cosipy-ki

Runs COSIPY glacier and snowpack energy-mass balance simulations with validated forcing conversion and diagnostics.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires numpy, pandas, scipy, xarray, dask, distributed, numba, h5netcdf, netCDF4, and includes scripts (resource) and references (resource) components.

What problem does it solve? Running the COSIPY glacier/snowpack energy and mass balance model requires deep operational knowledge: exact input units (Kelvin, hPa, W/m2), netCDF formatting, TOML configuration, and recovery from silent failures like Celsius temperatures forcing all precipitation to rain. This Skill packages that expertise so an AI agent can prepare forcing data, execute the real COSIPY model, and validate results without manual trial and error. ## Core Features & Use Cases - Forcing Conversion: Convert ERA5, AWS, CSV, or NASA POWER meteorological data into COSIPY netCDF input with automatic unit conversions, bounds checking, and unit-trap warnings. - Model Execution with Preflight Checks: Run the actual COSIPY v2.0.2 model via run_cosipy.py, with a preflight_check.py that verifies the Python environment, source tree, and input data before execution. - Output Parsing and Validation: Extract mass balance, snow height, albedo, and energy fluxes from result netCDF files and compare against observations (SNOTEL SWE, snow depth, stake data) with NSE/KGE/r/PBIAS metrics. - Diagnostic Recovery: A triplets.yaml database maps 23 known failure symptoms (e.g., broken netCDF4 backend, thin-column IndexError) to validated remedies. - Use Case: Simulate seasonal snow depth at a point station using NASA POWER forcing, then validate the modeled SNOWHEIGHT against the Canadian Historical Daily Snow Depth Database. ## Quick Start Run preflight_check.py in this directory, then ask the agent to simulate glacier mass balance for Zhadang Glacier using the bundled ERA5 2009 test data and report the MB output.

Frequently Asked Questions about cosipy-ki

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

FAQPage Schema
How do I run the COSIPY glacier mass balance model?

Run preflight_check.py first to verify the environment, then use tools/run_cosipy.py with a config.toml and constants.toml. The tool injects an h5netcdf shim automatically because the netCDF4 backend is broken on this host.

How to convert ERA5 data to COSIPY forcing format?

Use tools/convert_forcing.py with --source era5. It handles unit conversions: pressure Pa to hPa, accumulated radiation J/m2 to W/m2, 10-m wind to 2-m via log profile, and precipitation m to mm per timestep.

Why does COSIPY produce zero snowfall or all-rain precipitation?

The temperature input is almost certainly in Celsius instead of Kelvin. The tanh snow/rain partition sees T2 minus 273.16 as very negative and classifies all precipitation as rain with no error message.

Can COSIPY simulate seasonal snow at a point station without a glacier?

Yes, build a 1x1 MASK=1 static column and pass site elevation via convert_forcing.py --hgt, since the default 5000 m is wrong for most sites. Set a thick initial_glacier_height around 70 m to avoid the thin-column IndexError.

What units does COSIPY expect for input forcing variables?

T2 in Kelvin, RH2 in percent 0-100, PRES in hPa, G and LWin in instantaneous W/m2, RRR in mm per timestep, N as a 0-1 fraction, and SNOWFALL in meters of snow height. The dt constant must match the forcing temporal resolution.

How is COSIPY model output validated against observations?

Use parse_output.py --mode compare against stake mass balance, SNOTEL SWE (convert inches to mm), or snow depth series. Validation follows cited bands, e.g., MB RMSE <= 0.17 m w.e. rated very good per arndt2024 and huintjes2015.