Skip to content

Commit f684693

Browse files
authored
Merge pull request #1256 from CliMA/js/canopy-defaults
use get_default_parameter for canopy parameters
2 parents 63f8adb + 48f879d commit f684693

File tree

4 files changed

+24
-23
lines changed

4 files changed

+24
-23
lines changed

src/shared_utilities/Parameters.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,8 @@ end
121121
"""
122122
get_default_parameter(FT, climaparams_name)
123123
124-
Helper function for accessing and returning the default
125-
parameter value (a float of type `FT`) from the ClimaParams
124+
Helper function for accessing and returning the default
125+
parameter value (a float of type `FT`) from the ClimaParams
126126
dictionary. To look up the value, you must use the name
127127
of the parameter from ClimaParams (`climaparams_name`).
128128
For example, the following keys in the ClimaParams dictionary map
@@ -140,6 +140,8 @@ to the variables in the parameter structs as noted below:
140140
141141
:canopy_emissivity => :ϵ_canopy (TwoStreamParameters, BeerLambertParameters)
142142
:min_stomatal_conductance => :g0 (MedlynConductanceParameters)
143+
:low_water_pressure_sensitivity => :sc (FarquharParameters, OptimalityFarquharParameters)
144+
:moisture_stress_ref_water_pressure => :pc (FarquharParameters, OptimalityFarquharParameters)
143145
144146
:soil_conductivity => :κ_soil (BucketModelParameters)
145147
:soil_heat_capacity => :ρc_soil (BucketModelParameters)

src/standalone/Soil/Soil.jl

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -216,17 +216,14 @@ When running the soil model in standalone mode, `prognostic_land_components = (:
216216
this should be a list of the component models. This value of this argument must be the same across all components in the land model.
217217
218218
Default spatially varying parameters (for retention curve parameters, composition, and specific storativity) are provided but can be
219-
changed with keyword arguments.
219+
changed with keyword arguments.
220220
221-
The runoff and albedo parameterizations are also provided and can be changed via keyword argument;
222-
additional sources may be required in your model if the soil model will be composed with other
221+
The runoff and albedo parameterizations are also provided and can be changed via keyword argument;
222+
additional sources may be required in your model if the soil model will be composed with other
223223
component models.
224224
225225
Roughness lengths and soil emissivity are currently treated as constants; these can be passed in as Floats
226226
by kwarg; otherwise the default values are used.
227-
228-
TODO: Move runoff scalar parameters to ClimaParams, possibly use types in retention, composition,
229-
roughness, and emissivity.
230227
"""
231228
function EnergyHydrology(
232229
FT,
@@ -256,6 +253,8 @@ function EnergyHydrology(
256253
emissivity = LP.get_default_parameter(FT, :emissivity_bare_soil),
257254
additional_sources = (),
258255
)
256+
# TODO: Move runoff scalar parameters to ClimaParams, possibly use types in retention, composition,
257+
# roughness, and emissivity.
259258
top_bc = AtmosDrivenFluxBC(
260259
forcing.atmos,
261260
forcing.radiation,
@@ -298,11 +297,9 @@ end
298297
Creates a RichardsModel model with the given float type FT, domain, earth_param_set and forcing.
299298
300299
Default spatially varying parameters (for retention curve parameters and specific storativity) are provided but can be
301-
changed with keyword arguments.
300+
changed with keyword arguments.
302301
303302
The runoff parameterization is also provided and can be changed via keyword argument.
304-
305-
TODO: Move scalar parameters to ClimaParams and obtain from earth_param_set, possibly use types in retention argument.
306303
"""
307304
function RichardsModel(
308305
FT,
@@ -319,6 +316,7 @@ function RichardsModel(
319316
),
320317
S_s = ClimaCore.Fields.zeros(domain.space.subsurface) .+ 1e-3,
321318
)
319+
# TODO: Move scalar parameters to ClimaParams and obtain from earth_param_set, possibly use types in retention argument.
322320
top_bc = RichardsAtmosDrivenFluxBC(forcing.atmos, runoff)
323321
bottom_bc = WaterFluxBC((p, t) -> 0.0)
324322
boundary_conditions = (; top = top_bc, bottom = bottom_bc)

src/standalone/Vegetation/Canopy.jl

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ The following default parameter is used:
7474
function BigLeafEnergyModel{FT}(;
7575
ac_canopy::FT = FT(2e3),
7676
) where {FT <: AbstractFloat}
77+
# TODO: move `ac_canopy` to ClimaParams.jl so we can call `get_default_parameter`.
7778
parameters = BigLeafEnergyParameters{FT}(ac_canopy)
7879
return BigLeafEnergyModel{FT, typeof(parameters)}(parameters)
7980
end
@@ -85,8 +86,8 @@ end
8586
photosynthesis_parameters = clm_photosynthesis_parameters(
8687
domain.space.surface,
8788
),
88-
pc::FT = -2e6,
89-
sc::FT = 5e-6,
89+
sc::FT = LP.get_default_parameter(FT, :low_water_pressure_sensitivity),
90+
pc::FT = LP.get_default_parameter(FT, :moisture_stress_ref_water_pressure),
9091
) where {
9192
FT <: AbstractFloat,
9293
MECH <: Union{FT, ClimaCore.Fields.Field},
@@ -110,8 +111,8 @@ function FarquharModel{FT}(
110111
photosynthesis_parameters = clm_photosynthesis_parameters(
111112
domain.space.surface,
112113
),
113-
sc::FT = FT(5e-6),
114-
pc::FT = FT(-2e6),
114+
sc::FT = LP.get_default_parameter(FT, :low_water_pressure_sensitivity),
115+
pc::FT = LP.get_default_parameter(FT, :moisture_stress_ref_water_pressure),
115116
) where {FT <: AbstractFloat}
116117
(; is_c3, Vcmax25) = photosynthesis_parameters
117118
parameters = FarquharParameters(FT, is_c3; Vcmax25, sc, pc)
@@ -194,6 +195,7 @@ function PlantHydraulicsModel{FT}(
194195
rooting_depth = clm_rooting_depth(domain.space.surface),
195196
transpiration = PlantHydraulics.DiagnosticTranspiration{FT}(),
196197
) where {FT <: AbstractFloat}
198+
# TODO: move hydraulics paramters to ClimaParams.jl so we can call `get_default_parameter`.
197199
@assert n_stem >= 0 "Stem number must be non-negative"
198200
@assert n_leaf >= 0 "Leaf number must be non-negative"
199201
@assert h_stem >= 0 "Stem height must be non-negative"
@@ -301,7 +303,7 @@ end
301303
## Stomatal conductance models
302304
"""
303305
MedlynConductanceModel{FT}(;
304-
g0::FT = FT(1e-4),
306+
g0::FT = LP.get_default_parameter(FT, :min_stomatal_conductance),
305307
g1 = clm_medlyn_g1(domain.space.surface),
306308
) where {FT <: AbstractFloat}
307309
@@ -317,8 +319,8 @@ The following default parameter is used:
317319
"""
318320
function MedlynConductanceModel{FT}(
319321
domain;
320-
g0::FT = FT(1e-4),
321322
g1 = clm_medlyn_g1(domain.space.surface),
323+
g0::FT = LP.get_default_parameter(FT, :min_stomatal_conductance),
322324
) where {FT <: AbstractFloat}
323325
parameters = MedlynConductanceParameters(FT; g0, g1)
324326
return MedlynConductanceModel{FT, typeof(parameters)}(parameters)

src/standalone/Vegetation/canopy_parameterizations.jl

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ end
7171
Computes the PAR and NIR fractional absorbances, reflectances, and tranmittances
7272
for a canopy in the case of the
7373
Beer-Lambert model. The absorbances are a function of the radiative transfer
74-
model, as well as the leaf area index, the clumping index,
74+
model, as well as the leaf area index, the clumping index,
7575
the cosine of the zenith angle, the leaf angle distribution,
7676
the extinction coefficient, and the
7777
soil albedo in the PAR and NIR bands. Returns a
@@ -116,7 +116,7 @@ end
116116
Computes the PAR and NIR fractional absorbances, reflectances, and tranmittances
117117
for a canopy in the case of the
118118
Two-stream model. The absorbances are a function of the radiative transfer
119-
model, as well as the leaf area index, the clumping index,
119+
model, as well as the leaf area index, the clumping index,
120120
the cosine of the zenith angle, the leaf angle distribution,
121121
the extinction coefficient, and the
122122
soil albedo in the PAR and NIR bands.
@@ -799,9 +799,6 @@ This currently takes a leaf conductance (moles per leaf area per second)
799799
and (1) converts it to m/s, (2) upscales to the entire canopy, by assuming
800800
the leaves in the canopy are in parallel and hence multiplying
801801
by LAI.
802-
803-
TODO: Check what CLM does, and check if we can use the same function
804-
for GPP from An, and make more general.
805802
"""
806803
function upscale_leaf_conductance(
807804
gs::FT,
@@ -810,6 +807,8 @@ function upscale_leaf_conductance(
810807
R::FT,
811808
P::FT,
812809
) where {FT}
810+
# TODO: Check what CLM does, and check if we can use the same function
811+
# for GPP from An, and make more general.
813812
canopy_conductance = gs * LAI * (R * T) / P # convert to m s-1
814813
return canopy_conductance
815814
end
@@ -949,7 +948,7 @@ where `VPD` is the vapor pressure deficit in the atmosphere
949948
950949
Note that in supersaturated conditions the vapor pressure deficit will be negative,
951950
which leads to an imaginary Medlyn term `m`. Clipping to zero solves this, but this leads
952-
to division by zero, so we regularize the division by adding a small quantity.
951+
to division by zero, so we regularize the division by adding a small quantity.
953952
954953
An alternative to consider in the future is to compute the inverse of this quantity
955954
and stomatal resistance instead of conductance.

0 commit comments

Comments
 (0)