hydrocraft-parflow

Configure, run, and diagnose ParFlow integrated surface-subsurface hydrology 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-parflow-lzwei196
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: hydrocraft-parflow
Source: https://github.com/lzwei196/KISS-Knowledge-Infrastructure-for-Scientific-Simulation/tree/main/models/ParFlow
Command: npx skills add https://github.com/lzwei196/KISS-Knowledge-Infrastructure-for-Scientific-Simulation --skill hydrocraft-parflow-lzwei196

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires pftools, and includes scripts (resource) and references (resource) components.

What problem does it solve? Running ParFlow (3D Richards equation + overland flow + CLM land surface) requires deep operational knowledge scattered across source code and documentation: unit traps (K in m/hr, alpha in 1/m, precipitation in mm/s), pftools key-ordering rules, MPI topology constraints, and silent failure modes. This Skill packages that expertise into 12 validated pipeline tools, 9 stage documents, and 36 diagnostic triplets so an agent can set up, execute, and validate basin-scale ParFlow simulations without silent scientific errors. ## Core Features & Use Cases - 10-stage simulation pipeline: Tools for domain/grid definition, subsurface properties (HWSD + Rosetta pedotransfer), DEM slope processing, CLM driver setup, CMFD/MSWX forcing conversion to PFB, initial conditions, run-script generation, MPI execution, and output parsing (water table depth, discharge, soil moisture). - Diagnostic recovery: 36 symptom-to-remedy triplets covering unit conversion traps, solver convergence failures, CLM coupling errors, and distributed PFB output issues, with 15 documented silent-error modes. - Downstream coupling: Export ParFlow surface runoff to CaMa-Flood NetCDF input for large-scale river routing. - Use Case: A hydrologist needs a July 2003 flood simulation for the Bengbu basin. The Skill generates the UTM grid, builds clay soil properties with correct m/hr conductivity, converts CMFD forcing, generates the pftools run script, executes via MPI, and extracts a discharge hydrograph validated against expected runoff ratios. ## Quick Start Run python preflight_check.py in this KI directory, then ask the agent to set up and run a ParFlow simulation for your basin shapefile and simulation period following the 10-stage pipeline.

Frequently Asked Questions about hydrocraft-parflow

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

FAQPage Schema
How do I run a ParFlow simulation for a river basin?

Follow the 10-stage pipeline: define the UTM grid and mask from your basin shapefile, build subsurface properties and slopes, set up CLM and forcing, generate initial conditions and the run script, then execute via MPI and parse outputs. Each stage has a dedicated Python tool with argparse CLI.

What units does ParFlow use for hydraulic conductivity and precipitation?

ParFlow expects hydraulic conductivity in m/hr (not m/day like MODFLOW or m/s like SI) and CLM precipitation in mm/s. Van Genuchten alpha must be in 1/m, not 1/cm. These unit mismatches cause silent errors covered by diagnostic triplets dt_pf_001, dt_pf_002, and dt_pf_005.

When should I use ParFlow instead of VIC plus MODFLOW?

Use ParFlow when groundwater-surface water interaction, lateral subsurface flow, or water table dynamics drive your research question, typically for basins under 50,000 km2. It solves surface, soil, and groundwater as one coupled system, replacing the VIC + MODFLOW + routing chain.

Why does the ParFlow PFMG preconditioner fail to converge?

PFMG fails when hydraulic conductivity contrasts exceed about 6 orders of magnitude between adjacent cells, per triplet dt_pf_022. Cap minimum K at 1e-5 m/hr or switch to the MGSemi preconditioner. Also verify MPI P*Q*R exactly matches the -np process count.

How do I compute water table depth from ParFlow output?

Derive water table depth from cells where saturation is at least 0.99, not from the zero-pressure contour. On coarse grids the pressure-equals-zero interpolation gives spurious positions, a silent error documented in triplet dt_pf_041.

Can ParFlow output feed into CaMa-Flood river routing?

Yes, the parflow_to_cama tool converts ParFlow surface runoff to CaMa-Flood NetCDF input. Ensure VIC runoff is not also supplied for the same basin, since double-counting surface water produces roughly 2x discharge (triplet dt_pf_050).