From 17971e9042ab3cf358c200d005943ee09fb3f443 Mon Sep 17 00:00:00 2001 From: rosiealice Date: Wed, 8 Apr 2020 10:56:51 -0600 Subject: [PATCH 01/22] basic SP modifications. compiles --- main/EDInitMod.F90 | 7 ++++++- main/EDTypesMod.F90 | 6 +++++- main/FatesInterfaceMod.F90 | 2 ++ 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/main/EDInitMod.F90 b/main/EDInitMod.F90 index 3ce7d083f0..7788ac480c 100644 --- a/main/EDInitMod.F90 +++ b/main/EDInitMod.F90 @@ -38,6 +38,7 @@ module EDInitMod use FatesInterfaceMod , only : bc_in_type use FatesInterfaceMod , only : hlm_use_planthydro use FatesInterfaceMod , only : hlm_use_inventory_init + use FatesInterfaceMod , only : hlm_use_static_biogeog use FatesInterfaceMod , only : numpft use FatesInterfaceMod , only : nleafage use FatesInterfaceMod , only : nlevsclass @@ -122,6 +123,8 @@ subroutine init_site_vars( site_in, bc_in ) allocate(site_in%dz_soil(site_in%nlevsoil)) allocate(site_in%z_soil(site_in%nlevsoil)) + allocate(site_in%area_pft(1:numpft)) + do el=1,num_elements allocate(site_in%flux_diags(el)%leaf_litter_input(1:numpft)) allocate(site_in%flux_diags(el)%root_litter_input(1:numpft)) @@ -134,7 +137,9 @@ subroutine init_site_vars( site_in, bc_in ) site_in%zi_soil(:) = bc_in%zi_sisl(:) site_in%dz_soil(:) = bc_in%dz_sisl(:) site_in%z_soil(:) = bc_in%z_sisl(:) - + + ! PLACEHOLDER FOR PFT AREA DATA MOVED ACROSS INTERFACE + site_in%area_pft(1:4)=0.25_r8 ! end subroutine init_site_vars diff --git a/main/EDTypesMod.F90 b/main/EDTypesMod.F90 index 913c1a8ef5..d37ea33070 100644 --- a/main/EDTypesMod.F90 +++ b/main/EDTypesMod.F90 @@ -659,7 +659,11 @@ module EDTypesMod ! INDICES real(r8) :: lat ! latitude: degrees real(r8) :: lon ! longitude: degrees - + + ! Fixed Biogeography mode inputs + + real(r8), allocatable :: area_PFT(:) ! Area allocated to individual PFTs + ! Mass Balance (allocation for each element) type(site_massbal_type), pointer :: mass_balance(:) diff --git a/main/FatesInterfaceMod.F90 b/main/FatesInterfaceMod.F90 index 8bc84cd8fe..5045ad6909 100644 --- a/main/FatesInterfaceMod.F90 +++ b/main/FatesInterfaceMod.F90 @@ -174,6 +174,8 @@ module FatesInterfaceMod ! This need only be defined when ! hlm_use_inventory_init = 1 + integer, public :: hlm_use_static_biogeog ! Placeholder for the flag the HLM compset will send to FATES when + ! using the fixed biogeography. ! ------------------------------------------------------------------------------------- ! Parameters that are dictated by FATES and known to be required knowledge ! needed by the HLMs From dcc8e58aec31a47d159daadc2af90723abed7b14 Mon Sep 17 00:00:00 2001 From: rosiealice Date: Wed, 8 Apr 2020 11:00:27 -0600 Subject: [PATCH 02/22] adding SBG fix --- main/EDInitMod.F90 | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/main/EDInitMod.F90 b/main/EDInitMod.F90 index 7788ac480c..ce2f086129 100644 --- a/main/EDInitMod.F90 +++ b/main/EDInitMod.F90 @@ -138,8 +138,13 @@ subroutine init_site_vars( site_in, bc_in ) site_in%dz_soil(:) = bc_in%dz_sisl(:) site_in%z_soil(:) = bc_in%z_sisl(:) + ! PLACEHOLDER FOR PFT AREA DATA MOVED ACROSS INTERFACE - site_in%area_pft(1:4)=0.25_r8 + ! Also fixing static biogeog which will become a namelist eventually. + hlm_use_static_biogeog=1 + if(hlm_use_static_biogeog.eq.1)then + site_in%area_pft(1:4)=0.25_r8 + end if ! end subroutine init_site_vars From 2d015c840dcb2d08610a23a056bd7547888135ed Mon Sep 17 00:00:00 2001 From: rosiealice Date: Wed, 8 Apr 2020 14:54:05 -0600 Subject: [PATCH 03/22] added filters on recruitment --- biogeochem/EDPhysiologyMod.F90 | 16 +++++++++++++++- main/EDInitMod.F90 | 1 - main/EDTypesMod.F90 | 2 +- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/biogeochem/EDPhysiologyMod.F90 b/biogeochem/EDPhysiologyMod.F90 index 3e11d37aa9..8f02956775 100644 --- a/biogeochem/EDPhysiologyMod.F90 +++ b/biogeochem/EDPhysiologyMod.F90 @@ -1423,6 +1423,7 @@ subroutine recruitment( currentSite, currentPatch, bc_in ) ! ! !USES: use FatesInterfaceMod, only : hlm_use_ed_prescribed_phys + use FatesInterfaceMod, only : hlm_use_static_biogeog ! ! !ARGUMENTS type(ed_site_type), intent(inout), target :: currentSite @@ -1460,14 +1461,27 @@ subroutine recruitment( currentSite, currentPatch, bc_in ) real(r8) :: mass_demand ! Total mass demanded by the plant to achieve the stoichiometric targets ! of all the organs in the recruits. Used for both [kg per plant] and [kg per cohort] real(r8) :: stem_drop_fraction - + + integer :: use_this_pft(1:numpft) !---------------------------------------------------------------------- allocate(temp_cohort) ! create temporary cohort call zero_cohort(temp_cohort) + do ft = 1,numpft + use_this_pft(ft) = 1 + if(hlm_use_static_biogeog.eq.1)then + if(currentSite%area_pft(ft).gt.0.0_r8)then + use_this_pft(ft) = 1 + else + use_this_pft(ft) = 0 + end if !area + end if !SBG + end do !ft + do ft = 1,numpft + temp_cohort%canopy_trim = 0.8_r8 !starting with the canopy not fully expanded temp_cohort%pft = ft temp_cohort%hite = EDPftvarcon_inst%hgt_min(ft) diff --git a/main/EDInitMod.F90 b/main/EDInitMod.F90 index ce2f086129..28dab155c5 100644 --- a/main/EDInitMod.F90 +++ b/main/EDInitMod.F90 @@ -123,7 +123,6 @@ subroutine init_site_vars( site_in, bc_in ) allocate(site_in%dz_soil(site_in%nlevsoil)) allocate(site_in%z_soil(site_in%nlevsoil)) - allocate(site_in%area_pft(1:numpft)) do el=1,num_elements allocate(site_in%flux_diags(el)%leaf_litter_input(1:numpft)) diff --git a/main/EDTypesMod.F90 b/main/EDTypesMod.F90 index d37ea33070..773b5a603c 100644 --- a/main/EDTypesMod.F90 +++ b/main/EDTypesMod.F90 @@ -662,7 +662,7 @@ module EDTypesMod ! Fixed Biogeography mode inputs - real(r8), allocatable :: area_PFT(:) ! Area allocated to individual PFTs + real(r8) :: area_PFT(maxpft) ! Area allocated to individual PFTs ! Mass Balance (allocation for each element) From edc9c14768d8d5f38fa9554a295f5afbe34e055c Mon Sep 17 00:00:00 2001 From: rosiealice Date: Wed, 8 Apr 2020 15:41:06 -0600 Subject: [PATCH 04/22] mask out recruitment terms --- biogeochem/EDPhysiologyMod.F90 | 25 +++++++++---------------- main/EDInitMod.F90 | 31 +++++++++++++++++++++---------- main/EDTypesMod.F90 | 3 ++- 3 files changed, 32 insertions(+), 27 deletions(-) diff --git a/biogeochem/EDPhysiologyMod.F90 b/biogeochem/EDPhysiologyMod.F90 index 8f02956775..cc75fe96fb 100644 --- a/biogeochem/EDPhysiologyMod.F90 +++ b/biogeochem/EDPhysiologyMod.F90 @@ -1301,7 +1301,7 @@ subroutine SeedIn( currentSite, bc_in ) litt => currentPatch%litter(el) do pft = 1,numpft - + if(currentSite%use_this_pft(pft).eq.1)then ! Seed input from local sources (within site) litt%seed_in_local(pft) = litt%seed_in_local(pft) + site_seed_rain(pft)/area @@ -1312,7 +1312,11 @@ subroutine SeedIn( currentSite, bc_in ) ! Seeds entering externally [kg/site/day] site_mass%seed_in = site_mass%seed_in + seed_in_external*currentPatch%area - + else + litt%seed_in_local(pft)=0.0_r8 + litt%seed_in_extern(pft)=0.0_r8 + site_mass%seed_in=0.0_r8 + endif !use this pft? enddo @@ -1404,6 +1408,7 @@ subroutine SeedGermination( litt, cold_stat, drought_stat ) litt%seed_germ_in(pft) = 0.0_r8 end if + enddo end subroutine SeedGermination @@ -1423,7 +1428,6 @@ subroutine recruitment( currentSite, currentPatch, bc_in ) ! ! !USES: use FatesInterfaceMod, only : hlm_use_ed_prescribed_phys - use FatesInterfaceMod, only : hlm_use_static_biogeog ! ! !ARGUMENTS type(ed_site_type), intent(inout), target :: currentSite @@ -1462,7 +1466,6 @@ subroutine recruitment( currentSite, currentPatch, bc_in ) ! of all the organs in the recruits. Used for both [kg per plant] and [kg per cohort] real(r8) :: stem_drop_fraction - integer :: use_this_pft(1:numpft) !---------------------------------------------------------------------- allocate(temp_cohort) ! create temporary cohort @@ -1470,18 +1473,7 @@ subroutine recruitment( currentSite, currentPatch, bc_in ) do ft = 1,numpft - use_this_pft(ft) = 1 - if(hlm_use_static_biogeog.eq.1)then - if(currentSite%area_pft(ft).gt.0.0_r8)then - use_this_pft(ft) = 1 - else - use_this_pft(ft) = 0 - end if !area - end if !SBG - end do !ft - - do ft = 1,numpft - + if(currentSite%use_this_pft(ft).eq.1)then temp_cohort%canopy_trim = 0.8_r8 !starting with the canopy not fully expanded temp_cohort%pft = ft temp_cohort%hite = EDPftvarcon_inst%hgt_min(ft) @@ -1718,6 +1710,7 @@ subroutine recruitment( currentSite, currentPatch, bc_in ) endif + endif !use_this_pft enddo !pft loop deallocate(temp_cohort) ! delete temporary cohort diff --git a/main/EDInitMod.F90 b/main/EDInitMod.F90 index 28dab155c5..70b5b2b2e5 100644 --- a/main/EDInitMod.F90 +++ b/main/EDInitMod.F90 @@ -138,13 +138,6 @@ subroutine init_site_vars( site_in, bc_in ) site_in%z_soil(:) = bc_in%z_sisl(:) - ! PLACEHOLDER FOR PFT AREA DATA MOVED ACROSS INTERFACE - ! Also fixing static biogeog which will become a namelist eventually. - hlm_use_static_biogeog=1 - if(hlm_use_static_biogeog.eq.1)then - site_in%area_pft(1:4)=0.25_r8 - end if - ! end subroutine init_site_vars @@ -251,6 +244,7 @@ subroutine set_site_properties( nsites, sites ) integer :: cleafoff ! DOY for cold-decid leaf-off, initial guess integer :: dleafoff ! DOY for drought-decid leaf-off, initial guess integer :: dleafon ! DOY for drought-decid leaf-on, initial guess + integer :: ft ! PFT loop !---------------------------------------------------------------------- @@ -293,7 +287,24 @@ subroutine set_site_properties( nsites, sites ) sites(s)%acc_NI = acc_NI sites(s)%NF = 0.0_r8 sites(s)%frac_burnt = 0.0_r8 - + + ! PLACEHOLDER FOR PFT AREA DATA MOVED ACROSS INTERFACE + ! Also fixing static biogeog which will become a namelist eventually. + hlm_use_static_biogeog=1 + if(hlm_use_static_biogeog.eq.1)then + sites(s)%area_pft(1:4) = 0.25_r8 + end if + + do ft = 1,numpft + sites(s)%use_this_pft(ft) = 1 + if(hlm_use_static_biogeog.eq.1)then + if(sites(s)%area_pft(ft).gt.0.0_r8)then + sites(s)%use_this_pft(ft) = 1 + else + sites(s)%use_this_pft(ft) = 0 + end if !area + end if !SBG + end do !ft end do @@ -473,7 +484,7 @@ subroutine init_cohorts( site_in, patch_in, bc_in) patch_in%shortest => null() do pft = 1,numpft - + if(site_in%use_this_pft(pft).eq.1)then if(EDPftvarcon_inst%initd(pft)>1.0E-7) then allocate(temp_cohort) ! temporary cohort @@ -617,7 +628,7 @@ subroutine init_cohorts( site_in, patch_in, bc_in) deallocate(temp_cohort) ! get rid of temporary cohort endif - + endif !use_this_pft enddo !numpft ! Zero the mass flux pools of the new cohorts diff --git a/main/EDTypesMod.F90 b/main/EDTypesMod.F90 index 773b5a603c..f9d915aaad 100644 --- a/main/EDTypesMod.F90 +++ b/main/EDTypesMod.F90 @@ -663,7 +663,8 @@ module EDTypesMod ! Fixed Biogeography mode inputs real(r8) :: area_PFT(maxpft) ! Area allocated to individual PFTs - + integer :: use_this_pft(maxpft) ! Is area_PFT > 0 ? (1=yes, 0=no) + ! Mass Balance (allocation for each element) type(site_massbal_type), pointer :: mass_balance(:) From 7c35d61ed2cf29a0cdf806630ec24b5258012757 Mon Sep 17 00:00:00 2001 From: rosiealice Date: Thu, 9 Apr 2020 01:59:39 -0600 Subject: [PATCH 05/22] added bc_in variable --- main/EDInitMod.F90 | 5 ++--- main/FatesInterfaceMod.F90 | 11 +++++++++++ 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/main/EDInitMod.F90 b/main/EDInitMod.F90 index 70b5b2b2e5..82ba9327f9 100644 --- a/main/EDInitMod.F90 +++ b/main/EDInitMod.F90 @@ -290,14 +290,13 @@ subroutine set_site_properties( nsites, sites ) ! PLACEHOLDER FOR PFT AREA DATA MOVED ACROSS INTERFACE ! Also fixing static biogeog which will become a namelist eventually. - hlm_use_static_biogeog=1 - if(hlm_use_static_biogeog.eq.1)then + if(hlm_use_static_biogeog.eq.itrue)then sites(s)%area_pft(1:4) = 0.25_r8 end if do ft = 1,numpft sites(s)%use_this_pft(ft) = 1 - if(hlm_use_static_biogeog.eq.1)then + if(hlm_use_static_biogeog.eq.itrue)then if(sites(s)%area_pft(ft).gt.0.0_r8)then sites(s)%use_this_pft(ft) = 1 else diff --git a/main/FatesInterfaceMod.F90 b/main/FatesInterfaceMod.F90 index 5045ad6909..f1cadf8c77 100644 --- a/main/FatesInterfaceMod.F90 +++ b/main/FatesInterfaceMod.F90 @@ -471,6 +471,12 @@ module FatesInterfaceMod real(r8),allocatable :: hksat_sisl(:) ! hydraulic conductivity at saturation (mm H2O /s) real(r8),allocatable :: h2o_liq_sisl(:) ! Liquid water mass in each layer (kg/m2) real(r8) :: smpmin_si ! restriction for min of soil potential (mm) + + + ! Fixed biogeography mode + + real(r8), allocatable :: pft_areafrac(:) ! Fractional area of the FATES column occupied by each PFT + end type bc_in_type @@ -795,6 +801,11 @@ subroutine allocate_bcin(bc_in, nlevsoil_in, nlevdecomp_in) allocate(bc_in%h2o_liq_sisl(nlevsoil_in)); bc_in%h2o_liq_sisl = nan end if + hlm_use_static_biogeog=itrue + if(hlm_use_static_biogeog.eq.itrue)then + allocate(bc_in%pft_areafrac(maxpft)) + end if + return end subroutine allocate_bcin From 34cd0af08aa2ee4cc20841fb1379d7b38dd1436b Mon Sep 17 00:00:00 2001 From: rosiealice Date: Thu, 9 Apr 2020 02:41:15 -0600 Subject: [PATCH 06/22] adding bc_in call to set_sites_properties. Ties into changes in HLM --- main/EDTypesMod.F90 | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/main/EDTypesMod.F90 b/main/EDTypesMod.F90 index f9d915aaad..46c7d52b31 100644 --- a/main/EDTypesMod.F90 +++ b/main/EDTypesMod.F90 @@ -661,9 +661,8 @@ module EDTypesMod real(r8) :: lon ! longitude: degrees ! Fixed Biogeography mode inputs - - real(r8) :: area_PFT(maxpft) ! Area allocated to individual PFTs - integer :: use_this_pft(maxpft) ! Is area_PFT > 0 ? (1=yes, 0=no) + real(r8), allocatable :: area_PFT(:) ! Area allocated to individual PFTs + integer, allocatable :: use_this_pft(:) ! Is area_PFT > 0 ? (1=yes, 0=no) ! Mass Balance (allocation for each element) From 0689d955c417f20c76b66213a5801ad32d2bd46d Mon Sep 17 00:00:00 2001 From: rosiealice Date: Thu, 9 Apr 2020 02:42:45 -0600 Subject: [PATCH 07/22] adding bc_in call to set_sites_properties. Ties into changes in HLM --- main/EDInitMod.F90 | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/main/EDInitMod.F90 b/main/EDInitMod.F90 index 82ba9327f9..0c19ddaa0f 100644 --- a/main/EDInitMod.F90 +++ b/main/EDInitMod.F90 @@ -123,6 +123,8 @@ subroutine init_site_vars( site_in, bc_in ) allocate(site_in%dz_soil(site_in%nlevsoil)) allocate(site_in%z_soil(site_in%nlevsoil)) + allocate(site_in%area_pft(1:numpft)) + allocate(site_in%use_this_pft(1:numpft)) do el=1,num_elements allocate(site_in%flux_diags(el)%leaf_litter_input(1:numpft)) @@ -218,10 +220,12 @@ subroutine zero_site( site_in ) ! canopy spread site_in%spread = 0._r8 + site_in%area_pft = 0._r8 + site_in%use_this_pft = fates_unset_int end subroutine zero_site ! ============================================================================ - subroutine set_site_properties( nsites, sites ) + subroutine set_site_properties( nsites, sites,bc_in ) ! ! !DESCRIPTION: ! @@ -231,7 +235,7 @@ subroutine set_site_properties( nsites, sites ) integer, intent(in) :: nsites type(ed_site_type) , intent(inout), target :: sites(nsites) - + type(bc_in_type), intent(in) :: bc_in(nsites) ! ! !LOCAL VARIABLES: integer :: s @@ -288,10 +292,11 @@ subroutine set_site_properties( nsites, sites ) sites(s)%NF = 0.0_r8 sites(s)%frac_burnt = 0.0_r8 - ! PLACEHOLDER FOR PFT AREA DATA MOVED ACROSS INTERFACE - ! Also fixing static biogeog which will become a namelist eventually. + ! PLACEHOLDER FOR PFT AREA DATA MOVED ACROSS INTERFACE if(hlm_use_static_biogeog.eq.itrue)then - sites(s)%area_pft(1:4) = 0.25_r8 + do ft = 1,numpft + sites(s)%area_pft(ft) = bc_in(s)%pft_areafrac(ft) + end do end if do ft = 1,numpft From 020bd97f87f8f9f7f78a0adde6996ba849f72742 Mon Sep 17 00:00:00 2001 From: rosiealice Date: Tue, 14 Apr 2020 13:53:58 -0600 Subject: [PATCH 08/22] changed name of static_biogeog to fates_biogeog --- main/EDInitMod.F90 | 6 +++--- main/FatesInterfaceMod.F90 | 20 ++++++++++++++++---- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/main/EDInitMod.F90 b/main/EDInitMod.F90 index 0c19ddaa0f..98658a713a 100644 --- a/main/EDInitMod.F90 +++ b/main/EDInitMod.F90 @@ -38,7 +38,7 @@ module EDInitMod use FatesInterfaceMod , only : bc_in_type use FatesInterfaceMod , only : hlm_use_planthydro use FatesInterfaceMod , only : hlm_use_inventory_init - use FatesInterfaceMod , only : hlm_use_static_biogeog + use FatesInterfaceMod , only : hlm_use_fixed_biogeog use FatesInterfaceMod , only : numpft use FatesInterfaceMod , only : nleafage use FatesInterfaceMod , only : nlevsclass @@ -293,7 +293,7 @@ subroutine set_site_properties( nsites, sites,bc_in ) sites(s)%frac_burnt = 0.0_r8 ! PLACEHOLDER FOR PFT AREA DATA MOVED ACROSS INTERFACE - if(hlm_use_static_biogeog.eq.itrue)then + if(hlm_use_fixed_biogeog.eq.itrue)then do ft = 1,numpft sites(s)%area_pft(ft) = bc_in(s)%pft_areafrac(ft) end do @@ -301,7 +301,7 @@ subroutine set_site_properties( nsites, sites,bc_in ) do ft = 1,numpft sites(s)%use_this_pft(ft) = 1 - if(hlm_use_static_biogeog.eq.itrue)then + if(hlm_use_fixed_biogeog.eq.itrue)then if(sites(s)%area_pft(ft).gt.0.0_r8)then sites(s)%use_this_pft(ft) = 1 else diff --git a/main/FatesInterfaceMod.F90 b/main/FatesInterfaceMod.F90 index f1cadf8c77..295eb78d15 100644 --- a/main/FatesInterfaceMod.F90 +++ b/main/FatesInterfaceMod.F90 @@ -174,7 +174,7 @@ module FatesInterfaceMod ! This need only be defined when ! hlm_use_inventory_init = 1 - integer, public :: hlm_use_static_biogeog ! Placeholder for the flag the HLM compset will send to FATES when + integer, public :: hlm_use_fixed_biogeog ! Placeholder for the flag the HLM compset will send to FATES when ! using the fixed biogeography. ! ------------------------------------------------------------------------------------- ! Parameters that are dictated by FATES and known to be required knowledge @@ -801,10 +801,8 @@ subroutine allocate_bcin(bc_in, nlevsoil_in, nlevdecomp_in) allocate(bc_in%h2o_liq_sisl(nlevsoil_in)); bc_in%h2o_liq_sisl = nan end if - hlm_use_static_biogeog=itrue - if(hlm_use_static_biogeog.eq.itrue)then allocate(bc_in%pft_areafrac(maxpft)) - end if + return end subroutine allocate_bcin @@ -1479,6 +1477,7 @@ subroutine set_fates_ctrlparms(tag,ival,rval,cval) hlm_use_logging = unset_int hlm_use_ed_st3 = unset_int hlm_use_ed_prescribed_phys = unset_int + hlm_use_fixed_biogeog = unset_int hlm_use_inventory_init = unset_int hlm_inventory_ctrl_file = 'unset' @@ -1679,6 +1678,13 @@ subroutine set_fates_ctrlparms(tag,ival,rval,cval) call endrun(msg=errMsg(sourcefile, __LINE__)) end if + if(hlm_use_fixed_biogeog.eq.unset_int) then + if(fates_global_verbose()) then + write(fates_log(), *) 'switch for fixed biogeog unset: him_use_fixed_biogeog, exiting' + end if + call endrun(msg=errMsg(sourcefile, __LINE__)) + end if + if(hlm_use_cohort_age_tracking .eq. unset_int) then if (fates_global_verbose()) then write(fates_log(), *) 'switch for cohort_age_tracking unset: hlm_use_cohort_age_tracking, exiting' @@ -1762,6 +1768,12 @@ subroutine set_fates_ctrlparms(tag,ival,rval,cval) if (fates_global_verbose()) then write(fates_log(),*) 'Transfering hlm_use_spitfire= ',ival,' to FATES' end if + + case('use_fixed_biogeog') + hlm_use_fixed_biogeog = ival + if (fates_global_verbose()) then + write(fates_log(),*) 'Transfering hlm_use_fixed_biogeog= ',ival,' to FATES' + end if case('use_planthydro') hlm_use_planthydro = ival From 05ac74854a899ff7471cf22d56339065cb0d10d6 Mon Sep 17 00:00:00 2001 From: rosiealice Date: Fri, 17 Apr 2020 12:02:37 -0600 Subject: [PATCH 09/22] fixed restart bug. phew --- biogeochem/EDPhysiologyMod.F90 | 12 +++++------- main/EDInitMod.F90 | 4 ++-- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/biogeochem/EDPhysiologyMod.F90 b/biogeochem/EDPhysiologyMod.F90 index cc75fe96fb..b440d23f04 100644 --- a/biogeochem/EDPhysiologyMod.F90 +++ b/biogeochem/EDPhysiologyMod.F90 @@ -1198,6 +1198,7 @@ subroutine SeedIn( currentSite, bc_in ) ! !USES: use EDTypesMod, only : area use EDTypesMod, only : homogenize_seed_pfts + use FatesInterfaceMod, only : hlm_use_fixed_biogeog ! ! !ARGUMENTS type(ed_site_type), intent(inout), target :: currentSite @@ -1301,22 +1302,18 @@ subroutine SeedIn( currentSite, bc_in ) litt => currentPatch%litter(el) do pft = 1,numpft - if(currentSite%use_this_pft(pft).eq.1)then ! Seed input from local sources (within site) litt%seed_in_local(pft) = litt%seed_in_local(pft) + site_seed_rain(pft)/area ! Seed input from external sources (user param seed rain, or dispersal model) seed_in_external = seed_stoich*EDPftvarcon_inst%seed_suppl(pft)*years_per_day - + if(hlm_use_fixed_biogeog.eq.itrue)then + seed_in_external = 0._r8 + end if litt%seed_in_extern(pft) = litt%seed_in_extern(pft) + seed_in_external ! Seeds entering externally [kg/site/day] site_mass%seed_in = site_mass%seed_in + seed_in_external*currentPatch%area - else - litt%seed_in_local(pft)=0.0_r8 - litt%seed_in_extern(pft)=0.0_r8 - site_mass%seed_in=0.0_r8 - endif !use this pft? enddo @@ -1428,6 +1425,7 @@ subroutine recruitment( currentSite, currentPatch, bc_in ) ! ! !USES: use FatesInterfaceMod, only : hlm_use_ed_prescribed_phys + ! ! !ARGUMENTS type(ed_site_type), intent(inout), target :: currentSite diff --git a/main/EDInitMod.F90 b/main/EDInitMod.F90 index 98658a713a..28d8e04f5c 100644 --- a/main/EDInitMod.F90 +++ b/main/EDInitMod.F90 @@ -220,8 +220,8 @@ subroutine zero_site( site_in ) ! canopy spread site_in%spread = 0._r8 - site_in%area_pft = 0._r8 - site_in%use_this_pft = fates_unset_int + site_in%area_pft(:) = 0._r8 + site_in%use_this_pft(:) = fates_unset_int end subroutine zero_site ! ============================================================================ From 2f506ccea28317ae2fd00fa551c8a178eaab4786 Mon Sep 17 00:00:00 2001 From: rosiealice Date: Mon, 20 Apr 2020 03:39:12 -0600 Subject: [PATCH 10/22] adding use_fates_nocomp switch --- main/EDMainMod.F90 | 4 +++- main/FatesInterfaceMod.F90 | 26 +++++++++++++++++++++++--- 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/main/EDMainMod.F90 b/main/EDMainMod.F90 index 4641aec3e8..0864f102c0 100644 --- a/main/EDMainMod.F90 +++ b/main/EDMainMod.F90 @@ -614,7 +614,7 @@ subroutine TotalBalanceCheck (currentSite, call_index ) type(ed_patch_type) , pointer :: currentPatch type(ed_cohort_type) , pointer :: currentCohort type(litter_type), pointer :: litt - logical, parameter :: print_cohorts = .false. ! Set to true if you want + logical, parameter :: print_cohorts = .true. ! Set to true if you want ! to print cohort data ! upon fail (lots of text) !----------------------------------------------------------------------- @@ -677,6 +677,7 @@ subroutine TotalBalanceCheck (currentSite, call_index ) write(fates_log(),*) 'biomass', biomass_stock write(fates_log(),*) 'litter',litter_stock write(fates_log(),*) 'seeds',seed_stock + write(fates_log(),*) 'total stock', total_stock write(fates_log(),*) 'previous total',site_mass%old_stock write(fates_log(),*) 'lat lon',currentSite%lat,currentSite%lon @@ -694,6 +695,7 @@ subroutine TotalBalanceCheck (currentSite, call_index ) write(fates_log(),*) 'root litter (by layer): ',sum(litt%root_fines,dim=1) write(fates_log(),*) 'dist mode: ',currentPatch%disturbance_mode write(fates_log(),*) 'anthro_disturbance_label: ',currentPatch%anthro_disturbance_label + write(fates_log(),*) 'use_this_pft: ', currentSite%use_this_pft(:) if(print_cohorts)then write(fates_log(),*) '---- Biomass by cohort and organ -----' currentCohort => currentPatch%tallest diff --git a/main/FatesInterfaceMod.F90 b/main/FatesInterfaceMod.F90 index 295eb78d15..1001ef3bd8 100644 --- a/main/FatesInterfaceMod.F90 +++ b/main/FatesInterfaceMod.F90 @@ -174,8 +174,14 @@ module FatesInterfaceMod ! This need only be defined when ! hlm_use_inventory_init = 1 - integer, public :: hlm_use_fixed_biogeog ! Placeholder for the flag the HLM compset will send to FATES when - ! using the fixed biogeography. + integer, public :: hlm_use_fixed_biogeog ! Flag to use FATES fixed biogeography mode + ! 1 = TRUE, 0 = FALSE + + integer, public :: hlm_use_nocomp ! Flag to use FATES no PFT competition mode + ! 1 = TRUE, 0 = FALSE + + + ! ------------------------------------------------------------------------------------- ! Parameters that are dictated by FATES and known to be required knowledge ! needed by the HLMs @@ -474,7 +480,6 @@ module FatesInterfaceMod ! Fixed biogeography mode - real(r8), allocatable :: pft_areafrac(:) ! Fractional area of the FATES column occupied by each PFT @@ -1478,6 +1483,7 @@ subroutine set_fates_ctrlparms(tag,ival,rval,cval) hlm_use_ed_st3 = unset_int hlm_use_ed_prescribed_phys = unset_int hlm_use_fixed_biogeog = unset_int + hlm_use_nocomp = unset_int hlm_use_inventory_init = unset_int hlm_inventory_ctrl_file = 'unset' @@ -1685,6 +1691,13 @@ subroutine set_fates_ctrlparms(tag,ival,rval,cval) call endrun(msg=errMsg(sourcefile, __LINE__)) end if + if(hlm_use_nocomp.eq.unset_int) then + if(fates_global_verbose()) then + write(fates_log(), *) 'switch for no competition mode. ' + end if + call endrun(msg=errMsg(sourcefile, __LINE__)) + end if + if(hlm_use_cohort_age_tracking .eq. unset_int) then if (fates_global_verbose()) then write(fates_log(), *) 'switch for cohort_age_tracking unset: hlm_use_cohort_age_tracking, exiting' @@ -1775,6 +1788,13 @@ subroutine set_fates_ctrlparms(tag,ival,rval,cval) write(fates_log(),*) 'Transfering hlm_use_fixed_biogeog= ',ival,' to FATES' end if + case('use_nocomp') + hlm_use_nocomp = ival + if (fates_global_verbose()) then + write(fates_log(),*) 'Transfering hlm_use_nocomp= ',ival,' to FATES' + end if + + case('use_planthydro') hlm_use_planthydro = ival if (fates_global_verbose()) then From 7a38199487dc460e8f2bf036456a09349de5f8eb Mon Sep 17 00:00:00 2001 From: rosiealice Date: Mon, 20 Apr 2020 03:51:38 -0600 Subject: [PATCH 11/22] turning off print cohorts --- main/EDMainMod.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main/EDMainMod.F90 b/main/EDMainMod.F90 index 0864f102c0..1b520e56c3 100644 --- a/main/EDMainMod.F90 +++ b/main/EDMainMod.F90 @@ -614,7 +614,7 @@ subroutine TotalBalanceCheck (currentSite, call_index ) type(ed_patch_type) , pointer :: currentPatch type(ed_cohort_type) , pointer :: currentCohort type(litter_type), pointer :: litt - logical, parameter :: print_cohorts = .true. ! Set to true if you want + logical, parameter :: print_cohorts = .false. ! Set to true if you want ! to print cohort data ! upon fail (lots of text) !----------------------------------------------------------------------- From c0ceb918d20ae973e24d122cd58ae5a4faf02dc6 Mon Sep 17 00:00:00 2001 From: rosiealice Date: Fri, 24 Apr 2020 10:03:22 -0600 Subject: [PATCH 12/22] changes to use itrue and ifalse --- biogeochem/EDPhysiologyMod.F90 | 2 +- main/EDInitMod.F90 | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/biogeochem/EDPhysiologyMod.F90 b/biogeochem/EDPhysiologyMod.F90 index b440d23f04..0cab8b57e2 100644 --- a/biogeochem/EDPhysiologyMod.F90 +++ b/biogeochem/EDPhysiologyMod.F90 @@ -1471,7 +1471,7 @@ subroutine recruitment( currentSite, currentPatch, bc_in ) do ft = 1,numpft - if(currentSite%use_this_pft(ft).eq.1)then + if(currentSite%use_this_pft(ft).eq.itrue)then temp_cohort%canopy_trim = 0.8_r8 !starting with the canopy not fully expanded temp_cohort%pft = ft temp_cohort%hite = EDPftvarcon_inst%hgt_min(ft) diff --git a/main/EDInitMod.F90 b/main/EDInitMod.F90 index 28d8e04f5c..d820181c78 100644 --- a/main/EDInitMod.F90 +++ b/main/EDInitMod.F90 @@ -300,12 +300,12 @@ subroutine set_site_properties( nsites, sites,bc_in ) end if do ft = 1,numpft - sites(s)%use_this_pft(ft) = 1 + sites(s)%use_this_pft(ft) = itrue if(hlm_use_fixed_biogeog.eq.itrue)then if(sites(s)%area_pft(ft).gt.0.0_r8)then - sites(s)%use_this_pft(ft) = 1 + sites(s)%use_this_pft(ft) = itrue else - sites(s)%use_this_pft(ft) = 0 + sites(s)%use_this_pft(ft) = ifalse end if !area end if !SBG end do !ft @@ -488,7 +488,7 @@ subroutine init_cohorts( site_in, patch_in, bc_in) patch_in%shortest => null() do pft = 1,numpft - if(site_in%use_this_pft(pft).eq.1)then + if(site_in%use_this_pft(pft).eq.itrue)then if(EDPftvarcon_inst%initd(pft)>1.0E-7) then allocate(temp_cohort) ! temporary cohort From e39ad3fd98d2fcf1434f06edee4972e8a0d6dc97 Mon Sep 17 00:00:00 2001 From: rosiealice Date: Mon, 27 Apr 2020 03:45:57 -0600 Subject: [PATCH 13/22] adding restart capability for use_this_pft --- biogeochem/EDCanopyStructureMod.F90 | 2 +- biogeochem/EDPhysiologyMod.F90 | 7 +++--- main/EDTypesMod.F90 | 2 +- main/FatesRestartInterfaceMod.F90 | 33 +++++++++++++++++++++++++++-- 4 files changed, 36 insertions(+), 8 deletions(-) diff --git a/biogeochem/EDCanopyStructureMod.F90 b/biogeochem/EDCanopyStructureMod.F90 index acf7a9edd0..4bdb462b04 100644 --- a/biogeochem/EDCanopyStructureMod.F90 +++ b/biogeochem/EDCanopyStructureMod.F90 @@ -1592,7 +1592,7 @@ subroutine leaf_area_profile( currentSite , snow_depth_si, frac_sno_eff_si) if(snow_depth_avg>= minh(iv).and.snow_depth_avg <= maxh(iv))then !only partly hidden... fraction_exposed = max(0._r8,(min(1.0_r8,(snow_depth_avg-minh(iv))/dh))) endif - fraction_exposed = 1.0_r8 + ! fraction_exposed = 1.0_r8 ! no m2 of leaf per m2 of ground in each height class ! FIX(SPM,032414) these should be uncommented this and double check diff --git a/biogeochem/EDPhysiologyMod.F90 b/biogeochem/EDPhysiologyMod.F90 index 0cab8b57e2..bc141c04ae 100644 --- a/biogeochem/EDPhysiologyMod.F90 +++ b/biogeochem/EDPhysiologyMod.F90 @@ -1,4 +1,4 @@ -module EDPhysiologyMod + EDPhysiologyMod #include "shr_assert.h" @@ -1302,18 +1302,17 @@ subroutine SeedIn( currentSite, bc_in ) litt => currentPatch%litter(el) do pft = 1,numpft + if(currentSite%use_this_pft(pft).eq.itrue)then ! Seed input from local sources (within site) litt%seed_in_local(pft) = litt%seed_in_local(pft) + site_seed_rain(pft)/area ! Seed input from external sources (user param seed rain, or dispersal model) seed_in_external = seed_stoich*EDPftvarcon_inst%seed_suppl(pft)*years_per_day - if(hlm_use_fixed_biogeog.eq.itrue)then - seed_in_external = 0._r8 - end if litt%seed_in_extern(pft) = litt%seed_in_extern(pft) + seed_in_external ! Seeds entering externally [kg/site/day] site_mass%seed_in = site_mass%seed_in + seed_in_external*currentPatch%area + end if !use this pft enddo diff --git a/main/EDTypesMod.F90 b/main/EDTypesMod.F90 index 46c7d52b31..819fadd830 100644 --- a/main/EDTypesMod.F90 +++ b/main/EDTypesMod.F90 @@ -32,7 +32,7 @@ module EDTypesMod ! are not the top canopy layer) integer, parameter, public :: nlevleaf = 30 ! number of leaf layers in canopy layer - integer, parameter, public :: maxpft = 15 ! maximum number of PFTs allowed + integer, parameter, public :: maxpft = 16 ! maximum number of PFTs allowed ! the parameter file may determine that fewer ! are used, but this helps allocate scratch ! space and output arrays. diff --git a/main/FatesRestartInterfaceMod.F90 b/main/FatesRestartInterfaceMod.F90 index b578e8c52f..5ea5c615a9 100644 --- a/main/FatesRestartInterfaceMod.F90 +++ b/main/FatesRestartInterfaceMod.F90 @@ -151,6 +151,8 @@ module FatesRestartInterfaceMod integer :: ir_seed_bank_sift integer :: ir_spread_si integer :: ir_recrate_sift + integer :: ir_use_this_pft_sift + integer :: ir_area_pft_sift integer :: ir_fmortrate_cano_siscpf integer :: ir_fmortrate_usto_siscpf integer :: ir_imortrate_siscpf @@ -176,7 +178,6 @@ module FatesRestartInterfaceMod integer :: ir_errfates_mbal integer :: ir_prt_base ! Base index for all PRT variables - ! Hydraulic indices integer :: ir_hydro_th_ag_covec integer :: ir_hydro_th_troot_covec @@ -1004,6 +1005,17 @@ subroutine define_restart_vars(this, initialize_variables) units='indiv/ha/day', flushval = flushzero, & hlms='CLM:ALM', initialize=initialize_variables, ivar=ivar, index = ir_recrate_sift) + call this%set_restart_var(vname='fates_use_this_pft', vtype=cohort_int, & !should this be cohort_int as above? + long_name='in fixed biogeog mode, is pft in gridcell?', & + units='0/1', flushval = flushzero, & + hlms='CLM:ALM', initialize=initialize_variables, ivar=ivar, index = ir_use_this_pft_sift) + + call this%set_restart_var(vname='fates_area_pft', vtype=cohort_r8, & + long_name='in fixed biogeog mode, what is pft area in gridcell?', & + units='0/1', flushval = flushzero, & + hlms='CLM:ALM', initialize=initialize_variables, ivar=ivar, index = ir_area_pft_sift) + + call this%set_restart_var(vname='fates_fmortrate_canopy', vtype=cohort_r8, & long_name='fates diagnostics on fire mortality canopy', & units='indiv/ha/year', flushval = flushzero, & @@ -1532,6 +1544,8 @@ subroutine set_restart_vectors(this,nc,nsites,sites) rio_watermem_siwm => this%rvars(ir_watermem_siwm)%r81d, & rio_vegtempmem_sitm => this%rvars(ir_vegtempmem_sitm)%r81d, & rio_recrate_sift => this%rvars(ir_recrate_sift)%r81d, & + rio_use_this_pft_sift => this%rvars(ir_use_this_pft_sift)%int1d, & + rio_area_pft_sift => this%rvars(ir_area_pft_sift)%r81d, & rio_fmortrate_cano_siscpf => this%rvars(ir_fmortrate_cano_siscpf)%r81d, & rio_fmortrate_usto_siscpf => this%rvars(ir_fmortrate_usto_siscpf)%r81d, & rio_imortrate_siscpf => this%rvars(ir_imortrate_siscpf)%r81d, & @@ -1587,6 +1601,14 @@ subroutine set_restart_vectors(this,nc,nsites,sites) rio_recrate_sift(io_idx_co_1st+i_pft-1) = sites(s)%recruitment_rate(i_pft) end do + do i_pft = 1,numpft + rio_use_this_pft_sift(io_idx_co_1st+i_pft-1) = sites(s)%use_this_pft(i_pft) + end do + + do i_pft = 1,numpft + rio_area_pft_sift(io_idx_co_1st+i_pft-1) = sites(s)%area_pft(i_pft) + end do + do el = 1, num_elements io_idx_si_cwd = io_idx_co_1st @@ -2270,6 +2292,8 @@ subroutine get_restart_vectors(this, nc, nsites, sites) rio_watermem_siwm => this%rvars(ir_watermem_siwm)%r81d, & rio_vegtempmem_sitm => this%rvars(ir_vegtempmem_sitm)%r81d, & rio_recrate_sift => this%rvars(ir_recrate_sift)%r81d, & + rio_use_this_pft_sift => this%rvars(ir_use_this_pft_sift)%int1d, & + rio_area_pft_sift => this%rvars(ir_area_pft_sift)%r81d,& rio_fmortrate_cano_siscpf => this%rvars(ir_fmortrate_cano_siscpf)%r81d, & rio_fmortrate_usto_siscpf => this%rvars(ir_fmortrate_usto_siscpf)%r81d, & rio_imortrate_siscpf => this%rvars(ir_imortrate_siscpf)%r81d, & @@ -2313,7 +2337,12 @@ subroutine get_restart_vectors(this, nc, nsites, sites) do i_pft = 1,numpft sites(s)%recruitment_rate(i_pft) = rio_recrate_sift(io_idx_co_1st+i_pft-1) enddo - + + !variables for fixed biogeography mode. These are currently used in restart even when this is off. + do i_pft = 1,numpft + sites(s)%use_this_pft(i_pft) = rio_use_this_pft_sift(io_idx_co_1st+i_pft-1) + sites(s)%area_pft(i_pft) = rio_area_pft_sift(io_idx_co_1st+i_pft-1) + enddo ! Mass balance and diagnostics across elements at the site level do el = 1, num_elements From 691f4cf8e91898469176485d4e59b7d610ff0409 Mon Sep 17 00:00:00 2001 From: rosiealice Date: Mon, 27 Apr 2020 04:02:38 -0600 Subject: [PATCH 14/22] typo in EDphys --- biogeochem/EDPhysiologyMod.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/biogeochem/EDPhysiologyMod.F90 b/biogeochem/EDPhysiologyMod.F90 index bc141c04ae..78c50c0f93 100644 --- a/biogeochem/EDPhysiologyMod.F90 +++ b/biogeochem/EDPhysiologyMod.F90 @@ -1,4 +1,4 @@ - EDPhysiologyMod +module EDPhysiologyMod #include "shr_assert.h" From 347270b5d8182d6ff101c38d4d24f277f665b42a Mon Sep 17 00:00:00 2001 From: rosiealice Date: Mon, 27 Apr 2020 04:05:57 -0600 Subject: [PATCH 15/22] roll back snow change --- biogeochem/EDCanopyStructureMod.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/biogeochem/EDCanopyStructureMod.F90 b/biogeochem/EDCanopyStructureMod.F90 index 4bdb462b04..acf7a9edd0 100644 --- a/biogeochem/EDCanopyStructureMod.F90 +++ b/biogeochem/EDCanopyStructureMod.F90 @@ -1592,7 +1592,7 @@ subroutine leaf_area_profile( currentSite , snow_depth_si, frac_sno_eff_si) if(snow_depth_avg>= minh(iv).and.snow_depth_avg <= maxh(iv))then !only partly hidden... fraction_exposed = max(0._r8,(min(1.0_r8,(snow_depth_avg-minh(iv))/dh))) endif - ! fraction_exposed = 1.0_r8 + fraction_exposed = 1.0_r8 ! no m2 of leaf per m2 of ground in each height class ! FIX(SPM,032414) these should be uncommented this and double check From 9876102cf6b683397641e1ed74eaa73f0d22aa1d Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Tue, 19 May 2020 11:40:12 -0700 Subject: [PATCH 16/22] making set_bcs public as it was missed in PR647 --- main/FatesInterfaceMod.F90 | 1 + 1 file changed, 1 insertion(+) diff --git a/main/FatesInterfaceMod.F90 b/main/FatesInterfaceMod.F90 index 24ecd9ea2b..2361c835d6 100644 --- a/main/FatesInterfaceMod.F90 +++ b/main/FatesInterfaceMod.F90 @@ -76,6 +76,7 @@ module FatesInterfaceMod public :: allocate_bcin public :: allocate_bcout public :: zero_bcs + public :: set_bcs contains From 87de44662e6af2ca203ab0163a03bee5317749ac Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Tue, 19 May 2020 11:48:57 -0700 Subject: [PATCH 17/22] removing dead code from PR647 --- main/EDInitMod.F90 | 1 - 1 file changed, 1 deletion(-) diff --git a/main/EDInitMod.F90 b/main/EDInitMod.F90 index b34f838598..ab86f65aec 100644 --- a/main/EDInitMod.F90 +++ b/main/EDInitMod.F90 @@ -35,7 +35,6 @@ module EDInitMod use EDTypesMod , only : phen_dstat_moistoff use EDTypesMod , only : phen_cstat_notcold use EDTypesMod , only : phen_dstat_moiston - use EDTypesMod , only : element_pos use FatesInterfaceTypesMod , only : bc_in_type use FatesInterfaceTypesMod , only : hlm_use_planthydro use FatesInterfaceTypesMod , only : hlm_use_inventory_init From 9b7f66c7ccba3d0b17f5b735abd4eb6b8875994a Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Tue, 19 May 2020 13:56:13 -0600 Subject: [PATCH 18/22] reinstating pft_areafrac to FatesInterfaceTypeMod after it was deleted in deconflict --- main/FatesInterfaceTypesMod.F90 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/main/FatesInterfaceTypesMod.F90 b/main/FatesInterfaceTypesMod.F90 index ecc1624ec0..69465d1784 100644 --- a/main/FatesInterfaceTypesMod.F90 +++ b/main/FatesInterfaceTypesMod.F90 @@ -423,7 +423,10 @@ module FatesInterfaceTypesMod real(r8),allocatable :: hksat_sisl(:) ! hydraulic conductivity at saturation (mm H2O /s) real(r8),allocatable :: h2o_liq_sisl(:) ! Liquid water mass in each layer (kg/m2) real(r8) :: smpmin_si ! restriction for min of soil potential (mm) - + + ! Fixed biogeography mode + real(r8), allocatable :: pft_areafrac(:) ! Fractional area of the FATES column occupied by each PFT + end type bc_in_type From b235e967897e5fee03a0223d0576fb53530cc7f6 Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Tue, 19 May 2020 14:08:46 -0600 Subject: [PATCH 19/22] reinstating hlm_use_fixed_biogeog to FatesInterfaceTypeMod after being trampled in merge deconflict --- main/FatesInterfaceTypesMod.F90 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/main/FatesInterfaceTypesMod.F90 b/main/FatesInterfaceTypesMod.F90 index 69465d1784..1b3dce4bd8 100644 --- a/main/FatesInterfaceTypesMod.F90 +++ b/main/FatesInterfaceTypesMod.F90 @@ -133,6 +133,9 @@ module FatesInterfaceTypesMod ! This need only be defined when ! hlm_use_inventory_init = 1 + integer, public :: hlm_use_fixed_biogeog ! Flag to use FATES fixed biogeography mode + ! 1 = TRUE, 0 = FALSE + ! ------------------------------------------------------------------------------------- ! Parameters that are dictated by FATES and known to be required knowledge ! needed by the HLMs From 66c2cc8094cc1e3e68d34f719928d6cee8b452c3 Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Tue, 19 May 2020 14:24:38 -0600 Subject: [PATCH 20/22] commenting out nocomp for future reduced complexity mode --- main/FatesInterfaceMod.F90 | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/main/FatesInterfaceMod.F90 b/main/FatesInterfaceMod.F90 index 2361c835d6..1fddc28def 100644 --- a/main/FatesInterfaceMod.F90 +++ b/main/FatesInterfaceMod.F90 @@ -991,7 +991,7 @@ subroutine set_fates_ctrlparms(tag,ival,rval,cval) hlm_use_ed_st3 = unset_int hlm_use_ed_prescribed_phys = unset_int hlm_use_fixed_biogeog = unset_int - hlm_use_nocomp = unset_int + !hlm_use_nocomp = unset_int ! future reduced complexity mode hlm_use_inventory_init = unset_int hlm_inventory_ctrl_file = 'unset' @@ -1199,12 +1199,13 @@ subroutine set_fates_ctrlparms(tag,ival,rval,cval) call endrun(msg=errMsg(sourcefile, __LINE__)) end if - if(hlm_use_nocomp.eq.unset_int) then - if(fates_global_verbose()) then - write(fates_log(), *) 'switch for no competition mode. ' - end if - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if + ! Future reduced complexity mode + !if(hlm_use_nocomp.eq.unset_int) then + ! if(fates_global_verbose()) then + ! write(fates_log(), *) 'switch for no competition mode. ' + ! end if + ! call endrun(msg=errMsg(sourcefile, __LINE__)) + ! end if if(hlm_use_cohort_age_tracking .eq. unset_int) then if (fates_global_verbose()) then @@ -1295,12 +1296,13 @@ subroutine set_fates_ctrlparms(tag,ival,rval,cval) if (fates_global_verbose()) then write(fates_log(),*) 'Transfering hlm_use_fixed_biogeog= ',ival,' to FATES' end if - - case('use_nocomp') - hlm_use_nocomp = ival - if (fates_global_verbose()) then - write(fates_log(),*) 'Transfering hlm_use_nocomp= ',ival,' to FATES' - end if + + ! Future reduced complexity mode + !case('use_nocomp') + ! hlm_use_nocomp = ival + ! if (fates_global_verbose()) then + ! write(fates_log(),*) 'Transfering hlm_use_nocomp= ',ival,' to FATES' + ! end if case('use_planthydro') From 111e24cb961e39eeb59afa705ba17b2ed8fb9653 Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Tue, 19 May 2020 14:36:27 -0600 Subject: [PATCH 21/22] commenting out what looks like future code --- biogeochem/EDPhysiologyMod.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/biogeochem/EDPhysiologyMod.F90 b/biogeochem/EDPhysiologyMod.F90 index c4a6d8b765..7f58c73514 100644 --- a/biogeochem/EDPhysiologyMod.F90 +++ b/biogeochem/EDPhysiologyMod.F90 @@ -1206,7 +1206,7 @@ subroutine SeedIn( currentSite, bc_in ) ! !USES: use EDTypesMod, only : area use EDTypesMod, only : homogenize_seed_pfts - use FatesInterfaceMod, only : hlm_use_fixed_biogeog + !use FatesInterfaceTypesMod, only : hlm_use_fixed_biogeog ! For future reduced complexity? ! ! !ARGUMENTS type(ed_site_type), intent(inout), target :: currentSite From 0ffab8bb75e88d05c822711a7808038dbf5a5dd8 Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Tue, 19 May 2020 14:44:40 -0600 Subject: [PATCH 22/22] reinstating hlm_use_fixed_biogeog to EDInitMod that got trampled during merge --- main/EDInitMod.F90 | 1 + 1 file changed, 1 insertion(+) diff --git a/main/EDInitMod.F90 b/main/EDInitMod.F90 index ab86f65aec..646084ef1b 100644 --- a/main/EDInitMod.F90 +++ b/main/EDInitMod.F90 @@ -38,6 +38,7 @@ module EDInitMod use FatesInterfaceTypesMod , only : bc_in_type use FatesInterfaceTypesMod , only : hlm_use_planthydro use FatesInterfaceTypesMod , only : hlm_use_inventory_init + use FatesInterfaceTypesMod , only : hlm_use_fixed_biogeog use FatesInterfaceTypesMod , only : numpft use FatesInterfaceTypesMod , only : nleafage use FatesInterfaceTypesMod , only : nlevsclass