skip to main content
RiverSMART Help : RiverSMART in Batch Mode : Running RiverSMART in Batch Mode
Running RiverSMART in Batch Mode
The RiverWare Command Language (RCL) facility allows studies be simulated in batch mode. While in this mode, RiverSMART does not open a user interface, but instead runs in the background.
In batch mode, provide RiverSMART with a script file, which contains the commands RiverSMART executes. Commands are entered through the RCL file, rather than through the user interface. The commands are described in detail in the following sections.
The syntax to invoke RiverWare in batch mode from a command prompt is:
RiverSMART.exe --batch <script file> --log <log file|console>
Tip:  You can use environment variables in the command line as part of file paths. For example, you could specify --log $VAR\batch.log where VAR is an environment variable.
The following example will invoke the batch script file called BasinStudy.rcl and will write the diagnostics output to file called BasinStudyDiagnostics.txt.
RiverSMART.exe --batch “C:\MyFiles\BasinStudy.rcl” --log “C:\MyOutputs\BasinStudyDiagnostics.txt”
The <script file> defines how the batch simulation should proceed. In the file, you specify commands to open a study, simulate the specified scenarios, and save the resulting study if desired. All output will still go to the files specified in the RiverSMART study file. The following sample RCL commands support these actions:
# Open the Study
OpenStudy SampleBasin.rwsm
# simulate scenarios
SimulateScenarios Supply=DNF,DPC Demand=Baseline Policy=Conservation
# save the study
SaveStudy SampleStudy.saved.rwsm
# Clear the Study
ClearStudy
This is a very simple example. The full complement of key words and commands is presented in the following section. In the above example, the # indicates a comment.
For the log messages, there are two options:
• RiverSMART.exe --log “C:\MyOutputs\BasinStudyDiagnostics.txt” - Send the output to the specified file.
• RiverSMART.exe --log console - Send the output to a separate command window. This is good if you don’t expect many diagnostics.
Revised: 07/03/2024