From b4415079927843cb752d2d6e6131c96c406f20a7 Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Wed, 4 Dec 2024 10:49:31 -0700 Subject: [PATCH 1/2] moved the passing of the use_luh2 flag to fates earlier in the sequence to allow memory allocation handling --- src/utils/clmfates_interfaceMod.F90 | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/utils/clmfates_interfaceMod.F90 b/src/utils/clmfates_interfaceMod.F90 index 269189d1b7..d580615cbc 100644 --- a/src/utils/clmfates_interfaceMod.F90 +++ b/src/utils/clmfates_interfaceMod.F90 @@ -305,6 +305,7 @@ subroutine CLMFatesGlobals1(surf_numpft,surf_numcft,maxsoil_patches) integer :: pass_nocomp integer :: pass_sp integer :: pass_masterproc + integer :: pass_luh logical :: verbose_output type(fates_param_reader_ctsm_impl) :: var_reader @@ -348,6 +349,14 @@ subroutine CLMFatesGlobals1(surf_numpft,surf_numcft,maxsoil_patches) end if call set_fates_ctrlparms('masterproc',ival=pass_masterproc) + ! FATES landuse modes + if(use_fates_luh) then + pass_luh = 1 + else + pass_luh = 0 + end if + call set_fates_ctrlparms('use_luh2',ival=pass_luh) + end if @@ -540,16 +549,12 @@ subroutine CLMFatesGlobals2() ! FATES landuse modes if(use_fates_luh) then - pass_use_luh = 1 pass_num_luh_states = num_landuse_state_vars pass_num_luh_transitions = num_landuse_transition_vars else - pass_use_luh = 0 pass_num_luh_states = 0 pass_num_luh_transitions = 0 end if - - call set_fates_ctrlparms('use_luh2',ival=pass_use_luh) call set_fates_ctrlparms('num_luh2_states',ival=pass_num_luh_states) call set_fates_ctrlparms('num_luh2_transitions',ival=pass_num_luh_transitions) From 4bff2f28473af91f3b3fb248c360eb4985653cb6 Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Wed, 4 Dec 2024 12:15:26 -0700 Subject: [PATCH 2/2] updated naming convention of local variables --- src/utils/clmfates_interfaceMod.F90 | 33 ++++++++++++++--------------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/src/utils/clmfates_interfaceMod.F90 b/src/utils/clmfates_interfaceMod.F90 index d580615cbc..bee69cce45 100644 --- a/src/utils/clmfates_interfaceMod.F90 +++ b/src/utils/clmfates_interfaceMod.F90 @@ -301,11 +301,11 @@ subroutine CLMFatesGlobals1(surf_numpft,surf_numcft,maxsoil_patches) integer,intent(in) :: surf_numpft integer,intent(in) :: surf_numcft integer,intent(out) :: maxsoil_patches - integer :: pass_biogeog - integer :: pass_nocomp - integer :: pass_sp + integer :: pass_use_fixed_biogeog + integer :: pass_use_nocomp + integer :: pass_use_sp integer :: pass_masterproc - integer :: pass_luh + integer :: pass_use_luh2 logical :: verbose_output type(fates_param_reader_ctsm_impl) :: var_reader @@ -322,25 +322,25 @@ subroutine CLMFatesGlobals1(surf_numpft,surf_numcft,maxsoil_patches) ! Send parameters individually if(use_fates_fixed_biogeog)then - pass_biogeog = 1 + pass_use_fixed_biogeog = 1 else - pass_biogeog = 0 + pass_use_fixed_biogeog = 0 end if - call set_fates_ctrlparms('use_fixed_biogeog',ival=pass_biogeog) + call set_fates_ctrlparms('use_fixed_biogeog',ival=pass_use_fixed_biogeog) if(use_fates_nocomp)then - pass_nocomp = 1 + pass_use_nocomp = 1 else - pass_nocomp = 0 + pass_use_nocomp = 0 end if - call set_fates_ctrlparms('use_nocomp',ival=pass_nocomp) + call set_fates_ctrlparms('use_nocomp',ival=pass_use_nocomp) if(use_fates_sp)then - pass_sp = 1 + pass_use_sp = 1 else - pass_sp = 0 + pass_use_sp = 0 end if - call set_fates_ctrlparms('use_sp',ival=pass_sp) + call set_fates_ctrlparms('use_sp',ival=pass_use_sp) if(masterproc)then pass_masterproc = 1 @@ -351,11 +351,11 @@ subroutine CLMFatesGlobals1(surf_numpft,surf_numcft,maxsoil_patches) ! FATES landuse modes if(use_fates_luh) then - pass_luh = 1 + pass_use_luh2 = 1 else - pass_luh = 0 + pass_use_luh2 = 0 end if - call set_fates_ctrlparms('use_luh2',ival=pass_luh) + call set_fates_ctrlparms('use_luh2',ival=pass_use_luh2) end if @@ -404,7 +404,6 @@ subroutine CLMFatesGlobals2() integer :: pass_is_restart integer :: pass_cohort_age_tracking integer :: pass_tree_damage - integer :: pass_use_luh integer :: pass_use_potentialveg integer :: pass_num_luh_states integer :: pass_num_luh_transitions