May 28, 1997 MODFLOW - Version: 2.6 1996/09/20 Three-dimensional finite-difference ground-water flow model NOTE: This version of MODFLOW (now referred to as MODFLOW-88) has been superseded by a new version that is referred to as MODFLOW-96. For assistance, enhancement requests, or bug reports contact the Hydrologic Analysis Software Support Team via email at h2osoft@usgs.gov. See the file doc\modflow.txt for descriptions, references, and additional contacts for this software. Instructions for installation, execution, and testing are provided below. TABLE OF CONTENTS A. FILES B. EXTRACTING FILES C. COMPILING D. INSTALLING E. RUNNING THE SOFTWARE F. TESTING A. FILES The following self-extracting DOS distribution files (containing the software, test data sets, and information files) are currently available for DOS computer systems: mdfw2_6.exe - Compiled using Lahey Fortran 90 with source code mdfw2_6b.exe - Compiled using Lahey Fortran 90 (binaries only) mdfw2_6s.exe - Source code For use on personal computers, the program source code consists of the following files (found in the modflow2.6\src directory): modflwpc.for bas2.for bcf3.for riv1.for drn1.for wel1.for ghb1.for rch1.for evt1.for sip1.for sor1.for utl1.for pcg2.for str1.for ibs1.for chd1.for gfd1.for hfb1.for tlk1.for de45.for res1.for makefile -- input instructions to the Lahey "make" utility for compiling MODFLOW B. EXTRACTING FILES For whichever MODFLOW distribution file that you have acquired, mdfw2_6.exe, mdfw2_6b.exe, or mdfw2_6s.exe, the directory modflow2.6 is created (or overwritten) when the files are extracted. If the modflow2.6 directory already exists, you may want to delete or rename it before extracting the files. The following are the steps to extract the files from a distribution file. Note, replace with the drive letter where you want to install MODFLOW and optionally replace [directory] with the name of a directory on that drive: 1. If you are not in the directory where the distribution file is located, go there. For example (if already on the C disk drive): cd c:\wrdapp 2. Extract the files using the command: mdfw2_6 -d -o :\[directory] Substitute "mdfw2_6b" or "mdflw2_6s" for "mdfw2_6" if you are installing the executable-code-only or source-code distributions, respectively. Note, be sure to include the -d (restore directory structure) and -o (overwrite existing files) options and ":\" in the command. Examples are: mdfw2_6 -d -o c:\ mdfw2_6 -d -o c:\wrdapp The following directory structure will be created (the contents of each directory are shown to the right): modflow2.6 ; copy of this readme file `-----bin ; compiled executable and Lahey error file `-----doc ; documentation files `-----src ; makefile and source code `-----test ; batch files to run verification tests `-----data ; standard data sets used in verification tests Notes: a) The executable is not included in the mdfw2_6s.exe distribution file. b) The source code is not included in the mdfw2_6b.exe distribution file. c) It is recommended that no user files are kept in the modflow2.6 directory structure. If you do plan to put files in the modflow2.6 directory structure, do so only by creating subdirectories of modflow2.6. d) Brackets "[xxx]" are used to indicate optional arguments to commands. C. COMPILING The source code is provided in the mdfw2_6.exe and mdfw2_6s.exe distribution files so that users can generate the executable themselves. No support can be provided for users generating their own versions of the software. In general, the requirements are a Fortran compiler and a minimal level of knowledge of the compiler and the DOS operating system. As provided, the makefile and source code are optimized for use on a Pentium personal computer using the Lahey Fortran 90 compiler and supplied make program. To generate a new executable, do the following: 1. Change directory to the source directory: cd modflow2.6\src 2. Modify the beginning of the file named makefile to correctly specify system-dependent variables: FFLAGS Fortran compiler flags FC Fortran compiler name LINKER Fortran linker name LNKFLGS Fortran linker flags 3. Use the make program to initiate compilation of the source code and installation of the software: make [BINDIR=directory_for_executable] See the Installing instructions below for an explanation of BINDIR. The make will: a. create the directory modflow2.6\bin if it does not exist, b. compile the source code, c. place the executable (modflow.exe) in modflow2.6\bin, and d. place a copy of the executable in BINDIR if specified. D: INSTALLING To make the MODFLOW program accessible from any directory, the directory containing the executable should be included in the PATH environment variable. For example, you could add a line similar to the following to the AUTOEXEC.BAT file: PATH=%PATH%;C:\modflow2.6\bin Note, substitute the appropriate drive letter and pathname if not C:\ as shown above. As an alternative, the MODFLOW executable can be installed in a directory already included in the PATH environment variable. The makefile (input instructions to the Lahey make program--located in modflow2.6\src) contains instructions to optionally place a copy of the executable contained in modflow2.6\bin in a specified directory. Use the following two commands to do this: cd modflow_source_directory make install BINDIR=directory_for_executable For example: cd C:\modflow2.6\src make install BINDIR=C:\wrdapp\bin Note, the makefile may need to be modified to be used with make programs other than the Lahey make program. E. RUNNING THE SOFTWARE **System Requirements** - 386-based or higher personal computer with math co-processor running DOS. - 2 MB application RAM - 2 MB hard disk space MODFLOW has been compiled using the Lahey Fortran 90 extended memory compiler version 3.00f. The file "LF90.EER" (from the Lahey compiler) located in modflow2.6\bin contains error messages. If an error occurs, this file is used to print error messages if the modflow2.6\bin directory is included in the PATH environment variable; if LF90.ERR cannot be found, the error will only be identified by number. The source code compiled was that documented in the published MODFLOW reports. The only modifications to this code are in the MAIN program and the BAS Package. The BAS Package was modified to open files because the Lahey compiler cannot deal with preallocated files as originally used in MODFLOW. The MAIN program was modified to prompt the user to enter the name of a Name File. This file must contain names and units for all files used in a MODFLOW simulation. The MAIN program was also modified to dynamically allocate memory as described below. Memory for the X array is dynamically allocated based on the problem size. The maximum X array size is 15,000,000 elements. This will run a problem of around 1,000,000 nodes. It is best to have enough memory to hold the full allocated X array. If there is less memory than this, the program will use virtual memory, but this slows computations significantly. The memory used by the X array in bytes is 4 times the allocated number of elements in the X array. The number of elements used for each package is shown in the listing file, usually named with a .lst suffix, that is generated by MODFLOW. The allocated number of elements is the total number of elements used by all packages. Note that the listing file will NOT contain the usual Fortran carriage control characters (blank, 0, and 1) in the first column of each line. Instead, the carriage control characters are interpreted before they are output. The listing file can be printed with the DOS PRINT command. After MODFLOW is properly installed in a directory that is included in your PATH, the program is initiated using the command: modflow. MODFLOW prompts for the name of a Name File. Each record of the Name File specifies a file type, unit number, and file name for each file used in the MODFLOW simulation. The file type is either "LIST", "DATA", "DATA(BINARY)", or a 3-character package name such as RCH. In addition to defining the file names and unit numbers, the Name File activates packages. That is, the IUNIT elements that correspond to the packages indicated by the file types are turned "on". The IUNIT record in the BAS Package input file is ignored; packages can now only be activated through the Name File. The Name File is read on unit 99, so this unit should not be used for any other model files. The following table relates the IUNIT element to the corresponding 3-character package name. IUNIT PACKAGE NAME 1 BCF 2 WEL 3 DRN 4 RIV 5 EVT 6 TLK 7 GHB 8 RCH 9 SIP 10 DE4 11 SOR 12 OC 13 PCG 14 GFD 15 16 HFB 17 RES 18 STR 19 IBS 20 CHD 21 22 23 24 The first record in the Name File must specify file type "LIST", which is the MODFLOW listing file. All other files can be in any order. File type "DATA" is for formatted data files. File type "DATA(BINARY)" is for unformatted data files such as the file used to save heads. The following file is the Name File for the sample problem in Appendix D of the MODFLOW documentation (TWRI 6-A1). The lines in the Name File are read using free format, so spacing is not important as long as a comma or at least one space separates adjacent fields. The following shows an example of a Name File: LIST 6 twri.lst BAS 5 twri.bas BCF 11 twri.bcf WEL 12 twri.wel DRN 13 twri.drn RCH 18 twri.rch SIP 19 twri.sip F. TESTING Test data sets are provided to verify that the program is correctly installed and running on the system. The tests may also be looked at as examples of how to use the program. The directory modflow2.6\test contains batch files to run the tests. The directory modflow2.6\data contains the input data and expected results for each test. Run the tests in the modflow2.6\test directory using the command: test After the tests are completed, the results can be compared to the expected results. To clean-up after the tests, type the command: clean The tests are described in the table below. Test is the test number, program is the program used to run the test, and the usage column indicates how a file is used, with i for input, o for output, and i/o for both input and output. test program description of test and files file name & usage ---- ------- --------------------------------- ----------------- 1 modflow Runs the storage depletion test problem in OFR 88-482 Name File to designate files ibs.nam i BAS1 Package ibs.bas i BCF2 Package ibs.bcf i SIP1 Package ibs.sip i Output Control ibs.oc i IBS1 Package ibs.ibs i Listing of results ibs.lst o 2 modflow Runs the example problem in OFR 88-729 Name File to designate files str.nam i BAS1 Package str.bas i BCF2 Package str.bcf i SIP1 Package str.sip i Output Control str.oc i STR1 Package str.str i Listing of results str.lst o 3 modflow Runs the problem in Appendix D of TWRI 6-A1 Name File to designate files twri.nam i BAS1 Package twri.bas i BCF2 Package twri.bcf i WEL1 Package twri.wel i DRN1 Package twri.drn i RCH1 Package twri.rch i SIP1 Package twri.sip i Listing of results twri.lst o 4 modflow Runs problem 1 in OFR 91-536 Name File to designate files bcf2ss.nam i BAS1 Package bcf2ss.bas i BCF2 Package bcf2ss.bcf i WEL1 Package bcf2ss.wel i RIV1 Package bcf2ss.riv i RCH1 Package bcf2ss.rch i PCG2 Package bcf2ss.pcg i Output Control bcf2ss.oc i Listing of results bcf2ss.lst o 5 modflow Runs the first problem in OFR 94-59 Name File to designate files tlkp1.nam i BAS1 Package tlkp1.bas i BCF Package tlkp1.bcf i TLK Package tlkp1.tlk i SIP Package tlkp1.sip i Output Control tlkp1.oc i Listing of results tlkp1.lst o 6 modflow Runs the example problem in OFR 96-364 Name File to designate files restest.nam i BAS1 Package restest.bas i BCF Package restest.bcf i GHB Package restest.ghb i SIP Package restest.sip i Output Control restest.oc i RES (Reservoir) Package restest.oc i Listing of results restest.lst o * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Good Luck! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *