Chapter 15 · Tangent linear and adjoint models
Overview
Monday’s forecast for Thursday was badly wrong. Which part of Monday’s initial state was responsible, and by how much would each part have had to change to fix it?
That is a question about a gradient — the derivative of one forecast quantity with respect to every component of the initial state. The obvious way to get it is to perturb each component in turn and re-run the model. For Lorenz 63 that is four runs. For an operational model with state variables it is a hundred million runs, and it is never going to happen.
The adjoint delivers the whole gradient in one extra model-sized integration, at a cost independent of the state dimension. That single fact is why 4D-Var (chapter 18) exists, why singular vectors (chapter 16) are computable, and why targeted observing is a real technique rather than a thought experiment.
| State dimension | Finite differences | Adjoint |
|---|---|---|
| 3 (Lorenz 63) | 4 model runs | 2 |
| 40 (Lorenz 96) | 41 | 2 |
| (operational NWP) | 2 |
The model
The tangent linear propagator satisfies along the nonlinear trajectory. It is state-dependent — the same flow-dependence chapter 7 measured as finite-time exponents — and it is linear, so once you have it the effect of any small perturbation is a matrix-vector product.
One detail is easy to get wrong and hard to notice: the model you actually run is the discretised one, so the tangent must be stepped through the same RK4 stages, with evaluated at each intermediate state. Freezing across the step leaves an inconsistency between the tangent and the discrete map.
The adjoint is defined by the identity . Under the Euclidean inner product , which makes it look trivial — but the identity is the definition, and under a weighted norm the adjoint acquires the weights, which is where operational adjoints go wrong.
Two limits, and two tests
The linearisation has a shelf life. The neglected term is and grows like , so the window over which the tangent model is trustworthy is
measured here at 1.18 MTU per e-fold of against . This is the logarithmic law for the third time — chapter 7 found it in the growth rate, chapter 20 in the forecast horizon, and here it sets how long a 4D-Var assimilation window can be. A hundredfold smaller perturbation buys about five extra MTU of linearity, not a hundredfold longer window.
There are exactly two tests worth running, and you need both:
- The adjoint identity, which must hold to machine precision () because it is algebraic rather than approximate. It tests against and says nothing about whether is right.
- The finite-difference check, in which the relative discrepancy against the true nonlinear difference must fall linearly with the perturbation amplitude — slope 1 on log–log, down to round-off. This is what catches a wrong Jacobian.
An adjoint that passes only the first can be the perfect adjoint of the wrong tangent linear model.
Three bugs these tests caught, in this book
Not hypothetical. All three were live in chaoslib during writing, and each was found by
a test rather than by reading the code:
- A floor that no smaller perturbation removed — a constant 4.6 % error, independent of amplitude, from linearising the continuous flow instead of the discrete map.
- A zero-length window that advanced anyway —
max(1, round(tau/dt))took one step when , corrupting essentially every cycling 4D-Var gradient by ~6.8 %. Found only when chapter 20’s 4D-Var underperformed for no visible reason. - A propagator covering the wrong interval whenever was not an exact multiple of the step — caught by Liouville’s theorem, , which pins the interval independently of the trajectory and is checked live in the notebook.
Exercises
Analytic. Show that , and hence that the cost of the gradient is independent of . Then derive the adjoint under a weighted inner product and say what changes.
Computational. Verify Liouville’s theorem for this system: must equal for every trajectory and every . Why does that test constrain the interval the propagator covers, when the trace identity of chapter 7 constrains the exponents?
Exploratory. Move the lead time from 0.25 to 4 MTU and watch the validation curve shift upward while its slope stays at 1. Accuracy and correctness are different properties — only one of them is a bug. At what amplitude does the round-off floor set in, and what does that imply about testing an adjoint with ?
Further reading
- Errico, R. M. (1997). What is an adjoint model? Bulletin of the American Meteorological Society, 78, 2577–2591 — the clearest introduction there is.
- Kalnay, E. (2003). Atmospheric Modeling, Data Assimilation and Predictability, §6.2–6.3.
- Giering, R. and Kaminski, T. (1998). Recipes for adjoint code construction. ACM TOMS, 24, 437–474 [citation needed: pages].
- Palmer, T. and Hagedorn, R., eds. (2006). Predictability of Weather and Climate, ch. 5 [citation needed: pages].