Skip to contents

This workflow runs the P-model with {rsofun} with the latest version and forcing as used in Stocker et al. (2020). Calibration and evaluation data is also as in Stocker et al. (2020). All data is from files created for Stocker et al. (2020).

Model parameters

Model parameters are determined for this version from calibration. The code for model calibration is not shown. See vignettes/0_p-model_current_run.Rmd for the code.

params_modl <- list(
  kphio              = 0.04090209, # 0.09423773,  # par_calib$par["kphio"],
  kphio_par_a        = -0.001366283, # par_calib$par["kphio_par_a"],
  kphio_par_b        = par_fixed["kphio_par_b"],
  soilm_thetastar    = par_fixed["soilm_thetastar"],
  soilm_betao        = 0.683499654, # par_calib$par["soilm_betao"], # 0,  # 
  beta_unitcostratio = par_fixed["beta_unitcostratio"],
  rd_to_vcmax        = par_fixed["rd_to_vcmax"],
  tau_acclim         = par_fixed["tau_acclim"],
  kc_jmax            = 0.200000000 # par_calib$par["kc_jmax"] # 0.41  # 
)

Model run

output <- rsofun::runread_pmodel_f(
  df_drivers_fluxnet2015 |>
    dplyr::mutate(
      forcing = purrr::map(
        forcing,
        ~rename(., rain = rainf, snow = snowf))
      ) |>
    dplyr::mutate(
      forcing = purrr::map(
        forcing,
        ~mutate(., netrad = 0))
    ),
  par = params_modl
)

Run evaluation

This runs the eval_sofun() routine included in the sofunCalVal package, and outputs daily, monthly and annual summary statistics comparing observed with simulated values. We’ll retake this same routine when running on the latest release (i.e. the workflow is equivalent but for the release of the rsofun package)

Results

Level rsq rmse slope bias nvals
daily_pooled 0.6711118 2.274700 0.9594255 -0.1227976 237777
xdaily_pooled 0.7309871 2.011392 1.0525394 -0.1201709 33152
annual_pooled 0.6552680 425.480412 1.1957465 -69.8919884 598
monthly_pooled 0.7575989 1.844084 1.0855110 -0.2585732 7428
spatial 0.6742977 442.951690 1.1592433 -72.5740133 109
anomalies_annual 0.0819797 167.420654 0.5862724 -2.7028986 598
meandoy 0.7202762 1.866047 1.0356033 0.0037699 42844
anomalies_daily 0.2685024 1.531785 0.4614379 -0.0296151 237603
meanxoy 0.7451584 1.757658 1.0598742 -0.0092887 5528
anomalies_xdaily 0.1496114 1.165698 0.4538087 -0.0025707 33152

8-daily, spatial and annual

Mean seasonal cycle

Drought response

Consistency with rpmodel

Since rsofun takes time series forcing, overwrite forcing with constant values corresponding to the arguments provided to rpmodel::rpmodel().

Setup ORG

## [1] "Are values equivalent for:"
## [1] "- ci:ca: Mean relative difference: 19.85932"
## [1] "- GPP: Mean relative difference: 1"
## [1] "- Vcmax: Mean relative difference: 1"
## [1] "- Vcmax25: Mean relative difference: 1"
## [1] "- Jmax: Mean relative difference: 215900042"
## [1] "- Jmax25: Mean relative difference: 215900412"

Setup BRC

## [1] "Are values equivalent for:"
## [1] "- ci:ca: Mean relative difference: 19.85932"
## [1] "- GPP: Mean relative difference: 1"
## [1] "- Vcmax: Mean relative difference: 1"
## [1] "- Vcmax25: Mean relative difference: 1"
## [1] "- Jmax: Mean relative difference: 201115440"
## [1] "- Jmax25: Mean relative difference: 201115784"

Appendix

## R version 4.4.1 (2024-06-14)
## Platform: x86_64-pc-linux-gnu
## Running under: Ubuntu 22.04.4 LTS
## 
## Matrix products: default
## BLAS:   /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3 
## LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.20.so;  LAPACK version 3.10.0
## 
## locale:
##  [1] LC_CTYPE=C.UTF-8       LC_NUMERIC=C           LC_TIME=C.UTF-8       
##  [4] LC_COLLATE=C.UTF-8     LC_MONETARY=C.UTF-8    LC_MESSAGES=C.UTF-8   
##  [7] LC_PAPER=C.UTF-8       LC_NAME=C              LC_ADDRESS=C          
## [10] LC_TELEPHONE=C         LC_MEASUREMENT=C.UTF-8 LC_IDENTIFICATION=C   
## 
## time zone: UTC
## tzcode source: system (glibc)
## 
## attached base packages:
## [1] stats     graphics  grDevices utils     datasets  methods   base     
## 
## other attached packages:
##  [1] RColorBrewer_1.1-3 here_1.0.1         ggthemes_5.1.0     knitr_1.48        
##  [5] lubridate_1.9.3    ggplot2_3.5.1      readr_2.1.5        tidyr_1.3.1       
##  [9] dplyr_1.1.4        rsofun_4.4.1       rpmodel_1.2.3     
## 
## loaded via a namespace (and not attached):
##  [1] remotes_2.5.0        rlang_1.1.4          magrittr_2.0.3      
##  [4] compiler_4.4.1       mgcv_1.9-1           systemfonts_1.1.0   
##  [7] callr_3.7.6          vctrs_0.6.5          stringr_1.5.1       
## [10] profvis_0.3.8        pkgconfig_2.0.3      crayon_1.5.3        
## [13] fastmap_1.2.0        ellipsis_0.3.2       labeling_0.4.3      
## [16] utf8_1.2.4           promises_1.3.0       rmarkdown_2.27      
## [19] sessioninfo_1.2.2    tzdb_0.4.0           ps_1.7.7            
## [22] nloptr_2.1.1         ragg_1.3.2           purrr_1.0.2         
## [25] bit_4.0.5            xfun_0.46            cachem_1.1.0        
## [28] jsonlite_1.8.8       highr_0.11           later_1.3.2         
## [31] parallel_4.4.1       R6_2.5.1             bslib_0.8.0         
## [34] stringi_1.8.4        boot_1.3-30          pkgload_1.4.0       
## [37] jquerylib_0.1.4      Rcpp_1.0.13          usethis_3.0.0       
## [40] DHARMa_0.4.6         httpuv_1.6.15        Matrix_1.7-0        
## [43] splines_4.4.1        timechange_0.3.0     tidyselect_1.2.1    
## [46] yaml_2.3.10          miniUI_0.1.1.1       curl_5.2.1          
## [49] processx_3.8.4       pkgbuild_1.4.4       plyr_1.8.9          
## [52] lattice_0.22-6       tibble_3.2.1         shiny_1.9.1         
## [55] withr_3.0.1          bridgesampling_1.1-2 coda_0.19-4.1       
## [58] evaluate_0.24.0      desc_1.4.3           urlchecker_1.0.1    
## [61] pillar_1.9.0         generics_0.1.3       vroom_1.6.5         
## [64] rprojroot_2.0.4      hms_1.1.3            BayesianTools_0.1.8 
## [67] munsell_0.5.1        scales_1.3.0         minqa_1.2.7         
## [70] xtable_1.8-4         glue_1.7.0           GenSA_1.1.14        
## [73] tools_4.4.1          lme4_1.1-35.5        fs_1.6.4            
## [76] mvtnorm_1.2-5        grid_4.4.1           yardstick_1.3.1     
## [79] devtools_2.4.5       colorspace_2.1-1     nlme_3.1-164        
## [82] cli_3.6.3            textshaping_0.4.0    fansi_1.0.6         
## [85] Brobdingnag_1.2-9    gtable_0.3.5         sass_0.4.9          
## [88] digest_0.6.36        htmlwidgets_1.6.4    farver_2.1.2        
## [91] memoise_2.0.1        htmltools_0.5.8.1    pkgdown_2.1.0       
## [94] lifecycle_1.0.4      mime_0.12            bit64_4.0.5         
## [97] MASS_7.3-60.2