Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add single-layer BigLeafHydraulics Model #619

Draft
wants to merge 10 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/src/APIs/canopy/PlantHydraulics.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ CurrentModule = ClimaLand.PlantHydraulics
## Models

```@docs
ClimaLand.PlantHydraulics.PlantHydraulicsModel
ClimaLand.PlantHydraulics.BigLeafHydraulicsModel
```

## Plant Hydraulics Diagnostic Variables
Expand Down
15 changes: 3 additions & 12 deletions docs/tutorials/integrated/soil_canopy_tutorial.jl
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,8 @@ f_root_to_shoot = FT(3.5)
SAI = FT(0.00242)
maxLAI = FT(4.2)
plant_ν = FT(2.46e-4)
n_stem = Int64(1)
n_leaf = Int64(1)
h_stem = FT(9)
h_leaf = FT(9.5)
compartment_midpoints = [h_stem / 2, h_stem + h_leaf / 2]
compartment_surfaces = [zmax, h_stem, h_stem + h_leaf]
land_domain = Column(; zlim = (zmin, zmax), nelements = nelements);

# - We will be using prescribed atmospheric and radiative drivers from the
Expand Down Expand Up @@ -215,7 +211,7 @@ canopy_component_types = (;
radiative_transfer = Canopy.TwoStreamModel{FT},
photosynthesis = Canopy.FarquharModel{FT},
conductance = Canopy.MedlynConductanceModel{FT},
hydraulics = Canopy.PlantHydraulicsModel{FT},
hydraulics = Canopy.BigLeafHydraulicsModel{FT},
);

# Then provide arguments to the canopy radiative transfer, stomatal conductance,
Expand Down Expand Up @@ -270,13 +266,8 @@ plant_hydraulics_ps = PlantHydraulics.PlantHydraulicsParameters(;
retention_model = retention_model,
)

plant_hydraulics_args = (
parameters = plant_hydraulics_ps,
n_stem = n_stem,
n_leaf = n_leaf,
compartment_midpoints = compartment_midpoints,
compartment_surfaces = compartment_surfaces,
);
plant_hydraulics_args =
(parameters = plant_hydraulics_ps, h_stem = h_stem, h_leaf = h_leaf);

# We may now collect all of the canopy component argument tuples into one
# arguments tuple for the canopy component models.
Expand Down
12 changes: 3 additions & 9 deletions docs/tutorials/standalone/Canopy/canopy_tutorial.jl
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,8 @@ f_root_to_shoot = FT(3.5)
SAI = FT(0.00242)
maxLAI = FT(4.2)
plant_ν = FT(2.46e-4) # kg/m^2
n_stem = Int64(1)
n_leaf = Int64(1)
h_stem = FT(9)
h_leaf = FT(9.5)
compartment_midpoints = [h_stem / 2, h_stem + h_leaf / 2]
compartment_surfaces = [zmax, h_stem, h_stem + h_leaf]
land_domain = Point(; z_sfc = FT(0.0))

# - We will be using prescribed atmospheric and radiative drivers from the
Expand Down Expand Up @@ -233,12 +229,10 @@ plant_hydraulics_ps = PlantHydraulics.PlantHydraulicsParameters(;

# Define the remaining variables required for the plant hydraulics model.

plant_hydraulics = PlantHydraulics.PlantHydraulicsModel{FT}(;
plant_hydraulics = PlantHydraulics.BigLeafHydraulicsModel{FT}(;
parameters = plant_hydraulics_ps,
n_stem = n_stem,
n_leaf = n_leaf,
compartment_surfaces = compartment_surfaces,
compartment_midpoints = compartment_midpoints,
h_stem = h_stem,
h_leaf = h_leaf,
);

# Now, instantiate the canopy model, using the atmospheric and radiative
Expand Down
2 changes: 0 additions & 2 deletions experiments/integrated/fluxnet/US-Ha1/US-Ha1_simulation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ dz_bottom = FT(1.5)
dz_top = FT(0.025)

# Stem and leaf compartments and their heights:
n_stem = Int64(1)
n_leaf = Int64(1)
h_leaf = FT(12) # m
h_stem = FT(14) # m

Expand Down
2 changes: 0 additions & 2 deletions experiments/integrated/fluxnet/US-MOz/US-MOz_simulation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ dz_bottom = FT(1.5)
dz_top = FT(0.025)

# Stem and leaf compartments and their heights:
n_stem = Int64(1)
n_leaf = Int64(1)
h_stem = FT(9) # m
h_leaf = FT(9.5) # m

Expand Down
2 changes: 0 additions & 2 deletions experiments/integrated/fluxnet/US-NR1/US-NR1_simulation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ dz_bottom = FT(1.25)
dz_top = FT(0.05)

# Stem and leaf compartments and their heights:
n_stem = Int64(1)
n_leaf = Int64(1)
h_leaf = FT(6.5) # m
h_stem = FT(7.5) # m

Expand Down
2 changes: 0 additions & 2 deletions experiments/integrated/fluxnet/US-Var/US-Var_simulation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ dz_bottom = FT(1.0)
dz_top = FT(0.05)

# Stem and leaf compartments and their heights:
n_stem = Int64(0)
n_leaf = Int64(1)
h_leaf = FT(0.7) # m
h_stem = FT(0) # m

Expand Down
3 changes: 0 additions & 3 deletions experiments/integrated/fluxnet/fluxnet_domain.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ nelements = 20
zmin = FT(-10)
zmax = FT(0)
h_canopy = h_stem + h_leaf
compartment_midpoints =
n_stem > 0 ? [h_stem / 2, h_stem + h_leaf / 2] : [h_leaf / 2]
compartment_surfaces = n_stem > 0 ? [zmax, h_stem, h_canopy] : [zmax, h_leaf]

land_domain = Column(;
zlim = (zmin, zmax),
Expand Down
15 changes: 5 additions & 10 deletions experiments/integrated/fluxnet/ozark_pft.jl
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ canopy_component_types = (;
radiative_transfer = Canopy.TwoStreamModel{FT},
photosynthesis = Canopy.FarquharModel{FT},
conductance = Canopy.MedlynConductanceModel{FT},
hydraulics = Canopy.PlantHydraulicsModel{FT},
hydraulics = Canopy.BigLeafHydraulicsModel{FT},
energy = Canopy.BigLeafEnergyModel{FT},
)
# Individual Component arguments
Expand Down Expand Up @@ -209,13 +209,8 @@ plant_hydraulics_ps = PlantHydraulics.PlantHydraulicsParameters(;
conductivity_model = conductivity_model,
retention_model = retention_model,
)
plant_hydraulics_args = (
parameters = plant_hydraulics_ps,
n_stem = n_stem,
n_leaf = n_leaf,
compartment_midpoints = compartment_midpoints,
compartment_surfaces = compartment_surfaces,
)
plant_hydraulics_args =
(parameters = plant_hydraulics_ps, h_stem = h_stem, h_leaf = h_leaf)

energy_args = (parameters = Canopy.BigLeafEnergyParameters{FT}(ac_canopy),)

Expand Down Expand Up @@ -276,12 +271,12 @@ Y.soil.ρe_int =
Y.soilco2.C .= FT(0.000412) # set to atmospheric co2, mol co2 per mol air
ψ_stem_0 = FT(-1e5 / 9800) # pressure in the leaf divided by rho_liquid*gravitational acceleration [m]
ψ_leaf_0 = FT(-2e5 / 9800)
ψ_comps = n_stem > 0 ? [ψ_stem_0, ψ_leaf_0] : ψ_leaf_0
ψ_comps = h_stem > 0 ? [ψ_stem_0, ψ_leaf_0] : ψ_leaf_0

S_l_ini =
inverse_water_retention_curve.(retention_model, ψ_comps, plant_ν, plant_S_s)

for i in 1:(n_stem + n_leaf)
for i in 1:(h_stem < 0 + 1)
Y.canopy.hydraulics.ϑ_l.:($i) .=
augmented_liquid_fraction.(plant_ν, S_l_ini[i])
end
Expand Down
15 changes: 5 additions & 10 deletions experiments/integrated/fluxnet/run_fluxnet.jl
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ canopy_component_types = (;
radiative_transfer = Canopy.TwoStreamModel{FT},
photosynthesis = Canopy.FarquharModel{FT},
conductance = Canopy.MedlynConductanceModel{FT},
hydraulics = Canopy.PlantHydraulicsModel{FT},
hydraulics = Canopy.BigLeafHydraulicsModel{FT},
energy = Canopy.BigLeafEnergyModel{FT},
)
# Individual Component arguments
Expand Down Expand Up @@ -169,13 +169,8 @@ plant_hydraulics_ps = PlantHydraulics.PlantHydraulicsParameters(;
conductivity_model = conductivity_model,
retention_model = retention_model,
)
plant_hydraulics_args = (
parameters = plant_hydraulics_ps,
n_stem = n_stem,
n_leaf = n_leaf,
compartment_midpoints = compartment_midpoints,
compartment_surfaces = compartment_surfaces,
)
plant_hydraulics_args =
(parameters = plant_hydraulics_ps, h_stem = h_stem, h_leaf = h_leaf)

energy_args = (parameters = Canopy.BigLeafEnergyParameters{FT}(ac_canopy),)

Expand Down Expand Up @@ -236,12 +231,12 @@ Y.soil.ρe_int =
Y.soilco2.C .= FT(0.000412) # set to atmospheric co2, mol co2 per mol air
ψ_stem_0 = FT(-1e5 / 9800) # pressure in the leaf divided by rho_liquid*gravitational acceleration [m]
ψ_leaf_0 = FT(-2e5 / 9800)
ψ_comps = n_stem > 0 ? [ψ_stem_0, ψ_leaf_0] : ψ_leaf_0
ψ_comps = h_stem > 0 ? [ψ_stem_0, ψ_leaf_0] : ψ_leaf_0

S_l_ini =
inverse_water_retention_curve.(retention_model, ψ_comps, plant_ν, plant_S_s)

for i in 1:(n_stem + n_leaf)
for i in 1:(h_stem > 0 + 1)
Y.canopy.hydraulics.ϑ_l.:($i) .=
augmented_liquid_fraction.(plant_ν, S_l_ini[i])
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ dz_bottom = FT(1.5)
dz_top = FT(0.025)

# Stem and leaf compartments and their heights:
n_stem = Int64(1)
n_leaf = Int64(1)
h_stem = FT(9) # m
h_leaf = FT(9.5) # m

Expand Down Expand Up @@ -112,7 +110,7 @@ canopy_component_types = (;
radiative_transfer = Canopy.TwoStreamModel{FT},
photosynthesis = Canopy.FarquharModel{FT},
conductance = Canopy.MedlynConductanceModel{FT},
hydraulics = Canopy.PlantHydraulicsModel{FT},
hydraulics = Canopy.BigLeafHydraulicsModel{FT},
energy = Canopy.BigLeafEnergyModel{FT},
)
# Individual Component arguments
Expand Down Expand Up @@ -153,13 +151,8 @@ plant_hydraulics_ps = PlantHydraulics.PlantHydraulicsParameters(;
conductivity_model = conductivity_model,
retention_model = retention_model,
)
plant_hydraulics_args = (
parameters = plant_hydraulics_ps,
n_stem = n_stem,
n_leaf = n_leaf,
compartment_midpoints = compartment_midpoints,
compartment_surfaces = compartment_surfaces,
)
plant_hydraulics_args =
(parameters = plant_hydraulics_ps, h_stem = h_stem, h_leaf = h_leaf)

# Canopy component args
canopy_component_args = (;
Expand Down
15 changes: 3 additions & 12 deletions experiments/integrated/performance/profile_allocations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -86,14 +86,10 @@ dz_bottom = FT(2.0)
dz_top = FT(0.2)
soil_depth = FT(5)
z_sfc = FT(0)
n_stem = Int64(1)
n_leaf = Int64(1)
h_stem = FT(9) # m
h_leaf = FT(9.5) # m

h_canopy = h_stem + h_leaf
compartment_midpoints = [h_stem / 2, h_stem + h_leaf / 2]
compartment_surfaces = [z_sfc, h_stem, h_canopy]

land_domain = ClimaLand.Domains.SphericalShell(;
radius = FT(6.3781e6),
Expand Down Expand Up @@ -258,7 +254,7 @@ canopy_component_types = (;
radiative_transfer = Canopy.TwoStreamModel{FT},
photosynthesis = Canopy.FarquharModel{FT},
conductance = Canopy.MedlynConductanceModel{FT},
hydraulics = Canopy.PlantHydraulicsModel{FT},
hydraulics = Canopy.BigLeafHydraulicsModel{FT},
energy = Canopy.BigLeafEnergyModel{FT},
)
# Individual Component arguments
Expand Down Expand Up @@ -287,13 +283,8 @@ plant_hydraulics_ps = PlantHydraulics.PlantHydraulicsParameters(;
conductivity_model = conductivity_model,
retention_model = retention_model,
)
plant_hydraulics_args = (
parameters = plant_hydraulics_ps,
n_stem = n_stem,
n_leaf = n_leaf,
compartment_midpoints = compartment_midpoints,
compartment_surfaces = compartment_surfaces,
)
plant_hydraulics_args =
(parameters = plant_hydraulics_ps, h_stem = h_stem, h_leaf = h_leaf)

# Canopy component args
canopy_component_args = (;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ export harvard_default_args
function harvard_default_args(;
dz_bottom = FT(1.5),
dz_top = FT(0.025),
n_stem = Int64(1),
n_leaf = Int64(1),
h_leaf = FT(12), # m
h_stem = FT(14), # m
t0 = Float64(120 * 3600 * 24),
Expand All @@ -15,8 +13,6 @@ export harvard_default_args
return (
dz_bottom = dz_bottom,
dz_top = dz_top,
n_stem = n_stem,
n_leaf = n_leaf,
h_stem = h_stem,
h_leaf = h_leaf,
t0 = t0,
Expand All @@ -30,8 +26,6 @@ Named Tuple containing default simulation parameter for the Harvard site.
function harvard_default_args(;
dz_bottom = FT(1.5),
dz_top = FT(0.025),
n_stem = Int64(1),
n_leaf = Int64(1),
h_leaf = FT(12), # m
h_stem = FT(14), # m
t0 = Float64(120 * 3600 * 24),
Expand All @@ -41,8 +35,6 @@ function harvard_default_args(;
return (
dz_bottom = dz_bottom,
dz_top = dz_top,
n_stem = n_stem,
n_leaf = n_leaf,
h_stem = h_stem,
h_leaf = h_leaf,
t0 = t0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ export ozark_default_args
function ozark_default_args(;
dz_bottom = FT(1.5),
dz_top = FT(0.025),
n_stem = Int64(1),
n_leaf = Int64(1),
h_stem = FT(9),
h_leaf = FT(9.5),
t0 = Float64(120 * 3600 * 24),
Expand All @@ -15,8 +13,6 @@ export ozark_default_args
return (
dz_bottom = dz_bottom,
dz_top = dz_top,
n_stem = n_stem,
n_leaf = n_leaf,
h_stem = h_stem,
h_leaf = h_leaf,
t0 = t0,
Expand All @@ -30,8 +26,6 @@ Named Tuple containing default simulation parameter for the Ozark site.
function ozark_default_args(;
dz_bottom = FT(1.5),
dz_top = FT(0.025),
n_stem = Int64(1),
n_leaf = Int64(1),
h_stem = FT(9),
h_leaf = FT(9.5),
t0 = Float64(120 * 3600 * 24),
Expand All @@ -41,8 +35,6 @@ function ozark_default_args(;
return (
dz_bottom = dz_bottom,
dz_top = dz_top,
n_stem = n_stem,
n_leaf = n_leaf,
h_stem = h_stem,
h_leaf = h_leaf,
t0 = t0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ export niwotridge_default_args
function niwotridge_default_args(;
dz_bottom = FT(1.25),
dz_top = FT(0.05),
n_stem = Int64(1),
n_leaf = Int64(1),
h_leaf = FT(6.5), # m,
h_stem = FT(7.5), # m,
t0 = Float64(120 * 3600 * 24), # start mid year to avoid snow,
Expand All @@ -15,8 +13,6 @@ export niwotridge_default_args
return (
dz_bottom = dz_bottom,
dz_top = dz_top,
n_stem = n_stem,
n_leaf = n_leaf,
h_stem = h_stem,
h_leaf = h_leaf,
t0 = t0,
Expand All @@ -30,8 +26,6 @@ Named Tuple containing default simulation parameter for the Niwot Ridge site.
function niwotridge_default_args(;
dz_bottom = FT(1.25),
dz_top = FT(0.05),
n_stem = Int64(1),
n_leaf = Int64(1),
h_leaf = FT(6.5), # m,
h_stem = FT(7.5), # m,
t0 = Float64(120 * 3600 * 24), # start mid year to avoid snow,
Expand All @@ -41,8 +35,6 @@ function niwotridge_default_args(;
return (
dz_bottom = dz_bottom,
dz_top = dz_top,
n_stem = n_stem,
n_leaf = n_leaf,
h_stem = h_stem,
h_leaf = h_leaf,
t0 = t0,
Expand Down
Loading
Loading