diff --git a/NEWS.md b/NEWS.md new file mode 100644 index 00000000..871f045a --- /dev/null +++ b/NEWS.md @@ -0,0 +1,3 @@ +## v4.0 + +* Public release after refactored code \ No newline at end of file diff --git a/README.md b/README.md index 1f6ac1ac..9fffe140 100644 --- a/README.md +++ b/README.md @@ -3,21 +3,11 @@ # rsofun -Provides a modelling framework that implements the P-model for leaf-level acclimation of photosynthesis for site-scale simulations, with SPLASH used for simulating the soil water balance (see also [Stocker et al., 2019 GMDD](https://www.geosci-model-dev-discuss.net/gmd-2019-200/)). The package provides the following functionalities: +A modelling framework for site-scale simulations of ecosystem processes, implemented as an R package (low-level routines in Fortran 90). Implements the following models: -- Calibrating model parameters -- Running the model and getting outputs directly back into R ("tidy" data) -- Evaluating outputs (benchmarking) - -Model forcing and calibration data is collected using the [ingestr](https://stineb.github.io/ingestr/) package. See [here](https://rpubs.com/stineb/rsofun) for an example. - -Parallelisation for a large number of site-level simulations is provided using the *multidplyr* R package. Calibration uses the *GenSA* R package. - -The P-model is implemented in different repositories for different purposes: - -- **rsofun** (this package): Is for site-scale simulations (large ensemble of sites can be run in parallelised mode), forced by time series of meteorological data. Acclimation of photosynthesis is assumed at a user-defined time scale. I.e., the P-model optimality criterion (Wang et al., 2017; Prentice et al., 2014) is solved daily with "damped" daily variations in the forcing data (similar to a running mean). All model code is implemented in Fortran. -- [**rpmodel**](https://stineb.github.io/rpmodel/): Implements the same equation as rsofun (all native R), but solves the optimality criterion for each time step independently (instantaneous acclimation). This can be used for hypothesis generation, exploration, and illustrations. Transient simulations of acclimation and GPP should be done using rsofun. -- [**SOFUN**](https://stineb.github.io/sofun/): This is for P-model simulations on a (global) spatial grid and is purely in Fortran. Forcing data is read from NetCDF files and outputs are written to NetCDF files. +- P-model for leaf-level acclimation of photosynthesis from [Stocker et al. (2019)](https://www.geosci-model-dev-discuss.net/gmd-2019-200/). +- SPLASH for bioclimatic variables, including the surface radiation budget and the soil water balance from [Davis et al. (2017)](https://doi.org/10.5194/gmd-10-689-2017). +- LM3-PPA 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)](https://doi.org/10.5194/bg-12-2655-2015). ## Installation diff --git a/docs/articles/benchmark_gpp_FLUXNET2015_ensemble_EXAMPLE_files/header-attrs-2.7/header-attrs.js b/docs/articles/benchmark_gpp_FLUXNET2015_ensemble_EXAMPLE_files/header-attrs-2.7/header-attrs.js new file mode 100644 index 00000000..dd57d92e --- /dev/null +++ b/docs/articles/benchmark_gpp_FLUXNET2015_ensemble_EXAMPLE_files/header-attrs-2.7/header-attrs.js @@ -0,0 +1,12 @@ +// Pandoc 2.9 adds attributes on both header and div. We remove the former (to +// be compatible with the behavior of Pandoc < 2.8). +document.addEventListener('DOMContentLoaded', function(e) { + var hs = document.querySelectorAll("div.section[class*='level'] > :first-child"); + var i, h, a; + for (i = 0; i < hs.length; i++) { + h = hs[i]; + if (!/^h[1-6]$/i.test(h.tagName)) continue; // it should be a header h1-h6 + a = h.attributes; + while (a.length > 0) h.removeAttribute(a[0].name); + } +}); diff --git a/docs/articles/example_lm3ppa_files/header-attrs-2.7/header-attrs.js b/docs/articles/example_lm3ppa_files/header-attrs-2.7/header-attrs.js new file mode 100644 index 00000000..dd57d92e --- /dev/null +++ b/docs/articles/example_lm3ppa_files/header-attrs-2.7/header-attrs.js @@ -0,0 +1,12 @@ +// Pandoc 2.9 adds attributes on both header and div. We remove the former (to +// be compatible with the behavior of Pandoc < 2.8). +document.addEventListener('DOMContentLoaded', function(e) { + var hs = document.querySelectorAll("div.section[class*='level'] > :first-child"); + var i, h, a; + for (i = 0; i < hs.length; i++) { + h = hs[i]; + if (!/^h[1-6]$/i.test(h.tagName)) continue; // it should be a header h1-h6 + a = h.attributes; + while (a.length > 0) h.removeAttribute(a[0].name); + } +}); diff --git a/docs/articles/example_pmodel_files/header-attrs-2.7/header-attrs.js b/docs/articles/example_pmodel_files/header-attrs-2.7/header-attrs.js new file mode 100644 index 00000000..dd57d92e --- /dev/null +++ b/docs/articles/example_pmodel_files/header-attrs-2.7/header-attrs.js @@ -0,0 +1,12 @@ +// Pandoc 2.9 adds attributes on both header and div. We remove the former (to +// be compatible with the behavior of Pandoc < 2.8). +document.addEventListener('DOMContentLoaded', function(e) { + var hs = document.querySelectorAll("div.section[class*='level'] > :first-child"); + var i, h, a; + for (i = 0; i < hs.length; i++) { + h = hs[i]; + if (!/^h[1-6]$/i.test(h.tagName)) continue; // it should be a header h1-h6 + a = h.attributes; + while (a.length > 0) h.removeAttribute(a[0].name); + } +}); diff --git a/docs/index.html b/docs/index.html index e45431cd..7a0803d6 100644 --- a/docs/index.html +++ b/docs/index.html @@ -98,24 +98,6 @@
This is important
-In order to successfully compile the package (Fortran source), you need to have gfortran installed and manually adjust the compiler flag specification. To do so, open the Makeconf file (you’ll find it by entering in R: file.path(R.home("etc"), "Makeconf")
). In there, add the gfortran flag -ffree-line-length-0
. The respective line then looks like this:
FCFLAGS = -Wall -g -O2 $(LTO) -ffree-line-length-0
The rsofun
package requires a large number of other R-packages (dependencies). Required dependencies are essential for rsofun
functions and are:
This package is designed to be extendible to ingesting other data types (sources). The developer (Beni Stocker) would appreciate if you made sure that your developments can be fed back to this repository. To do so, please use git. See here for a brief introduction to git.
-<<<<<<< HEAD -I recommend the following steps if you would just like to use this package (no development):
-I recommend the following steps if you would like to use and further develop the package (even if this is just some extension for your own application - Keep in mind: Others may benefit from your efforts too!):
-ingestr
placed in your home directory):cd home
-git clone https://github.com/<your_github_username>/rsofun.git
~/rsofun/
. This opens the repository in RStudio and you have access to the code where all the functions of this package are implemented (see subdirectory ./R/
)../R/
, write a nice roxygen header (see other source files as an example), then click on ‘Build’ -> ‘More’ -> ‘Document’, and then again on ‘Install and Restart’.git add -u # adds all edits to your next commit
-git add <newfile> # adds new file to the git repository
-git commit -m "a brief description of what you did"
-git push # pushes the commit to your fork
Net assimilation calculation
+calc_net_assim(par, args, iabs, kphio, a_unitcost)+ +
par | +parameters (vcmax, gs) |
+
---|---|
args | +arguments (kmm, gammastart, ns_star, ca, vpd, beta) |
+
iabs | +iabs |
+
kphio | +kphio |
+
a_unitcost | +cost unit |
+
Net assimilation
+ +if (FALSE) calib_sofun( df_drivers = filter(df_drivers, sitename %in% settings$sitenames), ddf_obs = ddf_obs_calib, settings = settings) - -=======-<<<<<<< HEAD -if (FALSE) { calib_sofun( df_drivers = filter(df_drivers, @@ -157,7 +153,6 @@Examp ddf_obs = ddf_obs_calib, settings = settings) } ->>>>>>> 463af7b984d4541e03a5994c8b0069d37aadf674
runread_lm3ppa_f(df_drivers, makecheck = TRUE, parallel = FALSE, ncores = 2)-=======runread_lm3ppa_f(drivers, makecheck = TRUE, parallel = FALSE, ncores = 2)->>>>>>> 463af7b984d4541e03a5994c8b0069d37aadf674Arguments
data
-=======mod <- runread_pmodel_f( df_drivers, params_modl, makecheck = TRUE, parallel = FALSE, ncores = 2 ) -#> Error: Problem with `mutate()` input `data`. -#> x Can't subset columns that don't exist. -#> x Column `rain` doesn't exist. -#> ℹ Input `data` is `purrr::pmap(...)`.-
->>>>>>> 463af7b984d4541e03a5994c8b0069d37aadf674 -if (FALSE) { mod <- runread_pmodel_f( df_drivers, params_modl, makecheck = TRUE, parallel = FALSE, ncores = 2 ) }
runread_pmodel_f(drivers, par, makecheck = TRUE, parallel = FALSE, ncores = 2)+
runread_pmodel_f(drivers, par, makecheck = TRUE, parallel = FALSE, ncores = 1)