June 3, 1997 CGAP - Version: 3.5 1995/10/06 GENFTBL - Version: 3.1 1995/05/26 Channel Geometry Analysis Program For assistance, enhancement requests, or bug reports contact the Hydrologic Analysis Software Support Team via email at h2osoft@usgs.gov. See the file doc/cgap.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: cgap3.5.DGUX.tar.gz - Compiled for Data General AViiON under DG/UX 5.4 cgap3.5.Solaris.tar.gz - Compiled for Sun UltraSPARC 2 under Solaris 2.5 cgap3.5.source.tar.gz - Source code B. EXTRACTING FILES The compressed tar file, named cgap3.5.OS.tar.gz, contains all the files needed to install and test CGAP 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 cgap3.5.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 cgap3.5 is created (or overwritten) when the files are extracted from the tar file. If the cgap3.5 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 cgap3.5.____.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 cgap3.5.____.tar.gz 4. Extract the distribution files from the tar file. For example: tar -xpof cgap3.5.___.tar This creates the following directory structure (the contents of each directory are shown to the right): cgap3.5 ; copy of this README file `-----bin ; compiled executables `-----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 cgap3.5.source.tar.gz distribution (it is created during compilation). b) Source code is included only with the cgap3.5.source.tar.gz distribution. c) It is recommended that no user files be kept in the cgap3.5 directory structure. If you do plan to put files in the cgap3.5 directory structure, do so only by creating subdirectories of cgap3.5. 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 cgap3.5.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 (which includes screen prompting and device independent graphics routines), GKS or CalComp graphics 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 CGAP 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, CGAP could easily be modified to use it, rather than the GKS library. To generate new executables, do the following: 1. Change directory to the source directory: cd cgap3.5/src 2. Modify the beginning of the file named Makefile to correctly specify system-dependent variables: LibDir Top-level directory for LIBUTL software GraphLib Graphics libraries 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] NOTE: the Installing instructions below for an explanation of BINDIR. The make will: a. create the directories cgap3.5/bin and BINDIR if they do not already exist, b. compile the source code, c. place the executables (cgap and genftbl) in cgap3.5/bin, and d. place links to the executables in BINDIR if specified. D. INSTALLING To make the executables (cgap and genftbl) 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 cgap3.5/src) contains instructions to optionally place links in a specified directory to the executables contained in cgap3.5/bin. Use the following two commands to do this: cd cgap3.5/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 CGAP executable files, the installer must have sufficient rights in the directory that BINDIR is set to. E. RUNNING THE SOFTWARE After CGAP is properly installed in a directory that is included in your PATH, the program is initiated using the command: cgap. CGAP is an interactive prompting program. The files that were last used with CGAP in the current directory are retained in a "master" file for subsequent use. Input files may be pre-coded, created interactively, or modified interactively during a CGAP session. 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 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 cgap3.5/test contains the scripts to run the tests. The directory cgap3.5/data contains the input data and expected results for each test. Tests must be run in the directory cgap3.5/test. Run the tests using any of the commands in the table below. To test the installation, change to the cgap3.5/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=4 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 cgap Three-mile slough, Rio Vista, two cross sections. Example 1 on page 43 of WRIR, shows all input in single file, output for options 1, 11, 4, 14, 10, 5, 6, and 16 (figs. 4-9, 12, 13, 15, and 16 in CGAP WRIR 85-4335). program-control file cgap1.ctl i cgap responses file ctst1.go i cgap queries file cgap1.log o printer output file cgap1.prt o subdivision output file cgap1.sbd o postscript file of graphics cgap1.plt o tabular output for option 6 cgap1.pun o 2 cgap Sacramento River, eight input cross sections. Example 2 on page 44 of WRIR, shows separation of input into two files and performs options 7 and 15 (figs. 10 and 11 of CGAP WRIR 85-4335). program-control file cgap2.ctl i PCSCD file cgap2.pcs i cgap responses file go i cgap queries file cgap2.log o printer output file cgap2.prt o postscript file of graphics cgap2.plt o 3 cgap Ohio River at Greenup, Ky., four cross sections. Example 3 on page 45 of WRIR, shows input of E431 formatted data and performs option 6 with PARAMETER alterations (fig. 14 of CGAP WRIR 85-4335). program-control file cgap3.ctl i cgap responses file go i cgap queries file cgap3.log o printer output file cgap3.prt o tabular output for option 6 cgap3.pun o 4 cgap Truckee River with four cross sections. Runs option 9 and 16. Option 16 is run to produce results for use with genftbl program. This test shows use of variable roughness to compute conveyances in subdivisions of each cross section. program-control file cgap4.ctl i cgap responses file go i cgap queries file cgap4.log o printer output file cgap4.prt o tabular output for option 16 cgap4.sbd o tabular output for option 9 cgap4.sft o * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Good Luck! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *