BiomeEP: expose additional parameters to R#328
Open
fabern wants to merge 40 commits into
Open
Conversation
6b685b3 to
9ddabd9
Compare
This streamlines the input preparation of the BiomeEP simulation
Namely: 'phenotype','Vmax','alphaBM','leafLS','lAImax','CNleaf0'
Namely: 'phenotype','Vmax','alphaBM','leafLS','lAImax','CNleaf0'
9ddabd9 to
40f8f0d
Compare
I.e. store them as part of the params_species_biomee and params_tile_biomee. Currently still hardcoded, but this allows for exposure of these in a next step.
Member
Author
Strategy for calibration(as discussed, from memory, feel free to modify) There are three kinds of parameter with respect to calibration:
|
… API)
This change is currently undocumented, since without specifying these parameters, BiomeEP continues to use the former hardcoded values as default.
This concerns parameters:
("kphio","beta","rd_to_vcmax","kc_jmax","kphio_par_a","kphio_par_b") in params_species and ("tau_acclim") in params_tile.
Small fix
825ba82 to
05a4bb8
Compare
Namely: 'gamma_L','Vannual','betaOFF','betaON', 'leaf_size' (all unused)
…th `mortrate_d_c`) Change value of mortrate_d_c in the example BiomeEP data set
Member
Author
|
@stineb: could you please have a quick look at the summarized changes from the first message in this PR. Is this streamlining of input parameters in your intent? I will base the calibration on this PR. |
This allows to use gdb instead of lldb. lldb has some shortcomings with Fortran, namely it can't explore variables at a breakpoint. The recommendation is therefore to use gdb. Since this is not available for arm-based "M4" Macs, we run an arm-based Linux in a Docker container. Use VSCode extension "Dev Containers" together with the specified Docker file. Step 1: "Dev Containers: Reopen in Container" Step 2: set a breakpoin in code. Step 3: go to the debug Tab in VSCode and click Play on the correct debug action "(gdb) Launch - MacBook Air M4".
81f2d91 to
22b4b81
Compare
…ohort_age`) If not provided it recovers old default of 0 years old at initialization.
This has no effect with the default parametrization that anyway uses 0.1 for sp%internal_gap_frac and thus corresponds to the previously hardcoded f_gap=0.1
This concerns parameters:
("extinct", "kappa", "f_gap", "A_mort", "B_mort", "f_LFR_max") in params_species and ("CN0metabolicL","CN0structuralL") in params_tile.
Note that there is still some redundundancy in "extinct" and "kappa", and in "f_gap" and "internal_gap_frac"
This change is currently undocumented (like 05a4bb8), since without specifying these parameters, BiomeEP continues to use the former hardcoded values as default.
Passed parameters are now stored as part of the params_species_biomee and params_tile_biomee.
…micsLayer() This results is slightly larger evaporation of soil water from forest floor.
By specifying min version of dplyr as "1.2.0" and by adding dplyr::
0520567 to
bb86f57
Compare
And add some comments
…ward comaptibility with defaults Previously `init_cohort_nsc` was provided but overwritten, rendering this input parameter obsolete. With this commit `init_cohort_nsc` is correctly taken into account, if provided. To ensure backward compatibility: - `init_cohort_nsc` is made optional: falling back on previous behavior as a default if not provided - `init_cohort_nsc` is removed from the default drivers (to trigger previous behavior) NOTE: changes to biomee_gs_leuning_output.rda, biomee_p_model_luluc_output.rda and biomee_p_model_output are minor.
And add remark for other potential bug
Previously, default initial values were derived inside of Fortran code. This has now been moved to R in case the user does not provide initial values of N pools. Bottom line: The default recovers former default initialization.
97ae49e to
b678e2d
Compare
…tional) Previously, default initial values were derived inside of Fortran code. This has now been moved to R in case the user does not provide initial values for the soil pools. Bottom line: The default recovers former default initialization.
b678e2d to
b5125f1
Compare
…imits) Except: on Windows CI testing: test failed since it appeared to be slightly outside of the tolerance limits. Thus we update the snapshot
Cohort LU matching now compares against the cohort’s lu_index, not the loop index.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR exposes additional BiomeEP parameters to R, making them amenable to calibration.
Status
Some of the inputs parameters were previously ignored [1], while other parameters and initial conditions were hardcoded [2],[3],[4].
For the initial conditions, many of them were derived based on parameter values for convenience. While this may seem convenient and pragmatic, it does not allow to stop and restart a simulation, since the user is not able to restart it by prescribing all the state variables. The convenience function have now been moved to the R part of the code. They are only triggered if the corresponding initial conditions are not explicitly provided. This allows to recover the former behavior by default but enables the users to control the initial conditions with more granularity if desired.
Lastly, a bug was present since
init_cohort_nscwas not taken into account.[1]: in
params_species:phenotype,Vmax,alphaBM,leafLS,lAImax,CNleaf0,gamma_L,Vannual,betaON,betaOFF,leaf_size[2]:
rsofun/src/gpp_biomee.mod.f90
Lines 22 to 35 in 9ddabd9
[3]: Initial states were not exposed to R in
init_cohort:init_cohort_ageand the nitrogen pools:init_cohort_bl_n14,init_cohort_br_n14,init_cohort_bsw_n14,init_cohort_bHW_n14,init_cohort_seedC_n14,init_cohort_nsc_n14[4]: Initial states were not exposed to Rin
init_soil:init_fast_soil_N,init_slow_soil_N,init_pmicr_C,init_pmicr_d13C,init_pmicr_N,init_wcl1,init_wcl2,init_wcl3,init_N0_ecosystemChanges
Changes of this PR are summarized in
NEWS.md.They are breaking changes.
This PR reduces the number of parameters required in the drivers for BiomeEP:
params_tile$par_mort_underandparams_tile$par_mortare removed and have to be replaced byparams_species%mortrate_d_uandparams_species%mortrate_d_cparams_speciesthis concerns:phenotype,Vmax,alphaBM,leafLS,lAImax,CNleaf0,gamma_L,Vannual,betaON,betaOFF,`leaf_sizeThis PR also allows to optionally provide additional parameters/initial values in the drivers for BiomeEP:
run_biomee_f_by_site()params_speciesthis concerns:kphio,beta,rd_to_vcmax,kc_jmax,kphio_par_a,kphio_par_bparams_tilethis concerns:tau_accliminit_cohortthis concerns:init_cohort_ageand the nitrogen pools:init_cohort_bl_n14,init_cohort_br_n14,init_cohort_bsw_n14,init_cohort_bHW_n14,init_cohort_seedC_n14,init_cohort_nsc_n14.init_soilsthis concerns:init_fast_soil_N,init_slow_soil_N,init_pmicr_C,init_pmicr_d13C,init_pmicr_N,init_wcl1,init_wcl2,init_wcl3,init_N0_ecosystemLastly, this PR fixes the bug that
init_cohort_nscwas not taken into account.init_cohort_nscwas made optional. Not providinginit_cohort_nscalso recovers former default value.