Skip to content

Concept

A model can be for different purposes and could be built using different modelling tools like MIKE 11, MIKE 21, MIKE SHE, etc… Therefore, to provide Users with an option to register any type of model with MIKE WORKBENCH, this adapter has been created.

It does not provide the user with full flexibility of editing different options via MIKE WORKBENCH but still enables users to register their models by writing a configuration file. The configuration file should adhere to an xml schema which is mentioned later in this document.

It also provides users with an option to register their FLOOD WATCH models without having to write the configuration file. But for this to work, the user needs to follow a strict predefined FLOOD WATCH folder structure. The required folder structure is also mentioned later in this document.

Prerequisites

The configuration and execution of models into MIKE WORKBENCH using this adapter will require:

  • Configuration file describing model setup. E.g. The model setup files, other output files, model object types, model objects and their input, output and spatial output time series etc..

  • Time series are assumed to be single item DFS0 time series.

  • The spatial time series are assumed to be single item DFS2.

  • Hotstart.xml file containing hotstart start and end date times in corresponding hotstart input and output folders. These files also need to follow a specified schema mentioned later in this document, and are required if hotstart is used

  • If user is registering a FLOOD WATCH model and a predefined folder structure is followed then also user can register the model in MIKE WORKBENCH via this adapter. User can optionally specify hotstart start and end date time in a hotstart.cfg file which is described later in this document.

    If not specified via the file, user has to specify them via the UI.

Configuration

This section describes the xml schema of the configuration file to be created for registering the model via this adapter. Also a sample configuration file is provided. In the configuration file a user can specify launch commands. Launch command can be either of type ‘file’ or ‘script’ as shown below:

\<LaunchCmd CmdType="file">HSPF Run.bat\</LaunchCmd>

Or

\<LaunchCmd CmdType="script">/ScriptName\</LaunchCmd>

User can also specify multiple launch commands in the configuration file. They will be executed in the same order in which they are listed in the configuration file.

Input timeseries

The Generic adapter supports two formats of input and output time series – DFS0 and csv. A DFS0-file may contain multiple items. The csv-format assumes only one item per file. The csv-file looks like this:

cid:image001.png\@01D44ABF.8FF20980

Or like this when viewed in Excel:

cid:image002.png\@01D44ABF.8FF20980

I.e. it is a semi-colon separated file with two headers and two columns.

The first line may contain an item description in the form “\<Variable>[unit]:\<value type>”. If the variable, unit and value type translate into the MIKE Zero EUM system for DFS0-files, they will be used for defining the data series characteristics, otherwise the type will be undefined.

The second line contains “Time” in the first column and the item name in the second column.

From line 3, the columns contain date and time (preferably in the format “yyyy-MM-dd HH:mm:ss”) and a value with decimal point.

Configuration file

The configuration file is a XML-file listing the model setup files, other output files, model object types and model objects with it input, output, spatial output time series, hotstart folders.

The schema of the configuration file is found here

The sample configuration file is found here

The hotstart.xml schema for specifying hotstart start and end date times is found here

How to organize model setup files for FLOOD WATCH

Below is the screenshot showing predefined folder structure for FLOOD WATCH.

Figure 1 Sample of FLOOD WATCH model folder structure.

As shown in the above screenshot FLOOD WATCH model being registered should adhere to above shown folder structure.

  1. HOTSTART_INPUT: This folder contains the hotstart input files and the hotstart.xml(optional)

  2. HOTSTART_OUTPUT: This folder contains the hotstart output files. No need to have hotstart.xml in this folder.

  3. INPUT_DATA: This folder will contain all the input time series of the model.

  4. MODEL_FILES: This folder contains the other model files like the dynamic.cfg etc…

  5. OUTPUT_DATA: This folder contains the output time series.

  6. Configuration.xml: This is the main file which will be used by generic adapter to register the model.

  7. Configuration.cfg: This file is generated by generic adapter so no need to have this file initially.

Model registration

The following illustrates the registration process.

  1. From Scenario Manager in MIKE WORKBENCH the user selects “Register model”

  2. The user selects the Generic model adapter by selecting GENERIC option.

  3. The user provides the required (and optional ) input to the Generic Adapter

    1. Model setup name – the name of the model setup to be registered.

    2. Configuration file – Path of the configuration file to be used by generic adapter for registering the model in MIKE WORKBENCH.

    3. Coordinate system (optional) – Specify the coordinate system to be used by the adapter.

      If unspecified then the coordinate system will be taken up from the first model object type shape file specified in the configuration xml.

    4. Generate configuration (optional) – User can press this button if they are trying to register a FLOOD WATCH model which follows specified folder structure as shown earlier in this document.

  4. Clicking next will start the parsing of the model setup configuration file.

  5. Keep following through the model registration wizard.

  6. Eventually the model setup can be seen and used in Scenario Manager

Generate configuration option

If user selects Generate configuration button on the Generic adapter dialog, then below dialog will be prompted to the user.

  1. Root folder – This is the folder that contains the predefined folder structure of FLOOD WATCH model.

  2. Launch cmd – This can be either a script path in MIKE WORKBENCH or it can be a path to an executable or batch file.

  3. Hotstart start and end date times (optional if specified in hotstart.xml file) – These can be specified here in the UI or via the hotstart.xml file in the hotstart_input folder. The file schema is defined above in this document.

When user presses OK to this dialog, then a configuration file is created based on folder parsing in the selected root folder and the path of the newly generated configuration file is put in to the configuration file path in the previous dialog, as shown below.

Then user can specify the model name and click next to continue registering the model in MIKE WORKBENCH.