New Python Climate Model Matches Legacy Fortran Code While Running Four Times Faster on GPUs
Marine Science

New Python Climate Model Matches Legacy Fortran Code While Running Four Times Faster on GPUs

A fully coupled land surface model has been rewritten in Python, unlocking GPU acceleration and gradient calculations for future climate forecasting.

By Kamran Akhtar
Published:
Email this Article
New Python Climate Model Matches Legacy Fortran Code While Running Four Times Faster on GPUs
Mean fields of CLM-JAX, CLM and CLM-JAX minus CLM for eight variables during 2019–2023. Soil variables use the first soil layer. RMSE and nRMSE are computed from the mean fields. Shijin Yuan et al. / arXiv

A newly developed Python version of a major land surface model matches its legacy Fortran counterpart while operating up to four times faster on graphics cards. Land surface models simulate vital water, energy, and carbon exchanges between the ground and the atmosphere, serving as core components of global climate forecasts.

Researchers led by Shijin Yuan at Tongji University introduced CLM-JAX, a reimplementation of the Community Land Model version 5.0 in Python, published in the arXiv preprint server. Unlike previous efforts that targeted only isolated modules or simplified versions, this new framework retains the full set of coupled biogeophysical, biogeochemical, and crop processes found in the standard model configuration.

How does the new Python model match the original Fortran code?

To evaluate whether the Python translation preserves accurate numerical behavior, the authors ran continuous five-year global simulations across thirty-two different variables from 2019 to 2023. Because tiny rounding errors can cascade unpredictably in chaotic Earth system simulations, the team established a stringent baseline by introducing microscopic floating-point perturbations of order ten to the power of negative fourteen to the initial soil temperature of ten separate reference runs.

Figure 1: CLM-JAX workflow and execution. (a) Forward and backward passes through a model time step. Starting from the initial state 𝐒0\mathbf{S}_{0}, the forward pass (dark blue arrows) advances the state 𝐒n\mathbf{S}_{n} to 𝐒n+1\mathbf{S}_{n+1} using forcing and boundary inputs 𝐔n\mathbf{U}_{n}, parameters 𝜽\boldsymbol{\theta} and grid structure 𝒢\mathcal{G}, as in Eq. (1). Carbon and nitrogen calculations are performed before and after subsurface drainage. History files record states, fluxes and diagnostics after the vegetation state update. In the backward pass (red dotted arrows), the adjoint 𝝀N=∇𝐒NJ\boldsymbol{\lambda}_{N}=\nabla_{\mathbf{S}_{N}}J obtained from the objective JJ is propagated backward in time and, within each time step, through the processes in reverse order, as in Eq. (3). The resulting 𝝀0\boldsymbol{\lambda}_{0} is the gradient of JJ with respect to the initial state, and gradients with respect to the continuous forcing and the parameters can be computed in the same way.
CLM-JAX workflow and execution. (a) Forward and backward passes through a model time step. Starting from the initial state 𝐒0\mathbf{S}_{0}, the forward pass (dark blue arrows) advances the state 𝐒n\mathbf{S}_{n} to 𝐒n+1\mathbf{S}_{n+1} using forcing and boundary inputs 𝐔n\mathbf{U}_{n}, parameters 𝜽\boldsymbol{\theta} and grid structure 𝒢\mathcal{G}, as in Eq. (1). Carbon and nitrogen calculations are performed before and after subsurface drainage. History files record states, fluxes and diagnostics after the vegetation state update. In the backward pass (red dotted arrows), the adjoint 𝝀N=∇𝐒NJ\boldsymbol{\lambda}_{N}=\nabla_{\mathbf{S}_{N}}J obtained from the objective JJ is propagated backward in time and, within each time step, through the processes in reverse order, as in Eq. (3). The resulting 𝝀0\boldsymbol{\lambda}_{0} is the gradient of JJ with respect to the initial state, and gradients with respect to the continuous forcing and the parameters can be computed in the same way. Credit: Shijin Yuan et al. / arXiv

The differences recorded between CLM-JAX and the standard model consistently remained below this baseline of internal model variability. Statistical evaluations across hourly samples, spatial patterns, plant functional types, and eleven distinct land column types confirmed that the Python version produces results virtually indistinguishable from the traditional CPU implementation.

What makes GPU acceleration and gradient calculations possible?

Traditional climate models are written in Fortran and rely heavily on multiple CPU cores communicating through complex message-passing interfaces. By shifting the entire model structure into Python utilizing the JAX library, the system becomes capable of utilizing hardware accelerators while supporting automatic differentiation.

Tested on a single NVIDIA A800 graphics processing unit, CLM-JAX required about zero point seven seven seconds per model hour, achieving speedups of four point zero four and two point five seven over the original model running on sixty-four processor cores compiled with different system toolchains. Furthermore, the model successfully performed gradient backpropagation through one hundred consecutive time steps, yielding accurate directional derivatives that agreed with converged finite-difference references in over ninety-five percent of evaluated gridcell combinations.

Figure 2: Six-hourly RMSE of eight variables during 2019–2023. Blue lines show the 45 pairwise differences among ten CLM runs with perturbed initial soil temperature, and the black line shows the baseline of CLM’s own differences. The red line shows the difference between CLM-JAX and the unperturbed CLM run. Soil variables include all valid soil layers.
Six-hourly RMSE of eight variables during 2019–2023. Blue lines show the 45 pairwise differences among ten CLM runs with perturbed initial soil temperature, and the black line shows the baseline of CLM’s own differences. The red line shows the difference between CLM-JAX and the unperturbed CLM run. Soil variables include all valid soil layers. Credit: Shijin Yuan et al. / arXiv

What hurdles remain for advanced climate data assimilation?

While the overall performance and numerical consistency exceeded expectations, the team observed that finite-difference convergence dropped in snow-covered or frozen gridcells. This drop occurs because physical parameterization schemes, such as soil freezing and thawing, introduce sharp threshold boundaries that cause mathematical discontinuities in the model gradients.

Overcoming these gradient discontinuities remains a key step for future applications. The researchers plan to incorporate artificial intelligence parameterizations to smooth physical thresholds, opening the door for advanced end-to-end parameter optimization and four-dimensional variational data assimilation using real-world satellite and flux-site observations.

The study was posted to the arXiv preprint server on November 25, 2026.

Fact Checked

This article has been fact checked for accuracy, with information verified against reputable sources. Learn more about us and our editorial process.

Last reviewed on .

Article history

  • Latest version

Cite this page:

Akhtar, Kamran. “New Python Climate Model Matches Legacy Fortran Code While Running Four Times Faster on GPUs.” BioScience. BioScience ISSN 2521-5760, 26 November 2026. <https://www.bioscience.com.pk/en/subject/marine-science/clm-jax-v3-2-46-a-differentiable-gpu-accelerated-land-surface-model-numerically-indistinguishable-from-the-community-land-model-5-0>. Akhtar, K. (2026, November 26). “New Python Climate Model Matches Legacy Fortran Code While Running Four Times Faster on GPUs.” BioScience. ISSN 2521-5760. Retrieved November 26, 2026 from https://www.bioscience.com.pk/en/subject/marine-science/clm-jax-v3-2-46-a-differentiable-gpu-accelerated-land-surface-model-numerically-indistinguishable-from-the-community-land-model-5-0 Akhtar, Kamran. “New Python Climate Model Matches Legacy Fortran Code While Running Four Times Faster on GPUs.” BioScience. ISSN 2521-5760. https://www.bioscience.com.pk/en/subject/marine-science/clm-jax-v3-2-46-a-differentiable-gpu-accelerated-land-surface-model-numerically-indistinguishable-from-the-community-land-model-5-0 (accessed November 26, 2026).
End of the article