  Several space missions that will use atomic clocks on board of an
Earth-orbiting satellite are planned for the near future, such as the Atomic
Clock Ensemble in Space (ACES) or the Space Optical Clock on the ISS (I-SOC).
The increasing accuracies of the developed clocks and of the links connecting
them with ground stations impose corresponding accuracy requirements for
theoretical models of electromagnetic signal propagation through the atmosphere
of Earth and for the related time and frequency transfer corrections. We
develop a relativistic model of one- and two-way time and frequency transfer.
In addition to the gravitational effects, it also includes the effects of
atmospheric refractivity and atmospheric flows within the relativistic
framework. The model is based on an analytical solution of the equation of
motion of a light ray in spacetime filled with a medium: the null geodesic
equation of Gordon's optical metric. Explicit formulas for one- and two-way
time and frequency transfer corrections are given using realistic fields of the
gravitational potential, the refractive index, and the wind speed, taking
nonstationarity and deviations from spherical symmetry into account. Numerical
examples are provided that focus on two-way ground-to-satellite transfer, with
satellite parameters similar to those of the ISS. The effect of the atmospheric
refractive index increases as the satellite position moves from zenith to
horizon, and it is shown that the effect ranges from 0 ps to 5 ps for two-way
time transfer and from $10^{-17}$ to $10^{-13}$ for two-way frequency transfer.
The effect of the wind contribution is well below 1 ps for the two-way time
transfer for normal atmospheric conditions, but for the two-way frequency
transfer, the effect can be significant: A contribution of $10^{-17}$ is
possible for a horizontal wind field with a velocity magnitude of about 11 m/s.
