Automatic Differentiation: A Tool For Data Assimilation and - - PowerPoint PPT Presentation

automatic differentiation a tool for data assimilation
SMART_READER_LITE
LIVE PREVIEW

Automatic Differentiation: A Tool For Data Assimilation and - - PowerPoint PPT Presentation

Automatic Differentiation: A Tool For Data Assimilation and Sensitivity Analysis in Oceanography Moulay HICHAM TBER* Projet TROPICS, INRIA, 2004 route des Lucioles Sophia Antipolis hicham.tber@sop-inria.fr M. H. Tber (TROPICS) AD: Tool .. 1


slide-1
SLIDE 1

Automatic Differentiation: A Tool For Data Assimilation and Sensitivity Analysis in Oceanography

Moulay HICHAM TBER*

Projet TROPICS, INRIA, 2004 route des Lucioles Sophia Antipolis hicham.tber@sop-inria.fr

  • M. H. Tber (TROPICS)

AD: Tool .. 1 / 20

slide-2
SLIDE 2

Data Assimilation in Oceanography

Model M describing the distribution and evolution in space and time of the characteristics of the sea- State Variables Y-(velocity, temperature, pressure, ..) M depends, among others, on the initial conditions Y0 = X. Observations : In-Situ, Spatial Data assimilation = estimating initial conditions (in our context)

  • M. H. Tber (TROPICS)

AD: Tool .. 2 / 20

slide-3
SLIDE 3

Direct Model: OPA/NEMO

Developed at LODYC-LOCEAN-Paris VI General ocean circulation model Configuration : ORCA 2o : i × j × k = 180 × 149 × 31

  • M. H. Tber (TROPICS)

AD: Tool .. 3 / 20

slide-4
SLIDE 4

Optimal control theory summary

Direct model The system state equation can be given by y = M(x) y(0) = x Cost function: 2J (x) = 2J 0(x) + 2J b(x) = H(y(x)) − y02 + x − xb2 H : observation operator y0 : observations xb : background control minimization of J (x) with respect to the control vector x using gradient based algorithm

  • M. H. Tber (TROPICS)

AD: Tool .. 4 / 20

slide-5
SLIDE 5

Incremental 4D-var

Tangent linear approximation M(x + δx) = M(x) + Mδx, δx = x − xb H(x + δx) = H(x) + Mδx, δx = x − xb Cost function: 2J (δx) = H.Mδx − d2 + δx2 d : yo − H(M(x)) minimization of J (δx) with respect to the control vector δx using gradient based algorithm Quadratic cost function and shorter control vector. Nonlinearities taken by updating xb.

  • M. H. Tber (TROPICS)

AD: Tool .. 5 / 20

slide-6
SLIDE 6

Tangent and Adjoint Model Development for OPA

Gradient based algorithm 4D-Var: J (x) − → M ∇J (x) − → MT Incremental 4D-Var: J (δx) − → M ∇J (δx) − → M and MT M : Model OPA M : Tangent Linear Model of OPA MT : Adjoint Model of OPA

  • M. H. Tber (TROPICS)

AD: Tool .. 6 / 20

slide-7
SLIDE 7

NEMO Tangent and Adjoint Model "NEMOTAM" History

1992-94: 1st version developed by E. Greiner (LODYC) for OPA4.

Applied to 4D-Var with a tropical Atlantic configuration.

1995-96: Major rewrite for OPA7 by F . Van den Berghe (CETIIS) and A. Weaver (LODYC).

This version was never exploited scientifically.

1997-2001: Adapted to OPA8.0 - 8.1 by A. Weaver (LODYC-CERFACS).

Developed initially for 4D-Var with a tropical Pacific configuration (TDH). Widely used, primarily for 4D-Var studies. Applied to applications other than data assimilation (singular vectors / optimal perturbations).

2002-present: Developed for OPA8.2, free-surface version, by A. Weaver (CERFACS) and C. Deltel (LOCEAN).

1st global ocean version (ORCA2¡). Used for 4D-Var in the ENACT project. Currently used by several groups for a variety of applications.

  • M. H. Tber (TROPICS)

AD: Tool .. 7 / 20

slide-8
SLIDE 8

NEMOTAM Current Status

Hand written tangent and adjoint model OPA 9.0 /NEMO: Major new version in Fortran 95. Development for OPA 9.0/NEMO using Automatic Differentiation.

  • M. H. Tber (TROPICS)

AD: Tool .. 8 / 20

slide-9
SLIDE 9

Automatic Differentiation (AD) of Computer Programs

Every programming language provides a limited number of elementary mathematical functions computer program, no matter how complicated, may be viewed as the composition of these so-called intrinsic functions P = {I1; I2; . . . ; Ip−1; Ip} implement F = fp ◦ fp−1 ◦ . . . f1 Derivatives for the intrinsic functions are combined using the chaine rule F ′(x0 = x) = f ′

p(xp−1) · f ′ p−1(xp−2) · · · f ′ 1(x0); xi = fi(xi−1)

  • M. H. Tber (TROPICS)

AD: Tool .. 9 / 20

slide-10
SLIDE 10

Automatic Differentiation (AD) of Computer Programs

But calculating and multiplying jacobians is too expensive F ′(x0 = x) = f ′

p(xp−1) · f ′ p−1(xp−2) · · · f ′ 1(x0)

Tangent mode y = F ′(x) · ˙ x = f ′

p(xp−1) · f ′ p−1(xp−2) · · · f ′ 1(x0)) · ˙

x Reverse mode x = F ′T(x) · y = f ′T

1 (x0) · · · f ′T p−1(xp−2) · f ′T p (xp−1) · y

Which mode ? F : Rm − → Rn Tangent mode: m ≤ n Reverse mode: m >> n (e.g. data assimilation)

  • M. H. Tber (TROPICS)

AD: Tool .. 10 / 20

slide-11
SLIDE 11

Automatic Differentiation (AD) of Computer Programs : Recompute vs Restore

Form of adjoint code: Recompute all strategy: Restore all strategy:

  • M. H. Tber (TROPICS)

AD: Tool .. 11 / 20

slide-12
SLIDE 12

Automatic Differentiation (AD) of Computer Programs : Checkpointing

  • M. H. Tber (TROPICS)

AD: Tool .. 12 / 20

slide-13
SLIDE 13

Validation and Performances: Correctness test

Compute a directional derivative ∇F(x) ˙ x for a random direction ˙ x using finite difference and the tangent linear mode AD. Compute via the reverse mode a single adjoint ¯ x = ∇F(x)T ¯ y for ¯ y equals ˙ y the output of the tangent linear mode. Check the following equality within the limits of the machine precision lim

ε− →0

  • F(x + ε ˙

x) − F(x − ε ˙ x) 2ε

  • 2

= ˙ y ˙ y = ¯ x ˙ x

  • M. H. Tber (TROPICS)

AD: Tool .. 13 / 20

slide-14
SLIDE 14

Validation and Performances : Correctness test

Dot product test for 1000 iterations Divided differences (ε = 10−7) 4.405352760987440e+08 AD (tangent linear) 4.405346876439977e+08 AD (adjoint) 4.405346876439867e+08

  • M. H. Tber (TROPICS)

AD: Tool .. 14 / 20

slide-15
SLIDE 15

Validation and Performances: Binomial Checkpointing

Multilevel checkpointing e.g. MIT-gcm not optimal Optimal checkpointing ’treeverse/revolve’

Figure: Slow dow factor vesus Max number of iterations

  • M. H. Tber (TROPICS)

AD: Tool .. 15 / 20

slide-16
SLIDE 16

Validation and Performances: Sensitivity Analysis

The sensitivity of the north atlantic heat transport at 290N, to changes in temperature at the ocean surface.

  • M. H. Tber (TROPICS)

AD: Tool .. 16 / 20

slide-17
SLIDE 17

Twin Experiment

Zoom on Antarctic Fully nonlinear approach Distributed observations Estimating sea surface temperature at x=60 (longitude)

  • M. H. Tber (TROPICS)

AD: Tool .. 17 / 20

slide-18
SLIDE 18

Twin Experiment: Results

  • M. H. Tber (TROPICS)

AD: Tool .. 18 / 20

slide-19
SLIDE 19

Twin Experiments: Results

  • M. H. Tber (TROPICS)

AD: Tool .. 19 / 20

slide-20
SLIDE 20

In Progress

PCG Solver Wind stress assimilation for a stationary solution

  • M. H. Tber (TROPICS)

AD: Tool .. 20 / 20