From c45e5ec77b57ebae09866f3098c935ce0125e21e Mon Sep 17 00:00:00 2001 From: AlexisRenchon Date: Mon, 19 Aug 2024 15:17:48 -0700 Subject: [PATCH] All CO2 fluxes in mol CO2 m-2 s-1 There was some inconsistencies, as well as some bug in the code, because of sometimes expressing CO2 fluxes in gC m-2 s-1, and sometimes in mol CO2 m-2 s-1. In this PR, we express all CO2 fluxes in mol CO2 m-2 s-1. Note: the parameter "f1" (:mol_CO2_to_kg_C_factor) from AutotrophicRespirationParameters has been removed, and the parameter "f2" (:relative_contribution_factor) renamed to "f". This change is also happening in ClimaParams.jl Co-authored-by: AlexisRenchon Co-authored-by: kmdeck --- ext/CreateParametersExt.jl | 3 +-- .../Vegetation/autotrophic_respiration.jl | 13 ++++++------- .../Vegetation/canopy_parameterizations.jl | 8 +++----- 3 files changed, 10 insertions(+), 14 deletions(-) diff --git a/ext/CreateParametersExt.jl b/ext/CreateParametersExt.jl index 514495916b..e501cabc35 100644 --- a/ext/CreateParametersExt.jl +++ b/ext/CreateParametersExt.jl @@ -96,8 +96,7 @@ function AutotrophicRespirationParameters( :live_stem_wood_coeff => :ηsl, :specific_leaf_density => :σl, :root_leaf_nitrogen_ratio => :μr, - :mol_CO2_to_kg_C_factor => :f1, - :relative_contribution_factor => :f2, + :relative_contribution_factor => :f, :stem_leaf_nitrogen_ratio => :μs, ) parameters = CP.get_parameter_values(toml_dict, name_map, "Land") diff --git a/src/standalone/Vegetation/autotrophic_respiration.jl b/src/standalone/Vegetation/autotrophic_respiration.jl index 78d73bb616..a56c585dcf 100644 --- a/src/standalone/Vegetation/autotrophic_respiration.jl +++ b/src/standalone/Vegetation/autotrophic_respiration.jl @@ -22,10 +22,8 @@ Base.@kwdef struct AutotrophicRespirationParameters{FT <: AbstractFloat} μr::FT "Ratio stem nitrogen to top leaf nitrogen (-), typical value 0.1" μs::FT - "Factor to convert from mol CO2 to kg C" - f1::FT "Factor of relative contribution or Rgrowth (-)" - f2::FT + f::FT end Base.eltype(::AutotrophicRespirationParameters{FT}) where {FT} = FT @@ -73,7 +71,7 @@ ClimaLand.auxiliary_domain_names(::AutotrophicRespirationModel) = (:surface,) h, ) -Computes the autotrophic respiration as the sum of the plant maintenance +Computes the autotrophic respiration (mol co2 m^-2 s^-1) as the sum of the plant maintenance and growth respirations, according to the JULES model. Clark, D. B., et al. "The Joint UK Land Environment Simulator (JULES), model description–Part 2: carbon fluxes and vegetation dynamics." Geoscientific Model Development 4.3 (2011): 701-722. @@ -92,13 +90,14 @@ function compute_autrophic_respiration( h, ) - (; ne, ηsl, σl, μr, μs, f1, f2) = model.parameters + (; ne, ηsl, σl, μr, μs, f) = model.parameters Nl, Nr, Ns = nitrogen_content(ne, Vcmax25, LAI, SAI, RAI, ηsl, h, σl, μr, μs) - Rpm = plant_respiration_maintenance(Rd, β, Nl, Nr, Ns, f1) - Rg = plant_respiration_growth(f2, An, Rpm) + Rpm = plant_respiration_maintenance(Rd, β, Nl, Nr, Ns) + Rg = plant_respiration_growth(f, An, Rpm) Ra = Rpm + Rg return Ra * (1 - exp(-K * LAI * Ω)) / (K * Ω) # adjust to canopy level end Base.broadcastable(model::AutotrophicRespirationModel) = tuple(model) # this is so that @. does not broadcast on Ref(canopy.autotrophic_respiration) + diff --git a/src/standalone/Vegetation/canopy_parameterizations.jl b/src/standalone/Vegetation/canopy_parameterizations.jl index 6522c50d2f..75e8c0b84b 100644 --- a/src/standalone/Vegetation/canopy_parameterizations.jl +++ b/src/standalone/Vegetation/canopy_parameterizations.jl @@ -1007,7 +1007,6 @@ end Nl::FT, # Nitrogen content of leafs Nr::FT, # Nitrogen content of roots Ns::FT, # Nitrogen content of stems - f::FT # Factor to convert from mol CO2 to kg C ) where {FT} Computes plant maintenance respiration as a function of dark respiration (Rd), @@ -1020,10 +1019,9 @@ function plant_respiration_maintenance( Nl::FT, # Nitrogen content of leafs Nr::FT, # Nitrogen content of roots Ns::FT, # Nitrogen content of stems - f1::FT, # Factor to convert from mol CO2 to kg C ) where {FT} # When LAI is zero, Nl = 0 - Rpm = f1 * Rd * (β + (Nr + Ns) / max(Nl, eps(FT))) + Rpm = Rd * (β + (Nr + Ns) / max(Nl, eps(FT))) return Rpm end @@ -1037,7 +1035,7 @@ end Computes plant growth respiration as a function of net photosynthesis (An), plant maintenance respiration (Rpm), and a relative contribution factor, f. """ -function plant_respiration_growth(f2::FT, An::FT, Rpm::FT) where {FT} - Rg = f2 * (An - Rpm) +function plant_respiration_growth(f::FT, An::FT, Rpm::FT) where {FT} + Rg = f * (An - Rpm) return Rg end