diff --git a/src/datatypes_biomee.mod.f90 b/src/datatypes_biomee.mod.f90 index cd9349f9..c488ca12 100644 --- a/src/datatypes_biomee.mod.f90 +++ b/src/datatypes_biomee.mod.f90 @@ -69,7 +69,7 @@ module datatypes_biomee real :: vpd = 0.0 real :: temp = 0.0 real :: patm = 0.0 - real, dimension(NLAYERS_MAX) :: par = dummy ! Initialization to a dummy value. Important! Keep it. + real :: par = 0.0 end type dampended_forcing_type !=============== Tile level data type ============================================================ diff --git a/src/gpp_biomee.mod.f90 b/src/gpp_biomee.mod.f90 index 0bb03cc7..4677683c 100644 --- a/src/gpp_biomee.mod.f90 +++ b/src/gpp_biomee.mod.f90 @@ -83,7 +83,7 @@ subroutine gpp( forcing, vegn ) integer:: i ! local variables used for P-model part - real :: tk, kphio_temp + real :: kphio_temp type(outtype_pmodel) :: out_pmodel ! list of P-model output variables !----------------------------------------------------------- @@ -190,6 +190,7 @@ subroutine gpp( forcing, vegn ) vegn%dampended_forcing%temp = (forcing%Tair - kTkelvin) vegn%dampended_forcing%vpd = forcing%vpd vegn%dampended_forcing%patm = forcing%P_air + vegn%dampended_forcing%par = forcing%radiation vegn%dampended_forcing%initialized = .True. else vegn%dampended_forcing%co2 = dampen_variability( forcing%CO2 * 1.0e6, params_gpp%tau_acclim, & @@ -200,9 +201,18 @@ subroutine gpp( forcing, vegn ) params_gpp%tau_acclim, vegn%dampended_forcing%vpd ) vegn%dampended_forcing%patm = dampen_variability( forcing%P_air, & params_gpp%tau_acclim, vegn%dampended_forcing%patm ) + vegn%dampended_forcing%par = dampen_variability( forcing%radiation, & + params_gpp%tau_acclim, vegn%dampended_forcing%par ) end if - tk = forcing%Tair + kTkelvin + !---------------------------------------------------------------- + ! Instantaneous temperature effect on quantum yield efficiency + !---------------------------------------------------------------- + kphio_temp = calc_kphio_temp( (forcing%Tair - kTkelvin), & + .false., & ! no C4 + params_gpp%kphio, & + params_gpp%kphio_par_a, & + params_gpp%kphio_par_b ) !---------------------------------------------------------------- ! Photosynthesis for each cohort @@ -212,27 +222,11 @@ subroutine gpp( forcing, vegn ) cc => vegn%cohorts(i) associate ( sp => myinterface%params_species(cc%species) ) - !---------------------------------------------------------------- - ! Instantaneous temperature effect on quantum yield efficiency - !---------------------------------------------------------------- - kphio_temp = calc_kphio_temp( (forcing%Tair - kTkelvin), & - .false., & ! no C4 - params_gpp%kphio, & - params_gpp%kphio_par_a, & - params_gpp%kphio_par_b ) - - ! photosynthetically active radiation level at this layer - par = f_light(cc%layer) * forcing%radiation * kfFEC * 1.0e-6 - ! slowly varying light conditions per layer, relevant for acclimation (P-model quantities) - if (vegn%dampended_forcing%par(cc%layer) == dummy) then - vegn%dampended_forcing%par(cc%layer) = par - else - vegn%dampended_forcing%par(cc%layer) = dampen_variability(par, params_gpp%tau_acclim, & - vegn%dampended_forcing%par(cc%layer)) - end if - if (cc%status == LEAF_ON) then + ! photosynthetically active radiation level at this layer + par = f_light(cc%layer) * vegn%dampended_forcing%par * kfFEC * 1.0e-6 + !---------------------------------------------------------------- ! P-model call for C3 plants to get a list of variables that are ! acclimated to slowly varying conditions @@ -241,7 +235,7 @@ subroutine gpp( forcing, vegn ) kphio = kphio_temp, & beta = params_gpp%beta, & kc_jmax = params_gpp%kc_jmax, & - ppfd = vegn%dampended_forcing%par(cc%layer), & + ppfd = par, & co2 = vegn%dampended_forcing%co2, & tc = vegn%dampended_forcing%temp, & vpd = vegn%dampended_forcing%vpd, &