June 5, 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. TABLE OF CONTENTS A. DISTRIBUTION PACKAGES B. EXTRACTING FILES C. COMPILING D. INSTALLING E. RUNNING THE SOFTWARE F. TESTING A. DISTRIBUTION PACKAGES MODBRNCH distributed as a package that contains the MODBRNCH software, data sets, and information files. The program is available either uncompiled (source code), or compiled for one of three operating systems (contains the executable files, but not the source code). Instructions for extracting the files contained in the distribution packages (compressed tar files) are presented in Section B. The following distribution packages are currently available for UNIX systems: modbrnch.3_7.DGUX.tar.gz - Compiled for Data General AViiON under DG/UX 5.4 modbrnch.3_7.Solaris.tar.gz - Compiled for Sun UltraSPARC 2 under Solaris 2.5 modbrnch.3_7.source.tar.gz - Source code B. EXTRACTING FILES The compressed tar file, named modbrnch.3_7.OS.tar.gz, contains all the files needed to install and test MODBRNCH on a computer with a particular operating system, where OS is a string indicating the operating system for which the distribution is intended. If a version is not available for your operating system, the file modbrnch.3_7.source.tar.gz contains the source code and the files needed to compile, install, and test the software on a UNIX-based computer. Note, you will also need the MODFLOW, BRANCH, and LIBUTL source- code distribution packages to recompile. For either type of distribution, the directory modbrnch.3_7 is created (or overwritten) when the files are extracted from the tar file. 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 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 modbrnch.3_7.____.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 modbrnch.3_7.____.tar.gz 4. Extract the distribution files from the tar file. For example: tar -xpof modbrnch.3_7.___.tar This creates the following directory structure (the contents of each directory are shown to the right): modbrnch.3_7 ; copy of this README file `-----bin ; compiled executables `-----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 modbrnch.3_7.source.tar.gz distribution (it is created during compilation). b) Source code is included only with the modbrnch.3_7.source.tar.gz distribution. c) It is recommended that no user files be 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. 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. Note: to build MODBRNCH you must also have the libutl6.0, branch4.2, and modflw96.3_0 distributions. (See the USGS World Wide Web page at http://h2o.usgs.gov/software/ for information on these software packages.) The source code is provided in the modbrnch.3_7.source.tar.gz distribution 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-- prompting, device independent graphics, and Time-Dependent Data Base access routines), MODFLOW software, 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 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. The BRANCH program graphics are written using CalComp calls. The LIBUTL library includes routines that translate CalComp calls to GKS calls. If a CalComp library is available, BRANCH could easily be modified to use it, rather than the GKS library. There are three options for data base support for the BRANCH model component of this distribution: 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 (modbrnch) and WDM (modbrwdm) 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 new executables, 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: LibDir Top-level directory for LIBUTL, BRANCH, and MODFLOW software BrnDir Top-level directory for BRANCH software ModDir Top-level directory for MODFLOW software UlibDir Top-level directory for LIBUTL software CalLIB Pathname of CalComp graphics library AnnLib Pathname of directory containing WDM libraries PlotObjs Graphics routine to use with BRANCH GraphLib Graphics libraries NetDir Pathname of directory containing NetCDF software CDFLib Pathname of NetCDF library (optional) CDFObjs Set to either cdfout.o or cdfoutdm.o F77 Fortran compiler name FFLAGS Fortran compiler flags You may also selectively determine the types of executables generated. See the Makefile for details. 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 modbrnch.3_7/bin and BINDIR if they do not already exist, b. compile the source code, c. place the executables (modbrnch, modbrnchwdm) in modbrnch.3_7/bin, and d. place links to the executables in BINDIR if specified. D. INSTALLING To make the executables (modbrnch and modbrnchwdm) easy to use, they should be installed in a directory included in the user's search path. The Makefile (input instructions to the UNIX make program--located in modbrnch.3_7/src) contains instructions to optionally place links in a specified directory to the executables contained in modbrnch.3_7/bin. Use the following two commands to do this: cd modbrnch.3_7/src make install [BINDIR=directory_for_links] If BINDIR is specified, links to the executables are 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 executables 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 links to the MODBRNCH executable files, the installer must have sufficient rights in the directory that BINDIR is set to. E. RUNNING THE SOFTWARE 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 NOTE: Versions of the software other than Data General have been linked to XGKS (a public domain Graphical Kernel System (GKS) software library--XGKS (C) Copyright 1993 UCAR/Unidata) to resolve graphics calls. XGKS is maintained at unidata.ucar.edu. Fonts used by XGKS are dynamically loaded when first referenced. Thus, the fonts must be installed on the machine where the XGKS application executes. The font path is compiled into the XGKS library and is set to /usr/local/unidata/lib/xgksfonts. However, it is possible to have XGKS fonts installed in a different location and still execute the software without having to recompile. To do this set the environment variable "XGKSFontDir" to the new path before executing this application. This variable setting will tell XGKS at runtime where to find its fonts. For example (using C shell syntax): setenv XGKSFontDir /usr/xgks-2.5.5/lib/xgksfonts F. TESTING A test data set is provided to verify that the program is correctly installed and running on the system. The test may also be looked at as an example of how to use the program. The directory modbrnch.3_7/test contains the scripts to run the test. The directory modbrnch.3_7/data contains the input data and expected results for the test. The test must be run in the directory modbrnch.3_7/test. To test the installation, change to the modbrnch.3_7/test directory and type the command: ./test.sh After the test is 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 test, 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 test is 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 BRANCH user-table results l31n.pst o * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Good Luck! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *