This article presents new software for the analysis of global dynamical fields in (re)analyses, weather forecasts and climate models. A new diagnostic tool, developed within the MODES project, allows one to diagnose properties of balanced and inertio-gravity (IG) circulations across many scales. In particular, the IG spectrum, which has only recently become observable, can be studied simultaneously in the mass and wind fields while considering the whole model depth in contrast to the majority of studies.

The paper includes the theory of normal-mode function (NMF) expansion, technical details of the Fortran 90
code, examples of

The presented application of the software to the ERA Interim data set reveals several aspects of
the large-scale circulation after it has been partitioned into the linearly balanced and IG components.
The global energy distribution is dominated by the balanced energy while the IG
modes contribute around 10

Spherical harmonics have been used extensively for representing many
geophysical quantities over the globe. They are useful for the decomposition
of global circulation data because they are eigensolutions of the global
barotropic vorticity equation involving the Laplace operator on the sphere.
Furthermore, spherical harmonics are used as basis functions for the
numerical discretization of dynamical terms of the global prognostic
equations for numerical weather prediction (NWP) in some of the major global
NWP models (e.g. ECMWF). A scale-dependent distribution of atmospheric
kinetic energy at a given horizontal level is readily produced from spherical
harmonics as a function of the global wave number

It is however often more desirable to represent flow patterns not only of the horizontal velocity components but also of the associated mass-field variables as functions of longitude, latitude and height. Our picture of the atmosphere is that of a vibrating system with many modes of oscillations, like a musical instrument. Hence, it is desirable to have some vector functions to represent simultaneously both the wind field and the mass field corresponding to the various modes. Such modes are provided by the eigensolutions of the primitive equations linearized around a simple reference state of rest, and they are known as normal modes.

It is the objective of this article to present the development and application of a software package
that applies 3-D vector harmonic functions based on the natural modes of oscillations for representing global
circulation patterns in terms of a single expansion series.
The development of 3-D vector functions is based on the theoretical work by

The derivation of NMFs by

A more extensive work based on the application of NMFs has been carried out in the pressure system.

The most important application of normal modes in NWP research has been the
initialization of operational forecast models, known as non-linear
normal-mode initialization (NNMI)

The global horizontal structures of normal modes, known as Hough functions,
have been used to analyze atmospheric variability

A separation of non-linear atmospheric motions into the high-frequency
IG and low-frequency balanced motions is possible only if the
simplification of linearized equations around some specific resting
background state is introduced. Furthermore, the vertical part of solutions
can be obtained analytically only for some special cases such as the
isothermal atmosphere

The 3-D orthogonality of normal modes allowed

In relation to a more reliable representation of physical processes in later analyses, especially convection,
and the associated divergent circulation,

The following presents details of the software for NMF analysis and describes
the sequence of steps applied to generate a picture of the unbalanced
component of global circulation. The application of the software is
controlled through Fortran

The paper is structured as follows:
the next section presents the theory of normal modes as an updated extended summary of the article
by

The derivation of 3-D normal modes presented in this section follows KP1981, although the notation is somewhat different. The reader is also referred to several other cited papers for any missing details.

As a model of the atmosphere, we deal with the traditional hydrostatic baroclinic primitive equation
system on a sphere, customarily adopted for NWP

Although the atmospheric model is non-linear, we are interested in small-amplitude motions around the
basic state of an atmosphere at rest. Therefore, we can deal with a linearized adiabatic and inviscid version of the model.
Solutions of such a system with appropriate boundary conditions are referred to as normal modes

A new geopotential variable introduced by KP1981 accounts for the fact that the surface
pressure

The system of linearized equations describing oscillations

Here,

The static stability parameter

As inferred from the work of

Two systems of equations governing three-dimensional motions are connected by
particular values of a separation parameter

We first discuss the vertical structure functions

The vertical structure function

Solutions of the VSE are sought under the boundary conditions that no mass transport takes place through
the Earth's surface and the model top. They are represented by

Together with homogeneous boundary conditions (

In an atmosphere with a realistic temperature profile, there is always one discrete solution of
Eq. (

With the objective to construct the 3-D NMFs to represent global atmospheric motions,
we must account for both internal modes and external modes.
Moreover, we need to choose the boundary conditions
that yield a discrete spectrum of internal modes by using the same top boundary conditions
as conditions adopted by the NWP and climate models which are being analyzed.
Thus, we can represent the spectrum of

The case where

The structure functions

After the 3-D model is decomposed into the product of a 2-D system and the VSE as seen in Eq. (

To write down the HSEs, we make the dependent variables

Therefore, the HSEs are written as follows:

Since Eq. (

Now, we define the global inner product as

Then, the linear operator (

This can be verified by forming relevant inner products, integrating them globally, and using Green's theorem.
For details see

By substituting Eq. (

Therefore, by using Eqs. (

Now we discuss some very important properties of the eigenvalues and eigenfunctions of Eq. (

The case of

The case of

Since the magnitude of

Separation of variables and the periodic boundary conditions in the longitudinal direction lead to the
solution of

By substituting Eq. (

This is the orthogonality condition for

Various aspects of the eigensolutions of HSEs, including the methods of solution, their asymptotic characters,
and tables of their eigenvalues (wave frequencies) and the eigenfunctions (meridional profiles) are discussed
by

The general algorithm for solving system (

For the zonal wave number

Figure 1 shows the frequency behaviour of the two classes of solutions for
four equivalent depths: 10, 1

Properties of equatorial MRG and KWs as well as of other
eigensolutions of linearized shallow-water equations on the
equatorial-

Frequencies of spherical normal modes for different equivalent
depths.

When the mean zonal flow is taken into account, the frequencies of wave
solutions of the linearized global shallow-water equations become different
from the wave frequencies associated with the linearization around the state
of rest.

An input data vector

Equation (

The projection is performed on the pre-computed vertical structure functions,

The scaling matrix

The integer subscript

Here,

Definition of the vector

The dimensionless horizontal coefficient vector

The scalar complex coefficient

Equations (

One of the advantages of expanding the fields of atmospheric motions by the NMFs
is that the global total energy can be derived from a particular type of scalar product, called the energy product.
A history on the origin of the energy product is discussed by

The conservation equation of global total energy in the system in the modal space is given by

Here,

The global energy product of the

Note that in Eq. (

Applying the expression for

Thus, to obtain the global total energy

Also note that similar to Eq. (

The software consists of a new code written mainly in Fortran 90 which needs
to be combined with several basic libraries available in the public domain.
The external libraries needed for the software implementation are the
libraries for handling the input data in GRIB (GRIdded Binary) and NetCDF (Network Common Data Form) formats and the
LAPACK (Linear Algebra PACKage) and ALFPACK (Associated Legendre Functions PACKage) libraries for solving the eigenvalue problem. While
a version of the LAPACK (version 3.4) and a somewhat modified ALFPACK source
code are provided with the package, the NetCDF and GRIB-API (GRIB-Application Program Interface) libraries need to
be installed by the user. The ALFPACK package, which is used for the
computation of the associated Legendre functions of the first kind,
originates from NCAR

Once the above libraries are correctly installed and their paths provided in the

the Gaussian grid and weights;

the vertical structure functions;

the horizontal structure functions;

projection of 3-D global data;

filtering of selected modes back to physical space.

All auxiliary input files are direct-access binary files except the input
file with the vertical coordinate definition which is kept in text format.
Such files for the ECMWF system are available online, e.g. from

Compilation is straightforward and it has been successfully applied on Linux systems and Mac OS as well as the large IBM and CRAY computers of ECMWF. The applied Fortran compiler is by default gfortran. Other compilers, the Intel Fortran and the IBM Fortran have also been used and no problems specific to different compilers were found. Small and big endian computers have also been used.

The computation of the Gaussian grid on which the 3-D normal-mode projection is carried out is easily
performed by specifying only two input values in the

Input data for the projection needs to be provided on a regular Gaussian grid. The software
performs no horizontal data interpolation. The regular Gaussian grid is available for extraction directly
from the ECMWF data archiving system MARS. Data sets on non-Gaussian grids should be interpolated
to the Gaussian grid by the user. This can be done by using standard operators such as the NetCDF operator (NCO)
(

The described procedure for the NMF representation assumes that the input
data are defined on vertical

In addition to the

Globally averaged vertical profiles of

Appendix B shows parameters in the input

Values of the equivalent depths

Correspondingly, small equivalent depths have been extensively used to
characterize various equatorial waves. This relies on the theory of tropical
wave solutions derived for the equatorial-

As discussed in previous papers, the equivalent depth for the first vertical mode (

The shapes of vertical structure functions for the ERA Interim 60-level system
are shown in Fig. 4a and b for the first seven vertical modes (Fig. 4a) and for selected higher
modes (Fig. 4b). The solutions for first seven vertical modes are also shown for the case of
21 levels (Fig. 4c) defined by values of average pressure closest to the standard pressure.
This figure can be compared with other figures from literature including plots from KP1981 and

Vertical structure functions for

A separate program computes the meridional structure of Hough harmonics, i.e.
vectors

The size of output binary files can be relatively large if a large zonal and meridional truncation is requested. For example, for the presented ERA Interim data set, we have used 200 zonal wave numbers and 70 meridional modes for each of the IG and balanced modes. With a single file per zonal wave number, there are as many files with meridional structure of Hough function as zonal wave numbers. The computation of horizontal structure functions is also the most memory intensive computation. However, once these files are computed, they can be used repeatedly for projection purposes and they are read only once at the beginning of projection and filtering.

The meridional profiles of the Hough functions corresponding to the Kelvin
mode and to the

Meridional structure of the Hough harmonics for (top) Kelvin mode
and (bottom)

The inverse projection or filtering of modes back to physical space is defined by Eqs. (35) and (32) for the inverse horizontal and vertical projections, respectively. Not all modes need to be inverted back to physical space. For example, it may be of interest to separate the balanced and IG components of circulation. Tropical modes are of special interest as many studies deal with the characteristics of the Kelvin mode and MRG mode throughout the tropical atmosphere. The NMF software can filter any mode or a set of modes back to physical space.

Appendix E contains an example of input file

Atmospheric energy spectra.

We now present some average properties for the ERA Interim

Ratio of balanced (red line) and inertio-gravity (blue line) energy
and total energy in each zonal wave number. Averaging is performed for the
30-year period and for all

Figure 6 shows the average energy distribution as a function of the zonal wave number as
defined by Eq. (47).
The spectra are shown up to the maximal truncation used for the projection: zonal wave number 200, which
corresponds to a grid spacing about 100

Distribution of total, balanced and inertio-gravity wave energy in
meridional modes. Summation is performed over all

For the planetary wave numbers 1–5, the total (and balanced) energy spectrum
is flatter than for synoptic scales; energy injected at scales associated
with baroclinic instability inversely cascades to larger scales

The total energy distribution shows no sign of slope flattening in
sub-synoptic scales in comparison to synoptic scales. On the contrary, after
a zonal wave number of around 100 the total energy spectrum becomes somewhat
steeper (Fig. 6a). This lack of variability in sub-synoptic scales has been
noted also in other studies of NWP models

A relative contribution of the two energy components is further presented in
Fig. 7. This figure shows that at the zonal wave numbers 28–30, which
correspond to the resolution of about 700

The meridional energy distribution is presented in Fig. 8.
The dominance of balanced energy over IG energy is clearly seen for all meridional modes except
for the lowest,

From the physical point of view, it is more complicated to discuss the energy distribution as a function of vertical mode. As discussed in the previous section, it is difficult to discuss a single vertical mode separately except perhaps the barotropic mode. Nevertheless, the vertical energy distribution displays characteristics for the balanced and IG modes that can be physically interpreted. In particular, the vertical distribution of IG energy appears related to tropical convection which generates a majority of tropical IG motions. Several distinct maxima in energy distribution can be associated with free-propagating large-scale IG modes, with deep convection and with convectively coupled waves (figure not shown). An exact physical interpretation of these energy maxima in relation to dominant equatorial waves derived from observations can be obtained by filtering these vertical modes back to physical space and comparing their properties with independent observations. This is a subject of a separate paper.

Meridional profile of the zonally averaged

As in Fig. 9 but for the IG component of the zonally averaged
meridional wind:

Figure 9 shows the climatological (1980–2009) zonal winds in January and
July, averaged zonally. The three pairs of panels for each month correspond to the
total, balanced and IG component. The sum of the balanced and IG components
correspond to the total average zonal wind. While Fig. 9a and d resemble the
known properties of the zonally averaged zonal wind from earlier reanalyses
and global climate models (GCMs)

A further insight into the meridional wind in the tropics is provided in Fig. 11. This shows the longitudinal features of cross-equatorial circulation for balanced and IG components. In this figure, several known dynamical properties of tropical circulation can be associated with the balanced and IG components. In January, we recognize vertically propagating IG waves in the stratosphere (Fig. 11a and c). The cross-equatorial flow in the upper troposphere and near the surface are in opposite directions and mostly associated with the IG modes. A shift from northerly to southerly winds from winter to summer is associated with the movement of the Hadley cell and the inter-tropical convergence zone (ITCZ). This is especially intense in the Indian Ocean sector due to the monsoon. Another feature seen in Fig. 11 is the impact of orography. It is obvious in the lower troposphere due to the African land massif and in the eastern Pacific due to the Andes. Such features of the lower tropospheric circulation are absent when the vertical structure of circulation is analyzed by using data on standard-pressure levels which remove the impact of orography by the interpolation. While the presented complex structure of winds near the surface may appear less familiar, these are realistic winds as analyzed by ERA Interim on its hybrid model levels which are almost the same as sigma levels close to the surface. We do not go into more detailed research on various features in Figs. 9–11 as their proper study and a more exact quantification of the IG component is beyond the scope of the present paper. Our purpose is primarily to illustrate the diagnostic capabilities of the NMF software.

Meridional winds along the Equator in

Climatological horizontal winds in January on ERA Interim model
level 31 (about 229

As in Fig. 12 but for the model level 51 (about 909

As in Fig. 12 but for July.

The horizontal climatological structure of wind field is shown in several
figures for two levels. We display model level 51 which is located in the
lower troposphere close to 900

The IG circulation close to 900

As in Fig. 13 but for July.

Climatological Kelvin wave in ERA Interim for July on

Finally, we show an example from the climatology of the most studied mode of
tropical dynamics, the Kelvin mode. In Fig. 16 the KW is shown at
two levels; besides the upper troposphere level 31 shown in other figures, we
also show model level 27 closer to the tropical tropopause, where the KW amplitude is largest in July. The prevalent feature of
KW
climatology is the zonal wave number

We presented the theory of the NMFs, technical details of
the code dealing with their application on global 3-D data and examples of
the software application to the reanalysis data set ERA Interim. It is argued
and illustrated by examples that the normal-mode procedure, once an important
part of the initialization of NWP models, can be applied for a range of other
topics. In particular, normal modes can be used to evaluate the unbalanced
circulation across many scales. The current global observing system provides
an unprecedented number of observations, mainly from satellites. Together
with advanced assimilation procedures and high-resolution global models,
high-density observations for the first time in history can resolve
IG waves across many scales

In particular, the spatio-temporal details of the large-scale equatorial modes such as the KW are identified
simultaneously in the mass field and wind field. Furthermore, the analysis is done by considering the entire
model depth in contrast to the majority of existing studies.
Although the NMF representation is applied independently to instantaneous atmospheric states,
the time series of Hough projection coefficients for various modes and their physical-space equivalents
link together to provide a spatio-temporal picture consistent with the linear wave theory which has been
the backbone of our understanding of atmospheric dynamics.
This has been illustrated in

The paper has presented technical details of the software implementation which is considered user friendly.
A limited knowledge of Fortran (or a similar programming language) is judged sufficient to implement and modify
the software.
The software application is controlled through a limited number of parameters in several

The presented representation of the ERA Interim data set in terms of NMFs has revealed climatological
features of the large-scale circulation. We showed that the global energy distribution is dominated by
the balanced energy with the IG modes making less than 10

The software is available from

& gaussian N = 256, gauss_fname = “gauss256.data”,

& vsfcalc_cnf stab_fname = “stability_L60.data”, vgrid_fname = “sigma_levels_L60.data”, vsf_fname = “vsf_L60.data”, equiheight_fname = “equivalent_height_L60.data”, num_vmode = 60, mp = 60, hstd = 8000.0d0, suft = 288.0d0, given_stability = .true., given_vsf = .false., ocheck = .true.,

& houghcalc_cnf szw = 0, ezw = 200, maxl = 70, my = 256, freq_fname = “freq.data”, ks_mode = “K”, ocheck = .false.,

& normal_cnf nx = 512, ny = 256, nz = 60, nstep = 1, coef3DNMF_fname = “Hough_coeff_”, output_3DNMF = .true., saveps = .false., savemeant = .false., ps_fname = “Ps_”, meant_fname = “Tmean_”, saveasci = .false., afname = “Inputa_”, aformat = “(512E20.4,1x)”,

& normal_cnf_inverse nx = 512, ny = 256, nz = 60, nstep = 1, coef3DNMF_fname = “Hough_coeff_”, inverse_fname = “ Inverse_allmodes_”, inv2hybrid = .false., ps_fname = “ Ps_”, meant_fname = “Tmean_”, saveasci = .true., afname = “AInverse_allmodes_”, aformat = “(512E12.4,1x)”,

Development of the NMF software as an open-access tool and its application is carried out under the funding from the European Research Council, grant agreement no. 280153. The National Center for Atmospheric Research is sponsored by the National Science Foundation. The authors would like to thank Patrick Callaghan for his comments on the manuscript and to Dennis Shea for English proofreading. Blazž Jesenko is thanked for improving Figs. 11–16. Edited by: K. Gierens