Adjoint models: Theory ATM 569 Fovell Fall 2015 (See course notes, Chapter 15) 1 Motivation • We often look at a forecast and wonder “how could this be changed”, especially if it involves model error • Often our strategy involves posing a hypothesis that explains the error’s origin, changing the model initial conditions and/or model parameters to compensate, and running the model… usually over and over and over • Ideally, we want an active, dynamic tracer that shows how the error came about in the model – which fields, where and when • The adjoint model is a simplified version of the forward model that runs backwards • The forward model predicts temperature, pressure, winds, etc., forward in time • “The future evolves from the past” • The adjoint model predicts sensitivity to temperature, pressure, winds, etc.., backwards in time • “Traces error back to its roots” 2 Background: simple problem • 1D wave equation: M real grid points, 1 prognostic variable, 2 time level scheme • Rewrite in explicit form c>0 3 Background: matrix form • Write in matrix form (real points j = 1, 2, …, M) WRONG Mx1 MxM Mx1 For this simple problem, same C every time step. Not true for more realistic problems. 4 Background: matrix form • Write in matrix form (real points j = 1, 2, …, M) Mx1 Matrix fixed MxM Mx1 For this simple problem, same C every time step. Not true for more realistic problems. 5 Background: integrate model • Initial condition is u0. Integrate for N time steps. We can relate the final forecast to the initial condition through the transition matrix PN 6 Background: generalize model • x is p prognostic fields x M gridpoints • p = 4+ (i.e., u, w, q’, p’,…) • M = NX x NY x NZ 7 Tangent linear model (TLM) #1 • A simple model equation u = prognostic variable = model parameter • Examples: 1D wave equation Exponential decay 8 Tangent linear model (TLM) #2 • Run the model twice, using two different initial conditions and/or two different values for parameter . • • • • Control solution uC(x,z,t) Alternative solution uA(x,z,t) Control parameter C Alternative parameter A • Difference between simulations and their parameters 9 Tangent linear model (TLM) #3 • You can always subtract two simulations. • The TLM is a model that attempts to estimate the difference between the control and alternative runs, based on the control run Instead of… calculate run run TLM run estimate run …do this Why? We’ll see… 10 Tangent linear model (TLM) #4 • TLM can be formed via perturbation analysis, and as usual presumes the perturbations are (& remain) small so higher order terms absent1 • Uses Taylor series to approximate u” for 1See course notes for qualifications and disclaimers so the TLM is 11 Tangent linear model (TLM) #5 • The perturbation model has been linearized (no u’’’’ term) and is constrained to (“tangent to”) the control run (uC, C). • “Tangent linear model” Ignore for simplicity • Discretize TLM and write in matrix form Cn based on control model run - Run control simulation - Archive Cn every time step - Initialize and run TLM 12 Tangent linear model (TLM) #6 • Integrate the TLM. Initial condition is u’’0 Cn based on control model run - Run control simulation - Archive Cn every time step - Initialize and run TLM 13 Tangent linear model (TLM) #7 • Generic form. x” is p variables by M points. Initial condition is x’’0 14 Forecast aspect J • The forecast aspect J is something about the control run we want to examine • How did some feature appear? • Why did some error occur? • A J at time N is a scalar function of the control run at that time • JN = J(xN) • JN can be changed by perturbing the control run (ignoring higher order terms) 15 Change of forecast aspect ∆JN Change of J at time N p variables M locations Perturb a variable/location It only changes J if J is sensitive to it Perturbation applied to variable/location xl at time N Sensitivity of J to xl at time N 16 Change of forecast aspect ∆JN Let JN be surface pressure at one point, say 30˚N 60˚W, at time N ∆JN is how surface pressure at that place and time can be changed At time N, ∆JN is sensitive to only one variable and location – pressure at that location Therefore, of the p x M terms in the sum, only one sensitivity is nonzero, and it is equal to 1 Thus ∆JN is KNOWN information and is TRIVIAL 17 Making this less trivial • Rewrite as an inner product • Postulate the adjoint model, a prediction model for sensitivity x* From control run Take the TLM model and (a) Replace x’’ by x* (b) Transpose Cn (c) Operate it backwards Note CnT ≠ Cn-1, so we are not running TLM backwards 18 TLM vs. adjoint The control run “information” used to step perturbations forward in time is transposed and used to step sensitivity backwards in time 19 TLM and adjoint • Relating initial and final times for TLM and adjoint models • Next, we will make use of the adjoint property • This is how the adjoint model got its name… 20 The recipe trivial by definition relate final to initial time invoke adjoint property relate final to initial time Note therefore that 21 The recipe KNOWN TRIVIAL KNOWN NOT TRIVIAL! Tells me what my perturbations x’’ have to be at the initial time to get that change to J at time N 22 Integrating the adjoint (1) Run the control model to time N and save Cn every time step (2) Initialize adjoint at time N (3) Integrate adjoint backwards, reading in Cn from archive You DON’T need to integrate the TLM 23 To summarize • The control simulation is made by integrating a (likely nonlinear) model forward in time, producing forecasts of temperature, pressure, winds, etc.. • The tangent linear model is a linearized version of the forward model, producing forecasts of perturbations (deviations) from the control forecast • The inescapable assumption is the deviations are small • The adjoint model is a transposed version of the TLM • • • • The adjoint model runs backwards in time The adjoint propagates sensitivity to temperature, pressure, winds, etc., backwards It represents an active, dynamical “tracer” It also must assume that deviations are small • Our simple examples involved differentiating the model differential equation to create the TLM. In practice, we differentiate the model code. 24