Skip to content

Commit

Permalink
remove PlantHydraulicsModel
Browse files Browse the repository at this point in the history
  • Loading branch information
Espeer5 committed Jun 2, 2024
1 parent ae41507 commit 2c6f8c7
Show file tree
Hide file tree
Showing 25 changed files with 97 additions and 850 deletions.
1 change: 0 additions & 1 deletion docs/src/APIs/canopy/PlantHydraulics.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ CurrentModule = ClimaLand.PlantHydraulics
## Models

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

Expand Down
4 changes: 0 additions & 4 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
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
12 changes: 5 additions & 7 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 @@ -211,10 +211,8 @@ plant_hydraulics_ps = PlantHydraulics.PlantHydraulicsParameters(;
)
plant_hydraulics_args = (
parameters = plant_hydraulics_ps,
n_stem = n_stem,
n_leaf = n_leaf,
compartment_midpoints = compartment_midpoints,
compartment_surfaces = compartment_surfaces,
h_stem = h_stem,
h_leaf = h_leaf,
)

energy_args = (parameters = Canopy.BigLeafEnergyParameters{FT}(ac_canopy),)
Expand Down Expand Up @@ -276,12 +274,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
12 changes: 5 additions & 7 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 @@ -171,10 +171,8 @@ plant_hydraulics_ps = PlantHydraulics.PlantHydraulicsParameters(;
)
plant_hydraulics_args = (
parameters = plant_hydraulics_ps,
n_stem = n_stem,
n_leaf = n_leaf,
compartment_midpoints = compartment_midpoints,
compartment_surfaces = compartment_surfaces,
h_stem = h_stem,
h_leaf = h_leaf,
)

energy_args = (parameters = Canopy.BigLeafEnergyParameters{FT}(ac_canopy),)
Expand Down Expand Up @@ -236,12 +234,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 @@ -155,10 +153,8 @@ plant_hydraulics_ps = PlantHydraulics.PlantHydraulicsParameters(;
)
plant_hydraulics_args = (
parameters = plant_hydraulics_ps,
n_stem = n_stem,
n_leaf = n_leaf,
compartment_midpoints = compartment_midpoints,
compartment_surfaces = compartment_surfaces,
h_stem = h_stem,
h_leaf = h_leaf,
)

# Canopy component args
Expand Down
12 changes: 3 additions & 9 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 @@ -289,10 +285,8 @@ plant_hydraulics_ps = PlantHydraulics.PlantHydraulicsParameters(;
)
plant_hydraulics_args = (
parameters = plant_hydraulics_ps,
n_stem = n_stem,
n_leaf = n_leaf,
compartment_midpoints = compartment_midpoints,
compartment_surfaces = compartment_surfaces,
h_stem = h_stem,
h_leaf = h_leaf,
)

# 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
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ export vairaranch_default_args
function vairaranch_default_args(;
dz_bottom = FT(1.0),
dz_top = FT(0.05),
n_stem = Int64(0),
n_leaf = Int64(1),
h_leaf = FT(0.7), # m,
h_stem = FT(0), # m,
t0 = Float64(21 * 3600 * 24), # start day 21 of the year,
Expand All @@ -15,8 +13,6 @@ export vairaranch_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 Vaira Ranch site.
function vairaranch_default_args(;
dz_bottom = FT(1.0),
dz_top = FT(0.05),
n_stem = Int64(0),
n_leaf = Int64(1),
h_leaf = FT(0.7), # m,
h_stem = FT(0), # m,
t0 = Float64(21 * 3600 * 24), # start day 21 of the year,
Expand All @@ -41,8 +35,6 @@ function vairaranch_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

0 comments on commit 2c6f8c7

Please sign in to comment.