From 7d378d24864b5667348b9fd3e25f70a7c58226bc Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Thu, 7 May 2020 16:04:53 -0700 Subject: [PATCH 1/8] fates interface refactor. this interface refactor is intended to consolidate the initialization sequence, and also reduce fates side circular dependencies. This also fixes a bug where some parteh structures were not being passed to this history dimensions properly. --- src/main/clm_initializeMod.F90 | 7 +- src/main/decompInitMod.F90 | 2 +- src/utils/clmfates_interfaceMod.F90 | 283 +++++++++++++++------------- 3 files changed, 162 insertions(+), 130 deletions(-) diff --git a/src/main/clm_initializeMod.F90 b/src/main/clm_initializeMod.F90 index 73c71f90d9..e740d82e04 100644 --- a/src/main/clm_initializeMod.F90 +++ b/src/main/clm_initializeMod.F90 @@ -24,7 +24,7 @@ module clm_initializeMod use PatchType , only : patch ! instance use reweightMod , only : reweight_wrapup use filterMod , only : allocFilters, filter - use FatesInterfaceMod, only : set_fates_global_elements + use CLMFatesInterfaceMod, only : CLMFatesGlobals use clm_instMod use SoilMoistureStreamMod, only : PrescribedSoilMoistureInit @@ -186,9 +186,10 @@ subroutine initialize1( ) ! ! (Note: fates_maxELementsPerSite is the critical variable used by CLM ! to allocate space) + ! This also sets up various global constants in FATES ! ------------------------------------------------------------------------ - - call set_fates_global_elements(use_fates) + + call CLMFatesGlobals() ! ------------------------------------------------------------------------ ! Determine decomposition of subgrid scale landunits, columns, patches diff --git a/src/main/decompInitMod.F90 b/src/main/decompInitMod.F90 index c6b8e1764b..1e2b61e106 100644 --- a/src/main/decompInitMod.F90 +++ b/src/main/decompInitMod.F90 @@ -20,7 +20,7 @@ module decompInitMod use glcBehaviorMod , only : glc_behavior_type use decompMod use mct_mod , only : mct_gsMap_init, mct_gsMap_ngseg, mct_gsMap_nlseg, mct_gsmap_gsize - use FatesInterfaceMod, only : fates_maxElementsPerSite + use FatesInterfaceTypesMod, only : fates_maxElementsPerSite ! ! !PUBLIC TYPES: implicit none diff --git a/src/utils/clmfates_interfaceMod.F90 b/src/utils/clmfates_interfaceMod.F90 index 1263e67d63..edff17fb3c 100644 --- a/src/utils/clmfates_interfaceMod.F90 +++ b/src/utils/clmfates_interfaceMod.F90 @@ -45,6 +45,7 @@ module CLMFatesInterfaceMod use clm_varctl , only : iulog use clm_varctl , only : use_vertsoilc use clm_varctl , only : fates_parteh_mode + use clm_varctl , only : use_fates use clm_varctl , only : use_fates_spitfire use clm_varctl , only : use_fates_planthydro use clm_varctl , only : use_fates_cohort_age_tracking @@ -98,9 +99,12 @@ module CLMFatesInterfaceMod ! use SoilWaterPlantSinkMod, only : Compute_EffecRootFrac_And_VertTranSink_Default ! Used FATES Modules - use FatesInterfaceMod , only : fates_interface_type + use FatesInterfaceTypesMod , only : fates_interface_type + use FatesInterfaceMod, only : FatesInterfaceInit, FatesReportParameters + use FatesInterfaceMod, only : SetFatesGlobalElements use FatesInterfaceMod , only : allocate_bcin use FatesInterfaceMod , only : allocate_bcout + use FatesInterfaceMod , only : zero_bcs use FatesInterfaceMod , only : SetFatesTime use FatesInterfaceMod , only : set_fates_ctrlparms @@ -110,14 +114,13 @@ module CLMFatesInterfaceMod use EDTypesMod , only : ed_patch_type use EDTypesMod , only : num_elements - use FatesInterfaceMod , only : hlm_numlevgrnd + use FatesInterfaceTypesMod , only : hlm_numlevgrnd use EDMainMod , only : ed_ecosystem_dynamics use EDMainMod , only : ed_update_site use EDInitMod , only : zero_site use EDInitMod , only : init_site_vars use EDInitMod , only : init_patches use EDInitMod , only : set_site_properties - use EDInitMod , only : InitFatesGlobals use EDPftVarcon , only : EDpftvarcon_inst use EDSurfaceRadiationMod , only : ED_SunShadeFracs, ED_Norman_Radiation use EDBtranMod , only : btran_ed, & @@ -129,7 +132,6 @@ module CLMFatesInterfaceMod use FatesPlantHydraulicsMod, only : hydraulics_drive use FatesPlantHydraulicsMod, only : HydrSiteColdStart use FatesPlantHydraulicsMod, only : InitHydrSites - use FatesPlantHydraulicsMod, only : UpdateH2OVeg use FatesPlantHydraulicsMod, only : RestartHydrStates implicit none @@ -203,9 +205,151 @@ module CLMFatesInterfaceMod character(len=*), parameter, private :: sourcefile = & __FILE__ - -contains + public :: CLMFatesGlobals + + contains + + + subroutine CLMFatesGlobals() + + ! -------------------------------------------------------------------------------- + ! This is one of the first calls to fates + ! Used for setting dimensions. This MUST + ! be called after NL variables are specified and + ! after the FATES parameter file has been read in + ! Aside from setting global dimension info, which + ! is used in the history file, we also transfer + ! over the NL variables to FATES global settings. + ! -------------------------------------------------------------------------------- + + logical :: verbose_output + integer :: pass_masterproc + integer :: pass_vertsoilc + integer :: pass_spitfire + integer :: pass_ed_st3 + integer :: pass_logging + integer :: pass_ed_prescribed_phys + integer :: pass_planthydro + integer :: pass_inventory_init + integer :: pass_is_restart + integer :: pass_cohort_age_tracking + + if (use_fates) then + + verbose_output = .false. + call FatesInterfaceInit(iulog, verbose_output) + + ! Force FATES parameters that are recieve type, to the unset value + call set_fates_ctrlparms('flush_to_unset') + + ! Send parameters individually + call set_fates_ctrlparms('num_sw_bbands',ival=numrad) + call set_fates_ctrlparms('vis_sw_index',ival=ivis) + call set_fates_ctrlparms('nir_sw_index',ival=inir) + + call set_fates_ctrlparms('num_lev_ground',ival=nlevgrnd) + call set_fates_ctrlparms('hlm_name',cval='CLM') + call set_fates_ctrlparms('hio_ignore_val',rval=spval) + call set_fates_ctrlparms('soilwater_ipedof',ival=get_ipedof(0)) + call set_fates_ctrlparms('max_patch_per_site',ival=(natpft_size-1)) + + call set_fates_ctrlparms('parteh_mode',ival=fates_parteh_mode) + + if(is_restart()) then + pass_is_restart = 1 + else + pass_is_restart = 0 + end if + call set_fates_ctrlparms('is_restart',ival=pass_is_restart) + + if(use_vertsoilc) then + pass_vertsoilc = 1 + else + pass_vertsoilc = 0 + end if + call set_fates_ctrlparms('use_vertsoilc',ival=pass_vertsoilc) + + if(use_fates_spitfire) then + pass_spitfire = 1 + else + pass_spitfire = 0 + end if + call set_fates_ctrlparms('use_spitfire',ival=pass_spitfire) + + if(use_fates_ed_st3) then + pass_ed_st3 = 1 + else + pass_ed_st3 = 0 + end if + call set_fates_ctrlparms('use_ed_st3',ival=pass_ed_st3) + + if(use_fates_logging) then + pass_logging = 1 + else + pass_logging = 0 + end if + call set_fates_ctrlparms('use_logging',ival=pass_logging) + + if(use_fates_ed_prescribed_phys) then + pass_ed_prescribed_phys = 1 + else + pass_ed_prescribed_phys = 0 + end if + call set_fates_ctrlparms('use_ed_prescribed_phys',ival=pass_ed_prescribed_phys) + + if(use_fates_planthydro) then + pass_planthydro = 1 + else + pass_planthydro = 0 + end if + call set_fates_ctrlparms('use_planthydro',ival=pass_planthydro) + + if(use_fates_cohort_age_tracking) then + pass_cohort_age_tracking = 1 + else + pass_cohort_age_tracking = 0 + end if + call set_fates_ctrlparms('use_cohort_age_tracking',ival=pass_cohort_age_tracking) + + if(use_fates_inventory_init) then + pass_inventory_init = 1 + else + pass_inventory_init = 0 + end if + call set_fates_ctrlparms('use_inventory_init',ival=pass_inventory_init) + + call set_fates_ctrlparms('inventory_ctrl_file',cval=fates_inventory_ctrl_filename) + + if(masterproc)then + pass_masterproc = 1 + else + pass_masterproc = 0 + end if + call set_fates_ctrlparms('masterproc',ival=pass_masterproc) + + ! Check through FATES parameters to see if all have been set + call set_fates_ctrlparms('check_allset') + + end if + + ! This determines the total amount of space it requires in its largest + ! dimension. We are currently calling that the "cohort" dimension, but + ! it is really a utility dimension that captures the models largest + ! size need. + ! Sets: + ! fates_maxElementsPerPatch + ! num_elements + ! fates_maxElementsPerSite (where a site is roughly equivalent to a column) + ! (Note: this needs to be called when use_fates=.false. as well, becuase + ! it will return some nominal dimension sizes of 1 + + call SetFatesGlobalElements(use_fates) + + return + end subroutine CLMFatesGlobals + + ! ==================================================================================== subroutine init(this, bounds_proc ) @@ -226,8 +370,7 @@ subroutine init(this, bounds_proc ) ! is not turned on ! --------------------------------------------------------------------------------- - use FatesInterfaceMod, only : FatesInterfaceInit, FatesReportParameters - use FatesInterfaceMod, only : numpft_fates => numpft + use FatesInterfaceTypesMod, only : numpft_fates => numpft use FatesParameterDerivedMod, only : param_derived implicit none @@ -238,7 +381,7 @@ subroutine init(this, bounds_proc ) ! local variables integer :: nclumps ! Number of threads - logical :: verbose_output + integer :: pass_masterproc integer :: pass_vertsoilc integer :: pass_spitfire @@ -268,113 +411,11 @@ subroutine init(this, bounds_proc ) ! Parameter Routines call param_derived%Init( numpft_fates ) - - - verbose_output = .false. - call FatesInterfaceInit(iulog, verbose_output) nclumps = get_proc_clumps() allocate(this%fates(nclumps)) allocate(this%f2hmap(nclumps)) - ! --------------------------------------------------------------------------------- - ! Send dimensions and other model controling parameters to FATES. These - ! are obviously only those parameters that are dictated by the host - ! --------------------------------------------------------------------------------- - - ! Force FATES parameters that are recieve type, to the unset value - call set_fates_ctrlparms('flush_to_unset') - - ! Send parameters individually - call set_fates_ctrlparms('num_sw_bbands',ival=numrad) - call set_fates_ctrlparms('vis_sw_index',ival=ivis) - call set_fates_ctrlparms('nir_sw_index',ival=inir) - - call set_fates_ctrlparms('num_lev_ground',ival=nlevgrnd) - call set_fates_ctrlparms('hlm_name',cval='CLM') - call set_fates_ctrlparms('hio_ignore_val',rval=spval) - call set_fates_ctrlparms('soilwater_ipedof',ival=get_ipedof(0)) - call set_fates_ctrlparms('max_patch_per_site',ival=(natpft_size-1)) ! RGK: FATES IGNORES - ! AND DOESNT TOUCH - ! THE BARE SOIL PATCH - call set_fates_ctrlparms('parteh_mode',ival=fates_parteh_mode) - - - if(is_restart()) then - pass_is_restart = 1 - else - pass_is_restart = 0 - end if - call set_fates_ctrlparms('is_restart',ival=pass_is_restart) - - if(use_vertsoilc) then - pass_vertsoilc = 1 - else - pass_vertsoilc = 0 - end if - call set_fates_ctrlparms('use_vertsoilc',ival=pass_vertsoilc) - - if(use_fates_spitfire) then - pass_spitfire = 1 - else - pass_spitfire = 0 - end if - call set_fates_ctrlparms('use_spitfire',ival=pass_spitfire) - - if(use_fates_ed_st3) then - pass_ed_st3 = 1 - else - pass_ed_st3 = 0 - end if - call set_fates_ctrlparms('use_ed_st3',ival=pass_ed_st3) - - if(use_fates_ed_prescribed_phys) then - pass_ed_prescribed_phys = 1 - else - pass_ed_prescribed_phys = 0 - end if - call set_fates_ctrlparms('use_ed_prescribed_phys',ival=pass_ed_prescribed_phys) - - if(use_fates_planthydro) then - pass_planthydro = 1 - else - pass_planthydro = 0 - end if - call set_fates_ctrlparms('use_planthydro',ival=pass_planthydro) - - if(use_fates_cohort_age_tracking) then - pass_cohort_age_tracking = 1 - else - pass_cohort_age_tracking = 0 - end if - call set_fates_ctrlparms('use_cohort_age_tracking',ival=pass_cohort_age_tracking) - - if(use_fates_logging) then - pass_logging = 1 - else - pass_logging = 0 - end if - call set_fates_ctrlparms('use_logging',ival=pass_logging) - - if(use_fates_inventory_init) then - pass_inventory_init = 1 - else - pass_inventory_init = 0 - end if - call set_fates_ctrlparms('use_inventory_init',ival=pass_inventory_init) - - call set_fates_ctrlparms('inventory_ctrl_file',cval=fates_inventory_ctrl_filename) - - - if(masterproc)then - pass_masterproc = 1 - else - pass_masterproc = 0 - end if - call set_fates_ctrlparms('masterproc',ival=pass_masterproc) - - ! Check through FATES parameters to see if all have been set - call set_fates_ctrlparms('check_allset') if(debug)then write(iulog,*) 'clm_fates%init(): allocating for ',nclumps,' threads' @@ -464,7 +505,7 @@ subroutine init(this, bounds_proc ) call allocate_bcin(this%fates(nc)%bc_in(s),col%nbedrock(c),ndecomp) call allocate_bcout(this%fates(nc)%bc_out(s),col%nbedrock(c),ndecomp) - call this%fates(nc)%zero_bcs(s) + call zero_bcs(this%fates(nc),s) ! Pass any grid-cell derived attributes to the site ! --------------------------------------------------------------------------- @@ -507,12 +548,6 @@ subroutine init(this, bounds_proc ) end do !$OMP END PARALLEL DO - ! This will initialize all FATES globals, - ! particular PARTEH and HYDRO globals - - call InitFatesGlobals(masterproc) - - call this%init_history_io(bounds_proc) @@ -820,10 +855,6 @@ subroutine wrap_update_hlmfates_dyn(this, nc, bounds_clump, & ! ! This updates the internal value and the bc_out value. ! ! If hydraulics is off, it returns 0 storage if ( use_fates_planthydro ) then - ! call UpdateH2OVeg(this%fates(nc)%nsites, & - ! this%fates(nc)%sites, & - ! this%fates(nc)%bc_out) - ! do s = 1, this%fates(nc)%nsites c = this%f2hmap(nc)%fcolumn(s) waterstate_inst%total_plant_stored_h2o_col(c) = & @@ -940,7 +971,7 @@ subroutine restart( this, bounds_proc, ncid, flag, waterstate_inst, & use FatesIODimensionsMod, only: fates_bounds_type use FatesIOVariableKindMod, only : site_r8, site_int, cohort_r8, cohort_int use EDMainMod, only : ed_update_site - use FatesInterfaceMod, only: fates_maxElementsPerSite + use FatesInterfaceTypesMod, only: fates_maxElementsPerSite implicit none @@ -2390,12 +2421,12 @@ end subroutine wrap_hydraulics_drive subroutine hlm_bounds_to_fates_bounds(hlm, fates) use FatesIODimensionsMod, only : fates_bounds_type - use FatesInterfaceMod, only : nlevsclass, nlevage, nlevcoage - use FatesInterfaceMod, only : nlevheight + use FatesInterfaceTypesMod, only : nlevsclass, nlevage, nlevcoage + use FatesInterfaceTypesMod, only : nlevheight use EDtypesMod, only : nfsc use FatesLitterMod, only : ncwd use EDtypesMod, only : nlevleaf, nclmax - use FatesInterfaceMod, only : numpft_fates => numpft + use FatesInterfaceTypesMod, only : numpft_fates => numpft use clm_varpar, only : nlevgrnd implicit none From 61317d3d6447ccbb7a24e8880a6d8d2157668214 Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Thu, 7 May 2020 17:52:32 -0600 Subject: [PATCH 2/8] Removed site level veg24 since it was meaningless --- src/utils/clmfates_interfaceMod.F90 | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/utils/clmfates_interfaceMod.F90 b/src/utils/clmfates_interfaceMod.F90 index edff17fb3c..ef8196aeb5 100644 --- a/src/utils/clmfates_interfaceMod.F90 +++ b/src/utils/clmfates_interfaceMod.F90 @@ -676,11 +676,6 @@ subroutine dynamics_driv(this, nc, bounds_clump, & this%fates(nc)%bc_in(s)%h2o_liqvol_sl(1:nlevsoil) = & waterstate_inst%h2osoi_vol_col(c,1:nlevsoil) - ! TO-DO: SHOULD THIS BE LIQVOL OR IS VOL OK? (RGK-02-2017) - - this%fates(nc)%bc_in(s)%t_veg24_si = & - temperature_inst%t_veg24_patch(col%patchi(c)) - this%fates(nc)%bc_in(s)%max_rooting_depth_index_col = & min(nlevsoil, canopystate_inst%altmax_lastyear_indx_col(c)) From 39a99d9e530cd4957483f270d46ec68ce5ed155c Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Fri, 8 May 2020 11:40:29 -0700 Subject: [PATCH 3/8] fates interface - fixed module use calls --- src/main/histFileMod.F90 | 68 ++++++++++++++++++++-------------------- 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/src/main/histFileMod.F90 b/src/main/histFileMod.F90 index 58b8c11b08..6701e8fd5c 100644 --- a/src/main/histFileMod.F90 +++ b/src/main/histFileMod.F90 @@ -22,12 +22,12 @@ module histFileMod use PatchType , only : patch use EDTypesMod , only : nclmax use EDTypesMod , only : nlevleaf - use FatesInterfaceMod , only : nlevsclass, nlevage, nlevcoage - use FatesInterfaceMod , only : nlevheight + use FatesInterfaceTypesMod , only : nlevsclass, nlevage, nlevcoage + use FatesInterfaceTypesMod , only : nlevheight use EDTypesMod , only : nfsc use FatesLitterMod , only : ncwd use EDTypesMod , only : num_elements_fates => num_elements - use FatesInterfaceMod , only : numpft_fates => numpft + use FatesInterfaceTypesMod , only : numpft_fates => numpft use ncdio_pio ! @@ -2504,37 +2504,37 @@ subroutine htape_timeconst(t, mode) use domainMod , only : ldomain, lon1d, lat1d use clm_time_manager, only : get_nstep, get_curr_date, get_curr_time use clm_time_manager, only : get_ref_date, get_calendar, NO_LEAP_C, GREGORIAN_C - use FatesInterfaceMod, only : fates_hdim_levsclass - use FatesInterfaceMod, only : fates_hdim_pfmap_levscpf - use FatesInterfaceMod, only : fates_hdim_scmap_levscpf - use FatesInterfaceMod, only : fates_hdim_levcoage - use FatesInterfaceMod, only : fates_hdim_pfmap_levcapf - use FatesInterfaceMod, only : fates_hdim_camap_levcapf - use FatesInterfaceMod, only : fates_hdim_levage - use FatesInterfaceMod, only : fates_hdim_levheight - use FatesInterfaceMod, only : fates_hdim_levpft - use FatesInterfaceMod, only : fates_hdim_scmap_levscag - use FatesInterfaceMod, only : fates_hdim_agmap_levscag - use FatesInterfaceMod, only : fates_hdim_scmap_levscagpft - use FatesInterfaceMod, only : fates_hdim_agmap_levscagpft - use FatesInterfaceMod, only : fates_hdim_pftmap_levscagpft - use FatesInterfaceMod, only : fates_hdim_agmap_levagepft - use FatesInterfaceMod, only : fates_hdim_pftmap_levagepft - use FatesInterfaceMod, only : fates_hdim_levfuel - use FatesInterfaceMod, only : fates_hdim_levcwdsc - use FatesInterfaceMod, only : fates_hdim_levcan - use FatesInterfaceMod, only : fates_hdim_canmap_levcnlf - use FatesInterfaceMod, only : fates_hdim_lfmap_levcnlf - use FatesInterfaceMod, only : fates_hdim_canmap_levcnlfpf - use FatesInterfaceMod, only : fates_hdim_lfmap_levcnlfpf - use FatesInterfaceMod, only : fates_hdim_pftmap_levcnlfpf - use FatesInterfaceMod, only : fates_hdim_levelem - use FatesInterfaceMod, only : fates_hdim_elmap_levelpft - use FatesInterfaceMod, only : fates_hdim_pftmap_levelpft - use FatesInterfaceMod, only : fates_hdim_elmap_levelcwd - use FatesInterfaceMod, only : fates_hdim_cwdmap_levelcwd - use FatesInterfaceMod, only : fates_hdim_elmap_levelage - use FatesInterfaceMod, only : fates_hdim_agemap_levelage + use FatesInterfaceTypesMod, only : fates_hdim_levsclass + use FatesInterfaceTypesMod, only : fates_hdim_pfmap_levscpf + use FatesInterfaceTypesMod, only : fates_hdim_scmap_levscpf + use FatesInterfaceTypesMod, only : fates_hdim_levcoage + use FatesInterfaceTypesMod, only : fates_hdim_pfmap_levcapf + use FatesInterfaceTypesMod, only : fates_hdim_camap_levcapf + use FatesInterfaceTypesMod, only : fates_hdim_levage + use FatesInterfaceTypesMod, only : fates_hdim_levheight + use FatesInterfaceTypesMod, only : fates_hdim_levpft + use FatesInterfaceTypesMod, only : fates_hdim_scmap_levscag + use FatesInterfaceTypesMod, only : fates_hdim_agmap_levscag + use FatesInterfaceTypesMod, only : fates_hdim_scmap_levscagpft + use FatesInterfaceTypesMod, only : fates_hdim_agmap_levscagpft + use FatesInterfaceTypesMod, only : fates_hdim_pftmap_levscagpft + use FatesInterfaceTypesMod, only : fates_hdim_agmap_levagepft + use FatesInterfaceTypesMod, only : fates_hdim_pftmap_levagepft + use FatesInterfaceTypesMod, only : fates_hdim_levfuel + use FatesInterfaceTypesMod, only : fates_hdim_levcwdsc + use FatesInterfaceTypesMod, only : fates_hdim_levcan + use FatesInterfaceTypesMod, only : fates_hdim_canmap_levcnlf + use FatesInterfaceTypesMod, only : fates_hdim_lfmap_levcnlf + use FatesInterfaceTypesMod, only : fates_hdim_canmap_levcnlfpf + use FatesInterfaceTypesMod, only : fates_hdim_lfmap_levcnlfpf + use FatesInterfaceTypesMod, only : fates_hdim_pftmap_levcnlfpf + use FatesInterfaceTypesMod, only : fates_hdim_levelem + use FatesInterfaceTypesMod, only : fates_hdim_elmap_levelpft + use FatesInterfaceTypesMod, only : fates_hdim_pftmap_levelpft + use FatesInterfaceTypesMod, only : fates_hdim_elmap_levelcwd + use FatesInterfaceTypesMod, only : fates_hdim_cwdmap_levelcwd + use FatesInterfaceTypesMod, only : fates_hdim_elmap_levelage + use FatesInterfaceTypesMod, only : fates_hdim_agemap_levelage ! From c796117491cca448c2be8fbac8a649a5366607da Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Fri, 8 May 2020 16:14:30 -0600 Subject: [PATCH 4/8] updated module use statement in subgridMod for fates globals --- src/main/subgridMod.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/subgridMod.F90 b/src/main/subgridMod.F90 index 6358e90b5e..2ad494b7da 100644 --- a/src/main/subgridMod.F90 +++ b/src/main/subgridMod.F90 @@ -18,7 +18,7 @@ module subgridMod use clm_instur , only : wt_lunit, wt_nat_patch, urban_valid, wt_cft use landunit_varcon, only : istcrop, istdlak, istwet, isturb_tbd, isturb_hd, isturb_md use glcBehaviorMod , only : glc_behavior_type - use FatesInterfaceMod, only : fates_maxElementsPerSite + use FatesInterfaceTypesMod, only : fates_maxElementsPerSite implicit none private From e3fd221a11776d4881e0f42b0629dfb739acb0de Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Tue, 12 May 2020 11:31:52 -0700 Subject: [PATCH 5/8] changed fire variables to uppercase per PR640 --- cime_config/testdefs/testmods_dirs/clm/Fates/user_nl_clm | 4 ++-- .../testdefs/testmods_dirs/clm/FatesColdDef/user_nl_clm | 4 ++-- .../testdefs/testmods_dirs/clm/FatesShortList/user_nl_clm | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cime_config/testdefs/testmods_dirs/clm/Fates/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/Fates/user_nl_clm index c40769a62e..1bbaa01c6a 100644 --- a/cime_config/testdefs/testmods_dirs/clm/Fates/user_nl_clm +++ b/cime_config/testdefs/testmods_dirs/clm/Fates/user_nl_clm @@ -4,8 +4,8 @@ hist_nhtfrq = -24 hist_empty_htapes = .true. use_fates_spitfire= .true. hist_fincl1 = 'NPP','GPP','BTRAN','H2OSOI','TLAI','LITTER_IN_ELEM','LITTER_OUT_ELEM', - 'FIRE_AREA','SCORCH_HEIGHT','FIRE_INTENSITY','FIRE_TFC_ROS','fire_fuel_mef', - 'fire_fuel_bulkd','fire_fuel_sav','FIRE_NESTEROV_INDEX','PFTbiomass', + 'FIRE_AREA','SCORCH_HEIGHT','FIRE_INTENSITY','FIRE_TFC_ROS','FIRE_FUEL_MEF', + 'FIRE_FUEL_BULKD','FIRE_FUEL_SAV','FIRE_NESTEROV_INDEX','PFTbiomass', 'PFTleafbiomass','FIRE_ROS','WIND','AREA_TREES','AREA_PLANT', 'TOTSOMC','TOTLITC','T_SCALAR','NEP','HR','NPLANT_SCAG','NPLANT_SCPF', 'BA_SCLS','NPP_BY_AGE','CWD_AG_CWDSC','PARSUN_Z_CNLF','PARSUN_Z_CNLFPFT','PARSHA_Z_CAN', diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesColdDef/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/FatesColdDef/user_nl_clm index 97cafd9d42..02b13dcd1d 100644 --- a/cime_config/testdefs/testmods_dirs/clm/FatesColdDef/user_nl_clm +++ b/cime_config/testdefs/testmods_dirs/clm/FatesColdDef/user_nl_clm @@ -3,8 +3,8 @@ hist_nhtfrq = -24 hist_empty_htapes = .true. use_fates_spitfire= .true. hist_fincl1 = 'NPP','GPP','BTRAN','H2OSOI','TLAI','LITTER_IN','LITTER_OUT', - 'FIRE_AREA','SCORCH_HEIGHT','FIRE_INTENSITY','FIRE_TFC_ROS','fire_fuel_mef', - 'fire_fuel_bulkd','fire_fuel_sav','FIRE_NESTEROV_INDEX','PFTbiomass', + 'FIRE_AREA','SCORCH_HEIGHT','FIRE_INTENSITY','FIRE_TFC_ROS','FIRE_FUEL_MEF', + 'FIRE_FUEL_BULKD','FIRE_FUEL_SAV','FIRE_NESTEROV_INDEX','PFTbiomass', 'PFTleafbiomass','FIRE_ROS','WIND','AREA_TREES','AREA_PLANT', 'TOTSOMC','TOTLITC','T_SCALAR','NEP','HR','NPLANT_SCAG','NPLANT_SCPF', 'BA_SCLS','NPP_BY_AGE','CWD_AG_CWDSC','PARSUN_Z_CNLF','PARSUN_Z_CNLFPFT','PARSHA_Z_CAN' diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesShortList/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/FatesShortList/user_nl_clm index fc057c0be3..1790bb86c8 100644 --- a/cime_config/testdefs/testmods_dirs/clm/FatesShortList/user_nl_clm +++ b/cime_config/testdefs/testmods_dirs/clm/FatesShortList/user_nl_clm @@ -1,5 +1,5 @@ hist_fincl1 = 'NPP','GPP','BTRAN','H2OSOI','TLAI','LITTER_IN','LITTER_OUT', - 'FIRE_AREA','SCORCH_HEIGHT','FIRE_INTENSITY','FIRE_TFC_ROS','fire_fuel_mef', - 'fire_fuel_bulkd','fire_fuel_sav','FIRE_NESTEROV_INDEX','PFTbiomass', + 'FIRE_AREA','SCORCH_HEIGHT','FIRE_INTENSITY','FIRE_TFC_ROS','FIRE_FUEL_MEF', + 'FIRE_FUEL_BULKD','FIRE_FUEL_SAV','FIRE_NESTEROV_INDEX','PFTbiomass', 'PFTleafbiomass','FIRE_ROS','WIND','AREA_TREES','AREA_PLANT', 'TOTSOMC','TOTLITC','T_SCALAR','NEP','HR' From 4e392f15c8a003e25a4b2c900233d3df8e98c87c Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Tue, 12 May 2020 16:13:53 -0700 Subject: [PATCH 6/8] updating pointer to fates tag --- Externals_CLM.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Externals_CLM.cfg b/Externals_CLM.cfg index 6474d99ce2..ba11a3bf2d 100644 --- a/Externals_CLM.cfg +++ b/Externals_CLM.cfg @@ -2,7 +2,7 @@ local_path = src/fates protocol = git repo_url = https://github.com/NGEET/fates -tag = sci.1.35.0_api.10.0.0 +tag = sci.1.35.2_api.10.0.1 required = True [PTCLM] From 774f19d72598467d26791049ca5b380d307402fc Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Tue, 12 May 2020 22:42:41 -0600 Subject: [PATCH 7/8] Updating fates tag to api 11 --- Externals_CLM.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Externals_CLM.cfg b/Externals_CLM.cfg index 6474d99ce2..903f276ead 100644 --- a/Externals_CLM.cfg +++ b/Externals_CLM.cfg @@ -2,7 +2,7 @@ local_path = src/fates protocol = git repo_url = https://github.com/NGEET/fates -tag = sci.1.35.0_api.10.0.0 +tag = sci.1.35.4_api.11.0.0 required = True [PTCLM] From b5989cf9aeacdb547ef3e4a66ea3097590f1ecfd Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Tue, 19 May 2020 11:16:08 -0700 Subject: [PATCH 8/8] removing dead code --- src/utils/clmfates_interfaceMod.F90 | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/src/utils/clmfates_interfaceMod.F90 b/src/utils/clmfates_interfaceMod.F90 index 7fc52c8112..6924c188f2 100644 --- a/src/utils/clmfates_interfaceMod.F90 +++ b/src/utils/clmfates_interfaceMod.F90 @@ -391,18 +391,6 @@ subroutine init(this, bounds_proc ) ! local variables integer :: nclumps ! Number of threads - - integer :: pass_masterproc - integer :: pass_vertsoilc - integer :: pass_spitfire - integer :: pass_ed_st3 - integer :: pass_ed_prescribed_phys - integer :: pass_logging - integer :: pass_planthydro - integer :: pass_cohort_age_tracking - integer :: pass_inventory_init - integer :: pass_is_restart - integer :: pass_biogeog integer :: nc ! thread index integer :: s ! FATES site index integer :: c ! HLM column index