Recipes for adjoint code construction

  • Authors:
  • Ralf Giering;Thomas Kaminski

  • Affiliations:
  • Max-Planck-Institut für Meteorologie;Max-Planck-Institut für Meteorologie

  • Venue:
  • ACM Transactions on Mathematical Software (TOMS)
  • Year:
  • 1998

Quantified Score

Hi-index 0.02

Visualization

Abstract

Adjoint models are increasingly being developed for use in meteorology and oceanography. Typical applications are data assimilation, model tuning, sensitivity analysis, and determination of singular vectors. The adjoint model computes the gradient of a cost function with respect to control variables. Generation of adjoint code may be seen as the special case of differentiation of algorithms in reverse mode, where the dependent function is a scalar. The described method for adjoint code generation is based on a few basic principles, which permits the establishment of simple construction rules for adjoint statements and complete adjoint subprograms. These rules are presented and illustrated with some examples. Conflicts that occur due to loops and redefinition of variables are also discussed. Direct coding of the adjoint of a more sophisticated model is extremely time consuming and subject to errors. Hence, automatic generation of adjoint code represents a distinct advantage. An implementation of the method, described in this article, is the tangent linear and adjoint model compiler (TAMC).