Instructions for adding a BMI to a model
Currently, these are only (very) loose notes gathered from recent work with Mariela and Scott.
Notes
What variables will your model accept as input, and provide as output? Consult the list of standard names.
However, don't use standard names in the input file for your model! (I'm trying to work around this, however.)
Python instructions. See examples on GitHub for C, C++, Fortran, Java (incomplete).
Metadata
The .bmi directory provides information on the model's BMI. It is used by CSDMS software engineers to transform the model into a CSDMS plug-and-play component.
Explain the four required files:
- api.yaml
- info.yaml
- parameters.yaml
- the model input file
Use CamelCase for the component name in api.yaml.
For example, "FrostNumberModel", not "Frost_Number_Model".
This is required by babel
.
Units
Parameters should be described with standard units. CSDMS uses the UDUNITS package developed by Unidata. UDUNITS follows the syntax for unit strings developed by NIST.
The UDUNITS manual has some useful information, especially Section 4.3, "What Gets Installed?", which lists the actual XML files used by UDUNITS. This I've found most useful -- on a machine where UDUNITS is installed, I've grepped these files for unit definitions.
Time
CSDMS has traditionally used days, d
, for time units.
Years, yr
, are also used.
We should really move to the SI standard of seconds, s
.
Model time should start at 0.0.