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 distribution packages (containing the software, test data sets, and information files) are currently available for UNIX systems: modflow2.6.DGUX.tar.gz - Compiled for Data General AViiON under DG/UX 5.4 modflow2.6.Solaris.tar.gz - Compiled for Sun UltraSPARC 2 under Solaris 2.5 modflow2.6.SGI.tar.gz - Compiled for Silicon Graphics Indigo (32-bit) under Irix Release 6.0.1 modflow2.6.source.tar.gz - Source code For use on Data General workstations, the program source code consists of the following files (found in the modflow2.6/src directory): modflow.f bas1.f bcf3.f riv1.f drn1.f wel1.f ghb1.f rch1.f evt1.f sip1.f sor1.f utl1.f pcg2.f str1.f ibs1.f chd1.f gfd1.f hfb1.f tlk1.f de45.f res1.f Makefile -- input instructions to the UNIX "make" utility for compiling MODFLOW B. EXTRACTING FILES The compressed tar file, named modflow2.6.OS.tar.gz, contains all the files needed to install and test MODFLOW on a computer with a particular operating system, where OS is a string indicating the operating system the distribution is intended for. If a version is not available for your operating system, the file modflow2.6.source.tar.gz contains the source code and all other files needed to compile, install, and test the software on a UNIX-based computer. For either type of distribution, the directory modflow2.6 is created (or overwritten) when the files are extracted from the tar file. 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 tar file. 1. If the tar file is not already in the directory under which you want the distribution installed, move it there. For example: mv modflow2.6.____.tar.gz /usr/opt/wrdapp 2. If you are not in the directory where the tar file is located, go there. For example: cd /usr/opt/wrdapp 3. Uncompress the distribution file. For example: gunzip modflow2.6.____.tar.gz 4. Extract the distribution files from the tar file. For example: tar -xof modflow2.6.___.tar This creates the following directory structure (the contents of each directory are shown to the right): modflow2.6 ; copy of this README file `-----bin ; compiled executable `-----doc ; documentation files (manual page, update notes) `-----src ; Makefile and source code `-----test ; scripts to run verification tests `-----data ; standard data sets used in verification tests Notes: a) The bin directory is not included in the modflow2.6.source.tar.gz distribution (it is created during compilation). b) Source code is included only with the modflow2.6.source.tar.gz distribution. c) It is recommended that no user files be 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. C. COMPILING If a compiled version of the software is not available for your computer, or if you want to build the executable yourself, follow the instructions in this section. If you have retrieved a pre-compiled distribution of the software, skip to the Installing section below. The source code is provided in the modflow2.6.source.tar.gz distribution 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 UNIX operating system. As provided, the Makefile and source code are set up for use on Data General AViiON workstations running the DG/UX operating system. 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: F77 Fortran compiler name FFLAGS Fortran compiler flags 3. Use the make program to initiate compilation of the source code and installation of the software: make [BINDIR=directory_for_links] See the Installing instructions below for an explanation of BINDIR. The make will: a. create the directories modflow2.6/bin and BINDIR if they do not already exist, b. compile the source code, c. place the executable (modflow) in modflow2.6/bin, and d. place a link to the executable in BINDIR if specified. D. INSTALLING To make the executable (modflow) easy to use, it should be installed in a directory included in the user's search path. The Makefile (input instructions to the UNIX make program--located in modflow2.6/src) contains instructions to optionally place a link in a specified directory to the executable contained in modflow2.6/bin. Use the following two commands to do this: cd modflow2.6/src make install [BINDIR=directory_for_links] If BINDIR is specified, a link to the executable is placed in the specified directory. For example, if your search path consists of: /usr/bin:/usr/opt/bin:/usr/local/bin use the command: make install BINDIR=/usr/local/bin to make the executable accessible from any directory without requiring the full pathname of the software's location. Notes: a) Brackets "[xxx]" are used to indicate optional arguments to commands. b) To create and delete a link to the MODFLOW executable file, the installer must have sufficient rights in the directory that BINDIR is set to. E. RUNNING THE SOFTWARE The X array is dimensioned to 1,500,000. This is large enough for a model having approximately 90,000 cells. MODFLOW uses preallocated files, which means that the files are not opened by Fortran OPEN statements. Instead, the compiler or operating system must provide a way to open the files. On the Data General's there is an easy way to deal with such files that are not explicitly opened in a Fortran program. First, unit 5 is by default "standard in" (the keyboard) and unit 6 is "standard out" (the screen). You can redirect these units to files using "<" and ">" on the command line. All other units are linked to files named "fort.n" where n is the unit number. For example, if you use unit 7, file "fort.7" will be opened automatically the first time you use that unit in a READ or WRITE statement. As with any file, if you read from one of these "fort.n" files, that file must already exist. There are two easy ways to create these files before running the Fortran program. One way is to use cp to make a copy of the file with the right name, but it means you have two copies of the same file. A better way is to use a symbolic link (example below), which makes what appears to be a new file, but it really creates only a dummy file that points to the original file. Thus, it doesn't waste time or disk space copying the contents of the file. You can delete symbolic links just like deleting a regular file. The original file is not deleted when you delete the link. If your program writes to one of the fort.n files, you can rename it when the program is done to whatever name you want. Here is an example shell program for running MODFLOW. First, it creates symbolic links for all the input files except unit 5. Unit 5 is used for reading the Basic Package data, but unit 5 is read from standard input. So unit 5 is redirected to the Basic input file via the command line that executes the model. Before running the model the old listing and head files are removed. Then the model is run, redirecting standard input and standard output. Finally, the output file to which heads are written is renamed using the "mv command"; output was written to unit 50 in this example. Then all the remaining fort.n files are removed. # ln -s sample.bcf fort.11 ln -s sample.wel fort.12 ln -s sample.drn fort.13 ln -s sample.rch fort.18 ln -s sample.sip fort.19 ln -s sample.oc fort.22 rm sample.list rm sample.hd modflow sample.list mv fort.50 sample.hd rm fort.?? There is no absolute need to delete the old listing and head files before running the model, but there is some advantage in doing this. If you don't delete the old file and if the model fails to run due to a data error, you might be fooled into thinking it ran because there would still be an old listing file from the previous run. The "rm fort.??" command deletes any file starting with "fort." and having exactly two more characters--i.e., all of the symbolic link files that remain. Shell programs are provided for executing the sample problems; the names of these shell programs are listed in the TESTING section below. 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 the scripts to run the tests. The directory "modflow2.6/data" contains the input data and expected results for each test. Tests must be run in the directory "modflow2.6/test". Run the tests using any of the commands in the table below. To test the installation, change to the modflow2.6/test directory and type the command: ./test.sh [m [n]] where: m = the number of the first test to perform, default=1 n = the number of the last test to perform, default=6 For example: command what happens ------------------ ------------------------------------ ./test.sh runs all of the tests ./test.sh n runs test 'n' through the last test ./test.sh n m runs test 'n' through 'm' After the tests are completed, the results are compared to the expected results. If all goes well, the only differences will be due to different processing times or pathnames. To clean up after the tests, type the command: ./clean.sh NOTE: the standard data sets were created on a Data General AViiON workstation. You may notice slight numeric differences in the results on other computers. These are generally due to different round-off algorithms and the different architecture of the central processing unit chip. 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 shell program to designate files ibs.sh 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 shell program to designate files str.sh 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 shell program to designate files twri.sh 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 shell program to designate files bcf2ss.sh 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.pcg2 i Output Control bcf2ss.oc i Listing of results bcf2ss.lst o 5 modflow Runs the first problem in OFR 94-59 shell program to designate files tlkp1.sh 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 shell program to designate files restest.sh 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! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *