From e4cfba419282c3df3fc22aa53fc16a55a05baaf5 Mon Sep 17 00:00:00 2001 From: Edward Speer Date: Sun, 2 Jun 2024 10:38:54 -0700 Subject: [PATCH] remove compartment_surfaces --- src/standalone/Vegetation/Canopy.jl | 4 ++-- src/standalone/Vegetation/PlantHydraulics.jl | 2 +- src/standalone/Vegetation/canopy_boundary_fluxes.jl | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/standalone/Vegetation/Canopy.jl b/src/standalone/Vegetation/Canopy.jl index f52c9cbd96..9b22bc748e 100644 --- a/src/standalone/Vegetation/Canopy.jl +++ b/src/standalone/Vegetation/Canopy.jl @@ -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. @@ -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, diff --git a/src/standalone/Vegetation/PlantHydraulics.jl b/src/standalone/Vegetation/PlantHydraulics.jl index 1c06a82a4d..c3b001935c 100644 --- a/src/standalone/Vegetation/PlantHydraulics.jl +++ b/src/standalone/Vegetation/PlantHydraulics.jl @@ -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 diff --git a/src/standalone/Vegetation/canopy_boundary_fluxes.jl b/src/standalone/Vegetation/canopy_boundary_fluxes.jl index 24c5163e3d..690e22aa9b 100644 --- a/src/standalone/Vegetation/canopy_boundary_fluxes.jl +++ b/src/standalone/Vegetation/canopy_boundary_fluxes.jl @@ -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 """ @@ -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 """