CaMa‐PyTorch (v1.0): A New Catchment‐Based Macro‐Scale Floodplain Model Written in PyTorch
6 affiliations
- 1College of Artificial Intelligence Changchun Normal University Changchun China
- 2School of Atmospheric Sciences Sun Yat‐Sen University Zhuhai China
- 3College of Computer Science and Technology Jilin University Changchun China
- 4College of Geographical Sciences Changchun Normal University Changchun China
- 5Jilin Meteorological Administration Changchun China
- 6Division of Environment and Sustainability The Hong Kong University of Science and Technology Hong Kong China
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.
Related
- Porting Deep‐Learning Phase Pickers From TensorFlow to PyTorch for SeisBench Without Retraining
- Convolutional LSTM and Self-Attention Networks in PyTorch for Decade-Ahead Forecasting of Land-Cover Time Series
- Flood susceptibility in a coastal backwater floodplain: a spatially validated multi-event SAR framework for Alappuzha, India
- A process-based framework for diagnosing floodplain ecological functioning to guide riverine wetland restoration
- Assessing SWOT capabilities for monitoring floodplain water dynamics in the Paraná Basin
BibTeX
@article{liu2026camapytorch,
title = {{CaMa‐PyTorch (v1.0): A New Catchment‐Based Macro‐Scale Floodplain Model Written in PyTorch}},
author = {Zenghui Liu and Qiyu Li and Qingliang Li and Zhongwang Wei and Cheng Zhang and Hua Yuan and Yunfeng Lv and Jingquan Ren and Xiaoming Shi and Yongjiu Dai},
journal = {Earth and Space Science},
year = {2026},
month = oct,
doi = {10.1029/2026ea005015},
url = {https://agupubs.onlinelibrary.wiley.com/doi/10.1029/2026EA005015},
note = {CC BY-NC 4.0},
}
RIS
TY - JOUR
TI - CaMa‐PyTorch (v1.0): A New Catchment‐Based Macro‐Scale Floodplain Model Written in PyTorch
AU - Zenghui Liu
AU - Qiyu Li
AU - Qingliang Li
AU - Zhongwang Wei
AU - Cheng Zhang
AU - Hua Yuan
AU - Yunfeng Lv
AU - Jingquan Ren
AU - Xiaoming Shi
AU - Yongjiu Dai
PY - 2026
DA - 2026/10/29
JO - Earth and Space Science
DO - 10.1029/2026ea005015
UR - https://agupubs.onlinelibrary.wiley.com/doi/10.1029/2026EA005015
AB - 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.
SN - 2333-5084
SN - 2333-5084
ER -