StateDMI / Command / WriteRiverNetworkToStateMod
Overview
The WriteRiverNetworkToStateMod command (for StateMod)
writes the river network to a StateMod river network file.
Command Editor
The following dialog is used to edit the command and illustrates the command syntax.
 
WriteRiverNetworkToStateMod Command Editor (see also the full-size image)
Command Syntax
The command syntax is as follows:
WriteRiverNetworkToStateMod(Parameter="Value",...)
Command Parameters
| Parameter | Description | Default | 
|---|---|---|
| OutputFilerequired | The name of the output file to write, surrounded by double quotes. | None – must be specified. | 
| WriteHow | OverwriteFileif the file should be overwritten orUpdateFileif the file should be updated, resulting in the previous header being carried forward. | OverwriteFile | 
Examples
See the automated tests.
The following command file illustrates how a StateMod river network file can be created from the generalized network file:
StartLog(LogFile="rin.commands.StateDMI.log")
# rin.commands.StateDMI
#
# creates the river network file for the Colorado River monthly/daily models
#
#  Step 1 - read river nodes from the network file and create file framework
#
ReadNetworkFromStateMod(InputFile="cm2005.net")
CreateRiverNetworkFromNetwork()
#
#  Step 2 - get node (diversion, stream stations, reservoirs, instream flows)
#           names from HydroBase
#
FillRiverNetworkFromHydroBase(ID="*",NameFormat=StationName_NodeType)
#
#  Step 3 - read missing node names from network file
#
FillRiverNetworkFromNetwork(ID="*",NameFormat="StationName_NodeType",CommentFormat="StationID")
#
#  Step 4 - create StateMod river network file
#
WriteRiverNetworkToStateMod(OutputFile="..\StateMod\cm2005.rin")
#
# Check the results
CheckRiverNetwork(ID="*")
WriteCheckFile(OutputFile="rin.commands.StateDMI.check.html")
Troubleshooting
See Also
- ReadRiverNetworkFromStateModcommand
- WriteRiverNetworkToListcommand