Skip to content
Back to skills

Docs

ASecurity

Thin wrapper for the preserved detailed note: [s3_execute_cama.md](s3_execute_cama.md).

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

Security analysis

A100/100

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

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
# Stage 3: Execute CaMa-Flood Skill

Thin wrapper for the preserved detailed note: [s3_execute_cama.md](s3_execute_cama.md).

## Purpose

Run the actual CaMa-Flood Fortran executable through the generated shell script and produce yearly routing outputs. This stage enforces the KI guardrail in `SKILL.md`: no simplified Python routing substitute is scientifically valid.

## Inputs

- `tools/run_cama.py`
- Run script: `KISSPATH_BINARIES/cmf_v420_pkg/gosh/run_bengbu_1d_nc.sh`
- Binary: `KISSPATH_BINARIES/cmf_v420_pkg/src/MAIN_cmf`
- Stage 2 map directory: `KISSPATH_BINARIES/cmf_v420_pkg/map/bengbu_15min/`
- Stage 1 forcing directory: `KISSPATH_ROOT/ata-kdt/bengbu_ki_driven/outputs/cama_input`
- `diagnostics/triplets.yaml`

## Outputs

- Output NetCDFs in `KISSPATH_BINARIES/cmf_v420_pkg/out/bengbu_2000_2005_cama/`
- Files such as `o_outflw2003.nc`, `o_rivdph2003.nc`, `o_sfcelv2003.nc`, `o_flddph2003.nc`, and `o_fldfrc2003.nc`
- Restart files such as `restartYYYY010100.nc`
- Execution diagnostics from `tools/run_cama.py`

## Procedure

Run a dry preflight against the generated script:

```bash
cd KISSPATH_KI_ROOT/CaMa_Flood/knowledge_infrastructure
python tools/run_cama.py \
  --script KISSPATH_BINARIES/cmf_v420_pkg/gosh/run_bengbu_1d_nc.sh \
  --dry_run
```

Then execute the model with an explicit timeout:

```bash
cd KISSPATH_KI_ROOT/CaMa_Flood/knowledge_infrastructure
python tools/run_cama.py \
  --script KISSPATH_BINARIES/cmf_v420_pkg/gosh/run_bengbu_1d_nc.sh \
  --timeout 7200
```

The wrapper runs `bash <script>` from the script directory, checks known error patterns, and verifies output files after a successful exit.

## Verification

Check the existing Bengbu validation products and inspect the namelist paths:

```bash
test -s KISSPATH_BINARIES/cmf_v420_pkg/out/bengbu_2000_2005_cama/o_outflw2003.nc
test -s KISSPATH_BINARIES/cmf_v420_pkg/out/bengbu_2000_2005_cama/o_flddph2003.nc
grep -n "CDIMINFO\|CNEXTXY\|CINPMAT\|CROFCDF" KISSPATH_BINARIES/cmf_v420_pkg/out/bengbu_2000_2005_cama/input_cmf.nam
```

All `CDIMINFO`, `CNEXTXY`, `CINPMAT`, and `CROFCDF` paths should be absolute paths under the bound CaMa-Flood tree or the selected forcing directory.

## Traps

- `dt_001`: relative namelist paths trigger `STOP 10` or file-open failures because the generated script changes into `RDIR` before `MAIN_cmf` opens files.
- `dt_002`: `MAIN_cmf` is missing, not executable, or fails startup; repair the Fortran binary before running.
- `dt_004`: discharge above plausible basin scale can come from feeding `m3/s` values as `Runoff`.
- `dt_016`: cold-start storage contaminates the first simulated year; use spin-up restarts or exclude the cold-start year from scoring.

## Example

```bash
cd KISSPATH_KI_ROOT/CaMa_Flood/knowledge_infrastructure
python tools/run_cama.py \
  --script KISSPATH_BINARIES/cmf_v420_pkg/gosh/run_bengbu_1d_nc.sh \
  --dry_run
```

Files in this skill

  • REFERENCES.md1.4 KB
  • format_spec.yaml39.5 KB
  • papers.json5.9 KB
  • s0_preflight.md2.2 KB
  • s0_preflight_skill.md2.2 KB
  • s1_prepare_runoff.md2.9 KB
  • s1_prepare_runoff_skill.md3.2 KB
  • s2_configure_basin.md3.6 KB
  • s2_configure_basin_skill.md3.8 KB
  • s3_execute_cama.md2.6 KB
  • s3_execute_cama_skill.md2.8 KB
  • s4_postprocess.md2.8 KB
  • s4_postprocess_skill.md2.9 KB
  • validation_convention.yaml18.4 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…