README March 1, 1996 HSPEXP Expert System for Calibration of HSPF HSPEXP - Version 2.3 1996/03/01 hspexp2.3.DGUX.tar.gz - Distribution prepared on a Data General AViiON under DG/UX 5.4 hspexp2.3.source.tar.gz - Distribution that includes the source code but no compiled software. TABLE OF CONTENTS A. DESCRIPTION B. DOCUMENTATION C. EXTRACTING FILES D COMPILING E. INSTALLING F. RUNNING THE PROGRAM G. TESTING H. CONTACTS A. DESCRIPTION Interactively allows the user to edit the input uci file for the Hydrologic Simulation Program--Fortran (HSPF), simulate with HSPF, produce plots of HSPF output compared to observed values, compute error statistics for a simulation, and provide the user with expert advice on which parameters should be changed up or down to improve the calibration. In general, the user will spend time repeating the cycle of simulate, compute statistics, see plots, get advice, and edit the parameters. The expert system uses over 35 rules involving over 80 conditions to recommend parameter adjustments. The rules are divided into four phases--annual volumes, low flows, storm flows, and seasonal flows. Rules in subsequent phases are not tested until all rules in the previous phase pass. The rules are based on the experience of experts in the use of HSPF in a wide range of climates and physiographic regions. B. DOCUMENTATION Lumb, A.M., McCammon, R.B, and Kittle, J.L., Jr., 1994, Users manual for an expert system (HSPEXP) for calibration of the hyrdological simulation program--Fortran: U.S. Geological Survey Water-Resources Investigations Report 94-4168, 102 p. A postscript version of this report is available in the hspexp2.3/doc directory. See the file hspexp.ps. Bicknell, B.R., Imhoff, J.C., Kittle, J.L., Jr., Donigian, A.S., and Johanson, R.C., 1993, Hydrological Simulation Program--Fortran, Users Manual for Release 10: EPA-600/R-93/144, Environmental Research Laboratory, Athens, Ga., 660 p. C. EXTRACTING FILES Compressed tar files are used to distribute pre-compiled versions of the software and the source code. All of the files needed to install hspexp2.3 are contained in the files hspexp2.3.______.tar.gz (where ______ is a string indicating the file contains either the source code or a pre-compiled version of the program for the indicated operating system). The source version of the tar file contains the source code and all other files needed to compile and install the software on a UNIX-based computer. For either type of distribution, the directory hspexp2.3 will be created (or overwritten) when the files are extracted from the tar tape. If the hspexp2.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. Steps in extracting files explanation ---------------------------------------- ----------------------------------- mv hspexp2.3.____.tar.gz /usr/opt/wrdapp If the tar file is not already in the directory where you want the distribution installed, move it there. cd /usr/opt/wrdapp If you are not in the directory where the tar file is located, go there. gunzip hspexp2.3.____.tar.gz Uncompress the distribution file. tar -xof hspexp2.3.____.tar Extract the distribution files from the tar file. This creates the following directory structure (the contents of each directory are shown to the right): hspexp2.3 copy of this README file `-----bin compiled executable `-----bin_data message file required during execution `-----doc documentation files (see file Contents) `-----src Makefile (and, with source tar, the source code) `-----msg (with source tar, script & file to build message file) `-----test scripts to run verification tests `-----data standard data sets used in verification tests `--huntday files specific to daily time step test `--hunthour files specific to hourly time step test Notes: a) The bin and bin_data subdirectories are not included in the hspexp2.3.source.tar.gz distribution; they are created during compilation. b) Source code is included only with the hspexp2.3.source.tar.gz distribution. c) It is recommended that no user files be kept in the hspexp2.3 directory structure. If you plan to put files in the hspexp2.3 directory structure, do so only by creating subdirectories under hspexp2.3. d) The software is configured for installation under the directory /usr/opt/wrdapp. The wrdapp directory may be a separate file system mounted at /usr/opt/wrdapp. If you choose to install the software elsewhere, you will need to retrieve the source version of the tar file and compile the software. e) To compile a new version of the software, you will also need: (1) libraries and other data files from the lib3.0 library (lib3.0.______.tar.gz), (2) ANSI-compliant Fortran 77 compiler, and (3) a Graphical Kernel System (GKS) library. D. COMPILING If you have retrieved a pre-compiled distribution of the software, skip to the Installing section below. 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. The source code is provided in the hspexp2.3.source.tar.gz distribution so that users can generate the executable themselves. Little or no support can be provided for users generating their own versions of the software. In general, the requirements are ANSI-compliant Fortran 77 and a minimum level of knowledge of the compiler and the UNIX operating system. A Graphical Kernel System (GKS) library is required. Libraries and data files from the lib3.0 distribution are also required. As provided, the make file, source code, and text version of the message file are set up for use on Data General AViiON workstations running the DG/UX operating system. To generate a new executable and message file, do the following: 1. The values for the indicated variables in the following hspexp2.3 files may need to be modified (see the file hspexp2.3/doc/versions.doc for more details): may need to be modified ------------------------------- version compiler file name variables flags name library --------------------- --------- ----------- ------- src/Makefile WrdA FFLAGS F77 LGks fhsxms.inc WDNAME msg/wdimex.sh WrdA test/test.sh WrdA 2. Run the Makefile program in the src directory to compile the source and build the message file. In the directory hspexp2.3/src, run the make: cd hspexp2.3/src make The hspexp2.3/src/Makefile will: a. Create the directories hspexp2.3/bin and hspexp2.3/bin_data if they do not already exist. b. Compile the source code and place the hspexp executable in the directory hspexp2.3/bin. c. Run the wdimex.sh script in hspexp2.3/msg to build the message file (hspexp.wdm); the file is placed in hspexp2.3/bin_data. E. INSTALLING To make the hspexp program easy to use, it should be installed in a directory included in the user's search path. The Makefile in hspexp2.3/src contains instructions to optionally place a link in a specified directory to the executable contained in hspexp2.3/bin. Use the following commands to do this: cd hspexp2.3/src make install [BINDIR=bin_path] where bin_path is the name of a directory in the user's search path. If BINDIR is specified, a link to the executable (hspexp2.3/bin/hspexp) is placed in the specified directory. If BINDIR is not specified, no link is set and the full pathname of the executable is required to run the program. For example, if the search path is /usr/bin:/usr/opt/bin:/usr/local/bin, you can use the following command to install the program: make install BINDIR=/usr/local/bin Notes: a) Brackets "[xxx]" are used to indicate optional arguments to commands. b) To create and delete links to the hspexp executable, the installer must have sufficient rights to the BINDIR directory. F. RUNNING THE PROGRAM After the hspexp executable is properly installed (see Installing, above) in a directory that is included in the user's PATH, the program can be executed with the command "hspexp". 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 hspexp2.3/test contains the script to run the tests. The directory hspexp2.3/data contains the input data and the expected results for each test. Tests are usually run in the hspexp2.3/test directory, but they can be run in any user directory. Type the following commands to test the program installation: [path]/test.sh [start [stop]] where: path = path to the script use "." if running the tests in the hspexp2.3/test directory use full pathname if not running the test in hspexp2.3/test start = the number of the first test to perform, default = 1 stop = the number of the last test to perform, default = 2 For example: command what happens -------------------------------------- -------------------------------- ./test.sh runs all of the tests ./test.sh 1 1 runs the first test ./test.sh 2 runs test 2 /usr/opt/wrdapp/hspexp2.3/test/test.sh runs all of the tests After the tests are completed, the results are compared to the expected results (found in hspexp2.3/data). See the file check.out; if all goes well, the only differences will be due to different processing times. To clean up after the tests, type the command: ./clean.sh Notes: a) Tests 1 and 2 require that either the annie2.2 program be installed so that the wdm data files can be built, or that the required wdm files exist in the hspexp2.3/data/hunthour and hspexp2.3/data/huntday directories and can be copied into the local directory. b) 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, m for modify, and o for output. test program description of test and files file name(s) & usage ---- ------- --------------------------------- -------------------------- 1.a annie build daily wdm file (if data/huntday/hunting.wdm exists, it will be used) annie command file test0.log i annie archive file huntday/hunting.exp i hunting daily wdm file hunting.wdm o 1.b hspexp daily simulation hspexp command file test1.log i hunting daily wdm file hunting.wdm m hspf uci file [hunting/test1].uci m hspexp file [hunting/test1].exs m hspexp plot options [hunting/test1].plt m echo of input uci [hunting/test1].ech o simulation results [hunting/test1].out o calibration advice test1.ot1 o statistics test1.ot2 o 2.a annie build daily wdm file (if data/huntday/hunting.wdm exists, it will be used) annie command file test0.log i annie archive file hunthour/hunting.exp i hunting hourly wdm file hunting.wdm o 2.b hspexp hourly simulation hspexp command file test2.log i hunting hourly wdm file hunting.wdm m hspf uci file [hunting/test2].uci m hspexp file [hunting/test2].exs m hspexp plot options [hunting/test2].plt m echo of input uci [hunting/test2].ech o simulation results [hunting/test2].out o calibration advice test2.ot1 o statistics test2.ot2 o H. CONTACTS Inquiries about this software distribution should be directed to: U.S. Geological Survey Hydrologic Analysis Software Support Team Kathleen M. Flynn e-mail: h2osoft@usgs.gov 437 National Center phone: 703-648-5313 Reston, VA 22092 fax: 703-648-5722