Skip to content

StateDMI / Command / WriteNetworkToStateMod


Overview

The WriteNetworkToStateMod command (for StateMod) writes the generalized network to a StateMod XML network file.

Command Editor

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

WriteNetworkToStateMod command editor

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

Command Syntax

The command syntax is as follows:

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

Command Parameters

Parameter             Description Default                
OutputFile The name of the output file to write, surrounded by double quotes. None – must be specified.
WriteHow OverwriteFile if the file should be overwritten or UpdateFile if the file should be updated, resulting in the previous header being carried forward. OverwriteFile

Examples

See the automated tests.

The following example command file illustrates how the command might be used:

# Create a generalized XML network from individual StateMod files
# Read the network, which contains upstream to downstream connectivity but does
# not indicate node types
ReadRiverNetworkFromStateMod(InputFile=cm2005.rin)
# Read the stations, which imply the node types
ReadRiverStreamGageStationsFromStateMod(InputFile=cm2005.ris)
ReadRiverDiversionStationsFromStateMod(InputFile=cm2005.dds)
ReadRiverReservoirStationsFromStateMod(InputFile=cm2005.res)
ReadRiverInstreamFlowStationsFromStateMod(InputFile=cm2005.ifs)
ReadRiverWellStationsFromStateMod(InputFile=cm2005.wes)
# To be developed...
#ReadRiverPlanStationsFromStateMod()
ReadRiverStreamEstimateStationsFromStateMod(InputFile=cm2005.ris)
# Now create the generalized network, using the connectivity and node types
CreateNetworkFromRiverNetwork()
# Fill in node names and locations from HydroBase, if any is still missing
FillNetworkFromHydroBase()
# Write the generalized network
WriteNetworkToStateMod(OutputFile="cm2005.net")
# Check for errors (the following is not yet implemented)
#CheckNetwork()
WriteCheckFile(OutputFile="cm2005.net.check.html")

Troubleshooting

See the main troubleshooting documentation

See Also