diff --git a/NEWS.md b/NEWS.md index 31a12705..141ca7e1 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,6 @@ # rsofun (development version) * BiomeEP: + * Bugfix: `phenotype` is now correctly taking into account, decoupling it from `LMA` (#329) * Bugfix: annual, cohort-level output had mixed up column names for variables: `NSN`,`seedC`,`leafC`,`rootC`,`sapwoodC`,`heartwoodC` * Bugfix: `init_cohort$init_cohort_nsc` is now correctly taken into account. To @@ -11,8 +12,8 @@ * Cohorts are now less aggressively merged. Merging criteria was simplified from relative to absolute DBH difference. Now merging if difference <= 0.01 m. * Removed dummy parameters in `params_species` for `run_biomee_f_bysite()`: - `phenotype`,`Vmax`,`alphaBM`,`leafLS`,`lAImax`,`CNleaf0`,`gamma_L`,`Vannual`, - `betaON`,`betaOFF`, `leaf_size`. + `Vmax`,`alphaBM`,`leafLS`,`lAImax`,`CNleaf0`,`gamma_L`,`Vannual`, + `betaON`,`betaOFF`, `leaf_size` and in `params_tile`: `GR_factor`. If still provided, they must be NA, otherwise an error occurs. * Removed parameter in `params_tile` for `run_biomee_f_bysite()`: `par_mort_under` and `par_mort`. Their effects can be fully specified by @@ -29,6 +30,7 @@ `init_pmicr_d13C`, `init_pmicr_N`, `init_wcl1`, `init_wcl2`, `init_wcl3`, `init_N0_ecosystem`. If not provided, default values ensure backwards compatibility. * Added check that all `species$LMA` >= `params_tile$LMAmin` + * Added `output_daily_tile$Tksoil`, i.e. daily output of soil temperature * P-model: * no changes diff --git a/R/data.R b/R/data.R index 4940b850..253890b5 100644 --- a/R/data.R +++ b/R/data.R @@ -235,7 +235,6 @@ #' \item{LMAmin}{Minimum LMA, leaf mass per unit area, only of parts of the leaf that become fine litter (metabolic parts), kg C m\eqn{^{-2}}. Has to be smaller than LMA.} #' \item{fsc_fine}{Fraction of fast turnover carbon in fine biomass.} #' \item{fsc_wood}{Fraction of fast turnover carbon in wood biomass.} -#' \item{GR_factor}{Growth respiration factor.} #' \item{l_fract}{Fraction of the carbon retained after leaf drop.} #' \item{retransN}{Retranslocation coefficient of nitrogen.} #' \item{f_initialBSW}{Coefficient for setting up initial sapwood.} @@ -324,6 +323,14 @@ #' \item{init_cohort_nsc_n14}{Initial non-structural biomass, in kg N per individual. (optional, defaults to value derived from br_max and bl_max)} #' \item{lu_index}{Land use type this cohorts belongs to (given as index in init_lu aray). (optional) #' Default: 0 (attach to all LU types except thoses which do not accept vegetation -- cf init_lu.vegetated).} +#' \item{restart_status}{Restart phenology status for the cohort (`0` = leaf-off, `1` = leaf-on). Optional; when omitted, a cold-start default is used.} +#' \item{restart_layer}{Restart canopy layer for the cohort. Optional; when omitted, cohorts are relayered as in a cold start.} +#' \item{restart_firstlayer}{Restart flag indicating whether the cohort has previously occupied the top layer. Optional.} +#' \item{restart_gdd}{Restart growing degree days stored on the cohort. Optional.} +#' \item{restart_leaf_age}{Restart leaf age, in years. Optional.} +#' \item{restart_topyear}{Restart count of years spent in the top canopy layer. Optional.} +#' \item{restart_bl_max}{Restart target leaf biomass (`bl_max`), in kg C per individual. Optional.} +#' \item{restart_br_max}{Restart target fine-root biomass (`br_max`), in kg C per individual. Optional.} #' }} #' \item{init_soil}{A data.frame of initial soil pools, including #' the following data: @@ -341,6 +348,8 @@ #' \item{init_wcl2}{Initial volumetric water content of soil layer 2, in m\eqn{^{3}}m\eqn{^{-3}}. (optional, defaults to field capacity)} #' \item{init_wcl3}{Initial volumetric water content of soil layer 3, in m\eqn{^{3}}m\eqn{^{-3}}. (optional, defaults to field capacity)} #' \item{init_N0_ecosystem}{Initial total amount of nitrogen in ecosystem (only used for nitrogen workaround), in kg N m\eqn{^{-2}}. (optional, defaults to sum of soil and plant pools.) Might not be needed.} +#' \item{restart_tk_pheno}{Restart smoothed phenology temperature, in Kelvin. Optional.} +#' ### \item{restart_vegn_gdd}{Restart tile-level growing degree days. Optional.} #' }} #' \item{init_lu}{A data.frame of initial land unit (LU) specifications, including #' the following data: diff --git a/R/run_biomee_f_bysite.R b/R/run_biomee_f_bysite.R index 7a8bc7b7..c4493b20 100644 --- a/R/run_biomee_f_bysite.R +++ b/R/run_biomee_f_bysite.R @@ -26,7 +26,8 @@ #' If multiple land units (LU) are simulated, an additional column 'aggregated' contains output aggregating all tiles as #' well as product pools. #' Model output for each land unit (LU) is provided as a list. -#' Each list has elements: \code{output_daily_tile}, \code{output_annual_tile}, and \code{output_annual_cohorts}. +#' Each list has elements: \code{output_daily_tile}, \code{output_annual_tile}, \code{output_annual_cohorts}, +#' \code{restart_init_cohort}, and \code{restart_init_soil}. #' Model output for the aggregated land units (LU) is provided as a list containing \code{output_daily_cell}. #' \describe{ #' \item{\code{output_daily_tile}}{A data.frame with daily outputs at tile level. @@ -34,14 +35,15 @@ #' \item{year}{Year of the simulation.} #' \item{doy}{Day of the year.} #' \item{Tk}{Air temperature (Kelvin).} +#' \item{Tksoil}{Dampened soil temperature (Kelvin).} #' \item{Prcp}{Precipitation (mm m\eqn{^{-2}} day\eqn{^{-1}}).} #' \item{SoilWater}{Soil water content in root zone (kg m\eqn{^{-2}}).} #' \item{Transp}{Transpiration (mm m\eqn{^{2-}} day\eqn{^{-1}}).} #' \item{Evap}{Evaporation (mm m\eqn{^{-2}} day\eqn{^{-1}}).} #' \item{Runoff}{Water runoff (mm m\eqn{^{-2}} day\eqn{^{-1}}).} -#' \item{ws1}{Volumetric soil water content for layer 1.} -#' \item{ws2}{Volumetric soil water content for layer 2.} -#' \item{ws3}{Volumetric soil water content for layer 3.} +#' \item{ws1}{Soil water content for layer 1 (mm = kg H2O m\eqn{^{-2}}).} +#' \item{ws2}{Soil water content for layer 2 (mm = kg H2O m\eqn{^{-2}}).} +#' \item{ws3}{Soil water content for layer 3 (mm = kg H2O m\eqn{^{-2}}).} #' \item{LAI}{Leaf area index (m\eqn{^2}/m\eqn{^2}).} #' \item{NPP}{Net primary productivity (kg C m\eqn{^{-2}} day\eqn{^{-1}}).} #' \item{GPP}{Gross primary production (kg C m\eqn{^{-2}} day\eqn{^{-1}}).} @@ -175,6 +177,11 @@ #' \item{n_deadtrees}{Plant to soil N flux due to mortality, including natural mortality, starvation and any other processes causing a loss of individuals in general (kg N yr\eqn{^{-1}} m\eqn{^{-2}}).} #' \item{c_deadtrees}{Plant to soil C flux due to mortality, including natural mortality, starvation and any other processes causing a loss of individuals in general (kg C yr\eqn{^{-1}} m\eqn{^{-2}}).} #' }} +#' \item{\code{restart_init_cohort}}{A data.frame that can be passed back as \code{init_cohort} for a restart run. +#' It contains the initialized pools together with restart-only cohort state such as phenology status, canopy layer, +#' GDD, leaf age, and the stored \code{bl_max}/\code{br_max} targets.} +#' \item{\code{restart_init_soil}}{A one-row data.frame that can be passed back as \code{init_soil} for a restart run. +#' It contains the soil pools together with the tile-level phenology restart state currently used during initialization.} #' } #' If there are multiple land units (LU) there will also be a column named `aggregated` containing a data.frame in the column #' `output_annual_cell` with annual outputs aggregating all tiles present in the simulation cell. Note that quantities per m2 refer to @@ -365,11 +372,17 @@ build_lu_out <- function(biomeeout, lu, trimmed_object){ # annual cohorts output_annual_cohorts <- annual_cohort_output(biomeeout[[3]][,,,lu,drop=FALSE]) + # restart state + restart_init_cohort <- restart_cohort_output(biomeeout[[5]][,,lu,drop=FALSE]) + restart_init_soil <- restart_soil_output(biomeeout[[6]][,lu,drop=FALSE]) + # format the output in a structured list out_lu <- list( output_daily_tile = output_daily_tile, output_annual_tile = output_annual_tile, - output_annual_cohorts = output_annual_cohorts + output_annual_cohorts = output_annual_cohorts, + restart_init_cohort = restart_init_cohort, + restart_init_soil = restart_init_soil ) return(out_lu) @@ -507,6 +520,26 @@ build_params_siml <- function(params_siml, forcing_years, makecheck){ } build_params_tile <- function(params_tile){ + # a) Ensure certain unused legacy parameters (if provided) are NA. + # If any other value is received an error is emitted. + # If not provided set them to NA. + must_be_NA_or_missing <- c('GR_factor') + params_that_should_be_NA <- lapply(seq_len(nrow(params_tile)), function(it){ + params_tile[it,] |> dplyr::select(any_of(must_be_NA_or_missing))}) %>% bind_rows() + + if (any(!is.na(params_that_should_be_NA))){ + offending <- which(!is.na(params_that_should_be_NA), arr.ind=TRUE, useNames = TRUE) + + colnam <- colnames(params_that_should_be_NA) + offending_species <- paste0(unique(sort(offending[,'row'])), collapse = ", ") # species + offending_parameters <- paste0(unique(colnam[offending[,'col']]), collapse = ", ") # parameter + stop(sprintf("Legacy parameters are unused and must be set to NA in 'params_tile'.\nThis concerns parameters: (%s) and species (%s)", + offending_parameters, offending_species)) + } + + # If parameters are missing add them as NA + params_tile[, must_be_NA_or_missing] <- NA + # Default values (of formerly hard-coded) if ('tau_acclim' %nin% names(params_tile)) { params_tile$tau_acclim <- 30.0 # days, acclimation time scale of p-model (vcmax, jmax) @@ -528,13 +561,9 @@ build_params_species <- function(params_species, params_tile_arg = NULL){ # b) Ensure certain unused legacy parameters (if provided) are NA. # If any other value is received an error is emitted. # If not provided set them to NA. - must_be_NA_or_missing <- c('phenotype','Vmax','alphaBM','leafLS','lAImax','CNleaf0','gamma_L','Vannual','betaOFF','betaON','leaf_size') - - params_that_should_be_NA <- lapply( - seq_len(nrow(params_species)), - function(it){ - params_species[it,] |> dplyr::select(any_of(must_be_NA_or_missing))} - ) %>% bind_rows() + must_be_NA_or_missing <- c('Vmax','alphaBM','leafLS','lAImax','CNleaf0','gamma_L','Vannual','betaOFF','betaON','leaf_size') + params_that_should_be_NA <- lapply((nrow(params_species)), function(it){ + params_species[it,] |> dplyr::select(any_of(must_be_NA_or_missing))}) %>% bind_rows() if (any(!is.na(params_that_should_be_NA))){ offending <- which(!is.na(params_that_should_be_NA), arr.ind=TRUE, useNames = TRUE) @@ -644,19 +673,43 @@ build_init_cohort <- function(init_cohort, params_species){ if ('init_cohort_nsc_n14' %nin% names(init_cohort)) { # init_cohort_nsn init_cohort$init_cohort_nsc_n14 <- 5.0 * (res$bl_max/curr_CNleaf0 + res$br_max/curr_CNroot0) # former default: initialize to value based on bl_max and br_max } + if ('restart_status' %nin% names(init_cohort)) { + init_cohort$restart_status <- -9999.0 + } + if ('restart_layer' %nin% names(init_cohort)) { + init_cohort$restart_layer <- -9999.0 + } + if ('restart_firstlayer' %nin% names(init_cohort)) { + init_cohort$restart_firstlayer <- -9999.0 + } + if ('restart_gdd' %nin% names(init_cohort)) { + init_cohort$restart_gdd <- NA_real_ + } + if ('restart_leaf_age' %nin% names(init_cohort)) { + init_cohort$restart_leaf_age <- NA_real_ + } + if ('restart_topyear' %nin% names(init_cohort)) { + init_cohort$restart_topyear <- NA_real_ + } + if ('restart_bl_max' %nin% names(init_cohort)) { + init_cohort$restart_bl_max <- NA_real_ + } + if ('restart_br_max' %nin% names(init_cohort)) { + init_cohort$restart_br_max <- NA_real_ + } if ('init_cohort_bl_n14' %nin% names(init_cohort)) { # TODO: rename to clearer: init_cohort_pleaf_n14 init_cohort$init_cohort_bl_n14 = init_cohort$init_cohort_bl / curr_CNleaf0 # former default } - if ('init_cohort_br_n14' %nin% names(init_cohort)) { # init_cohort_proot_n14 + if ('init_cohort_br_n14' %nin% names(init_cohort)) { # TODO: rename to clearer: init_cohort_proot_n14 init_cohort$init_cohort_br_n14 = init_cohort$init_cohort_br / curr_CNroot0 # former default } - if ('init_cohort_bsw_n14' %nin% names(init_cohort)) { # init_cohort_psapw_n14 + if ('init_cohort_bsw_n14' %nin% names(init_cohort)) { #TODO: rename to clearer: init_cohort_psapw_n14 init_cohort$init_cohort_bsw_n14 = init_cohort$init_cohort_bsw / curr_CNsw0 # former default } - if ('init_cohort_bHW_n14' %nin% names(init_cohort)) { # init_cohort_pwood_n14 + if ('init_cohort_bHW_n14' %nin% names(init_cohort)) { # TODO: rename to clearer: init_cohort_pwood_n14 init_cohort$init_cohort_bHW_n14 = init_cohort$init_cohort_bHW / curr_CNwood0 # former default } - if ('init_cohort_seedC_n14' %nin% names(init_cohort)) { # init_cohort_pseed_n14 + if ('init_cohort_seedC_n14' %nin% names(init_cohort)) { # TODO: rename to clearer: init_cohort_pseed_n14 init_cohort$init_cohort_seedC_n14 = init_cohort$init_cohort_seedC / curr_CNseed0 # former default } @@ -698,6 +751,12 @@ build_init_soil <- function(init_soil, init_cohort, params_tile){ Ntot <- Ntot_soil + Ntot_plant init_soil$init_N0_ecosystem = Ntot # former default: sum of the initialized soil and plant pools } + if ('restart_tk_pheno' %nin% names(init_soil)) { + init_soil$restart_tk_pheno <- NA_real_ + } + # if ('restart_vegn_gdd' %nin% names(init_soil)) { + # init_soil$restart_vegn_gdd <- NA_real_ + # } return(init_soil) } @@ -847,7 +906,16 @@ prepare_init_cohort <- function(init_cohort){ "init_cohort_seedC_n14", "init_cohort_nsc_n14", # land use: - "lu_index" + "lu_index", + # optional restart state: + "restart_status", + "restart_layer", + "restart_firstlayer", + "restart_gdd", + "restart_leaf_age", + "restart_topyear", + "restart_bl_max", + "restart_br_max" ) return(init_cohort) @@ -866,7 +934,7 @@ prepare_params_tile <- function(params_tile){ "LMAmin", "fsc_fine", "fsc_wood", - "GR_factor", + "GR_factor", # NOTE: dummy parameter, must be NA "l_fract", "retransN", "f_initialBSW", @@ -882,7 +950,7 @@ prepare_params_tile <- function(params_tile){ prepare_params_species <- function(params_species){ params_species <- params_species %>% dplyr::select( "lifeform", - "phenotype", # NOTE: dummy parameter, must be NA + "phenotype", "pt", "alpha_FR", "rho_FR", @@ -974,6 +1042,7 @@ daily_tile_output <- function(raw_data){ "year", "doy", "Tk", + "Tksoil", "Prcp", "SoilWater", "Transp", @@ -1093,6 +1162,72 @@ annual_tile_output <- function(raw_data, aggregated_LU = FALSE){ return(df) } +restart_cohort_output <- function(raw_data){ + df <- as.data.frame(raw_data[, , 1, drop = TRUE]) + colnames(df) <- c( + "init_cohort_species", + "init_cohort_nindivs", + "init_cohort_age", + "init_cohort_bl", + "init_cohort_br", + "init_cohort_bsw", + "init_cohort_bHW", + "init_cohort_seedC", + "init_cohort_nsc", + "init_cohort_bl_n14", + "init_cohort_br_n14", + "init_cohort_bsw_n14", + "init_cohort_bHW_n14", + "init_cohort_seedC_n14", + "init_cohort_nsc_n14", + "lu_index", + "restart_status", + "restart_layer", + "restart_firstlayer", + "restart_gdd", + "restart_leaf_age", + "restart_topyear", + "restart_bl_max", + "restart_br_max" + ) + + df <- df[!is.na(df$init_cohort_species), , drop = FALSE] + + if (nrow(df) > 0) { + df$init_cohort_species <- as.integer(df$init_cohort_species) + df$lu_index <- as.integer(df$lu_index) + df$restart_status <- as.integer(df$restart_status) + df$restart_layer <- as.integer(df$restart_layer) + df$restart_firstlayer <- as.integer(df$restart_firstlayer) + } + + df +} + +restart_soil_output <- function(raw_data){ + values <- as.numeric(raw_data[, 1]) + df <- as.data.frame(as.list(values)) + colnames(df) <- c( + "init_fast_soil_C", + "init_slow_soil_C", + "init_Nmineral", + "N_input", + "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_ecosystem", + "restart_tk_pheno" + #"restart_vegn_gdd" + ) + + df +} + annual_cohort_output <- function(raw_data){ annual_values <- c( "cohort", # ANNUAL_COHORTS_ID = 1 diff --git a/data-raw/generate_biomee_drivers.R b/data-raw/generate_biomee_drivers.R index e31a451e..5967498b 100644 --- a/data-raw/generate_biomee_drivers.R +++ b/data-raw/generate_biomee_drivers.R @@ -62,7 +62,6 @@ params_tile <- tibble( LMAmin = 0.02, fsc_fine = 1.0, fsc_wood = 0.0, - GR_factor = 0.33, l_fract = 0.0, retransN = 0.0, f_initialBSW = 0.2, @@ -72,6 +71,7 @@ params_tile <- tibble( params_species <- tibble( lifeform = c(0, 1, 1, 1, 1), # 0: grass; 1 Woody + phenotype = c(0, 1, 1, 1, 1), # 0: Deciduous; 1 Evergreen pt = c(1, 0, 0, 0, 0), # 0: C3; 1: C4 # Root parameters alpha_FR = rep(1.2, 5), diff --git a/data/biomee_gs_leuning_drivers.rda b/data/biomee_gs_leuning_drivers.rda index fb80eabb..9e409e82 100644 Binary files a/data/biomee_gs_leuning_drivers.rda and b/data/biomee_gs_leuning_drivers.rda differ diff --git a/data/biomee_gs_leuning_output.rda b/data/biomee_gs_leuning_output.rda index 31315c84..56df834c 100644 Binary files a/data/biomee_gs_leuning_output.rda and b/data/biomee_gs_leuning_output.rda differ diff --git a/data/biomee_p_model_drivers.rda b/data/biomee_p_model_drivers.rda index 253a1945..63abb1fa 100644 Binary files a/data/biomee_p_model_drivers.rda and b/data/biomee_p_model_drivers.rda differ diff --git a/data/biomee_p_model_luluc_drivers.rda b/data/biomee_p_model_luluc_drivers.rda index 288384f9..3b1cff10 100644 Binary files a/data/biomee_p_model_luluc_drivers.rda and b/data/biomee_p_model_luluc_drivers.rda differ diff --git a/data/biomee_p_model_luluc_output.rda b/data/biomee_p_model_luluc_output.rda index e13e6865..8f90bcef 100644 Binary files a/data/biomee_p_model_luluc_output.rda and b/data/biomee_p_model_luluc_output.rda differ diff --git a/data/biomee_p_model_output.rda b/data/biomee_p_model_output.rda index 8920dd39..851fac4d 100644 Binary files a/data/biomee_p_model_output.rda and b/data/biomee_p_model_output.rda differ diff --git a/man/biomee_gs_leuning_drivers.Rd b/man/biomee_gs_leuning_drivers.Rd index 0ae27d4d..d160ed18 100644 --- a/man/biomee_gs_leuning_drivers.Rd +++ b/man/biomee_gs_leuning_drivers.Rd @@ -56,7 +56,6 @@ This data structure can be freely used for documenting the dataset, but must inc \item{LMAmin}{Minimum LMA, leaf mass per unit area, only of parts of the leaf that become fine litter (metabolic parts), kg C m\eqn{^{-2}}. Has to be smaller than LMA.} \item{fsc_fine}{Fraction of fast turnover carbon in fine biomass.} \item{fsc_wood}{Fraction of fast turnover carbon in wood biomass.} - \item{GR_factor}{Growth respiration factor.} \item{l_fract}{Fraction of the carbon retained after leaf drop.} \item{retransN}{Retranslocation coefficient of nitrogen.} \item{f_initialBSW}{Coefficient for setting up initial sapwood.} @@ -145,6 +144,14 @@ This data structure can be freely used for documenting the dataset, but must inc \item{init_cohort_nsc_n14}{Initial non-structural biomass, in kg N per individual. (optional, defaults to value derived from br_max and bl_max)} \item{lu_index}{Land use type this cohorts belongs to (given as index in init_lu aray). (optional) Default: 0 (attach to all LU types except thoses which do not accept vegetation -- cf init_lu.vegetated).} + \item{restart_status}{Restart phenology status for the cohort (`0` = leaf-off, `1` = leaf-on). Optional; when omitted, a cold-start default is used.} + \item{restart_layer}{Restart canopy layer for the cohort. Optional; when omitted, cohorts are relayered as in a cold start.} + \item{restart_firstlayer}{Restart flag indicating whether the cohort has previously occupied the top layer. Optional.} + \item{restart_gdd}{Restart growing degree days stored on the cohort. Optional.} + \item{restart_leaf_age}{Restart leaf age, in years. Optional.} + \item{restart_topyear}{Restart count of years spent in the top canopy layer. Optional.} + \item{restart_bl_max}{Restart target leaf biomass (`bl_max`), in kg C per individual. Optional.} + \item{restart_br_max}{Restart target fine-root biomass (`br_max`), in kg C per individual. Optional.} }} \item{init_soil}{A data.frame of initial soil pools, including the following data: @@ -162,6 +169,8 @@ This data structure can be freely used for documenting the dataset, but must inc \item{init_wcl2}{Initial volumetric water content of soil layer 2, in m\eqn{^{3}}m\eqn{^{-3}}. (optional, defaults to field capacity)} \item{init_wcl3}{Initial volumetric water content of soil layer 3, in m\eqn{^{3}}m\eqn{^{-3}}. (optional, defaults to field capacity)} \item{init_N0_ecosystem}{Initial total amount of nitrogen in ecosystem (only used for nitrogen workaround), in kg N m\eqn{^{-2}}. (optional, defaults to sum of soil and plant pools.) Might not be needed.} + \item{restart_tk_pheno}{Restart smoothed phenology temperature, in Kelvin. Optional.} + ### \item{restart_vegn_gdd}{Restart tile-level growing degree days. Optional.} }} \item{init_lu}{A data.frame of initial land unit (LU) specifications, including the following data: diff --git a/man/run_biomee_f_bysite.Rd b/man/run_biomee_f_bysite.Rd index 9688db41..40a3ab67 100644 --- a/man/run_biomee_f_bysite.Rd +++ b/man/run_biomee_f_bysite.Rd @@ -52,7 +52,8 @@ If multiple land units (LU) are simulated, the columns are named according to th If multiple land units (LU) are simulated, an additional column 'aggregated' contains output aggregating all tiles as well as product pools. Model output for each land unit (LU) is provided as a list. -Each list has elements: \code{output_daily_tile}, \code{output_annual_tile}, and \code{output_annual_cohorts}. +Each list has elements: \code{output_daily_tile}, \code{output_annual_tile}, \code{output_annual_cohorts}, +\code{restart_init_cohort}, and \code{restart_init_soil}. Model output for the aggregated land units (LU) is provided as a list containing \code{output_daily_cell}. \describe{ \item{\code{output_daily_tile}}{A data.frame with daily outputs at tile level. @@ -60,14 +61,15 @@ Model output for the aggregated land units (LU) is provided as a list containing \item{year}{Year of the simulation.} \item{doy}{Day of the year.} \item{Tk}{Air temperature (Kelvin).} + \item{Tksoil}{Dampened soil temperature (Kelvin).} \item{Prcp}{Precipitation (mm m\eqn{^{-2}} day\eqn{^{-1}}).} \item{SoilWater}{Soil water content in root zone (kg m\eqn{^{-2}}).} \item{Transp}{Transpiration (mm m\eqn{^{2-}} day\eqn{^{-1}}).} \item{Evap}{Evaporation (mm m\eqn{^{-2}} day\eqn{^{-1}}).} \item{Runoff}{Water runoff (mm m\eqn{^{-2}} day\eqn{^{-1}}).} - \item{ws1}{Volumetric soil water content for layer 1.} - \item{ws2}{Volumetric soil water content for layer 2.} - \item{ws3}{Volumetric soil water content for layer 3.} + \item{ws1}{Soil water content for layer 1 (mm = kg H2O m\eqn{^{-2}}).} + \item{ws2}{Soil water content for layer 2 (mm = kg H2O m\eqn{^{-2}}).} + \item{ws3}{Soil water content for layer 3 (mm = kg H2O m\eqn{^{-2}}).} \item{LAI}{Leaf area index (m\eqn{^2}/m\eqn{^2}).} \item{NPP}{Net primary productivity (kg C m\eqn{^{-2}} day\eqn{^{-1}}).} \item{GPP}{Gross primary production (kg C m\eqn{^{-2}} day\eqn{^{-1}}).} @@ -201,6 +203,11 @@ Model output for the aggregated land units (LU) is provided as a list containing \item{n_deadtrees}{Plant to soil N flux due to mortality, including natural mortality, starvation and any other processes causing a loss of individuals in general (kg N yr\eqn{^{-1}} m\eqn{^{-2}}).} \item{c_deadtrees}{Plant to soil C flux due to mortality, including natural mortality, starvation and any other processes causing a loss of individuals in general (kg C yr\eqn{^{-1}} m\eqn{^{-2}}).} }} + \item{\code{restart_init_cohort}}{A data.frame that can be passed back as \code{init_cohort} for a restart run. + It contains the initialized pools together with restart-only cohort state such as phenology status, canopy layer, + GDD, leaf age, and the stored \code{bl_max}/\code{br_max} targets.} + \item{\code{restart_init_soil}}{A one-row data.frame that can be passed back as \code{init_soil} for a restart run. + It contains the soil pools together with the tile-level phenology restart state currently used during initialization.} } If there are multiple land units (LU) there will also be a column named `aggregated` containing a data.frame in the column `output_annual_cell` with annual outputs aggregating all tiles present in the simulation cell. Note that quantities per m2 refer to diff --git a/src/aggregated_tile_biomee.mod.f90 b/src/aggregated_tile_biomee.mod.f90 index ecf977a7..f9805570 100644 --- a/src/aggregated_tile_biomee.mod.f90 +++ b/src/aggregated_tile_biomee.mod.f90 @@ -10,6 +10,7 @@ module md_aggregated_tile_biomee use md_interface_out_biomee use md_cohort use md_cohort_linked_list, only: cohort_stack_item + use, intrinsic :: iso_c_binding, only: c_double implicit none @@ -30,6 +31,7 @@ module md_aggregated_tile_biomee procedure populate_outarrays procedure populate_outcohorts procedure populate_outdaily + procedure populate_restart_state end type aggregated_tile @@ -321,6 +323,22 @@ subroutine populate_outarrays(self, output_annual_aggregated, output_annual_tile end subroutine populate_outarrays + subroutine populate_restart_state(self, output_restart_cohorts, output_restart_soil) + class(aggregated_tile), intent(in) :: self + real(kind=c_double), dimension(:, :, :), intent(out) :: output_restart_cohorts + real(kind=c_double), dimension(:, :), intent(out) :: output_restart_soil + + integer :: lu_idx + + do lu_idx = 1, self%n_lu() + associate(lu => self%tiles(lu_idx)) + if (lu%non_empty()) then + call lu%vegn%export_restart_state(output_restart_cohorts(:, :, lu_idx), output_restart_soil(:, lu_idx)) + end if + end associate + end do + end subroutine populate_restart_state + subroutine populate_outcohorts(self, output_annual_cohorts) use, intrinsic :: iso_fortran_env, dp=>real64 diff --git a/src/biosphere_biomee.mod.f90 b/src/biosphere_biomee.mod.f90 index cc3db5b5..fd8143ff 100644 --- a/src/biosphere_biomee.mod.f90 +++ b/src/biosphere_biomee.mod.f90 @@ -9,7 +9,7 @@ module md_biosphere_biomee use md_vegetation_processes_biomee use md_soil_biomee use md_forcing_biomee - use md_soiltemp, only: air_to_soil_temp + use md_soiltemp, only: air_to_soil_temp_biomee use, intrinsic :: iso_c_binding, only: c_double implicit none @@ -39,21 +39,18 @@ subroutine biosphere_annual( & integer :: doy ! Day of year integer :: dayloop_idx, fastloop_idx, simu_steps real, dimension(ndayyear) :: daily_temp ! Daily temperatures (average) in Kelvin - real, dimension(size(climate)) :: tair - - tair = climate(:)%TairK !---------------------------------------------------------------- ! INITIALISATIONS !---------------------------------------------------------------- - ! Compute averaged daily temperatures - call aggregate(daily_temp, tair, inputs%steps_per_day) - !===== Reset diagnostics and counters simu_steps = 0 ! fast loop doy = 0 call vegn%zero_diagnostics() + ! Compute averaged daily temperatures + call aggregate(daily_temp, climate(:)%TairK, inputs%steps_per_day) ! save result to daily_temp + !---------------------------------------------------------------- ! LOOP THROUGH DAYS !---------------------------------------------------------------- @@ -63,7 +60,7 @@ subroutine biosphere_annual( & ! Compute daily air and soil temperature vegn%tk_daily = daily_temp(doy) - vegn%tc_soil = air_to_soil_temp( & + vegn%tc_soil = air_to_soil_temp_biomee( & vegn%thetaS(), & daily_temp - kTkelvin, & doy, & diff --git a/src/biosphere_pmodel.mod.f90 b/src/biosphere_pmodel.mod.f90 index 1535a024..e0be775b 100644 --- a/src/biosphere_pmodel.mod.f90 +++ b/src/biosphere_pmodel.mod.f90 @@ -12,7 +12,7 @@ module md_biosphere_pmodel getpar_modl_tile, diag_daily use md_plant_pmodel, only: getpar_modl_plant use md_sofunutils, only: calc_patm - use md_soiltemp, only: soiltemp + use md_soiltemp, only: soiltemp_pmodel use md_track_vegetation_d13c, only: track_vegetation_d13c implicit none @@ -161,8 +161,8 @@ function biosphere_annual() result( out_biosphere ) !---------------------------------------------------------------- ! calculate soil temperature !---------------------------------------------------------------- - ! if (verbose) print*, 'calling soiltemp() ... ' - call soiltemp(& + ! if (verbose) print*, 'calling soiltemp_pmodel() ... ' + call soiltemp_pmodel(& tile(:)%soil, & myinterface%climate(:)%dtemp, & doy, & diff --git a/src/cohort_biomee.mod.f90 b/src/cohort_biomee.mod.f90 index c10d4499..440128e1 100644 --- a/src/cohort_biomee.mod.f90 +++ b/src/cohort_biomee.mod.f90 @@ -41,7 +41,7 @@ module md_cohort !===== Biological state variables (prognostic) real :: gdd = 0.0 ! growing degree-day (phenology) integer :: status = LEAF_OFF ! growth status of plant - real :: leaf_age = 0.0 ! leaf age (years) + real :: leaf_age = 0.0 ! leaf age (years) !===== Organic pools, kg tree-1 type(orgpool) :: pleaf ! leaf biomass @@ -111,7 +111,7 @@ module md_cohort !========== Other member procedures - procedure reset_cohort + procedure reset_cohort_fluxes procedure init_bl_max_br_max procedure can_be_merged_with @@ -310,15 +310,15 @@ pure subroutine merge_in(self, other) end subroutine merge_in - pure subroutine reset_cohort(self) + pure subroutine reset_cohort_fluxes(self) !//////////////////////////////////////////////////////////////// ! Reset cohort temporary data (used yearly) !--------------------------------------------------------------- class(cohort_type), intent(inout) :: self ! Save last year's values - self%DBH_ys = self%dbh() - self%BA_ys = basal_area(self) + self%DBH_ys = self%dbh() ! _ys: year start + self%BA_ys = basal_area(self) ! _ys: year start self%WupL(:) = 0.0 @@ -342,7 +342,7 @@ pure subroutine reset_cohort(self) self%m_turnover = 0.0 self%deathrate = 0.0 - end subroutine reset_cohort + end subroutine reset_cohort_fluxes function can_be_merged_with(self, other) result(res) !//////////////////////////////////////////////////////////////// diff --git a/src/interface_in_biosphere_biomee.mod.f90 b/src/interface_in_biosphere_biomee.mod.f90 index 5b294e4f..0c84772d 100644 --- a/src/interface_in_biosphere_biomee.mod.f90 +++ b/src/interface_in_biosphere_biomee.mod.f90 @@ -16,14 +16,16 @@ module md_interface_in_biomee real, public, parameter :: thksl(MAX_LEVELS) = (/0.05, 0.45, 1.5/) ! m, thickness of soil layers !===== Leaf life span - real, parameter :: c_LLS = 28.57143 ! yr/ (kg C m-2), c_LLS=1/LMAs, where LMAs = 0.035 + real, parameter :: c_LLS = 28.57143 ! yr/ (kg C m-2), c_LLS=1yr/LMAs, where LMAs = 0.035 kgC/m2, i.e. + ! leaves with 0.035 are approximated with a lifespan of 1 + ! year (NOTE: can lead to non-compatible LMA and phenotype parameters) !===== Number of parameters integer, public, parameter :: nvars_params_siml = 11 integer, public, parameter :: nvars_site_info = 4 integer, public, parameter :: nvars_params_tile = 20 - integer, public, parameter :: nvars_init_soil = 13 - integer, public, parameter :: nvars_init_cohorts = 16 + integer, public, parameter :: nvars_init_soil = 14 + integer, public, parameter :: nvars_init_cohorts = 24 integer, public, parameter :: nvars_params_species = 65 integer, public, parameter :: nvars_init_lu = 5 @@ -67,7 +69,7 @@ module md_interface_in_biomee real :: LMAmin real :: fsc_fine real :: fsc_wood - real :: GR_factor + ! real :: GR_factor ! unused parameter real :: l_fract real :: retransN real :: f_initialBSW @@ -76,8 +78,8 @@ module md_interface_in_biomee !===== GPP P-model parameters (no effect in gs_leuning option) real :: tau_acclim - real :: soilm_thetastar ! unused parameter - real :: soilm_betao ! unused parameter + ! real :: soilm_thetastar ! unused parameter + ! real :: soilm_betao ! unused parameter real :: CN0metabolicL real :: CN0structuralL @@ -203,6 +205,14 @@ module md_interface_in_biomee real :: init_cohort_seedC_n14 real :: init_cohort_nsc_n14 integer :: lu_index ! Which land use (LU) should this cohort be used for. Given as the index in 'init_lu' array. + integer :: restart_status + integer :: restart_layer + integer :: restart_firstlayer + real :: restart_gdd + real :: restart_leaf_age + real :: restart_topyear + real :: restart_bl_max + real :: restart_br_max contains @@ -224,6 +234,8 @@ module md_interface_in_biomee real :: init_wcl2 real :: init_wcl3 real :: init_N0_ecosystem + real :: restart_tk_pheno + ! real :: restart_vegn_gdd contains @@ -403,6 +415,14 @@ subroutine populate_init_cohort(self, init_cohort) self%init_cohort_seedC_n14 = real(init_cohort(14)) self%init_cohort_nsc_n14 = real(init_cohort(15)) self%lu_index = int( init_cohort(16)) + self%restart_status = int( init_cohort(17)) + self%restart_layer = int( init_cohort(18)) + self%restart_firstlayer = int( init_cohort(19)) + self%restart_gdd = real(init_cohort(20)) + self%restart_leaf_age = real(init_cohort(21)) + self%restart_topyear = real(init_cohort(22)) + self%restart_bl_max = real(init_cohort(23)) + self%restart_br_max = real(init_cohort(24)) end subroutine populate_init_cohort subroutine populate_init_soil(self, init_soil) @@ -423,6 +443,8 @@ subroutine populate_init_soil(self, init_soil) self%init_wcl2 = real( init_soil(11)) self%init_wcl3 = real( init_soil(12)) self%init_N0_ecosystem = real( init_soil(13)) + self%restart_tk_pheno = real( init_soil(14)) + ! self%restart_vegn_gdd = real( init_soil(15)) end subroutine populate_init_soil @@ -442,7 +464,7 @@ subroutine populate_params_tile(self, params_tile) self%LMAmin = real( params_tile(9) ) self%fsc_fine = real( params_tile(10) ) self%fsc_wood = real( params_tile(11) ) - self%GR_factor = real( params_tile(12) ) + ! self%GR_factor = real( params_tile(12) ) ! unused self%l_fract = real( params_tile(13) ) self%retransN = real( params_tile(14) ) self%f_initialBSW = real( params_tile(15) ) @@ -474,7 +496,7 @@ subroutine populate_spec_data(self, params_species) real(kind=c_double), dimension(nvars_params_species), intent(in) :: params_species self%lifeform = int( params_species(1)) - ! self%phenotype = int( params_species(2)) ! overridden by ifelse(self%leafLS>1.0, 1, 0) + self%phenotype = int( params_species(2)) self%pt = int( params_species(3)) self%alpha_FR = real( params_species(4)) self%rho_FR = real( params_species(5)) @@ -544,7 +566,6 @@ subroutine populate_spec_data(self, params_species) self%f_LFR_max = real( params_species(65)) ! Following parameters are not yet populated and will be initialized with init_pft_data(): - ! integer :: phenotype ! phenology type: 0 for deciduous, 1 for evergreen !===== Population level variables ! real :: LAImax, underLAImax ! max. LAI - Overridden !===== Root traits @@ -619,14 +640,8 @@ subroutine init_derived_species_data(self) self%root_frac(j) = self%root_frac(j) + residual*thksl(j)/rdepth(MAX_LEVELS) enddo - if(self%leafLS>1.0)then - self%phenotype = 1 - else - self%phenotype = 0 - endif - - ! Leaf turnover rate, (leaf longevity as a function of LMA) - self%alpha_L = 1.0/self%leafLS * self%phenotype + ! Leaf turnover rate + self%alpha_L = 1.0/self%leafLS * self%phenotype ! unneeded for deciduous (phenotype=0) end subroutine init_derived_species_data diff --git a/src/interface_out_biosphere_biomee.mod.f90 b/src/interface_out_biosphere_biomee.mod.f90 index de52baa1..3f315eef 100644 --- a/src/interface_out_biosphere_biomee.mod.f90 +++ b/src/interface_out_biosphere_biomee.mod.f90 @@ -13,44 +13,45 @@ module md_interface_out_biomee !=============== Daily - integer, public, parameter :: nvars_daily_tile = 36 + integer, public, parameter :: nvars_daily_tile = 37 integer, public, parameter :: DAILY_TILE_YEAR = 1 integer, public, parameter :: DAILY_TILE_DOY = 2 integer, public, parameter :: DAILY_TILE_TK = 3 - integer, public, parameter :: DAILY_TILE_PRCP = 4 - integer, public, parameter :: DAILY_TILE_SOIL_W = 5 - integer, public, parameter :: DAILY_TILE_TRSP = 6 - integer, public, parameter :: DAILY_TILE_EVAP = 7 - integer, public, parameter :: DAILY_TILE_RUNOFF = 8 - integer, public, parameter :: DAILY_TILE_WS1 = 9 - integer, public, parameter :: DAILY_TILE_WS2 = 10 - integer, public, parameter :: DAILY_TILE_WS3 = 11 - integer, public, parameter :: DAILY_TILE_LAI = 12 - integer, public, parameter :: DAILY_TILE_NPP = 13 - integer, public, parameter :: DAILY_TILE_GPP = 14 - integer, public, parameter :: DAILY_TILE_RESP = 15 - integer, public, parameter :: DAILY_TILE_RH = 16 - integer, public, parameter :: DAILY_TILE_NSC = 17 - integer, public, parameter :: DAILY_TILE_SEED_C = 18 - integer, public, parameter :: DAILY_TILE_LEAF_C = 19 - integer, public, parameter :: DAILY_TILE_ROOT_C = 20 - integer, public, parameter :: DAILY_TILE_SWC = 21 - integer, public, parameter :: DAILY_TILE_HWC = 22 - integer, public, parameter :: DAILY_TILE_NSN = 23 - integer, public, parameter :: DAILY_TILE_SEED_N = 24 - integer, public, parameter :: DAILY_TILE_LEAF_N = 25 - integer, public, parameter :: DAILY_TILE_ROOT_N = 26 - integer, public, parameter :: DAILY_TILE_SW_N = 27 - integer, public, parameter :: DAILY_TILE_HW_N = 28 - integer, public, parameter :: DAILY_TILE_MCRB_C = 29 - integer, public, parameter :: DAILY_TILE_FASTSOM = 30 - integer, public, parameter :: DAILY_TILE_SLOWSOM = 31 - integer, public, parameter :: DAILY_TILE_MCRB_N = 32 - integer, public, parameter :: DAILY_TILE_FS_N = 33 - integer, public, parameter :: DAILY_TILE_SL_N = 34 - integer, public, parameter :: DAILY_TILE_INORG_N = 35 - integer, public, parameter :: DAILY_TILE_N_UPTK = 36 + integer, public, parameter :: DAILY_TILE_TKSOIL = 4 + integer, public, parameter :: DAILY_TILE_PRCP = 5 + integer, public, parameter :: DAILY_TILE_SOIL_W = 6 + integer, public, parameter :: DAILY_TILE_TRSP = 7 + integer, public, parameter :: DAILY_TILE_EVAP = 8 + integer, public, parameter :: DAILY_TILE_RUNOFF = 9 + integer, public, parameter :: DAILY_TILE_WS1 = 10 + integer, public, parameter :: DAILY_TILE_WS2 = 11 + integer, public, parameter :: DAILY_TILE_WS3 = 12 + integer, public, parameter :: DAILY_TILE_LAI = 13 + integer, public, parameter :: DAILY_TILE_NPP = 14 + integer, public, parameter :: DAILY_TILE_GPP = 15 + integer, public, parameter :: DAILY_TILE_RESP = 16 + integer, public, parameter :: DAILY_TILE_RH = 17 + integer, public, parameter :: DAILY_TILE_NSC = 18 + integer, public, parameter :: DAILY_TILE_SEED_C = 19 + integer, public, parameter :: DAILY_TILE_LEAF_C = 20 + integer, public, parameter :: DAILY_TILE_ROOT_C = 21 + integer, public, parameter :: DAILY_TILE_SWC = 22 + integer, public, parameter :: DAILY_TILE_HWC = 23 + integer, public, parameter :: DAILY_TILE_NSN = 24 + integer, public, parameter :: DAILY_TILE_SEED_N = 25 + integer, public, parameter :: DAILY_TILE_LEAF_N = 26 + integer, public, parameter :: DAILY_TILE_ROOT_N = 27 + integer, public, parameter :: DAILY_TILE_SW_N = 28 + integer, public, parameter :: DAILY_TILE_HW_N = 29 + integer, public, parameter :: DAILY_TILE_MCRB_C = 30 + integer, public, parameter :: DAILY_TILE_FASTSOM = 31 + integer, public, parameter :: DAILY_TILE_SLOWSOM = 32 + integer, public, parameter :: DAILY_TILE_MCRB_N = 33 + integer, public, parameter :: DAILY_TILE_FS_N = 34 + integer, public, parameter :: DAILY_TILE_SL_N = 35 + integer, public, parameter :: DAILY_TILE_INORG_N = 36 + integer, public, parameter :: DAILY_TILE_N_UPTK = 37 !=============== Cohorts diff --git a/src/main_biomee.mod.f90 b/src/main_biomee.mod.f90 index 2e3c4496..55bbbc0e 100644 --- a/src/main_biomee.mod.f90 +++ b/src/main_biomee.mod.f90 @@ -33,7 +33,9 @@ subroutine biomee_f( & output_daily_tile, & output_annual_tile, & output_annual_cohorts, & - output_annual_aggregated & + output_annual_aggregated, & + output_restart_cohorts, & + output_restart_soil & ) bind(C, name = "biomee_f_") !//////////////////////////////////////////////////////////////// @@ -83,6 +85,8 @@ subroutine biomee_f( & real(kind=c_double), dimension(NCohortMax, nt_annual_trans, nvars_annual_cohorts, n_lu), & intent(out) :: output_annual_cohorts real(kind=c_double), dimension(nt_annual,nvars_aggregated_out), intent(out) :: output_annual_aggregated + real(kind=c_double), dimension(NCohortMax, nvars_init_cohorts, n_lu), intent(out) :: output_restart_cohorts + real(kind=c_double), dimension(nvars_init_soil, n_lu), intent(out) :: output_restart_soil ! Local state type(aggregated_tile) :: aggregat @@ -102,6 +106,8 @@ subroutine biomee_f( & output_annual_tile = nan output_annual_cohorts = nan output_annual_aggregated = nan + output_restart_cohorts = nan + output_restart_soil = nan ! Allocate climate array allocate(climate(inputs%ntstepsyear)) @@ -124,6 +130,11 @@ subroutine biomee_f( & !---------------------------------------------------------------- steering_state = get_steering( yr, inputs%params_siml%steering_input ) + !---------------------------------------------------------------- + ! Print here all persistent state variables to check initialization and restart + !---------------------------------------------------------------- + !call debug_print_state(steering_state, aggregat) + !---------------------------------------------------------------- ! Get external (environmental) forcing (for biomee, co2 is in inputs%climate) !---------------------------------------------------------------- @@ -182,6 +193,9 @@ subroutine biomee_f( & end do yearloop + call aggregat%populate_restart_state(output_restart_cohorts, output_restart_soil) + !call debug_print_restart_state(output_restart_cohorts, output_restart_soil) + !---------------------------------------------------------------- ! Clean-up allocated memory !---------------------------------------------------------------- @@ -191,4 +205,329 @@ subroutine biomee_f( & end subroutine biomee_f + subroutine debug_print_state(steering_state, aggregat) + use md_aggregated_tile_biomee, only: aggregated_tile + use md_params_core, only: outtype_steering + use md_orgpool, only: orgpool + + implicit none + + type(outtype_steering), intent(in) :: steering_state + class(aggregated_tile), intent(in) :: aggregat + + type(orgpool) :: prod_pool + integer :: lu_idx, pool_idx + + ! PRINT STEERING STATE: + print *, 'DEBUG BIOMEE STATE START year_loop=', steering_state%year + call debug_print_steering_state(steering_state) + + ! PRINT LU PRODUCT POOLS: + do pool_idx = 1, 2 + prod_pool = aggregat%prod_pools%get_pool(pool_idx) + print *, 'DEBUG BIOMEE STATE product_pool=', pool_idx, ' c12=', prod_pool%c12, ' d13=', prod_pool%d13, ' n14=', prod_pool%n14 + end do + print *, ' ' ! For newline + + ! PRINT LU state for each LU + do lu_idx = 1, aggregat%n_lu() + call debug_print_lu_state('DEBUG BIOMEE STATE', lu_idx, aggregat%tiles(lu_idx)) + end do + + print *, 'DEBUG BIOMEE STATE END year_loop=', steering_state%year + + end subroutine debug_print_state + + subroutine debug_print_steering_state(steering_state) + use md_params_core, only: outtype_steering + + implicit none + + type(outtype_steering), intent(in) :: steering_state + + print *, 'DEBUG BIOMEE STATE steering year=', steering_state%year, ' climateyear=', steering_state%climateyear, & + ' climateyear_idx=', steering_state%climateyear_idx, ' forcingyear=', steering_state%forcingyear, & + ' forcingyear_idx=', steering_state%forcingyear_idx, ' outyear=', steering_state%outyear + print *, 'DEBUG BIOMEE STATE steering spinup=', steering_state%spinup, ' init=', steering_state%init, & + ' finalize=', steering_state%finalize, ' daily_reporting=', steering_state%daily_reporting, & + ' daily_report_idx=', steering_state%daily_report_idx, ' cohort_reporting=', steering_state%cohort_reporting, & + ' cohort_report_idx=', steering_state%cohort_report_idx + print *, ' ' ! For newline + + end subroutine debug_print_steering_state + + subroutine debug_print_lu_state(label, lu_idx, lu) + use md_lu_tile_biomee, only: lu_tile + use md_cohort_linked_list, only: cohort_stack_item + + implicit none + + character(len=*), intent(in) :: label + integer, intent(in) :: lu_idx + class(lu_tile), intent(in) :: lu + + type(cohort_stack_item), pointer :: it + + ! PRINT ALL LU-LEVEL (TILE) VARIABLES + call debug_print_lu_header('DEBUG BIOMEE STATE LU') + call debug_print_label_cell(trim(label)//' LU') + call debug_print_int_cell(lu_idx) + call debug_print_real_cell(lu%fraction) + call debug_print_logical_cell(lu%non_empty()) + call debug_print_int_cell(lu%vegn%n_cohorts()) + call debug_print_real_cell(lu%vegn%age) + call debug_print_real_cell(lu%vegn%density) + call debug_print_real_cell(lu%vegn%pleaf%c12) + call debug_print_real_cell(lu%vegn%pleaf%n14) + call debug_print_real_cell(lu%vegn%proot%c12) + call debug_print_real_cell(lu%vegn%proot%n14) + call debug_print_real_cell(lu%vegn%psapw%c12) + call debug_print_real_cell(lu%vegn%psapw%n14) + call debug_print_real_cell(lu%vegn%pwood%c12) + call debug_print_real_cell(lu%vegn%pwood%n14) + call debug_print_real_cell(lu%vegn%pseed%c12) + call debug_print_real_cell(lu%vegn%pseed%n14) + call debug_print_real_cell(lu%vegn%plabl%c12) + call debug_print_real_cell(lu%vegn%plabl%n14) + call debug_print_real_cell(lu%vegn%psoil_fs%c12) + call debug_print_real_cell(lu%vegn%psoil_fs%n14) + call debug_print_real_cell(lu%vegn%psoil_sl%c12) + call debug_print_real_cell(lu%vegn%psoil_sl%n14) + call debug_print_real_cell(lu%vegn%pmicr%c12) + call debug_print_real_cell(lu%vegn%pmicr%d13) + call debug_print_real_cell(lu%vegn%pmicr%n14) + call debug_print_real_cell(lu%vegn%inorg%c12) + call debug_print_real_cell(lu%vegn%inorg%n14) + call debug_print_real_cell(lu%vegn%wcl(1)) + call debug_print_real_cell(lu%vegn%wcl(2)) + call debug_print_real_cell(lu%vegn%wcl(3)) + call debug_print_real_cell(lu%vegn%tk_pheno) + call debug_print_real_cell(lu%vegn%initialN0) + call debug_print_real_cell(lu%vegn%annualN) + call debug_print_real_cell(lu%vegn%totC) + call debug_print_real_cell(lu%vegn%totN) + call debug_print_real_cell(lu%vegn%totSeed%c12) + call debug_print_real_cell(lu%vegn%totSeed%n14) + call debug_print_real_cell(lu%vegn%totNewC%c12) + call debug_print_real_cell(lu%vegn%totNewC%n14) + call debug_print_real_cell(lu%vegn%tk_daily) + call debug_print_real_cell(lu%vegn%tc_soil) + write(*, *) + print *, ' ' ! For newline + + ! PRINT ALL COHORTS OF THIS LU + call debug_print_cohort_header('DEBUG BIOMEE STATE COHORT') + it => lu%vegn%cohorts() + do while (associated(it)) + call debug_print_cohort_state(label, lu_idx, it) + it => it%next() + end do + print *, ' ' ! For newline + + ! PRINT SMOOTHENED DTEMP AND WSCAL: + print *, trim(label), ' lu=', lu_idx, ' dtemp_pvy_allocated=', allocated(lu%vegn%dtemp_pvy), & + ' wscal_pvy_allocated=', allocated(lu%vegn%wscal_pvy) + if (allocated(lu%vegn%dtemp_pvy)) then + print *, trim(label), ' lu=', lu_idx, ' dtemp_pvy=', lu%vegn%dtemp_pvy + end if + if (allocated(lu%vegn%wscal_pvy)) then + print *, trim(label), ' lu=', lu_idx, ' wscal_pvy=', lu%vegn%wscal_pvy + end if + print *, trim(label), ' lu=', lu_idx, ' wscal_alldays=', lu%vegn%wscal_alldays + + end subroutine debug_print_lu_state + + subroutine debug_print_cohort_state(label, lu_idx, it) + use md_cohort_linked_list, only: cohort_stack_item + + implicit none + + character(len=*), intent(in) :: label + integer, intent(in) :: lu_idx + type(cohort_stack_item), pointer, intent(in) :: it + + call debug_print_label_cell(trim(label)//' COHORT') + call debug_print_int_cell(lu_idx) + call debug_print_int_cell(it%uid()) + call debug_print_int_cell(it%cohort%species) + call debug_print_real_cell(it%cohort%density) + call debug_print_real_cell(it%cohort%age) + call debug_print_int_cell(it%cohort%layer) + call debug_print_int_cell(it%cohort%firstlayer) + call debug_print_int_cell(it%cohort%status) + call debug_print_real_cell(it%cohort%gdd) + call debug_print_real_cell(it%cohort%leaf_age) + call debug_print_real_cell(it%cohort%topyear) + call debug_print_real_cell(it%cohort%bl_max) + call debug_print_real_cell(it%cohort%br_max) + call debug_print_real_cell(it%cohort%pleaf%c12) + call debug_print_real_cell(it%cohort%pleaf%n14) + call debug_print_real_cell(it%cohort%proot%c12) + call debug_print_real_cell(it%cohort%proot%n14) + call debug_print_real_cell(it%cohort%psapw%c12) + call debug_print_real_cell(it%cohort%psapw%n14) + call debug_print_real_cell(it%cohort%pwood%c12) + call debug_print_real_cell(it%cohort%pwood%n14) + call debug_print_real_cell(it%cohort%pseed%c12) + call debug_print_real_cell(it%cohort%pseed%n14) + call debug_print_real_cell(it%cohort%plabl%c12) + call debug_print_real_cell(it%cohort%plabl%n14) + write(*, *) + + end subroutine debug_print_cohort_state + + subroutine debug_print_lu_header(label) + implicit none + + character(len=*), intent(in) :: label + + call debug_print_label_cell(trim(label)) + call debug_print_header_cell('lu') + call debug_print_header_cell('fraction') + call debug_print_header_cell('non_empty') + call debug_print_header_cell('n_cohorts') + call debug_print_header_cell('age') + call debug_print_header_cell('density') + call debug_print_header_cell('pleaf_c') + call debug_print_header_cell('pleaf_n') + call debug_print_header_cell('proot_c') + call debug_print_header_cell('proot_n') + call debug_print_header_cell('psapw_c') + call debug_print_header_cell('psapw_n') + call debug_print_header_cell('pwood_c') + call debug_print_header_cell('pwood_n') + call debug_print_header_cell('pseed_c') + call debug_print_header_cell('pseed_n') + call debug_print_header_cell('plabl_c') + call debug_print_header_cell('plabl_n') + call debug_print_header_cell('psoilfs_c') + call debug_print_header_cell('psoilfs_n') + call debug_print_header_cell('psoilsl_c') + call debug_print_header_cell('psoilsl_n') + call debug_print_header_cell('pmicr_c') + call debug_print_header_cell('pmicr_d13') + call debug_print_header_cell('pmicr_n') + call debug_print_header_cell('inorg_c') + call debug_print_header_cell('inorg_n') + call debug_print_header_cell('wcl1') + call debug_print_header_cell('wcl2') + call debug_print_header_cell('wcl3') + call debug_print_header_cell('tk_pheno') + call debug_print_header_cell('initialN0') + call debug_print_header_cell('annualN') + call debug_print_header_cell('totC') + call debug_print_header_cell('totN') + call debug_print_header_cell('totSeed_c') + call debug_print_header_cell('totSeed_n') + call debug_print_header_cell('totNewC_c') + call debug_print_header_cell('totNewC_n') + call debug_print_header_cell('tk_daily') + call debug_print_header_cell('tc_soil') + write(*, *) + + end subroutine debug_print_lu_header + + subroutine debug_print_cohort_header(label) + implicit none + + character(len=*), intent(in) :: label + + call debug_print_label_cell(trim(label)) + call debug_print_header_cell('lu') + call debug_print_header_cell('cohort_uid') + call debug_print_header_cell('species') + call debug_print_header_cell('density') + call debug_print_header_cell('age') + call debug_print_header_cell('layer') + call debug_print_header_cell('firstlayer') + call debug_print_header_cell('status') + call debug_print_header_cell('gdd') + call debug_print_header_cell('leaf_age') + call debug_print_header_cell('topyear') + call debug_print_header_cell('bl_max') + call debug_print_header_cell('br_max') + call debug_print_header_cell('pleaf_c') + call debug_print_header_cell('pleaf_n') + call debug_print_header_cell('proot_c') + call debug_print_header_cell('proot_n') + call debug_print_header_cell('psapw_c') + call debug_print_header_cell('psapw_n') + call debug_print_header_cell('pwood_c') + call debug_print_header_cell('pwood_n') + call debug_print_header_cell('pseed_c') + call debug_print_header_cell('pseed_n') + call debug_print_header_cell('plabl_c') + call debug_print_header_cell('plabl_n') + write(*, *) + + end subroutine debug_print_cohort_header + + subroutine debug_print_label_cell(value) + implicit none + + character(len=*), intent(in) :: value + + write(*, '(a24,1x)', advance='no') adjustl(value) + + end subroutine debug_print_label_cell + + subroutine debug_print_header_cell(value) + implicit none + + character(len=*), intent(in) :: value + + write(*, '(a12,1x)', advance='no') adjustl(value) + + end subroutine debug_print_header_cell + + subroutine debug_print_real_cell(value) + implicit none + + real, intent(in) :: value + + write(*, '(es12.4,1x)', advance='no') value + + end subroutine debug_print_real_cell + + subroutine debug_print_int_cell(value) + implicit none + + integer, intent(in) :: value + + write(*, '(i12,1x)', advance='no') value + + end subroutine debug_print_int_cell + + subroutine debug_print_logical_cell(value) + implicit none + + logical, intent(in) :: value + + write(*, '(l12,1x)', advance='no') value + + end subroutine debug_print_logical_cell + + subroutine debug_print_restart_state(output_restart_cohorts, output_restart_soil) + use, intrinsic :: iso_c_binding, only: c_double + + implicit none + + real(kind=c_double), dimension(:, :, :), intent(in) :: output_restart_cohorts + real(kind=c_double), dimension(:, :), intent(in) :: output_restart_soil + + integer :: lu_idx + + print *, 'DEBUG BIOMEE RESTART START' + print *, 'DEBUG BIOMEE RESTART output_restart_soil=' + print *, output_restart_soil + + do lu_idx = 1, size(output_restart_cohorts, 3) + print *, 'DEBUG BIOMEE RESTART lu=', lu_idx, ' output_restart_cohorts=' + print *, output_restart_cohorts(:, :, lu_idx) + end do + + print *, 'DEBUG BIOMEE RESTART END' + + end subroutine debug_print_restart_state + end module biomee_mod diff --git a/src/soiltemp_sitch.mod.f90 b/src/soiltemp_sitch.mod.f90 index 500cff43..1c422be1 100644 --- a/src/soiltemp_sitch.mod.f90 +++ b/src/soiltemp_sitch.mod.f90 @@ -7,11 +7,11 @@ module md_soiltemp implicit none private - public soiltemp, air_to_soil_temp + public soiltemp_pmodel, air_to_soil_temp_biomee contains - subroutine soiltemp( soil, dtemp, doy, init, finalize) + subroutine soiltemp_pmodel( soil, dtemp, doy, init, finalize) !///////////////////////////////////////////////////////////////////////// ! Calculates soil temperature (deg C) based on air temperature (deg C). !------------------------------------------------------------------------- @@ -29,7 +29,7 @@ subroutine soiltemp( soil, dtemp, doy, init, finalize) ! local variables real, dimension(:), allocatable, save :: dtemp_pvy ! daily temperature of previous year (deg C) real, dimension(:,:), allocatable, save :: wscal_pvy ! daily Cramer-Prentice-Alpha of previous year (unitless) - real, dimension(:,:), allocatable, save :: wscal_alldays + real, dimension(:,:), allocatable, save :: wscal_alldays! daily Cramer-Prentice-Alpha of current year (unitless) integer :: lu, window_length @@ -120,12 +120,12 @@ subroutine soiltemp( soil, dtemp, doy, init, finalize) if (allocated(wscal_alldays)) deallocate( wscal_alldays ) end if - end subroutine soiltemp + end subroutine soiltemp_pmodel - real function air_to_soil_temp( thetaS, dtemp, doy, dtemp_pvy, wscal_pvy, wscal_alldays) + real function air_to_soil_temp_biomee( thetaS, dtemp, doy, dtemp_pvy, wscal_pvy, wscal_alldays) !///////////////////////////////////////////////////////////////////////// ! Calculates soil temperature (deg C) based on air temperature (deg C). - ! Same as soiltemp but simlified to not use global variables + ! Same as soiltemp_pmodel but simlified to not use global variables !------------------------------------------------------------------------- use md_params_core, only: ndayyear, pi use md_sofunutils, only: running @@ -183,7 +183,7 @@ real function air_to_soil_temp( thetaS, dtemp, doy, dtemp_pvy, wscal_pvy, wscal_ ! In case of zero soil water, soil temp = air temp if (abs(meanw1 - 0.0) < eps) then - air_to_soil_temp = dtemp(doy) + air_to_soil_temp_biomee = dtemp(doy) else ! Interpolate thermal diffusivity function against soil water content @@ -212,7 +212,7 @@ real function air_to_soil_temp( thetaS, dtemp, doy, dtemp_pvy, wscal_pvy, wscal_ lagtemp = ( tempthismonth - templastmonth ) * ( 1.0 - lag ) + templastmonth ! Adjust amplitude of lagged air temp to give estimated soil temp - air_to_soil_temp = avetemp + amp * ( lagtemp - avetemp ) + air_to_soil_temp_biomee = avetemp + amp * ( lagtemp - avetemp ) end if @@ -225,6 +225,6 @@ real function air_to_soil_temp( thetaS, dtemp, doy, dtemp_pvy, wscal_pvy, wscal_ wscal_pvy(:) = wscal_alldays(:) end if - end function air_to_soil_temp + end function air_to_soil_temp_biomee end module md_soiltemp diff --git a/src/vegetation_processes_biomee.mod.f90 b/src/vegetation_processes_biomee.mod.f90 index 36998b47..cf92fed8 100755 --- a/src/vegetation_processes_biomee.mod.f90 +++ b/src/vegetation_processes_biomee.mod.f90 @@ -338,8 +338,9 @@ subroutine vegn_growth_EW( vegn ) ! update bl_max and br_max daily BL_c = sp%LMA * sp%LAImax * cc%crownarea() * & (1.0-sp%internal_gap_frac) / cc%layer - BL_u = sp%LMA*cc%crownarea()*(1.0-sp%internal_gap_frac) * & - sp%underLAImax + BL_u = sp%LMA * sp%underLAImax * cc%crownarea() * & + (1.0-sp%internal_gap_frac) + if (cc%layer == 1) cc%topyear = cc%topyear + 1.0 / 365.0 diff --git a/src/vegetation_tile_biomee.mod.f90 b/src/vegetation_tile_biomee.mod.f90 index 4309de77..33336c5d 100644 --- a/src/vegetation_tile_biomee.mod.f90 +++ b/src/vegetation_tile_biomee.mod.f90 @@ -11,6 +11,7 @@ module md_vegetation_tile_biomee use md_cohort use md_cohort_linked_list use, intrinsic :: iso_c_binding, only: c_double + use, intrinsic :: ieee_arithmetic, only: ieee_is_nan ! define data types and constants implicit none @@ -199,6 +200,7 @@ module md_vegetation_tile_biomee procedure initialize_vegn_tile procedure :: aggregate_pools_across_cohorts procedure :: lu_props + procedure :: export_restart_state !========= Private helper methods @@ -599,14 +601,14 @@ subroutine zero_diagnostics(self) self%n_deadtrees = 0.0 self%c_deadtrees = 0.0 self%m_turnover = 0.0 - self%totseed = orgpool() - self%totNewC = orgpool() + self%totseed = orgpool() ! initializes with zero + self%totNewC = orgpool() ! initializes with zero ! We reset the cohorts internal state it => self%cohorts() do while (associated(it)) - call it%cohort%reset_cohort() + call it%cohort%reset_cohort_fluxes() it => it%next() end do @@ -619,7 +621,7 @@ subroutine zero_daily_diagnostics(self) ! Reset dauly diagnostic variables class(vegn_tile_type), intent(inout) :: self - self%daily_fluxes = common_fluxes() + self%daily_fluxes = common_fluxes() ! initializes with zero self%dailyRh = 0.0 self%dailyPrcp = 0.0 self%dailyEvap = 0.0 @@ -694,6 +696,7 @@ subroutine daily_diagnostics(self, iyears, idoy, daily_reporting) self%out_daily_tile(idoy, DAILY_TILE_YEAR ) = iyears self%out_daily_tile(idoy, DAILY_TILE_DOY ) = idoy self%out_daily_tile(idoy, DAILY_TILE_TK ) = self%tk_daily + self%out_daily_tile(idoy, DAILY_TILE_TKSOIL ) = self%tc_soil + kTkelvin self%out_daily_tile(idoy, DAILY_TILE_PRCP ) = self%dailyPrcp self%out_daily_tile(idoy, DAILY_TILE_SOIL_W ) = self%soilwater() self%out_daily_tile(idoy, DAILY_TILE_TRSP ) = self%daily_fluxes%trsp @@ -778,7 +781,7 @@ subroutine annual_diagnostics(self, iyears, cohort_reporting) froot = cc%NPProot / treeG fwood = cc%NPPwood / treeG dDBH = cc%dbh() - cc%DBH_ys !in m - dBA = cc%basal_area() - cc%BA_ys + dBA = cc%basal_area() - cc%BA_ys ! _ys: year start if (i <= NCohortMax) then @@ -822,6 +825,13 @@ subroutine annual_diagnostics(self, iyears, cohort_reporting) self%out_annual_cohorts(i, ANNUAL_COHORTS_ROOT_N ) = cc%proot%n14 self%out_annual_cohorts(i, ANNUAL_COHORTS_SW_N ) = cc%psapw%n14 self%out_annual_cohorts(i, ANNUAL_COHORTS_HW_N ) = cc%pwood%n14 + + ! print *, 'NSC,NSN', self%out_annual_cohorts(i, ANNUAL_COHORTS_NSC), self%out_annual_cohorts(i, ANNUAL_COHORTS_NSN), cc%plabl%c12, cc%plabl%n14 + ! print *, 'Seed', self%out_annual_cohorts(i, ANNUAL_COHORTS_SEED_C ), cc%pseed%c12, cc%pseed%n14 + ! print *, 'Leaf', self%out_annual_cohorts(i, ANNUAL_COHORTS_LEAF_C ), cc%pleaf%c12, cc%pleaf%n14 + ! print *, 'Root', self%out_annual_cohorts(i, ANNUAL_COHORTS_ROOT_C ), cc%proot%c12, cc%proot%n14 + ! print *, 'sapw', self%out_annual_cohorts(i, ANNUAL_COHORTS_SW_C ), cc%psapw%c12, cc%psapw%n14 + ! print *, 'heaw', self%out_annual_cohorts(i, ANNUAL_COHORTS_HW_C ), cc%pwood%c12, cc%pwood%n14 end if @@ -903,6 +913,11 @@ subroutine annual_diagnostics(self, iyears, cohort_reporting) self%out_annual_tile(ANNUAL_TILE_M_TURNOVER ) = 0 self%out_annual_tile(ANNUAL_TILE_C_TURNOVER_TIME ) = self%pwood%c12 / self%NPPW + !print *, 'MCRB_C', self%out_annual_tile(ANNUAL_TILE_MCRB_C ), self%pmicr%c12, self%pmicr%n14 + !print *, 'FASTSOM', self%out_annual_tile(ANNUAL_TILE_FASTSOM ), self%psoil_fs%c12, self%psoil_fs%n14 + !print *, 'SLOWSOM', self%out_annual_tile(ANNUAL_TILE_SLOWSOM ), self%psoil_sl%c12, self%psoil_sl%n14 + !print *, 'INORG_N', self%out_annual_tile(ANNUAL_TILE_INORG_N ), self%inorg%n14 + ! Rebalance N (to compensate for the adjunction in vegn_N_uptake) if (inputs%params_siml%do_closedN_run) call self%recover_N_balance() @@ -1026,12 +1041,14 @@ subroutine initialize_vegn_tile( self, lu_index ) ! Local variables integer :: i, init_n_cohorts + logical :: has_restart_state type(cohort_type), pointer :: cc type(cohort_stack_item), pointer :: new type(params_species_biomee) :: sp ! Initialize lu_index self%lu_index = lu_index + has_restart_state = .false. ! If it is an LU acception vegetation (typically anything else than urban), we add the cohorts matching the lu_index if (inputs%init_lu(lu_index)%vegetated) then @@ -1051,10 +1068,7 @@ subroutine initialize_vegn_tile( self, lu_index ) cc%density = inputs%init_cohort(i)%init_cohort_density ! trees/m2 cc%age = inputs%init_cohort(i)%init_cohort_age ! years - sp = cc%sp() ! careful this uses cc%species, ensure it is done after setting cc%species - - ! set bl_max, br_max parameters ( to initialize non-structural N: plabl%n14) - call cc%init_bl_max_br_max() + sp = cc%sp() ! careful this uses cc%species, ensure cc%sp() is called only after setting cc%species ! C pools cc%plabl%c12 = inputs%init_cohort(i)%init_cohort_nsc @@ -1071,10 +1085,52 @@ subroutine initialize_vegn_tile( self, lu_index ) cc%pleaf%n14 = inputs%init_cohort(i)%init_cohort_bl_n14 cc%proot%n14 = inputs%init_cohort(i)%init_cohort_br_n14 cc%pseed%n14 = inputs%init_cohort(i)%init_cohort_seedC_n14 + + ! Other memory variables (needed for restarting a simulation) + if (inputs%init_cohort(i)%restart_status >= 0) then + cc%status = inputs%init_cohort(i)%restart_status + has_restart_state = .true. + end if + + if (inputs%init_cohort(i)%restart_layer > 0) then + cc%layer = inputs%init_cohort(i)%restart_layer + has_restart_state = .true. + end if + + if (inputs%init_cohort(i)%restart_firstlayer >= 0) then + cc%firstlayer = inputs%init_cohort(i)%restart_firstlayer + has_restart_state = .true. + end if + + if (.not. ieee_is_nan(inputs%init_cohort(i)%restart_gdd)) then + cc%gdd = inputs%init_cohort(i)%restart_gdd + has_restart_state = .true. + end if + + if (.not. ieee_is_nan(inputs%init_cohort(i)%restart_leaf_age)) then + cc%leaf_age = inputs%init_cohort(i)%restart_leaf_age + has_restart_state = .true. + end if + + if (.not. ieee_is_nan(inputs%init_cohort(i)%restart_topyear)) then + cc%topyear = inputs%init_cohort(i)%restart_topyear + has_restart_state = .true. + end if + + if (.not. ieee_is_nan(inputs%init_cohort(i)%restart_bl_max) .and. & + .not. ieee_is_nan(inputs%init_cohort(i)%restart_br_max)) then + cc%bl_max = inputs%init_cohort(i)%restart_bl_max + cc%br_max = inputs%init_cohort(i)%restart_br_max + has_restart_state = .true. + else + ! Cold starts still derive these targets from the initialized structure. + call cc%init_bl_max_br_max() + end if + enddo ! Split initial layer in smaller layers (if it is full) - call self%relayer() + if (.not. has_restart_state) call self%relayer() ! restart states do not need relayer(), they already carry layer assignments end if @@ -1096,11 +1152,79 @@ subroutine initialize_vegn_tile( self, lu_index ) ! Initialize initialN0, that is used for nitrogen workaround: keep the N in the system constant at this value self%initialN0 = inputs%init_soil%init_N0_ecosystem + if (.not. ieee_is_nan(inputs%init_soil%restart_tk_pheno)) self%tk_pheno = inputs%init_soil%restart_tk_pheno + !if (.not. ieee_is_nan(inputs%init_soil%restart_vegn_gdd)) self%gdd = inputs%init_soil%restart_vegn_gdd + !call self%aggregate_pools_across_cohorts() !self%initialN0 = self%totN end subroutine initialize_vegn_tile + subroutine export_restart_state(self, output_init_cohort, output_init_soil) + !//////////////////////////////////////////////////////////////////////// + ! Export the current tile state in a format compatible with init_cohort + ! and init_soil, including restart-only cohort and tile fields. + !------------------------------------------------------------------------ + class(vegn_tile_type), intent(in) :: self + real(kind=c_double), dimension(:, :), intent(out) :: output_init_cohort + real(kind=c_double), dimension(:), intent(out) :: output_init_soil + + type(cohort_type), pointer :: cc + type(cohort_stack_item), pointer :: it + integer :: i + + i = 0 + it => self%cohorts() + do while (associated(it) .and. i < size(output_init_cohort, 1)) + cc => it%cohort + i = i + 1 + + output_init_cohort(i, 1) = cc%species + output_init_cohort(i, 2) = cc%density + output_init_cohort(i, 3) = cc%age + output_init_cohort(i, 4) = cc%pleaf%c12 + output_init_cohort(i, 5) = cc%proot%c12 + output_init_cohort(i, 6) = cc%psapw%c12 + output_init_cohort(i, 7) = cc%pwood%c12 + output_init_cohort(i, 8) = cc%pseed%c12 + output_init_cohort(i, 9) = cc%plabl%c12 + output_init_cohort(i, 10) = cc%pleaf%n14 + output_init_cohort(i, 11) = cc%proot%n14 + output_init_cohort(i, 12) = cc%psapw%n14 + output_init_cohort(i, 13) = cc%pwood%n14 + output_init_cohort(i, 14) = cc%pseed%n14 + output_init_cohort(i, 15) = cc%plabl%n14 + output_init_cohort(i, 16) = self%lu_index + output_init_cohort(i, 17) = cc%status + output_init_cohort(i, 18) = cc%layer + output_init_cohort(i, 19) = cc%firstlayer + output_init_cohort(i, 20) = cc%gdd + output_init_cohort(i, 21) = cc%leaf_age + output_init_cohort(i, 22) = cc%topyear + output_init_cohort(i, 23) = cc%bl_max + output_init_cohort(i, 24) = cc%br_max + + it => it%next() + end do + + output_init_soil(1) = self%psoil_fs%c12 + output_init_soil(2) = self%psoil_sl%c12 + output_init_soil(3) = self%inorg%n14 + output_init_soil(4) = inputs%init_soil%N_input + output_init_soil(5) = self%psoil_fs%n14 + output_init_soil(6) = self%psoil_sl%n14 + output_init_soil(7) = self%pmicr%c12 + output_init_soil(8) = self%pmicr%d13 + output_init_soil(9) = self%pmicr%n14 + output_init_soil(10) = self%wcl(1) + output_init_soil(11) = self%wcl(2) + output_init_soil(12) = self%wcl(3) + output_init_soil(13) = self%initialN0 + output_init_soil(14) = self%tk_pheno + !output_init_soil(15) = self%gdd ! previously we had a vegn%gdd, but use only cc%gdd + + end subroutine export_restart_state + !---------------------------------------------------------------- ! Private helper methods !---------------------------------------------------------------- diff --git a/src/wrappersc.c b/src/wrappersc.c index 61f2442a..a5442857 100644 --- a/src/wrappersc.c +++ b/src/wrappersc.c @@ -174,7 +174,9 @@ void F77_NAME(biomee_f)( double *output_daily_tile, double *output_annual_tile, double *output_annual_cohorts, - double *output_annual_aggregated + double *output_annual_aggregated, + double *output_restart_cohorts, + double *output_restart_soil ); // C wrapper function for biomee @@ -216,10 +218,10 @@ extern SEXP biomee_f_C( // Output list - SEXP out_list = PROTECT( allocVector(VECSXP, 4) ); + SEXP out_list = PROTECT( allocVector(VECSXP, 6) ); /******* Output sub-lists *******/ - SEXP output_daily_tile = PROTECT( alloc3DArray(REALSXP, nt_daily, 36, n_lu) ); + SEXP output_daily_tile = PROTECT( alloc3DArray(REALSXP, nt_daily, 37, n_lu) ); SEXP output_annual_tile = PROTECT( alloc3DArray(REALSXP, nt_annual, 61, n_lu) ); // Dimensions @@ -231,6 +233,8 @@ extern SEXP biomee_f_C( SEXP output_annual_cohort_tile = PROTECT( allocArray(REALSXP, dims) ); SEXP output_annual_aggregated = PROTECT( allocMatrix(REALSXP, nt_annual, 71) ); + SEXP output_restart_cohorts = PROTECT( alloc3DArray(REALSXP, 50, 24, n_lu) ); + SEXP output_restart_soil = PROTECT( allocMatrix(REALSXP, 14, n_lu) ); /****************/ // Fortran subroutine call @@ -255,15 +259,19 @@ extern SEXP biomee_f_C( REAL(output_daily_tile), REAL(output_annual_tile), REAL(output_annual_cohort_tile), - REAL(output_annual_aggregated) + REAL(output_annual_aggregated), + REAL(output_restart_cohorts), + REAL(output_restart_soil) ); SET_VECTOR_ELT(out_list, 0, output_daily_tile); SET_VECTOR_ELT(out_list, 1, output_annual_tile); SET_VECTOR_ELT(out_list, 2, output_annual_cohort_tile); SET_VECTOR_ELT(out_list, 3, output_annual_aggregated); + SET_VECTOR_ELT(out_list, 4, output_restart_cohorts); + SET_VECTOR_ELT(out_list, 5, output_restart_soil); - UNPROTECT(6); + UNPROTECT(8); return out_list; } diff --git a/tests/testthat/_snaps/model-runs-snapshot-biomee.md b/tests/testthat/_snaps/model-runs-snapshot-biomee.md index 04d94870..0e15759a 100644 --- a/tests/testthat/_snaps/model-runs-snapshot-biomee.md +++ b/tests/testthat/_snaps/model-runs-snapshot-biomee.md @@ -2,24 +2,24 @@ # `mod_BiomeE_Pmodel_odt_yr1`: tibble::tribble( - ~year, ~doy, ~Tk, ~Prcp, ~SoilWater, ~Transp, ~Evap, ~Runoff, ~ws1, ~ws2, ~ws3, ~LAI, ~NPP, ~GPP, ~Rauto, ~Rh, ~NSC, ~seedC, ~leafC, ~rootC, ~sapwoodC, ~heartwoodC, ~NSN, ~seedN, ~leafN, ~rootN, ~sapwoodN, ~heartwoodN, ~mcrbC, ~fastSOM, ~slowSOM, ~mcrbN, ~fastSoilN, ~slowSoilN, ~mineralN, ~N_uptk, - 1, 1, 273.5336608886719, 1.436545491218567, 799.9446411132812, 0, 0.0554012693464756, 1.436545491218567, 19.944599151611328, 179.99998474121094, 600, 0, -2.97977797991677562e-09, 0, 2.97977797991677562e-09, 2.773448841253412e-06, 0.005826912354677916, 0, 0, 0, 0.002500000176951289, 0, 0.00029308954253792763, 0, 0, 0, 7.142857157305116e-06, 0, 3.692179575409682e-07, 0.00999686587601900101, 0.000999990850687027, 3.692179717518229e-08, 0.0006664577522315085, 2.4999771994771436e-05, 0.014924914576113224, 0, - 1, 2, 271.50848388671875, 2.0038182735443115, 799.9472045898438, 0, 0.05280914157629013, 1.94841718673706055, 19.94719123840332, 179.99998474121094, 600, 0.00017509811732452363, -2.796728767862077802e-05, 0, 2.796728767862077802e-05, 2.752370164671447e-06, 0.005743016488850117, 0, 2.976667929033283e-05, 1.7772452338249423e-05, 3.0054898161324672e-05, 0.002478334354236722, 0.0002921090926975012, 0, 5.121619892634044e-07, 4.443113255092612e-07, 8.587085176259279e-08, 7.080955583660398e-06, 7.353892215178348e-07, 0.00999375618994236, 0.0009999817702919245, 7.353892073069801e-08, 0.0006662504165433347, 2.4999544621095993e-05, 0.01485054288059473, 0, - 1, 180, 290.3451843261719, 2.415818214416504, 799.1299438476562, 0, 0.8700509667396545, 1.0773378610610962, 19.12995147705078, 179.99998474121094, 600, 0.004660780541598797, 1.424936453986447304e-05, 1.908696867758408189e-05, 4.83760459246696e-06, 1.0379684681538492e-05, 0.004003825597465038, 0, 0.0007923326338641346, 0.00047306911437772214, 0.0007721544825471938, 0.002478334354236722, 0.00025850688689388335, 0, 1.3632797163154464e-05, 1.1826728950836696e-05, 2.206155613748706e-06, 7.080955583660398e-06, 9.97683746390976e-05, 0.009317527525126934, 0.0010561823146417737, 9.9768376458087e-06, 0.0006211685249581933, 2.5818837457336485e-05, 0.0058710030280053616, 0, - 1, 364, 271.62640380859375, 2.0575454235076904, 799.9307861328125, 0, 0.06923088431358337, 1.9698282480239868, 19.9307708740234375, 179.99998474121094, 600, 0.006191854830831289, 1.6428944036306348e-06, 6.178122021083254e-06, 4.53522761745262e-06, 2.367866500208038e-06, 0.004261433146893978, 0, 0.0010526153491809964, 0.000628473237156868, 0.001149466261267662, 0.002837070496752858, 0.00023810572747606784, 0, 1.8111200915882364e-05, 1.57118101924425e-05, 3.284189460828202e-06, 8.105919732770417e-06, 0.00023415253963321447, 0.007998576387763023, 0.0011340860510244966, 2.3415253963321447e-05, 0.000531817611772567, 2.697298077691812e-05, 0.003205659333616495, 0, - 1, 365, 273.3876037597656, 1.826090812683105469, 799.9038696289062, 0, 0.0961432233452797, 1.7568600177764893, 19.903858184814453, 179.99998474121094, 600, 0.006200521253049374, 1.6177618817891926e-06, 6.168299478304107e-06, 4.550537596514914e-06, 2.3623879314982332e-06, 0.004254146479070187, 0, 0.00105408858507871628, 0.0006293528131209314, 0.0011514449724927545, 0.002838983666151762, 0.00023798539768904448, 0, 1.813655035221018e-05, 1.573379813635256e-05, 3.2898424251470715e-06, 8.111385795928072e-06, 0.00023431360023096204, 0.007998200133442879, 0.0011345992097631097, 2.34313592955004424e-05, 0.0005317443865351379, 2.6980338589055464e-05, 0.0032112158369272947, 0, + ~year, ~doy, ~Tk, ~Tksoil, ~Prcp, ~SoilWater, ~Transp, ~Evap, ~Runoff, ~ws1, ~ws2, ~ws3, ~LAI, ~NPP, ~GPP, ~Rauto, ~Rh, ~NSC, ~seedC, ~leafC, ~rootC, ~sapwoodC, ~heartwoodC, ~NSN, ~seedN, ~leafN, ~rootN, ~sapwoodN, ~heartwoodN, ~mcrbC, ~fastSOM, ~slowSOM, ~mcrbN, ~fastSoilN, ~slowSoilN, ~mineralN, ~N_uptk, + 1, 1, 273.5336608886719, 274.1312255859375, 1.436545491218567, 799.9446411132812, 0, 0.0554012693464756, 1.436545491218567, 19.944599151611328, 179.99998474121094, 600, 0, -2.97977797991677562e-09, 0, 2.97977797991677562e-09, 2.773448841253412e-06, 0.005826912354677916, 0, 0, 0, 0.002500000176951289, 0, 0.00029308954253792763, 0, 0, 0, 7.142857157305116e-06, 0, 3.692179575409682e-07, 0.00999686587601900101, 0.000999990850687027, 3.692179717518229e-08, 0.0006664577522315085, 2.4999771994771436e-05, 0.014924914576113224, 0, + 1, 2, 271.50848388671875, 274.0488586425781, 2.0038182735443115, 799.9472045898438, 0, 0.052807990461587906, 1.94841718673706055, 19.94719123840332, 179.99998474121094, 600, 0.0003648526908364147, -5.8273035392630845e-05, 0, 5.8273035392630845e-05, 2.752370164671447e-06, 0.005652101244777441, 0, 6.202496297191828e-05, 3.703254697029479e-05, 0.0016369707882404327, 0.0008805100223980844, 0.0002910465991590172, 0, 1.067194148163253e-06, 9.25813708363421e-07, 4.67705922346795e-06, 2.515743062758702e-06, 7.353892215178348e-07, 0.00999375618994236, 0.0009999817702919245, 7.353892073069801e-08, 0.0006662504165433347, 2.4999544621095993e-05, 0.01485054288059473, 0, + 1, 180, 290.3451843261719, 286.4756774902344, 2.415818214416504, 799.1299438476562, 0, 0.870050847530365, 1.0773391723632812, 19.12995147705078, 179.99998474121094, 600, 0.004662044811993837, 1.4255607311497442e-05, 0x1.40502p-16, 4.836535026697675e-06, 1.0380407729826402e-05, 0.004000645596534014, 0, 0.000792547594755888, 0.00047319746227003634, 0.0008088446338661015, 0.002442991128191352, 0.0002584756293799728, 0, 1.3636492440127768e-05, 1.18299203677452169e-05, 2.31098488256975543e-06, 6.9799784796487074e-06, 9.977493027690798e-05, 0.0093181729316711426, 0.0010563548421487212, 9.9774933914886788e-06, 0.0006212115404196084, 2.5821305825957097e-05, 0.005870996043086052, 0, + 1, 364, 271.62640380859375, 274.1844482421875, 2.0575454235076904, 799.9307861328125, 0, 0.06923087686300278, 1.9698282480239868, 19.9307708740234375, 179.99998474121094, 600, 0.0061927973292768, 1.6445910659967922e-06, 6.179061983857537e-06, 4.5344709178607445e-06, 2.36803953157505e-06, 0.004259446170181036, 0, 0.00105277553666383028, 0.0006285688723437488, 0.0011497334344312549, 0.0028377308044582605, 0.00023807525576557964, 0, 1.8113965779775754e-05, 1.571420580148697e-05, 3.2849527542566648e-06, 8.107809662760701e-06, 0.0002341683721169829369, 0.007999159395694733, 0.0011342739453539252, 2.3416836484102532e-05, 0.0005318562616594136, 2.6975696528097615e-05, 0.0032056604977697134, 0, + 1, 365, 273.3876037597656, 274.1578063964844, 1.826090812683105469, 799.9038696289062, 0, 0.0961432233452797, 1.7568600177764893, 19.903858184814453, 179.99998474121094, 600, 0.006201462354511023, 1.619542672415264e-06, 6.16923489360488e-06, 4.549692221189616e-06, 2.362560280744219e-06, 0.004252162761986256, 0, 0.0010542486561462283, 0.0006294483901001513, 0.00115171307697892189, 0.0028396411798894405, 0.00023795492597855628, 0, 1.81393097591353580356e-05, 1.5736191926407628e-05, 3.290608674433315e-06, 8.113266630971339e-06, 0.00023432944726664573, 0.007998783141374588, 0.0011347872205078602, 2.3432945454260334e-05, 0.0005317830364219844, 2.698305615922436e-05, 0.003211217001080513, 0, ) --- # `mod_BiomeE_Pmodel_odt_yr251`: tibble::tribble( - ~year, ~doy, ~Tk, ~Prcp, ~SoilWater, ~Transp, ~Evap, ~Runoff, ~ws1, ~ws2, ~ws3, ~LAI, ~NPP, ~GPP, ~Rauto, ~Rh, ~NSC, ~seedC, ~leafC, ~rootC, ~sapwoodC, ~heartwoodC, ~NSN, ~seedN, ~leafN, ~rootN, ~sapwoodN, ~heartwoodN, ~mcrbC, ~fastSOM, ~slowSOM, ~mcrbN, ~fastSoilN, ~slowSoilN, ~mineralN, ~N_uptk, - 251, 1, 273.5336608886719, 1.436545491218567, 799.9583740234375, 0, 0.04164949059486389, 1.3647308349609375, 19.958351135253906, 179.99998474121094, 600, 3.5711464881896973, 0.002246167976409197, 0.0022930759005248547, 4.690802961704321e-05, 0.001467015827074647, 2.1851139068603516, 0.00102845055516809225, 0.6070948839187622, 0.36907511949539185, 4.419338226318359, 3.35748028755188, 0.06249659135937691, 5.142251757206395e-05, 0.01044566929340362548828, 0.009226866997778416, 0.0126266796141862869, 0.009592792019248009, 0.16364069283008575, 2.1829378604888916, 73.7013168334961, 0.016364069655537605, 0.11383578926324844, 0.6851038336753845, 0.0020995328668504953, 5.2250525186536834e-05, - 251, 2, 271.50848388671875, 2.0038182735443115, 799.9576416015625, 0, 0.04234856739640236, 1.9621679782867432, 19.957653045654297, 179.99998474121094, 600, 3.577575922012329, -0.00011209235526621342, 0.0022606588900089264, 0.00237275124527514, 0.0014580391580238938, 2.180330514907837, 0.00121350307017564774, 0.6081878542900085, 0.3689758777618408, 4.404471397399902, 3.374283790588379, 0.06242924928665161, 6.067514550522901e-05, 0.0104644745588302612, 0.00922438595443964, 0.01258420292288065, 0.009640802629292011, 0.1636427342891693, 2.1835122108459473, 73.70084381103516, 0.01636427268385887, 0.113847553730010986, 0.6851065158843994, 0.002134067239239812, 0, - 251, 180, 290.3451843261719, 2.415818214416504, 799.4786987304688, 0, 0.5212868452072144, 1.6898143291473389, 19.478713989257812, 179.99998474121094, 600, 3.6855220794677734, 0.006996382959187031, 0.00940756592899561, 0.002411183202639222, 0.005773116368800402, 2.1710057258605957, 0.03244977444410324, 0.6265387535095215, 0.373284131288528, 4.545224189758301, 3.5366082191467285, 0.06344294548034668, 0.0016224890714511275, 0.010780218057334423065, 0.009332086890935898, 0.0129863535985350609, 0.010104586370289326, 0.16461129486560822, 2.1958518028259277, 73.51875305175781, 0.01646113023161888, 0.11346811801195145, 0.6854029297828674, 0.0016644787974655628, 0, - 251, 364, 271.62640380859375, 2.0575454235076904, 799.949951171875, 0, 0.05007721483707428, 1.9918313026428222656, 19.94992446899414, 179.99998474121094, 600, 3.810532569885254, 0.0004853953141719103, 0.0024726183619350195, 0.001987223047763109, 0.00142469769343733788, 2.262698173522949, 0.07006724178791046, 0.6477905511856079, 0.3867690563201904297, 4.750125408172607, 3.686607599258423, 0.06478233635425568, 0.0035033617168664932, 0.011145866475999355, 0.00966921728104353, 0.0135717857629060745, 0.010533157736063004, 0.16338472068309784, 2.0303914546966553, 73.09454345703125, 0.016338471323251724, 0.10725955665111542, 0.6852454543113708, 0.002280128188431263, 0, - 251, 365, 273.3876037597656, 1.826090812683105469, 799.92822265625, 0, 0.07181990146636963, 1.776013970375061, 19.928178787231445, 179.99998474121094, 600, 3.8112215995788574, 0.000471955630928277969, 0.0024662481155246496, 0.0019942924845963717, 0.0014233457623049617, 2.259279727935791, 0.07026728987693787, 0.6479076147079468, 0.3868389427661896, 4.751210689544678, 3.687388181686401, 0.06489767879247665, 0.0035133648198097944, 0.011147881858050823, 0.009670963510870934, 0.0135748879984021187, 0.010535388253629208, 0.16338132321834564, 2.0310678482055664, 73.09408569335938, 0.016338132321834564, 0.107273481786251068, 0.6852483749389648, 0.0021408540196716785, 0.00017251026292797178, + ~year, ~doy, ~Tk, ~Tksoil, ~Prcp, ~SoilWater, ~Transp, ~Evap, ~Runoff, ~ws1, ~ws2, ~ws3, ~LAI, ~NPP, ~GPP, ~Rauto, ~Rh, ~NSC, ~seedC, ~leafC, ~rootC, ~sapwoodC, ~heartwoodC, ~NSN, ~seedN, ~leafN, ~rootN, ~sapwoodN, ~heartwoodN, ~mcrbC, ~fastSOM, ~slowSOM, ~mcrbN, ~fastSoilN, ~slowSoilN, ~mineralN, ~N_uptk, + 251, 1, 273.5336608886719, 274.1312255859375, 1.436545491218567, 799.9583740234375, 0, 0.04164948686957359, 1.3647308349609375, 19.95835304260254, 179.99998474121094, 600, 3.571153402328491, 0.0022461693733930588, 0.00229307753033936023712, 4.690809510066174e-05, 0.0014670148957520723, 2.1851158142089844, 0x1.0d9f28p-10, 0.6070960760116577, 0.36907586455345154, 4.4193291664123535, 3.3574888706207275, 0.06247977912425995, 5.142626469023526e-05, 0.0104456990957260132, 0.0092268837615847588, 0.012626654468476772, 0.009592811577022076, 0.16364045441150665, 2.182933568954467773, 73.70133972167969, 0.016364045441150665, 0.11382948607206345, 0.6851032376289368, 0.002138829790055752, 0.00017328847025055438, + 251, 2, 271.50848388671875, 274.0488586425781, 2.0038182735443115, 799.9576416015625, 0, 0.04234856739640236, 1.96216952800750732422, 19.957653045654297, 179.99998474121094, 600, 3.577581882476806641, -0.0001120197121053934097, 0.0022606600541621447, 0.002372679766267538, 0.0014580382267013192, 2.180332660675049, 0.0012135779252275825, 0.6081888675689697, 0.3689765930175781, 4.404462814331055, 3.3742918968200684, 0.06241244450211525, 6.067890353733674e-05, 0.010464503429830074, 0.009224400855600834, 0.01258417870849371, 0.009640821255743504, 0.1636424958705902, 2.183507919311523438, 73.70086669921875, 0.01636425033211708, 0.113841257989406586, 0.6851059198379517, 0.0021730929147452116, 0, + 251, 180, 290.3451843261719, 286.4756774902344, 2.415818214416504, 799.4786987304688, 0, 0.5212867259979248, 1.6898143291473389, 19.478713989257812, 179.99998474121094, 600, 3.685528039932251, 0.006996393203735351562, 0.009407570585608482, 0.002411177381873131, 0.005773113574832678, 2.171008825302124, 0.03244990110397339, 0.6265397667884827, 0.37328478693962097, 4.545215129852295, 3.536618232727051, 0.06355509907007217, 0.0016224950086325407, 0.010780243203043938, 0.009332102723419666, 0x1.a98934p-7, 0.01010461151599884, 0.16461098194122314, 2.1958484649658203, 73.5187759399414, 0.016461098566651344, 0.11346269398927689, 0.6854023337364197, 0.001538897748105228, 0, + 251, 364, 271.62640380859375, 274.1844482421875, 2.0575454235076904, 799.949951171875, 0, 0.05007721483707428, 1.9918313026428222656, 19.94992446899414, 179.99998474121094, 600, 3.810537815093994, 0.0004854507278650999, 0.002472618827596307, 0.001987168099731207, 0.0014246972277760506, 2.2626984119415283, 0.070067398250103, 0.6477914452552795, 0.38676953315734863, 4.750117301940918, 3.686615467071533, 0.06480302661657333, 0.003503370564430952, 0.01114590559154749, 0.009669226594269276, 0.01357176527380943298, 0.010533180087804794, 0.1633845418691635, 2.0303890705108643, 73.09456634521484, 0.01633845455944538, 0.107255458831787109, 0.6852447986602783, 0.0022604770492762327, 0, + 251, 365, 273.3876037597656, 274.1578063964844, 1.826090812683105469, 799.92822265625, 0, 0.07181989401578903, 1.776013970375061, 19.928178787231445, 179.99998474121094, 600, 3.811227798461914, 0.0004718594718724489, 0.0024662483483552933, 0.0019943888764828444, 0.0014233452966436744, 2.25927996635437, 0.070267453789711, 0.647908627986908, 0.386839538812637329, 4.7512030601501465, 3.6873958110809326, 0.0649053230881691, 0.003513373201712966, 0.011147922836244106, 0.009670975618064404, 0.013574868440628052, 0.010535410605370998, 0.16338114440441132, 2.0310654640197754, 73.09410858154297, 0.016338113695383072, 0.10726938396692276, 0.6852477192878723, 0.002134375274181366, 0.00015947069914545864, ) --- @@ -67,24 +67,24 @@ # `mod_BiomeE_gsLeun_odt_yr1`: tibble::tribble( - ~year, ~doy, ~Tk, ~Prcp, ~SoilWater, ~Transp, ~Evap, ~Runoff, ~ws1, ~ws2, ~ws3, ~LAI, ~NPP, ~GPP, ~Rauto, ~Rh, ~NSC, ~seedC, ~leafC, ~rootC, ~sapwoodC, ~heartwoodC, ~NSN, ~seedN, ~leafN, ~rootN, ~sapwoodN, ~heartwoodN, ~mcrbC, ~fastSOM, ~slowSOM, ~mcrbN, ~fastSoilN, ~slowSoilN, ~mineralN, ~N_uptk, - 1, 1, 273.5336608886719, 1.43654537200927734, 799.9983520507812, 0, 0.05569557473063469, 1.382531762123108, 19.998319625854492, 179.99998474121094, 600, 0, -2.987802671938766e-09, 0, 2.987802671938766e-09, 2.7720184334611986e-06, 0.005826915148645639, 0, 0, 0, 0.002500000176951289, 0, 0.00029308954253792763, 0, 0, 0, 7.142857157305116e-06, 0, 3.689146126362175e-07, 0.009996870532631874, 0.0009999916655942798, 3.689146055307901e-08, 0.0006664580432698131, 2.4999792003654875e-05, 0.0133011955767869949, 0, - 1, 2, 271.50848388671875, 2.0038180351257324, 799.9982299804688, 1.2079907492079656e-06, 0.05217472091317177, 0x1.f3a55ap+0, 19.998218536376953, 179.99998474121094, 600, 0.00017509813187643886, -2.792086888803169e-05, 4.892129368272435e-08, 2.7969790608040057e-05, 2.7542077987163793e-06, 0.005743066314607859, 0, 2.976668292831164e-05, 1.777245597622823e-05, 3.0054898161324672e-05, 0.002478334354236722, 0.0002921090926975012, 0, 5.121621029502421e-07, 4.4431135393097065e-07, 8.587085176259279e-08, 7.080955583660398e-06, 7.352170428021054e-07, 0.009993758983910084, 0.0009999832836911082, 7.352170428021054e-08, 0.0006662505911663175, 2.4999582819873467e-05, 0.011797891929745674, 0, - 1, 180, 290.34521484375, 2.415818214416504, 799.9872436523438, 0.004336793906986713, 0.93294012546539307, 0.6211963891983032, 19.98725700378418, 179.99998474121094, 600, 0.0046233441680669785, 8.06308162282221e-06, 1.37145862026955e-05, 5.651504125125939e-06, 1.0383035260019824e-05, 0.0033712696749716997, 0, 0.0007859685574658215, 0.0004692694346886128, 0.0007316789706237614, 0.002478334354236722, 0.0002588448114693165, 0, 1.3523294001061004e-05, 0x1.89a6bp-17, 2.0905115434288746e-06, 7.080955583660398e-06, 9.9721328297164291e-05, 0.00931682251393795, 0.00105604901909828186, 9.9721328297164291e-06, 0.0006211214931681752, 2.5816461857175454e-05, 0.000220529327634722, 0, - 1, 364, 271.6263732910156, 2.0575451850891113, 799.9979858398438, 5.981626600259915e-05, 0.07056940346956253, 1.9863909482955933, 19.997962951660156, 179.99998474121094, 600, 0.005956937558948994, -3.137013663945254e-06, 4.5645705881725007202e-07, 3.5934706374973757e-06, 2.3677509943809127e-06, 0.0026950554456561804, 0, 0.001012679422274232, 0.0006046291091479361, 0.0010831515537574887, 0.002672628965228796, 0.00024028615735005587, 0, 1.7424057659809478e-05, 1.5115697351575363e-05, 3.0947182949603302e-06, 7.636082955286838e-06, 0.0002339369093533605337, 0.007990280166268349, 0.00113208545371890068, 2.3393691662931815e-05, 0.0005314130685292184, 2.6944133423967287e-05, 0.0002255252911709249, 0, - 1, 365, 273.3876037597656, 1.826090931892395, 799.9976806640625, 0.00011265448119957, 0.10030783712863922, 1.7260770797729492, 0x1.3ff65ep+4, 179.99998474121094, 600, 0.0059640295803546906, -2.6005820927821333e-06, 1.094984781957464293e-06, 3.6955668747395976e-06, 2.3605275600857567e-06, 0.0026855089236050844, 0, 0.00101388513576239347, 0.000605348905082792, 0.0010846691438928246, 0.002673572627827525, 0.00024018087424337864, 0, 1.7444801414967515e-05, 1.5133693523239344e-05, 3.099054538324708e-06, 7.638778697582893e-06, 0.00023409779532812536, 0.007989832200109959, 0.001132578239776194, 2.3409778805216774e-05, 0.0005313383298926055, 2.695122930163052e-05, 0.00022555250325240195, 0, + ~year, ~doy, ~Tk, ~Tksoil, ~Prcp, ~SoilWater, ~Transp, ~Evap, ~Runoff, ~ws1, ~ws2, ~ws3, ~LAI, ~NPP, ~GPP, ~Rauto, ~Rh, ~NSC, ~seedC, ~leafC, ~rootC, ~sapwoodC, ~heartwoodC, ~NSN, ~seedN, ~leafN, ~rootN, ~sapwoodN, ~heartwoodN, ~mcrbC, ~fastSOM, ~slowSOM, ~mcrbN, ~fastSoilN, ~slowSoilN, ~mineralN, ~N_uptk, + 1, 1, 273.5336608886719, 274.1312255859375, 1.43654537200927734, 799.9983520507812, 0, 0.05569557473063469, 1.382531762123108, 19.998319625854492, 179.99998474121094, 600, 0, -2.987802671938766e-09, 0, 2.987802671938766e-09, 2.7720184334611986e-06, 0.005826915148645639, 0, 0, 0, 0.002500000176951289, 0, 0.00029308954253792763, 0, 0, 0, 7.142857157305116e-06, 0, 3.689146126362175e-07, 0.009996870532631874, 0.0009999916655942798, 3.689146055307901e-08, 0.0006664580432698131, 2.4999792003654875e-05, 0.0133011955767869949, 0, + 1, 2, 271.50848388671875, 274.0488586425781, 2.0038180351257324, 799.9982299804688, 1.4847264537820593e-06, 0.05217362195253372, 1.951744794845581, 19.998218536376953, 179.99998474121094, 600, 0.0003648529236670583487, -5.8215657190885395e-05, 6.261067397872466e-08, 5.827826680615544e-05, 2.7542077987163793e-06, 0.005652162712067366, 0, 6.202499935170636e-05, 3.703256879816763e-05, 0.0016369707882404327, 0.0008805100223980844, 0.0002910465991590172, 0, 1.0671948302842793e-06, 9.258142199541908e-07, 4.67705922346795e-06, 2.515743062758702e-06, 7.352170428021054e-07, 0.009993758983910084, 0.0009999832836911082, 7.352170428021054e-08, 0.0006662505911663175, 2.4999582819873467e-05, 0.011797891929745674, 0, + 1, 180, 290.34521484375, 286.4757080078125, 2.415818214416504, 799.9872436523438, 0.004337979014962912, 0.9329398274421692, 0.6211949586868286, 19.98725700378418, 179.99998474121094, 600, 0.004624608438462019, 8.067949238466099e-06, 1.3718336958845612e-05, 5.650388175126864e-06, 1.038375012285541743e-05, 0.0033678857143968344, 0, 0.0007861834019422531, 0.0004693977243732661, 0.0007988597499206662, 0.0024124959018081427, 0.00025881340843625367, 0, 1.3526979273592588e-05, 1.1734934560081456e-05, 2.282456762259244e-06, 6.892842975503299e-06, 9.972787665901706e-05, 0x1.315084p-7, 0.0010562230600044131, 9.972787665901706e-06, 0.000621163984760642, 2.581891749287024e-05, 0.00022052921121940017, 0, + 1, 364, 271.6263732910156, 274.1844482421875, 2.0575451850891113, 799.9979858398438, 5.982535003568046e-05, 0.07056939601898193, 1.9863909482955933, 19.997962951660156, 179.99998474121094, 600, 0.00595784280449152, -3.135761062367237e-06, 4.565264646316791e-07, 3.5922876122640445828e-06, 2.367923571000574e-06, 0.002692683134227991, 0, 0.0010128332069143653, 0.0006047209026291966, 0.0010834032436832786, 0.00267324922606349, 0.0002402563550276681781, 0, 1.7426697013434023e-05, 1.5118011106096674e-05, 3.095437932643108e-06, 7.637851922481786e-06, 0.00023395307653117925, 0.007990861311554909, 0.0011322710197418928, 2.3395306925522164e-05, 0.0005314505542628467, 2.6946820071316324e-05, 0.00022552537848241627, 0, + 1, 365, 273.3876037597656, 274.1578063964844, 1.826090931892395, 799.9976806640625, 0.00011267152149230242, 0.10030782967805862, 1.7260770797729492, 0x1.3ff65ep+4, 179.99998474121094, 600, 0.00596493249759078, -2.5993213057518005e-06, 1.0951505373668624e-06, 3.694471843118663e-06, 2.3606999093317427e-06, 0.0026831398718059063, 0, 0.0010140385711565614, 0.0006054405239410698, 0.0010849208338186145, 0.0026741905603557825, 0.0002401510719209909439087, 0, 1.7447437130613253e-05, 1.5136001820792444e-05, 3.099774176007486e-06, 7.640541298314929e-06, 0.000234114020713605, 0.007990413345396519, 0.001132763922214508, 2.3411401343764737e-05, 0.0005313758156262338, 2.695391776796896e-05, 0.00022555259056389332, 0, ) --- # `mod_BiomeE_gsLeun_odt_yr251`: tibble::tribble( - ~year, ~doy, ~Tk, ~Prcp, ~SoilWater, ~Transp, ~Evap, ~Runoff, ~ws1, ~ws2, ~ws3, ~LAI, ~NPP, ~GPP, ~Rauto, ~Rh, ~NSC, ~seedC, ~leafC, ~rootC, ~sapwoodC, ~heartwoodC, ~NSN, ~seedN, ~leafN, ~rootN, ~sapwoodN, ~heartwoodN, ~mcrbC, ~fastSOM, ~slowSOM, ~mcrbN, ~fastSoilN, ~slowSoilN, ~mineralN, ~N_uptk, - 251, 1, 273.5336608886719, 1.43654537200927734, 799.9971313476562, 0.028174523264169693, 0.043697044253349304, 1.3635268211364746, 19.998138427734375, 179.9991912841797, 599.999755859375, 2.667818784713745, 0.0003397279651835561, 0.0004432628629729151725769, 0.00010353488323744386, 0.0007246868335641921, 0.19111987948417664, 0.0120559735223650932, 0.4535292387008667, 0.27157941460609436, 4.144713878631592, 2.8570165634155273, 0.003623802913352847, 0.0006027987692505121, 0.007803379092365503, 0.006789487320929766, 0.011842037551105022, 0.008162804879248142, 0.0915088877081871, 1.22912085056304932, 32.38499069213867, 0.00915088877081871, 0.060809049755334854, 0.3255288302898407, 0.0001973370963241905, 1.3517693332687486e-05, - 251, 2, 271.50848388671875, 2.0038180351257324, 799.9969482421875, 0x1.5fe8c8p-6, 0.04344530403614044, 1.9392485618591309, 19.998023986816406, 179.99917602539062, 599.999755859375, 2.670933723449707, -0.001087999320589006, 0.00018716175691224635, 0.0012751610483974218, 0.0007223300635814667, 0.18758651614189148, 0.012085862457752228, 0.4540587067604065, 0.27174603939056396, 4.144245147705078, 2.858055830001831, 0.00359409907832741737366, 0.0006042931927368045, 0.0078124902211129665, 0.006793652661144733, 0.0118406992405653, 0.008165774866938591, 0.09150894731283188, 1.2296632528305054, 32.38484573364258, 0.009150894358754158, 0.06082283332943916, 0.32553133368492126, 0.00019777777197305113, 1.3421255061984994e-05, - 251, 180, 290.34521484375, 2.415818214416504, 748.39697265625, 2.32507061958313, 0.589282214641571, 0, 19.985286712646484, 154.23561096191406, 574.1760864257812, 2.6152026653289795, 0.00430785259231925, 0.00724016595631837845, 0.0029323133639991283, 0.0029223416931927204, 0.23151130974292755, 0.015626102685928345, 0.4445844292640686, 0.2645074725151062, 4.224729537963867, 2.9161970615386963, 0.002594863995909691, 0.0007813052507117391, 0.007649480830878019, 0.006612685974687338, 0.012070655822753906, 0.008331887423992157, 0.09200018644332886, 1.26938271522521973, 32.31508255004883, 0.0092000188305974, 0.06194433197379112, 0.32586660981178284, 0.0001677886029938236, 4.7396253648912534e-05, - 251, 364, 271.6263732910156, 2.0575451850891113, 799.9964599609375, 0x1.c23a8ep-6, 0.053421564400196075, 1.3615320920944214, 19.99772834777832, 179.99900817871094, 599.999755859375, 2.7787084579467773, -0.0005370039725676179, 0.00019622490799520165, 0.0007332288660109043, 0.0007179134991019964, 0.22412198781967163, 0.02126888930797577, 0.47238045930862427, 0.2819010615348816, 4.32190465927124, 2.9827568531036377, 0.003604006487876177, 0.0010634445352479815, 0.008127730339765549, 0.007047521416097879, 0.012348298914730549, 0.008522058837115765, 0.0916229858994484, 1.206502079963684, 32.14424133300781, 0.009162298403680325, 0.060166630893945694, 0.3260026276111603, 0.00019669566245283931, 1.3870513612346258e-05, - 251, 365, 273.3876037597656, 1.826090931892395, 799.995849609375, 0.05051876977086067, 0.07730823010206223, 1.6988409757614136, 19.997377395629883, 179.9988250732422, 599.9996948242188, 2.7785348892211914, -0.0003141847555525601, 0.00046658882638439536, 0.0007807735819369555, 0.0007170354947447777, 0.22245734930038452, 0.021291933953762054, 0.4723508954048157, 0.28185179829597473, 4.322030067443848, 2.982844591140747, 0.00359008158557117, 0.00106459681410342455, 0.008127220906317234, 0.007046290207654238, 0x1.94a40ap-7, 0.00852231029421091, 0.0916222706437110900879, 1.2070825099945068, 32.14410400390625, 0.00916222669184208, 0.060181137174367905, 0.3260052502155304, 0.0001970182056538760662079, 1.3850550203642342e-05, + ~year, ~doy, ~Tk, ~Tksoil, ~Prcp, ~SoilWater, ~Transp, ~Evap, ~Runoff, ~ws1, ~ws2, ~ws3, ~LAI, ~NPP, ~GPP, ~Rauto, ~Rh, ~NSC, ~seedC, ~leafC, ~rootC, ~sapwoodC, ~heartwoodC, ~NSN, ~seedN, ~leafN, ~rootN, ~sapwoodN, ~heartwoodN, ~mcrbC, ~fastSOM, ~slowSOM, ~mcrbN, ~fastSoilN, ~slowSoilN, ~mineralN, ~N_uptk, + 251, 1, 273.5336608886719, 274.1010437011719, 1.43654537200927734, 799.9971313476562, 0.028174446895718575, 0.0436970591545105, 1.3635268211364746, 19.998138427734375, 179.9991912841797, 599.999755859375, 2.6678121089935303, 0.00033972697565332055, 0.00044326161150820553, 0.00010353463585488498, 0.0007246842724271119, 0.19111771881580353, 0.0120500326156616211, 0.4535280466079712, 0.2715788781642914, 4.14472770690918, 2.857024908065796, 0.003624333767220378, 0.0006025019683875144, 0.007803363725543022, 0.006789466366171837, 0.0118420775979757309, 0.008162828162312508, 0.0915089026093483, 1.2291189432144165, 32.38479232788086, 0.00915089063346386, 0.06080888584256172, 0.32552772760391235, 0.00019733702356461436, 1.351768514723517e-05, + 251, 2, 271.50848388671875, 274.0190734863281, 2.0038180351257324, 799.9969482421875, 0.021478788927197456, 0.0434453189373016357422, 1.9392485618591309, 19.998023986816406, 179.99917602539062, 599.999755859375, 2.6709282398223877, -0.0010877815075218678, 0.000187161262147128582, 0.0012749427696689963, 0.0007223273860290647, 0.1875849813222885, 0.012079929932951927, 0.45405781269073486, 0.2717456817626953, 4.14425802230835, 2.8580644130706787, 0.003594623878598213, 0.0006039967993274331, 0.007812478579580784, 0.006793636828660965, 0.01184073742479086, 0.008165799081325531, 0x1.76d21ap-4, 1.2296613454818726, 32.384647369384766, 0.009150896221399307, 0.06082266569137573, 0.3255302309989929, 0.00019777758279815316, 1.3421246876532678e-05, + 251, 180, 290.34521484375, 286.5027770996094, 2.415818214416504, 748.3969116210938, 2.325070381164551, 0.5892822742462158, 0, 19.985286712646484, 154.2355499267578, 574.1760864257812, 2.615203619003296, 0.004307818133383989, 0.0072401645593345165, 0.002932346425950527, 0.0029223328456282616, 0.23149561882019043, 0.015620054677128792, 0.44458460807800292969, 0.2645074725151062, 4.224748134613037, 2.916208505630493, 0.0025953331496566534, 0.0007810028037056327, 0.0076494840905070305, 0.006612685043364763, 0.012070707976818085, 0.008331924676895142, 0.09200023859739304, 1.269382119178772, 32.314884185791016, 0.009200023487210274, 0x1.fb724ep-5, 0.3258655369281769, 0.0001677877880865708, 4.739607174997218e-05, + 251, 364, 271.6263732910156, 274.15130615234375, 2.0575451850891113, 799.9964599609375, 0.02747965976595878601074, 0.05342160165309906, 1.3618450164794922, 19.99772834777832, 179.99900817871094, 599.999755859375, 2.778696298599243, -0.0005369719583541155, 0.0001962241076398641, 0.0007331960368901491, 0.0007179108797572553, 0.2241131961345672607422, 0.02126256935298443, 0.47237837314605713, 0.2818998098373413, 4.321922779083252, 2.982767105102539, 0.0036045429296791553, 0.0010631285840645432, 0.00812770426273346, 0.00704749533906579, 0.012348351068794727, 0.008522085845470428, 0.09162262827157974, 1.206500768661499, 32.14404296875, 0.00916226301342249, 0.06016646698117256, 0.3260015547275543, 0.0001966954005183652, 1.38704699566005729e-05, + 251, 365, 273.3876037597656, 274.1257019042969, 1.826090931892395, 799.995849609375, 0x1.9dd912p-5, 0.077308289706707, 1.6988409757614136, 19.997377395629883, 179.9988250732422, 599.9996948242188, 2.778522253036499, -0.00031414703698828816, 0.0004665868473239243, 0.0007807338843122125, 0.0007170327589847147, 0.2224486768245697, 0.021285612136125565, 0.47234880924224854, 0.28185057640075684, 4.322047233581543, 2.982856035232544, 0.0035906194243580103, 0.0010642806300893426, 0.008127194829285145, 0.0070462641306221485, 0.0123487077653408051, 0.008522339165210724, 0.09162191301584244, 1.2070810794830322, 32.14390563964844, 0.009162191301584244, 0.060180969536304474, 0.32600417733192444, 0x1.9d2d36p-13, 1.3850509276380762e-05, ) --- @@ -120,12 +120,12 @@ # `mod_BiomeE_gsLeun_oac_yr251`: tibble::tribble( - ~year, ~cID, ~PFT, ~layer, ~density, ~flayer, ~DBH, ~dDBH, ~height, ~age, ~BA, ~dBA, ~Acrown, ~Aleaf, ~NSC, ~NSN, ~seedC, ~leafC, ~rootC, ~sapwoodC, ~heartwoodC, ~treeG, ~fseed, ~fleaf, ~froot, ~fwood, ~NPP, ~GPP, ~Rauto, ~N_uptk, ~N_fxed, ~deathrate, ~n_deadtrees, ~c_deadtrees, ~seedN, ~leafN, ~rootN, ~sapwoodN, ~heartwoodN, - 251, 406, 2, 1, 9681.46484375, 0x1.b009d2p-4, 0.8080161213874817, 0.06408132612705231, 3.236029863357544, 9.602127075195312, 5.127786425873637e-05, 7.810867828084156e-06, 0.108948506414890289, 0.3430755138397217, 0.07346989214420319, 0.0007270948262885213, 0.010331083089113235, 0.058322835713624954, 0.03482215851545334, 0.07144169509410858, 0.04926229640841484, 0.093487337231636047, 0.11050783097743988, 0.20008333027362823, 0.4659423828125, 0x1.c9a8dp-3, 0.0959932953119278, 0.16653335094451904, 0.07054005563259125, 0.0014088205061852932, 0, 0.010726323351264, 3.5957578802481294e-05, 0.0030909916386008263, 0.0005165540496818721, 0.0010034986771643162, 0.0008705527288839221, 0.0002041191328316927, 0.00014074947102926672, - 251, 214, 2, 1, 21.0069580078125, 0x1.f64628p-6, 21.15327262878418, 0.20581036806106567, 16.5573673248291, 141.0599365234375, 0.03514350205659866, 0.0006805285811424255, 14.593438148498535, 45.96021270751953, 1.2249454259872437, 0.032123442739248276, 0.1238904669880867, 7.813236236572266, 4.664961338043213, 130.43170166015625, 89.87305450439453, 12.0432949066162109, 0.0102870911359786987, 0.1413847804069519, 0x1.c425dp-2, 0.40677759051322937, 12.620774269104004, 22.446157455444336, 9.825383186340332, 0.1873016506433487, 0, 0.10728958249092102, 0.00020707683870568871, 0.05276927351951599, 0.006194521673023701, 0.13443374633789062, 0.11662402749061584, 0.3726620078086853, 0.25674065947532654, - 251, 282, 2, 1, 1081.8145751953125, 0.5646983981132507, 10.658964157104492, 0.185316801071167, 11.753304481506348, 90.758415222167969, 0.008923184126615524, 0.00030757952481508255, 5.219918251037598, 16.44205665588379, 1.2424023151397705, 0.017460817471146584, 0.04891180247068405, 2.795149564743042, 1.66886842250823975, 26.962270736694336, 18.57845687866211, 4.490318298339844, 0.010892724618315697, 0.14180508255958557, 0.4463185667991638, 0.400983601808548, 4.689686298370361, 8.345051765441895, 3.655365467071533, 0.07024802267551422, 0, 0.044799454510211945, 0.0011623644968494773, 0.24860483407974243, 0.0024455897510051727, 0.0480930358171463, 0.04172166809439659, 0.07703506201505661, 0.05308115854859352, - 251, 376, 2, 1, 1623.66162109375, 0.33621853590011597, 5.754707336425781, 0.1069478690624237, 8.636029243469238, 57.1512069702148438, 0.00260097626596689224, 9.577698074281216e-05, 2.070742607116699, 3.4390366077423096, 0.042665936052799225, 0.0018369671888649464, 0.03548339754343033, 0.5846362113952637, 0.34781086444854736, 6.532346725463867, 4.501042366027832, 1.0216233730316162, 0.03473236784338951, 0.12365271151065826, 0.38555505871772766, 0.45605987310409546, 0.9962588548660278, 1.7761448621749878, 0.77988600730896, 0.01385111641138792, 0, 0.023804951459169388, 0.00020828952256124467, 0.046551428735256195, 0.00177417113445699214935, 0.010059193708002567, 0.008695281110703945, 0.01866384781897068, 0.012860093265771866, - 251, 397, 2, 2, 3080.87109375, 0.01163176167756319, 0.3986457288265228, 0.06337305903434753, 2.272982120513916, 0x1.cfd396p+0, 1.248142416443443e-05, 3.652938175946474e-06, 0.03775478154420853, 0.040754977613687515, 0.01971736177802086, 0.001959690358489752, 0, 0.006928346119821072, 0.004136629868298769, 0.004997086711227894, 0x1.338dfap-6, 0.01736113801598549, 0, 0.3204140365123749, 0.22988617420196533, 0.4496996998786926, 0.008225620724260807, 0.0200980491936206818, 0.0118724284693598747, 0, 0, 0.34929198026657104, 0.00024215198936872184, 0.005870368797332048, 0, 0.00011920845281565562, 0.00010341555025661364, 1.4277388800110202e-05, 5.3633233619621024e-05, + ~year, ~cID, ~PFT, ~layer, ~density, ~flayer, ~DBH, ~dDBH, ~height, ~age, ~BA, ~dBA, ~Acrown, ~Aleaf, ~NSC, ~NSN, ~seedC, ~leafC, ~rootC, ~sapwoodC, ~heartwoodC, ~treeG, ~fseed, ~fleaf, ~froot, ~fwood, ~NPP, ~GPP, ~Rauto, ~N_uptk, ~N_fxed, ~deathrate, ~n_deadtrees, ~c_deadtrees, ~seedN, ~leafN, ~rootN, ~sapwoodN, ~heartwoodN, + 251, 406, 2, 1, 9691.70703125, 0.1054143756628036499, 0.8071213960647583, 0.06401878595352173, 3.2342376708984375, 9.5871181488037109, 5.116437023389153e-05, 7.794566045049578e-06, 0.10876759886741638, 0.3425057828426361, 0.0733126848936081, 0.0007293460075743496, 0.010299854911863804, 0.05822598189115524, 0.034764330834150314, 0.07125985622406006, 0.0491369366645813, 0.09331022948026657104, 0.11038291454315186, 0.200190529227256775, 0.4660780727863312, 0.223348468542099, 0.09583421796560287, 0.1662517786026001, 0.07041756063699722, 0.0014063079142943025, 0, 0.0107251172885298729, 3.595728412619792e-05, 0.003087153658270836, 0.0005149939679540694, 0.0010018324246630073, 0.0008691070834174752, 0.00020359958580229431, 0.0001403915957780555, + 251, 214, 2, 1, 21.006366729736328, 0.03065652586519718, 21.15373992919922, 0.20592063665390015, 16.55755043029785, 141.05950927734375, 0.035145051777362823, 0.0006809085607528687, 14.593920707702637, 45.961692810058594, 1.21358692646026611, 0.032009173184633255, 0.1238970085978508, 7.813488006591797, 4.665111541748047, 130.43832397460938, 89.87757873535156, 12.046396255493164, 0.0102849854156374931, 0.14141924679279327, 0.4413963556289673, 0.4068993628025055, 12.616394996643066, 22.442611694335938, 9.82621669769287109, 0.1872352659702301, 0, 0x1.b778a8p-4, 0.000207060453249141574, 0.05276941508054733, 0.00619485042989254, 0.13443806767463684, 0.1166277825832367, 0.3726809322834015, 0.25675320625305176, + 251, 282, 2, 1, 1082.1727294921875, 0.5646827816963196, 10.656414985656738, 0.18536821007728577, 0x1.780f9p+3, 90.7577896118164, 0.00891891773790121, 0.00030759070068597794, 5.21804666519165, 16.43610382080078, 1.2269095182418823, 0.017346370965242386, 0.0487363338470459, 2.794137716293335, 1.6682645082473754883, 0x1.af28b6p+4, 18.5682373046875, 4.488149166107178, 0.0108588933944702148, 0.14177972078323364, 0.4462025463581085, 0.40115886926651, 4.68450403213501, 8.337443351745605, 3.652939319610595703, 0.07018178701400757, 0, 0.0447869747877121, 0.0011613238602876663, 0.24841268360614777, 0.0024368150625377893, 0x1.89d5d2p-5, 0.04170659929513931, 0.07699268311262131, 0.053051985800266266, + 251, 376, 2, 1, 1619.5845947265625, 0.3363090455532074, 5.765395641326904, 0.10721199214458466, 8.64404582977295, 57.21648025512695, 0.0026106468867510557, 9.619141928851604e-05, 2.07651424407959, 3.4574801921844482422, 0.042881909757852554, 0.001846335013397038, 0.035674259066581726, 0.5877716541290283, 0.3496735990047455, 6.560286045074463, 4.520292282104492, 1.0268653631210327, 0.034740932285785675, 0.1236678585410118103, 0x1.8ae4d8p-2, 0x1.d2e54p-2, 1.001363754272461, 1.7853071689605713, 0.7839434146881104, 0.01392417587339878, 0, 0.02384342812001705, 0.00020908408623654395, 0.04671269282698631, 0.0017837138148024678, 0.0101131163537502289, 0.008741840720176697, 0.01874367520213127, 0.012915109284222126, + 251, 397, 2, 2, 3068.652099609375, 0.0115778632462024689, 0.3984675705432892, 0.06345228850841522, 2.272474527359009, 1.8078478574752808, 1.2470270121411886e-05, 3.6553346944856457e-06, 0.037729475647211075, 0.04072762280702591, 0.019721753895282745, 0.0019605588167905807, 0, 0.0069236960262060165, 0.004133853130042553, 0.004991947207599878, 0.018752355128526688, 0.017364898696541786, 0, 0.32066264748573303, 0.22951793670654297, 0.4498193860054016, 0.008209405466914177, 0.02008109726011753, 0.011871691793203354, 0, 0, 0.3493077754974365, 0.00024127212236635387, 0.005844407714903355, 0, 0.00011912843910977244, 0.000103346166724804789, 1.426270591764478e-05, 5.357816917239688e-05, ) --- @@ -145,24 +145,24 @@ # `mod_BiomeE_PLULUC_primary_odt_yr1`: tibble::tribble( - ~year, ~doy, ~Tk, ~Prcp, ~SoilWater, ~Transp, ~Evap, ~Runoff, ~ws1, ~ws2, ~ws3, ~LAI, ~NPP, ~GPP, ~Rauto, ~Rh, ~NSC, ~seedC, ~leafC, ~rootC, ~sapwoodC, ~heartwoodC, ~NSN, ~seedN, ~leafN, ~rootN, ~sapwoodN, ~heartwoodN, ~mcrbC, ~fastSOM, ~slowSOM, ~mcrbN, ~fastSoilN, ~slowSoilN, ~mineralN, ~N_uptk, - 1, 1, 273.5336608886719, 1.436545491218567, 799.9446411132812, 0, 0.0554012693464756, 1.436545491218567, 19.944599151611328, 179.99998474121094, 600, 0, -2.97977797991677562e-09, 0, 2.97977797991677562e-09, 2.773448841253412e-06, 0.005826912354677916, 0, 0, 0, 0.002500000176951289, 0, 0.00029308954253792763, 0, 0, 0, 7.142857157305116e-06, 0, 3.692179575409682e-07, 0.00999686587601900101, 0.000999990850687027, 3.692179717518229e-08, 0.0006664577522315085, 2.4999771994771436e-05, 0.0149249155074357986, 0, - 1, 2, 271.50848388671875, 2.0038182735443115, 799.9472045898438, 0, 0.05280914157629013, 1.94841718673706055, 19.94719123840332, 179.99998474121094, 600, 0.00017509811732452363, -2.796728767862077802e-05, 0, 2.796728767862077802e-05, 2.752370164671447e-06, 0.005743016488850117, 0, 2.976667929033283e-05, 1.7772452338249423e-05, 3.0054898161324672e-05, 0.002478334354236722, 0.0002921090926975012, 0, 5.121619892634044e-07, 4.443113255092612e-07, 8.587085176259279e-08, 7.080955583660398e-06, 7.353892215178348e-07, 0.00999375618994236, 0.0009999817702919245, 7.353892073069801e-08, 0.0006662504165433347, 2.4999544621095993e-05, 0x1.e69f64p-7, 0, - 1, 180, 290.3451843261719, 2.415818214416504, 799.1299438476562, 0, 0.8700509667396545, 1.0773378610610962, 19.12995147705078, 179.99998474121094, 600, 0.004660780541598797, 1.424936453986447304e-05, 1.908696867758408189e-05, 4.83760459246696e-06, 1.0379684681538492e-05, 0.004003825597465038, 0, 0.0007923326338641346, 0.00047306911437772214, 0.0007721544825471938, 0.002478334354236722, 0.00025850688689388335, 0, 1.3632797163154464e-05, 1.1826728950836696e-05, 2.206155613748706e-06, 7.080955583660398e-06, 9.97683746390976e-05, 0.009317527525126934, 0.0010561823146417737, 9.9768376458087e-06, 0.0006211685249581933, 2.5818837457336485e-05, 0.005871004890650511, 0, - 1, 364, 271.62640380859375, 2.0575454235076904, 799.9307861328125, 0, 0.06923088431358337, 1.9698282480239868, 19.9307708740234375, 179.99998474121094, 600, 0.006191854830831289, 1.6428944036306348e-06, 6.178122021083254e-06, 4.53522761745262e-06, 2.367866500208038e-06, 0.004261433146893978, 0, 0.0010526153491809964, 0.000628473237156868, 0.001149466261267662, 0.002837070496752858, 0.00023810572747606784, 0, 1.8111200915882364e-05, 1.57118101924425e-05, 3.284189460828202e-06, 8.105919732770417e-06, 0.00023415253963321447, 0.007998576387763023, 0.0011340860510244966, 2.3415253963321447e-05, 0.000531817611772567, 2.697298077691812e-05, 0.0032056597992777824, 0, - 1, 365, 273.3876037597656, 1.826090812683105469, 799.9038696289062, 0, 0.0961432233452797, 1.7568600177764893, 19.903858184814453, 179.99998474121094, 600, 0.006200521253049374, 1.6177618817891926e-06, 6.168299478304107e-06, 4.550537596514914e-06, 2.3623879314982332e-06, 0.004254146479070187, 0, 0.00105408858507871628, 0.0006293528131209314, 0.0011514449724927545, 0.002838983666151762, 0.00023798539768904448, 0, 1.813655035221018e-05, 1.573379813635256e-05, 3.2898424251470715e-06, 8.111385795928072e-06, 0.00023431360023096204, 0.007998200133442879, 0.0011345992097631097, 2.34313592955004424e-05, 0.0005317443865351379, 2.6980338589055464e-05, 0.003211216302588582, 0, + ~year, ~doy, ~Tk, ~Tksoil, ~Prcp, ~SoilWater, ~Transp, ~Evap, ~Runoff, ~ws1, ~ws2, ~ws3, ~LAI, ~NPP, ~GPP, ~Rauto, ~Rh, ~NSC, ~seedC, ~leafC, ~rootC, ~sapwoodC, ~heartwoodC, ~NSN, ~seedN, ~leafN, ~rootN, ~sapwoodN, ~heartwoodN, ~mcrbC, ~fastSOM, ~slowSOM, ~mcrbN, ~fastSoilN, ~slowSoilN, ~mineralN, ~N_uptk, + 1, 1, 273.5336608886719, 274.1312255859375, 1.436545491218567, 799.9446411132812, 0, 0.0554012693464756, 1.436545491218567, 19.944599151611328, 179.99998474121094, 600, 0, -2.97977797991677562e-09, 0, 2.97977797991677562e-09, 2.773448841253412e-06, 0.005826912354677916, 0, 0, 0, 0.002500000176951289, 0, 0.00029308954253792763, 0, 0, 0, 7.142857157305116e-06, 0, 3.692179575409682e-07, 0.00999686587601900101, 0.000999990850687027, 3.692179717518229e-08, 0.0006664577522315085, 2.4999771994771436e-05, 0.0149249155074357986, 0, + 1, 2, 271.50848388671875, 274.0488586425781, 2.0038182735443115, 799.9472045898438, 0, 0.052807990461587906, 1.94841718673706055, 19.94719123840332, 179.99998474121094, 600, 0.0003648526908364147, -5.8273035392630845e-05, 0, 5.8273035392630845e-05, 2.752370164671447e-06, 0.005652101244777441, 0, 6.202496297191828e-05, 3.703254697029479e-05, 0.0016369707882404327, 0.0008805100223980844, 0.0002910465991590172, 0, 1.067194148163253e-06, 9.25813708363421e-07, 4.67705922346795e-06, 2.515743062758702e-06, 7.353892215178348e-07, 0.00999375618994236, 0.0009999817702919245, 7.353892073069801e-08, 0.0006662504165433347, 2.4999544621095993e-05, 0x1.e69f64p-7, 0, + 1, 180, 290.3451843261719, 286.4756774902344, 2.415818214416504, 799.1299438476562, 0, 0.870050847530365, 1.0773391723632812, 19.12995147705078, 179.99998474121094, 600, 0.004662044811993837, 1.4255607311497442e-05, 0x1.40502p-16, 4.836535026697675e-06, 1.0380407729826402e-05, 0.004000645596534014, 0, 0.000792547594755888, 0.00047319746227003634, 0.0008088446338661015, 0.002442991128191352, 0.0002584756293799728, 0, 1.3636492440127768e-05, 1.18299203677452169e-05, 2.31098488256975543e-06, 6.9799784796487074e-06, 9.977493027690798e-05, 0.0093181729316711426, 0.0010563548421487212, 9.9774933914886788e-06, 0.0006212115404196084, 2.5821305825957097e-05, 0.005870996043086052, 0, + 1, 364, 271.62640380859375, 274.1844482421875, 2.0575454235076904, 799.9307861328125, 0, 0.06923087686300278, 1.9698282480239868, 19.9307708740234375, 179.99998474121094, 600, 0.0061927973292768, 1.6445910659967922e-06, 6.179061983857537e-06, 4.5344709178607445e-06, 2.36803953157505e-06, 0.004259446170181036, 0, 0.00105277553666383028, 0.0006285688723437488, 0.0011497334344312549, 0.0028377308044582605, 0.00023807525576557964, 0, 1.8113965779775754e-05, 1.571420580148697e-05, 3.2849527542566648e-06, 8.107809662760701e-06, 0.0002341683721169829369, 0.007999159395694733, 0.0011342739453539252, 2.3416836484102532e-05, 0.0005318562616594136, 2.6975696528097615e-05, 0.0032056604977697134, 0, + 1, 365, 273.3876037597656, 274.1578063964844, 1.826090812683105469, 799.9038696289062, 0, 0.0961432233452797, 1.7568600177764893, 19.903858184814453, 179.99998474121094, 600, 0.006201462354511023, 1.619542672415264e-06, 6.16923489360488e-06, 4.549692221189616e-06, 2.362560280744219e-06, 0.004252162761986256, 0, 0.0010542486561462283, 0.0006294483901001513, 0.00115171307697892189, 0.0028396411798894405, 0.00023795492597855628, 0, 1.81393097591353580356e-05, 1.5736191926407628e-05, 3.290608674433315e-06, 8.113266630971339e-06, 0.00023432944726664573, 0.007998783141374588, 0.0011347872205078602, 2.3432945454260334e-05, 0.0005317830364219844, 2.698305615922436e-05, 0.003211217001080513, 0, ) --- # `mod_BiomeE_PLULUC_primary_odt_yr251`: tibble::tribble( - ~year, ~doy, ~Tk, ~Prcp, ~SoilWater, ~Transp, ~Evap, ~Runoff, ~ws1, ~ws2, ~ws3, ~LAI, ~NPP, ~GPP, ~Rauto, ~Rh, ~NSC, ~seedC, ~leafC, ~rootC, ~sapwoodC, ~heartwoodC, ~NSN, ~seedN, ~leafN, ~rootN, ~sapwoodN, ~heartwoodN, ~mcrbC, ~fastSOM, ~slowSOM, ~mcrbN, ~fastSoilN, ~slowSoilN, ~mineralN, ~N_uptk, - 251, 1, 273.5336608886719, 1.436545491218567, 799.9583740234375, 0, 0.04164949059486389, 1.3647308349609375, 0x1.3f5568p+4, 179.99998474121094, 600, 3.5711464881896973, 0.002246167976409197, 0.0022930759005248547, 4.690802961704321e-05, 0.001467015827074647, 2.1851139068603516, 0.00102845055516809225, 0.6070948839187622, 0.36907511949539185, 4.419338226318359, 3.35748028755188, 0.06249659135937691, 5.142251757206395e-05, 0.01044566929340362548828, 0.009226866997778416, 0.0126266796141862869, 0.009592792019248009, 0.16364069283008575, 2.1829378604888916, 73.7013168334961, 0.016364069655537605, 0.11383578926324844, 0.6851038336753845, 0.0020995328668504953, 5.2250525186536834e-05, - 251, 2, 271.50848388671875, 2.0038182735443115, 799.9576416015625, 0, 0.04234856739640236, 1.9621679782867432, 19.957653045654297, 179.99998474121094, 600, 3.577575922012329, -0.00011209235526621342, 0.0022606588900089264, 0.00237275124527514, 0.0014580391580238938, 2.180330514907837, 0.00121350307017564774, 0.6081878542900085, 0.3689758777618408, 4.404471397399902, 3.374283790588379, 0.06242924928665161, 6.067514550522901e-05, 0.0104644745588302612, 0.00922438595443964, 0.01258420292288065, 0.009640802629292011, 0.1636427342891693, 2.1835122108459473, 73.70084381103516, 0.01636427268385887, 0.113847553730010986, 0.6851065158843994, 0.002134067239239812, 0, - 251, 180, 290.3451843261719, 2.415818214416504, 799.4786987304688, 0, 0.5212868452072144, 1.6898143291473389, 19.478713989257812, 179.99998474121094, 600, 3.6855220794677734, 0.006996382959187031, 0.00940756592899561, 0.002411183202639222, 0.005773116368800402, 2.1710057258605957, 0.03244977444410324, 0.6265387535095215, 0x1.7e3e32p-2, 4.545224189758301, 3.5366082191467285, 0.06344294548034668, 0.0016224890714511275, 0.010780218057334423065, 0.009332086890935898, 0.0129863535985350609, 0.010104586370289326, 0.16461129486560822, 2.1958518028259277, 73.51875305175781, 0.01646113023161888, 0.11346811801195145, 0.6854029297828674, 0.0016644787974655628, 0, - 251, 364, 271.62640380859375, 2.0575454235076904, 799.949951171875, 0, 0.05007721483707428, 1.9918313026428222656, 19.94992446899414, 179.99998474121094, 600, 3.810532569885254, 0.0004853953141719103, 0.0024726183619350195, 0.001987223047763109, 0.00142469769343733788, 2.262698173522949, 0.07006724178791046, 0.6477905511856079, 0.3867690563201904297, 4.750125408172607, 3.686607599258423, 0.06478233635425568, 0.0035033617168664932, 0.011145866475999355, 0.00966921728104353, 0.0135717857629060745, 0.010533157736063004, 0.16338472068309784, 2.0303914546966553, 73.09454345703125, 0.016338471323251724, 0.10725955665111542, 0.6852454543113708, 0.002280128188431263, 0, - 251, 365, 273.3876037597656, 1.826090812683105469, 799.92822265625, 0, 0.07181990146636963, 1.776013970375061, 19.928178787231445, 179.99998474121094, 600, 3.8112215995788574, 0.000471955630928277969, 0.0024662481155246496, 0.0019942924845963717, 0.0014233457623049617, 2.259279727935791, 0.07026728987693787, 0.6479076147079468, 0.3868389427661896, 4.751210689544678, 0x1.d7fc56p+1, 0.06489767879247665, 0.0035133648198097944, 0.011147881858050823, 0.009670963510870934, 0.0135748879984021187, 0.010535388253629208, 0.16338132321834564, 2.0310678482055664, 73.09408569335938, 0.016338132321834564, 0.107273481786251068, 0.6852483749389648, 0.0021408540196716785, 0.00017251026292797178, + ~year, ~doy, ~Tk, ~Tksoil, ~Prcp, ~SoilWater, ~Transp, ~Evap, ~Runoff, ~ws1, ~ws2, ~ws3, ~LAI, ~NPP, ~GPP, ~Rauto, ~Rh, ~NSC, ~seedC, ~leafC, ~rootC, ~sapwoodC, ~heartwoodC, ~NSN, ~seedN, ~leafN, ~rootN, ~sapwoodN, ~heartwoodN, ~mcrbC, ~fastSOM, ~slowSOM, ~mcrbN, ~fastSoilN, ~slowSoilN, ~mineralN, ~N_uptk, + 251, 1, 273.5336608886719, 274.1312255859375, 1.436545491218567, 799.9583740234375, 0, 0.04164948686957359, 1.3647308349609375, 19.95835304260254, 179.99998474121094, 600, 3.571153402328491, 0.0022461693733930588, 0.00229307753033936023712, 4.690809510066174e-05, 0.0014670148957520723, 2.1851158142089844, 0x1.0d9f28p-10, 0.6070960760116577, 0.36907586455345154, 4.4193291664123535, 3.3574888706207275, 0.06247977912425995, 5.142626469023526e-05, 0.0104456990957260132, 0.0092268837615847588, 0.012626654468476772, 0.009592811577022076, 0.16364045441150665, 2.182933568954467773, 73.70133972167969, 0.016364045441150665, 0.11382948607206345, 0.6851032376289368, 0.002138829790055752, 0.00017328847025055438, + 251, 2, 271.50848388671875, 274.0488586425781, 2.0038182735443115, 799.9576416015625, 0, 0.04234856739640236, 1.96216952800750732422, 19.957653045654297, 179.99998474121094, 600, 3.577581882476806641, -0.0001120197121053934097, 0.0022606600541621447, 0.002372679766267538, 0.0014580382267013192, 2.180332660675049, 0.0012135779252275825, 0.6081888675689697, 0.3689765930175781, 4.404462814331055, 3.3742918968200684, 0.06241244450211525, 6.067890353733674e-05, 0.010464503429830074, 0.009224400855600834, 0.01258417870849371, 0.009640821255743504, 0.1636424958705902, 2.183507919311523438, 73.70086669921875, 0.01636425033211708, 0.113841257989406586, 0.6851059198379517, 0.0021730929147452116, 0, + 251, 180, 290.3451843261719, 286.4756774902344, 2.415818214416504, 799.4786987304688, 0, 0.5212867259979248, 1.6898143291473389, 19.478713989257812, 179.99998474121094, 600, 3.685528039932251, 0.006996393203735351562, 0.009407570585608482, 0.002411177381873131, 0.005773113574832678, 2.171008825302124, 0.03244990110397339, 0.6265397667884827, 0.37328478693962097, 4.545215129852295, 3.536618232727051, 0.06355509907007217, 0.0016224950086325407, 0.010780243203043938, 0.009332102723419666, 0x1.a98934p-7, 0.01010461151599884, 0.16461098194122314, 2.1958484649658203, 73.5187759399414, 0.016461098566651344, 0.11346269398927689, 0.6854023337364197, 0.001538897748105228, 0, + 251, 364, 271.62640380859375, 274.1844482421875, 2.0575454235076904, 799.949951171875, 0, 0.05007721483707428, 1.9918313026428222656, 19.94992446899414, 179.99998474121094, 600, 3.810537815093994, 0.0004854507278650999, 0.002472618827596307, 0.001987168099731207, 0.0014246972277760506, 2.2626984119415283, 0.070067398250103, 0.6477914452552795, 0.38676953315734863, 4.750117301940918, 3.686615467071533, 0.06480302661657333, 0.003503370564430952, 0.01114590559154749, 0.009669226594269276, 0.01357176527380943298, 0.010533180087804794, 0.1633845418691635, 2.0303890705108643, 73.09456634521484, 0.01633845455944538, 0.107255458831787109, 0.6852447986602783, 0.0022604770492762327, 0, + 251, 365, 273.3876037597656, 274.1578063964844, 1.826090812683105469, 799.92822265625, 0, 0.07181989401578903, 1.776013970375061, 19.928178787231445, 179.99998474121094, 600, 3.811227798461914, 0.0004718594718724489, 0.0024662483483552933, 0.0019943888764828444, 0.0014233452966436744, 2.25927996635437, 0.070267453789711, 0.647908627986908, 0.386839538812637329, 4.7512030601501465, 3.6873958110809326, 0.0649053230881691, 0.003513373201712966, 0.011147922836244106, 0.009670975618064404, 0.013574868440628052, 0.010535410605370998, 0.16338114440441132, 2.0310654640197754, 73.09410858154297, 0.016338113695383072, 0.10726938396692276, 0.6852477192878723, 0.002134375274181366, 0.00015947069914545864, ) --- @@ -210,24 +210,24 @@ # `mod_BiomeE_PLULUC_secondary_odt_yr1`: tibble::tribble( - ~year, ~doy, ~Tk, ~Prcp, ~SoilWater, ~Transp, ~Evap, ~Runoff, ~ws1, ~ws2, ~ws3, ~LAI, ~NPP, ~GPP, ~Rauto, ~Rh, ~NSC, ~seedC, ~leafC, ~rootC, ~sapwoodC, ~heartwoodC, ~NSN, ~seedN, ~leafN, ~rootN, ~sapwoodN, ~heartwoodN, ~mcrbC, ~fastSOM, ~slowSOM, ~mcrbN, ~fastSoilN, ~slowSoilN, ~mineralN, ~N_uptk, - 1, 1, 273.5336608886719, 1.436545491218567, 799.9446411132812, 0, 0.0554012767970562, 1.43660509586334229, 19.944599151611328, 179.99998474121094, 600, 0, -2.97977797991677562e-09, 0, 2.97977797991677562e-09, 2.7734490686270874e-06, 0.005826912354677916, 0, 0, 0, 0.002500000176951289, 0, 0.00029308954253792763, 0, 0, 0, 7.142857157305116e-06, 0, 3.6921798596267763e-07, 0.009996866807341576, 0.000999990850687027, 3.692179717518229e-08, 0.0006664578104391694, 2.4999771994771436e-05, 0.014924914576113224, 0, - 1, 2, 271.50848388671875, 2.0038182735443115, 799.9472045898438, 0, 0.05280914157629013, 1.94841718673706055, 19.94719123840332, 179.99998474121094, 600, 0.00017509811732452363, -2.796728767862077802e-05, 0, 2.796728767862077802e-05, 2.752370619418798e-06, 0.005743016488850117, 0, 2.976667929033283e-05, 1.7772452338249423e-05, 3.0054898161324672e-05, 0.002478334354236722, 0.0002921090926975012, 0, 5.121619892634044e-07, 4.443113255092612e-07, 8.587085176259279e-08, 7.080955583660398e-06, 7.353893920480914e-07, 0.0099937571212649345, 0.0009999817702919245, 7.353894204698008e-08, 0.0006662504747509956, 2.4999544621095993e-05, 0.01485054288059473, 0, - 1, 180, 290.3451843261719, 2.415818214416504, 799.1299438476562, 0, 0.8700509667396545, 1.0773378610610962, 19.12995147705078, 179.99998474121094, 600, 0.004660780541598797, 1.424936453986447304e-05, 1.908696867758408189e-05, 4.83760459246696e-06, 1.0379686500527896e-05, 0.004003825597465038, 0, 0.0007923326338641346, 0.00047306911437772214, 0.0007721544825471938, 0.002478334354236722, 0.00025850688689388335, 0, 1.3632797163154464e-05, 1.1826728950836696e-05, 2.206155613748706e-06, 7.080955583660398e-06, 9.97683891910128295422e-05, 0.009317528456449509, 0.0010561823146417737, 9.976838555303402e-06, 0.0006211685831658542, 2.5818837457336485e-05, 0.005871003959327936, 0, - 1, 364, 271.62640380859375, 2.0575454235076904, 799.9307861328125, 0, 0.06923088431358337, 1.9698282480239868, 19.9307708740234375, 179.99998474121094, 600, 0.006191854830831289, 1.6428944036306348e-06, 6.178122021083254e-06, 4.53522761745262e-06, 2.36786718232906424e-06, 0.004261433146893978, 0, 0.0010526153491809964, 0.000628473237156868, 0.001149466261267662, 0.002837070496752858, 0.00023810572747606784, 0, 1.8111200915882364e-05, 1.57118101924425e-05, 3.284189460828202e-06, 8.105919732770417e-06, 0.00023415248142555356, 0.007998579181730747, 0.0011340860510244966, 2.3415248506353237e-05, 0.0005318177281878889, 2.697298077691812e-05, 0.003205659333616495, 0, - 1, 365, 273.3876037597656, 1.826090812683105469, 799.9038696289062, 0, 0.0961432233452797, 1.7568600177764893, 19.903858184814453, 179.99998474121094, 600, 0.006200521253049374, 1.6177618817891926e-06, 6.168299478304107e-06, 4.550537596514914e-06, 2.3623886136192596e-06, 0.004254146479070187, 0, 0.00105408858507871628, 0.0006293528131209314, 0.0011514449724927545, 0.002838983666151762, 0.00023798539768904448, 0, 1.813655035221018e-05, 1.573379813635256e-05, 3.2898424251470715e-06, 8.111385795928072e-06, 0.00023431354202330112, 0.007998202927410603, 0.0011345992097631097, 2.3431353838532232e-05, 0.0005317445029504597, 2.6980338589055464e-05, 0.0032112158369272947, 0, + ~year, ~doy, ~Tk, ~Tksoil, ~Prcp, ~SoilWater, ~Transp, ~Evap, ~Runoff, ~ws1, ~ws2, ~ws3, ~LAI, ~NPP, ~GPP, ~Rauto, ~Rh, ~NSC, ~seedC, ~leafC, ~rootC, ~sapwoodC, ~heartwoodC, ~NSN, ~seedN, ~leafN, ~rootN, ~sapwoodN, ~heartwoodN, ~mcrbC, ~fastSOM, ~slowSOM, ~mcrbN, ~fastSoilN, ~slowSoilN, ~mineralN, ~N_uptk, + 1, 1, 273.5336608886719, 274.1312255859375, 1.436545491218567, 799.9446411132812, 0, 0.0554012767970562, 1.43660509586334229, 19.944599151611328, 179.99998474121094, 600, 0, -2.97977797991677562e-09, 0, 2.97977797991677562e-09, 2.7734490686270874e-06, 0.005826912354677916, 0, 0, 0, 0.002500000176951289, 0, 0.00029308954253792763, 0, 0, 0, 7.142857157305116e-06, 0, 3.6921798596267763e-07, 0.009996866807341576, 0.000999990850687027, 3.692179717518229e-08, 0.0006664578104391694, 2.4999771994771436e-05, 0.014924914576113224, 0, + 1, 2, 271.50848388671875, 274.0488586425781, 2.0038182735443115, 799.9472045898438, 0, 0.052807990461587906, 1.94841718673706055, 19.94719123840332, 179.99998474121094, 600, 0.0003648526908364147, -5.8273035392630845e-05, 0, 5.8273035392630845e-05, 2.752370619418798e-06, 0.005652101244777441, 0, 6.202496297191828e-05, 3.703254697029479e-05, 0.0016369707882404327, 0.0008805100223980844, 0.0002910465991590172, 0, 1.067194148163253e-06, 9.25813708363421e-07, 4.67705922346795e-06, 2.515743062758702e-06, 7.353893920480914e-07, 0.0099937571212649345, 0.0009999817702919245, 7.353894204698008e-08, 0.0006662504747509956, 2.4999544621095993e-05, 0.01485054288059473, 0, + 1, 180, 290.3451843261719, 286.4756774902344, 2.415818214416504, 799.1299438476562, 0, 0.870050847530365, 1.0773391723632812, 19.12995147705078, 179.99998474121094, 600, 0.004662044811993837, 1.4255607311497442e-05, 0x1.40502p-16, 4.836535026697675e-06, 1.0380408639321104e-05, 0.004000645596534014, 0, 0.000792547594755888, 0.00047319746227003634, 0.0008088446338661015, 0.002442991128191352, 0.0002584756293799728, 0, 1.3636492440127768e-05, 1.18299203677452169e-05, 2.31098488256975543e-06, 6.9799784796487074e-06, 9.97749375528656e-05, 0.0093181738629937172, 0.0010563548421487212, 9.9774933914886788e-06, 0.0006212115986272693, 2.5821305825957097e-05, 0.005870996043086052, 0, + 1, 364, 271.62640380859375, 274.1844482421875, 2.0575454235076904, 799.9307861328125, 0, 0.06923087686300278, 1.9698282480239868, 19.9307708740234375, 179.99998474121094, 600, 0.0061927973292768, 1.6445910659967922e-06, 6.179061983857537e-06, 4.5344709178607445e-06, 2.36803953157505e-06, 0.004259446170181036, 0, 0.00105277553666383028, 0.0006285688723437488, 0.0011497334344312549, 0.0028377308044582605, 0.00023807525576557964, 0, 1.8113965779775754e-05, 1.571420580148697e-05, 3.2849527542566648e-06, 8.107809662760701e-06, 0.00023416834301315248, 0.007999159395694733, 0.0011342739453539252, 2.341683466511313e-05, 0.0005318562616594136, 2.6975696528097615e-05, 0.0032056604977697134, 0, + 1, 365, 273.3876037597656, 274.1578063964844, 1.826090812683105469, 799.9038696289062, 0, 0.0961432233452797, 1.7568600177764893, 19.903858184814453, 179.99998474121094, 600, 0.006201462354511023, 1.619542672415264e-06, 6.16923489360488e-06, 4.549692221189616e-06, 2.362560280744219e-06, 0.004252162761986256, 0, 0.0010542486561462283, 0.0006294483901001513, 0.00115171307697892189, 0.0028396411798894405, 0.00023795492597855628, 0, 1.81393097591353580356e-05, 1.5736191926407628e-05, 3.290608674433315e-06, 8.113266630971339e-06, 0.00023432941816281527, 0.007998783141374588, 0.0011347872205078602, 2.3432941816281527e-05, 0.0005317830364219844, 2.698305615922436e-05, 0.003211217001080513, 0, ) --- # `mod_BiomeE_PLULUC_secondary_odt_yr251`: tibble::tribble( - ~year, ~doy, ~Tk, ~Prcp, ~SoilWater, ~Transp, ~Evap, ~Runoff, ~ws1, ~ws2, ~ws3, ~LAI, ~NPP, ~GPP, ~Rauto, ~Rh, ~NSC, ~seedC, ~leafC, ~rootC, ~sapwoodC, ~heartwoodC, ~NSN, ~seedN, ~leafN, ~rootN, ~sapwoodN, ~heartwoodN, ~mcrbC, ~fastSOM, ~slowSOM, ~mcrbN, ~fastSoilN, ~slowSoilN, ~mineralN, ~N_uptk, - 251, 1, 273.5336608886719, 1.436545491218567, 799.9583740234375, 0, 0.04164949059486389, 1.3647308349609375, 0x1.3f5568p+4, 179.99998474121094, 600, 3.5711464881896973, 0.002246167976409197, 0.0022930759005248547, 4.690802961704321e-05, 0.001467015827074647, 2.1851139068603516, 0.00102845055516809225, 0.6070948839187622, 0.36907511949539185, 4.419338226318359, 3.35748028755188, 0.06249659135937691, 5.142251757206395e-05, 0.01044566929340362548828, 0.009226866997778416, 0.0126266796141862869, 0.009592792019248009, 0.16364069283008575, 2.1829378604888916, 73.7013168334961, 0.016364069655537605, 0.11383578926324844, 0.6851038336753845, 0.0020995328668504953, 5.2250525186536834e-05, - 251, 2, 271.50848388671875, 2.0038182735443115, 799.9576416015625, 0, 0.04234856739640236, 1.9621679782867432, 19.957653045654297, 179.99998474121094, 600, 3.577575922012329, -0.00011209235526621342, 0.0022606588900089264, 0.00237275124527514, 0.0014580391580238938, 2.180330514907837, 0.00121350307017564774, 0.6081878542900085, 0.3689758777618408, 4.404471397399902, 3.374283790588379, 0.06242924928665161, 6.067514550522901e-05, 0.0104644745588302612, 0.00922438595443964, 0.01258420292288065, 0.009640802629292011, 0.1636427342891693, 2.1835122108459473, 73.70084381103516, 0.01636427268385887, 0.113847553730010986, 0.6851065158843994, 0.002134067239239812, 0, - 251, 180, 290.3451843261719, 2.415818214416504, 799.4786987304688, 0, 0.5212868452072144, 1.6898143291473389, 19.478713989257812, 179.99998474121094, 600, 3.6855220794677734, 0.006996382959187031, 0.00940756592899561, 0.002411183202639222, 0.005773116368800402, 2.1710057258605957, 0.03244977444410324, 0.6265387535095215, 0x1.7e3e32p-2, 4.545224189758301, 3.5366082191467285, 0.06344294548034668, 0.0016224890714511275, 0.010780218057334423065, 0.009332086890935898, 0.0129863535985350609, 0.010104586370289326, 0.16461129486560822, 2.1958518028259277, 73.51875305175781, 0.01646113023161888, 0.11346811801195145, 0.6854029297828674, 0.0016644787974655628, 0, - 251, 364, 271.62640380859375, 2.0575454235076904, 799.949951171875, 0, 0.05007721483707428, 1.9918313026428222656, 19.94992446899414, 179.99998474121094, 600, 3.810532569885254, 0.0004853953141719103, 0.0024726183619350195, 0.001987223047763109, 0.00142469769343733788, 2.262698173522949, 0.07006724178791046, 0.6477905511856079, 0.3867690563201904297, 4.750125408172607, 3.686607599258423, 0.06478233635425568, 0.0035033617168664932, 0.011145866475999355, 0.00966921728104353, 0.0135717857629060745, 0.010533157736063004, 0.16338472068309784, 2.0303914546966553, 73.09454345703125, 0.016338471323251724, 0.10725955665111542, 0.6852454543113708, 0.002280128188431263, 0, - 251, 365, 273.3876037597656, 1.826090812683105469, 799.92822265625, 0, 0.07181990146636963, 1.776013970375061, 19.928178787231445, 179.99998474121094, 600, 3.8112215995788574, 0.000471955630928277969, 0.0024662481155246496, 0.0019942924845963717, 0.0014233457623049617, 2.259279727935791, 0.07026728987693787, 0.6479076147079468, 0.3868389427661896, 4.751210689544678, 0x1.d7fc56p+1, 0.06489767879247665, 0.0035133648198097944, 0.011147881858050823, 0.009670963510870934, 0.0135748879984021187, 0.010535388253629208, 0.16338132321834564, 2.0310678482055664, 73.09408569335938, 0.016338132321834564, 0.107273481786251068, 0.6852483749389648, 0.0021408540196716785, 0.00017251026292797178, + ~year, ~doy, ~Tk, ~Tksoil, ~Prcp, ~SoilWater, ~Transp, ~Evap, ~Runoff, ~ws1, ~ws2, ~ws3, ~LAI, ~NPP, ~GPP, ~Rauto, ~Rh, ~NSC, ~seedC, ~leafC, ~rootC, ~sapwoodC, ~heartwoodC, ~NSN, ~seedN, ~leafN, ~rootN, ~sapwoodN, ~heartwoodN, ~mcrbC, ~fastSOM, ~slowSOM, ~mcrbN, ~fastSoilN, ~slowSoilN, ~mineralN, ~N_uptk, + 251, 1, 273.5336608886719, 274.1312255859375, 1.436545491218567, 799.9583740234375, 0, 0.04164948686957359, 1.3647308349609375, 19.95835304260254, 179.99998474121094, 600, 3.571153402328491, 0.0022461693733930588, 0.00229307753033936023712, 4.690809510066174e-05, 0.0014670148957520723, 2.1851158142089844, 0x1.0d9f28p-10, 0.6070960760116577, 0.36907586455345154, 4.4193291664123535, 3.3574888706207275, 0.06247977912425995, 5.142626469023526e-05, 0.0104456990957260132, 0.0092268837615847588, 0.012626654468476772, 0.009592811577022076, 0.16364045441150665, 2.182933568954467773, 73.70133972167969, 0.016364045441150665, 0.11382948607206345, 0.6851032376289368, 0.002138829790055752, 0.00017328847025055438, + 251, 2, 271.50848388671875, 274.0488586425781, 2.0038182735443115, 799.9576416015625, 0, 0.04234856739640236, 1.96216952800750732422, 19.957653045654297, 179.99998474121094, 600, 3.577581882476806641, -0.0001120197121053934097, 0.0022606600541621447, 0.002372679766267538, 0.0014580382267013192, 2.180332660675049, 0.0012135779252275825, 0.6081888675689697, 0.3689765930175781, 4.404462814331055, 3.3742918968200684, 0.06241244450211525, 6.067890353733674e-05, 0.010464503429830074, 0.009224400855600834, 0.01258417870849371, 0.009640821255743504, 0.1636424958705902, 2.183507919311523438, 73.70086669921875, 0.01636425033211708, 0.113841257989406586, 0.6851059198379517, 0.0021730929147452116, 0, + 251, 180, 290.3451843261719, 286.4756774902344, 2.415818214416504, 799.4786987304688, 0, 0.5212867259979248, 1.6898143291473389, 19.478713989257812, 179.99998474121094, 600, 3.685528039932251, 0.006996393203735351562, 0.009407570585608482, 0.002411177381873131, 0.005773113574832678, 2.171008825302124, 0.03244990110397339, 0.6265397667884827, 0.37328478693962097, 4.545215129852295, 3.536618232727051, 0.06355509907007217, 0.0016224950086325407, 0.010780243203043938, 0.009332102723419666, 0x1.a98934p-7, 0.01010461151599884, 0.16461098194122314, 2.1958484649658203, 73.5187759399414, 0.016461098566651344, 0.11346269398927689, 0.6854023337364197, 0.001538897748105228, 0, + 251, 364, 271.62640380859375, 274.1844482421875, 2.0575454235076904, 799.949951171875, 0, 0.05007721483707428, 1.9918313026428222656, 19.94992446899414, 179.99998474121094, 600, 3.810537815093994, 0.0004854507278650999, 0.002472618827596307, 0.001987168099731207, 0.0014246972277760506, 2.2626984119415283, 0.070067398250103, 0.6477914452552795, 0.38676953315734863, 4.750117301940918, 3.686615467071533, 0.06480302661657333, 0.003503370564430952, 0.01114590559154749, 0.009669226594269276, 0.01357176527380943298, 0.010533180087804794, 0.1633845418691635, 2.0303890705108643, 73.09456634521484, 0.01633845455944538, 0.107255458831787109, 0.6852447986602783, 0.0022604770492762327, 0, + 251, 365, 273.3876037597656, 274.1578063964844, 1.826090812683105469, 799.92822265625, 0, 0.07181989401578903, 1.776013970375061, 19.928178787231445, 179.99998474121094, 600, 3.811227798461914, 0.0004718594718724489, 0.0024662483483552933, 0.0019943888764828444, 0.0014233452966436744, 2.25927996635437, 0.070267453789711, 0.647908627986908, 0.386839538812637329, 4.7512030601501465, 3.6873958110809326, 0.0649053230881691, 0.003513373201712966, 0.011147922836244106, 0.009670975618064404, 0.013574868440628052, 0.010535410605370998, 0.16338114440441132, 2.0310654640197754, 73.09410858154297, 0.016338113695383072, 0.10726938396692276, 0.6852477192878723, 0.002134375274181366, 0.00015947069914545864, ) --- diff --git a/tests/testthat/test-model-runs-snapshot-biomee.R b/tests/testthat/test-model-runs-snapshot-biomee.R index ab4efc1c..b85c5ea3 100644 --- a/tests/testthat/test-model-runs-snapshot-biomee.R +++ b/tests/testthat/test-model-runs-snapshot-biomee.R @@ -1,6 +1,41 @@ # BiomeE: test model outputs, repeatability and agreement with reference values from subfolder ./_snaps/ set.seed(10) +test_that("BiomeEP Tksoil initial days (rolling mean, smoothed)", { + out <- runread_biomee_f( + biomee_p_model_drivers, + makecheck = TRUE, + parallel = FALSE) + testthat::expect_equal(tolerance = 1e-6, + object = out$data[[1]]$output_daily_tile$Tksoil[1:100], # |> dput() + expected = c(274.131225585938, 274.048858642578, 273.926605224609, 273.828460693359, + 273.749633789062, 273.685852050781, 273.649108886719, 273.640594482422, + 273.629180908203, 273.614959716797, 273.617065429688, 273.612640380859, + 273.610260009766, 273.594940185547, 273.549255371094, 273.518737792969, + 273.537414550781, 273.561279296875, 273.596313476562, 273.595153808594, + 273.577362060547, 273.511474609375, 273.436340332031, 273.346618652344, + 273.287780761719, 273.245819091797, 273.211639404297, 273.187286376953, + 273.146240234375, 273.085357666016, 273.017272949219, 272.994445800781, + 272.974212646484, 272.945190429688, 272.927551269531, 272.899078369141, + 272.884002685547, 272.870178222656, 272.845550537109, 272.824340820312, + 272.797088623047, 272.765411376953, 272.720794677734, 272.682922363281, + 272.681671142578, 272.687591552734, 272.684417724609, 272.677215576172, + 272.686370849609, 272.702239990234, 272.70263671875, 272.713531494141, + 272.748168945312, 272.802947998047, 272.880401611328, 272.964019775391, + 273.035675048828, 273.078796386719, 273.143005371094, 273.194885253906, + 273.249633789062, 273.320373535156, 273.384155273438, 273.424102783203, + 273.451446533203, 273.467651367188, 273.490570068359, 273.537017822266, + 273.592193603516, 273.650756835938, 273.727630615234, 273.828094482422, + 273.946411132812, 274.096221923828, 274.250335693359, 274.402404785156, + 274.532379150391, 274.634552001953, 274.724029541016, 274.813507080078, + 274.903900146484, 274.981170654297, 275.064575195312, 275.181274414062, + 275.298217773438, 275.421630859375, 275.558258056641, 275.715179443359, + 275.874176025391, 276.011444091797, 276.159576416016, 276.333129882812, + 276.5234375, 276.67919921875, 276.811828613281, 276.972717285156, + 277.122802734375, 277.219665527344, 277.342437744141, 277.502380371094 + )) +}) + test_that("Snapshot tests run_biomee_f_bysite()", { skip_on_cran() diff --git a/tests/testthat/test-model-runs.R b/tests/testthat/test-model-runs.R index 772ec1da..72e572ad 100644 --- a/tests/testthat/test-model-runs.R +++ b/tests/testthat/test-model-runs.R @@ -608,3 +608,48 @@ test_that("Check net C (and N) balances without/with land-use-change", { ) }) + + +test_that("BiomeEP repeated restart == single simulation", { + skip() # TODO: remove this again + drv <- rsofun::biomee_p_model_drivers + # + drv$params_siml[[1]]$spinupyears <- 0 + drv$params_siml[[1]]$do_daily_diagnostics <- FALSE + drv$params_siml[[1]]$nyeartrend <- 2 + out_full <- run_biomee_f_bysite(sitename = drv$sitename, + params_siml = drv$params_siml[[1]], + site_info = drv$site_info[[1]], + forcing = drv$forcing[[1]], + params_tile = drv$params_tile[[1]], + params_species = drv$params_species[[1]], + init_cohort = drv$init_cohort[[1]], + init_soil = drv$init_soil[[1]]) + drv1 <- drv + drv1$params_siml[[1]]$nyeartrend <- 1 + out_y1 <- run_biomee_f_bysite(sitename = drv1$sitename, + params_siml = drv1$params_siml[[1]], + site_info = drv1$site_info[[1]], + forcing = drv1$forcing[[1]], + params_tile = drv1$params_tile[[1]], + params_species = drv1$params_species[[1]], + init_cohort = drv1$init_cohort[[1]], + init_soil = drv1$init_soil[[1]]) + drv2 <- drv + drv2$params_siml[[1]]$nyeartrend <- 1 + drv2$init_cohort[[1]] <- out_y1$data$restart_init_cohort + drv2$init_soil[[1]] <- out_y1$data$restart_init_soil + out_restart <- run_biomee_f_bysite(sitename = drv2$sitename, + params_siml = drv2$params_siml[[1]], + site_info = drv2$site_info[[1]], + forcing = drv2$forcing[[1]], + params_tile = drv2$params_tile[[1]], + params_species = drv2$params_species[[1]], + init_cohort = drv2$init_cohort[[1]], + init_soil = drv2$init_soil[[1]]) + + testthat::expect_equal(ignore_attr = TRUE, tolerance = 1e-4, + out_full$data$output_annual_tile[2,] |> select(-year), + out_restart$data$output_annual_tile[1,]|> select(-year)) + +})