Skip to content
Back to skills

Docs

ASecurity

> **Stage ID**: s10_coupling > **Pipeline order**: 10 of 10 > **Depends on**: none (uses outputs from HydroCraft VIC/CaMa-Flood/DSSAT pipelines)

  • 200 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added September 11, 2026
devopspythonbash

Works with

  • cli

Security analysis

A100/100

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

Scanned October 5, 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-7e36b827/badge)](https://www.skillsdirectory.com/skills/lzwei196-docs-7e36b827)

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
# Multi-Model Coupling (VIC/CaMa-Flood/DSSAT) — Skill Document

> **Stage ID**: s10_coupling
> **Pipeline order**: 10 of 10
> **Depends on**: none (uses outputs from HydroCraft VIC/CaMa-Flood/DSSAT pipelines)

## Purpose

Bridge RESULTS from HydroCraft's hydrological (VIC), hydrodynamic (CaMa-Flood), and crop (DSSAT) models to LDNDC biogeochemistry inputs. This ensures physical consistency across models when running coupled hydrology-biogeochemistry-agronomy simulations. Three primary coupling pathways exist: VIC soil-moisture results for the initial water content, CaMa-Flood water table/flooding, and DSSAT residue/management. A fourth path (LDNDC to water quality) provides feedback for downstream nutrient assessments.

## Prerequisites

- [ ] VIC simulation complete (HydroCraft Steps 1-7) for VIC coupling
- [ ] CaMa-Flood simulation complete for water table coupling
- [ ] DSSAT simulation complete for residue/management coupling
- [ ] Python environment activated with xarray, netCDF4, pandas

## Inputs

| Input | Type | Source | Description |
|-------|------|--------|-------------|
| vic_result_dir | directory | HydroCraft VIC | VIC simulation output (flux files) |
| cama_output_dir | directory | HydroCraft CaMa | CaMa-Flood output NetCDF (sfcelv, flddph, fldfrc) |
| dssat_summary | file | HydroCraft DSSAT | DSSAT Summary.OUT with crop yield and residue |
| lat, lon | number | HydroCraft | Target grid cell coordinates |

## Procedure

Coupling works on model RESULTS. LDNDC climate and soil are not made from VIC forcing files or the VIC soil parameter file: build them from the data source with S4 (`convert_forcing_to_ldndc_climate.py`) and S2 (`hwsd_to_ldndc_soil.py`). (Steps 1 and 2 of the earlier version of this document did that conversion; they were removed on 2026-10-02.)

### Step 3: Extract VIC soil moisture for initial conditions (VIC -> LDNDC)

```bash
python tools/s10_vic_coupling/vic_to_ldndc_soilwater.py
```

Extracts VIC soil moisture on simulation start date, converts mm to volumetric fraction (theta = SM_mm / layer_depth_mm), interpolates from VIC 3-layer to LDNDC multi-layer profile.

### Step 4: CaMa-Flood water table coupling (CaMa -> LDNDC)

Extract CaMa-Flood surface water elevation and flood depth to determine water table depth for LDNDC groundwater boundary conditions.

```
wt_depth = surface_elevation - water_level
if flooding: wt_depth = -flddph (water above surface)
```

**Impact**: Shallow water table increases anaerobic soil volume, promoting denitrification (N2O) and methanogenesis (CH4). Critical for floodplain and wetland biogeochemistry.

**Status**: Conceptual -- no validated tool yet. Use CaMa output values to manually set LDNDC groundwater parameters.

### Step 5: DSSAT management/residue coupling (DSSAT -> LDNDC)

Compare DSSAT-simulated crop yield with LDNDC yield for cross-validation. Use DSSAT residue and management data to inform LDNDC management events.

**Yield conversion**: LDNDC yield is in kgC/ha. DSSAT yield (HWAM) is in kg DM/ha. Convert: `yield_DM = yield_C / 0.45`.

### Step 6: LDNDC nutrient leaching for water quality (LDNDC -> downstream)

LDNDC NO3 leaching output can feed into water quality assessment when coupled with VIC drainage:

```
NO3_load_kg = NO3_leaching_kgN_ha * basin_area_ha
NO3_concentration_mgL = (NO3_load_kg * 1e6) / (drainage_mm * basin_area_m2)
```

## Expected Outputs

| Output | Path | Verification |
|--------|------|--------------|
| soil moisture JSON | in-memory | Theta in [0, porosity] per layer |
| Yield comparison | in-memory | LDNDC vs DSSAT within 30% |

## Validation Checks

1. **Bulk density units**: LDNDC bd in g/cm3 (0.5-2.0), NOT kg/m3 (500-2000)
2. **Organic carbon**: LDNDC corg as mass fraction (0.001-0.05), NOT percentage
3. **Water table depth**: Should be in range [-5, 20] meters (negative = above surface)

## Common Pitfalls

> **PITFALL**: LDNDC yield in kgC vs DSSAT yield in kg DM
> LDNDC reports yield as kgC/ha. DSSAT reports as kg dry matter/ha (HWAM). The carbon content of grain is ~45%, so multiply LDNDC by ~2.2 to get DM equivalent for comparison.

---

*This skill document is part of the ldndc-knowledge-infrastructure package.*
*Stage 10 of 10 | Tools used: vic_to_ldndc_soilwater*

Files in this skill

  • REFERENCES.md1.3 KB
  • format_spec.yaml34.9 KB
  • model_couplings.yaml9.6 KB
  • papers.json6.7 KB
  • s10_vic_coupling_skill.md5.2 KB
  • s1_installation_skill.md4.9 KB
  • s1_project_setup_skill.md4 KB
  • s2_site_config_skill.md4.7 KB
  • s3_setup_modules_skill.md4.3 KB
  • s4_climate_prep_skill.md4 KB
  • s5_airchemistry_prep_skill.md2.7 KB
  • s6_management_config_skill.md4.2 KB
  • s7_species_params_skill.md3.4 KB
  • s8_execution_skill.md4 KB
  • s9_coupling_skill.md7.3 KB
  • s9_output_parsing_skill.md4.5 KB
  • validation_convention.yaml18.6 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.

Comments

Loading comments…