Presentation on theme: "Introduction to Adjoint Methods in Meteorology"— Presentation transcript:
1Introduction to Adjoint Methods in Meteorology Rolf LanglandData Assimilation SectionNaval Research LaboratoryMonterey, CAIncluding Material Provided byDr. Ronald M. Errico (NASA-UMBC)JCSDA Summer Colloquium on Data AssimilationSanta Fe, N.M., 31 July 2012
2Adjoint Methods Introduction What is an adjoint modelExamples of adjoint equationsInterpretation of adjoint sensitivityDevelopment / testing of adjoint codeMisunderstandings about adjoint methodsPlease ask questions during presentation if something is not clear!
3What is an Adjoint Model? [NWP context] The transpose of a tangent linear version of a forecast modelIt can be used to estimate the sensitivity of a forecast aspect (J) with respect to model initial conditions and parametersSensitivity information is useful for short-range forecasts (72 hr or less), subject to tangent-linear approximations
4Why use adjoint models ?Require information about sensitivity to initial conditions, but cannot construct the inverse of a numerical forecast model …An adjoint model can provide good estimates of initial condition sensitivity, consistent with actual dynamics of nonlinear forecast model (group velocity, etc.)Difficult or impossible to obtain this information by other methods
5Adjoint ApplicationsSensitivity of Forecast to Initial Conditions and Boundary Conditions – Key analysis errorsObservation Impact InformationTargeted Observing GuidanceVariational Data Assimilation – 4D-VarGeneration of Perturbations for Ensemble ForecastingOptimal Perturbations and Singular Vectors
6Adjoint models exist for: Global weather prediction modelsRegional modelsOcean modelsData assimilation proceduresObservation operatorsAdjoint codes are used in one form or another at every operational NWP forecast center
7Forecast and Analysis Procedure Observation(y)DataAssimilationSystemAnalysis(xa)ForecastModelForecast(xf)Background(xb)Adjoint of Forecast and Analysis ProcedureObservationSensitivity(J/ y)Adjoint ofthe DataAssimilationSystemAdjoint of theForecast ModelTangentPropagatorAnalysisSensitivity(J/ xa)Gradient ofCost FunctionJ: (J/ xf)BackgroundSensitivity(J/ xb)Observation Impact<y-H(xb)> (J/ y)What is the impact of the observations on measures of forecast error (J) ?
8Data Assimilation Equation with K in observation space BACKGROUND (6h) FORECASTANALYSISPost-multiplierSolver (self-adjoint)OBSERVATIONSTemperatureWindsPressureThe analysis, Xa can be changed by perturbations of the observations (δy) or the background (δ Xb)An adjoint can be used to quantify this sensitivity
9Adjoint of Data Assimilation Equation Sensitivity to Observations:Adjoint of forecast model produces sensitivity toSensitivity to Background:see Baker and Daley 2000, QJRMS
10Adjoint Operator - Linear algebra 101 The inner (dot) product of two vectors = a scalarIf L is an m x n matrix, then L* = LTNote: transpose is not the same as inverse !
11TLM and Adjoint Equations The linear operator L propagates a perturbation vector forward in timeTLMfinal time initial timeL is a tangent linear version of a nonlinear model, Mperturbations of state variablesThe adjoint operator LT propagates a sensitivity gradient vector backward in time – sensitivity of J to all elements of X at initial timeAdjointinitial time final timesensitivity gradientsLT is the transpose of L
12Forecast Response Function (J) J can be any differentiable function of the model state variables that comprise XfExamples:Surface pressureTemperature, wind component, specific humidityVorticity, divergence, enthalpyKinetic energyForecast error (f –a) or (f-a)2Energy-weighted forecast error normNot valid: J=Anomaly Correlation Coefficient𝜕(𝐴𝐶𝐶) 𝜕𝐗𝑓 = undefined
13Estimating δJ using TLM and Adjoint 𝛿𝐽= 𝜕𝐽 𝜕𝐗𝑓 ,𝐋𝛿𝐗0 = 𝜕𝐽 𝜕𝐗𝑓 ,𝛿𝐗𝑓𝛿𝐽= 𝛿𝐗0,𝐋T 𝜕𝐽 𝜕𝐗𝑓 = 𝛿𝐗0, 𝜕𝐽 𝜕𝐗0AdjointEquivalent to a 1st-order Taylor Seriesδx0 = can be any real or hypothetical perturbation13
14Obtain sensitivity to initial conditions using an adjoint model The trajectory (analysis and forecast values of state variables) of the nonlinear forecast model are saved (at every time step if possible) from t=0 to t=fThe adjoint cost function (J) is definedJ J/T, J/u, J/v, J/ps at t=fThe adjoint model is integrated backwards in time to obtain:J/T, J/u, J/v, J/ps at t=0
15Adjoint sensitivity example Navy COAMPS model J = kinetic energy in lower troposphereAnimation is𝜕𝐽 𝜕𝑢 at 700hPa, from 36hr to 0 hr
16Forward (conventional) vs. adjoint sensitivity procedure In a forward-in-time sensitivity procedure, we change the initial conditions (or observations) and evaluate the effect on the forecast (OSE)In an adjoint sensitivity procedure we select the forecast aspect (J) and evaluate the sensitivity to the initial conditions (or observations)
17Adjoint Sensitivity Analysis Impacts vs. SensitivitiesA single impact study yields exact response measures(J) for all forecast aspects with respect to the particularperturbation investigated.A single adjoint-derived sensitivity yields linearizedestimates of the particular measure (J) investigatedwith respect to all possible perturbations.
18The forecast error norm A useful way to combine errors of wind, temperature, humidity and surface pressure into a costfunction𝐽=Ʃ𝑖,𝑗,𝑘 0.5 𝐂u uf−ua 2+𝐂v vf−va 2+𝐂T Tf−Ta 2+𝐂q qf−qa 2+𝐂p pf−pa 2 𝐂u uf−ua 2+𝐂v vf−va 2+𝐂T Tf−Ta 2+𝐂q qf−qa 2+𝐂p pf−pa 2𝐂u 𝐂v 𝐂T 𝐂q 𝐂p are weighting functions that transform the errors of winds, temperature, humidity and pressure into units of energy [J kg-1], accounting for grid volume size/mass …The adjoint model starting condition is then …for example𝜕𝐽 𝜕𝑢𝑓 = 𝐂u uf−ua , at all grid points (i,j,k), units = Jkg-1m-1sEnergy norm ref: Rabier et al. 1996, QJRMS
19Sensitivity summary field Then, to display of initial condition sensitivity, we can transform the gradients back into units of energy and combine the winds, temperature and pressure sensitivitiesS0=Ʃ𝑖,𝑗,𝑘 𝐂 u 𝜕𝐽 𝜕𝑢0 + 𝐂 v 𝜕𝐽 𝜕𝑣0 + 𝐂 T 𝜕𝐽 𝜕𝑇0 + 𝐂 q 𝜕𝐽 𝜕𝑞0 + 𝐂 p 𝜕𝐽 𝜕p0-1-1-1-1-1𝐂u 𝐂v 𝐂T 𝐂q 𝐂p are inverses of the weighting functions, that transform the sensitivity gradients of winds, temperature, humidity and pressure into units of energy [J kg-1], accounting for grid volume size/mass-1-1-1-1-1
20Sensitivity of NOGAPS 72-h forecast error to the initial T,u,v,ps fields 00 UTC 10 February 2002 J kg-1In the extratropics, the leading SV or ASG usually have max amplitude in the lower troposphere, tilt into the prevailing westerlies, and correspond to growing baroclinic disturbances. (for these choices of J).Not measures of analysis error, but indicate directions along which the analysis error is most likely to grow rapidly. May not be largest analysis error, but component that grows most rapidly.It is these dynamically sensitive regions that should be most carefully observed.
22Optimal correction of initial 500mb temperature based on adjoint sensitivity gradient to improve 72-hr forecast of east coast storm
23Optimal correction of initial 300mb u-wind based on adjoint sensitivity gradient to improve hr forecast of east coast storm
24300mb u-wind – Comparison of initial conditions - Original IC – this produces large forecast error“Corrected IC” – this produces small forecast error
25L L L L NOGAPS Sea-Level Pressure Forecasts and Analyses 72-hr forecast from 12Z 22 Jan 2000Forecast with Adjoint-based IC Correction (+72hr)Operational Forecast (+72hr)LLLL
26Plots of sensitivity gradient magnitude and grid resolution Gradient of error energy with respect to Tv 24-hours earlier Units: Jkg-1K-11 x 1.25 degree lat-lon grid0.5 x degree lat-lon gridSensitivity magnitude on this grid is larger because a perturbation of initial conditions at any grid point represents a larger area / volumeThe same sensitivity gradient has smaller magnitude on this grid because of finer resolution –The sum of sensitivity for equal areas is independent of grid resolutionProvided by R. Todling
27Singular Vectors in 72-hr East Coast Storm Forecast Initial Time Total Energy 12Z 22 Jan 2000Final Time Sfc Pressure 12Z 25 Jan 2000SV 1SV 2SV 3
28Example of TLM and Adjoint Derivation Nonlinear Equations1st order Linearization
29Example of TLM and Adjoint Derivation Tangent Linear EquationsAdjoint Equations (LT)L = the Jacobian of the nonlinear model operatorCan be derived continuous -> discrete ordiscrete -> discreteAutomatic adjoint code generatorsShallow water equations
30Nonlinear model and tangent linear model trajectories The trajectory of the TLM is an approximation of the nonlinear trajectoryTLMNLMThe nonlinear forecast trajectory is saved at specified time intervals and used in the TLMThe TLM is tangent to the nonlinear trajectory at every time step where an update is provided – it is not a purely linear calculationTime
31Development of TLM and Adjoint Model Code OPTIONS:Develop TLM code directly from nonlinear model code, then develop adjoint codeDevelop TLM versions of nonlinear model original equations, then develop TLM and adjoint codeOption 1 is the best method ….
32Why develop the TLM from the nonlinear model code? Eventually a TLM and adjoint code will be necessary anywayThe code itself is the most accurate description of the model algorithmIf the model algorithm creates different dynamics than the original equations being modeled, for most applications it is the former that are desirable and only the former that can be validated
34Considerations in development of TLM and Adjoint code TLM and Adjoint models are straight-forward (although tedious) to derive from NLM code, and actually simpler to developIntelligent approximations can be made to improve efficiencyTLM and adjoint codes are simple to test rigorously4. Some outstanding errors and problems in the NLM are typicallyrevealed when the TLM and Adjoint are developed5. Some approximations to the NLM physics are generally necessary
35TLM validation Comparison to nonlinear model Does the TLM or Adjoint model tell us anything aboutthe behavior of perturbation growth in the nonlinearmodel that may be of interest?
36Linear vs. Nonlinear results with moist physics, 24-hr forecasts TLMNLMNon-ConvectivePrecip. ci=0.5mmNon-ConvectivePrecip. ci=0.5mmTLMNLMConvectivePrecip. ci=0.2mmConvectivePrecip. ci=0.2mm
37Adjoint model verification Gradient check Adjoint model starting condition and IC sensitivity gradient𝛿𝐗𝑓, 𝜕𝐽 𝜕𝐗𝑓 = 𝛿𝐗0, 𝜕𝐽 𝜕𝐗0Evolved TLM perturbation and TLM starting conditionNote that the dot product in the above equation is computed for all i,j,k in the model domain. This is a fundamental test to determine if the TLM and adjoint are coded correctly
38Adjoint method accuracy Quantitative accuracy best for small perturbations and short forecastsOften, qualitatively useful information can be obtained for large perturbations in forecasts as long as 3-5 days…for example, when applied to mid-latitude winter storms – synoptic-scalesAccuracy is less for highly non-linear flows and smaller-scalesAdjoint accuracy is equivalent to that of the TLM
39Tangent Linear vs. Nonlinear Results In general, agreement between TLM and NLM resultswill depend on:Amplitude of perturbationsStability properties of the reference stateStructure of perturbationsPhysics involvedTime period over which perturbation evolvesMetric used for comparison
40Issues with physics in TLM and adjoint Parts of the NLM code may be non-differentiable, requiring approximations in the TLM and adjoint2. Numerical instabilities may occur in the TLM as a result of physics linearization3. Some physical parameterizations are much more suitable than others for linearization4. Development of the TLM and adjoint may uncover problems with the nonlinear model physics
41Example of a transient instability in a TLM solution NLMErrico andRaeder 1999QJRMS
42Adjoint models as paradigm changers Some results discovered using adjoint models1. Atmospheric flows are very sensitive to low-level T perturbations2. Evolution of a barotropic flow can be very sensitive to perturbationshaving small vertical scale3. Error structures can propagate and amplify rapidly4. Forecast barotropic vorticity can be sensitive to initial water vapor5. Relatively few perturbation structures are initially growing ones6. Sensitivities to observations differ from sensitivities to analyses
43Misunderstanding # 1 False: Adjoint models are difficult to understand True: Understanding how to use and interpret adjoints of numerical models primarily uses concepts taught in early college mathematics
44Misunderstanding # 2 False: Adjoint models are difficult to develop True: Adjoint models of dynamical cores are simplerto develop than their parent models, and almosttrivial to check, but adjoints of model physicscan pose difficult problems
45Misunderstanding # 3False: Automatic adjoint generators easily generateperfect and useful adjoint modelsTrue: Problems can be encountered with automaticallygenerated adjoint codes that are inherent in theparent model. Do these problems also have abad effect in the parent model?
46Misunderstanding # 4False: An adjoint model is demonstrated useful andcorrect if it reproduces nonlinear results forranges of very small perturbationsTrue: To be truly useful, adjoint results must yieldgood approximations to sensitivities withrespect to meaningfully large perturbations.This must be part of the validation process
47Misunderstanding # 5False: Adjoints are not needed because the EnKF isbetter than 4DVAR and adjoint results disagreewith our notions of atmospheric behaviorTrue: Adjoint models have uses beyond 4DVAR. Their results can be surprising, but have been confirmed. It is rare that we have a tool that can answer such important questions so directly! It has not been demonstrated that EnKF is superior to TLM/adjoint for either data assimilation or sensitivity calculations.
48Challenges Develop new adjoint models Include more physics in adjoint modelsDevelop parameterization schemes suitablefor linearized applicationsAlways validate adjoint results (linearity)Many applications (sensitivity analysis, model tuning, predictability research, etc.) for adjoint models are not being fully examined at the present time
49Adjoint Workshops 1992 – Pacific Grove, CA 1995 – Visegrad, Hungary 1998 – Lennoxville, Quebec2000 – Moliets-et-Maa, France2002 – Mount Bethel, PA2004 – Aquafredda di Maratea,Italy2006 – Tirol, Austria2009 – Tannersville, PACefalu,Sicily2013?Contact Dr. Ron Erricoto be put on mailing list