The process and value of reprogramming a legacy global hydrological model

Abstract. Global hydrological models (GHMs) improve our understanding of water flows and storage on the continents and have undergone significant advancements in process representation over the past four decades. However, as research questions and GHMs become increasingly complex, maintaining and enhancing existing model codes efficiently has become challenging. Issues such as non-modular design, inconsistent variable naming, insufficient documentation, lack of automated software testing suites, and containerization hinder the sustainability of GHM research software as well as the reproducibility of study results obtained with the help of GHMs. Although some GHMs have been reprogrammed to address these challenges, existing literature focuses on evaluating the quality of model output rather than the quality of the reprogrammed software. To address this research gap and guide other researchers who wish to implement their existing models as sustainable research software, we describe how the most recent version of the GHM WaterGAP was reprogrammed. The success of reprogramming is assessed based on various software sustainability criteria and the FAIR4RS principles – findability, accessibility, interoperability, and reusability – since the primary goal was to improve software sustainability and research reproducibility, rather than model output quality. Following an agile project management approach, WaterGAP was rewritten from scratch in Python with a modular Model-View-Controller architecture. Due to the switch from C/C++ in the legacy code to Python, execution time doubled. Our evaluation indicates that the reprogramming substantially improved the software's usability, maintainability, and extensibility, making the reprogrammed WaterGAP software much more sustainable than its predecessor. The reprogrammed WaterGAP software can be easily understood, applied, and enhanced by novice and experienced modellers and is suited for collaborative code development across diverse teams and locations, fostering the establishment of a community GHM. We outline four lessons learned from the reprogramming process concerning the sustainability-runtime trade-off, the applicability of the agile approach, software design patterns, variable naming, external documentation, and automation.

Authors

Institutions

Publication Details

Journal
Geoscientific model development
Published
2025-09-04
DOI
https://doi.org/10.5194/gmd-18-5635-2025
Primary Topic
Hydrology and Watershed Management Studies
Type
article
Field-Weighted Citation Impact
0.00

Funders

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

The process and value of reprogramming a legacy global hydrological model

Emmanuel Nyenah, Robert Reinecke, Lisa Nissen, Martina Flörke et al.
Geoscientific model development
Hydrology and Watershed Management Studies
article

The process and value of reprogramming a legacy global hydrological model

Emmanuel Nyenah, Robert Reinecke, Lisa Nissen, Martina Flörke, Petra Döll, Leon Mühlenbruch
article en

Abstract

Abstract. Global hydrological models (GHMs) improve our understanding of water flows and storage on the continents and have undergone significant advancements in process representation over the past four decades. However, as research questions and GHMs become increasingly complex, maintaining and enhancing existing model codes efficiently has become challenging. Issues such as non-modular design, inconsistent variable naming, insufficient documentation, lack of automated software testing suites, and containerization hinder the sustainability of GHM research software as well as the reproducibility of study results obtained with the help of GHMs. Although some GHMs have been reprogrammed to address these challenges, existing literature focuses on evaluating the quality of model output rather than the quality of the reprogrammed software. To address this research gap and guide other researchers who wish to implement their existing models as sustainable research software, we describe how the most recent version of the GHM WaterGAP was reprogrammed. The success of reprogramming is assessed based on various software sustainability criteria and the FAIR4RS principles – findability, accessibility, interoperability, and reusability – since the primary goal was to improve software sustainability and research reproducibility, rather than model output quality. Following an agile project management approach, WaterGAP was rewritten from scratch in Python with a modular Model-View-Controller architecture. Due to the switch from C/C++ in the legacy code to Python, execution time doubled. Our evaluation indicates that the reprogramming substantially improved the software's usability, maintainability, and extensibility, making the reprogrammed WaterGAP software much more sustainable than its predecessor. The reprogrammed WaterGAP software can be easily understood, applied, and enhanced by novice and experienced modellers and is suited for collaborative code development across diverse teams and locations, fostering the establishment of a community GHM. We outline four lessons learned from the reprogramming process concerning the sustainability-runtime trade-off, the applicability of the agile approach, software design patterns, variable naming, external documentation, and automation.

Geoscientific model developmentVol. 18(17)
Goethe University Frankfurt (DE), Johannes Gutenberg University Mainz (DE), Senckenberg Biodiversity and Climate Research Centre (DE), Ruhr University Bochum (DE)
Deutsche Forschungsgemeinschaft
Openalex Percentile: Top 78%
Hydrology and Watershed Management Studies
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.