skip to main content
RiverSMART Help : RiverSMART Event Reference : RiverWare DMI Sequence Event
RiverWare DMI Sequence Event
The RiverWare DMI Sequence event allows you to specify a sequence of initial conditions for RiverSMART scenarios. The RiverWare Data Management Interface (DMI) provides a mechanism for importing data to a RiverWare model.
If you link a DMI Sequence event to the RiverWare event in the RiverSMART workspace, multiple DMI configurations are included as variables in the generation of RiverSMART scenarios. The DMI configurations generated by RiverSMART are passed to RiverWare before RiverWare executes. They are used to configure the DMI in the model for RiverWare execution.
Example 5.3  Example DMI Sequence configuration
You have a model that generates 100 sets of data, each of which may be a set of initial conditions for RiverSMART scenarios. The initial condition sets are named sequentially, in either of the following ways:
• As Excel workbook sheets
• As file system folders
You can configure 100 instances of the DMI Event—one for each set of initial conditions—but this is a tedious and error-prone process, and it will clutter the RiverSMART workspace. A better alternative is to configure one instance of the DMI Sequence event for the 100 sets of initial conditions, as shown in the following DMI Sequence Configuration window.
Note:  In this section, the term sets of input is used to refer to sets of initial conditions.
See RiverWare DMI Event for details about that event.
DMI Sequence Configuration Window
This window opens when you open a DMI Sequence event on the RiverSMART workspace.
Name
Enter a user-defined unique name for the DMI Sequence event. This name is used in naming scenarios in RiverSMART.
DMI Configuration frame
Name
The menu lists all DMIs in the RiverWare model that have the type selected in the DMI Type field. Select the name of the DMI you want to use. If the name does not match a DMI in the model—for example, if the DMI was deleted from the model—the text box is highlighted yellow to indicate the error.
Category
Enter a user-defined category name. This allows you to group DMI Sequence events on the RiverSMART workspace that import similar data. The category is used when RiverSMART scenarios are generated; for example all DMIs with the “Supply” category would be considered as alternative choices in the Supply dimension when inputs to the RiverWare event are combined into alternative scenarios.
Note:  These DMIs are executed as MRM pre-run (initialization) DMIs, which are executed once before a multiple run is started.
DMI Type
Select the DMI type, as follows.
• Direct Connect; see Direct Connect DMI.
• Control File / Executable; see Control File / Executable DMI.
DMI Sequence
Enter the starting and ending numbers of the input set sequence to be used. The sequence is used to configure Excel worksheet names and file system folder names.
Sequence Digits
Enter the number of digits used to format the sequence numbers in scenario names. At a minimum, the value must be the number of digits necessary to represent the largest sequence number. This entry enables the input sets to sort in a natural order—for example, if you enter “2”, 09 sorts before, rather than after, 10. The field is necessary because the sequence may be extended.
For example, if the event is originally configured for input sets 1 to 50, the event can use two digits to identify the sequence; however, if the event is later configured for input sets 1 to 100, the input set names will change from two to three digits—that is, 01 to 001—and when scenarios are regenerated, this name change will cause scenarios to be removed unnecessarily. If, instead, you anticipate the maximum number of digits when you define this field, you will be able to extend the sequence later, without changing input set names.
Direct Connect DMI
If you select the Direct Connect option in the DMI Type field, the DMI Sequence Configuration window appears as follows.
Direct Connect Datasets frame
In this frame, you can modify the datasets specified for the DMI in the RiverWare model.
Note:  The DMI Sequence event supports Excel datasets only.
To add a new dataset to the list, select Plus. To remove a selected dataset, select Minus. When you add a dataset, the following fields are available.
Dataset Name
Required field. Specify the name of the dataset to use. You can select the name from the menu, which lists all the Excel datasets in the RiverWare model, or you can enter the name directly in the text box. This entry must match exactly the name of an Excel dataset configured for the DMI in the RiverWare model. If the entry does not match—for example, if the dataset was deleted from the model—the text box is highlighted yellow to indicate the error.
Type
Display only. Indicates the dataset is an Excel workbook.
Workbook
Optional field. Open the field and enter the path for the Excel workbook to use as input when the DMI is invoked; this entry overrides the workbook path specified for the Excel dataset in the RiverWare model.
Worksheet Sequence
Optional field. Open the field and enter the base name of the input set sheets. The index of the current input set is appended to this entry to configure the dataset to use the appropriate sheet when the DMI is invoked; for example, sheet Set37.
Control File / Executable DMI
If you select the Control File / Executable option in the DMI Type field, the DMI Sequence Configuration window appears as follows.
Folder Containing Data
Specify the folder that includes the input set folders. You can enter the path in the text box or select it through the File Chooser. The path can include environment variables.
Sequence Name
Enter the base name of the input set folders. The index of the current input set is appended to the sequence name to inform the DMI which input set folder to use.
Control File
Optional field. The control file identifies slots and the data files they import, as well as information such as units and scale. You can enter the path in the text box or select it through the File Chooser. The path can include environment variables. This overrides the control file path configured for the DMI in the RiverWare model.
Example 5.4  Example control file
Following is an example control file.
DeepLake.Inflow: file=C:\TestData\DeepLake.Inflow units=cfs scale=1000
When the DMI is invoked, it replaces the path in the control file with the current input set folder; for example:
DeepLake.Inflow: file=C:\InputSets\Set37\DeepLake.Inflow units=cfs scale=1000
If the file keyword is not specified, it is added to the entry with the current input set folder and the following file name:
%o.%s
where:
– %o is the object name.
– %s is the slot name.
Revised: 12/06/2024