6.5 Ocean Modeling

Ocean general circulation models (OGCMs) solve the equations of fluid motion on a discrete grid to simulate ocean currents, temperature, salinity, and biogeochemistry. They are essential tools for understanding climate variability, projecting future change, and interpreting observational data.

Primitive Equations for the Ocean

The primitive equations are derived from the full Navier–Stokes equations with two key simplifications: the Boussinesq approximation (density variations are neglected except in the buoyancy term) and the hydrostatic approximation (vertical accelerations are small compared to gravity).

Momentum Equations

$$\frac{Du}{Dt} - fv = -\frac{1}{\rho_0}\frac{\partial p}{\partial x} + A_H\nabla_H^2 u + \frac{\partial}{\partial z}\left(A_z\frac{\partial u}{\partial z}\right)$$

$$\frac{Dv}{Dt} + fu = -\frac{1}{\rho_0}\frac{\partial p}{\partial y} + A_H\nabla_H^2 v + \frac{\partial}{\partial z}\left(A_z\frac{\partial v}{\partial z}\right)$$

Hydrostatic, Continuity & Tracer

$$\frac{\partial p}{\partial z} = -\rho g \quad \text{(hydrostatic)}$$

$$\frac{\partial u}{\partial x} + \frac{\partial v}{\partial y} + \frac{\partial w}{\partial z} = 0 \quad \text{(continuity)}$$

$$\frac{DT}{Dt} = K_H\nabla_H^2 T + \frac{\partial}{\partial z}\left(K_z\frac{\partial T}{\partial z}\right) + Q_T \quad \text{(temperature)}$$

Equation of State

The system is closed by an equation of state relating density to temperature, salinity, and pressure:$\rho = \rho(T, S, p)$. The TEOS-10 standard (IOC/UNESCO) provides the most accurate formulation, using Conservative Temperature and Absolute Salinity.

Vertical Coordinate Systems

z-coordinates

Fixed depth levels. Simple to implement. Good for the open ocean. Used by MOM6, NEMO, POP. Suffers from staircase representation of topography and spurious diapycnal mixing on sloping isopycnals.

Sigma (terrain-following)

Levels follow the bottom topography: $\sigma = z/H(x,y)$. Excellent near coasts and over shelves. Used by ROMS, FVCOM. Can produce pressure gradient errors over steep topography.

Isopycnal

Layers follow constant density surfaces. Minimises spurious diapycnal mixing. Natural for tracking water masses. Used by HYCOM (hybrid), GOLD. Challenges where isopycnals outcrop or in weakly stratified regions.

Major Ocean Models

MOM6 (GFDL)

Modular Ocean Model, version 6. z* and hybrid isopycnal coordinates. ALE (Arbitrary Lagrangian-Eulerian) remapping. Used in GFDL's CM4 and ESM4 climate models.

NEMO (Europe)

Nucleus for European Modelling of the Ocean. z-coordinates with partial cells. Used in CMIP6 models (IPSL, CNRM, EC-Earth). Includes sea ice (SI3) and biogeochemistry (PISCES).

ROMS (Regional)

Regional Ocean Modeling System. Sigma-coordinates. Excellent for shelf and coastal processes. Widely used for fisheries, pollution transport, and regional climate downscaling.

POP & HYCOM

POP: z-level, used in CESM. HYCOM: hybrid vertical coordinates (isopycnal in deep, z near surface, sigma on shelves). Used by the U.S. Navy for operational forecasting.

Grid Types & Subgrid Parameterisation

Arakawa Grid Types

Variables (u, v, h, T) are staggered differently on the grid cell:

B-grid: u,v at corners; T,h at centre. Used by GFDL MOM4, POP.
C-grid: u on east face, v on north face, T at centre. Used by NEMO, MOM6, ROMS. Best for resolving gravity waves.

Key Parameterisations

GM90 (Gent–McWilliams)

Parameterises the effect of unresolved mesoscale eddies by flattening isopycnal surfaces. Introduces an eddy-induced transport velocity:

$\mathbf{u}^* = -\nabla \times (\kappa_{GM}\,\mathbf{s})$

where $\mathbf{s}$ is the isopycnal slope and $\kappa_{GM} \sim 10^3\;\text{m}^2/\text{s}$.

KPP (K-Profile Parameterisation)

Models turbulent vertical mixing in the surface boundary layer. Prescribes a mixing coefficient profile:

$K(z) = h\,w(\sigma)\,G(\sigma)$

where $h$ is boundary layer depth, $\sigma = -z/h$, and $G$ is a shape function.

Resolution, Coupled Models & Data Assimilation

1° (~100 km)

Climate models. Eddies parameterised. Centuries-long runs.

0.25° (~25 km)

Eddy-permitting. Some eddies resolved. Multi-decade runs.

0.1° (~10 km)

Eddy-resolving. Computationally expensive. Decade-scale runs.

Coupled Climate Models

In Atmosphere–Ocean General Circulation Models (AOGCMs) and Earth System Models (ESMs), the ocean component is coupled to atmospheric, sea ice, land surface, and biogeochemical models through a coupler that exchanges fluxes of heat, freshwater, momentum, and tracers. Major coupled systems include CESM (NCAR), GFDL-ESM (NOAA), UKESM (Met Office), and IPSL-CM (France).

Data Assimilation

Ocean reanalyses combine models with observations (Argo floats, satellite SST/SSH, ship data) using techniques such as Optimal Interpolation (OI), 3D-Var, 4D-Var, and Ensemble Kalman Filters. The cost function minimised in variational methods is:

$$J(\mathbf{x}) = (\mathbf{x} - \mathbf{x}_b)^T \mathbf{B}^{-1}(\mathbf{x} - \mathbf{x}_b) + (\mathbf{y} - H(\mathbf{x}))^T \mathbf{R}^{-1}(\mathbf{y} - H(\mathbf{x}))$$

where $\mathbf{x}_b$ is the background state, $\mathbf{y}$ are observations,$H$ is the observation operator, and $\mathbf{B}$, $\mathbf{R}$ are the background and observation error covariances.

Derivation: Boussinesq Approximation

Step 1: Full Navier-Stokes Momentum Equation

Begin with the compressible Navier-Stokes momentum equation where density appears in every term:

$$\rho \frac{D\mathbf{u}}{Dt} = -\nabla p + \rho \mathbf{g} + \mu \nabla^2 \mathbf{u}$$

Step 2: Decompose Density into Reference and Perturbation

Write density as a constant reference value plus a small perturbation: $\rho = \rho_0 + \rho'$ where $|\rho'| \ll \rho_0$. Similarly decompose pressure into hydrostatic and dynamic parts:

$$p = p_0(z) + p', \quad \text{where } \frac{dp_0}{dz} = -\rho_0 g$$

Step 3: Substitute and Neglect Small Terms

Substituting into the momentum equation and dividing by $\rho_0$. In the inertial term $\rho D\mathbf{u}/Dt$, replace $\rho$ by $\rho_0$ since $\rho'/\rho_0 \ll 1$. However, in the gravity term, keep $\rho'$ because it multiplies $g$:

$$\rho_0 \frac{D\mathbf{u}}{Dt} = -\nabla p' - \rho' g \hat{z} + \mu \nabla^2 \mathbf{u}$$

Step 4: Resulting Boussinesq Equations

Dividing through by $\rho_0$ yields the Boussinesq momentum equation. The buoyancy $b = -g\rho'/\rho_0$ drives vertical motion while the continuity equation simplifies to incompressible form:

$$\frac{D\mathbf{u}}{Dt} = -\frac{1}{\rho_0}\nabla p' + b\hat{z} + \nu \nabla^2 \mathbf{u}, \quad \nabla \cdot \mathbf{u} = 0$$

Step 5: Physical Justification

In the ocean, $\rho'/\rho_0 \sim 0.01$ (density varies by ~1% from surface to abyss), so neglecting $\rho'$ in inertial terms introduces <1% error. But in the buoyancy term, even small $\rho'$ multiplied by $g \approx 9.81$ m/s$^2$ produces the dominant vertical forcing that drives ocean circulation.

Derivation: Reynolds-Averaged Navier-Stokes (RANS)

Step 1: Reynolds Decomposition

Decompose each variable into a time-mean (overbar) and turbulent fluctuation (prime): $u = \bar{u} + u'$, $v = \bar{v} + v'$, $p = \bar{p} + p'$. By definition, $\overline{u'} = 0$.

$$u_i = \bar{u}_i + u_i', \quad \overline{u_i'} = 0$$

Step 2: Substitute into the Momentum Equation

Insert the decomposition into the Boussinesq Navier-Stokes equation and consider the nonlinear advection term $u_j \partial u_i / \partial x_j$:

$$(\bar{u}_j + u_j')\frac{\partial (\bar{u}_i + u_i')}{\partial x_j} = \bar{u}_j \frac{\partial \bar{u}_i}{\partial x_j} + \bar{u}_j \frac{\partial u_i'}{\partial x_j} + u_j' \frac{\partial \bar{u}_i}{\partial x_j} + u_j' \frac{\partial u_i'}{\partial x_j}$$

Step 3: Time-Average and Extract Reynolds Stress

Taking the time average, terms linear in fluctuations vanish ($\overline{u'} = 0$). The quadratic fluctuation term survives as the Reynolds stress tensor. Using the continuity equation $\partial u_j'/\partial x_j = 0$:

$$\overline{u_j' \frac{\partial u_i'}{\partial x_j}} = \frac{\partial}{\partial x_j}\overline{u_i' u_j'} \equiv -\frac{1}{\rho_0}\frac{\partial \tau_{ij}^R}{\partial x_j}$$

Step 4: The RANS Equation

The resulting Reynolds-averaged momentum equation has the same form as the original but with an additional Reynolds stress divergence term requiring parameterisation (closure):

$$\frac{\partial \bar{u}_i}{\partial t} + \bar{u}_j \frac{\partial \bar{u}_i}{\partial x_j} = -\frac{1}{\rho_0}\frac{\partial \bar{p}}{\partial x_i} + \bar{b}\delta_{i3} + \nu \nabla^2 \bar{u}_i - \frac{\partial \overline{u_i' u_j'}}{\partial x_j}$$

Step 5: Eddy Viscosity Closure

The closure problem is addressed by parameterising Reynolds stresses using an eddy viscosity $A$ (analogous to molecular viscosity but orders of magnitude larger), yielding the form used in ocean models:

$$-\overline{u_i' u_j'} = A_H \left(\frac{\partial \bar{u}_i}{\partial x_j} + \frac{\partial \bar{u}_j}{\partial x_i}\right), \quad \text{with } A_H \sim 10^2\text{--}10^4 \;\text{m}^2/\text{s}$$

Python: 2D Shallow Water Model & Arakawa C-Grid Demo

Python: 2D Shallow Water Model & Arakawa C-Grid Demo

Python

!/usr/bin/env python3

script.py72 lines

Click Run to execute the Python code

Code will be executed with Python 3 on the server

Fortran: 1D KPP Vertical Mixing Model

The K-Profile Parameterisation (Large, McWilliams & Doney, 1994) models the oceanic surface boundary layer. This program computes the vertical mixing profile for temperature given surface forcing (wind stress and buoyancy flux).

Fortran: 1D KPP Vertical Mixing Model

Fortran

============================================================

program.f90104 lines

Click Run to execute the Fortran code

Code will be compiled with gfortran and executed on the server