0% found this document useful (0 votes)
10 views30 pages

mtmw14 4

The document describes a course on numerical weather forecasting and climate modeling. Week 4 focuses on more advanced spatial schemes, including Lagrangian and semi-Lagrangian schemes as well as series expansion methods like finite element and spectral methods. Lagrangian schemes move the grid with the flow to avoid advection terms, while semi-Lagrangian schemes advect grid points onto a regular grid. Series expansion methods represent the spatial variation using basis functions rather than grid point values.

Uploaded by

Ajay Malkoti
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views30 pages

mtmw14 4

The document describes a course on numerical weather forecasting and climate modeling. Week 4 focuses on more advanced spatial schemes, including Lagrangian and semi-Lagrangian schemes as well as series expansion methods like finite element and spectral methods. Lagrangian schemes move the grid with the flow to avoid advection terms, while semi-Lagrangian schemes advect grid points onto a regular grid. Series expansion methods represent the spatial variation using basis functions rather than grid point values.

Uploaded by

Ajay Malkoti
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 30

MSc Module MTMW14:

More advanced spatial schemes

4.1 Series expansion methods


4.2 Lagrangian and semi-lagrangian schemes

(c) 2006 d.b.stephenson@reading.ac.uk 1


Course content
Week 1: The Basics
1.1 Introduction
1.2 Brief history of numerical weather forecasting
and climate modelling
1.3 Dynamical equations for the unforced fluid

Week 2: Modelling the real world


2.1 Physical parameterisations: horizontal mixing and convection
2.2 Ocean modelling

Week 3: Staggered schemes


3.1 Staggered time discretisation and the semi-implicit method
3.2 Staggered space discretisations

Week 4: More advanced spatial schemes


4.1 Lagrangian and semi-lagrangian schemes
4.2 Series expansion methods:
finite element and spectral methods

Week 5: Synthesis
5.1 Revision
5.2 Test

(c) 2006 d.b.stephenson@reading.ac.uk 2


4.1 Lagrangian schemes

Key idea
Move the grid with the flow so that there
is no longer any advection term and
hence advective CFL instability can be
avoided ( so larger time steps can be
used).

Frames of reference
1-dimensional example
Good points and bad points of the
method

(c) 2006 d.b.stephenson@reading.ac.uk 3


4.1 Frames of reference

Eulerian coordinate system geographically


fixed (e.g. latitude-longitude coordinates).
Lagrangian coordinate system moves with
the fluid.
Grid points in fully Lagrangian schemes get
advected along by the flow therefore no
explicit advection term in the equations.
However, grid becomes horribly distorted
and non-linear stability is likely to occur.
(c) 2006 d.b.stephenson@reading.ac.uk 4
4.1 1-dimensional example
t f
x= x(t)

i
x
D
u F
Dt t x

f i dt dx
x (t )
t x

F u dt dx
x (t )
x x

(dx xdt ) Fdt


x (t )
x x (t )

Eulerian: dx-udt=-udt
Lagrangian: dx-udt=0
(c) 2006 d.b.stephenson@reading.ac.uk 5
4.1 Eulerian and Lagrangian schemes
t f
Eulerian
grid points
don t move

i
x

t f
Lagrangian
grid points
advect from a
regular grid
i
x

t f
Semi
-Lagrangian
grid points
advect onto
a regular grid i
(c) 2006 d.b.stephenson@reading.ac.uk
x 6
4.1 Semi-Lagrangian

n 1 n
x i xi Fdt
x (t )

Steps:
Back trajectory calculation to find out
where grid point was on previous time
step e.g. ~ n n n 1
xi xi ui h
Find the field at this location by
interpolating the field from neighbouring
grid points (e.g. cubic interpolation)

Find the integrated forcing by using


numerical quadrature (e.g. Simpsons rule
over a half time step).
(c) 2006 d.b.stephenson@reading.ac.uk 7
4.1 Semi-lagrangian
Advantages:
No advection term
No advective CFL problems so time step
can be larger ( less time steps needed)
Less problems with the pole
Disadvantages:
Have to calculate a back trajectory for
each grid point at each time step
More CPU needed per time step
Problems with fast forcing (e.g. doppler
shift of gravity waves over mountains)
Overly diffusive on low resolution grids

Example:
Ritchie et al. 1995 ECMWF
h=3mins (Eulerian) 15 mins (Semi-Lagr)
SL takes 20% more CPU per step so net speed up
is factor of 4.
(c) 2006 d.b.stephenson@reading.ac.uk 8
4.1 Summary of main points
Once gravity waves have been slowed
down using semi-implicit schemes, the
maximum time step is determined by
advective CFL

Lagrangian methods can be used to


remove the advection term and so avoid
these CFL limits

Semi-lagrangian is better than Lagrangian


because it results in a regular grid on the
new time step

Time step is then determined by accuracy


requirements rather than by stability
limitations.
(c) 2006 d.b.stephenson@reading.ac.uk 9
4.2 Series expansion (Galerkin) methods

Key idea
use a finite set of spatial basis functions
to represent the spatial variation (rather
than a finite set of grid point variables).

Finite difference schemes


Finite volume schemes
Galerkin methods:
Finite element
Spectral

(c) 2006 d.b.stephenson@reading.ac.uk 10


4.2 Reduction of truncation error
Consider the PDE L[u]-g=0 which has
true solution u. L[.] is a non-linear
differential operator and g is some forcing
function. The numerical solution u*
satisfies L[u*]-g=e where e is the residual
truncation error.

Three main classes of method:


1. Point collocation set e to zero only
at specific locations (grid points).
2. Least squares minimise e*e
averaged over the whole domain
3. Galerkin set e to be orthogonal to
the set of pre-defined spatial basis
functions.
i ( x)e( x, t )dA 0

http://www.cs.ut.ee/~toomas_l/linalg/dv/node1.html
(c) 2006 d.b.stephenson@reading.ac.uk 11
4.2 Finite volume schemes
Advection term can be written in different ways:
u. uij i 1, j i 1, j vij i, j 1 i, j 1

.(u ) ui 1, j i 1, j ui 1, j i 1, j vi , j 1 i, j 1 vi , j 1 i, j 1

k. (u k) ???

1st form is known as advection form


2nd form is known as flux form

When equations are solved in flux form, the


total flux of vorticity into grid cells is conserved.
Rather than thinking of finite differences one
is thinking of finite volumes.

Equal combination of all 3 forms gives what is


known as the Arakawa jacobian which
conserves energy and enstrophy. ( hence
more stable!!).
(c) 2006 d.b.stephenson@reading.ac.uk 12
4.2 Integral formulation of a PDE

Example: diffusion equation

t
Equivalent weak form integral formulation:

w d w .( )d
t
w. d

where w is an arbitrary weight (test) function

(c) 2006 d.b.stephenson@reading.ac.uk 13


4.2 The Galerkin finite element method

Divide the domain into a


finite set of N elements. Then
approximate the solution as:

N
t i t i
i 1

Where
Ai the i are the basis functions at
node i.
N

i (x) 1
i 1

Solve weak form of the equations for finite


series of test functions, wi
Galerkin method: choose wi = i

(c) 2006 d.b.stephenson@reading.ac.uk 14


4.2 Example: basis functions for linear elements

1
1
0

0
1
0

Higher-order (e.g., quadratic) elements


=> more nodes

While higher-order elements are


nominally more accurate, when
combined with adaptive meshing, low-
order elements offer maximum flexibility
(for fixed computational resources) and
the errors can be rigorously controlled
(c) 2006 d.b.stephenson@reading.ac.uk 15
4.2 Example: ICOM
Imperial College Ocean Model
David Marshall (University of Reading), Chris Pain, Matthew Piggott, Philip
Power, Adrian Umpleby, Matthew Eaton, Gerard Gorman, Cassiano de Oliveira,
Tony Goddard (Imperial College, London)

General-purpose code for solving 3-D Navier-Stokes


equations that incorporates unstructured meshing with
dynamic mesh adaptivity;
Need to solve a 4th-order elliptic problem - currently use
a conjugate-gradient solver (to be replaced by multigrid
solver). Domain decomposition methods employed for
parallel processors.
Initially approx. 1/4 degree everywhere:

(c) 2006 d.b.stephenson@reading.ac.uk 16


4.2 Adapted mesh

Nodes 25,000
Elements
(c) 2006 d.b.stephenson@reading.ac.uk
65,000 17
4.2 Pros and cons of FE schemes
Advantages of finite element schemes:
can conform very accurately to the basin
geometry;
various natural boundary conditions can be
included in a very straightforward manner;
formulation based on rigorous mathematical
foundations, allowing statements about errors,
convergence to be made.

HOWEVER finite-element methods are more


computationally expensive than finite-difference
methods, but some of this can be offset by
adaptive meshing:
remeshing controlled by a functional that gauges
the quality of the mesh, based on the Hessian of
the velocity/tracer fields and prescribed error
tolerances;
constraints on aspect ratio of elements and size
variations between adjacent elements and
prescribed minimum and maximum element size. 18
(c) 2006 d.b.stephenson@reading.ac.uk
4.2 Spectral methods
Key idea
Use basis functions that are eigensolutions
of the spatial derivative operators

e.g. Fourier modes:

i ( kx ly )
e

ik
x
Perfectly accurate derivatives
Note: ik not 2isin(kd)
Very simple Laplacian terms
Nice smooth solutions (continuous
differentiable)
(c) 2006 d.b.stephenson@reading.ac.uk 19
4.2 1-d example
2
u 2
0
t x x
N
i 2 kx / N
( x, t ) k (t )e
k 1

N 2
d k 2 j 2 k
uk j j k 0
dt j 1 N N
PDE converted into a set of N ODEs
one for each Fourier mode amplitude
Diffusion term is very simple just a
wavenumber dependent damping for
each Fourier mode
Advection term consists of non-linear triad
interaction between mode amplitudes
Method takes O(N2) CPU operations
rather than O(N) for finite difference so
becomes prohibitive for large N!
(c) 2006 d.b.stephenson@reading.ac.uk 20
4.2 The transform method
Fast Fourier Transform (FFT) algorithm
O(NlogN) rather than O(N2) operations
Carl Friedrich Gauss, "Nachlass: Theoria interpolationis methodo
nova tractata," Werke band 3, 265 327 (Königliche Gesellschaft der
Wissenschaften, Göttingen, 1866). See also M. T. Heideman, D. H.
Johnson, and C. S. Burrus, "Gauss and the history of the fast Fourier
transform," IEEE ASSP Magazine 1 (4), 14 21 (1984).

James W. Cooley and John W. Tukey, "An algorithm for the machine
calculation of complex Fourier series," Math. Comput. 19, 297 301
(1965).

The Transform Method


Calculate du/dx etc. in wavenumber space
Transform them to physical space by FFT
Multiply them together to get advection terms
Inverse FFT back to wavenumber space
O(NlogN) rather than O(N2) speed up of 20 (N=100) 145 (N=1000)

Orszag, S. A., 1970:


Transform method for the calculation of vector-coupled sums:
Application to the spectral form of the vorticity equation. J. Atmos.
Sci., 27, 890-895.
(c) 2006 d.b.stephenson@reading.ac.uk 21
4.2 The ECMWF spectral
ECMWF algorithm model

(c) 2006 d.b.stephenson@reading.ac.uk 22


4.2 Spectral methods in GCMs
The spectral technique has become the most
widely used method of integrating the governing
equations of numerical weather prediction over
hemispheric or global domains.

Following the development of efficient transform


methods by Orszag (1970) and Eliasen et al.
(1970), and the construction and testing of multi-
level primitive-equation models (e.g. Bourke,
1974; Hoskins and Simmons, 1975; Daley et al.,
1976), spectral models were introduced for
operational forecasting in Australia and Canada
during 1976. The technique has been used
operationally in the USA since 1980, in France
since 1982, and in Japan and at ECMWF since
1983. The method is also extensively used by
groups involved in climate modelling.

Comprehensive accounts of the technique are


given by Machenhauer (1979), and Jarraud and
Simmons (1984).

(c) 2006 d.b.stephenson@reading.ac.uk 23


4.2 Spectral methods on the sphere
On a flat 2-dimensional domain we could
use Fourier modes:
i ( kx ly )
( x, y , t ) kl (t ) e
k ,l

BUT the Earth isnt flat and so these are


eigensolutions of the Laplacian operator
on the sphere. So instead need to use
surface harmonics (spherical harmonics):

m
( x, sin , t ) mn (t )Y ( x, sin )
n
n m

Ynm ( x, sin ) eimx Pnm (sin )


n=truncation
m=zonal wavenumber |m|<=n
Fourier mode in x-direction (in longitude)
Associated Legendre polynomial in
latitude direction with n-|m| zeros between
poles
(c) 2006 d.b.stephenson@reading.ac.uk 24
4.2 Some spherical harmonics

(c) 2006 d.b.stephenson@reading.ac.uk 25


4.2 Some definitions and properties
(2n 1)(n m)! (1 y 2 ) m / 2 d n m 2
Pnm ( y ) ( y 1) n

2(n m)! 2 n n! dy n m

0 1
P 0
2
3 3(1 y 2 )
P10 y P11
2 4
5 15 15
P20 (3 y 2 1) P21 y 1 y2 P22 1 y2
8 4 16

2 1
1 m '* m 1 m' m n' n
Y Y dydx
n' n
4 0 1
0 otherwise
2 m n(n 1) m
Y n 2
Yn
a

(c) 2006 d.b.stephenson@reading.ac.uk 26


4.2 Truncation and resolution
n

m
Two types of truncation:
Triangular e.g. T42
Rhomboidal e.g. R15

Triangular gives isotropic resolution whereas


rhomboidal gives more resolution meridionally

T42 means maximum number of waves


around equator m= 42
resolution ~ 0.5 * 360deg/ 42 ~ 4.3 degrees
(c) 2006 d.b.stephenson@reading.ac.uk 27
(c) 2006 d.b.stephenson@reading.ac.uk 28
Some disadvantages of spherical harmonics:
more CPU time needed per time step
not local so can generate non-local
artefacts such as Gibbs oscillations
not clear what resolution they resolve

A. Navarra, W.F. Stern and K. Miyakoda, 1994:


Reduction of the Gibbs Oscillation in Spectral Model Simulations
Journal of Climate: Vol. 7, No. 8, pp. 1169 1183.

Lander, J. and Hoskins, B. J. (1997).


Believable scales and parameterizations in a spectral transform method.
Monthly Weather Review, 125, 292-303.

(c) 2006 d.b.stephenson@reading.ac.uk 29


4.2 Summary of main points

Finite differences are a rather naïve way


of solving PDEs

Better approach is to use a set of spatial


basis functions either local piecewise
functions (Finite Elements) or harmonics
(Spectral methods)

These methods generally take more


computer time per time step but can
achieve more accurate results

(c) 2006 d.b.stephenson@reading.ac.uk 30

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy