Skip to content
Back to skills

Docs

ASecurity

Configure and run mHM's built-in DDS or SCE optimizer, then extract the best MPR global parameters for later forward validation or s10 transfer.

  • 231 stars
  • 0 votes
  • 0 copies
  • 4 views
  • Added September 11, 2026
testingpythonbash

Security analysis

A100/100

Pro scans all 16 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-f3b98b56/badge)](https://www.skillsdirectory.com/skills/lzwei196-docs-f3b98b56)

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_calibration Skill

## Purpose

Configure and run mHM's built-in DDS or SCE optimizer, then extract the best MPR global parameters for later forward validation or s10 transfer.

## Inputs

- A fully working forward-run directory from s0-s8.
- `mhm.nml`, `mhm_parameter.nml`, forcing, morphology, and gauge files.
- Optimizer method: `1` for DDS or `3` for SCE.
- Discharge objective function, normally `1` for `1 - NSE(Q)` or `9` for `1 - KGE(Q)`.
- Iteration count, at least 6 and realistically hundreds or thousands.
- Optional basin type preset such as `humid_subtropical`.

## Outputs

- Calibration-enabled `mhm.nml`.
- mHM optimizer outputs such as `FinalParam.nml` and DDS/SCE result files when the binary completes.
- Parsed calibrated parameter file or report from `tools/s9_calibration/setup_mhm_calibration.py --parse_results`.

## Procedure

Configure calibration:

```bash
python tools/s9_calibration/setup_mhm_calibration.py \
  --run_dir runs/wangjiaba \
  --opti_method 1 \
  --opti_function 1 \
  --n_iterations 2000 \
  --basin_type humid_subtropical
```

Verify optimizer settings immediately before execution:

```bash
rg -n "opti_function|nIterations|opti_method" runs/wangjiaba/mhm.nml
```

Execute calibration with the real mHM binary:

```bash
python tools/s9_calibration/setup_mhm_calibration.py \
  --run_dir runs/wangjiaba \
  --execute
```

Parse results:

```bash
python tools/s9_calibration/setup_mhm_calibration.py \
  --run_dir runs/wangjiaba \
  --parse_results
```

## Verification

Do not rely on exit code alone:

```bash
test -s runs/wangjiaba/FinalParam.nml
find runs/wangjiaba -maxdepth 2 -type f | rg "FinalParam|dds|sce|Opti|Param"
rg -n "opti_function|nIterations" runs/wangjiaba/mhm.nml
```

Then regenerate s6 forward namelists over the calibration plus validation period with `--param_nml runs/wangjiaba/FinalParam.nml` and score both periods separately in s8.

## Traps

- `dt_r14` in `../diagnostics/triplets.yaml`: DDS with `nIterations < 6` can stop with status 0 and no `FinalParam.nml`.
- `dt_r15`: `opti_function=10` is soil-moisture KGE in mHM v5.13.1, not discharge KGE; use `1` or `9` for discharge.
- `dt_r16`: wrapper invocations must not rewrite `mhm.nml` with default optimizer flags during `--execute` or `--parse_results`.
- `dt_s04`: multi-basin calibration can bias toward the largest basin if the objective is not normalized.

## Example

For Wangjiaba, calibrate on 1981-1985 with 1980 as spin-up using DDS:

```bash
python tools/s9_calibration/setup_mhm_calibration.py \
  --run_dir runs/wangjiaba \
  --opti_method 1 \
  --opti_function 1 \
  --n_iterations 2000 \
  --basin_type humid_subtropical
```

Files in this skill

  • REFERENCES.md1.1 KB
  • format_spec.yaml37.1 KB
  • papers.json5.2 KB
  • s0_config_skill.md2.7 KB
  • s10_regionalize_skill.md2.5 KB
  • s1_domain_skill.md2.6 KB
  • s2_morphology_skill.md3.5 KB
  • s3_mpr_skill.md2.2 KB
  • s4_forcing_skill.md2.2 KB
  • s5_gauge_skill.md1.9 KB
  • s6_namelist_skill.md2.9 KB
  • s7_execute_skill.md2 KB
  • s8_postprocess_skill.md2.4 KB
  • s9_calibration_skill.md2.6 KB
  • validation_convention.yaml12.2 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 testing →

Comments

Loading comments…

Newsletter

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