Hydrology, applied
Rivers, aquifers and other wet things that can flood your house
September 7, 2020 — June 30, 2022
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 NWT
, 2005
and 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 has 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:
Then
This gets you a version that runs on Linux or macOS.
Alternatively, one can use docker files. Here are some miscellaneous docker files I am auditioning: lucasaugustomcc/modflow-nwt, flopymetascript, mintproject/modflow-2005 (the most popular one).
In the case of the more recent MODFLOW 6 it can be installed via conda:
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.