2026-08-14 –, Alte Mensa — Atrium Maximum
Ocean models simulate complex physics, but struggle from inherent limitations and under-resolved phenomena. This motivates the use of inverse and machine learning methods to inform models with data. We have implemented automatic differentiation in the Ocean modeling package Oceananigans.jl, through the use and enhancement of compiler tools Enzyme.jl and Reactant.jl. Using these open-source packages, we generate gradients for applications like parameter estimation and embedded ML techniques.
Ocean general circulation models (GCMs) are used for operational forecasting and climate modeling. They simulate a wide range of physical processes, but suffer from biases and uncertainties due to inherent model limitations and inability to model under-resolved processes. These limitations motivate the use of inverse or machine learning methods to systematically constrain models with data from real world observations or high-resolution model runs, thereby reducing both structural and parametric uncertainties. Gradient-based approaches offer a way to “learn” high-dimensional model input spaces, such as physics-based parameters or neural network weights. Combining these methods leads to the notion of neural GCMs that are fully differentiable through automatic differentiation (AD). We have implemented such a capability in the open source ocean GCM Oceananigans.jl, resulting in DJ4Oceananigans (Differentiable Julia for Oceananigans). This required the enhancement of the AD tool Enzyme.jl in conjunction with the compiler tool Reactant.j, which produces a stable multi-level intermediate representation (MLIR) that renders robust, optimized derivative code executable on a wide range of devices including CPUs, TPUs, and GPUs. We demonstrate the computation of accurate gradients across several Oceananigans configurations, for use in sensitivity tests, parameter estimation, and embedded neural network layers. This work represents a significant milestone toward integrating gradient-based inverse methods and machine learning in ocean modeling in Julia, providing open source tools to improve model calibration, reduce persistent model biases, and characterize model uncertainty. It is useful and accessible for other researchers interested in ocean and climate modeling, as well as those interested in an example of differentiability being successfully applied and utilized within a complex scientific model implemented in Julia.
I am a PhD student in the Oden Institute at the University of Texas at Austin. My research is in the design and optimization of linear solvers, and the use of automatic differentiation to enable data driven methods like parameter estimation and scientific machine learning, with an emphasis on applications in ocean and climate modeling.