FloPy

Build, run, and post-process MODFLOW groundwater models through FloPy Python scripting.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires flopy, numpy, pandas, matplotlib, scipy, rasterio, and includes scripts (resource) and references (resource) components.

What problem does it solve? Running MODFLOW groundwater simulations requires operational expertise scattered across documentation and practice: consistent unit handling, correct package assembly, convergence troubleshooting, and binary output parsing. This Skill packages that expertise so an agent can construct, execute, validate, and debug FloPy/MODFLOW groundwater models without silent unit or indexing errors. ## Core Features & Use Cases - End-to-end modeling pipeline: Seven staged procedures covering DEM-to-grid construction, soil-to-aquifer property conversion, forcing/boundary preparation, model assembly, execution, output analysis, and calibration, backed by 5 validated command-line tools. - Diagnostic recovery system: 21 symptom-diagnosis-remedy triplets covering known failure modes such as unit mismatches (mm/day vs m/day recharge), zero-based indexing errors, binary precision mismatches, and convergence failures. - Validation against published standards: Hydraulic head output is judged against cited RMSE bands (marker2015), with a machine-readable dag.yaml defining every output's units, rank, and observability. - Use Case: Ask the agent to build a steady-state MODFLOW 6 model from a DEM and recharge data; it runs preflight checks, converts inputs to consistent units, executes the real mf6 binary, and parses heads and water budgets into CSV and plots. ## Quick Start Run python preflight_check.py in this directory, then ask the agent to build and run a MODFLOW 6 groundwater model from your DEM and forcing data.

Frequently Asked Questions about FloPy

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

FAQPage Schema
How do I run a MODFLOW 6 model with FloPy in Python?

Create an MFSimulation with TDIS, IMS, and a ModflowGwf model, add DIS, IC, NPF, boundary packages, and output control, then call sim.write_simulation() and sim.run_simulation(). The mf6 binary must be installed separately via get-modflow.

How do I convert recharge and pumping units for MODFLOW?

MODFLOW is unit-agnostic, so all inputs must match your chosen length/time system. Divide recharge in mm/day by 1000 to get m/day, and multiply well rates in L/s by 86.4 to get m3/day; FloPy does not warn about mismatches.

Does FloPy include the MODFLOW solver?

No. FloPy is a pre/post-processor that writes input files and reads outputs; the compiled MODFLOW executable performs the numerical solution. Install binaries with the get-modflow utility and verify with mf6 --version.

Why does my MODFLOW model converge but give wrong heads?

Silent unit inconsistencies are the most common cause, such as recharge entered as mm/day instead of m/day or K in cm/s instead of m/day. Also check one-based versus zero-based cell indexing and steady-state flags on transient stress periods.

Why do I get garbage values when reading MODFLOW binary output?

The .hds or .bud file was likely written in a different precision than the reader expects. Specify precision='single' or precision='double' in flopy.utils.HeadFile or CellBudgetFile, and mask HDRY (-1e30) dry-cell sentinels before analysis.