October, Scripps Institution of Oceanography An Alternative Method to Building Adjoints Julia Levin Rutgers University Andrew Bennett “Inverse Modeling of the Ocean and Atmosphere” Carl Wunsch “Ocean Circulation Inverse Problem” Julia Muccino’s Inverse Ocean Modeling Website
Different ways of building adjoints “Symbolic” “Analytic” Automatic
Outline Background: basic ideas of building adjoint operators on a simple 1D advection equation. Continuous and discrete adjoint operators Comparison between “analytic” and “symbolic” approaches to building discrete adjoint operators. Examples
Advection equation are errors in the model, boundary conditions, initial conditions and data respectively
Least squares minimization (weak constraint) Minimize model errors, subject to constraints from PDE from boundary conditions from initial conditions and make solution closest to the data
Analytic Forward and Inverse model
Also sensitivity: To forcing To BC To IC
Strong constraint No model errors Constraints from PDE from boundary conditions from initial conditions How far solution is from to the data
Forward and adjoint models Decoupled system
Sensitivity: To forcing To BC To IC
Discrete Equations
Discrete Least squares
Inverse system (weak constraint)
Inverse system (strong constraint)
“Symbolic” computation of adjoint Since we don’t have forward operator in a closed form, we can not compute its transpose directly. Instead we break the operator into basic operations according to the code structure (loops, sums, products, etc). Then we derive transpose for those elementary operators, and change the order, according to a formula
Continuous adjoint: Minimize model errors, subject to constraints from PDE from boundary conditions from initial conditions and make solution closest to the data
“Analytic” Discrete adjoint
Twin Experiment 2 year run NL simulation Init. Cond., Forcing True run: NL simulation True solution Modify Init Cond and Forcing Difference is model error Prior run : NL simulation Prior solution Synthetic data: True + noise Introduce observational error Test run: assimilation Optimal solution Statistics of errors Difference is residual error Difference is prior error
Comparison between data, true and final solution (Experiment 3) Time=9.5 h
Comparison between data, true and final solution (wrong statistics) Time=9.5 h
Twin experiment with SEOM Comparison of Prior and Residual Error (free surface). Assimilation is over 10 hour period (40 time steps). Synthetic data is free surface. Experiment 1: inserted at time 9.5h on all grid points, variance 10; Experiment 2: inserted at time 4.5 and 9.5h at all grid points, variance 10 Experiment 3: inserted at tiime 9.5 h at all grid points, variance 5. data One iteration in outer loop, 9 iterations in the inner loop
Twin experiment with SEOM Comparison of Prior and Residual Error (velocity). data Assimilation is over 10 hour period (40 time steps). Synthetic data is free surface. Experiment 1: inserted at time 9.5h on all grid points, variance 10; Experiment 2: inserted at time 4.5 and 9.5h at all grid points, variance 10 Experiment 3: inserted at tiime 9.5 h at all grid points, variance 5.
Conclusion “Symbolic” method is a powerful tool to build complex adjoint operators, but it produces a unintuitive code, and does not provide any insight on the resulting discrete adjoint equations, more difficult to debug and analize. Continuous adjoint equations are very important in understanding the adjoint processes. Usually, they are not difficult to derive. “Analytic”approach to building discrete adjoint equations provides good understanding of the numerics of an adjoint code; the adjoint code is more compact and more readable; but the equations can be difficult to derive, especially for complex difference schemes.