From 7c8a53cf6b65c2bef7c96f729a82575152425b8d Mon Sep 17 00:00:00 2001 From: Marcos Longo <5891904+mpaiao@users.noreply.github.com> Date: Fri, 7 Jul 2023 08:57:27 -0700 Subject: [PATCH 1/2] Fix EDInitMod.F90 initialisation of drought deciduous variables Two local variables were not initialised before the first time being used (thanks @adrifoster for spotting it!). This PR fixes it. --- main/EDInitMod.F90 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/main/EDInitMod.F90 b/main/EDInitMod.F90 index de0a5be0e5..c5fd5afea1 100644 --- a/main/EDInitMod.F90 +++ b/main/EDInitMod.F90 @@ -847,6 +847,10 @@ subroutine init_cohorts( site_in, patch_in, bc_in) temp_cohort%canopy_trim = 1.0_r8 temp_cohort%crowndamage = 1 ! Assume no damage to begin with + ! Retrieve drop fraction of non-leaf tissues for phenology initialisation + fnrt_drop_fraction = prt_params%phen_fnrt_drop_fraction(pft) + stem_drop_fraction = prt_params%phen_stem_drop_fraction(pft) + ! Initialise phenology variables. spmode_case: select case (hlm_use_sp) From f7776b2d2e4b7d72352b54a71ace19f9bc6f4fcd Mon Sep 17 00:00:00 2001 From: Marcos Longo <5891904+mpaiao@users.noreply.github.com> Date: Fri, 7 Jul 2023 09:16:33 -0700 Subject: [PATCH 2/2] Remove duplicated init of the drought deciduous local variables I forgot to delete the assignment of the local variables when I moved it to the beginning of the `do` loop (thanks @glemieux). --- main/EDInitMod.F90 | 5 ----- 1 file changed, 5 deletions(-) diff --git a/main/EDInitMod.F90 b/main/EDInitMod.F90 index c5fd5afea1..50d2bcf56c 100644 --- a/main/EDInitMod.F90 +++ b/main/EDInitMod.F90 @@ -917,11 +917,6 @@ subroutine init_cohorts( site_in, patch_in, bc_in) temp_cohort%n = temp_cohort%n * sum(site_in%use_this_pft) endif - ! Retrieve drop fraction of non-leaf tissues for phenology initialisation - fnrt_drop_fraction = prt_params%phen_fnrt_drop_fraction(temp_cohort%pft) - stem_drop_fraction = prt_params%phen_stem_drop_fraction(temp_cohort%pft) - - ! h,dbh,leafc,n from SP values or from small initial size. if(hlm_use_sp.eq.itrue)then