wflow

Runs and validates wflow_sbm hydrology and wflow_sediment simulations via Julia pipeline tools.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires xarray, netCDF4, numpy, pandas, geopandas, shapely, matplotlib, pyyaml, hydromt_wflow, and includes scripts (resource) and references (resource) components.

What problem does it solve? Running Deltares' wflow distributed hydrological model correctly requires deep operational knowledge: Julia environment setup, TOML v1.0 configuration, NetCDF forcing in exact units, cycle-free flow networks, and sediment parameterization. This Skill packages that expertise so an AI agent can build, run, validate, and couple wflow_sbm and wflow_sediment models without silent scientific errors. ## Core Features & Use Cases - End-to-end pipeline: 24 tools across 10 stages covering configuration, HydroMT model building, CMFD/MSWX forcing conversion, PET calculation, TOML generation, Julia execution, discharge extraction, and sediment analysis. - Diagnostic recovery: 39 diagnostic triplets map symptoms (e.g., LDD cycles, Kelvin-vs-Celsius forcing, double-counted routing with CaMa-Flood) to validated remedies. - Coupling and validation: Export unrouted runoff to CaMa-Flood, recharge to MODFLOW, compare discharge against VIC with NSE/KGE metrics, and derive USLE K/C factors from HWSD and AVHRR data. - Use Case: Ask the agent to simulate discharge for the Bengbu basin (2003-2005) with CMFD forcing; it builds staticmaps.nc, converts forcing, generates the v1.0 TOML, runs Wflow.jl in 14 seconds, and validates the hydrograph. ## Quick Start Run preflight_check.py in this KI directory, then ask the agent to build and run a wflow_sbm simulation for your basin by providing the outlet coordinates, period, and forcing dataset.

Frequently Asked Questions about wflow

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

FAQPage Schema
How do I run a wflow_sbm hydrology simulation for a new basin?

Provide the basin outlet coordinates, period, and forcing dataset, then follow the staged pipeline: generate the config, build staticmaps.nc, convert forcing to NetCDF, generate the v1.0 TOML, and execute via run_wflow.py. The Bengbu basin setup is production-validated as a reference.

How does wflow compare to VIC for distributed hydrology?

wflow uses Julia with TOML config, NetCDF I/O, built-in kinematic-wave or local-inertial routing, and a native sediment module. VIC uses C with flat-text config, ASCII forcing, external routing, and no sediment. The compare_with_vic.py tool computes NSE, PBIAS, and KGE between them.

Why does my wflow run crash with cycles detected in the flow graph?

Naive D8 flow direction on coarse grids creates reciprocal flows in flat areas. Use the stage-1 builder with WhiteboxTools breach_depressions and d8_pointer, or MERIT-Hydro flow directions on low-relief basins, and verify n_outlets equals exactly 1.

Can wflow output be coupled to CaMa-Flood or MODFLOW?

Yes. wflow_to_cama.py exports unrouted runoff for CaMa-Flood (never send routed q_river, which double-counts routing), and wflow_recharge_to_modflow.py converts groundwater recharge from mm/day to m/day for MODFLOW boundary conditions.

What forcing units does wflow require?

Precipitation must be mm per timestep (mm/day for daily runs, not mm/s), temperature in degrees Celsius (subtract 273.15 from Kelvin sources like CMFD), and PET must be supplied, computed via calculate_pet.py using Hargreaves or Penman-Monteith.

Why is the first wflow run so slow?

Julia's JIT compilation causes a 30-60 second delay before output appears on the first run; this is normal, not an error. After compilation, the validated Bengbu run completed 1,096 timesteps over 224 cells in 14 seconds.