🌀 Geophysical Fluid Dynamics

How rotation and stratification organise the atmosphere and ocean — why the wind blows along the pressure contours rather than across them, why weather systems and ocean eddies come out the size they do, and why a fluid on a spinning planet behaves unlike any fluid in a laboratory. An interactive textbook, with every chapter runnable in the browser.

📖 An interactive Geophysical Fluid Dynamics Textbook

Twenty-four chapters across seven parts: from kinematics and the governing equations, through geostrophic balance, quasi-geostrophy and stratified waves, to the instabilities that make storms and eddies, geostrophic turbulence, and the wind-driven and overturning circulations. Every chapter runs Python in your browser — nothing to install, no account, no server. Free and open, for anyone.

Open the textbook →

Notebooks

The two notebooks below are chapters 6 and 16 of the interactive textbook, reproduced here. Open the book for the full table of contents.

Rotating Fluids

Rotating Shallow Water & Geostrophic Adjustment

Perturb a rotating fluid away from rest and two things happen at once: fast inertia-gravity waves radiate the imbalance outward, while rotation traps part of the disturbance behind as a standing, balanced flow. This is how almost every localized disturbance in the atmosphere or ocean — a convective burst, a wind-stress event, an eddy shed from an unstable current — settles into the slowly evolving balanced motion. The deformation radius decides the outcome, and the conserved potential vorticity predicts the balanced end state before you integrate a single time step.

L_R = c / f₀  ·  q = ζ − η̂ (conserved)
  • Inertia-gravity waves radiating from a localized disturbance
  • The deformation radius sets which disturbances survive
  • PV inversion predicts the balanced end state in advance
  • Presets: a small burst disperses, a large surge survives
  • Pseudo-spectral RK4 on a doubly-periodic domain
▶ View Notebook ✎ Edit & Run ⤓ Jupyter (.ipynb)

The download installs its own dependencies in the first cell. Its sliders are static — edit value= and re-run to change a parameter.

Instabilities

Baroclinic Instability

Mid-latitude storms and ocean mesoscale eddies do not draw their energy from horizontal shear. They draw it from the potential energy locked up in a sloping temperature surface — the same thermal-wind shear that balances the mean flow. This chapter builds both classic models: the Eady problem, whose eigenvalue solution gives a closed growth-rate curve from stratification and shear alone, and the two-layer Phillips model, whose nonlinear evolution shows what the instability actually does — grow, peak, break and equilibrate. Arguably the single most consequential instability in geophysical fluid dynamics.

σ = μ c_i, μ = k N H / f₀  ·  q_i = ∇²ψ_i + F(ψ_j − ψ_i) + βy
  • Eady growth rate from stratification and shear alone
  • Benchmarked: μ_max ≈ 1.61, σ_max ≈ 0.31, cutoff μ_c ≈ 2.399
  • Two-layer Phillips model: grow, peak, break, equilibrate
  • A precomputed life cycle to scrub through
  • The same mechanism at storm-track and mesoscale-eddy scales
▶ View Notebook ✎ Edit & Run ⤓ Jupyter (.ipynb)

The download installs its dependencies and fetches the precomputed life cycle in its first cells. Its sliders are static — edit value= and re-run to change a parameter.