Skip to content

csdms/bmi

Repository files navigation

The Basic Model Interface

DOI JOSS article Documentation Status License: MIT

The Basic Model Interface (BMI) is a standardized set of functions that allows coupling of models to models and models to data.

The Basic Model Interface (BMI), developed by the Community Surface Dynamics Modeling System (CSDMS), is a standardized set of control and query functions that, when added to a software element such as a model or a dataset, makes that software easier to couple with other software that also exposes a BMI.

A BMI makes a model self-describing and fully controllable by a modeling framework or application. By design, the BMI functions are straightforward to implement in any language, using basic data types from standard language libraries. Also by design, the BMI functions are noninvasive. This means that a model's BMI does not make calls to other components or tools and is not modified to use any framework-specific data structures. A BMI, therefore, introduces no dependencies into a model, so the model can still be used in a stand-alone manner.

The BMI is expressed in the Scientific Interface Definition Language (SIDL). From bmi.sidl, CSDMS has derived BMI specifications for five languages--C, C++, Fortran, Java, and Python. For each language, links to the specification and an example implementation are listed in the table below.

BMI languages
Language Specification Example implementation
C bmi-c bmi-example-c
C++ bmi-cxx bmi-example-cxx
Fortran bmi-fortran bmi-example-fortran
Java bmi-java bmi-example-java
Python bmi-python bmi-example-python

Detailed instructions for building the specifications and examples are given at each link above. Alternatively, the specifications can be installed through conda (C, C++, Fortran, Python) or Maven (Java). See the links above for details.

While CSDMS currently supports the languages listed above, a BMI specification can be written for any language. BMI is a community-driven standard; contributions that follow the contributor code of conduct are welcomed, and are acknowledged.

The table below lists community-contributed language specifications and examples for two languages, Javascript and Julia.

Community-contributed BMI languages
Language Specification Example implementation
Javascript bmi-js bmi-example-js
Julia bmi-julia bmi-example-julia

The default branch of this repository reflects the current state of development for the BMI. When implementing a BMI, please use the latest release listed in the right sidebar; currently this is Basic Model Interface 2.0. For more information on implementing a BMI, see the documentation.

BMI is open source software released under the MIT License. BMI is an element of the CSDMS Workbench, an integrated system of software tools, technologies, and standards for building and coupling models.

The Community Surface Dynamics Modeling System is supported by the National Science Foundation.