12  Visual Basic Scripts

VBScript (Visual Basic Scripting Edition) is an Active Scripting language developed by Microsoft that is modelled on Visual Basic. It is designed as a “lightweight” language with a fast interpreter and can be effectively used for automating day to day office tasks as well as monitoring in the Windows-based environment. It has been installed by default in every desktop release of Microsoft Windows since Windows 98.

This chapter describes the methodology to run tasks using Visual Basic scripts when working with RS MINERVE models (running a model, extracting information from dataset, etc.).

12.1 Introduction to Visual Basic Scripts

A VBScript script must be executed within a host environment, of which there are several provided with Microsoft Windows, including: Windows Script Host (WSH), Internet Explorer (IE), and Internet Information Services (IIS).

VBScript can also be used to create applications that run directly on a workstation running Microsoft Windows. The simplest example is a script that makes use of the Windows Script Host (WSH) environment. Such a script is usually in a stand-alone file with the file extension .vbs.

VBScript can be used for managing RS MINERVE without the graphical interface. The VBScript can be invoked in two ways: from the command line with Cscript, or directly by double-clicking on the script.

In VBScript, Properties are attributes or values of an object that can be read and set. As long as the value returned by the property is not an object, setting and retrieving property values requires a simple assignment statement. Many properties return either individual objects or collections (a collection is an object that serves as a container for other data items or objects). These also require assignment statements that use the Set statement. For example, you can retrieve a reference to the root folder of the C: drive on a local system with a code fragment like the following:

Set oFS = CreateObject("Scripting.FileSystemObject")

When running RS MINERVE with VBScripts, the following code line has to be used before executing the specific RS MINERVE tasks:

Set rsm = CreateObject("RSMinerve.RS.Task")

Also, it is worth mentioning the difference between:

  • Procedures (or Sub Procedures): does not return any value.

  • Functions (or Function Procedures): return a value.

12.2 Available VBS procedures and functions in RS MINERVE

Table 12.1: Summary of the VBS procedures and functions available in RS MINERVE
Type Name of procedure/ function
Application start Start
Model preparation LoadDataset
LoadDatasetAndSetDates
MergeLoadedDataset
LoadInitialConditionsFromFile
LoadInitialConditionsFromDataset
LoadInitialConditionsFromFileAndCopyFile
LoadInitialConditionsFromFileAndMoveFile
LoadParametersFromFile
GetStartDateFromDataset
GetEndDateFromDataset
GetStartDateFromModel
GetEndDateFromModel
GetICDateFromICFile
SetDates
SetStartDate
SetEndDate
SetSimulationTimeStep
SetRecordingTimeStep
SetETPMethod
SetLongitudeAndLatitude
SetUniformETPValue
SetSpatialInterpolationMethod
DefineModelProperties
UpdateModelProperties
SetOutputRatioCoeffsInPlanner
SetConditionThresholdInPlanner
SetDaysInPlanner
SetHoursInPlanner
Simulation and reports SavePreSimulationReportAs
SavePreSimulationReport
Simulate
SavePostSimulationReportAs
SavePostSimulationReport
Save model and properties SaveModelAs
SaveModel
SaveInitialConditionsAs
SaveInitialConditions
SaveFinalConditionsAs
SaveFinalConditions
SaveParametersAs
SaveParameters
Model results SaveFullResultsAs
SaveFullResults
SaveSelectionResultsAs
SaveSelectionResults
SaveInitializationDatasetAs
SaveInitializationDataset
ExportResultsTo
MergeFullResults
MergeSelectionResults
MergeDatasetsAs
MergeDatasets
GetPropertyValue
GetIndicatorValue
Calibration LoadCalibrationsInModel
LoadCalibrationsByFile
SaveAllCalibrationsInModel
RunCalibration
RunAllCalibrations
ExportCalibrationResults
ExportAllCalibrationsResults
SetCalibrationDates
Application stop Stop
Other procedures /functions RemoveFile
GetAppVersion
GetReaderVersion

12.3 Application Start

Start Opening of the model

Description

This procedure opens the indicated model to be used.

Syntax

Start (modelFullPath, debug=false)

Parameters

modelFullPath String. Full path of the hydrological model. The file extension of the model has to be *.rsm; otherwise, the script reports an error.
Debug Boolean (optional). If TRUE, the script writes a text file with the error logs.

Errors

Argument Null Exception “Model file not defined”
Argument Exception “Model file not found”
Invalid Operation Exception “Model file not valid”

12.4 Model preparation

LoadDataset Loading of the input dataset

Description

This procedure loads the indicated input dataset in the model. The model has to have been previously open.

Syntax

LoadDataset (inputDatasetFullPath)

Parameters

inputDatasetFullPath String. Full path of the input dataset

Errors

Invalid Operation Exception “Model not loaded”
Argument Null Exception “Input dataset not defined”
Argument Exception “Input dataset not found”
Invalid Operation Exception “Input dataset not valid”
Invalid Operation Exception “Failed to apply datasources”



LoadDatasetAndSetDates Loading of the input dataset and set dates

Description

The input dataset is loaded, and the datasource and the simulation period are defined based on the dataset. Depending on the parameters and whether each time series have a different period, the simulation period is defined.

Syntax

LoadDatasetAndSetDates (inputDatasetFullPath, canBeginWithMissingData, canEndWithMissingData)

Parameters

inputDatasetFullPath String. Full path of the input dataset
canBeginWithMissingData Boolean. If false, the last start date of the time series is used as simulation date start.
canEndWithMissingData Boolean. If false, the first last date of the time series is used as simulation date end.

Errors

Invalid Operation Exception “Model not loaded”
Argument Null Exception “Input dataset not defined”
Argument Exception “Input dataset not found”
Invalid Operation Exception “Input dataset not valid”
Invalid Operation Exception “Failed to apply datasources”
Invalid Operation Exception “Input dataset is empty”



MergeLoadedDataset Merging of the input dataset to base dataset

Description

This procedure merges a loaded dataset to a base dataset. It can be useful when new data is available and the user would like to merge to historical data. The result is an updated base dataset containing the loaded dataset, saved in a text or binary format file.

Syntax

MergeLoadedDataset (baseDatasetFullPath, saveDataInDstFile)

Parameters

baseDatasetFullPath String. Full path of the base dataset.
saveDataInDstFile Boolean. If true the dataset values are saved in text format (*.dst), if false in binary format (*.dsb).

Errors

Invalid Operation Exception “Input dataset not loaded, failed to merge with base dataset”
Argument Null Exception “Input dataset not defined”
Argument Exception “Fullpath of base dataset not valid”
Invalid Operation Exception “Failed to create new base dataset”
Invalid Operation Exception “Base dataset not valid”
Invalid Operation Exception “Failed to merge input dataset with base dataset”
Invalid Operation Exception “Failed to save changes in base dataset”



LoadInitialConditionsFromFile Setting of the initial conditions

Description

This procedure sets the initial conditions of the model from a text or an Excel file (please refer to Section 13.2 to learn more about Initial Conditions files).

Syntax

LoadInitialConditionsFromFile (icFileFullPath)

Parameters

icFileFullPath String. Full path of the IC file. Accepted file extensions are *.txt and *.xlsx.

Errors

Invalid Operation Exception “Model not loaded”
Argument Null Exception “IC file not defined”
Argument Exception “IC file not found”
Invalid Operation Exception “Failed to import initial conditions from IC file”



LoadInitialConditionsFromDataset Setting of the initial conditions from a dataset

Description

The initial conditions are set from a dataset file (please refer to Section 14.2 of this manual to learn more about dataset formats).

Syntax

LoadInitialConditionsFromDataset (icDatasetFullPath)

Parameters

icDatasetFullPath String. Full path of the dataset from where to extract the initial conditions.

Errors

Invalid Operation Exception “Model not loaded”
Argument Null Exception “IC dataset not defined”
Argument Exception “IC dataset not found”
Invalid Operation Exception “IC dataset not valid”
Invalid Operation Exception “Failed to load results from IC dataset”
Invalid Operation Exception “Failed to initialize the model with IC dataset”



LoadInitialConditionsFromFileAndCopyFile Setting of the initial conditions from a file and copy the file

Description

This procedure sets the initial conditions of the model from a text or an Excel file, and copies them in a newly created text file (which name is based on the original IC filename but includes the start date of the simulation). If the indicated folder where to create the new IC file does not exist it will be created.

Syntax

LoadInitialConditionsFromFileAndCopyFile (icFileFullPath, saveFolder)

Parameters

icFileFullPath String. Full path of the IC file. Accepted file extensions are *.txt and *.xlsx.
saveFolder String. Folder where results have to be stored.

Errors

Invalid Operation Exception “Model not loaded”
Argument Null Exception “IC file not defined”
Argument Exception “IC file not found”
Argument Null Exception “Save folder not defined”
Argument Exception “Save folder ‘saveFolder’ not valid”
Invalid Operation Exception “Failed to import initial conditions from IC file”
Invalid Operation Exception “Failed to copy the IC file”



LoadInitialConditionsFromFileAndMoveFile Loading of the initial conditions and moving of the text file

Description

This procedure sets the initial conditions of the model from a text or an Excel file, and moves the file to the specified folder (the filename is based on the original IC filename but includes the start date of the simulation). The target file must not exist before; otherwise an error occurs.

Syntax

LoadInitialConditionsFromFileAndMoveFile (icFileFullPath, saveFolder)

Parameters

icFileFullPath String. Full path of the IC file. Accepted file extensions are *.txt and *.xlsx.
saveFolder String. Folder where results are stored.

Errors

Invalid Operation Exception “Model not loaded”
Argument Null Exception “IC file not defined”
Argument Exception “IC file not found”
Argument Null Exception “Save folder not defined”
Argument Exception “Save folder ‘saveFolder’ not valid”
Invalid Operation Exception “Failed to import initial conditions from IC file”
Invalid Operation Exception “Failed to move the IC file”



LoadParametersFromFile Setting of the parameters

Description

This procedure sets the parameters of the model from a text or an Excel file (please refer to Section 13.2 of this manual to learn more about Parameters files).

Syntax

LoadParametersFromFile (paramFileFullPath)

Parameters

icFileFullPath String. Full path of the Parameters file. Accepted file extensions are *.txt and *.xlsx.

Errors

Invalid Operation Exception “Model not loaded”
Argument Null Exception “Parameters file not defined”
Argument Exception “Parameters file not found”
Invalid Operation Exception “Failed to import parameters from Parameters file”



GetStartDateFromDataset Getting the start date from a dataset

Description

This function extracts the start date of a specified dataset file. If the dataset contains different start dates (data series with initial lacking data), the user can choose whether to get the first common date of the complete dataset.

Syntax

GetStartDateFromDataset (DatasetFullPath, canBeginWithMissingData)

Parameters

DatasetFullPath String. Full path of the dataset file.
canBeginWithMissingData Boolean. If true the last start date of the time series is used as simulation date start.

Returned value

Start date It returns the value of the start date of a dataset. The format of the date is: dd.MM.yyyy HH:mm:ss.

Errors

Invalid Operation Exception “Model not loaded”
Argument Null Exception “Dataset not defined”
Argument Exception “Dataset not found”
Invalid Operation Exception “Dataset not valid”



GetEndDateFromDataset Getting the end date from a dataset

Description

This function extracts the end date of a specified dataset file. If the dataset contains different end dates (data series with final lacking data), the user can choose whether to get the last common date of the complete dataset.

Syntax

GetEndDateFromDataset (DatasetFullPath, canEndWithMissingData)

Parameters

DatasetFullPath String. Full path of the dataset file.
canEndWithMissingData Boolean. If true the first last date of the time series is used as simulation date end.

Outputs

End date It returns the value of the end date of a dataset. The format of the date is: dd.MM.yyyy HH:mm:ss.

Errors

Invalid Operation Exception “Model not loaded”
Argument Null Exception “Dataset not defined”
Argument Exception “Dataset not found”
Invalid Operation Exception “Dataset not valid”



GetStartDateFromModel Getting the start date from model

Description

This function extracts the start date from the loaded model.

Syntax

GetStartDateFromModel ()

Returned value

Start date It returns the value of the start date of the model. The format of the date is: dd.MM.yyyy HH:mm:ss.

Errors

Invalid Operation Exception “Model not loaded”



GetEndDateFromModel Getting the end date from model

Description

This function extracts the end date from the loaded model.

Syntax

GetEndDateFromModel ()

Returned value

End date It returns the value of the end date of the model. The format of the date is: dd.MM.yyyy HH:mm:ss.

Errors

Invalid Operation Exception “Model not loaded”



GetICDateFromICFile Getting the date from an Initial Conditions file

Description

This function extracts the date corresponding to a specified Initial Conditions file.

Syntax

GetICDateFromICFile (icFileFullPath)

Parameters

icFileFullPath String. Full path of the IC file. Accepted file extension is *.txt.

Returned value

Date It returns the date of the Initial Conditions file. The format of the date is: dd.MM.yyyy HH:mm:ss.

Errors

Invalid Operation Exception “Model not loaded”
Argument Null Exception “IC file not defined”
Argument Exception “IC file not found”
Invalid Operation Exception “Failed to get IC Date from IC file”



SetDates Setting of the dates

Description

This procedure sets the simulation period based on specified start and end dates.

Syntax

SetDates (startDate, endDate)

Parameters

startdate Date. Start date for the simulation period. The format of the date has to be: dd.MM.yyyy HH:mm:ss.
enddate Date. End date for the simulation period. The format of the date has to be: dd.MM.yyyy HH:mm:ss.

Errors

Invalid Operation Exception “Model not loaded”
Argument Exception “Start Date not valid, unable to convert ‘startdate’ to a Date”
Argument Exception “End Date not valid, unable to convert ‘enddate’ to a Date”



SetStartDate Setting of the start date

Description

This procedure sets the simulation period start date.

Syntax

SetStartDate (startDate)

Parameters

startdate Date. Start date for the simulation period. The format of the date has to be: dd.MM.yyyy HH:mm:ss.

Errors

Invalid Operation Exception “Model not loaded”
Argument Exception “Start Date not valid, unable to convert ‘startdate’ to a Date”



SetEndDate Setting of the end date

Description

This procedure sets the simulation period end date.

Syntax

SetEndtDate (endDate)

Parameters

enddate Date. End date for the simulation period. The format of the date has to be: dd.MM.yyyy HH:mm:ss.

Errors

Invalid Operation Exception “Model not loaded”
Argument Exception “End Date not valid, unable to convert ‘enddate’ to a Date”



SetSimulationTimeStep Setting of the simulation timestep

Description

This procedure sets the simulation timestep and its unit for the simulation.

Syntax

SetSimulationTimeStep (value, unit)

Parameters

value Double. Simulation time step as double (value has to be >0).
unit String. Unit: Seconds, Minutes, Hours or Days.

Errors

Invalid Operation Exception “Model not loaded”
Argument Exception “Simulation time step not valid, unable to convert ‘value’ to a Double”
Argument Exception “Simulation time step not valid, ‘value’ is outside the range of a Double”
Argument Exception “Simulation time step not valid, unit ‘unit’ not recognized”



SetRecordingTimeStep Setting of the recording timestep

Description

This procedure sets the recording timestep and its unit for the simulation.

Syntax

SetRecordingTimeStep (value, unit)

Parameters

value Double. Recording time step as double (value has to be >0).
unit String. Unit: Seconds, Minutes, Hours, Days or Months.

Errors

Invalid Operation Exception “Model not loaded”
Argument Exception “Recording time step not valid, unable to convert ‘value’ to a Double”
Argument Exception “Recording time step not valid, ‘value’ is outside the range of a Double”
Argument Exception “Recording time step not valid, unit ‘unit’ not recognized”



SetETPMethod Setting of the ETP method

Description

This procedure sets the ETP (Potential EvapoTranspiration) method in the model (please refer to Section 13.2 of the User’s Manual to learn more about the model Settings).

Syntax

SetETPMethod (etpMethod)

Parameters

selectedETPMethod String. Selected ETP Method: Turc, McGuinness, Oudin or Uniform ETP.

Errors

Invalid Operation Exception “Model not loaded”
Argument Exception “Selected ETP Method is not implemented in RS MINERVE”



SetLongitudeAndLatitude Setting of the Longitude and Latitude

Description

This procedure sets the Longitude and Latitude used when applying ETP methods.

Syntax

SetLongitudeAndLatitude (longitude, latitude)

Parameters

longitude Integer. Selected Longitude.
latitude Integer. Selected Latitude.

Errors

Invalid Operation Exception “Model not loaded”
Argument Exception “Longitude not valid”
Argument Exception “Latitude not valid”



SetUniformETPValue Setting of the Uniform ETP

Description

This procedure sets the Uniform ETP value when Uniform ETP Method has been set.

Syntax

SetUniformETPValue (value)

Parameters

value String. Uniform ETP value.

Errors

Invalid Operation Exception “Model not loaded”
Argument Exception “Uniform ETP value not valid”



SetSpatialInterpolationMethod Setting of the Spatial Interpolation method

Description

This procedure sets the Spatial Interpolation method to be used.

Syntax

SetSpatialInterpolationMethod (spatialInterpolationMethod)

Parameters

selectedETPMethod String. Selected ETP Method.

Errors

Invalid Operation Exception “Model not loaded”
Argument Exception “Selected Spatial Interpolation Method does not exist in RS MINERVE”



DefineModelProperties Defining property of an object

Description

This procedure defines a parameter or an initial condition in all objects included in the specified zone.

Syntax

DefineModelProperties (objectType, propertyName, value, zone = null)

Parameters

objectType String. Object type (e.g. SOCONT, GSM, Reservoir, etc.). See Table 12.2.
propertyName String. Property name (e.g. HGR3Max). See Table 12.2.
value Double. Value of the property.
zone = null String (optional). Zone where the objects are.

Errors

Invalid Operation Exception “Model not loaded”
Argument Exception “Object type ‘objectType’ not valid”
Argument Null Exception “Property name not defined”
Argument Exception “Zone ‘zone’ not found in ‘hydrologicalmodel’”
Argument Exception “Value is not valid, unable to convert ‘value’ to a Double”
Invalid Operation Exception “Failed to define model properties”



UpdateModelProperties Updating of model properties

Description

This procedure updates a parameter or an initial condition in all objects included in the specified zone.

Syntax

UpdateModelProperties (objectType, propertyName, scale, shift, linkedPropertyName=null, zone = null, objectName=null)

Parameters

objectType String. Object type (e.g. SOCONT, GSM, Reservoir, etc.). See Table 12.2.
propertyName String. Property name (e.g. HGR3Ini). See Table 12.2.
scale String. Scale to multiply the current property.
shift String. Shift to add to the current property.
linkedPropertyName = null String (optional). Name of the property that restricts the maximum value of the updated property (e.g. the HGR3Max when updating the HGR3Ini).
zone = null String (optional). Zone where the objects to which the procedure will be applied are.
objectName = null String (optional). Name of the object to which the procedure will be applied. The object must be within the zone if this one has been specified.

Errors

Invalid Operation Exception “Model not loaded”
Argument Exception “Object type ‘objectType’ not valid”
Argument Null Exception “Property name not defined”
Argument Exception “Zone ‘zone’ not found in ‘hydrologicalmodel’”
Argument Exception “Scale is not valid, unable to convert ‘scale’ to a Double”
Argument Exception “Shift is not valid, unable to convert ‘shift’ to a Double”
Invalid Operation Exception “Failed to update model properties”



SetOutputRatioCoeffsInPlanner Setting of the coefficients of the expression defining a rule’s output

Description

This procedure sets the coefficients A and B in the expression: \(Q=A \cdot Output+B\) for the definition of a particular Rule output at a specified Planner.

Syntax

SetOutputRatioCoeffsInPlanner (plannerName, ruleName, coefA, coefB)

Parameters

plannerName String. Name of the Planner object concerned.
ruleName String. Name of the Rule (defined within the above Planner) for which the output expression’s coefficients are to be defined.
coefA Double. Value of the coefficient A in the output expression \(Q=A \cdot Output+B\)
coefB Double. Value of the coefficient B in the output expression *\(Q=A \cdot Output+B\)

Errors

Argument Null Exception “Planner name not defined”
Argument Null Exception “Rule name not defined”
Argument Exception “Ratio Coeff. A is not valid, unable to convert to a Double”
Argument Exception “Ratio Coeff. B is not valid, unable to convert to a Double”
Invalid Operation Exception “No Planner with this name”
Invalid Operation Exception “No Rule with this name”
Invalid Operation Exception “Failed to define Ratio Coefficient in Planner”



SetConditionThresholdInPlanner Setting of the threshold value of a condition in a specific Planner

Description

This procedure sets the Threshold value of a condition in a Rule of a specific Planner.

Syntax

SetConditionThresholdInPlanner (plannerName, ruleName, conditionName, value)

Parameters

regulationName String. Name of the Planner object concerned.
ruleName String. Name of the Rule, defined within the above Planner.
conditionName String. Name of the Condition, defined within the above Rule, for which the threshold is to be defined.
value Double. Value of the threshold of the specified condition.

Errors

Argument Null Exception “Planner name not defined”
Argument Null Exception “Rule name not defined”
Argument Null Exception “Condition name not defined”
Argument Exception “Value is not valid, unable to convert to a Double”
Invalid Operation Exception “No Planner with this name”
Invalid Operation Exception “No Rule with this name”
Invalid Operation Exception “No condition with this name”
Invalid Operation Exception “Failed to define Threshold value in Planner”



SetDaysInPlanner Setting of the days of a rule in a specific Planner

Description

This procedure sets the week days of a Rule of a specific Planner.

Syntax

SetDaysInPlanner (plannerName, ruleName, day1, day2, day3, day4, day5, day6, day7)

Parameters

plannerName String. Name of the Planner object concerned.
ruleName String. Name of the Rule, defined within the above Planner.
day1,…, day7 Boolean. Whether the rule is active for the nth day of the week (day1=Monday, day2=Tuesday…).

Errors

Argument Null Exception “Planner name not defined”
Argument Null Exception “Rule name not defined”
Argument Exception “No Planner with name plannerName”
Argument Exception “No Rule with name ruleName”
Invalid Operation Exception “Failed to define rule days in Planner”



SetHoursInPlanner Setting of the hours of a rule in a specific Planner

Description

This procedure sets the hours of a Rule of a specific Planner.

Syntax

SetHoursInPlanner (plannerName, ruleName, startHour, endHour)

Parameters

plannerName String. Name of the Planner object concerned.
ruleName String. Name of the Rule, defined within the above Planner.
startHour String. Initial hour of the period for which the rule is active.
endHour String. Final hour of the period for which the rule is active.

Errors

Argument Null Exception “Planner name not defined”
Argument Null Exception “Rule name not defined”
Argument Exception “No Planner with name plannerName”
Argument Exception “No Rule with name ruleName”
Invalid Operation Exception “Failed to define hours in Planner”

12.5 Simulation and reports

SavePreSimulationReportAs Writing of the pre-simulation report

Description

This procedure writes the pre-simulation report in a text file, at the specified location with the name: preSimulationReportFullPath.txt.

Syntax

SavePreSimulationReportAs (preSimulationReportFullPath)

Parameters

preSimulationReportFullPath String. Full path of the text file where to save the pre-simulation report. The file extension has to be *.txt.

Errors

Invalid Operation Exception “Model not loaded”
Argument Null Exception “Fullpath not defined”
Argument Exception “Fullpath contains invalid characters”
Argument Exception “Filename extension not valid”
Argument Exception “Fullpath not rooted”
Invalid Operation Exception “Failed to save pre-simulation report”



SavePreSimulationReport Writing of the pre-simulation report

Description

This procedure writes the pre-simulation report in a text file, at the specified location with the specified reference name.

Syntax

SavePreSimulationReport (saveFolder, referenceName, showInitialDateInFileName = true)

Parameters

saveFolder String. Folder path where to save the text file.
referenceName String. Reference name for the file.
showInitialDateInFileName Boolean (optional). Adds the StartDate of the simulation to the filename if True (e.g. yyyyMMddHH_referenceName.txt).

Errors

Invalid Operation Exception “Model not loaded”
Argument Null Exception “Reference name not defined”
Argument Null Exception “Save folder not defined”
Argument Exception “Save folder ‘savefolder’ not valid”
Invalid Operation Exception “Failed to save pre-simulation report”



Simulate Running of the model

Description

This procedure executes the simulation of the model with the loaded parameters and hydrometeorological datasets.

Syntax

Simulate()

Errors

Invalid Operation Exception “Model not loaded”
Invalid Operation Exception “Simulation failed, see /log_RSM/errlog.txt”



SavePostSimulationReportAs Writing of the post-simulation report

Description

This procedure writes the post-simulation report in a text file, at the specified location with the name: postSimulationReportFullPath.

Syntax

SavePostSimulationReportAs (postSimulationReportFullPath)

Parameters

postSimulationReportFullPath String. Full path of the text file where to save the post-simulation report. The file extension has to be *.txt.

Errors

Invalid Operation Exception “Model not loaded”
Argument Null Exception “Fullpath not defined”
Argument Exception “Fullpath contains invalid characters”
Argument Exception “Filename extension not valid”
Argument Exception “Fullpath not rooted”
Invalid Operation Exception “Failed to save post-simulation report”



SavePostSimulationReport Writing of the post-simulation report

Description

This procedure writes the post-simulation report in a text file, at the specified location with the specified reference name.

Syntax

SavePostSimulationReport (saveFolder, referenceName, showInitialDateInFileName = true)

Parameters

saveFolder String. Folder path where to save the text file.
referenceName String. Reference name for the file.
showInitialDateInFileName Boolean (optional). Adds the StartDate of the simulation to the filename if True (e.g. yyyyMMddHH_referenceName.txt).

Errors

Invalid Operation Exception “Model not loaded”
Argument Null Exception “Reference name not defined”
Argument Null Exception “Save folder not defined”
Argument Exception “Save folder ‘saveFolder’ not valid”
Invalid Operation Exception “Failed to save post-simulation report”

12.6 Save model and properties

SaveModelAs Saving of the model

Description

This procedure saves the loaded model, at a defined location with a specified name: modelNameFullPath.

Syntax

SaveModelAs (modelNameFullPath)

Parameters

modelNameFullPath String. Full path of the model to save. The file extension has to be *.rsm.

Errors

Invalid Operation Exception “Model not loaded”
Argument Null Exception “Fullpath not defined”
Argument Exception “Fullpath contains invalid characters”
Argument Exception “Filename extension not valid”
Argument Exception “Fullpath not rooted”
Invalid Operation Exception “Failed to save model”



SaveModel Saving of the model

Description

This procedure saves the loaded model at its current location.

Syntax

SaveModel ()

Errors

Invalid Operation Exception “Model not loaded”
Invalid Operation Exception “Failed to save model”



SaveInitialConditionsAs Saving of the initial conditions

Description

This procedure saves the initial conditions at starting date of the simulation (in a text or an Excel format), at the specified location with the name: initialConditionsFullPath.

Syntax

SaveInitialConditionsAs (initialConditionsFullPath)

Parameters

initialConditionsFullPath String. Full path of the text or Excel file where to save the Initial Conditions. The file extension has to be *.txt. or *.xlsx.

Errors

Invalid Operation Exception “Model not loaded”
Argument Null Exception “Fullpath not defined”
Argument Exception “Fullpath contains invalid characters”
Argument Exception “Fullpath not rooted”
Invalid Operation Exception “Failed to create and save initial conditions file”



SaveInitialConditions Saving of the initial conditions

Description

This procedure saves the initial conditions at starting date of the simulation as a text file, at the specified location with the specified reference name.

Syntax

SaveInitialConditions (saveFolder, referenceName, showInitialDateInFileName = true)

Parameters

saveFolder String. Folder path where to save the file.
referenceName String. Reference name for the file.
showInitialDateInFileName Boolean (optional). Add the StartDate of the simulation to the filename if True (e.g. yyyyMMddHH_referenceName.txt).

Errors

Invalid Operation Exception “Model not loaded”
Argument Null Exception “Reference name not defined”
Argument Null Exception “Save folder not defined”
Argument Exception “Save folder ‘saveFolder’ not valid”
Invalid Operation Exception “Failed to save initial conditions file”



SaveFinalConditionsAs Saving of the final conditions

Description

This procedure saves the conditions at the end of the simulation (in a text or an Excel format), at the specified location with the name: finalConditionsFullPath.

Syntax

SaveFinalConditionsAs (finalConditionsFullPath)

Parameters

finalConditionsFileFullPath String. Full path of the text or Excel file where to save the Final Conditions. The file extension has to be *.txt. or *.xlsx.

Errors

Invalid Operation Exception “Model not loaded”
Invalid Operation Exception “Model ‘hydrologicalmodel’ has no results”
Argument Null Exception “Fullpath not defined”
Argument Exception “Fullpath contains invalid characters”
Argument Exception “Fullpath not rooted”
Invalid Operation Exception “Failed to generate final conditions”
Invalid Operation Exception “Failed to create and save final conditions file”



SaveFinalConditions Saving of the final conditions

Description

This procedure saves the initial conditions at the end of the simulation as a text file, at the specified location with the specified reference name.

Syntax

SaveFinalConditions (saveFolder, referenceName, showInitialDateInFileName = true)

Parameters

saveFolder String. Folder path where to save the file.
referenceName String. Reference Name for the file.
showInitialDateInFileName Boolean (optional). Add the EndDate of the simulation to the filename if True (e.g. yyyyMMddHH_referenceName.txt).

Errors

Invalid Operation Exception “Model not loaded”
Invalid Operation Exception “Model ‘hydrologicalmodel’ has no results”
Argument Null Exception “Reference name not defined”
Argument Null Exception “Save folder not defined”
Argument Exception “Save folder ‘saveFolder’ not valid”
Invalid Operation Exception “Failed to generate final conditions”
Invalid Operation Exception “Failed to save final conditions file”



SaveParametersAs Saving of the parameters

Description

This procedure saves the parameters of the model (in a text or an Excel format), at the specified location with the name: parametersFullPath.

Syntax

SaveParametersAs (parametersFullPath)

Parameters

parametersFullPath Full path of the text or Excel file where to save the parameters. The file extension has to be *.txt. or *.xlsx.

Errors

Invalid Operation Exception “Model not loaded”
Argument Null Exception “Fullpath not defined”
Argument Exception “Fullpath contains invalid characters”
Argument Exception “Fullpath not rooted”
Invalid Operation Exception “Failed to create and save parameters file”



SaveParameters Saving of the parameters

Description

This procedure saves the parameters of the model as a text file, at the specified location with the specified reference name.

Syntax

SaveParameters (saveFolder, referenceName)

Parameters

saveFolder String. Folder path where to save the file.
referenceName String. Reference Name for the file.

Errors

Invalid Operation Exception “Model not loaded”
Argument Null Exception “Reference name not defined”
Argument Null Exception “Save folder not defined”
Argument Exception “Save folder ‘saveFolder’ not valid”
Invalid Operation Exception “Failed to save parameters file”

12.7 Model results

SaveFullResultsAs Saving of all the results

Description

This procedure saves the full results dataset of the simulation in a binary or a text format, at the specified location with the name: resultsDatasetFullPath.

Syntax

SaveFullResultsAs (resultsDatasetFullPath, saveDataInDstFile)

Parameters

resultsDatasetFullPath String. Full path of the file where to save the full results dataset. The file extension has to be *.dsx.
saveDataInDstFile Boolean. If true the dataset values are saved in text format (*.dst), if false in binary format (*.dsb).

Errors

Invalid Operation Exception “Model not loaded”
Invalid Operation Exception “Model ‘hydrologicalmodel’ has no results”
Argument Null Exception “Fullpath of full results dataset not defined”
Argument Exception “Fullpath of full results dataset contains invalid characters”
Argument Exception “Filename extension of full results dataset not valid”
Argument Exception “Fullpath of full results dataset not rooted”
Invalid Operation Exception “Failed to create and save full results dataset”



SaveFullResults Saving of all the results

Description

This procedure saves the full results dataset of the simulation in a binary or a text format, at the specified location with the specified reference name and with or without the simulation length (in hours) in the name.

Syntax

SaveFullResults (saveFolder, referenceName, saveDataInDstFile, showDurationInFileName, showInitialDateInFileName = true)

Parameters

saveFolder String. Folder path where to save the file.
referenceName String. Reference Name for the file.
saveDataInDstFile Boolean. If true the dataset values are saved in text format (*.dst), if false in binary format (*.dsb).
showDurationInFileName Boolean. If true it adds the duration in hours of the simulation in the filename (e.g. referencename_nbHoursH.txt).
showInitialDateInFileName Boolean (optional). If true it adds the StartDate of the simulation to the filename (e.g. yyyyMMddHH_referencename.txt).

Errors

Invalid Operation Exception “Model not loaded”
Invalid Operation Exception “Model ‘hydrologicalmodel’ has no results”
Argument Null Exception “Reference name not defined”
Argument Null Exception “Save folder not defined”
Argument Exception “Save folder ‘saveFolder’ not valid”
Invalid Operation Exception “Failed to save full result”



SaveSelectionResultsAs Saving of selection results

Description

This procedure saves the results dataset of the selection in a binary or a text format, at the specified location with the name: selectionResultsDatasetFullPath.

Syntax

SaveSelectionResultsAs (selectionResultsDatasetFullPath, saveDataInDstFile, selectionName)

Parameters

selectionResultsDatasetFullPath String. Full path of the file where to save the selection results dataset. The file extension has to be *.dsx.
saveDataInDstFile Boolean. If true the dataset values are saved in text format (*.dst), if false in binary format (*.dsb).
selectionName String. Name of the selection of results.

Errors

Invalid Operation Exception “Model not loaded”
Invalid Operation Exception “Model ‘hydrologicalmodel’ has no results”
Argument Null Exception “Fullpath of selection results dataset not defined”
Argument Exception “Fullpath of selection results dataset contains invalid characters”
Argument Exception “Filename extension of selection results dataset not valid”
Argument Exception “Fullpath of selection results dataset not rooted”
Argument Exception “Selection ‘selectionname’ not valid”
Invalid Operation Exception “Failed to create and save selection results dataset



SaveSelectionResults Saving of selection results

Description

This procedure saves the results dataset of the selection in a binary or a text format, at the specified location with the specified reference name and with or without the simulation length (in hours) in the name.

Syntax

SaveSelectionResults (saveFolder, referenceName, saveDataInDstFile, selectionName, showDurationInFileName, showInitialDateInFileName = true)

Parameters

saveFolder String. Folder path where to save the file.
referenceName String. Reference Name for the file.
saveDataInDstFile Boolean. If true the dataset values are saved in text format (*.dst), if false in binary format (*.dsb).
selectionName String. Name of the selection of results. This selection name will be included in the filename.
showDurationInFileName Boolean. If true it adds the duration in hours of the simulation in the filename (e.g. referencename_nbHoursH_selectionname.txt).
showInitialDateInFileName Boolean (optional). If true it adds the StartDate of the simulation to the filename (e.g. yyyyMMddHH_referencename_selectionname.txt).

Errors

Invalid Operation Exception “Model not loaded”
Invalid Operation Exception “Model ‘hydrologicalmodel’ has no results”
Argument Null Exception “Reference name not defined”
Argument Null Exception “Save folder not defined”
Argument Exception “Save folder ‘saveFolder’ not valid”
Argument Null Exception “Selection not defined”
Argument Exception “Selection ‘selectionName’ not valid”
Invalid Operation Exception “Failed to save selection results”



SaveInitializationDatasetAs Saving of series of state variables

Description

This procedure saves a dataset containing only the necessary state variables to initialize the model (i.e. the initial conditions of all the objects), at the specified location with the specified reference name and with or without the simulation length (in hours) or the initial date in the name.

Syntax

SaveInitializationDatasetAs (saveFolder, referenceName, saveDataInDstFile, showDurationInFileName, showInitialDateInFileName = true)

Parameters

saveFolder String. Folder path where to save the file.
referenceName String. Reference Name for the file.
saveDataInDstFile Boolean. If true the dataset values are saved in text format (*.dst), if false in binary format (*.dsb).
showDurationInFileName Boolean. If true it adds the duration in hours of the simulation in the filename (e.g. referencename_nbHoursH.dsx).
showInitialDateInFileName Boolean (optional). If true it adds the StartDate of the simulation to the filename (e.g. yyyyMMddHH_referencename.dsx).

Errors

Invalid Operation Exception “Model not loaded”
Invalid Operation Exception “Model has no results”
Argument Null Exception “Reference name not defined”
Argument Null Exception “Save folder not defined”
Argument Exception “Save folder not valid”
Invalid Operation Exception “Failed to save full results”



SaveInitializationDataset Saving of series of state variables

Description

This procedure saves a dataset containing only the necessary state variables to initialize the model (i.e. the initial conditions of all the objects).

Syntax

SaveInitializationDataset (resultsDatasetFullPath, saveDataInDstFile)

Parameters

resultsDatasetFullPath String. Full path of the file where is the full results dataset. The file extension has to be *.dsx.
saveDataInDstFile Boolean. If true the dataset values are saved in text format (*.dst), if false in binary format (*.dsb).

Errors

Invalid Operation Exception “Model not loaded”
Invalid Operation Exception “Model has no results”
Argument Null Exception “Fullpath of full results dataset not defined”
Argument Exception “Fullpath of full results dataset contains invalid characters”
Argument Exception “Filename extension of full results dataset not valid”
Argument Exception “Fullpath of full results dataset not rooted”
Invalid Operation Exception “Failed to create and save full results dataset”



ExportResultsTo Exporting of the selection results

Description

This procedure exports the selection results to an Excel or CSV file at the specified location with the name: selectionFileFullPath.

Syntax

ExportResultsTo (selectionFileFullPath, selectionName)

Parameters

selectionResultsFileFullPath String. Full path of the selection results file. Accepted file extensions are *.csv and *.xlsx.
selectionName String. Name of the selection of results.

Errors

Invalid Operation Exception “Model not loaded”
Invalid Operation Exception “Model ‘hydrologicalmodel’ has no results”
Argument Null Exception “Fullpath not defined”
Argument Exception “Fullpath of selection results contains invalid characters”
Argument Exception “Fullpath of selection results dataset not rooted”
Argument Exception “Selection ‘selectionName’ not valid”
Argument Exception “Fullpath extension not valid”
Invalid Operation Exception “Failed to create and save selection results”



MergeFullResults Merging of full results dataset with the base full dataset

Description

This procedure merges full results from the current simulation with the specified full results dataset (containing the same structure).

Syntax

MergeFullResults (resultsDatasetFullPath, saveDataInDstFile)

Parameters

resultsDatasetFullPath String. Full path of full results dataset. The file extension has to be *.dsx.
saveDataInDstFile Boolean. If true the dataset values are saved in text format (*.dst), if false in binary format (*.dsb).

Errors

Invalid Operation Exception “Model not loaded”
Invalid Operation Exception “Model ‘hydrologicalmodel’ has no results”
Argument Null Exception “Fullpath of full results dataset not defined”
Argument Exception “Fullpath of full results dataset contains invalid characters”
Argument Exception “Filename extension of full results dataset not valid”
Argument Exception “Fullpath of full results dataset not rooted”
Invalid Operation Exception “Failed to create new full results dataset”
Invalid Operation Exception “Full results dataset not valid”
Invalid Operation Exception “Failed to retrieve results to update full results dataset”
Invalid Operation Exception “Failed to merge results with full results dataset”
Invalid Operation Exception “Failed to save changes in full results dataset”



MergeSelectionResults Merging of selection results dataset with the base selection dataset

Description

This procedure merges the selection results from the current simulation with the specified selection results dataset (containing the same structure).

Syntax

MergeSelectionResults (selectionResultsDatasetFullPath, saveDataInDstFile, selectionName)

Parameters

selectionResultsDatasetFullPath String. Full path of the selection results file. The file extension has to be *.dsx.
saveDataInDstFile Boolean. If true the dataset values are saved in text format (*.dst), if false in binary format (*.dsb).
selectionName String. Name of the selection of results

Errors

Invalid Operation Exception “Model not loaded”
Invalid Operation Exception “Model ‘hydrologicalmodel’ has no results”
Argument Null Exception “Fullpath of selection results dataset not defined”
Argument Null Exception “Selection not defined”
Argument Exception “Selection ‘selectionName’ not valid”
Argument Exception “Fullpath of selection results dataset contains invalid characters”
Argument Exception “Filename extension of selection results dataset not valid”
Argument Exception “Fullpath of selection results dataset not rooted”
Invalid Operation Exception “Failed to create new selection results dataset”
Invalid Operation Exception “Selection results dataset not valid”
Invalid Operation Exception “Failed to retrieve results to update selection results dataset”
Invalid Operation Exception “Failed to merge results with selection results dataset”
Invalid Operation Exception “Failed to save changes in selection results dataset”



MergeDatasetsAs Merging of a source dataset with another dataset

Description

This procedure merges a source dataset with a specified dataset (containing the same structure) at a specific location. If two stations have the same name, it can merge the data of both stations; the second dataset is prioritized for the merge of common dates in common stations.

Syntax

MergeDatasetsAs (nDataset1, nDataset2, MergedDatasetFullPath, merge=true, saveDataInDstFile=true)

Parameters

nDataset1 String. Full path of the first dataset to be merged. The file extension has to be *.dsx.
nDataset2 String. Full path of the second dataset to be merged. The file extension has to be *.dsx.
MergedDatasetFullPath String. Full path of the dataset where the 2 datasets will be merged. The file extension has to be *.dsx.
merge Boolean. If true, the resulting dataset merge the data of stations with the same name. If false, it duplicates one of the stations with a “_(0)” suffix.
saveDataInDstFile Boolean. If true, the dataset values are saved in text format (*.dst), if false in binary format (*.dsb).

Errors

Argument Null Exception “First dataset not defined”
Argument Null Exception “Second dataset not defined”
Argument Null Exception “Fullpath of merged dataset not defined”
Argument Exception “Fullpath of full merged dataset contains invalid characters”
Argument Exception “Filename extension of merged dataset not valid”
Argument Exception “Fullpath of full merged dataset not rooted”
Invalid Operation Exception “First dataset not valid”
Invalid Operation Exception “Second dataset not valid”
Invalid Operation Exception “Failed to create merged dataset”



MergeDatasets Merging of a source dataset with another dataset

Description

This procedure merges a source dataset with a specified dataset (containing the same structure) and saves the resulting dataset in the source dataset. If two stations have the same name, it can merge the data of both stations; the second dataset (update dataset) is prioritized for the merge of common dates in common stations.

Syntax

MergeDatasets (sourceDatasetFullPath, updateDatasetFullPath, merge=true)

Parameters

sourceDatasetFullPath String. Full path of the source dataset where the new dataset is added. The file extension has to be *.dsx.
updateDatasetFullPath String. Full path of the update dataset to be added to the source dataset. The file extension has to be *.dsx.
merge Boolean. If true, the resulting dataset merge the data of stations with the same name. If false, it duplicates one of the stations with a “_(0)” suffix.

Errors

Argument Null Exception “First dataset not defined”
Argument Null Exception “Second dataset not defined”
Invalid Operation Exception “First dataset not valid”
Invalid Operation Exception “Second dataset not valid”
Invalid Operation Exception “Failed to merge datasets”



GetPropertyValue Getting property value from an object

Description

This function gets the value of a parameter or an initial condition of an object.

Syntax

GetPropertyValue (objectType, propertyName, zone = null)

Parameters

objectType String. Object type (e.g. SOCONT, GSM, Reservoir, etc.). See Table 12.2.
propertyName String. Property name (e.g. HGR3Max). See Table 12.2.
zone String (optional). Zone where the objects are.

Returned value

property value It returns the property value (parameter or initial condition) of the object.

Errors

Invalid Operation | “Model not loaded” Exception
Argument Exception “Object type ‘objectType’ not valid”
Argument Null Exception “Property name not defined”
Argument Exception “Zone ‘zone’ not found in hydrological model”
Invalid Operation Exception “Failed to provide model property”
Invalid Operation Exception “Model property not found”



GetIndicatorValue Getting the value of an indicator from a comparator

Description

This function gets the specified indicator value from a Comparator object.

Syntax

GetIndicatorValue (indicatorName, objectName)

Parameters

indicatorName String. Indicator name. Indicators: Nash, Nash-ln, Pearson Correlation Coeff, Kling-Gupta Efficiency, Bias Score, RRMSE, Relative Volume Bias, Normalized Peak Error
objectName String. User-defined object name.

Returned value

indicator value It returns the value of the indicator.

Errors

Invalid Operation Exception “Model not loaded”
Argument Exception “Comparator ‘objectName’ not found”
Argument Exception “Indicator name ‘indicatorName’ not valid”

12.8 Calibration

LoadCalibrationsInModel Loading of all the calibrations defined in a model

Description

This procedure loads all the calibration configurations defined in the opened model.

Syntax

LoadCalibrationsInModel ()

Errors

Invalid Operation Exception “Model not loaded”



LoadCalibrationsByFile Loading of all the calibration configurations defined in a configuration file

Description

This procedure loads all the calibration configurations defined in a specified configuration file.

Syntax

LoadCalibrationsByFile (filePath)

Parameters

filePath String. Full path of the calibration configuration file defined in the Calibrator module of RS MINERVE. The file extension has to be *.cbt.

Errors

Argument Null Exception “File path is not defined”
Argument Exception “Selected file is not a XML file”
Invalid Operation Exception “No Calibration configuration is loaded”



SaveAllCalibrationsInModel Saving all calibration configurations in the RSM model

Description

This procedure saves all the calibration configurations in the loaded RSM model. Configurations will then be saved in the .rsm file).

Syntax

SaveAllCalibrationsInModel ()

Errors

Invalid Operation Exception “Model not loaded”



RunCalibration Running a specified calibration

Description

This procedure runs a specified calibration available among the loaded configuration(s).

Syntax

RunCalibration (configName, logFilePath, deleteLogAfter=false)

Parameters

configName String. Name given in the Calibrator module of RS MINERVE to the calibration configuration to be executed.
logFilePath String. Full path of the log file where the logs are written.
deleteLogAfter Boolean. If true, the log file is deleted after the calibration process is ended.

Errors

Argument Null Exception “The name of the calibration configuration is not defined”
Argument Exception “No calibration configuration called configName”
Invalid Operation Exception “The model has fatal errors and cannot continue”



RunAllCalibrations Running all the calibrations

Description

This procedure runs all the calibration configurations previously loaded.

Syntax

RunAllCalibrations (logFilePath, deleteLogAfter=false)

Parameters

logFilePath String. Full path of the log file where the logs are written.
deleteLogAfter Boolean. If true, the log file is deleted after the calibration process is ended.

Errors

Invalid Operation Exception “The model has fatal errors and cannot continue”



ExportCalibrationResults Exporting of the calibration’s results

Description

This procedure exports the results of a specified calibration, to a .txt file.

Syntax

ExportCalibrationResults (configName, resultFilePath)

Parameters

configName String. Name given in the Calibrator module of RS MINERVE to the calibration configuration to be executed.
resultFilePath String. Full path of the file where to save the calibration results. The file extension has to be *.txt.

Errors

Argument Null Exception “The name of the calibration configuration is not defined”
Argument Exception “The file path for the results is not defined”
Argument Exception “No calibration configuration called configName”
Invalid Operation Exception “There are no results to export in calibration configName”



ExportAllCalibrationsResults Exporting of all the calibrations’ results

Description

This procedure exports the results of all the calibration configurations loaded, to a .txt file.

Syntax

ExportAllCalibrationsResults (resultFolderPath)

Parameters

resultFolderPath String. Folder path to export the results of all the calibration configurations. The exported results file is named as ConfigName.txt, where ConfigName is the name of each calibration configuration executed.

Errors

Argument Null Exception “The folder path for the results is not defined”
Argument Exception “Selected folder does not exist”
Invalid Operation Exception “There are no results to export for some calibrations”



SetCalibrationDates Setting of the start and end dates of the calibration period

Description

This procedure defines the start and end dates of the period used by the Calibrator module to execute the calibration.

Syntax

SetCalibrationDates (configName, startDate, endDate)

Parameters

configName String. Name given in the Calibrator module of RS MINERVE to the calibration configuration for which the start and end dates are to be set.
startDate Date. Start date for the calibration period. The format of the date has to be: dd.MM.yyyy HH:mm:ss.
endDate Date. End date for the calibration period. The format of the date has to be: dd.MM.yyyy HH:mm:ss.

Errors

Invalid Operation Exception “Model not loaded”
Argument Null Exception “The name of the calibration configuration is not defined”
Argument Exception “No calibration configuration called configName”

12.9 Application Stop

Stop Stop of the execution

Description

This procedure stops the execution of the model.

Syntax

Stop ()

12.10 Other procedures/functions

RemoveFile Removing any type of files

Description

This procedure remove for the computer any file given by its full path.

Syntax

RemoveFile (fileFullPath)

Parameters

fileFullPath String. Full path of the file to be removed. The file extension of the file must be specified.

Errors

Argument Null Exception “File not defined”
Argument Exception “File not found”
Invalid Operation Exception “Failed to remove the file”



GetAppVersion Getting the installed RS MINERVE software version

Description

This function gets the version number of the installed RS MINERVE software.

Syntax

GetAppVersion ()

Returned value

Software version It returns the version number of the installed RS MINERVE software (e.g., 2.6.2.0).



GetReaderVersion Getting the installed model reader (xml) version

Description

This function gets the number of the installed model reader (xml) version.

Syntax

GetReaderVersion ()

Returned value

Reader version It returns the number of the installed model reader (xml) version (e.g., 4.001).

12.11 Objects nomenclature in VBScript

When using VBScripts to perform tasks within RS MINERVE, it is necessary to indicate the type of the object or the name of a property as arguments for some functions (DefineModelProperties, UpdateModelProperties and GetPropertyValue). Table 12.2 gathers the proper nomenclatures of these arguments to be used in the corresponding VBScripts functions.

Table 12.2: Nomenclature of objects, parameters and initial condition to be used in the GetPropertyValue function
ObjectType Parameters Initial conditions
Station X, Y, Z, Search Radius, No. min. of stations, Gradient P, Gradient T, Gradient ETP, Coeff P, Coeff T, Coeff ETP -
SnowSD S, SInt, SMin, SPh, ThetaCri, bp, Tcp1, Tcp2, Tcf SWEIni, ThetaIni
SWMM A, L, J0, K HIni
GSM A, S, SInt, SMin, SPh, ThetaCri, bp, Tcp1, Tcp2, Tcf, G, GInt, GMin, Tcg, Kgl, Ksn SWEIni, ThetaIni, QsnowIni, QglacierIni, HglacierIni
SOCONT A, S, SInt, SMin, SPh, ThetaCri, bp, Tcp1, Tcp2, Tcf, HGR3Max, KGR3, L, J0, Kr SWEIni, ThetaIni, HGR3Ini, HrIni
HBV A, CFMax, CFR, CWH, TT, TTInt, TTSM, Beta, FC, PWP, SUMax, Kr, Ku, Kl, Kperc SWEIni, WHIni, HumIni, SUIni, SLIni
GR4J A, X1, X2, X3, X4 Sini, RIni
SAC A, Adimp, Pctim, Riva, UztwMax, UzfwMax, Uzk, Zperc, Rexp, Pfree, LztwMax, LzfpMax, LzfsMax, Rserv, Lzpk, Lzsk, Side AdimIni, UztwIni, UzfwIni, LztwIni, LzfpIni, LzfsIni
LagTime L, B0, m, J0, K, lag Qini
Kinematic L, B0, m, J0, K, N Qini
MuskingumCunge L, B0, m, J0, K, N Qini
StVenant L, B0, m, J0, K, N Qini
Reservoir - Hini, HvarIni
Hydropower Zplant, L, D, K, ν, Default Price -
Consumer Default QDemand, LossRate, ConsumptionRate -
StructureEfficiency Efficiency -