From 87e861fcb29435440909aa8feec8beff8fd50c7a Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Fri, 13 Feb 2026 13:52:04 -0800 Subject: [PATCH 1/6] add landuse x pft bounds and hist dimension --- src/main/histFileMod.F90 | 3 +++ src/utils/clmfates_interfaceMod.F90 | 7 +++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/main/histFileMod.F90 b/src/main/histFileMod.F90 index 29cb8e3cb1..b286817890 100644 --- a/src/main/histFileMod.F90 +++ b/src/main/histFileMod.F90 @@ -2583,6 +2583,7 @@ subroutine htape_create (t, f, histrest) call ncd_defdim(lnfid, 'fates_levclscpf', nclmax*nlevsclass*numpft_fates, dimid) call ncd_defdim(lnfid, 'fates_levlanduse', n_landuse_cats, dimid) call ncd_defdim(lnfid, 'fates_levlulu', n_landuse_cats * n_landuse_cats, dimid) + call ncd_defdim(lnfid, 'fates_levlupft', n_landuse_cats * numpft_fates, dimid) end if if ( .not. lhistrest )then @@ -5811,6 +5812,8 @@ subroutine hist_addfld2d (fname, type2d, units, avgflag, long_name, type1d_out, num2d = n_landuse_cats case ('fates_levlulu') num2d = n_landuse_cats * n_landuse_cats + case ('fates_levlupft') + num2d = n_landuse_cats * numpft_fates case('cft') if (cft_size > 0) then num2d = cft_size diff --git a/src/utils/clmfates_interfaceMod.F90 b/src/utils/clmfates_interfaceMod.F90 index e61112674b..21d06e5634 100644 --- a/src/utils/clmfates_interfaceMod.F90 +++ b/src/utils/clmfates_interfaceMod.F90 @@ -3348,7 +3348,7 @@ subroutine init_history_io(this,bounds_proc) use FatesIOVariableKindMod, only : site_height_r8, site_elem_r8, site_elpft_r8 use FatesIOVariableKindMod, only : site_elcwd_r8, site_elage_r8, site_agefuel_r8 use FatesIOVariableKindMod, only : site_cdpf_r8, site_cdsc_r8, site_clscpf_r8 - use FatesIOVariableKindMod, only : site_landuse_r8, site_lulu_r8 + use FatesIOVariableKindMod, only : site_landuse_r8, site_lulu_r8, site_lupft_r8 use FatesIODimensionsMod, only : fates_bounds_type @@ -3454,7 +3454,7 @@ subroutine init_history_io(this,bounds_proc) site_scagpft_r8, site_agepft_r8, site_elem_r8, site_elpft_r8, & site_elcwd_r8, site_elage_r8, site_agefuel_r8, & site_cdsc_r8, site_cdpf_r8, & - site_landuse_r8, site_lulu_r8) + site_landuse_r8, site_lulu_r8, site_lupft_r8) d_index = fates_hist%dim_kinds(dk_index)%dim2_index @@ -3808,6 +3808,9 @@ subroutine hlm_bounds_to_fates_bounds(hlm, fates) fates%lulu_begin = 1 fates%lulu_end = n_landuse_cats * n_landuse_cats + + fates%lupft_begin = 1 + fates%lupft_end = n_landuse_cats * numpft_fates call t_stopf('fates_hlm2fatesbnds') From 0ff294bce7fca00ef6cf06aee08cc4c8fe22e663 Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Fri, 13 Feb 2026 14:53:14 -0800 Subject: [PATCH 2/6] add bc inputs to fates for the high frequency update subroutine --- src/main/clm_driver.F90 | 3 ++- src/utils/clmfates_interfaceMod.F90 | 29 ++++++++++++++++++++++++++--- 2 files changed, 28 insertions(+), 4 deletions(-) diff --git a/src/main/clm_driver.F90 b/src/main/clm_driver.F90 index ad97911736..38d13a71f8 100644 --- a/src/main/clm_driver.F90 +++ b/src/main/clm_driver.F90 @@ -1182,7 +1182,8 @@ subroutine clm_drv(doalb, nextsw_cday, declinp1, declin, rstwr, nlend, rdate, ro call clm_fates%wrap_update_hifrq_hist(bounds_clump, & soilbiogeochem_carbonflux_inst, & - soilbiogeochem_carbonstate_inst) + soilbiogeochem_carbonstate_inst, & + solarabs_inst, energyflux_inst, temperature_inst) if( is_beg_curr_day() ) then diff --git a/src/utils/clmfates_interfaceMod.F90 b/src/utils/clmfates_interfaceMod.F90 index 21d06e5634..016634ccdc 100644 --- a/src/utils/clmfates_interfaceMod.F90 +++ b/src/utils/clmfates_interfaceMod.F90 @@ -3067,24 +3067,34 @@ end subroutine WrapUpdateFatesSeedInOut subroutine wrap_update_hifrq_hist(this, bounds_clump, & soilbiogeochem_carbonflux_inst, & - soilbiogeochem_carbonstate_inst) + soilbiogeochem_carbonstate_inst, & + solarabs_inst, energyflux_inst, & + temperature_inst) ! Arguments class(hlm_fates_interface_type), intent(inout) :: this type(bounds_type), intent(in) :: bounds_clump type(soilbiogeochem_carbonflux_type), intent(in) :: soilbiogeochem_carbonflux_inst type(soilbiogeochem_carbonstate_type), intent(in) :: soilbiogeochem_carbonstate_inst + type(solarabs_type), intent(in) :: solarabs_inst + type(energyflux_type), intent(in) :: energyflux_inst + type(temperature_type), intent(in) :: temperature_inst ! locals real(r8) :: dtime - integer :: s, c, nc + integer :: s, c, nc, ifp, p call t_startf('fates_wrap_update_hifrq_hist') associate(& hr => soilbiogeochem_carbonflux_inst%hr_col, & ! (gC/m2/s) total heterotrophic respiration totsomc => soilbiogeochem_carbonstate_inst%totsomc_col, & ! (gC/m2) total soil organic matter carbon - totlitc => soilbiogeochem_carbonstate_inst%totlitc_col) ! (gC/m2) total litter carbon in BGC pools + totlitc => soilbiogeochem_carbonstate_inst%totlitc_col, & ! (gC/m2) total litter carbon in BGC pools + eflx_lh_tot => energyflux_inst%eflx_lh_tot_patch(p), & ! (W/m2) latent heat flux + eflx_sh_tot => energyflux_inst%eflx_sh_tot_patch(p), & ! (W/m2) sensible heat flux + fsa_patch => solarabs_inst%fsa_patch(p), & ! (W/m2) absorbed solar flux + eflx_lwrad_net=> energyflux_inst%eflx_lwrad_net_patch(p), & ! (W/m2) net longwave radiative flux + t_ref2m => temperature_inst%t_ref2m_patch) ! (K) 2-m air temperature nc = bounds_clump%clump_index @@ -3105,6 +3115,19 @@ subroutine wrap_update_hifrq_hist(this, bounds_clump, & end do end if + + ! summarize biophysical variables that we want to output on FATES dimensions + do s = 1, this%fates(nc)%nsites + c = this%f2hmap(nc)%fcolumn(s) + do ifp = 0, this%fates(nc)%sites(s)%youngest_patch%patchno + p = ifp + col_pp%pfti(c) + this%fates(nc)%bc_in(s)%lhflux_pa(ifp) = eflx_lh_tot(p) + this%fates(nc)%bc_in(s)%shflux_pa(ifp) = eflx_sh_tot(p) + this%fates(nc)%bc_in(s)%swabs_pa(ifp) = fsa_patch(p) + this%fates(nc)%bc_in(s)%t2m_pa(ifp) = t_ref2m(p) + end do + end do + dtime = get_step_size_real() ! Update history variables that track these variables From 5853531ed331378f414ccfcbb25c9ae8a0ade838 Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Mon, 23 Feb 2026 17:07:11 -0700 Subject: [PATCH 3/6] remove erroneous patch index in associate statement --- src/utils/clmfates_interfaceMod.F90 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/utils/clmfates_interfaceMod.F90 b/src/utils/clmfates_interfaceMod.F90 index 016634ccdc..ee9cc06693 100644 --- a/src/utils/clmfates_interfaceMod.F90 +++ b/src/utils/clmfates_interfaceMod.F90 @@ -3090,10 +3090,10 @@ subroutine wrap_update_hifrq_hist(this, bounds_clump, & hr => soilbiogeochem_carbonflux_inst%hr_col, & ! (gC/m2/s) total heterotrophic respiration totsomc => soilbiogeochem_carbonstate_inst%totsomc_col, & ! (gC/m2) total soil organic matter carbon totlitc => soilbiogeochem_carbonstate_inst%totlitc_col, & ! (gC/m2) total litter carbon in BGC pools - eflx_lh_tot => energyflux_inst%eflx_lh_tot_patch(p), & ! (W/m2) latent heat flux - eflx_sh_tot => energyflux_inst%eflx_sh_tot_patch(p), & ! (W/m2) sensible heat flux - fsa_patch => solarabs_inst%fsa_patch(p), & ! (W/m2) absorbed solar flux - eflx_lwrad_net=> energyflux_inst%eflx_lwrad_net_patch(p), & ! (W/m2) net longwave radiative flux + eflx_lh_tot => energyflux_inst%eflx_lh_tot_patch, & ! (W/m2) latent heat flux + eflx_sh_tot => energyflux_inst%eflx_sh_tot_patch, & ! (W/m2) sensible heat flux + fsa_patch => solarabs_inst%fsa_patch, & ! (W/m2) absorbed solar flux + eflx_lwrad_net=> energyflux_inst%eflx_lwrad_net_patch, & ! (W/m2) net longwave radiative flux t_ref2m => temperature_inst%t_ref2m_patch) ! (K) 2-m air temperature nc = bounds_clump%clump_index @@ -3120,7 +3120,7 @@ subroutine wrap_update_hifrq_hist(this, bounds_clump, & do s = 1, this%fates(nc)%nsites c = this%f2hmap(nc)%fcolumn(s) do ifp = 0, this%fates(nc)%sites(s)%youngest_patch%patchno - p = ifp + col_pp%pfti(c) + p = ifp + col%patchi(c) this%fates(nc)%bc_in(s)%lhflux_pa(ifp) = eflx_lh_tot(p) this%fates(nc)%bc_in(s)%shflux_pa(ifp) = eflx_sh_tot(p) this%fates(nc)%bc_in(s)%swabs_pa(ifp) = fsa_patch(p) From 392fad658192ea9d0817dfc098cacc4a4ec91644 Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Mon, 23 Feb 2026 17:07:38 -0700 Subject: [PATCH 4/6] add new landuse biophysics diagnsotic outuput for LUH2 testmods --- .../testdefs/testmods_dirs/clm/FatesColdLUH2/user_nl_clm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2/user_nl_clm index 65b24d27b2..24cc0a2af5 100644 --- a/cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2/user_nl_clm +++ b/cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2/user_nl_clm @@ -31,4 +31,7 @@ hist_fincl1 = 'FATES_NCOHORTS', 'FATES_TRIMMING', 'FATES_AREA_PLANTS', 'FATES_SEED_ALLOC', 'FATES_STEM_ALLOC', 'FATES_FROOT_ALLOC', 'FATES_CROOT_ALLOC', 'FATES_STORE_ALLOC', 'FATES_PATCHAREA_LU', 'FATES_DISTURBANCE_RATE_MATRIX_LULU', -'FATES_TRANSITION_MATRIX_LULU' +'FATES_TRANSITION_MATRIX_LULU', +'FATES_VEGC_LUPF','FATES_NOCOMP_PATCHAREA_LUPF', +'FATES_TVEG_LU','FATES_TSA_LU','FATES_SWABS_LU','FATES_NETLW_LU', +'FATES_SHFLUX_LU','FATES_LHFLUX_LU','FATES_GPP_LU' \ No newline at end of file From 8b8416c23af37e4caf34e31b22ebd98ce99d9627 Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Fri, 6 Mar 2026 17:24:57 -0700 Subject: [PATCH 5/6] Adding comment about passing in the bareground patch values --- src/utils/clmfates_interfaceMod.F90 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/utils/clmfates_interfaceMod.F90 b/src/utils/clmfates_interfaceMod.F90 index ee9cc06693..19b247218e 100644 --- a/src/utils/clmfates_interfaceMod.F90 +++ b/src/utils/clmfates_interfaceMod.F90 @@ -3116,7 +3116,9 @@ subroutine wrap_update_hifrq_hist(this, bounds_clump, & end if - ! summarize biophysical variables that we want to output on FATES dimensions + ! Summarize biophysical variables that we want to output on FATES dimensions + ! Note that we pass in the bareground patch values here by starting the ifp + ! do loop from zero do s = 1, this%fates(nc)%nsites c = this%f2hmap(nc)%fcolumn(s) do ifp = 0, this%fates(nc)%sites(s)%youngest_patch%patchno From 5de542d02919650b16f57bbab312b766cac7a5fe Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Sun, 8 Mar 2026 22:37:43 -0600 Subject: [PATCH 6/6] add known existing issue to list --- cime_config/testdefs/ExpectedTestFails.xml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cime_config/testdefs/ExpectedTestFails.xml b/cime_config/testdefs/ExpectedTestFails.xml index 1e82513737..343665ad22 100644 --- a/cime_config/testdefs/ExpectedTestFails.xml +++ b/cime_config/testdefs/ExpectedTestFails.xml @@ -187,6 +187,14 @@ --> + + + FAIL + #3660 + Restart issues with default "inactive" fields added to history by hist_all_fields. + + + FAIL