RAPID

Route land-surface runoff through river networks with the RAPID Muskingum model and PETSc.

155|6|Updated Mar 31, 2026
One-click install
npx skills add https://github.com/lzwei196/KISS-Knowledge-Infrastructure-for-Scientific-Simulation --skill rapid-lzwei196
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: RAPID
Source: https://github.com/lzwei196/KISS-Knowledge-Infrastructure-for-Scientific-Simulation/tree/main/models/RAPID
Command: npx skills add https://github.com/lzwei196/KISS-Knowledge-Infrastructure-for-Scientific-Simulation --skill rapid-lzwei196

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires numpy, netCDF4, networkx, geopandas, and includes scripts (resource) and references (resource) components.

What problem does it solve? Running the RAPID river-routing model correctly requires operational expertise scattered across Fortran source code, namelist conventions, and strict unit and file-format rules; this Skill packages that expertise so an AI agent can build inputs, execute the real model binary, validate outputs, and recover from known failure modes without substituting approximations. ## Core Features & Use Cases - End-to-end routing pipeline: Six tools cover connectivity building, LSM runoff-to-Vlat NetCDF conversion, Muskingum k/x parameter generation, namelist assembly, MPI execution, and Qout/V output parsing with metrics. - Diagnostic recovery: A triplets.yaml knowledge base maps 21 symptom patterns (e.g., discharge 10800x too small from Vlat rate-vs-volume errors, KSP divergence from unstable k) to diagnoses and validated remedies. - Validation against published benchmarks: Grade runs against cited NSE/PBIAS bands from David et al. 2011/2015, with dag.yaml defining Qout (m3/s) as the rank-1 observable output. - Use Case: Given GLDAS runoff and a MERIT-Hydro river network, generate the connectivity CSVs, convert runoff to Vlat volumes, assemble the namelist, run RAPID under MPI, and score the simulated discharge against gage observations. ## Quick Start Run python preflight_check.py in this directory to verify the RAPID binary and data are available, then ask the agent to build connectivity and execute a routing simulation for your basin.

Frequently Asked Questions about RAPID

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run the RAPID river routing model?

Build the Fortran binary with PETSc 3.13.6 (or use the Docker image), generate connectivity and parameter CSVs, assemble a namelist, then run mpiexec -np 4 ./rapid -nl rapid_namelist. The included run_rapid.py tool wraps execution with preflight checks.

How do I convert LSM runoff to RAPID Vlat input?

Use convert_lsm_to_vlat.py with your runoff NetCDF, catchment areas, and riv_bas_id file. RAPID expects Vlat as accumulated volume in m3 per routing period, not a rate; the tool converts kg/m2/s, mm/s, or mm/day runoff using catchment area and ZS_TauR.

Why is my RAPID discharge output near zero or 10800 times too small?

This happens when Vlat is supplied as a flow rate (m3/s) instead of accumulated volume (m3); RAPID divides by ZS_TauR internally, so rates get divided twice. It also occurs if the NetCDF variable is named Vlat instead of m3_riv, which RAPID's reader requires.

What units do Muskingum k and x parameters use in RAPID?

k is travel time in seconds (typical range 900-360000), and x is a dimensionless weighting factor between 0 and 0.5. Supplying k in hours or x as a percentage causes unstable C1/C2/C3 coefficients, NaN discharge, or KSP solver divergence.

Can RAPID calibrate parameters against observed discharge?

Yes, setting IS_opt_run=2 activates the built-in TAO optimizer, which calibrates k and x by minimizing squared errors against gage observations. It requires a Qobs NetCDF file in m3/s plus CSV lists of gage reach IDs and optimization time window parameters.

What are the limitations of the Muskingum routing method in RAPID?

Muskingum assumes a linear storage-flow relationship with constant per-reach k and x, so it does not resolve dynamic backwater, floodplain inundation, or nonlinear wave behavior. Discharge accuracy is also bounded by the quality of the externally supplied lateral inflow.