Work in Progress

Todo

For DelftOnlin/fm/3Di:

  • Cleanup dflowfm BMI module
  • Test new BMI calls with dflowfm
  • Adapt dflowfm variable list to generate.py
  • Extend generate.py for delft3d
  • Test new BMI calls with delft3d
  • Test new BMI calls with subgrid (tick)
  • Create bmi-runner in python (tick)
  • Create mmi-runner in python
  • Documentation bmi-python (bmi.readthedocs.org)
  • Documentation mmi-python (mmi.readthedocs.org)
  • General docs BMI + MMI on public wiki
  • Update Delft3D DelftOnline manual

For IEMSS/Hydroinformatics:

  • summarize BMI proposals/inconsistencies for discussion with Scott
  • Create bmi-runner (gui) in c#
  • Create mmi-runner (gui) in c#
  • Create example model in c
  • Create example model in c++
  • Create example model in fortran 90
  • Create example model in python (cython)
  • Documentation bmi-c# (autogenerated)
  • Documentation mmi-c# (autogenerated)
  • Generate mmi-lod runner

For model lab:

  • Discuss variables.f90 branch with XBeach people
  • Adapt xbeach variable list to generate.py
  • Test new BMI calls with xbeach
  • Implement variable list for xbeach

Later:

  • Extend generate.py for swan
  • Test new BMI calls with swan
  • Implement variable list for swan
  • Implement variable list for dflowfm
  • Implement variable list for subgrid
  • Implement variable list for delft3d

Required functions (serverside)

A model that is run by an MMI server should implement at least the following functions:
From BMI:

Model control:

  • initialize
  • update
  • finalize

Timestep:

  • get_time_step
  • get_time_units
  • get_start_time
  • get_current_time
  • get_end_time

Model information:

  • get_attribute
  • get_input_var_names
  • get_output_var_names

Metadata:

  • get_var_pointer # return the (void) pointer to the variable
  • get_var_type
  • get_var_rank
  • get_var_shape
  • get_var_attribute(name, attribute) # 'units', 'standard_name', 'long_name'

Set vars are not required as we have direct access to the pointer and can overwrite memory as we please. Variable pointers won't be accessed while the update is being called.

Functions that can be called by the model are:

  • log(LEVEL, message)

Required functions (clientside)

  • No labels

1 Comment

  1. set_var_values is required, since very frequently models require additional variables to be updated if something get's updated from the outside.

    get_var_values is missing.

    get_var_pointer should be marked as optional, or should be just get_var_value (return by pointer, if supported), or we need additional method to specify if model support changes in the variable directly (get_var_access_method) - will make API more messy. 

    What is the difference between Model information and Metadata? 

    Missing methods:

    get_attribute_count()

    get_variable_count()

    minor: maybe it is good to have get_var_role (input / output / input_output) instead of get_input_var_names get_output_var_names:

    get_var_count()
    get_var_names()
    get_var_roles()