MODFLOW (Beware)
The purpose of this blog page is to help myself and others, by summarizing 1+ USGS reports on MODFLOW inner-workings. Normal Human Beings should perhaps not attempt to read.
SOURCES
A few of the best resources on the web for MF2005, thanks to Uncle Sam!
- Outline and bulleted list content (below) is mostly copied text from Harbaugh 2005 (starting 4-1) and with commentary from other sources.
- However, the best near-current information about MODFLOW input files I find is the 00-92 from 2000.
- Finally, new or confused users should begin with the pre-Web era McDonald and Harbaugh 1988 for its clarity, plus the fact it only runs the Basic Package, which simplifies the documentation and hence explication considerably.
GUIs
I have had some success with ModelMuse as a learning platform for understanding the input file structure. Plus, it’s also got a cool interface. However, the ideal end-user has different needs than I.
Recently, a new GUI for creating input files, MFI2005, became available. As this tool promises to build clean, effective input files for my purposes, I’m juiced by it and its excellent documentation.
PYTHONISTAS
Bakker-involved project puts out a Py library to run MODFLOW, SEWAT & SWI:
http://code.google.com/p/flopy/
***Symbols — Notes to Self***
* = Use ModelMuse GUI to generate
& = Write/adapt/use python wrapper
? = Undecided
[ … ] = Usual file extension
Name File — &
Name File [nam] is the file specified through a command line argument or an interactive prompt to run MODFLOW.
- text specifies a type, unit number, and file name (in that order)
- must include two files required by the Basic Package, the BAS Package file [bas] and the Discretization File
DATA Files — & + Autogenerated
DATA and DATA(BINARY) (in Name File) define input or output files whose file unit numbers are referenced by other files.
- DATA includes head output [fhd] and [fdn]
- DATA(BINARY) includes binary budget files [bud] and interface elevation levels when using SWI [zta]
- see http://tech.dir.groups.yahoo.com/group/gwmodel/message/3080 for info on how to read [zta] output with Modelmuse
- surely, MF2005 must contain a means to unpack binary > ASCII
BAS File — *
BAS Package File [bas] declares variables and allocates the memory required for the data.
- IBOUND variable contains a code for each cell indicating whether it’s a (-1) variable-head cell (1) constant-head cell or (0) no-flow or inactive cell
- don’t expect to see any of (1) in a ModelMuse-generated [bas]
- SWI turns off cells with head creep (?) in [bas]
- CHD Package [chd] uses cells with (-1) associated with collocated cells marked in [chd]
- IBOUND variable stored in ASCII blocks, layer by layer
- the initial heads must be specified in the BAS Package input file
Discretization File — &
(Like [bas] needs to be checked, especially to make sure no funny business with SS.)
The Basic Package reads spatial discretization information from a file called the Discretization File [dis]. For in-depth information on [disc] structure see 00-92, p. 45.
- begins with NLAY NROW NCOL NPER ITMUNI LENUNI number string
- LAYCBD (should be zeros)
- specify row/column widths DELR and DELC (100s)
- Funny business starts at Top (1) elevation and BOTM (1 per layer)
- Top:0.00000000000000E+0000
- BOTM: negative linearly decreasing increments
- Ends ERLEN NSTP TSMULT Ss/tr
- be very careful viz. ModelMuse
Other
RCH Package [rch] reads the recharge rate for every cell in a model layer when recharge is being simulated.
Well Package [wel] can define pumping rates. Documentation can get complicated; see existing example(s) for clarity on writing to this file.
SOFTWARE
Python Notes:
- open and close file objects as ASCII objects
- vim: remember not to save as utf-8
- use lists, or maybe numpy arrays / matrix objects for Well File [well] pumping values
- see matplotlib for documentation
Vim Notes:
- The command “5.” in normal mode repeats last “<Esc> input text <Esc>” five times, but remember to move cursor 1 right