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. This version of CGAP is packaged for use on personal computers using the DOS operating system. The installation procedures and the compiled version of CGAP 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 CGAP is distributed as a package that contains the software (cgap and genftbl), 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. cgap3_5.exe - Compiled using Lahey Fortran 90 with source code cgap3_5b.exe - Compiled using Lahey Fortran 90 (binaries only) cgap3_5s.exe - Source code only B. EXTRACTING FILES For whichever CGAP distribution file that you have acquired, cgap3_5.exe, cgap3_5b.exe, or cgap3_5s.exe, the directory cgap3.5 is created (or overwritten) when the files are extracted. 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 file. Note, replace with the drive letter where you want to install CGAP 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: cd c:\wrdapp 2. Extract the files using the command: cgap3_5 -d -o :\[directory] Substitute "cgap3_5b" or "cgap3_5s" for "cgap3_5" if you are installing the executable-code-only or source-code-only distributions, respectively. Note, be sure to include the -d (restore directory structure) and -o (overwrite existing files) options and ":\" in the command. Examples are: cgap3_5 -d -o c:\ cgap3_5 -d -o c:\wrdapp The following directory structure will be created (the contents of each directory are shown to the right): cgap3.5 ; 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 cgap3_5s.exe distribution file (it is created during compilation). b) The executable is not included in the cgap3_5s.exe distribution file. c) The source code is not included in the cgap3_5b.exe distribution file. d) It is recommended that no user files are 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. e) Brackets "[xxx]" are used to indicate optional arguments to commands. C. COMPILING The source code is provided in the cgap3_5.exe and cgap3_5s.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 and device independent graphics routines), partial CalComp graphics 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. The CGAP 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, CGAP and the makefile could easily be modified to use it, rather than the default configuration. 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: GRAPHLIB Graphics libraries LibDir Top-level directory for LIBUTL software 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 cgap3.5\bin if it does not already exist, b. compile the source code, c. place the executables (cgap.exe and genftbl.exe) in cgap3.5\bin, and d. place a copy of the executable in BINDIR if specified. D: INSTALLING To make the CGAP program 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:\cgap3.5\bin Note, substitute the appropriate drive letter and pathname if not C:\ as shown above. As an alternative, the CGAP executable can be installed in a directory already included in the PATH environment variable. The makefile (input instructions to the Lahey make program--located in cgap3.5\src) contains instructions to optionally place a copy of the executable contained in cgap3.5\bin in the specified directory. Use the following two commands to do this: cd cgap_source_directory make install BINDIR=directory_for_executable For example: cd C:\cgap3.5\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 - 2 MB application RAM - 2 MB hard disk space CGAP has been compiled using the Lahey Fortran 90 extended memory compiler version 3.00f. The file "LF90.EER" (from the Lahey compiler) located in cgap3.5\bin contains error messages. If an error occurs, this file is used to print error messages if the cgap3.5\bin directory is included in the PATH environment variable; if LF90.ERR cannot be found, the error will only be identified by number. 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. 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 batch files to run the tests. The directory cgap3.5\data contains the input data and expected results for each test. Run the tests in the cgap3.5\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 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 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 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 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 printer output file cgap4.prt o tabular output for option 16 cgap4.sbd o tabular output for option 9 cgap4.sft o * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Good Luck! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *