Variational Data Assimilation : from optimal control to large scale data assimilation

Automatic Differentiation

At the present stage, the reader known why it can be interesting to consider an adjoint model, what for. In practice, the strategy to write the adjoint model may be different according to the forward computational code already available. One of the three possibilities to derive an adjoint code, consists to derive directly the forward source code. This option is called source-to-source transformation; it is possible in C or Fortran (at leat). In the present chapter, the forward source code is supposed to be written in Fortran. In the next section, the advantages and drawbacks of ”automatic differentiation” is presented briefly. Next, we present the relationship between the differential calculus (as considered in the previous chapters) and a source code di↵erentiation. The presentation is done in the framework of the software Tapenade, [13]. Also, we present how to validate an adjoint code. Few exercices are proposed. Next, the conceptual way to re-use the direct linear solver (eg arising from our favorite linear algebra library) in the adjoint code, since it solves a linear system thus the algorithm should not be differentiated. Finally, are presented some useful tricks related to the standard MPI instructions (how to adjointize the forward MPI instructions ?), and how to save a bit of memory (memory may be the greatest problem while running an adjoint code).

Download the pdf file :

6-automatic-differentiation

PrécédentPrécédentSuivantSuivant
AccueilAccueilImprimerImprimer J. Monnier, submitted to Open Learn. Res. Ed. INPT 0908 (2013) 24h Paternité - Partage des Conditions Initiales à l'IdentiqueRéalisé avec Scenari (nouvelle fenêtre)