From 328e3b32c200848ee39669165aa4d1f3e7e0f57d Mon Sep 17 00:00:00 2001 From: Edward Speer Date: Sun, 2 Jun 2024 01:47:17 -0700 Subject: [PATCH] reformat --- src/integrated/soil_canopy_model.jl | 4 +--- src/standalone/Vegetation/Canopy.jl | 2 +- src/standalone/Vegetation/canopy_boundary_fluxes.jl | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/integrated/soil_canopy_model.jl b/src/integrated/soil_canopy_model.jl index 20b1cd506d..92b13171a3 100644 --- a/src/integrated/soil_canopy_model.jl +++ b/src/integrated/soil_canopy_model.jl @@ -257,9 +257,7 @@ function make_update_boundary_fluxes( area_index = p.canopy.hydraulics.area_index - labels = - land.canopy.hydraulics.h_stem > 0 ? [:stem, :leaf] : - [:leaf] + labels = land.canopy.hydraulics.h_stem > 0 ? [:stem, :leaf] : [:leaf] above_ground_area_index = getproperty(area_index, labels[1]) diff --git a/src/standalone/Vegetation/Canopy.jl b/src/standalone/Vegetation/Canopy.jl index 11ce5c8950..f52c9cbd96 100644 --- a/src/standalone/Vegetation/Canopy.jl +++ b/src/standalone/Vegetation/Canopy.jl @@ -548,7 +548,7 @@ function ClimaLand.make_update_aux( T_canopy = canopy_temperature(canopy.energy, canopy, Y, p, t) # update moisture stress - i_end = hydraulics.h_stem > 0 + 1 + i_end = (hydraulics.h_stem > 0 ? 1 : 0) + 1 @. β = moisture_stress(ψ.:($$i_end) * ρ_l * grav, sc, pc) # Update Rd, An, Vcmax25 (if applicable to model) in place diff --git a/src/standalone/Vegetation/canopy_boundary_fluxes.jl b/src/standalone/Vegetation/canopy_boundary_fluxes.jl index 673273e0fd..24c5163e3d 100644 --- a/src/standalone/Vegetation/canopy_boundary_fluxes.jl +++ b/src/standalone/Vegetation/canopy_boundary_fluxes.jl @@ -157,7 +157,7 @@ function canopy_boundary_fluxes!( shf = p.canopy.energy.shf lhf = p.canopy.energy.lhf r_ae = p.canopy.energy.r_ae - i_end = canopy.hydraulics.h_stem > 0 + 1 + i_end = (canopy.hydraulics.h_stem > 0 ? 1 : 0) + 1 # Compute transpiration, SHF, LHF canopy_turbulent_fluxes = turbulent_fluxes(atmos, canopy, Y, p, t)