30
The Spectral Method: Its The Spectral Method: Its Impact on NWP Impact on NWP Ferdinand Baer Ferdinand Baer Department of Meteorology Department of Meteorology University of Maryland University of Maryland College Park, MD 20742 College Park, MD 20742 Symposium on the 50th Anniversary of Operational Numerical Weather Prediction 14–17 June 2004, The Inn and Conference Center, College Park, MD 20742

The Spectral Method: Its Impact on NWP Ferdinand Baer Department of Meteorology University of Maryland College Park, MD 20742 Symposium on the 50th Anniversary

Embed Size (px)

Citation preview

Page 1: The Spectral Method: Its Impact on NWP Ferdinand Baer Department of Meteorology University of Maryland College Park, MD 20742 Symposium on the 50th Anniversary

The Spectral Method: Its The Spectral Method: Its Impact on NWPImpact on NWP

Ferdinand BaerFerdinand Baer Department of MeteorologyDepartment of Meteorology

University of MarylandUniversity of MarylandCollege Park, MD 20742College Park, MD 20742

Symposium on the 50th Anniversary of Operational Numerical Weather Prediction14–17 June 2004, The Inn and Conference Center, College Park, MD 20742

Page 2: The Spectral Method: Its Impact on NWP Ferdinand Baer Department of Meteorology University of Maryland College Park, MD 20742 Symposium on the 50th Anniversary

NWP50 2

General features of a NWP modelGeneral features of a NWP model

• Let a vector B represent N dependent variables describing the state of the prediction system at any time,

B = {Bb} = (V s qv qi ql aj )T

• The prediction system is,

or,

• F has the dimensions of B, and depends nonlinearly and differentially on B, r and t. A linear matrix operator L is often used to transform these equations.

• Convert this system to computational form for prediction. We will focus on finite-differencefinite-difference and spectral methodsspectral methods, since they are most popular.

B

tF B,r, t L

B

t ˜ F B,r, t (2)

(1)

Page 3: The Spectral Method: Its Impact on NWP Ferdinand Baer Department of Meteorology University of Maryland College Park, MD 20742 Symposium on the 50th Anniversary

NWP50 3

The finite difference processThe finite difference process

• Select a three-dimensional grid with M points to approximate the space continuum;

• Select a difference operator for derivatives;

• Represent B at each point as a vector of dimension NM;

• F becomes a numerical vector with NM elements after applying the difference operator at each grid point;

• L, by virtue of the difference operator, is an (NM x NM) matrix.

• Using a circumflex to represent numerical vectors and matrices at gridpoints, the finite difference system is,

ˆ B

t ˆ L 1 ˆ F ˆ B , ˆ r , t (3)

Page 4: The Spectral Method: Its Impact on NWP Ferdinand Baer Department of Meteorology University of Maryland College Park, MD 20742 Symposium on the 50th Anniversary

NWP50 4

• Select a truncated set of linearly independent, continuous global structures, Za and expand the model variables Bb in them,

• Since L = {Lb} is diagonal, the scalar form of (2) is,

• Substitution of (4) into (5) leads to an error equation,

which can be solved for the unknown Bb,a by multiplying it by test multiplying it by test functionsfunctions and requiring the integral over the domain to vanish, yielding NMe spectral equations for ,

• To detemine Fb, let Bb (Bb,a) and Z (Za) with Me elements;

The spectral methodThe spectral method

(4)

(5)

Bb ,a

tLba

a1

M e

˜ F b b

(6)

Bb,a t

Bb ,a

tLba

ˆ kdS

a1

M e

˜ F b ˆ kdS 0

Bb (r, t) Bb,a (t)a

a1

M e

(r)

Lb

Bb

t ˜ F b B,r, t

Page 5: The Spectral Method: Its Impact on NWP Ferdinand Baer Department of Meteorology University of Maryland College Park, MD 20742 Symposium on the 50th Anniversary

NWP50 5

The spectral method (cont.)The spectral method (cont.)

• And (6) yields Me prediction equations for the expansion coefficients,

• Define matrices , and . If Bs (Bb) and

Fs (Fb) are extended vectors for the expansion coefficients including all including all variablesvariables,

The grid point values from this spectral representation are calculated at each point (ix1, jx2, kx3) for each dependent variable Bb by use of (4) and can be compared to the FD eq.(3);

Note the structural similarity of these equations!Note the structural similarity of these equations!

(7)

A L Diag ˆ Z LbZT dS

A R Diag ˆ Z ZT dS

(9)

Fb Fb ,a (t)Za

a

ZTFb

Bb

t ˆ Z LbZ

T dS 1 ˆ Z ZT dSFb (8)

Bs

tA L

1ARFs

ˆ B

t ˆ L 1 ˆ F ˆ B , ˆ r , t (3)

Page 6: The Spectral Method: Its Impact on NWP Ferdinand Baer Department of Meteorology University of Maryland College Park, MD 20742 Symposium on the 50th Anniversary

NWP50 6

Specifics of the spectral Specifics of the spectral method used for NWPmethod used for NWP

• Use on horizontal surfaces:

• Let the expansion functions Za satisfy the eigenvalue problem, Lb Za = -cb,a Za

Orthogonality and normality, Test fctns. = Exp. fctns.,

• Use solid harmonics, With Za = Y , = (n + im), Lb 2

and

• The expansion (Eq.4) becomes

Zi Z jdS i, j

Z ˆ Z

Yn,m (,) Pn,m ()e im

c n(n 1)

(11)

Bb (,,zk, t) Bb, ,k

(t)Y (,)

expansion coefficientsexpansion coefficients

Page 7: The Spectral Method: Its Impact on NWP Ferdinand Baer Department of Meteorology University of Maryland College Park, MD 20742 Symposium on the 50th Anniversary

NWP50 7

Spectral Barotropic Vorticity EquationSpectral Barotropic Vorticity Equation

V2

t V2 V2 - fk V2 -

1

p 2 p

• Convert to vorticity and divergence;

• And the BVE in term of becomes,

• In spectral form, the BVE is,

V2 k V2 2 divergence

kV2 2 relative vorticity

2t

2

F()

F()

2

2

(t)

t2imc

1 (t) F (t)

F (t) F()Y*(,)dS

(12)

(13)

Page 8: The Spectral Method: Its Impact on NWP Ferdinand Baer Department of Meteorology University of Maryland College Park, MD 20742 Symposium on the 50th Anniversary

NWP50 8

Computational features of the spectral methodComputational features of the spectral method

Interaction coefficient methodInteraction coefficient method

• Use BVE for demonstration: From (11), (12) and (13) the nonlinear term is F ;

Interaction Coefficients (IC) I,, Time change of any depends on the coupling of all allowed . The IC set depends on model truncation. Its size is ~n5, the largest

allowed index. It can be computed once and stored. The general systemgeneral system (2) can be represented identically but has more

variables. However, some variables may not expand effectively and create computing problems.

F (t) i

2

(t)(t)I, ,

I, , (c c) mY

Y

mY

Y

Y

*dS

Page 9: The Spectral Method: Its Impact on NWP Ferdinand Baer Department of Meteorology University of Maryland College Park, MD 20742 Symposium on the 50th Anniversary

NWP50 9

Computational features of the spectral Computational features of the spectral methodmethod

Transform methodTransform method

• An alternate method for calculating F; also use BVE for demonstration: Integrand in (13)--nonlinear terms-- is transformed onto a special

grid and solved exactly by quadrature; Derivatives in F() are taken before evaluation on the grid; Number of calculations is of order n3 (n is the max number of

grid points) hence a dramatic saving in computing time; Since forcing functions are summed over the grid, those

functions with near local singularities are smoothed out; The general systemgeneral system (2)can be represented identically but with

more variables. This procedure made the spectral method a popular alternative to

FD methods.

Page 10: The Spectral Method: Its Impact on NWP Ferdinand Baer Department of Meteorology University of Maryland College Park, MD 20742 Symposium on the 50th Anniversary

NWP50 10

Advantageous features of the spectral methodAdvantageous features of the spectral method

Linear instability and phase errorsLinear instability and phase errors

• The general prediction equation (9) can be written with a linear and nonlinear terms;

Diagonalize C and solve the linear part of the equation; Transform Bs with this solution, thereby removing it from

equation (15); Then the resulting system cannot have linear instability or

linear phase errors; This is more cumbersome with the FD method which can

yield systematic linear phase errors and possibly linear instability.

Bs

tCBs + nonlinear terms (15)

Page 11: The Spectral Method: Its Impact on NWP Ferdinand Baer Department of Meteorology University of Maryland College Park, MD 20742 Symposium on the 50th Anniversary

NWP50 11

Advantageous features of the spectral methodAdvantageous features of the spectral methodNonlinear instabilityNonlinear instability

• First discussed by Phillips (1959);• Eq. (3) includes nonlinear terms of the form u∂u/∂x for calculating

∂u/∂t ;• Let • A component of the nonlinear product for two waves mi, mj is,

• When mi+ mj M, the FD form for ∂u/∂t cannot see this term and it is folded back into the range mi+ mj < M causing an aliasing error and ultimately leading to instability. To prevent this instability, scale dependent artificial friction is introduced to prevent the error from growing.

• This error is completely avoided in the spectral method since terms which exceed the allowed range of the expansion functions need not be calculated.

u ui

i1

M

sin mix over M gridpoints on x intervals;

uu

xuiu j (1 2)m j sin mi m j x sin mi m j x

Page 12: The Spectral Method: Its Impact on NWP Ferdinand Baer Department of Meteorology University of Maryland College Park, MD 20742 Symposium on the 50th Anniversary

NWP50 12

Advantageous features of the spectral methodAdvantageous features of the spectral method

ConservationConservation

• Conservation conditions inherent in the differential equations should be maintained in the computational system;

• The BVE, as an example, demonstrates that the abs. vorticity or any function thereof must be conserved following a particle or on integration over all particles.

• This is difficult to achieve with the FD method; however Arakawa (1966) satisfied conservation of vorticity, enstrophy and energy over the global surface by manipulation of the Jacobian operator (nonlinear advection), although the method may not be unique;

• Platzman (1960) and Lorenz(1960) independently demonstrated that the spectral BVE, when truncated, satisfies all appropriate conservation conditions without application of additional techniques;

• Experiments with the spectral shallow water equations, which involve cubic nonlinearity, show small errors in conservation.

Page 13: The Spectral Method: Its Impact on NWP Ferdinand Baer Department of Meteorology University of Maryland College Park, MD 20742 Symposium on the 50th Anniversary

NWP50 13

Advantageous features of the spectral methodAdvantageous features of the spectral method

The polar problemThe polar problem

• Finite difference methods: Mapping to a grid is complex in polar regions; The simple procedure of using a lat.-lon. grid requires no mapping and

has become popular; Approaching the poles the length of the increment decreases as

cos(), thus requiring a shorter t to satisfy the CFL criterion; Numerous ‘fixes’ have been tried such as reducing the number of

elements as one approaches the pole; This requires arbitrary scale truncation which may distort the solution

because of nonlinearity.

• Spectral method: In the spectral system, scales are directly represented by expansion in

wave number, thus no special truncation is needed; All selected expansion functions are regular at the pole, hence no

convergence problems exist there.

Page 14: The Spectral Method: Its Impact on NWP Ferdinand Baer Department of Meteorology University of Maryland College Park, MD 20742 Symposium on the 50th Anniversary

NWP50 14

Scaling in the verticalScaling in the vertical• Use a simplified equation like the Quasi-Geos. Pot. Vort. Eq.

(QGPVE) which has linear solutions,

The vertical structures can be constructed from the vertical

part of the L operator having eigenvalues which are the vertical scaling numbers, equivalent depths,

(For simple thermodynamic profiles and BCs, these structures are Bessel functions in the vertical.)

fo2

z

N 2z

fo2

ghk

Spectral applications for insightsSpectral applications for insights

t

V

L

x0

L 2 fo

2z

N 2z

equivalent depth

s2 n,k n n 1 a2 fo2

ghk

L() s2(n,k)

3-D index

Horizontal vertical

Page 15: The Spectral Method: Its Impact on NWP Ferdinand Baer Department of Meteorology University of Maryland College Park, MD 20742 Symposium on the 50th Anniversary

NWP50 15

TruncationTruncation• This is essential to close a model.• With the finite difference methodfinite difference method, one has many alternatives in

grid dimensions, distribution, etc.

2-D truncation with the spectral method2-D truncation with the spectral method

a) At a specified wave number = (n + im)max;

b) At a specified ordinal index, nmax, and m nmax: denoted as triangular truncationtriangular truncation;

c) At mmax and n n + mmax; denoted as rhomboidal truncationrhomboidal truncation.d) (b) and (c) have been most popular: energy in atmospheric

surfaces converges rapidly with both truncations; e) Relative advantages:

For (c) each planetary wave has equal resolution; For (b) it is simpler, more computationally economical, and

depends on a single scale index (n). Additionally, some observational data tends to distribute along lines of constant n.

Page 16: The Spectral Method: Its Impact on NWP Ferdinand Baer Department of Meteorology University of Maryland College Park, MD 20742 Symposium on the 50th Anniversary

Some spectral truncationsSome spectral truncations

Page 17: The Spectral Method: Its Impact on NWP Ferdinand Baer Department of Meteorology University of Maryland College Park, MD 20742 Symposium on the 50th Anniversary

Average KE (both ht. and time) as percent of total in each Average KE (both ht. and time) as percent of total in each wave component wave component = = n +imn +im..

Planetary wave Planetary wave mm Planetary wave Planetary wave mm

Zer

os in

lati

tude

(Z

eros

in la

titu

de ( n

- m

n -

m))

U-ENERGYU-ENERGY

Zer

os in

lati

tude

(Z

eros

in la

titu

de ( n

- m

n -

m))

V-ENERGYV-ENERGY

Page 18: The Spectral Method: Its Impact on NWP Ferdinand Baer Department of Meteorology University of Maryland College Park, MD 20742 Symposium on the 50th Anniversary

3D truncation with spectral model3D truncation with spectral model

2 4 6 8 10 12 14 16 18

Vertical index - Vertical index - kk

Hor

izon

tal i

ndex

-

Hor

izon

tal i

ndex

- nn

Can truncate the model for fixed values of s based on the QGPV Eq.,

s2 n,k n n 1 a2 fo2

ghk

0

10

20

30

40

50

60

70

80

Page 19: The Spectral Method: Its Impact on NWP Ferdinand Baer Department of Meteorology University of Maryland College Park, MD 20742 Symposium on the 50th Anniversary

3D truncation with spectral model-- 3D truncation with spectral model-- Where to put the levels?Where to put the levels?

• One can find levels in the atmosphere on which numerical structures of the QGPV eq. converge to the exact solutions. These can be used as optimum vertical levels in a FD vertical and spectral horizontal representation. See example below.

7 9* 12 15

14.7 13.2 12.3 11.8

18.1 16.0

22.3 26.6 21.8

28.3 29.6

37.1 39.0 40.3

54.6 61.9 57.3 54.8

84.1 74.4

106. 103. 123. 101.

138.

172. 181. 187.

218. 297. 266. 254.

492. 346.

592. 653. 540.

819. 827.

943. 963. 985. 986.

Optimized -levels in mb.No. of levels

Page 20: The Spectral Method: Its Impact on NWP Ferdinand Baer Department of Meteorology University of Maryland College Park, MD 20742 Symposium on the 50th Anniversary

NWP50 20

Brief history of spectral modelingBrief history of spectral modeling

• First attempted in early 1950s;• First became popular in the 1960s;• First successful PE model by Bourke (1974);• Implemented by Canadians and Australians in

1976;• Adopted by NMC in 1980;• By the French in 1982;• By ECMWF in 1983;• In 1998, ECMWF was running at T213;• In 1999 NCEP was running at T254.

???????????????

Page 21: The Spectral Method: Its Impact on NWP Ferdinand Baer Department of Meteorology University of Maryland College Park, MD 20742 Symposium on the 50th Anniversary

NWP50 21

SummarySummary• Breakthrough for spectral models came with the transform

method since it became computationally competitive with the FD method.

• The spectral method has some advantageous features: It can eliminate linear instability and phase errors; It prevents a form of nonlinear instability automatically; It avoids the pole problem; It has clear scaling scaling properties; It can be systematically truncated based on scaling; It can give insight into 3D truncation based on horizontal and

vertical coupling.

• Since new computational methods are still being developed, the future for NWP modeling is still up in the up in the air.air.

Page 22: The Spectral Method: Its Impact on NWP Ferdinand Baer Department of Meteorology University of Maryland College Park, MD 20742 Symposium on the 50th Anniversary

HaveHaveA A

HappyHappy5050thth

Page 23: The Spectral Method: Its Impact on NWP Ferdinand Baer Department of Meteorology University of Maryland College Park, MD 20742 Symposium on the 50th Anniversary

NWP50 23

Spectral applications for insightsSpectral applications for insights

ScalingScaling

• A prelude to truncation.• In physical space, scales are determined by grid elements x.• In the spectral domain, scales are determined by wave

numbers; i.e., transforms from the gridded lengths.

Scaling in the 2-D spectral domainScaling in the 2-D spectral domain

Consider the Laplace operator from scale analysis,

where l is an index representing the # of sub-regions in s2, the area of the domain.

2 ~1

s

2

~l

s

2

Page 24: The Spectral Method: Its Impact on NWP Ferdinand Baer Department of Meteorology University of Maryland College Park, MD 20742 Symposium on the 50th Anniversary

NWP50 24

• Cartesian domain: Assume a function such that,

This 2-D index depends on both dimensions and their indices.

• Spherical surface: Assume a function such that,

Here the 2-D index depends only on a single scale index n , and linearly for 1.

2-D Scaling (cont.)2-D Scaling (cont.)

Spectral applications for insightsSpectral applications for insights

f r exp ikr

2 f k 2 f kx2 ky

2 f and l2 k 2s2

f r Y , exp im P

2 f 2Y n n 1 Y and l2 n n 1 s2

Page 25: The Spectral Method: Its Impact on NWP Ferdinand Baer Department of Meteorology University of Maryland College Park, MD 20742 Symposium on the 50th Anniversary

n k

12

10

8

6

4

2

2 4 6 8 10 12

kx and m

Structure of 2-D indicesStructure of 2-D indices

Page 26: The Spectral Method: Its Impact on NWP Ferdinand Baer Department of Meteorology University of Maryland College Park, MD 20742 Symposium on the 50th Anniversary

Cellular structure of solid harmonic functions Cellular structure of solid harmonic functions YYn,mn,m for for nn=5 and all =5 and all

allowed values of allowed values of mm..

Page 27: The Spectral Method: Its Impact on NWP Ferdinand Baer Department of Meteorology University of Maryland College Park, MD 20742 Symposium on the 50th Anniversary

• Use QGPV model. Operator L has eigenvalues which depend on the horizontal index n and equiv. depth hk,

• These indices can be used for 3D scaling.3D truncation limits on modes k and n as determined

by the limit on s.

3-D Scaling3-D Scaling

s2 n,k n n 1 a2 fo2

ghk

Page 28: The Spectral Method: Its Impact on NWP Ferdinand Baer Department of Meteorology University of Maryland College Park, MD 20742 Symposium on the 50th Anniversary

NWP50 28

• Original style; consider only computation cycle speed and memory.

• Innovations since; – vector calculations – multiprocessors.

• Current primary issue; models need more power than is available, thus one must make use of machines most efficiently.

The computational worldThe computational world

Page 29: The Spectral Method: Its Impact on NWP Ferdinand Baer Department of Meteorology University of Maryland College Park, MD 20742 Symposium on the 50th Anniversary

NWP50 29

• Define a "computing cycle" to be that time required to do once all calculations which are systematically repeated to complete the entire calculation.

• For conventional marching problems this computing cycle is one complete time step.

• On a serial machine the computing cycle is the total time for that operation and can only be reduced by a faster machine.

• On a MPP the computing cycle is reduced insofar as many computations can be performed simultaneously.

• The time required to complete this cycle should converge to the time needed by the machine to perform one computation (the machine cycle) as the number of processors is increased.

The computational world (cont.)The computational world (cont.)

Page 30: The Spectral Method: Its Impact on NWP Ferdinand Baer Department of Meteorology University of Maryland College Park, MD 20742 Symposium on the 50th Anniversary

NWP50 30

Consider a SIMD parallel processor; Distribute I, one to a processor; Send pairs to appropriate processors; Calculate all contributions in one cycle; Sweep, sum and repeat. In limit, this process can approach one machine cycle. We calculated the BVE at LANL on a CM-5 using this scheme

and compared to the transform method with comparable speed. Additionally, a baroclinic model showed similar results. Unfortunately, SIMDs have disappearedUnfortunately, SIMDs have disappeared.

Example of using this process with the Example of using this process with the interaction coefficient methodinteraction coefficient method.

(t)

t2imc

1 (t)i

2

(t)(t)I , ,