Instructions for Rebuilding and Testing HSPF 12.5 - respec/FORTRAN GitHub Wiki
The following instructions have been prepared to assist in compiling and testing HSPF. These instructions assume that the user has installed Lahey Fortran90 Version 4.50i and version 4.0 or later of BASINS. The instructions include specific details for obtaining the HSPF code and test runs, rebuilding the HSPF Message WDM, setting the version number for the DLL, recompiling the HSPF library, rebuilding the DLL, and running the HSPF test runs.
To obtain the HSPF code and test runs:
- The code is available at https://github.com/respec/FORTRAN. The folders contain the following: lib3.0 the fortran and sequential files for building HSPF f90apps the fortran code for converting the HSPF library into a DLL test a folder containing the 16 test runs
To rebuild the HSPF Message WDM:
If you have modified any of the HSPF sequential files in C:\FORTRAN\lib3.0\msg\hspf125, you will need to re-import the modified file into the HSPF Message WDM (hspfmsg.wdm).
- open a command (dos) prompt
- change directory to C:\FORTRAN\lib3.0\bin
- type 'wdimex'
- at the prompt specify the name of the HSPF Message WDM (hspfmsg.wdm) including the full path if this file is not kept in this folder. The default location for hspfmsg.wdm when BASINS is installed is \BASINS\bin\Plugins\BASINS.
- at the prompt type 'i' for import
- specify the name of the modified sequential file to import, such as C:\FORTRAN\lib3.0\msg\hspf125\perlnd.seq when prompted
- at the prompt type 'o' for overwrite
To recompile the HSPF dynamic wave f95 code:
The HSPF125 library consists of the base FORTRAN code that makes up this and earlier versions of HSPF, along with FORTRAN 95 code that was ported from SWMM for the HSPF dynamic wave routing option added in HSPF version 12.4.
If this is the first time you are compiling the HSPF library on this computer, or if the .f95 code has changed, do the following:
- open a command (dos) prompt
- change directory to C:\FORTRAN\lib3.0\src\hspf125
- type 'compile_f95'
- an output file from the compile will be written to C:\FORTRAN\lib3.0\src\hspf125\compile_f95.out. Open this file with a text editor and check for compiling errors. Note that you may see linking errors; these are not a problem because they will be resolved in subsequent steps.
To set the version number for the DLL:
- open a command (dos) prompt
- change directory to C:\FORTRAN\f90apps\hasslibs\res
- modify the file hass_ent.rc in a text editor, taking care to update the version number in all four places
- type 'rc hass_ent.rc' -- this will create the resource file hass_ent.res, which will be referenced when the DLL is rebuilt
To rebuild the DLL (which includes compiling HSPF):
- from the folder C:\FORTRAN\f90apps\hasslibs, double click on the file named HassEnt125.bat.
- the new DLL will appear in C:\FORTRAN\f90apps\hasslibs\bin
- an output file from the compile will be written to C:\FORTRAN\f90apps\hasslibs\HassEnt.lis. Open this file with a text editor and check for compiling errors.
- copy the DLL to the windows system folder for use with BASINS and/or WinHSPF (or WinHSPFLt (generally c:\windows\system or c:\winnt\system32)
To run the HSPF test runs:
- A series of test runs has been provided in C:\FORTRAN\test\hspf\standard\Current. Run each of the 16 UCIs (test01.uci through test16.uci) by running WinHSPFLt from the desktop and specifying the UCI file name, or by dragging the UCI file onto the WinHSPFLt icon.
- After running all of the test runs, compare the contents of the C:\FORTRAN\test\hspf\standard\Current folder with the contents of C:\FORTRAN\test\hspf\standard\Base. Each file in the test folder should match each corresponding file in the base output folder.