Skip to content

MRRpy

Rainfall–runoff and flood routing for any basin on Earth, from a DEM and a storm.

MRRpy, the Multi-Mechanism Runoff and Routing model, is a distributed, physics-based flood model in Python. Give it an elevation model and a storm. It traces the drainage network, works out how much of the rain runs off the soil, routes the water through every grid cell and river channel, and returns the flood hydrograph at the outlet, maps of depth and flow, and a check that no water was lost.

It runs offline with your own data, or fetches what's missing (elevation, satellite rain, soil, land cover) from Google Earth Engine, so even an ungauged basin can be modelled in minutes.

Get started User manual Examples

Water depth and river flow spreading over the Kathmandu valley during a storm, with the hydrograph

A 2-hour storm over the whole Kathmandu valley at 90 m. Left: water depth. Middle: river flow, wider lines for more water. Right: flow leaving the valley. (Example 10)

IMERG satellite rain and the simulated flood of 26–30 September 2024

The September 2024 Kathmandu flood, from NASA satellite rain (Example 7).

Storm rain spread from four gauges by Thiessen and by IDW, and the two hydrographs

Your own rain gauges, spread two ways, and the floods they make (Example 6).

Try it

pip install "MRRpy[all]"
from MRRpy import ConfigForm
ConfigForm()        # six steps: terrain, projection, rain, runoff, routing, run
MRRpy wizard            # a few plain questions, saved as run.yaml
MRRpy run -c run.yaml
from MRRpy import Config, run_pipeline, plot_hydrograph

cfg = Config(DEM_PATH="dem.tif", OUTPUT_POINT=(27.632, 85.293),   # outlet (lat, lon)
             TARGET_CRS_EPSG="EPSG:32645", OUTPUT_DIR="results/",
             RAIN_INTENSITY_MM_HR=20.0, RAIN_DURATION_HOURS=3.0)
out = run_pipeline(cfg)              # → results/hydrograph.csv, mass_balance.csv, …
plot_hydrograph(out)

MRRpy_plugin: a five-tab dialog (DEM & Watershed, Precipitation, Runoff, Routing, Results) that runs the same model inside QGIS. Install it.

What it does

  • Terrain


    Your DEM, or one of eight DEM datasets downloaded for a box you draw. Pit removal that carves through barriers, D8 flow directions, and the watershed above an outlet, or the whole DEM. Chapter 1

  • Rain


    A design storm, your rain gauges (Thiessen or inverse-distance), NASA IMERG satellite rain for any date since 2000, weather-model rain from Open-Meteo, past or forecast, or your own rain maps (NetCDF or GeoTIFF). Optional snow line. Chapter 3

  • Runoff


    SCS Curve Number (with the global GCN250 map), runoff coefficients, your own runoff maps, or soil physics: Green–Ampt infiltration, saturated source areas (VSA-OPM, Pradhan & Ogden 2010) and impervious cities, in any combination. Chapter 4

  • Routing


    Kinematic wave, Muskingum–Cunge, or a semi-implicit diffusion wave that handles backwater and flat valleys with large, stable time steps. Chapter 5

  • River channels


    Sub-grid channels cut into each river cell, sized to carry the 2-year flood: from a global estimate, your gauge, or a regional formula. Chapter 5.5

  • Results


    Outlet hydrograph, virtual gauges anywhere, depth and flow maps over time, animations, peak-flood GeoTIFFs, and a water-balance check on every run. Chapter 6

  • Global data, or none


    Earth Engine supplies DEMs, IMERG rain, curve numbers, soil, land cover and river size. Every option also works offline with your own files. Earth Engine

  • Four ways to work


    A step-by-step Jupyter form, a terminal wizard and config files, Python, and a QGIS plugin, all building the same configuration. CPU or NVIDIA GPU. Ways to set up a run

How it fits together

 DEM ─▶ Terrain ─▶ drainage network + watershed                     (stage process_dem)
                          │
 Rain ─▶ Runoff ─▶ runoff in every cell                              (stage routing)
                          ▼
                  Routing through cells and channels ─▶ hydrograph.csv, gauges.csv,
                  ▲                                     flood maps, mass_balance.csv
     roughness · river channels · inflows from upstream

Runoff and routing are independent: any runoff method works with any routing method, so comparing two choices means changing one setting.

Where to go next

I want to… Go to
install MRRpy and make a first run Installation, Quickstart
understand a setting, or the physics behind it the user manual, or the A–Z list
copy a working setup the examples, each in notebook, CLI, Python and QGIS form
script many runs or extend the model Many runs from Python, For developers

Learn the science

A free, interactive companion course walks through the physics from the ground up (DEMs, delineation, runoff, and each routing scheme) with in-browser simulations: the MRRpy course.

Citing and acknowledgements

MRRpy was developed as part of Saurav Bhattarai's PhD research at Jackson State University, in collaboration with the U.S. Army Engineer Research and Development Center (ERDC–CHL), with support from ORISE. If you use it, please cite it.