  We apply the Lagrange-mesh $R$-matrix method to calculate the $S$-factor for
the $^{13}$C$(p,\gamma)^{14}$N and $^{16}$O$(p,\gamma)^{17}$F direct radiative
capture reactions. By comparing the astrophysical $S$-factors calculated with
nonlocal and local potentials, we investigate the nonlocality effects coming
from the nuclear potentials in the direct capture reactions. Our calculations
are in good agreement with the experimental data and indicate a nonnegligible
difference in the results of local and nonlocal potentials. The use of small
diffuseness narrow potentials also provides a remarkably good fit in the case
with multiple broad resonances. Our findings suggest that the nonlocal
potential improves the calculated results although the difference between the
local and nonlocal potentials is smaller than uncertainties from other sources.
We propose the nonlocality potential should be used in the potential model
calculation of future astrophysics rates evaluation.
