You are on page 1of 6

NUMERICAL MODELS / Methods 1423

Testing Models Further Reading


Given the complexities of atmospheric chemistry, and Atkinson R, et al. (1997) IUPAC (International Union of
the many interactions with other processes, atmos- Pure and Applied Chemistry), Evaluated kinetic, photo-
pheric chemical models can be very large programs. chemical and heterogeneous data for atmospheric chem-
Much care is needed to write the code in a rigorous istry. 5. IUPAC Subcommittee on Gas Kinetic Data
Evaluation for Atmospheric Chemistry. Journal of
way to minimize the risk of errors. Generally the
Physical and Chemical Reference Data 26: 5211011.
program should make use of all of the options Brasseur G and Solomon S (1986) Aeronomy of the Middle
available in a particular language, and on a particular Atmosphere, 2nd edn. Dordrecht, Netherlands: D. Reidel
machine, to test for coding errors. When a model is Publishing.
running it is validated by comparison with observa- Brasseur GP, Orlando JJ and Tyndall GS (eds) (1999)
tions. Periodically different atmospheric models are Atmospheric Chemistry and Global Change. Oxford:
intercompared in international workshops to asses the Oxford University Press.
uncertainties in model calculations due to differences Jacobsen MZ (1999) Fundamentals of Atmospheric Mod-
in approach. eling. Cambridge: Cambridge University Press.
Park J, et al. (1999) Models and Measurements Intercom-
parison II. NASA Publication NASA/TM-1999-209554,
Langley Research Center, Hampton, VA.
Sander SP, et al. (2000) NASA/JPL, Chemical Kinetics and
See also Photochemical Data for Use in Stratospheric Modeling,
Chemistry of the Atmosphere: Chemical Kinetics; Gas Evaluation no. 13. JPL publication 00-003.
Phase Reactions. Cloud Chemistry. Deposition. WMO (1985) World Meteorological Organization, Atmos-
Numerical Models: Methods. Radiative Transfer: pheric Ozone. Global Ozone Research and Monitoring
Absorption and Thermal Emission. Stratospheric Project, Report No. 16, WMO, Geneva, CH 1211,
Chemistry and Composition: Overview. Geneva 20, Switzerland.

Methods
J Thuburn, University of Reading, Reading, UK using the available information to advance the solution
Copyright 2003 Elsevier Science Ltd. All Rights Reserved. to the next time level. On the other hand, an equation
describing a relationship among a number of variables
all at the same instant in time is called a diagnostic
The Need for Numerical Solutions equation. The ideal gas law is an example of a local
Only in a small number of special cases can exact diagnostic equation. Nonlocal diagnostic equations are
analytic solutions be found for the differential equa- also important; they are often boundary value problems
tions describing the uid dynamics, physics, and and often describe some kind of balance such as hydro-
chemistry of the atmosphere. In all other cases static balance or the relationship between quasi-geo-
solutions can be found only by approximating the strophic potential vorticity and streamfunction (see
differential equations by algebraic equations and then Dynamic Meteorology: Overview). They also arise in
nding specific numerical solutions to these algebraic connection with implicit time stepping schemes see
equations. Because of the vast amount of arithmetic below. Boundary value diagnostic equations require
involved, numerical solutions are virtually always different solution methods from prognostic equations
found with the aid of electronic computers. because the solution at any point in the domain depends
simultaneously on all of the boundary and forcing values.
The equations used to model the atmosphere are
Types of Equations nearly always a combination of prognostic and diag-
nostic, and so a corresponding combination of nu-
In broad terms, the method for nding a numerical
merical solution methods is used.
solution generally reects the type of equation being
solved, which in turn reects the nature of the physics
that the equation describes. For example, an equation Representation of Data; Resolution
describing how a variable evolves in time is called a
prognostic equation. A prognostic equation is solved by
and Aliasing
specifying the solution at some initial time, along with Fields like temperature and velocity are usually con-
appropriate boundary conditions, and then repeatedly sidered to exist throughout a continuous region of
1424 NUMERICAL MODELS / Methods

>

>
> >

Figure 1 Gridpoint representation of a simple function. Five data Figure 3 Finite element representation of a simple function. In
values are stored, indicated by the diamond symbols. this case the individual elements are witchs hats, which are
continuous, piecewise linear, and nonzero over only two cells. Five
data values are stored.
space and time and so contain, potentially, an innite
amount of information. For a numerical solution to be
obtained, these elds must be represented approxi-
In more than one dimension combinations of the
mately by a nite set of data values that can be stored in
above methods can be used, e.g., gridpoint in the
a computer. There are several possible ways to do this.
horizontal and nite element in the vertical, or spectral
 Gridpoint representation. In gridpoint methods a in the horizontal and gridpoint in the vertical.
eld is represented by its values at a nite set of The number of data values used to represent a eld
points called the grid or mesh points (Figure 1). denes the model resolution: a greater number of data
 Finite volume representation. Each value stored in values corresponds to higher resolution and means
the computer represents the value of a eld not at a that smaller-scale structures in the eld can be repre-
point but averaged over a nite volume or grid cell sented. Nevertheless, for any xed number of data
(Figure 2). values there will be some limiting scale below which
 Finite element representation. Each eld f is repre- structures cannot be represented. Structures on small-
sented as a series in terms of certain basis functions er scales than this will be misrepresented, or aliased, as
ci x (eqn [1]) and the coefcients f^ are stored in features of some other scale (Figure 5). Aliasing is an
i
the computer (Figure 3). important problem because, even if the initial data are
smooth, the nonlinearity of the equations describing
X
fx f^ c x 1 atmospheric dynamics tends to generate structure on
i i
i ever smaller scales, and eventually on scales that must
be aliased. This is one reason why models often include
Usually the ci are simple local functions that are some form of scale-selective dissipation to damp
piecewise constant or piecewise linear over a small poorly resolved near-grid-scale structure.
number of gird cells and zero elsewhere.
 Spectral representation. As for nite element meth-
>

ods, each eld is represented as a series in terms of


certain basis functions, but here the basis functions
are mutually orthogonal global functions. The
simplest example in one dimension is a Fourier
series representation in which the basis functions are
sines and cosines (Figure 4). For modeling the >
atmosphere on a spherical planet, a spectral method (A)
based on spherical harmonics is often used.
>
>

>
(B)
>

Figure 2 Finite volume representation of a simple function. Five Figure 4 (A) Fourier representation (dotted curve) of a simple
grid-cell-average values are stored, indicated by the histogram function (solid curve). The coefcients of ve Fourier components
values. are stored; those components are shown in (B).
NUMERICAL MODELS / Methods 1425

pendence of the truncation error on Dx determines


the order of accuracy of the approximation. Formula
[3] is said to be rst-order accurate, since the
truncation error decreases as fast as Dx to the power
one as Dx ! 0, while formula [4] is second-order
accurate. Higher-order approximations can be sys-
tematically constructed but lead to more complex
formulas.
Figure 5 Example of aliasing. A wavenumber 7 Fourier compo-
nent sampled by only 6 data points appears the same as a
wavenumber 1 Fourier component. Local Truncation Error, and
Consistency
Roundoff Error and Truncation Error The local truncation error is the residual left over when
the true solution is substituted into the nite difference
Numerical solutions are subject to roundoff error and version of an equation. It is a measure of how well the
truncation error. Roundoff error arises because of the difference equation approximates the differential
nite number of digits, and hence limited precision, equation locally, and is closely related to the trunca-
used to store numbers in a computer. On a typical tion error discussed above. For example, consider the
workstation using standard precision the roundoff linear advection eqn [5] (v a constant).
error is about 73 in the eighth decimal digit. For most
purposes this error is so small as to be insignificant. qf qf
However, the effects of roundoff error can be greatly v 0 5
qt qx
amplied in certain calculations for example, when
adding small numbers to large ones or when taking When this is approximated by eqn [6], where fnj means
differences of nearly equal numbers. the numerical solution for f at the point jDx and time
Truncation errors are those that arise through nDt, j and n integers, then the local truncation error is
approximating a continuous eld by a nite set of ODt ODx.
data values and through approximating derivatives or
integrals by algebraic operations such as differences or fn1
j  fnj fnj  fnj1
v 0 6
sums. They are a function of the resolution of the Dt Dx
model, and are usually much more significant than
roundoff errors. A difference scheme is said to be consistent if the
local truncation error tends to zero as Dt ! 0 and
Dx ! 0.
Taylor Series, Approximation
of Derivatives
Convergence, Stability
For gridpoint methods, derivatives are approximated
A scheme is said to be convergent if the nite difference
by nite differences. The approximations are derived
solution approaches the true solution as Dt ! 0 and
from Taylor series. For example, if the grid spacing is
Dx ! 0. Consistency is not sufcient to ensure con-
Dx then eqn [2] leads to eqn [3].
vergence. For example, a scheme might be consistent
qf q2 f Dx2 but fail to converge because it is unstable. There are
fx Dx fx Dx 2 ODx3 2 several slightly different definitions of stability.
qx qx 2
For most practical purposes a useful definition is
that a scheme is unstable if it produces numerical
qf fx Dx  fx solutions that grow much more rapidly than the true
ODx 3
qx Dx solution.
For example, by investigating the behavior of a trial
Combination of eqn [2] with the corresponding
solution of the form fnj An eikjDx with A a complex
formula for fx  Dx leads to eqn [4].
constant (a technique called von Neumann stability
qf fx Dx  fx  Dx analysis), it can be shown that scheme [6] is stable if
ODx2 4 and only if 0  v Dt=Dx  1. Thus, although the
qx 2Dx
scheme is consistent, the numerical solution will not
The difference between the exact derivative and the approach the true solution as Dt ! 0 and Dx ! 0
approximation is the truncation error, and the de- unless vDt=Dx lies within this range.
1426 NUMERICAL MODELS / Methods

A-grid B-grid approach will typically lead to a set of simultaneous


equations involving df ^ =dt multiplied by a sparse
i
u, v, T u, v, T T T matrix called the mass matrix. Once these are
solved for df ^ =dt, f ^ may be stepped forward in
i i
time, for example, using a temporal nite difference
u, v
formula.
Perhaps because of the need to solve simultaneous
u, v, T u, v, T T T equations to nd df ^ =dt, nite element methods have
i
been used relatively little to date for modeling the
atmosphere. For spectral methods, on the other hand,
because the basis functions are mutually orthogonal,
C-grid D-grid the mass matrix is diagonal and therefore trivial to
invert.
T u T T v T Several terms in the model equations would be
difcult or expensive to evaluate directly in terms of
u u the spectral coefcients f ^ . In practice it is simpler and
v v i
more efcient to transform the model elds to a
gridpoint representation fj , to evaluate those terms,
T u T T v T
and then to transform the result back into the spectral
representation. The transforms can be carried out
efciently with the aid of a fast Fourier transform
E-grid algorithm. This method is called the spectral trans-
form method. The advantages of spectral methods,
u, v T u, v including their high intrinsic accuracy and their
facilitation of the solution of elliptic problems see
below has made the spectral transform method very
T u, v T
important in global weather prediction and climate
models.
u, v T u, v

Figure 6 The arrangement of variables on the ve staggered The CFL Criterion


grids analysed by Arakawa.
According to the CourantFriedrichsLewy (CFL)
criterion, a necessary condition for the stability of a
numerical scheme for a hyperbolic equation is that the
Staggered Grids domain of dependence of the numerical solution at any
The accuracy of some gridpoint methods can be point (jDx; nDt) should include the domain of de-
improved by storing different variables, such as the pendence of the true solution at the same point. For
different wind components and temperature, on dif- example, for the scheme [6] the numerical domain of
ferent grids that are staggered with respect to each dependence of fnj consists of the points j  1Dx and
other in space. The best-known are the ve grids, jDx at time n  1Dt. Since, for the true solution of the
known as the A-grid, B-grid, etc., that were classied linear advection equation, information propagates at
and analysed by Arakawa (Figure 6). It is also possible velocity v, the domain of dependence of the true
to store elds in a way that is staggered in time, or both solution consists of the single point jDx  vDt at time
space and time, but this is rarely used. n  1Dt. In this case the numerical domain of
dependence contains the true domain of dependence
if and only if 0  vDt=Dx  1. In general, satisfac-
tion of the CFL criterion is necessary but not sufcient
Finite Element and Spectral Methods
to guarantee stability, though in the example just given
For nite element and spectral methods the object is to it turns out to be sufcient too.
determine how the coefcients f ^ evolve in time. One The quantity vDt=Dx is called the Courant
i
way to do this is to require that the residual, which is number. An analogous quantity can be dened for
the amount left over when the approximate solution other equations with wavelike solutions, e.g. gravity
[1] is substituted into the original equation, be waves, with v replaced by the speed of the equations
orthogonal to each of the basis functions. This characteristics. Many schemes are stable only for a
NUMERICAL MODELS / Methods 1427

limited range of Courant numbers, so that at any given Implicit Time Stepping and
model resolution it is important to use a time step Semi-Implicit Time Stepping
small enough to ensure stability; this, of course, affects
the overall cost of the model. Consider the following two schemes (eqns [9] and
[10]) for time discretization of the equation
qf=qt Rf.
Semi-Lagrangian Advection
fn1  fn1
Semi-Lagrangian schemes are a way of modeling the Rfn 9
2Dt
advection terms in uid dynamical equations while
satisfying the CFL criterion and ensuring stability
without any restriction on the time step. By removing fn1  fn 1   
Rfn R fn1 10
one of the major constraints on the time step, they Dt 2
allow models to be run more cheaply, and as a result Scheme [9] is an example of an explicit scheme;
they are now widely used. fn1 is given explicitly in terms of known quan-
An equation of the form Df=Dt S, where S tities fn1 and fn . Scheme [10], on the other
represents all terms other than the advection term, is hand, is an example of an implicit scheme; fn1
typically discretized along an air parcel trajectory appears on both sides of the equation, making it
starting from some departure point xd at time nDt and more difcult to solve. The advantage of scheme
arriving at a grid point xj at time n 1Dt as in eqn [7] [10] is that it is stable for any size of time step and
(Figure 7). any reasonable R, whereas scheme [9] is stable only
for a limited range of time steps and for certain
fn1  fnd forms of R.

j
S 7
Dt Implicit time schemes are often used for modeling
atmospheric chemistry, where short reaction time
Here  S is some estimate of S averaged along the scales would require very short time steps for
trajectory, fn1
j is the value of f at xj and time stability if an explicit time scheme were used. Implicit
n 1Dt, and fnd is the value of f at xd and time nDt. schemes are also often used in atmospheric models
In general xd will not coincide with a model grid point to model the gravity wave terms, and, if the hydro-
so that the value fnd must be found by interpolation. static approximation is not made, the acoustic wave
Cubic interpolation is typically used. terms. Acoustic and gravity waves are the highest-
The departure point xd is given implicitly by eqn [8], frequency signals in the atmosphere and would
where v is an estimate of the average velocity along the strongly constrain the time step if explicit time
trajectory, e.g., v vn1
j vnd =2. Equation [8] is schemes were used. One effect of implicit time schemes
implicit because  v depends on xd ; when large time steps are used is articially to slow the
xj  xd highest-frequency waves. This is usually considered

v 8 acceptable, since acoustic and gravity waves are not
Dt
the most significant meterological features on synoptic
it is solved iteratively using typically two or three scales.
iterations, with vnd estimated by linear interpolation at Because the equations describing the atmosphere
each iteration. are nonlinear, an implicit discretization in the form
[10] would be difcult and expensive to solve for fn1.
Instead a semi-implicit discretization is usually used
(eqn [11]).
n +2
fn1  fn 1
Lfn Lfn1 
n +1 Dt 2
n
xd Rfn1=2  Lfn1=2 11
n1
Here L is an approximation to R (or to that part of R
j4 j3 j2 j1 j j +1 describing gravity waves) obtained by linearizing
about a suitable reference state, usually a stratied
Figure 7 Schematic showing how a semi-Lagrangian advection
scheme can carry information along an air parcel trajectory from the atmosphere at rest, and fn1=2 is an estimate of f
departure point xd at time nDt to the arrival grid point xj at time at time n 1=2Dt obtained, for example, by
n 1Dt. extrapolating from times n  1Dt and nDt. This
1428 NUMERICAL MODELS / Methods

leads to a much simpler, linear problem for fn1 were used and the basis functions could be chosen to be
(eqn [12]). eigenfunctions of the Helmholtz operator, then M
would be diagonal and the solution would be trivial. In
Dt
fn1  Lfn1 known terms 12 practice it is possible to choose the basis functions to be
2 eigenfunctions of the horizontal part of the Helmholtz
Equation [12] is usually of a form similar to eqn operator, e.g. spherical harmonics in spherical geo-
[13] for some coefcients n, known as a Helmholtz metry. Then eqn [14] separates into a number of much
equation. smaller problems whose matrices correspond to the
vertical part of the Helmholtz operator; these can be
fn1  nr2 fn1 known terms 13 solved by direct matrix inversion.
If a spectral representation is not used then eqn [14]
Thus, an elliptic problem with suitable boundary
is usually solved iteratively. One set of methods
conditions must be solved to determine fn1 .
involves relaxation of an approximate solution to
The combination of a semi-Lagrangian treatment of
obtain a better approximation at each iteration. The
advection terms with a semi-implicit treatment of
convergence of the iteration procedure can be greatly
gravity waves and acoustic waves removes most of the
accelerated by carrying out some iterations on coarser
stability constraints on the time step size, allowing the
grids than that on which the nal solution is required;
time step to be chosen on the basis of accuracy rather
this is a multigrid method. Another iterative method
than stability considerations, and thus making models
involves reformulating eqn [14] as a minimization
more efcient. For this reason, models based on semi-
problem and then solving it using a minimization
implicit semi-Lagrangian schemes have become
algorithm such as the conjugate gradient algorithm.
widely used.

Elliptic Equations See also


Dynamic Meteorology: Overview. Middle Atmos-
Elliptic problems arise in atmospheric models when
phere: Gravity Waves. Numerical Models: Chemistry
some form of balance is assumed, e.g., when deter- Models. Weather Prediction: Ensemble Prediction;
mining the streamfunction from the quasigeostrophic Seasonal and Interannual Weather Prediction.
potential vorticity, or when a semi-implicit time
scheme gives rise to a Helmholtz equation. They also
arise when vorticity and divergence are predicted Further Reading
variables and it is necessary to derive the wind velocity Durran DR (1999) Numerical Methods for Wave Equations
from these elds via a streamfunction and velocity in Geophysical Fluid Dynamics. New York: Springer-
potential. Verlag.
Discretization in space of an elliptic problem like Haltiner JG and Williams RT (1980) Numerical Prediction
eqn [13] leads to an equation of the form [14], where and Dynamic Meteorology. Chichester: Wiley.
M is a sparse matrix. LeVeque RJ (1992) Numerical Methods for Conservation
Laws. Basel: Birkhauser.
Mfn1 known terms 14 Pielke RA (1984) Mesoscale Meteorological Modeling.
London: Academic Press.
Direct inversion of the matrix M is usually prohibi- Press WH, Teukolsky SA, Vetterling WT and Flannery BP
tively expensive for three-dimensional problems. (1992) Numerical Recipes in FORTRAN 77: The Art of
However, there are several other possible approaches Scientific Computing, 2nd edn. Cambridge: Cambridge
to solving eqn [14]. If a spectral representation of f University Press.

You might also like