rsofun
Implements the Simulating Optimal FUNctioning framework for site-scale simulations of ecosystem processes, including model calibration. It contains Fortran 90 modules for the P-model, SPLASH, and BiomeE models.
Science Score: 59.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
✓DOI references
Found 14 DOI reference(s) in README -
✓Academic publication links
Links to: biorxiv.org, zenodo.org -
✓Committers with academic emails
9 of 25 committers (36.0%) from academic institutions -
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (18.1%) to scientific vocabulary
Keywords
Repository
Implements the Simulating Optimal FUNctioning framework for site-scale simulations of ecosystem processes, including model calibration. It contains Fortran 90 modules for the P-model, SPLASH, and BiomeE models.
Basic Info
- Host: GitHub
- Owner: geco-bern
- License: gpl-3.0
- Language: Fortran
- Default Branch: master
- Homepage: https://geco-bern.github.io/rsofun/
- Size: 180 MB
Statistics
- Stars: 30
- Watchers: 9
- Forks: 33
- Open Issues: 17
- Releases: 11
Topics
Metadata Files
README.md
rsofun
An R Simulating Optimal FUNctioning (RSOFUN) framework for site-scale simulations of ecosystem processes. The package contains the following modules:
- P-model for leaf-level acclimation of photosynthesis from Stocker et al. (2019).
- SPLASH for bioclimatic variables, including the surface radiation budget and the soil water balance from Davis et al. (2017).
- BiomeE for comprehensive simulations of ecosystem carbon and water cycling, tree growth, and tree cohort-explicit forest dynamics following the Perfect Plasticity Approximation, from Weng et al., (2015).
Installation
Stable release
To install the current stable release use a CRAN repository:
r
install.packages("rsofun")
library("rsofun")
Development release
To install the latest development release of the package run the following commands to install rsofun directly from GitHub:
r
if(!require(remotes)){install.packages("remotes")}
remotes::install_github("geco-bern/rsofun")
library("rsofun")
NOTE: Installing from GitHub requires compilation of Fortran and C source code contained in {rsofun}. To enable compiling source code, install Rtools on Windows, or Xcode and the GNU Fortran compiler on Mac (see also 'Mandatory tools' here). On Linux, the gfortran compiler is usually installed already.
Vignettes are not rendered by default, if you want to include additional documentation please use:
r
if(!require(remotes)){install.packages("remotes")}
remotes::install_github("geco-bern/rsofun", build_vignettes = TRUE)
library("rsofun")
From source
Assuming rsofun is the location of the source directory, on can build the R package (with extension .tar.gz) from the command line using:
bash
R CMD build --no-manual --no-build-vignettes rsofun
The package can then be installed with:
bash
R CMD INSTALL -c --preclean *.tar.gz
, where the star * can be replaced by the name of the package produced at the previous step.
Use
Below sections show the ease of use of the package in terms of model parameter specification and running both a single run or optimizing the parameters for a given site (or multiple sites). For an in depth discussion we refer to the vignettes.
Running model
With all data prepared we can run the P-model using runread_pmodel_f(). This function takes the nested data structure and runs the model site by site, returning nested model output results matching the input drivers.
``` r
define model parameter values from previous
work
paramsmodl <- list( kphio = 0.04998, # setup ORG in Stocker et al. 2020 GMD kphiopara = 0.0, # set to zero to disable temperature-dependence of kphio kphioparb = 1.0, soilmthetastar = 0.6 * 240, # to recover old setup with soil moisture stress soilmbetao = 0.0, betaunitcostratio = 146.0, rdtovcmax = 0.014, # value from Atkin et al. 2015 for C3 herbaceous tauacclim = 30.0, kcjmax = 0.41 )
run the model for these parameters
output <- rsofun::runreadpmodelf( pmodeldrivers, par = params_modl ) ```
Parameter optimization
To optimize new parameters based upon driver data and a validation dataset we must first specify an optimization strategy and settings, as well as a cost function and parameter ranges.
r
settings <- list(
method = "GenSA",
metric = cost_rmse_pmodel,
control = list(
maxit = 100),
par = list(
kphio = list(lower=0.02, upper=0.2, init = 0.05)
)
)
rsofun supports both optimization using the GenSA and BayesianTools packages. The above statement provides settings for a GenSA optimization approach. For this example the maximum number of iterations is kept artificially low. In a real scenario you will have to increase this value orders of magnitude. Keep in mind that optimization routines rely on a cost function, which, depending on its structure influences parameter selection. A limited set of cost functions is provided but the model structure is transparent and custom cost functions can be easily written. More details can be found in the "Parameter calibration and cost functions" vignette.
In addition starting values and ranges are provided for the free parameters in the model. Free parameters include: parameters for the quantum yield efficiency kphio, kphio_par_a and kphio_par_b, soil moisture stress parameters soilm_thetastar and soilm_betao, and also beta_unitcostratio, rd_to_vcmax, tau_acclim and kc_jmax (see ?runread_pmodel_f). Be mindful that with newer versions of rsofun additional parameters might be introduced, so re-check vignettes and function documentation when updating existing code.
With all settings defined the optimization function calib_sofun() can be called with driver data and observations specified. Extra arguments for the cost function (like what variable should be used as target to compute the root mean squared error (RMSE) and previous values for the parameters that aren't calibrated, which are needed to run the P-model).
``` r
calibrate the model and optimize free parameters
pars <- calibsofun(
drivers = pmodeldrivers,
obs = pmodelvalidation,
settings = settings,
# extra arguments passed to the cost function:
targets = "gpp", # define target variable GPP
parfixed = params_modl[-1] # fix non-calibrated parameters to previous
# values, removing kphio
)
```
Data and code for model documentation paper (Paredes et al., in rev.)
Versioned releases of this repository are deposited on Zenodo (see badge at the top of the README file). Code to reproduce the analysis and plots presented here is contained in this repository (subdirectory analysis/) and is demonstrated on the model documentation website (https://geco-bern.github.io/rsofun/, article ‘Sensitivity analysis and calibration interpretation’).
The model forcing and evaluation data is based on the publicly available FLUXNET2015 data for the site FR-Pue, prepared by FluxDataKit v3.4.2 (10.5281/zenodo.14808331), taken here as a subset of the originally published data for years 2007-2012. It is accessible through the {rsofun} R package and contained as part of this repository (subdirectory data/) as CSV and as files. Outputs of the analysis presented here are archived in the analysis/paper_results_files/ subfolder.
The model documentation paper is currently under review. A preprint is available at: https://www.biorxiv.org/content/10.1101/2023.11.24.568574v3
References
Stocker, B. D., Wang, H., Smith, N. G., Harrison, S. P., Keenan, T. F., Sandoval, D., Davis, T., and Prentice, I. C.: P-model v1.0: an optimality-based light use efficiency model for simulating ecosystem gross primary production, Geosci. Model Dev., 13, 1545–1581, https://doi.org/10.5194/gmd-13-1545-2020, 2020.
Davis, T. W., Prentice, I. C., Stocker, B. D., Thomas, R. T., Whitley, R. J., Wang, H., Evans, B. J., Gallego-Sala, A. V., Sykes, M. T., and Cramer, W.: Simple process-led algorithms for simulating habitats (SPLASH v.1.0): robust indices of radiation, evapotranspiration and plant-available moisture, Geoscientific Model Development, 10, 689–708, doi:10.5194/gmd-10-689-2017, URL http: //www.geosci-model-dev.net/10/689/2017/, 2017.
Weng, E. S., Malyshev, S., Lichstein, J. W., Farrior, C. E., Dybzinski, R., Zhang, T., Shevliakova, E., and Pacala, S. W.: Scaling from individual trees to forests in an Earth system modeling framework using a mathematically tractable model of height-structured competition, Biogeosciences, 12, 2655–2694, https://doi.org/10.5194/bg-12-2655-2015, 2015.
Acknowledgements
The {rsofun} is part of the LEMONTREE project and funded by Schmidt Futures and under the umbrella of the Virtual Earth System Research Institute (VESRI).
Owner
- Name: GECO
- Login: geco-bern
- Kind: organization
- Location: Switzerland
- Website: geco-group.org
- Twitter: SteniBocker
- Repositories: 22
- Profile: https://github.com/geco-bern
Geocomputation and Earth Observation at the University of Bern
GitHub Events
Total
- Create event: 33
- Release event: 2
- Issues event: 89
- Watch event: 6
- Delete event: 25
- Issue comment event: 189
- Push event: 288
- Pull request review event: 96
- Pull request review comment event: 68
- Pull request event: 55
- Fork event: 4
Last Year
- Create event: 33
- Release event: 2
- Issues event: 89
- Watch event: 6
- Delete event: 25
- Issue comment event: 189
- Push event: 288
- Pull request review event: 96
- Pull request review comment event: 68
- Pull request event: 55
- Fork event: 4
Committers
Last synced: 6 months ago
Top Committers
| Name | Commits | |
|---|---|---|
| Pepa Aran Paredes | p****a@p****n | 407 |
| Benjamin Stocker | b****r@g****m | 348 |
| khufkens | k****s@g****m | 264 |
| marcadella | m****a@u****h | 221 |
| stineb | b****r@i****k | 189 |
| Fabian Bernhard | 1****n | 148 |
| Laura Marques | l****z@g****m | 115 |
| maloan | a****h@u****h | 71 |
| Laura Marqués | l****s@g****h | 54 |
| Laura Marques | l****a@p****n | 23 |
| Pepa Arán | 6****n | 19 |
| Joan Maspons | j****s@c****t | 18 |
| marcadella | 3****a | 8 |
| Benjamin Stocker | b****r@B****l | 4 |
| maloan | 5****n | 2 |
| stineb | b****r@g****m | 1 |
| Benjamin Stocker | b****e@g****h | 1 |
| Benjamin Stocker | b****e@e****h | 1 |
| Benjamin Stocker | b****e@e****h | 1 |
| Benjamin Stocker | b****e@e****h | 1 |
| Benjamin Stocker | b****e@e****h | 1 |
| Benjamin Stocker | b****e@e****h | 1 |
| Benjamin Stocker | b****r@B****l | 1 |
| Benjamin Stocker | b****r@c****t | 1 |
| yunpeng | y****g@u****h | 1 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 6 months ago
All Time
- Total issues: 97
- Total pull requests: 120
- Average time to close issues: 2 months
- Average time to close pull requests: 5 days
- Total issue authors: 8
- Total pull request authors: 10
- Average comments per issue: 3.06
- Average comments per pull request: 1.11
- Merged pull requests: 90
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 46
- Pull requests: 52
- Average time to close issues: 17 days
- Average time to close pull requests: 8 days
- Issue authors: 4
- Pull request authors: 6
- Average comments per issue: 3.24
- Average comments per pull request: 1.37
- Merged pull requests: 31
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- marcadella (36)
- stineb (20)
- khufkens (18)
- pepaaran (13)
- fabern (11)
- FrancescoGrossi-unimi (2)
- jrmodel (1)
- Zinny-E (1)
Pull Request Authors
- stineb (33)
- marcadella (29)
- fabern (20)
- khufkens (19)
- pepaaran (19)
- jaideep777 (6)
- lauramarques (5)
- maloan (4)
- FrancescoGrossi-unimi (4)
- jrmodel (3)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 2
-
Total downloads:
- cran 132 last-month
-
Total dependent packages: 0
(may contain duplicates) -
Total dependent repositories: 0
(may contain duplicates) - Total versions: 7
- Total maintainers: 1
proxy.golang.org: github.com/geco-bern/rsofun
- Documentation: https://pkg.go.dev/github.com/geco-bern/rsofun#section-documentation
- License: gpl-3.0
-
Latest release: v5.0.1+incompatible
published 11 months ago
Rankings
cran.r-project.org: rsofun
The P-Model and BiomeE Modelling Framework
- Homepage: https://github.com/geco-bern/rsofun
- Documentation: http://cran.r-project.org/web/packages/rsofun/rsofun.pdf
- License: GPL-3
-
Latest release: 5.0.0
published about 1 year ago
Rankings
Maintainers (1)
Dependencies
- R >= 3.6 depends
- BayesianTools * imports
- GenSA * imports
- dplyr * imports
- graphics * imports
- lubridate * imports
- magrittr * imports
- multidplyr * imports
- purrr * imports
- stats * imports
- tidyr * imports
- tidyselect * imports
- utils * imports
- covr * suggests
- ggplot2 * suggests
- knitr * suggests
- rmarkdown * suggests
- rpmodel * suggests
- testthat * suggests
- actions/cache v2 composite
- actions/checkout v2 composite
- actions/upload-artifact main composite
- r-lib/actions/setup-pandoc v2 composite
- r-lib/actions/setup-r v2 composite
- JamesIves/github-pages-deploy-action v4.4.1 composite
- actions/checkout v3 composite
- r-lib/actions/setup-pandoc v2 composite
- r-lib/actions/setup-r v2 composite
- r-lib/actions/setup-r-dependencies v2 composite
- actions/cache v2 composite
- actions/checkout v2 composite
- r-lib/actions/setup-pandoc v1 composite
- r-lib/actions/setup-r v1 composite