-
Notifications
You must be signed in to change notification settings - Fork 51
FABM 2.0
This page describes the upcoming FABM 2.0 release, which is currently available from branch 2.0rc1.
FABM 2.0 is in most respects a minor release, but it includes a few backward-incompatible changes that warrant a new version number.
Users: FABM 2.0 drops support for very old (> 5 years) versions of cmake, gfortran and Python. This is unlikely to cause problems, as most production systems have newer version of these packages installed. Users of pyfabm will need to adopt the new (simpler) installation mechanism.
Developers: biogeochemical models will not require changes to support FABM 2.0. Host models only require changes if they directly access the metadata or value of biogeochemical parameters, which is rare.
General: FABM 2.0 now respects the (undocumented) top-level require_initialization attribute in fabm.yaml: if this attribute is true, FABM verifies that all state variables defined by a model instance are given an initial value in its initialization section. Missing values will trigger a runtime error. Previous versions of FABM ignored the this attribute altogether. The consequence of this change is that some fabm.yaml files will need to be updated by:
- adding missing initial values, or,
- removing
require_initialization: true(or setting it tofalse)
FABM 2.0 drops support for older releases (from 5 years or more ago) of cmake, gfortran, and Python. This has enabled simplication and clean-up of the code. More details are available here. The minimum supported versions now are:
- cmake 3.12
- gfortran 5.1 (only relevant if you use gfortran; other Fortran compilers are also fine, e.g., Intel, Cray, AMD)
- Python 3.7 (only relevant if you use pyfabm)
To verify if your system meet these requirements, you can execute cmake --version, gfortran --version, python --version.
(NB on some systems, the latest Python will be python3 rather than python)
pyfabm is now installed using normal Python conventions:
pip install <FABMDIR>
The replaces the old installation mechanism that required you to create a build directory, call cmake, and build the "install" target.
Underneath, the pip-based installation calls cmake. Therefore, you do still need cmake and a Fortran compiler.
If you want to customize cmake options (e.g., to customize FABM_INSTITUTES, or manually specify the Fortran compiler to use), the easiest way to do this is to create a file named setup.cfg in the toplevel FABM directory, with contents
[build_ext]
cmake_opts=<CMAKE-OPTIONS>
You can enumerate all active model instances and their parameters like this:
type (type_model_list_node), pointer :: instance
type (type_key_value_pair), pointer :: pair
! Get pointer to the first model instance
instance => model%root%children%first
do while (associated(instance))
if (instance%model%user_created) then
print *, 'Instance ', trim(instance%model%name)
pair => instance%model%parameters%first
do while (associated(pair))
select type (value => pair%value)
class is (type_real_setting)
print *, ' ', trim(pair%name), ': ', value%pvalue
class is (type_integer_setting)
print *, ' ', trim(pair%name), ': ', value%pvalue
class is (type_logical_setting)
print *, ' ', trim(pair%name), ': ', value%pvalue
class is (type_string_setting)
print *, ' ', trim(pair%name), ': ', value%pvalue
end select
pair => pair%next
end do
end if
instance => instance%next
end doYou can detect which FABM version is used at compile time: preprocessor symbol _FABM_API_VERSION_, defined in fabm_version.h, is 2 for FABM 2.x, 1 for FABM 1.x, and 0 for earlier versions. Based on the value of this symbol, you can stop compilation and tell users to upgrade, or activate different code paths.
For questions about FABM's use or development, visit Discussions. If you would like to cite FABM, please refer to its main publication and/or URLs.
Background
User guide
- Obtaining the source code
- Building and installing
- Setting up a simulation
- Available biogeochemical models
- Specific hosts
Developer guide
Updates
Tips and tricks
Support
How to cite
Licensing and copyright
Acknowledgements
Presentations