Automatic adjoints without the algebra: flexible sensitivity analysis of nonlinear problems in the geosciences
Abstract. Material parameter values used in geoscientific simulations are often poorly constrained due to the sparse nature of the observations. In addition, the constitutive relationships used to describe natural processes typically involve nonlinearities, which results in large changes in simulation output when material parameters or initial conditions change. It is therefore important to have a tool that can efficiently determine the quantitative effect of parameter changes on the simulation output. The adjoint gradient method addresses this by delivering the gradient of an observation, here the result of the forward simulation, with respect to all material parameters at a computational cost independent of their number. Deriving the adjoint gradient analytically can be labor-intensive and in some cases must be re-derived when the constitutive relationships change. Here, we present a framework that avoids the re-derivation by applying automatic differentiation directly to the code, which is used for the forward simulation. The residual calculation contains all discrete operations needed to assemble the Jacobian of the forward problem and the parameter sensitivity matrix. The full gradient with respect to all spatially varying parameters then follows from a single solution of the (linear) adjoint problem, regardless of the dimension of the parameters space. We additionally give a geometric interpretation of the discrete calculation of the adjoint gradients, making its computational structure explicit to guide implementation in other codes. The framework is implemented in Julia and demonstrated on four problems of increasing complexity: transient heat diffusion in a petrological experimental setup, coupled fluid flow and heat transport in a Central European geothermal reservoir, thermo-visco-elasto-plastic Stokes flow applied to a rising mantle plume, and to localizing shear bands. We deliberately emphasize flexibility and transparency over computational efficiency, providing a compact and reproducible basis for sensitivity analysis.
Competing interests: At least one of the (co-)authors is a member of the editorial board of Geoscientific Model Development.
Publisher's note: Copernicus Publications remains neutral with regard to jurisdictional claims made in the text, published maps, institutional affiliations, or any other geographical representation in this paper. While Copernicus Publications makes every effort to include appropriate place names, the final responsibility lies with the authors. Views expressed in the text are those of the authors and do not necessarily reflect the views of the publisher.