8. GLOFRIM API¶
8.1. Initialization¶
Before a coupled model can be run, the individual model have to be initialized and all exchanges between them must be defined.
Initializing the model configuration file. |
|
Initializes the model, ie loading all files and checking for consistency. |
|
Initializes the model following a two-step initialization procedure. |
|
Defines variable exchanges between models as well as unit and time conversions. |
8.2. Execution¶
GLOFRIM provides a range of functions to retrieve and change time information, update models, as well as exchange content between models during execution. These exchange functions are used inside the update function to exchange variables according to the setting in the exhanges section of the GLOFRIM ini file.
Provides current model time. |
|
Updating model for a certain time step interval (default: None). |
|
Updates the model until time t is reached with an update time step dt. |
|
Exchanges variable content from specified source variable in source model to a specified destination variable in the destination model. |
|
Exchanges variable content from specified source variable in source model to a specified destination variable in the destination model for the entire grid. |
|
Exchanges variable content from specified source variable in source model to a specified destination variable in the destination model for user-specified indices. |
8.2.7. Variable Getter and Setter Functions¶
Functions to retrieve and overwrite values for either entire grid or only certain indices.
Gets values of a certain exposed variable. |
|
Gets values at a specific index of a certain exposed variable. |
|
Overwriting of all values of a certain exposed variable with provided new values. |
|
Overwriting of value at specific entry of a certain exposed variable with provided new values. |
8.3. Finalization¶
It is possible to change model end times and finalize model states after execution.
Finalizes the model. |
8.4. Auxiliary functions¶
In addition, there are several auxiliary functions built in GLOFRIM to check states and properties of models as well as their components, variables, and attributs.
8.4.1. Model Information Functions¶
General information about model structure and variables.
Returns type of model. |
|
Returns component name of specified model. |
|
Returns list with all possible input variable names that can be used as exchange TO the specified model. |
|
Returns list with all possible output variable names that can be used as exchange FROM the specified model. |
8.4.2. Variable Information Functions¶
Providing information about properties of model variables.
Returns the type of a user-specified model variable exposed via BMI. |
|
Provides units of variable. |
|
Provides number of dimensions of variable. |
|
Providestotal number of values contained in variable. |
|
Provides shape of variable. |
|
Provides number of bytes of variable. |
|
Provides time unit of model. |
8.4.4. Attribute/ Config Information Functions¶
Functions providing insights in settings of model configuration files. Note that the set functions can only be used before model initialization.
Setting output directory of model. |
|
Provides time step of model. |
|
Overwriting default model start time with user-specified start time. |
|
Provides start time of model. |
|
Provides end time of model. |
|
Overwriting default model end time with user-specified end time. |
|
Provides list with all model attribute names from model config file. |
|
gets attribute value in in underlying model. |
|
sets attribute value in underlying model. |