Ginzburg-Landau equations for a d-wave superconductor with applications to vortex structure and surface problems.