skip to main content
RiverSMART Help : RiverSMART in Batch Mode : RiverSMART RCL Commands Reference
RiverSMART RCL Commands Reference
This section describes the RiverSMART specific RCL commands in alphabetical order, but first, we describe the syntax.
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, “<y|n>” indicates that either “y” or “n” must be provided as a required parameter. The underlined item is the default.
• 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 “ ”.
• 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 set outside of the RCL script can be referenced using the form:
– $VARIABLE
– $(VARIABLE)
– ${VARIABLE}
VARIABLE is the environment variable consisting of letters, digits or underscores. If the variable is followed by other letters, digit or underscores, it must be “quoted” with () or {}.
Further, file paths made of environment variables and additional information should be fully quoted. For example to open a study in the folder referenced by SAMPLE_STUDY variable, the command would be constructed as follows:
OpenStudy {$(SAMPLE_STUDY)/Sample.rwsm}
Note that the environment variable is optionally quoted by “( )” while the entire path must be quoted by “{ }”.
Commands
This section describe the RiverSMART specific commands that are supported. In the future, additional commands will be added to configure events, regenerate scenarios, and post process. For now, those actions must be performed interactively.
 ClearStudy
ClearStudy
Clears the RiverSMART workspace.
Note:  The ClearStudy command does not close RiverSMART. RiverSMART closes once the execution of the complete batch script is complete. Multiple OpenStudy and ClearStudy commands within the same script will be executed within a single RiverSMART session.
 OpenStudy
OpenStudy {study file}
Open the specified study file. See the note in the Syntax Key about use of environment variables in the file specification.
 PrintVerboseMessages
PrintVerboseMessages <y|n>
Enables verbose diagnostic messages, most notably why scenarios were skipped.
 RepeatCommandsInLog
RepeatCommandsInLog <y|n>
Enable or disable tracing messages from the RCL interpreter. The trace messages are prefaced with “TRACE:” and written to standard output; they can be captured in a file with the --log <log file> command line option.
 SaveStudy
SaveStudy [{study file}]
Save the study to the either the current file if no file is specified, or to the specified file. See the note in the Syntax Key about use of environment variables in the file specification.
 SimulateScenarios
SimulateScenarios [resimulate=<y|n>] [allowInfoDiag=<y|n|cancel>] [input=value[,value]*]*
Simulate the scenarios that match the specified input=value combinations. The following is a description of the keywords:
• resimulate = <y|n> - Specify whether to resimulate scenarios that have already been successfully simulated prior to this session. Scenarios are never resimulated within a session unless inputs have changed. If not specified, “n” is the default.
• allowInfoDiag=<y|n|cancel> - Specify whether to allow informational diagnostics to be posted. If “y”, informational diagnostics will be enabled. If “n”, the informational diagnostics will be disabled. If “cancel”, the simulations will be canceled. The default is “cancel”. See Simulation Confirmations for more information.
• input=value - Specify the scenarios to simulate by saying which inputs to use. If an input is not specified, all values will be used.
For example, consider the command:
SimulateScenarios Supply=DNF,DPC Demand=Baseline Policy=Conservation
This will simulate any scenarios with the Supply=DNF OR Supply=DPC, the Demand=Baseline, AND Policy=Conservation. Within an input type, the variables are OR together, (e.g. DNF or DPC). Items across input values are AND-ed together. In this example, any scenarios with Demand=Proposed would not be simulated.
Consider an additional example: assume the hydrology inputs are Dry, Avg and Wet, and the Simulate argument is {Hydrology=Dry,Wet},    If resimulate=n and PrintVerboseMessages=y, the verbose diagnostic messages might be:
Scenario Dry,X,Y skipped: Inactive
Scenario Dry,X,Y skipped: Hidden
Scenario Avg,X,Y skipped: Hydrology Avg isn’t one of (Dry, Wet)
<This is the first input which caused the scenario to be skipped, there could be others>
Scenario Dry,X,Y skipped: Already simulated successfully this session
Scenario Dry,X,Y skipped: Already simulated unsuccessfully this session
Scenario Dry,X,Y skipped: Previously simulated successfully (and not resimulating)
Revised: 12/06/2024