DHSVM

Run and validate DHSVM 3.2 distributed watershed hydrology simulations with unit-safe forcing conversion.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires numpy, pandas, matplotlib, pyyaml, netCDF4, rasterio, pysheds, pyflwdir, and includes scripts (resource) and references (resource) components.

What problem does it solve? Running the DHSVM distributed hydrology model requires correct forcing unit conversions, binary terrain maps, stream network files, and configuration assembly, where silent unit errors (mm vs m, Kelvin vs Celsius) produce plausible-looking but wrong results. ## Core Features & Use Cases - End-to-end pipeline tools: Seven Python tools cover terrain building, stream network generation, forcing conversion, soil parameter conversion, config generation, model execution, and output parsing. - Diagnostic recovery: 20 symptom-diagnosis-remedy triplets in diagnostics/triplets.yaml map known failure modes (unit traps, path mismatches, segfaults) to validated fixes. - Validation against cited standards: Streamflow NSE/PBIAS and SWE metrics are judged against literature-cited pass bands, with a preflight check verifying binary, environment, and data before any run. - Use Case: Convert CMFD or ERA5 reanalysis data into DHSVM per-cell forcing files, build terrain and stream inputs for a mountainous basin, run the compiled DHSVM binary, and score simulated streamflow against observed discharge. ## Quick Start Run python preflight_check.py in this directory, then ask the agent to convert CMFD forcing data, generate the DHSVM configuration, and execute the model for the Chiwawa test watershed.

Frequently Asked Questions about DHSVM

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

FAQPage Schema
How do I run the DHSVM hydrology model on a new watershed?

Build terrain binaries with build_terrain.py, generate the stream network with build_stream_network.py, convert forcing with convert_forcing.py, assemble the config with generate_config.py, then execute via run_dhsvm.py. Run preflight_check.py first to verify the binary and environment.

How do I convert CMFD or ERA5 data to DHSVM forcing format?

Use tools/convert_forcing.py with --source-format cmfd, era5, or mswx. It writes per-cell ASCII files named data_<lat>_<lon> with precipitation in meters per timestep, temperature in Celsius, and humidity in percent.

Why does my DHSVM run produce absurd streamflow with no error?

The most common cause is precipitation supplied in mm instead of meters per timestep, producing a silent 1000x flood. Check diagnostics/triplets.yaml entries dt_001 through dt_011 for unit conversion traps before debugging further.

What basins are suitable for DHSVM modeling?

DHSVM targets steep, mountainous watersheds at 30-150 m resolution with relief above roughly 300 m and areas up to about 10,000 km2. Flat, regulated lowland basins like the Huai plain are outside its domain and should be rejected.

What Python packages do the DHSVM KI tools require?

The tools require numpy, pandas, matplotlib, PyYAML, rasterio, pysheds, and pyflwdir, plus netCDF4 optionally. The preflight check verifies each import in the configured Python environment.

How is DHSVM streamflow output validated against observations?

Use parse_output.py with an observed discharge CSV to compute NSE, KGE, and PBIAS from Stream.Flow output. Results are judged against cited bands: NSE 0.5 satisfactory, 0.65 good, 0.75 very good, excluding the spin-up period.