Chapter 15: Modmain



Modmain is a graphical user interface for MODFLOW, the MODular three-
dimensional, finite difference FLOW model developed by the United States Geological
Survey (McDonald and Harbaugh, 1984). MODFLOW is a program designed to model
ground water flow and heads (pressure and elevation) in confined and unconfined
aquifer systems. In its basic form, MODFLOW can be difficult, or awkward to use. The
modmain program module is designed to simplify data entry, model editing, and
analysis of results.
This chapter goes into the details of using modmain as an interface for
MODFLOW. It however does not explain the theory or use of MODFLOW, that is better
left to the MODFLOW user's manual (McDonald and Harbaugh, 1984).
- WARNING: To use modmain and MODFLOW effectively, you must have the
MODFLOW user's manual, and it should be readily available whenever you are
building data sets with modmain. In the current release, modmain does not
error check data file formats; this can lead to incorrect numbers for any
variable, and it can cause "segmentation faults" which will terminate modmain.
To find the problem, the data files may have to be examined line by line to
determine where the problem is. This can only be done if the MODFLOW user's
manual is available!
The modmain application is composed of two sections; the main menu-bar, and
the status and log text area. The menu-bar is used to select all modmain commands,
and the log/status area is used by the program to report important messages or results.
In addition to the main window and supporting pop-up dialog windows, a graphical
editor is available for creating and modifying two-dimensional arrays. Modmain also
use's other UNCERT (grid, contour, surface, and block) modules for visualizing model
output.
Menu Items
Examples
Command Line Arguments
File Formats
Bibliography
The Main Menu:
The main menu controls nearly all the program operations; files can be opened
and saved, data files can be created and modified, MODFLOW can be executed,
graphics can be plotted, and help can be requested. For modmain there are eight items
on the main menu:
Project,
Packages.
Run,
View,
Simulator,
Network,
Log, and
Help
(Figure 15.1). Project controls project file handling (opening, saving, naming project
files), and allows the user to quit the application. Project is not a feature of MODFLOW,
but it allows a complete set of MODFLOW data files to be handled as a set; this option
controls the loading, and saving of these "project" files. This menu-bar option also
allows the user to quit the application. Packages allows the user to individually load,
modify, or save each MODFLOW package data file. Run executes MODFLOW using the
currently defined data files. View allows the user to view the standard text output file
or view the model results using grid (Chapter 10) and contour (Chapter 11), surface
(Chapter 12), or block (Chapter 13). Simulator and Network currently are not installed,
but will allow MODFLOW to be run using different data files describing material
distributions simultaneously on different computers over the network. Log allows the
user to save to a file all information printed to the log-status window. Help gives the user a selection of pop-up help topics. Each menu item is fully described below with all
the available options.
Figure 15.1
[TOP] [SYNTAX]
Project:
The Project sub-menu options control project file handling, and exiting the
application. The options include Open Project, View Project, Save Project, Save
Preferences, Quit, and Quit Without Saving.
Open Project:
Selecting Project:Open Project generates a pop-up dialog which allows the user to
select an existing data file. This dialog functions as the File:Open dialog in Figure 5.2
(Plotgraph - Chapter 5) and allows the user to select an existing project file. The default
project file name extension, though is "*.prj".
View Project:
Project:View Project pops up a simple screen editor with the last opened or saved
version of the project file.
Save Project:
Project:Save saves the name of the MODFLOW files currently being used. If a
save file has already been opened, the data are simply saved. If a save file has not been
selected yet, a pop-up dialog similar to that used in File:Open (Figure 5.2) is created.
The main difference between the Open and the Save dialog is that to save a file, the file
does not have to pre-exist. For a description of how the dialog works, see the File:Save
section in Chapter 5.
Save Preferences:
When using programs with many user options, it is not possible for the program
to always pick reasonable default values for each parameter or input variable. For this
reason preference files were created (See Appendix C). These allow the user to define a
unique set of "defaults" applicable to the particular project. When File:Save Preferences
is selected, modmain determines how all the input variables are currently defined and
writes them to the file "modmain.prf."
- WARNING: if modmain.prf" already exists, you will be warned that it is about to be
over-written. If you do not want the old version destroyed you must move it to a
new file (e.g. the UNIX command mv modmain.prf modmain.old.prf would be
sufficient). When you press OK the old version will be over-written! This cannot
be done currently from within the application. To rename the file, you will have to
execute the UNIX mv command from a UNIX prompt in another window.
If "modmain.prf" does not exist in the current directory, it is created. This is an ASCII
file and can be edited by the user. See Appendix C for details.
Quit:
Project:Quit terminates the program, but if changes have been made to any
MODFLOW package, the user will first be queried to supply appropriate filenames for
the modified files. Also, if packages have been added, deleted, or substituted with a
new file, the project file will also have to be saved.
Quit Without Saving:
Project:Quit Without Saving terminates the program regardless of any additions
to any MODFLOW data package. Once pressed there is no option to change your mind.
[TOP] [SYNTAX]
Packages:
To use MODFLOW, there are a number of different packages that can be used:
Basic,
Block Centered Flow,
Drain,
Evapotranspiation,
General Head,
MT3D,
Output Control,
PCG,
Recharge,
River,
SIP,
SSOR,
Well,
and Utility.
The only ones required are the Basic and Block Centered Flow packages, with either the
PCG2, SIP, or SSOR solver. MODFLOW will run, however with only the Basic module
without error, but no meaningful information will be calculated. When using the
Packages pull-down menu, all of the available MODFLOW packages are displayed. The
titles are also color coded; RED indicates that with the current settings, this package is
required, but has not been defined. GREEN also means it is required, but it is defined
sufficiently for MODFLOW to run (This does not mean all data entries are correct for the
particular model). BLACK means that the package is not currently needed, and it may
be ignored.
- NOTE: When first starting modmain, a project must be loaded, a Basic package file
must be loaded, or a Basic package must be created (Packages:Basic:Modify
menu option) before any package besides the Basic package can be read or
created. This is because the Basic package contains the grid row, column, layer
dimension information that all of the other packages require.
Each package has a pull-down sub-menu with five menu options: Open Package,
View Package:Save, Save as, and Modify. The Open option generates a dialog similar to
that shown in Figure 5.2. The dialogs works the same as that dialog too, except that
the default file name extensions are different. For each package the default file name
extensions are:
- BASIC: *.bas
BLOCK CENTERED FLOW: *.bcf
DRAIN: *.drn
EVAPOTRANSPIRATION: *.evt
GENERAL HEAD: *.ghb
OUTPUT CONTROL: *.oc
PCG2: *.pcg
RECHARGE: *.rch
RIVER: *.riv
SIP: *.sip
SSOR: *.ssor
WELL: *.well
These file extensions are strictly conventions, and do not have to be followed. It,
however, is recommended that you follow some consistent naming convention. The
View menu option will display the last saved or loaded version of the data file.
- NOTE: Changes made to a package within the modmain application (using Modify
below) will not be reflected in the data file until the changes have been saved
(see Save below).
The Save menu option will save any modifications, overwriting the last opened or saved
package file. If no package file has been loaded or saved previously, a pop-up dialog will
appear similar to Figure 5.2's, but showing the appropriate default file extension. To
save the package file, select an existing file, or enter a new file name, then press the
"Save" button on the dialog. Save as is similar to Save, except that you are queried for
a file name. Modify will generate a new pop-up dialog which will allow the user to enter
all the appropriate data for that particular package. These package dialogs are
discussed below.
- NOTE: The packages and dialogs discussed below explain how and where to enter
data and package parameter values. The meaning of different variables is not
discussed, and is left to the MODFLOW user's manual (McDonald and
Harbaugh, 1984).
WARNING: As dialogs are generated, default values will be assumed. These values
though may have no meaning with regard to a particular model, and it is the
modeler's responsibility to insure all entries are correct.
Basic:
Selecting Packages:Basic:Modify will generate the pop-up dialog shown in Figure
15.2. This dialog allows all the parameters needed for the Basic package to be defined.
Listed below are the MODFLOW variable names with a description of the equivalent
dialog entry.
Figure 15.2
- NOTE and WARNING: Before any grid/array can be defined, the number of rows
columns and layers must be defined. Also, once these values are defined, they
cannot be changed without restarting modmain. If the values are not define, the
error message in Figure 15.3 will be displayed.
Figure 15.3
- 1).
- HEADNG(32)
- Heading (#1)
2). - HEADNG(continued)
- Heading (#2)
3). - NLAY
- Layers
NROW - Rows
NCOL - Columns
NPER - Stress Periods
ITMUNI - Time Units: Pressing the appropriate menu toggle (Undefined, Seconds, Minutes, Hours, Days, Years) will
set the value appropriately.
4).- IUNIT
- Packages Used and Solver Used:
By pressing the toggle
button for each package, it may be selected and a unit number will by assigned that package. For the solver,
select either the SIP or the SSOR package. The default
unit numbers are as follows (These unit numbers must
be honored):
-
BAS = 1
BCF = 11
DRN = 13
EVT = 15
GHB = 17
MT3D = 32
OC = 22
PCG2 = 23
RCH = 18
RIV = 14
SIP = 19
SOR = 21
WEL = 12
5).- IAPART
- BUFF and RHS memory allocation
ISTRT - Starting Heads for Drawdown
6).- IBOUND
- Boundary Conditions button: This calls the utility 2D integer array
editor (See below, U2DINT).
7).- HNOFLO
- Dummy NO-FLOW Head Value
8).- Shead
- Starting Heads button: This calls the utility 2D real array
editor (See below, U2DREL).
9).- PERLEN, NSTP, & TSMULT
- Define Stress Periods button: Because there can be multiple stress
periods a pop-up dialog is needed (Figure 15.4). An
entry is needed for each stress period. If more then 10
stress periods are required, using the Previous and
Next buttons will allow you to proceed through them.
Length is equivalent to PERLEN, No. Steps to NSTP,
and Multiplier to TSMULT.
Figure 15.4
Block Centered Flow:
Selecting Packages:Block Centered Flow:Modify will generate the pop-up dialog
shown in Figure 15.5. This dialog allows all the parameters needed for the Block
Centered Flow package to be defined. Listed below are the MODFLOW variable names
with a description of the equivalent dialog entry:
Figure 15.5
- 1).
- ISS
- Steady-State Flag: Select either Steady-State or Transient.
IBCFCB - Cell-by-Cell Output: Output will be Not Saved, Saved to Standard
Output, or Saved to File (A unit number will be automatically
selected). If a filename is required, "Unknown" or a filename
will be written in the Cell-toCell Filename text entry field. To enter a filename, type over the current entry or press the
button Select. A dialog similar to that used in Figure 5.2 will
be displayed. The default file extension is "*.ctc". If the CTC
file already exists, the Convert to NCG button will convert the
file to a NODE CENTERED GRID file (see Chapter 11. This
option is not yet installed).
2).- LAYCON
- Layer Types button: To enter the layer type for each layer the dialog
shown in Figure 15.6 is used. Note, only the top layer can be
unconfined (Type 1). If there are more than ten layers, use
the Next and Previous buttons to define all layers.
Figure 15.6
- 3).
- TRPY
- Layer Anisotropy button: This calls the 1D utility array editor (See
below, U1DREL).
4).- DELR
- Width Along Rows button: This calls the 1D utility array editor
(See below, U1DREL).
5).- DELC
- Width Along Columns button: This calls the 1D utility array editor
(See below, U1DREL).
6).- sf1, Tran, HY, BOT, Vcont, sf2, TOP
- Layer Specifics button: These seven arrays can be fairly confusing
to get correct. The dialog in Figure 15.7 based on layer type,
layer position, and whether the simulation is transient or
steady-state will determine which layers need to be specified.
Arrays with a faded GRAY button are not needed, and cannot
be specified. Arrays that need to be defined are identified with
a RED button. Arrays that have been specified (not
necessarily with meaningful information) and are needed, are
colored GREEN. All of these arrays use the 2D utility array
editor described below (See below, U2DREL).
Figure 15.7
Drain:
Selecting Packages:Drain:Modify will generate the pop-up dialog shown in Figure
15.8. This dialog allows all the parameters needed for the Drain package to be defined.
Listed below are the MODFLOW variable names with a description of the equivalent
dialog entry:
Figure 15.8
- 1).
- MXDRN
- This term is not entered by the user.
IDRNCB - Cell-by-Cell Output: Output will be Not Saved, Saved to Standard
Output, or Saved to File (A unit number will bee automatically
selected). If a filename is required, "Unknown" or a filename
will be written in the Cell-to-Cell Filename text entry field. To
enter a filename, type over the current entry or press the button Select. A dialog similar to that used in Figure 5.2 will
be displayed. The default file extension is "*.ctc". If the CTC
file already exists, the Convert to NCG button will convert the
file to a NODE CENTERED GRID file (see Chapter 11, This
option is not yet installed).
To define the remaining parameters, press the Set Active Drain Sections button.
This will create the dialog shown in Figure 15.9. This dialog allows data entry for each
stress period.
Figure 15.9
- 2).
- ITMP
- Number Active Sections for stress period.
3).- Layer, Row, Col, Elevation, Cond
- Sections Definition button for stress period: Pressing these button
will pop-up the dialog shown in Figure 15.10. For each
section, enter the appropriate Layer, Row, Column, Elevation,
and Conductance. If there are more than ten sections, press
the Next and Previous buttons as appropriate.
Figure 15.10
Evapotranspiration:
Selecting Packages:Evapotranspiration:Modify will generate the pop-up dialog
shown in Figure 15.11. This dialog allows all the parameters needed for the
Evapotranspiration package to be defined. Listed below are the MODFLOW variable
names with a description of the equivalent dialog entry:
Figure 15.11
- 1).
- NEVTOP
- Evapotranspiration Application Location Option menu: Select applied to
the Top Layer Only or Vertically Distributed.
IEVTCB - Print Cell to Cell Flow: Output will be Not Saved or Saved to File
(A unit number will bee automatically selected). If a filename
is required, "Unknown" or a filename will be written in the
Cell-to-Cell Filename text entry field. To enter a filename, type
over the current entry or press the button Select. A dialog
similar to that used in Figure 5.2 will be displayed. The
default file extension is "*.ctc". If the CTC file already exists,
the Convert to NCG button will convert the file to a NODE
CENTERED GRID file (see Chapter 11, This option is not yet
installed).
To define the remaining parameters, press the Time Dependent
Evapotranspiration Data button. This will create the dialog shown in Figure 15.12.
This dialog allows data entry for each stress period.
Figure 15.12
- 2).
- INSURF
- Surface New or Last menu option for stress period.
INEVTR - Maximum ET Rate New
or Last menu option for stress period.
INEXDP - Extinction Depth New or Last menu option for stress period.
INIEVT - Layer New or Last menu option for stress period.
NOTE: For each of the above options, the array for stress period 1 must be
New.
3).
- SURF
- Surface button: This calls the 2D utility array editor (See below,
U2DREL).
4).- EVTR
- Maximum ET Rate
button: This calls the 2D utility array editor
(See below, U2DREL).
5).- EXDP
- Extinction Depth
button: This calls the 2D utility array editor (See
below, U2DREL).
6).- IEVT
- Layer
button: This calls the 2D utility array editor (See below,
U2DINT).
General Head:
Selecting Packages:General Head:Modify will generate the pop-up dialog shown
in Figure 15.13. This dialog allows all the parameters needed for the General Head
Boundary package to be defined. Listed below are the MODFLOW variable names with
a description of the equivalent dialog entry:
Figure 15.13
- 1).
- MXBND
- This term is not entered by the user.
IGHBCB - Cell-by-Cell Output:
Output will be Not Saved, Saved to Standard
Output, or Saved to File (A unit number will bee automatically
selected). If a filename is required, "Unknown" or a filename
will be written in the Cell-to-Cell Filename text entry field. To
enter a filename, type over the current entry or press the
button Select. A dialog similar to that used in Figure 5.2 will
be displayed. The default file extension is "*.ctc". If the CTC
file already exists, the Convert to NCG button will convert the
file to a NODE CENTERED GRID file (see Chapter 11, This
option is not yet installed).
To define the remaining parameters, press the Set Active GHB Zones button.
This will create the dialog shown in Figure 15.14. This dialog allows data entry for each
stress period.
Figure 15.14
- 2).
- ITMP
- Number Active GHB Zones
for stress period.
3).- Layer, Row, Col, Head, Cond
- GHB Zone Definitions button for stress period: Pressing these
button will pop-up the dialog shown in Figure 15.15. For
each section, enter the appropriate Layer, Row, Column,
Head, and Conductance. If there are more than ten sections,
press the Next and Previous buttons as appropriate.
Figure 15.15
MT3D:
If the MODFLOW output is being used as input for MT3D (See Chapter 16), a
specially formatted head file must be selected. This is done using the dialog shown in
Figure 15.16.
Figure 15.16
Output Control:
Selecting Packages:Output Control:Modify will generate the pop-up dialog shown
in Figure 15.17. This dialog allows all the parameters needed for the Output Control
package to be defined. Listed below are the MODFLOW variable names with a
description of the equivalent dialog entry:
Figure 15.17
- 1).
- IHEDFM
- Head Print Format menu list is used to select the file output format for
heads. This is the same format list used in the utility
package.
IDDNFM - Drawdown Print Format
button is used to select the file output format
for drawdowns. This is the same format list used in the utility
package.
IHEDUN - Head Filename
text field and Select button is used to select the output
file to which heads will be saved. A dialog similar to that used
in Figure 5.2 will be displayed. The default file extension is
"*.head". If no file is selected (Press the Cancel button), heads
will not be saved to a special file. If a non-zero Head Unit ID is
specified, a filename must be given.
IDDNUN - Drawdown Filename
text field and Select button is used to select the
output file to which drawdowns will be saved. A dialog similar
to that used in Figure 5.2 will be displayed. The default file
extension is "*.dd". If no file is selected (Press the Cancel
button), heads will not be saved to a special file. If a non-zero
Drawdown Unit ID is specified, a filename must be given.
To define the remaining parameters, select the desired Stress Period and press
the Set Time Step Data button. This will create the dialog shown in Figure 15.18 for the
specified stress period. This dialog allows data entry for each time step.
Figure 15.18
- 2).
- INCODE
- The Output Code may be specified as the same as the Last time step
(Not applicable for the first time step), as all layers treated the
Same, or on a By-Layer basis.
IHDDFL - Head & Drawdown, when set to TRUE these terms will be saved.
IBUDFL - Print Budget, when set to TRUE the water budget will be saved.
ICBCFL - Cell-to-Cell, when set to TRUE will print data from the packages
saving cell-to-cell information.
If the Output Code is set to all layers treated the Same or By-Layer, several
more terms must be specified for that time step. Press the Specification button to
display these terms (Figure 15.19). Note: this button will be highlighted in RED
(undefined) or GREEN (already defined) if needed; otherwise it will be faded GRAY and
not pressable.
Figure 15.19
- 3).
- Hdpr
- Print Head
, when true heads will be printed to standard output.
Ddpr - Print Drawdown, when true drawdowns will be printed to
standard output.
Hdsv - Save Head
, when true heads will be saved to the IHEDUN file.
Ddsv - Save Drawdown, when true drawdowns will be saved to the
IDDNUN file.
NOTE: If the modmain interface is going to be used to create head or drawdown
maps, head and drawdown must be printed to standard output. The standard
output file is read my modmain to determine the result values.
PCG:
Selecting Packages:PCG:Modify will generate the pop-up dialog shown in Figure
15.20. This dialog allows all the parameters needed for the Preconditioned Conjugate-
Gradient 2 package to be defined. Listed below are the MODFLOW variable names with
a description of the equivalent dialog entry:
Figure 15.20
- 1).
- MXITER
- Maximum Iterations per Time Step.
ITER1 - Maximum Number of Inner Iterations.
NPCOND - Matrix Preconditioning Method. Modified Incomplete Cholesky
(the
default) should be used on scalar computers, and Polynomial
should be used on vector computers.
2).- HCLOSE
- Head Change Convergence Criteria.
RCLOSE - Residual Convergence Criterion.
RELAX - Relaxation Parameter. 1.0 is normally used, but 0.99, 0.98, or
0.97 will reduce the number of iterations required for
convergence.
NBPOL - Maximum Eigenvalue method. This can be set to 2.0 or the
program can estimate a value.
IPRPCG - Print-Out Interval for the PCG solver.
MUTPCG - Printing from Solver has several options: Unsuppressed, the number of
Iterations are Printed, but Extremes Suppressed, or All printing
is Suppressed.
IPCGCD - Cholesky Decomposition Calls. This should generally be set to
zero.
Recharge:
Selecting Packages:Recharge:Modify will generate the pop-up dialog shown in
Figure 15.21. This dialog allows all the parameters needed for the Recharge package to
be defined. Listed below are the MODFLOW variable names with a description of the
equivalent dialog entry:
Figure 15.21
- 1).
- NRCHOP
- Recharge Application Location Option menu: Select recharge applied to
the Top Layer Only, Vertically Distributed (IRCH array), or
Applied to Highest Active Cell.
IRCHCB- Print Cell to Cell Flow: Output will be Not Saved or Saved to File (A unit
number will bee automatically selected). If a filename is
required, "Unknown" or a filename will be written in the Cell-
to-Cell Filename text entry field. To enter a filename, type over
the current entry or press the button Select. A dialog similar
to that used in Figure 5.2 will be displayed. The default file
extension is "*.ctc". If the CTC file already exists, the Convert
to NCG button will convert the file to a NODE CENTERED
GRID file (see Chapter 11, This option is not yet installed).
To define the remaining parameters, press the Time Dependent Recharge Data
button. This will create the dialog shown in Figure 15.22. This dialog allows data entry
for each stress period.
Figure 15.22
- 2).
- INRECH
- Recharge Rate New or Last menu option for stress period.
INIRCH- Recharge Layer New or Last menu option for stress period.
NOTE: For each of the above options, the array for stress period 1 must be
New.
3).
- RECH
- Recharge Rate button: This calls the 2D utility array editor (See
below, U2DREL).
The last array, is only read if recharge is Applied to Highest Active Cell. If it is
needed, the button will be highlighted in RED (undefined) or GREEN (previously
defined), or in faded GRAY if not needed.
- 4).
- IRCH
- Recharge Layer button: This calls the 2D utility array editor (See
below, U2DINT).
River:
Selecting Packages:River:Modify will generate the pop-up dialog shown in Figure
15.23. This dialog allows all the parameters needed for the River package to be defined.
Listed below are the MODFLOW variable names with a description of the equivalent
dialog entry:
Figure 15.23
- 1).
- MXRIVR
- This term is not entered by the user.
IRIVCB- Cell-by-Cell Output: Output will be Not Saved, Saved to Standard
Output, or Saved to File (A unit number will bee automatically
selected). If a filename is required, "Unknown" or a filename
will be written in the Cell-to-Cell Filename text entry field. To
enter a filename, type over the current entry or press the
button Select. A dialog similar to that used in Figure 5.2 will
be displayed. The default file extension is "*.ctc". If the CTC
file already exists, the Convert to NCG button will convert the
file to a NODE CENTERED GRID file (see Chapter 11, This
option is not yet installed).
To define the remaining parameters, press the Set Active Reaches button. This
will create the dialog shown in Figure 15.24.
Figure 15.24
- 2).
- ITMP
- Number Active Reaches for stress period.
3).- Layer, Row, Col, Stage, Cond, Rbot
- Reach Definitions button for stress period: Pressing these button
will pop-up the dialog shown in Figure 15.25. For each
section, enter the appropriate Layer, Row, Column, Stage,
Conductance, and Bottom. If there are more than ten sections,
press the Next and Previous buttons as appropriate.
Figure 15.25
SIP:
Selecting Packages:SIP:Modify will generate the pop-up dialog shown in Figure
15.26. This dialog allows all the parameters needed for the Strongly Implicit Procedure
package to be defined. Listed below are the MODFLOW variable names with a
description of the equivalent dialog entry:
Figure 15.26
- 1).
- MXITER
- Maximum Iterations per Time Step.
NPARM- Number of Iteration Parameters.
2).- ACCL
- Acceleration.
HCLOSE- Head change Convergence Criteria.
IPCALC- Iteration Flag. This specifies whether the seed will be User
Defined or Calculated at the Start of the Simulation.
WSEED- Seed. This parameter only needs to be set if IPCALC is set to
Seed User Defined.
IPRSIP - Printout Interval.
SSOR:
Selecting Packages:SSOR:Modify will generate the pop-up dialog shown in Figure
15.27. This dialog allows all the parameters needed for the Slice-Successive
Overrelaxation package to be defined. Listed below are the MODFLOW variable names
with a description of the equivalent dialog entry:
Figure 15.27
- 1).
- MXITER
- Maximum Iterations per Time Step.
2).- ACCL
- Acceleration.
HCLOSE- Head change Convergence Criteria.
IPRSOR- Printout Interval.
Well:
Selecting Packages:Well:Modify will generate the pop-up dialog shown in Figure
15.28. This dialog allows all the parameters needed for the Well package to be defined. Listed below are the MODFLOW variable names with a description of the equivalent dialog entry:
Figure 15.28
- 1).
- MXWELL
- This term is not entered by the user.
IWELCB- Cell-by-Cell Output: Output will be Not Saved, Saved to Standard
Output, or Saved to File (A unit number will bee automatically
selected). If a filename is required, "Unknown" or a filename
will be written in the Cell-to-Cell Filename text entry field. To
enter a filename, type over the current entry or press the
button Select. A dialog similar to that used in Figure 5.2 will
be displayed. The default file extension is "*.ctc". If the CTC
file already exists, the Convert to NCG button will convert the
file to a NODE CENTERED GRID file (see Chapter 11, This
option is not yet installed).
To define the remaining parameters, press the Set Active Wells button. This will
create the dialog shown in Figure 15.29.
Figure 15.29
- 2).
- ITMP
- Number Active Wells for stress period.
3).- Layer, Row, Col, Recharge
- Well Definitions button for stress period: Pressing these button will
pop-up the dialog shown in Figure 15.30. For each section,
enter the appropriate Layer, Row, Column, and Recharge. If
there are more than ten sections, press the Next and Previous
buttons as appropriate.
Figure 15.30
Utility:
Many of the MODFLOW packages require 1D and 2D arrays. For these arrays
MODFLOW has several standard utility modules for inputting this information. These
are implemented with pop-up dialogs for U1DREL, U2DREL, and U2DINT. They are all
very similar to the dialog shown in Figure 15.31. The parameters are explained below
and can be defined for each applicable layer (These can be step through by using the
Next and Previous buttons):
Figure 15.31
- REAL ARRAYS (U1DREL and U2DREL):
1).- LOCAT
- Data Source (File/Constant): values for an array can be set as
Array = Constant Value, or values may be read from an
Unformatted File or a Formatted File. If the LOCAT does not
define a constant, the Define Array button will be activated;
RED indicates the array needs to be defined, and GREEN
indicates it has been previously defined. To enter the array
position values, press the Define Array button; it will pop-up
the array editor discussed below. If LOCAT does not define a
constant, a file Unit Number ID (positive only) must be
specified. If the Unit Number ID does not match the unit
number ID for the package being modified (See
Packages:Basic - IUNIT section above), a Data Filename
associated with the Unit ID also needs to be specified.
CNSTNT- If LOCAT is set to Array = Constant Value, the constant value should be
entered in the Constant for Array text field. Otherwise,
individual values are read for each array position, and the
multiplier should be entered in the Multiplier text field.
FMTIN - Input FORTRAN77 FORMAT: This format is user specified for
reading the data file. It must be a valid FORTRAN77 format
for REAL numbers, and there must be an entry.
IPRN- Output FORTRAN77 FORMAT: This button allows the user to
select the standard output file format for this array. For
U1DREL the (10G12.4) format is the only valid format. For
U2DREL, the valid formats can be selected from the menu list
button. Valid formats are:
-
10G11.4
11G10.3
9G13.6
15F7.1
15F7.2
15F7.3
15F7.4
20F5.0
20F5.1
20F5.2
20F5.3
20F5.4
10G11.4
INTEGER ARRAYS (U2DINT):
1).- LOCAT
- Data Source (File/Constant): values for an array can be set as
Array = Constant Value, or values may be read from an
Unformatted File or a Formatted File. If the LOCAT does not
define a constant, the Define Array button will be activated;
RED indicates the array needs to be defined, and GREEN
indicates it has been previously defined. To enter the array
position values, press the Define Array button; it will pop-up
the array editor discussed below. If LOCAT does not define a
constant, a file Unit Number ID (positive only) must be
specified. If the Unit Number ID does not match the unit
number ID for the package being modified (See
Packages:Basic - IUNIT section above), a Data Filename
associated with the Unit ID also needs to be specified.
ICONST- If LOCAT is set to Array = Constant Value, the constant value
should be entered in the Constant for Array text field.
Otherwise, individual values are read for each array position,
and the multiplier should be entered in the Multiplier text
field.
FMTIN - Input FORTRAN77 FORMAT: This format is user specified for
reading the data file. It must be a valid FORTRAN77 format
for INTEGER numbers, and there must be an entry.
IPRN- Output FORTRAN77 FORMAT: This button allows the user to
select the standard output file format for this array. For
U2DINT, the valid formats can be selected from the menu list
button. Valid formats are:
-
10I11
60I1
40I2
30I3
25I4
20I5
[TOP] [SYNTAX]
Run:
Once all the data packages are built, a script to run MODFLOW with the current
data files can be built and MODFLOW can be executed.
- NOTE and WARNING: The standard release of MODFLOW does not support the
PCG2 solver or MT3D. If you want to use these packages, you need to update
the software yourself, or download the copy of MODFLOW released with
UNCERT (See Chapter 2, the Acquiring Software section).
Now:
Run:Now will check to see that all package modifications have been saved,
update the run script, and make a system call to execute MODFLOW.
- NOTE: MODFLOW is executed with a system call; as a result modmain cannot
independently determine when MODFLOW is done or if there has been a
problem. The standard MODFLOW messages, however will still be printed to the
xterm window that launched modmain. When MODFLOW is complete, "STOP"
will be printed in the xterm window.
Save Script:
Modmain does not contain MODFLOW; it is simply a user interface for
MODFLOW. To execute MODFLOW, modmain builds an executes a script. The script
file copies all the active packages files from there user defined names to their
FORTRAN77 unit ID names (e.g. f93.bas, a Basic package data file, would be copied to
fort.1), and redirects standard output to a data file (default = mod.out). Finally the
copied fort.* data files are deleted since they are no longer needed.
[TOP] [SYNTAX]
View:
Once MODFLOW has been run, the standard output data file can be read, and
head data and drawdown data may be striped from the file and formatted into files
compatible with contour, surface, and block.
- NOTE: These options are not available until MODFLOW has been run, using the
Run:Now menu-bar option.
WARNING: Because there is currently no error checking on whether MODFLOW
completed successfully, modmain may try to map head values that do not exist.
Before you try to make a grid or block file, examine the file to insure it has
completed successfully.
MODFLOW Output File:
View:MODFLOW output file generates the pop-up dialog in Figure 15.32. This
dialog allows the user to select the output file containing MODFLOW's redirected output
(MODFLOW Output Filename). To view the data file, press the Edit button. The output
file will be displayed (Figure 15.33) using editor (Chapter 18). Note, editor is a separate
program then modmain and must be quit separately.
Figure 15.32
Figure 15.33
Drawdown/Head - Contoured Surface:
View:Drawdown/Head:Contoured Surface generates the pop-up dialog in Figure
15.34. This dialog allows the user to specify what layer or cross-section, during which
stress period the user is interested in mapping. This dialog is used to strip the
appropriate head/drawdown data from MODFLOW's redirected output (MODFLOW
Output Filename). Once the head/drawdown data is striped, the head/drawdown
values are matched to their X, Y, and Z positions and saved to a file (Data Filename).
Pressing the Grid Data button, will strip the data and save the data file. If the Run
Gridding Program option is set to Create XYZ Data File and Grid the data file will be
passed to grid (Chapter 10) where the data can be regridded to a regular grid and then
plotted with either contour (Chapter 11) or surface
(Chapter 12).
Figure 15.34
- NOTE: The X-Z and Y-Z Plane options are not installed.
NOTE: If a cell has gone dry, MODFLOW will mark it by giving it a head value of
HNOFLO (Basic Package). When creating the X. Y, Z, head value data file, any
cells with heads greater than HNOFLO will be considered dry and not included
in the data file. When a cell value is discarded, a WARNING message identifying
the cell position will be displayed in the log-status window.
NOTE: Because grid is an independent program module, it must be terminated
separately from modmain. Also, once grid is open, modmain can no longer
inform it what files to load. If the Grid Data button is pressed repeatedly with
the Create XYZ Data File and Grid option set, there will be multiple instances of
grid running using up computer memory. It is therefore best to 1) quit grid after
each grid data file is created, or 2) to set the Run Gridding Program option to
Create XYZ Data File Only. Once the XYZ data file is created, it is a simple
matter to load the new XYZ data file with grid.
Drawdown/Head - Block:
View:Drawdown/Head:Block generates the pop-up dialog in Figure 15.35. This
dialog allows the user to specify which stress period the user is interested in mapping.
This dialog is used to strip the appropriate head/drawdown data from MODFLOW's
redirected output (MODFLOW Output Filename). Once the head/drawdown data is
striped, the head/drawdown values are matched to their X, Y, and Z positions. If Grid
is pressed the stripped values and coordinates are passed to grid (Chapter 10) as
discussed in the View:Drawdown/Head:Contoured Surface section above. If the Make
Block Map button is pressed, a NODE CENTERED GRID file (Chapter 11) is created if
DELR and DELC (Block Centered Flow Package) are constant arrays, otherwise an
IRREGULAR_GRID_SPACING file (Chapter 13) is created. In either case the grid file is
sent to block (Chapter 13) for viewing.
Figure 15.35
- NOTE: If a cell has gone dry, MODFLOW will mark it by giving it a head value of
HNOFLO (Basic Package). When creating the X. Y, Z, head value data file, any
cells with heads greater than HNOFLO will be considered dry and not included
in the data file. When a cell value is discarded, a WARNING message identifying
the cell position will be displayed in the log-status window.
NOTE: Cells with values outside the minimum and maximum head/drawdown will
not be display when viewed using block.
NOTE: Because grid and block are independent programs module, they must be
terminated separately from modmain. Also, once open, modmain can no longer
inform them what files to load.
[TOP] [SYNTAX]
Simulator:
NOT INSTALLED.
[TOP] [SYNTAX]
Network:
NOT INSTALLED.
[TOP] [SYNTAX]
Log:
The Log menu option is supplied to allow the user to save, view, or print all text
which has been written to the log/status window by the program or added by the user
(The log window is also a simple text editor). The options include View Log, Save, Save
as, and Print. View Log, Save, and Save as are similar in operation to the menu options
under File described above.
[TOP] [SYNTAX]
Help:
Help lists topics about the program for which there is help. When a item is
selected a pop-up dialog with a scrolled text area is generated which is similar to Figure
5.15 with the desired information.
- NOTE: Only one help window may be open at a time.
Help files are editable ASCII data files; for further information see Appendix D.
[TOP] [SYNTAX]
Editor:
The array editor is composed of two sections; the menu-bar, the drawing and
editing screen. In the drawing area, the current array will be displayed with the array
name at the top of the map and either the row-column coordinates for the grid, or the
actual X-Y distance coordinates (Example: Figure 15.36). In the upper-left corner of the drawing area, as the mouse pointed is moved over the array, the current array values,
and row/column position for the cell will be displayed.
Figure 15.36
Array:
The editor Array menu options control printing, and quitting.
Print Setup:
Array:Print Setup allows the user to define the print destination and the number
of copies that will be made. These features are explained in detail in Chapter 5; the
pop-up dialog used is shown in Figure 5.3.
Print:
Array:Print generates a Postscript file of the array/map, and depending on how
the print options are define in Print Setup, directs this file to the specified print queue,
or to the specified file.
Quit:
Array:Quit terminates the array editor. Changes to the array are saved
automatically.
Edit:
Edit:New Value generates the pop-up dialog shown in Figure 15.37. This dialog
controls the color palette, the input values to the array, and the method values will be
input into the array.
Figure 15.37
The color palette, is set linearly from the minimum to the maximum data values
in the array (Normal Scaled Color Palette Gradation). Because many parameters very
over several orders of magnitude (e.g. hydraulic conductivity - clay = 10-5 ft/day, gravel
= 103 ft/day), however, a linear color scale will hide much of the detail. For this reason,
the color scale can be Log Scaled (Note, any values <= 0.0 will be set to BLACK). If
array value range has been changed, pressing the Refit Color Palette button will rescale
the color palette.
To enter new values in the array, enter the desired value(s) in the Start Array
Value and End Array Value (optional) text fields. Pressing the Apply Start Value to All
Cells will apply the value in the Start Array Value text field to all the cells in the array;
this is a quick way to initialize the array to a given value. Values may also be entered
into the array using the mouse. When the left mouse button is held down and the
mouse is moved, a small rectangle is created. When the mouse button is released, all
cells that are under or within the rectangle will be reset based on the current Populate
Rule. Individual cells can be changed by pointing at a cell and pressing and releasing
the left mouse button. The rules are detailed below:
- Constant (Start Value):
- All cells marked, will be set to the value in the Start Array
Value text field.
Left to Right: - When marking the rectangle, cells on the side of the rectangle where
the mouse was first pressed will be assigned the Start Array Value. Those on the
other side will be assigned the End Array Value. Cell in-between, will be defined
based on the linear distance of the middle of the cell to the distance between
the middle of the right and left most selected cells (Figure 15.38a).
Figure 15.38a
- Top to Bottom:
- When marking the rectangle, cells on the side of the rectangle where
the mouse was first pressed will be assigned the Start Array Value. Those on the
other side will be assigned the End Array Value. Cell in-between, will be defined
based on the linear distance of the middle of the cell to the distance between
the middle of the top and bottom most selected cells (Figure 15.38b).
Figure 15.38b
- Start to End Vector:
- When marking the rectangle, the cell in the corner of the
rectangle where the mouse was first pressed will be assigned the Start Array
Value. The cell in the opposite corner will be assigned the End Array Value.
Cell in-between, will be defined based on the linear distance of the middle of the
cell starting cell to the middle of the ending cell (Figure 15.38c & 15.38d).
Figure 15.38c and
Figure 15.38d
A combination of the rules can be used to create more complex arrays as shown
in Figure 15.38e or Figure 15.36.
Figure 15.38e
[TOP]
Example of Using Modmain:
An example MODFLOW model is included in the $UNCERT/demo/modmain
directory. There are two project files, f93.prj and f93cor.prj. These projects were used
as a calibration problem, the first being the basic model setup, but the starting heads,
recharge rates, river conductance's, and hydraulic conductivity distributions are filled
with constant and inaccurate values. The second project, f93cor.prj, defines the "true"
site conditions (This is a hypothetical model).
To run the correct or actual solution, run modmain, and load the project file
f93cor.prj (Use the Project:Open Project menu-bar option). Opening the project will load
several files into the application. These files are display in the log/status window and
are also listed below:
- f93.bas : BASIC INPUT PACKAGE
f93cor.bcf : BLOCK CENTERED FLOW INPUT PACKAGE
f93.oc : OUTPUT CONTROL INPUT PACKAGE
f93cor.rch : RECHARGE INPUT PACKAGE
f93cor.riv : RIVER INPUT PACKAGE
f93.sip : SIP INPUT PACKAGE
When modmain reads in f93.bas, it recognized that the BCF, OC, RCH, RIV, and SIP
packages are also required. These are defined by the Packages Used and Solver Used
toggles and toggle menu (IUNIT variables, Figure 15.2). If you pull down the Packages
menu-bar you will note that all of the above packages are highlighted in GREEN. This
means that all of the required packages are defined, and MODFLOW can be run.
- WARNING: A package can be defined, without necessarily having reasonable
entries.
To execute MODFLOW with these modules, select the Run:Now menu-bar option. A
pop-up dialog will appear (similar to Figure 5.2) asking for the name of a script file. A
script file is simple an ASCII text file with instructions the UNIX operating system can
understand and execute. Select f93cor.csh. Modmain will determine what files are
needed, build the script file, and tell the UNIX operating system to execute the script.
In the log/status window a message will be printed:
- Executing MODFLOW
SYSTEM CALL: $PWD/f93cor.csh &
NOTE: WAIT for "STOP" to appear in the xterm text window before continuing.
The system call executes the script. Because a shell script is being executed, however,
modmain has no way of knowing when MODFLOW is complete; this has to be
determined by the user. In the xterm window were modmain was executed, when
MODFLOW is done, the word "STOP" will be printed (For this data set, you will only
have to wait a few seconds).
Once MODFLOW is complete, modmain can be used to view the results. To view
the text file, select the View:MODFLOW output file menu-bar option. Press the View
Output Filename button (Figure 15.32) and the standard output file generated by
MODFLOW will be displayed (Figure 15.33). To make a contour map of the model head
results, select the View:as Contoured Surface menu-bar option. The model was steady-
state, so there is only one stress period; it was also, only a one layer X-Y plane model,
so the default values shown in Figure 15.34 are correct. To create a data file containing
the X, Y coordinates and head value for each cell, press the Grid Data button.
- NOTE: In the log-status window, there are several WARNINGS. For six cells, the
head value was 1.0e30! This is how MODFLOW indicates the cell went dry.
These values are not included in the data set, because they have no real
meaning with regard to the water table level at those locations.
Once the file has been created, grid (Chapter 10) is called, and several parameters are
passed to that application. The most important are the X, Y, head value file name, and
the number of columns and rows to use to build the grid (By default, twice the
MODFLOW rows and columns plus 1 are used; this reduces some of the problems with
the inverse-distance gridding algorithm honoring the MODFLOW results). For this
example, it is sufficient to select Method:Calculate from the grid menu-bar. When the
grid is calculated, select View:Contour Map from the grid menu-bar, and save the file to
junk.srf (See Chapter 10 for further detail on using grid). Once the file is saved, the grid
file will be passed to contour (Chapter 11) and displayed. A map similar to Figure 15.39
will be displayed. In addition to the normal features of a contour map, the areas
outside of the flow region have been blanked out (description file = f93.blk) and the
location the calculated heads are marked by "+" symbols (description file = junk.dat;
this is the X, Y, head value data file created by modmain, and used by grid to generate
the displayed grid file). These filenames are specified in the contour preference file,
"contour.prf."
Figure 15.39
- NOTE: In the lower-left portion of the map area, where the regular grid would imply
that there should be some head measurement, the "+" symbol is missing. These
are some of the locations where the cells went dry.
For further details on using contour, refer to Chapter 11.
[TOP]
Running From the Command Line:
In many cases it is more convenient to run the application completely from the
command line, or at least pass some parameter values in from the command line. The
options listed below allow the user to accomplish almost anything that is possible from
within the X-windows application from the command line (adding lines from different
files is not currently supported). This feature can be useful when the user does not
have a X-windows/Motif terminal available, or when many models need to be processed
quickly, and the operation can be completed in batch mode without user interaction.
Syntax: modmain [project file name]
- NOTE: Parameters in [] brackets are optional.
[TOP]
Setting up Files:
In addition to the MODFLOW file formats, modmain adds two more file. One is a
project file which is used to keep track of all the files used in a project. The other is a
shell script file which is used to rename files for MODFLOW, run MODFLOW, redirect
standard output, and clean up after MODFLOW whens it's done.
Project File:
The project file saves three groups of files, packages files, cell-to-cell flow files,
and files associated with the package files. These later files are defined with a unit
number in the 1D and 2D array utility cards with a LOCAT file unit number different
from the parent package. The files are listed in the following order:
- Associated Files
MODFLOW Package Files (Basic Package file first)
Cell-to-Cell Files
For each file, three pieces of information are needed: 1) the files unit ID, 2) the files
name, and 3) the unit ID of the owning package (e.g. block.ctc might be owned by the
Block Center Flow Package, unit 11). A sample file might look like:
- 41 starting_head.dat 1
42 hyd_cond.dat 11
1 sample.bas 1
11 sample.bcf 11
43 block.ctc 11
Script File:
The shell script file has three sections: 1) copying user named files to fort.<unit
ID> files, 2) executing MODFLOW and redirecting standard output, and 3) cleaning up
after MODFLOW is down. For the above example (Project File), the shell script would
look like:
- \cp sample.bas ----- fort.1
\cp sample.bcf ----- fort.11
\cp starting_head.dat -----fort.41
\cp hyd_cond.dat -----fort.42
modflow > mod.out
\rm ----- fort.1
\rm ----- fort.11
\rm ----- fort.41
\rm ----- fort.42
\mv fort.42 ----- block.ctc
[TOP]
Bibliography (modmain):
McDonald, M.G., and A.W. Harbaugh, 1984, A Modular Three-Dimensional Finite-Element Flow Model, U.S. Geological Survey OFR 83-875.
[TOP]
Table of Contents
Previous Chapter
Beginning of this Chapter
Next Chapter