Skip to content

Commit 2d9e356

Browse files
authored
Merge pull request #297 from fabern/revise-for-manuscript
Revise for manuscript
2 parents d6099e3 + cad357f commit 2d9e356

26 files changed

+4595
-847
lines changed

.gitignore

-8
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,6 @@
66
.DS_Store
77
.idea
88

9-
# VS Code local settings
10-
.vscode/
11-
12-
# act local config & secrets
13-
.actrc
14-
.secrets
15-
169
# source files
1710
src/*.o
1811
src/*.so
@@ -25,5 +18,4 @@ vignettes/*.html
2518
# documentation dir
2619
docs/
2720

28-
# CRAN submission archives
2921
CRAN-SUBMISSION

DESCRIPTION

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: rsofun
22
Title: The P-Model and BiomeE Modelling Framework
3-
Version: 5.0.0.9000
3+
Version: 5.0.1
44
Authors@R: c(
55
person(
66
family = "Stocker",
@@ -75,15 +75,12 @@ ByteCompile: true
7575
NeedsCompilation: yes
7676
RoxygenNote: 7.3.2
7777
Suggests:
78-
constructive,
7978
covr,
8079
rcmdcheck,
8180
testthat,
8281
rmarkdown,
8382
ggplot2,
8483
knitr,
85-
lubridate,
86-
rlang,
8784
sensitivity
8885
VignetteBuilder: knitr
8986
Encoding: UTF-8

NEWS.md

+6
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ available forcing data
55
* Breaking change: biomee drivers' `init_cohort$init_n_cohorts` column has been phased out and must not be present in
66
drivers to protect against data corruption.
77

8+
# rsofun v5.0.1
9+
10+
* This model version behaves exactly as the version before.
11+
* Update was necessary to include description of scripts and data used for the model documentation paper into archive on Zenodo
12+
13+
814
# rsofun v5.0.0
915

1016
* new BiomeE forcing data matching that of P-model

R/run_pmodel_f_bysite.R

-30
Original file line numberDiff line numberDiff line change
@@ -156,35 +156,6 @@ run_pmodel_f_bysite <- function(
156156
as.integer() %>%
157157
abs()
158158

159-
# Default value for tc_home
160-
if ('tc_home' %in% names(site_info)) {stop("Unexpectedly received site_info$tc_home for p-model.")}
161-
# Calculate tc_home (mean maximum temperature of the warmest month)
162-
site_info$tc_home <- forcing %>%
163-
dplyr::mutate(
164-
year = format(.data$date, "%Y"), month = format(.data$date, "%m")
165-
) %>%
166-
dplyr::group_by(.data$year, .data$month) %>%
167-
dplyr::summarise(
168-
mean_tmax_month = mean(.data$tmax, na.rm = TRUE), .groups = "drop"
169-
) %>%
170-
dplyr::group_by(.data$year) %>%
171-
dplyr::summarise(
172-
warmest_month_tmax = max(.data$mean_tmax_month, na.rm = TRUE),
173-
.groups = "drop"
174-
) %>%
175-
dplyr::summarise(tc_home = mean(.data$warmest_month_tmax, na.rm = TRUE)) %>%
176-
dplyr::pull(.data$tc_home)
177-
178-
# Validation
179-
if (is.na(site_info$tc_home) || length(site_info$tc_home) == 0) {
180-
if (verbose) {
181-
warning(
182-
"Calculated tc_home is NA or missing; setting default to 25C."
183-
)
184-
}
185-
site_info$tc_home <- 25
186-
}
187-
188159
# re-define units and naming of forcing dataframe
189160
# keep the order of columns - it's critical for Fortran (reading by column number)
190161
forcing_features <- c(
@@ -337,7 +308,6 @@ run_pmodel_f_bysite <- function(
337308
latitude = as.numeric(site_info$lat),
338309
altitude = as.numeric(site_info$elv),
339310
whc = as.numeric(site_info$whc),
340-
tc_home = as.numeric(site_info$tc_home),
341311
n = as.integer(nrow(forcing)), # number of rows in matrix (pre-allocation of memory)
342312
par = c(as.numeric(params_modl$kphio), # model parameters as vector in order
343313
as.numeric(params_modl$kphio_par_a),

README.md

+16
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,22 @@ pars <- calib_sofun(
118118
)
119119
```
120120

121+
## Data and code for model documentation paper
122+
123+
Scripts to reproduce the plots in the model documentation paper are located in the `analysis` subfolder (`01-sensitivity-analysis.R`, `02-bayesian-calibration.R`, and `03-uncertainty-estimation.R`) and the outputs
124+
are archived in the `analysis/paper_results_files` subfolder.
125+
126+
Data used in the model documentation paper is located in the `data` subfolder (`p_model_drivers.rda` and `p_model_validation.rda`).
127+
128+
The data is based on the publicly available FLUXNET2015 data for the site FR-Pue containing years 2007 to 2012 (available as FluxDataKit v3.4.2 under DOI 10.5281/zenodo.14808331).
129+
It is generated with the script `data-raw/generate_pmodel_drivers.R`.
130+
131+
Versions of {rsofun} (including the exact version used in the model documentation paper) are publicly archived on Zenodo (https://doi.org/10.5281/zenodo.3712928).
132+
133+
The model documentation paper is currently under review.
134+
A preprint is available at: https://www.biorxiv.org/content/10.1101/2023.11.24.568574v3
135+
136+
121137
## References
122138

123139
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.

analysis/paper_inputs_csvs/p_model_drivers_forcing.csv

+2,191
Large diffs are not rendered by default.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
spinup,spinupyears,recycle,outdt,ltre,ltne,ltrd,ltnd,lgr3,lgn3,lgr4
2+
TRUE,10,1,1,FALSE,FALSE,FALSE,FALSE,TRUE,FALSE,FALSE
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
lon,lat,elv,whc
2+
3.5957,43.7413,270,432.375

0 commit comments

Comments
 (0)