The spectral transform method is based on a dual representation of the scalar fields in terms of a truncated series of spherical harmonic functions and in terms of values on a rectangular tensor-product grid whose axes represent longitude and latitude. Representations of the state variables in spectral space are the coefficients of an expansion in terms of complex exponentials and associated Legendre functions,
where
is the (normalized) associated Legendre
function [34] and
.
The spectral coefficients are then determined by the equation

since the spherical harmonics
form an
orthonormal basis for square integrable functions on the sphere.
In the truncated expansion, M is the highest Fourier mode and
is the highest degree of the associated Legendre
function in the north-south representation.
Since the physical quantities are real,
is the complex
conjugate of
, and only spectral coefficients for nonnegative
modes need to be calculated.
To evaluate the spectral coefficients numerically, a fast Fourier
transform (FFT) is used to find
for any
given
. The Legendre transform is approximated using
a Gaussian quadrature rule. Denoting the Gauss points in
by
and the Gauss weights by
,
Here J is the number of Gauss points. (For simplicity, we will henceforth refer to (3) as the forward Legendre transform.) The point values are recovered from the spectral coefficients by computing
for each m (which we will refer to as the inverse Legendre
transform), followed by FFTs to calculate
.
The tensor-product grid in physical space is rectangular
with I grid lines evenly spaced along the longitude axis and
J grid lines along the latitude axis placed at the Gaussian quadrature
points used in the forward Legendre transform.
To allow exact, unaliased
transforms of quadratic terms the following relations are sufficient:
, I=2J, and
[27].
Using
is called a triangular truncation
because the
indices of the spectral coefficients make up a triangular
array.
The examples in the rest of this section will assume a triangular truncation
is used.