Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
This branch is 4 commits ahead, 4 commits behind DOI-USGS:develop.

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time


Modflow-setup is a Python package for automating the setup of MODFLOW groundwater models from grid-independent source data including shapefiles, rasters, and other MODFLOW models that are geo-located. Input data and model construction options are summarized in a single configuration file. Source data are read from their native formats and mapped to a regular finite difference grid specified in the configuration file. An external array-based Flopy model instance with the desired packages is created from the sampled source data and configuration settings. MODFLOW input can then be written from the flopy model instance.

Version 0.3

Tests codecov PyPI version Binder Project Status: Active – The project has reached a stable, usable state and is being actively developed.

Getting Started

For more details, see the modflow-setup documentation

Using a yaml-aware text editor, create a configuration file similar to one of the examples in the Configuration File Gallery.

The yaml file summarizes source data and parameter settings for setting up the various MODFLOW packages. To set up the model:

from mfsetup import MFnwtModel, MF6model

m = MF6model.setup_from_yaml(<path to configuration file>)

where m is a flopy MODFLOW-6 model instance that is returned. The MODFLOW input files can be written from the model instance:


MODFLOW-NWT version:

m = MFnwtModel.setup_from_yaml(<path to configuration file>)


See the Installation Instructions

How to cite

Citation for Modflow-setup

Leaf AT and Fienen MN (2022) Modflow-setup: Robust automation of groundwater model construction. Front. Earth Sci. 10:903965.

Software/Code Citation for Modflow-setup

Leaf, A.T. and Fienen, M.N. (2022). Modflow-setup version 0.1, U.S. Geological Survey Software Release, 30 Sep. 2022.

Applications of Modflow-setup

Fienen, M.N, and Corson-Dosch, N.T., 2021, Groundwater Model Archive and Workflow for Neversink/Rondout Basin, New York, Source Water Delineation: U.S. Geological Survey data release,

Fienen, M.N., Corson-Dosch, N.T., White, J.T., Leaf, A.T. and Hunt, R.J. (2022), Risk-Based Wellhead Protection Decision Support: A Repeatable Workflow Approach. Groundwater, 60: 71-86.

MODFLOW Resources


This software is preliminary or provisional and is subject to revision. It is being provided to meet the need for timely best science. The software has not received final approval by the U.S. Geological Survey (USGS). No warranty, expressed or implied, is made by the USGS or the U.S. Government as to the functionality of the software and related material nor shall the fact of release constitute any such warranty. The software is provided on the condition that neither the USGS nor the U.S. Government shall be held liable for any damages resulting from the authorized or unauthorized use of the software. It is the responsibility of the user to check the accuracy of the results.

Any use of trade, firm, or product names is for descriptive purposes only and does not imply endorsement by the U.S. Government.


Python package for robust automation of MODFLOW groundwater flow model construction.







No packages published


  • Python 99.3%
  • Other 0.7%