The problem of generating and maintaining adjoint models is sufficiently difficult that
typically only the most advanced and well-resourced community ocean models achieve it.
There are two current technologies which each suffer from their own limitations. Automatic
differentiation is employed by models such as the MITGCM and the Alfred Wegener Institute
model FESOM. This technique requires frequent manual intervention and is often
defeated by modern software constructs such as derived data types. Since automatic
differentiation produces a discrete adjoint model, it has difficulties coping with
non-differentiable discretisations even where the underlying continuous system is
differentiable.
An alternative is to formulate the adjoint differential equation and to discretise this
separately. This approach, known as the continuous adjoint, has the disadvantage that two
different model code bases must be maintained and manually kept synchronised as the model
develops.
The alternative presented here is to formulate the flow model in the high level language
UFL (Unified Form Language) and to automatically generate the model using the software of
the FEniCS project. In this approach it is the high level code specification which is
differentiated, a task very similar to the formulation of the continuous adjoint. However
since the forward and adjoint models are generated automatically, the difficulty
of maintaining them vanishes and the software engineering process is therefore
robust.
In this poster, a proof of concept study for this approach will be presented in
which a shallow water model is formulated along with its adjoint model using this
technique. |