Skip to content

Commit

Permalink
remove compartment_surfaces
Browse files Browse the repository at this point in the history
  • Loading branch information
Espeer5 committed Jun 2, 2024
1 parent 328e3b3 commit e4cfba4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/standalone/Vegetation/Canopy.jl
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,7 @@ function ClimaLand.make_update_aux(
areaip1 = getproperty(area_index, labels[ip1])

midpoint = hydraulics.h_stem / 2
midpointip1 = hydraulics.h_stem + (model.h_leaf / 2)
midpointip1 = hydraulics.h_stem + (hydraulics.h_leaf / 2)

# Compute the flux*area between the current compartment `i`
# and the compartment above.
Expand Down Expand Up @@ -568,7 +568,7 @@ function ClimaLand.make_update_aux(
@. GPP = compute_GPP(An, K, LAI, Ω)
@. gs = medlyn_conductance(g0, Drel, medlyn_factor, An, c_co2_air)
# update autotrophic respiration
h_canopy = hydraulics.compartment_surfaces[end]
h_canopy = hydraulics.h_stem + hydraulics.h_leaf
@. Ra = compute_autrophic_respiration(
canopy.autotrophic_respiration,
Vcmax25,
Expand Down
2 changes: 1 addition & 1 deletion src/standalone/Vegetation/PlantHydraulics.jl
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,7 @@ function root_water_flux_per_ground_area!(
t,
) where {FT}
(; conductivity_model, root_distribution) = model.parameters
area_index = p.canopy.hydraulics, area_index
area_index = p.canopy.hydraulics.area_index
# We can index into a field of Tuple{FT} to extract a field of FT
# using the following notation: field.:index
ψ_base = p.canopy.hydraulics.ψ.:1
Expand Down
6 changes: 3 additions & 3 deletions src/standalone/Vegetation/canopy_boundary_fluxes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ model.
See Cowan 1968; Brutsaert 1982, pp. 113–116; Campbell and Norman 1998, p. 71; Shuttleworth 2012, p. 343; Monteith and Unsworth 2013, p. 304.
"""
function ClimaLand.displacement_height(model::CanopyModel{FT}, Y, p) where {FT}
return FT(0.67) * model.hydraulics.compartment_surfaces[end]
return FT(0.67) * (model.hydraulics.h_stem + model.hydraulics.h_leaf)
end

"""
Expand Down Expand Up @@ -68,8 +68,8 @@ end
A helper function which returns the surface height for the canopy
model, which is stored in the parameter struct.
"""
function ClimaLand.surface_height(model::CanopyModel, _...)
return model.hydraulics.compartment_surfaces[1]
function ClimaLand.surface_height(model::CanopyModel{FT}, _...) where {FT}
return FT(0.0)
end

"""
Expand Down

0 comments on commit e4cfba4

Please sign in to comment.