the Creative Commons Attribution 4.0 License.
the Creative Commons Attribution 4.0 License.
The XSO framework (v0.1) and Phydra library (v0.1) for a flexible, reproducible and integrated plankton community modeling environment in Python
Abstract. Plankton community modeling is a critical tool for understanding the processes that shape marine ecosystems and their impacts on global biogeochemical cycles. These models can be of variable ecological, physiological and physical complexity. Many published models are either not publicly available or implemented in monolithic and inflexible code, thus hampering adoption, collaboration, and reproducibility of results. Here we present Phydra, an open-source library for plankton community modelling, and Xarray-simlab-ODE (XSO), a modular framework for efficient, flexible, and reproducible model development based on ordinary differential equations. Both tools are written in Python. Phydra provides pre-built models and model components that can be modified and assembled to develop plankton community models of various levels of ecological complexity. The components can be created, adapted and modified using standard variable types provided by the XSO framework. XSO is embedded in the Python scientific ecosystem and is integrated with tools for data analysis and visualization. To demonstrate the range of applicability and how Phydra and XSO can be used to develop and execute models, we present three applications: (1) a highly simplified nutrient-phytoplankton (NP) model in a chemostat setting, (2) a nutrient-phytoplankton-zooplankton-detritus (NPZD) model in a zero-dimensional pelagic ocean setting, and (3) a size-structured plankton community model that resolves 50 phytoplankton and 50 zooplankton size classes with functional traits determined by allometric relationships. The applications presented here are available as interactive Jupyter notebooks and can be used by the scientific community to build, modify, and run plankton community models based on differential equations for a diverse range of scientific pursuits.
-
Notice on discussion status
The requested preprint has a corresponding peer-reviewed final revised paper. You are encouraged to refer to the final revised version.
-
Preprint
(1892 KB)
-
The requested preprint has a corresponding peer-reviewed final revised paper. You are encouraged to refer to the final revised version.
- Preprint
(1892 KB) - Metadata XML
- BibTeX
- EndNote
- Final revised paper
Journal article(s) based on this preprint
Interactive discussion
Status: closed
-
RC1: 'Comment on egusphere-2023-1697', Anonymous Referee #1, 13 Sep 2023
Post et al. introduces the Xarray-simlab-ODE (XSO) framework for plankton community models and the library Phydracontaining pre-build models that can be used directly as they are or as reference for other model configurations. Written in Python, the XSO framework and Phydra library are developed as an easy-to-use alternative to Fortran code and a framework for models that streamline code-development and prevent inaccessible models that are limited to the development team. The authors illustrate the XSO in three examples of plankton models of different complexity and structure, all included in the Phydra library. The three examples effectively illustrate the strength of XSO in its ability to embrace fundamentally different models within the same framework.
The manuscript is well constructed and clearly written. It has a good balance between the description of XSO and Phydra, implementation examples and model-result description. The authors succeed in presenting the modular approach of the XSO framework as a well-thought-out alternative to standard ODE based models in Fortran. I recommend the article for publication following the correction of minor concerns.
Overall comments:
The ability to link the models to physical circulation
In the current state the XSO framework only supports zero-dimensional models and I fear that this will be a significant concern for many potential users. It is necessary to expand on the single sentence in line 536 that addresses this issue. What is the future potential for expanding on the dimensionality and coupling to physical circulation? In the introduction (line 30-32) the authors mention the problem of linking ecological “legacy” models to physical models but without the possibility to couple or use a physical circulation with the XSO framework many users will need to have several versions of the code (XSO and Fortran) which is time consuming.
Computational efficiency
In model application 2 and 3 (line 315 and 449) the authors note that the XSO framework allows for vectorization of nested for-loops. However, the authors do not address the computational efficiency of the new framework. Is it possible to compare the model implications in XSO to the original models? The issue of computational efficiency is on the front of every develops mind when they choose a framework for model development.
ODE integration method
The only method for integration is RK45. However, plankton models are commonly stiff, which requires a solver that is designed for stiff systems. Could another integration method be added? Alternatively, this concern should be flagged in the discussion and suggested as a future development.
Phydra as a codebase for scientific exploration
At line 147-150 the authors propose the idea that Phydra could be a codebase for scientific exploration. It is not, however, clear how that should be accomplished. Do the authors want others to add their models directly to their GitHub? Without further specification it is not realistic that this will become this peer-reviewed database the authors hope it will.
Version number
It seems appropriate to change the version number from 0.1 to 1.0.
Minor technical/editorial issues:
Title: The title mentions “reproducible” models. However, all models that publish their code are reproducible – even though the codes are often messy and inflexible (this is also an issue in line 5 of the abstract).
Title: The title mention “integrated”. It is unclear what that refers to.
Line 18. This list of references are largely irrelevant to the statement. They are examples of models, but not a review of the history of modelling. I suggest to remove the references, as they are not really needed either.
Line 19: “comprising” => “comprised”
Line 21. There is something odd going on with the sentence here. Please reformulate.
Line 66. A more appropriate reference with be Evans & Parslows whose “slab” model is essentially a chemostat (one section of their paper is with a fixed MLD, which is exactly a chemostat).
Equ. 14. This is not a type III, but a type II functional relationship, with a half staturation constant k_Z^2.
Line 430. Mathematical functions (exp, log) should not be written in italics
Citation: https://doi.org/10.5194/egusphere-2023-1697-RC1 -
RC2: 'Comment on egusphere-2023-1697', Anonymous Referee #2, 22 Sep 2023
The authors have introduced a plankton community modeling environment that offers users a high degree of flexibility in creating new plankton community models. This flexibility is made possible by the inclusion of built-in components within the Phydra library and the interactive capabilities of the XSO framework. Notably, this environment has been developed using Python, one of the most widely used programming languages today, which enhances its accessibility to a broad user base. The effectiveness of both the library and framework is aptly demonstrated through the presentation of three plankton models, each varying in complexity. The paper itself is thoughtfully structured and well-written.
While the introduced environment holds great promise as a valuable tool for teaching plankton modeling, it may still require further development before it can be effectively utilized for scientific investigations. This limitation stems from its current sole reliance on 0D physical settings or its inability to integrate with physical models. The authors have acknowledged the necessity of coupling with other hydrodynamic models and have proposed the inclusion of multi-dimensional physical settings in the next development. However, it remains unclear how these enhancements would be practically achieved within the XSO framework, especially considering the author’s mention of limitations related to the hard-coded dimensionality of flux or state variables in the components and can not be altered after creating a model object. It would be beneficial if the authors could provide more details here.
From Phydra on GitHub (Post, 2023a), it seems that users might be required to invest time in learning the parameters, variables, and functions of the Phydra library and XSO framework in Python. This learning curve, when compared to other frameworks (e.g., FABM), might not offer a significant advantage. However, if Phydra and XSO were to be provided through a Graphical User Interface (GUI), this could significantly enhance their usability and accessibility.
In the broader context of ecosystem modeling, enhancing flexibility and accessibility through frameworks like XSO and Phydra is imperative. Given the existence of other frameworks, such as FABM, which offers a wide array of hydrodynamic and biogeochemical models, it would be valuable to understand the authors' vision for XSO and Phydra within the ecosystem modeling community. Specifically, what role or contribution do the authors envision for XSO and Phydra, and how do they intend to develop and position these tools within this field?
Citation: https://doi.org/10.5194/egusphere-2023-1697-RC2 -
AC1: 'Comment on egusphere-2023-1697', Benjamin Post, 11 Nov 2023
Dear Referees,
We thank the anonymous reviewers for their thoughtful and constructive comments, which have helped us to improve the manuscript.
Attached here is a document, in which we respond to both comments in sequence.
Sincerely,
Benjamin Post, Esteban Acevedo-Trejos, Andrew D. Barton, and Agostino Merico
Interactive discussion
Status: closed
-
RC1: 'Comment on egusphere-2023-1697', Anonymous Referee #1, 13 Sep 2023
Post et al. introduces the Xarray-simlab-ODE (XSO) framework for plankton community models and the library Phydracontaining pre-build models that can be used directly as they are or as reference for other model configurations. Written in Python, the XSO framework and Phydra library are developed as an easy-to-use alternative to Fortran code and a framework for models that streamline code-development and prevent inaccessible models that are limited to the development team. The authors illustrate the XSO in three examples of plankton models of different complexity and structure, all included in the Phydra library. The three examples effectively illustrate the strength of XSO in its ability to embrace fundamentally different models within the same framework.
The manuscript is well constructed and clearly written. It has a good balance between the description of XSO and Phydra, implementation examples and model-result description. The authors succeed in presenting the modular approach of the XSO framework as a well-thought-out alternative to standard ODE based models in Fortran. I recommend the article for publication following the correction of minor concerns.
Overall comments:
The ability to link the models to physical circulation
In the current state the XSO framework only supports zero-dimensional models and I fear that this will be a significant concern for many potential users. It is necessary to expand on the single sentence in line 536 that addresses this issue. What is the future potential for expanding on the dimensionality and coupling to physical circulation? In the introduction (line 30-32) the authors mention the problem of linking ecological “legacy” models to physical models but without the possibility to couple or use a physical circulation with the XSO framework many users will need to have several versions of the code (XSO and Fortran) which is time consuming.
Computational efficiency
In model application 2 and 3 (line 315 and 449) the authors note that the XSO framework allows for vectorization of nested for-loops. However, the authors do not address the computational efficiency of the new framework. Is it possible to compare the model implications in XSO to the original models? The issue of computational efficiency is on the front of every develops mind when they choose a framework for model development.
ODE integration method
The only method for integration is RK45. However, plankton models are commonly stiff, which requires a solver that is designed for stiff systems. Could another integration method be added? Alternatively, this concern should be flagged in the discussion and suggested as a future development.
Phydra as a codebase for scientific exploration
At line 147-150 the authors propose the idea that Phydra could be a codebase for scientific exploration. It is not, however, clear how that should be accomplished. Do the authors want others to add their models directly to their GitHub? Without further specification it is not realistic that this will become this peer-reviewed database the authors hope it will.
Version number
It seems appropriate to change the version number from 0.1 to 1.0.
Minor technical/editorial issues:
Title: The title mentions “reproducible” models. However, all models that publish their code are reproducible – even though the codes are often messy and inflexible (this is also an issue in line 5 of the abstract).
Title: The title mention “integrated”. It is unclear what that refers to.
Line 18. This list of references are largely irrelevant to the statement. They are examples of models, but not a review of the history of modelling. I suggest to remove the references, as they are not really needed either.
Line 19: “comprising” => “comprised”
Line 21. There is something odd going on with the sentence here. Please reformulate.
Line 66. A more appropriate reference with be Evans & Parslows whose “slab” model is essentially a chemostat (one section of their paper is with a fixed MLD, which is exactly a chemostat).
Equ. 14. This is not a type III, but a type II functional relationship, with a half staturation constant k_Z^2.
Line 430. Mathematical functions (exp, log) should not be written in italics
Citation: https://doi.org/10.5194/egusphere-2023-1697-RC1 -
RC2: 'Comment on egusphere-2023-1697', Anonymous Referee #2, 22 Sep 2023
The authors have introduced a plankton community modeling environment that offers users a high degree of flexibility in creating new plankton community models. This flexibility is made possible by the inclusion of built-in components within the Phydra library and the interactive capabilities of the XSO framework. Notably, this environment has been developed using Python, one of the most widely used programming languages today, which enhances its accessibility to a broad user base. The effectiveness of both the library and framework is aptly demonstrated through the presentation of three plankton models, each varying in complexity. The paper itself is thoughtfully structured and well-written.
While the introduced environment holds great promise as a valuable tool for teaching plankton modeling, it may still require further development before it can be effectively utilized for scientific investigations. This limitation stems from its current sole reliance on 0D physical settings or its inability to integrate with physical models. The authors have acknowledged the necessity of coupling with other hydrodynamic models and have proposed the inclusion of multi-dimensional physical settings in the next development. However, it remains unclear how these enhancements would be practically achieved within the XSO framework, especially considering the author’s mention of limitations related to the hard-coded dimensionality of flux or state variables in the components and can not be altered after creating a model object. It would be beneficial if the authors could provide more details here.
From Phydra on GitHub (Post, 2023a), it seems that users might be required to invest time in learning the parameters, variables, and functions of the Phydra library and XSO framework in Python. This learning curve, when compared to other frameworks (e.g., FABM), might not offer a significant advantage. However, if Phydra and XSO were to be provided through a Graphical User Interface (GUI), this could significantly enhance their usability and accessibility.
In the broader context of ecosystem modeling, enhancing flexibility and accessibility through frameworks like XSO and Phydra is imperative. Given the existence of other frameworks, such as FABM, which offers a wide array of hydrodynamic and biogeochemical models, it would be valuable to understand the authors' vision for XSO and Phydra within the ecosystem modeling community. Specifically, what role or contribution do the authors envision for XSO and Phydra, and how do they intend to develop and position these tools within this field?
Citation: https://doi.org/10.5194/egusphere-2023-1697-RC2 -
AC1: 'Comment on egusphere-2023-1697', Benjamin Post, 11 Nov 2023
Dear Referees,
We thank the anonymous reviewers for their thoughtful and constructive comments, which have helped us to improve the manuscript.
Attached here is a document, in which we respond to both comments in sequence.
Sincerely,
Benjamin Post, Esteban Acevedo-Trejos, Andrew D. Barton, and Agostino Merico
Peer review completion
Journal article(s) based on this preprint
Model code and software
Xarray-simlab-ODE Benjamin Post https://github.com/ben1post/xarray-simlab-ode
Phydra Benjamin Post https://github.com/ben1post/phydra
Viewed
HTML | XML | Total | BibTeX | EndNote | |
---|---|---|---|---|---|
253 | 87 | 19 | 359 | 13 | 14 |
- HTML: 253
- PDF: 87
- XML: 19
- Total: 359
- BibTeX: 13
- EndNote: 14
Viewed (geographical distribution)
Country | # | Views | % |
---|
Total: | 0 |
HTML: | 0 |
PDF: | 0 |
XML: | 0 |
- 1
Esteban Acevedo-Trejos
Andrew D. Barton
Agostino Merico
The requested preprint has a corresponding peer-reviewed final revised paper. You are encouraged to refer to the final revised version.
- Preprint
(1892 KB) - Metadata XML