June 11, 1997 MFI - Version: 2.3 1996/12/06 A Data Input Program for the U.S. Geological Survey Modular Finite-Difference Ground-Water Flow Model (MODFLOW) For assistance, enhancement requests, or bug reports contact the Hydrologic Analysis Software Support Team via e-mail sent to h2osoft@usgs.gov. See the file doc/mfi.txt for descriptions, references, and additional contacts for this software. Instructions for installation, execution, and testing are provided below. TABLE OF CONTENTS A. DISTRIBUTION FILES B. EXTRACTING FILES C. COMPILING D. INSTALLING E. SPREADSHEET INTERACTION F. RUNNING THE SOFTWARE G. TESTING A. DISTRIBUTION FILES The following distribution packages (containing the software, test data sets, and information files) are currently available for UNIX systems: mfi2.3.DGUX.tar.gz - Compiled for Data General AViiON under DG/UX 5.4 mfi2.3.source.tar.gz - Source code The program source code consists of the following files, located in the mfi2.3/src directory when extracted: mfi.f mfidmgmt.f mfimoc.f mfiriv.f mfiwel.f mfi.gbl mfidrn.f mfimp.f mfisolve.f spread.f mfibas.f mfievt.f mfioc.f mfistr.f system.f mfibcf.f mfighb.f mfirch.f mfiutl.f Makefile -- input instructions to the UNIX "make" utility for compiling MFI Included in directory mfi2.3/doc is a Portable Document Format (PDF) version of the MFI documentation (of94_468.pdf). A PostScript version of this report is available from: http://water.usgs.gov/software/mfi.html The PDF file is readable and printable on various computer platforms using Acrobat Reader from Adobe. The Acrobat Reader is freely available from the following World Wide Web sites: http://www.adobe.com/ http://www.shareware.com/ and by File Transfer Protocol (FTP) from the following site: ftp.adobe.com (path: /pub/adobe/acrobat) B. EXTRACTING FILES The compressed tar file, named mfi2.3.OS.tar.gz, contains all the files needed to install and test MFI 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 mfi2.3.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 whichever distribution, the directory mfi2.3 is created (or overwritten) when the files are extracted from the tar file. If the mfi2.3 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 mfi2.3.____.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 mfi2.3.____.tar.gz 4. Extract the distribution files from the tar file. For example: tar -xpof mfi2.3.___.tar This creates the following directory structure (the contents of each directory are shown to the right): mfi2.3 ; copy of this README file `-----bin ; compiled executables and scripts `-----bin_data ; data file required during execution `-----doc ; documentation files `-----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 mfi2.3.source.tar.gz distribution (it is created during compilation). b) Source code is included only with the mfi2.3.source.tar.gz distribution. c) It is recommended that no user files be kept in the mfi2.3 directory structure. If you do plan to put files in the mfi2.3 directory structure, do so only by creating subdirectories of mfi2.3. 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 mfi2.3.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; version 3.1 or higher of the software libraries distributed as lib3.1; 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 mfi2.3/src 2. Modify the beginning of the file named Makefile to correctly specify system-dependent variables: LIBDIR pathname for lib3.1 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_link] Note that the brackets ([]) above surround an optional argument to the make command. The INSTALLING instructions below explain the use of BINDIR. The make will: a. create the directories mfi2.3/bin, mfi2.3/bin_data, and BINDIR if they do not already exist, b. compile the source code, c. place the executable (mfi.exe) in mfi2.3/bin, d. build the screen message file (mfi.wdm) in mfi2.3/msg and place it in mfi2.3/bin_data, e. update the pathname in the mfi script in mfi2.3/bin, and f. place a link to the mfi script in BINDIR if specified. It may be necessary to modify the code when used on a system other than a USGS Data General AViiON workstation. As described in the MFI documentation, subroutines in the files system.f and spread.f are system dependent. Additional versions of these code groups (system4.f and spread2.f) are provided as examples for possible modifications. D. INSTALLING MFI is executed using a UNIX script (mfi) located in the mfi2.3/bin directory. This script has a hard-coded pathname that must be set to the installation directory before accessing the software. To make MFI easy to use, this script should be installed in a directory that is in the user's search path. The Makefile (input instructions to the UNIX make program-- located in mfi2.3/src) contains instructions to automatically update this pathname and to optionally place a link to the script in a specified directory. Use the following two commands to do this: cd mfi2.3/src make install [BINDIR=directory_for_link] If BINDIR is specified, a link to the script 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 script accessible from any directory without needing to type 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 MFI script file, the installer must have sufficient rights in the directory that BINDIR is set to. E. SPREADSHEET INTERACTION When a user indicates that an array should be modified, MFI makes use of a spreadsheet program to do the editing. The user must provide this spreadsheet program and set up MFI to use it. The pre-compiled Data General version will use the Tactician program. MFI could be easily modified to use a spreadsheet program that can read and write Lotus .WK1 files (See the source file spread2.f and the MFI documentation for more details). Any version of Lotus 123 can do this as well as many other spreadsheet packages. F. RUNNING THE SOFTWARE After MFI is properly installed (see INSTALLING, above), the following command is used to execute MFI: mfi [dataset] where dataset = The name of the dataset to be created/updated by mfi. It may consist of up to 8 characters and must represent a valid filename for the operating system used. If the dataset name is not entered as part of the command, then the first screen will prompt for it. Output filenames are generated as the dataset name followed by a dot and a 2- or 3- character suffix. The following suffixes define some of the files that can be part of an mfi dataset: dataset.nam - Names of all files that define the dataset dataset.log - File of information generated by mfi dataset.bas - Basic Package file of modflow(1) dataset.bcf - BCF Package file for modflow(1) dataset.mpn - Name file for modpath(1) dataset.mp - Main input file for modpath(1) If the file dataset.nam exists, it is read and the specified files are read and can be updated. G. 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 mfi2.3/test contains the scripts to run the tests. The directory mfi2.3/data contains the input data and expected results for each test. Tests are usually run in the directory mfi2.3/test, but they can be run in any user directory if the installation procedure was completed (make install performed). Run the tests using any of the commands in the table below. To test the installation, change to the mfi2.3/test directory and type the command: ./test.sh [m [n]] If running from another directory, specify the full path to the script; for example: /usr/opt/wrdapp/mfi2.3/test/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=2 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, where '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 and o for output. test program description of test and files file name & usage ---- ------- ------------------------------------- ----------------- 1 MFI Test problem 1 Response file for MFI AIDE screens mfitest1.aid i MODFLOW basic input mfitest1.bas o Block centered flow data mfitest1.bcf o Evapotranspiration mfitest1.evt o Preconditioned Conjugate-Gradient mfitest1.pcg o File names file mfitest1.nam o Recharge mfitest1.rch o Capture of MFI AIDE session mfitest1.scr o Script file to run MODFLOW mfitest1.sh o Screen output from MFI mfitest1.log o 2 MFI Test problem 2 Response file for MFI AIDE screens mfitest2.aid i MODFLOW basic input mfitest2.bas o Block centered flow data mfitest2.bcf o Preconditioned Conjugate-Gradient mfitest2.pcg o OC data mfitest2.oc o File names file mfitest2.nam o Capture of MFI AIDE session mfitest2.scr o Screen output from MFI mfitest2.log o * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Good Luck! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *