Building Hfam II

 

Hfam II was designed and built over the last four years. Desktop computers evolved since Hfam 1.1 was completed in 1997, and now have much larger memory and disk drives. Access to the Internet has become almost universal. Hfam II design goals and methods to achieve these goals are outlined below.

 

Ease of Use:

 

Graphical user interfaces (GUIs), interactive menus, and on-line help are standard practice for engineering applications. Hfam II benefits from user’s experience and feedback from Hfam 1.1 and predecessor models.

 

 

Hfam II, like Hfam 1.1, can be used for design analysis (flood frequency, reservoir yields, spillway design) or for operational forecasting (floods, reservoir storage, hydro generation). Three meteorological data bases are maintained for historic, real-time and forecast data. Watershed initial conditions or watershed states are maintained.

 

Ease of use requires that necessary information, or information used in all model runs, be prominently displayed and immediately available. Information that is used less frequently is accessed from menus.

 

The primary elements in simulation are physical; hydrometeorological stations, land segments, reaches, reservoirs, aquifer elements. These primary elements often contain related elements (diversions, spillways, powerhouses, external inflows, outlet valves, control points, etc.). Linkages between elements need to be specified, but are given only once. The sequence of operations to produce results is calculated internally in Hfam II, and memory is dynamically allocated and released. The ‘Run Setup’ input in Hfam 1.1 (equivalent to the OPN SEQUENCE block in HSPF) is eliminated.

 

Model users will ignore error messages unless they are prominently displayed. Error messages and warnings in Hfam II appear in a window as the model executes. Errors in input or model setup are very rare because all input is validated by schemas before it is read by Hfam II.

 

Model users are interested in hydrologic process detail whenever the simulation results depart from observations. Then, they want to find an explanation for the differences. This requires information about water and energy flux between model elements (soil moisture changes, snow pack heat exchange, stream flow routing, etc.). These data are available in Hfam II on hourly intervals for any period within the simulation run and can be graphically displayed. Data can also be exported in XML files for external analysis.   

 

Data Management

 

Hfam 1.1 and legacy hydrologic simulation code (HSP, HSPF and Stanford Watershed Model V) all included a custom binary data base. This was necessary because simulation programs are data intensive, and data must be accessed very rapidly as models execute. Conventional relational databases are used to archive data, but are too slow to handle data as a simulation program executes. Custom binary data bases are troublesome; data cannot be readily inspected. A program is needed to inspect or update the data base, so the data base in not ‘transparent’. Differences can develop between the external hydro-meteorological files (text files) and the binary data base, and these differences may not be noticed.

 

Hfam II does not use a binary data base. Data is held in XML (or text) input files, and is read into memory before the program executes. Output is held in memory for later output in XML files as needed. Memory is dynamically allocated for these tasks.

The benefits of this design are;

 

Once in memory, simulations execute very quickly. Inexpensive high capacity computer memory made this design feasible (memory on a typical desktop PC has expanded about 200 times in the last decade). The tradeoff in this approach is a time delay, typically 5 to 30 seconds, as time series are first read into computer memory. This time delay is worthwhile given the data validation and transparency that XML file formats afford.

 

 

Watershed Characteristics

 

Simulation models are given the physical characteristics of watersheds, and of any civil works (reservoirs, diversions, etc.) that are present in the watershed. These data in Hfam II are all in XML files and conform to schemas. The following figure is a view of the principal input schema in Hfam II:

 

                            

 

 

In addition to being validated before use, input files in XML are readily changed. Input for additional watershed elements can be added without major changes to code. A short sample of XML text input follows (this input is created by DataPrep, Excel or other auxiliary programs);

 

<?xml version="1.0" encoding="UTF-8" ?>

- <!--

 edited with XMLSPY v2004 rel. 3 U (http://www.xmlspy.com) by Norman H Crawford (Hydrocomp, Inc.) 

  -->

- <xs:schema targetNamespace="http://Hydrocomp.com/namespace" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://Hydrocomp.com/namespace" elementFormDefault="qualified" attributeFormDefault="unqualified">

- <xs:element name="HFAMII">

- <xs:annotation>

  <xs:documentation>Hydrocomp Watershed Specification</xs:documentation>

  </xs:annotation>

- <xs:complexType>

- <xs:sequence>

- <xs:element name="Watershed">

- <xs:complexType>

- <xs:sequence>

  <xs:element name="Name" type="xs:string" />

  <xs:element name="Information" type="xs:string" />

  <xs:element name="InitialConditions" type="xs:string" />

  </xs:sequence>

  </xs:complexType>

  </xs:element>

- <xs:element name="Modeling">

- <xs:complexType>

- <xs:sequence>

- <xs:element name="Period">

- <xs:complexType>

- <xs:sequence>

- <xs:element name="Run">

- <xs:complexType>

- <xs:sequence>

  <xs:element name="StartDate" type="xs:date" />

  <xs:element name="EndDate" type="xs:date" />

  </xs:sequence>

  </xs:complexType>

  </xs:element>

- <xs:element name="Historic">

- <xs:complexType>

- <xs:sequence>

  <xs:element name="StartDate" type="xs:date" />

  <xs:element name="EndDate" type="xs:date" />

  </xs:sequence>

  </xs:complexType>

  </xs:element>

- <xs:element name="Realtime">

- <xs:complexType>

- <xs:sequence>

  <xs:element name="StartDate" type="xs:date" />

  <xs:element name="EndDate" type="xs:date" />

  </xs:sequence>

  </xs:complexType>

  </xs:element>

 

 

Enhancements in Hfam II vs. Hfam 1.1

 

 

 

Return to Index

 

Hydrocomp, Inc.