Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexisRenchon committed Jul 26, 2024
1 parent b2b76ef commit 3eac581
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 18 deletions.
3 changes: 1 addition & 2 deletions experiments/integrated/fluxnet/ozark_pft.jl
Original file line number Diff line number Diff line change
Expand Up @@ -184,9 +184,8 @@ radiative_transfer_args = (;
conductance_args = (; parameters = MedlynConductanceParameters(FT; g1))
# Set up photosynthesis
# Set up photosynthesis
SP = SIFParameters()
photosynthesis_args =
(; parameters = FarquharParameters(FT, Canopy.C3(), SP; Vcmax25 = Vcmax25))
(; parameters = FarquharParameters(FT, Canopy.C3(); Vcmax25 = Vcmax25))
# Set up plant hydraulics
ai_parameterization = PrescribedSiteAreaIndex{FT}(LAIfunction, SAI, RAI)

Expand Down
17 changes: 10 additions & 7 deletions ext/CreateParametersExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -133,17 +133,19 @@ toml_dict = CP.create_toml_dict(Float32);
ClimaLand.Canopy.FarquharParameters(toml_dict, ClimaLand.Canopy.C3(); Vcmax25 = 99999999, pc = 444444444)
```
"""
FarquharParameters(
function FarquharParameters(
::Type{FT},
mechanism,
SIFParameters();
mechanism;
kwargs...,
) where {FT <: AbstractFloat} =
FarquharParameters(CP.create_toml_dict(FT), mechanism, SIFParameters(); kwargs...)
) where {FT <: AbstractFloat}
sif_parameters = SIFParameters{FT}()
FarquharParameters(CP.create_toml_dict(FT), mechanism, sif_parameters; kwargs...)
end

function FarquharParameters(
toml_dict::CP.AbstractTOMLDict,
mechanism;
mechanism,
sif_parameters;
Vcmax25 = 5e-5,
kwargs...,
)
Expand All @@ -168,10 +170,11 @@ function FarquharParameters(
parameters = CP.get_parameter_values(toml_dict, name_map, "Land")
FT = CP.float_type(toml_dict)
MECH = typeof(mechanism)
SP = SIFParameters()
SP = typeof(sif_parameters)
return FarquharParameters{FT, MECH, SP}(;
mechanism,
Vcmax25,
sif_parameters,
parameters...,
kwargs...,
)
Expand Down
18 changes: 9 additions & 9 deletions src/standalone/Vegetation/photosynthesis.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,23 @@ $(DocStringExtensions.FIELDS)
"""
@kwdef struct SIFParameters{FT <: AbstractFloat}
""
kf::FT = 0.05
kf::FT = FT(0.05)
""
kd_p1::FT = 0.03
kd_p1::FT = FT(0.03)
""
kd_p2::FT = 0.0273
kd_p2::FT = FT(0.0273)
""
min_kd::FT = 0.087
min_kd::FT = FT(0.087)
""
kn_p1::FT = 6.2473
kn_p1::FT = FT(6.2473)
""
kn_p2::FT = 0.5944
kn_p2::FT = FT(0.5944)
""
kp::FT = 4.0
kp::FT = FT(4.0)
""
kappa_p1::FT = 0.045
kappa_p1::FT = FT(0.045)
""
kappa_p2::FT = 7.85
kappa_p2::FT = FT(7.85)
end

abstract type AbstractPhotosynthesisMechanism end
Expand Down

0 comments on commit 3eac581

Please sign in to comment.