Developer: Men Vuthy (MEng)
Expertise: Hydrology · GIS/Remote Sensing · Climate Change · Geospatial Software Eng · ML & DL
Date: April 2026
This repository provides a Python‑based automatic calibration framework for the Rainfall–Runoff–Inundation (RRI) model using the SCE‑UA global optimization algorithm implemented via SPOTPY.
The framework is designed to automate RRI model calibration, reduce manual trial‑and‑error, and improve reproducibility in hydrological and flood modeling studies.
Schematic Diagram of Rainfall-Runoff-Inundation (RRI) Model (Sayama et al., 2012)
To support my work, please put a Star ⭐ on this repository! Thank you 🙇♂️
- Key Features
- Calibration Workflow
- Repository Structure
- Requirements
- Installation
- Input Data
- Running Auto Calibration
- Outputs
- Showcase
- Notes/Disclaimer
- Acknowledgments
- License
- Contact
- Commercial Version
- Automatic calibration of RRI model parameters
- Global optimization using the SCE‑UA algorithm
- Integration with SPOTPY optimization framework
- Support for common objective functions (RMSE, MAE, R²)
- Flexible parameter range definition
- CSV‑based logging of calibration results
- Reproducible environment using Conda (
environment.yml)
The auto‑calibration process follows these steps:
- Initialize the RRI calibration model
- Read calibration settings and parameter ranges
- Load observed discharge data
- Execute repeated RRI simulations
- Evaluate model performance using an objective function
- Search for optimal parameters using SCE‑UA
- Save calibration logs and optimal parameter sets
RRI_project_root/
│
├─ rri_calib/
│ ├─ obs/ # Observed discharge (CSV)
│ ├─ src/ # RRI simulation outputs
│ ├─ init.py
│ └─ ParameterSetting.xlsx # Calibration parameter definition (XLSX)
│
├─ rri_calib/src/
│ ├─ init.py
│ ├─ plot_style.py # Custom plotting style
│ └─ calibrator.py # CalibrateRRI class
│
├─ rri_calib/obs/
│ └─ disc_kankai.csv # Example observed discharge (CSV)
│
├─ environment.yml # Conda environment (recommended)
├─ LICENSE
└─ README.mdThis notebook requires a Conda environment with the following main dependencies:
- Python (recommended: 3.10)
- SPOTPY
- Scikit-learn
- NumPy
- Pandas
- SciPy
- Matplotlib
The environment can be created using the provided environment.yml file.
- Anaconda installed on your system
(https://www.anaconda.com/)
Clone this repository or download the source code, and copy the program files into the RRI‑CUI project folder where the RRI model executable and input files are located.
Ensure that:
- The
rri_calibmodule is placed inside the RRI‑CUI working directory - Observed discharge data and RRI input files are accessible from this folder
- File paths in the configuration and parameter setting files remain unchanged
This step allows the auto‑calibration program to directly execute the RRI model and access required input/output files.
Use the provided environment.yml file to create the required Conda environment:
conda env create -f environment.ymlAfter the environment is created, activate rri_calib environment:
conda activate rri_calibThe following inputs are required before running the calibration:
- Observed discharge data (CSV format)
- RRI model input files and executable
- Parameter ranges defined in
ParameterSetting.xlsx - Number of calibration iterations
- Selected objective function (e.g. RMSE or MAE)
Please ensure that all input files are correctly configured before execution.
The code cell below initializes the calibration model, sets up the SCE‑UA sampler, and starts the optimization process.
Depending on the number of iterations and model complexity, the calibration may require significant computation time.
The calibration produces the following outputs:
- CSV log file containing objective function values and parameter sets
- Optimal parameter combination identified by SCE‑UA
- Hydrograph plots comparing observed and simulated discharge
These results can be used for validation, sensitivity analysis, or further simulations.
This showcase demonstrates the application of an automatic calibration program to a RRI model simulation in the Pursat River Basin, Cambodia. The showcase highlights optimized parameter estimation and improved agreement between observed and simulated discharge, demonstrating the effectiveness of automated calibration for hydrological modeling.
- Calibration results depend strongly on the quality of observed data and the selected parameter ranges.
- It is recommended to verify calibrated parameters against physical and hydrological plausibility.
- Long calibration runs are advised to ensure stable convergence of the SCE‑UA algorithm.
This program was supported by the Department of Water Resources and Energy, Nippon Koei Co., Ltd., Tokyo, Japan, and it was applied in the Rural Road Connectivity Improvement Project (RRCIP) under the Ministry of Rural Development (MRD) in Cambodia. The authors gratefully acknowledge MRD, JICA Cambodia, and all related institutions for their support and for providing the data necessary for the case study.
Distributed under the Apache-2.0 License. See LICENSE for more information.
MEN Vuthy (MEng)
📍 Tokyo, Japan
For inquiries related to this repository, including technical questions, collaboration, or commercial licensing, please feel free to reach out via email.
Email:
- 📧 Work: vuthy-mn@n-koei.jp
- 📧 Personal: menvuthy93@gmail.com
This is a limited version of the project for demonstration purposes. A full version of this software is available for commercial use.
If you are interested, please contact the author above.




