Skip to content
Back to skills

Docs

ASecurity

Generate the main SFINCS configuration file (sfincs.inp) with all simulation parameters. The most critical parameter is the computational timestep `dt`, which must satisfy the CFL stability condition.

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

Security analysis

A100/100

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

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
# S6: Configuration — Skill Document

## Purpose

Generate the main SFINCS configuration file (sfincs.inp) with all simulation parameters. The most critical parameter is the computational timestep `dt`, which must satisfy the CFL stability condition.

## Prerequisites

- grid_info.json from s1_domain
- sfincs.dep, sfincs.msk, sfincs.ind from s2_topobathy
- sfincs.man from s3_roughness (or uniform manning value)
- Forcing files from s4_forcing
- Optional structure files from s5_structures

## Inputs

| Input | Type | Required |
|-------|------|----------|
| grid_info.json | JSON | Yes |
| Start/end dates | string | Yes |
| Manning's n or man file | number/file | Yes (default: 0.04) |
| Precipitation file | NetCDF | Optional |
| Boundary condition files | text | Optional |
| Output interval | number | Optional (default: 3600s) |

## Procedure

1. **Run tool**: `generate_sfincs_inp.py --grid_info <json> --start_date <date> --end_date <date> --output_dir <dir>`
   - Add `--precip_file`, `--src_file`, `--dis_file` etc. as needed

2. **CFL timestep calculation**:
   ```
   dt_max = dx / sqrt(g * h_max)
   ```
   Where g=9.81 m/s2, h_max is assumed max flood depth (10m default).
   Use dt = 0.75 * dt_max for safety.

   | dx (m) | h_max=5m | h_max=10m | h_max=20m |
   |--------|---------|----------|----------|
   | 10 | 1.4s | 1.0s | 0.7s |
   | 25 | 3.6s | 2.5s | 1.8s |
   | 50 | 7.1s | 5.1s | 3.6s |
   | 100 | 14.3s | 10.1s | 7.1s |
   | 200 | 28.5s | 20.2s | 14.3s |

3. **Key parameters in sfincs.inp**:
   - `outputformat = net` — ALWAYS include this (dt_018)
   - `advection = 0` — disable unless needed (dt_010)
   - `alpha = 0.75` — momentum damping (increase to 0.9 if oscillating)
   - `qinf = 0.0` — infiltration in mm/hr (increase for permeable soils)

4. **Copy all input files to run directory**: sfincs.inp references files by name (relative to CWD). All files must be in the same directory.

## Expected Outputs

| Output | Path | Verification |
|--------|------|-------------|
| sfincs.inp | `{output_dir}/sfincs.inp` | Contains all required parameters |

## Validation Checks

1. `dt` satisfies CFL: dt < dx / sqrt(9.81 * 10) (dt_009)
2. `outputformat = net` is present (dt_018)
3. `tstart < tstop` (time range makes sense)
4. All referenced files (depfile, mskfile, etc.) exist in the output directory
5. Either precipitation or boundary conditions are specified (otherwise no water input)

## Common Pitfalls

- **dt_009**: dt too large -> NaN crash. Tool auto-computes CFL-safe value.
- **dt_017**: Running from wrong directory. SFINCS reads from CWD.
- **dt_018**: Missing outputformat -> binary output instead of NetCDF.
- **dt_010**: advection=1 with low alpha -> oscillations. Use advection=0 by default.

Files in this skill

  • REFERENCES.md1.5 KB
  • format_spec.yaml44.1 KB
  • papers.json5.8 KB
  • s1_domain_skill.md2.5 KB
  • s2_topobathy_skill.md3.4 KB
  • s3_roughness_skill.md2.1 KB
  • s4_forcing_skill.md4.2 KB
  • s5_structures_skill.md2.1 KB
  • s6_config_skill.md2.7 KB
  • s7_execution_skill.md2.6 KB
  • s8_postprocess_skill.md3.1 KB
  • validation_convention.yaml8.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…