Skip to content
Back to skills

Docs

ASecurity

Convert gridded meteorological forcing into the NetCDF layout and units mHM reads: `pre`, `tavg`, and, for PET method 0, `pet`.

  • 200 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added September 11, 2026
toolspythonbash

Works with

  • cli

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-695a6176/badge)](https://www.skillsdirectory.com/skills/lzwei196-docs-695a6176)

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
# s4_forcing Skill

## Purpose

Convert gridded meteorological forcing into the NetCDF layout and units mHM reads: `pre`, `tavg`, and, for PET method 0, `pet`.

## Inputs

- `config.json` and `domain_info.json`.
- Forcing root passed as `--forcing_dir`.
- Forcing dataset selection from `config.json`, normally CMFD or MSWX.
- PET method code passed to `tools/s4_forcing/convert_forcing_to_mhm.py`.

## Outputs

- `input/meteo/pre/pre.nc`
- `input/meteo/tavg/tavg.nc`
- `input/meteo/pet/pet.nc` when `--pet_method 0`
- mHM-style `header.txt` files in the meteo variable directories.

## Procedure

Use the KI converter rather than hand-written unit arithmetic:

```bash
python tools/s4_forcing/convert_forcing_to_mhm.py \
  --config runs/wangjiaba/config.json \
  --domain_info runs/wangjiaba/domain_info.json \
  --forcing_dir KISSPATH_DATA/CMFD \
  --pet_method 0
```

The converter is expected to load forcing through HydroCraft's normalized forcing path described in `SKILL.md`: `ki_tools_common.load_forcing.load_daily_forcing`.

## Verification

Check files, variable names, and rough physical ranges:

```bash
test -f runs/wangjiaba/input/meteo/pre/pre.nc
test -f runs/wangjiaba/input/meteo/tavg/tavg.nc
test -f runs/wangjiaba/input/meteo/pet/pet.nc
ncdump -h runs/wangjiaba/input/meteo/pre/pre.nc | rg "pre|time|yc|xc"
ncdump -h runs/wangjiaba/input/meteo/tavg/tavg.nc | rg "tavg|time|yc|xc"
ncdump -h runs/wangjiaba/input/meteo/pet/pet.nc | rg "pet|time|yc|xc"
```

For CMFD daily precipitation, basin-mean annual precipitation should be physically plausible, not about one eighth of climatology.

## Traps

- `dt_r03` in `../diagnostics/triplets.yaml`: wrong meteo paths, variable names, or time range cause missing-forcing crashes.
- `dt_r06`, `dt_s08`, and `dt_s10`: precipitation and temperature units are silent error sources; CMFD daily precipitation needs daily mean-rate handling, not the 3-hour factor.
- `dt_s02` and `dt_s11`: Hargreaves requires real tmin/tmax. With daily mean temperature only, use `--pet_method 0` and Oudin PET.
- `dt_r12`: forcing grid headers must align with the square-L0-derived L1 grid.

## Example

The Wangjiaba reference in `SKILL.md` uses CMFD daily forcing and PET method 0. That writes an Oudin PET file for mHM to read with `processCase(5)=0`.

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.

Comments

Loading comments…