Tutorial 3: Applying the ArcGIS HSPF
Preprocessing Methodology
Prepared by: Nate Johnson
Summer 2005
Center for Research in Water Resources
3. Computer and Data
Requirements
4.1. Renumbering Basins and
Streams
4.3. Define Land Segments to
be Simulated with HSPF
4.4. Write intermediate text
files to transfer data to WinHSPF
4.5. Create a new HSPF model
using WinHSPF
2. Purpose and Overview
The purpose of this exercise is to demonstrate how to use ArcGIS data and tools to create a new HSPF model in the ArcGIS environment. This tutorial is based on work from the author’s Masters Thesis, the entirety of which can be found here: ArcGIS and HSPF Model Development.
The ArcGIS HSPF Preprocessing methodology uses as many existing tools as possible to bridge the gap between ArcGIS and HSPF. The methodology avoids the necessity of additional terrain processing tools by assuming that existing Arc Hydro, BASINS, or other terrain processing tools have been used to produce “Catchment” and “DrainageLine” feature classes.
Once information has been extracted from GIS data, the WinHSPF program is used to finish building a new HSPF model. WinHSPF is a non-proprietary component of the BASINS system that runs independently of any GIS environment and is widely used for developing and calibration HSPF models.
Beginning with two feature classes describing Catchments and DrainageLines, landuse data, and terrain data, four main tasks will be accomplished:
(i) Calculate physical attributes (slopes) necessary for HSPF model creation
(ii) Define Land Segments to be simulated with HSPF
(iii) Write intermediate text files to transfer data from GIS to WinHSPF
(iv) Create a new HSPF model using WinHSPF and the intermediate text files
Each of these tasks will be described in detail below.
3. Computer and Data Requirements
To carry out this exercise, you need to have a
computer with ArcGIS 9.x software and liscence and the Spatial Analyst
extension. This tutorial uses custom
ArcGIS tools from the ArcGIS HSPF Preprocessing system developed at the Center
for Research and Water Resources. These
tools are a combination of standard and custom Geoprocessing tools, intended to
be applied within the ArcCatalog environmnet.
If the ArcGIS HSPF Preprocessing tools are not installed on your
computer they can be obtained from here: ArcGIS HSPF
Preprocessing tools. Tutorial 1 provides instructions on how to install the tools and
a description of the toolboxes. The
ArcGIS HSPF Preprocessing tools consist of two toolboxes:
(i) “crwrHSPFTools” contains custom Geoprocessing tools to
aid in HSPF model development and
(ii) “crwrArcHydro2HSPFModels” contains ModelBuilder models
which link Geoprocessing tools together.

The ModelBuilder models (in the crwrArcHydro2HSPFModels Toolbox) contain a combination of standard ESRI Geoprocessing tools and custom Geoprocessing tools (from the crwrHSPFTools Toolbox). Though this tutorial uses ArcGIS ModelBuilder models to link Geoprocessing tools together, the ArcGIS HSPF Preprocessing methodology can be equivalently implemented by performing each Geoprocessing tool independently, in sequence.
In addition to ArcGIS tools, the final part of creating a new HSPF model uses tools from the WinHSPF/GenScn program. This program is a non-proprietary (and non-GIS) component of the BASINS system, and can be downloaded free of charge from the BASINS website. http://www.epa.gov/waterscience/basins/ or from http://hspf.com/pub/GenScn/. (See Tutorial 1)
This tutorial can be applied to create a new HSPF
model using either:
(i) Sample data distributed with the ArcGIS HSPF
Preprocessing tools. (See Tutorial
2: Preparing a Geodatabase for HSPF Model Development) or
(ii) Data from another source, i.e. from the application of
ArcHydro or BASINS terrain processing tools.
Required GIS data for the development of HSPF models
with the ArcGIS HSPF Preprocessing methodology include:
(i) Arc Hydro DrainageLine and Catchment shapefiles or
feature classes
(ii) Polygon (or raster) Landuse data
(iii) Digital Elevation Model
(iv) Slope Raster (can be calculated from DEM)
Sample polygon data can be found in the ‘\ArcHydro2HSPF \tutorial\LoadData’ directory. Sample raster data including DEM, slope, and landuse data can be found in the ‘\ArcHydro2HSPF \tutorial\raster’ directory.

Catchment data must have an attribute containing a
unique identifier for each feature (HydroID) and another attribute specifying
the downstream catchment (NextDownID).
DrainageLine data must have a attribute (DrainID) specifying which
Catchment the DrainageLine belongs to.
There must be a one-to-one (and only one) relationship between
DrainageLines and Catchments.


DEM data should have vertical units that are the same
as the linear projection unit of the datasets, and the Slope raster should be
in % rise (ft/ft * 100).


In addition to the GIS data listed above, two tables
of landuse-related information are also required:
(i) LuseDefinition – defines the types of landuse to be
simulated with HSPF
(ii) LuseHSPFClass – defines the impervious area for each
landuse type and the Operation Numbering convention to be adopted when WinHSPF
builds a new .uci file
Templates for these tables are distributed in the ‘\bin’ folder with the ArcGIS HSPF Preprocessing tools, however, these tables should be modified to meet the needs of any real HSPF modeling application.


While the tools of the ArcGIS HSPF Preprocessing methodology are general enough to work with data stored in a different format (e.g. different feature class / attribute names), using a well-structured database is a convenient way to organize data and works best with the tools. Using the geodatabase design distributed with the ArcGIS HSPF Preprocessing system is recommended.
This tutorial presents a methodology for applying the ArcGIS HSPF Preprocessing tools using ModelBuilder models in order to create a new HSPF model. The tasks accomplished by the ModelBuilder models can be equivalently implemented by applying each ArcGIS Geoprocessing tool used by the models in order. The ModelBuilder environment is not an extremely robust system, and if problems are encountered repeatedly, applying individual Geoprocessing tools may provide a better alternative.
***This tutorial assumes that you have already created a
geodatabase and loaded into it landuse, catchment, and DrainageLine data
as well as tables describing landuse types (See Tutorial
2: Preparing a Geodatabase for HSPF Model Development)***
4.1. Renumbering Basins and Streams
Before calculating physically-based parameters for HSPF model development (e.g. slopes), a tool is included in the ArcGIS HSPF Preprocessing tools to renumber GIS features in a way more consistent with the BASINS Preprocessing methodology. A custom tool was developed to populate the “Subbasin” and “Subbasinr” BASINS attributes of DrainageLine and Catchment. The same network information is stored in the Arc Hydro attributes “HydroID” and “NextDownID,” but its format is slightly different. Downstream information is stored on the River Segment features in the BASINS attributes and on the Catchment features in the Arc Hydro attributes.
Transferring network information from the Arc Hydro convention to the BASINS convention ensures that the HSPF River Segments will be numbered from 1 to N, and makes the process more consistent with the ArcView 3.x BASINS system.
A tool called “

(1) Double-click on the tool to open the interface to the Geoprocessing tool.

The Catchment and DrainageLine feature classes are required as inputs. These can be chosen either by dragging the feature class (from Arc Catalog) into the tool interface, or by browsing to the feature class.
(2) Choose the Catchment and DrainageLine feature classes,
Additional input variables are available to specify field names if they are different from the standard Arc Hydro and BASINS attributes.
(3) Click on the “Arc Hydro Attributes” and “BASINS Attributes” links to see the additional input fields
These fields will default to the Arc Hydro and BASINS variables after the Catchment and DrainageLine feature classes have been specified. If the data you are using has different attribute names, choose these names from the drop down list.
(4) Click OK after all parameters have been specified.
The tool will update the ‘Subbasin’ and ‘Subbasinr’ fields in the Catchment and DrainageLine feature classes and should not take very long to run.
Note: Common problems are the presence of two most-downstream catchments, and not having the network information properly stored in the HydroID and NextDownID attributes to begin with. The tool does not support loops in the network, and assumes that the NextDownID of the single most downstream catchment is a negative number.
(5) Browse to the Catchment and DrainageLine feature classes and make sure the Subbasin and Subbasinr attributes have been populated correctly.
Standard ArcGIS tools are available in ArcToolbox to calculate the land surface slope and river slope. A ModelBuilder Model has been created which links these tools together to make the process more efficient. This model, called “Calculate BASINS Attributes” can be found in the “Create New HSPF Model” Toolset in the “crwrHSPFModels” Toolbox.

Note: One custom tool is used several times in the ‘Calculate BASINS Attributes’ model. This tool was developed to avoid the necessity of creating a layer and a join when copying an attribute from one table/feature class to another in ModelBuilder. It is called “Copy Field : Table to Feature Class” and can be found in the “Attribute Tools” Toolset in the “crwrHSPFTools” Toolbox.
Two separate interfaces are available to access ModelBuilder models. The simple interface can be accessed by double-clicking on the model, while the visual interface can be accessed by right-clicking and choosing “Edit.”.
(1) Double-click on the “Calculate BASINS Attributes” model

This simple interface to the model exposes 5 input parameters, Catchment, DrainageLine, a DEM Raster, a Slope Raster, and a temporary workspace (geodatabase) to store intermediate files. This simple interface to a ModelBuilder model is useful for efficiently executing processes that must be run repeatedly.
A second interface to the model is available that exposes all of the functions and data that the model uses. This visual interface is more useful when beginning to use a model, or using a model that is not extremely robust. It is much easier to manage the data, see the workflow, and see which tool is causing a model to error in the visual interface.
(2) Close the simple interface to the model
(3) Open the visual interface to the model by right clicking and choosing “Edit”


Each of the individual Geoprocessing tools in the ModelBuilder model are illustrated as rectangle shapes, and the data on which the tools operate are shown as oval shapes. Eight Geoprocessing tools are used by the ModelBuilder model to calculate the slopes and transfer the data to the appropriate attributes of the Catchment and DrainageLine feature classes.
(4) Double-click on some of the Geoprocessing tools and data to explore the ModelBuilder model. Take care when modifying parameters.
The eight Geoprocessing functions used by the model are described below:
- Create Personal Geodatabase – Creates a temporary database to store the results of Zonal Statistics
- Zonal Statistics as Table: Catchment – Executes the standard ESRI Zonal Statistics tool over the watersheds using the Slope raster and stores the result (mean land surface slope) in the temporary geodatabase.
- Zonal Statistics as Table: DrainageLine – Executes the standard ESRI Zonal Statistics tool over the DrainageLines using the DEM raster and stores the result (min and max elevations on the river features) in the temporary geodatabase.
-
Copy Field:
- Copy Field: MaxEl – Copies the Maximum Elevation from the temporary geodatabase to the appropriate location in the DrainageLine feature class.
- Copy Field: MinEl – Copies the Minimum Elevation from the temporary geodatabase to the appropriate location in the DrainageLine feature class.
- Calculate Field: Slo2 – Executes the standard ESRI Calculate Field tool to calculate the slope of each DrainageLine feature using MaxEl, MinEl, and Shape_Length attributes.
- Calculate Field: Len2 – Executes the standard ESRI Calculate Field tool to calculate the Length of each DrainageLine feature from the Shape_Length attribute.
The above tools are linked together in the ModelBuilder model to streamline the process, but the process could be implemented equivalently by executing each Geoprocessing tool listed above in sequence.
In order to run the ModelBuilder model from the visual interface, the model input parameters (marked with a ‘P’) must be set to appropriate data sets.
(5) Double click on the parameter “DrainageLine” and browse to the appropriate dataset.

(6) Double click on the other parameters (Catchment, DEM Raster, Slope Raster, and temp Workspace) and browse to appropriate datasets/locations.
Note: You will need to create the temporary geodatabase before the other tools in the model will run properly. You can do this by right clicking on the “Create Personal Geodatabase” tool in the ModelBuilder visual interface and choosing “Run.” This will run only this one tool and should only need to be run individually the first time the model is run. The output locations for the “Zonal Statistics as Table” tools should write to this temporary geodatabase.
Once all the parameters have been set, the model is ready to run.
(7) Choose “Run” or “Run Entire Model” from the ‘Model’ menu

If the model does not run entirely through, check to see which tool the error message came from and make sure all the parameters for each tool have been properly set.
Note: There are many problems that could cause the model to produce errors. The most common of these are: Not creating the temporary geodatabase initially; Not choosing the appropriate fields for the zonal statistics and/or Copy/Calculate Field tools; Not having the raster data projected to the same coordiate system as the other data;
If the entire model runs smoothly, check to make sure the data was saved properly in the Catchment and DrainageLine feature classes.
(8) Close the visual interface to the “Calculate BASINS Attributes” model. Saving changes is probably a good idea unless you’ve done something you wish you hadn’t.
(9) Browse to your Catchment and DrainageLine data in ArcCatalog and “Preview” the “Table” view of the Catchment feature class

The ‘Slo1’ field of the Catchment feature class should now contain the average slope for each Catchment feature. In the DrainageLine feature class, the ‘Len2,’ ‘Slo2,’ ‘MinEl,’ and ‘MaxEl’ fields should all be populated.

Note: The Width and Depth of river segments (Wid2 and Dep2) are not typically available from GIS data sources. If available from another source, they should be manually entered into the DrainageLine feature class before proceeding, however, subsequent tools will assume a default value of 30 feet for width and 5 feet for depth if no values are entered into the table. Before performing simulations with HSPF, either (1) enter realistic estimates for channel widths and depths in the DrainageLine feature class during model development or (2) add realistic channel geometry information to the .uci file (FTABLES) after initial model development.
Note: The method used to calculate the slope of each river segment relies on the standard ESRI Zonal Statistics function on a raster DEM over polylines. Whether to use a raw DEM to perform this analysis or a processed DEM (burn in streams, fill sinks, etc.) is up to the user. In addition to questions about which DEM to use, questions have also arisen about the accuracy of the Zonal Statistics function over polylines. Care should be taken to ensure that the calculated slopes are accurate, possibly by manually checking some of the values calculated by the tool.
All the necessary attributes should now be present in the DrainageLine and Catchment feature classes. Subsequent tools for HSPF Preprocessing require the presence of two fields for the Catchment feature class: (1) Subbasin, and (2) Slo1 (%); and six fields from the DrainageLine feature class (1) Subbasin, (2) Subbasinr, (3) Len2, (4) Slo2, (5) MinEl, and (6) MaxEl. Estimates for Width and Depth entered manually at this point will be used to create (somewhat) realistic FTABLES in the .uci file (See note above).
(10)Make sure that the eight attributes (ten including width and depth) listed above have been properly populated in the Catchment and DrainageLine feature classes before continuing.
If these attributes are not properly populated, you can either (1) find and correct the problems in the ModelBuilder model so that the model runs smoothly and attributes are properly calculated or (2) run the appropriate Geoprocessing tools one at a time to populate the attributes.
Once these 8 attributes (10 including width and depth) are populated, the physically based attributes and network information required for model creation is properly stored in the Catchment and DrainageLine feature classes. You are ready to move on to defining the landuse types to be simulated by HSPF.
4.3. Define Land Segments to be Simulated with HSPF
The next step in creating an HSPF model is defining the landuse types that are to be simulated. Standard ArcGIS (ArcToolbox) tools are also used to define the landuse types that are to be simulated by HSPF. This tutorial will only describe how to define land segments based on polygon landuse data. A tutorial for using Raster Landuse data is available at: Using Raster Landuse Data.
Two basic tasks are accomplished by the “Define Land Segments” model located in the “Create New HSPF Model” Toolset in the “crwrHSPFModels” Toolbox.
(i) Categories of landuse defined in GIS data will be mapped to the types to be simulated in HSPF (9 or fewer) using information stored in the “LuseDefinition” table and
(ii) Catchments will be intersected with these HSPF landuse types to calculate the area of land contributing to each river segment.
The LuseDefinition table is responsible for mapping the landuse from the categories in the raw GIS data to the types to be simulated by HSPF.
(1) Browse to and preview the LuseDefinition table in ArcCatalog

Note: If the LuseDefinition table is not populated in your geodatabase, a sample table can be found in the ‘ArcHydro2HSPF\bin\TemplateTables\’ directory. (See Tutorial 2)
The table contains one record for each category of landuse described by the raw GIS landuse data. These categories are mapped to types of landuse to be simulated by HSPF as defined in the HSPFLUSE attribute.
Note: If more than 9 unique HSPF landuse types are specified in the HSPFLUSE attributes, WinHSPF will have trouble creating a new model. Use 9 or fewer unique types for best results.
(2) Edit the LuseDefinition table to map the raw landuse data to types to be simulated by HSPF (< 10). Define landuse types appropriate for your HSPF modeling application. Make sure a record exists for each unique category in the raw GIS landuse data and that 9 or fewer HSPF landuse types are specified.
Once the LuseDefinition table is prepared you are ready to perform the spatial analysis necessary to define Land Segments for HSPF Modeling.
(3) Open
the visual interface to the ‘


Five Geoprocessing tools are used by the ModelBuilder Model to copy information from the ‘LuseDefinition’ table and calculate the landuse types contributing to each river segment.
- Add Field – adds field to store landuse type to be simulated by HSPF
- Copy Field: Table to Feature Class – Copies field specifying HSPF landuse types from LuseDefinition table to landuse feature class
- Dissolve – Executes the standard ESRI Dissolve tool to create a feature class storing the types of landuse to be simulated with HSPF.
- Delete Field – Deletes the field used to store the HSPF landuse type from the landuse feature class. This is done so that another mapping scheme can be used at a different time.
- Intersect – Executes the standard ESRI Intersect tool to calculate the areas of each landuse type that contribute to each river segment. The result of this tool is used to represent the land segments simulated by HSPF.
In order to run the ModelBuilder model from the visual interface, the model input parameters must be set to read from appropriate data sets.
(4) Double click on the parameter “Landuse” and browse to the appropriate dataset.

(5) Double click on the other parameter s (LuseDefinition, Catchment, PreProLandSegment) and browse to the appropriate datasets.
Note: The PreProLandSegment feature class is the result of this tool and will store information necessary for defining the land segments for a new HSPF model. This parameter must point to a new feature class, it cannot refer to the location of an existing feature class. The PreProcess feature dataset is a convenient location to store the PreProLandSegment feature class.
Note: The process of copying the HSPFLUSE field to every feature of a large landuse dataset could be extremely time consuming. One way to avoid this process is to modify the ModelBuilder model (or the Geoprocessing tools used to implement it) so that the area of interest is first clipped out of the larger dataset using either the Catchment feature class or a buffer around it.
Once all the parameters have been set the model is ready to run.
(6) Choose “Run” or “Run Entire Model” from the ‘Model’ menu.
If the model does not run entirely through, check to see which tool the error message came from and make sure all the parameters for each tool have been properly set.
Note: The most common problem causing this model not to run smoothly is the presence of the field which the “Add Field” tool is attempting to add. Make sure this field does not exist before running the model. Another common problem is the presence of the feature class the tool is trying to create. Make sure the result of the last tool in the model points to a new location.
If the entire model runs smoothly, check to make sure the PreProLandSegment was created properly.
(7)
Close the visual interface to the “
(8) Browse to the directory where you saved the output feature class in ArcCatalog and “Preview” the “Geographic” view of the PreProLandSegment feature class

The output from the model, PreProLandSegment, (the intersection of the HSPF landuse data and the catchment boundaries) contains all the fields from both the Landuse and Catchment feature class. Each feature should contain a field specifying three key attributes used by subsequent tools: (1) the Catchment in which the feature resides (Subbasin), (2) the average slope of the Catchment (Slo1), and (3) the type of landuse to be simulated by HSPF (HSPFLUSE).
(9) Explore the features of the PreProLandSegment feature class using the ‘Identify’ tool and by previewing the table. Each feature should represent the area of a single type of landuse in a single catchment.
Note: Many of the attributes of PreProLandSegment are no longer required. The HSPFLandSegment feature class in the PreProcess feature dataset contains only the attributes of the PreProLandSegment feature class that will be used in subsequent tools. Subsequent tools can operate on either PreProLandSegment feature class or the HSPFLandSegment feature class, however, features from PreProLandSegment can be loaded into the HSPFLandSegment feature class to minimize extraneous information.
All of the spatial preprocessing necessary for defining a new HSPF model has now been accomplished. The DrainageLine feature class contains a GIS representation of the River Segments to be simulated by HSPF, and the HSPFLandSegment or PreProLandSegment (see note above) contains the information necessary to define the Land Segments to be simulated by HSPF.
Subsequent tools for HSPF Preprocessing require the presence of four fields from the HSPFLandSegment/PreProLandSegment feature class: (1) Subbasin, (2) Slo1, (3) HSPFLUSE; (4) Shape_Area; and six (or eight) fields from the DrainageLine feature class (see section 4.2 of this tutorial).
(10)Before proceeding check to make sure that the necessary fields are present in the HSPFLandSegment/PreProLandSegment and DrainageLine feature classes.
If all of the required attributes are properly stored in the DrainageLine feature class and the PreProLandSegment/HSPFLandSegment feature class contains the correct information (single feature for each type of landuse in each Catchment and required attributes), you are ready to move on to defining impervious land areas and exporting information to be used in WinHSPF.
4.4. Write intermediate text files to transfer data to WinHSPF
In order to use the WinHSPF tools to build a new HSPF .uci file, information from GIS data must be extracted to intermediate text files used by WinHSPF. Four intermediate files (.wsd, .rch, .ptf, and .psr) are required to use the WinHSPF “Create Project” tool. The format and content of these text files is described in detail in the WinHSPF User’s Manual.
Three basic tasks are accomplished by the “Create HSPF Model” located in the “Create New HSPF Model” Toolset in the “crwrHSPFModels” Toolbox.
(i) HSPFLandSegment/PreProLandSegment feature class is combined with information from the ‘LuseHSPFClass’ table to define the pervious and impervious land segments to be simulated by HSPF.
(ii) Information is first written to 3 geodatabase tables which mirror the intermediate text files used by WinHSPF to create a new HSPF model
(iii) Data from these 3 geodatabase tables is written to the proper text file format for use with WinHSPF.
GIS data for streams can be used directly to extract the data necessary to define HSPF River Segments, however, defining Land Segments is more complex. The .wsd file is used to define both pervious and impervious land segments for HSPF modeling. Information about impervious landuse is stored in the ‘LuseHSPFClass’ table. (See Tutorial 2: Preparing a Geodatabase for HSPF Model Development)
(1) Browse to and preview the LuseHSPFClass table in ArcCatalog

Note: If the LuseHSPFClass table is not populated in your geodatabase, a sample table can be found in the ‘ArcHydro2HSPF\bin\TemplateTables\’ directory. (See Tutorial 2)
The ‘LuseHSPFClass’ (HSPF Landuse Classification) table contains one record for each of the unique landuse types defined in the LuseDefinition table (See #2 in Section 4.3 of this tutorial). The ‘PluseID’ field is used to define the Operation Numbering convention used by WinHSPF when creating a new HSPF model. This number will be the third digit of Pervious Land Segment Operation numbers. The ‘PercentImp’ field contains the percentage (integer in %) of impervious land in each landuse type. This number will be used to define Impervious Land Segments for HSPF modeling. The ‘HSPFLUSEI’ field offers the option of combining one or more pervious land categories into a single impervious category. The ‘ILuseID’ field defines the Operation numbering convention for Impervious land segments. Unique values in this field should correspond directly to unique values in the HSPFLUSEI field.
(2) Edit the LuseHSPFClass table to specify impervious areas for the HSPF landuse types defined in the LuseDefinition table. Use appropriate values for your HSPF modeling application. Assign impervious categories and LuseID’s for both pervious and impervious land.
Note: Make sure a record exists in the LuseHSPFClass table for each unique category defined in the LuseDefinition table and that Percent Impervious is specified (not Percent Pervious)
Once the LuseHSPFClass table is prepared you are ready to use custom Geoprocessing tools to extract information from GIS to intermediate text files for use with WinHSPF.
(3) Open the visual interface to the ‘Create HSPF Model’ by right clicking and choosing “Edit”

Three Geoprocessing tools are used to define impervious land segments and extract information to intermediate text files.
- Write to rch and ptf Tables in Database – writes relevant information from DrainageLine feature class to rchTable and ptfTable in geodatabase
- Write to wsd Table in Database – Combines information in PreProLandSegment / HSPFLandSegment feature class and LuseHSPFClass table to define pervious and impervious land segments in wsdTable in geodatabase.
- Write to Text Files – Writes information from these geodatabase tables to text files in a specified location.
(4) Double click on the “Write to rch and ptf Tables in Database” Geoprocessing tool and explore the input parameters. Do the same for the other two Geoprocessing tools.

You will notice that the rchTable, ptfTable, and wsdTable locations are not required inputs to the Geoprocessing functions. The tools assume the presence of these tables in the geodatabase containing the feature classes DrainageLine and Catchment.
(5) Make sure the rchTable, ptfTable, and wsdTable are present in the GDB before continuing. Templates can be found in the ‘ArcHydro2HSPF\bin\TemplateTables’ directory
Note: There is no geodatabase table for the .psr intermediate file required by WinHSPF for creating a new model. This file is only used to specify point sources, and this functionality is not supported for the ArcGIS system.
Note: The one optional parameter in the ‘Write Text Files’ Geoprocessing tool specifies the location of template text files which will be copied when the new files are written. The ‘ArcHydro2HSPF\bin’ should contain these files when the tools are installed.
(6) Set each of the five required input parameters to the model: (1) Catchment and (2) DrainageLine feature classes, (3) LuseHSPFClass table, (4) directory to store intermediate text files, and (5) new project name. Double click on each parameter and browse to the appropriate dataset/directory.
Once all the parameters have been set, the model is ready to run.
(7) Choose “Run” or “Run Entire Model” from the ‘Model’ menu
If the model does not run entirely through, check to see which tool the error message came from and make sure all the parameters for each tool have been properly set.
Note: The most common problem in running this model is not having the LuseHSPFClass table set up appropriately. Make sure there is a single record for each type of landuse in the PreProLandSegment feature class. Another common problem is not having the intermediate text tables (rchTable, ptfTable, and wsdTable) in the geodatabase prior to running the tools. Another common problem is not having template text files in the location specified by the optional parameter in the ‘Write to Text Files’ tool.
Note: If intermediate text files are already present in the specified location, the tool will overwrite these text files without warning.
If the entire model runs smoothly, check to make sure the tables of the geodatabase were populated correctly and that the text files were written.
(8) Close the visual interface to the “Create HSPF Model”.
(9) “Preview” the ptfTable, rchTable, and wsdTables in ArcCatalog.

The ptfTable (24 fields not counting OID) and rchTable (34 fields) should contain a record for each DrainageLine to be simulated by HSPF. The wsdTable (6 fields) should contain a record for each pervious and impervious land segment to be simulated by HSPF. In addition, ‘dummy land segments’ (contributing area of 0) are created for the first subbasin to ensure that the Operation Numbering convention adopted by WinHSPF is consistent with the information stored in the geodatabase. The ‘dummy land segments’ created by the first subbasin can be deleted from the .uci file after the WinHSPF ‘Create Project’ tool is used.
Note: Impervious land areas are created only for areas with more than 200 m^2 contributing area. If a catchment contains less than 200 m^2 (0.1 acre) of any Impervious land type, this land segment will not be created.
(10)Use Windows Explorer to browse to the location specified for the intermediate text files. Preview each of the four files using Notepad, WordPad, or another text editor to make sure they contain the necessary information.

Make sure that each of the text files contains the proper number of columns. A detailed description of the intermediate file structure can be found in the WinHSPF help files or User’s Manual.
Note: If ‘Null’ values are encountered in the ptfTable, rchTable, or wsdTable, no value will be written to the text file for this column. This will cause the fields of the intermediate text file to shift one to the left, and will likely cause problems when using WinHSPF to create a new .uci file.
If the four text files are written correctly you are ready to move on to using WinHSPF to create a new HSPF model from the information extracted from ArcGIS.
4.5. Create a new HSPF model using WinHSPF
The final process of creating a new HSPF model involves using the WinHSPF program to create a new .uci file from the intermediate text files. The WinHSPF program runs independently of any GIS environment and consequently can be used with information extracted from either ArcView 3.x or ArcGIS 8 or 9 data. Using tools from the WinHSPF system to build a new HSPF model avoids the duplication of a substantial amount of work that went into its development and provides a link to a program that is widely used in the HSPF modeling community.
The WinHSPF ‘Create Project’ tool will be used to create a new HSPF .uci (User Control Input) file from the information extracted from GIS data.
(1) Start WinHSPF and choose the ‘Create Project’ tool under the ‘File’ menu.

This will open a new form in which three files must be specified and one option chosen to complete building a new HSPF model.

(2) Select a ‘BASINS Watershed File’ by pressing the appropriate ‘Select’ button and browsing to the .wsd intermediate text file containing the information extracted from GIS data.

Note: Only the .wds file will be shown when looking for the Watershed file. The tool assumes that three other text files (.rch, .ptf, .psr) are present in the same directory and have the same name.
Once the Watershed file has been specified, a ‘met WDM File’ must be specified. This file contains the timeseries to be used in HSPF modeling. If timeseries such as precipitation and evaporation for your HSPF modeling application is already stored in a .wdm file, then browse to and choose this file. If you do not yet have the required timeseries for your HSPF modeling application, you can assign dummy timeseries at this time and add meaningful data at a later time. An example .wdm file (ForcingExample.wdm) is available in the ‘ArcHydro2HSPF\bin’ directory.
Note: The type of precipitation data to be used in an HSPF modeling application can be influential in choosing a model configuration to represent the system. It is a good idea to consider what type of rainfall data (i.e. data from a single gauge, multiple gauges, radar estimates) is available before developing an HSPF model.
(3) Browse to and choose a .wdm file containing precipitation and evaporation data to use in building a new .uci file.

In addition to specifying an input timeseries .wdm file you must also specify an output timeseries .wdm file. If you already have an output .wdm file to use for your application, browse to and choose this file. If not, an example output file (OutExample.wdm) is available in the ‘ArcHydro2HSPF\bin’ directory.
(4) Browse to and choose an output timeseries .wdm file.

Once the BASINS Watershed File, MetWDM Files and Project WDM File have been specified, the tool is ready to create a new HSPF model. Two options are available that will define the model configuration used to create the .uci file. In the “Model Segmentation” area of the form, a ‘Grouped’ and an ‘Individual’ option are available.

Choosing the ‘Grouped’ option will result in a single set of land segments (one for each type) being created to simulate the land surface processes over the entire model domain. Choosing the ‘Individual’ option will create a set of land segments (one for each type) for each catchment.
Note: The choice of model configuration depends on many things including the objective of the model and the availability of data. This tutorial describes tools that are primarily intended to reproduce the HSPF preprocessing tools of the BASINS (ArcView 3.x) system in an ArcGIS environment. Further information about HSPF model development and the choice of a model configuration is available in the author’s Master’s Thesis at: ArcGIS and HSPF Model Development.
Note: If you intend to use tools from the ArcGIS Timeseries Preprocessing system to automatically update the .uci file to read appropriate timeseries from .wdm files (or NEXRAD precipitation data) you must choose the ‘Individual’ option. Subsequent tools assume this model configuration.
(5) Choose a ‘Model Semgentation’ option appropriate for your HSPF modeling objectives
(6) Press OK to go to the next screen
The final step in the WinHSPF Create Project process is to specify which datasets in the specified input timeseries file will be used in the simulation. If you are using meaningful data, choose the appropriate datasets. If you are using dummy data, choose any dataset, or no datasets.

(7) Choose appropriate .wdm datasets and press OK to finish creating a new HSPF model.
If all goes well, a new .uci file will be created and will be open for editing in the WinHSPF environment.

If errors are encountered, make sure that the intermediate text files contain all the information necessary to build a new .uci file.
Note: A common problem is to have missing columns of information in the text files due to <Null> values in the wsdTable, rchTable, or ptfTable in the geodatabase.
(8) Use Windows Explorer to browse to the directory with the intermediate text files and open the newly created .uci file in a text editor.

Congratulations! You have successfully created a new HSPF model in the ArcGIS environment. All WinHSPF and GenScn tools can be used with this HSPF model in the same way as with a model created using the BASINS ArcView 3.x GIS tools.
If you want to prepare timeseries for HSPF modeling using ArcGIS tools and data, you will first need to create a link between the GIS data and the .uci file using the tasks outlined in Tutorial 4.