CaMa‐PyTorch (v1.0): A New Catchment‐Based Macro‐Scale Floodplain Model Written in PyTorch

Abstract Accurate simulation of river discharge underpins hydrological research, climate‐impact assessment, and flood forecasting. CaMa‐Flood, a widely used global river‐routing model, applies physically based principles to represent water transport through river networks. However, its legacy Fortran implementation restricts compatibility with modern AI frameworks and prevents efficient GPU utilization. Here, we present CaMa‐PyTorch (v1.0), a Python reimplementation of CaMa‐Flood v4.23 within PyTorch. A custom indexing scheme reproduces the flexible array operations of the Fortran model while preserving its river network logic and core algorithms. We evaluated numerical fidelity through modular tests and a continuous simulation over the continental United States at 0.0833° resolution from 2005 through 2010. Daily streamflow observations from the Global Runoff Data Centre (GRDC) provided an external benchmark, and model behavior was assessed using hydrograph comparisons, residual analyses, spatial diagnostics, and standard performance metrics. Across these evaluations, CaMa‐PyTorch closely reproduced the temporal and spatial discharge patterns generated by the Fortran implementation. Its tensor architecture also supports parallel computation and GPU execution. As a proof‐of‐concept for machine learning interoperability, a long short‐term memory (LSTM) network was used to postprocess simulated discharge and improved predictive performance. This experiment demonstrates output level coupling with a PyTorch data‐driven module but does not constitute a fully differentiable modeling system. CaMa‐PyTorch therefore provides a numerically faithful and computationally flexible basis for large scale river modeling and future research on more closely integrated physical and data‐driven approaches.

Authors

Institutions

Publication Details

Journal
Earth and Space Science
Published
2026-10-29
DOI
https://doi.org/10.1029/2026ea005015
Primary Topic
Hydrological Forecasting Using AI
Type
article
Field-Weighted Citation Impact
0.00

Funders

Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

CaMa‐PyTorch (v1.0): A New Catchment‐Based Macro‐Scale Floodplain Model Written in PyTorch

Zhongwang Wei, Xiaoming Shi, Yongjiu Dai, Hua Yuan et al.
Earth and Space Science
Hydrological Forecasting Using AI
article

CaMa‐PyTorch (v1.0): A New Catchment‐Based Macro‐Scale Floodplain Model Written in PyTorch

Zhongwang Wei, Xiaoming Shi, Yongjiu Dai, Hua Yuan, 任景全, Yunfeng Lv, Qingliang Li, Qiyu Li, Zenghui Liu, Cheng Zhang
article en

Abstract

Abstract Accurate simulation of river discharge underpins hydrological research, climate‐impact assessment, and flood forecasting. CaMa‐Flood, a widely used global river‐routing model, applies physically based principles to represent water transport through river networks. However, its legacy Fortran implementation restricts compatibility with modern AI frameworks and prevents efficient GPU utilization. Here, we present CaMa‐PyTorch (v1.0), a Python reimplementation of CaMa‐Flood v4.23 within PyTorch. A custom indexing scheme reproduces the flexible array operations of the Fortran model while preserving its river network logic and core algorithms. We evaluated numerical fidelity through modular tests and a continuous simulation over the continental United States at 0.0833° resolution from 2005 through 2010. Daily streamflow observations from the Global Runoff Data Centre (GRDC) provided an external benchmark, and model behavior was assessed using hydrograph comparisons, residual analyses, spatial diagnostics, and standard performance metrics. Across these evaluations, CaMa‐PyTorch closely reproduced the temporal and spatial discharge patterns generated by the Fortran implementation. Its tensor architecture also supports parallel computation and GPU execution. As a proof‐of‐concept for machine learning interoperability, a long short‐term memory (LSTM) network was used to postprocess simulated discharge and improved predictive performance. This experiment demonstrates output level coupling with a PyTorch data‐driven module but does not constitute a fully differentiable modeling system. CaMa‐PyTorch therefore provides a numerically faithful and computationally flexible basis for large scale river modeling and future research on more closely integrated physical and data‐driven approaches.

Earth and Space ScienceVol. 13(11)
Sun Yat-sen University (CN), Jilin University (CN), Hong Kong University of Science and Technology (HK), Changchun Normal University (CN), Jilin Meteorological Bureau (CN)
National Natural Science Foundation of China, Ministry of Education of the People's Republic of China
Climate action
Openalex Percentile: Top 22%
Hydrological Forecasting Using AI
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.

Laika access coming soon