EGU23-4038
https://doi.org/10.5194/egusphere-egu23-4038
EGU General Assembly 2023
© Author(s) 2023. This work is distributed under
the Creative Commons Attribution 4.0 License.

Reproducible Open Source Carbon Cycle Models    Biogeochemical Model Database  bgc_md2

Markus Müller1, Holger Metzler2, Verónika Ceballos Núñez3, Kostiantyn Viatkin1, Thomas Lotze, Jon Wells4, Yu Zhou1, Cuijuan Liao5, Aneesh Chandel1, Feng Tao5, Yuanyuan Huang6, Alison Bennett6, Chenyu Bian7, Lifen Jiang1, Song Wang8, Chengcheng Gang10, Carlos Sierra9,2, and Yiqi Luo1
Markus Müller et al.
  • 1School of Integrative Plant Science Cornell College of Agriculture and Life Sciences
  • 2Swedish University of Agricultural Sciences, Department of Crop Production Ecology, Uppsala, Sweden,
  • 3Leipzig University, German Centre for Integrative Biodiversity Research (iDiv), Halle-Jena-Leipzig, Germany,
  • 4Northern Arizona University, Center for Ecosystem Sciences and Society,
  • 5Tsinghua University, Department of Earth System Science, Beijing, China,
  • 6University of Melbourne, School of Ecosystem and Forest Science, Parkville, VIC, Australia,
  • 7East China Normal University, School of Ecological and Environmental Sciences, Shanghai, China
  • 8IGSNRR Institute of Geographic Sciences and Natural Resources Research, CAS, Key Laboratory of Ecosystem Network Observation and Modeling,
  • 9Max Planck Institute for Biogeochemistry, Theoretical Ecosystem Ecology, Jena, Germany
  • 10Northwest A&F University, Institute of Soil and Water Conservation, Yangling, China

How to formulate and run an element cycling model within a day?
How to compare many models with respect to many different diagnostics reliably? 
How to allow models to be formulated in different ways?
How to make runnable models transparent without implementation details obscuring the scientific content?

bgc_md2 is an open source python library, available on github and binder. 
It provides an extendable set of datatypes that capture the essential properties compartmental models have in common and enables the formulation of a model with a few lines of regular python code. The structure of the model is captured in symbolic math (using sympy) and can be checked during the creation of the model e.g. by drawing a carbon flow diagram or printing the flux equations using the same mathematical symbols used in the publication describing the model. 
This can be done long before a complete parameter set for the model is added and the model can be run e.g. for a benchmark.
The computation of diagnostic variables both symbolic or numeric is based on the common building blocks which avoids the effort, obscurity and possible inconsistency resulting from a model specific implementation. The difference in available data for different models is addressed by computational graphs.
Instead of an inflexible schema for a relational database records can have different entries reflecting the available data.
Using the computability graphs the comparable is extended to the computable data. This allows for instance comparing a model described by a collection of fluxes with one described by matrices.
bgc_md2 is an extendable library that provides complex and well tested tools for model comparison but does not force the user into a rigid framework.
Rather than full automation it aims at flexibility of use within the python universe and can be used interactively in a jupyter notebook as well as in parallel computations on a supercomputer for global data assimilation as we do in a current model inter comparison.
Example jupyter notebooks can be explored interactively on binder without installation. 

How to cite: Müller, M., Metzler, H., Ceballos Núñez, V., Viatkin, K., Lotze, T., Wells, J., Zhou, Y., Liao, C., Chandel, A., Tao, F., Huang, Y., Bennett, A., Bian, C., Jiang, L., Wang, S., Gang, C., Sierra, C., and Luo, Y.: Reproducible Open Source Carbon Cycle Models    Biogeochemical Model Database  bgc_md2, EGU General Assembly 2023, Vienna, Austria, 24–28 Apr 2023, EGU23-4038, https://doi.org/10.5194/egusphere-egu23-4038, 2023.