  YBa$_2$Cu$_3$O$_7$ (YBCO) exhibits a large anisotropy between the $a$ and $b$
axes in the CuO$_2$ planes because of the presence of CuO chains. In order to
account for such an anisotropy we develop a Ginzburg-Landau (GL) theory for an
anisotropic d-wave superconductor in an external magnetic field, based on an
anisotropic effective mass approximation within CuO$_2$ planes. The anisotropic
parameter $\lambda=m_x/m_y$, where $m_x$ ($m_y$) is the effective mass in the
$x$ ($y$) direction, is found to have significant physical consequences: In the
bulk case, there exist both the $s$- and $d$-wave order parameters with the
same transition temperature, as long as $\lambda\ne 1$. The GL equations are
also solved both analytically and numerically for the vortex state, and it is
shown that both the $s$- and $d$-wave components show a two-fold symmetry, in
contrast to the four-fold symmetry around the vortex, as expected for the
purely $d$-wave vortex. With the deviation of $\lambda$ from unity, the
opposite winding between the $s$- and $d$-wave components observed in the
purely $d$-wave case is gradually taken over by the same winding number. The
vortex lattice is found to have oblique structure in a wide temperature range
with the precise shape depending on the anisotropy.
