Skip to content
Back to skills

Docs

ASecurity

Connect wflow outputs with other HydroCraft models: CaMa-Flood (flood routing), VIC (model intercomparison), MODFLOW (groundwater recharge), SWAT+ (sediment-water quality). Each coupling has specific data format requirements and potential for silent errors from double-counting or unit mismatches.

  • 231 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added September 11, 2026
code-qualitypythonbash

Security analysis

A100/100

Pro scans all 14 files and shows the line behind each finding

Scanned September 11, 2026

npx -y skills add lzwei196/KISS---Knowledge-Infrastructure-for-Scientific-Simulation --skill docs --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Docs?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Docs
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/lzwei196-docs-c572953c/badge)](https://www.skillsdirectory.com/skills/lzwei196-docs-c572953c)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
# s9 — Cross-Model Coupling Skill Document

## Purpose

Connect wflow outputs with other HydroCraft models: CaMa-Flood (flood routing), VIC (model intercomparison), MODFLOW (groundwater recharge), SWAT+ (sediment-water quality). Each coupling has specific data format requirements and potential for silent errors from double-counting or unit mismatches.

## Prerequisites

- wflow_sbm run complete (output_grid.nc exists)
- Target model available and configured for the same basin

## Coupling Points

### c_w01: wflow -> CaMa-Flood (Flood Routing)

**When**: wflow's built-in routing is insufficient; need CaMa-Flood's global river network + floodplain dynamics.

**CRITICAL (dt_w025)**: Use UNROUTED runoff from wflow, NOT routed discharge (q_river). wflow already routes internally — sending q_river to CaMa-Flood double-counts routing.

```bash
python wflow_to_cama.py \
  --wflow_output output_grid.nc \
  --output_dir cama_input/ \
  --basin_name chaohe \
  --start_year 2000 --end_year 2010
```

Output: `<basin>_runoff_1d_YYYY.nc` files compatible with CaMa-Flood's setup_cama_basin.py.

### c_w02: wflow vs VIC (Model Intercomparison)

**When**: Scientific comparison of two hydrology models on the same basin.

```bash
python compare_with_vic.py \
  --wflow_csv discharge.csv \
  --vic_routing_file routing_output.day \
  --output comparison.json --plot comparison.png
```

**Expected**: 30-50% magnitude difference is NORMAL (dt_w020). Focus on timing/correlation.

### c_w03: wflow_sediment -> SWAT+ (Water Quality)

**When**: Sediment-bound nutrient transport. wflow provides spatially distributed erosion rates to SWAT+ channel sediment loading.

Convert: wflow sediment yield (t/ha/yr per cell) -> SWAT+ .sed input files.

### c_w04: wflow GW Recharge -> MODFLOW

**When**: Coupled surface-groundwater modeling.

```bash
python wflow_recharge_to_modflow.py \
  --wflow_output output_grid.nc \
  --output recharge_modflow.nc
```

**UNIT CONVERSION**: wflow recharge is mm/day, MODFLOW needs m/day. Tool divides by 1000.

### c_w05: wflow Local Inertial -> SWMM

**When**: wflow 2D flood extent provides boundary conditions for urban drainage models.

### c_w06: wflow + OGGM (Glaciers)

**When**: Detailed glacier dynamics needed. Use OGGM instead of wflow's built-in degree-day glacier.

**CRITICAL**: Same double-counting trap as VIC+OGGM. One model must "own" glacier melt.

## Expected Outputs

| Coupling | Output Format | Tool |
|----------|--------------|------|
| wflow->CaMa | runoff_1d_YYYY.nc | wflow_to_cama.py |
| wflow vs VIC | comparison.json + PNG | compare_with_vic.py |
| wflow->MODFLOW | recharge.nc (m/day) | wflow_recharge_to_modflow.py |

## Validation Checks

1. CaMa-Flood input uses runoff variable, NOT q_river (dt_w025)
2. Recharge units are m/day for MODFLOW (not mm/day)
3. Spatial grids align between coupled models
4. Time periods match exactly

## Common Pitfalls

- **dt_w025**: Double-counting routing (wflow + CaMa-Flood)
- **dt_w020**: wflow vs VIC magnitude difference is expected, not a bug
- **dt_w026**: Ksat unit mismatch between models (mm/day vs mm/s vs m/day)
- Glacier double-counting (wflow + OGGM both compute melt)

Files in this skill

  • REFERENCES.md1.6 KB
  • format_spec.yaml45.8 KB
  • papers.json5.4 KB
  • s0_configuration_skill.md2.2 KB
  • s10_reservoir_skill.md8.2 KB
  • s1_hydromt_setup_skill.md15.3 KB
  • s2_forcing_skill.md2.9 KB
  • s3_parameters_skill.md2.9 KB
  • s4_execution_skill.md2.8 KB
  • s5_output_skill.md2.5 KB
  • s6_s8_sediment_skill.md6.1 KB
  • s9_coupling_skill.md3.1 KB
  • validation_convention.yaml14.8 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in code-quality →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.