\chapter{Description of the atmosphere}
 \label{sec:atmosphere}

\starthistory
 110610 & Revised by Patrick Eriksson.\\ 
 020315 & First version by Patrick Eriksson.\\
\stophistory

\graphicspath{{Figs/atmosphere/}}

This section discusses the model atmosphere: how it is defined, its boundaries
and the variables describing the basic properties. One aspect that can cause
confusion is that several vertical coordinates must be used
(Section~\ref{sec:fm_defs:altitudes}). The main vertical coordinate is pressure
and atmospheric quantities are defined as a function of pressure
(Section~\ref{sec:fm_defs:grids}), but the effective vertical coordinate from a
geometrical perspective (such as the determination of propagation paths) is the
radius (Section~\ref{sec:fm_defs:atmdim}). Pressures and radii are linked by
specifying the geometrical altitudes (\builtindoc{z\_field}).


\section{Altitude coordinates}
%===================
\label{sec:fm_defs:altitudes}

\begin{description}
  
\item[Pressure\index{pressure}] The main altitude coordinate is
  pressure. This is most clearly manifested by the fact that the
  vertical atmospheric grid consists of levels with equal pressure.
  The vertical grid is consistently denoted as the pressure grid and
  the corresponding workspace variable is \wsvindex{p\_grid}. The
  choice of having pressure as main altitude coordinate results in
  that atmospheric quantities are retrieved as a function of pressure,
  not as a function of geometrical altitude.
  
\item[Pressure altitude\index{pressure altitude}] A basic assumption
  in ARTS is that atmospheric quantities (temperature, geometric
  altitude, species VMR etc.) vary linearly with the logarithm of the
  pressure. This corresponds roughly to assuming a linear variation
  with altitude. 

\item[Radius\index{radius}] Geometrical altitudes are
  needed to determine the propagation path through the atmosphere etc.
  The main geometrical altitude coordinate is the distance to the
  centre of the coordinate system used, the radius. This is a natural
  consequence of using a spherical or polar coordinate system. The
  radius is used inside ARTS for all geometrical calculations and to
  store the position of the sensor (Section 
  \ref{sec:fm_defs:sensor1}).
  
\item[Geometrical altitude\index{geometrical altitude}] The term geometrical
  altitude signifies here the difference in radius between a point and the
  geoid (Section \ref{sec:fm_defs:geoid}) along the vector to the centre of the
  coordinate system (Equation \ref{eq:fm_defs:zsurface}). This is consistent
  with the usage of geocentric latitudes (see below). Hence, the altitude is
  not measured along the local zenith direction.
\end{description}



\section{Atmospheric dimensionality}
%===================
\label{sec:fm_defs:atmdim}

The structure of the modelled atmosphere can be selected to have different
degree of complexity, the \textindex{atmospheric dimensionality}. There exist
three levels for the complexity of the atmosphere, 1D, 2D and 3D, where 1D and
2D can be seen as special cases of 3D. The significance of these different
atmospheric dimensionalities and the geometrical coordinate systems used
are described below in this section. The atmospheric dimensionality is selected
by setting the workspace variable \wsvindex{atmosphere\_dim} to a value between
1 and 3. The atmospheric dimensionality is most easily set by the functions
\wsmindex{AtmosphereSet1D}, \wsmindex{AtmosphereSet2D} and
\wsmindex{AtmosphereSet3D}.

\begin{figure}
 \begin{center}
  \includegraphics*[width=0.98\hsize]{atm_dim_1d}
  \caption{Schematic of a 1D atmosphere. The atmosphere is 
    here spherically symmetric. This means that the radius of the
    geoid, the surface and all the pressure levels are constant
    around the globe. The fields are specified by a value for each
    pressure level. The extension of the cloud box is either from
    the surface up to a pressure level, or between two pressure
    levels (which is the case shown in the figure). The figure shows
    further that the surface must be above the lowermost pressure
    level.}
  \label{fig:fm_defs:1d}  
 \end{center}
\end{figure}
% This figure was produced by the Matlab function mkfigs_atm_dims.

\begin{figure}
 \begin{center}
  \includegraphics*[width=0.98\hsize]{atm_dim_2d}
  \caption{Schematic of a 2D atmosphere. The radii (for the geoid, the surface
    and the pressure levels) vary here linear between the latitude
    grid points. The atmospheric fields vary linearly along the
    pressure levels and the latitude grid points (that is, along the
    dotted lines). Inside the grid cells, the fields have a bi-linear
    variation. No cloud box is included in this figure.}
  \label{fig:fm_defs:2d}
 \end{center}
\end{figure}
% This figure was produced by the Matlab function mkfigs_atm_dims.

\begin{description}
  
\item[\textindex{3D}\,\,\,] In this, the most general, case, the
  atmospheric fields vary in all three spatial coordinates, as in a
  true atmosphere (Figures \ref{fig:fm_defs:3d} and
  \ref{fig:fm_defs:3dcross}). A \textindex{spherical coordinate
    system} is used where the dimensions are radius (\Rds), latitude
  (\Lat) and longitude (\Lon), and a position is given as
  $(\Rds,\Lat,\Lon)$. With other words, the standard way to specify a
  geographical position is followed.  However, the way to specify the
  radial position differs depending on the context, which is described
  in Section \ref{sec:fm_defs:altitudes}. The valid range for
  latitudes is $[-90\degree,+90\degree]$, where +90\degree corresponds
  to the North pole etc. Longitudes are counted from the Greenwich
  meridian with positive values towards the east. Longitudes can have
  values from -360\degree to +360\degree. When the difference between
  the last and first value of the longitude grid is $\geq 360\degree$
  then the whole globe is considered to be covered. The user must
  ensure that the atmospheric fields for \Lon\ and $\Lon+360\degree$
  are equal. If a point of propagation path is found to be outside the
  range of the longitude grid, this will results in an error if not
  the whole globe is covered. When possible, the longitude is shifted with
  360\degree\ in the relevant direction.
  
\item[\textindex{1D}\,\,\,] A 1D atmosphere can be described as being
  spherically symmetric (Figure \ref{fig:fm_defs:1d}). The term 1D is
  used here for simplicity and historical reasons, not because it is a
  true 1D case (a strictly 1D atmosphere would just extend along a
  line). A spherical symmetry means that atmospheric fields and the
  surface extend in all three dimensions, but they have no latitude
  and longitude variation. This means that, for example, atmospheric
  fields vary only as a function of altitude and the surface
  constitutes the surface of a sphere. The radial coordinate is
  accordingly sufficient when dealing with atmospheric quantities, but
  the angular distance between the sensor and a point along the
  propagation path can be of interest, for example when determining
  the cross-link between two satellites. This distance is tracked, 
  basically using the 2D view (see below) with the sensor
  position set to be the zero point for the latitudes. A 1D
  atmosphere is shown in Figure \ref{fig:fm_defs:1d}.
  
\item[\textindex{2D}\,\,\,] In contrast to the 1D and 3D cases, a 2D atmosphere
  is strictly defined only inside a plane (Figure \ref{fig:fm_defs:2d}). A
  spherical coordinate system is accordingly not needed and a polar
  system\index{polar coordinate system}, consisting of a radial and an angular
  coordinate, is used. The 2D case is most likely used for satellite
  measurements where the atmosphere is observed inside the orbit plane. The
  angular coordinate corresponds then to the angular distance along the
  satellite track, but the coordinate is for simplicity denoted as the
  latitude. The zero point for the 2D latitude is arbitrary. No lower and upper
  limit exists for the 2D latitude, and this allows that measurements from
  several subsequent orbits can be simulated as one unit. The atmosphere is
  normally treated to be undefined outside the considered plane, but some
  scattering calculations treat the surrounding atmosphere in an simplified
  manner [FIXME: Add reference to FOS, when chapyer exists.]. A 2D atmosphere
  is shown in Figure \ref{fig:fm_defs:2d}.

\end{description}

\begin{figure}[p]
 \begin{center}
  \includegraphics*[angle=-90,width=0.98\hsize]{atm_dim_3d}
  \vspace*{-15mm}
  \caption{Schematic of a 3D atmosphere. Plotting symbols as in 
    Figure \ref{fig:fm_defs:2d}. Radii and fields are here defined to
    vary linearly along the latitude and longitude grid points. This
    means that the radius of a pressure level has a
    bi-linear variation inside the area limited by two latitude and
    longitude grid values, while the atmospheric fields have a
    tri-linear variation inside the grid cells. }
  \label{fig:fm_defs:3d}
 \end{center}
\end{figure}
% This figure was produced by the Matlab function mkfigs_atm_dims.

\begin{figure}[p]
 \begin{center}
  \includegraphics*[width=0.98\hsize]{atm_dim_3dcross}
  \caption{A latitudinal, or longitudinal, cross section of a 3D atmosphere. 
    Plotting symbols as in Figure \ref{fig:fm_defs:1d}. Radii and
    fields inside the cross section match the definitions for 2D.
    The vertical extension
    of the cloud box is defined identical for 1D and 3D. The horizontal 
    extension of the cloud box is between two latitude and longitude grid
    positions, where only one of the dimensions is visible in this figure.}
  \label{fig:fm_defs:3dcross}
 \end{center}
\end{figure}
% This figure was produced by the Matlab function mkfigs_atm_dims.



\section{Atmospheric grids and fields}
%===================
\label{sec:fm_defs:grids}

As mentioned above, the vertical grid of the atmosphere consists of a
set of layers with equal pressure, the pressure grid
(\wsvindex{p\_grid}).  This grid must of course always be specified.
The upper end of the pressure grid gives the practical upper limit of
the atmosphere as vacuum is assumed above. With other words, no
absorption and refraction take place above the uppermost pressure
level.

A \textindex{latitude} grid (\wsvindex{lat\_grid}) must be specified
for 2D and 3D.  For 2D, the latitudes shall be treated as the angular
distance along the orbit track, as described above in
Section \ref{sec:fm_defs:atmdim}.  The latitude angle is throughout
calculated for the vector going from the centre of the coordinate
system to the point of concern. Hence, the latitudes here correspond
to the definition of the geocentric latitude, and not geodetic
latitudes (see Section \ref{sec:ppath:geoid}). This is in accordance
to the definition of geometric altitudes above. For 3D, a
\textindex{longitude} grid (\wsvindex{lon\_grid}) must also be specified.
Valid ranges for latitude and longitude values are given in
Section \ref{sec:fm_defs:atmdim}.

The atmosphere is treated to be undefined outside the latitude and
longitude ranges covered by the grids, if not the whole globe is
covered. This results in that a propagation path is not allowed to
cross a latitude or longitude end face of the atmosphere, if such
exists, it can only enter or leave the atmosphere through the top of
the atmosphere (the uppermost pressure level). See further
Section \ref{sec:fm_defs:ppaths}. The volume (or area for 2D) covered
by the grids is denoted as the \textindex{model atmosphere}.

If the longitude and latitude grids are not used for the selected atmospheric
dimensionality, then the longitude grid (for 1D and 2D) and the latitude grid
(for 1D) can normally be set to be empty, but some methods require a scalar
latitude and longitude. 

The basic atmospheric quantities are represented by their values at each
crossing of the involved grids (indicated by thick dots in Figures
\ref{fig:fm_defs:1d}--\ref{fig:fm_defs:3dcross}), or for 1D at each pressure
level (thick dots in Figure \ref{fig:fm_defs:1d}). This representation is
denoted as the field\index{atmospheric field} of the quantity. The field must,
at least, be specified for the geometric altitude of the pressure levels
(\wsvindex{z\_field}), the temperature (\wsvindex{t\_field}) and considered
atmospheric species (\builtindoc{vmr\_field}). The fields are assumed to be
piece-wise linear functions vertically (with pressure altitude as the vertical
coordinate, Section \ref{sec:fm_defs:altitudes}), and along the latitude and
longitude edges of 2D and 3D grid boxes. For points inside 2D and 3D grid
boxes, multidimensional linear interpolation is applied (that is, bi-linear
interpolation for 2D etc.). Note especially that this is also valid for the
field of geometrical altitudes (\builtindoc{z\_field}). Fields are rank-3
tensors. For example, the temperature field is $T=T(\Prs,\Lat,\Lon)$. That
means each field is like a book, with one page for each pressure grid point,
one row for each latitude grid point, and one column for each longitude grid
point. In the 1D case there is just one row and one column on each page. The
representation of atmospheric fields, and other quantities, is discussed
further in Sec.~\ref{sec:wfuns:basis}, where the concept of basis
functions\index{basis function} is introduced. In short, the basis functions
give the mapping from the set of discrete values to the continous
representation of the quantity.



\section{Hydrostatic equilibrium}
%===================
\label{sec:fm_defs:hse}

There is no general demand that the model atmosphere fulfils hydrostatic
equilibrium. That is, \builtindoc{t\_field} and \builtindoc{z\_field} can be
specified independently of each other. On the other hand, ARTS provides means
for ensuring that a model atmosphere matches hydrostatic equilibrium by the
method \wsmindex{z\_fieldFromHSE}. This method is presently valid only for the
planet Earth, but considers that gravitation varies with latitude and altitude.

Hydrostatic equilibrium gives only constrain for the distance between the
pressure levels, not for the absolute geometrical altitudes. For this reason, a
``reference point'' must be introduced. This is done by setting the pressure of
this point by \wsvindex{p\_hse} (common for all latitude and longitudes). The
geometrical altitudes matching \builtindoc{p\_hse} are taken from the original
values in \wsvindex{z\_field}. 


\section{The geoid and surface}
%===================
\label{sec:fm_defs:surf}

Geometrical altitudes are specified as the vertical distance to a reference
geoid. The geoid is defined by giving the radius for each latitude and
longitude grid point. Accordingly, this is a matrix, named as
\wsvindex{r\_geoid}. For 1D atmosphere, this matrix has the size $[1,1]$.
See further Section \ref{sec:fm_defs:geoid}.

The lower boundary of the atmosphere is denoted as the surface. The surface is
specified by its geometrical altitude on the latitude and longitude grids.
The workspace variable holding these data is called \wsvindex{z\_surface}, and
is a matrix of same size as \builtindoc{r\_geoid}.

It is not allowed that there is an altitude gap between the surface and
the lowermost pressure level.  That is, the surface pressure must be
smaller than the pressure of the lowermost vertical grid level. On
the other hand, it is not necessary to match the surface and the first
pressure level, the pressure grid can extend below the surface level.


\section{The cloud box}
%===================
\label{sec:fm_defs:cloudbox}
In order to save computational time, calculations involving scattering and
polarised gas absorption are limited to a special atmospheric domain. This
atmospheric region is denoted as the \textindex{cloud box}, reflecting that it
was introduced primarily to simplify scattering calculations. The cloud box is
discussed here as it acts as an additional atmospheric limit when calculating
propagation paths (see Section \ref{sec:fm_defs:rte}).

The cloud box is defined to be rectangular in the used coordinate
system, with limits exactly at points of the involved grids. This
means, for example, that the vertical limits of the cloud box are two
pressure levels. For 3D, the horizontal extension of the cloud box
is between two points of the latitude grid and likewise in the
longitude direction (Figure \ref{fig:fm_defs:3dcross}). The latitude
and longitude limits for the cloud box cannot be placed at the end
points of the corresponding grid as it must be possible to calculate
the incoming intensity field. The cloud box is activated by setting
the variable \wsvindex{cloudbox\_on} to 1.  The limits of the cloud
box are stored in \wsvindex{cloudbox\_limits}.  It is recommended to
use the method \wsmindex{CloudboxOff} when no scattering calculations
shall be performed. This method assigns dummy values to all workspace
variables not needed when scattering is neglected.

When the radiation entering the cloud box is calculated this is done
with the cloud box turned off. This to avoid to end up in the
situation that the radiation entering the cloud box depends on the
radiation coming out from the cloud box. {\bf It is the task of the
  user to define the cloud box in such way that the link between the
  outgoing and ingoing radiation fields of the cloud box can be
  neglected}. The main point to consider here is radiation reflected
by the surface. To be formally correct there should never be a gap
between the surface and the cloud box. This is the case as radiation
leaving the cloud box can then be reflected back into the cloud box by
the surface. If it is considered that the surface is a scattering object
it is clear that the surface should in general be part of the cloud
box. However, for many cases it can be accepted to have a gap between
the surface and the cloud box, with the gain that the cloud box can be
made smaller. Such a case is when the surface is treated to act as
blackbody, the surface is then not reflecting any radiation.
Reflections from the surface can also be neglected if the zenith
optical thickness of the atmosphere between the surface and cloud box
is sufficiently high.


%%% Local Variables: 
%%% mode: latex
%%% TeX-master: "uguide"
%%% End: 
