DHDavid A. Ham

David A. Ham

*This is an algorithmically generated author record based on publicly available information.

Current Organizations / Institutes

The organizations/institutes from the scholar's latest article

Previous Organizations / Institutes

The organizations / institutes from the scholar's other articles in the past ten years


David A. Ham has a total of 113 co-authors. Here are the top co-authors by number of shared publications:


Latest Publications

  • Open Access

    Firedrake - automated, differentiable building blocks for geoscientific simulation

    by David Ham, Connor Ward, Pablo Brubeck, Joshua Hope-Collins, Leo Collins

    Computer simulations of continuous processes described by partial differential equations are a bedrock of geoscientific simulation. Each simulation is a complex composition of equations, discretisations, solvers and parameterisations. Realistic geoscientific simulation also depends on the integration of observed data either as facing functions or through data assimilation. The result of this complexity is that creating new models, or even extending existing ones, can often be exceptionally resource intensive, even for large and highly capable institutions. Firedrake (https://www.firedrakeproject.org/) offers a revolutionary different approach to model creation. Rather than coding the implementation of a model in low level code in a compiled language, Firedrake users write the mathematical formulation of their model in high-level Python. The high performance, parallel implementation of that code is then automatically generated and executed. Users have access to: A huge range of finite element discretisations for any PDE they choose, including generalisations of the various variables staggerings that are typically used across the geosciences.Programmable, composable solvers and preconditioners, including algebraic and geometric multigrid approaches, and physics-based preconditions based on the characteristics of the system being solved.Seemless coupling to external processes, including the ML frameworks JAX and PyTorch.Fully automated adjoint computations: the adjoint to a Firedrake simulation is available with no additional coding required.Integration with optimisation algorithms for data assimilation. Firedrake already provides the basis for:The GUSTO toolkit, used for dynamical core development research at the Met Office and University of Exeter (https://www.firedrakeproject.org/gusto/).The Thetis coastal ocean model (Kärna et al. 2018)G-ADOPT: The Geoscientific ADjoint Optimisation PlaTform for mantle convection and glacial isostatic adjustment from the Australian National University (Ghelichkhan et al 2024). As well as hundreds of bespoke simulations by users around the world. This PICO will present the key features of Firedrake and illustrate the applications to which it is put. References Ghelichkhan, Sia, et al. "Automatic adjoint-based inversion schemes for geodynamics: reconstructing the evolution of Earth's mantle in space and time." Geoscientific Model Development 17.13 (2024): 5057-5086.Kärnä, Tuomas, et al. "Thetis coastal ocean model: discontinuous Galerkin discretization for the three-dimensional hydrostatic equations." Geoscientific Model Development11.11 (2018): 4359-4382.

  • Open Access

    Geoscientific Model Development - the EGU’s software journal

    by David Ham, Juan Añel, Astrid Kerkweg, Min-Hui Lo, Richard Neale, Rolf Sander, Paul Ullrich

    Computer modelling underpins vast areas of the geosciences, and the development of those models is itself a major scientific undertaking. GMD provides the forum for the publication of new developments in software across the geosciences. We communicate the advances made in geoscientific modelling capability, and thereby provide recognition to the many scientists who undertake this form of research. Equally importantly, we provide a key link in the provenance chain of geoscientific modelling. Every time a model result informs the conclusions of a scientific paper, the reader should be able to understand the basis of that calculation, its assumptions and limitations. In other words, the details of the computer model used to produce a scientific result should themselves be published. GMD provides the venue for that publication. We take our role in establishing the provenance of scientific results very seriously. GMD publications are required, whenever legally possible, to be accompanied by complete, public, and persistent archives of the software and data used to create the results presented: our authors are required to show their working. By doing this, we provide readers with a detailed access to what models actually do that goes far beyond the summary descriptions that fit in a research paper. GMD’s scope spans the geosciences. Papers describe fluid and solid models of the atmosphere, ocean, cryosphere, surface, lithosphere, and core. Specialist publications deal with individual parametrisations, while survey papers cover entire Earth System Models. Data assimilation papers discuss the incorporation of observed data, using ensemble, variational and machine learning techniques. Technical papers cover new algorithms and ports to new hardware, as well as new standards for data and interfaces. In essence, any paper about any stage of the development of software for the geosciences is in scope.

  • Open Access

    An abstraction for solving multi-domain problems using finite element methods

    by Koki Sagiyama, Lawrence Mitchell, David A. Ham

    We introduce a new abstraction for the representation and solution of multi-domain problems using finite element methods. This is an advance over previous work in that it achieves a single higher-level abstraction that represents multi-domain problems in the mixed variational problem formalism. We implemented our new abstraction in UFL and Firedrake, and validated our implementations solving a quad-triangle mixed-cell-type problem, a hex-quad mixed-cell-type problem, and a fluid-structure interaction benchmark problem.

  • Open Access

    Automating the construction of time-parallel 4DVar data assimilation systems for finite element models.

    by Josh Hope-Collins, Jemima Tabeart, David Ham

    Data assimilation (DA) has made a significant contribution to the increase in forecast skill in recent decades by leveraging real-world observations to improve the states used in the forecasting system. However, the DA stage comprises a large part of the computational work of the system. Therefore, improving DA efficiency is crucial for continued improvements in forecast skill, which in turn requires high productivity software to be available for DA researchers. 4D variational assimilation (4DVar) is a DA method in common use operationally. 4DVar optimises an objective function (agreement with observations and prior forecasts) by updating a control (initial conditions) using the adjoint method. This requires running the linearised system forwards in time, and the system adjoint backwards in time, at every optimisation step. Weak constraint 4DVar is a modification that allows an "inexact model" and splitting the time-series into chunks. This enables reformulating each optimisation step as a saddle point problem, where the forward and adjoint models on each time-chunk can be run in parallel. This time-parallelism can potentially greatly decrease the time required for the optimisation. The adjoint method is highly effective but requires differentiating every operation in the system. Manually differentiation requires high developer effort for new system components, while automatic numerical differentiation is often computationally inefficient. This is particularly problematic in the development stage, where researchers want to run a variety of methods on a variety of equations. This causes a gap between simple equations (e.g. Lorenz and heat) often used in research, and the fluids models in operational systems.Symbolic differentiation aims to achieve the efficiency of manual differentiation with the automation of numerical differentiation, and provides a route to closing this gap. We present a library for constructing the 4DVar system using symbolic automatic differentiation. This is achieved using: Firedrake, a finite element library which provides symbolic differentiation using UFL, a high level DSL; and pyadjoint, a library for symbolically recording code execution and automatically constructing the forward and adjoint models.To construct the 4DVar system, the user need only run the forward model (i.e. dynamical core) and the observation operators once. Firedrake and pyadjoint record this run and calculate the linearised forward model and the adjoint model, from which all components of 4DVar can be constructed.The implementation is both space and time parallel, enabling the real performance of the methods to be tested on HPC machines. Because pyadjoint is model agnostic, this library can be used for any equation simply by changing the finite element model. Minimising the code modification required for different models is key for improving researcher productivity. This not only allows a smoother transition up the model hierarchy, but also allows straightforward testing of different dynamical core discretisations. We will demonstrate the software API and discuss the design choices taken, and present preliminary results on different equations.

  • Efficient N-to-M Checkpointing Algorithm for Finite Element Simulations

    by David A. Ham, Vaclav Hapla, Matthew G. Knepley, Lawrence Mitchell, Koki Sagiyama

    In this work, we introduce a new algorithm for N-to-M checkpointing in finite element simulations. This new algorithm allows efficient saving/loading of functions representing physical quantities associated with the mesh representing the physical domain. Specifically, the algorithm allows for using different numbers of parallel processes for saving and loading, allowing for restarting and postprocessing on the process count appropriate to the given phase of the simulation and other conditions. For demonstration, we implemented this algorithm in PETSc, the Portable, Extensible Toolkit for Scientific Computation, and added a convenient high-level interface into Firedrake, a system for solving partial differential equations using finite element methods. We evaluated our new implementation by saving and loading data involving 8.2 billion finite element degrees of freedom using 8,192 parallel processes on ARCHER2, the UK National Supercomputing Service. Reproducibility of computational results. This paper has been awarded the “SIAM Reproducibility Badge: Code and data available” as a recognition that the authors have followed reproducibility principles valued by SISC and the scientific computing community. Code and data that allow readers to reproduce the results in this paper are available at https://zenodo.org/records/7675345 . [Formula: see text]


  • Open Access

    Differentiable programming across the PDE and Machine Learning barrier

    by Nacime Bouziani, David A. Ham, Ado Farsi

    The combination of machine learning and physical laws has shown immense potential for solving scientific problems driven by partial differential equations (PDEs) with the promise of fast inference, zero-shot generalisation, and the ability to discover new physics. Examples include the use of fundamental physical laws as inductive bias to machine learning algorithms, also referred to as physics-driven machine learning, and the application of machine learning to represent features not represented in the differential equations such as closures for unresolved spatiotemporal scales. However, the simulation of complex physical systems by coupling advanced numerics for PDEs with state-of-the-art machine learning demands the composition of specialist PDE solving frameworks with industry-standard machine learning tools. Hand-rolling either the PDE solver or the neural net will not cut it. In this work, we introduce a generic differentiable programming abstraction that provides scientists and engineers with a highly productive way of specifying end-to-end differentiable models coupling machine learning and PDE-based components, while relying on code generation for high performance. Our interface automates the coupling of arbitrary PDE-based systems and machine learning models and unlocks new applications that could not hitherto be tackled, while only requiring trivial changes to existing code. Our framework has been adopted in the Firedrake finite-element library and supports the PyTorch and JAX ecosystems, as well as downstream libraries.

  • Open Access

    Consistent point data assimilation in Firedrake and Icepack

    by Reuben W. Nixon-Hill, Daniel Shapero, Colin J. Cotter, David A. Ham

    We present a high-level, differentiable, and composable abstraction for the point evaluation of the solution fields of partial differential equation models. The new functionality, embedded in the Firedrake automated finite element system, enables modellers to easily assimilate point data into their models at the point locations, rather than resorting to extrapolation to a computational mesh. We demonstrate the expressiveness and ease with which more mathematically defensible data assimilation can be performed with examples in the fields of groundwater hydrology and glaciology. In various geoscience disciplines, modellers seek to estimate fields that are challenging to directly observe using measurements of other related fields. These measurements are often sparse, and it is common practice to first extrapolate these measurements to the grid or mesh used for computations. When this estimation procedure is viewed as a deterministic inverse problem, the extrapolation step is undesirable because the choice of extrapolation method introduces an arbitrary algorithmic degree of freedom that can alter the outcomes. When the estimation procedure is instead viewed through the lens of statistical inference, the extrapolation step is undesirable for the additional reason that it obscures the number of statistically independent measurements that are assimilated and thus makes it impossible to apply statistical goodness-of-fit tests or model selection criteria. The introduction of point evaluation into Firedrake, together with its integration into the automatic differentiation features of the system, greatly facilitates the direct assimilation of point data and thus improved methodology for solving both deterministic and statistical inverse problems.


  • Open Access

    Automatic adjoint-based inversion schemes for geodynamics: reconstructing the evolution of Earth's mantle in space and time

    by Sia Ghelichkhan, Angus Gibson, D. Rhodri Davies, Stephan C. Kramer, David A. Ham

    Reconstructing the thermo-chemical evolution of Earth's mantle and its diverse surface manifestations is a widely recognised grand challenge for the geosciences. It requires the creation of a digital twin: a digital representation of Earth's mantle across space and time that is compatible with available observational constraints on the mantle's structure, dynamics and evolution. This has led geodynamicists to explore adjoint-based approaches that reformulate mantle convection modelling as an inverse problem, in which unknown model parameters can be optimised to fit available observational data. Whilst there has been a notable increase in the use of adjoint-based methods in geodynamics, the theoretical and practical challenges of deriving, implementing and validating adjoint systems for large-scale, non-linear, time-dependent problems, such as global mantle flow, has hindered their broader use. Here, we present the Geoscientific ADjoint Optimisation PlaTform (G-ADOPT), an advanced computational modelling framework that overcomes these challenges for coupled, non-linear, time-dependent systems by integrating three main components: (i) Firedrake, an automated system for the solution of partial differential equations using the finite-element method; (ii) Dolfin-Adjoint, which automatically generates discrete adjoint models in a form compatible with Firedrake; and (iii) the Rapid Optimisation Library, ROL, an efficient large-scale optimisation toolkit; G-ADOPT enables the application of adjoint methods across geophysical continua, showcased herein for geodynamics. Through two sets of synthetic experiments, we demonstrate the application of this framework to the initial condition problem of mantle convection, in both square and annular geometries, for both isoviscous and non-linear rheologies. We confirm the validity of the gradient computations underpinning the adjoint approach, for all cases, through second-order Taylor remainder convergence tests and subsequently demonstrate excellent recovery of the unknown initial conditions. Moreover, we show that the framework achieves theoretical computational efficiency. Taken together, this confirms the suitability of G-ADOPT for reconstructing the evolution of Earth's mantle in space and time. The framework overcomes the significant theoretical and practical challenges of generating adjoint models and will allow the community to move from idealised forward models to data-driven simulations that rigorously account for observational constraints and their uncertainties using an inverse approach.


  • Open Access

    Response to all reviewer and community comments

    by Siavash Ghelichkhan, Angus Gibson, D. Rhodri Davies, Stephan C. Kramer, David A. Ham

    Reconstructing the thermo-chemical evolution of Earth's mantle and its diverse surface manifestations is a widely-recognised grand challenge for the geosciences. It requires the creation of a digital twin: a digital representation of Earth's mantle across space and time that is compatible with available observational constraints on the mantle's structure, dynamics and evolution. This has led geodynamicists to explore adjoint-based approaches that reformulate mantle convection modelling as an inverse problem, in which unknown model parameters can be optimised to fit available observational data. Whilst recent years have seen a notable increase in the use of adjoint-based methods in geodynamics, the theoretical and practical challenges of deriving, implementing and validating adjoint systems for large-scale, non-linear, time-dependent problems, such as global mantle flow, has hindered their broader use. Here, we present the Geoscientific Adjoint Optimisation Platform (G-ADOPT), an advanced computational modelling framework that overcomes these challenges for coupled, non-linear, time-dependent systems. By integrating three main components: (i) Firedrake, an automated system for the solution of partial differential equations using the finite element method; (ii) Dolfin-Adjoint, which automatically generates discrete adjoint models in a form compatible with Firedrake; and (iii) the Rapid Optimisation Library, ROL, an efficient large-scale optimisation toolkit; G-ADOPT enables the application of adjoint methods across geophysical continua, showcased herein for geodynamics. Through two sets of synthetic experiments, we demonstrate application of this framework to the initial condition problem of mantle convection, in both square and annular geometries, for both isoviscous and non-linear rheologies. We confirm the validity of the gradient computations underpinning the adjoint approach, for all cases, through second-order Taylor remainder convergence tests, and subsequently demonstrate excellent recovery of the unknown initial conditions. Moreover, we show that the framework achieves theoretical computational efficiency. Taken together, this confirms the suitability of G-ADOPT for reconstructing the evolution of Earth's mantle in space and time. The framework overcomes the significant theoretical and practical challenges of generating adjoint models, and will allow the community to move from idealised forward models to data-driven simulations that rigorously account for observational constraints and their uncertainties using an inverse approach.

  • Open Access

    checkpoint_schedules: schedules for incremental checkpointing of adjoint simulations

    by Daiane I. Dolci, James R. Maddison, David A. Ham, Guillaume Pallez, Julien Herrmann

    Checkpoint_schedules provides schedules for step-based incremental checkpointing of the adjoints to computer models. The schedules contain instructions indicating the sequence of forward and adjoint steps to be executed, and the data storage and retrieval to be performed. These instructions are independent of the model implementation, which enables the model authors to switch between checkpointing algorithms without recoding. Conversely, checkpoint-ing_schedules provides developers of checkpointing algorithms a direct mechanism to convey their work to model authors. checkpointing_schedules has been integrated into tlm_adjoint (James R. Maddison et al., 2019), a Python library designed for the automated derivation of higher-order tangent-linear and adjoint models and work is ongoing to integrate it with pyadjoint (Mitusch et al., 2019). This package can be incorporated into other gradient solvers based on adjoint methods, regardless of the specific approach taken to generate the adjoint model.