  We study the d-wave holographic superconductors (the d-wave model proposed in
[arXiv:1003.2991[hep-th]]) immersed in constant external magnetic fields by
using the analytic matching method and numerical computation. In the probe
limit, we calculate the spatially dependent condensate solution in the presence
of the magnetism and find that the expression for the upper critical magnetic
field satisfies the relation given in the Ginzburg-Landau theory. The result
shows that the upper critical field gradually increases to its maximum value
$B_{c2}$ at absolute zero temperature T=0, while vanishing at the critical
temperature $T=T_c$. Moving away from the probe limit, we investigate the
effect of spacetime backreaction on the critical temperature and the upper
critical magnetic field. The magnetic fields as well as the electric fields
acting as gravitational sources reduce the critical temperature of the
superconductor and actually result in a dyonic black hole solution to the
leading order. We obtain the expression for the upper critical magnetic field
up to $\mathcal{O}(\kappa^2)$ order. The analytic result is consistent with the
numerical findings.
