From c2f9fb85273109ed365d15bbe3d514e729e74908 Mon Sep 17 00:00:00 2001 From: Marcos Longo <5891904+mpaiao@users.noreply.github.com> Date: Thu, 12 Mar 2026 08:09:38 -0300 Subject: [PATCH] Bug fix: conditional logic for wood_rwc calculation I found this bug whilst looking for some code that could cause the crash in issue #430. The `if` block had no `else` clause, which could leave the variable undefined. The proposed fix follows the same logic for calculating `leaf_rwc` in the same sub-routine . Fixing this bug does not solve the problem in issue #430 according to @sdeherto, but this is still needs correction. --- ED/src/dynamics/plant_hydro.f90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ED/src/dynamics/plant_hydro.f90 b/ED/src/dynamics/plant_hydro.f90 index ac3d85269..e5551b7a0 100644 --- a/ED/src/dynamics/plant_hydro.f90 +++ b/ED/src/dynamics/plant_hydro.f90 @@ -1396,7 +1396,7 @@ subroutine tw2rwc(leaf_water_int,wood_water_int,is_small,bleaf,bsapwooda,bsapwoo wood_rwc = wood_water_int / tot_water_sat elseif (is_small) then wood_rwc = op_buff * small_rwc_min(ipft) - elseif (is_small) then + else wood_rwc = op_buff * wood_rwc_min(ipft) end if !------------------------------------------------------------------------------------!