Skip to content

StateDMI / Command / FillRiverNetworkFromNetwork


Overview

The FillRiverNetworkFromNetwork command (for StateMod) fills missing data in the StateMod river network, using the generalized network for data. This is used, for example, when the river network has been created from the generalized network and “official” node names are first filled from HydroBase. Any remaining missing names can then be filled from the generalized network, using labels for the diagram.

Command Editor

The following dialog is used to edit the command and illustrates the command syntax.

FillRiverNetworkFromNetwork

FillRiverNetworkFromNetwork Command Editor (see also the full-size image)

Command Syntax

The command syntax is as follows:

FillRiverNetworkFromNetwork(Parameter="Value",...)

Command Parameters

Parameter             Description Default          
ID A single river station identifier to match or a pattern using wildcards (e.g., 20*). None – must be specified.
NameFormat The format to use when setting the name, one of:
  • StationName – use the station name from HydroBase
  • StationName_NodeType – use the first 20 characters of the name from Hydrobase + “_” + the node type.
StationName
CommentFormat The format to use for the river station comment, currently only:
  • StationID – the river station identifier.
If not specified, the original data will remain unchanged.
IfNotFound Used for error handling, one of the following:
  • Fail – generate a failure message if the ID is not matched
  • Ignore – ignore (don’t add and don’t generate a message) if the ID is not matched
  • Warn – generate a warning message if the ID is not matched
Warn

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