# Learning to generate physical ocean states: Towards hybrid climate modeling

Étienne Meunier, David Kamm, Guillaume Gachon, Redouane Lguensat, Julie Deshayes

► To cite this version:

Étienne Meunier, David Kamm, Guillaume Gachon, Redouane Lguensat, Julie Deshayes. Learning to generate physical ocean states: Towards hybrid climate modeling. 2025. hal-04937213v2

HAL Id: hal-04937213

https://hal.science/hal-04937213v2

Preprint submitted on 10 Dec 2025

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_1.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
# Learning to generate physical ocean states:
## Towards hybrid climate modeling

Etienne Meunier¹,², David Kamm², Guillaume Gachon²,³,
Redouane Lguensat³, and Julie Deshayes¹,²,³

¹Inria Paris

²Sorbonne Universités (UPMC, Univ Paris

06)-CNRS-IRD-MNHN, LOCEAN Laboratory, Paris, France

³Institut Pierre-Simon Laplace, IRD, Sorbonne Université, Paris,
France

February 2025

## Abstract

Ocean General Circulation Models require extensive computational re-
sources to reach equilibrium states, while deep learning emulators, despite
offering fast predictions, lack the physical interpretability and long-term
stability necessary for climate scientists to understand climate sensitiv-
ity (to greenhouse gas emissions) and mechanisms of abrupt variability
such as tipping points. We propose to take the best from both worlds
by leveraging deep generative models to produce physically consistent
oceanic states that can serve as initial conditions for climate projections.
We assess the viability of this hybrid approach through both physical
metrics and numerical experiments, and highlight the benefits of enforc-
ing physical constraints during generation. Although we train here on
ocean variables from idealized numerical simulations, we claim that this
hybrid approach, combining the computational efficiency of deep learning
with the physical accuracy of numerical models, can effectively reduce the
computational burden of running climate models to equilibrium, and re-
duce uncertainties in climate projections by minimizing drifts in baseline
simulations.

# 1 Introduction

Ocean General Circulation Models (OGCMs) are fundamental tools in climate
science, essential for understanding past climate variations and projecting future
conditions. These models require substantial computational resources, particu-
larly during their spin-up phase to reach equilibrium, which requires millions of
CPU hours even at coarse spatial resolution. This computational cost severely limits our ability to explore different parameter calibrations or perform large ensemble simulations necessary for uncertainty quantification. Recent advances in deep learning have led to promising climate model emulators [Wang et al., 2024; Aouni et al., 2024; Kochkov et al., 2024; Watt-Meyer et al., 2023] that can reproduce short-term dynamics with impressive accuracy while requiring significantly less computational resources. However, these emulators face two major limitations: their autoregressive nature leads to instability in long-term predictions, and their black-box nature makes them unsuitable for studying mechanisms of climate variability or performing sensitivity analyses. In this work, we investigate whether deep generative models can help bridge this gap by directly producing physically consistent oceanic states, inspired by recent success in turbulent flow simulation [Lienen et al., 2023]. Rather than attempting to emulate the temporal evolution of the system, we propose to generate states that can serve as initial conditions for numerical integration. This approach presents several challenges, particularly in ensuring that generated states respect both local physical constraints and global conservation laws.

We make the following contributions:

* A generative framework for producing oceanic states that captures complex spatial patterns and vertical structure

* A method for enforcing physical constraints during the generation process

* Metrics and evaluation protocols for assessing the physical consistency of generated states and their viability as initial conditions for numerical integration

## 2 Methods

<figure><img src="image_2.png" /><figcaption>Figure 1: Pipeline of the training and evaluation protocol. From left to right: training of the diffusion model using a database of stable states produced by our oceanic model, generation of initialization states from our diffusion model and temporal integration using numerical simulation, then evaluation of physical consistency on simulated trajectories.</figcaption></figure>

Our approach consists of three main components: (1) training a diffusion model to learn the distribution of oceanic states, (2) generating new states while
enforcing physical constraints, and (3) validating these states through numerical integration. As illustrated in Figure 1, we first train our model on a dataset of states from the DINO configuration, each representing a snapshot of the ocean's temperature and salinity fields.

**Data:** This study utilizes data from the DINO <fnref n="1" /> configuration, an idealized configuration of the global ocean implemented in NEMO<fnref n="2" />. DINO represents a simplified Atlantic basin with a zonally periodic Southern Ocean channel, designed to capture key features of the global ocean circulation such as the meridional overturning circulation (MOC) and the Antarctic Circumpolar Current (ACC), while maintaining computational efficiency. The states are discretized on a 3D grid of size $Z \times W \times H$, where $Z = 36$ represents vertical levels and $(W, H) = (199, 62)$ the horizontal spatial dimensions. We use the index $k$ representing the depth level and the indices $(i, j)$ for the horizontal coordinates. While the original states contain multiple variables, we focus on two prognostic variables central to ocean dynamics: conservative temperature $T$ and absolute salinity $S$. These fields are concatenated to form our input state $X = (T \| S)$, $X_t$ being the state at timestep $t$. Further details are provided in Appendix A.

## 2.1 Generative model and physical constraints

We base our approach on denoising diffusion probabilistic models (DDPM) [Ho et al., 2020] which has shown promising results for generating complex physical fields [Lienen et al., 2023]. Formally, we train a denoising model $\epsilon_\theta(x_s, s)$ to predict the noise added to the data, where $s \in [1, S]$ represents the diffusion step. See details in Appendix B.

**Physical constraints:** generated states from diffusion models do not inherently respect the physical characteristics of variables as produced by the ocean model. Rather than imposing these constraints through architecture design or additional training losses, we propose to enforce them during the sampling process through a guided generation approach.

Given a constraint function $C(x): \mathbb{R}^{Z \times W \times H} \to \mathbb{R}$ defined over our 3D fields, we modify the sampling step by adding the gradient of this constraint scaled by a function $\kappa(s)$:

$$x_{s-1} = \alpha_s^{-\frac{1}{2}}(x_s - \gamma_s \epsilon_\theta(x_s, s)) - \kappa(s)\nabla C(x_s) + \sigma_s \mathbf{z} \quad (1)$$

where $\kappa(s)$ controls the strength of the constraint throughout the generation process, $\mathbf{z} \sim N(0, I)$ and $(\gamma, \alpha, \sigma)$ are fixed by the noise scheduler (Appendix D). This approach allows us to balance between respecting the learned distribution and enforcing physical constraints.

**Hydrostatic balance constraint:** a key physical characteristic in variables produced by ocean models is to ensure a hydrostatically stable stratification, where density should increase with depth. To enforce this, we propose a

<footnote n="1">¹https://github.com/vopikamm/DINO</footnote>

<footnote n="2">²https://www.nemo-ocean.eu/</footnote>
constraint that penalizes deviations from the vertical structure in our training data:

$$C(x) = \sum_{k} (\mu_k - \frac{1}{N} \sum_{i,j} x_{ijk})^2 \quad (2)$$

where $\mu_k$ is the mean value for vertical layer k computed over the training dataset (zero in our case due to normalization) and N is the number of horizontal cells. This regularization acts as a soft constraint on the mean vertical profile, with $\kappa(s)$ allowing us to tune the trade-off between variability in generated states and strict enforcement of the vertical structure.

# 3 Results

Our evaluation follows two complementary approaches: first, an *a priori* analysis of the generated states' physical properties and spatial patterns, and second, an *a posteriori* analysis of their viability as initialization points for numerical integration in NEMO.

<figure><img src="image_3.png" /><figcaption>Figure 2: Comparison between training data and generated states. Left panel: temperature and salinity fields at two different depth levels from the training data (left) and our diffusion model (right), showing the model's ability to capture complex spatial patterns. Right panel: zonally averaged sections of potential density computed from the temperature and salinity fields, comparing the statistical distribution from the training data (top) with generated samples (bottom).</figcaption></figure>

**Quality of generated states:** we demonstrate that our model successfully learns the complex spatial patterns present in oceanic states in Figure 2. The generated fields exhibit realistic features such as the formation of cold and fresh water masses at high latitudes, the ventilation of warm and salty water masses near the tropics, while maintaining coherent vertical relationships between different depth levels. The density profiles further validate that the model captures the overall stratification structure of the global ocean.
<table><caption>Table 1: Statistical analysis of water mass properties and density stability. Values are presented as mean ± σ. The first four columns show salinity and temperature averages in bottom and deep water masses (defined in C). The rightmost column shows the percentage of ocean volume where static instability occurs (where denser water is above lighter water).</caption><thead><tr><th rowspan="2">Source</th><th colspan="2">Bottom-Water</th><th colspan="2">Deep-Water</th><th rowspan="2">Density<br>Errors</th></tr><tr><th>S</th><th>T</th><th>S</th><th>T</th></tr></thead><tbody><tr><td>Data</td><td>35.2 ± 2.4e-5</td><td>4.7 ± 6.5e-3</td><td>35.3 ± 4.4e-4</td><td>2.6 ± 1.1e-2</td><td>0.4 ± 4.3e-2</td></tr><tr><td>No Constraint</td><td>35.2 ± 6.4e-2</td><td>4.7 ± 0.5</td><td>35.3 ± 8.0e-2</td><td>2.9 ± 1.0</td><td>26.8 ± 9.6</td></tr><tr><td><strong>Constraint</strong></td><td>35.2 ± 1.4e-3</td><td>4.7 ± 1.0e-2</td><td>35.3 ± 1.9e-3</td><td>2.6 ± 2.2e-2</td><td>1.8 ± 0.3</td></tr></tbody></table>

**Impact of physical constraints** : we analyze the water mass properties generated by our model in comparison with the training data in Table 1. Following the methodology detailed in Appendix C, we identified characteristic regions where we compute mean temperature and salinity, and departures from those. These regions are crucial drivers of the ocean dynamics, making their property distributions essential for the system's evolution. Additionally, we compute an error score that quantifies the occurrence of hydrostatic instabilities in the water column. Two key findings emerge from this analysis: the unconstrained model successfully generates fields with realistic spatial structure, and adding a hydrostatic constraint on the generated fields reduces density instabilities by an order of magnitude while maintaining the spatial structure.

<figure><img src="image_4.png" /><figcaption>Figure 3: Effect of physical constraints on generation and temporal evolution. Top: unconstrained generation; bottom: generation with hydrostatic constraint. Left to right: initial density profiles from generated states, density profiles after 10 years of NEMO integration, spatial variance of sea surface temperature and salinity in generated samples. The constraint successfully realizes stratification at the cost of reduced variability in the generated states.</figcaption></figure>

We illustrate the crucial role of our physical constraints in Fig. 3, without constraints, while the generated states may appear realistic, their density profiles can violate physical principles, leading to numerical instabilities during integration and/or excessive vertical diffusion. The constrained generation produces states that not only respect physical principles but also lead to stable long-term integration in NEMO. The temporal evolution revealed by 10-year
integrations shows that unconstrained states tend to drift significantly from their initial conditions, while constrained states maintain physically consistent trajectories closer to the training distribution. However, this improved stability comes at the cost of reduced variability in the generated states, as shown by the decreased variance in surface fields. This trade-off between physical consistency and diversity is a key challenge in the application of generative models to physical systems.

# 4 Conclusion

In this work, we have demonstrated that deep generative models can produce physically consistent oceanic states suitable for numerical integration. By developing methods to enforce physical constraints during generation, we show how to balance between respecting learned patterns and maintaining necessary physical properties. Our evaluation reveals the impact of generated initial state properties on the long-term system evolution, justifying our approach of using numerical integration as a validation tool. Furthermore, our results highlight important trade-offs between state diversity and physical consistency.

This exploratory work opens several promising directions. Future developments could focus on making the model conditional on physical parameters, enabling its use for ensemble generation and uncertainty quantification. More sophisticated physical constraints could be developed to better preserve conservation laws while maintaining state diversity. Additionally, comprehensive comparison with traditional spin-up methods would help position this approach in the broader context of climate modeling.

# References

Anass El Aouni, Quentin Gaudel, Charly Regnier, Simon Van Gennip, Marie Drevillon, Yann Drillet, and Jean-Michel Lellouche. Glonet: Mercator's end-to-end neural forecasting system, 2024. URL https://arxiv.org/abs/2412.05454.

Jonathan Ho, Ajay Jain, and Pieter Abbeel. Denoising diffusion probabilistic models. In Advances in Neural Information Processing Systems, 2020.

Dmitrii Kochkov, Janni Yuval, Ian Langmore, Peter Norgaard, Jamie Smith, Griffin Mooers, Milan Klöwer, James Lottes, Stephan Rasp, Peter Düben, Sam Hatfield, Peter Battaglia, Alvaro Sanchez-Gonzalez, Matthew Willson, Michael P. Brenner, and Stephan Hoyer. Neural general circulation models for weather and climate. Nature, 632(8027):1060–1066, July 2024. ISSN 1476-4687. doi: 10.1038/s41586-024-07744-y. URL http://dx.doi.org/10.1038/s41586-024-07744-y.

M Lienen, D Lüdke, J Hansen-Palmus, and S Günnemann. From zero to turbulence: Generative modeling for 3d flow simulation. arXiv preprint arXiv:2306.01776, 2023.
Olaf Ronneberger, Philipp Fischer, and Thomas Brox. U-Net: Convolutional networks for biomedical image segmentation. In *Medical Image Computing and Computer-Assisted Intervention (MICCAI)*, pages 234–241, 2015.

Patrick von Platen, Suraj Patil, Anton Lozhkov, Pedro Cuenca, Nathan Lam-
bert, Kashif Rasul, Mishig Davaadorj, Dhruv Nair, Sayak Paul, William
Berman, Yiyi Xu, Steven Liu, and Thomas Wolf. Diffusers: State-of-the-
art diffusion models. https://github.com/huggingface/diffusers, 2022.

X Wang, R Wang, N Hu, P Wang, P Huo, G Wang, and J Song. Xihe: A data-driven model for global ocean eddy-resolving forecasting. *arXiv preprint arXiv:2402.02995*, 2024.

O Watt-Meyer, G Dresdner, J McGibbon, S K Clark, B Henn, J Duncan, and C S Bretherton. Ace: A fast, skillful learned global atmospheric model for climate prediction. *arXiv preprint arXiv:2310.02074*, 2023.

A Dataset

Here we give details on the training dataset generated from the DINO configura-
tion. The configuration uses a mercator grid with 1/4 horizontal resolution and
36 vertical levels. The domain spans 60° longitude and 70° latitude from equator
to both poles. For this study, we generated a dataset by running DINO for 50
years, saving 1800 snapshots of temperature and salinity fields. The resulting
dataset consists of 1800 states, each containing two 3D fields (T,S). Prior to
training, we perform per-level standardization of both temperature and salinity
fields, computing means and standard deviations from the training set.

B Diffusion model

The training objective for our denoiser is:

$$
\mathcal{L}(\theta) = \mathbb{E}_{s,x_0,\epsilon} [\|\epsilon_{\theta}(x_s, s) - \epsilon\|^2] \quad (3)
$$

where $x_s = \sqrt{\bar{\alpha}_s}x_0 + \sqrt{1-\bar{\alpha}_s}\epsilon$ with $x_0$ sampled from our training data, $\epsilon \sim \mathcal{N}(0, \mathbf{I})$, and $\{\bar{\alpha}_s = \prod_{k=1}^s \alpha_k\}_{s=1}^S$ where the $\alpha$ are fixed by our variance schedule. (In practice we use "squaredcos_cap_v2" from Hugging Face library <fnref n="3" />.)

To generate samples, we start from Gaussian noise $x_S \sim \mathcal{N}(0, \mathbf{I})$ and iteratively denoise it :

$$
x_{s-1} = \alpha_s^{-\frac{1}{2}} (x_s - \gamma_s \epsilon_\theta(x_s, s)) + \sigma_s \mathbf{z} \quad (4)
$$

where $\mathbf{z} \sim \mathcal{N}(0, \mathbf{I})$, $\gamma_s = (1-\alpha_s)(1-\bar{\alpha}_s)^{-\frac{1}{2}}$, and $\sigma_s$ is the standard deviation of the reverse process noise. This sampling procedure progressively transforms noise into oceanic states.

<footnote n="3">³https://huggingface.co/docs/diffusers/v0.32.2/en/api/schedulers/ddpm</footnote>
# C Metrics

## C.1 Bottom-Deep water boxes :

In figure 4 we describe the area of the Deep and Bottom water boxes.

<figure><img src="image_5.png" /><figcaption>Figure 4: Illustration of the areas considered for computing the Bottom Water and Deep Water characteristics. Strength of the Antarctic Circumpolar Current (ACC) and North Atlantic subtropical gyre (NASTG) are also depicted, as they are crucial elements of the global ocean dynamics.</figcaption></figure>

## C.2 Density error metric :

We define a density error metric to measure the proportion of the ocean volume where the vertical density profile violates hydrostatic stability, calculated as:

$$ \text{Density Error} = 100 \times \frac{\sum_{i,j,k} V_{i,j,k} \cdot 1\{\rho_{i,j,k+1} - \rho_{i,j,k} < 0\}}{\sum_{i,j,k} V_{i,j,k}} \quad (5) $$

where $V_{i,j,k}$ represents the volume of each grid cell, $\rho_{i,j,k}$ is the density at grid point $(i, j, k)$, with indices $(i, j, k)$ corresponding to (longitude, latitude, depth) coordinates. The indicator function $1\{\cdot\}$ equals 1 when the density difference between two vertical levels is negative (unstable stratification) and 0 otherwise. The result is expressed as a percentage of the total volume exhibiting density instabilities.
## D Training and inference details

AdamW was used for training with an initial learning rate of 1e-4 and a cosine learning scheduler with no warmup steps. Batch size was 8. Training took nearly two days and a half on a single V100 GPU card.

We did not perform hyperparameter tuning in this work as the goal was not to find the optimal performance for the diffusion model. We are aware that many aspects of the training can be largely improved. Future work include training with Exponential Moving Average (EMA) and investigating the use of Latent Diffusion Models.

For the hydrostatic constraint we use $\kappa(s) = \eta(1 + \lambda e^{-\frac{ks}{S}})$ with $\eta = 1e-3$, $\lambda = 40$ and $k = 20$. These values were chosen empirically, with the goal of enforcing stronger constraint near the end of the generation ($s = 1$) compared to the start ($s = S$).

As we run into boundary issues when using convolutional kernels near solid boundaries, we implement a simple solution for generated fields where the values of cells directly adjacent to the top and bottom walls are copied from their nearest interior cell.

## E Architecture

A widely adopted network architecture in diffusion models is the U-Net [Ronneberger et al., 2015], originally developed for biomedical image segmentation. A U-Net typically consists of a downsampling path and an upsampling path, with skip connections between corresponding layers in the two paths. These skip connections preserve spatial detail by allowing the model to combine low-level features from earlier layers with higher-level features in deeper layers, which is especially beneficial in image generation tasks.

In our work, we employ a U-Net inspired architecture available in Hugging Face's Diffusers library [von Platen et al., 2022], which provides a flexible and widely adopted PyTorch implementation of diffusion-based generative models. The Diffusers' U-Net follows a multi-scale approach with residual blocks, attention mechanisms, and skip connections between downsampling and upsampling stages. These design choices enable the network to capture both global context and fine-grained details. We base our implementation on this standard U-Net, adapting its channel dimensions and layer configurations to fit our computational constraints and target resolution. Two main modifications with regard of the standard architecture were done, firstly we chose to remove attention mechanisms from the DownBlocks and UpBlocks and keep it only for the MiddleBlock for computational reasons, and secondly we replace the nearest neighbors upsampling by a bilinear upsampling to avoid checkerboard effects. The following figure summarizes the architecture, interested readers might refer to the diffusers library documentation<fnref n="4" /> for more details.

<footnote n="4">⁴https://huggingface.co/docs/diffusers/v0.32.2/en/api/models/unet2d</footnote>
<figure><img src="image_6.png" /></figure>