geco-bern / 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.
https://geco-bern.github.io/rsofun/
GNU General Public License v3.0
25 stars 29 forks source link

Homogenize validation data.sets as arguments to `cost_likelihood_pmodel()` and `cost_likelihood_biomee()` #236

Open fabern opened 1 month ago

fabern commented 1 month ago

After the inputs to the running of the model is homogenized (https://github.com/geco-bern/rsofun/issues/228), also the inputs to the calibration would need to be homogenized.

Some work has already been done to reduce code redundundancy in the likelihood/RMSE functions in PR: #233 Either within that PR or after it, we should also homogenize the validation data sets, i.e. rsofun::biomee_validation, rsofun::p_model_validation_vcmax25, and rsofun::p_model_validation.

# TODO: homogenize format rsofun::biomee_validation with rsofun::p_model_validation_vcmax25
#       for pmodel it is a wide data structure, and for biomee it is a long data structure
# rsofun::p_model_validation |> tidyr::unnest(data)
#  # A tibble: 2,190 × 4
#   sitename date         gpp gpp_unc
#   <chr>    <date>     <dbl>   <dbl>
# 1 FR-Pue   2007-01-01 2.21  0.0108 
# 2 FR-Pue   2007-01-02 2.23  0.00475
# 3 FR-Pue   2007-01-03 2.48  0.00727
# 4 FR-Pue   2007-01-04 1.71  0.00516
# rsofun::p_model_validation_vcmax25 |> tidyr::unnest(data)
# # A tibble: 4 × 3
# # Groups:   sitename [4]
#   sitename               vcmax25 vcmax25_unc
#   <chr>                    <dbl>       <dbl>
# 1 Reichetal_Colorado   0.0000339   0.0000136
# 2 Reichetal_New_Mexico 0.0000757   0.0000163
# 3 Reichetal_Venezuela  0.0000472   0.0000164
# 4 Reichetal_Wisconsin  0.0000502   0.0000147
# rsofun::biomee_validation |> tidyr::unnest(data)
#     sitename variables targets_obs
#   <chr>    <chr>           <dbl>
# 1 CH-Lae   GPP              1.86
# 2 CH-Lae   LAI              6.49
# 3 CH-Lae   Density        296.
# 4 CH-Lae   Biomass         44.5
stineb commented 1 month ago

Regarding soil temperature: