November 2026 · Politecnico di Milano
Atmosphere and Ocean Dynamics — Lecture 6
Prof. Dr. Pedro da Silva Peixoto
Applied Mathematics
Instituto de Matemática e Estatística
Universidade de São Paulo
Visiting Professor at MOX Lab
Politecnico di Milano
Previous knowledge
Build the conservation laws into the scheme, then choose the grid for rotating waves
(LeVeque 2002; Randall 1994)

Observed M2 tide: R. Ray, NASA Goddard Space Flight Center, from TOPEX/Poseidon
But: a sea must not create or lose water; and which grid for rotating waves?
Conserve exactly what the sea holds, and get rotating gravity waves right
(Hendershott 1981) · Map: commons.wikimedia.org: M2_Tidal_constituent.tif
A control volume: the change of what is inside equals what flows in minus what flows out. For a tracer \(q\) with flux \(F = c\,q\), over the cell \([x_{j-1/2}, x_{j+1/2}]\):
\[\frac{d}{dt}\int_{x_{j-1/2}}^{x_{j+1/2}} q\,dx = F(x_{j-1/2}) - F(x_{j+1/2})\]
\(x_{j\pm1/2}\): the faces of cell \(j\); \(F\): the flux, here \(c\,q\)
For every cell, so (if \(q\) is smooth) \(\partial_t q + \partial_x F = 0\). Finite volumes keep the integral form.
Conservation laws are statements about volumes; derivatives come second
(LeVeque 2002, Ch. 2; Durran 2010, sec. 5.1)
Divide by \(\Delta x\); the unknown is the cell average \(Q_j = \frac{1}{\Delta x}\int_{\text{cell } j} q\,dx\):
\[\frac{dQ_j}{dt} = -\frac{{\color{#1f5ccc}F_{j+1/2}} - {\color{#1f5ccc}F_{j-1/2}}}{\Delta x}\]
\(Q_j\): cell average; \(F_{j\pm1/2}\): fluxes through its faces; \(\Delta x\): cell width
A finite-volume scheme is a recipe for the fluxes through the faces
(LeVeque 2002, Ch. 4)
Finite volumes conserve mass (and salt, heat, tracers) exactly, up to round-off
(LeVeque 2002, sec. 4.1; Durran 2010, sec. 5.2)
Godunov (1959), in LeVeque’s reconstruct, evolve, average form: reconstruct, evolve exactly, average. For \(c > 0\) the flux is \(F_{j+1/2} = c\,Q_j\): the cell upstream donates what crosses the face
The result is the upwind scheme, now conservative by construction
But: first order, and diffusive
Upwind = donor cell: monotone and conservative, but it smears every front
(Godunov 1959; LeVeque 2002, secs. 4.9–4.10)
Lax–Wendroff flux = donor cell + a correction; a limiter \(\varphi(r)\) switches it off near jumps and extrema:
\[F_{j+1/2} = c\,Q_j + {\color{#1f5ccc}\varphi(r_{j+\frac12})}\,\frac{c}{2}(1 - C)(Q_{j+1} - Q_j)\]
\(C = c\,\Delta t/\Delta x\): Courant number; \(\varphi\): the limiter; \(r\): the ratio of successive jumps
Limiters: second order where smooth, no new extrema near jumps, and still exactly conservative
(Durran 2010, sec. 5.5; LeVeque 2002, secs. 6.11–6.12; van Leer 1977)
Theorem (Godunov 1959). A linear scheme for the advection equation that never creates new extrema (monotonicity preserving) is at most first order accurate.
Order and monotonicity: a linear scheme must choose one
(Godunov 1959; Durran 2010, sec. 5.2)
Exercise 1 — One step by hand. Six cells on a periodic line hold \(Q = (0, 0, 1, 1, 0, 0)\); the flow goes right with \(C = c\,\Delta t/\Delta x = 1/2\). (a) Do one step of the donor-cell scheme, \(F_{j+1/2} = c\,Q_j\). (b) Do one step of Lax–Wendroff, \(F_{j+1/2} = c\left[\tfrac12(Q_j + Q_{j+1}) - \tfrac{C}{2}(Q_{j+1} - Q_j)\right]\). (c) Compare the totals and the largest and smallest values with those of \(Q\).
(d) To hand in: an open channel. The same six cells, now a channel open at both ends: \(Q = (0, 0, 1, 1, 0, 0.5)\), a river brings in \(\Delta t\,F_{1/2}/\Delta x = 0.5\) through the left face, and water leaves through the right face with the donor-cell flux. Do one donor-cell step and show that the total changes by exactly \(\Delta t\,(F_{1/2} - F_{13/2})/\Delta x\), whatever happens inside.
In notebook 06a (exercise 1): open in Colab · download
(LeVeque 2002, Ch. 4)
Conservation is exact for any flux; monotonicity is not: that is the limiter’s job
(LeVeque 2002, Ch. 4; Durran 2010, sec. 5.2)
Notebook 06a (open in Colab · download): fluxes, conservation and limiters in 1D, on a computer.
A speed that varies in space: the total, flux form against advective form
Predict, run, explain: which form keeps the total exactly?
Fluxes through faces: the total changes only through the boundary
(LeVeque 2002, Ch. 4–6; Wicker and Skamarock 2002)
Shallow water: \(\partial_t h + \nabla\cdot(h\mathbf{u}) = 0\). Over a square cell, the divergence theorem:
\[\frac{dh_{ij}}{dt} = -\frac{(hu)_{i+\frac12,j} - (hu)_{i-\frac12,j}}{\Delta x} - \frac{(hv)_{i,j+\frac12} - (hv)_{i,j-\frac12}}{\Delta y}\]
But: the momentum equations need \(v\) at \(u\) points (Coriolis), and vorticity
On the C grid, the mass equation is a finite-volume budget: water is conserved exactly
(Sadourny 1975; Randall 2011)
Shallow water in vector-invariant form, with the potential vorticity \(q = (\zeta + f)/h\) (from here on \(q\) is the potential vorticity, not a tracer):
\[\frac{\partial \mathbf{u}}{\partial t} + q\,\mathbf{k}\times(h\mathbf{u}) = -\nabla\left(gh + \tfrac12|\mathbf{u}|^2\right)\]
\(\zeta\): relative vorticity; \(\mathbf k\): vertical unit vector; \(gh + |\mathbf u|^2/2\): the Bernoulli potential
Gravity waves need no averaging on the C grid; rotation does. Is that a problem?
(Sadourny 1975; Arakawa and Lamb 1977)
Where the unknowns live decides which terms are computed exactly and which need averages
(Arakawa and Lamb 1977; Randall 2011; Cushman-Roisin and Beckers 2011, sec. 9.7)
Exact: \(\omega^2 = f^2\left[1 + L_d^2(k^2 + l^2)\right]\), \(L_d = \sqrt{gH}/f\); each grid replaces \(k\) by a difference over \(\Delta x\) and averages some terms
C: excellent if \(L_d/\Delta x \gtrsim 1\), poor if not; B: fair in both cases; A: noisy when \(L_d\) is resolved
(Arakawa and Lamb 1977; Randall 1994)
Exercise 2 — Can the grid see the deformation radius? Compute \(L_d/\Delta x\) and choose a grid (B or C) with the dispersion figure: (a) a global atmosphere model with \(\Delta x = 9\) km, external mode, \(L_d \approx 3000\) km; (b) the same model, a high internal mode with \(L_d \approx 50\) km; (c) ocean models with \(\Delta x = 80\) km (1°) and \(\Delta x = 7\) km (\(1/12^\circ\)), first baroclinic mode, \(L_d \approx 30\) km.
(d) To hand in: the Adriatic. A tide model of the Adriatic uses \(\Delta x = 5\) km at \(43^\circ\)N (\(f \approx 1.0\times10^{-4}\,\mathrm{s^{-1}}\)). Compute \(L_d = \sqrt{gH}/f\) for the tide in 50 m of water, and for an internal wave of speed 0.5 m/s. Is its C grid adequate for each?
In notebook 06c (exercise 1): open in Colab · download
An eddy of radius \(L_d = 30\) km on two ocean grids, to scale
(Randall 1994; Arakawa and Lamb 1977)
The ratio \(L_d/\Delta x\) chooses the grid: the C grid where the deformation radius is resolved
(Randall 1994; Arakawa and Lamb 1977)
Mass fluxes \(U = \overline{h}^x u\), \(V = \overline{h}^y v\) on the faces, \(q\) at the corners, \(B = gh + K\) at the centres:
\[\begin{aligned} \frac{du}{dt} &= {\color{#1f5ccc}\overline{q\,\overline{V}^x}^{\,y}} - \delta_x B\\ \frac{dv}{dt} &= -{\color{#1f5ccc}\overline{q\,\overline{U}^y}^{\,x}} - \delta_y B \end{aligned}\]
\(\overline{a}^x\): average of two neighbours along \(x\); \(\delta_x\): their difference over \(\Delta x\); \(K = |\mathbf u|^2/2\)
Two unstable jets roll up into vortices: vorticity, 128 × 128 cells (notebook, section 6)
Mimic the continuous invariants on the grid: mass exactly, and energy or enstrophy
(Sadourny 1975; Arakawa and Lamb 1977)
Notebook 06b (open in Colab · download): Sadourny’s scheme on the C grid in 2D, on a computer.
A bump of water adjusts: waves leave, a balanced vortex stays
Predict, run, explain: which way does the water turn around the bump?
A shallow water model in a page of code, checked against geostrophy and Rossby’s adjustment
(Sadourny 1975; Peixoto and Schreiber 2019)
But: a real sea has coasts. How does a C grid handle walls, and an open boundary?
The model adjusts as Rossby’s theory says, and conserves what it was built to conserve
(Randall 1994; Sadourny 1975)
\[\begin{aligned} \frac{\partial \mathbf{u}}{\partial t} + f\,\mathbf{k}\times\mathbf{u} &= -g\nabla\eta - r\,\mathbf{u}\\ \frac{\partial \eta}{\partial t} + \nabla\cdot(H\mathbf{u}) &= 0 \end{aligned}\]
\(\eta\): sea level; \(H(y)\): depth at rest; \(r\): linear friction rate
On the C grid, a coast is simply a face with zero flux
(Cushman-Roisin and Beckers 2011, sec. 9.8; Hendershott 1981)
Notebook 06c (open in Colab · download): Laplace’s tidal equations on a C grid, in an idealized Adriatic.
The result to expect: M2 amplitude (colour) and hours of high water after Otranto (lines)
Predict, run, explain: the tide enters at Otranto. Along which coast does it travel north?
A tide model of a sea in a page of code: walls are faces with zero flux
(Hendershott 1981; Janeković and Kuzmić 2005)
Laplace’s tidal equations (with friction) on a C grid of finite volumes: the amphidrome appears by itself
(Janeković and Kuzmić 2005; Hendershott 1981)
The ideas of today, cells, fluxes and a C grid, scale up to the sphere
(Ringler et al. 2010; Skamarock et al. 2012)
Notebooks 06a (open in Colab · download), 06b (open in Colab · download) and 06c (open in Colab · download): exercise 1 comes back in 06a, exercise 2 in 06c.
Finite volumes keep mass by construction; on the C grid, energy or enstrophy too
Reading: (Durran 2010, Ch. 5; LeVeque 2002; Randall 1994; Sadourny 1975)