Skip to content

Commit

Permalink
All CO2 fluxes in mol CO2 m-2 s-1
Browse files Browse the repository at this point in the history
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 <a.renchon@gmail.com>
Co-authored-by: kmdeck <kdeck@caltech.edu>
  • Loading branch information
AlexisRenchon and kmdeck committed Aug 19, 2024
1 parent 394a295 commit c45e5ec
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 14 deletions.
3 changes: 1 addition & 2 deletions ext/CreateParametersExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
13 changes: 6 additions & 7 deletions src/standalone/Vegetation/autotrophic_respiration.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand All @@ -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)

8 changes: 3 additions & 5 deletions src/standalone/Vegetation/canopy_parameterizations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand All @@ -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

Expand All @@ -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

0 comments on commit c45e5ec

Please sign in to comment.