...
Configuring a general adapter for HSPF
To be added
ExportActivity States
The general adapter is similar to the setup of any general adapter. Two HSPF specific settings are:
- the uci file is treated as the State file, because it contains initial conditions in the INIT tables
- HSPF is run in OpenDA, therefore OpenDA is run from FEWS, and via OpenDA the WinHSPFLight executable is run.
See examples of the States ExportActivity and the ExecuteActivity below.
ExportActivity States
Code Block | ||||
---|---|---|---|---|
| ||||
Code Block | ||||
| ||||
<exportStateActivity> <moduleInstanceId>HSPF_Basin_update</moduleInstanceId> <stateExportDir>%WORK_DIR%/model</stateExportDir> <stateConfigFile>%WORK_DIR%/states/state_in.xml</stateConfigFile> <stateLocations type="file"> <stateLocation> <readLocation>Basin.uci</readLocation> <writeLocation>../work0/Basin.uci</writeLocation> </stateLocation> </stateLocations> ... </exportStateActivity> |
...
Code Block | ||||
---|---|---|---|---|
| ||||
<executeActivities>
<!-- Execute HSPF model-->
<executeActivity>
<description>OpenDa in Fews adapter</description>
<command>
<executable>%REGION_HOME%/Modules/OpenDaInFews/bin/run_openda_in_fews.bat</executable>
</command>
<arguments>
<argument>-m</argument>
<argument>org.openda.blackbox.wrapper.BBModelFactory</argument>
<argument>hspfModel.xml</argument>
<argument>-f</argument>
<argument>%WORK_DIR%/run_info.xml</argument>
</arguments>
<timeOut>4000000</timeOut>
</executeActivity>
</executeActivities> |
Configuring the HSPF model adapter in OpenDA
There are two OpenDA files that need to be configured. The hspfWrapper.xml and the hspfModel.xml. Only if the intention is to use the HSPF model in a Data Assimilation or Calibration run a more extensive OpenDA setup, that requires additional xml-files, is needed. See http://openda.org/ for more information on OpenDA or for downloading the OpenDA binaries.
hspfWrapper.xml file
</executeActivities> |
Configuring the HSPF model adapter in OpenDA
There are two OpenDA files that need to be configured. The hspfWrapper.xml and the hspfModel.xml. Only if the intention is to use the HSPF model in a Data Assimilation or Calibration run a more extensive OpenDA setup, that requires additional xml-files, is needed. See http://openda.org/ for more information on OpenDA or for downloading the OpenDA binaries.
hspfWrapper.xml file
This is the wrapper file that describes the run actions (model initialize actions, compute actions, and finalize actions), and the InputOutput objects.
The HSPF adapter:
- copies files from the model dir to the work dir as part of the initializeActionsUsingDirClone action
- clears the content of the WDM Results and WDM State files with the ClearWdmFile statement, to prevent that old records from a previous run may be present in the file.
- runs HSPF with the WinHspfLt.exe and a reference to the uci file as an argument
- copies records from the WDM State file to the INIT tables in the uci-file as part of the finalizeActions
This is the wrapper file that describes the run actions (model initialize actions, compute actions, and finalize actions), and the InputOutput objects. An example configuration file is shown below:
...