MODFLOW is the USGS’s modular hydrologic model. MODFLOW is considered an international standard for simulating and predicting groundwater conditions and groundwater/surface-water interactions. MODFLOW 6 is presently the core MODFLOW version distributed by the USGS. The previous core version, MODFLOW-2005, is actively maintained and supported as well.
The FloPy package consists of a set of Python scripts to run MODFLOW, MT3D, SEAWAT and other MODFLOW-related groundwater programs. FloPy enables you to run all these programs with Python scripts.
But how do you install MODFLOW?
It’s one of those US government software packages which is perfectly respectable and functional but some versions use a “classic”, which is to say, antiquated, mode of development. (I mean, it does date to 1988.)
There are various versions which are incompatible with each other to some unexplained extent.
These have version numbers like
6, and varying degrees of modern convenience.
For example, MODFLOW-2005, a version of a… distinguished vintage, has no source code repository (not for us punters anyway), just giant (like, 400MB) zip files full of compiled Windows binaries with big chunks of fortran code embedded in there like chunky choco for compilation by the adventurous.
Thankfully, the community have made modflow pymake. The documentation was a little confusing (it seems to suggest I should use certain scripts that are not installed per default), but they all turn out to be one-liners. Here is how to install MODFLOW-NWT:
pip install git+https://github.com/modflowpy/pymake.git python
import pymake pymake.build_apps("mfnwt")
This gets you a version that runs on linux or macos.
conda install -c conda-forge modflow6
MODFLOW 6 has a source code repository and other trappings of modernity. It compiles and runs everywhere etc, but it does not implement all the features of historical MODFLOW versions, or so I am told.