From 07245f92cafbe75c6938d134bba4243b62e9be39 Mon Sep 17 00:00:00 2001 From: Alexis Renchon Date: Wed, 7 Aug 2024 13:08:56 -0700 Subject: [PATCH] WIP --- .../Vegetation/solar_induced_fluorescence.jl | 58 +++++++++++++------ 1 file changed, 41 insertions(+), 17 deletions(-) diff --git a/src/standalone/Vegetation/solar_induced_fluorescence.jl b/src/standalone/Vegetation/solar_induced_fluorescence.jl index 40379aff88..f780952ec8 100644 --- a/src/standalone/Vegetation/solar_induced_fluorescence.jl +++ b/src/standalone/Vegetation/solar_induced_fluorescence.jl @@ -9,25 +9,49 @@ The required parameters for the SIF parameterisation Lee et al, 2015. Global Change Biology 21, 3469-3477, doi:10.1111/gcb.12948. $(DocStringExtensions.FIELDS) """ -@kwdef struct SIFParameters{FT <: AbstractFloat} +Base.@kwdef struct SIFParameters{FT <: AbstractFloat} "The rate coefficient for florescence, unitless" - kf::FT = FT(0.05) + kf::FT "Parameter used to compute the rate coefficient for heat loss in dark-adapted conditions, Tol et al. 2014, unitless" - kd_p1::FT = FT(0.03) + kd_p1::FT "Parameter used to compute the rate coefficient for heat loss in dark-adapted conditions, Tol et al. 2014, unitless" - kd_p2::FT = FT(0.0273) + kd_p2::FT "Parameter used to compute the rate coefficient for heat loss in dark-adapted conditions, Tol et al. 2014, unitless" - min_kd::FT = FT(0.087) + min_kd::FT "Parameter used to compute the rate coefficient for heat loss in light-adapted conditions, Lee et al 2013 (unitless)" - kn_p1::FT = FT(6.2473) + kn_p1::FT "Parameter used to compute the rate coefficient for heat loss in light-adapted conditions, Lee et al 2013 (unitless)" - kn_p2::FT = FT(0.5944) + kn_p2::FT "Rate coefficient for photochemical quenching" - kp::FT = FT(4.0) + kp::FT "Slope of line relating leaf-level fluorescence to spectrometer-observed fluorescence as a function of Vcmax 25. Lee et al 2015." - kappa_p1::FT = FT(0.045) + kappa_p1::FT "Intercept of line relating leaf-level fluorescence to spectrometer-observed fluorescence as a function of Vcmax 25. Lee et al 2015." - kappa_p2::FT = FT(7.85) + kappa_p2::FT +end + +function SIFParameters{FT}(; + kf = FT(0.05), + kd_p1 = FT(0.03), + kd_p2 = FT(0.0273), + min_kd = FT(0.087), + kn_p1 = FT(6.2473), + kn_p2 = FT(0.5944), + kp = FT(4.0), + kappa_p1 = FT(0.045), + kappa_p2 = FT(7.85), + ) where {FT} + return SIFParameters{FT}( + kf, + kd_p1, + kd_p2, + min_kd, + kn_p1, + kn_p2, + kp, + kappa_p1, + kappa_p2, + ) end Base.eltype(::SIFParameters{FT}) where {FT} = FT @@ -51,14 +75,14 @@ ClimaLand.auxiliary_domain_names(::Lee2015SIFModel) = (:surface,) # call function below inside photosynthesis.jl p function compute_SIF_at_a_point( - APAR, - Tc, - Vcmax25, - R, - T_freeze, + APAR::FT, + Tc::FT, + Vcmax25::FT, + R::FT, + T_freeze::FT, photosynthesis_parameters, sif_parameters, -) +) where {FT} (; ΔHJmax, To, θj, ϕ) = photosynthesis_parameters Jmax = max_electron_transport(Vcmax25, ΔHJmax, Tc, To, R) J = electron_transport(APAR, Jmax, θj, ϕ) @@ -70,7 +94,7 @@ function compute_SIF_at_a_point( ϕp0 = kp / (kf + kp + kn) ϕp = J / Jmax * ϕp0 ϕf = kf / (kf + kd + kn) * (1 - ϕp) - κ = kappa_p1 * Vcmax25 * FT(1000000.0) + kappa_p2 # formula expects Vcmax25 in μmol/m^2/s + κ = kappa_p1 * Vcmax25 * FT(1e6) + kappa_p2 # formula expects Vcmax25 in μmol/m^2/s F = APAR * ϕf SIF_755 = F / κ