skip to main content
Automation Tools : Batch Mode and RiverWare Command Language : About RiverWare Command Language
About RiverWare Command Language
This section provides general information about the RiverWare Command Language (RCL) syntax and variables.
Syntax Key
• Angled brackets (<>) indicate a required parameter.
• Brackets ([]) indicate an optional parameter.
• A vertical bar “|” within angled brackets or brackets indicates a choice of parameters. For example, “<#RunInfo|#MRM>” indicates that either “#RunInfo” or “#MRM” must be provided as a required parameter.
• Parameters starting with “!” are tokens, which should appear exactly as is.
• Parameters starting with “#” are RiverWare names, which should appear exactly as is.
• A “#” sign at the beginning of the line represents a comment. Anything occurring after the “#” will be ignored.
• Parameters which contain embedded white space characters must be enclosed in curly braces {}, or quotes “ ”.
• Anywhere there is a file referenced below, the user can specify the path using either a full reference or using environment variables (see next section). On Windows, path names should use “/” or '\\'. Also, the file may reference a shared network: RCL accepts '\' but it has to be escaped with '\', so the RCL syntax is as follows:
\\\\ComputerName\\ShareName\\...
Environment Variables
Environment variables are system variables that allow portability of models across machines and platforms.
Setting Environment Variables
If you wish to set environment variables and then reference them in the RCL script, they can be set using the TCL command “set env” as follows:
set env(variable) value
Then the variable can be accessed within the RCL script using the $env(variable) syntax. These variables are only available within the script, RiverWare has already inherited the environment before this is set and are then not available. To set variables to be available to RiverWare, use the SetEnv command; see SetEnv. This command has the following syntax:
SetEnv <variable> <value>
These variables are then available in RiverWare but not available within the script. Most likely, you will want to set both variables within the script. Consider the following example:
# for use in the script:
set env(DMI_DIR) C:/DMI/data
# for use by RiverWare:
SetEnv DMI_DIR $env(DMI_DIR)
# open the model using the TCL environment variable syntax:
OpenWorkspace $env(DMI_DIR)/model.mdl.gz
Then within RiverWare, you can reference DMI_DIR using the $DMI_DIR syntax in DMI’s, MRM or other places.
Using Environment Variables
Environment variables set outside of the RCL script can be referenced using the form:
• $VARIABLE
• $(VARIABLE)
• ${VARIABLE}
VARIABLE is a letter followed by zero or more letters, digits or underscores. If the variable is followed by a letter, digit or underscore it must be “quoted” with () or {}.
Special Parameters
• {date time}
A date and time of the format {MM/DD/YYYY HH:MM} or {MM-DD-YYYY HH:MM}, where the year includes the century and the hour is 24-hour based.
Note:  A date and time, which includes embedded white space, must be enclosed in braces {}.
• {delta time}
A timestep or time duration of the format {count units}, where units are “HOURS,” “DAYS,” “WEEKS,” or “MONTHS.”
Note:  A delta time, which includes embedded white space, must be enclosed in braces {}.
Revised: 12/01/2020