June 9, 1997 MODBRNCH - Version: 3.7 1997/06/05 MODFLOW/BRANCH Coupled Flow Model For assistance, enhancement requests, or bug reports contact the Hydrologic Analysis Software Support Team via email at h2osoft@usgs.gov. See the file doc/modbrnch.txt, doc/branch.txt, and doc/modflw96.txt for descriptions, references, and additional contacts for this software. Instructions for installation, execution, and testing are provided below. This version of MODBRNCH is packaged for use on personal computers using the DOS operating system. The installation procedures and the compiled version of MODBRNCH must be run using either DOS directly or a DOS window within Microsoft Windows, Windows 95, or Windows NT. TABLE OF CONTENTS A. DISTRIBUTION PACKAGES B. EXTRACTING FILES C. COMPILING D. INSTALLING E. RUNNING THE SOFTWARE F. TESTING A. DISTRIBUTION PACKAGES MODBRANCH is distributed as a package that contains the software (modbrnch), data sets, and information files. The software is available either uncompiled (source code), compiled only, or compiled plus source code. The following self-extracting DOS distribution files are currently available. modbr37.exe - Compiled using Lahey Fortran 90 with source code modbr37b.exe - Compiled using Lahey Fortran 90 (binaries only) modbr37s.exe - Source code only B. EXTRACTING FILES For whichever type of MODBRNCH distribution file that you have acquired, modbr37.exe, modbr37s.exe, or modbr37b.exe, the directory modbrnch.3_7 is created (or overwritten) when the files are extracted. If the modbrnch.3_7 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 MODBRNCH 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: modbr37 -d -o :\[directory] Substitute "modbr37s" or "modbr37b" for "modbr37" if you are installing the source-code-only or executable-code-only distributions, respectively. Note, be sure to include the -d (create directory structure) and -o (overwrite existing files) options and ":\" in the command. Examples are: modbr37 -d -o c:\ modbr37 -d -o c:\wrdapp The following directory structure will be created (the contents of each directory are shown to the right): modbrnch.3_7 ; copy of this readme file `-----bin ; compiled executables 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 bin directory is not included in the modbr37s.exe distribution file (it is created during compilation). b) The executable is not included with the modbr37s.exe distribution file. c) The source code is not included with the modbr37b.exe distribution file. d) It is recommended that no user files are kept in the modbrnch.3_7 directory structure. If you do plan to put files in the modbrnch.3_7 directory structure, do so only by creating subdirectories of modbrnch.3_7. e) Brackets "[xxx]" are used to indicate optional arguments to commands. C. COMPILING If a compiled version of the software is not available for your computer, or if you want to build the executables 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 modbr37.exe and modbr37s.exe distribution files so that users can generate the executables themselves. No support can be provided for users generating their own versions of the software. In general, the requirements are a Fortran compiler, utility library libutl6.0 (which includes screen prompting, device independent graphics, and Time-Dependent Data Base access routines), BRANCH software (branch4.3) MODFLOW-96 software (modflw96.3_1), GKS or CalComp graphics software, optionally Watershed Data Management library (lib3.1) and NetCDF software, 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 Lahey supplied make program. (See the USGS World Wide Web page at http://h2o.usgs.gov/software/ for information on most of these software packages.) The BRANCH program graphics are written using CalComp calls; the LIBUTL library includes routines to resolve some of these CalComp calls. Other CalComp calls (PLOTS, PLOT, NEWPEN, and FACTOR) must be provided by the user. The Lahey graph90 library contains these calls. The LIBUTL library also includes routines that translate CalComp calls to INTERACTOR calls. The makefile is coded to use the CalComp to INTERACTOR graphics library. If another CalComp library is available, BRANCH and the makefile could easily be modified to use it, rather than the default configuration. There are three options for data base support: TDDB, WDM, and (or) NetCDF. The TDDS data base routines are included in the libutl6.0 distributions. The WDM data base routines are included in the lib3.1 distributions. The model can produce NetCDF formatted files, but if this is desired, you will need the NetCDF libraries when compiling the software. An executable is provided that supports TDDB (branch) and WDM (branchwdm) data bases. Neither of these executables support NetCDF output. (See the USGS World Wide Web page at http://h2o.usgs.gov/software/ for information on TDDS and WDM.) To generate a new executable, do the following: 1. Change directory to the source directory: cd modbrnch.3_7\src 2. Modify the beginning of the file named Makefile to correctly specify system-dependent variables: BrnDir Top-level directory for BRANCH software ModDir Top-level directory for MODFLOW software UlibDir Top-level directory for LIBUTL soft PlotObjs Object file for including or not including graphics INTDIR Path to Interacter libraries (required for WDM version) GRAPHLIB Graphics libraries ANNDIR Top-level directory for WDM software NetDir Top-level directory for NetCDF libraries CDFLib Pathname of NetCDF library (optional) CDFObjs set to either cdfout.o or cdfoutdm.o 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 modbrnch.3_7\bin if it does not exist, b. compile the source code, c. place the executables (modbrnch.exe and modbrwdm.exe in modbrnch.3_7\bin, and d. place a copy of the executables in BINDIR if specified. D: INSTALLING To make the MODBRNCH programs accessible from any directory, the directory containing the executables 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:\modbrnch.3_7\bin Note, substitute the appropriate drive letter and pathname if not C:\ as shown above. As an alternative, the MODBRNCH executables can be installed in a directory already included in the PATH environment variable. The makefile (input instructions to the Lahey make program--located in modbrnch.3_7\src) contains instructions to optionally place a copy of the executables contained in modbrnch.3_7\bin in a specified directory. Use the following two commands to do this: cd modbrnch_source_directory make install BINDIR=directory_for_executable For example: cd C:\modbrnch.3_7\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 - 8 MB application RAM - 4 MB hard disk space MODBRNCH has been compiled using the Lahey Fortran 90 extended memory compiler version 3.00f. The file "LF90.EER" (from the Lahey compiler) located in modbrnch.3_7\bin contains error messages. If an error occurs, this file is used to print error messages if the modbrnch.3_7\bin directory is included in the PATH environment variable; if LF90.ERR cannot be found, the error will only be identified by number. The maximum X array size is 1,500,000 elements. This will run a problem of around 90,000 cells. 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 printed in the listing when MODFLOW runs. The allocated number of elements is the total number of elements used by all packages. After MODBRNCH is properly installed in a directory that is included in your PATH, the program is initiated using the command: modbrnch. The MODFLOW-96 component of MODBRNCH uses a Name File to indicate which files are used. MODFLOW-96 prompts the user to enter the name of the Name File, and then it automatically opens all the files specified in the 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. 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. Refer to the MODFLOW-96 documentation (USGS Open-File Report 96-485) for details about preparing the Name File. The file names related to MODBRNCH's BRANCH model component that were last used in the current directory are retained in a "master" file for subsequent use. MODBRNCH prompts for the file name of this master file and displays its contents if it exists. BRANCH input files may be pre-coded or portions of one file can be modified interactively during a MODBRNCH session. The BRANCH master file must be maintained in an order specific to the model. It may be manually edited only if the order of records and column positions within the file are retained. The model writes the master file after all files for a particular simulation have been designated. The following is an example master file: Input computation controls : ..\data\l31n.brn Output printed flow results : l31n.prt Input cross-sectional data : Input initial-condition data: Input TDDS station reference: Input/Output TDDS data base : Output initial conditions : Output for TRKPLOT input : Output digital plots : Output instantaneous volumes: Output cumulative volumes : Output instantaneous flows : Output map-formatted flows : Output flows for BLTM input : Output user-table results : l31n.pst 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 modbrnch.3_7\test contains batch files to run the tests. The directory modbrnch.3_7\data contains the input data and expected results for each test. Run the tests in the modbrnch.3_7\test directory using the command: test After the tests are completed, the results can be compared to the expected results. If all has gone well, the only differences will be due to different processing times or pathnames. 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 modbrnch L31 canal south of Tamiami, 60 hour simulation. Aquifer is 1160 X 10560 feet name file to designate files l31n.nam i BAS1 Package l31n.bas i BCF2 Package l31n.bcf i SIP1 Package l31n.sip i Output Control l31n.oc i IBS1 Package l31n.ibn i CHD1 Package l31n.chd i aquifer heads l31n.hed i MODFLOW printed output l31n.lst o MODFLOW head output l31n.hbn o BRANCH program-control file l31n.brn i BRANCH master file of file names l31n.mtr i BRANCH user response file BRANCH.LOG o BRANCH master file of file names BRANCH.MTR o BRANCH printed output l31n.prt o MODFLOW user-table results l31n.pst o * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Good Luck! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *