Spatial operators
To calculate the various terms and perform the time-stepping, discrete difference and interpolation operators must be designed from which all the terms, such as momentum advection and Laplacian diffusion, may be constructed. Much of the material in this section is derived from Marshall et al. (1997).
Differences
Difference operators act as the discrete form of the derivative operator. Care must be taken when calculating differences on a staggered grid. For example, the the difference of a cell-centered variable such as temperature
where the
Additionally, two
and another for taking the difference of a face-centered variable and projecting it onto the cell centers
The three superscript characters indicate the cell location of the output in the
Interpolation
In order to add or multiply variables that are defined at different points they are interpolated. In our case, linear interpolation or averaging is employed. Once again, there are two averaging operators, one for each direction,
Additionally, three averaging operators must be defined for each direction. One for taking the average of a cell-centered variable and projecting it onto the cell faces
and another for taking the average of a face-centered variable and projecting it onto the cell centers
Divergence and flux divergence
The divergence of the flux of a cell-centered quantity over the cell can be calculated as
where
A similar divergence operator can be defined for a face-centered quantity. The divergence of, e.g., the flux of
where
Momentum advection
The advection terms that appear in model equations can be rewritten using the incompressibility (
which can then be discretized similarly to the flux divergence operator, however, they must be discretized differently for each direction.
For example, the
where
Discretization of isotropic diffusion operators
An isotropic viscosity operator acting on vertical momentum is discretized via
where
An isotropic diffusion operator acting on a tracer
Vertical integrals
Vertical integrals are converted into sums along each column. For example, the hydrostatic pressure anomaly is
where
where we converted the sum into a recursive definition for
The vertical velocity
to satisfy the incompressibility condition