hydrocraft-cequalw2-reservoir

Configures, runs, and analyzes CE-QUAL-W2 2D reservoir hydrodynamic and water quality simulations.

155|6|Updated Mar 31, 2026
One-click install
npx skills add https://github.com/lzwei196/KISS-Knowledge-Infrastructure-for-Scientific-Simulation --skill hydrocraft-cequalw2-reservoir-lzwei196
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: hydrocraft-cequalw2-reservoir
Source: https://github.com/lzwei196/KISS-Knowledge-Infrastructure-for-Scientific-Simulation/tree/main/models/CE_QUAL_W2
Command: npx skills add https://github.com/lzwei196/KISS-Knowledge-Infrastructure-for-Scientific-Simulation --skill hydrocraft-cequalw2-reservoir-lzwei196

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires numpy, pandas, xarray, netCDF4, geopandas, shapely, rasterio, matplotlib, scipy, and includes scripts (resource) and references (resource) components.

What problem does it solve? Setting up and running CE-QUAL-W2, the USACE 2D laterally-averaged reservoir model, requires labor-intensive bathymetry digitization, fixed-width Fortran input files, and unit conversions where silent errors (like cloud cover in the wrong scale) corrupt results without any warning. This Skill encodes that operational expertise into validated tools and diagnostic triplets so an agent can run real simulations reliably. ## Core Features & Use Cases - 14-stage pipeline: 16 Python tools covering bathymetry grid generation, branch topology, meteorological and inflow forcing conversion, outflow configuration, control file assembly, execution, output parsing, calibration, and CaMa-Flood coupling. - 25 diagnostic triplets: Symptom-to-remedy mappings for known failure modes, including 14 silent errors such as cloud cover in tenths (0-10), dewpoint conversion from vapor pressure, and 8-character fixed-width control file fields. - Use Case: Model thermal stratification and selective withdrawal in an elongated reservoir like Danjiangkou (80 km long, two branches) where a 1D lake model cannot resolve longitudinal gradients, then route dam releases downstream into CaMa-Flood. ## Quick Start Ask the agent to run the preflight check and then build an idealized CE-QUAL-W2 reservoir grid, convert forcing data, generate the control file, and execute the w2 binary for your chosen reservoir and period.

Frequently Asked Questions about hydrocraft-cequalw2-reservoir

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run a CE-QUAL-W2 reservoir simulation?

Build the segment-layer grid with build_reservoir_grid.py, convert meteorological and inflow forcing to W2 fixed-width formats, generate w2_con.npt with generate_w2_control.py, then execute the model via run_w2.py. Run preflight_check.py first to verify the binary and data are available.

When should I use CE-QUAL-W2 instead of GLM?

Use CE-QUAL-W2 when the reservoir length-to-width ratio exceeds 5:1, when multiple tributaries enter at different locations, or when multi-level selective withdrawal matters. GLM is sufficient for compact round lakes and quick screening studies.

Why is my CE-QUAL-W2 water temperature several degrees too warm?

The most common cause is cloud cover passed as a 0-1 fraction instead of the required 0-10 tenths scale, which makes the model see near-clear sky and excess shortwave radiation. This silent error is documented as diagnostic triplet dt_001.

What input file format does CE-QUAL-W2 use?

CE-QUAL-W2 uses fixed-width Fortran text files: the w2_con.npt control file with 8-character right-justified fields, plus bathymetry, meteorological, inflow, and outflow files per water body or branch. Column misalignment silently corrupts all subsequent values.

Can CE-QUAL-W2 couple with CaMa-Flood and VIC?

Yes. CaMa-Flood discharge and VIC distributed runoff feed the reservoir as inflows via convert_inflow_to_w2 and generate_distributed_inflow, and dam release discharge and temperature route back to CaMa-Flood through w2_to_cama_coupling. Avoid double-counting overlapping runoff areas.

What are the limitations of the current CE-QUAL-W2 toolset?

Hydraulic structures (gates, spillways, pumps), sediment diagenesis, pH/carbonate chemistry, restart files, and specialized modules like mercury and particle tracking lack dedicated tools. Calibration is currently a placeholder not yet wired to actual model execution.