Skip to content

Latest commit

 

History

History
42 lines (28 loc) · 1.61 KB

STEMMUS_SCOPE_BMI.md

File metadata and controls

42 lines (28 loc) · 1.61 KB

STEMMUS_SCOPE BMI

STEMMUS_SCOPE has a BMI-like interface. This is available when running the Matlab Runtime version of the model. The full BMI is implemented in Python in PyStemmusScope.

A Docker image will also be available, which allows you to run the model on any system without installing Matlab Runtime.

BMI mode

When starting the executable, a run-mode can be specified. The following command will run the model using the config file:

./STEMMUS_SCOPE "/home/path/to/config/file.txt" full

(Where ./STEMMUS_SCOPE is the path to the executable. For more info see documentation)

To start BMI mode, pass anything (e.g. an empty string "") as config file, and use bmi to start the model in BMI-mode:

./STEMMUS_SCOPE "" bmi

The model will respond with Finished command. Select run mode: . Now you can initialize the model:

Finished command. Select run mode: initialize "/home/path/to/config/file.txt"

The model will respond with:

Reading config from /home/path/to/config/file.txt
Finished model initialization

Now you can use the commands update to advance the model by one timestep, and finalize to finalize the model.

Exposing variables to BMI interface

The variables which are exposed to the Python BMI are defined in STEMMUS_SCOPE_exe.m. To add more variables, update the bmiVarNames variable. After this, you will need to change the BMI codes in PyStemmusScope so it can make use of these exposed variables.