From a826743d0944f50ca04c5e99f81ed01888372c3c Mon Sep 17 00:00:00 2001 From: kmdeck Date: Mon, 17 Jun 2024 12:23:20 -0700 Subject: [PATCH] fix bugs --- src/integrated/soil_canopy_model.jl | 2 +- src/standalone/Vegetation/photosynthesis.jl | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/integrated/soil_canopy_model.jl b/src/integrated/soil_canopy_model.jl index e817020510..f446cd2bbe 100644 --- a/src/integrated/soil_canopy_model.jl +++ b/src/integrated/soil_canopy_model.jl @@ -364,7 +364,7 @@ function lsm_radiant_energy_fluxes!( # net canopy @. SW_net_canopy = energy_per_photon_NIR * N_a * p.canopy.radiative_transfer.nir.abs + - energy_per_photon_PAR * N_a * p.canopy.radiative_transfer.abs.abs + energy_per_photon_PAR * N_a * p.canopy.radiative_transfer.par.abs # net soil = (1-α)*trans for par and nir diff --git a/src/standalone/Vegetation/photosynthesis.jl b/src/standalone/Vegetation/photosynthesis.jl index 341a2feee6..c9282c423d 100644 --- a/src/standalone/Vegetation/photosynthesis.jl +++ b/src/standalone/Vegetation/photosynthesis.jl @@ -92,6 +92,7 @@ function photosynthesis_at_a_point_Farquhar( APAR, c_co2, medlyn_factor, + R, parameters, ) (; @@ -111,7 +112,7 @@ function photosynthesis_at_a_point_Farquhar( Ko25, ΔHkc, ΔHko, - ) = model.parameters + ) = parameters Jmax = max_electron_transport(Vcmax25, ΔHJmax, T, To, R) J = electron_transport(APAR, Jmax, θj, ϕ) Vcmax = compute_Vcmax(Vcmax25, T, To, R, ΔHVcmax) @@ -165,10 +166,12 @@ function update_photosynthesis!( APAR, c_co2, medlyn_factor, + R, model.parameters, ) Vcmax25field .= Vcmax25 end -Base.broadcastable(m::AbstractPhotosynthesisMechanism) = tuple(m) # this is so that @. does not broadcast on Ref(canopy.autotrophic_respiration) +Base.broadcastable(m::AbstractPhotosynthesisMechanism) = tuple(m) +Base.broadcastable(m::FarquharParameters) = tuple(m) include("./optimality_farquhar.jl")