Using dual numbers for automatic differentiation of complex functions -- a simple way to create data assimilation code for coupled models.

Jann Paul Mattern1, Christopher A Edwards1 and Christopher N Hill2, (1)University of California Santa Cruz, Santa Cruz, CA, United States, (2)MIT, Cambridge, United States
Abstract:
The computation of derivatives of complex, high-dimensional functions is fundamental to a wide variety of scientific applications, including variational data assimilation. Dual numbers (which are similar to complex numbers) allow for automatic, exact evaluation of the numerical derivative of high-dimensional functions at an arbitrary point and with minimal coding effort. When building a data assimilation system completely based on dual numbers, their use can eliminate the need for tangent linear and adjoint code which can be difficult to create and maintain for complex coupled models. Dual numbers can also be used to create tangent linear and adjoint code for coupling models to an existing data assimilation system. We introduce dual numbers and use them to construct tangent linear and adjoint model code for a biogeochemical ocean model and apply it to a variational (4D-Var) data assimilation system based on a coupled physical-biogeochemical model of the California current system. The resulting data assimilation system takes modestly longer to run than its hand-coded equivalent but is considerably easier to implement and updates automatically when modifications are made to the biogeochemical model, thus making its maintenance with code changes trivial.