From c9ab29bef534c27f086ffac362efe9634817dbeb Mon Sep 17 00:00:00 2001 From: Edward Speer Date: Sun, 2 Jun 2024 01:44:36 -0700 Subject: [PATCH] fix loop index bug --- src/standalone/Vegetation/Canopy.jl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/standalone/Vegetation/Canopy.jl b/src/standalone/Vegetation/Canopy.jl index f057ab69ba..11ce5c8950 100644 --- a/src/standalone/Vegetation/Canopy.jl +++ b/src/standalone/Vegetation/Canopy.jl @@ -505,8 +505,9 @@ function ClimaLand.make_update_aux( # field.:($index) .= value # works # @ field.:($$index) = value # works labels = hydraulics.h_stem > 0 ? [:stem, :leaf] : [:leaf] - @inbounds for i in eachindex(labels) - ip1 = i + 1 + if hydraulics.h_stem > 0 + i = 1 + ip1 = 2 @. ψ.:($$ip1) = PlantHydraulics.water_retention_curve( retention_model, PlantHydraulics.effective_saturation(ν, ϑ_l.:($$ip1)),