MIKE SHE Adapter¶
The MIKE SHE adapter enables use of MIKE SHE model setups within the MIKE Workbench.
About MIKE SHE¶
MIKE SHE is a Software developed by DHI Group for Integrated catchment hydrological modelling. Please refer to MIKE BY DHI for more information.
Prerequisite¶
The Adaptor requires MIKE SHE to be installed on the MIKE Workbench computer (for registration) and the run machine. The execution of models will require a license on the run machine.
Supported Model objects¶
Supported model objects.
- Evaporation Rate
- Precipitation Rate
- Air Temperature
- SW Solar Radiation
- Degree-Day coefficient
- Well
- Detailed Output
- Detailed Output MIKE+
Types 1-5 all support: - Spatial distribution: Uniform or via polygon shape file. - Temporal distribution: Constant or via time series.
Furthermore, the model object will show the name and location of the input.
Type 6, Wells will register name, location, and for each filter, the filter time series and location in the well.
Only time series can be modified from the MIKE Workbench.
Configuration¶
Model preparation¶
The model must have been successfully executed.
Registration¶
The MIKE SHE model should be registered from within the Scenario Explorer of MIKE Workbench. The below screens show how the registration could look like.
When registering a model, an entry for the MIKE SHE model will appear.
When selecting model type MIKE SHE, the Model register wizard will display a dialog where the necessary MIKE SHE model information can be specified.
Model registration wizard (Page 1) - Registration information
Click Next to continue.
Model registration wizard (Page 2) - Model information
Select the MIKE SHE model file (.she) to register and specify the name of the model setup once registered.
Click Next to continue.
Model registration wizard (Page 3) - Additional Files
On the third page of the model registration wizard, additional files can be selected. From the context menu of the tree, the files can be selected or removed. Selection is done from an open file dialog.
It is required that files selected must be on the same drive/disk, so that a common root of the additional files and the native MIKE vSHE files can be found.
The selected files are shown in a tree with one level, with their full path and name. Selected files will be added to the model zip file containing the native MIKE SHE files, so that they are available when selecting Open in native tool on the model setup in the Scenario Manager of MIKE Workbench.
Click Prepare for registration
After clicking the Finish button, the MIKE SHE model will be loaded, and the result of the MIKE SHE model parsing will be displayed on the Time series Link Page.
Click Next to display the default Specifications page.
Specify the necessary information and click Finish to register the model.
Note
If your model does not use an EPSG coordinate system, please read this faq.
Execution¶
- Export model data to MIKE SHE model file *.SHE
- Use a wrapped class (based on pfs) in MO to update the model data
- Use
MSHE_Simulation.exe
to run a simulation
Change engine¶
The launch command can be changed in the MIKE SHE Adapter.xml
created during model registration.
<?xml version="1.0"?>
<MIKESHEAdapter>
<!-- ... -->
<SHEFilePath>Karup_Basic\Karup_basic.she</SHEFilePath>
<LaunchCmd>MSHE_SImulation.exe</LaunchCmd>
<LaunchArguments>
</LaunchArguments>
<LaunchSilentArguments>/Silent</LaunchSilentArguments>
<EditModelCmd>MZShell.exe</EditModelCmd>
<Folders>
<String>Karup_Basic</String>
<String>Karup_Mhydro</String>
<String>Karup_Basic\Model Inputs</String>
<String>Karup_Basic\Model Inputs\GIS Data</String>
<String>Karup_Basic\Model Inputs\Maps</String>
<String>Karup_Basic\Model Inputs\Time</String>
<String>Karup_Mhydro\GIS data</String>
</Folders>
</MIKESHEAdapter>
Updating the launch command requires that the model setup is exported e.g. using the Open in Native Tool or by using an export script, so that that the MIKE SHE Adapter.xml
can be changed.
After changing the MIKE SHE Adapter.xml
file, the exported model, should be zipped and imported again, e.g. by using an zip and import script in the script manager.
def ReZipSetup(modelSetupPath, directory):
"""
<Script>
<Author>admin</Author>
<Description>Script to zip a folder and assign the result as content to a modelsetup, ths updating the blob</Description>
<Parameters>
<Parameter name="modelSetupPath" type="string">The full path of the model setup in the database (copy Full Path)</Parameter>
<Parameter name="directory" type="string">The directoy path in windows where the setup has been unpacked</Parameter>
</Parameters>
</Script>
"""
if (System.IO.Directory.Exists(directory) == False):
return;
scm = app.Modules.Get("Scenario Manager");
modelsetup = scm.ModelSetupList.Fetch(modelsetupPath);
zipptr = BaseAdapter.ZipFiles(directory, None, "no Adapter");
modelsetup.Content = zipptr;
scm.ModelSetupList.Update(modelsetup, True);
Warning
Be carefull when editing the model information and importing the changes, as the model information is used as when running simulation.
Open in Native Tool¶
After registration, the MIKE SHE model can be - opened in native mode. This is done by selecting Open in Native Tool from the context menu of the Model Setup.
By default, the MIKE SHE model will be opened in MIKE Zero.
When unchecking Open MIKE SHE, the MIKE SHE model content will be unzipped into a temporary folder in the user's default temp folder %temp%
.
The folder will contain any native MIKE SHE files as well as the selected additional folders and files.
Limitations¶
-
SHE-file must be in the root folder of the setup.
-
All files in directory structure from the root folder and down (except result files) are zipped during registration, so reduce the size of data files and remove unnecessary files.
-
An eventual MIKE+ model included with the MIKE SHE setup is not explicitly parsed for model objects; hence any necessary input time series must be added manually via the adapter UI.
-
All referenced shape files must share a common projection which is valid in the MIKE Workbench for the feature information to be included.
-
Hotstart is not yet supported.