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

Python-Fortran Hybrid Programming for Deep Incorporation of AI and Physics Modeling and Data Assimilation (Hf2pMDA_1.0)

Xianrui Zhu, Zikuan Lin, Shaoqing Zhang, Zebin Lu, Songhua Wu, Xiangyun Hou, Zhisheng Xiao, Zhicheng Ren, Jiangyu Li, Jing Xu, Yang Gao, Rixu Hao, Xiaolin Yu, and Mingkui Li

Abstract. Artificial intelligence (AI) provides an unprecedented opportunity for advancing physics numerical modeling including data assimilation, which is a high-efficient and critically-important tool for advancing our understanding on Earth system and its applications. At the same time, deep incorporation of AI and physical modeling can make great driving to advance AI by injecting it rich physics from long time physics-based modeling development. However, since such physics models are conventionally coded in Fortran and AI algorithms usually are conveniently designed in Python, difficulties exist to directly incorporate AI algorithms into physics models, vice versa. Here, based on a f2py protocol, we have developed a procedure that implements an infrastructure which conveniently conducts Python and Fortran hybrid modeling and data assimilation (Hf2pMDA) to form a program entity so that AI algorithms and physical models can invoke mutually. As examples, within Hf2pMDA, a climate weakly coupled data assimilation (WCDA) system is naturally upgraded to a strongly CDA (SCDA) system, and a 1 km high-resolution weather DA system is conveniently implemented within a multi-layer downscaling model that has multiscale DA in different nesting layers. In the climate SCDA system, a coupled general circulation model (CGCM) and multiscale filtering algorithm is integrated by a Python main controller (PMC) that calls Fortran CGCM components and WCDA modules as well as a data-trained SCDA algorithm by latent space variational autoencoder (VAE) in Python. In the high-resolution weather DA system, the downscaled model consisting of traditional Fortran DA modules in all mother domains and Python VAE DA algorithm in the central child domain is integrated by a PMC that organizes these components. With convenient realization of deep incorporation of any AI algorithm and physics model, the Hf2pMDA has a great potential to make progresses on both AI and scientific modeling.

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
Xianrui Zhu, Zikuan Lin, Shaoqing Zhang, Zebin Lu, Songhua Wu, Xiangyun Hou, Zhisheng Xiao, Zhicheng Ren, Jiangyu Li, Jing Xu, Yang Gao, Rixu Hao, Xiaolin Yu, and Mingkui Li

Status: open (until 04 May 2026)

Comment types: AC – author | RC – referee | CC – community | EC – editor | CEC – chief editor | : Report abuse
Xianrui Zhu, Zikuan Lin, Shaoqing Zhang, Zebin Lu, Songhua Wu, Xiangyun Hou, Zhisheng Xiao, Zhicheng Ren, Jiangyu Li, Jing Xu, Yang Gao, Rixu Hao, Xiaolin Yu, and Mingkui Li

Data sets

Hf2p CM2.1_SCDA & WRF_LDA Dataset Xianrui Zhu, Zikuan Lin, Zebin Lu, Shaoqing Zhang, Songhua Wu https://doi.org/10.5281/zenodo.18799861

Model code and software

Hf2p CM2.1_SCDA and WRF_LDA Xianrui Zhu, Zikuan Lin, Shaoqing Zhang, Zebin Lu, Songhua Wu, Xiangyun Hou, Zhisheng Xiao, Zhicheng Ren, Jiangyu Li, Jing Xu, Yang Gao, Rixu Hao, Xiaolin Yu, Mingkui Li https://doi.org/10.5281/zenodo.18800167

CM2.1 Model Thomas L. Delworth, Anthony J. Broccoli, Anthony Rosati, Ronald J. Stouffer, V. Balaji, John A. Beesley, William F. Cooke, Keith W. Dixon, John Dunne, K. A. Dunne, Jeffrey W. Durachta, Kirsten L. Findell, Paul Ginoux, Anand Gnanadesikan, C. T. Gordon, Stephen M. Griffies, Rich Gudgel, Matthew J. Harrison, Isaac M. Held, Richard S. Hemler, Larry W. Horowitz, Stephen A. Klein, Thomas R. Knutson, Paul J. Kushner, Amy R. Langenhorst, Hyun-Chul Lee, Shian-Jiann Lin, Jian Lu, Sergey L. Malyshev, P. C. D. Milly, V. Ramaswamy, Joellen Russell, M. Daniel Schwarzkopf, Elena Shevliakova, Joseph J. Sirutis, Michael J. Spelman, William F. Stern, Michael Winton, Andrew T. Wittenberg, Bruce Wyman, Fanrong Zeng, and Rong Zhang https://doi.org/10.5281/zenodo.18883209

Xianrui Zhu, Zikuan Lin, Shaoqing Zhang, Zebin Lu, Songhua Wu, Xiangyun Hou, Zhisheng Xiao, Zhicheng Ren, Jiangyu Li, Jing Xu, Yang Gao, Rixu Hao, Xiaolin Yu, and Mingkui Li
Metrics will be available soon.
Latest update: 09 Mar 2026
Download
Short summary
Deep integration of Artificial intelligence (AI) algorithms and traditional scientific models is crucial for progress, but Fortran-based scientific codes and Python-based AI are difficult to combine. We develop a Python–Fortran hybrid procedure that enables mutual invocation of AI and scientific modules. Applied to climate and weather models, it supports strongly coupled data assimilation and high-precision prediction, promoting future advances in both AI and scientific modeling.
Share