Preprints
https://doi.org/10.5194/egusphere-2026-7116
https://doi.org/10.5194/egusphere-2026-7116
24 Nov 2026
 | 24 Nov 2026
Status: this preprint is open for discussion and under review for Geoscientific Model Development (GMD).

TerraFlow (version 1.0): a differentiable multi-backend nonhydrostatic atmospheric dynamical core on unstructured spherical meshes

Tiange Huang, Li Dong, Ziniu Xiao, Baoxiang Pan, and Gaopeng Lu

Abstract. Atmospheric modeling increasingly requires dynamical cores that combine efficient simulation with gradient computation for sensitivity analysis and parameter estimation. To address these needs, we present TerraFlow (version 1.0), a differentiable, multi-backend nonhydrostatic atmospheric dynamical core that supports both JAX and PyTorch on unstructured spherical meshes. Built on a layer-averaged finite-volume formulation in a dry-mass vertical coordinate, TerraFlow uses a common array and state-update interface to execute the same numerical operators with either backend. This design brings automatic differentiation, just-in-time compilation, and graphics processing unit (GPU) acceleration across both backends together with distributed forward integration through the Message Passing Interface in a unified framework. Five idealized tests evaluate the model's numerical performance, demonstrating that it reproduces the principal features of passive-tracer transport, large-scale rotational flow, and nonhydrostatic gravity waves. To assess local derivative accuracy, we use finite-difference comparisons and Taylor remainder tests in short nonhydrostatic integrations. For both backends, directional derivatives computed by automatic differentiation agree with centered finite-difference estimates to relative errors below 10−4 for all tested output fields over suitable perturbation ranges, and the loss Taylor remainders exhibit second-order convergence. The resulting gradients support a successful inversion that recovers two prescribed initial potential-temperature perturbation amplitudes from noise-free synthetic observations in six updates. Computational efficiency is assessed separately through double-precision hydrostatic benchmarks, in which one NVIDIA RTX 4090 achieves forward-integration speedups of approximately 2.3–7.0 relative to corresponding runs on 10 central processing unit (CPU) nodes with 2560 cores in total, excluding compilation, model construction, and output. By bringing efficient forward simulation and verified local differentiation into a shared numerical implementation, TerraFlow provides a common framework for atmospheric sensitivity analysis and gradient-based parameter estimation across two computational backends.

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.
Share
Tiange Huang, Li Dong, Ziniu Xiao, Baoxiang Pan, and Gaopeng Lu

Status: open (until 19 Jan 2027)

Comment types: AC – author | RC – referee | CC – community | EC – editor | CEC – chief editor | : Report abuse
Tiange Huang, Li Dong, Ziniu Xiao, Baoxiang Pan, and Gaopeng Lu

Model code and software

TerraFlow v1.0: source code and supporting materials for a differentiable multi-backend nonhydrostatic atmospheric dynamical core on unstructured spherical meshes Tiange Huang et al. https://doi.org/10.5281/zenodo.24191174

Tiange Huang, Li Dong, Ziniu Xiao, Baoxiang Pan, and Gaopeng Lu
Metrics will be available soon.
Latest update: 24 Nov 2026
Download
Short summary

We developed TerraFlow 1.0 to combine efficient atmospheric simulation with automatic differentiation. The model supports multiple computational backends, acceleration on graphics processors, and simulations across multiple computers. Tests reproduce key flow patterns and confirm the accuracy of sensitivity calculations used to recover parameters in a controlled experiment. TerraFlow thus provides a foundation for integrating machine learning into atmospheric modeling.

Share