  We perform a nonperturbative determination of the $O(a)$-improvement
coefficient $c_{\rm SW}$ and the critical hopping parameter $\kappa_c$ for
$N_f$=3, 2, 0 flavor QCD with the RG-improved gauge action using the
Schr\"odinger functional method. In order to interpolate $c_{\rm SW}$ and
$\kappa_c$ as a function of the bare coupling, a wide range of $\beta$ from the
weak coupling region to the moderately strong coupling points used in
large-scale simulations is studied. Corrections at finite lattice size of
$O(a/L)$ turned out to be large for the RG-improved gauge action, and hence we
make the determination at a size fixed in physical units using a modified
improvement condition. This enables us to avoid $O(a)$ scaling violations which
would remain in physical observables if $c_{\rm SW}$ determined for a fixed
lattice size $L/a$ is used in numerical simulations.
