From a999afb7fa74e577d2323a596a8f4c96b40df747 Mon Sep 17 00:00:00 2001 From: Fang Date: Fri, 30 May 2025 10:13:19 -0600 Subject: [PATCH 001/129] big commit --- src/biogeochem/CNFireLi2024Mod.F90 | 34 +++++++++++++++++++----------- 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/src/biogeochem/CNFireLi2024Mod.F90 b/src/biogeochem/CNFireLi2024Mod.F90 index dbad9a773d..a516600461 100644 --- a/src/biogeochem/CNFireLi2024Mod.F90 +++ b/src/biogeochem/CNFireLi2024Mod.F90 @@ -7,11 +7,8 @@ module CNFireLi2024Mod ! module for fire dynamics ! created in Nov, 2012 and revised in Apr, 2013 by F. Li and S. Levis ! based on Li et al. (2012a,b; 2013) - ! revised in Apr, 2014 according to Li et al.(2014) - ! revised in May, 2015, according to Li et al. (2015, in prep.) - ! Fire-related parameters were calibrated or tuned in May, 2015 based on the - ! 20th Century transient simulations at f19_g16 with a CLM4.5 version - ! (clm50fire), CRUNCEPv5, and climatological lightning data. + ! revised in Apr, 2014 according to Li and Lawrance (2017) + ! revised in Jun, 2024 and modified in May, 2025, according to Li et al. (2025, in prep.) ! ! !USES: use shr_kind_mod , only : r8 => shr_kind_r8 @@ -147,6 +144,10 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ real(r8) :: fs ! hd-dependent fires suppression (0-1) real(r8) :: ig ! total ignitions (count/km2/hr) real(r8) :: hdmlf ! human density + real(r8) :: topoi ! influence of topography on fires (0-1), where 1 indicates no impact. + ! can be removed if CLM consider Arctic C3 grass in plateau-> + ! intense light-> much more C allocated to fine roots than leaf, + ! and roots decreasing infiltration real(r8) :: arh, arh30 !combustability of fuel related to RH and RH30 real(r8) :: afuel !weight for arh and arh30 real(r8) :: btran_col(bounds%begc:bounds%endc) @@ -180,7 +181,7 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ defo_fire_precip_thresh_bdt => cnfire_const%defo_fire_precip_thresh_bdt, & ! Input: [real(r8) ] (mm/day) Max running mean daily precip allowing deforestation fire for broadleaf deciduous trees borpeat_fire_soilmoist_denom => cnfire_const%borpeat_fire_soilmoist_denom, & ! Input: [real(r8) ] (unitless) Denominator of exponential in soil moisture term of equation relating that and temperature to boreal peat fire (unitless) nonborpeat_fire_precip_denom => cnfire_const%nonborpeat_fire_precip_denom, & ! Input: [real(r8) ] (unitless) Denominator of precipitation in equation relating that to non-boreal peat fire (unitless) - + forc_topo_g => atm2lnd_inst%forc_topo_grc , & ! Input: [real(r8) (:) ] atmospheric surface height (m) fsr_pft => pftcon%fsr_pft , & ! Input: fd_pft => pftcon%fd_pft , & ! Input: rswf_min => pftcon%rswf_min , & ! Input: @@ -197,8 +198,8 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ forc_t => atm2lnd_inst%forc_t_downscaled_col , & ! Input: [real(r8) (:) ] downscaled atmospheric temperature (Kelvin) forc_rain => wateratm2lndbulk_inst%forc_rain_downscaled_col , & ! Input: [real(r8) (:) ] downscaled rain forc_snow => wateratm2lndbulk_inst%forc_snow_downscaled_col , & ! Input: [real(r8) (:) ] downscaled snow - prec30 => wateratm2lndbulk_inst%prec30_patch , & ! Input: [real(r8) (:) ] 10-day running mean of tot. precipitation - rh30 => wateratm2lndbulk_inst%rh30_patch , & ! Input: [real(r8) (:) ] 10-day running mean of tot. relative humidity + prec30 => wateratm2lndbulk_inst%prec30_patch , & ! Input: [real(r8) (:) ] 30-day running mean of tot. precipitation + rh30 => wateratm2lndbulk_inst%rh30_patch , & ! Input: [real(r8) (:) ] 30-day running mean of tot. relative humidity dwt_smoothed => cnveg_state_inst%dwt_smoothed_patch , & ! Input: [real(r8) (:) ] change in patch weight (-1 to 1) on the gridcell, smoothed over the year cropf_col => cnveg_state_inst%cropf_col , & ! Input: [real(r8) (:) ] cropland fraction in veg column gdp_lf => this%gdp_lf_col , & ! Input: [real(r8) (:) ] gdp data @@ -303,7 +304,7 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ cropf_col(c) = cropf_col(c) + patch%wtcol(p) end if ! For natural vegetation - if (patch%itype(p) <= nc4_grass ) then + if (patch%itype(p) <= nc4_grass .and. patch%itype(p) >= ndllf_evr_tmp_tree) then lfwt(c) = lfwt(c) + patch%wtgcell(p) end if end do @@ -516,8 +517,12 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ g = col%gridcell(c) ! For crop + ! cropf_col(c) * col%wtgcell(c) > 0.1_r8 is added because fires are rare in + ! gridcells with limited cropland coverage based on GFED5. Also, this helps to + ! avoid abm (crop fire peak month) regridding error from 0.05 degree to lower resolution + ! The condition could be removed if CLM supports the use of mode in abm inputs regridding if( forc_t(c) >= SHR_CONST_TKFRZ .and. patch%itype(p) > nc4_grass .and. & - kmo == abm_lf(c) .and. & + kmo == abm_lf(c) .and. cropf_col(c) * col%wtgcell(c) > 0.1_r8 .and. & burndate(p) >= 999 .and. patch%wtcol(p) > 0._r8 )then ! catch crop burn time hdmlf = this%forc_hdm(g) @@ -616,7 +621,12 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ cnfire_params%ignition_efficiency*(1._r8-fs)* & (lfwt(c)**0.5) end if - nfire(c) = ig/secsphr*fb*fire_m*lgdp_col(c) !fire counts/km2/sec + if(forc_topo_g(g) <= 2500._r8)then !influence of topography on fires + topoi = 1._r8 + else + topoi = 0.004_r8 + end if + nfire(c) = ig/secsphr*fb*fire_m*lgdp_col(c) * topoi !fire counts/km2/sec Lb_lf = 1._r8+10._r8*(1._r8-EXP(-0.06_r8*forc_wind(g))) spread_m = fire_m**0.5_r8 fd_col(c) = (lfwt(c)*lgdp1_col(c)*lpop_col(c))**0.5_r8 * fd_col(c) @@ -639,7 +649,7 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ / (trotr1_col(c) + trotr2_col(c)) cli = max(0._r8,min(1._r8,1._r8-prec30_col(c)*secspday/cri))* & - (15._r8*min(0.0016_r8,dtrotr_col(c)/dt*dayspyr*secspday)+0.009_r8)* & + (0.67_r8*min(0.01_r8,dtrotr_col(c)/dt*dayspyr*secspday)+0.001_r8) * & max(0._r8,min(1._r8,(0.25_r8-(forc_rain(c)+forc_snow(c))*secsphr)/0.25_r8)) farea_burned(c) = farea_burned(c)+fb*cli*(cli_scale/secspday) From 88a32eb7004f60050b3f7ecc220074e55dde41a9 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Wed, 4 Jun 2025 09:35:42 -0600 Subject: [PATCH 002/129] Include abm = 13 values when determining dominant abm in mksurfdata_esmf --- tools/mksurfdata_esmf/src/mkagfirepkmonthMod.F90 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/mksurfdata_esmf/src/mkagfirepkmonthMod.F90 b/tools/mksurfdata_esmf/src/mkagfirepkmonthMod.F90 index 6115e813f9..e740c5c9ee 100644 --- a/tools/mksurfdata_esmf/src/mkagfirepkmonthMod.F90 +++ b/tools/mksurfdata_esmf/src/mkagfirepkmonthMod.F90 @@ -21,8 +21,8 @@ module mkagfirepkmonthMod public :: mkagfirepkmon ! Set agricultural fire peak month integer , parameter :: min_valid = 1 - integer , parameter :: max_valid = 12 - integer , parameter :: unsetmon = 13 + integer , parameter :: max_valid = 13 + integer , parameter :: unsetmon = 0 type(ESMF_DynamicMask) :: dynamicMask From 74773721113d34f69de2f6212b9466cd9f224876 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Wed, 4 Jun 2025 14:55:35 -0600 Subject: [PATCH 003/129] Change unsetmon from 13 to 14 --- tools/mksurfdata_esmf/src/mkagfirepkmonthMod.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/mksurfdata_esmf/src/mkagfirepkmonthMod.F90 b/tools/mksurfdata_esmf/src/mkagfirepkmonthMod.F90 index e740c5c9ee..5b6230e4fb 100644 --- a/tools/mksurfdata_esmf/src/mkagfirepkmonthMod.F90 +++ b/tools/mksurfdata_esmf/src/mkagfirepkmonthMod.F90 @@ -22,7 +22,7 @@ module mkagfirepkmonthMod integer , parameter :: min_valid = 1 integer , parameter :: max_valid = 13 - integer , parameter :: unsetmon = 0 + integer , parameter :: unsetmon = 14 type(ESMF_DynamicMask) :: dynamicMask From 16a192143cb2e18e1e443a0e07a10302b2cc9020 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Wed, 4 Jun 2025 15:10:46 -0600 Subject: [PATCH 004/129] Adding comments explaining some of mkagfirepkmonthMod.F90 --- tools/mksurfdata_esmf/src/mkagfirepkmonthMod.F90 | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/tools/mksurfdata_esmf/src/mkagfirepkmonthMod.F90 b/tools/mksurfdata_esmf/src/mkagfirepkmonthMod.F90 index 5b6230e4fb..adbcfa6c59 100644 --- a/tools/mksurfdata_esmf/src/mkagfirepkmonthMod.F90 +++ b/tools/mksurfdata_esmf/src/mkagfirepkmonthMod.F90 @@ -20,9 +20,9 @@ module mkagfirepkmonthMod public :: mkagfirepkmon ! Set agricultural fire peak month - integer , parameter :: min_valid = 1 - integer , parameter :: max_valid = 13 - integer , parameter :: unsetmon = 14 + integer , parameter :: min_valid = 1 ! month value for January + integer , parameter :: max_valid = 13 ! value for no agricultural fire + integer , parameter :: unsetmon = 14 ! maximum value expected in the output file if raw dataset includes values outside the 1 through 13 range type(ESMF_DynamicMask) :: dynamicMask @@ -36,6 +36,10 @@ module mkagfirepkmonthMod subroutine mkagfirepkmon(file_mesh_i, file_data_i, mesh_o, pioid_o, rc) ! ! Make agricultural fire peak month data from higher resolution data + ! by selecting the dominant value from values 1 through 13 + ! where 13 means no agricultural fire. + ! + ! The relevant subroutine is get_dominant_indices. ! ! input/output variables character(len=*) , intent(in) :: file_mesh_i ! input mesh file name @@ -142,6 +146,7 @@ subroutine mkagfirepkmon(file_mesh_i, file_data_i, mesh_o, pioid_o, rc) ! Create a dynamic mask object ! The dynamic mask object further holds a pointer to the routine that will be called in order to ! handle dynamically masked elements - in this case its DynMaskProc (see below) + ! This calls subroutine get_dominant_indices call ESMF_DynamicMaskSetR4R8R4(dynamicMask, dynamicMaskRoutine=get_dominant_indices, & handleAllElements=.true., rc=rc) if (chkerr(rc,__LINE__,u_FILE_u)) return From 7d7a49ed9634a7b30a7d20abfa5ec2a0678cf373 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Thu, 5 Jun 2025 09:01:03 -0600 Subject: [PATCH 005/129] mkagfirepkmonthMod: Add some TODOs. --- tools/mksurfdata_esmf/src/mkagfirepkmonthMod.F90 | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/tools/mksurfdata_esmf/src/mkagfirepkmonthMod.F90 b/tools/mksurfdata_esmf/src/mkagfirepkmonthMod.F90 index adbcfa6c59..1feb3e41b8 100644 --- a/tools/mksurfdata_esmf/src/mkagfirepkmonthMod.F90 +++ b/tools/mksurfdata_esmf/src/mkagfirepkmonthMod.F90 @@ -58,9 +58,9 @@ subroutine mkagfirepkmon(file_mesh_i, file_data_i, mesh_o, pioid_o, rc) integer :: k integer :: ni,no integer :: ns_i, ns_o - integer , allocatable :: mask_i(:) - real(r4), allocatable :: rmask_i(:) - real(r8), allocatable :: frac_o(:) + integer , allocatable :: mask_i(:) ! TODO: What is this? + real(r4), allocatable :: rmask_i(:) ! TODO: What is this? + real(r8), allocatable :: frac_o(:) ! TODO: What is this? integer , allocatable :: idata_i(:) ! input grid: agricultural fire peak month integer , allocatable :: agfirepkmon_o(:) ! agricultural fire peak month real(r4), pointer :: dataptr(:) @@ -210,10 +210,10 @@ end subroutine mkagfirepkmon subroutine get_dominant_indices(dynamicMaskList, dynamicSrcMaskValue, dynamicDstMaskValue, rc) ! input/output arguments - type(ESMF_DynamicMaskElementR4R8R4) , pointer :: dynamicMaskList(:) - real(ESMF_KIND_R4) , intent(in), optional :: dynamicSrcMaskValue - real(ESMF_KIND_R4) , intent(in), optional :: dynamicDstMaskValue - integer , intent(out) :: rc + type(ESMF_DynamicMaskElementR4R8R4) , pointer :: dynamicMaskList(:) ! TODO: What is this? + real(ESMF_KIND_R4) , intent(in), optional :: dynamicSrcMaskValue ! TODO: What is this? + real(ESMF_KIND_R4) , intent(in), optional :: dynamicDstMaskValue ! TODO: What is this? + integer , intent(out) :: rc ! TODO: What is this? ! local variables integer :: ni, no, n @@ -225,6 +225,7 @@ subroutine get_dominant_indices(dynamicMaskList, dynamicSrcMaskValue, dynamicDst rc = ESMF_SUCCESS if (associated(dynamicMaskList)) then + ! TODO: Can parts of this loop and/or its subloops be broken out into separate functions/subroutines to facilitate testing? do no = 1, size(dynamicMaskList) hasdata = .false. wts_o(:) = 0.d0 From 7f28c6f3549519fd8c1f5d1a9e21c90906a198d8 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Thu, 5 Jun 2025 14:05:43 -0600 Subject: [PATCH 006/129] Remove unsetmon as recommended in the code review --- tools/mksurfdata_esmf/src/mkagfirepkmonthMod.F90 | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tools/mksurfdata_esmf/src/mkagfirepkmonthMod.F90 b/tools/mksurfdata_esmf/src/mkagfirepkmonthMod.F90 index 1feb3e41b8..0f7fd33cb0 100644 --- a/tools/mksurfdata_esmf/src/mkagfirepkmonthMod.F90 +++ b/tools/mksurfdata_esmf/src/mkagfirepkmonthMod.F90 @@ -22,7 +22,6 @@ module mkagfirepkmonthMod integer , parameter :: min_valid = 1 ! month value for January integer , parameter :: max_valid = 13 ! value for no agricultural fire - integer , parameter :: unsetmon = 14 ! maximum value expected in the output file if raw dataset includes values outside the 1 through 13 range type(ESMF_DynamicMask) :: dynamicMask @@ -168,8 +167,8 @@ subroutine mkagfirepkmon(file_mesh_i, file_data_i, mesh_o, pioid_o, rc) ! Check validity of output data if (min_bad(agfirepkmon_o, min_valid, 'agfirepkmon') .or. & - max_bad(agfirepkmon_o, unsetmon , 'agfirepkmon')) then - call shr_sys_abort() + max_bad(agfirepkmon_o, max_valid, 'agfirepkmon')) then + call shr_sys_abort(subname//" error in agfirepkmon_o value range; min_valid, max_valid are "//min_valid//", "//max_valid) end if ! Close the file @@ -245,7 +244,7 @@ subroutine get_dominant_indices(dynamicMaskList, dynamicSrcMaskValue, dynamicDst maxindex = maxloc(wts_o(:)) dynamicMaskList(no)%dstElement = real(maxindex(1), kind=r4) else - dynamicMaskList(no)%dstElement = real(unsetmon, kind=r4) + call shr_sys_abort(subname//" error: hasdata needs to be true") end if end do end if From 1469512c98d86e0a7e7ce2e28228210e4a182866 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Thu, 5 Jun 2025 14:37:46 -0600 Subject: [PATCH 007/129] Document more variables as recommended in the code review --- .../mksurfdata_esmf/src/mkagfirepkmonthMod.F90 | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/tools/mksurfdata_esmf/src/mkagfirepkmonthMod.F90 b/tools/mksurfdata_esmf/src/mkagfirepkmonthMod.F90 index 0f7fd33cb0..47caf70a69 100644 --- a/tools/mksurfdata_esmf/src/mkagfirepkmonthMod.F90 +++ b/tools/mksurfdata_esmf/src/mkagfirepkmonthMod.F90 @@ -57,9 +57,9 @@ subroutine mkagfirepkmon(file_mesh_i, file_data_i, mesh_o, pioid_o, rc) integer :: k integer :: ni,no integer :: ns_i, ns_o - integer , allocatable :: mask_i(:) ! TODO: What is this? - real(r4), allocatable :: rmask_i(:) ! TODO: What is this? - real(r8), allocatable :: frac_o(:) ! TODO: What is this? + integer , allocatable :: mask_i(:) ! input grid: mesh file landmask + real(r4), allocatable :: rmask_i(:) ! input grid: raw dataset landmask + real(r8), allocatable :: frac_o(:) ! output grid: agricultural fire peak month integer , allocatable :: idata_i(:) ! input grid: agricultural fire peak month integer , allocatable :: agfirepkmon_o(:) ! agricultural fire peak month real(r4), pointer :: dataptr(:) @@ -182,7 +182,7 @@ subroutine mkagfirepkmon(file_mesh_i, file_data_i, mesh_o, pioid_o, rc) ! Output diagnostics comparing global area of each peak month on input and output grids call output_diagnostics_index(mesh_i, mesh_o, mask_i, frac_o, & - 1, 13, idata_i, agfirepkmon_o, 'peak fire month', ndiag, rc) + min_valid, max_valid, idata_i, agfirepkmon_o, 'peak fire month', ndiag, rc) if (chkerr(rc,__LINE__,u_FILE_u)) call shr_sys_abort() ! Release memory @@ -209,10 +209,10 @@ end subroutine mkagfirepkmon subroutine get_dominant_indices(dynamicMaskList, dynamicSrcMaskValue, dynamicDstMaskValue, rc) ! input/output arguments - type(ESMF_DynamicMaskElementR4R8R4) , pointer :: dynamicMaskList(:) ! TODO: What is this? - real(ESMF_KIND_R4) , intent(in), optional :: dynamicSrcMaskValue ! TODO: What is this? - real(ESMF_KIND_R4) , intent(in), optional :: dynamicDstMaskValue ! TODO: What is this? - integer , intent(out) :: rc ! TODO: What is this? + type(ESMF_DynamicMaskElementR4R8R4) , pointer :: dynamicMaskList(:) + real(ESMF_KIND_R4) , intent(in), optional :: dynamicSrcMaskValue ! Source (i.e. input) grid mask + real(ESMF_KIND_R4) , intent(in), optional :: dynamicDstMaskValue ! Destination (i.e. output) grid mask + integer , intent(out) :: rc ! error status ! local variables integer :: ni, no, n @@ -224,7 +224,6 @@ subroutine get_dominant_indices(dynamicMaskList, dynamicSrcMaskValue, dynamicDst rc = ESMF_SUCCESS if (associated(dynamicMaskList)) then - ! TODO: Can parts of this loop and/or its subloops be broken out into separate functions/subroutines to facilitate testing? do no = 1, size(dynamicMaskList) hasdata = .false. wts_o(:) = 0.d0 From 27259b14110cf03f87b73974c1f5ef5f66d614f1 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Thu, 5 Jun 2025 18:05:04 -0600 Subject: [PATCH 008/129] Update paths in gen_mksurfdata_namelist.xml and get mods from #3224 --- .../gen_mksurfdata_namelist.xml | 36 +++++++++---------- .../src/mkagfirepkmonthMod.F90 | 30 +++++++++------- 2 files changed, 35 insertions(+), 31 deletions(-) diff --git a/tools/mksurfdata_esmf/gen_mksurfdata_namelist.xml b/tools/mksurfdata_esmf/gen_mksurfdata_namelist.xml index 007be2e8bb..279c92308b 100644 --- a/tools/mksurfdata_esmf/gen_mksurfdata_namelist.xml +++ b/tools/mksurfdata_esmf/gen_mksurfdata_namelist.xml @@ -10,7 +10,7 @@ - /glade/campaign/cesm/development/lmwg/landuse_source_data/CTSM53CMIP7RawData/globalctsm53histMKSRFDeg025_250417/mksrf_landuse_ctsm53_pftlai_CLIM.c250417.nc + lnd/clm2/rawdata/CTSM54RawData/globalctsm53histMKSRFDeg025_250417/mksrf_landuse_ctsm53_pftlai_CLIM.c250417.nc lnd/clm2/mappingdata/grids/UNSTRUCTgrid_0.25x0.25_nomask_cdf5_c200129.nc @@ -21,7 +21,7 @@ - /glade/campaign/cesm/development/lmwg/landuse_source_data/CTSM53CMIP7RawData/globalctsm53histMKSRFDeg025_250417/mksrf_landuse_ctsm53_soilcolor_CLIM.c250417.nc + lnd/clm2/rawdata/CTSM54RawData/globalctsm53histMKSRFDeg025_250417/mksrf_landuse_ctsm53_soilcolor_CLIM.c250417.nc lnd/clm2/mappingdata/grids/UNSTRUCTgrid_0.25x0.25_nomask_cdf5_c200129.nc @@ -213,31 +213,31 @@ version of the raw dataset will probably go away. - /glade/campaign/cesm/development/lmwg/landuse_source_data/CTSM53CMIP7RawData/globalctsm53histCMIP7Deg025_250417/mksrf_landuse_ctsm53_histCMIP7_1700.c250417.nc + lnd/clm2/rawdata/CTSM54RawData/globalctsm53histCMIP7Deg025_250417/mksrf_landuse_ctsm53_histCMIP7_1700.c250417.nc lnd/clm2/mappingdata/grids/UNSTRUCTgrid_0.25x0.25_nomask_cdf5_c200129.nc lnd/clm2/rawdata/lake_area/mksurf_lake_0.05x0.05_hist_clm5_hydrolakes_1850.cdf5.c20220325.nc - /glade/campaign/cgd/tss/people/oleson/Dynamic_Urban_Data/CMIP7/urban_properties_CMIP7_ThreeClass_1700_c250423.nc + lnd/clm2/rawdata/CTSM54RawData/urban_properties/urban_properties_CMIP7_ThreeClass_1700_c250423.nc - /glade/campaign/cesm/development/lmwg/landuse_source_data/CTSM53CMIP7RawData/globalctsm53histCMIP7Deg025_250417/mksrf_landuse_ctsm53_histCMIP7_1850.c250417.nc + lnd/clm2/rawdata/CTSM54RawData/globalctsm53histCMIP7Deg025_250417/mksrf_landuse_ctsm53_histCMIP7_1850.c250417.nc lnd/clm2/mappingdata/grids/UNSTRUCTgrid_0.25x0.25_nomask_cdf5_c200129.nc lnd/clm2/rawdata/lake_area/mksurf_lake_0.05x0.05_hist_clm5_hydrolakes_1850.cdf5.c20220325.nc - /glade/campaign/cgd/tss/people/oleson/Dynamic_Urban_Data/CMIP7/urban_properties_CMIP7_ThreeClass_1850_c250423.nc + lnd/clm2/rawdata/CTSM54RawData/urban_properties/urban_properties_CMIP7_ThreeClass_1850_c250423.nc - /glade/campaign/cesm/development/lmwg/landuse_source_data/CTSM53CMIP7RawData/globalctsm53histCMIP7Deg025_250417/mksrf_landuse_ctsm53_histCMIP7_2000.c250417.nc + lnd/clm2/rawdata/CTSM54RawData/globalctsm53histCMIP7Deg025_250417/mksrf_landuse_ctsm53_histCMIP7_2000.c250417.nc lnd/clm2/mappingdata/grids/UNSTRUCTgrid_0.25x0.25_nomask_cdf5_c200129.nc lnd/clm2/rawdata/lake_area/mksurf_lake_0.05x0.05_hist_clm5_hydrolakes_2000.cdf5.c20220325.nc - /glade/campaign/cgd/tss/people/oleson/Dynamic_Urban_Data/CMIP7/urban_properties_CMIP7_ThreeClass_2000_c250423.nc + lnd/clm2/rawdata/CTSM54RawData/urban_properties/urban_properties_CMIP7_ThreeClass_2000_c250423.nc - /glade/campaign/cesm/development/lmwg/landuse_source_data/CTSM53CMIP7RawData/globalctsm53histCMIP7Deg025_250417/mksrf_landuse_ctsm53_histCMIP7_2005.c250417.nc + lnd/clm2/rawdata/CTSM54RawData/globalctsm53histCMIP7Deg025_250417/mksrf_landuse_ctsm53_histCMIP7_2005.c250417.nc lnd/clm2/mappingdata/grids/UNSTRUCTgrid_0.25x0.25_nomask_cdf5_c200129.nc lnd/clm2/rawdata/lake_area/mksurf_lake_0.05x0.05_hist_clm5_hydrolakes_2005.cdf5.c20220325.nc - /glade/campaign/cgd/tss/people/oleson/Dynamic_Urban_Data/CMIP7/urban_properties_CMIP7_ThreeClass_2005_c250423.nc + lnd/clm2/rawdata/CTSM54RawData/urban_properties/urban_properties_CMIP7_ThreeClass_2005_c250423.nc @@ -252,10 +252,10 @@ version of the raw dataset will probably go away. - /glade/campaign/cesm/development/lmwg/landuse_source_data/CTSM53CMIP7RawData/globalctsm53histCMIP7Deg025_250417/mksrf_landuse_ctsm53_histCMIP7_%y.c250417.nc + lnd/clm2/rawdata/CTSM54RawData/globalctsm53histCMIP7Deg025_250417/mksrf_landuse_ctsm53_histCMIP7_%y.c250417.nc lnd/clm2/mappingdata/grids/UNSTRUCTgrid_0.25x0.25_nomask_cdf5_c200129.nc lnd/clm2/rawdata/lake_area/mksurf_lake_0.05x0.05_hist_clm5_hydrolakes_%y.cdf5.c20220325.nc - /glade/campaign/cgd/tss/people/oleson/Dynamic_Urban_Data/CMIP7/urban_properties_CMIP7_ThreeClass_%y_c250423.nc + lnd/clm2/rawdata/CTSM54RawData/urban_properties/urban_properties_CMIP7_ThreeClass_%y_c250423.nc @@ -267,7 +267,7 @@ version of the raw dataset will probably go away. - /glade/campaign/cesm/cesmdata/inputdata/lnd/clm2/rawdata/CTSM53RawData/globalctsm53TRSSP126Deg025_240728/mksrf_landuse_ctsm53_TRSSP126_%y.c240728.nc + lnd/clm2/rawdata/CTSM53RawData/globalctsm53TRSSP126Deg025_240728/mksrf_landuse_ctsm53_TRSSP126_%y.c240728.nc lnd/clm2/mappingdata/grids/UNSTRUCTgrid_0.25x0.25_nomask_cdf5_c200129.nc lnd/clm2/rawdata/lake_area/mksurf_lake_0.05x0.05_hist_clm5_hydrolakes_%y.cdf5.c20220325.nc lnd/clm2/rawdata/gao_oneill_urban/ssp1/urban_properties_GaoOneil_05deg_ThreeClass_ssp1_%y_cdf5_c20220910.nc @@ -280,21 +280,21 @@ version of the raw dataset will probably go away. - /glade/campaign/cesm/cesmdata/inputdata/lnd/clm2/rawdata/CTSM53RawData/globalctsm53TRSSP119Deg025_240728/mksrf_landuse_ctsm53_TRSSP119_%y.c240728.nc + lnd/clm2/rawdata/CTSM53RawData/globalctsm53TRSSP119Deg025_240728/mksrf_landuse_ctsm53_TRSSP119_%y.c240728.nc lnd/clm2/mappingdata/grids/UNSTRUCTgrid_0.25x0.25_nomask_cdf5_c200129.nc lnd/clm2/rawdata/lake_area/mksurf_lake_0.05x0.05_hist_clm5_hydrolakes_%y.cdf5.c20220325.nc lnd/clm2/rawdata/gao_oneill_urban/ssp1/urban_properties_GaoOneil_05deg_ThreeClass_ssp1_%y_cdf5_c20220910.nc - /glade/campaign/cesm/cesmdata/inputdata/lnd/clm2/rawdata/CTSM53RawData/globalctsm53TRSSP245Deg025_240728/mksrf_landuse_ctsm53_TRSSP245_%y.c240728.nc + lnd/clm2/rawdata/CTSM53RawData/globalctsm53TRSSP245Deg025_240728/mksrf_landuse_ctsm53_TRSSP245_%y.c240728.nc lnd/clm2/mappingdata/grids/UNSTRUCTgrid_0.25x0.25_nomask_cdf5_c200129.nc lnd/clm2/rawdata/lake_area/mksurf_lake_0.05x0.05_hist_clm5_hydrolakes_%y.cdf5.c20220325.nc lnd/clm2/rawdata/gao_oneill_urban/ssp2/urban_properties_GaoOneil_05deg_ThreeClass_ssp2_%y_cdf5_c20220910.nc - /glade/campaign/cesm/cesmdata/inputdata/lnd/clm2/rawdata/CTSM53RawData/globalctsm53TRSSP370Deg025_240728/mksrf_landuse_ctsm53_TRSSP370_%y.c240728.nc + lnd/clm2/rawdata/CTSM53RawData/globalctsm53TRSSP370Deg025_240728/mksrf_landuse_ctsm53_TRSSP370_%y.c240728.nc lnd/clm2/mappingdata/grids/UNSTRUCTgrid_0.25x0.25_nomask_cdf5_c200129.nc lnd/clm2/rawdata/lake_area/mksurf_lake_0.05x0.05_hist_clm5_hydrolakes_%y.cdf5.c20220325.nc lnd/clm2/rawdata/gao_oneill_urban/ssp3/urban_properties_GaoOneil_05deg_ThreeClass_ssp3_%y_cdf5_c20220910.nc @@ -308,14 +308,14 @@ version of the raw dataset will probably go away. - /glade/campaign/cesm/cesmdata/inputdata/lnd/clm2/rawdata/CTSM53RawData/globalctsm53TRSSP460Deg025_240728/mksrf_landuse_ctsm53_TRSSP460_%y.c240728.nc + lnd/clm2/rawdata/CTSM53RawData/globalctsm53TRSSP460Deg025_240728/mksrf_landuse_ctsm53_TRSSP460_%y.c240728.nc lnd/clm2/mappingdata/grids/UNSTRUCTgrid_0.25x0.25_nomask_cdf5_c200129.nc lnd/clm2/rawdata/lake_area/mksurf_lake_0.05x0.05_hist_clm5_hydrolakes_%y.cdf5.c20220325.nc lnd/clm2/rawdata/gao_oneill_urban/ssp4/urban_properties_GaoOneil_05deg_ThreeClass_ssp4_%y_cdf5_c20220910.nc - /glade/campaign/cesm/cesmdata/inputdata/lnd/clm2/rawdata/CTSM53RawData/globalctsm53TRSSP585Deg025_240728/mksrf_landuse_ctsm53_TRSSP585_%y.c240728.nc + lnd/clm2/rawdata/CTSM53RawData/globalctsm53TRSSP585Deg025_240728/mksrf_landuse_ctsm53_TRSSP585_%y.c240728.nc lnd/clm2/mappingdata/grids/UNSTRUCTgrid_0.25x0.25_nomask_cdf5_c200129.nc lnd/clm2/rawdata/lake_area/mksurf_lake_0.05x0.05_hist_clm5_hydrolakes_%y.cdf5.c20220325.nc lnd/clm2/rawdata/gao_oneill_urban/ssp5/urban_properties_GaoOneil_05deg_ThreeClass_ssp5_%y_cdf5_c20220910.nc diff --git a/tools/mksurfdata_esmf/src/mkagfirepkmonthMod.F90 b/tools/mksurfdata_esmf/src/mkagfirepkmonthMod.F90 index 6115e813f9..47caf70a69 100644 --- a/tools/mksurfdata_esmf/src/mkagfirepkmonthMod.F90 +++ b/tools/mksurfdata_esmf/src/mkagfirepkmonthMod.F90 @@ -20,9 +20,8 @@ module mkagfirepkmonthMod public :: mkagfirepkmon ! Set agricultural fire peak month - integer , parameter :: min_valid = 1 - integer , parameter :: max_valid = 12 - integer , parameter :: unsetmon = 13 + integer , parameter :: min_valid = 1 ! month value for January + integer , parameter :: max_valid = 13 ! value for no agricultural fire type(ESMF_DynamicMask) :: dynamicMask @@ -36,6 +35,10 @@ module mkagfirepkmonthMod subroutine mkagfirepkmon(file_mesh_i, file_data_i, mesh_o, pioid_o, rc) ! ! Make agricultural fire peak month data from higher resolution data + ! by selecting the dominant value from values 1 through 13 + ! where 13 means no agricultural fire. + ! + ! The relevant subroutine is get_dominant_indices. ! ! input/output variables character(len=*) , intent(in) :: file_mesh_i ! input mesh file name @@ -54,9 +57,9 @@ subroutine mkagfirepkmon(file_mesh_i, file_data_i, mesh_o, pioid_o, rc) integer :: k integer :: ni,no integer :: ns_i, ns_o - integer , allocatable :: mask_i(:) - real(r4), allocatable :: rmask_i(:) - real(r8), allocatable :: frac_o(:) + integer , allocatable :: mask_i(:) ! input grid: mesh file landmask + real(r4), allocatable :: rmask_i(:) ! input grid: raw dataset landmask + real(r8), allocatable :: frac_o(:) ! output grid: agricultural fire peak month integer , allocatable :: idata_i(:) ! input grid: agricultural fire peak month integer , allocatable :: agfirepkmon_o(:) ! agricultural fire peak month real(r4), pointer :: dataptr(:) @@ -142,6 +145,7 @@ subroutine mkagfirepkmon(file_mesh_i, file_data_i, mesh_o, pioid_o, rc) ! Create a dynamic mask object ! The dynamic mask object further holds a pointer to the routine that will be called in order to ! handle dynamically masked elements - in this case its DynMaskProc (see below) + ! This calls subroutine get_dominant_indices call ESMF_DynamicMaskSetR4R8R4(dynamicMask, dynamicMaskRoutine=get_dominant_indices, & handleAllElements=.true., rc=rc) if (chkerr(rc,__LINE__,u_FILE_u)) return @@ -163,8 +167,8 @@ subroutine mkagfirepkmon(file_mesh_i, file_data_i, mesh_o, pioid_o, rc) ! Check validity of output data if (min_bad(agfirepkmon_o, min_valid, 'agfirepkmon') .or. & - max_bad(agfirepkmon_o, unsetmon , 'agfirepkmon')) then - call shr_sys_abort() + max_bad(agfirepkmon_o, max_valid, 'agfirepkmon')) then + call shr_sys_abort(subname//" error in agfirepkmon_o value range; min_valid, max_valid are "//min_valid//", "//max_valid) end if ! Close the file @@ -178,7 +182,7 @@ subroutine mkagfirepkmon(file_mesh_i, file_data_i, mesh_o, pioid_o, rc) ! Output diagnostics comparing global area of each peak month on input and output grids call output_diagnostics_index(mesh_i, mesh_o, mask_i, frac_o, & - 1, 13, idata_i, agfirepkmon_o, 'peak fire month', ndiag, rc) + min_valid, max_valid, idata_i, agfirepkmon_o, 'peak fire month', ndiag, rc) if (chkerr(rc,__LINE__,u_FILE_u)) call shr_sys_abort() ! Release memory @@ -206,9 +210,9 @@ subroutine get_dominant_indices(dynamicMaskList, dynamicSrcMaskValue, dynamicDst ! input/output arguments type(ESMF_DynamicMaskElementR4R8R4) , pointer :: dynamicMaskList(:) - real(ESMF_KIND_R4) , intent(in), optional :: dynamicSrcMaskValue - real(ESMF_KIND_R4) , intent(in), optional :: dynamicDstMaskValue - integer , intent(out) :: rc + real(ESMF_KIND_R4) , intent(in), optional :: dynamicSrcMaskValue ! Source (i.e. input) grid mask + real(ESMF_KIND_R4) , intent(in), optional :: dynamicDstMaskValue ! Destination (i.e. output) grid mask + integer , intent(out) :: rc ! error status ! local variables integer :: ni, no, n @@ -239,7 +243,7 @@ subroutine get_dominant_indices(dynamicMaskList, dynamicSrcMaskValue, dynamicDst maxindex = maxloc(wts_o(:)) dynamicMaskList(no)%dstElement = real(maxindex(1), kind=r4) else - dynamicMaskList(no)%dstElement = real(unsetmon, kind=r4) + call shr_sys_abort(subname//" error: hasdata needs to be true") end if end do end if From ff3bc9edc29ccc516ca096221e5f92ff7f54e435 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Fri, 13 Jun 2025 14:03:54 -0600 Subject: [PATCH 009/129] Correct a message to the user in gen_mksurfdata_jobscript_*.py files --- python/ctsm/toolchain/gen_mksurfdata_jobscript_multi.py | 4 +++- python/ctsm/toolchain/gen_mksurfdata_jobscript_single.py | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/python/ctsm/toolchain/gen_mksurfdata_jobscript_multi.py b/python/ctsm/toolchain/gen_mksurfdata_jobscript_multi.py index 14957a0177..67fe9169ed 100755 --- a/python/ctsm/toolchain/gen_mksurfdata_jobscript_multi.py +++ b/python/ctsm/toolchain/gen_mksurfdata_jobscript_multi.py @@ -145,7 +145,9 @@ def write_runscript( runfile.write(f"{output} \n") check = f"if [ $? != 0 ]; then echo 'Error running resolution {res}'; exit -4; fi" runfile.write(f"{check} \n") - runfile.write(f"echo Successfully ran resolution {res}\n") + runfile.write( + f"echo Started fsurdat/landuse generation; see .log file for progress {res}\n" + ) runfile.write(f"echo Successfully ran {jobscript_file}\n") diff --git a/python/ctsm/toolchain/gen_mksurfdata_jobscript_single.py b/python/ctsm/toolchain/gen_mksurfdata_jobscript_single.py index c3f762380e..dabb2a8357 100755 --- a/python/ctsm/toolchain/gen_mksurfdata_jobscript_single.py +++ b/python/ctsm/toolchain/gen_mksurfdata_jobscript_single.py @@ -266,7 +266,7 @@ def write_runscript_part2(namelist_file, runfile, executable, mksurfdata_path, e check = f'if [ $? != 0 ]; then echo "Error running for namelist {namelist_file}"; exit -4; fi' runfile.write(f"{check} \n") - runfile.write("echo Successfully ran resolution\n") + runfile.write("echo Started fsurdat/landuse generation; see .log file for progress\n") def main(): From bd3ce9667f2874a4332a99c9644f1efd2ca205a6 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Fri, 13 Jun 2025 15:10:19 -0600 Subject: [PATCH 010/129] Corrections to messages to the user --- python/ctsm/toolchain/gen_mksurfdata_jobscript_multi.py | 2 +- python/ctsm/toolchain/gen_mksurfdata_jobscript_single.py | 2 +- tools/mksurfdata_esmf/src/mkagfirepkmonthMod.F90 | 4 +++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/python/ctsm/toolchain/gen_mksurfdata_jobscript_multi.py b/python/ctsm/toolchain/gen_mksurfdata_jobscript_multi.py index 67fe9169ed..4c5566acc6 100755 --- a/python/ctsm/toolchain/gen_mksurfdata_jobscript_multi.py +++ b/python/ctsm/toolchain/gen_mksurfdata_jobscript_multi.py @@ -146,7 +146,7 @@ def write_runscript( check = f"if [ $? != 0 ]; then echo 'Error running resolution {res}'; exit -4; fi" runfile.write(f"{check} \n") runfile.write( - f"echo Started fsurdat/landuse generation; see .log file for progress {res}\n" + f"echo Started fsurdat/landuse generation, see .log file for progress {res}\n" ) runfile.write(f"echo Successfully ran {jobscript_file}\n") diff --git a/python/ctsm/toolchain/gen_mksurfdata_jobscript_single.py b/python/ctsm/toolchain/gen_mksurfdata_jobscript_single.py index dabb2a8357..0594f6167a 100755 --- a/python/ctsm/toolchain/gen_mksurfdata_jobscript_single.py +++ b/python/ctsm/toolchain/gen_mksurfdata_jobscript_single.py @@ -266,7 +266,7 @@ def write_runscript_part2(namelist_file, runfile, executable, mksurfdata_path, e check = f'if [ $? != 0 ]; then echo "Error running for namelist {namelist_file}"; exit -4; fi' runfile.write(f"{check} \n") - runfile.write("echo Started fsurdat/landuse generation; see .log file for progress\n") + runfile.write("echo Started fsurdat/landuse generation, see .log file for progress\n") def main(): diff --git a/tools/mksurfdata_esmf/src/mkagfirepkmonthMod.F90 b/tools/mksurfdata_esmf/src/mkagfirepkmonthMod.F90 index 47caf70a69..e8fac8aa37 100644 --- a/tools/mksurfdata_esmf/src/mkagfirepkmonthMod.F90 +++ b/tools/mksurfdata_esmf/src/mkagfirepkmonthMod.F90 @@ -168,7 +168,8 @@ subroutine mkagfirepkmon(file_mesh_i, file_data_i, mesh_o, pioid_o, rc) ! Check validity of output data if (min_bad(agfirepkmon_o, min_valid, 'agfirepkmon') .or. & max_bad(agfirepkmon_o, max_valid, 'agfirepkmon')) then - call shr_sys_abort(subname//" error in agfirepkmon_o value range; min_valid, max_valid are "//min_valid//", "//max_valid) + if (root_task) write(ndiag, '(a)') trim(subname)//" error in agfirepkmon_o value range: min_valid and max_valid equal ", min_valid, max_valid + call shr_sys_abort() end if ! Close the file @@ -219,6 +220,7 @@ subroutine get_dominant_indices(dynamicMaskList, dynamicSrcMaskValue, dynamicDst real(ESMF_KIND_R4) :: wts_o(min_valid:max_valid) integer :: maxindex(1) logical :: hasdata + character(len=*), parameter :: subname = 'get_dominant_indices' !--------------------------------------------------------------- rc = ESMF_SUCCESS From 5d426baa7635dd8143cc1cb2ea20a25f67cd08d5 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Fri, 13 Jun 2025 15:21:17 -0600 Subject: [PATCH 011/129] Refine message to the user --- python/ctsm/toolchain/gen_mksurfdata_jobscript_multi.py | 2 +- python/ctsm/toolchain/gen_mksurfdata_jobscript_single.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/python/ctsm/toolchain/gen_mksurfdata_jobscript_multi.py b/python/ctsm/toolchain/gen_mksurfdata_jobscript_multi.py index 4c5566acc6..88ffa7f7b1 100755 --- a/python/ctsm/toolchain/gen_mksurfdata_jobscript_multi.py +++ b/python/ctsm/toolchain/gen_mksurfdata_jobscript_multi.py @@ -146,7 +146,7 @@ def write_runscript( check = f"if [ $? != 0 ]; then echo 'Error running resolution {res}'; exit -4; fi" runfile.write(f"{check} \n") runfile.write( - f"echo Started fsurdat/landuse generation, see .log file for progress {res}\n" + f"echo Confirm completion of fsurdat/landuse generation in the .log file {res}\n" ) runfile.write(f"echo Successfully ran {jobscript_file}\n") diff --git a/python/ctsm/toolchain/gen_mksurfdata_jobscript_single.py b/python/ctsm/toolchain/gen_mksurfdata_jobscript_single.py index 0594f6167a..1413e49158 100755 --- a/python/ctsm/toolchain/gen_mksurfdata_jobscript_single.py +++ b/python/ctsm/toolchain/gen_mksurfdata_jobscript_single.py @@ -266,7 +266,7 @@ def write_runscript_part2(namelist_file, runfile, executable, mksurfdata_path, e check = f'if [ $? != 0 ]; then echo "Error running for namelist {namelist_file}"; exit -4; fi' runfile.write(f"{check} \n") - runfile.write("echo Started fsurdat/landuse generation, see .log file for progress\n") + runfile.write("echo Confirm completion of fsurdat/landuse generation in the .log file\n") def main(): From bd0c628e2cbb28a96de6219e8a8a62fff3e3c41e Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Tue, 17 Jun 2025 12:31:42 -0600 Subject: [PATCH 012/129] Bring back unsetmon but equal to 14 for ocean to not skew the regridding --- tools/mksurfdata_esmf/src/mkagfirepkmonthMod.F90 | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/tools/mksurfdata_esmf/src/mkagfirepkmonthMod.F90 b/tools/mksurfdata_esmf/src/mkagfirepkmonthMod.F90 index e8fac8aa37..417658245c 100644 --- a/tools/mksurfdata_esmf/src/mkagfirepkmonthMod.F90 +++ b/tools/mksurfdata_esmf/src/mkagfirepkmonthMod.F90 @@ -22,6 +22,7 @@ module mkagfirepkmonthMod integer , parameter :: min_valid = 1 ! month value for January integer , parameter :: max_valid = 13 ! value for no agricultural fire + integer , parameter :: unsetmon = 14 ! value for no data type(ESMF_DynamicMask) :: dynamicMask @@ -119,6 +120,10 @@ subroutine mkagfirepkmon(file_mesh_i, file_data_i, mesh_o, pioid_o, rc) call mkpio_get_rawdata(pioid_i, 'abm', mesh_i, idata_i, rc=rc) if (chkerr(rc,__LINE__,u_FILE_u)) return call ESMF_VMLogMemInfo("After mkpio_getrawdata in "//trim(subname)) + ! Update idata_i to unsetmon where mask_i == 0, i.e. over ocean + do ni = 1, ns_i + if (mask_i(ni) == 0) idata_i(ni) = unsetmon + end do ! Create ESMF fields that will be used below field_i = ESMF_FieldCreate(mesh_i, ESMF_TYPEKIND_R4, meshloc=ESMF_MESHLOC_ELEMENT, rc=rc) @@ -167,8 +172,8 @@ subroutine mkagfirepkmon(file_mesh_i, file_data_i, mesh_o, pioid_o, rc) ! Check validity of output data if (min_bad(agfirepkmon_o, min_valid, 'agfirepkmon') .or. & - max_bad(agfirepkmon_o, max_valid, 'agfirepkmon')) then - if (root_task) write(ndiag, '(a)') trim(subname)//" error in agfirepkmon_o value range: min_valid and max_valid equal ", min_valid, max_valid + max_bad(agfirepkmon_o, unsetmon , 'agfirepkmon')) then + if (root_task) write(ndiag, '(a)') trim(subname)//" error in agfirepkmon_o value range: expect min_valid to unsetmon which equal ", min_valid, unsetmon call shr_sys_abort() end if @@ -183,7 +188,7 @@ subroutine mkagfirepkmon(file_mesh_i, file_data_i, mesh_o, pioid_o, rc) ! Output diagnostics comparing global area of each peak month on input and output grids call output_diagnostics_index(mesh_i, mesh_o, mask_i, frac_o, & - min_valid, max_valid, idata_i, agfirepkmon_o, 'peak fire month', ndiag, rc) + min_valid, unsetmon, idata_i, agfirepkmon_o, 'peak fire month', ndiag, rc) if (chkerr(rc,__LINE__,u_FILE_u)) call shr_sys_abort() ! Release memory @@ -245,7 +250,7 @@ subroutine get_dominant_indices(dynamicMaskList, dynamicSrcMaskValue, dynamicDst maxindex = maxloc(wts_o(:)) dynamicMaskList(no)%dstElement = real(maxindex(1), kind=r4) else - call shr_sys_abort(subname//" error: hasdata needs to be true") + dynamicMaskList(no)%dstElement = real(unsetmon, kind=r4) end if end do end if From f84e650f61f48326da2c82059680aef82c2b85f1 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Tue, 17 Jun 2025 18:07:12 -0600 Subject: [PATCH 013/129] Update Makefile and .cfg file to accommodate changes in subset_data --- tools/mksurfdata_esmf/Makefile | 2 +- tools/mksurfdata_esmf/modify_1x1_urbanc_alpha.cfg | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/mksurfdata_esmf/Makefile b/tools/mksurfdata_esmf/Makefile index 835f732a02..b30f2abc3d 100644 --- a/tools/mksurfdata_esmf/Makefile +++ b/tools/mksurfdata_esmf/Makefile @@ -81,7 +81,7 @@ URBALPHA_TMP2_FNAME := surfdata_1x1_urbanc_alpha_hist_2000_78pfts_tmp.nc URBALPHA_FNAME := surfdata_1x1_urbanc_alpha_hist_2000_78pfts_c$(CDATE).nc SUBSETDATA_1X1_MEXICOCITY := --lat 19.5 --lon 260.5 --site 1x1_mexicocityMEX --out-surface $(MEXICOCITY_TMP_FNAME) SUBSETDATA_1X1_VANCOUVER := --lat 49.5 --lon 236.5 --site 1x1_vancouverCAN --out-surface $(VANCOUVER_TMP_FNAME) -SUBSETDATA_1X1_URBALPHA := --lat -37.7308 --lon 0 --site 1x1_urbanc_alpha --out-surface $(URBALPHA_TMP_FNAME) +SUBSETDATA_1X1_URBALPHA := --lat -37.7308 --lon 360 --site 1x1_urbanc_alpha --out-surface $(URBALPHA_TMP_FNAME) # ne120np4 and hi-res are for high resolution, ne16np4 is for mid-resolution testing # low-res is for low resolutions for testing diff --git a/tools/mksurfdata_esmf/modify_1x1_urbanc_alpha.cfg b/tools/mksurfdata_esmf/modify_1x1_urbanc_alpha.cfg index bdb27ac43d..1e509ccb8f 100644 --- a/tools/mksurfdata_esmf/modify_1x1_urbanc_alpha.cfg +++ b/tools/mksurfdata_esmf/modify_1x1_urbanc_alpha.cfg @@ -32,6 +32,8 @@ lnd_lat_2 = 90 lnd_lon_1 = 0 # easternmost longitude for rectangle lnd_lon_2 = 360 +# Upper limit of longitudes, from format being either [-180, 180] or [0, 360] +lon_type = 360 # user-defined mask in a file, as alternative to setting lat/lon values landmask_file = UNSET From c106c33e6aeb43e8d3c2bd33d3812bf500246757 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Wed, 18 Jun 2025 14:38:47 -0600 Subject: [PATCH 014/129] Correct inadvertent conflict that crept in with one of the merges --- tools/mksurfdata_esmf/src/mkagfirepkmonthMod.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/mksurfdata_esmf/src/mkagfirepkmonthMod.F90 b/tools/mksurfdata_esmf/src/mkagfirepkmonthMod.F90 index 3d6211ffe6..417658245c 100644 --- a/tools/mksurfdata_esmf/src/mkagfirepkmonthMod.F90 +++ b/tools/mksurfdata_esmf/src/mkagfirepkmonthMod.F90 @@ -250,7 +250,7 @@ subroutine get_dominant_indices(dynamicMaskList, dynamicSrcMaskValue, dynamicDst maxindex = maxloc(wts_o(:)) dynamicMaskList(no)%dstElement = real(maxindex(1), kind=r4) else - call shr_sys_abort(subname//" error: hasdata needs to be true") + dynamicMaskList(no)%dstElement = real(unsetmon, kind=r4) end if end do end if From f6a903e3200b31c85d8d233297f29ad8bdcbe992 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Tue, 15 Jul 2025 11:09:49 -0600 Subject: [PATCH 015/129] Update to new abm raw dataset provided today by Fang Li --- tools/mksurfdata_esmf/gen_mksurfdata_namelist.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/mksurfdata_esmf/gen_mksurfdata_namelist.xml b/tools/mksurfdata_esmf/gen_mksurfdata_namelist.xml index 279c92308b..cd9a5b058a 100644 --- a/tools/mksurfdata_esmf/gen_mksurfdata_namelist.xml +++ b/tools/mksurfdata_esmf/gen_mksurfdata_namelist.xml @@ -168,7 +168,7 @@ version of the raw dataset will probably go away. - lnd/clm2/rawdata/mksrf_abm_0.5x0.5_simyr2000.c240821.nc + lnd/clm2/rawdata/mksrf_abm_0.5x0.5_simyr2000.c250715.nc lnd/clm2/mappingdata/grids/UNSTRUCTgrid_0.5x0.5_nomask_cdf5_c200129.nc From d3cf177e3c942eef92c06c1118cdecb7ca0dbfc2 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Tue, 22 Jul 2025 17:54:16 -0600 Subject: [PATCH 016/129] Update default popdens stream file --- bld/namelist_files/namelist_defaults_ctsm.xml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index 50e3cf68ad..fe10078c71 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -2168,15 +2168,14 @@ lnd/clm2/surfdata_esmf/NEON/ctsm5.3.0/surfdata_1x1_NEON_TOOL_hist_2000_78pfts_c2 2000 2000 -lnd/clm2/firedata/clmforc.Li_2017_HYDEv3.2_CMIP6_hdm_0.5x0.5_AVHRR_simyr1850-2016_c180202.nc +lnd/clm2/firedata/clmforc.Li_2025_CMIP7_SSP3CMIP6_hdm_0.5x0.5_simyr1850-2100_c250717.nc lnd/clm2/firedata/clmforc.Li_2018_SSP1_CMIP6_hdm_0.5x0.5_AVHRR_simyr1850-2100_c181205.nc lnd/clm2/firedata/clmforc.Li_2018_SSP1_CMIP6_hdm_0.5x0.5_AVHRR_simyr1850-2100_c181205.nc lnd/clm2/firedata/clmforc.Li_2018_SSP2_CMIP6_hdm_0.5x0.5_AVHRR_simyr1850-2100_c181205.nc -lnd/clm2/firedata/clmforc.Li_2018_SSP3_CMIP6_hdm_0.5x0.5_AVHRR_simyr1850-2100_c181205.nc - +lnd/clm2/firedata/clmforc.Li_2025_CMIP7_SSP3CMIP6_hdm_0.5x0.5_simyr1850-2100_c250717.nc lnd/clm2/firedata/clmforc.Li_2018_SSP4_CMIP6_hdm_0.5x0.5_AVHRR_simyr1850-2100_c181205.nc lnd/clm2/firedata/clmforc.Li_2018_SSP4_CMIP6_hdm_0.5x0.5_AVHRR_simyr1850-2100_c181205.nc @@ -2186,15 +2185,14 @@ lnd/clm2/surfdata_esmf/NEON/ctsm5.3.0/surfdata_1x1_NEON_TOOL_hist_2000_78pfts_c2 lnd/clm2/firedata/clmforc.Li_2018_SSP5_CMIP6_hdm_0.5x0.5_AVHRR_simyr1850-2100_c181205.nc -lnd/clm2/firedata/clmforc.Li_2017_HYDEv3.2_CMIP6_hdm_0.5x0.5_AVHRR_simyr1850-2016_c180202.nc +lnd/clm2/firedata/clmforc.Li_2025_CMIP7_SSP3CMIP6_hdm_0.5x0.5_simyr1850-2100_c250717.nc lnd/clm2/firedata/clmforc.Li_2018_SSP1_CMIP6_hdm_0.5x0.5_AVHRR_simyr1850-2100_c181205.nc lnd/clm2/firedata/clmforc.Li_2018_SSP1_CMIP6_hdm_0.5x0.5_AVHRR_simyr1850-2100_c181205.nc lnd/clm2/firedata/clmforc.Li_2018_SSP2_CMIP6_hdm_0.5x0.5_AVHRR_simyr1850-2100_c181205.nc -lnd/clm2/firedata/clmforc.Li_2018_SSP3_CMIP6_hdm_0.5x0.5_AVHRR_simyr1850-2100_c181205.nc - +lnd/clm2/firedata/clmforc.Li_2025_CMIP7_SSP3CMIP6_hdm_0.5x0.5_simyr1850-2100_c250717.nc lnd/clm2/firedata/clmforc.Li_2018_SSP4_CMIP6_hdm_0.5x0.5_AVHRR_simyr1850-2100_c181205.nc lnd/clm2/firedata/clmforc.Li_2018_SSP4_CMIP6_hdm_0.5x0.5_AVHRR_simyr1850-2100_c181205.nc From a9451782fb10dd24ca7fe3ccb1ee6dda15cf3953 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Wed, 23 Jul 2025 17:15:50 -0600 Subject: [PATCH 017/129] Urban mesh was pointing to a 3x3min instead of a 0.25x0.25 file --- tools/mksurfdata_esmf/gen_mksurfdata_namelist.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/mksurfdata_esmf/gen_mksurfdata_namelist.xml b/tools/mksurfdata_esmf/gen_mksurfdata_namelist.xml index 69a3547653..cd9a5b058a 100644 --- a/tools/mksurfdata_esmf/gen_mksurfdata_namelist.xml +++ b/tools/mksurfdata_esmf/gen_mksurfdata_namelist.xml @@ -93,7 +93,7 @@ - lnd/clm2/mappingdata/grids/UNSTRUCTgrid_3x3min_nomask_cdf5_c200129.nc + lnd/clm2/mappingdata/grids/UNSTRUCTgrid_0.25x0.25_nomask_cdf5_c200129.nc From 473db81fe59106117457d0a0f538f2091cae9d90 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Thu, 24 Jul 2025 11:44:45 -0600 Subject: [PATCH 018/129] Add ctsm54 ne30, f09, f19 fsurdat/landuse files to namelist defaults --- bld/namelist_files/namelist_defaults_ctsm.xml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index fe10078c71..bea0066251 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -1717,9 +1717,9 @@ lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_4x5_hist_1850_16pfts_c241007.nc lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_360x720cru_hist_1850_78pfts_c240908.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_0.9x1.25_hist_1850_78pfts_c240908.nc +lnd/clm2/surfdata_esmf/ctsm5.4.0/surfdata_0.9x1.25_hist_1850_78pfts_c250723.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_1.9x2.5_hist_1850_78pfts_c240908.nc +lnd/clm2/surfdata_esmf/ctsm5.4.0/surfdata_1.9x2.5_hist_1850_78pfts_c250723.nc lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_10x15_hist_1850_78pfts_c240908.nc @@ -1735,7 +1735,7 @@ lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_ne30np4_hist_1850_78pfts_c240908.nc lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_ne30np4.pg2_hist_1850_78pfts_c240908.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_ne30np4.pg3_hist_1850_78pfts_c240908.nc +lnd/clm2/surfdata_esmf/ctsm5.4.0/surfdata_ne30np4.pg3_hist_1850_78pfts_c250723.nc lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_ne3np4.pg3_hist_1850_78pfts_c240908.nc @@ -1795,9 +1795,9 @@ lnd/clm2/surfdata_esmf/NEON/ctsm5.3.0/surfdata_1x1_NEON_TOOL_hist_2000_78pfts_c2 lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_0.9x1.25_SSP2-4.5_1850-2100_78pfts_c240908.nc + >lnd/clm2/surfdata_esmf/ctsm5.4.0/landuse.timeseries_0.9x1.25_hist_1850-2023_78pfts_c250723.nc lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_1.9x2.5_SSP2-4.5_1850-2100_78pfts_c240908.nc + >lnd/clm2/surfdata_esmf/ctsm5.4.0/landuse.timeseries_1.9x2.5_hist_1850-2023_78pfts_c250723.nc lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_ne0np4.ARCTICGRIS.ne30x8_SSP2-4.5_1979-2026_78pfts_c240908.nc lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_ne16np4.pg3_SSP2-4.5_1850-2100_78pfts_c240908.nc lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_ne30np4.pg3_SSP2-4.5_1850-2100_78pfts_c240908.nc +>lnd/clm2/surfdata_esmf/ctsm5.4.0/landuse.timeseries_ne30np4.pg3_hist_1850-2023_78pfts_c250723.nc lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_C96_SSP2-4.5_1850-2100_78pfts_c240908.nc From d6f97ffb273744da3a3b509c4adf6aa7e1a44e93 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Fri, 25 Jul 2025 14:16:33 -0600 Subject: [PATCH 019/129] New hdm stream file should be used only with clm6 by default --- bld/namelist_files/namelist_defaults_ctsm.xml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index bea0066251..a94c588e4f 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -2168,14 +2168,16 @@ lnd/clm2/surfdata_esmf/NEON/ctsm5.3.0/surfdata_1x1_NEON_TOOL_hist_2000_78pfts_c2 2000 2000 -lnd/clm2/firedata/clmforc.Li_2025_CMIP7_SSP3CMIP6_hdm_0.5x0.5_simyr1850-2100_c250717.nc +lnd/clm2/firedata/clmforc.Li_2025_CMIP7_SSP3CMIP6_hdm_0.5x0.5_simyr1850-2100_c250717.nc +lnd/clm2/firedata/clmforc.Li_2017_HYDEv3.2_CMIP6_hdm_0.5x0.5_AVHRR_simyr1850-2016_c180202.nc lnd/clm2/firedata/clmforc.Li_2018_SSP1_CMIP6_hdm_0.5x0.5_AVHRR_simyr1850-2100_c181205.nc lnd/clm2/firedata/clmforc.Li_2018_SSP1_CMIP6_hdm_0.5x0.5_AVHRR_simyr1850-2100_c181205.nc lnd/clm2/firedata/clmforc.Li_2018_SSP2_CMIP6_hdm_0.5x0.5_AVHRR_simyr1850-2100_c181205.nc -lnd/clm2/firedata/clmforc.Li_2025_CMIP7_SSP3CMIP6_hdm_0.5x0.5_simyr1850-2100_c250717.nc +lnd/clm2/firedata/clmforc.Li_2025_CMIP7_SSP3CMIP6_hdm_0.5x0.5_simyr1850-2100_c250717.nc +lnd/clm2/firedata/clmforc.Li_2018_SSP3_CMIP6_hdm_0.5x0.5_AVHRR_simyr1850-2100_c181205.nc lnd/clm2/firedata/clmforc.Li_2018_SSP4_CMIP6_hdm_0.5x0.5_AVHRR_simyr1850-2100_c181205.nc lnd/clm2/firedata/clmforc.Li_2018_SSP4_CMIP6_hdm_0.5x0.5_AVHRR_simyr1850-2100_c181205.nc @@ -2185,14 +2187,16 @@ lnd/clm2/surfdata_esmf/NEON/ctsm5.3.0/surfdata_1x1_NEON_TOOL_hist_2000_78pfts_c2 lnd/clm2/firedata/clmforc.Li_2018_SSP5_CMIP6_hdm_0.5x0.5_AVHRR_simyr1850-2100_c181205.nc -lnd/clm2/firedata/clmforc.Li_2025_CMIP7_SSP3CMIP6_hdm_0.5x0.5_simyr1850-2100_c250717.nc +lnd/clm2/firedata/clmforc.Li_2025_CMIP7_SSP3CMIP6_hdm_0.5x0.5_simyr1850-2100_c250717.nc +lnd/clm2/firedata/clmforc.Li_2017_HYDEv3.2_CMIP6_hdm_0.5x0.5_AVHRR_simyr1850-2016_c180202.nc lnd/clm2/firedata/clmforc.Li_2018_SSP1_CMIP6_hdm_0.5x0.5_AVHRR_simyr1850-2100_c181205.nc lnd/clm2/firedata/clmforc.Li_2018_SSP1_CMIP6_hdm_0.5x0.5_AVHRR_simyr1850-2100_c181205.nc lnd/clm2/firedata/clmforc.Li_2018_SSP2_CMIP6_hdm_0.5x0.5_AVHRR_simyr1850-2100_c181205.nc -lnd/clm2/firedata/clmforc.Li_2025_CMIP7_SSP3CMIP6_hdm_0.5x0.5_simyr1850-2100_c250717.nc +lnd/clm2/firedata/clmforc.Li_2025_CMIP7_SSP3CMIP6_hdm_0.5x0.5_simyr1850-2100_c250717.nc +lnd/clm2/firedata/clmforc.Li_2018_SSP3_CMIP6_hdm_0.5x0.5_AVHRR_simyr1850-2100_c181205.nc lnd/clm2/firedata/clmforc.Li_2018_SSP4_CMIP6_hdm_0.5x0.5_AVHRR_simyr1850-2100_c181205.nc lnd/clm2/firedata/clmforc.Li_2018_SSP4_CMIP6_hdm_0.5x0.5_AVHRR_simyr1850-2100_c181205.nc From 66b83d1d957c9b51fab2664a2e6add4b1354478d Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Fri, 25 Jul 2025 16:40:46 -0600 Subject: [PATCH 020/129] Remove 64bitoffset suffix from finidat to use the unmodified files --- bld/namelist_files/namelist_defaults_ctsm.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index a94c588e4f..5869da9d57 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -1298,14 +1298,14 @@ attributes from the config_cache.xml file (with keys converted to upper-case). ic_ymd="18500101" sim_year="1850" do_transient_pfts=".false." use_excess_ice=".true." ic_tod="0" glc_nec="10" use_crop=".true." irrigate=".false." phys="clm6_0" use_init_interp=".true." ->lnd/clm2/initdata_esmf/ctsm5.4/ctsm53041_54surfdata_snowTherm_100_pSASU.clm2.r.0161-01-01-00000_64bitoffset.nc +>lnd/clm2/initdata_esmf/ctsm5.4/ctsm53041_54surfdata_snowTherm_100_pSASU.clm2.r.0161-01-01-00000.nc lnd/clm2/initdata_esmf/ctsm5.4/ctsm53041_54surfdata_ne30_102_pSASU.clm2.r.0081-01-01-00000_64bitoffset.nc +>lnd/clm2/initdata_esmf/ctsm5.4/ctsm53041_54surfdata_ne30_102_pSASU.clm2.r.0081-01-01-00000.nc Date: Fri, 25 Jul 2025 16:43:10 -0600 Subject: [PATCH 021/129] Remove LII2 tests from expected fails --- cime_config/testdefs/ExpectedTestFails.xml | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/cime_config/testdefs/ExpectedTestFails.xml b/cime_config/testdefs/ExpectedTestFails.xml index ac35ad812e..c899c4937b 100644 --- a/cime_config/testdefs/ExpectedTestFails.xml +++ b/cime_config/testdefs/ExpectedTestFails.xml @@ -98,20 +98,6 @@ - - - FAIL - #3252 - Works with finidat = 'ctsm53041_54surfdata_snowTherm_100_pSASU.clm2.r.0161-01-01-00000.nc' and fails with finidat = 'ctsm53041_54surfdata_snowTherm_100_pSASU.clm2.r.0161-01-01-00000_64bitoffset.nc'. - - - - - FAIL - #3252 - Works with finidat = 'ctsm53041_54surfdata_snowTherm_100_pSASU.clm2.r.0161-01-01-00000.nc' and fails with finidat = 'ctsm53041_54surfdata_snowTherm_100_pSASU.clm2.r.0161-01-01-00000_64bitoffset.nc'. - - FAIL From 2e5e87c7c4ecb91e9f28acf2de4c0dc9d56b8132 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Fri, 25 Jul 2025 17:59:52 -0600 Subject: [PATCH 022/129] For ctsm5.4 replace WhatsNewInCTSM5.3.md with WhatsNewInCTSM5.4.md I used WhatsNewInCTSM5.3.md as the starting point for WhatsNewInCTSM5.4.md and will start modifying in subsequent commits --- WhatsNewInCTSM5.3.md => WhatsNewInCTSM5.4.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename WhatsNewInCTSM5.3.md => WhatsNewInCTSM5.4.md (100%) diff --git a/WhatsNewInCTSM5.3.md b/WhatsNewInCTSM5.4.md similarity index 100% rename from WhatsNewInCTSM5.3.md rename to WhatsNewInCTSM5.4.md From eadb1f77deeac4d398448aa79b19eeae57115675 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Mon, 28 Jul 2025 18:39:52 -0600 Subject: [PATCH 023/129] Draft WhatNewinCTSM54_release_notes (mostly deletes, some additions) --- WhatsNewInCTSM5.4.md | 98 ++++++++++++++------------------------------ 1 file changed, 30 insertions(+), 68 deletions(-) diff --git a/WhatsNewInCTSM5.4.md b/WhatsNewInCTSM5.4.md index 4717deac30..a6282c8d34 100644 --- a/WhatsNewInCTSM5.4.md +++ b/WhatsNewInCTSM5.4.md @@ -1,108 +1,70 @@ -# What's new in CTSM 5.3 (tag `ctsm5.3.021`) +# What's new in CTSM 5.4 (tag `ctsm5.4.0xx`) -## Purpose and description of changes since CTSM 5.2 (tag `ctsm5.2.005`) +## Purpose and description of changes since CTSM 5.3 (tag `ctsm5.3.021`) ### New features -* `manage_externals` replaced by [`git-fleximod`](https://github.com/ESMCI/git-fleximod/blob/main/README.md). ([PR \#2559](https://github.com/ESCOMP/CTSM/pull/2559)) -* No longer runs the 0th time step in first segment of startup and hybrid runs; branch and continue runs never had this 0th time step. ([PR \#2084](https://github.com/ESCOMP/CTSM/pull/2084)) -* New CN Matrix method speeds up spinup for the BGC model. ([PR \#640](https://github.com/ESCOMP/CTSM/pull/640); [Liao et al. 2023](https://agupubs.onlinelibrary.wiley.com/doi/10.1029/2023MS003625)). -* New `Leung_2023` dust emissions. ([PR \#1897](https://github.com/ESCOMP/CTSM/pull/1897); [Leung et al 2023](https://doi.org/10.5194/acp-23-6487-2023), [Leung et al. 2024](https://doi.org/10.5194/acp-24-2287-2024)) -* Explicit air conditioning for the urban model. ([PR \#2275](https://github.com/ESCOMP/CTSM/pull/2275); [Li et al. 2024](https://agupubs.onlinelibrary.wiley.com/share/NY4AYPREB8Y8BUDP7DXD?target=10.1029/2023MS004107)) -* FATES compsets can now be run with transient land use; off by default. ([PR \#2507](https://github.com/ESCOMP/CTSM/pull/2507)) -* Ability to handle CAM7 in `LND_TUNING_MODE`. ([PR \#2632](https://github.com/ESCOMP/CTSM/pull/2632)) +* ### Answer changes Changes to defaults for `clm6_0` physics: -* Urban explicit A/C turned on (links above). -* Snow thermal conductivity method is now `Sturm1997`. ([PR \#2348](https://github.com/ESCOMP/CTSM/pull/2348); see also [discussion \#1960](https://github.com/ESCOMP/CTSM/discussions/1960)) * New initial conditions files for f09 ("1-degree" 1850, 2000), f19 (“2-degree” 1850), and ne30 (1850, 1979, 2000) resolutions. -* New crop calendars. ([PR \#2664](https://github.com/ESCOMP/CTSM/pull/2664); informed by [Rabin et al., 2023](https://gmd.copernicus.org/articles/16/7253/2023/gmd-16-7253-2023.html)) -* Dust emissions method is now `Leung_2023` (links above). -* Excess ice is turned on. ([PR \#1787](https://github.com/ESCOMP/CTSM/pull/1787)) -* Updates to MEGAN for BVOCs. ([PR \#2588](https://github.com/ESCOMP/CTSM/pull/2588)) -* New BGC fire method `li2024crujra`: Avoid crop fires during growing season; allow lightning ignitions in tropical closed forests; add effect of landscape fragmentation on ignitions and duration; recalibrate against GFED5 burned area and with CRU-JRA climate. ([PR \#2684](https://github.com/ESCOMP/CTSM/pull/2684), [PR \#2711](https://github.com/ESCOMP/CTSM/pull/2711), [PR \#2715](https://github.com/ESCOMP/CTSM/issues/2715)) +* Updates to MEGAN for BVOCs. ([PR \#xxxx](https://github.com/ESCOMP/CTSM/pull/xxxx)) Changes for all physics versions: -* Parameters updated for CRU-JRA forcing: PPE-based modifications were made to the parameters `leafcn`, `slatop`, `froot_leaf`, `medlynslope`, and `kmax`. Lowers LAI and biomass in boreal and tropical forests, without reducing latent heat in the tropics. Affected PFTs: NET temperate, NET boreal, BET tropical, BDS boreal, C3 arctic grass. ([PR \#2500](https://github.com/ESCOMP/CTSM/pull/2500)) -* FATES parameter file updated (see section below). -* Pass active glacier (CISM) runoff directly to river model (MOSART) ([MOSART PR \#94](https://github.com/ESCOMP/MOSART/pull/94)) +* Parameters updated: PPE-based modifications were made to the parameters `xxxx`. ([PR \#xxxx](https://github.com/ESCOMP/CTSM/pull/xxxx)) +* FATES parameter file updated? * New surface datasets and landuse timeseries files (see section below). -* CNMatrix is new default spinup method (links above). ### Heads up -* Small glacier changes mean that you can’t use a 5.3 surface dataset with pre-5.3 code and vice versa anymore. (Merged with [PR \#2500](https://github.com/ESCOMP/CTSM/pull/2500)) -* Updates the definition of history variable “time” from *end* of `time_bounds` to *middle* of `time_bounds`. ([PR \#2838](https://github.com/ESCOMP/CTSM/pull/2838); see section below) -* Standardizes history variable attributes and a history dimension name. ([PR \#2052](https://github.com/ESCOMP/CTSM/pull/2052); see section below) +* History tapes now split into two files from hX to hXi and hXa, where X is the tape number (e.g. h0i/h0a) and where "i" stands for history file containing instantaneous fields, while "a" stands for history file containing non-instantaneous fields. Details below and in the PRs [\#2445](https://github.com/ESCOMP/ctsm/pull/2445) [\#117](https://github.com/ESCOMP/MOSART/pull/117) [\#61](https://github.com/ESCOMP/RTM/pull/61) and the correspondng issues. ## ## Additional detail -### Changes related to time and history files +### Changes related to history files (Note that the same information in this section applies to MOSART and RTM.) -Startup and hybrid runs no longer run the 0th time step, consistent with the same change in CAM. (Branch and continue runs never had this 0th time step.) This means you will not get an extraneous initial history file anymore. In some circumstances this may also affect the names of history files. +Following ctsm5.3.018 "Change history time to be the middle of the time bounds" and to keep CLM history consistent with CAM history, the CTSM5.4 change intends to prevent confusion associated with the time corresponding to instantaneous history fields by putting them on separate files than non-instantaneous fields. The result is -In most cases, the history `time` variable is now defined as the middle of a history file’s `time_bounds` instead of the end, for consistency with the same change in CAM. The exception is if you specify `hist_avgflag_pertape = 'I'` for that file, in which case it will be treated as an “instantaneous” file. Instantaneous history files (a) have their `time` coordinate set to the end of the last timestep (as did all history files before this tag) and (b) do not include `time_bounds`. +1) two history files per clm, mosart, and rtm history tape: + tape h0 becomes h0a and h0i + tape h1 becomes h1a and h1i + ... + tape hX becomes hXa and hXi -The history dimension name `hist_interval` (of output variable `time_bounds`) is standardized to be `nbnd`. History variables `time_bounds`, `mcdate`, `mcsec`, `mdcur`, and `mscur` are standardized to include the calendar attribute. +2) two history restart files per history restart tape: + rh0 becomes rh0a and rh0i + rh1 becomes rh1a and rh1i + ... + rhX becomes rhXa and rhXi -### New surface datasets and landuse timeseries files ([PR \#2500](https://github.com/ESCOMP/CTSM/pull/2500)) +The CLM handles empty history (and corresponding history restart) files by not generating them, while rtm and mosart give an error. Instead of refactoring rtm and mosart to behave like the clm (considered out of scope), we have introduced one active instantaneous field in mosart and one in rtm to bypass the "empty file" error. -* Transient landuse timeseries files going back to 1700 now possible (and made for f09). -* Fix an important bug on soil fields that was there since `ctsm5.2.0`. This has the side effect of `mksurfdata_esmf` now giving identical answers with a change in number of processors, as it should. ([Issue \#2744](https://github.com/ESCOMP/CTSM/issues/2744)) -* Surface datasets now provided for the `ne0np4.POLARCAP.ne30x4` grid. ([PR \#2716](https://github.com/ESCOMP/CTSM/pull/2716), [issue \#2720](https://github.com/ESCOMP/CTSM/issues/2720)) -* Surface datasets now have their version number embedded to prevent mismatch of surface dataset and CTSM version. ([Issue \#2723](https://github.com/ESCOMP/CTSM/issues/2723)) -* Remove outdated hydrology `VIC` (Variable Infiltration Capacity Hydrology model) fields from surface datasets. +### New surface datasets and landuse timeseries files ([PR \#xxxx](https://github.com/ESCOMP/CTSM/pull/xxxx)) + +* Transient landuse timeseries files going back to 1700 made for f09. +* Surface datasets now provided for the `xxxx` grid. ([PR \#xxxx](https://github.com/ESCOMP/CTSM/pull/xxxx), [issue \#xxxx](https://github.com/ESCOMP/CTSM/issues/xxxx)) * Updates to input datasets: - * PFT/LAI/soil-color raw datasets; now from the TRENDY2024 timeseries that ends in 2023. (Issues [\#2570](https://github.com/ESCOMP/CTSM/issues/2570) and [\#2452](https://github.com/ESCOMP/CTSM/issues/2452)) - * Two fire datasets: crop fire peak month and peatland fraction. (Issue [\#2618](https://github.com/ESCOMP/CTSM/issues/2618)) - * Glacier behavior dataset (related to how non-Greenland glaciers are handled). (Issue [\#423](https://github.com/ESCOMP/CTSM/issues/423)) + * PFT/LAI/soil-color raw datasets; now from the xxxx timeseries that ends in 2023. (Issues [\#xxxx](https://github.com/ESCOMP/CTSM/issues/xxxx) + * Two fire datasets: crop fire peak month and population density. (Issue [\#xxxx](https://github.com/ESCOMP/CTSM/issues/xxxx)) ### Changes to FATES parameter file -* [PR \#2507](https://github.com/ESCOMP/CTSM/pull/2507) ([ctsm5.2.013](https://github.com/ESCOMP/CTSM/releases/tag/ctsm5.2.013)) / [FATES PR \#1116](https://github.com/NGEET/fates/pull/1116) ([sci.1.77.1\_api.36.0.0](https://github.com/NGEET/fates/releases/tag/sci.1.77.0_api.36.0.0)) - * Adds new parameters for new land use harvest mode and land use by PFT capabilities -* [PR \#2700](https://github.com/ESCOMP/CTSM/pull/2700) ([ctsm5.3.003](https://github.com/ESCOMP/CTSM/releases/tag/ctsm5.3.003)) / [FATES PR \#1255](https://github.com/NGEET/fates/pull/1255) ([sci.1.78.3\_api.36.1.0](https://github.com/NGEET/fates/releases/tag/sci.1.78.3_api.36.1.0)) - * Adds two arctic shrub PFTs, increasing the number of default PFTs to 14 and update arctic grass parameters ([FATES PR\#1236](https://github.com/NGEET/fates/pull/1236)) - * Splits `fates_turnover_leaf` parameter into canopy and understory specific turnover rates and provides new values for both ([FATES PR\#1136](https://github.com/NGEET/fates/pull/1136)) - * Updates grass allometry parameters ([FATES PR\#1206](https://github.com/NGEET/fates/pull/1206)) - * Changes the prescribe nutrient uptake defaults from 1 to 0 for all PFTs (only relevant to ELM-FATES) + * ### Changes to rpointer files -The rpointer files are simple text files that CESM uses to keep track of how far simulations have progressed, pointing to the filename of the latest restart file for that component. There is one such file for each component, so for CTSM `I` cases that's `lnd`, `cpl`, and `atm` (and `rof` if it's active). Normally, when the user is just extending the length of simulations, there’s no need to worry about these files. - -However, if there was a problem when a simulation shut down, it's possible that different components will have mismatched restarts and rpointer files. In the past, this meant figuring out what restart file should be pointed to in each component rpointer file and correcting it by hand in an editor. There was only the final set of rpointer files that was kept for a case. - -Now, with this update, the `lnd`, `cpl`, and `atm` rpointer files have the simulation date in the filenames, so it's easy to spot if the restarts are mismatched for one of the components. Also, since there are matching rpointer files for each time restarts are created, it's now easier to (a) make sure restarts and rpointer files are all correctly matched and (b) for a user to take a set of restarts and matching rpointer files to start up from for any part of an existing simulation. This means you don't have to hand-edit the rpointer files, making sure you don't make a mistake when you do. - -Old rpointer filenames: - -* `rpointer.atm` -* `rpointer.cpl` -* `rpointer.lnd` - -New names: - -* `rpointer.atm.YYYY-MM-DD-SSSSS` -* `rpointer.cpl.YYYY-MM-DD-SSSSS` -* `rpointer.lnd.YYYY-MM-DD-SSSSS` - -Where `YYYY-MM-DD-SSSSS` is the year, month, day, and seconds into the day for the simulation timestamp. For example, `rpointer.lnd.2000-01-01-00000` for a rpointer file for starting at midnight (beginning of the day) on January 1st, 2000\. - -Note that this is backwards-compatible, so for all the components you can use either the new or old format for the rpointer filenames. Thus, if you are restarting from an existing case before `ctsm5.3.016`, you CAN use the rpointer filenames that don't have the timestamps in the name. ## Simulations supporting this release -- f19 `Clm60Bgc` 16pft: [https://github.com/NCAR/LMWG\_dev/issues/70](https://github.com/NCAR/LMWG_dev/issues/70) -- f09 with `Clm60BgcCrop`: [https://github.com/NCAR/LMWG\_dev/issues/69](https://github.com/NCAR/LMWG_dev/issues/69) -- ne30 with `Clm60BgcCrop`: [https://github.com/NCAR/LMWG\_dev/issues/68](https://github.com/NCAR/LMWG_dev/issues/68) +- f19 `Clm60Bgc` 16pft: [https://github.com/NCAR/LMWG\_dev/issues/xxx](https://github.com/NCAR/LMWG_dev/issues/xxx) +- f09 with `Clm60BgcCrop`: [https://github.com/NCAR/LMWG\_dev/issues/xxx](https://github.com/NCAR/LMWG_dev/issues/xxx) +- ne30 with `Clm60BgcCrop`: [https://github.com/NCAR/LMWG\_dev/issues/xxx](https://github.com/NCAR/LMWG_dev/issues/xxx) -Note: Dust emissions in CTSM 5.3 will be different from the above simulations because of a tuning update that came in after those. \ No newline at end of file From 50c7143053a0e9d2c228442563d3d8358c7a1fb1 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Tue, 29 Jul 2025 13:50:50 -0600 Subject: [PATCH 024/129] Draft WhatsNewInCTSM5.4.md with ChangeLog info from ctsm5.3.022 to .065 --- WhatsNewInCTSM5.4.md | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/WhatsNewInCTSM5.4.md b/WhatsNewInCTSM5.4.md index a6282c8d34..62e1e45416 100644 --- a/WhatsNewInCTSM5.4.md +++ b/WhatsNewInCTSM5.4.md @@ -2,21 +2,32 @@ ## Purpose and description of changes since CTSM 5.3 (tag `ctsm5.3.021`) +REMOVE THESE NOTES WHEN DONE AND READY TO RELEASE +- As of 2025/7/29 slevis has gone through the ChangeLog from cctsm5.3.022 to ctsm5.3.065 +- Ask for reviewers to browse/read this doc for accuracy, omissions, and redundancies +- For omissions, request contributions from the relevant developers + ### New features -* +* Can now choose the CRUJRA2024 atmospheric driver data with clm6 and clm5 [PR \#2956](https://github.com/ESCOMP/ctsm/pull/2956)) +* Can now run PLUMBER towers, similar to the NEON tower capability ([issue \#1487](https://github.com/ESCOMP/CTSM/issues/1487)) +* New namelist variables `snow_thermal_cond_glc_method` and `snow_thermal_cond_lake_method` ([PR \#3072](https://https://github.com/ESCOMP/CTSM/pull/3072)) +* Potentially time-evolving `leafcn_target` replaces time-constant `leafcn`: the former is calculated as a function of the latter and can be time-evolving depending on new paramfile parameter `leafcn_co2_slope` ([PR \#1654](https://github.com/ESCOMP/ctsm/pull/1654) +* Easier, more flexible use of anomaly forcings for ISSP cases ([PR \#2686](https://github.com/ESCOMP/CTSM/pull/2686) [PR \#3212](https://github.com/ESCOMP/CTSM/pull/3212)) +* New equilibrium script in /tools/contrib for spectral element grids ([PR \#2991](https://github.com/ESCOMP/ctsm/pull/2991)) ### Answer changes Changes to defaults for `clm6_0` physics: -* New initial conditions files for f09 ("1-degree" 1850, 2000), f19 (“2-degree” 1850), and ne30 (1850, 1979, 2000) resolutions. -* Updates to MEGAN for BVOCs. ([PR \#xxxx](https://github.com/ESCOMP/CTSM/pull/xxxx)) +* Bytnerowicz is now the default nfix_method for clm6 ([PR \#2972](https://github.com/ESCOMP/ctsm/pull/2972)) +* New initial conditions files for f09 ("1-degree" 1850, 2000), f19 (“2-degree” 1850), and ne30 (1850, 1979, 2000) resolutions? +* Updates to MEGAN for BVOCs ([PR \#3065](https://github.com/ESCOMP/CTSM/pull/3065) [PR \#3309](https://github.com/ESCOMP/CTSM/pull/3309)) Changes for all physics versions: -* Parameters updated: PPE-based modifications were made to the parameters `xxxx`. ([PR \#xxxx](https://github.com/ESCOMP/CTSM/pull/xxxx)) -* FATES parameter file updated? +* Parameters updated: Added MIMICS parameter `mimics_fi`. ([PR \#2365](https://github.com/ESCOMP/CTSM/pull/2365)) +* FATES parameter file updated: ([PR \#2965](https://github.com/ESCOMP/CTSM/pull/2965) [PR \#2904](https://github.com/ESCOMP/CTSM/pull/2904) [PR \#1344](https://https://github.com/NGEET/fates/pull/1344) [PR \#3087](https://github.com/ESCOMP/CTSM/pull/3087)) * New surface datasets and landuse timeseries files (see section below). ### Heads up From 5cc650ad26d6435b0600a31476e5cda1fe05207c Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Tue, 12 Aug 2025 10:15:30 -0600 Subject: [PATCH 025/129] defo_fire_precip_thresh_bet now 3.0 for li2024crujra. --- bld/namelist_files/namelist_defaults_ctsm.xml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index 62f57db777..28bf786dfb 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -257,11 +257,13 @@ attributes from the config_cache.xml file (with keys converted to upper-case). li2014qianfrc 90.d00 -4.0d00 1.8d00 0.3d00 1.0d00 +4.0d00 +3.0d00 + 30.0d00 80.0d00 0.3d00 From b1a9acdc0bdf60107c637a1b0f7797fd922652e1 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Tue, 12 Aug 2025 10:16:21 -0600 Subject: [PATCH 026/129] cropfire_a1 now 0.32 for li2024crujra. --- bld/namelist_files/namelist_defaults_ctsm.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index 28bf786dfb..e198eaf7dc 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -385,7 +385,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). 0.28d-4 0.010d00 0.71d-4 -0.3d00 +0.32d00 0.33d00 75.d00 825.d00 From dec813122e2e64b646109a8cd7bb825dfe5c996a Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Tue, 12 Aug 2025 10:18:33 -0600 Subject: [PATCH 027/129] CNFireLi2024Mod: Improve comments. --- src/biogeochem/CNFireLi2024Mod.F90 | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/biogeochem/CNFireLi2024Mod.F90 b/src/biogeochem/CNFireLi2024Mod.F90 index a516600461..c95b0332af 100644 --- a/src/biogeochem/CNFireLi2024Mod.F90 +++ b/src/biogeochem/CNFireLi2024Mod.F90 @@ -181,7 +181,7 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ defo_fire_precip_thresh_bdt => cnfire_const%defo_fire_precip_thresh_bdt, & ! Input: [real(r8) ] (mm/day) Max running mean daily precip allowing deforestation fire for broadleaf deciduous trees borpeat_fire_soilmoist_denom => cnfire_const%borpeat_fire_soilmoist_denom, & ! Input: [real(r8) ] (unitless) Denominator of exponential in soil moisture term of equation relating that and temperature to boreal peat fire (unitless) nonborpeat_fire_precip_denom => cnfire_const%nonborpeat_fire_precip_denom, & ! Input: [real(r8) ] (unitless) Denominator of precipitation in equation relating that to non-boreal peat fire (unitless) - forc_topo_g => atm2lnd_inst%forc_topo_grc , & ! Input: [real(r8) (:) ] atmospheric surface height (m) + forc_topo_g => atm2lnd_inst%forc_topo_grc , & ! Input: [real(r8) (:) ] atmospheric surface height, a.k.a. elevation (m) fsr_pft => pftcon%fsr_pft , & ! Input: fd_pft => pftcon%fd_pft , & ! Input: rswf_min => pftcon%rswf_min , & ! Input: @@ -303,7 +303,7 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ if( patch%itype(p) > nc4_grass )then cropf_col(c) = cropf_col(c) + patch%wtcol(p) end if - ! For natural vegetation + ! Exclude crops and bare soil if (patch%itype(p) <= nc4_grass .and. patch%itype(p) >= ndllf_evr_tmp_tree) then lfwt(c) = lfwt(c) + patch%wtgcell(p) end if @@ -621,11 +621,14 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ cnfire_params%ignition_efficiency*(1._r8-fs)* & (lfwt(c)**0.5) end if + + ! Reduce burnability at high elevations if(forc_topo_g(g) <= 2500._r8)then !influence of topography on fires topoi = 1._r8 else topoi = 0.004_r8 end if + nfire(c) = ig/secsphr*fb*fire_m*lgdp_col(c) * topoi !fire counts/km2/sec Lb_lf = 1._r8+10._r8*(1._r8-EXP(-0.06_r8*forc_wind(g))) spread_m = fire_m**0.5_r8 From cfb46480ad4d604c6239efbe0965dc680ad256d7 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Tue, 12 Aug 2025 10:23:41 -0600 Subject: [PATCH 028/129] cli_scale updated for li2024* fire methods. --- bld/namelist_files/namelist_defaults_ctsm.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index e198eaf7dc..2df3d9bd83 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -362,7 +362,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). 80.0d00 0.85d00 0.98d00 -0.01d00 +0.04d00 0.28d-4 0.010d00 0.71d-4 @@ -381,7 +381,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). 85.0d00 0.85d00 0.98d00 -0.01d00 +0.03d00 0.28d-4 0.010d00 0.71d-4 From 8fa074705eaa76cca22855f53404e394c04f83fe Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Fri, 15 Aug 2025 15:18:15 -0600 Subject: [PATCH 029/129] Set init_interp_fill_missing_urban_with_HD = .true. always --- bld/CLMBuildNamelist.pm | 1 + bld/namelist_files/namelist_defaults_ctsm.xml | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index 4cd02532f8..fad6fb6f46 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -2359,6 +2359,7 @@ sub setup_logic_urban { add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'urban_hac'); add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'urban_explicit_ac'); add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'urban_traffic'); + add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'init_interp_fill_missing_urban_with_HD'); } #------------------------------------------------------------------------------- diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index 62f57db777..2087179d5d 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -2500,6 +2500,10 @@ lnd/clm2/surfdata_esmf/NEON/ctsm5.3.0/surfdata_1x1_NEON_TOOL_hist_2000_78pfts_c2 general + +.true. + From 57c4a154fd10156a35aed8933c62d94806a4b53d Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Fri, 22 Aug 2025 15:57:22 -0600 Subject: [PATCH 030/129] Update clm6_0 paramfile with Fang's fire changes. * needleleaf_deciduous_boreal_tree rswf_min: 0.15 to 0.35 * needleleaf_deciduous_boreal_tree rswf_max: 0.55 to 0.7 * fd_pft (fire duration): Increase from 1 to 5 days * fsr_pft (fire spread rate): Divide by 5 "The parameters rswf_max and rswf_min (thresholds for root-zone soil moisture) were adjusted to achieve more reasonable simulations of burned area fraction for needleleaf_deciduous_boreal_tree. The value of fd_pft (fire duration) was changed from 1 to 5 days, which aligns better with FireAtlas data for non-peat and non-deforestation fires outside croplands. To maintain the burned area unchanged, fsr_pft (fire spread rate) for most PFTs was divided by 5. fsr_pft is not used for prognostic crops, so its value for those PFTs was set to the fill value." --- bld/namelist_files/namelist_defaults_ctsm.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index 24744ed8fa..aaf4ec77a0 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -549,7 +549,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). -lnd/clm2/paramdata/ctsm5.3.041.Nfix_params.v13.c250221_upplim250.nc +lnd/clm2/paramdata/clm60_params.ctsm6_li2024.c250822.nc lnd/clm2/paramdata/clm50_params.c250311.nc lnd/clm2/paramdata/clm45_params.c250311.nc From baa76603c1282b1782bb4446f1abf43ffbb9f933 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Fri, 22 Aug 2025 16:15:34 -0600 Subject: [PATCH 031/129] CNFireLi2024Mod: Delete ">10% crop" condition. No longer needed now that ESCOMP/CTSM#3188 is resolved. --- src/biogeochem/CNFireLi2024Mod.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/biogeochem/CNFireLi2024Mod.F90 b/src/biogeochem/CNFireLi2024Mod.F90 index c95b0332af..d4c05f63bc 100644 --- a/src/biogeochem/CNFireLi2024Mod.F90 +++ b/src/biogeochem/CNFireLi2024Mod.F90 @@ -522,7 +522,7 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ ! avoid abm (crop fire peak month) regridding error from 0.05 degree to lower resolution ! The condition could be removed if CLM supports the use of mode in abm inputs regridding if( forc_t(c) >= SHR_CONST_TKFRZ .and. patch%itype(p) > nc4_grass .and. & - kmo == abm_lf(c) .and. cropf_col(c) * col%wtgcell(c) > 0.1_r8 .and. & + kmo == abm_lf(c) .and. & burndate(p) >= 999 .and. patch%wtcol(p) > 0._r8 )then ! catch crop burn time hdmlf = this%forc_hdm(g) From 71f96808c0dab738f5c72dae3bd38ba584b0df2e Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Fri, 22 Aug 2025 16:19:50 -0600 Subject: [PATCH 032/129] li2024crujra cropfire_a1: was 0.32, now 0.34. --- bld/namelist_files/namelist_defaults_ctsm.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index aaf4ec77a0..12a0f2f981 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -385,7 +385,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). 0.28d-4 0.010d00 0.71d-4 -0.32d00 +0.34d00 0.33d00 75.d00 825.d00 From 9c59d7e9d5f06cc58ed00d4becb42d85e7ee4e5d Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Mon, 25 Aug 2025 13:26:21 -0600 Subject: [PATCH 033/129] namelist_defaults_ctsm.xml: Group stream_fldfilename_cultivar_gdds lines. --- bld/namelist_files/namelist_defaults_ctsm.xml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index 2087179d5d..0224395a1c 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -2074,20 +2074,23 @@ lnd/clm2/surfdata_esmf/NEON/ctsm5.3.0/surfdata_1x1_NEON_TOOL_hist_2000_78pfts_c2 2000 2000 + +lnd/clm2/cropdata/calendars/processed/gdds_20230829_161011.tweaked_latlons.nc +lnd/clm2/cropdata/calendars/processed/gdds_20230829_161011.tweaked_latlons.nc + lnd/clm2/cropdata/calendars/processed/swindow_starts_ggcmi_crop_calendar_phase3_v1.01.2000-2000.20231005_145103.tweaked_latlons.nc lnd/clm2/cropdata/calendars/processed/swindow_ends_ggcmi_crop_calendar_phase3_v1.01.2000-2000.20231005_145103.tweaked_latlons.nc -lnd/clm2/cropdata/calendars/processed/gdds_20230829_161011.tweaked_latlons.nc lnd/clm2/cropdata/calendars/processed/360x720_120830_ESMFmesh_c20210507_cdf5.tweaked_latlons.nc lnd/clm2/cropdata/calendars/processed/swindow_starts_ggcmi_crop_calendar_phase3_v1.01.2000-2000.20231005_145103.tweaked_latlons.nc lnd/clm2/cropdata/calendars/processed/swindow_ends_ggcmi_crop_calendar_phase3_v1.01.2000-2000.20231005_145103.tweaked_latlons.nc -lnd/clm2/cropdata/calendars/processed/gdds_20230829_161011.tweaked_latlons.nc lnd/clm2/cropdata/calendars/processed/20230714_cropcals_pr2_1deg.actually2deg.1980-2009.from_GDDB20.interpd_halfdeg.tweaked_latlons.nc lnd/clm2/cropdata/calendars/processed/gdd20bl.copied_from.gdds_20230829_161011.v2.tweaked_latlons.nc lnd/clm2/cropdata/calendars/processed/sdates_ggcmi_crop_calendar_phase3_v1.01_nninterp-hcru_hcru_mt13.2000-2000.20230728_165845.tweaked_latlons.nc lnd/clm2/cropdata/calendars/processed/hdates_ggcmi_crop_calendar_phase3_v1.01_nninterp-hcru_hcru_mt13.2000-2000.20230728_165845.tweaked_latlons.nc lnd/clm2/cropdata/calendars/processed/360x720_120830_ESMFmesh_c20210507_cdf5.tweaked_latlons.nc + none From f4694d7c62bccfb702b72e8c3bf0c3da0a1f8c8d Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Mon, 25 Aug 2025 13:33:31 -0600 Subject: [PATCH 034/129] Update default stream_fldfilename_cultivar_gdds. With cropcals_rx true, now uses maturity requirements derived from a CRU-JRA run... Unless using a GSWP3 compset (via lnd_tuning_mode), in which case the previous files are used. --- bld/namelist_files/namelist_defaults_ctsm.xml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index 0224395a1c..871a499f0d 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -2075,7 +2075,10 @@ lnd/clm2/surfdata_esmf/NEON/ctsm5.3.0/surfdata_1x1_NEON_TOOL_hist_2000_78pfts_c2 2000 -lnd/clm2/cropdata/calendars/processed/gdds_20230829_161011.tweaked_latlons.nc +lnd/clm2/cropdata/calendars/processed/gdds_20250809_025305.tweaked_latlons.nc +lnd/clm2/cropdata/calendars/processed/gdds_20230829_161011.tweaked_latlons.nc +lnd/clm2/cropdata/calendars/processed/gdds_20230829_161011.tweaked_latlons.nc +lnd/clm2/cropdata/calendars/processed/gdds_20230829_161011.tweaked_latlons.nc lnd/clm2/cropdata/calendars/processed/gdds_20230829_161011.tweaked_latlons.nc From 5510a7e3569c0ad6770097cc58e1a92d02b9adf7 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Tue, 26 Aug 2025 18:09:59 -0600 Subject: [PATCH 035/129] Bring back WhatsNewInCTSM5.3.md but in the /doc directory --- doc/WhatsNewInCTSM5.3.md | 108 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 108 insertions(+) create mode 100644 doc/WhatsNewInCTSM5.3.md diff --git a/doc/WhatsNewInCTSM5.3.md b/doc/WhatsNewInCTSM5.3.md new file mode 100644 index 0000000000..4717deac30 --- /dev/null +++ b/doc/WhatsNewInCTSM5.3.md @@ -0,0 +1,108 @@ +# What's new in CTSM 5.3 (tag `ctsm5.3.021`) + +## Purpose and description of changes since CTSM 5.2 (tag `ctsm5.2.005`) + +### New features + +* `manage_externals` replaced by [`git-fleximod`](https://github.com/ESMCI/git-fleximod/blob/main/README.md). ([PR \#2559](https://github.com/ESCOMP/CTSM/pull/2559)) +* No longer runs the 0th time step in first segment of startup and hybrid runs; branch and continue runs never had this 0th time step. ([PR \#2084](https://github.com/ESCOMP/CTSM/pull/2084)) +* New CN Matrix method speeds up spinup for the BGC model. ([PR \#640](https://github.com/ESCOMP/CTSM/pull/640); [Liao et al. 2023](https://agupubs.onlinelibrary.wiley.com/doi/10.1029/2023MS003625)). +* New `Leung_2023` dust emissions. ([PR \#1897](https://github.com/ESCOMP/CTSM/pull/1897); [Leung et al 2023](https://doi.org/10.5194/acp-23-6487-2023), [Leung et al. 2024](https://doi.org/10.5194/acp-24-2287-2024)) +* Explicit air conditioning for the urban model. ([PR \#2275](https://github.com/ESCOMP/CTSM/pull/2275); [Li et al. 2024](https://agupubs.onlinelibrary.wiley.com/share/NY4AYPREB8Y8BUDP7DXD?target=10.1029/2023MS004107)) +* FATES compsets can now be run with transient land use; off by default. ([PR \#2507](https://github.com/ESCOMP/CTSM/pull/2507)) +* Ability to handle CAM7 in `LND_TUNING_MODE`. ([PR \#2632](https://github.com/ESCOMP/CTSM/pull/2632)) + +### Answer changes + +Changes to defaults for `clm6_0` physics: + +* Urban explicit A/C turned on (links above). +* Snow thermal conductivity method is now `Sturm1997`. ([PR \#2348](https://github.com/ESCOMP/CTSM/pull/2348); see also [discussion \#1960](https://github.com/ESCOMP/CTSM/discussions/1960)) +* New initial conditions files for f09 ("1-degree" 1850, 2000), f19 (“2-degree” 1850), and ne30 (1850, 1979, 2000) resolutions. +* New crop calendars. ([PR \#2664](https://github.com/ESCOMP/CTSM/pull/2664); informed by [Rabin et al., 2023](https://gmd.copernicus.org/articles/16/7253/2023/gmd-16-7253-2023.html)) +* Dust emissions method is now `Leung_2023` (links above). +* Excess ice is turned on. ([PR \#1787](https://github.com/ESCOMP/CTSM/pull/1787)) +* Updates to MEGAN for BVOCs. ([PR \#2588](https://github.com/ESCOMP/CTSM/pull/2588)) +* New BGC fire method `li2024crujra`: Avoid crop fires during growing season; allow lightning ignitions in tropical closed forests; add effect of landscape fragmentation on ignitions and duration; recalibrate against GFED5 burned area and with CRU-JRA climate. ([PR \#2684](https://github.com/ESCOMP/CTSM/pull/2684), [PR \#2711](https://github.com/ESCOMP/CTSM/pull/2711), [PR \#2715](https://github.com/ESCOMP/CTSM/issues/2715)) + +Changes for all physics versions: + +* Parameters updated for CRU-JRA forcing: PPE-based modifications were made to the parameters `leafcn`, `slatop`, `froot_leaf`, `medlynslope`, and `kmax`. Lowers LAI and biomass in boreal and tropical forests, without reducing latent heat in the tropics. Affected PFTs: NET temperate, NET boreal, BET tropical, BDS boreal, C3 arctic grass. ([PR \#2500](https://github.com/ESCOMP/CTSM/pull/2500)) +* FATES parameter file updated (see section below). +* Pass active glacier (CISM) runoff directly to river model (MOSART) ([MOSART PR \#94](https://github.com/ESCOMP/MOSART/pull/94)) +* New surface datasets and landuse timeseries files (see section below). +* CNMatrix is new default spinup method (links above). + +### Heads up + +* Small glacier changes mean that you can’t use a 5.3 surface dataset with pre-5.3 code and vice versa anymore. (Merged with [PR \#2500](https://github.com/ESCOMP/CTSM/pull/2500)) +* Updates the definition of history variable “time” from *end* of `time_bounds` to *middle* of `time_bounds`. ([PR \#2838](https://github.com/ESCOMP/CTSM/pull/2838); see section below) +* Standardizes history variable attributes and a history dimension name. ([PR \#2052](https://github.com/ESCOMP/CTSM/pull/2052); see section below) + +## + +## Additional detail + +### Changes related to time and history files + +(Note that the same information in this section applies to MOSART and RTM.) + +Startup and hybrid runs no longer run the 0th time step, consistent with the same change in CAM. (Branch and continue runs never had this 0th time step.) This means you will not get an extraneous initial history file anymore. In some circumstances this may also affect the names of history files. + +In most cases, the history `time` variable is now defined as the middle of a history file’s `time_bounds` instead of the end, for consistency with the same change in CAM. The exception is if you specify `hist_avgflag_pertape = 'I'` for that file, in which case it will be treated as an “instantaneous” file. Instantaneous history files (a) have their `time` coordinate set to the end of the last timestep (as did all history files before this tag) and (b) do not include `time_bounds`. + +The history dimension name `hist_interval` (of output variable `time_bounds`) is standardized to be `nbnd`. History variables `time_bounds`, `mcdate`, `mcsec`, `mdcur`, and `mscur` are standardized to include the calendar attribute. + +### New surface datasets and landuse timeseries files ([PR \#2500](https://github.com/ESCOMP/CTSM/pull/2500)) + +* Transient landuse timeseries files going back to 1700 now possible (and made for f09). +* Fix an important bug on soil fields that was there since `ctsm5.2.0`. This has the side effect of `mksurfdata_esmf` now giving identical answers with a change in number of processors, as it should. ([Issue \#2744](https://github.com/ESCOMP/CTSM/issues/2744)) +* Surface datasets now provided for the `ne0np4.POLARCAP.ne30x4` grid. ([PR \#2716](https://github.com/ESCOMP/CTSM/pull/2716), [issue \#2720](https://github.com/ESCOMP/CTSM/issues/2720)) +* Surface datasets now have their version number embedded to prevent mismatch of surface dataset and CTSM version. ([Issue \#2723](https://github.com/ESCOMP/CTSM/issues/2723)) +* Remove outdated hydrology `VIC` (Variable Infiltration Capacity Hydrology model) fields from surface datasets. +* Updates to input datasets: + * PFT/LAI/soil-color raw datasets; now from the TRENDY2024 timeseries that ends in 2023. (Issues [\#2570](https://github.com/ESCOMP/CTSM/issues/2570) and [\#2452](https://github.com/ESCOMP/CTSM/issues/2452)) + * Two fire datasets: crop fire peak month and peatland fraction. (Issue [\#2618](https://github.com/ESCOMP/CTSM/issues/2618)) + * Glacier behavior dataset (related to how non-Greenland glaciers are handled). (Issue [\#423](https://github.com/ESCOMP/CTSM/issues/423)) + +### Changes to FATES parameter file + +* [PR \#2507](https://github.com/ESCOMP/CTSM/pull/2507) ([ctsm5.2.013](https://github.com/ESCOMP/CTSM/releases/tag/ctsm5.2.013)) / [FATES PR \#1116](https://github.com/NGEET/fates/pull/1116) ([sci.1.77.1\_api.36.0.0](https://github.com/NGEET/fates/releases/tag/sci.1.77.0_api.36.0.0)) + * Adds new parameters for new land use harvest mode and land use by PFT capabilities +* [PR \#2700](https://github.com/ESCOMP/CTSM/pull/2700) ([ctsm5.3.003](https://github.com/ESCOMP/CTSM/releases/tag/ctsm5.3.003)) / [FATES PR \#1255](https://github.com/NGEET/fates/pull/1255) ([sci.1.78.3\_api.36.1.0](https://github.com/NGEET/fates/releases/tag/sci.1.78.3_api.36.1.0)) + * Adds two arctic shrub PFTs, increasing the number of default PFTs to 14 and update arctic grass parameters ([FATES PR\#1236](https://github.com/NGEET/fates/pull/1236)) + * Splits `fates_turnover_leaf` parameter into canopy and understory specific turnover rates and provides new values for both ([FATES PR\#1136](https://github.com/NGEET/fates/pull/1136)) + * Updates grass allometry parameters ([FATES PR\#1206](https://github.com/NGEET/fates/pull/1206)) + * Changes the prescribe nutrient uptake defaults from 1 to 0 for all PFTs (only relevant to ELM-FATES) + +### Changes to rpointer files + +The rpointer files are simple text files that CESM uses to keep track of how far simulations have progressed, pointing to the filename of the latest restart file for that component. There is one such file for each component, so for CTSM `I` cases that's `lnd`, `cpl`, and `atm` (and `rof` if it's active). Normally, when the user is just extending the length of simulations, there’s no need to worry about these files. + +However, if there was a problem when a simulation shut down, it's possible that different components will have mismatched restarts and rpointer files. In the past, this meant figuring out what restart file should be pointed to in each component rpointer file and correcting it by hand in an editor. There was only the final set of rpointer files that was kept for a case. + +Now, with this update, the `lnd`, `cpl`, and `atm` rpointer files have the simulation date in the filenames, so it's easy to spot if the restarts are mismatched for one of the components. Also, since there are matching rpointer files for each time restarts are created, it's now easier to (a) make sure restarts and rpointer files are all correctly matched and (b) for a user to take a set of restarts and matching rpointer files to start up from for any part of an existing simulation. This means you don't have to hand-edit the rpointer files, making sure you don't make a mistake when you do. + +Old rpointer filenames: + +* `rpointer.atm` +* `rpointer.cpl` +* `rpointer.lnd` + +New names: + +* `rpointer.atm.YYYY-MM-DD-SSSSS` +* `rpointer.cpl.YYYY-MM-DD-SSSSS` +* `rpointer.lnd.YYYY-MM-DD-SSSSS` + +Where `YYYY-MM-DD-SSSSS` is the year, month, day, and seconds into the day for the simulation timestamp. For example, `rpointer.lnd.2000-01-01-00000` for a rpointer file for starting at midnight (beginning of the day) on January 1st, 2000\. + +Note that this is backwards-compatible, so for all the components you can use either the new or old format for the rpointer filenames. Thus, if you are restarting from an existing case before `ctsm5.3.016`, you CAN use the rpointer filenames that don't have the timestamps in the name. + +## Simulations supporting this release + +- f19 `Clm60Bgc` 16pft: [https://github.com/NCAR/LMWG\_dev/issues/70](https://github.com/NCAR/LMWG_dev/issues/70) +- f09 with `Clm60BgcCrop`: [https://github.com/NCAR/LMWG\_dev/issues/69](https://github.com/NCAR/LMWG_dev/issues/69) +- ne30 with `Clm60BgcCrop`: [https://github.com/NCAR/LMWG\_dev/issues/68](https://github.com/NCAR/LMWG_dev/issues/68) + +Note: Dust emissions in CTSM 5.3 will be different from the above simulations because of a tuning update that came in after those. \ No newline at end of file From 224cf73f025f3cf7e468c76501f7da35bd7654d2 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Tue, 26 Aug 2025 18:20:20 -0600 Subject: [PATCH 036/129] An update to WhatsNewInCTSM5.4.md about changes in ctsm5.3.040 --- WhatsNewInCTSM5.4.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/WhatsNewInCTSM5.4.md b/WhatsNewInCTSM5.4.md index 62e1e45416..a36b8266c0 100644 --- a/WhatsNewInCTSM5.4.md +++ b/WhatsNewInCTSM5.4.md @@ -33,6 +33,15 @@ Changes for all physics versions: ### Heads up * History tapes now split into two files from hX to hXi and hXa, where X is the tape number (e.g. h0i/h0a) and where "i" stands for history file containing instantaneous fields, while "a" stands for history file containing non-instantaneous fields. Details below and in the PRs [\#2445](https://github.com/ESCOMP/ctsm/pull/2445) [\#117](https://github.com/ESCOMP/MOSART/pull/117) [\#61](https://github.com/ESCOMP/RTM/pull/61) and the correspondng issues. +* As of ctsm5.3.040, the new ctsm_pylib conda environment is incompatible with our tools from before ctsm5.3.040 and vice versa. If you have a ctsm_pylib conda environment installed from before ctsm5.3.040, keep that under a different name. We suggest the following command for doing this in a local copy of ctsm5.3.040 or later: + +./py_env_create -r ctsm_pylib_old + +This first renames your existing ctsm_pylib to ctsm_pylib_old and then installs the Python 3.13.2 version as ctsm_pylib. If you are unsure whether you already have ctsm_pylib installed, use the same command regardless, as it will skip the rename step if necessary. + +Information about additional py_env_create options — including how to install a fresh copy of the old conda environment — is available as follows: + +./py_env_create --help ## From 6c083591dd0dff4f89629e3dd4a9314581da995f Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Tue, 9 Sep 2025 12:14:18 -0600 Subject: [PATCH 037/129] Add LII2FINIDATAREAS tests to expected fails. --- cime_config/testdefs/ExpectedTestFails.xml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/cime_config/testdefs/ExpectedTestFails.xml b/cime_config/testdefs/ExpectedTestFails.xml index e99ef67616..1cf1922f64 100644 --- a/cime_config/testdefs/ExpectedTestFails.xml +++ b/cime_config/testdefs/ExpectedTestFails.xml @@ -338,6 +338,22 @@ + + + FAIL + #3252 + This should be resolved for the 5.4 release. + + + + + + FAIL + #3252 + This should be resolved for the 5.4 release. + + + From ab03812ff05c6a4bb2a49dc6078508ef2dcfc583 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Tue, 9 Sep 2025 15:32:45 -0600 Subject: [PATCH 038/129] Add ISSP test to expected fails. --- 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 1cf1922f64..230eacc06c 100644 --- a/cime_config/testdefs/ExpectedTestFails.xml +++ b/cime_config/testdefs/ExpectedTestFails.xml @@ -354,6 +354,14 @@ + + + FAIL + #3250 + This should be resolved for the 5.4 release. + + + From 77f0580a011c645c90f6c224b7c0995f1d0007f8 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Wed, 10 Sep 2025 09:53:51 -0600 Subject: [PATCH 039/129] Failed attempt to fix stream_fldfilename_cultivar_gdds logic. --- bld/namelist_files/namelist_defaults_ctsm.xml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index 6dcd5448c2..8098e3a3b5 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -2082,6 +2082,9 @@ lnd/clm2/surfdata_esmf/NEON/ctsm5.3.0/surfdata_1x1_NEON_TOOL_hist_2000_78pfts_c2 lnd/clm2/cropdata/calendars/processed/gdds_20230829_161011.tweaked_latlons.nc lnd/clm2/cropdata/calendars/processed/gdds_20230829_161011.tweaked_latlons.nc lnd/clm2/cropdata/calendars/processed/gdds_20230829_161011.tweaked_latlons.nc +lnd/clm2/cropdata/calendars/processed/gdds_20230829_161011.tweaked_latlons.nc +lnd/clm2/cropdata/calendars/processed/gdds_20230829_161011.tweaked_latlons.nc +lnd/clm2/cropdata/calendars/processed/gdds_20230829_161011.tweaked_latlons.nc lnd/clm2/cropdata/calendars/processed/swindow_starts_ggcmi_crop_calendar_phase3_v1.01.2000-2000.20231005_145103.tweaked_latlons.nc From f28f74cb8ae83ccc236a023fbc01f8d8488d105f Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Wed, 10 Sep 2025 10:06:35 -0600 Subject: [PATCH 040/129] Fix stream_fldfilename_cultivar_gdds logic. --- bld/namelist_files/namelist_defaults_ctsm.xml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index 8098e3a3b5..91c9d9d2a2 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -2077,14 +2077,16 @@ lnd/clm2/surfdata_esmf/NEON/ctsm5.3.0/surfdata_1x1_NEON_TOOL_hist_2000_78pfts_c2 2000 -lnd/clm2/cropdata/calendars/processed/gdds_20250809_025305.tweaked_latlons.nc lnd/clm2/cropdata/calendars/processed/gdds_20230829_161011.tweaked_latlons.nc lnd/clm2/cropdata/calendars/processed/gdds_20230829_161011.tweaked_latlons.nc lnd/clm2/cropdata/calendars/processed/gdds_20230829_161011.tweaked_latlons.nc -lnd/clm2/cropdata/calendars/processed/gdds_20230829_161011.tweaked_latlons.nc lnd/clm2/cropdata/calendars/processed/gdds_20230829_161011.tweaked_latlons.nc lnd/clm2/cropdata/calendars/processed/gdds_20230829_161011.tweaked_latlons.nc lnd/clm2/cropdata/calendars/processed/gdds_20230829_161011.tweaked_latlons.nc +lnd/clm2/cropdata/calendars/processed/gdds_20230829_161011.tweaked_latlons.nc + +lnd/clm2/cropdata/calendars/processed/gdds_20250809_025305.tweaked_latlons.nc +lnd/clm2/cropdata/calendars/processed/gdds_20230829_161011.tweaked_latlons.nc lnd/clm2/cropdata/calendars/processed/swindow_starts_ggcmi_crop_calendar_phase3_v1.01.2000-2000.20231005_145103.tweaked_latlons.nc From 70e89ccda007249d5ff51b79453e3d4289cde5c8 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Wed, 10 Sep 2025 13:44:22 -0600 Subject: [PATCH 041/129] Fix stream_fldfilename_cultivar_gdds logic??? --- bld/namelist_files/namelist_defaults_ctsm.xml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index 91c9d9d2a2..83c1ba9931 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -2077,16 +2077,14 @@ lnd/clm2/surfdata_esmf/NEON/ctsm5.3.0/surfdata_1x1_NEON_TOOL_hist_2000_78pfts_c2 2000 +lnd/clm2/cropdata/calendars/processed/gdds_20250809_025305.tweaked_latlons.nc +lnd/clm2/cropdata/calendars/processed/gdds_20250809_025305.tweaked_latlons.nc lnd/clm2/cropdata/calendars/processed/gdds_20230829_161011.tweaked_latlons.nc lnd/clm2/cropdata/calendars/processed/gdds_20230829_161011.tweaked_latlons.nc lnd/clm2/cropdata/calendars/processed/gdds_20230829_161011.tweaked_latlons.nc lnd/clm2/cropdata/calendars/processed/gdds_20230829_161011.tweaked_latlons.nc lnd/clm2/cropdata/calendars/processed/gdds_20230829_161011.tweaked_latlons.nc lnd/clm2/cropdata/calendars/processed/gdds_20230829_161011.tweaked_latlons.nc -lnd/clm2/cropdata/calendars/processed/gdds_20230829_161011.tweaked_latlons.nc - -lnd/clm2/cropdata/calendars/processed/gdds_20250809_025305.tweaked_latlons.nc -lnd/clm2/cropdata/calendars/processed/gdds_20230829_161011.tweaked_latlons.nc lnd/clm2/cropdata/calendars/processed/swindow_starts_ggcmi_crop_calendar_phase3_v1.01.2000-2000.20231005_145103.tweaked_latlons.nc From 5e41f47752421819e76774179e70e97ea99a0a7b Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Wed, 10 Sep 2025 15:26:09 -0600 Subject: [PATCH 042/129] Revert failed attempts to fix stream_fldfilename_cultivar_gdds logic. --- bld/namelist_files/namelist_defaults_ctsm.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index 83c1ba9931..8098e3a3b5 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -2078,10 +2078,10 @@ lnd/clm2/surfdata_esmf/NEON/ctsm5.3.0/surfdata_1x1_NEON_TOOL_hist_2000_78pfts_c2 lnd/clm2/cropdata/calendars/processed/gdds_20250809_025305.tweaked_latlons.nc -lnd/clm2/cropdata/calendars/processed/gdds_20250809_025305.tweaked_latlons.nc lnd/clm2/cropdata/calendars/processed/gdds_20230829_161011.tweaked_latlons.nc lnd/clm2/cropdata/calendars/processed/gdds_20230829_161011.tweaked_latlons.nc lnd/clm2/cropdata/calendars/processed/gdds_20230829_161011.tweaked_latlons.nc +lnd/clm2/cropdata/calendars/processed/gdds_20230829_161011.tweaked_latlons.nc lnd/clm2/cropdata/calendars/processed/gdds_20230829_161011.tweaked_latlons.nc lnd/clm2/cropdata/calendars/processed/gdds_20230829_161011.tweaked_latlons.nc lnd/clm2/cropdata/calendars/processed/gdds_20230829_161011.tweaked_latlons.nc From e7fa6e5b2925f541b9bb27f7fb6dbb08c2ef432c Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Wed, 10 Sep 2025 15:28:25 -0600 Subject: [PATCH 043/129] cropcals_rx_adapt fallback to correct stream_fldfilename_cultivar_gdds. --- bld/namelist_files/namelist_defaults_ctsm.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index 8098e3a3b5..1428184e3a 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -2081,7 +2081,7 @@ lnd/clm2/surfdata_esmf/NEON/ctsm5.3.0/surfdata_1x1_NEON_TOOL_hist_2000_78pfts_c2 lnd/clm2/cropdata/calendars/processed/gdds_20230829_161011.tweaked_latlons.nc lnd/clm2/cropdata/calendars/processed/gdds_20230829_161011.tweaked_latlons.nc lnd/clm2/cropdata/calendars/processed/gdds_20230829_161011.tweaked_latlons.nc -lnd/clm2/cropdata/calendars/processed/gdds_20230829_161011.tweaked_latlons.nc +lnd/clm2/cropdata/calendars/processed/gdds_20250809_025305.tweaked_latlons.nc lnd/clm2/cropdata/calendars/processed/gdds_20230829_161011.tweaked_latlons.nc lnd/clm2/cropdata/calendars/processed/gdds_20230829_161011.tweaked_latlons.nc lnd/clm2/cropdata/calendars/processed/gdds_20230829_161011.tweaked_latlons.nc From e69570af3c4b5bb82734c57b9e215149d86a9ee0 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Wed, 10 Sep 2025 15:44:52 -0600 Subject: [PATCH 044/129] Update Makefile/_multi.py to accommodate new fsurdat/landuse needs --- .../gen_mksurfdata_jobscript_multi.py | 26 ++++++++----------- tools/mksurfdata_esmf/Makefile | 8 +++--- 2 files changed, 15 insertions(+), 19 deletions(-) diff --git a/python/ctsm/toolchain/gen_mksurfdata_jobscript_multi.py b/python/ctsm/toolchain/gen_mksurfdata_jobscript_multi.py index 8154167609..6e332cc0d3 100755 --- a/python/ctsm/toolchain/gen_mksurfdata_jobscript_multi.py +++ b/python/ctsm/toolchain/gen_mksurfdata_jobscript_multi.py @@ -32,7 +32,7 @@ "crop-global-present-low-res", "crop-global-present-ne16", "crop-global-present-ne30", - "crop-global-present-ne120", + "crop-global-present-vrandne120", "crop-global-present-mpasa480", "crop-global-present-nldas", "crop-global-1850", @@ -52,7 +52,7 @@ "crop-global-SSP2-4.5-f19", "crop-global-SSP2-4.5-f10", "crop-global-SSP2-4.5-f45", - "crop-global-SSP2-4.5-ne0np4", + "crop-global-SSP2-4.5-vrandne120", "crop-global-SSP2-4.5-ne3", "crop-global-SSP2-4.5-ne16", "crop-global-SSP2-4.5-ne30", @@ -193,7 +193,7 @@ def main(): # ], # -------------------------- resolution_dict = { - "standard_res_no_crop": ["0.9x1.25", "1.9x2.5", "mpasa60"], + "standard_res_no_crop": ["0.9x1.25", "1.9x2.5", "mpasa60", "mpasa30"], "f09": ["0.9x1.25"], "f19": ["1.9x2.5"], "hcru": ["360x720cru"], @@ -212,17 +212,13 @@ def main(): "ne3": ["ne3np4", "ne3np4.pg3"], "ne16": ["ne16np4.pg3"], "ne30": ["ne30np4.pg3", "ne30np4.pg2", "ne30np4"], - "ne0np4": [ - "ne0np4.ARCTICGRIS.ne30x8", - "ne0np4.ARCTIC.ne30x4", - "ne0np4CONUS.ne30x8", - "ne0np4.POLARCAP.ne30x4", - ], - "ne120": [ + "ne120": ["ne120np4.pg3"], + "vr_and_ne120": [ "ne0np4.ARCTICGRIS.ne30x8", "ne0np4.ARCTIC.ne30x4", "ne0np4CONUS.ne30x8", "ne0np4.POLARCAP.ne30x4", + "ne0np4.NATL.ne30x8", "ne120np4.pg3", ], } @@ -275,9 +271,9 @@ def main(): "--start-year 2000 --end-year 2000 --res", "ne30", ), - "crop-global-present-ne120": ( + "crop-global-present-vrandne120": ( "--start-year 2000 --end-year 2000 --res", - "ne120", + "vr_and_ne120", ), "crop-global-present-mpasa480": ( "--start-year 2000 --end-year 2000 --res", @@ -359,9 +355,9 @@ def main(): "--start-year 1850 --end-year 2100 --nosurfdata --ssp-rcp SSP2-4.5 --res", "f45", ), - "crop-global-SSP2-4.5-ne0np4": ( - "--start-year 1979 --end-year 2026 --ssp-rcp SSP2-4.5 --res", - "ne0np4", + "crop-global-SSP2-4.5-vrandne120": ( + "--start-year 1979 --end-year 2030 --ssp-rcp SSP2-4.5 --res", + "vr_and_ne120", ), "crop-global-SSP2-4.5-ne3": ( "--start-year 1850 --end-year 2100 --nosurfdata --ssp-rcp SSP2-4.5 --res", diff --git a/tools/mksurfdata_esmf/Makefile b/tools/mksurfdata_esmf/Makefile index b30f2abc3d..627669d154 100644 --- a/tools/mksurfdata_esmf/Makefile +++ b/tools/mksurfdata_esmf/Makefile @@ -99,7 +99,7 @@ CROP = \ crop-global-future \ crop-global-hist-f09 \ crop-global-1850-ne120 \ - crop-global-present-ne120 \ + crop-global-present-vrandne120 \ crop-global-present-nldas \ crop-global-present-ne30 \ crop-global-present \ @@ -216,7 +216,7 @@ crop-global-present-ne30 : FORCE $(MKSURFDATA) --number-of-nodes 4 --scenario $@ --jobscript-file $@.sh --walltime 01:00:00 $(BATCHJOBS) $@.sh -crop-global-present-ne120 : FORCE +crop-global-present-vrandne120 : FORCE $(MKSURFDATA) --number-of-nodes 4 --scenario $@ --jobscript-file $@.sh --walltime 01:00:00 $(BATCHJOBS) $@.sh @@ -315,7 +315,7 @@ crop-global-SSP2-4.5 : crop-global-SSP2-4.5-f09 \ crop-global-SSP2-4.5-hcru \ crop-global-SSP2-4.5-ne16 \ crop-global-SSP2-4.5-ne30 \ - crop-global-SSP2-4.5-ne0np4 \ + crop-global-SSP2-4.5-vrandne120 \ crop-global-SSP2-4.5-C96 \ crop-global-SSP2-4.5-mpasa120 @@ -359,7 +359,7 @@ crop-global-SSP2-4.5-ne30 : FORCE $(MKSURFDATA) --number-of-nodes 9 --scenario $@ --jobscript-file $@.sh --walltime 12:00:00 $(BATCHJOBS) $@.sh -crop-global-SSP2-4.5-ne0np4 : FORCE +crop-global-SSP2-4.5-vrandne120 : FORCE $(MKSURFDATA) --number-of-nodes 2 --scenario $@ --jobscript-file $@.sh --walltime 12:00:00 $(BATCHJOBS) $@.sh From 86331ef9cd36db6baa37fb6977c8c446ef7822b1 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Wed, 10 Sep 2025 15:46:15 -0600 Subject: [PATCH 045/129] ClmBuildNamelist: Add lnd_tuning_mode to stream_fldfilename_cultivar_gdds logic. --- bld/CLMBuildNamelist.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index 416e5f3b60..a9f9b3ed8a 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -4371,7 +4371,9 @@ sub setup_logic_cropcal_streams { if ( &value_is_true($cropcals_rx) or &value_is_true($cropcals_rx_adapt) ) { add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_fldFileName_swindow_start'); add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_fldFileName_swindow_end'); - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_fldfilename_cultivar_gdds'); + add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_fldfilename_cultivar_gdds', + 'lnd_tuning_mode'=>$nl_flags->{'lnd_tuning_mode'} + ); if ( &value_is_true($cropcals_rx_adapt) ) { add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_fldFileName_gdd20_baseline', 'stream_gdd20_seasons'=>$stream_gdd20_seasons); } From 0247d554af6c1a9f74cd58a119b0e63efdc59cd4 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Fri, 12 Sep 2025 16:56:05 -0600 Subject: [PATCH 046/129] Update Makefile/_multi.py for fsurdat/landuse updates in ctsm54 (part 2) --- .../gen_mksurfdata_jobscript_multi.py | 27 ++++++++++++------- tools/mksurfdata_esmf/Makefile | 26 +++++++++++------- 2 files changed, 33 insertions(+), 20 deletions(-) diff --git a/python/ctsm/toolchain/gen_mksurfdata_jobscript_multi.py b/python/ctsm/toolchain/gen_mksurfdata_jobscript_multi.py index 6e332cc0d3..16ff0515b5 100755 --- a/python/ctsm/toolchain/gen_mksurfdata_jobscript_multi.py +++ b/python/ctsm/toolchain/gen_mksurfdata_jobscript_multi.py @@ -25,7 +25,7 @@ "global-present-low-res", "global-present-ultra-hi-res", "global-hist-1850-f19", - "global-hist-1850-f45", + "global-hist-1850-low-res", "crop-tropics-present", "crop", "crop-global-present", @@ -45,7 +45,8 @@ "crop-global-hist-low-res", "crop-global-hist-ne16", "crop-global-hist-ne30", - "crop-global-hist-f09", + "crop-global-hist-1700", + "crop-global-hist-mpasa480", "crop-global-SSP1-1.9-f09", "crop-global-SSP1-2.6-f09", "crop-global-SSP2-4.5-f09", @@ -193,7 +194,9 @@ def main(): # ], # -------------------------- resolution_dict = { - "standard_res_no_crop": ["0.9x1.25", "1.9x2.5", "mpasa60", "mpasa30"], + "potveg_res": ["0.9x1.25", "1.9x2.5", "ne16np4.pg3", "ne30np4.pg3"], + "standard_res_no_crop": ["0.9x1.25", "1.9x2.5", "mpasa60", "mpasa30", "ne30np4.pg3"], + "1700_res": ["0.9x1.25", "360x720cru"], "f09": ["0.9x1.25"], "f19": ["1.9x2.5"], "hcru": ["360x720cru"], @@ -201,11 +204,11 @@ def main(): "mpasa120": ["mpasa120"], "f10": ["10x15"], "f45": ["4x5"], - "low_res_no_crop": ["4x5", "10x15"], + "low_res_no_crop": ["4x5", "10x15", "400pt_sparse"], "ultra_hi_res_no_crop": ["mpasa15", "mpasa3p75"], "standard_res": ["360x720cru", "0.9x1.25", "1.9x2.5", "C96", "mpasa120"], "standard_res_no_f09": ["360x720cru", "1.9x2.5", "C96", "mpasa120"], - "low_res": ["4x5", "10x15", "ne3np4.pg3", "ne3np4"], + "low_res": ["4x5", "10x15", "ne3np4.pg3", "ne3np4.pg2", "ne3np4", "400pt_sparse"], "mpasa480": ["mpasa480"], "nldas_res": ["0.125nldas2"], "5x5_amazon": ["5x5_amazon"], @@ -229,7 +232,7 @@ def main(): dataset_dict = { "global-potveg": ( "--start-year 1850 --end-year 1850 --nocrop --potveg --res", - "f09", + "potveg_res", ), "global-present": ( "--start-year 2000 --end-year 2000 --nocrop --res", @@ -247,9 +250,9 @@ def main(): "--start-year 1850 --end-year 2023 --nocrop --res", "f19", ), - "global-hist-1850-f45": ( + "global-hist-1850-low-res": ( "--start-year 1850 --end-year 2023 --nocrop --res", - "f45", + "low_res_no_crop", ), "crop-tropics-present": ( "--start-year 2000 --end-year 2000 --res", @@ -307,6 +310,10 @@ def main(): "--start-year 1850 --end-year 1850 --res", "mpasa480", ), + "crop-global-hist-mpasa480": ( + "--start-year 1850 --end-year 2023 --nosurfdata --res", + "mpasa480", + ), "crop-global-hist": ( "--start-year 1850 --end-year 2023 --nosurfdata --res", "standard_res_no_f09", @@ -323,9 +330,9 @@ def main(): "--start-year 1850 --end-year 2023 --nosurfdata --res", "ne30", ), - "crop-global-hist-f09": ( + "crop-global-hist-1700": ( "--start-year 1700 --end-year 2023 --res", - "f09", + "1700_res", ), "crop-global-SSP1-1.9-f09": ( "--start-year 1850 --end-year 2100 --nosurfdata --ssp-rcp SSP1-1.9 --res", diff --git a/tools/mksurfdata_esmf/Makefile b/tools/mksurfdata_esmf/Makefile index 627669d154..edf81e2492 100644 --- a/tools/mksurfdata_esmf/Makefile +++ b/tools/mksurfdata_esmf/Makefile @@ -14,7 +14,7 @@ # To generate a single dataset, run make with the name of the rule you # want to build. For example, to generate the crop data set for 1x1_numaIA: # -# make crop-numa +# make 1x1-numa-present # # NOTE: The default behavior is to parallelize data set creation using # the batch system by submitting jobs to the batch queue (on Derecho). @@ -87,17 +87,20 @@ SUBSETDATA_1X1_URBALPHA := --lat -37.7308 --lon 360 --site 1x1_urbanc_alpha - # low-res is for low resolutions for testing # nldas is for NWP working with WRF # STANDARD means no crop, so 16 pfts -# global-hist-1850-f45 is used by FATES and we expect it to be phased out +# global-hist-1850-low-res is used by FATES; we expected to phase it out, but to f45 we added f10 in ctsm5.4 STANDARD = \ global-potveg \ global-present \ global-present-low-res \ global-hist-1850-f19 \ - global-hist-1850-f45 \ + global-hist-1850-low-res \ +# NOTE slevis 2025/9/10: For CTSM5.4, I removed from CROP: +# crop-global-future +# and I added here because it spans 1979-2030: +# crop-global-SSP2-4.5-vrandne120 CROP = \ - crop-global-future \ - crop-global-hist-f09 \ + crop-global-hist-1700 \ crop-global-1850-ne120 \ crop-global-present-vrandne120 \ crop-global-present-nldas \ @@ -111,6 +114,7 @@ CROP = \ crop-global-1850-ne16 \ crop-global-1850-ne30 \ crop-global-1850-mpasa480 \ + crop-global-SSP2-4.5-vrandne120 \ # Build the executable if it doesn't exist and any target depends on it $(MKSURFDATA_EXE): @@ -127,11 +131,12 @@ all : all-subset global-present-ultra-hi-res crop standard crop-tropics-present # These are all the surface datasets generated by subset_data # This runs interactively and does not send jobs to the batch queue +# NOTE slevis 2025/9/10: For CTSM5.4, I removed from all-subset: +# 1x1_brazil-transient +# 1x1-smallville-present all-subset : \ 1x1_brazil-present \ - 1x1_brazil-transient \ 1x1-numa-present \ - 1x1-smallville-present \ 1x1-smallville-1850 \ 1x1-smallville-transient \ 1x1-cidadinho-present \ @@ -171,7 +176,7 @@ global-present-low-res : FORCE global-hist-1850-f19 : FORCE $(MKSURFDATA) --number-of-nodes 8 --scenario $@ --jobscript-file $@.sh --walltime 12:00:00 $(BATCHJOBS) $@.sh -global-hist-1850-f45 : FORCE +global-hist-1850-low-res : FORCE $(MKSURFDATA) --number-of-nodes 2 --scenario $@ --jobscript-file $@.sh --walltime 12:00:00 $(BATCHJOBS) $@.sh # @@ -256,7 +261,7 @@ crop-global-hist : FORCE $(MKSURFDATA) --number-of-nodes 72 --scenario $@ --jobscript-file $@.sh --walltime 12:00:00 $(BATCHJOBS) $@.sh -crop-global-hist-f09 : FORCE +crop-global-hist-1700 : FORCE $(MKSURFDATA) --number-of-nodes 9 --scenario $@ --jobscript-file $@.sh --walltime 12:00:00 $(BATCHJOBS) $@.sh @@ -310,12 +315,13 @@ crop-global-future : crop-global-SSP1-1.9-f09 \ crop-global-SSP2-4.5-low-res : crop-global-SSP2-4.5-f10 \ crop-global-SSP2-4.5-f45 \ crop-global-SSP2-4.5-ne3 +# NOTE slevis 2025/9/10: For CTSM5.4, I moved to CROP because it spans 1979-2030: +# crop-global-SSP2-4.5-vrandne120 crop-global-SSP2-4.5 : crop-global-SSP2-4.5-f09 \ crop-global-SSP2-4.5-f19 \ crop-global-SSP2-4.5-hcru \ crop-global-SSP2-4.5-ne16 \ crop-global-SSP2-4.5-ne30 \ - crop-global-SSP2-4.5-vrandne120 \ crop-global-SSP2-4.5-C96 \ crop-global-SSP2-4.5-mpasa120 From ffede38a3b4cc2b1e72768d65118f357bb51ea80 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Mon, 15 Sep 2025 11:39:36 -0600 Subject: [PATCH 047/129] Rm unnecessary 400pt_sparse grid from gen_mksurfdata_jobscript_multi.py 400pt_sparse simulations just point to the f19_400pt_sparse mesh file and do not need their own unique fsurdat file --- python/ctsm/toolchain/gen_mksurfdata_jobscript_multi.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/ctsm/toolchain/gen_mksurfdata_jobscript_multi.py b/python/ctsm/toolchain/gen_mksurfdata_jobscript_multi.py index 16ff0515b5..0bd5109967 100755 --- a/python/ctsm/toolchain/gen_mksurfdata_jobscript_multi.py +++ b/python/ctsm/toolchain/gen_mksurfdata_jobscript_multi.py @@ -204,11 +204,11 @@ def main(): "mpasa120": ["mpasa120"], "f10": ["10x15"], "f45": ["4x5"], - "low_res_no_crop": ["4x5", "10x15", "400pt_sparse"], + "low_res_no_crop": ["4x5", "10x15"], "ultra_hi_res_no_crop": ["mpasa15", "mpasa3p75"], "standard_res": ["360x720cru", "0.9x1.25", "1.9x2.5", "C96", "mpasa120"], "standard_res_no_f09": ["360x720cru", "1.9x2.5", "C96", "mpasa120"], - "low_res": ["4x5", "10x15", "ne3np4.pg3", "ne3np4.pg2", "ne3np4", "400pt_sparse"], + "low_res": ["4x5", "10x15", "ne3np4.pg3", "ne3np4.pg2", "ne3np4"], "mpasa480": ["mpasa480"], "nldas_res": ["0.125nldas2"], "5x5_amazon": ["5x5_amazon"], From 7b6a268563fa91a2cf5d4d03149489f1817a6f0d Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Mon, 15 Sep 2025 17:26:23 -0600 Subject: [PATCH 048/129] Makefile corrections after first test of `make all` (part 1) --- tools/mksurfdata_esmf/Makefile | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tools/mksurfdata_esmf/Makefile b/tools/mksurfdata_esmf/Makefile index edf81e2492..e234ba41d6 100644 --- a/tools/mksurfdata_esmf/Makefile +++ b/tools/mksurfdata_esmf/Makefile @@ -100,6 +100,11 @@ STANDARD = \ # and I added here because it spans 1979-2030: # crop-global-SSP2-4.5-vrandne120 CROP = \ + crop-global-hist \ + crop-global-hist-low-res \ + crop-global-hist-ne16 \ + crop-global-hist-ne30 \ + crop-global-hist-mpasa480 \ crop-global-hist-1700 \ crop-global-1850-ne120 \ crop-global-present-vrandne120 \ @@ -277,6 +282,10 @@ crop-global-hist-ne30 : FORCE $(MKSURFDATA) --number-of-nodes 9 --scenario $@ --jobscript-file $@.sh --walltime 12:00:00 $(BATCHJOBS) $@.sh +crop-global-hist-mpasa480 : FORCE + $(MKSURFDATA) --number-of-nodes 4 --scenario $@ --jobscript-file $@.sh --walltime 12:00:00 + $(BATCHJOBS) $@.sh + 1x1-numa-present : FORCE $(SUBSETDATA_POINT_ALLLU) --create-surface $(SUBSETDATA_1X1_NUMAIA) From 98ee05958092cd4fa4f0c027bba6fcedabf54401 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Tue, 16 Sep 2025 18:17:17 -0600 Subject: [PATCH 049/129] Makefile / _multi.py updates after first test of 'make all' (part 2) --- .../ctsm/toolchain/gen_mksurfdata_jobscript_multi.py | 12 ++++++------ tools/mksurfdata_esmf/Makefile | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/python/ctsm/toolchain/gen_mksurfdata_jobscript_multi.py b/python/ctsm/toolchain/gen_mksurfdata_jobscript_multi.py index 0bd5109967..0613394085 100755 --- a/python/ctsm/toolchain/gen_mksurfdata_jobscript_multi.py +++ b/python/ctsm/toolchain/gen_mksurfdata_jobscript_multi.py @@ -24,7 +24,7 @@ "global-present", "global-present-low-res", "global-present-ultra-hi-res", - "global-hist-1850-f19", + "global-hist-1850-1and2deg", "global-hist-1850-low-res", "crop-tropics-present", "crop", @@ -197,6 +197,7 @@ def main(): "potveg_res": ["0.9x1.25", "1.9x2.5", "ne16np4.pg3", "ne30np4.pg3"], "standard_res_no_crop": ["0.9x1.25", "1.9x2.5", "mpasa60", "mpasa30", "ne30np4.pg3"], "1700_res": ["0.9x1.25", "360x720cru"], + "1and2deg_no_crop": ["1.9x2.5", "0.9x1.25", "ne30np4.pg3"], "f09": ["0.9x1.25"], "f19": ["1.9x2.5"], "hcru": ["360x720cru"], @@ -207,8 +208,7 @@ def main(): "low_res_no_crop": ["4x5", "10x15"], "ultra_hi_res_no_crop": ["mpasa15", "mpasa3p75"], "standard_res": ["360x720cru", "0.9x1.25", "1.9x2.5", "C96", "mpasa120"], - "standard_res_no_f09": ["360x720cru", "1.9x2.5", "C96", "mpasa120"], - "low_res": ["4x5", "10x15", "ne3np4.pg3", "ne3np4.pg2", "ne3np4"], + "low_res": ["ne3np4.pg2", "ne3np4.pg3", "ne3np4", "4x5", "10x15"], "mpasa480": ["mpasa480"], "nldas_res": ["0.125nldas2"], "5x5_amazon": ["5x5_amazon"], @@ -246,9 +246,9 @@ def main(): "--start-year 2000 --end-year 2000 --nocrop --res", "ultra_hi_res_no_crop", ), - "global-hist-1850-f19": ( + "global-hist-1850-1and2deg": ( "--start-year 1850 --end-year 2023 --nocrop --res", - "f19", + "1and2deg_no_crop", ), "global-hist-1850-low-res": ( "--start-year 1850 --end-year 2023 --nocrop --res", @@ -316,7 +316,7 @@ def main(): ), "crop-global-hist": ( "--start-year 1850 --end-year 2023 --nosurfdata --res", - "standard_res_no_f09", + "standard_res", ), "crop-global-hist-low-res": ( "--start-year 1850 --end-year 2023 --nosurfdata --res", diff --git a/tools/mksurfdata_esmf/Makefile b/tools/mksurfdata_esmf/Makefile index e234ba41d6..5f3956796b 100644 --- a/tools/mksurfdata_esmf/Makefile +++ b/tools/mksurfdata_esmf/Makefile @@ -92,7 +92,7 @@ STANDARD = \ global-potveg \ global-present \ global-present-low-res \ - global-hist-1850-f19 \ + global-hist-1850-1and2deg \ global-hist-1850-low-res \ # NOTE slevis 2025/9/10: For CTSM5.4, I removed from CROP: @@ -178,7 +178,7 @@ global-present-low-res : FORCE $(MKSURFDATA) --number-of-nodes 1 --tasks-per-node 64 --scenario $@ --jobscript-file $@.sh --walltime 01:00:00 $(BATCHJOBS) $@.sh -global-hist-1850-f19 : FORCE +global-hist-1850-1and2deg : FORCE $(MKSURFDATA) --number-of-nodes 8 --scenario $@ --jobscript-file $@.sh --walltime 12:00:00 $(BATCHJOBS) $@.sh global-hist-1850-low-res : FORCE @@ -271,7 +271,7 @@ crop-global-hist-1700 : FORCE $(BATCHJOBS) $@.sh crop-global-hist-low-res : FORCE - $(MKSURFDATA) --number-of-nodes 14 --tasks-per-node 32 --scenario $@ --jobscript-file $@.sh --walltime 12:00:00 + $(MKSURFDATA) --number-of-nodes 1 --tasks-per-node 128 --scenario $@ --jobscript-file $@.sh --walltime 12:00:00 $(BATCHJOBS) $@.sh crop-global-hist-ne16 : FORCE From 60e1907ba7ff355d53e654e8d99282d509a211a0 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Tue, 16 Sep 2025 18:18:53 -0600 Subject: [PATCH 050/129] Makefile / _multi.py updates after first test of 'make all' (part 3) --- .../gen_mksurfdata_jobscript_multi.py | 37 ++++++++++++++++--- tools/mksurfdata_esmf/Makefile | 31 ++++++++++++++-- 2 files changed, 60 insertions(+), 8 deletions(-) diff --git a/python/ctsm/toolchain/gen_mksurfdata_jobscript_multi.py b/python/ctsm/toolchain/gen_mksurfdata_jobscript_multi.py index 0613394085..b038154be0 100755 --- a/python/ctsm/toolchain/gen_mksurfdata_jobscript_multi.py +++ b/python/ctsm/toolchain/gen_mksurfdata_jobscript_multi.py @@ -30,6 +30,7 @@ "crop", "crop-global-present", "crop-global-present-low-res", + "crop-global-present-ne3", "crop-global-present-ne16", "crop-global-present-ne30", "crop-global-present-vrandne120", @@ -37,12 +38,16 @@ "crop-global-present-nldas", "crop-global-1850", "crop-global-1850-low-res", + "crop-global-1850-ne3", "crop-global-1850-ne16", "crop-global-1850-ne30", "crop-global-1850-ne120", "crop-global-1850-mpasa480", "crop-global-hist", "crop-global-hist-low-res", + "crop-global-hist-ne3-1", + "crop-global-hist-ne3-2", + "crop-global-hist-ne3-3", "crop-global-hist-ne16", "crop-global-hist-ne30", "crop-global-hist-1700", @@ -205,14 +210,16 @@ def main(): "mpasa120": ["mpasa120"], "f10": ["10x15"], "f45": ["4x5"], - "low_res_no_crop": ["4x5", "10x15"], + "low_res": ["4x5", "10x15"], "ultra_hi_res_no_crop": ["mpasa15", "mpasa3p75"], "standard_res": ["360x720cru", "0.9x1.25", "1.9x2.5", "C96", "mpasa120"], - "low_res": ["ne3np4.pg2", "ne3np4.pg3", "ne3np4", "4x5", "10x15"], "mpasa480": ["mpasa480"], "nldas_res": ["0.125nldas2"], "5x5_amazon": ["5x5_amazon"], - "ne3": ["ne3np4", "ne3np4.pg3"], + "ne3": ["ne3np4.pg2", "ne3np4.pg3", "ne3np4"], + "ne3_1": ["ne3np4"], + "ne3_2": ["ne3np4.pg2"], + "ne3_3": ["ne3np4.pg3"], "ne16": ["ne16np4.pg3"], "ne30": ["ne30np4.pg3", "ne30np4.pg2", "ne30np4"], "ne120": ["ne120np4.pg3"], @@ -240,7 +247,7 @@ def main(): ), "global-present-low-res": ( "--start-year 2000 --end-year 2000 --nocrop --res", - "low_res_no_crop", + "low_res", ), "global-present-ultra-hi-res": ( "--start-year 2000 --end-year 2000 --nocrop --res", @@ -252,7 +259,7 @@ def main(): ), "global-hist-1850-low-res": ( "--start-year 1850 --end-year 2023 --nocrop --res", - "low_res_no_crop", + "low_res", ), "crop-tropics-present": ( "--start-year 2000 --end-year 2000 --res", @@ -266,6 +273,10 @@ def main(): "--start-year 2000 --end-year 2000 --res", "low_res", ), + "crop-global-present-ne3": ( + "--start-year 2000 --end-year 2000 --res", + "ne3", + ), "crop-global-present-ne16": ( "--start-year 2000 --end-year 2000 --res", "ne16", @@ -294,6 +305,10 @@ def main(): "--start-year 1850 --end-year 1850 --res", "low_res", ), + "crop-global-1850-ne3": ( + "--start-year 1850 --end-year 1850 --res", + "ne3", + ), "crop-global-1850-ne16": ( "--start-year 1850 --end-year 1850 --res", "ne16", @@ -322,6 +337,18 @@ def main(): "--start-year 1850 --end-year 2023 --nosurfdata --res", "low_res", ), + "crop-global-hist-ne3-1": ( + "--start-year 1850 --end-year 2023 --nosurfdata --res", + "ne3_1", + ), + "crop-global-hist-ne3-2": ( + "--start-year 1850 --end-year 2023 --nosurfdata --res", + "ne3_2", + ), + "crop-global-hist-ne3-3": ( + "--start-year 1850 --end-year 2023 --nosurfdata --res", + "ne3_3", + ), "crop-global-hist-ne16": ( "--start-year 1850 --end-year 2023 --nosurfdata --res", "ne16", diff --git a/tools/mksurfdata_esmf/Makefile b/tools/mksurfdata_esmf/Makefile index 5f3956796b..e94d8edd4d 100644 --- a/tools/mksurfdata_esmf/Makefile +++ b/tools/mksurfdata_esmf/Makefile @@ -102,6 +102,9 @@ STANDARD = \ CROP = \ crop-global-hist \ crop-global-hist-low-res \ + crop-global-hist-ne3-1 \ + crop-global-hist-ne3-2 \ + crop-global-hist-ne3-3 \ crop-global-hist-ne16 \ crop-global-hist-ne30 \ crop-global-hist-mpasa480 \ @@ -112,10 +115,12 @@ CROP = \ crop-global-present-ne30 \ crop-global-present \ crop-global-present-low-res \ + crop-global-present-ne3 \ crop-global-present-ne16 \ crop-global-present-mpasa480 \ crop-global-1850 \ crop-global-1850-low-res \ + crop-global-1850-ne3 \ crop-global-1850-ne16 \ crop-global-1850-ne30 \ crop-global-1850-mpasa480 \ @@ -215,7 +220,11 @@ crop-global-present : FORCE $(BATCHJOBS) $@.sh crop-global-present-low-res : FORCE - $(MKSURFDATA) --number-of-nodes 1 --tasks-per-node 64 --scenario $@ --jobscript-file $@.sh --walltime 12:00:00 + $(MKSURFDATA) --number-of-nodes 1 --scenario $@ --jobscript-file $@.sh --walltime 12:00:00 + $(BATCHJOBS) $@.sh + +crop-global-present-ne3 : FORCE + $(MKSURFDATA) --number-of-nodes 1 --scenario $@ --jobscript-file $@.sh --walltime 12:00:00 $(BATCHJOBS) $@.sh crop-global-present-ne16 : FORCE @@ -243,7 +252,11 @@ crop-global-1850 : FORCE $(BATCHJOBS) $@.sh crop-global-1850-low-res : FORCE - $(MKSURFDATA) --number-of-nodes 1 --tasks-per-node 64 --scenario $@ --jobscript-file $@.sh --walltime 12:00:00 + $(MKSURFDATA) --number-of-nodes 1 --scenario $@ --jobscript-file $@.sh --walltime 12:00:00 + $(BATCHJOBS) $@.sh + +crop-global-1850-ne3 : FORCE + $(MKSURFDATA) --number-of-nodes 1 --scenario $@ --jobscript-file $@.sh --walltime 12:00:00 $(BATCHJOBS) $@.sh crop-global-1850-ne16 : FORCE @@ -271,7 +284,19 @@ crop-global-hist-1700 : FORCE $(BATCHJOBS) $@.sh crop-global-hist-low-res : FORCE - $(MKSURFDATA) --number-of-nodes 1 --tasks-per-node 128 --scenario $@ --jobscript-file $@.sh --walltime 12:00:00 + $(MKSURFDATA) --number-of-nodes 1 --scenario $@ --jobscript-file $@.sh --walltime 12:00:00 + $(BATCHJOBS) $@.sh + +crop-global-hist-ne3-1: FORCE + $(MKSURFDATA) --number-of-nodes 1 --scenario $@ --jobscript-file $@.sh --walltime 12:00:00 + $(BATCHJOBS) $@.sh + +crop-global-hist-ne3-2: FORCE + $(MKSURFDATA) --number-of-nodes 1 --scenario $@ --jobscript-file $@.sh --walltime 12:00:00 + $(BATCHJOBS) $@.sh + +crop-global-hist-ne3-3: FORCE + $(MKSURFDATA) --number-of-nodes 1 --scenario $@ --jobscript-file $@.sh --walltime 12:00:00 $(BATCHJOBS) $@.sh crop-global-hist-ne16 : FORCE From 8c7a0de09e10d887c668580c4bdbc51cb2ef1f12 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Wed, 17 Sep 2025 16:51:39 -0600 Subject: [PATCH 051/129] Add input_pftdata_filename variable to landuse.timeseries files --- tools/mksurfdata_esmf/src/mksurfdata.F90 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/mksurfdata_esmf/src/mksurfdata.F90 b/tools/mksurfdata_esmf/src/mksurfdata.F90 index 35ff1807cd..c2ecc9c308 100644 --- a/tools/mksurfdata_esmf/src/mksurfdata.F90 +++ b/tools/mksurfdata_esmf/src/mksurfdata.F90 @@ -968,8 +968,8 @@ program mksurfdata rcode = pio_put_var(pioid, pio_varid, (/ntim/), year) rcode = pio_inq_varid(pioid, 'time', pio_varid) rcode = pio_put_var(pioid, pio_varid, (/ntim/), year) - !rcode = pio_inq_varid(pioid, 'input_pftdata_filename', pio_varid) - !rcode = pio_put_var(pioid, pio_varid, (/1,ntim/), (/len_trim(string),1/), trim(string)) + rcode = pio_inq_varid(pioid, 'input_pftdata_filename', pio_varid) + rcode = pio_put_var(pioid, pio_varid, (/1,ntim/), trim(string)) call pio_syncfile(pioid) ! Create pctpft data at model resolution from file fname From 883012b7a40577665ccba14a155dc49af80a7cb4 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Wed, 17 Sep 2025 16:58:20 -0600 Subject: [PATCH 052/129] Update README.md with how to turn on DEBUG in mksurfdata_esmf --- tools/mksurfdata_esmf/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/mksurfdata_esmf/README.md b/tools/mksurfdata_esmf/README.md index f49d23fb61..95064a9839 100644 --- a/tools/mksurfdata_esmf/README.md +++ b/tools/mksurfdata_esmf/README.md @@ -100,6 +100,7 @@ This will bring in CIME and ccs_config which are required for building. ``` shell # Assuming pwd is the tools/mksurfdata_esmf directory +setenv DEBUG TRUE # only if debugging and your shell is tcsh (in bash use: export DEBUG=TRUE) ./gen_mksurfdata_build # For machines with a cime build ``` From 14cab8a108608e1239c07f9cd2fe6e34f15dcb89 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Fri, 19 Sep 2025 15:18:20 -0600 Subject: [PATCH 053/129] Add new expected failure for issue #3495 --- cime_config/testdefs/ExpectedTestFails.xml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cime_config/testdefs/ExpectedTestFails.xml b/cime_config/testdefs/ExpectedTestFails.xml index 49ccc9f46a..fe3237afa5 100644 --- a/cime_config/testdefs/ExpectedTestFails.xml +++ b/cime_config/testdefs/ExpectedTestFails.xml @@ -98,6 +98,12 @@ + + + FAIL + #3495 + + FAIL From e66386b4100bef89f4b585ff0402dd1ff2d791b4 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Tue, 23 Sep 2025 18:05:00 -0600 Subject: [PATCH 054/129] Introduce cmip_era flag (= cmip6 or cmip7) to namelist_defaults --- .../namelist_defaults_cmip_era.xml | 23 +++++++++++++++++++ bld/namelist_files/namelist_defaults_ctsm.xml | 12 +++++++--- .../namelist_definition_ctsm.xml | 6 +++++ 3 files changed, 38 insertions(+), 3 deletions(-) create mode 100644 bld/namelist_files/namelist_defaults_cmip_era.xml diff --git a/bld/namelist_files/namelist_defaults_cmip_era.xml b/bld/namelist_files/namelist_defaults_cmip_era.xml new file mode 100644 index 0000000000..81c10af811 --- /dev/null +++ b/bld/namelist_files/namelist_defaults_cmip_era.xml @@ -0,0 +1,23 @@ + + + + + + + + + +cmip7 +cmip6 +cmip6 +cmip6 +cmip6 + + diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index 80c96947b9..84fecb14d0 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -1807,10 +1807,14 @@ lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_4x5_hist_1850_16pfts_c241007.nc lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_360x720cru_hist_1850_78pfts_c240908.nc - + lnd/clm2/surfdata_esmf/ctsm5.4.0/surfdata_0.9x1.25_hist_1850_78pfts_c250723.nc - + +lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_0.9x1.25_hist_1850_78pfts_c240908.nc + lnd/clm2/surfdata_esmf/ctsm5.4.0/surfdata_1.9x2.5_hist_1850_78pfts_c250723.nc + +-lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_1.9x2.5_hist_1850_78pfts_c240908.nc lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_10x15_hist_1850_78pfts_c240908.nc @@ -1825,8 +1829,10 @@ lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_mpasa120_hist_1850_78pfts_c240908.nc lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_ne30np4.pg2_hist_1850_78pfts_c240908.nc - + lnd/clm2/surfdata_esmf/ctsm5.4.0/surfdata_ne30np4.pg3_hist_1850_78pfts_c250723.nc + +lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_ne30np4.pg3_hist_1850_78pfts_c240908.nc lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_ne3np4.pg3_hist_1850_78pfts_c240908.nc diff --git a/bld/namelist_files/namelist_definition_ctsm.xml b/bld/namelist_files/namelist_definition_ctsm.xml index 69a243bd27..4fbf3f9777 100644 --- a/bld/namelist_files/namelist_definition_ctsm.xml +++ b/bld/namelist_files/namelist_definition_ctsm.xml @@ -2364,6 +2364,12 @@ A sim_year_range of 1000-1002 or 1000-1004 corresponds to data used for testing A sim_year_range that goes beyond 2005 corresponds to historical data until 2005 and then scenario data beyond that point. + +Whether to use CMIP6 or CMIP7 fsurdat/landuse files. +As of ctsm5.4 we do not have CMIP7 pft raw datasets for SSPs and NOANTHRO, so default to cmip6 for these. For other compsets default to cmip7. User may modify to a non-default value in env_run.xml. + + Namelist entries to demand be provided on the namelist. From 0f4808c662c1ec24bbf0160a9c53b9b6063f37e8 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Tue, 23 Sep 2025 18:06:38 -0600 Subject: [PATCH 055/129] Introduce CLM_CMIP_ERA flag to env_run.xml (= cmip6 or cmip7) --- bld/CLMBuildNamelist.pm | 5 +++++ cime_config/config_component.xml | 14 ++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index 4effcf76c7..d30654a80d 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -735,6 +735,11 @@ sub setup_cmdl_resolution { $log->verbose_message( "This is NOT a NEON site" ); } + # + # To determine CMIP era + # + $nl_flags->{'cmip_era'} = $envxml_ref->{'CLM_CMIP_ERA'}; + } #------------------------------------------------------------------------------- diff --git a/cime_config/config_component.xml b/cime_config/config_component.xml index f869d0e362..e0006ede9f 100644 --- a/cime_config/config_component.xml +++ b/cime_config/config_component.xml @@ -156,6 +156,20 @@ This is typically set by the compset. + + char + cmip6,cmip7 + cmip7 + + cmip6 + cmip6 + + run_component_ctsm + env_run.xml + Whether to use CMIP6 or CMIP7 fsurdat/landuse files. + As of ctsm5.4 we do not have CMIP7 pft raw datasets for SSPs and NOANTHRO, so default to cmip6 for these. For other compsets default to cmip7. User may modify to a non-default value in env_run.xml. + + logical From a30efabaf286a391b8e3fa0fda61c8e540d4a483 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Fri, 26 Sep 2025 16:21:46 -0600 Subject: [PATCH 056/129] Remove newly introduced namelist_defaults_cmip_era.xml --- .../namelist_defaults_cmip_era.xml | 23 ------------------- 1 file changed, 23 deletions(-) delete mode 100644 bld/namelist_files/namelist_defaults_cmip_era.xml diff --git a/bld/namelist_files/namelist_defaults_cmip_era.xml b/bld/namelist_files/namelist_defaults_cmip_era.xml deleted file mode 100644 index 81c10af811..0000000000 --- a/bld/namelist_files/namelist_defaults_cmip_era.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - -cmip7 -cmip6 -cmip6 -cmip6 -cmip6 - - From f408835fbacfae4a644bdcebb9c3485c725f3fe6 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Fri, 26 Sep 2025 16:24:36 -0600 Subject: [PATCH 057/129] Add cmip7 flag also for historical landuse files (f09, f19, ne30) --- bld/namelist_files/namelist_defaults_ctsm.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index 84fecb14d0..777b3bf78e 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -1891,9 +1891,9 @@ lnd/clm2/surfdata_esmf/NEON/ctsm5.3.0/surfdata_1x1_NEON_TOOL_hist_2000_78pfts_c2 >lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_4x5_hist_1850-2023_16pfts_c241007.nc -lnd/clm2/surfdata_esmf/ctsm5.4.0/landuse.timeseries_0.9x1.25_hist_1850-2023_78pfts_c250723.nc -lnd/clm2/surfdata_esmf/ctsm5.4.0/landuse.timeseries_1.9x2.5_hist_1850-2023_78pfts_c250723.nc lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_ne0np4.ARCTICGRIS.ne30x8_SSP2-4.5_1979-2026_78pfts_c240908.nc @@ -1923,7 +1923,7 @@ lnd/clm2/surfdata_esmf/NEON/ctsm5.3.0/surfdata_1x1_NEON_TOOL_hist_2000_78pfts_c2 >lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_ne3np4.pg3_SSP2-4.5_1850-2100_78pfts_c240908.nc lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_ne16np4.pg3_SSP2-4.5_1850-2100_78pfts_c240908.nc -lnd/clm2/surfdata_esmf/ctsm5.4.0/landuse.timeseries_ne30np4.pg3_hist_1850-2023_78pfts_c250723.nc Date: Fri, 26 Sep 2025 16:47:21 -0600 Subject: [PATCH 058/129] Add the cmip_era flag to all fsurdat/landuse add_default calls --- bld/CLMBuildNamelist.pm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index d30654a80d..65b9ef642e 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -2519,11 +2519,13 @@ sub setup_logic_demand { # For landuse.timeseries try with crop on first eise try with exact settings # Logic for this is identical for fsurdat if ( $item eq "flanduse_timeseries" ) { + $settings{'cmip_era'} = $nl_flags->{'cmip_era'}; $settings{'use_crop'} = ".true."; $settings{'nofail'} = 1; } add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, $item, %settings ); if ( $item eq "flanduse_timeseries" ) { + $settings{'cmip_era'} = $nl_flags->{'cmip_era'}; $settings{'nofail'} = 0; $settings{'use_crop'} = $nl_flags->{'use_crop'}; if ( ! defined($nl->get_value( $item )) ) { @@ -2573,6 +2575,7 @@ sub setup_logic_surface_dataset { add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, $var, 'hgrid'=>$nl_flags->{'res'}, 'ssp_rcp'=>$nl_flags->{'ssp_rcp'}, 'neon'=>$nl_flags->{'neon'}, 'neonsite'=>$nl_flags->{'neonsite'}, + 'cmip_era'=>$nl_flags->{'cmip_era'}, 'sim_year'=>$nl_flags->{'sim_year'}, 'use_vichydro'=>$nl_flags->{'use_vichydro'}, 'use_crop'=>".true.", 'use_fates'=>$nl_flags->{'use_fates'}, 'nofail'=>1); } @@ -2586,6 +2589,7 @@ sub setup_logic_surface_dataset { 'hgrid'=>$nl_flags->{'res'}, 'ssp_rcp'=>$nl_flags->{'ssp_rcp'}, 'use_vichydro'=>$nl_flags->{'use_vichydro'}, 'sim_year'=>$nl_flags->{'sim_year'}, 'use_fates'=>$nl_flags->{'use_fates'}, 'neon'=>$nl_flags->{'neon'}, 'neonsite'=>$nl_flags->{'neonsite'}, + 'cmip_era'=>$nl_flags->{'cmip_era'}, 'use_crop'=>$nl_flags->{'use_crop'} ); } # From 61014874652a7b53918eff6ad62fa4185579d9be Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Tue, 30 Sep 2025 16:34:01 -0600 Subject: [PATCH 059/129] Rm previously expected failures requiring finidat with c13/c14 to PASS --- cime_config/testdefs/ExpectedTestFails.xml | 28 ---------------------- 1 file changed, 28 deletions(-) diff --git a/cime_config/testdefs/ExpectedTestFails.xml b/cime_config/testdefs/ExpectedTestFails.xml index fe3237afa5..0fdb023f3d 100644 --- a/cime_config/testdefs/ExpectedTestFails.xml +++ b/cime_config/testdefs/ExpectedTestFails.xml @@ -29,34 +29,6 @@ - - - FAIL - #3311 - Requires finidat with c13/c14 to PASS - - - - - FAIL - #3311 - Requires finidat with c13/c14 to PASS - - - - - FAIL - #3311 - Requires finidat with c13/c14 to PASS - - - - - FAIL - #3311 - Requires finidat with c13/c14 to PASS - - FAIL From 3a0870f33850be4a4abefdfdbc82679deed48838 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Tue, 30 Sep 2025 17:28:36 -0600 Subject: [PATCH 060/129] Rm another expected failure that required finidat with c13/c14 to PASS --- cime_config/testdefs/ExpectedTestFails.xml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/cime_config/testdefs/ExpectedTestFails.xml b/cime_config/testdefs/ExpectedTestFails.xml index 0fdb023f3d..abe747b0fe 100644 --- a/cime_config/testdefs/ExpectedTestFails.xml +++ b/cime_config/testdefs/ExpectedTestFails.xml @@ -29,14 +29,6 @@ - - - FAIL - #3311 - Requires finidat with c13/c14 to PASS - - - FAIL From db3540d48d16e21189710c1077dc819f6b53f406 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Wed, 1 Oct 2025 15:45:35 -0600 Subject: [PATCH 061/129] Mention CLM_CMIP_ERA in namelist error message for easier debugging --- bld/CLMBuildNamelist.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index 65b9ef642e..4ec187557a 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -5454,7 +5454,7 @@ sub add_default { " Are defaults provided for this resolution and land mask?" ); } else { $log->fatal_error("No default value found for $var.\n" . - " Are defaults provided for this resolution and land mask?"); + " Are defaults provided in namelist_defaults for this resolution, land mask, and CLM_CMIP_ERA (set in env_run.xml)?"); } } else { From 3b15fbc8a8f1525ce95dee74bdb45560366269ec Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Wed, 1 Oct 2025 16:22:05 -0600 Subject: [PATCH 062/129] namelist_defaults updates for better error catching --- bld/namelist_files/namelist_defaults_ctsm.xml | 46 +++++++++---------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index 777b3bf78e..19bcd4d1c7 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -1304,7 +1304,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). lnd/clm2/initdata_esmf/ctsm5.3/clmi.interp_from.I1850Clm50BgcCrop-ciso.1366-01-01.0.9x1.25_gx1v7_simyr1850_c240223.nc @@ -1730,8 +1730,8 @@ lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_mpasa15_hist_2000_16pfts_c240908.nc - -lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_0.9x1.25_hist_2000_78pfts_c240908.nc + +lnd/clm2/surfdata_esmf/ctsm5.4.0/surfdata_0.9x1.25_hist_2000_78pfts_c250916.nc lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_1.9x2.5_hist_2000_78pfts_c240908.nc @@ -1941,61 +1941,61 @@ lnd/clm2/surfdata_esmf/NEON/ctsm5.3.0/surfdata_1x1_NEON_TOOL_hist_2000_78pfts_c2 -lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_0.9x1.25_SSP1-2.6_1850-2100_78pfts_c240908.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_0.9x1.25_SSP2-4.5_1850-2100_78pfts_c240908.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_1.9x2.5_SSP2-4.5_1850-2100_78pfts_c240908.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_4x5_SSP2-4.5_1850-2100_78pfts_c240908.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_10x15_SSP2-4.5_1850-2100_78pfts_c240908.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_360x720cru_SSP2-4.5_1850-2100_78pfts_c240908.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_1x1_brazil_SSP2-4.5_1850-2100_78pfts_c240912.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_mpasa120_SSP2-4.5_1850-2100_78pfts_c240908.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_ne3np4_SSP2-4.5_1850-2100_78pfts_c240926.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_ne3np4.pg3_SSP2-4.5_1850-2100_78pfts_c240908.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_ne16np4.pg3_SSP2-4.5_1850-2100_78pfts_c240908.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_ne30np4.pg3_SSP2-4.5_1850-2100_78pfts_c240908.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_C96_SSP2-4.5_1850-2100_78pfts_c240908.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_ne0np4.ARCTICGRIS.ne30x8_SSP2-4.5_1979-2026_78pfts_c240908.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_ne0np4.ARCTIC.ne30x4_SSP2-4.5_1979-2026_78pfts_c240908.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_ne0np4.POLARCAP.ne30x4_SSP2-4.5_1979-2026_78pfts_c240908.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_ne0np4CONUS.ne30x8_SSP2-4.5_1979-2026_78pfts_c240908.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_0.9x1.25_SSP3-7.0_1850-2100_78pfts_c240908.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_0.9x1.25_SSP4-6.0_1850-2100_78pfts_c240908.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_0.9x1.25_SSP5-8.5_1850-2100_78pfts_c240908.nc From 1283fb7bd790dad258e5a980b99284e1ab7e8482 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Wed, 1 Oct 2025 17:06:38 -0600 Subject: [PATCH 063/129] Remove another expected failure documented in issue #1733 --- cime_config/testdefs/ExpectedTestFails.xml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/cime_config/testdefs/ExpectedTestFails.xml b/cime_config/testdefs/ExpectedTestFails.xml index abe747b0fe..945bf5b4cb 100644 --- a/cime_config/testdefs/ExpectedTestFails.xml +++ b/cime_config/testdefs/ExpectedTestFails.xml @@ -137,13 +137,6 @@ - - - FAIL - #1733 - - - FAIL From 14f647df3b00a29ce4f8d3420d65388fcbe66549 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Wed, 1 Oct 2025 17:17:57 -0600 Subject: [PATCH 064/129] Remove expected failure in MODEL_BUILD documented in issue #3182 --- cime_config/testdefs/ExpectedTestFails.xml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/cime_config/testdefs/ExpectedTestFails.xml b/cime_config/testdefs/ExpectedTestFails.xml index 945bf5b4cb..0b2c558647 100644 --- a/cime_config/testdefs/ExpectedTestFails.xml +++ b/cime_config/testdefs/ExpectedTestFails.xml @@ -156,10 +156,6 @@ - - FAIL - #3182 - FAIL #3182 From 6c8128a6205cdd037dda847c40ba6c7c7f896c94 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Thu, 2 Oct 2025 11:52:13 -0600 Subject: [PATCH 065/129] Add details to CLM_CMIP_ERA documentation in env_run.xml --- cime_config/config_component.xml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cime_config/config_component.xml b/cime_config/config_component.xml index e0006ede9f..edef8320e3 100644 --- a/cime_config/config_component.xml +++ b/cime_config/config_component.xml @@ -167,7 +167,9 @@ run_component_ctsm env_run.xml Whether to use CMIP6 or CMIP7 fsurdat/landuse files. - As of ctsm5.4 we do not have CMIP7 pft raw datasets for SSPs and NOANTHRO, so default to cmip6 for these. For other compsets default to cmip7. User may modify to a non-default value in env_run.xml. + As of ctsm5.4 we do not have CMIP7 pft raw datasets for SSPs and NOANTHRO, so default to cmip6 for these. For other compsets default to cmip7. User may modify to a non-default value in env_run.xml. Caveats: +1) We supply only cmip7 C13/C14 isotope datasets, so these get used regardless. +2) We supply only cmip6 nitrogen deposition (ndep), so this gets used regardless. From a8124542e598546b0d0006699b49105b29eae421 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Thu, 2 Oct 2025 12:04:13 -0600 Subject: [PATCH 066/129] Add back the cmip6 flanduse defaults for f09, f19, ne30 --- bld/namelist_files/namelist_defaults_ctsm.xml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index 19bcd4d1c7..e977c6e050 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -1893,8 +1893,12 @@ lnd/clm2/surfdata_esmf/NEON/ctsm5.3.0/surfdata_1x1_NEON_TOOL_hist_2000_78pfts_c2 lnd/clm2/surfdata_esmf/ctsm5.4.0/landuse.timeseries_0.9x1.25_hist_1850-2023_78pfts_c250723.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_0.9x1.25_SSP2-4.5_1850-2100_78pfts_c240908.nc lnd/clm2/surfdata_esmf/ctsm5.4.0/landuse.timeseries_1.9x2.5_hist_1850-2023_78pfts_c250723.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_1.9x2.5_SSP2-4.5_1850-2100_78pfts_c240908.nc lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_ne0np4.ARCTICGRIS.ne30x8_SSP2-4.5_1979-2026_78pfts_c240908.nc lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_ne16np4.pg3_SSP2-4.5_1850-2100_78pfts_c240908.nc lnd/clm2/surfdata_esmf/ctsm5.4.0/landuse.timeseries_ne30np4.pg3_hist_1850-2023_78pfts_c250723.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_ne30np4.pg3_SSP2-4.5_1850-2100_78pfts_c240908.nc lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_C96_SSP2-4.5_1850-2100_78pfts_c240908.nc From 968eb7b6cb84465bb3164811ae455d9e8f4cd99e Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Thu, 2 Oct 2025 12:19:31 -0600 Subject: [PATCH 067/129] Add back the cmip6 fsurdat default for f09 2000 --- bld/namelist_files/namelist_defaults_ctsm.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index e977c6e050..6330e5e136 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -1732,6 +1732,8 @@ lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_mpasa3p75_hist_2000_16pfts_c240908.nc< lnd/clm2/surfdata_esmf/ctsm5.4.0/surfdata_0.9x1.25_hist_2000_78pfts_c250916.nc + +lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_0.9x1.25_hist_2000_78pfts_c240908.nc lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_1.9x2.5_hist_2000_78pfts_c240908.nc From d4af81e68f8b8c20ca994d960ee66297521000e2 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Thu, 2 Oct 2025 12:26:45 -0600 Subject: [PATCH 068/129] Add another detail to the CLM_CMIP_ERA documentation in env_run.xml --- cime_config/config_component.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cime_config/config_component.xml b/cime_config/config_component.xml index edef8320e3..429ec32d98 100644 --- a/cime_config/config_component.xml +++ b/cime_config/config_component.xml @@ -169,7 +169,8 @@ Whether to use CMIP6 or CMIP7 fsurdat/landuse files. As of ctsm5.4 we do not have CMIP7 pft raw datasets for SSPs and NOANTHRO, so default to cmip6 for these. For other compsets default to cmip7. User may modify to a non-default value in env_run.xml. Caveats: 1) We supply only cmip7 C13/C14 isotope datasets, so these get used regardless. -2) We supply only cmip6 nitrogen deposition (ndep), so this gets used regardless. +2) We supply only cmip7 population density with ctsm6 in non-SSP cases, because the fire model is calibrated to that; conversely, for pre-ctsm6 and for SSP we supply only cmip6 population density. +3) We supply only cmip6 nitrogen deposition (ndep), so this gets used regardless. From 7bf8c5b0f30c12209fce00975becc1ce1c7684a5 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Thu, 2 Oct 2025 12:33:17 -0600 Subject: [PATCH 069/129] Add same details to the cmip_era documentation in namelist_definition --- bld/namelist_files/namelist_definition_ctsm.xml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bld/namelist_files/namelist_definition_ctsm.xml b/bld/namelist_files/namelist_definition_ctsm.xml index 4fbf3f9777..7e481e6d86 100644 --- a/bld/namelist_files/namelist_definition_ctsm.xml +++ b/bld/namelist_files/namelist_definition_ctsm.xml @@ -2367,7 +2367,10 @@ A sim_year_range that goes beyond 2005 corresponds to historical data until 2005 Whether to use CMIP6 or CMIP7 fsurdat/landuse files. -As of ctsm5.4 we do not have CMIP7 pft raw datasets for SSPs and NOANTHRO, so default to cmip6 for these. For other compsets default to cmip7. User may modify to a non-default value in env_run.xml. +As of ctsm5.4 we do not have CMIP7 pft raw datasets for SSPs and NOANTHRO, so default to cmip6 for these. For other compsets default to cmip7. User may modify to a non-default value in env_run.xml. Caveats: +1) We supply only cmip7 C13/C14 isotope datasets, so these get used regardless. +2) We supply only cmip7 population density with ctsm6 in non-SSP cases, because the fire model is calibrated to that; conversely, for pre-ctsm6 and for SSP we supply only cmip6 population density. +3) We supply only cmip6 nitrogen deposition (ndep), so this gets used regardless. Date: Thu, 2 Oct 2025 14:10:48 -0600 Subject: [PATCH 070/129] Put back use_init_interp that I removed in 71f2db2 --- bld/namelist_files/namelist_defaults_ctsm.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index 6330e5e136..2f0e291285 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -1512,7 +1512,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). lnd/clm2/initdata_esmf/ctsm5.4/ctsm5.4_5.3.068_PPEcal115f09_118_HIST.clm2.r.2000-01-01-00000.nc Date: Thu, 2 Oct 2025 14:14:11 -0600 Subject: [PATCH 071/129] Remove SSP test from expected fails --- cime_config/testdefs/ExpectedTestFails.xml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/cime_config/testdefs/ExpectedTestFails.xml b/cime_config/testdefs/ExpectedTestFails.xml index 0b2c558647..48a621a3f5 100644 --- a/cime_config/testdefs/ExpectedTestFails.xml +++ b/cime_config/testdefs/ExpectedTestFails.xml @@ -331,14 +331,6 @@ - - - FAIL - #3250 - This should be resolved for the 5.4 release. - - - From c429f5f799e86b39cadc54eac2303a7328c9088d Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Wed, 8 Oct 2025 17:11:11 -0600 Subject: [PATCH 072/129] Changing build-namelist_test.pl; corresponding bug-fix in nml defaults I still need to fix four tests in build-namelist_test.pl. Three other tests are expected failures. --- bld/namelist_files/namelist_defaults_ctsm.xml | 2 +- bld/unit_testers/build-namelist_test.pl | 30 ++++++++++++++----- 2 files changed, 24 insertions(+), 8 deletions(-) diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index 2f0e291285..f6588d3ffe 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -1816,7 +1816,7 @@ lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_0.9x1.25_hist_1850_78pfts_c240908.nc lnd/clm2/surfdata_esmf/ctsm5.4.0/surfdata_1.9x2.5_hist_1850_78pfts_c250723.nc --lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_1.9x2.5_hist_1850_78pfts_c240908.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_1.9x2.5_hist_1850_78pfts_c240908.nc lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_10x15_hist_1850_78pfts_c240908.nc diff --git a/bld/unit_testers/build-namelist_test.pl b/bld/unit_testers/build-namelist_test.pl index ac5956506f..2236c5fda7 100755 --- a/bld/unit_testers/build-namelist_test.pl +++ b/bld/unit_testers/build-namelist_test.pl @@ -42,7 +42,7 @@ sub make_env_run { my %settings = @_; # Set default settings - my %env_vars = ( DIN_LOC_ROOT=>"MYDINLOCROOT", GLC_TWO_WAY_COUPLING=>"FALSE", LND_SETS_DUST_EMIS_DRV_FLDS=>"TRUE", NEONSITE=>"", PLUMBER2SITE=>"" ); + my %env_vars = ( DIN_LOC_ROOT=>"MYDINLOCROOT", GLC_TWO_WAY_COUPLING=>"FALSE", LND_SETS_DUST_EMIS_DRV_FLDS=>"TRUE", NEONSITE=>"", PLUMBER2SITE=>"", CLM_CMIP_ERA=>"cmip7" ); # Set any settings that came in from function call foreach my $item ( keys(%settings) ) { $env_vars{$item} = $settings{$item}; @@ -261,7 +261,7 @@ sub cat_and_create_namelistinfile { my $options = "-co2_ppmv 250 "; $options .= " -res 10x15 -ssp_rcp SSP2-4.5 -envxml_dir ."; - &make_env_run(); + &make_env_run( 'CLM_CMIP_ERA'=>"cmip6" ); eval{ system( "$bldnml $options > $tempfile 2>&1 " ); }; is( $@, '', "options: $options" ); $cfiles->checkfilesexist( "default", $mode ); @@ -611,6 +611,16 @@ sub cat_and_create_namelistinfile { system( "touch $finidat" ); my %failtest = ( + "cmip7_w_issp" =>{ options=>"-envxml_dir . -ssp_rcp SSP4-6.0", + namelst=>"", + CLM_CMIP_ERA=>"cmip7", + phys=>"clm6_0", + }, + "cmip6_w_i2000" =>{ options=>"-envxml_dir . -use_case 2000_control", + namelst=>"", + CLM_CMIP_ERA=>"cmip6", + phys=>"clm6_0", + }, "coldstart but with IC file"=>{ options=>"-clm_start_type cold -envxml_dir .", namelst=>"finidat='$finidat'", phys=>"clm5_0", @@ -1361,7 +1371,7 @@ sub cat_and_create_namelistinfile { my $options = $failtest{$key}{"options"}; my $namelist = $failtest{$key}{"namelst"}; my %settings; - foreach my $xmlvar ( "GLC_TWO_WAY_COUPLING", "LND_SETS_DUST_EMIS_DRV_FLDS") { + foreach my $xmlvar ( "GLC_TWO_WAY_COUPLING", "LND_SETS_DUST_EMIS_DRV_FLDS", "CLM_CMIP_ERA") { if ( defined($failtest{$key}{$xmlvar}) ) { $settings{$xmlvar} = $failtest{$key}{$xmlvar}; } @@ -1611,7 +1621,7 @@ sub cat_and_create_namelistinfile { foreach my $usecase ( @usecases ) { print "usecase = $usecase\n"; $options = "-res 0.9x1.25 -use_case $usecase -envxml_dir ."; - &make_env_run(); + &make_env_run( 'CLM_CMIP_ERA'=>"cmip6" ); my $expect_fail = undef; foreach my $failusecase ( @expect_fails ) { if ( $failusecase eq $usecase ) { @@ -1832,15 +1842,21 @@ sub cat_and_create_namelistinfile { my $startymd = undef; if ( ($usecase eq "1850_control") || ($usecase eq "20thC_transient") ) { $startymd = 18500101; + &make_env_run(); } elsif ( $usecase eq "2000_control") { $startymd = 20000101; + &make_env_run(); } elsif ( $usecase eq "2010_control") { $startymd = 20100101; + &make_env_run(); + } elsif ( $usecase eq "1850-2100_SSP2-4.5_transient") { + $startymd = 20150101; + &make_env_run( 'CLM_CMIP_ERA'=>"cmip6" ); } else { $startymd = 20150101; + &make_env_run(); } $options = "-bgc bgc -res $res -use_case $usecase -envxml_dir . -namelist '&a start_ymd=$startymd/'"; - &make_env_run(); eval{ system( "$bldnml $options > $tempfile 2>&1 " ); }; is( $@, '', "$options" ); $cfiles->checkfilesexist( "$options", $mode ); @@ -1877,11 +1893,11 @@ sub cat_and_create_namelistinfile { } # Transient ssp_rcp scenarios that work my @tran_res = ( "4x5", "0.9x1.25", "1.9x2.5", "10x15", "360x720cru", "ne3np4", "ne3np4.pg3", "ne16np4.pg3", "ne30np4.pg3", "C96", "mpasa120" ); +my $startymd = 20150101; +&make_env_run( 'CLM_CMIP_ERA'=>"cmip6" ); foreach my $usecase ( "1850-2100_SSP2-4.5_transient" ) { - my $startymd = 20150101; foreach my $res ( @tran_res ) { $options = "-res $res -bgc bgc -crop -use_case $usecase -envxml_dir . -namelist '&a start_ymd=$startymd/'"; - &make_env_run(); eval{ system( "$bldnml $options > $tempfile 2>&1 " ); }; is( $@, '', "$options" ); $cfiles->checkfilesexist( "$options", $mode ); From db26aaa3929b3e32c6d76dae5316c3dabc89f31b Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Wed, 8 Oct 2025 18:13:08 -0600 Subject: [PATCH 073/129] Fix 2 build-namelist tests that started failing in ctsm5.3.032 --- bld/unit_testers/build-namelist_test.pl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bld/unit_testers/build-namelist_test.pl b/bld/unit_testers/build-namelist_test.pl index 2236c5fda7..70cd776691 100755 --- a/bld/unit_testers/build-namelist_test.pl +++ b/bld/unit_testers/build-namelist_test.pl @@ -2030,7 +2030,8 @@ sub cat_and_create_namelistinfile { foreach my $bgc ( "sp", "bgc" ) { my $lndtuningmode = "${phys}_${forc}"; if ( $lndtuningmode eq "clm6_0_CRUv7" or - $lndtuningmode eq "clm4_5_CRUJRA2024") { + $lndtuningmode eq "clm4_5_CRUJRA2024" or + $lndtuningmode eq "clm5_0_CRUJRA2024") { next; } my $clmoptions = "-res $res -mask $mask -sim_year $simyr -envxml_dir . -lnd_tuning_mod $lndtuningmode -bgc $bgc"; From f16276d738c9aa54a121d76af20e49947fe2e4cc Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Wed, 8 Oct 2025 18:16:11 -0600 Subject: [PATCH 074/129] Rename 2nd inventoryfileDNE test to useFATESLUH2fileDNE --- bld/unit_testers/build-namelist_test.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bld/unit_testers/build-namelist_test.pl b/bld/unit_testers/build-namelist_test.pl index 70cd776691..db096652a9 100755 --- a/bld/unit_testers/build-namelist_test.pl +++ b/bld/unit_testers/build-namelist_test.pl @@ -1156,7 +1156,7 @@ sub cat_and_create_namelistinfile { namelst=>"use_fates_lupft=.true.", phys=>"clm4_5", }, - "inventoryfileDNE" =>{ options=>"-bgc fates -envxml_dir . -no-megan", + "useFATESLUH2fileDNE" =>{ options=>"-bgc fates -envxml_dir . -no-megan", namelst=>"use_fates_luh=.true., fluh_timeseries='zztop'", phys=>"clm4_5", }, From 8100fa8b5dc21d7bd084d566dcd1f5e052e25f65 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Wed, 8 Oct 2025 18:19:48 -0600 Subject: [PATCH 075/129] Resolve build-namelist tests, though not all, yet --- bld/unit_testers/build-namelist_test.pl | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/bld/unit_testers/build-namelist_test.pl b/bld/unit_testers/build-namelist_test.pl index db096652a9..b741f57baa 100755 --- a/bld/unit_testers/build-namelist_test.pl +++ b/bld/unit_testers/build-namelist_test.pl @@ -569,12 +569,30 @@ sub cat_and_create_namelistinfile { &make_config_cache($phys); foreach my $options ( "--res 0.9x1.25 --bgc sp --use_case 1850-2100_SSP2-4.5_transient --namelist '&a start_ymd=18501223/'", + "--res 1.9x2.5 --bgc bgc --use_case 1850-2100_SSP2-4.5_transient --namelist '&a start_ymd=19101023/'", + ) { + my $file = $startfile; + &make_env_run( 'CLM_CMIP_ERA'=>"cmip6" ); + eval{ system( "$bldnml -envxml_dir . $options > $tempfile 2>&1 " ); }; + is( $@, '', "options: $options" ); + $cfiles->checkfilesexist( "$options", $mode ); + $cfiles->shownmldiff( "default", $mode ); + if ( defined($opts{'compare'}) ) { + $cfiles->doNOTdodiffonfile( "$tempfile", "$options", $mode ); + $cfiles->dodiffonfile( "lnd_in", "$options", $mode ); + $cfiles->comparefiles( "$options", $mode, $opts{'compare'} ); + } + if ( defined($opts{'generate'}) ) { + $cfiles->copyfiles( "$options", $mode ); + } + &cleanup(); +} +foreach my $options ( "-bgc fates -use_case 2000_control -no-megan", "-bgc fates -use_case 20thC_transient -no-megan", "-bgc fates -use_case 20thC_transient -no-megan -no-crop --res 4x5", "-bgc fates -use_case 1850_control -no-megan -namelist \"&a use_fates_sp=T, soil_decomp_method='None'/\"", "-bgc sp -use_case 2000_control -res 0.9x1.25 -namelist '&a use_soil_moisture_streams = T/'", - "--res 1.9x2.5 --bgc bgc --use_case 1850-2100_SSP2-4.5_transient --namelist '&a start_ymd=19101023/'", "-namelist \"&a dust_emis_method='Zender_2003', zender_soil_erod_source='lnd' /'\"", "-bgc bgc -use_case 2000_control -namelist \"&a fire_method='nofire'/\" -crop", "-res 0.9x1.25 -bgc sp -use_case 1850_noanthro_control -drydep", From 3beef40fd30c4fe15a1d9160163c65d1b9d953ef Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Wed, 8 Oct 2025 19:22:51 -0600 Subject: [PATCH 076/129] Resolved remaining fails (except 2 expected ones) in build-namelist --- bld/unit_testers/build-namelist_test.pl | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/bld/unit_testers/build-namelist_test.pl b/bld/unit_testers/build-namelist_test.pl index b741f57baa..7c5fc59bb0 100755 --- a/bld/unit_testers/build-namelist_test.pl +++ b/bld/unit_testers/build-namelist_test.pl @@ -570,6 +570,8 @@ sub cat_and_create_namelistinfile { foreach my $options ( "--res 0.9x1.25 --bgc sp --use_case 1850-2100_SSP2-4.5_transient --namelist '&a start_ymd=18501223/'", "--res 1.9x2.5 --bgc bgc --use_case 1850-2100_SSP2-4.5_transient --namelist '&a start_ymd=19101023/'", + "--res 1.9x2.5 --bgc bgc --use_case 1850_control --namelist '&a start_ymd=18500101/'", + "--res 1.9x2.5 --bgc bgc --use_case 20thC_transient --namelist '&a start_ymd=18500101/'", ) { my $file = $startfile; &make_env_run( 'CLM_CMIP_ERA'=>"cmip6" ); @@ -629,16 +631,11 @@ sub cat_and_create_namelistinfile { system( "touch $finidat" ); my %failtest = ( - "cmip7_w_issp" =>{ options=>"-envxml_dir . -ssp_rcp SSP4-6.0", + "cmip7_w_issp" =>{ options=>"-envxml_dir . -use_case 1850-2100_SSP2-4.5_transient", namelst=>"", CLM_CMIP_ERA=>"cmip7", phys=>"clm6_0", }, - "cmip6_w_i2000" =>{ options=>"-envxml_dir . -use_case 2000_control", - namelst=>"", - CLM_CMIP_ERA=>"cmip6", - phys=>"clm6_0", - }, "coldstart but with IC file"=>{ options=>"-clm_start_type cold -envxml_dir .", namelst=>"finidat='$finidat'", phys=>"clm5_0", From 807040de0173631367c323510298005f1393c23a Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Mon, 13 Oct 2025 17:34:39 -0600 Subject: [PATCH 077/129] Change from "if a equals b" to "if a contains b" where b are SSP cases --- bld/unit_testers/build-namelist_test.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bld/unit_testers/build-namelist_test.pl b/bld/unit_testers/build-namelist_test.pl index 7c5fc59bb0..2fce56de4d 100755 --- a/bld/unit_testers/build-namelist_test.pl +++ b/bld/unit_testers/build-namelist_test.pl @@ -163,7 +163,7 @@ sub cat_and_create_namelistinfile { # # Figure out number of tests that will run # -my $ntests = 3394; +my $ntests = 3396; if ( defined($opts{'compare'}) ) { $ntests += 2061; @@ -1864,7 +1864,7 @@ sub cat_and_create_namelistinfile { } elsif ( $usecase eq "2010_control") { $startymd = 20100101; &make_env_run(); - } elsif ( $usecase eq "1850-2100_SSP2-4.5_transient") { + } elsif ( $usecase =~ "2100_SSP") { $startymd = 20150101; &make_env_run( 'CLM_CMIP_ERA'=>"cmip6" ); } else { From 826cee4b55428dc24f6d26c69e79a0f0618a8904 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Mon, 13 Oct 2025 17:37:52 -0600 Subject: [PATCH 078/129] Add LAI streams test to expected fails for now --- cime_config/testdefs/ExpectedTestFails.xml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cime_config/testdefs/ExpectedTestFails.xml b/cime_config/testdefs/ExpectedTestFails.xml index 48a621a3f5..e6f4295275 100644 --- a/cime_config/testdefs/ExpectedTestFails.xml +++ b/cime_config/testdefs/ExpectedTestFails.xml @@ -29,6 +29,13 @@ + + + FAIL + #3529 + We will generate new fsurdat files with the new raw lai file to resolve this issue. + + FAIL From 2e271ca50710c4d2f83ab68ede04f1bfa14ea50f Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Mon, 13 Oct 2025 17:46:04 -0600 Subject: [PATCH 079/129] Remove unnecessary change to namelist_definition_ctsm.xml --- bld/namelist_files/namelist_definition_ctsm.xml | 9 --------- 1 file changed, 9 deletions(-) diff --git a/bld/namelist_files/namelist_definition_ctsm.xml b/bld/namelist_files/namelist_definition_ctsm.xml index 7e481e6d86..69a243bd27 100644 --- a/bld/namelist_files/namelist_definition_ctsm.xml +++ b/bld/namelist_files/namelist_definition_ctsm.xml @@ -2364,15 +2364,6 @@ A sim_year_range of 1000-1002 or 1000-1004 corresponds to data used for testing A sim_year_range that goes beyond 2005 corresponds to historical data until 2005 and then scenario data beyond that point. - -Whether to use CMIP6 or CMIP7 fsurdat/landuse files. -As of ctsm5.4 we do not have CMIP7 pft raw datasets for SSPs and NOANTHRO, so default to cmip6 for these. For other compsets default to cmip7. User may modify to a non-default value in env_run.xml. Caveats: -1) We supply only cmip7 C13/C14 isotope datasets, so these get used regardless. -2) We supply only cmip7 population density with ctsm6 in non-SSP cases, because the fire model is calibrated to that; conversely, for pre-ctsm6 and for SSP we supply only cmip6 population density. -3) We supply only cmip6 nitrogen deposition (ndep), so this gets used regardless. - - Namelist entries to demand be provided on the namelist. From 92dd6d5215dbed19dfa2da7655265f7e220bc55e Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Mon, 13 Oct 2025 18:01:37 -0600 Subject: [PATCH 080/129] Add comment explaining why I split hist-ne3 into three separate jobs --- tools/mksurfdata_esmf/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/mksurfdata_esmf/Makefile b/tools/mksurfdata_esmf/Makefile index e94d8edd4d..037d004ad6 100644 --- a/tools/mksurfdata_esmf/Makefile +++ b/tools/mksurfdata_esmf/Makefile @@ -99,6 +99,7 @@ STANDARD = \ # crop-global-future # and I added here because it spans 1979-2030: # crop-global-SSP2-4.5-vrandne120 +# and I split ne3 into ne3-1, ne3-2, ne3-3 for historical because the combined ne3 job took >12 hours in the queue CROP = \ crop-global-hist \ crop-global-hist-low-res \ From c3e1ca1a2d494d6e72ae7cac87c7479bf55d0af4 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Mon, 13 Oct 2025 18:17:40 -0600 Subject: [PATCH 081/129] Point to corrected raw lai file and correspondng soil color file --- tools/mksurfdata_esmf/gen_mksurfdata_namelist.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/mksurfdata_esmf/gen_mksurfdata_namelist.xml b/tools/mksurfdata_esmf/gen_mksurfdata_namelist.xml index cd9a5b058a..938840bfe1 100644 --- a/tools/mksurfdata_esmf/gen_mksurfdata_namelist.xml +++ b/tools/mksurfdata_esmf/gen_mksurfdata_namelist.xml @@ -10,7 +10,7 @@ - lnd/clm2/rawdata/CTSM54RawData/globalctsm53histMKSRFDeg025_250417/mksrf_landuse_ctsm53_pftlai_CLIM.c250417.nc + lnd/clm2/rawdata/CTSM54RawData/CLM6_LUH3_HIST_CMIP7/mksrf_pftlai_clm6_histLUH3_2005_c251012.nc lnd/clm2/mappingdata/grids/UNSTRUCTgrid_0.25x0.25_nomask_cdf5_c200129.nc @@ -21,7 +21,7 @@ - lnd/clm2/rawdata/CTSM54RawData/globalctsm53histMKSRFDeg025_250417/mksrf_landuse_ctsm53_soilcolor_CLIM.c250417.nc + lnd/clm2/rawdata/CTSM54RawData/CLM6_LUH3_HIST_CMIP7/mksrf_soilcolor_clm6_histLUH3_2005_c251012.nc lnd/clm2/mappingdata/grids/UNSTRUCTgrid_0.25x0.25_nomask_cdf5_c200129.nc From 5a09596588e9659afa81a11ccd57a3b6e59a712e Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Mon, 13 Oct 2025 18:29:55 -0600 Subject: [PATCH 082/129] Added back 1x1_brazil_transient to the mksurfdata_esmf Makefile --- tools/mksurfdata_esmf/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/mksurfdata_esmf/Makefile b/tools/mksurfdata_esmf/Makefile index 037d004ad6..8a31f8bffe 100644 --- a/tools/mksurfdata_esmf/Makefile +++ b/tools/mksurfdata_esmf/Makefile @@ -143,10 +143,10 @@ all : all-subset global-present-ultra-hi-res crop standard crop-tropics-present # These are all the surface datasets generated by subset_data # This runs interactively and does not send jobs to the batch queue # NOTE slevis 2025/9/10: For CTSM5.4, I removed from all-subset: -# 1x1_brazil-transient # 1x1-smallville-present all-subset : \ 1x1_brazil-present \ + 1x1_brazil-transient \ 1x1-numa-present \ 1x1-smallville-1850 \ 1x1-smallville-transient \ From 2ea100a1a0568f176b2c3ac32cf5009104eda152 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Tue, 14 Oct 2025 10:26:41 -0600 Subject: [PATCH 083/129] Revert c3e1ca1 "Point to corrected raw lai file and corresp. soil color" --- tools/mksurfdata_esmf/gen_mksurfdata_namelist.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/mksurfdata_esmf/gen_mksurfdata_namelist.xml b/tools/mksurfdata_esmf/gen_mksurfdata_namelist.xml index 938840bfe1..cd9a5b058a 100644 --- a/tools/mksurfdata_esmf/gen_mksurfdata_namelist.xml +++ b/tools/mksurfdata_esmf/gen_mksurfdata_namelist.xml @@ -10,7 +10,7 @@ - lnd/clm2/rawdata/CTSM54RawData/CLM6_LUH3_HIST_CMIP7/mksrf_pftlai_clm6_histLUH3_2005_c251012.nc + lnd/clm2/rawdata/CTSM54RawData/globalctsm53histMKSRFDeg025_250417/mksrf_landuse_ctsm53_pftlai_CLIM.c250417.nc lnd/clm2/mappingdata/grids/UNSTRUCTgrid_0.25x0.25_nomask_cdf5_c200129.nc @@ -21,7 +21,7 @@ - lnd/clm2/rawdata/CTSM54RawData/CLM6_LUH3_HIST_CMIP7/mksrf_soilcolor_clm6_histLUH3_2005_c251012.nc + lnd/clm2/rawdata/CTSM54RawData/globalctsm53histMKSRFDeg025_250417/mksrf_landuse_ctsm53_soilcolor_CLIM.c250417.nc lnd/clm2/mappingdata/grids/UNSTRUCTgrid_0.25x0.25_nomask_cdf5_c200129.nc From 4ff9e681dd71dfd6fcedac1450b744c7081e4991 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Tue, 14 Oct 2025 14:26:46 -0600 Subject: [PATCH 084/129] New and updated comments pertaining to CLM_CMIP_ERA --- bld/CLMBuildNamelist.pm | 5 ++++- bld/unit_testers/build-namelist_test.pl | 1 + cime_config/config_component.xml | 11 +++++++---- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index 4ec187557a..689470d737 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -737,7 +737,10 @@ sub setup_cmdl_resolution { # # To determine CMIP era - # + # TODO slevis: Ideally this line would occupy a new subroutine, e.g. + # subr. process_envxml_flags that would get called from + # process_namelist_user_input. This would allow other such + # XML variables to be set in the same place in the future (issue #3547). $nl_flags->{'cmip_era'} = $envxml_ref->{'CLM_CMIP_ERA'}; } diff --git a/bld/unit_testers/build-namelist_test.pl b/bld/unit_testers/build-namelist_test.pl index 2fce56de4d..725a5defff 100755 --- a/bld/unit_testers/build-namelist_test.pl +++ b/bld/unit_testers/build-namelist_test.pl @@ -567,6 +567,7 @@ sub cat_and_create_namelistinfile { $phys = "clm5_0"; $mode = "-phys $phys"; &make_config_cache($phys); +# Four tests that require CLM_CMIP_ERA set to cmip6 foreach my $options ( "--res 0.9x1.25 --bgc sp --use_case 1850-2100_SSP2-4.5_transient --namelist '&a start_ymd=18501223/'", "--res 1.9x2.5 --bgc bgc --use_case 1850-2100_SSP2-4.5_transient --namelist '&a start_ymd=19101023/'", diff --git a/cime_config/config_component.xml b/cime_config/config_component.xml index 429ec32d98..e7e8f68314 100644 --- a/cime_config/config_component.xml +++ b/cime_config/config_component.xml @@ -167,10 +167,13 @@ run_component_ctsm env_run.xml Whether to use CMIP6 or CMIP7 fsurdat/landuse files. - As of ctsm5.4 we do not have CMIP7 pft raw datasets for SSPs and NOANTHRO, so default to cmip6 for these. For other compsets default to cmip7. User may modify to a non-default value in env_run.xml. Caveats: -1) We supply only cmip7 C13/C14 isotope datasets, so these get used regardless. -2) We supply only cmip7 population density with ctsm6 in non-SSP cases, because the fire model is calibrated to that; conversely, for pre-ctsm6 and for SSP we supply only cmip6 population density. -3) We supply only cmip6 nitrogen deposition (ndep), so this gets used regardless. + As of ctsm5.4 we do not have CMIP7 PFT raw datasets for SSPs and NOANTHRO, so default to CMIP6 for these. For other compsets default to CMIP7. User may modify to a non-default value in env_run.xml. +Caveats: +1) We supply only CMIP7 C13/C14 isotope datasets, so these get used regardless. +2) We supply only CMIP7 population density with ctsm6 in non-SSP cases, because the fire model is calibrated to that; conversely, for pre-ctsm6 and for SSP we supply only CMIP6 population density. +3) We supply only CMIP6 nitrogen deposition (ndep), so this gets used regardless. +4) For DATM we supply only CMIP6 aerosols. +5) For DATM we supply only CMIP6 CO2 From 92ee1a16addef9a42916dddc5b7b31b9c5dc252b Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Tue, 14 Oct 2025 18:12:14 -0600 Subject: [PATCH 085/129] Point to corrected raw lai file and corresp. soil color file This is identical to and replaces the earlier commit c3e1ca1a2d494d6e72ae7cac87c7479bf55d0af4 that I had to reverse. --- tools/mksurfdata_esmf/gen_mksurfdata_namelist.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/mksurfdata_esmf/gen_mksurfdata_namelist.xml b/tools/mksurfdata_esmf/gen_mksurfdata_namelist.xml index cd9a5b058a..b8d88352b7 100644 --- a/tools/mksurfdata_esmf/gen_mksurfdata_namelist.xml +++ b/tools/mksurfdata_esmf/gen_mksurfdata_namelist.xml @@ -10,7 +10,7 @@ - lnd/clm2/rawdata/CTSM54RawData/globalctsm53histMKSRFDeg025_250417/mksrf_landuse_ctsm53_pftlai_CLIM.c250417.nc + lnd/clm2/rawdata/CTSM54RawData/CLM6_LUH3_HIST_CMIP7/mksrf_pftlai_clm6_histLUH3_2005_c251012.nc lnd/clm2/mappingdata/grids/UNSTRUCTgrid_0.25x0.25_nomask_cdf5_c200129.nc @@ -21,7 +21,7 @@ - lnd/clm2/rawdata/CTSM54RawData/globalctsm53histMKSRFDeg025_250417/mksrf_landuse_ctsm53_soilcolor_CLIM.c250417.nc + lnd/clm2/rawdata/CTSM54RawData/CLM6_LUH3_HIST_CMIP7/mksrf_soilcolor_clm6_histLUH3_2005_c251012.c250417.nc lnd/clm2/mappingdata/grids/UNSTRUCTgrid_0.25x0.25_nomask_cdf5_c200129.nc From f1ea8889e3aaecf90c6f2391892cd53f9cc33f9d Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Tue, 14 Oct 2025 18:19:54 -0600 Subject: [PATCH 086/129] Correction to soilcolor file name --- tools/mksurfdata_esmf/gen_mksurfdata_namelist.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/mksurfdata_esmf/gen_mksurfdata_namelist.xml b/tools/mksurfdata_esmf/gen_mksurfdata_namelist.xml index b8d88352b7..938840bfe1 100644 --- a/tools/mksurfdata_esmf/gen_mksurfdata_namelist.xml +++ b/tools/mksurfdata_esmf/gen_mksurfdata_namelist.xml @@ -21,7 +21,7 @@ - lnd/clm2/rawdata/CTSM54RawData/CLM6_LUH3_HIST_CMIP7/mksrf_soilcolor_clm6_histLUH3_2005_c251012.c250417.nc + lnd/clm2/rawdata/CTSM54RawData/CLM6_LUH3_HIST_CMIP7/mksrf_soilcolor_clm6_histLUH3_2005_c251012.nc lnd/clm2/mappingdata/grids/UNSTRUCTgrid_0.25x0.25_nomask_cdf5_c200129.nc From e64f426ea35dfd220ea90652b596a80f5c684381 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Thu, 16 Oct 2025 11:35:11 -0600 Subject: [PATCH 087/129] Upd. to latest 1700-2023 & noanthro landuse files ...generated when the corrected lai & soilcolor raw datasets were generated; we're switching to these new landuse files because they ended up with 0.01% diffs in PCT_NAT_PFT and PCT_CFT values relative to the previous version --- tools/mksurfdata_esmf/gen_mksurfdata_namelist.xml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tools/mksurfdata_esmf/gen_mksurfdata_namelist.xml b/tools/mksurfdata_esmf/gen_mksurfdata_namelist.xml index 938840bfe1..1d242a11c5 100644 --- a/tools/mksurfdata_esmf/gen_mksurfdata_namelist.xml +++ b/tools/mksurfdata_esmf/gen_mksurfdata_namelist.xml @@ -204,37 +204,37 @@ version of the raw dataset will probably go away. - + - lnd/clm2/rawdata/CTSM53RawData/globalctsm53histTRNOANTHRODeg025_240831/mksrf_landuse_ctsm53_histTRNOANTHRO_1.c240831.nc + lnd/clm2/rawdata/CTSM54RawData/CLM6_LUH3_NOANTHRO_CMIP7/mksrf_landuse_clm6_noanthroLUH3_1.c251012.nc lnd/clm2/mappingdata/grids/UNSTRUCTgrid_0.25x0.25_nomask_cdf5_c200129.nc lnd/clm2/rawdata/lake_area/mksurf_lake_0.05x0.05_hist_clm5_hydrolakes_1850.cdf5.c20220325.nc lnd/clm2/rawdata/mksrf_urban_0.05x0.05_zerourbanpct.cdf5.c181014.nc - lnd/clm2/rawdata/CTSM54RawData/globalctsm53histCMIP7Deg025_250417/mksrf_landuse_ctsm53_histCMIP7_1700.c250417.nc + lnd/clm2/rawdata/CTSM54RawData/CLM6_LUH3_HIST_CMIP7/mksrf_landuse_clm6_histLUH3_1700.c251012.nc lnd/clm2/mappingdata/grids/UNSTRUCTgrid_0.25x0.25_nomask_cdf5_c200129.nc lnd/clm2/rawdata/lake_area/mksurf_lake_0.05x0.05_hist_clm5_hydrolakes_1850.cdf5.c20220325.nc lnd/clm2/rawdata/CTSM54RawData/urban_properties/urban_properties_CMIP7_ThreeClass_1700_c250423.nc - lnd/clm2/rawdata/CTSM54RawData/globalctsm53histCMIP7Deg025_250417/mksrf_landuse_ctsm53_histCMIP7_1850.c250417.nc + lnd/clm2/rawdata/CTSM54RawData/CLM6_LUH3_HIST_CMIP7/mksrf_landuse_clm6_histLUH3_1850.c251012.nc lnd/clm2/mappingdata/grids/UNSTRUCTgrid_0.25x0.25_nomask_cdf5_c200129.nc lnd/clm2/rawdata/lake_area/mksurf_lake_0.05x0.05_hist_clm5_hydrolakes_1850.cdf5.c20220325.nc lnd/clm2/rawdata/CTSM54RawData/urban_properties/urban_properties_CMIP7_ThreeClass_1850_c250423.nc - lnd/clm2/rawdata/CTSM54RawData/globalctsm53histCMIP7Deg025_250417/mksrf_landuse_ctsm53_histCMIP7_2000.c250417.nc + lnd/clm2/rawdata/CTSM54RawData/CLM6_LUH3_HIST_CMIP7/mksrf_landuse_clm6_histLUH3_2000.c251012.nc lnd/clm2/mappingdata/grids/UNSTRUCTgrid_0.25x0.25_nomask_cdf5_c200129.nc lnd/clm2/rawdata/lake_area/mksurf_lake_0.05x0.05_hist_clm5_hydrolakes_2000.cdf5.c20220325.nc lnd/clm2/rawdata/CTSM54RawData/urban_properties/urban_properties_CMIP7_ThreeClass_2000_c250423.nc - lnd/clm2/rawdata/CTSM54RawData/globalctsm53histCMIP7Deg025_250417/mksrf_landuse_ctsm53_histCMIP7_2005.c250417.nc + lnd/clm2/rawdata/CTSM54RawData/CLM6_LUH3_HIST_CMIP7/mksrf_landuse_clm6_histLUH3_2005.c251012.nc lnd/clm2/mappingdata/grids/UNSTRUCTgrid_0.25x0.25_nomask_cdf5_c200129.nc lnd/clm2/rawdata/lake_area/mksurf_lake_0.05x0.05_hist_clm5_hydrolakes_2005.cdf5.c20220325.nc lnd/clm2/rawdata/CTSM54RawData/urban_properties/urban_properties_CMIP7_ThreeClass_2005_c250423.nc @@ -252,7 +252,7 @@ version of the raw dataset will probably go away. - lnd/clm2/rawdata/CTSM54RawData/globalctsm53histCMIP7Deg025_250417/mksrf_landuse_ctsm53_histCMIP7_%y.c250417.nc + lnd/clm2/rawdata/CTSM54RawData/CLM6_LUH3_HIST_CMIP7/mksrf_landuse_clm6_histLUH3_%y.c251012.nc lnd/clm2/mappingdata/grids/UNSTRUCTgrid_0.25x0.25_nomask_cdf5_c200129.nc lnd/clm2/rawdata/lake_area/mksurf_lake_0.05x0.05_hist_clm5_hydrolakes_%y.cdf5.c20220325.nc lnd/clm2/rawdata/CTSM54RawData/urban_properties/urban_properties_CMIP7_ThreeClass_%y_c250423.nc From bbc9e40966910eb68c534bf5499f53710648ac5b Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Thu, 16 Oct 2025 15:19:06 -0600 Subject: [PATCH 088/129] Add test back to expected failures (issue #1733) The test seemed fixed in a short range of tags: ctsm5.3.063 to .072 and alpha-ctsm5.4.CMIP7.09.ctsm5.3.068 to .075 --- cime_config/testdefs/ExpectedTestFails.xml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cime_config/testdefs/ExpectedTestFails.xml b/cime_config/testdefs/ExpectedTestFails.xml index 1084e9d8ca..5d4d51e123 100644 --- a/cime_config/testdefs/ExpectedTestFails.xml +++ b/cime_config/testdefs/ExpectedTestFails.xml @@ -144,6 +144,13 @@ + + + FAIL + #1733 + + + FAIL From 37ae51ed472b21581aa352d505b0a16499b69e90 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Thu, 16 Oct 2025 18:00:33 -0600 Subject: [PATCH 089/129] Stop NOANTHRO from defaulting to cmip_era cmip6 --- cime_config/config_component.xml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cime_config/config_component.xml b/cime_config/config_component.xml index e7e8f68314..13140ad083 100644 --- a/cime_config/config_component.xml +++ b/cime_config/config_component.xml @@ -161,13 +161,12 @@ cmip6,cmip7 cmip7 - cmip6 cmip6 run_component_ctsm env_run.xml Whether to use CMIP6 or CMIP7 fsurdat/landuse files. - As of ctsm5.4 we do not have CMIP7 PFT raw datasets for SSPs and NOANTHRO, so default to CMIP6 for these. For other compsets default to CMIP7. User may modify to a non-default value in env_run.xml. + As of ctsm5.4 we do not have CMIP7 PFT raw datasets for SSPs, so default to CMIP6 for these. For other compsets default to CMIP7. User may modify to a non-default value in env_run.xml. Caveats: 1) We supply only CMIP7 C13/C14 isotope datasets, so these get used regardless. 2) We supply only CMIP7 population density with ctsm6 in non-SSP cases, because the fire model is calibrated to that; conversely, for pre-ctsm6 and for SSP we supply only CMIP6 population density. From 5399e09acc08b00fd96351c33b6938a5dfaac214 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Fri, 17 Oct 2025 17:20:27 -0600 Subject: [PATCH 090/129] Change VR and ne120 year range from 1979-2030 to 1979-2023 --- .../ctsm/toolchain/gen_mksurfdata_jobscript_multi.py | 6 +++--- tools/mksurfdata_esmf/Makefile | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/python/ctsm/toolchain/gen_mksurfdata_jobscript_multi.py b/python/ctsm/toolchain/gen_mksurfdata_jobscript_multi.py index b038154be0..1bae37bb29 100755 --- a/python/ctsm/toolchain/gen_mksurfdata_jobscript_multi.py +++ b/python/ctsm/toolchain/gen_mksurfdata_jobscript_multi.py @@ -58,7 +58,7 @@ "crop-global-SSP2-4.5-f19", "crop-global-SSP2-4.5-f10", "crop-global-SSP2-4.5-f45", - "crop-global-SSP2-4.5-vrandne120", + "crop-global-hist-vrandne120", "crop-global-SSP2-4.5-ne3", "crop-global-SSP2-4.5-ne16", "crop-global-SSP2-4.5-ne30", @@ -389,8 +389,8 @@ def main(): "--start-year 1850 --end-year 2100 --nosurfdata --ssp-rcp SSP2-4.5 --res", "f45", ), - "crop-global-SSP2-4.5-vrandne120": ( - "--start-year 1979 --end-year 2030 --ssp-rcp SSP2-4.5 --res", + "crop-global-hist-vrandne120": ( + "--start-year 1979 --end-year 2023 --res", "vr_and_ne120", ), "crop-global-SSP2-4.5-ne3": ( diff --git a/tools/mksurfdata_esmf/Makefile b/tools/mksurfdata_esmf/Makefile index 8a31f8bffe..79b863d7ac 100644 --- a/tools/mksurfdata_esmf/Makefile +++ b/tools/mksurfdata_esmf/Makefile @@ -97,8 +97,8 @@ STANDARD = \ # NOTE slevis 2025/9/10: For CTSM5.4, I removed from CROP: # crop-global-future -# and I added here because it spans 1979-2030: -# crop-global-SSP2-4.5-vrandne120 +# and I added here because it spans 1979-2023: +# crop-global-hist-vrandne120 # and I split ne3 into ne3-1, ne3-2, ne3-3 for historical because the combined ne3 job took >12 hours in the queue CROP = \ crop-global-hist \ @@ -125,7 +125,7 @@ CROP = \ crop-global-1850-ne16 \ crop-global-1850-ne30 \ crop-global-1850-mpasa480 \ - crop-global-SSP2-4.5-vrandne120 \ + crop-global-hist-vrandne120 \ # Build the executable if it doesn't exist and any target depends on it $(MKSURFDATA_EXE): @@ -350,8 +350,8 @@ crop-global-future : crop-global-SSP1-1.9-f09 \ crop-global-SSP2-4.5-low-res : crop-global-SSP2-4.5-f10 \ crop-global-SSP2-4.5-f45 \ crop-global-SSP2-4.5-ne3 -# NOTE slevis 2025/9/10: For CTSM5.4, I moved to CROP because it spans 1979-2030: -# crop-global-SSP2-4.5-vrandne120 +# NOTE slevis 2025/9/10: For CTSM5.4, I moved to CROP because it spans 1979-2023: +# crop-global-hist-vrandne120 crop-global-SSP2-4.5 : crop-global-SSP2-4.5-f09 \ crop-global-SSP2-4.5-f19 \ crop-global-SSP2-4.5-hcru \ @@ -400,7 +400,7 @@ crop-global-SSP2-4.5-ne30 : FORCE $(MKSURFDATA) --number-of-nodes 9 --scenario $@ --jobscript-file $@.sh --walltime 12:00:00 $(BATCHJOBS) $@.sh -crop-global-SSP2-4.5-vrandne120 : FORCE +crop-global-hist-vrandne120 : FORCE $(MKSURFDATA) --number-of-nodes 2 --scenario $@ --jobscript-file $@.sh --walltime 12:00:00 $(BATCHJOBS) $@.sh From ad3b2c9844c10aa4e371111c128bc9d616967f02 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Mon, 20 Oct 2025 12:41:37 -0600 Subject: [PATCH 091/129] Upd. to ccs_config_cesm1.0.61_add_domain_ne3np4.pg2_1 to gen. datasets --- .gitmodules | 2 +- ccs_config | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitmodules b/.gitmodules index a9bfb47b0c..f0e6ed2ef6 100644 --- a/.gitmodules +++ b/.gitmodules @@ -68,7 +68,7 @@ fxDONOTUSEurl = https://github.com/ESCOMP/mizuRoute [submodule "ccs_config"] path = ccs_config url = https://github.com/ESMCI/ccs_config_cesm.git -fxtag = ccs_config_cesm1.0.61 +fxtag = ccs_config_cesm1.0.61_add_domain_ne3np4.pg2_1 fxrequired = ToplevelRequired # Standard Fork to compare to with "git fleximod test" to ensure personal forks aren't committed fxDONOTUSEurl = https://github.com/ESMCI/ccs_config_cesm.git diff --git a/ccs_config b/ccs_config index b20a207bc9..d686615fac 160000 --- a/ccs_config +++ b/ccs_config @@ -1 +1 @@ -Subproject commit b20a207bc918b956b8dad44c14c4471aff9331ee +Subproject commit d686615faceac30705b199f592808e3558ac176b From fb4306b594e2e08b978f1d53773f8b5b1e9ede42 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Tue, 21 Oct 2025 17:24:52 -0600 Subject: [PATCH 092/129] Add comments as recommended in code review --- .../ctsm/toolchain/gen_mksurfdata_jobscript_multi.py | 4 ++++ tools/mksurfdata_esmf/Makefile | 11 ++++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/python/ctsm/toolchain/gen_mksurfdata_jobscript_multi.py b/python/ctsm/toolchain/gen_mksurfdata_jobscript_multi.py index 1bae37bb29..f0fd65862f 100755 --- a/python/ctsm/toolchain/gen_mksurfdata_jobscript_multi.py +++ b/python/ctsm/toolchain/gen_mksurfdata_jobscript_multi.py @@ -389,6 +389,10 @@ def main(): "--start-year 1850 --end-year 2100 --nosurfdata --ssp-rcp SSP2-4.5 --res", "f45", ), + # NOTE 2025/10/21: When CMIP7 future scenarios become available, + # change 2023 to 2030 for a so-called "midpoint" future scenario. + # This future-proofs these cases, so that as time moves on, these + # simulations will still include the most recent historical year. "crop-global-hist-vrandne120": ( "--start-year 1979 --end-year 2023 --res", "vr_and_ne120", diff --git a/tools/mksurfdata_esmf/Makefile b/tools/mksurfdata_esmf/Makefile index 79b863d7ac..1a6badd0c7 100644 --- a/tools/mksurfdata_esmf/Makefile +++ b/tools/mksurfdata_esmf/Makefile @@ -97,9 +97,9 @@ STANDARD = \ # NOTE slevis 2025/9/10: For CTSM5.4, I removed from CROP: # crop-global-future -# and I added here because it spans 1979-2023: +# Here I added this because it spans 1979-2023. When CMIP7 future scenarios become available, this will span 1979-2030: # crop-global-hist-vrandne120 -# and I split ne3 into ne3-1, ne3-2, ne3-3 for historical because the combined ne3 job took >12 hours in the queue +# Also I split ne3 into ne3-1, ne3-2, ne3-3 for historical because the combined ne3 job took >12 hours in the queue CROP = \ crop-global-hist \ crop-global-hist-low-res \ @@ -336,7 +336,11 @@ crop-global-hist-mpasa480 : FORCE # # Crop with future scenarios -# +# NOTE 2025/10/21: Time periods extending beyond 2023 combine CMIP7 data +# for the historical period and CMIP6 data beyond 2023. +# This introduces a discontinuity in 2024. +# TODO: Add crop-global-future back when the CMIP7 data become available. +# See other corresponding crop-global-future comment elsewhere in this Makefile. crop-global-future : crop-global-SSP1-1.9-f09 \ crop-global-SSP1-2.6-f09 \ @@ -352,6 +356,7 @@ crop-global-SSP2-4.5-low-res : crop-global-SSP2-4.5-f10 \ crop-global-SSP2-4.5-ne3 # NOTE slevis 2025/9/10: For CTSM5.4, I moved to CROP because it spans 1979-2023: # crop-global-hist-vrandne120 +# When CMIP7 future scenario data become available, this will span 1979-2030. crop-global-SSP2-4.5 : crop-global-SSP2-4.5-f09 \ crop-global-SSP2-4.5-f19 \ crop-global-SSP2-4.5-hcru \ From 6c1cc2dc703508d9b173c592f3cb4077b858c3db Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Thu, 23 Oct 2025 15:47:17 -0600 Subject: [PATCH 093/129] CTSM5.4 updates to default_data_[1850,2000].cfg & modify_smallville.sh --- tools/modify_input_files/modify_smallville.sh | 12 ++++++------ tools/site_and_regional/default_data_1850.cfg | 8 ++++---- tools/site_and_regional/default_data_2000.cfg | 14 +++++++------- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/tools/modify_input_files/modify_smallville.sh b/tools/modify_input_files/modify_smallville.sh index 4dc7c58e9b..f4694e95c2 100755 --- a/tools/modify_input_files/modify_smallville.sh +++ b/tools/modify_input_files/modify_smallville.sh @@ -7,14 +7,14 @@ module load nco # This script runs from the mksurfdata_esmf/Makefile. # When running standalone, it may need "subset_data_single_point/" in front # of each landuse.timeseries file name. - file_to_2100="landuse.timeseries_1x1_smallvilleIA_SSP2-4.5_1850-2100_78pfts_c$(date +%y%m%d).nc" - file_to_1855="landuse.timeseries_1x1_smallvilleIA_SSP2-4.5_1850-1855_78pfts_c$(date +%y%m%d).nc" - file_lake="landuse.timeseries_1x1_smallvilleIA_SSP2-4.5_1850-1855_78pfts_dynLakes_c$(date +%y%m%d).nc" - file_urban="landuse.timeseries_1x1_smallvilleIA_SSP2-4.5_1850-1855_78pfts_dynUrban_c$(date +%y%m%d).nc" - file_pft="landuse.timeseries_1x1_smallvilleIA_SSP2-4.5_1850-1855_78pfts_dynPft_c$(date +%y%m%d).nc" + file_whole="landuse.timeseries_1x1_smallvilleIA_hist_1850-2023_78pfts_c$(date +%y%m%d).nc" + file_to_1855="landuse.timeseries_1x1_smallvilleIA_synth_hist_1850-1855_78pfts_c$(date +%y%m%d).nc" + file_lake="landuse.timeseries_1x1_smallvilleIA_synth_hist_1850-1855_78pfts_dynLakes_c$(date +%y%m%d).nc" + file_urban="landuse.timeseries_1x1_smallvilleIA_synth_hist_1850-1855_78pfts_dynUrban_c$(date +%y%m%d).nc" + file_pft="landuse.timeseries_1x1_smallvilleIA_synth_hist_1850-1855_78pfts_dynPft_c$(date +%y%m%d).nc" # Trim the file to just the years 1850-1855 -ncks -d time,0,5 $file_to_2100 $file_to_1855 +ncks -d time,0,5 $file_whole $file_to_1855 # Replace all values in the LAKE and CROP variables ncap2 -s "PCT_LAKE=array(0.,0.,PCT_CROP); PCT_LAKE={0.,50.,25.,25.,25.,25.} ; PCT_LAKE_MAX=array(50.,50.,PCT_CROP_MAX); PCT_CROP=array(0.,0.,PCT_LAKE); PCT_CROP={0.,25.,12.,12.,12.,12.}; PCT_CROP_MAX=array(25.,25.,PCT_LAKE_MAX)" $file_to_1855 $file_lake diff --git a/tools/site_and_regional/default_data_1850.cfg b/tools/site_and_regional/default_data_1850.cfg index ce68b1debf..a86176acd8 100644 --- a/tools/site_and_regional/default_data_1850.cfg +++ b/tools/site_and_regional/default_data_1850.cfg @@ -15,12 +15,12 @@ precname = CLMCRUJRA2024.Precip tpqwname = CLMCRUJRA2024.TPQW [surfdat] -dir = lnd/clm2/surfdata_esmf/ctsm5.3.0 -surfdat_78pft = surfdata_0.9x1.25_hist_1850_78pfts_c240908.nc +dir = lnd/clm2/surfdata_esmf/ctsm5.4.0 +surfdat_78pft = surfdata_0.9x1.25_hist_1850_78pfts_c251022.nc [landuse] -dir = lnd/clm2/surfdata_esmf/ctsm5.3.0 -landuse_78pft = landuse.timeseries_0.9x1.25_SSP2-4.5_1850-2100_78pfts_c240908.nc +dir = lnd/clm2/surfdata_esmf/ctsm5.4.0 +landuse_78pft = landuse.timeseries_0.9x1.25_hist_1850-2023_78pfts_c251022.nc [domain] file = share/domains/domain.lnd.fv0.9x1.25_gx1v7.151020.nc diff --git a/tools/site_and_regional/default_data_2000.cfg b/tools/site_and_regional/default_data_2000.cfg index 60c012561c..e43af3f7e3 100644 --- a/tools/site_and_regional/default_data_2000.cfg +++ b/tools/site_and_regional/default_data_2000.cfg @@ -1,5 +1,5 @@ [main] -clmforcingindir = /glade/campaign/cesm/cesmdata/cseg/inputdata +clmforcingindir = /glade/campaign/cesm/cesmdata/inputdata [datm] dir = atm/datm7/atm_forcing.datm7.CRUJRA.0.5d.c20241231/three_stream @@ -15,16 +15,16 @@ precname = CLMCRUJRA2024.Precip tpqwname = CLMCRUJRA2024.TPQW [surfdat] -dir = lnd/clm2/surfdata_esmf/ctsm5.3.0 -surfdat_16pft = surfdata_0.9x1.25_hist_2000_16pfts_c240908.nc -surfdat_78pft = surfdata_0.9x1.25_hist_2000_78pfts_c240908.nc +dir = lnd/clm2/surfdata_esmf/ctsm5.4.0 +surfdat_16pft = surfdata_0.9x1.25_hist_2000_16pfts_c251022.nc +surfdat_78pft = surfdata_0.9x1.25_hist_2000_78pfts_c251022.nc mesh_dir = share/meshes/ mesh_surf = fv0.9x1.25_141008_ESMFmesh.nc [landuse] -dir = lnd/clm2/surfdata_esmf/ctsm5.3.0 -landuse_16pft = landuse.timeseries_0.9x1.25_SSP2-4.5_1850-2100_78pfts_c240908.nc -landuse_78pft = landuse.timeseries_0.9x1.25_SSP2-4.5_1850-2100_78pfts_c240908.nc +dir = lnd/clm2/surfdata_esmf/ctsm5.4.0 +landuse_16pft = landuse.timeseries_0.9x1.25_hist_1850-2023_78pfts_c251022.nc +landuse_78pft = landuse.timeseries_0.9x1.25_hist_1850-2023_78pfts_c251022.nc [domain] file = share/domains/domain.lnd.fv0.9x1.25_gx1v7.151020.nc From 05baeec9f35a42035c44d8ad755831b7f1e46cce Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Tue, 28 Oct 2025 15:41:02 -0600 Subject: [PATCH 094/129] Prevent IHist ne0np4 from ending up with SSP designation This was causing a ctsm_sci test to fail. IHist ne0np4 cases now stop in 2023 instead of continuing into SSP yrs since we do not have CMIP7 SSP data. --- cime_config/config_component.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/cime_config/config_component.xml b/cime_config/config_component.xml index 13140ad083..e991288cc5 100644 --- a/cime_config/config_component.xml +++ b/cime_config/config_component.xml @@ -238,7 +238,6 @@ Caveats: 1850-2100_SSP3-7.0_transient 1850-2100_SSP5-3.4_transient 1850-2100_SSP2-4.5_transient - 1850-2100_SSP2-4.5_transient 1850-2100_SSP1-1.9_transient 1850-2100_SSP4-3.4_transient 1850-2100_SSP4-6.0_transient From a94b45f5e311e2f4a91772e6591d00ca0e78eca0 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Tue, 28 Oct 2025 15:47:04 -0600 Subject: [PATCH 095/129] Update fsurdat/landuse paths in namelist_defaults (WIP) --- bld/namelist_files/namelist_defaults_ctsm.xml | 170 +++++++++--------- 1 file changed, 87 insertions(+), 83 deletions(-) diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index f6588d3ffe..20d6c5aac1 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -1715,166 +1715,168 @@ attributes from the config_cache.xml file (with keys converted to upper-case). -lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_0.9x1.25_hist_2000_16pfts_c240908.nc +lnd/clm2/surfdata_esmf/ctsm5.4.0/surfdata_0.9x1.25_hist_2000_16pfts_c251022.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_1.9x2.5_hist_2000_16pfts_c240908.nc +lnd/clm2/surfdata_esmf/ctsm5.4.0/surfdata_1.9x2.5_hist_2000_16pfts_c251022.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_10x15_hist_2000_16pfts_c240908.nc +lnd/clm2/surfdata_esmf/ctsm5.4.0/surfdata_10x15_hist_2000_16pfts_c251022.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_4x5_hist_2000_16pfts_c240908.nc +lnd/clm2/surfdata_esmf/ctsm5.4.0/surfdata_4x5_hist_2000_16pfts_c251022.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_mpasa60_hist_2000_16pfts_c240908.nc +lnd/clm2/surfdata_esmf/ctsm5.4.0/surfdata_mpasa60_hist_2000_16pfts_c251022.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_mpasa15_hist_2000_16pfts_c240908.nc +lnd/clm2/surfdata_esmf/ctsm5.4.0/surfdata_mpasa15_hist_2000_16pfts_c251022.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_mpasa3p75_hist_2000_16pfts_c240908.nc +lnd/clm2/surfdata_esmf/ctsm5.4.0/surfdata_mpasa3p75_hist_2000_16pfts_c251022.nc -lnd/clm2/surfdata_esmf/ctsm5.4.0/surfdata_0.9x1.25_hist_2000_78pfts_c250916.nc +lnd/clm2/surfdata_esmf/ctsm5.4.0/surfdata_0.9x1.25_hist_2000_78pfts_c251022.nc lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_0.9x1.25_hist_2000_78pfts_c240908.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_1.9x2.5_hist_2000_78pfts_c240908.nc +lnd/clm2/surfdata_esmf/ctsm5.4.0/surfdata_1.9x2.5_hist_2000_78pfts_c251022.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_10x15_hist_2000_78pfts_c240908.nc +lnd/clm2/surfdata_esmf/ctsm5.4.0/surfdata_10x15_hist_2000_78pfts_c251022.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_4x5_hist_2000_78pfts_c240908.nc +lnd/clm2/surfdata_esmf/ctsm5.4.0/surfdata_4x5_hist_2000_78pfts_c251022.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_1x1_brazil_hist_2000_78pfts_c240912.nc +lnd/clm2/surfdata_esmf/ctsm5.4.0/surfdata_1x1_brazil_hist_2000_78pfts_c251023.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_5x5_amazon_hist_2000_78pfts_c240908.nc +lnd/clm2/surfdata_esmf/ctsm5.4.0/surfdata_5x5_amazon_hist_2000_78pfts_c251022.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_ne30np4_hist_2000_78pfts_c240908.nc +lnd/clm2/surfdata_esmf/ctsm5.4.0/surfdata_ne30np4_hist_2000_78pfts_c251022.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_ne30np4.pg2_hist_2000_78pfts_c240908.nc +lnd/clm2/surfdata_esmf/ctsm5.4.0/surfdata_ne30np4.pg2_hist_2000_78pfts_c251022.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_ne30np4.pg3_hist_2000_78pfts_c240908.nc +lnd/clm2/surfdata_esmf/ctsm5.4.0/surfdata_ne30np4.pg3_hist_2000_78pfts_c251022.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_ne16np4.pg3_hist_2000_78pfts_c240908.nc +lnd/clm2/surfdata_esmf/ctsm5.4.0/surfdata_ne16np4.pg3_hist_2000_78pfts_c251022.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_0.125nldas2_hist_2000_78pfts_c240908.nc +lnd/clm2/surfdata_esmf/ctsm5.4.0/surfdata_0.125nldas2_hist_2000_78pfts_c251022.nc - -lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_T42_hist_2000_78pfts_c240908.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_360x720cru_hist_2000_78pfts_c240908.nc +lnd/clm2/surfdata_esmf/ctsm5.4.0/surfdata_360x720cru_hist_2000_78pfts_c251022.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_C96_hist_2000_78pfts_c240908.nc +lnd/clm2/surfdata_esmf/ctsm5.4.0/surfdata_C96_hist_2000_78pfts_c251022.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_1x1_numaIA_hist_2000_78pfts_c240912.nc +lnd/clm2/surfdata_esmf/ctsm5.4.0/surfdata_1x1_numaIA_hist_2000_78pfts_c251023.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_mpasa480_hist_2000_78pfts_c240908.nc +lnd/clm2/surfdata_esmf/ctsm5.4.0/surfdata_mpasa480_hist_2000_78pfts_c251022.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_mpasa120_hist_2000_78pfts_c240908.nc +lnd/clm2/surfdata_esmf/ctsm5.4.0/surfdata_mpasa120_hist_2000_78pfts_c251022.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_ne3np4_hist_2000_78pfts_c240925.nc +lnd/clm2/surfdata_esmf/ctsm5.4.0/surfdata_ne3np4_hist_2000_78pfts_c251022.nc + +lnd/clm2/surfdata_esmf/ctsm5.4.0/surfdata_ne3np4.pg2_hist_2000_78pfts_c251022.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_ne3np4.pg3_hist_2000_78pfts_c240908.nc +lnd/clm2/surfdata_esmf/ctsm5.4.0/surfdata_ne3np4.pg3_hist_2000_78pfts_c251022.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_ne120np4.pg3_hist_2000_78pfts_c240908.nc +lnd/clm2/surfdata_esmf/ctsm5.4.0/surfdata_ne120np4.pg3_hist_2000_78pfts_c251022.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_ne0np4.ARCTICGRIS.ne30x8_hist_2000_78pfts_c240908.nc +lnd/clm2/surfdata_esmf/ctsm5.4.0/surfdata_ne0np4.ARCTICGRIS.ne30x8_hist_2000_78pfts_c251022.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_ne0np4.ARCTIC.ne30x4_hist_2000_78pfts_c240908.nc +lnd/clm2/surfdata_esmf/ctsm5.4.0/surfdata_ne0np4.ARCTIC.ne30x4_hist_2000_78pfts_c251022.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_ne0np4.POLARCAP.ne30x4_hist_2000_78pfts_c240908.nc +lnd/clm2/surfdata_esmf/ctsm5.4.0/surfdata_ne0np4.POLARCAP.ne30x4_hist_2000_78pfts_c251022.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_ne0np4CONUS.ne30x8_hist_2000_78pfts_c240908.nc +lnd/clm2/surfdata_esmf/ctsm5.4.0/surfdata_ne0np4CONUS.ne30x8_hist_2000_78pfts_c251022.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_1x1_vancouverCAN_hist_2000_78pfts_c240912.nc +lnd/clm2/surfdata_esmf/ctsm5.4.0/surfdata_1x1_vancouverCAN_hist_2000_78pfts_c251023.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_1x1_mexicocityMEX_hist_2000_78pfts_c240912.nc +lnd/clm2/surfdata_esmf/ctsm5.4.0/surfdata_1x1_mexicocityMEX_hist_2000_78pfts_c251023.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/synthetic/surfdata_1x1_urbanc_alpha_synth_hist_2000_78pfts_c240912.nc +lnd/clm2/surfdata_esmf/ctsm5.4.0/synthetic/surfdata_1x1_urbanc_alpha_synth_hist_2000_78pfts_c251023.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_1.9x2.5_hist_1850_16pfts_c240926.nc +lnd/clm2/surfdata_esmf/ctsm5.4.0/surfdata_1.9x2.5_hist_1850_16pfts_c251022.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_4x5_hist_1850_16pfts_c241007.nc +lnd/clm2/surfdata_esmf/ctsm5.4.0/surfdata_4x5_hist_1850_16pfts_c251022.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_360x720cru_hist_1850_78pfts_c240908.nc +lnd/clm2/surfdata_esmf/ctsm5.4.0/surfdata_360x720cru_hist_1850_78pfts_c251022.nc -lnd/clm2/surfdata_esmf/ctsm5.4.0/surfdata_0.9x1.25_hist_1850_78pfts_c250723.nc +lnd/clm2/surfdata_esmf/ctsm5.4.0/surfdata_0.9x1.25_hist_1850_78pfts_c251022.nc lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_0.9x1.25_hist_1850_78pfts_c240908.nc -lnd/clm2/surfdata_esmf/ctsm5.4.0/surfdata_1.9x2.5_hist_1850_78pfts_c250723.nc +lnd/clm2/surfdata_esmf/ctsm5.4.0/surfdata_1.9x2.5_hist_1850_78pfts_c251022.nc lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_1.9x2.5_hist_1850_78pfts_c240908.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_10x15_hist_1850_78pfts_c240908.nc +lnd/clm2/surfdata_esmf/ctsm5.4.0/surfdata_10x15_hist_1850_78pfts_c251022.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_4x5_hist_1850_78pfts_c240908.nc +lnd/clm2/surfdata_esmf/ctsm5.4.0/surfdata_4x5_hist_1850_78pfts_c251022.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_mpasa480_hist_1850_78pfts_c240908.nc +lnd/clm2/surfdata_esmf/ctsm5.4.0/surfdata_mpasa480_hist_1850_78pfts_c251022.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_mpasa120_hist_1850_78pfts_c240908.nc +lnd/clm2/surfdata_esmf/ctsm5.4.0/surfdata_mpasa120_hist_1850_78pfts_c251022.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_ne30np4_hist_1850_78pfts_c240908.nc +lnd/clm2/surfdata_esmf/ctsm5.4.0/surfdata_ne30np4_hist_1850_78pfts_c251022.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_ne30np4.pg2_hist_1850_78pfts_c240908.nc +lnd/clm2/surfdata_esmf/ctsm5.4.0/surfdata_ne30np4.pg2_hist_1850_78pfts_c251022.nc -lnd/clm2/surfdata_esmf/ctsm5.4.0/surfdata_ne30np4.pg3_hist_1850_78pfts_c250723.nc +lnd/clm2/surfdata_esmf/ctsm5.4.0/surfdata_ne30np4.pg3_hist_1850_78pfts_c251022.nc lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_ne30np4.pg3_hist_1850_78pfts_c240908.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_ne3np4.pg3_hist_1850_78pfts_c240908.nc +lnd/clm2/surfdata_esmf/ctsm5.4.0/surfdata_ne3np4.pg3_hist_1850_78pfts_c251022.nc + +lnd/clm2/surfdata_esmf/ctsm5.4.0/surfdata_ne3np4.pg2_hist_1850_78pfts_c251022.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_ne3np4_hist_1850_78pfts_c240925.nc +lnd/clm2/surfdata_esmf/ctsm5.4.0/surfdata_ne3np4_hist_1850_78pfts_c251022.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_C96_hist_1850_78pfts_c240908.nc +lnd/clm2/surfdata_esmf/ctsm5.4.0/surfdata_C96_hist_1850_78pfts_c251022.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/synthetic/surfdata_1x1_smallvilleIA_synth_hist_1850_78pfts_c240912.nc +lnd/clm2/surfdata_esmf/ctsm5.4.0/synthetic/surfdata_1x1_smallvilleIA_synth_hist_1850_78pfts_c251023.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/synthetic/surfdata_1x1_cidadinhoBR_synth_hist_2000_78pfts_c240912.nc +lnd/clm2/surfdata_esmf/ctsm5.4.0/synthetic/surfdata_1x1_cidadinhoBR_synth_hist_2000_78pfts_c251023.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_1x1_brazil_hist_1850_78pfts_c240912.nc +lnd/clm2/surfdata_esmf/ctsm5.4.0/surfdata_1x1_brazil_hist_1850_78pfts_c251023.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_ne16np4.pg3_hist_1850_78pfts_c240908.nc +lnd/clm2/surfdata_esmf/ctsm5.4.0/surfdata_ne16np4.pg3_hist_1850_78pfts_c251022.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_ne120np4.pg3_hist_1850_78pfts_c240908.nc +lnd/clm2/surfdata_esmf/ctsm5.4.0/surfdata_ne120np4.pg3_hist_1850_78pfts_c251022.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_ne0np4.ARCTICGRIS.ne30x8_hist_1979_78pfts_c240908.nc +lnd/clm2/surfdata_esmf/ctsm5.4.0/surfdata_ne0np4.ARCTICGRIS.ne30x8_hist_1979_78pfts_c251022.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_ne0np4.ARCTIC.ne30x4_hist_1979_78pfts_c240908.nc +lnd/clm2/surfdata_esmf/ctsm5.4.0/surfdata_ne0np4.ARCTIC.ne30x4_hist_1979_78pfts_c251022.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_ne0np4.POLARCAP.ne30x4_hist_1979_78pfts_c240908.nc +lnd/clm2/surfdata_esmf/ctsm5.4.0/surfdata_ne0np4.POLARCAP.ne30x4_hist_1979_78pfts_c251022.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_ne0np4CONUS.ne30x8_hist_1979_78pfts_c240908.nc +lnd/clm2/surfdata_esmf/ctsm5.4.0/surfdata_ne0np4CONUS.ne30x8_hist_1979_78pfts_c251022.nc lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_0.9x1.25_PtVeg_nourb_1850_16pfts_c240908.nc +>lnd/clm2/surfdata_esmf/ctsm5.4.0/surfdata_0.9x1.25_PtVeg_nourb_1850_16pfts_c251022.nc -lnd/clm2/surfdata_esmf/NEON/ctsm5.3.0/16PFT_mixed/surfdata_1x1_NEON_${NEONSITE}_hist_2000_16pfts_c240912.nc +lnd/clm2/surfdata_esmf/NEON/ctsm5.4.0/16PFT_mixed/surfdata_1x1_NEON_${NEONSITE}_hist_2000_16pfts_c251023.nc -lnd/clm2/surfdata_esmf/NEON/ctsm5.3.0/surfdata_1x1_NEON_${NEONSITE}_hist_2000_78pfts_c240912.nc +lnd/clm2/surfdata_esmf/NEON/ctsm5.4.0/surfdata_1x1_NEON_${NEONSITE}_hist_2000_78pfts_c251023.nc @@ -1882,66 +1884,68 @@ lnd/clm2/surfdata_esmf/NEON/ctsm5.3.0/surfdata_1x1_NEON_TOOL_hist_2000_78pfts_c2 lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_1.9x2.5_hist_1850-2023_16pfts_c240926.nc + >lnd/clm2/surfdata_esmf/ctsm5.4.0/landuse.timeseries_1.9x2.5_hist_1850-2023_16pfts_c251022.nc lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_4x5_hist_1850-2023_16pfts_c241007.nc + >lnd/clm2/surfdata_esmf/ctsm5.4.0/landuse.timeseries_4x5_hist_1850-2023_16pfts_c251022.nc lnd/clm2/surfdata_esmf/ctsm5.4.0/landuse.timeseries_0.9x1.25_hist_1850-2023_78pfts_c250723.nc + >lnd/clm2/surfdata_esmf/ctsm5.4.0/landuse.timeseries_0.9x1.25_hist_1850-2023_78pfts_c251022.nc lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_0.9x1.25_SSP2-4.5_1850-2100_78pfts_c240908.nc lnd/clm2/surfdata_esmf/ctsm5.4.0/landuse.timeseries_1.9x2.5_hist_1850-2023_78pfts_c250723.nc + >lnd/clm2/surfdata_esmf/ctsm5.4.0/landuse.timeseries_1.9x2.5_hist_1850-2023_78pfts_c251022.nc lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_1.9x2.5_SSP2-4.5_1850-2100_78pfts_c240908.nc lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_ne0np4.ARCTICGRIS.ne30x8_SSP2-4.5_1979-2026_78pfts_c240908.nc +>lnd/clm2/surfdata_esmf/ctsm5.4.0/landuse.timeseries_ne0np4.ARCTICGRIS.ne30x8_hist_1979-2023_78pfts_c251022.nc lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_ne0np4.ARCTIC.ne30x4_SSP2-4.5_1979-2026_78pfts_c240908.nc +>lnd/clm2/surfdata_esmf/ctsm5.4.0/landuse.timeseries_ne0np4.ARCTIC.ne30x4_hist_1979-2023_78pfts_c251022.nc lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_ne0np4.POLARCAP.ne30x4_SSP2-4.5_1979-2026_78pfts_c240908.nc +>lnd/clm2/surfdata_esmf/ctsm5.4.0/landuse.timeseries_ne0np4.POLARCAP.ne30x4_hist_1979-2023_78pfts_c251022.nc lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_ne0np4CONUS.ne30x8_SSP2-4.5_1979-2026_78pfts_c240908.nc +>lnd/clm2/surfdata_esmf/ctsm5.4.0/landuse.timeseries_ne0np4CONUS.ne30x8_hist_1979-2023_78pfts_c251022.nc lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_4x5_SSP2-4.5_1850-2100_78pfts_c240908.nc + >lnd/clm2/surfdata_esmf/ctsm5.4.0/landuse.timeseries_4x5_hist_1850-2023_78pfts_c251022.nc lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_10x15_SSP2-4.5_1850-2100_78pfts_c240908.nc + >lnd/clm2/surfdata_esmf/ctsm5.4.0/landuse.timeseries_10x15_hist_1850-2023_78pfts_c251022.nc lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_360x720cru_SSP2-4.5_1850-2100_78pfts_c240908.nc +>lnd/clm2/surfdata_esmf/ctsm5.4.0/landuse.timeseries_360x720cru_hist_1850-2023_78pfts_c251022.nc lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_1x1_brazil_SSP2-4.5_1850-2100_78pfts_c240912.nc +>lnd/clm2/surfdata_esmf/ctsm5.4.0/landuse.timeseries_1x1_brazil_hist_1850-2023_78pfts_c251023.nc lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_mpasa120_SSP2-4.5_1850-2100_78pfts_c240908.nc +>lnd/clm2/surfdata_esmf/ctsm5.4.0/landuse.timeseries_mpasa120_hist_1850-2023_78pfts_c251022.nc lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_ne3np4_SSP2-4.5_1850-2100_78pfts_c240926.nc +>lnd/clm2/surfdata_esmf/ctsm5.4.0/landuse.timeseries_ne3np4_hist_1850-2023_78pfts_c251022.nc +lnd/clm2/surfdata_esmf/ctsm5.4.0/landuse.timeseries_ne3np4.pg2_hist_1850-2023_78pfts_c251022.nc lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_ne3np4.pg3_SSP2-4.5_1850-2100_78pfts_c240908.nc +>lnd/clm2/surfdata_esmf/ctsm5.4.0/landuse.timeseries_ne3np4.pg3_hist_1850-2023_78pfts_c251022.nc lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_ne16np4.pg3_SSP2-4.5_1850-2100_78pfts_c240908.nc +>lnd/clm2/surfdata_esmf/ctsm5.4.0/landuse.timeseries_ne16np4.pg3_hist_1850-2023_78pfts_c251022.nc lnd/clm2/surfdata_esmf/ctsm5.4.0/landuse.timeseries_ne30np4.pg3_hist_1850-2023_78pfts_c250723.nc +>lnd/clm2/surfdata_esmf/ctsm5.4.0/landuse.timeseries_ne30np4.pg3_hist_1850-2023_78pfts_c251022.nc lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_ne30np4.pg3_SSP2-4.5_1850-2100_78pfts_c240908.nc lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_C96_SSP2-4.5_1850-2100_78pfts_c240908.nc +>lnd/clm2/surfdata_esmf/ctsm5.4.0/landuse.timeseries_C96_hist_1850-2023_78pfts_c251022.nc lnd/clm2/surfdata_esmf/ctsm5.3.0/synthetic/landuse.timeseries_1x1_smallvilleIA_synth_1850-1855_78pfts_c240908.nc +>lnd/clm2/surfdata_esmf/ctsm5.4.0/synthetic/landuse.timeseries_1x1_smallvilleIA_synth_1850-1855_78pfts_c251023.nc From 8325e76255b3dc9969379da25282503afe4af449 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Wed, 29 Oct 2025 09:44:44 -0600 Subject: [PATCH 096/129] Add/remove fsurdat/landuse paths according to the grids spreadsheet https://docs.google.com/spreadsheets/d/1Osq56e423CF107zhoNQ0VS7-iH_JXLF9AtCvBdXyfJ4/edit?usp=sharing --- bld/namelist_files/namelist_defaults_ctsm.xml | 45 +++++++++++++++---- 1 file changed, 36 insertions(+), 9 deletions(-) diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index 35c97a5e06..49528abb14 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -1734,8 +1734,12 @@ lnd/clm2/surfdata_esmf/ctsm5.4.0/surfdata_1.9x2.5_hist_2000_16pfts_c251022.nc lnd/clm2/surfdata_esmf/ctsm5.4.0/surfdata_4x5_hist_2000_16pfts_c251022.nc + +lnd/clm2/surfdata_esmf/ctsm5.4.0/surfdata_ne30np4.pg3_hist_2000_16pfts_c251022.nc lnd/clm2/surfdata_esmf/ctsm5.4.0/surfdata_mpasa60_hist_2000_16pfts_c251022.nc + +lnd/clm2/surfdata_esmf/ctsm5.4.0/surfdata_mpasa30_hist_2000_16pfts_c251022.nc lnd/clm2/surfdata_esmf/ctsm5.4.0/surfdata_mpasa15_hist_2000_16pfts_c251022.nc @@ -1797,6 +1801,8 @@ lnd/clm2/surfdata_esmf/ctsm5.4.0/surfdata_ne120np4.pg3_hist_2000_78pfts_c251022. lnd/clm2/surfdata_esmf/ctsm5.4.0/surfdata_ne0np4.ARCTICGRIS.ne30x8_hist_2000_78pfts_c251022.nc lnd/clm2/surfdata_esmf/ctsm5.4.0/surfdata_ne0np4.ARCTIC.ne30x4_hist_2000_78pfts_c251022.nc + +lnd/clm2/surfdata_esmf/ctsm5.4.0/surfdata_ne0np4.NATL.ne30x8_hist_2000_78pfts_c251022.nc lnd/clm2/surfdata_esmf/ctsm5.4.0/surfdata_ne0np4.POLARCAP.ne30x4_hist_2000_78pfts_c251022.nc @@ -1817,6 +1823,12 @@ lnd/clm2/surfdata_esmf/ctsm5.4.0/synthetic/surfdata_1x1_urbanc_alpha_synth_hist_ lnd/clm2/surfdata_esmf/ctsm5.4.0/surfdata_1.9x2.5_hist_1850_16pfts_c251022.nc lnd/clm2/surfdata_esmf/ctsm5.4.0/surfdata_4x5_hist_1850_16pfts_c251022.nc + +lnd/clm2/surfdata_esmf/ctsm5.4.0/surfdata_1.9x2.5_hist_1850_16pfts_c251022.nc + +lnd/clm2/surfdata_esmf/ctsm5.4.0/surfdata_10x15_hist_1850_16pfts_c251022.nc + +lnd/clm2/surfdata_esmf/ctsm5.4.0/surfdata_ne30np4.pg3_hist_1850_16pfts_c251022.nc @@ -1871,14 +1883,24 @@ lnd/clm2/surfdata_esmf/ctsm5.4.0/surfdata_ne120np4.pg3_hist_1850_78pfts_c251022. lnd/clm2/surfdata_esmf/ctsm5.4.0/surfdata_ne0np4.ARCTICGRIS.ne30x8_hist_1979_78pfts_c251022.nc lnd/clm2/surfdata_esmf/ctsm5.4.0/surfdata_ne0np4.ARCTIC.ne30x4_hist_1979_78pfts_c251022.nc + +lnd/clm2/surfdata_esmf/ctsm5.4.0/surfdata_ne0np4.NATL.ne30x8_hist_1979_78pfts_c251022.nc lnd/clm2/surfdata_esmf/ctsm5.4.0/surfdata_ne0np4.POLARCAP.ne30x4_hist_1979_78pfts_c251022.nc lnd/clm2/surfdata_esmf/ctsm5.4.0/surfdata_ne0np4CONUS.ne30x8_hist_1979_78pfts_c251022.nc + +lnd/clm2/surfdata_esmf/ctsm5.4.0/surfdata_ne120np4.pg3_hist_1979_78pfts_c251022.nc lnd/clm2/surfdata_esmf/ctsm5.4.0/surfdata_0.9x1.25_PtVeg_nourb_1850_16pfts_c251022.nc +lnd/clm2/surfdata_esmf/ctsm5.4.0/surfdata_1.9x2.5_PtVeg_nourb_1850_16pfts_c251022.nc +lnd/clm2/surfdata_esmf/ctsm5.4.0/surfdata_ne16np4.pg3_PtVeg_nourb_1850_16pfts_c251022.nc +lnd/clm2/surfdata_esmf/ctsm5.4.0/surfdata_ne30np4.pg3_PtVeg_nourb_1850_16pfts_c251022.nc @@ -1905,6 +1927,12 @@ lnd/clm2/surfdata_esmf/NEON/ctsm5.4.0/surfdata_1x1_NEON_TOOL_hist_2000_78pfts_c2 >lnd/clm2/surfdata_esmf/ctsm5.4.0/landuse.timeseries_1.9x2.5_hist_1850-2023_16pfts_c251022.nc lnd/clm2/surfdata_esmf/ctsm5.4.0/landuse.timeseries_4x5_hist_1850-2023_16pfts_c251022.nc +lnd/clm2/surfdata_esmf/ctsm5.4.0/landuse.timeseries_1.9x2.5_hist_1850-2023_16pfts_c251022.nc +lnd/clm2/surfdata_esmf/ctsm5.4.0/landuse.timeseries_10x15_hist_1850-2023_16pfts_c251022.nc +lnd/clm2/surfdata_esmf/ctsm5.4.0/landuse.timeseries_ne30np4.pg3_hist_1850-2023_16pfts_c251022.nc lnd/clm2/surfdata_esmf/ctsm5.4.0/landuse.timeseries_ne0np4.ARCTICGRIS.ne30x8_hist_1979-2023_78pfts_c251022.nc lnd/clm2/surfdata_esmf/ctsm5.4.0/landuse.timeseries_ne0np4.ARCTIC.ne30x4_hist_1979-2023_78pfts_c251022.nc +lnd/clm2/surfdata_esmf/ctsm5.4.0/landuse.timeseries_ne0np4.NATL.ne30x8_hist_1979-2023_78pfts_c251022.nc lnd/clm2/surfdata_esmf/ctsm5.4.0/landuse.timeseries_ne0np4.POLARCAP.ne30x4_hist_1979-2023_78pfts_c251022.nc lnd/clm2/surfdata_esmf/ctsm5.4.0/landuse.timeseries_ne0np4CONUS.ne30x8_hist_1979-2023_78pfts_c251022.nc +lnd/clm2/surfdata_esmf/ctsm5.4.0/landuse.timeseries_ne120np4.pg3_hist_1979-2023_78pfts_c251022.nc lnd/clm2/surfdata_esmf/ctsm5.4.0/landuse.timeseries_4x5_hist_1850-2023_78pfts_c251022.nc lnd/clm2/surfdata_esmf/ctsm5.4.0/landuse.timeseries_ne3np4.pg3_hist_1850-2023_78pfts_c251022.nc lnd/clm2/surfdata_esmf/ctsm5.4.0/landuse.timeseries_ne16np4.pg3_hist_1850-2023_78pfts_c251022.nc +lnd/clm2/surfdata_esmf/ctsm5.4.0/landuse.timeseries_ne30np4_hist_1850-2023_78pfts_c251022.nc +lnd/clm2/surfdata_esmf/ctsm5.4.0/landuse.timeseries_ne30np4.pg2_hist_1850-2023_78pfts_c251022.nc lnd/clm2/surfdata_esmf/ctsm5.4.0/landuse.timeseries_ne30np4.pg3_hist_1850-2023_78pfts_c251022.nc lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_C96_SSP2-4.5_1850-2100_78pfts_c240908.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_ne0np4.ARCTICGRIS.ne30x8_SSP2-4.5_1979-2026_78pfts_c240908.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_ne0np4.ARCTIC.ne30x4_SSP2-4.5_1979-2026_78pfts_c240908.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_ne0np4.POLARCAP.ne30x4_SSP2-4.5_1979-2026_78pfts_c240908.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_ne0np4CONUS.ne30x8_SSP2-4.5_1979-2026_78pfts_c240908.nc - lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_0.9x1.25_SSP3-7.0_1850-2100_78pfts_c240908.nc From a41b9c59d0f34f0f679d174864ec51c3e8409109 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Thu, 30 Oct 2025 16:37:49 -0600 Subject: [PATCH 097/129] CTSM5.4 updates to finidata (not all tests pass so troubleshooting) --- bld/namelist_files/namelist_defaults_ctsm.xml | 40 +++++++++---------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index 49528abb14..83da36d03e 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -1353,49 +1353,49 @@ attributes from the config_cache.xml file (with keys converted to upper-case). lnd/clm2/initdata_esmf/ctsm5.4/ctsm5.4_5.3.068_PPEcal115_SP_f09_121_1850.clm2.r.0041-01-01-00000.nc + phys="clm6_0" +>lnd/clm2/initdata_esmf/ctsm5.4/ctsm5.4.CMIP7_ciso_ctsm5.3.075_SP_f09_127_1850.clm2.r.0102-01-01-00000.nc lnd/clm2/initdata_esmf/ctsm5.4/ctsm5.4_5.3.068_PPEcal115_SP_ne30_120_1850.clm2.r.0041-01-01-00000.nc +>lnd/clm2/initdata_esmf/ctsm5.4/ctsm5.4.CMIP7_ciso_ctsm5.3.075_SP_ne30_126_1850.clm2.r.0102-01-01-00000.nc lnd/clm2/initdata_esmf/ctsm5.4/ctsm5.4_5.3.068_PPEcal115_SP_f09_121_HIST.clm2.r.2000-01-01-00000.nc +>lnd/clm2/initdata_esmf/ctsm5.4/ctsm5.4.CMIP7_ciso_ctsm5.3.075_SP_f09_127_HIST.clm2.r.2000-01-01-00000.nc lnd/clm2/initdata_esmf/ctsm5.4/ctsm5.4_5.3.068_PPEcal115_SP_ne30_120_HIST.clm2.r.2000-01-01-00000.nc +>lnd/clm2/initdata_esmf/ctsm5.4/ctsm5.4.CMIP7_ciso_ctsm5.3.075_SP_ne30_126_HIST.clm2.r.2000-01-01-00000.nc lnd/clm2/initdata_esmf/ctsm5.4/ctsm5.4_5.3.068_PPEcal115f09_118_pSASU.clm2.r.0161-01-01-00000.nc + phys="clm6_0" +>lnd/clm2/initdata_esmf/ctsm5.4/ctsm5.4.CMIP7_ciso_ctsm5.3.075_f09_124_pSASU.clm2.r.0161-01-01-00000.nc lnd/clm2/initdata_esmf/ctsm5.4/ctsm5.4_5.3.068_PPEcal115_116_pSASU.clm2.r.0161-01-01-00000.nc + phys="clm6_0" +>lnd/clm2/initdata_esmf/ctsm5.4/ctsm5.4.CMIP7_ciso_ctsm5.3.075_ne30_123_pSASU.clm2.r.0161-01-01-00000.nc lnd/clm2/initdata_esmf/ctsm5.4/ctsm53065_54surfdata_PPEcal115_115_pSASU.clm2.r.0161-01-01-00000.nc +>lnd/clm2/initdata_esmf/ctsm5.4/ctsm5.4.CMIP7_ciso_ctsm5.3.075_f19_125_pSASU.clm2.r.0161-01-01-00000.nc lnd/clm2/initdata_esmf/ctsm5.4/ctsm5.4_5.3.068_PPEcal115f09_118_HIST.clm2.r.2000-01-01-00000.nc + phys="clm6_0" +>lnd/clm2/initdata_esmf/ctsm5.4/ctsm5.4.CMIP7_ciso_ctsm5.3.075_f09_124_HIST.clm2.r.2000-01-01-00000.nc lnd/clm2/initdata_esmf/ctsm5.4/ctsm5.4_5.3.068_PPEcal115_116_HIST.clm2.r.2000-01-01-00000.nc + phys="clm6_0" +>lnd/clm2/initdata_esmf/ctsm5.4/ctsm5.4.CMIP7_ciso_ctsm5.3.075_ne30_123_HIST_popDens.clm2.r.2000-01-01-00000.nc @@ -1539,13 +1539,13 @@ attributes from the config_cache.xml file (with keys converted to upper-case). ic_ymd="20100101" sim_year="2010" use_excess_ice=".true." ic_tod="0" glc_nec="10" use_crop=".true." phys="clm6_0" ->lnd/clm2/initdata_esmf/ctsm5.4/ctsm5.4_5.3.068_PPEcal115f09_118_HIST.clm2.r.2010-01-01-00000.nc +>lnd/clm2/initdata_esmf/ctsm5.4/ctsm5.4.CMIP7_ciso_ctsm5.3.075_f09_124_HIST.clm2.r.2010-01-01-00000.nc lnd/clm2/initdata_esmf/ctsm5.4/ctsm5.4_5.3.068_PPEcal115_116_HIST.clm2.r.2010-01-01-00000.nc +>lnd/clm2/initdata_esmf/ctsm5.4/ctsm5.4.CMIP7_ciso_ctsm5.3.075_ne30_123_HIST_popDens.clm2.r.2010-01-01-00000.nc @@ -1573,14 +1573,14 @@ attributes from the config_cache.xml file (with keys converted to upper-case). ic_ymd="19790101" sim_year="1979" use_excess_ice=".true." ic_tod="0" glc_nec="10" use_crop=".true." phys="clm6_0" ->lnd/clm2/initdata_esmf/ctsm5.4/ctsm5.4_5.3.068_PPEcal115f09_118_HIST.clm2.r.1979-01-01-00000.nc +>lnd/clm2/initdata_esmf/ctsm5.4/ctsm5.4.CMIP7_ciso_ctsm5.3.075_f09_124_HIST.clm2.r.1979-01-01-00000.nc lnd/clm2/initdata_esmf/ctsm5.4/ctsm5.4_5.3.068_PPEcal115_116_HIST.clm2.r.1979-01-01-00000.nc +>lnd/clm2/initdata_esmf/ctsm5.4/ctsm5.4.CMIP7_ciso_ctsm5.3.075_ne30_123_HIST_popDens.clm2.r.1979-01-01-00000.nc From ad7251dcd0ebb1496fae70a7fdfbec148bb39927 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Thu, 30 Oct 2025 17:31:59 -0600 Subject: [PATCH 098/129] hgrid="10x15" needed cmip6/cmip7 distinction for tests to pass --- bld/namelist_files/namelist_defaults_ctsm.xml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index 83da36d03e..10f369be56 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -1841,8 +1841,10 @@ lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_0.9x1.25_hist_1850_78pfts_c240908.nc lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_1.9x2.5_hist_1850_78pfts_c240908.nc - + lnd/clm2/surfdata_esmf/ctsm5.4.0/surfdata_10x15_hist_1850_78pfts_c251022.nc + +lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_10x15_hist_1850_78pfts_c240908.nc lnd/clm2/surfdata_esmf/ctsm5.4.0/surfdata_4x5_hist_1850_78pfts_c251022.nc From 9104e372f457d71528993cf09d26f784865e2363 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Fri, 31 Oct 2025 16:30:56 -0600 Subject: [PATCH 099/129] Add back use_init_interp for failing f09 test, ne30 test This is temporary while fsurdat/landuse and finidat files are not entirely consistent. We plan to make them all consistent for clm6. --- bld/namelist_files/namelist_defaults_ctsm.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index 10f369be56..8d5eb56821 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -1524,13 +1524,13 @@ attributes from the config_cache.xml file (with keys converted to upper-case). lnd/clm2/initdata_esmf/ctsm5.4/ctsm5.4.CMIP7_ciso_ctsm5.3.075_f09_124_HIST.clm2.r.2000-01-01-00000.nc lnd/clm2/initdata_esmf/ctsm5.4/ctsm5.4.CMIP7_ciso_ctsm5.3.075_ne30_123_HIST_popDens.clm2.r.2000-01-01-00000.nc From db6c43ffbedb994a2251d2f10e58ff5c10f41249 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Fri, 31 Oct 2025 16:53:01 -0600 Subject: [PATCH 100/129] Additions in prep for the next PR where we add tests for new grids --- bld/namelist_files/namelist_defaults_ctsm.xml | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index 8d5eb56821..ba8ee5982d 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -785,6 +785,8 @@ attributes from the config_cache.xml file (with keys converted to upper-case). maxpft="17" use_cn=".false." use_crop=".false." hgrid="ne0np4.ARCTIC.ne30x4" >.true. .true. +.true. .true. .true. +.true. .true. .true. @@ -985,6 +989,10 @@ attributes from the config_cache.xml file (with keys converted to upper-case). hgrid="ne3np4.pg3" >hgrid=0.9x1.25 maxpft=79 mask=gx1v7 use_cn=.true. use_crop=.true. irrigate=.true. glc_nec=10 do_transient_pfts=.false. use_excess_ice=.false. +hgrid=0.9x1.25 maxpft=79 mask=gx1v7 use_cn=.true. use_crop=.true. irrigate=.true. glc_nec=10 do_transient_pfts=.false. use_excess_ice=.false. + - + hgrid=ne120np4.pg3 maxpft=79 mask=tx0.1v3 use_cn=.true. use_crop=.true. irrigate=.true. glc_nec=10 do_transient_pfts=.false. use_excess_ice=.false. +hgrid=ne120np4.pg3 maxpft=79 mask=tx0.1v3 use_cn=.true. use_crop=.true. irrigate=.true. glc_nec=10 do_transient_pfts=.false. use_excess_ice=.false. + +hgrid=ne120np4.pg3 maxpft=79 mask=tx0.1v3 use_cn=.true. use_crop=.true. irrigate=.true. glc_nec=10 do_transient_pfts=.false. use_excess_ice=.false. + From a11cede8144b6dc829e799bc5121f29641e96a87 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Thu, 6 Nov 2025 14:17:18 -0700 Subject: [PATCH 101/129] Add ctsm_sci tests for new grids (ctsm5.4) --- bld/namelist_files/namelist_defaults_ctsm.xml | 13 +------ cime_config/testdefs/testlist_clm.xml | 37 +++++++++++++++++++ 2 files changed, 38 insertions(+), 12 deletions(-) diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index ba8ee5982d..6bd5c61579 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -785,8 +785,6 @@ attributes from the config_cache.xml file (with keys converted to upper-case). maxpft="17" use_cn=".false." use_crop=".false." hgrid="ne0np4.ARCTIC.ne30x4" >.true. .true. -.true. .true. .true. -.true. .true. .true. @@ -1050,7 +1046,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). >hgrid=0.9x1.25 maxpft=79 mask=gx1v7 use_cn=.true. use_crop=.true. irrigate=.true. glc_nec=10 do_transient_pfts=.false. use_excess_ice=.false. -hgrid=0.9x1.25 maxpft=79 mask=gx1v7 use_cn=.true. use_crop=.true. irrigate=.true. glc_nec=10 do_transient_pfts=.false. use_excess_ice=.false. @@ -1209,11 +1205,6 @@ attributes from the config_cache.xml file (with keys converted to upper-case). >hgrid=0.9x1.25 maxpft=79 mask=gx1v7 use_cn=.true. use_crop=.true. irrigate=.true. glc_nec=10 do_transient_pfts=.false. use_excess_ice=.false. -hgrid=0.9x1.25 maxpft=79 mask=gx1v7 use_cn=.true. use_crop=.true. irrigate=.true. glc_nec=10 do_transient_pfts=.false. use_excess_ice=.false. - - hgrid=0.9x1.25 maxpft=79 mask=gx1v7 use_cn=.true. use_crop=.true. irrigate=.true. glc_nec=10 do_transient_pfts=.false. use_excess_ice=.false. @@ -1893,8 +1884,6 @@ lnd/clm2/surfdata_esmf/ctsm5.4.0/surfdata_1x1_brazil_hist_1850_78pfts_c251023.nc lnd/clm2/surfdata_esmf/ctsm5.4.0/surfdata_ne16np4.pg3_hist_1850_78pfts_c251022.nc - -lnd/clm2/surfdata_esmf/ctsm5.4.0/surfdata_ne120np4.pg3_hist_1850_78pfts_c251022.nc lnd/clm2/surfdata_esmf/ctsm5.4.0/surfdata_ne0np4.ARCTICGRIS.ne30x8_hist_1979_78pfts_c251022.nc diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index 4e9a8c222e..16e451ec33 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -411,6 +411,15 @@ + + + + + + + + + @@ -931,6 +940,15 @@ + + + + + + + + + @@ -1102,6 +1120,15 @@ + + + + + + + + + @@ -2513,6 +2540,16 @@ + + + + + + + + + + From 6d702a2549d892e29553691fe523e04122f6b5b0 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Fri, 7 Nov 2025 10:54:29 -0700 Subject: [PATCH 102/129] namelist_defaults updates for ne120pg3 to pick up correct finidat --- bld/namelist_files/namelist_defaults_ctsm.xml | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index 6bd5c61579..c38427cf60 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -785,6 +785,8 @@ attributes from the config_cache.xml file (with keys converted to upper-case). maxpft="17" use_cn=".false." use_crop=".false." hgrid="ne0np4.ARCTIC.ne30x4" >.true. .true. +.true. hgrid=ne120np4.pg3 maxpft=79 mask=tx0.1v3 use_cn=.true. use_crop=.true. irrigate=.true. glc_nec=10 do_transient_pfts=.false. use_excess_ice=.false. -hgrid=ne120np4.pg3 maxpft=79 mask=tx0.1v3 use_cn=.true. use_crop=.true. irrigate=.true. glc_nec=10 do_transient_pfts=.false. use_excess_ice=.false. +hgrid=ne120np4.pg3 maxpft=17 mask=tx0.1v3 use_cn=.false. use_crop=.false. irrigate=.true. glc_nec=10 do_transient_pfts=.false. use_excess_ice=.false. @@ -1506,7 +1508,13 @@ attributes from the config_cache.xml file (with keys converted to upper-case). >lnd/clm2/initdata_map/clmi.FHISTSp.1979-01-01.ARCTICGRIS_ne30x8_mt12_simyr1979_c200806.nc - + +lnd/clm2/initdata_map/clmi.F2000.2000-01-01.ne120pg3_mt13_simyr2000_c200728.nc + Date: Mon, 10 Nov 2025 13:15:51 -0700 Subject: [PATCH 103/129] Add IHist test for the new ne3pg2 grid --- cime_config/testdefs/testlist_clm.xml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index 16e451ec33..913580c77b 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -949,6 +949,15 @@ + + + + + + + + + From 69453b7556383116be491f47f74c2196940424de Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Fri, 14 Nov 2025 12:31:33 -0700 Subject: [PATCH 104/129] finidat update from code review, plus a typo correction So far no change in test-suite results (aux_clm and ctsm_sci). --- bld/namelist_files/namelist_defaults_ctsm.xml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index c38427cf60..46f3c3eeaf 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -1220,8 +1220,8 @@ attributes from the config_cache.xml file (with keys converted to upper-case). hgrid=ne120np4.pg3 maxpft=79 mask=tx0.1v3 use_cn=.true. use_crop=.true. irrigate=.true. glc_nec=10 do_transient_pfts=.false. use_excess_ice=.false. -hgrid=ne120np4.pg3 maxpft=17 mask=tx0.1v3 use_cn=.false. use_crop=.false. irrigate=.true. glc_nec=10 do_transient_pfts=.false. use_excess_ice=.false. +hgrid=ne120np4.pg3 maxpft=79 mask=tx0.1v3 use_cn=.true. use_crop=.true. irrigate=.true. glc_nec=10 do_transient_pfts=.false. use_excess_ice=.false. @@ -1508,15 +1508,15 @@ attributes from the config_cache.xml file (with keys converted to upper-case). >lnd/clm2/initdata_map/clmi.FHISTSp.1979-01-01.ARCTICGRIS_ne30x8_mt12_simyr1979_c200806.nc - - +lnd/clm2/initdata_map/clmi.F2000.2000-01-01.ne120pg3_mt13_simyr2000_c200728.nc lnd/clm2/initdata_map/clmi.F2000.2000-01-01.ne120pg3_mt13_simyr2000_c200728.nc From aae49a096ec581b210bb367beb724df149978fd1 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Fri, 14 Nov 2025 16:24:03 -0700 Subject: [PATCH 105/129] fsurdat validation tool --- .../mksurfdata_esmf/validate_fsurdat_files.sh | 98 +++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100755 tools/mksurfdata_esmf/validate_fsurdat_files.sh diff --git a/tools/mksurfdata_esmf/validate_fsurdat_files.sh b/tools/mksurfdata_esmf/validate_fsurdat_files.sh new file mode 100755 index 0000000000..b1e68ad233 --- /dev/null +++ b/tools/mksurfdata_esmf/validate_fsurdat_files.sh @@ -0,0 +1,98 @@ +#!/bin/bash + +# Validation/verification of new fsurdat files +# -------------------------------------------- +# WRITTEN by slevis after discussions with ekluzek. +# DATE of original script 2025/11/11. +# +# LOCATION: I first used this script in the directory +# .../inputdata/lnd/clm2/surfdata_esmf/ctsm5.4.0/validation +# +# CAVEAT: For new CTSM versions, use this script as a template with the +# understanding that aspects of the code will need to change. +# +# PURPOSE and DETAILS +# ------------------- +# This script +# 1) uses cprnc to compare ctsm5.4 versus ctsm5.3 files by generating +# cprnc.out files. +# 2) greps for fields with differences (RMS or NORMALIZED) that are >=1. +# The strictest grep threshold that I found isolates potentially +# unexpected changes is E-03. I determined this empirically using two +# types of problematic fsurdat files from the recent past: +# - No LAI, SAI, and heights for pfts 15 and 16. +# - No soil textures in parts of the world in unstructured grids. +# These "unexpected" fields appear alongside expected diffs (discussed +# below) when grepping for E+. Grepping for less than E-03 starts to +# capture fields with smaller differences and is likely to miss +# unexpected problematic fields. +# +# Step after running the script +# ----------------------------- +# Interactively and iteratively build this grep command to confirm that +# all fields in the script's grep output are expected. This list of +# fields is ctsm5.4-specific: +# >>> grep NORM grep_E+_surfdata_cprnc.out | grep -v ROOF | grep -v WALL | grep -v URBAN | grep -v BUILDING | grep -v abm | grep -v CANYON | grep -v CONST_HARVEST | grep -v ROAD | grep -v UNREPRESENTED_PFT | grep -v PCT_NATVEG +# +# If the grep command reveals unexpected fields, investigate. +# +# ----------------------------- +# +# Separate subjective comparison +# ------------------------------ +# >>> ncdiff surfdata_new.nc surfdata_old.nc surfdata_new_vs_old.nc +# >>> ncview surfdata_new_vs_old.nc +# Focus on fields with larger RMS diffs in the cprnc output. +# For ctsm5.4 I got approval for expected diffs from +# - Keith Oleson for diffs in urban fields +# - Peter Lawrence for diffs in const_harvest, unrep_pft, pct_natveg, pct_nat_pft +# - Fang Li (a few months ago) for diffs in abm. +# ncvis works like ncview for unstructured grids (e.g. ne30), though it +# seems to crash when I give it a "diff" file generated by ncdiff. +# +# Another validation step +# ----------------------- +# Run mksurfdata_esmf with a different number of processors and confirm +# bit-for-bit same results. + +echo "starting grids loop" + +# The first loop of grids has different ctsm5.3 date stamp. +# Skip ne3np4.pg2 as present only in ctsm5.4. +grids=("ne3np4") + +for grid in "${grids[@]}" + + do /glade/campaign/cesm/cesmdata/cseg/tools/cime/tools/cprnc/cprnc ../surfdata_$grid\_hist_1850_78pfts_c251022.nc ../../ctsm5.3.0/surfdata_$grid\_hist_1850_78pfts_c240925.nc >& surfdata_$grid\_hist_1850_78pfts_ctsm5.4v5.3.cprnc.out + /glade/campaign/cesm/cesmdata/cseg/tools/cime/tools/cprnc/cprnc ../surfdata_$grid\_hist_2000_78pfts_c251022.nc ../../ctsm5.3.0/surfdata_$grid\_hist_2000_78pfts_c240925.nc >& surfdata_$grid\_hist_2000_78pfts_ctsm5.4v5.3.cprnc.out + echo "done $grid" + +done + +# Second loop of grids. +grids=("4x5" "10x15" "0.9x1.25" "1.9x2.5" "mpasa120" "mpasa480" "ne16np4.pg3" "ne120np4.pg3" "ne3np4.pg3" "ne30np4" "ne30np4.pg2" "ne30np4.pg3") +for grid in "${grids[@]}" + + do /glade/campaign/cesm/cesmdata/cseg/tools/cime/tools/cprnc/cprnc ../surfdata_$grid\_hist_1850_78pfts_c251022.nc ../../ctsm5.3.0/surfdata_$grid\_hist_1850_78pfts_c240908.nc >& surfdata_$grid\_hist_1850_78pfts_ctsm5.4v5.3.cprnc.out + /glade/campaign/cesm/cesmdata/cseg/tools/cime/tools/cprnc/cprnc ../surfdata_$grid\_hist_2000_78pfts_c251022.nc ../../ctsm5.3.0/surfdata_$grid\_hist_2000_78pfts_c240908.nc >& surfdata_$grid\_hist_2000_78pfts_ctsm5.4v5.3.cprnc.out + echo "done $grid" + +done + +# Third loop of grids. +# Skip mpasa30 as present only in ctsm5.4. +# Skip 1850 as only 2000 is present. +grids=("mpasa3p75" "mpasa15" "mpasa60") +for grid in "${grids[@]}" + + do /glade/campaign/cesm/cesmdata/cseg/tools/cime/tools/cprnc/cprnc ../surfdata_$grid\_hist_2000_16pfts_c251022.nc ../../ctsm5.3.0/surfdata_$grid\_hist_2000_16pfts_c240908.nc >& surfdata_$grid\_hist_2000_78pfts_ctsm5.4v5.3.cprnc.out + echo "done $grid" + +done + +# grep for E+ to catch larger diffs. +for file in surfdata_*cprnc.out + do grep -H NORM $file | grep 'E+' >> grep_E+_surfdata_cprnc.out +done + +exit From eca1eb0a2b435c094b525f335b650e2eddae6bf0 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Tue, 18 Nov 2025 12:20:34 -0700 Subject: [PATCH 106/129] Revised validation tool based on Erik's code review --- .../mksurfdata_esmf/validate_fsurdat_files.sh | 74 +++++++++++++------ 1 file changed, 51 insertions(+), 23 deletions(-) diff --git a/tools/mksurfdata_esmf/validate_fsurdat_files.sh b/tools/mksurfdata_esmf/validate_fsurdat_files.sh index b1e68ad233..2158a30435 100755 --- a/tools/mksurfdata_esmf/validate_fsurdat_files.sh +++ b/tools/mksurfdata_esmf/validate_fsurdat_files.sh @@ -3,18 +3,18 @@ # Validation/verification of new fsurdat files # -------------------------------------------- # WRITTEN by slevis after discussions with ekluzek. -# DATE of original script 2025/11/11. # -# LOCATION: I first used this script in the directory +# LOCATION: slevis first used this script in the directory # .../inputdata/lnd/clm2/surfdata_esmf/ctsm5.4.0/validation # # CAVEAT: For new CTSM versions, use this script as a template with the -# understanding that aspects of the code will need to change. +# understanding that aspects of the code will need to change. Search +# the string "current" for items that may need to change in the future. # # PURPOSE and DETAILS # ------------------- # This script -# 1) uses cprnc to compare ctsm5.4 versus ctsm5.3 files by generating +# 1) uses cprnc to compare NEW_VERSION versus OLD_VERSION files by generating # cprnc.out files. # 2) greps for fields with differences (RMS or NORMALIZED) that are >=1. # The strictest grep threshold that I found isolates potentially @@ -31,10 +31,14 @@ # ----------------------------- # Interactively and iteratively build this grep command to confirm that # all fields in the script's grep output are expected. This list of -# fields is ctsm5.4-specific: +# fields here is ctsm5.4-specific: # >>> grep NORM grep_E+_surfdata_cprnc.out | grep -v ROOF | grep -v WALL | grep -v URBAN | grep -v BUILDING | grep -v abm | grep -v CANYON | grep -v CONST_HARVEST | grep -v ROAD | grep -v UNREPRESENTED_PFT | grep -v PCT_NATVEG # # If the grep command reveals unexpected fields, investigate. +# The list of fields to check depends on which fields you expect to have +# answer changes. The magnitude of the differences will depend on the +# specifics of what changed. Ensure you only see the answer changes that +# you expect. # # ----------------------------- # @@ -42,50 +46,74 @@ # ------------------------------ # >>> ncdiff surfdata_new.nc surfdata_old.nc surfdata_new_vs_old.nc # >>> ncview surfdata_new_vs_old.nc -# Focus on fields with larger RMS diffs in the cprnc output. -# For ctsm5.4 I got approval for expected diffs from -# - Keith Oleson for diffs in urban fields -# - Peter Lawrence for diffs in const_harvest, unrep_pft, pct_natveg, pct_nat_pft -# - Fang Li (a few months ago) for diffs in abm. -# ncvis works like ncview for unstructured grids (e.g. ne30), though it -# seems to crash when I give it a "diff" file generated by ncdiff. +# - Focus on fields with larger RMS diffs in the cprnc output. +# - ncvis works like ncview for unstructured grids (e.g. ne30), though +# slevis found ncvis to crash when reading a "diff" file generated by ncdiff. # # Another validation step # ----------------------- # Run mksurfdata_esmf with a different number of processors and confirm # bit-for-bit same results. +# Settings to be used in the comparisons below. +# Paths are hardwired to derecho currently. +newdatestamp=c251022 # USER DEFINED +newdir=ctsm5.4.0 # USER DEFINED +olddir=ctsm5.3.0 # USER DEFINED +olddatestamp=c240908 # USER DEFINED +olddatestamp_ne3np4=c240925 # USER DEFINED +cimetoolspath=/glade/campaign/cesm/cesmdata/cseg/tools/cime/tools +CPRNC=$cimetoolspath/cprnc/cprnc + echo "starting grids loop" -# The first loop of grids has different ctsm5.3 date stamp. -# Skip ne3np4.pg2 as present only in ctsm5.4. +# The first loop of grids (unlike the other loops) uses olddatestamp_ne3np4 currently. +# Skip ne3np4.pg2 as present only in NEW_VERSION currently so may wish to add in future versions. grids=("ne3np4") for grid in "${grids[@]}" - do /glade/campaign/cesm/cesmdata/cseg/tools/cime/tools/cprnc/cprnc ../surfdata_$grid\_hist_1850_78pfts_c251022.nc ../../ctsm5.3.0/surfdata_$grid\_hist_1850_78pfts_c240925.nc >& surfdata_$grid\_hist_1850_78pfts_ctsm5.4v5.3.cprnc.out - /glade/campaign/cesm/cesmdata/cseg/tools/cime/tools/cprnc/cprnc ../surfdata_$grid\_hist_2000_78pfts_c251022.nc ../../ctsm5.3.0/surfdata_$grid\_hist_2000_78pfts_c240925.nc >& surfdata_$grid\_hist_2000_78pfts_ctsm5.4v5.3.cprnc.out + # 1850_78pft files + do $CPRNC ../surfdata_$grid\_hist_1850_78pfts_$newdatestamp.nc ../../$olddir/surfdata_$grid\_hist_1850_78pfts_$olddatestamp_ne3np4.nc >& surfdata_$grid\_hist_1850_78pfts_$newdir\_vs_$olddir.cprnc.out + # 2000_78pft files + $CPRNC ../surfdata_$grid\_hist_2000_78pfts_$newdatestamp.nc ../../$olddir/surfdata_$grid\_hist_2000_78pfts_$olddatestamp_ne3np4.nc >& surfdata_$grid\_hist_2000_78pfts_$newdir\_vs_$olddir.cprnc.out echo "done $grid" done # Second loop of grids. -grids=("4x5" "10x15" "0.9x1.25" "1.9x2.5" "mpasa120" "mpasa480" "ne16np4.pg3" "ne120np4.pg3" "ne3np4.pg3" "ne30np4" "ne30np4.pg2" "ne30np4.pg3") +grids=("C96" "360x720cru" "4x5" "10x15" "0.9x1.25" "1.9x2.5" "mpasa120" "mpasa480" "ne16np4.pg3" "ne120np4.pg3" "ne3np4.pg3" "ne30np4" "ne30np4.pg2" "ne30np4.pg3") for grid in "${grids[@]}" - do /glade/campaign/cesm/cesmdata/cseg/tools/cime/tools/cprnc/cprnc ../surfdata_$grid\_hist_1850_78pfts_c251022.nc ../../ctsm5.3.0/surfdata_$grid\_hist_1850_78pfts_c240908.nc >& surfdata_$grid\_hist_1850_78pfts_ctsm5.4v5.3.cprnc.out - /glade/campaign/cesm/cesmdata/cseg/tools/cime/tools/cprnc/cprnc ../surfdata_$grid\_hist_2000_78pfts_c251022.nc ../../ctsm5.3.0/surfdata_$grid\_hist_2000_78pfts_c240908.nc >& surfdata_$grid\_hist_2000_78pfts_ctsm5.4v5.3.cprnc.out + # 1850_78pft files + do $CPRNC ../surfdata_$grid\_hist_1850_78pfts_$newdatestamp.nc ../../$olddir/surfdata_$grid\_hist_1850_78pfts_$olddatestamp.nc >& surfdata_$grid\_hist_1850_78pfts_$newdir\_vs_$olddir.cprnc.out + # 2000_78pft files + $CPRNC ../surfdata_$grid\_hist_2000_78pfts_$newdatestamp.nc ../../$olddir/surfdata_$grid\_hist_2000_78pfts_$olddatestamp.nc >& surfdata_$grid\_hist_2000_78pfts_$newdir\_vs_$olddir.cprnc.out echo "done $grid" done # Third loop of grids. -# Skip mpasa30 as present only in ctsm5.4. -# Skip 1850 as only 2000 is present. -grids=("mpasa3p75" "mpasa15" "mpasa60") +# Skip 1850 as only 2000 is present currently. +# Skip mpasa30 as present only in NEW_VERSION currently so may wish to add in future versions. +# Skip mpasa3p75 because cprnc runs out of memory at that resolution currently. +grids=("mpasa60" "mpasa15") +for grid in "${grids[@]}" + + # 2000_16pft files + do $CPRNC ../surfdata_$grid\_hist_2000_16pfts_$newdatestamp.nc ../../$olddir/surfdata_$grid\_hist_2000_16pfts_$olddatestamp.nc >& surfdata_$grid\_hist_2000_16pfts_$newdir\_vs_$olddir.cprnc.out + echo "done $grid" + +done + +# Fourth loop of grids: for 1979 files. +# Skip ne0np4.NATL.ne30x8 and ne120np4.pg3 as present only in NEW_VERSION currently so may wish to add in future versions. +grids=("ne0np4.ARCTICGRIS.ne30x8" "ne0np4.ARCTIC.ne30x4" "ne0np4CONUS.ne30x8" "ne0np4.POLARCAP.ne30x4") + for grid in "${grids[@]}" - do /glade/campaign/cesm/cesmdata/cseg/tools/cime/tools/cprnc/cprnc ../surfdata_$grid\_hist_2000_16pfts_c251022.nc ../../ctsm5.3.0/surfdata_$grid\_hist_2000_16pfts_c240908.nc >& surfdata_$grid\_hist_2000_78pfts_ctsm5.4v5.3.cprnc.out + # 1979_78pft files + do $CPRNC ../surfdata_$grid\_hist_1979_78pfts_$newdatestamp.nc ../../$olddir/surfdata_$grid\_hist_1979_78pfts_$olddatestamp.nc >& surfdata_$grid\_hist_1979_78pfts_$newdir\_vs_$olddir.cprnc.out echo "done $grid" done From 1d8b770de71d919d7aa931999d01ba5a7f17f1a7 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Wed, 19 Nov 2025 12:09:01 -0700 Subject: [PATCH 107/129] Change namelist_defaults so lii2 tests pick up correct finidats --- bld/namelist_files/namelist_defaults_ctsm.xml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index 46f3c3eeaf..4358ff0ec5 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -1326,6 +1326,12 @@ attributes from the config_cache.xml file (with keys converted to upper-case). lnd_tuning_mode="clm5_0_GSWP3v1" use_init_interp=".true." >lnd/clm2/initdata_esmf/ctsm5.3/clmi.interp_from.I1850Clm50BgcCrop-ciso.1366-01-01.0.9x1.25_gx1v7_simyr1850_c240223.nc +lnd/clm2/initdata_esmf/ctsm5.4/clmi.f09_interp_from.ctsm5.4.CMIP7_ciso_ctsm5.3.075_f09_124_pSASU.clm2.r.0161_c251118.nc + Date: Wed, 19 Nov 2025 12:10:12 -0700 Subject: [PATCH 108/129] Remove VEGWP[LN,PD] from restarts for lii2 tests to pass --- src/biogeophys/CanopyStateType.F90 | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/src/biogeophys/CanopyStateType.F90 b/src/biogeophys/CanopyStateType.F90 index 81dc3947b1..744ba0d8f0 100644 --- a/src/biogeophys/CanopyStateType.F90 +++ b/src/biogeophys/CanopyStateType.F90 @@ -653,18 +653,6 @@ subroutine Restart(this, bounds, ncid, flag) scale_by_thickness=.false., & interpinic_flag='interp', readvar=readvar, data=this%vegwp_patch) - call restartvar(ncid=ncid, flag=flag, varname='VEGWPLN', xtype=ncd_double, & - dim1name='pft', dim2name='vegwcs', switchdim=.false., & - long_name='vegetation water matric potential for sun/sha canopy,xyl,root at local noon', units='mm', & - scale_by_thickness=.false., & - interpinic_flag='skip', readvar=readvar, data=this%vegwp_ln_patch) - - call restartvar(ncid=ncid, flag=flag, varname='VEGWPPD', xtype=ncd_double, & - dim1name='pft', dim2name='vegwcs', switchdim=.false., & - long_name='predawn vegetation water matric potential for sun/sha canopy,xyl,root', units='mm', & - scale_by_thickness=.false., & - interpinic_flag='skip', readvar=readvar, data=this%vegwp_pd_patch) - end if end subroutine Restart From aaf6f82bc8c8b7cb44138df83aff3e34f86fe9ee Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Thu, 20 Nov 2025 15:12:55 -0700 Subject: [PATCH 109/129] Put VEGWP[LN,PD] back on restart (= revert e684a9b) + rm from history --- src/biogeophys/CanopyStateType.F90 | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/biogeophys/CanopyStateType.F90 b/src/biogeophys/CanopyStateType.F90 index 744ba0d8f0..66804e1549 100644 --- a/src/biogeophys/CanopyStateType.F90 +++ b/src/biogeophys/CanopyStateType.F90 @@ -296,11 +296,11 @@ subroutine InitHistory(this, bounds) this%vegwp_ln_patch(begp:endp,:) = spval call hist_addfld2d (fname='VEGWPLN', units='mm', type2d='nvegwcs', & avgflag='A', long_name='vegetation water matric potential for sun/sha canopy,xyl,root at local noon', & - ptr_patch=this%vegwp_ln_patch, default='active') + ptr_patch=this%vegwp_ln_patch, default='inactive') this%vegwp_pd_patch(begp:endp,:) = spval call hist_addfld2d (fname='VEGWPPD', units='mm', type2d='nvegwcs', avgflag='A', & long_name='predawn vegetation water matric potential for sun/sha canopy,xyl,root', & - ptr_patch=this%vegwp_pd_patch, default='active') + ptr_patch=this%vegwp_pd_patch, default='inactive') end if end subroutine InitHistory @@ -653,6 +653,18 @@ subroutine Restart(this, bounds, ncid, flag) scale_by_thickness=.false., & interpinic_flag='interp', readvar=readvar, data=this%vegwp_patch) + call restartvar(ncid=ncid, flag=flag, varname='VEGWPLN', xtype=ncd_double, & + dim1name='pft', dim2name='vegwcs', switchdim=.false., & + long_name='vegetation water matric potential for sun/sha canopy,xyl,root at local noon', units='mm', & + scale_by_thickness=.false., & + interpinic_flag='skip', readvar=readvar, data=this%vegwp_ln_patch) + + call restartvar(ncid=ncid, flag=flag, varname='VEGWPPD', xtype=ncd_double, & + dim1name='pft', dim2name='vegwcs', switchdim=.false., & + long_name='predawn vegetation water matric potential for sun/sha canopy,xyl,root', units='mm', & + scale_by_thickness=.false., & + interpinic_flag='skip', readvar=readvar, data=this%vegwp_pd_patch) + end if end subroutine Restart From 8db2e534fca32625e0e2cc9827f58ac9d1f784be Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Fri, 21 Nov 2025 13:08:01 -0700 Subject: [PATCH 110/129] Rm use_init_interp=.T. from files clmi.f09_interp... & clmi.f19_twice... --- bld/namelist_files/namelist_defaults_ctsm.xml | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index 4358ff0ec5..627f1d54d0 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -1329,7 +1329,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). lnd/clm2/initdata_esmf/ctsm5.4/clmi.f09_interp_from.ctsm5.4.CMIP7_ciso_ctsm5.3.075_f09_124_pSASU.clm2.r.0161_c251118.nc @@ -1436,13 +1436,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). lnd/clm2/initdata_esmf/ctsm5.4/clmi.f19_twiceinterp_from.I1850Clm50BgcCrop-ciso.1366-01-01.0.9x1.25_gx1v7_simyr1850_c251030.nc - -lnd/clm2/initdata_esmf/ctsm5.4/clmi.f19_twiceinterp_from.I1850Clm50BgcCrop-ciso.1366-01-01.0.9x1.25_gx1v7_simyr1850_c251030.nc From a5136fc7d35ff34d9f1fb1e799c01dcb06aa86af Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Fri, 21 Nov 2025 17:24:00 -0700 Subject: [PATCH 111/129] File path and name updated to ctsm5.4 values for unit test to PASS --- python/ctsm/test/test_unit_subset_data.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/ctsm/test/test_unit_subset_data.py b/python/ctsm/test/test_unit_subset_data.py index a127a282e0..81b4fb3281 100755 --- a/python/ctsm/test/test_unit_subset_data.py +++ b/python/ctsm/test/test_unit_subset_data.py @@ -107,7 +107,7 @@ def test_inputdata_setup_files_basic(self): files = setup_files(self.args, self.defaults, self.cesmroot, testing=True) self.assertEqual( files["fsurf_in"], - "surfdata_0.9x1.25_hist_2000_16pfts_c240908.nc", + "surfdata_0.9x1.25_hist_2000_16pfts_c251022.nc", "fsurf_in filename not whats expected", ) self.assertEqual( @@ -117,7 +117,7 @@ def test_inputdata_setup_files_basic(self): ) self.assertEqual( files["main_dir"], - "/glade/campaign/cesm/cesmdata/cseg/inputdata", + "/glade/campaign/cesm/cesmdata/inputdata", "main_dir directory not whats expected", ) From f4f35f94599871561d819591c2b6ba15b30331ec Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Mon, 24 Nov 2025 10:02:06 -0700 Subject: [PATCH 112/129] Update to ctsm5.3.085 --- .github/workflows/docs-build-and-deploy.yml | 4 + .gitmodules | 4 +- bld/CLMBuildNamelist.pm | 75 +- .../namelist_definition_ctsm.xml | 45 + bld/unit_testers/build-namelist_test.pl | 26 +- cime_config/testdefs/ExpectedTestFails.xml | 9 + cime_config/testdefs/testlist_clm.xml | 20 + .../include_user_mods | 1 + .../ciso_cmip7_monthly_2013Start/user_nl_clm | 6 + .../ciso_monthly_2013Start/include_user_mods | 1 + .../clm/ciso_monthly_2013Start/shell_commands | 1 + .../clm/ciso_monthly_2013Start/user_nl_clm | 3 + doc/ChangeLog | 223 +++++ doc/ChangeSum | 3 + .../using-clm-tools/paramfile-tools.md | 7 +- python/ctsm/param_utils/paramfile_shared.py | 4 +- python/ctsm/param_utils/set_paramfile.py | 11 +- python/ctsm/test/test_sys_set_paramfile.py | 96 ++- .../ctsm/test/test_unit_paramfile_shared.py | 57 ++ python/ctsm/test/test_unit_set_paramfile.py | 8 +- share | 2 +- src/CMakeLists.txt | 27 +- src/biogeochem/AtmCarbonIsotopeStreamType.F90 | 238 ++++++ src/biogeochem/CMakeLists.txt | 1 + src/biogeochem/CNCIsoAtmTimeSeriesReadMod.F90 | 801 +++++++++++++++--- .../CIsoAtmTimeSeries_test/CMakeLists.txt | 11 + .../test_CIsoAtmTimeSeries.pf | 277 ++++++ src/biogeochem/test/CMakeLists.txt | 1 + src/biogeophys/CanopyFluxesMod.F90 | 12 +- src/biogeophys/PhotosynthesisMod.F90 | 57 +- .../share_esmf/CTSMForce2DStreamBaseType.F90 | 269 ++++++ src/cpl/share_esmf/FireDataBaseType.F90 | 2 + .../share_esmf/PrigentRoughnessStreamType.F90 | 2 + src/cpl/share_esmf/cropcalStreamMod.F90 | 1 + src/cpl/share_esmf/ndepStreamMod.F90 | 4 + src/fates | 2 +- src/main/clm_initializeMod.F90 | 10 +- src/main/clm_varcon.F90 | 10 +- src/main/clm_varctl.F90 | 18 +- .../SoilBiogeochemCompetitionMod.F90 | 12 +- src/unit_test_stubs/share_esmf/CMakeLists.txt | 1 + .../share_esmf/CTSMForce2DStreamBaseType.F90 | 120 +++ src/utils/clmfates_interfaceMod.F90 | 32 +- src/utils/fileutils.F90 | 11 +- 44 files changed, 2245 insertions(+), 280 deletions(-) create mode 100644 cime_config/testdefs/testmods_dirs/clm/ciso_cmip7_monthly_2013Start/include_user_mods create mode 100644 cime_config/testdefs/testmods_dirs/clm/ciso_cmip7_monthly_2013Start/user_nl_clm create mode 100644 cime_config/testdefs/testmods_dirs/clm/ciso_monthly_2013Start/include_user_mods create mode 100644 cime_config/testdefs/testmods_dirs/clm/ciso_monthly_2013Start/shell_commands create mode 100644 cime_config/testdefs/testmods_dirs/clm/ciso_monthly_2013Start/user_nl_clm create mode 100755 python/ctsm/test/test_unit_paramfile_shared.py create mode 100644 src/biogeochem/AtmCarbonIsotopeStreamType.F90 create mode 100644 src/biogeochem/test/CIsoAtmTimeSeries_test/CMakeLists.txt create mode 100644 src/biogeochem/test/CIsoAtmTimeSeries_test/test_CIsoAtmTimeSeries.pf create mode 100644 src/cpl/share_esmf/CTSMForce2DStreamBaseType.F90 create mode 100644 src/unit_test_stubs/share_esmf/CTSMForce2DStreamBaseType.F90 diff --git a/.github/workflows/docs-build-and-deploy.yml b/.github/workflows/docs-build-and-deploy.yml index a802a0743a..55ad033ed7 100644 --- a/.github/workflows/docs-build-and-deploy.yml +++ b/.github/workflows/docs-build-and-deploy.yml @@ -33,6 +33,10 @@ concurrency: jobs: build-and-deploy: + + # Only run on upstream repository + if: ${{ github.repository == 'ESCOMP/CTSM' }} + environment: name: github-pages url: ${{ steps.deployment.outputs.page_url }} diff --git a/.gitmodules b/.gitmodules index f0e6ed2ef6..7d566e63ca 100644 --- a/.gitmodules +++ b/.gitmodules @@ -28,7 +28,7 @@ [submodule "fates"] path = src/fates url = https://github.com/NGEET/fates -fxtag = sci.1.87.2_api.41.0.0 +fxtag = sci.1.88.0_api.42.0.0 fxrequired = AlwaysRequired # Standard Fork to compare to with "git fleximod test" to ensure personal forks aren't committed fxDONOTUSEurl = https://github.com/NGEET/fates @@ -100,7 +100,7 @@ fxDONOTUSEurl = https://github.com/ESCOMP/CDEPS.git [submodule "share"] path = share url = https://github.com/ESCOMP/CESM_share -fxtag = share1.1.9 +fxtag = share1.1.15 fxrequired = ToplevelRequired # Standard Fork to compare to with "git fleximod test" to ensure personal forks aren't committed fxDONOTUSEurl = https://github.com/ESCOMP/CESM_share diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index d83eaf088d..2dea2fcdb2 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -3770,32 +3770,58 @@ sub setup_logic_c_isotope { $log->warning("use_c14 is ONLY scientifically validated with the bgc=BGC configuration" ); } } + my $use_c14_bombspike = $nl->get_value('use_c14_bombspike'); + my $stream_fldfilename_atm_c14 = $nl->get_value('stream_fldfilename_atm_c14'); + my $atm_c14_filename = $nl->get_value('atm_c14_filename'); if ( &value_is_true($use_c14) ) { add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'use_c14_bombspike', 'use_c14'=>$use_c14 ); - my $use_c14_bombspike = $nl->get_value('use_c14_bombspike'); + $use_c14_bombspike = $nl->get_value('use_c14_bombspike'); if ( &value_is_true($use_c14_bombspike) ) { - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'atm_c14_filename', - 'use_c14'=>$use_c14, 'use_cn'=>$nl_flags->{'use_cn'}, 'use_c14_bombspike'=>$nl->get_value('use_c14_bombspike'), - 'ssp_rcp'=>$nl_flags->{'ssp_rcp'} ); + if ( defined($stream_fldfilename_atm_c14) ) { + setup_logic_c14_streams($opts, $nl_flags, $definition, $defaults, $nl); + } else { + add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'atm_c14_filename', + 'use_c14'=>$use_c14, 'use_cn'=>$nl_flags->{'use_cn'}, 'use_c14_bombspike'=>$nl->get_value('use_c14_bombspike'), + 'ssp_rcp'=>$nl_flags->{'ssp_rcp'} ); + } + $stream_fldfilename_atm_c14 = $nl->get_value('stream_fldfilename_atm_c14'); + $atm_c14_filename = $nl->get_value('atm_c14_filename'); + if ( defined($stream_fldfilename_atm_c14) && defined($atm_c14_filename) ) { + $log->fatal_error("Both stream_fldfilename_atm_c14 and atm_c14_filename set, only one should be set"); + } } } else { - if ( defined($nl->get_value('use_c14_bombspike')) || - defined($nl->get_value('atm_c14_filename')) ) { - $log->fatal_error("use_c14 is FALSE and use_c14_bombspike or atm_c14_filename set"); + if ( defined($use_c14_bombspike) || + defined($stream_fldfilename_atm_c14) || + defined($atm_c14_filename) ) { + $log->fatal_error("use_c14 is FALSE and use_c14_bombspike, stream_fldfilename_atm_c14 or atm_c14_filename set"); } } + my $use_c13_timeseries = $nl->get_value('use_c13_timeseries'); + my $stream_fldfilename_atm_c13 = $nl->get_value('stream_fldfilename_atm_c13'); + my $atm_c13_filename = $nl->get_value('atm_c13_filename'); if ( &value_is_true($use_c13) ) { add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'use_c13_timeseries', 'use_c13'=>$use_c13 ); - my $use_c13_timeseries = $nl->get_value('use_c13_timeseries'); + $use_c13_timeseries = $nl->get_value('use_c13_timeseries'); if ( &value_is_true($use_c13_timeseries) ) { - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'atm_c13_filename', - 'use_c13'=>$use_c13, 'use_cn'=>$nl_flags->{'use_cn'}, 'use_c13_timeseries'=>$nl->get_value('use_c13_timeseries'), - 'ssp_rcp'=>$nl_flags->{'ssp_rcp'} ); + if ( defined($stream_fldfilename_atm_c13) ) { + setup_logic_c13_streams($opts, $nl_flags, $definition, $defaults, $nl); + } else { + add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'atm_c13_filename', + 'use_c13'=>$use_c13, 'use_cn'=>$nl_flags->{'use_cn'}, 'use_c13_timeseries'=>$nl->get_value('use_c13_timeseries'), + 'ssp_rcp'=>$nl_flags->{'ssp_rcp'} ); + } + $stream_fldfilename_atm_c13 = $nl->get_value('stream_fldfilename_atm_c13'); + $atm_c13_filename = $nl->get_value('atm_c13_filename'); + if ( defined($stream_fldfilename_atm_c13) && defined($atm_c13_filename) ) { + $log->fatal_error("Both stream_fldfilename_atm_c13 and atm_c13_filename set, only one should be set"); + } } } else { if ( defined($nl->get_value('use_c13_timeseries')) || + defined($nl->get_value('stream_fldfilename_atm_c13')) || defined($nl->get_value('atm_c13_filename')) ) { - $log->fatal_error("use_c13 is FALSE and use_c13_timeseries or atm_c13_filename set"); + $log->fatal_error("use_c13 is FALSE and use_c13_timeseries, stream_fldfilename_atm_c13 or atm_c13_filename set"); } } } else { @@ -3803,8 +3829,10 @@ sub setup_logic_c_isotope { &value_is_true($use_c14) || &value_is_true($nl->get_value('use_c14_bombspike')) || defined($nl->get_value('atm_c14_filename')) || + defined($nl->get_value('stream_fldfilename_atm_c14')) || &value_is_true($nl->get_value('use_c13_timeseries')) || - defined($nl->get_value('atm_c13_filename')) ) { + defined($nl->get_value('atm_c13_filename')) || + defined($nl->get_value('stream_fldfilename_atm_c13')) ) { $log->fatal_error("bgc=sp and C isotope namelist variables were set, both can't be used at the same time"); } } @@ -3812,6 +3840,24 @@ sub setup_logic_c_isotope { #------------------------------------------------------------------------------- +sub setup_logic_c13_streams { + my ($opts, $nl_flags, $definition, $defaults, $nl) = @_; + # + # C13 stream file settings + # +} + +#------------------------------------------------------------------------------- + +sub setup_logic_c14_streams { + my ($opts, $nl_flags, $definition, $defaults, $nl) = @_; + # + # C14 stream file settings + # +} + +#------------------------------------------------------------------------------- + sub setup_logic_nitrogen_deposition { my ($opts, $nl_flags, $definition, $defaults, $nl) = @_; @@ -5334,6 +5380,9 @@ sub write_output_files { push @groups, "clm_canopy_inparm"; push @groups, "prigentroughness"; push @groups, "zendersoilerod"; + if ( &value_is_true($nl_flags->{'use_cn'}) ) { + push @groups, "carbon_isotope_streams"; + } if (remove_leading_and_trailing_quotes($nl->get_value('snow_cover_fraction_method')) eq 'SwensonLawrence2012') { push @groups, "scf_swenson_lawrence_2012_inparm"; } diff --git a/bld/namelist_files/namelist_definition_ctsm.xml b/bld/namelist_files/namelist_definition_ctsm.xml index 69a243bd27..7a032b901f 100644 --- a/bld/namelist_files/namelist_definition_ctsm.xml +++ b/bld/namelist_files/namelist_definition_ctsm.xml @@ -1806,6 +1806,51 @@ Mapping method from Nitrogen deposition input file to the model resolution none = no interpolation + + + +First year to loop over for atmospheric C14 isotope delta data + + + +Last year to loop over for data atmospheric C14 isotope delta data + + + +Simulation year that aligns with stream_year_first_atm_c14 value + + + +Filename of input stream data for atmospheric C14 isotope delta data + + + +First year to loop over for atmospheric C13 isotope delta data + + + +Last year to loop over for data atmospheric C13 isotope delta data + + + +Simulation year that aligns with stream_year_first_atm_c13 value + + + +Filename of input stream data for atmospheric C13 isotope delta data + + diff --git a/bld/unit_testers/build-namelist_test.pl b/bld/unit_testers/build-namelist_test.pl index 725a5defff..2795ef6f76 100755 --- a/bld/unit_testers/build-namelist_test.pl +++ b/bld/unit_testers/build-namelist_test.pl @@ -163,7 +163,7 @@ sub cat_and_create_namelistinfile { # # Figure out number of tests that will run # -my $ntests = 3396; +my $ntests = 3402; if ( defined($opts{'compare'}) ) { $ntests += 2061; @@ -821,6 +821,30 @@ sub cat_and_create_namelistinfile { namelst=>"use_c14_bombspike=.true.", phys=>"clm5_0", }, + "bombspike file and stream" =>{ options=>"-bgc bgc -envxml_dir .", + namelst=>"use_c14=TRUE use_c14_bombspike=.true. stream_fldfilename_atm_c14='/dev/null', atm_c14_filename='/dev/null'", + phys=>"clm6_0", + }, + "c13 file and stream" =>{ options=>"-bgc bgc -envxml_dir .", + namelst=>"use_c13_timeseries=.true. stream_fldfilename_atm_c13='/dev/null', atm_c13_filename='/dev/null'", + phys=>"clm6_0", + }, + "c13 off, but stream" =>{ options=>"-bgc bgc -envxml_dir .", + namelst=>"use_c13=.false. stream_fldfilename_atm_c13='/dev/null'", + phys=>"clm6_0", + }, + "c14 off, but stream" =>{ options=>"-bgc bgc -envxml_dir .", + namelst=>"use_c14=.false. stream_fldfilename_atm_c14='/dev/null'", + phys=>"clm6_0", + }, + "sp, but c13 stream" =>{ options=>"-bgc sp -envxml_dir .", + namelst=>"stream_fldfilename_atm_c13='/dev/null'", + phys=>"clm6_0", + }, + "sp, but c14 stream" =>{ options=>"-bgc sp -envxml_dir .", + namelst=>"stream_fldfilename_atm_c14='/dev/null'", + phys=>"clm6_0", + }, "lightres no cn" =>{ options=>"-bgc sp -envxml_dir . -light_res 360x720", namelst=>"", phys=>"clm5_0", diff --git a/cime_config/testdefs/ExpectedTestFails.xml b/cime_config/testdefs/ExpectedTestFails.xml index 5d4d51e123..d21fc39c42 100644 --- a/cime_config/testdefs/ExpectedTestFails.xml +++ b/cime_config/testdefs/ExpectedTestFails.xml @@ -247,6 +247,15 @@ + + FAIL diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index 913580c77b..15e395fe6d 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -195,6 +195,25 @@ + + + + + + + + + + + + + + + + + + + @@ -4445,6 +4464,7 @@ + diff --git a/cime_config/testdefs/testmods_dirs/clm/ciso_cmip7_monthly_2013Start/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/ciso_cmip7_monthly_2013Start/include_user_mods new file mode 100644 index 0000000000..5f7ca15ec0 --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/ciso_cmip7_monthly_2013Start/include_user_mods @@ -0,0 +1 @@ +../ciso_monthly_2013Start diff --git a/cime_config/testdefs/testmods_dirs/clm/ciso_cmip7_monthly_2013Start/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/ciso_cmip7_monthly_2013Start/user_nl_clm new file mode 100644 index 0000000000..df0189c2e6 --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/ciso_cmip7_monthly_2013Start/user_nl_clm @@ -0,0 +1,6 @@ + stream_fldfilename_atm_c13 = '$DIN_LOC_ROOT/lnd/clm2/isotopes/ctsmforc.Graven.atm_delta_C13_CMIP7_global_1700-2023_yearly_v3.0_c251013.nc' + stream_fldfilename_atm_c14 = '$DIN_LOC_ROOT/lnd/clm2/isotopes/ctsmforc.Graven.atm_delta_C14_CMIP7_4x1_global_1700-2023_yearly_v3.0_c251013.nc' + stream_year_first_atm_c14 = 2013 + stream_model_year_align_atm_c14 = 2013 + stream_year_first_atm_c13 = 2013 + stream_model_year_align_atm_c13 = 2013 diff --git a/cime_config/testdefs/testmods_dirs/clm/ciso_monthly_2013Start/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/ciso_monthly_2013Start/include_user_mods new file mode 100644 index 0000000000..2cc5720115 --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/ciso_monthly_2013Start/include_user_mods @@ -0,0 +1 @@ +../ciso_monthly diff --git a/cime_config/testdefs/testmods_dirs/clm/ciso_monthly_2013Start/shell_commands b/cime_config/testdefs/testmods_dirs/clm/ciso_monthly_2013Start/shell_commands new file mode 100644 index 0000000000..035842f982 --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/ciso_monthly_2013Start/shell_commands @@ -0,0 +1 @@ +./xmlchange RUN_STARTDATE=2013-01-01 diff --git a/cime_config/testdefs/testmods_dirs/clm/ciso_monthly_2013Start/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/ciso_monthly_2013Start/user_nl_clm new file mode 100644 index 0000000000..b0129f7f6e --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/ciso_monthly_2013Start/user_nl_clm @@ -0,0 +1,3 @@ +! Add C13/C14 output to validate the incoming data +hist_fincl1 += 'RC13_CANAIR', 'RC14_CANAIR' +hist_fincl2 = 'RC13_CANAIR', 'RC14_CANAIR' diff --git a/doc/ChangeLog b/doc/ChangeLog index 551de3ae12..655b56af19 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,4 +1,227 @@ =============================================================== +Tag name: ctsm5.3.085 +Originator(s): slevis (Samuel Levis,UCAR/TSS,303-665-1310) +Date: Fri Nov 14 11:08:54 AM MST 2025 +One-line Summary: Merge b4b-dev to master + +Purpose and description of changes +---------------------------------- + + PRs + #3581 by Bill Sacks: Generalize some paths so unit testing works in a CESM checkout, previously assumed standalone CTSM checkout. + #3561 by Erik Kluzek: Start adding streams infrastructure for carbon isotopes. + +Significant changes to scientifically-supported configurations +-------------------------------------------------------------- + +Does this tag change answers significantly for any of the following physics configurations? +(Details of any changes will be given in the "Answer changes" section below.) + + [Put an [X] in the box for any configuration with significant answer changes.] + +[ ] clm6_0 + +[ ] clm5_0 + +[ ] ctsm5_0-nwp + +[ ] clm4_5 + + +Bugs fixed +---------- +List of CTSM issues fixed (include CTSM Issue # and description) [one per line]: + Resolves #2837 + Resolves #3502 + Design notes in #3546 + Some work on #3346 + +Testing summary: +---------------- + [PASS means all tests PASS; OK means tests PASS other than expected fails.] + + python testing (if python code has changed; see instructions in python/README.md; document testing done): + + derecho - PASS + + regular tests (aux_clm: https://github.com/ESCOMP/CTSM/wiki/System-Testing-Guide#pre-merge-system-testing): + + derecho ----- OK + izumi ------- OK + +Answer changes +-------------- + +Changes answers relative to baseline: + No + +Other details +------------- +Pull Requests that document the changes (include PR ids): + https://github.com/ESCOMP/ctsm/pull/3609 + +=============================================================== +=============================================================== +Tag name: ctsm5.3.084 +Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326) +Date: Fri 31 Oct 2025 01:12:26 PM MDT +One-line Summary: Merge b4b-dev to master + +Purpose and description of changes +---------------------------------- + +Bring changes on b4b-dev to master + +- Fix FUNIT testing on Mac's +- Some fixes to set_paramfile +- Don't auto build documentation on personal forks, only on ESCOMP + +Significant changes to scientifically-supported configurations +-------------------------------------------------------------- + +Does this tag change answers significantly for any of the following physics configurations? +(Details of any changes will be given in the "Answer changes" section below.) + + [Put an [X] in the box for any configuration with significant answer changes.] + +[ ] clm6_0 + +[ ] clm5_0 + +[ ] ctsm5_0-nwp + +[ ] clm4_5 + + +Bugs fixed +---------- +List of CTSM issues fixed (include CTSM Issue # and description) [one per line]: + Fixes #3571 -- set_paramfile ordering of PFT's from user doesn't have to match paramfile order + Fixes #3559 -- Correct Ndims error + Fixes #3369 -- Docs build and deploy only runs on ESCOMP not personal forks + +Notes of particular relevance for users +--------------------------------------- + +Changes to documentation: + Some changes to set_paramfile documentation + +Notes of particular relevance for developers: +--------------------------------------------- + +Testing summary: regular +---------------- + + [PASS means all tests PASS; OK means tests PASS other than expected fails.] + + build-namelist tests (if CLMBuildNamelist.pm has changed): + + derecho - OK + + python testing (if python code has changed; see instructions in python/README.md; document testing done): + + derecho - PASS + + regular tests (aux_clm: https://github.com/ESCOMP/CTSM/wiki/System-Testing-Guide#pre-merge-system-testing): + + derecho ----- OK + izumi ------- OK + +If the tag used for baseline comparisons was NOT the previous tag, note that here: + + +Answer changes +-------------- + +Changes answers relative to baseline: No bit-for-bit + +Other details +------------- + +Pull Requests that document the changes (include PR ids): +(https://github.com/ESCOMP/ctsm/pull) + + -- #3577 unit testing on Mac + -- #3572 set_paramfile ordering + -- #3560 Fix Ndim error in set_paramfile + -- #3557 doc/build/run/deploy only on ESCOMP + +=============================================================== +=============================================================== +Tag name: ctsm5.3.083 +Originator(s): rgknox (Ryan Knox,LAWRENCE BERKELEY NATIONAL LABORATORY,510-495-2153) +Date: Wed 29 Oct 2025 03:35:50 PM MDT +One-line Summary: Changes to coupling of supplementation status with FATES. + +Purpose and description of changes +---------------------------------- + +Supplementation status is now passed to FATES as a run-time boundary condition. This set of changes is synchronized with FATES-side changes that were oriented around how supplementation status impacts whether or not fine-root proportions are allowed to change during CNP runs. + + +Significant changes to scientifically-supported configurations +-------------------------------------------------------------- + +Does this tag change answers significantly for any of the following physics configurations? No + +Bugs fixed +---------- + +No bugs were fixed. + +Notes of particular relevance for users +--------------------------------------- + +When CTSM-FATES has nutrient coupling, note that FATES plants will default to not changing L2FR when supplementing nitrogen. + +Caveats for users (e.g., need to interpolate initial conditions): None + +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): None + +Changes made to namelist defaults (e.g., changed parameter values): None + +Changes to the datasets (e.g., parameter, surface or initial files): None + +Changes to documentation: None necessary. + +Substantial timing or memory changes: None + +Notes of particular relevance for developers: +--------------------------------------------- + +We had been passing a stealth namelist variable from CTSM to FATES, it gave FATES information about what types of mineralized nutrient were available (ie NO3 or NH4), but FATES has never used this information, so it was removed. + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): None + +Changes to tests or testing: None + + +Testing summary: +---------------- + + regular tests (aux_clm: https://github.com/ESCOMP/CTSM/wiki/System-Testing-Guide#pre-merge-system-testing): + + derecho ----- OK + izumi ------- OK + + fates tests: (give name of baseline if different from CTSM tagname, normally fates baselines are fates--) + derecho ----- OK + izumi ------- OK + + +Answer changes +-------------- + +Changes answers relative to baseline: No answer changes with one exception. Some FATES-specific variables related to radiation diagnostics and error tracking changed with updating the FATES tag. These were diagnostic only changes, and not related to FATES internals changing in any way. + +ther details +------------- +Pull Requests that document the changes (include PR ids): + https://github.com/ESCOMP/CTSM/pull/3348 + + +=============================================================== +=============================================================== Tag name: ctsm5.3.082 Originator(s): slevis (Samuel Levis,UCAR/TSS,303-665-1310) Date: Fri 24 Oct 2025 11:17:41 AM MDT diff --git a/doc/ChangeSum b/doc/ChangeSum index e19584ae9d..135ae3ac13 100644 --- a/doc/ChangeSum +++ b/doc/ChangeSum @@ -1,5 +1,8 @@ Tag Who Date Summary ============================================================================================================================ + ctsm5.3.085 slevis 11/14/2025 Merge b4b-dev to master + ctsm5.3.084 erik 10/31/2025 Merge b4b-dev to master + ctsm5.3.083 rgknox 10/29/2025 Changes to coupling of supplementation status with FATES. ctsm5.3.082 slevis 10/24/2025 Update to CMIP7 population density file for non-SSP cases ctsm5.3.081 erik 10/22/2025 Change defaults for when Carbon isotopes are turned on, and turn on irrigate for Sp/Bgc cases for clm6_0 historical transient cases ctsm5.3.080 samrabin 10/16/2025 Merge b4b-dev to master diff --git a/doc/source/users_guide/using-clm-tools/paramfile-tools.md b/doc/source/users_guide/using-clm-tools/paramfile-tools.md index 71d881e362..aaee301bcb 100644 --- a/doc/source/users_guide/using-clm-tools/paramfile-tools.md +++ b/doc/source/users_guide/using-clm-tools/paramfile-tools.md @@ -57,9 +57,14 @@ Change a one-dimensional parameter (`mimics_fmet` has the `segment` dimension, l tools/param_utils/set_paramfile -i paramfile.nc -o output.nc mimics_fmet=0.1,0.2,0.3,0.4 ``` +Change a one-dimensional parameter to be all one value (`mxmat` has the `pft` dimension, length 79): +```bash +tools/param_utils/set_paramfile -i paramfile.nc -o output.nc mxmat=360 +``` + Change a parameter for specific PFTs: ```bash -tools/param_utils/set_paramfile -i paramfile.nc -o output.nc -p needleleaf_evergreen_temperate_tree,c4_grass medlynintercept=99.9,100.1 medlynslope=2.99,1.99 +tools/param_utils/set_paramfile -i paramfile.nc -o output.nc -p needleleaf_evergreen_temperate_tree,c4_grass medlynintercept=99.9,100.1 medlynslope=2.99,1.99 mxmat=199 ``` Set a parameter to the fill value: diff --git a/python/ctsm/param_utils/paramfile_shared.py b/python/ctsm/param_utils/paramfile_shared.py index b9860be0db..d12773dbdb 100644 --- a/python/ctsm/param_utils/paramfile_shared.py +++ b/python/ctsm/param_utils/paramfile_shared.py @@ -85,7 +85,9 @@ def get_selected_pft_indices(selected_pfts, pft_names): list of int Indices of selected PFTs. """ - indices = [i for i, name in enumerate(pft_names) if name in selected_pfts] + if isinstance(selected_pfts, str): + selected_pfts = [selected_pfts] + indices = [pft_names.index(pft) for pft in selected_pfts] return indices diff --git a/python/ctsm/param_utils/set_paramfile.py b/python/ctsm/param_utils/set_paramfile.py index 2ceb52069b..6efa491846 100644 --- a/python/ctsm/param_utils/set_paramfile.py +++ b/python/ctsm/param_utils/set_paramfile.py @@ -130,7 +130,7 @@ def check_correct_ndims(da, new_value, throw_error=False): """ expected = da.ndim actual = np.array(new_value).ndim - is_ndim_correct = expected == actual + is_ndim_correct = actual in (0, expected) # If actual 0, apply it to all if throw_error and not is_ndim_correct: raise RuntimeError(f"Incorrect N dims: Expected {expected}, got {actual}") return is_ndim_correct @@ -323,11 +323,12 @@ def apply_new_value_to_parameter(args, ds_out, var, new_value, var_encoding, *, # Ensure that any NaNs are replaced with the fill value new_value = _replace_nans_with_fill(var_encoding, new_value, chg=chg) - # This can be needed if, e.g., you're selecting and changing just one PFT + # This can be needed if, (a) you're selecting and changing just one PFT or (b) you're changing + # all values in a dimensioned parameter to match one value. if ds_out[var].values.ndim > 0 and new_value.ndim == 0: - new_value = np.atleast_1d(new_value) - - ds_out[var].values = new_value + ds_out[var].values[:] = new_value + else: + ds_out[var].values = new_value return ds_out diff --git a/python/ctsm/test/test_sys_set_paramfile.py b/python/ctsm/test/test_sys_set_paramfile.py index 7d82a32302..f65c8e0d50 100755 --- a/python/ctsm/test/test_sys_set_paramfile.py +++ b/python/ctsm/test/test_sys_set_paramfile.py @@ -121,8 +121,11 @@ def test_set_paramfile_changeparams_scalar_errors_given_list(self): with self.assertRaisesRegex(RuntimeError, "Incorrect N dims"): sp.main() - def test_set_paramfile_changeparam_1d_errors_given_scalar(self): - """Test that set_paramfile errors if given a scalar for a 1-d parameter""" + def test_set_paramfile_changeparam_1d_given_scalar(self): + """ + Test that set_paramfile works correctly if given a scalar for a 1-d parameter. We want it + to set all members of the 1d array to the given scalar. + """ output_path = os.path.join(self.tempdir, "output.nc") sys.argv = [ "set_paramfile", @@ -130,10 +133,53 @@ def test_set_paramfile_changeparam_1d_errors_given_scalar(self): PARAMFILE, "-o", output_path, - "xl=0.724", + "mxmat=1987", ] - with self.assertRaisesRegex(RuntimeError, "Incorrect N dims"): - sp.main() + sp.main() + self.assertTrue(os.path.exists(output_path)) + ds_in = open_paramfile(PARAMFILE) + ds_out = open_paramfile(output_path) + + for var in ds_in.variables: + # Check that all variables/coords are equal except the ones we changed, which should be + # set to what we asked + if var == "mxmat": + self.assertTrue(np.all(ds_out[var].values == 1987)) + else: + self.assertTrue(are_paramfile_dataarrays_identical(ds_in[var], ds_out[var])) + + def test_set_paramfile_changeparam_1d_given_scalar_and_pftlist(self): + """ + Test that set_paramfile works correctly if given a scalar for a 1-d parameter. We want it + to set all members of the 1d array to the given scalar. As + test_set_paramfile_changeparam_1d_given_scalar, but here we give a pft list. + """ + output_path = os.path.join(self.tempdir, "output.nc") + sys.argv = [ + "set_paramfile", + "-i", + PARAMFILE, + "-o", + output_path, + "-p", + "temperate_corn,irrigated_temperate_corn", + "mxmat=1987", + ] + sp.main() + self.assertTrue(os.path.exists(output_path)) + ds_in = open_paramfile(PARAMFILE) + ds_out = open_paramfile(output_path) + + for var in ds_in.variables: + # Check that all variables/coords are equal except the ones we changed, which should be + # set to what we asked + if var == "mxmat": + # First, check that they weren't 1987 before + self.assertFalse(np.any(ds_in[var].values[17:18] == 1987)) + # Now check that they are 1987 + self.assertTrue(np.all(ds_out[var].values[17:18] == 1987)) + else: + self.assertTrue(are_paramfile_dataarrays_identical(ds_in[var], ds_out[var])) def test_set_paramfile_changeparams_scalar_double(self): """Test that set_paramfile can copy to a new file with some scalar double params changed""" @@ -732,6 +778,46 @@ def test_set_paramfile_double_ok_given_int(self): ds_out = open_paramfile(output_path) self.assertFalse(sp.is_integer(ds_out[param_name].values)) + def test_set_paramfile_pft_order(self): + """ + Test that set_paramfile gives the same result regardless of the order you specify the PFTs + """ + + # First order + pfts_to_include = ["rice", "irrigated_rice"] + output0_path = os.path.join(self.tempdir, "output0.nc") + sys.argv = [ + "set_paramfile", + "-i", + PARAMFILE, + "-o", + output0_path, + "-p", + ",".join(pfts_to_include), + "mxmat=100,200", + ] + sp.main() + + # Reverse order + pfts_to_include.reverse() + output1_path = os.path.join(self.tempdir, "output1.nc") + sys.argv = [ + "set_paramfile", + "-i", + PARAMFILE, + "-o", + output1_path, + "-p", + ",".join(pfts_to_include), + "mxmat=200,100", + ] + sp.main() + + # These files should be identical + ds0 = open_paramfile(output0_path) + ds1 = open_paramfile(output1_path) + self.assertTrue(ds0.equals(ds1)) + if __name__ == "__main__": unit_testing.setup_for_tests() diff --git a/python/ctsm/test/test_unit_paramfile_shared.py b/python/ctsm/test/test_unit_paramfile_shared.py new file mode 100755 index 0000000000..e0adebc7c2 --- /dev/null +++ b/python/ctsm/test/test_unit_paramfile_shared.py @@ -0,0 +1,57 @@ +#!/usr/bin/env python3 + +"""Unit tests for paramfile_shared""" + +import unittest + +from ctsm import unit_testing + +from ctsm.param_utils import paramfile_shared as ps + +# Allow names that pylint doesn't like, because otherwise I find it hard +# to make readable unit test names +# pylint: disable=invalid-name + + +class TestUnitGetSelectedPftIndices(unittest.TestCase): + """Unit tests of get_selected_pft_indices""" + + def test_get_selected_pft_indices_1strselected_onlyinlist(self): + """Check get_selected_pft_indices() given the only one in the list, as a string""" + selected_pfts = "rice" + pft_names = ["rice"] + result = ps.get_selected_pft_indices(selected_pfts=selected_pfts, pft_names=pft_names) + self.assertListEqual(result, [0]) + + def test_get_selected_pft_indices_1selected_onlyinlist(self): + """Check get_selected_pft_indices() given the only one in the list, as a list""" + selected_pfts = ["rice"] + pft_names = ["rice"] + result = ps.get_selected_pft_indices(selected_pfts=selected_pfts, pft_names=pft_names) + self.assertListEqual(result, [0]) + + def test_get_selected_pft_indices_2selected_sameorder(self): + """Check get_selected_pft_indices() given 2 selected in the same order as the list""" + pft_names = ["rice", "irrigated_rice"] + result = ps.get_selected_pft_indices(selected_pfts=pft_names, pft_names=pft_names) + self.assertListEqual(result, [0, 1]) + + def test_get_selected_pft_indices_2selected_difforder(self): + """Check get_selected_pft_indices() given 2 selected NOT in the same order as the list""" + pft_names = ["rice", "irrigated_rice"] + result = ps.get_selected_pft_indices( + selected_pfts=list(reversed(pft_names)), pft_names=pft_names + ) + self.assertListEqual(result, [1, 0]) + + def test_get_selected_pft_indices_missing_valueerror(self): + """Check get_selected_pft_indices() given selected pft NOT in the list""" + selected_pfts = ["wheat"] + pft_names = ["rice", "irrigated_rice"] + with self.assertRaises(ValueError): + ps.get_selected_pft_indices(selected_pfts=selected_pfts, pft_names=pft_names) + + +if __name__ == "__main__": + unit_testing.setup_for_tests() + unittest.main() diff --git a/python/ctsm/test/test_unit_set_paramfile.py b/python/ctsm/test/test_unit_set_paramfile.py index 6b091f8967..13be015c67 100755 --- a/python/ctsm/test/test_unit_set_paramfile.py +++ b/python/ctsm/test/test_unit_set_paramfile.py @@ -65,14 +65,14 @@ def test_checkcorrectndims_0d_int_np(self): self.assertTrue(sp.check_correct_ndims(da, np.int32(1))) def test_checkcorrectndims_1d_int(self): - """Check False when given a standard int for a 0d parameter""" + """Check True when given a standard int for a 0d parameter""" da = xr.DataArray(data=[1, 2]) - self.assertFalse(sp.check_correct_ndims(da, 1)) + self.assertTrue(sp.check_correct_ndims(da, 1)) def test_checkcorrectndims_1d_int_np(self): - """Check False when given a numpy int for a 0d parameter""" + """Check True when given a numpy int for a 0d parameter""" da = xr.DataArray(data=[1, 2]) - self.assertFalse(sp.check_correct_ndims(da, np.int32(1))) + self.assertTrue(sp.check_correct_ndims(da, np.int32(1))) def test_checkcorrectndims_0d_list(self): """Check False when given a list for a 0d parameter""" diff --git a/share b/share index 14338bef3f..ec0475f05b 160000 --- a/share +++ b/share @@ -1 +1 @@ -Subproject commit 14338bef3fa604d49160e376257264db1d3313e5 +Subproject commit ec0475f05bde376bab73c74d09450549ec746d86 diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 2682775ca5..bc925b7dd1 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,17 +1,18 @@ -cmake_minimum_required(VERSION 2.8) +cmake_minimum_required(VERSION 3.10) list(APPEND CMAKE_MODULE_PATH ${CIME_CMAKE_MODULE_DIRECTORY}) include(CIME_initial_setup) -#list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../tools/mksurfdata_esmf/cmake") -list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../share/cmake") -list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../components/cmeps/cmake") +set(SRCROOT "${CIMEROOT}/..") +set(CLM_ROOT "..") + +list(APPEND CMAKE_MODULE_PATH "${SRCROOT}/share/cmake") +list(APPEND CMAKE_MODULE_PATH "${SRCROOT}/components/cmeps/cmake") project(clm_tests Fortran C) include(CIME_utils) -set(CLM_ROOT "..") # find needed external packages # NetCDF is required -- because PIO and NetCDF are required by the standard default ESMF libraries @@ -38,15 +39,15 @@ link_libraries(${ESMF_INTERFACE_LINK_LIBRARIES}) # done first, so that in case of name collisions, the CLM versions take # precedence (when there are two files with the same name, the one added later # wins). -add_subdirectory(${CLM_ROOT}/share/src csm_share) -add_subdirectory(${CLM_ROOT}/share/unit_test_stubs/util csm_share_stubs) +add_subdirectory(${SRCROOT}/share/src csm_share) +add_subdirectory(${SRCROOT}/share/unit_test_stubs/util csm_share_stubs) # Add files needed from CMEPS list ( APPEND drv_sources_needed - ${CLM_ROOT}/components/cmeps/cesm/nuopc_cap_share/glc_elevclass_mod.F90 - ${CLM_ROOT}/components/cmeps/cesm/nuopc_cap_share/shr_dust_emis_mod.F90 - ${CLM_ROOT}/components/cmeps/cesm/nuopc_cap_share/shr_expr_parser_mod.F90 - ${CLM_ROOT}/components/cmeps/cesm/nuopc_cap_share/shr_fire_emis_mod.F90 + ${SRCROOT}/components/cmeps/cesm/nuopc_cap_share/glc_elevclass_mod.F90 + ${SRCROOT}/components/cmeps/cesm/nuopc_cap_share/shr_dust_emis_mod.F90 + ${SRCROOT}/components/cmeps/cesm/nuopc_cap_share/shr_expr_parser_mod.F90 + ${SRCROOT}/components/cmeps/cesm/nuopc_cap_share/shr_fire_emis_mod.F90 ) # Add CLM source directories @@ -93,10 +94,10 @@ add_library(csm_share ${share_sources} ${drv_sources_needed}) declare_generated_dependencies(csm_share "${share_genf90_sources}") add_library(clm ${clm_sources}) declare_generated_dependencies(clm "${clm_genf90_sources}") -add_dependencies(clm csm_share esmf) +add_dependencies(clm csm_share ESMF) # We need to look for header files here, in order to pick up shr_assert.h -include_directories(${CLM_ROOT}/share/include) +include_directories(${SRCROOT}/share/include) # Tell cmake to look for libraries & mod files here, because this is where we built libraries include_directories(${CMAKE_CURRENT_BINARY_DIR}) diff --git a/src/biogeochem/AtmCarbonIsotopeStreamType.F90 b/src/biogeochem/AtmCarbonIsotopeStreamType.F90 new file mode 100644 index 0000000000..0a49ac8061 --- /dev/null +++ b/src/biogeochem/AtmCarbonIsotopeStreamType.F90 @@ -0,0 +1,238 @@ +module AtmCarbonIsotopeStreamType + ! + ! Description: + ! + ! This extends the stream base type to implement streams for atmospheric + ! Carbon isotope ratios that are read in from streams datasets (delta C13 and delta C14). + ! + use shr_kind_mod , only : r8 => shr_kind_r8 + use clm_varctl , only : iulog + use abortutils , only : endrun + use decompMod , only : bounds_type + use CTSMForce2DStreamBaseType, only : ctsm_force_2DStream_base_type + + implicit none + private + + !----------------------------------------------------------------------- + ! Atmospheric Delta C13 Stream Type + !----------------------------------------------------------------------- + character(len=*), parameter :: varname_c13 = 'delta13co2_in_air' + type, public, extends(ctsm_force_2DStream_base_type) :: atm_delta_c13_stream_type + private + real(r8), public, allocatable :: atm_delta_c13(:) ! delta C13 data array + contains + + ! Public Methods + procedure, public :: C13Init ! C13 initialization + procedure, public :: Init => C13Init ! Generic name for the initialization + procedure, public :: C13Interp ! C13 Interp method to fill the local data array + procedure, public :: Interp => C13Interp ! Generic name for the Interp method + procedure, public :: C13ClassClean ! C13 clean method as a class method + procedure, public :: Clean => C13ClassClean ! Generic name for the clean method + final :: C13TypeClean ! This clean method may be called by the compiler when the type goes out of scope + ! Private methods + procedure, private :: C13InitAllocate ! Allocate the local C13 data + + end type atm_delta_c13_stream_type + + !----------------------------------------------------------------------- + ! Atmospheric Delta C14 Stream Type + !----------------------------------------------------------------------- + character(len=*), parameter :: varname_c14 = 'Delta14co2_in_air' + type, public, extends(ctsm_force_2DStream_base_type) :: atm_delta_c14_stream_type + private + real(r8), public, allocatable :: atm_delta_c14(:) ! delta c14 data array + contains + + ! Public Methods + procedure, public :: C14Init ! C14 initialization + procedure, public :: Init => C14Init ! Generic name for the initialization + procedure, public :: C14Interp ! C14 Interp method to fill the local data array + procedure, public :: Interp => C14Interp ! Generic name for the Interp method + procedure, public :: C14ClassClean ! C14 clean method as a class method + procedure, public :: Clean => C14ClassClean ! Generic name for the clean method + final :: C14TypeClean ! This clean method may be called by the compiler when the type goes out of scope + ! Private methods + procedure, private :: C14InitAllocate ! Allocate the local C14 data + + end type atm_delta_c14_stream_type + + character(len=*), parameter, private :: sourcefile = & + __FILE__ + + !----------------------------------------------------------------------- + contains + !----------------------------------------------------------------------- + + !------------------------------------------------------------------------------------- + + subroutine C13Init( this, bounds, fldfilename, meshfile, mapalgo, tintalgo, taxmode, & + year_first, year_last, model_year_align ) + ! + ! Initialize the atmospheric delta C13 stream type + ! + ! Arguments: + class(atm_delta_c13_stream_type), intent(inout) :: this + type(bounds_type), intent(in) :: bounds + character(*), intent(in) :: fldfilename ! stream data filename (full pathname) (single file) + character(*), intent(in) :: meshfile ! full pathname to stream mesh file (none for global data) + character(*), intent(in) :: mapalgo ! stream mesh -> model mesh mapping type + character(*), intent(in) :: tintalgo ! time interpolation algorithm + character(*), intent(in) :: taxMode ! time axis mode + integer, intent(in) :: year_first ! first year to use + integer, intent(in) :: year_last ! last year to use + integer, intent(in) :: model_year_align ! align yearFirst with this model year + + call this%InitBase( bounds, varnames = (/ varname_c13 /), fldfilename=fldfilename, meshfile=meshfile, & + mapalgo=mapalgo, tintalgo=tintalgo, taxmode=taxmode, name=varname_c13, & + year_first=year_first, year_last=year_last, model_year_align=model_year_align ) + call this%C13InitAllocate( bounds ) + + end subroutine C13Init + + !------------------------------------------------------------------------------------- + + subroutine C13InitAllocate( this, bounds ) + ! Allocate memory for the delta C13 data array + use shr_infnan_mod , only : nan => shr_infnan_nan, assignment(=) + class(atm_delta_c13_stream_type), intent(inout) :: this + type(bounds_type), intent(in) :: bounds + + integer :: begg, endg + + begg = bounds%begg; endg = bounds%endg + allocate( this%atm_delta_c13( bounds%begg : bounds%endg ) ); this%atm_delta_c13 = nan + end subroutine C13InitAllocate + + !------------------------------------------------------------------------------------- + + subroutine C13ClassClean( this ) + ! Clean up memory for the C13 stream type as a class method + class(atm_delta_c13_stream_type), intent(inout) :: this + + call C13TypeClean( this ) + + end subroutine C13ClassClean + + !------------------------------------------------------------------------------------- + + subroutine C13TypeClean( this ) + ! Clean up memory for the C13 stream type for this specific type + type(atm_delta_c13_stream_type), intent(inout) :: this + + deallocate( this%atm_delta_c13 ) + call this%CleanBase() + + end subroutine C13TypeClean + + !------------------------------------------------------------------------------------- + + subroutine C13Interp( this, bounds ) + ! + ! Fill the local CTSM grid delta C13 array with data from the stream + ! + ! Arguments + class(atm_delta_c13_stream_type), intent(inout) :: this + type(bounds_type), intent(in) :: bounds + + ! Local Variables + integer :: g + real(r8), pointer :: dataptr1d(:) + integer :: rc ! error return code + + ! Get pointer for stream data that is time and spatially interpolated to model time and grid + call this%GetPtr1D( varname_c13, dataptr1d ) + + do g = bounds%begg, bounds%endg + this%atm_delta_c13(g) = dataptr1d(g) + end do + end subroutine C13Interp + + !------------------------------------------------------------------------------------- + + subroutine C14Init( this, bounds, fldfilename, meshfile, mapalgo, tintalgo, taxmode, & + year_first, year_last, model_year_align ) + ! + ! Initialize the atmospheric delta C14 stream type + ! + ! Arguments: + class(atm_delta_c14_stream_type), intent(inout) :: this + type(bounds_type), intent(in) :: bounds + character(*), intent(in) :: fldfilename ! stream data filename (full pathname) (single file) + character(*), intent(in) :: meshfile ! full pathname to stream mesh file (none for global data) + character(*), intent(in) :: mapalgo ! stream mesh -> model mesh mapping type + character(*), intent(in) :: tintalgo ! time interpolation algorithm + character(*), intent(in) :: taxMode ! time axis mode + integer, intent(in) :: year_first ! first year to use + integer, intent(in) :: year_last ! last year to use + integer, intent(in) :: model_year_align ! align yearFirst with this model year + + call this%InitBase( bounds, varnames = (/ varname_c14 /), fldfilename=fldfilename, meshfile=meshfile, & + mapalgo=mapalgo, tintalgo=tintalgo, taxmode=taxmode, name=varname_c14, & + year_first=year_first, year_last=year_last, model_year_align=model_year_align ) + call this%C14InitAllocate( bounds ) + + end subroutine C14Init + + !------------------------------------------------------------------------------------- + + subroutine C14InitAllocate( this, bounds ) + ! Allocate memory for the delta C14 data array + use shr_infnan_mod , only : nan => shr_infnan_nan, assignment(=) + ! Arguments + class(atm_delta_c14_stream_type), intent(inout) :: this + type(bounds_type), intent(in) :: bounds + + integer :: begg, endg + + begg = bounds%begg; endg = bounds%endg + allocate( this%atm_delta_c14( bounds%begg : bounds%endg ) ); this%atm_delta_c14 = nan + end subroutine C14InitAllocate + + !------------------------------------------------------------------------------------- + + subroutine C14Interp( this, bounds ) + ! Fill the local CTSM grid delta C13 array with data from the stream + ! + ! Arguments: + class(atm_delta_c14_stream_type), intent(inout) :: this + type(bounds_type), intent(in) :: bounds + + ! Local Variables + integer :: g + real(r8), pointer :: dataptr1d(:) + integer :: rc ! error return code + + ! Get pointer for stream data that is time and spatially interpolated to model time and grid + call this%GetPtr1D( varname_c14, dataptr1d ) + + do g = bounds%begg, bounds%endg + this%atm_delta_c14(g) = dataptr1d(g) + end do + end subroutine C14Interp + + !------------------------------------------------------------------------------------- + + subroutine C14ClassClean( this ) + ! Clean up memory for the C14 stream type as a class method + class(atm_delta_c14_stream_type), intent(inout) :: this + + call C14TypeClean( this ) + + end subroutine C14ClassClean + + !------------------------------------------------------------------------------------- + + subroutine C14TypeClean( this ) + ! Clean up memory for the C14 stream type for this specific type + type(atm_delta_c14_stream_type), intent(inout) :: this + + deallocate( this%atm_delta_c14 ) + call this%CleanBase() + + end subroutine C14TypeClean + + !------------------------------------------------------------------------------------- + +end module AtmCarbonIsotopeStreamType \ No newline at end of file diff --git a/src/biogeochem/CMakeLists.txt b/src/biogeochem/CMakeLists.txt index 3da0a2eab6..393e4e4db2 100644 --- a/src/biogeochem/CMakeLists.txt +++ b/src/biogeochem/CMakeLists.txt @@ -28,6 +28,7 @@ list(APPEND clm_sources CNVegNitrogenStateType.F90 CNVegNitrogenFluxType.F90 CNCIsoAtmTimeSeriesReadMod.F90 + AtmCarbonIsotopeStreamType.F90 CNVegComputeSeedMod.F90 FATESFireBase.F90 FATESFireDataMod.F90 diff --git a/src/biogeochem/CNCIsoAtmTimeSeriesReadMod.F90 b/src/biogeochem/CNCIsoAtmTimeSeriesReadMod.F90 index 529a547e88..736924fd4f 100644 --- a/src/biogeochem/CNCIsoAtmTimeSeriesReadMod.F90 +++ b/src/biogeochem/CNCIsoAtmTimeSeriesReadMod.F90 @@ -1,22 +1,27 @@ module CIsoAtmTimeseriesMod +#include "shr_assert.h" + !----------------------------------------------------------------------- ! Module for transient atmospheric boundary to the c13 and c14 codes ! ! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 + use shr_kind_mod , only : r8 => shr_kind_r8, CL => shr_kind_CL use clm_time_manager , only : get_curr_date, get_curr_yearfrac - use clm_varcon , only : c14ratio, secspday + use clm_varcon , only : c13ratio, c14ratio, secspday use shr_const_mod , only : SHR_CONST_PDB ! Ratio of C13/C12 - use clm_varctl , only : iulog + use clm_varctl , only : iulog, use_c13, use_c14 use abortutils , only : endrun use spmdMod , only : masterproc use shr_log_mod , only : errMsg => shr_log_errMsg + use AtmCarbonIsotopeStreamType, only : atm_delta_c13_stream_type, atm_delta_c14_stream_type + use decompMod , only : bounds_type ! implicit none private ! ! !PUBLIC MEMBER FUNCTIONS: + public:: CIsoAtmReadNML ! Read namelist for atmospheric C14/C13 isotope time series public:: C14BombSpike ! Time series for C14 data public:: C14_init_BombSpike ! Initialize C14 data series and read data in public:: C13Timeseries ! Time series for C13 data @@ -27,91 +32,439 @@ module CIsoAtmTimeseriesMod character(len=256) , public :: atm_c14_filename = ' ' ! file name of C14 input data logical , public :: use_c13_timeseries = .false. ! do we use time-varying atmospheric C13? character(len=256) , public :: atm_c13_filename = ' ' ! file name of C13 input data - integer, parameter , public :: nsectors_c14 = 3 ! Number of latitude sectors the C14 data has + real(r8), allocatable, public, protected :: rc14_atm_grc(:) ! Ratio of C14 C12 data on gridcell + real(r8), allocatable, public, protected :: rc13_atm_grc(:) ! Ratio of C13 C12 data on gridcell ! ! !PRIVATE MEMBER FUNCTIONS: private:: check_units ! Check the units of the data on the input file + ! Private subroutines only made public for unit testing + public:: CIsoCheckNMLInputs ! Check that the namelist inputs are valid + public:: CIsoSetNMLInputs ! Set the namelist inputs for unit testing + public:: CIsoSetControl ! Set the control variables for Carbon Isotopes + public:: CIsoLogControl ! Write out the control settings to the logfile + + type(atm_delta_c13_stream_type), private :: atm_c13_stream ! Atmospheric C13 stream object + type(atm_delta_c14_stream_type), private :: atm_c14_stream ! Atmospheric C14 stream object + ! !PRIVATE TYPES: + integer, parameter , private :: nsectors_c14 = 3 ! Number of latitude sectors the C14 data has real(r8), allocatable, private :: atm_c14file_time(:) ! time for C14 data - real(r8), allocatable, private :: atm_delta_c14(:,:) ! Delta C14 data + real(r8), allocatable, private :: atm_delta_c14(:,:) ! Delta C14 data (time,nsectors) + real(r8), allocatable, private :: atm_delta_c14_grc(:) ! Delta C14 data on gridcell real(r8), allocatable, private :: atm_c13file_time(:) ! time for C13 data - real(r8), allocatable, private :: atm_delta_c13(:) ! Delta C13 data + real(r8), allocatable, private :: atm_delta_c13(:) ! Delta C13 data (time) + real(r8), allocatable, private :: atm_delta_c13_grc(:) ! Delta C13 data on gridcell real(r8), parameter :: time_axis_offset = 1850.0_r8 ! Offset in years of time on file + logical, private :: use_c13_streams = .false. ! By default read in the CMIP6 file format for C13 + logical, private :: use_c14_streams = .false. ! By default read in the CMIP6 file format for C14 + + ! Private data for the control namelist: + character(len=CL), private :: stream_fldfilename_atm_c14 = ' ' + character(len=CL), private :: stream_fldfilename_atm_c13 = ' ' + integer, private :: stream_year_first_atm_c14 = 1850 + integer, private :: stream_year_last_atm_c14 = 2023 + integer, private :: stream_model_year_align_atm_c14 = 1850 + integer, private :: stream_year_first_atm_c13 = 1850 + integer, private :: stream_year_last_atm_c13 = 2023 + integer, private :: stream_model_year_align_atm_c13 = 1850 + character(len=CL), private :: stream_mapalgo_atm_c14 = 'nn' + character(len=CL), private :: stream_tintalgo_atm_c14 = 'linear' + character(len=CL), private :: stream_taxmode_atm_c14 = 'extend' + character(len=CL), private :: stream_mapalgo_atm_c13 = 'nn' + character(len=CL), private :: stream_tintalgo_atm_c13 = 'linear' + character(len=CL), private :: stream_taxmode_atm_c13 = 'extend' + character(len=*), parameter, private :: sourcefile = & - __FILE__ + __FILE__ !----------------------------------------------------------------------- contains !----------------------------------------------------------------------- - subroutine C14BombSpike( rc14_atm ) + subroutine CIsoAtmReadNML( NLFilename ) + ! + ! !DESCRIPTION: + ! Read in the namelist for atmospheric C14/C13 isotope time series + ! + ! Uses: + use shr_nl_mod , only : shr_nl_find_group_name + use spmdMod , only : masterproc, mpicom + use shr_mpi_mod, only : shr_mpi_bcast + + ! Arguments: + character(len=*), intent(in) :: NLFilename ! Namelist filename to read + + ! !LOCAL VARIABLES: + integer :: ierr ! error code + integer :: unitn ! unit for namelist file + character(len=*), parameter :: nml_name = 'carbon_isotope_streams' ! MUST agree with name in namelist and read + + namelist /carbon_isotope_streams/ stream_fldfilename_atm_c14, & + stream_fldfilename_atm_c13, stream_year_first_atm_c14, & + stream_year_last_atm_c14, stream_model_year_align_atm_c14, & + stream_year_first_atm_c13, stream_year_last_atm_c13, & + stream_model_year_align_atm_c13 + + ! Read in the namelist on the main task + if (masterproc) then + open( newunit=unitn, file=trim(NLFilename), status='old', iostat=ierr ) + write(iulog,*) 'Read in '//nml_name//' namelist' + call shr_nl_find_group_name(unitn, nml_name, status=ierr) + if (ierr == 0) then + read(unitn, nml=carbon_isotope_streams, iostat=ierr) + if (ierr /= 0) then + call endrun(msg="ERROR reading "//nml_name//"namelist", file=sourcefile, line=__LINE__) + return + end if + else + call endrun(msg="ERROR could NOT find "//nml_name//"namelist", file=sourcefile, line=__LINE__) + return + end if + close( unitn ) + end if + ! Broadcast namelist values to all tasks + call shr_mpi_bcast( stream_fldfilename_atm_c14, mpicom ) + call shr_mpi_bcast( stream_year_first_atm_c14, mpicom ) + call shr_mpi_bcast( stream_year_last_atm_c14, mpicom ) + call shr_mpi_bcast( stream_model_year_align_atm_c14, mpicom ) + call shr_mpi_bcast( stream_fldfilename_atm_c13, mpicom ) + call shr_mpi_bcast( stream_year_first_atm_c13, mpicom ) + call shr_mpi_bcast( stream_year_last_atm_c13, mpicom ) + call shr_mpi_bcast( stream_model_year_align_atm_c13, mpicom ) + + ! Do some error checking of input namelist items, set control flags, and write to the log + call CIsoCheckNMLInputs() + + call CIsoSetControl() + call CIsoLogControl() + + end subroutine CIsoAtmReadNML + + !----------------------------------------------------------------------- + subroutine CIsoSetControl() + ! Set control settings based on the namelist inputs + ! Also do some assert checks to make sure other settings are as expected + ! + if ( use_c13_timeseries )then + ! Decide if C14/C13 streams are going to be used or the old method + if ( len_trim(stream_fldfilename_atm_c13) /= 0 ) then + use_c13_streams = .true. + else + use_c13_streams = .false. + call shr_assert( len_trim(atm_c13_filename) /= 0 , & + msg="ERROR: use_c13_timeseries is true but atm_c13_filename is blank", file=sourcefile, line=__LINE__) + call shr_assert( .not. use_c13_streams , & + msg="ERROR: stream_fldfilename_atm_c13 is blank but use_c13_streams is not TRUE", file=sourcefile, line=__LINE__) + end if + else + use_c13_streams = .false. + call shr_assert( .not. use_c13_streams , & + msg="ERROR: use_c13_timeseries is false, but use_c13_streams is TRUE", file=sourcefile, line=__LINE__) + call shr_assert( len_trim(atm_c13_filename) == 0 , & + msg="ERROR: use_c13_timeseries is false but atm_c13_filename is NOT blank", file=sourcefile, line=__LINE__) + call shr_assert( len_trim(stream_fldfilename_atm_c13) == 0 , & + msg="ERROR: use_c13_timeseries is false but stream_fldfilename_atm_c13 is NOT blank", file=sourcefile, line=__LINE__) + end if + if ( use_c14_bombspike )then + if ( len_trim(stream_fldfilename_atm_c14) /= 0 ) then + use_c14_streams = .true. + else + use_c14_streams = .false. + call shr_assert( len_trim(atm_c14_filename) /= 0 , & + msg="ERROR: use_c14_bombspike is true but atm_c14_filename is blank", file=sourcefile, line=__LINE__) + call shr_assert( .not. use_c14_streams , & + msg="ERROR: stream_fldfilename_atm_c14 is blank but use_c14_streams is not TRUE", & + file=sourcefile, line=__LINE__) + end if + else + use_c14_streams = .false. + call shr_assert( .not. use_c14_streams , & + msg="ERROR: use_c14_bombspike is false, but use_c14_streams is TRUE", file=sourcefile, line=__LINE__) + call shr_assert( len_trim(atm_c14_filename) == 0, & + msg="ERROR: use_c14_bombspike is false but atm_c14_filename is NOT blank", file=sourcefile, line=__LINE__) + call shr_assert( len_trim(stream_fldfilename_atm_c14) == 0 , & + msg="ERROR: use_c14_bombspike is false but stream_fldfilename_atm_c14 is NOT blank", & + file=sourcefile, line=__LINE__) + end if + + end subroutine CIsoSetControl + + !----------------------------------------------------------------------- + subroutine CIsoLogControl() + ! Log namelist and control settings to output to display what behavior will be + ! + if ( use_c13_timeseries )then + if ( use_c13_streams ) then + call shr_assert( len_trim(stream_fldfilename_atm_c13) /= 0 , & + msg="use_c13_streams is TRUE but stream_fldfilename is blank", file=sourcefile, line=__LINE__) + write(iulog,*) 'C13 atmospheric data will be read in using the streams method from file: '// & + trim(stream_fldfilename_atm_c13) + else if ( len_trim(atm_c13_filename) /= 0 ) then + write(iulog,*) 'C13 atmospheric data will be read in using the CMIP6 time series method from file: '// & + trim(atm_c13_filename) + else + call endrun(msg="use_c13_timeseries is true but use_c13_streams=FALSE and atm_c13_filename is blank", & + file=sourcefile, line=__LINE__) + end if + else + call shr_assert( len_trim(stream_fldfilename_atm_c13) == 0 , & + msg="use_c13_timeseries is FALSE but stream_fldfilename is NOT blank", file=sourcefile, line=__LINE__) + call shr_assert( len_trim(atm_c13_filename) == 0 , & + msg="use_c13_timeseries is FALSE but stream_fldfilename is NOT blank", file=sourcefile, line=__LINE__) + write(iulog,*) 'C13 atmospheric data will be the global constant pre-industrial level' + end if + if ( use_c14_bombspike )then + if ( use_c14_streams ) then + write(iulog,*) 'C14 atmospheric data will be read in using the streams method from file: '// & + trim(stream_fldfilename_atm_c14) + else if ( len_trim(atm_c14_filename) /= 0 ) then + write(iulog,*) 'C14 atmospheric data will be read in using the CMIP6 time series method from file: '// & + trim(atm_c14_filename) + else + call endrun(msg="use_c14_bombspike is true but use_c14_streams=FALSE and atm_c14_filename is blank", & + file=sourcefile, line=__LINE__) + end if + else + call shr_assert( len_trim(stream_fldfilename_atm_c14) == 0 , & + msg="use_c14_bombspike is FALSE but stream_fldfilename is blank", file=sourcefile, line=__LINE__) + call shr_assert( len_trim(atm_c14_filename) == 0 , & + msg="use_c14_bombspike is FALSE but stream_fldfilename is blank", file=sourcefile, line=__LINE__) + write(iulog,*) 'C14 atmospheric data will be global constant pre-industrial level' + end if + + end subroutine CIsoLogControl + + !----------------------------------------------------------------------- + subroutine CIsoCheckNMLInputs() + ! + ! !DESCRIPTION: + ! Check that the namelist inputs are valid + ! + ! + ! !LOCAL VARIABLES: + !----------------------------------------------------------------------- + ! When carbon isotopes are off nothing should be set + if ( .not. use_c13 )then + if ( use_c13_timeseries ) then + call endrun( msg="use_c13 is false but use_c13_timeseries is TRUE " // & + "(use_c13_timeseries can only be TRUE if use_c13 is TRUE)", file=sourcefile, line=__LINE__) + return + end if + end if + if ( .not. use_c14 )then + if ( use_c14_bombspike ) then + call endrun( msg="use_c14 is false but use_c14_bombspike is TRUE " // & + "(use_c14_bombspike can only be TRUE if use_c14 is TRUE)", & + file=sourcefile, line=__LINE__) + return + end if + end if + + ! + ! Check C14 stream namelist inputs + ! + if ( use_c14_bombspike ) then + if ( len_trim(atm_c14_filename) /= 0 .and. len_trim(stream_fldfilename_atm_c14) /= 0 ) then + call endrun(msg="use_c14_bombspike TRUE but both atm_c14_filename AND stream_fldfilename_atm_c14 are set and only one should be", & + file=sourcefile, line=__LINE__) + return + end if + if ( len_trim(atm_c14_filename) == 0 .and. len_trim(stream_fldfilename_atm_c14) == 0 ) then + call endrun(msg="use_c14_bombspike TRUE but neither atm_c14_filename nor stream_fldfilename_atm_c14 are set and one or the other needs to be", & + file=sourcefile, line=__LINE__) + return + end if + else + if ( len_trim(atm_c14_filename) /= 0 .or. len_trim(stream_fldfilename_atm_c14) /= 0 ) then + call endrun(msg="use_c14_bombspike false but either atm_c14_filename or stream_fldfilename_atm_c14 is set and neither should be", & + file=sourcefile, line=__LINE__) + return + end if + end if + ! + ! Check C13 stream namelist inputs + ! + if ( use_c13_timeseries ) then + if ( len_trim(atm_c13_filename) /= 0 .and. len_trim(stream_fldfilename_atm_c13) /= 0 ) then + call endrun(msg="use_c13_timeseries TRUE but both atm_c13_filename AND stream_fldfilename_atm_c13 are set and only one should be", & + file=sourcefile, line=__LINE__) + return + end if + if ( len_trim(atm_c13_filename) == 0 .and. len_trim(stream_fldfilename_atm_c13) == 0 ) then + call endrun(msg="use_c13_timeseries TRUE but neither atm_c13_filename nor stream_fldfilename_atm_c13 are set and one or the other needs to be", & + file=sourcefile, line=__LINE__) + return + end if + else + if ( len_trim(atm_c13_filename) /= 0 .or. len_trim(stream_fldfilename_atm_c13) /= 0 ) then + call endrun(msg="use_c13_timeseries is false but either atm_c13_filename or stream_fldfilename_atm_c13 are set and neither should be", & + file=sourcefile, line=__LINE__) + return + end if + end if + + end subroutine CIsoCheckNMLInputs + + !----------------------------------------------------------------------- + subroutine CIsoSetNMLInputs( stream_fldfilename_atm_c13_in, stream_fldfilename_atm_c14_in, & + use_c13_streams_in, use_c14_streams_in ) + ! + ! !DESCRIPTION: + ! Set the namelist inputs for unit testing + ! + ! Arguments: + character(len=*), intent(in), optional :: stream_fldfilename_atm_c13_in + character(len=*), intent(in), optional :: stream_fldfilename_atm_c14_in + logical, intent(in), optional :: use_c13_streams_in + logical, intent(in), optional :: use_c14_streams_in + ! + ! !LOCAL VARIABLES: + !----------------------------------------------------------------------- + if ( present(stream_fldfilename_atm_c13_in) ) then + stream_fldfilename_atm_c13 = stream_fldfilename_atm_c13_in + end if + if ( present(stream_fldfilename_atm_c14_in) ) then + stream_fldfilename_atm_c14 = stream_fldfilename_atm_c14_in + end if + if ( present(use_c13_streams_in) ) then + use_c13_streams = use_c13_streams_in + end if + if ( present(use_c14_streams_in) ) then + use_c14_streams = use_c14_streams_in + end if + + end subroutine CIsoSetNMLInputs + + + !----------------------------------------------------------------------- + subroutine C14BombSpike( bounds ) ! ! !DESCRIPTION: ! for transient simulation, read in an atmospheric timeseries file to impose bomb spike ! + use GridcellType , only : grc ! !ARGUMENTS: implicit none - real(r8), intent(out) :: rc14_atm(nsectors_c14) ! Ratio of C14 to C12 + type(bounds_type), intent(in) :: bounds ! ! !LOCAL VARIABLES: integer :: yr, mon, day, tod ! year, month, day, time-of-day real(r8) :: dateyear ! Date converted to year real(r8) :: delc14o2_atm(nsectors_c14) ! C14 delta units - integer :: fp, p, nt ! Indices + real(r8) :: rc14_atm(nsectors_c14) ! C14 ratio C14 C12units + integer :: fp, p, nt, g ! Indices integer :: ind_below ! Time index below current time integer :: ntim_atm_ts ! Number of times on file real(r8) :: twt_1, twt_2 ! weighting fractions for interpolating integer :: l ! Loop index of sectors !----------------------------------------------------------------------- - ! get current date - call get_curr_date(yr, mon, day, tod) - dateyear = real(yr) + get_curr_yearfrac() - - ! find points in atm timeseries to interpolate between - ntim_atm_ts = size(atm_c14file_time) - ind_below = 0 - do nt = 1, ntim_atm_ts - if ((dateyear - time_axis_offset) >= atm_c14file_time(nt) ) then - ind_below = ind_below+1 - endif - end do + ! + ! If the bombspike timeseries file is being used, read the file in + ! + if ( use_c14_bombspike )then + + if ( use_c14_streams )then + call C14Streams( bounds ) + RETURN + end if + ! get current date + call get_curr_date(yr, mon, day, tod) + dateyear = real(yr) + get_curr_yearfrac() + + ! find points in atm timeseries to interpolate between + ntim_atm_ts = size(atm_c14file_time) + ind_below = 0 + do nt = 1, ntim_atm_ts + if ((dateyear - time_axis_offset) >= atm_c14file_time(nt) ) then + ind_below = ind_below+1 + endif + end do + + ! loop over lat bands to pass all three to photosynthesis + do l = 1,nsectors_c14 + ! interpolate between nearest two points in atm c14 timeseries + if (ind_below .eq. 0 ) then + delc14o2_atm(l) = atm_delta_c14(l,1) + elseif (ind_below .eq. ntim_atm_ts ) then + delc14o2_atm(l) = atm_delta_c14(l,ntim_atm_ts) + else + twt_2 = min(1._r8, max(0._r8,((dateyear - time_axis_offset)-atm_c14file_time(ind_below)) & + / (atm_c14file_time(ind_below+1)-atm_c14file_time(ind_below)))) + twt_1 = 1._r8 - twt_2 + delc14o2_atm(l) = atm_delta_c14(l,ind_below) * twt_1 + atm_delta_c14(l,ind_below+1) * twt_2 + endif + + ! change delta units to ratio + rc14_atm(l) = (delc14o2_atm(l) * 1.e-3_r8 + 1._r8) * c14ratio + end do + ! + ! When not using a time series file -- use the constant preindustrial value + ! + else + rc14_atm(:) = c14ratio + delc14o2_atm(:) = (rc14_atm(1)/c14ratio -1.0_r8)*1000.0_r8 + endif + ! + ! Now map to the gridcell from the sectors + ! - ! loop over lat bands to pass all three to photosynthesis - do l = 1,nsectors_c14 - ! interpolate between nearest two points in atm c14 timeseries - if (ind_below .eq. 0 ) then - delc14o2_atm(l) = atm_delta_c14(l,1) - elseif (ind_below .eq. ntim_atm_ts ) then - delc14o2_atm(l) = atm_delta_c14(l,ntim_atm_ts) + do g = bounds%begg, bounds%endg + ! determine latitute sector for radiocarbon bomb spike inputs + if ( grc%latdeg(g) >= 30._r8 ) then + l = 1 + else if ( grc%latdeg(g) >= -30._r8 ) then + l = 2 else - twt_2 = min(1._r8, max(0._r8,((dateyear - time_axis_offset)-atm_c14file_time(ind_below)) & - / (atm_c14file_time(ind_below+1)-atm_c14file_time(ind_below)))) - twt_1 = 1._r8 - twt_2 - delc14o2_atm(l) = atm_delta_c14(l,ind_below) * twt_1 + atm_delta_c14(l,ind_below+1) * twt_2 + l = 3 endif - - ! change delta units to ratio - rc14_atm(l) = (delc14o2_atm(l) * 1.e-3_r8 + 1._r8) * c14ratio + atm_delta_c14_grc(g) = delc14o2_atm(l) + rc14_atm_grc(g) = rc14_atm(l) end do - + end subroutine C14BombSpike !----------------------------------------------------------------------- - subroutine C14_init_BombSpike() + subroutine C14Streams( bounds ) + ! Description: + ! + ! Use the streams method to read in atmospheric C14 bomb spike data + ! + ! !ARGUMENTS: + type(bounds_type), intent(in) :: bounds + ! + ! !LOCAL VARIABLES: + !----------------------------------------------------------------------- + integer :: g ! Indices + + call atm_c14_stream%Advance( ) + call atm_c14_stream%Interp( bounds) + + do g = bounds%begg, bounds%endg + atm_delta_c14_grc(g) = atm_c14_stream%atm_delta_c14(g) + rc14_atm_grc(g) = (atm_delta_c14_grc(g) * 1.e-3_r8 + 1._r8) * c14ratio + end do + + end subroutine C14Streams + + !----------------------------------------------------------------------- + subroutine C14_init_BombSpike( bounds ) ! ! !DESCRIPTION: - ! read netcdf file containing a timeseries of atmospheric delta C14 values; save in module-level array + ! read netcdf file containing a timeseries of atmospheric delta C14 values; save in module-level array ! ! !USES: use ncdio_pio , only : ncd_pio_openfile, ncd_pio_closefile, file_desc_t, ncd_inqdlen, ncd_io use fileutils , only : getfil + use shr_infnan_mod, only : nan => shr_infnan_nan, assignment(=) + implicit none + ! Arguments: + type(bounds_type), intent(in) :: bounds ! ! !LOCAL VARIABLES: - implicit none character(len=256) :: locfn ! local file name type(file_desc_t) :: ncid ! netcdf id integer :: dimid,varid ! input netCDF id's @@ -122,116 +475,239 @@ subroutine C14_init_BombSpike() character(len=*), parameter :: vname = 'Delta14co2_in_air' ! Variable name on file !----------------------------------------------------------------------- - call getfil(atm_c14_filename, locfn, 0) - - if ( masterproc ) then - write(iulog, *) 'C14_init_BombSpike: preparing to open file:' - write(iulog, *) trim(locfn) - endif - - call ncd_pio_openfile (ncid, trim(locfn), 0) + ! Allocate the gridcell arrays + ! TODO: This should be below within the use_c14_bombspike if block + allocate(atm_delta_c14_grc(bounds%begg:bounds%endg)) + allocate(rc14_atm_grc(bounds%begg:bounds%endg)) + atm_delta_c14_grc(:) = nan + rc14_atm_grc(:) = nan + ! + ! If the bombspike timeseries file is being used, read the file in + ! + if ( use_c14_bombspike )then + + if ( use_c14_streams )then + write(iulog,*) 'Read in atmospheric C14 data from streams' + call C14StreamsInit( bounds ) + RETURN + end if + if ( .not. use_c14_streams .and. len_trim(atm_c14_filename) == 0 )then + write(iulog,*) 'Use constant preindustrial atmospheric C14 data' + RETURN + end if + + if ( masterproc ) then + write(iulog, *) 'C14_init_BombSpike: preparing to open file:' + write(iulog, *) trim(locfn) + endif - call ncd_inqdlen(ncid,dimid,ntim,'time') - call ncd_inqdlen(ncid,dimid,nsec,'sector') - if ( nsec /= nsectors_c14 )then - call endrun(msg="ERROR: number of sectors on file not what's expected"//errMsg(sourcefile, __LINE__)) + call getfil(atm_c14_filename, locfn, 0) + + call ncd_pio_openfile (ncid, trim(locfn), 0) + + call ncd_inqdlen(ncid,dimid,ntim,'time') + call ncd_inqdlen(ncid,dimid,nsec,'sector') + if ( nsec /= nsectors_c14 )then + call endrun(msg="ERROR: number of sectors on file not what's expected"//errMsg(sourcefile, __LINE__)) + end if + + !! allocate arrays based on size of netcdf timeseries + allocate(atm_c14file_time(ntim)) + allocate(atm_delta_c14(nsectors_c14,ntim)) + atm_delta_c14(:,:) = 0.0_r8 + call ncd_io(ncid=ncid, varname='time', flag='read', data=atm_c14file_time, & + readvar=readvar) + if ( .not. readvar ) then + call endrun(msg="ERROR: time not on file"//errMsg(sourcefile, __LINE__)) + end if + + call ncd_io(ncid=ncid, varname=vname, flag='read', data=atm_delta_c14, & + readvar=readvar) + if ( .not. readvar ) then + call endrun(msg="ERROR: '//vname//' not on file"//errMsg(sourcefile, __LINE__)) + end if + ! Check units + call check_units( ncid, vname, "Modern" ) + call ncd_pio_closefile(ncid) + + ! check to make sure that time dimension is well behaved + do t = 2, ntim + if ( atm_c14file_time(t) - atm_c14file_time(t-1) <= 0._r8 ) then + write(iulog, *) 'C14_init_BombSpike: error. time axis must be monotonically increasing' + call endrun(msg=errMsg(sourcefile, __LINE__)) + endif + end do end if - !! allocate arrays based on size of netcdf timeseries - allocate(atm_c14file_time(ntim)) - allocate(atm_delta_c14(nsectors_c14,ntim)) - atm_delta_c14(:,:) = 0.0_r8 - - call ncd_io(ncid=ncid, varname='time', flag='read', data=atm_c14file_time, & - readvar=readvar) - if ( .not. readvar ) then - call endrun(msg="ERROR: time not on file"//errMsg(sourcefile, __LINE__)) - end if + end subroutine C14_init_BombSpike - call ncd_io(ncid=ncid, varname=vname, flag='read', data=atm_delta_c14, & - readvar=readvar) - if ( .not. readvar ) then - call endrun(msg="ERROR: '//vname//' not on file"//errMsg(sourcefile, __LINE__)) - end if - ! Check units - call check_units( ncid, vname, "Modern" ) - call ncd_pio_closefile(ncid) - - ! check to make sure that time dimension is well behaved - do t = 2, ntim - if ( atm_c14file_time(t) - atm_c14file_time(t-1) <= 0._r8 ) then - write(iulog, *) 'C14_init_BombSpike: error. time axis must be monotonically increasing' - call endrun(msg=errMsg(sourcefile, __LINE__)) - endif - end do - end subroutine C14_init_BombSpike + !----------------------------------------------------------------------- + subroutine C14StreamsInit( bounds ) + ! Description: + ! + ! Initialize the streams method to read in atmospheric C14 bomb spike data + ! + ! !ARGUMENTS: + type(bounds_type), intent(in) :: bounds + ! + ! !LOCAL VARIABLES: + !----------------------------------------------------------------------- + if ( masterproc ) then + write(iulog, *) 'C14StreamsInit: Initializing C14 streams with file:' + write(iulog, *) trim(stream_fldfilename_atm_c14) + end if + ! Streams method + call atm_c14_stream%Init( bounds, & + fldfilename=stream_fldfilename_atm_c14, & + meshfile= 'none', & + mapalgo=stream_mapalgo_atm_c14, & + tintalgo=stream_tintalgo_atm_c14, & + taxmode=stream_taxmode_atm_c14, & + year_first=stream_year_first_atm_c14, & + year_last=stream_year_last_atm_c14, & + model_year_align=stream_model_year_align_atm_c14 ) + call atm_c14_stream%Advance( ) + call atm_c14_stream%Interp( bounds ) + + end subroutine C14StreamsInit !----------------------------------------------------------------------- - subroutine C13TimeSeries( rc13_atm ) + subroutine C13TimeSeries( bounds, atm2lnd_inst ) ! ! !DESCRIPTION: ! for transient pulse simulation, impose a time-varying atm boundary condition ! + use GridcellType , only : grc + use clm_varcon , only : preind_atm_del13c + use atm2lndType, only : atm2lnd_Type ! !ARGUMENTS: implicit none - real(r8), intent(out) :: rc13_atm ! Ratio of C13 to C12 + type(bounds_type), intent(in) :: bounds + type(atm2lnd_Type), intent(in) :: atm2lnd_inst ! ! !LOCAL VARIABLES: + real(r8) :: rc13_atm ! Ratio of C13 to C12 integer :: yr, mon, day, tod ! year, month, day, time-of-day real(r8) :: dateyear ! date translated to year real(r8) :: delc13o2_atm ! Delta C13 - integer :: fp, p, nt ! Indices + integer :: fp, p, nt, g ! Indices integer :: ind_below ! Index of time in file before current time integer :: ntim_atm_ts ! Number of times on file real(r8) :: twt_1, twt_2 ! weighting fractions for interpolating !----------------------------------------------------------------------- - ! get current date - call get_curr_date(yr, mon, day, tod) - dateyear = real(yr) + get_curr_yearfrac() - - ! find points in atm timeseries to interpolate between - ntim_atm_ts = size(atm_c13file_time) - ind_below = 0 - do nt = 1, ntim_atm_ts - if ((dateyear - time_axis_offset) >= atm_c13file_time(nt) ) then - ind_below = ind_below+1 - endif - end do + ! + ! If the timeseries file is being used, read the file in + ! + if ( use_c13_timeseries )then + + if ( use_c13_streams )then + call C13Streams( bounds ) + RETURN + end if + if ( .not. use_c13_streams .and. len_trim(atm_c13_filename) == 0 )then + write(iulog,*) 'Use constant preindustrial atmospheric C13 data' + RETURN + end if + ! get current date + call get_curr_date(yr, mon, day, tod) + dateyear = real(yr) + get_curr_yearfrac() + + ! find points in atm timeseries to interpolate between + ntim_atm_ts = size(atm_c13file_time) + ind_below = 0 + do nt = 1, ntim_atm_ts + if ((dateyear - time_axis_offset) >= atm_c13file_time(nt) ) then + ind_below = ind_below+1 + endif + end do + + ! interpolate between nearest two points in atm c13 timeseries + ! cdknotes. for now and for simplicity, just use the northern hemisphere values (sector 1) + if (ind_below .eq. 0 ) then + delc13o2_atm = atm_delta_c13(1) + elseif (ind_below .eq. ntim_atm_ts ) then + delc13o2_atm = atm_delta_c13(ntim_atm_ts) + else + twt_2 = min(1._r8, max(0._r8,((dateyear - time_axis_offset)-atm_c13file_time(ind_below)) & + / (atm_c13file_time(ind_below+1)-atm_c13file_time(ind_below)))) + twt_1 = 1._r8 - twt_2 + delc13o2_atm = atm_delta_c13(ind_below) * twt_1 + atm_delta_c13(ind_below+1) * twt_2 + endif - ! interpolate between nearest two points in atm c13 timeseries - ! cdknotes. for now and for simplicity, just use the northern hemisphere values (sector 1) - if (ind_below .eq. 0 ) then - delc13o2_atm = atm_delta_c13(1) - elseif (ind_below .eq. ntim_atm_ts ) then - delc13o2_atm = atm_delta_c13(ntim_atm_ts) + ! + ! When not using a time series file -- use the constant value + ! else - twt_2 = min(1._r8, max(0._r8,((dateyear - time_axis_offset)-atm_c13file_time(ind_below)) & - / (atm_c13file_time(ind_below+1)-atm_c13file_time(ind_below)))) - twt_1 = 1._r8 - twt_2 - delc13o2_atm = atm_delta_c13(ind_below) * twt_1 + atm_delta_c13(ind_below+1) * twt_2 - endif + rc13_atm = c13ratio + delc13o2_atm = (rc13_atm/SHR_CONST_PDB - 1.0_r8)*1000.0_r8 + end if ! change delta units to ratio, put on patch loop rc13_atm = (delc13o2_atm * 1.e-3_r8 + 1._r8) * SHR_CONST_PDB + ! + ! Copy to the gridcell arrays + ! + do g = bounds%begg, bounds%endg + + associate( & + forc_pco2 => atm2lnd_inst%forc_pco2_grc , & ! Input: [real(r8) (:) ] partial pressure co2 (Pa) + forc_pc13o2 => atm2lnd_inst%forc_pc13o2_grc & ! Input: [real(r8) (:) ] partial pressure c13o2 (Pa) + ) + rc13_atm_grc(g) = rc13_atm + atm_delta_c13_grc(g) = delc13o2_atm + + ! Currently when C13 is fixed, it's dependent on CO2 levels and changes with pressure + ! NOTE: This duplicates code in lnd_import_export.F90 + if ( .not. use_c13_timeseries )then + rc13_atm_grc(g) = forc_pc13o2(g)/(forc_pco2(g) - forc_pc13o2(g)) + atm_delta_c13_grc(g) = (rc13_atm_grc(g) / SHR_CONST_PDB - 1.0_r8)*1000.0_r8 + end if + end associate + end do + end subroutine C13TimeSeries !----------------------------------------------------------------------- - subroutine C13_init_TimeSeries() + subroutine C13Streams( bounds ) + ! Description: + ! + ! Use the streams method to read in atmospheric C13 data + ! + ! !ARGUMENTS: + type(bounds_type), intent(in) :: bounds + ! + ! !LOCAL VARIABLES: + integer :: g ! Indices + + call atm_c13_stream%Interp( bounds) + + do g = bounds%begg, bounds%endg + atm_delta_c13_grc(g) = atm_c13_stream%atm_delta_c13(g) + rc13_atm_grc(g) = (atm_delta_c13_grc(g) * 1.e-3_r8 + 1._r8) * SHR_CONST_PDB + end do + + end subroutine C13Streams + + !----------------------------------------------------------------------- + subroutine C13_init_TimeSeries( bounds ) ! ! !DESCRIPTION: - ! read netcdf file containing a timeseries of atmospheric delta C13 values; save in module-level array + ! read netcdf file containing a timeseries of atmospheric delta C13 values; save in module-level array ! ! !USES: use ncdio_pio , only : ncd_pio_openfile, ncd_pio_closefile, file_desc_t, ncd_inqdlen, ncd_io use fileutils , only : getfil + use shr_infnan_mod, only : nan => shr_infnan_nan, assignment(=) + implicit none ! + ! Arguments: + type(bounds_type), intent(in) :: bounds ! !LOCAL VARIABLES: - implicit none character(len=256) :: locfn ! local file name type(file_desc_t) :: ncid ! netcdf id integer :: dimid,varid ! input netCDF id's @@ -241,47 +717,96 @@ subroutine C13_init_TimeSeries() character(len=*), parameter :: vname = 'delta13co2_in_air' ! Variable name on file !----------------------------------------------------------------------- - call getfil(atm_c13_filename, locfn, 0) + ! TODO: This should be below within the use_c13_timeseries if block + ! Allocate the gridcell arrays + allocate(atm_delta_c13_grc(bounds%begg:bounds%endg) ) + allocate(rc13_atm_grc(bounds%begg:bounds%endg) ) + atm_delta_c13_grc(:) = nan + rc13_atm_grc(:) = nan + ! + ! If the timeseries file is being used, read the file in + ! + if ( use_c13_timeseries )then - if ( masterproc ) then - write(iulog, *) 'C13_init_TimeSeries: preparing to open file:' - write(iulog, *) trim(locfn) - endif + if ( use_c13_streams )then + call C13StreamsInit( bounds ) + RETURN + end if - call ncd_pio_openfile (ncid, trim(locfn), 0) + call getfil(atm_c13_filename, locfn, 0) - call ncd_inqdlen(ncid,dimid,ntim,'time') + if ( masterproc ) then + write(iulog, *) 'C13_init_TimeSeries: preparing to open file:' + write(iulog, *) trim(locfn) + endif - !! allocate arrays based on size of netcdf timeseries - allocate(atm_c13file_time(ntim)) - allocate(atm_delta_c13(ntim)) + call ncd_pio_openfile (ncid, trim(locfn), 0) - call ncd_io(ncid=ncid, varname='time', flag='read', data=atm_c13file_time, & - readvar=readvar) - if ( .not. readvar ) then - call endrun(msg="ERROR: time not on file"//errMsg(sourcefile, __LINE__)) - end if + call ncd_inqdlen(ncid,dimid,ntim,'time') - call ncd_io(ncid=ncid, varname=vname, flag='read', data=atm_delta_c13, & - readvar=readvar) - if ( .not. readvar ) then - call endrun(msg="ERROR: '//vname//' not on file"//errMsg(sourcefile, __LINE__)) - end if + !! allocate arrays based on size of netcdf timeseries + allocate(atm_c13file_time(ntim)) + allocate(atm_delta_c13(ntim)) - ! Check units - call check_units( ncid, vname, "VPDB" ) - call ncd_pio_closefile(ncid) - ! check to make sure that time dimension is well behaved - do t = 2, ntim - if ( atm_c13file_time(t) - atm_c13file_time(t-1) <= 0._r8 ) then - write(iulog, *) 'C13_init_TimeSeries: error. time axis must be monotonically increasing' - call endrun(msg=errMsg(sourcefile, __LINE__)) - endif - end do + call ncd_io(ncid=ncid, varname='time', flag='read', data=atm_c13file_time, & + readvar=readvar) + if ( .not. readvar ) then + call endrun(msg="ERROR: time not on file"//errMsg(sourcefile, __LINE__)) + end if + + call ncd_io(ncid=ncid, varname=vname, flag='read', data=atm_delta_c13, & + readvar=readvar) + if ( .not. readvar ) then + call endrun(msg="ERROR: '//vname//' not on file"//errMsg(sourcefile, __LINE__)) + end if + + ! Check units + call check_units( ncid, vname, "VPDB" ) + call ncd_pio_closefile(ncid) + + ! check to make sure that time dimension is well behaved + do t = 2, ntim + if ( atm_c13file_time(t) - atm_c13file_time(t-1) <= 0._r8 ) then + write(iulog, *) 'C13_init_TimeSeries: error. time axis must be monotonically increasing' + call endrun(msg=errMsg(sourcefile, __LINE__)) + endif + end do + end if end subroutine C13_init_TimeSeries + !----------------------------------------------------------------------- + subroutine C13StreamsInit( bounds ) + ! Description: + ! + ! Initialize the streams method to read in atmospheric C13 data + ! + ! !ARGUMENTS: + type(bounds_type), intent(in) :: bounds + ! + ! !LOCAL VARIABLES: + !----------------------------------------------------------------------- + + if ( masterproc ) then + write(iulog, *) 'C13StreamsInit: Initializing C13 streams with file:' + write(iulog, *) trim(stream_fldfilename_atm_c13) + end if + ! Streams method + call atm_c13_stream%Init( bounds, & + fldfilename=stream_fldfilename_atm_c13, & + meshfile= 'none', & + mapalgo=stream_mapalgo_atm_c13, & + tintalgo=stream_tintalgo_atm_c13, & + taxmode=stream_taxmode_atm_c13, & + year_first=stream_year_first_atm_c13, & + year_last=stream_year_last_atm_c13, & + model_year_align=stream_model_year_align_atm_c13 ) + call atm_c13_stream%Advance( ) + call atm_c13_stream%Interp( bounds ) + + end subroutine C13StreamsInit + !----------------------------------------------------------------------- subroutine check_units( ncid, vname, relativeto ) ! diff --git a/src/biogeochem/test/CIsoAtmTimeSeries_test/CMakeLists.txt b/src/biogeochem/test/CIsoAtmTimeSeries_test/CMakeLists.txt new file mode 100644 index 0000000000..9a9885508c --- /dev/null +++ b/src/biogeochem/test/CIsoAtmTimeSeries_test/CMakeLists.txt @@ -0,0 +1,11 @@ +set(pfunit_sources + test_CIsoAtmTimeSeries.pf) + +add_pfunit_ctest(CIsoAtmTimeSeries + TEST_SOURCES "${pfunit_sources}" + LINK_LIBRARIES clm csm_share) + +# I don't think we need esmf here +# LINK_LIBRARIES clm csm_share esmf +# EXTRA_FINALIZE unittest_finalize_esmf +# EXTRA_USE unittestInitializeAndFinalize) diff --git a/src/biogeochem/test/CIsoAtmTimeSeries_test/test_CIsoAtmTimeSeries.pf b/src/biogeochem/test/CIsoAtmTimeSeries_test/test_CIsoAtmTimeSeries.pf new file mode 100644 index 0000000000..01866b7617 --- /dev/null +++ b/src/biogeochem/test/CIsoAtmTimeSeries_test/test_CIsoAtmTimeSeries.pf @@ -0,0 +1,277 @@ +module test_CIsoAtmTimeSeries + + ! Tests of CNCIsoAtmTimeSeriesReadMod + + use funit + use CIsoAtmTimeSeriesMod + use shr_kind_mod , only : r8 => shr_kind_r8 + use clm_varctl, only : use_c13, use_c14 + + implicit none + + @TestCase + type, extends(TestCase) :: TestCIsoAtmTimeSeries + contains + procedure :: setUp + procedure :: tearDown + end type TestCIsoAtmTimeSeries + + character(len=200) :: expected_msg + +contains + + subroutine setUp(this) + class(TestCIsoAtmTimeSeries), intent(inout) :: this + + use_c13 = .true. + use_c14 = .true. + use_c13_timeseries = .true. + use_c14_bombspike = .true. + ! Set these filenames to /dev/null as it's a file guaranteed to exist on Linux systems + atm_c13_filename = '/dev/null' + atm_c14_filename = '/dev/null' + + end subroutine setUp + + subroutine tearDown(this) + class(TestCIsoAtmTimeSeries), intent(inout) :: this + + end subroutine tearDown + + @Test + subroutine check_both_timeseries_on(this) + ! Check that it works when both timeseries are on without using streams + class(TestCIsoAtmTimeSeries), intent(inout) :: this + + call CIsoCheckNMLInputs() + call CIsoSetControl() + call CIsoLogControl() + + end subroutine check_both_timeseries_on + + @Test + subroutine check_both_timeseries_streams_on(this) + ! Check that it works when both timeseries are on and using streams + class(TestCIsoAtmTimeSeries), intent(inout) :: this + + atm_c13_filename = '' + atm_c14_filename = '' + call CIsoSetNMLInputs( stream_fldfilename_atm_c13_in = '/dev/null', & + stream_fldfilename_atm_c14_in = '/dev/null' ) + call CIsoCheckNMLInputs() + call CIsoSetControl() + call CIsoLogControl() + + end subroutine check_both_timeseries_streams_on + + @Test + subroutine check_both_timeseries_off(this) + ! Check that it works when both timeseries are off + class(TestCIsoAtmTimeSeries), intent(inout) :: this + + atm_c13_filename = '' + atm_c14_filename = '' + use_c13_timeseries = .false. + use_c14_bombspike = .false. + call CIsoSetNMLInputs( stream_fldfilename_atm_c13_in = ' ', & + stream_fldfilename_atm_c14_in = ' ' ) + call CIsoCheckNMLInputs() + call CIsoSetControl() + call CIsoLogControl() + + end subroutine check_both_timeseries_off + + @Test + subroutine check_ciso_off(this) + ! Check that it works when both carbon isotopes are off + class(TestCIsoAtmTimeSeries), intent(inout) :: this + + atm_c13_filename = '' + atm_c14_filename = '' + use_c13_timeseries = .false. + use_c14_bombspike = .false. + use_c13 = .false. + use_c14 = .false. + call CIsoSetNMLInputs( stream_fldfilename_atm_c13_in = ' ', & + stream_fldfilename_atm_c14_in = ' ' ) + call CIsoCheckNMLInputs() + call CIsoSetControl() + call CIsoLogControl() + + end subroutine check_ciso_off + + @Test + subroutine abort_if_both_c13_plain_and_stream_timeseries_files_set(this) + ! Check that it aborts if both the plain and stream C13 timeseries files are set + class(TestCIsoAtmTimeSeries), intent(inout) :: this + + @assertTrue(use_c13) + @assertTrue(use_c13_timeseries) + atm_c13_filename = 'plain_c13_timeseries_file' + @assertTrue(use_c14) + @assertTrue(use_c14_bombspike) + @assertTrue(len_trim(atm_c14_filename) /= 0) + call CIsoSetNMLInputs( stream_fldfilename_atm_c13_in = 'stream_c13_timeseries_file', stream_fldfilename_atm_c14_in = ' ') + call CIsoCheckNMLInputs() + expected_msg = "ABORTED: use_c13_timeseries TRUE but both atm_c13_filename AND stream_fldfilename_atm_c13 are set and only one should be" + @assertExceptionRaised(expected_msg) + + end subroutine abort_if_both_c13_plain_and_stream_timeseries_files_set + + @Test + subroutine abort_if_both_c14_plain_and_stream_timeseries_files_set(this) + ! Check that it aborts if both the plain and stream C14 timeseries files are set + class(TestCIsoAtmTimeSeries), intent(inout) :: this + + @assertTrue(use_c14) + @assertTrue(use_c14_bombspike) + atm_c14_filename = 'plain_c14_timeseries_file' + call CIsoSetNMLInputs( stream_fldfilename_atm_c14_in = 'stream_c14_timeseries_file' ) + call CIsoCheckNMLInputs() + expected_msg = "ABORTED: use_c14_bombspike TRUE but both atm_c14_filename AND stream_fldfilename_atm_c14 are set and only one should be" + @assertExceptionRaised(expected_msg) + + end subroutine abort_if_both_c14_plain_and_stream_timeseries_files_set + + @Test + subroutine abort_if_both_c13_plain_and_stream_timeseries_files_blank(this) + ! Check that it aborts if both the plain and stream C13 timeseries files are blank + class(TestCIsoAtmTimeSeries), intent(inout) :: this + + @assertTrue(use_c13) + @assertTrue(use_c13_timeseries) + atm_c13_filename = ' ' + @assertTrue(use_c14) + @assertTrue(use_c14_bombspike) + @assertTrue(len_trim(atm_c14_filename) /= 0) + call CIsoSetNMLInputs( stream_fldfilename_atm_c13_in = ' ', stream_fldfilename_atm_c14_in = ' ') + call CIsoCheckNMLInputs() + expected_msg = "ABORTED: use_c13_timeseries TRUE but neither atm_c13_filename nor stream_fldfilename_atm_c13 are set and one or the other needs to be" + @assertExceptionRaised(expected_msg) + + end subroutine abort_if_both_c13_plain_and_stream_timeseries_files_blank + + @Test + subroutine abort_if_both_c14_plain_and_stream_timeseries_files_blank(this) + ! Check that it aborts if both the plain and stream C14 timeseries files are blank + class(TestCIsoAtmTimeSeries), intent(inout) :: this + @assertTrue(use_c14) + @assertTrue(use_c14_bombspike) + atm_c14_filename = ' ' + call CIsoSetNMLInputs( stream_fldfilename_atm_c14_in = ' ' ) + call CIsoCheckNMLInputs() + expected_msg = "ABORTED: use_c14_bombspike TRUE but neither atm_c14_filename nor stream_fldfilename_atm_c14 are set and one or the other needs to be" + @assertExceptionRaised(expected_msg) + + end subroutine abort_if_both_c14_plain_and_stream_timeseries_files_blank + + @Test + subroutine abort_if_c13_timeseries_off_and_plain_timeseries_file_set(this) + ! Check that it aborts if c13 timeseries off, but the plain timeseries file is set + class(TestCIsoAtmTimeSeries), intent(inout) :: this + + @assertTrue(use_c13) + use_c13_timeseries = .false. + @assertFalse(use_c13_timeseries) + atm_c13_filename = 'plain_c13_timeseries_file' + call CIsoSetNMLInputs( stream_fldfilename_atm_c13_in = ' ' ) + call CIsoCheckNMLInputs() + expected_msg = "ABORTED: use_c13_timeseries is false but either atm_c13_filename or stream_fldfilename_atm_c13 are set and neither should be" + @assertExceptionRaised(expected_msg) + + end subroutine abort_if_c13_timeseries_off_and_plain_timeseries_file_set + + @Test + subroutine abort_if_c13_timeseries_off_and_stream_timeseries_file_set(this) + ! Check that it aborts if c13 timeseries off, but the streamplain timeseries file is set + class(TestCIsoAtmTimeSeries), intent(inout) :: this + + @assertTrue(use_c13) + use_c13_timeseries = .false. + @assertFalse(use_c13_timeseries) + atm_c13_filename = ' ' + call CIsoSetNMLInputs( stream_fldfilename_atm_c13_in = 'stream_c13_filename ' ) + call CIsoCheckNMLInputs() + expected_msg = "ABORTED: use_c13_timeseries is false but either atm_c13_filename or stream_fldfilename_atm_c13 are set and neither should be" + @assertExceptionRaised(expected_msg) + + end subroutine abort_if_c13_timeseries_off_and_stream_timeseries_file_set + + @Test + subroutine abort_if_c14_bombspike_off_and_plain_timeseries_file_set(this) + ! Check that it aborts if c14 timeseries off, but the pain timeseries file is set + class(TestCIsoAtmTimeSeries), intent(inout) :: this + integer :: i + + ! This should be true whether C14 is on or off + do i = 1, 2 + if ( i == 1 ) then + @assertTrue(use_c14) + else + use_c14 = .false. + end if + use_c14_bombspike = .false. + atm_c14_filename = 'plain_c14_timeseries_file' + call CIsoSetNMLInputs( stream_fldfilename_atm_c14_in = ' ' ) + call CIsoCheckNMLInputs() + expected_msg = "ABORTED: use_c14_bombspike false but either atm_c14_filename or stream_fldfilename_atm_c14 is set and neither should be" + @assertExceptionRaised(expected_msg) + end do + + end subroutine abort_if_c14_bombspike_off_and_plain_timeseries_file_set + + @Test + subroutine abort_if_c14_bombspike_off_and_stream_timeseries_file_set(this) + ! Check that it aborts if c14 timeseries off, but the stream timeseries file is set + class(TestCIsoAtmTimeSeries), intent(inout) :: this + integer :: i + + ! This should be true whether C14 is on or off + do i = 1, 2 + if ( i == 1 ) then + @assertTrue(use_c14) + else + use_c14 = .false. + end if + use_c14_bombspike = .false. + atm_c14_filename = ' ' + call CIsoSetNMLInputs( stream_fldfilename_atm_c14_in = 'stream_c14_filename' ) + call CIsoCheckNMLInputs() + expected_msg = "ABORTED: use_c14_bombspike false but either atm_c14_filename or stream_fldfilename_atm_c14 is set and neither should be" + @assertExceptionRaised(expected_msg) + end do + + end subroutine abort_if_c14_bombspike_off_and_stream_timeseries_file_set + + @Test + subroutine abort_if_c13_off_but_c13_timeseries_on(this) + ! Check that it aborts if c13 is off, but the c13 timeseries is on + class(TestCIsoAtmTimeSeries), intent(inout) :: this + + use_c13 = .false. + use_c13_timeseries = .true. + atm_c13_filename = ' ' + call CIsoSetNMLInputs( stream_fldfilename_atm_c13_in = ' ' ) + call CIsoCheckNMLInputs() + expected_msg = "ABORTED: use_c13 is false but use_c13_timeseries is TRUE (use_c13_timeseries can only be TRUE if use_c13 is TRUE)" + @assertExceptionRaised(expected_msg) + + end subroutine abort_if_c13_off_but_c13_timeseries_on + + @Test + subroutine abort_if_c14_off_but_c14_bombspike_on(this) + ! Check that it aborts if c14 is off, but the c14 bombspike is on + class(TestCIsoAtmTimeSeries), intent(inout) :: this + + use_c14 = .false. + @assertFalse(use_c14) + use_c14_bombspike = .true. + atm_c14_filename = ' ' + call CIsoSetNMLInputs( stream_fldfilename_atm_c14_in = ' ' ) + call CIsoCheckNMLInputs() + expected_msg = "ABORTED: use_c14 is false but use_c14_bombspike is TRUE (use_c14_bombspike can only be TRUE if use_c14 is TRUE)" + @assertExceptionRaised(expected_msg) + + end subroutine abort_if_c14_off_but_c14_bombspike_on + +end module test_CIsoAtmTimeSeries diff --git a/src/biogeochem/test/CMakeLists.txt b/src/biogeochem/test/CMakeLists.txt index 2ebe27c76f..e47e2429b6 100644 --- a/src/biogeochem/test/CMakeLists.txt +++ b/src/biogeochem/test/CMakeLists.txt @@ -1,4 +1,5 @@ add_subdirectory(Species_test) +add_subdirectory(CIsoAtmTimeSeries_test) add_subdirectory(CNVegComputeSeed_test) add_subdirectory(CNPhenology_test) add_subdirectory(Latbaset_test) diff --git a/src/biogeophys/CanopyFluxesMod.F90 b/src/biogeophys/CanopyFluxesMod.F90 index afe665e6d1..3b0d990b21 100644 --- a/src/biogeophys/CanopyFluxesMod.F90 +++ b/src/biogeophys/CanopyFluxesMod.F90 @@ -13,7 +13,7 @@ module CanopyFluxesMod use shr_kind_mod , only : r8 => shr_kind_r8 use shr_log_mod , only : errMsg => shr_log_errMsg use abortutils , only : endrun - use clm_varctl , only : iulog, use_cn, use_lch4, use_c13, use_c14, use_cndv, use_fates, & + use clm_varctl , only : iulog, use_cn, use_lch4, use_c13, use_cndv, use_fates, & use_luna, use_hydrstress, use_biomass_heat_storage, z0param_method use clm_varpar , only : nlevgrnd, nlevsno, nlevcan, mxpft use pftconMod , only : pftcon @@ -229,7 +229,7 @@ subroutine CanopyFluxes(bounds, num_exposedvegp, filter_exposedvegp, use clm_time_manager , only : get_step_size_real, get_prev_date, is_near_local_noon use clm_varcon , only : sb, cpair, hvap, vkc, grav, denice, c_to_b use clm_varcon , only : denh2o, tfrz, tlsai_crit, alpha_aero - use clm_varcon , only : c14ratio, spval + use clm_varcon , only : spval use clm_varcon , only : c_water, c_dry_biomass, c_to_b use clm_varcon , only : nu_param, cd1_param use perf_mod , only : t_startf, t_stopf @@ -354,7 +354,6 @@ subroutine CanopyFluxes(bounds, num_exposedvegp, filter_exposedvegp, real(r8) :: err(bounds%begp:bounds%endp) ! balance error real(r8) :: erre ! balance error real(r8) :: co2(bounds%begp:bounds%endp) ! atmospheric co2 partial pressure (pa) - real(r8) :: c13o2(bounds%begp:bounds%endp) ! atmospheric c13o2 partial pressure (pa) real(r8) :: o2(bounds%begp:bounds%endp) ! atmospheric o2 partial pressure (pa) real(r8) :: svpts(bounds%begp:bounds%endp) ! saturation vapor pressure at t_veg (pa) real(r8) :: eah(bounds%begp:bounds%endp) ! canopy air vapor pressure (pa) @@ -479,7 +478,6 @@ subroutine CanopyFluxes(bounds, num_exposedvegp, filter_exposedvegp, forc_u => atm2lnd_inst%forc_u_grc , & ! Input: [real(r8) (:) ] atmospheric wind speed in east direction (m/s) forc_v => atm2lnd_inst%forc_v_grc , & ! Input: [real(r8) (:) ] atmospheric wind speed in north direction (m/s) forc_pco2 => atm2lnd_inst%forc_pco2_grc , & ! Input: [real(r8) (:) ] partial pressure co2 (Pa) - forc_pc13o2 => atm2lnd_inst%forc_pc13o2_grc , & ! Input: [real(r8) (:) ] partial pressure c13o2 (Pa) forc_po2 => atm2lnd_inst%forc_po2_grc , & ! Input: [real(r8) (:) ] partial pressure o2 (Pa) tc_ref2m => humanindex_inst%tc_ref2m_patch , & ! Output: [real(r8) (:) ] 2 m height surface air temperature (C) @@ -961,10 +959,6 @@ subroutine CanopyFluxes(bounds, num_exposedvegp, filter_exposedvegp, co2(p) = forc_pco2(g) o2(p) = forc_po2(g) - if ( use_c13 ) then - c13o2(p) = forc_pc13o2(g) - end if - ! Initialize flux profile nmozsgn(p) = 0 @@ -1645,7 +1639,7 @@ subroutine CanopyFluxes(bounds, num_exposedvegp, filter_exposedvegp, ! Determine total photosynthesis - call PhotosynthesisTotal(fn, filterp, & + call PhotosynthesisTotal(bounds, fn, filterp, & atm2lnd_inst, canopystate_inst, photosyns_inst) ! Calculate water use efficiency diff --git a/src/biogeophys/PhotosynthesisMod.F90 b/src/biogeophys/PhotosynthesisMod.F90 index b88fb170c7..098144446d 100644 --- a/src/biogeophys/PhotosynthesisMod.F90 +++ b/src/biogeophys/PhotosynthesisMod.F90 @@ -1,4 +1,4 @@ -module PhotosynthesisMod +module PhotosynthesisMod #include "shr_assert.h" @@ -21,7 +21,6 @@ module PhotosynthesisMod use decompMod , only : bounds_type, subgrid_level_patch use QuadraticMod , only : quadratic use pftconMod , only : pftcon - use CIsoAtmTimeseriesMod, only : C14BombSpike, use_c14_bombspike, C13TimeSeries, use_c13_timeseries, nsectors_c14 use atm2lndType , only : atm2lnd_type use CanopyStateType , only : canopystate_type use CNVegnitrogenstateType, only : cnveg_nitrogenstate_type @@ -1257,7 +1256,7 @@ subroutine Photosynthesis ( bounds, fn, filterp, & use clm_varcon , only : rgas, tfrz, spval use GridcellType , only : grc use clm_time_manager , only : get_step_size_real, is_near_local_noon - use clm_varctl , only : cnallocate_carbon_only + use clm_varctl , only : allocate_carbon_only use clm_varctl , only : lnc_opt, reduce_dayl_factor, vcmax_opt use pftconMod , only : nbrdlf_dcd_tmp_shrub @@ -1642,7 +1641,7 @@ subroutine Photosynthesis ( bounds, fn, filterp, & if (.not. use_cn) then vcmax25top = vcmax25top * fnitr(patch%itype(p)) else - if ( CNAllocate_Carbon_only() ) vcmax25top = vcmax25top * fnitr(patch%itype(p)) + if ( Allocate_Carbon_only() ) vcmax25top = vcmax25top * fnitr(patch%itype(p)) end if else if (vcmax_opt == 3) then vcmax25top = ( i_vcad(patch%itype(p)) + s_vcad(patch%itype(p)) * lnc(p) ) * dayl_factor(p) @@ -2063,12 +2062,15 @@ subroutine Photosynthesis ( bounds, fn, filterp, & end subroutine Photosynthesis !------------------------------------------------------------------------------ - subroutine PhotosynthesisTotal (fn, filterp, & + subroutine PhotosynthesisTotal (bounds, fn, filterp, & atm2lnd_inst, canopystate_inst, photosyns_inst) ! ! Determine total photosynthesis ! + use CIsoAtmTimeseriesMod, only : C14BombSpike, C13TimeSeries + use CIsoAtmTimeseriesMod, only : rc13_atm_grc, rc14_atm_grc ! !ARGUMENTS: + type(bounds_type) , intent(in) :: bounds integer , intent(in) :: fn ! size of pft filter integer , intent(in) :: filterp(fn) ! patch filter type(atm2lnd_type) , intent(in) :: atm2lnd_inst @@ -2078,13 +2080,10 @@ subroutine PhotosynthesisTotal (fn, filterp, & ! !LOCAL VARIABLES: integer :: f,fp,p,l,g ! indices - real(r8) :: rc14_atm(nsectors_c14), rc13_atm - integer :: sector_c14 !----------------------------------------------------------------------- associate( & forc_pco2 => atm2lnd_inst%forc_pco2_grc , & ! Input: [real(r8) (:) ] partial pressure co2 (Pa) - forc_pc13o2 => atm2lnd_inst%forc_pc13o2_grc , & ! Input: [real(r8) (:) ] partial pressure c13o2 (Pa) forc_po2 => atm2lnd_inst%forc_po2_grc , & ! Input: [real(r8) (:) ] partial pressure o2 (Pa) laisun => canopystate_inst%laisun_patch , & ! Input: [real(r8) (:) ] sunlit leaf area @@ -2114,19 +2113,10 @@ subroutine PhotosynthesisTotal (fn, filterp, & fpsn_wp => photosyns_inst%fpsn_wp_patch & ! Output: [real(r8) (:) ] product-limited photosynthesis (umol CO2 /m**2 /s) ) - if ( use_c14 ) then - if (use_c14_bombspike) then - call C14BombSpike(rc14_atm) - else - rc14_atm(:) = c14ratio - end if - end if - - if ( use_c13 ) then - if (use_c13_timeseries) then - call C13TimeSeries(rc13_atm) - end if - end if + ! Get the current C13/C14 ratio in the atmosphere from timeseries data or the fixed values + ! These calls fill the data: rc13_atm_grc and rc14_atm_grc + if ( use_c14 ) call C14BombSpike(bounds) + if ( use_c13 ) call C13TimeSeries(bounds, atm2lnd_inst) do f = 1, fn p = filterp(f) @@ -2141,11 +2131,7 @@ subroutine PhotosynthesisTotal (fn, filterp, & if (use_cn) then if ( use_c13 ) then - if (use_c13_timeseries) then - rc13_canair(p) = rc13_atm - else - rc13_canair(p) = forc_pc13o2(g)/(forc_pco2(g) - forc_pc13o2(g)) - endif + rc13_canair(p) = rc13_atm_grc(g) rc13_psnsun(p) = rc13_canair(p)/alphapsnsun(p) rc13_psnsha(p) = rc13_canair(p)/alphapsnsha(p) c13_psnsun(p) = psnsun(p) * (rc13_psnsun(p)/(1._r8+rc13_psnsun(p))) @@ -2157,19 +2143,10 @@ subroutine PhotosynthesisTotal (fn, filterp, & endif if ( use_c14 ) then - ! determine latitute sector for radiocarbon bomb spike inputs - if ( grc%latdeg(g) .ge. 30._r8 ) then - sector_c14 = 1 - else if ( grc%latdeg(g) .ge. -30._r8 ) then - sector_c14 = 2 - else - sector_c14 = 3 - endif - - rc14_canair(p) = rc14_atm(sector_c14) + rc14_canair(p) = rc14_atm_grc(g) - c14_psnsun(p) = rc14_atm(sector_c14) * psnsun(p) - c14_psnsha(p) = rc14_atm(sector_c14) * psnsha(p) + c14_psnsun(p) = rc14_atm_grc(g) * psnsun(p) + c14_psnsha(p) = rc14_atm_grc(g) * psnsha(p) endif end if @@ -2750,7 +2727,7 @@ subroutine PhotosynthesisHydraulicStress ( bounds, fn, filterp, & use clm_varcon , only : rgas, tfrz, rpi, spval use GridcellType , only : grc use clm_time_manager , only : get_step_size_real, is_near_local_noon - use clm_varctl , only : cnallocate_carbon_only + use clm_varctl , only : allocate_carbon_only use clm_varctl , only : lnc_opt, reduce_dayl_factor, vcmax_opt use clm_varpar , only : nlevsoi use pftconMod , only : nbrdlf_dcd_tmp_shrub @@ -3267,7 +3244,7 @@ subroutine PhotosynthesisHydraulicStress ( bounds, fn, filterp, & if (.not. use_cn) then vcmax25top = vcmax25top * fnitr(patch%itype(p)) else - if ( CNAllocate_Carbon_only() ) vcmax25top = vcmax25top * fnitr(patch%itype(p)) + if ( Allocate_Carbon_only() ) vcmax25top = vcmax25top * fnitr(patch%itype(p)) end if else if (vcmax_opt == 3) then vcmax25top = ( i_vcad(patch%itype(p)) + s_vcad(patch%itype(p)) * lnc(p) ) * dayl_factor(p) diff --git a/src/cpl/share_esmf/CTSMForce2DStreamBaseType.F90 b/src/cpl/share_esmf/CTSMForce2DStreamBaseType.F90 new file mode 100644 index 0000000000..174fa3554e --- /dev/null +++ b/src/cpl/share_esmf/CTSMForce2DStreamBaseType.F90 @@ -0,0 +1,269 @@ +module CTSMForce2DStreamBaseType + +! +! Description: +! +! Base module to handle 2D streams in CTSM. Specific streams extend this object +! for the details needed to handle a specific stream file. +! +! Having this base type allows the ESMF specific streams implementation to be isolated +! from the CTSM code. This allows the streams code this is based on to change in one place. +! It also makes it easier to unit-test extensions of this type as they become pretty standard +! CTSM code and there is a unit-tester stub for this code. +! + +#include "shr_assert.h" + + use ESMF, only : ESMF_LogFoundError, ESMF_LOGERR_PASSTHRU + use dshr_strdata_mod , only : shr_strdata_type + use shr_kind_mod , only : r8 => shr_kind_r8, CL => shr_kind_CL + use clm_varctl , only : iulog + use spmdMod , only : masterproc, mpicom, iam + use abortutils , only : endrun + use decompMod , only : bounds_type + use clm_varctl, only : FL => fname_len + + implicit none + private + + !----------------------------------------------------------------------- + ! Base 2D streams type + !----------------------------------------------------------------------- + type, abstract, public :: ctsm_force_2DStream_base_type + private + type(shr_strdata_type) :: sdat ! Stream data type + character(len=FL) :: stream_filename ! The stream data filename (also in sdat) + character(len=CL) :: stream_name ! The stream name (also in sdat) + contains + + ! PUBLIC METHODS + procedure(Init_interface) , public, deferred :: Init ! Initiale the extended type + procedure, public, non_overridable :: InitBase ! Initialize and read data in the streams + procedure(Clean_interface), public, deferred :: Clean ! Clean and deallocate the object class method + procedure, public, non_overridable :: CleanBase ! Clean method for the base type + procedure, public, non_overridable :: Advance ! Advance the streams data to the current model date + procedure, public :: GetPtr1D ! Get pointer to the 1D data array + procedure(Interp_interface), public, deferred :: Interp ! method in extensions to turn stream data into CTSM data + + end type ctsm_force_2DStream_base_type + !----------------------------------------------------------------------- + + !----------------------------------------------------------------------- + ! Interfaces that will be deferred to the extended type + !----------------------------------------------------------------------- + abstract interface + + !----------------------------------------------------------------------- + + subroutine Init_interface( this, bounds, fldfilename, meshfile, mapalgo, tintalgo, taxmode, & + year_first, year_last, model_year_align ) + ! Description: + ! + ! Initialize the specific stream type that extends the base type + ! Normally the extended type will call the InitBase as well as doing other initialization needed + ! + ! Uses: + use decompMod , only : bounds_type + import :: ctsm_force_2DStream_base_type + + ! Arguments: + class(ctsm_force_2DStream_base_type), intent(inout) :: this + type(bounds_type), intent(in) :: bounds + character(*), intent(in) :: fldfilename ! stream data filename (full pathname) (single file) + ! NOTE: fldfilename could be expanded to an array if needed, but currently we only have one file + character(*), intent(in) :: meshfile ! full pathname to stream mesh file (none for global data) + character(*), intent(in) :: mapalgo ! stream mesh -> model mesh mapping type + character(*), intent(in) :: tintalgo ! time interpolation algorithm + character(*), intent(in) :: taxMode ! time axis mode + integer, intent(in) :: year_first ! first year to use + integer, intent(in) :: year_last ! last year to use + integer, intent(in) :: model_year_align ! align yearFirst with this model year + end subroutine Init_interface + + !----------------------------------------------------------------------- + + subroutine Clean_interface(this) + ! Description: + ! Clean up any memory allocated in the specific stream type that extends the base type + ! Normally the extended type will call the CleanBase method as well as other things needed. + ! Uses: + import :: ctsm_force_2DStream_base_type + ! + ! Arguments: + class(ctsm_force_2DStream_base_type), intent(inout) :: this + end subroutine Clean_interface + + !----------------------------------------------------------------------- + + subroutine Interp_interface(this, bounds) + ! Description: + ! Get the current time data from the streams and put it into the data of the extension. + ! What this looks like may vary with the streams extension, but in general it will use + ! The GetPtr1D method to get the streams data. + ! Uses: + use decompMod , only : bounds_type + import :: ctsm_force_2DStream_base_type + ! + ! Arguments: + class(ctsm_force_2DStream_base_type), intent(inout) :: this + type(bounds_type), intent(in) :: bounds + end subroutine Interp_interface + + end interface + !----------------------------------------------------------------------- + + character(len=*), parameter, private :: sourcefile = & + __FILE__ + + !----------------------------------------------------------------------- + contains + !----------------------------------------------------------------------- + + !----------------------------------------------------------------------- + + subroutine InitBase( this, bounds, varnames, fldfilename, meshfile, mapalgo, tintalgo, taxmode, name, & + year_first, year_last, model_year_align ) + ! + ! Description: + ! + ! Initialization of the base type. Extended types will normally call this as part of their initialization. + ! + ! Uses: + use lnd_comp_shr , only : mesh, model_clock + use dshr_strdata_mod , only : shr_strdata_init_from_inline + use decompMod , only : bounds_level_proc + use shr_log_mod , only : errMsg => shr_log_errMsg + ! Arguments: + class(ctsm_force_2DStream_base_type), intent(inout) :: this + type(bounds_type), intent(in) :: bounds + character(*), intent(in) :: varnames(:) ! variable names to read from stream file + character(*), intent(in) :: fldfilename ! stream data filename (full pathname) (single file) + ! NOTE: fldfilename could be expanded to an array if needed, but currently we only have one file + character(*), intent(in) :: meshfile ! full pathname to stream mesh file (none for global data) + character(*), intent(in) :: mapalgo ! stream mesh -> model mesh mapping type + character(*), intent(in) :: tintalgo ! time interpolation algorithm + character(*), intent(in) :: taxMode ! time axis mode + character(*), intent(in) :: name ! name of stream + integer, intent(in) :: year_first ! first year to use + integer, intent(in) :: year_last ! last year to use + integer, intent(in) :: model_year_align ! align yearFirst with this model year + + ! Local variables + integer, parameter :: offset = 0 ! time offset in seconds of stream data + integer :: rc ! error return code + + ! Some error checking... + SHR_ASSERT( bounds%level == bounds_level_proc, "InitBase should have a processor bounds, so we can do some checking"//errMsg( sourcefile, __LINE__) ) + SHR_ASSERT( bounds%begg == 1, "Make sure the starting bounds index is 1 so we know the mapping to gridcells is correct"//errMsg( sourcefile, __LINE__) ) + if ( len(fldfilename) >= FL )then + call endrun( 'stream field filename is too long:'//trim(fldfilename), file=sourcefile, line=__LINE__ ) + end if + this%stream_filename = fldfilename + this%stream_name = name + call shr_strdata_init_from_inline(this%sdat, & + my_task = iam, & + logunit = iulog, & + compname = 'LND', & + model_clock = model_clock,& + model_mesh = mesh, & + stream_meshfile = trim(meshfile), & + stream_lev_dimname = 'null', & + stream_mapalgo = mapalgo, & + stream_filenames = (/trim(fldfilename)/), & + stream_fldlistFile = varnames, & + stream_fldListModel = varnames, & + stream_yearFirst = year_first, & + stream_yearLast = year_last, & + stream_yearAlign = model_year_align, & + stream_offset = offset, & + stream_taxmode = taxmode, & + stream_dtlimit = 1.0e30_r8, & + stream_tintalgo = tintalgo, & + stream_name = name, & + rc = rc) + if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=sourcefile)) then + write(iulog,*) ' Streams initialization failing for ', trim(name), ' stream file = ', trim(fldfilename) + call endrun( 'CTSM forcing Streams initialization failing', file=sourcefile, line=__LINE__ ) + end if + end subroutine InitBase + + !----------------------------------------------------------------------- + + subroutine CleanBase( this ) + ! Description: + ! Clean up any memory in the base type as needed. + ! Normally types that extend this base type will call this as part of their clean operation + ! + ! Arguments: + class(ctsm_force_2DStream_base_type) , intent(inout) :: this + + integer :: ierr ! error code + + ! Currently no data to deallocate other than the stream data type + ! The stream data type doesn't have a clean method right now + ! So doing a few things manually here + end subroutine CleanBase + + !----------------------------------------------------------------------- + + subroutine Advance(this) + ! + ! Description: + ! + ! Advance the stream to the current time-step + ! + ! Uses: + use clm_time_manager , only : get_curr_date + use dshr_strdata_mod , only : shr_strdata_advance + ! + ! Arguments: + class(ctsm_force_2DStream_base_type), intent(inout) :: this + ! !LOCAL VARIABLES: + integer :: year ! year (0, ...) for nstep+1 + integer :: mon ! month (1, ..., 12) for nstep+1 + integer :: day ! day of month (1, ..., 31) for nstep+1 + integer :: sec ! seconds into current date for nstep+1 + integer :: mcdate ! Current model date (yyyymmdd) + integer :: rc ! Error return code + + ! Advance sdat stream + call get_curr_date(year, mon, day, sec) + mcdate = year*10000 + mon*100 + day + call shr_strdata_advance(this%sdat, ymd=mcdate, tod=sec, logunit=iulog, istr='CTSMForce2DStreamBase', rc=rc) + if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) then + write(iulog,*) ' Streams advance failing for ', trim(this%stream_name), ' stream file = ', trim(this%stream_filename) + call endrun( 'CTSM forcing Streams advance failing', file=sourcefile, line=__LINE__ ) + end if + end subroutine Advance + + !----------------------------------------------------------------------- + + subroutine GetPtr1D(this, fldname, dataptr1d) + ! + ! Description: + ! + ! Get the pointer to the 1D data array for the given field name + ! Normally stream extensions will use this in the Interp method to + ! save the stream data locally. + ! + ! Uses: + use dshr_methods_mod , only : dshr_fldbun_getfldptr + ! Arguments: + class(ctsm_force_2DStream_base_type), intent(inout) :: this + character(*), intent(in) :: fldname ! field name to get pointer for + real(r8), pointer :: dataptr1d(:) ! Pointer to the 1D data + + ! Local variables + integer :: rc ! error return code + + ! Get pointer for stream data that is time and spatially interpolated to model time and grid + call dshr_fldbun_getFldPtr(this%sdat%pstrm(1)%fldbun_model, fldname=fldname, fldptr1=dataptr1d, rc=rc) + if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=sourcefile)) then + call endrun( 'Error getting field pointer for '//trim(fldname)//' from stream data', file=sourcefile, line=__LINE__ ) + end if + + end subroutine GetPtr1D + + !----------------------------------------------------------------------- + +end module CTSMForce2DStreamBaseType diff --git a/src/cpl/share_esmf/FireDataBaseType.F90 b/src/cpl/share_esmf/FireDataBaseType.F90 index fd8b140c95..aa9395b770 100644 --- a/src/cpl/share_esmf/FireDataBaseType.F90 +++ b/src/cpl/share_esmf/FireDataBaseType.F90 @@ -338,6 +338,7 @@ subroutine hdm_interp( this, bounds) ig = 0 do g = bounds%begg,bounds%endg ig = ig+1 + SHR_ASSERT_FL( ig == g, sourcefile, __LINE__ ) this%forc_hdm(g) = dataptr1d(ig) end do @@ -506,6 +507,7 @@ subroutine lnfm_interp(this, bounds ) ig = 0 do g = bounds%begg,bounds%endg ig = ig+1 + SHR_ASSERT_FL( ig == g, sourcefile, __LINE__ ) this%forc_lnfm(g) = dataptr1d(ig) end do diff --git a/src/cpl/share_esmf/PrigentRoughnessStreamType.F90 b/src/cpl/share_esmf/PrigentRoughnessStreamType.F90 index afc65f2ece..158c75e434 100644 --- a/src/cpl/share_esmf/PrigentRoughnessStreamType.F90 +++ b/src/cpl/share_esmf/PrigentRoughnessStreamType.F90 @@ -1,5 +1,6 @@ module PrigentRoughnessStreamType +#include "shr_assert.h" !----------------------------------------------------------------------- ! !DESCRIPTION: @@ -151,6 +152,7 @@ subroutine Init(this, bounds, NLFilename) ig = 0 do g = bounds%begg,bounds%endg ig = ig+1 + SHR_ASSERT_FL( ig == g, sourcefile, __LINE__ ) this%prigent_rghn(g) = dataptr1d(ig) end do diff --git a/src/cpl/share_esmf/cropcalStreamMod.F90 b/src/cpl/share_esmf/cropcalStreamMod.F90 index 591476e59e..df48ef5e98 100644 --- a/src/cpl/share_esmf/cropcalStreamMod.F90 +++ b/src/cpl/share_esmf/cropcalStreamMod.F90 @@ -480,6 +480,7 @@ subroutine cropcal_advance( bounds ) do g = begg,endg ig = ig+1 g_to_ig(g) = ig + SHR_ASSERT_FL( ig == g, sourcefile, __LINE__ ) end do end if diff --git a/src/cpl/share_esmf/ndepStreamMod.F90 b/src/cpl/share_esmf/ndepStreamMod.F90 index f8edd96ffc..860dd35641 100644 --- a/src/cpl/share_esmf/ndepStreamMod.F90 +++ b/src/cpl/share_esmf/ndepStreamMod.F90 @@ -1,5 +1,7 @@ module ndepStreamMod +#include "shr_assert.h" + !----------------------------------------------------------------------- ! !DESCRIPTION: ! Contains methods for reading in nitrogen deposition data file @@ -256,12 +258,14 @@ subroutine ndep_interp(bounds, atm2lnd_inst) dayspyr = get_curr_days_per_year( ) do g = bounds%begg,bounds%endg ig = ig+1 + SHR_ASSERT_FL( ig == g, sourcefile, __LINE__ ) atm2lnd_inst%forc_ndep_grc(g) = dataptr1d(ig) / (secspday * dayspyr) end do else ig = 0 do g = bounds%begg,bounds%endg ig = ig+1 + SHR_ASSERT_FL( ig == g, sourcefile, __LINE__ ) atm2lnd_inst%forc_ndep_grc(g) = dataptr1d(ig) end do end if diff --git a/src/fates b/src/fates index c1dfc21c50..5bb36cba29 160000 --- a/src/fates +++ b/src/fates @@ -1 +1 @@ -Subproject commit c1dfc21c505b5c8b29d4592b7d4a5e058239f6fb +Subproject commit 5bb36cba29b95295aca5aedc13f348ef1e001b99 diff --git a/src/main/clm_initializeMod.F90 b/src/main/clm_initializeMod.F90 index 1c26b55cfd..4530fda860 100644 --- a/src/main/clm_initializeMod.F90 +++ b/src/main/clm_initializeMod.F90 @@ -157,6 +157,7 @@ subroutine initialize2(ni,nj, currtime) use clm_time_manager , only : get_curr_date, get_nstep, advance_timestep use clm_time_manager , only : timemgr_init, timemgr_restart_io, timemgr_restart, is_restart use CIsoAtmTimeseriesMod , only : C14_init_BombSpike, use_c14_bombspike, C13_init_TimeSeries, use_c13_timeseries + use CIsoAtmTimeseriesMod , only : CIsoAtmReadNML use DaylengthMod , only : InitDaylength use dynSubgridDriverMod , only : dynSubgrid_init use dynConsBiogeophysMod , only : dyn_hwcontent_set_baselines @@ -475,11 +476,12 @@ subroutine initialize2(ni,nj, currtime) ! Also do this for FATES see below call SatellitePhenologyInit(bounds_proc) end if - if ( use_c14 .and. use_c14_bombspike ) then - call C14_init_BombSpike() + if ( use_c13 .or. use_c14 ) call CIsoAtmReadNML( NLFilename ) + if ( use_c14 ) then + call C14_init_BombSpike( bounds_proc ) end if - if ( use_c13 .and. use_c13_timeseries ) then - call C13_init_TimeSeries() + if ( use_c13 ) then + call C13_init_TimeSeries( bounds_proc ) end if else ! FATES OR Satellite phenology diff --git a/src/main/clm_varcon.F90 b/src/main/clm_varcon.F90 index 985660142a..234b89c797 100644 --- a/src/main/clm_varcon.F90 +++ b/src/main/clm_varcon.F90 @@ -131,23 +131,23 @@ module clm_varcon !!! C13 real(r8), public, parameter :: preind_atm_del13c = -6.0_r8 ! preindustrial value for atmospheric del13C - real(r8), public, parameter :: preind_atm_ratio = SHR_CONST_PDB + (preind_atm_del13c * SHR_CONST_PDB)/1000.0_r8 ! 13C/12C + real(r8), private, parameter :: preind_atm_ratio = SHR_CONST_PDB + (preind_atm_del13c * SHR_CONST_PDB)/1000.0_r8 ! 13C/12C real(r8), public :: c13ratio = preind_atm_ratio/(1.0_r8+preind_atm_ratio) ! 13C/(12+13)C preind atmosphere ! typical del13C for C3 photosynthesis (permil, relative to PDB) - real(r8), public, parameter :: c3_del13c = -28._r8 + real(r8), private, parameter :: c3_del13c = -28._r8 ! typical del13C for C4 photosynthesis (permil, relative to PDB) - real(r8), public, parameter :: c4_del13c = -13._r8 + real(r8), private, parameter :: c4_del13c = -13._r8 ! isotope ratio (13c/12c) for C3 photosynthesis - real(r8), public, parameter :: c3_r1 = SHR_CONST_PDB + ((c3_del13c*SHR_CONST_PDB)/1000._r8) + real(r8), private, parameter :: c3_r1 = SHR_CONST_PDB + ((c3_del13c*SHR_CONST_PDB)/1000._r8) ! isotope ratio (13c/[12c+13c]) for C3 photosynthesis real(r8), public, parameter :: c3_r2 = c3_r1/(1._r8 + c3_r1) ! isotope ratio (13c/12c) for C4 photosynthesis - real(r8), public, parameter :: c4_r1 = SHR_CONST_PDB + ((c4_del13c*SHR_CONST_PDB)/1000._r8) + real(r8), private, parameter :: c4_r1 = SHR_CONST_PDB + ((c4_del13c*SHR_CONST_PDB)/1000._r8) ! isotope ratio (13c/[12c+13c]) for C4 photosynthesis real(r8), public, parameter :: c4_r2 = c4_r1/(1._r8 + c4_r1) diff --git a/src/main/clm_varctl.F90 b/src/main/clm_varctl.F90 index 9a0d2901b9..83133acf2b 100644 --- a/src/main/clm_varctl.F90 +++ b/src/main/clm_varctl.F90 @@ -11,8 +11,8 @@ module clm_varctl ! !PUBLIC MEMBER FUNCTIONS: implicit none public :: clm_varctl_set ! Set variables - public :: cnallocate_carbon_only_set - public :: cnallocate_carbon_only + public :: allocate_carbon_only_set + public :: allocate_carbon_only ! private save @@ -585,15 +585,15 @@ subroutine clm_varctl_set( caseid_in, ctitle_in, brnch_retain_casename_in, & end subroutine clm_varctl_set - ! Set module carbon_only flag - subroutine cnallocate_carbon_only_set(carbon_only_in) + ! Set module carbon_only flag (applies to both CN and FATES) + subroutine allocate_carbon_only_set(carbon_only_in) logical, intent(in) :: carbon_only_in carbon_only = carbon_only_in - end subroutine cnallocate_carbon_only_set + end subroutine allocate_carbon_only_set - ! Get module carbon_only flag - logical function CNAllocate_Carbon_only() - cnallocate_carbon_only = carbon_only - end function CNAllocate_Carbon_only + ! Get module carbon_only flag (applies to both CN and FATES) + logical function Allocate_Carbon_only() + allocate_carbon_only = carbon_only + end function Allocate_Carbon_only end module clm_varctl diff --git a/src/soilbiogeochem/SoilBiogeochemCompetitionMod.F90 b/src/soilbiogeochem/SoilBiogeochemCompetitionMod.F90 index 57bc82984e..041f6ee740 100644 --- a/src/soilbiogeochem/SoilBiogeochemCompetitionMod.F90 +++ b/src/soilbiogeochem/SoilBiogeochemCompetitionMod.F90 @@ -76,7 +76,7 @@ subroutine readParams ( ncid ) type(file_desc_t),intent(inout) :: ncid ! pio netCDF file id ! ! !LOCAL VARIABLES: - character(len=32) :: subname = 'CNAllocParamsType' + character(len=32) :: subname = 'readParams' character(len=100) :: errCode = '-Error reading in parameters file:' logical :: readv ! has variable been read in or not real(r8) :: tempr ! temporary to read in parameter @@ -130,7 +130,7 @@ subroutine SoilBiogeochemCompetitionInit ( bounds) ! !USES: use clm_varcon , only: secspday use clm_time_manager, only: get_step_size_real - use clm_varctl , only: iulog, cnallocate_carbon_only_set + use clm_varctl , only: iulog, allocate_carbon_only_set use shr_infnan_mod , only: nan => shr_infnan_nan, assignment(=) ! ! !ARGUMENTS: @@ -160,7 +160,7 @@ subroutine SoilBiogeochemCompetitionInit ( bounds) errMsg(sourcefile, __LINE__)) end select - call cnallocate_carbon_only_set(carbon_only) + call allocate_carbon_only_set(carbon_only) end subroutine SoilBiogeochemCompetitionInit @@ -175,7 +175,7 @@ subroutine SoilBiogeochemCompetition (bounds, num_bgc_soilc, filter_bgc_soilc,nu soilbiogeochem_nitrogenflux_inst,canopystate_inst) ! ! !USES: - use clm_varctl , only: cnallocate_carbon_only, iulog + use clm_varctl , only: allocate_carbon_only, iulog use clm_varpar , only: nlevdecomp, ndecomp_cascade_transitions use clm_varpar , only: i_cop_mic, i_oli_mic use clm_varcon , only: nitrif_n2o_loss_frac @@ -338,7 +338,7 @@ subroutine SoilBiogeochemCompetition (bounds, num_bgc_soilc, filter_bgc_soilc,nu fpi_vr(c,j) = 1.0_r8 actual_immob_vr(c,j) = potential_immob_vr(c,j) sminn_to_plant_vr(c,j) = plant_ndemand(c) * nuptake_prof(c,j) - else if ( cnallocate_carbon_only()) then !.or. & + else if ( allocate_carbon_only()) then !.or. & ! this code block controls the addition of N to sminn pool ! to eliminate any N limitation, when Carbon_Only is set. This lets the ! model behave essentially as a carbon-only model, but with the @@ -729,7 +729,7 @@ subroutine SoilBiogeochemCompetition (bounds, num_bgc_soilc, filter_bgc_soilc,nu ! eliminate N limitations, so there is still a diagnostic quantity ! that describes the degree of N limitation at steady-state. - if ( cnallocate_carbon_only()) then !.or. & + if ( allocate_carbon_only()) then !.or. & if ( fpi_no3_vr(c,j) + fpi_nh4_vr(c,j) < 1._r8 ) then fpi_nh4_vr(c,j) = 1.0_r8 - fpi_no3_vr(c,j) supplement_to_sminn_vr(c,j) = (potential_immob_vr(c,j) & diff --git a/src/unit_test_stubs/share_esmf/CMakeLists.txt b/src/unit_test_stubs/share_esmf/CMakeLists.txt index 368601dcc8..c68bb17a98 100644 --- a/src/unit_test_stubs/share_esmf/CMakeLists.txt +++ b/src/unit_test_stubs/share_esmf/CMakeLists.txt @@ -1,6 +1,7 @@ list(APPEND clm_sources ExcessIceStreamType.F90 FireDataBaseType.F90 + CTSMForce2DStreamBaseType.F90 laiStreamMod.F90 PrigentRoughnessStreamType.F90 ZenderSoilErodStreamType.F90 diff --git a/src/unit_test_stubs/share_esmf/CTSMForce2DStreamBaseType.F90 b/src/unit_test_stubs/share_esmf/CTSMForce2DStreamBaseType.F90 new file mode 100644 index 0000000000..59e6a4d551 --- /dev/null +++ b/src/unit_test_stubs/share_esmf/CTSMForce2DStreamBaseType.F90 @@ -0,0 +1,120 @@ +module CTSMForce2DStreamBaseType + + use shr_kind_mod , only : r8 => shr_kind_r8, CL => shr_kind_CL + use abortutils , only : endrun + use decompMod , only : bounds_type + use clm_varctl, only : FL => fname_len + + implicit none + private + + type, abstract, public :: ctsm_force_2DStream_base_type + private + character(len=FL) :: stream_filename ! The stream data filename (also in sdat) + character(len=CL) :: stream_name ! The stream name (also in sdat) + contains + + ! PUBLIC METHODS + procedure(Init_interface) , public, deferred :: Init + procedure, public, non_overridable :: InitBase ! Initialize and read data in the streams, , store the g_to_ig index array + procedure(Clean_interface), public, deferred :: Clean ! Clean and deallocate the object class method + procedure, public, non_overridable :: CleanBase ! Clean method for the base type + procedure, public, non_overridable :: Advance ! Advance the streams data to the current model date + procedure, public :: GetPtr1D ! Get pointer to the 1D data array + procedure(Interp_interface), public, deferred :: Interp ! method in extensions to turn stream data into output data + + end type ctsm_force_2DStream_base_type + + abstract interface + + subroutine Init_interface( this, bounds, fldfilename, meshfile, mapalgo, tintalgo, taxmode, & + year_first, year_last, model_year_align ) + ! Uses: + use decompMod , only : bounds_type + import :: ctsm_force_2DStream_base_type + + ! Arguments: + class(ctsm_force_2DStream_base_type), intent(inout) :: this + type(bounds_type), intent(in) :: bounds + character(*), intent(in) :: fldfilename ! stream data filename (full pathname) (single file) + ! NOTE: fldfilename could be expanded to an array if needed, but currently we only have one file + character(*), intent(in) :: meshfile ! full pathname to stream mesh file (none for global data) + character(*), intent(in) :: mapalgo ! stream mesh -> model mesh mapping type + character(*), intent(in) :: tintalgo ! time interpolation algorithm + character(*), intent(in) :: taxMode ! time axis mode + integer, intent(in) :: year_first ! first year to use + integer, intent(in) :: year_last ! last year to use + integer, intent(in) :: model_year_align ! align yearFirst with this model year + end subroutine Init_interface + + subroutine Clean_interface(this) + ! Uses: + import :: ctsm_force_2DStream_base_type + ! + ! Arguments: + class(ctsm_force_2DStream_base_type), intent(inout) :: this + end subroutine Clean_interface + + subroutine Interp_interface(this, bounds) + ! Uses: + use decompMod , only : bounds_type + import :: ctsm_force_2DStream_base_type + ! + ! Arguments: + class(ctsm_force_2DStream_base_type), intent(inout) :: this + type(bounds_type), intent(in) :: bounds + end subroutine Interp_interface + + end interface + + character(len=*), parameter, private :: sourcefile = & + __FILE__ + + contains + + subroutine InitBase( this, bounds, varnames, fldfilename, meshfile, mapalgo, tintalgo, taxmode, name, & + year_first, year_last, model_year_align ) + ! Uses: + ! Arguments: + class(ctsm_force_2DStream_base_type), intent(inout) :: this + type(bounds_type), intent(in) :: bounds + character(*), intent(in) :: varnames(:) ! variable names to read from stream file + character(*), intent(in) :: fldfilename ! stream data filename (full pathname) (single file) + ! NOTE: fldfilename could be expanded to an array if needed, but currently we only have one file + character(*), intent(in) :: meshfile ! full pathname to stream mesh file (none for global data) + character(*), intent(in) :: mapalgo ! stream mesh -> model mesh mapping type + character(*), intent(in) :: tintalgo ! time interpolation algorithm + character(*), intent(in) :: taxMode ! time axis mode + character(*), intent(in) :: name ! name of stream + integer, intent(in) :: year_first ! first year to use + integer, intent(in) :: year_last ! last year to use + integer, intent(in) :: model_year_align ! align yearFirst with this model year + + end subroutine InitBase + + subroutine CleanBase( this ) + class(ctsm_force_2DStream_base_type) , intent(inout) :: this + + call endrun('CTSMForce2DStreamBaseType: CleanBase method not implemented in stub') + + end subroutine CleanBase + + subroutine Advance(this) + ! Arguments: + class(ctsm_force_2DStream_base_type), intent(inout) :: this + + call endrun('CTSMForce2DStreamBaseType: Advance method not implemented in stub') + + end subroutine Advance + + subroutine GetPtr1D(this, fldname, dataptr1d) + ! Get the pointer to the 1D data array for the given field name + ! Uses: + ! Arguments: + class(ctsm_force_2DStream_base_type), intent(inout) :: this + character(*), intent(in) :: fldname ! field name to get pointer for + real(r8), pointer :: dataptr1d(:) ! Pointer to the 1D data + + end subroutine GetPtr1D + +end module CTSMForce2DStreamBaseType diff --git a/src/utils/clmfates_interfaceMod.F90 b/src/utils/clmfates_interfaceMod.F90 index da43b30b18..81f8a78b8e 100644 --- a/src/utils/clmfates_interfaceMod.F90 +++ b/src/utils/clmfates_interfaceMod.F90 @@ -80,6 +80,7 @@ module CLMFatesInterfaceMod use clm_varctl , only : use_lch4 use clm_varctl , only : fates_history_dimlevel use clm_varctl , only : nsrest, nsrBranch + use clm_varctl , only : Allocate_Carbon_only use clm_varcon , only : tfrz use clm_varcon , only : spval use clm_varcon , only : denice @@ -474,23 +475,6 @@ subroutine CLMFatesGlobals2() end if call set_fates_ctrlparms('use_tree_damage',ival=pass_tree_damage) - ! These may be in a non-limiting status (ie when supplements) - ! are added, but they are always allocated and cycled non-the less - ! FATES may want to interact differently with other models - ! that don't even have these arrays allocated. - ! FATES also checks that if NO3 is cycled in ELM, then - ! any plant affinity parameters are checked. - - if(use_nitrif_denitrif) then - call set_fates_ctrlparms('nitrogen_spec',ival=1) - else - call set_fates_ctrlparms('nitrogen_spec',ival=2) - end if - - ! Phosphorus is not tracked in CLM - call set_fates_ctrlparms('phosphorus_spec',ival=0) - - ! Pass spitfire mode values call set_fates_ctrlparms('spitfire_mode',ival=fates_spitfire_mode) call set_fates_ctrlparms('sf_nofire_def',ival=no_fire) @@ -1161,6 +1145,12 @@ subroutine dynamics_driv(this, nc, bounds_clump, & real(r8) :: s_node, smp_node ! local for relative water content and potential logical :: after_start_of_harvest_ts integer :: iharv + logical :: nitr_suppl ! true -> CLM is supplementing Nitrogen + logical, parameter :: phos_dummy_suppl = .true. ! true -> Phosphorus is NOT limited (i.e. supplemented) + ! This argument is needed for FATES + ! to specify if phosphorus is being + ! supplemented, Phosphorous is not limited in CLM + ! so we set it to TRUE !----------------------------------------------------------------------- ! --------------------------------------------------------------------------------- @@ -1342,10 +1332,16 @@ subroutine dynamics_driv(this, nc, bounds_clump, & end do + if(Allocate_Carbon_only())then + nitr_suppl = .true. + else + nitr_suppl = .false. + end if + ! Nutrient uptake fluxes have been accumulating with each short ! timestep, here, we unload them from the boundary condition ! structures into the cohort structures. - call UnPackNutrientAquisitionBCs(this%fates(nc)%sites, this%fates(nc)%bc_in) + call UnPackNutrientAquisitionBCs(this%fates(nc)%sites, this%fates(nc)%bc_in, nitr_suppl, phos_dummy_suppl) ! Distribute any seeds from neighboring gridcells into the current gridcell ! Global seed availability array populated by WrapGlobalSeedDispersal call diff --git a/src/utils/fileutils.F90 b/src/utils/fileutils.F90 index e7146468e7..f67cf91af0 100644 --- a/src/utils/fileutils.F90 +++ b/src/utils/fileutils.F90 @@ -21,6 +21,9 @@ module fileutils public :: getavu !Get next available Fortran unit number !----------------------------------------------------------------------- + character(len=*), parameter, private :: sourcefile = & + __FILE__ + contains !----------------------------------------------------------------------- @@ -76,7 +79,7 @@ subroutine getfil (fulpath, locfn, iflag) write(iulog,'(a)')'(GETFIL): full pathname is '//trim(fulpath) write(iulog,'(a)')'(GETFIL): local filename has zero length' end if - call shr_sys_abort + call shr_sys_abort('GETFIL: local filename has zero length', file=sourcefile, line=__LINE__) else if (masterproc) then write(iulog,'(a)')'(GETFIL): attempting to find local file ',trim(locfn) @@ -105,7 +108,7 @@ subroutine getfil (fulpath, locfn, iflag) write(iulog,'(a)')'(GETFIL): failed getting file from full path: '//fulpath end if if (iflag==0) then - call shr_sys_abort ('GETFIL: FAILED to get '//trim(fulpath)) + call shr_sys_abort ('GETFIL: FAILED to get '//trim(fulpath), file=sourcefile, line=__LINE__) else RETURN endif @@ -131,7 +134,7 @@ subroutine opnfil (locfn, iun, form) if (len_trim(locfn) == 0) then write(iulog,*)'(OPNFIL): local filename has zero length' - call shr_sys_abort + call shr_sys_abort('OPNFIL: local filename has zero length', file=sourcefile, line=__LINE__) endif if (form=='u' .or. form=='U') then ft = 'unformatted' @@ -142,7 +145,7 @@ subroutine opnfil (locfn, iun, form) if (ioe /= 0) then write(iulog,*)'(OPNFIL): failed to open file ',trim(locfn), & & ' on unit ',iun,' ierr=',ioe - call shr_sys_abort + call shr_sys_abort('OPNFIL: failed to open '//trim(locfn), rc=ioe, file=sourcefile, line=__LINE__) else if ( masterproc )then write(iulog,*)'(OPNFIL): Successfully opened file ',trim(locfn), & & ' on unit= ',iun From 560ad747f6f267b9544588c58a7e907f696bfaa8 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Mon, 24 Nov 2025 14:23:11 -0700 Subject: [PATCH 113/129] User's Guide updates about splitting hX to hXa and hXi files --- .../running-single-points/supported-tower-sites.rst | 4 ++-- .../Running-with-custom-crop-calendars.rst | 6 +++--- .../setting-up-and-running-a-case/history_fields_fates.rst | 2 ++ .../history_fields_nofates.rst | 2 ++ 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/doc/source/users_guide/running-single-points/supported-tower-sites.rst b/doc/source/users_guide/running-single-points/supported-tower-sites.rst index 3e080a3ee1..db0e8e83fb 100644 --- a/doc/source/users_guide/running-single-points/supported-tower-sites.rst +++ b/doc/source/users_guide/running-single-points/supported-tower-sites.rst @@ -60,9 +60,9 @@ To run CTSM at a NEON site, change directories to where the run_tower tool is lo When a simulation completes, the data are stored in the archive directory under ``CTSM/tools/site_and_regional/archive``. In this directory you will find files that include data for every day of the simulation, as well as files that average model variables monthly. The output file names are automatically generated and are composed of the simulation name, which includes the site name, type of simulation (eg, ``transient``), and the date of simulated data. The tower simulations generate two types of files: -1) ``h0`` Variables that are averaged monthly. One file is available for every month of the simulation. These files include hundreds of variables. +1) ``h0a`` Variables that are averaged monthly. One file is available for every month of the simulation. These files include hundreds of variables. -2) ``h1`` Variables that are recorded every 30 minutes. Values are aggregated into one file for each day of the simulation. Each file includes 48 data points for selected variables. +2) ``h1a`` Variables that are recorded every 30 minutes. Values are aggregated into one file for each day of the simulation. Each file includes 48 data points for selected variables. ========================================= PLUMBER Tower Single Point Simulations diff --git a/doc/source/users_guide/running-special-cases/Running-with-custom-crop-calendars.rst b/doc/source/users_guide/running-special-cases/Running-with-custom-crop-calendars.rst index 22009add51..b03e73066b 100644 --- a/doc/source/users_guide/running-special-cases/Running-with-custom-crop-calendars.rst +++ b/doc/source/users_guide/running-special-cases/Running-with-custom-crop-calendars.rst @@ -59,18 +59,18 @@ In a GDD-generating run, crops are planted on the specified sowing dates and are generate_crop_gdds = .true. use_mxmat = .false. - ! (h0) Save default variables monthly instead of daily to save space + ! (h0a) Save default variables monthly instead of daily to save space hist_nhtfrq = 0 hist_mfilt = 12 - ! (h1) Annual outputs for GDD generation + ! (h1i) Annual outputs for GDD generation hist_fincl2 = 'GRAINC_TO_FOOD_PERHARV', 'GRAINC_TO_FOOD_ANN', 'SDATES', 'SDATES_PERHARV', 'SYEARS_PERHARV', 'HDATES', 'GDDHARV_PERHARV', 'GDDACCUM_PERHARV', 'HUI_PERHARV', 'SOWING_REASON_PERHARV', 'HARVEST_REASON_PERHARV' hist_nhtfrq(2) = 17520 hist_mfilt(2) = 999 hist_type1d_pertape(2) = 'PFTS' hist_dov2xy(2) = .false. - ! (h2) Daily outputs for GDD generation + ! (h2a) Daily outputs for GDD generation hist_fincl3 = 'GDDACCUM', 'GDDHARV' hist_nhtfrq(3) = -24 hist_mfilt(3) = 365 diff --git a/doc/source/users_guide/setting-up-and-running-a-case/history_fields_fates.rst b/doc/source/users_guide/setting-up-and-running-a-case/history_fields_fates.rst index 84caf92465..6c037f707d 100644 --- a/doc/source/users_guide/setting-up-and-running-a-case/history_fields_fates.rst +++ b/doc/source/users_guide/setting-up-and-running-a-case/history_fields_fates.rst @@ -3,6 +3,8 @@ CTSM History Fields (fates) ============================= CAUTION: Not all variables are relevant / present for all CTSM cases. +NOTE: Instantaneous fields will appear in history files labeled with h0i, h1i, ... and non-instantaneous fields will appear in history fields labeled with h0a, h1a, ... + Key flags used in this CTSM case: use_cn = F use_crop = F diff --git a/doc/source/users_guide/setting-up-and-running-a-case/history_fields_nofates.rst b/doc/source/users_guide/setting-up-and-running-a-case/history_fields_nofates.rst index 67868f75b1..a38b8a9c9b 100644 --- a/doc/source/users_guide/setting-up-and-running-a-case/history_fields_nofates.rst +++ b/doc/source/users_guide/setting-up-and-running-a-case/history_fields_nofates.rst @@ -3,6 +3,8 @@ CTSM History Fields (nofates) ============================= CAUTION: Not all variables are relevant / present for all CTSM cases. +NOTE: Instantaneous fields will appear in history files labeled with h0i, h1i, ... and non-instantaneous fields will appear in history fields labeled with h0a, h1a, ... + Key flags used in this CTSM case: use_cn = T use_crop = T From 93b0dd44b65a13fb6aad966fac2041547c5f11d6 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Mon, 24 Nov 2025 15:34:38 -0700 Subject: [PATCH 114/129] Additional User's Guide updates about splitting hX to hXa and hXi files --- .../customizing-the-clm-namelist.rst | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/doc/source/users_guide/setting-up-and-running-a-case/customizing-the-clm-namelist.rst b/doc/source/users_guide/setting-up-and-running-a-case/customizing-the-clm-namelist.rst index a4333a2b29..f4c28da9a8 100644 --- a/doc/source/users_guide/setting-up-and-running-a-case/customizing-the-clm-namelist.rst +++ b/doc/source/users_guide/setting-up-and-running-a-case/customizing-the-clm-namelist.rst @@ -145,7 +145,9 @@ There are two ways to change the averaging of output history fields. The first i - ``X`` Maximum, over the output interval. - ``M`` Minimum, over the output interval. -The default averaging depends on the specific fields, but for most fields is an average. A sample user namelist ``user_nl_clm`` making the monthly output fields all averages (except ``TSOI`` for the first two streams and ``FIRE`` for the 5th stream), and adding auxiliary file streams for instantaneous (6-hourly), maximum (daily), minimum (daily), and average (daily). For some of the fields we diverge from the per-tape value given and customize to some different type of optimization. +The default averaging depends on the specific fields, but for most fields is an average. A sample user namelist ``user_nl_clm`` follows making the monthly output fields all averages (except ``TSOI``), and adding auxiliary file streams for instantaneous (6-hourly), maximum (daily), minimum (daily), and average (daily). For some of the fields we diverge from the per-tape value given and customize to some different type of averaging. + +.. note:: As of ctsm5.4, history files that used to be labeled with hX (where X is an integer from 0 to 4 in the example) will be labeled with hXi and hXa (as separate files) to indicate instantaneous versus non-instantaneous (average, etc.) files. The change intends to prevent confusion associated with the time corresponding to instantaneous history fields by now putting them on separate files than non-instantaneous fields. The separate instantaneous history files represent the exact time step when they were written and do not include a time_bounds variable. Conversely, non-instantaneous history files represent the period of their time_bounds variable. As a result, time data on non-instantaneous history files are now read correctly during post processing (e.g. by xarray). Special handling may still be needed for instantaneous history files, whose timestamps represent the date and time at the END of the history timestep. So, e.g., an instantaneous variable saved at the end of year 2023 will get the timestamp 2024-01-01 00:00:00. Example: user_nl_clm namelist with various ways to average history fields ------------------------------------------------------------------------------------- @@ -162,12 +164,12 @@ Example: user_nl_clm namelist with various ways to average history fields 'EFLX_LH_TOT', 'WT' hist_fincl5 = 'TSOI', 'TG', 'TV', 'FIRE:I', 'FSR', 'FSH', 'EFLX_LH_TOT', 'WT' - hist_avgflag_pertape = 'A', 'I', 'X', 'M', 'A' + hist_avgflag_pertape = 'A', 'I', 'X', 'M', 'A' hist_nhtfrq = 0, -6, -24, -24, -24 -In the example we put the same list of fields on each of the tapes: soil-temperature, ground temperature, vegetation temperature, emitted longwave radiation, reflected solar radiation, sensible heat, total latent-heat, and total water storage. We also modify the soil temperature for the primary and secondary auxiliary tapes by outputting them for a maximum instead of the prescribed per-tape of average and instantaneous respectively. For the tertiary auxiliary tape we output ground temperature instantaneous instead of as a maximum, and for the fourth auxiliary tape we output vegetation temperature instantaneous instead of as a minimum. Finally, for the fifth auxiliary tapes we output ``FIRE`` instantaneously instead of as an average. +In the example we put the same list of fields on each of the tapes: soil-temperature, ground temperature, vegetation temperature, emitted longwave radiation, reflected solar radiation, sensible heat, total latent-heat, and total water storage. We also modify the soil temperature for the primary and secondary auxiliary tapes by outputting them for a maximum instead of the prescribed per-tape of average and instantaneous respectively. For the tertiary auxiliary tape we output ground temperature as instantaneous instead of as maximum, and for the fourth auxiliary tape we output vegetation temperature as instantaneous instead of as minimum. Finally, for the fifth auxiliary tapes we output ``FIRE`` as instantaneous instead of as average. -.. note:: We also use ``hist_empty_htapes`` as in the previous example, so we can list ONLY the fields that we want on the primary history tapes. +.. note:: We also use ``hist_empty_htapes`` as in the previous example, so we can list ONLY the fields that we want on the primary history tape. Outputting history files as a vector in order to analyze the plant function types within gridcells -------------------------------------------------------------------------------------------------- From b883127c536a5f81b8959f4dcd78bc1c6204012c Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Mon, 24 Nov 2025 16:18:05 -0700 Subject: [PATCH 115/129] Updated WhatsNewInCTSM54 --- WhatsNewInCTSM5.4.md | 190 ++++++++++++++++++++++++++++--------------- 1 file changed, 126 insertions(+), 64 deletions(-) mode change 100644 => 100755 WhatsNewInCTSM5.4.md diff --git a/WhatsNewInCTSM5.4.md b/WhatsNewInCTSM5.4.md old mode 100644 new mode 100755 index a36b8266c0..35806d6f13 --- a/WhatsNewInCTSM5.4.md +++ b/WhatsNewInCTSM5.4.md @@ -1,90 +1,152 @@ # What's new in CTSM 5.4 (tag `ctsm5.4.0xx`) -## Purpose and description of changes since CTSM 5.3 (tag `ctsm5.3.021`) - -REMOVE THESE NOTES WHEN DONE AND READY TO RELEASE -- As of 2025/7/29 slevis has gone through the ChangeLog from cctsm5.3.022 to ctsm5.3.065 -- Ask for reviewers to browse/read this doc for accuracy, omissions, and redundancies -- For omissions, request contributions from the relevant developers - -### New features - -* Can now choose the CRUJRA2024 atmospheric driver data with clm6 and clm5 [PR \#2956](https://github.com/ESCOMP/ctsm/pull/2956)) -* Can now run PLUMBER towers, similar to the NEON tower capability ([issue \#1487](https://github.com/ESCOMP/CTSM/issues/1487)) -* New namelist variables `snow_thermal_cond_glc_method` and `snow_thermal_cond_lake_method` ([PR \#3072](https://https://github.com/ESCOMP/CTSM/pull/3072)) -* Potentially time-evolving `leafcn_target` replaces time-constant `leafcn`: the former is calculated as a function of the latter and can be time-evolving depending on new paramfile parameter `leafcn_co2_slope` ([PR \#1654](https://github.com/ESCOMP/ctsm/pull/1654) -* Easier, more flexible use of anomaly forcings for ISSP cases ([PR \#2686](https://github.com/ESCOMP/CTSM/pull/2686) [PR \#3212](https://github.com/ESCOMP/CTSM/pull/3212)) -* New equilibrium script in /tools/contrib for spectral element grids ([PR \#2991](https://github.com/ESCOMP/ctsm/pull/2991)) - -### Answer changes - -Changes to defaults for `clm6_0` physics: - -* Bytnerowicz is now the default nfix_method for clm6 ([PR \#2972](https://github.com/ESCOMP/ctsm/pull/2972)) -* New initial conditions files for f09 ("1-degree" 1850, 2000), f19 (“2-degree” 1850), and ne30 (1850, 1979, 2000) resolutions? -* Updates to MEGAN for BVOCs ([PR \#3065](https://github.com/ESCOMP/CTSM/pull/3065) [PR \#3309](https://github.com/ESCOMP/CTSM/pull/3309)) +# Purpose and description of changes since CTSM 5.3 (tag `ctsm5.3.021`) + +## New features + +* New surface datasets from CMIP7 data including PFT and urban distributions, land use transitions, population density, and atmospheric C isotopes. These data are only available through the historical record (1850-2023), and + * are not available for future periods (presently known as SSP), + * nitrogen deposition is calculated by CAM-CHEM, and not yet available from CESM3, + * for future periods and N deposition we continue to use CMIP6 data from CESM2. +* Option to use CRUJRA2024 atmospheric driver data with clm6 and clm5 physics options ([PR \\\#2956](https://github.com/ESCOMP/ctsm/pull/2956)), this is the default data-atmosphere (DATM) for clm6. This CRUJRA dataset covers 1901-2023, whereas previous GSWP3 only covers 1901-2014. +* Capability to run single-point PLUMBER tower sites, similar to the NEON tower capability ([issue \\\#1487](https://github.com/ESCOMP/CTSM/issues/1487)). Initial conditions are not provided for PLUMBER sites. +* New CLM\_CMIP\_ERA flag in env\_run.xml. Valid options are cmip7 and cmip6. Defaults to cmip7 except in compsets containing SSP for which it defaults to cmip6 because there are no future-period datasets yet available for CMIP7. +* Automatic, more flexible use of anomaly forcings for CMIP6 ISSP cases, which also use the cmip6 CLM\_CMIP\_ERA flag: [Documentation](https://escomp.github.io/CTSM/users_guide/running-special-cases/Running-with-anomaly-forcing.html) + +* Unsupported script that checks for spinup equilibrium in `tools/contrib/` for spectral element grids ([PR \\\#2991](https://github.com/ESCOMP/ctsm/pull/2991)). +* New paramfile tools that allow users to query and modify CLM parameter files ([documentation](https://escomp.github.io/CTSM/users_guide/using-clm-tools/paramfile-tools.html)) +* Optional time-evolving \`leafcn\_target\`. More under “Additional detail” below. +* New vertical movement scheme for soil nitrate, which is off by default (PR \\[\#2992](https://github.com/ESCOMP/CTSM/pull/2992)). +* Documentation improvements and new URL: https://escomp.github.io/CTSM/index.html. +* FATES: + * Grazing ([sci.1.81.0\_api.37.1.0](https://github.com/NGEET/fates/releases/tag/sci.1.81.0_api.37.1.0)). + * Johnson and Berry 2021 electron transport model ([sci.1.85.0\_api.40.0.0](https://github.com/NGEET/fates/releases/tag/sci.1.85.0_api.40.0.0)). + * Managed Fire ([sci.1.87.0\_api.41.0.0](https://github.com/NGEET/fates/releases/tag/sci.1.87.0_api.41.0.0)). + +## Answer changes + +Changes to defaults for \`clm6\` physics: + +* New CMIP7 surface and landuse timeseries datasets (see in Additional Details below). +* New namelist variables \`snow\_thermal\_cond\_glc\_method\` and \`snow\_thermal\_cond\_lake\_method\` ([PR \\\#3072](https://github.com/ESCOMP/CTSM/pull/3072)). Snow thermal conductivity uses Jordan1991 over glaciers to reduce Greenland melt rates by default and Sturm over land and lake land units. +* Bytnerowicz is now the default nfix\_method for clm6 (\[PR \\\#2972\]([https://github.com/ESCOMP/ctsm/pull/2972](https://github.com/ESCOMP/ctsm/pull/2972))) which revises the temperature function for nitrogen fixation, replacing the Houlton *et al.* function. +* Updates to MEGAN for BVOCs (\[PR \\\#3065\](https://github.com/ESCOMP/CTSM/pull/3065) [PR \\\#3309](https://github.com/ESCOMP/CTSM/pull/3309)). Removes dependence on soil moisture from clm6 physics. +* New model parameter values that were calibrated to improve carbon cycle representation with CRUJRA. +* New model parameter values that were calibrated to improve the fire model. Now using li2024 fire code. +* New initial conditions files for f09 ("1-degree" 1850, 2000), f19 (“2-degree” 1850), and ne30 (1850, 1979, 2000\) resolutions. +* Change default for glcmec\_downscale\_longwave to FALSE for clm6 physics as turning off the LW downscaling improves the melt and runoff biases. +* See “Changes to FATES and the FATES parameter file” below. +* Namelist defaults change so that + * use\_c13/use\_c14 are on only for HistClm60Bgc compsets with CRUJRA2024 or CAM7 forcing; examples of when use\_c13/use\_c14 are now off include SSP and single-point compsets, as well as cases using older forcings, such as CAM6, GSWP3v1, Qian, and CRUv7 + * when use\_c13 or use\_c14 is on, turn on the corresponding time series file + * irrigation is on for transient cases (1850-2000, 1850-2100, but not for clm4\_5). Changes for all physics versions: -* Parameters updated: Added MIMICS parameter `mimics_fi`. ([PR \#2365](https://github.com/ESCOMP/CTSM/pull/2365)) -* FATES parameter file updated: ([PR \#2965](https://github.com/ESCOMP/CTSM/pull/2965) [PR \#2904](https://github.com/ESCOMP/CTSM/pull/2904) [PR \#1344](https://https://github.com/NGEET/fates/pull/1344) [PR \#3087](https://github.com/ESCOMP/CTSM/pull/3087)) -* New surface datasets and landuse timeseries files (see section below). - -### Heads up +* Parameters updated: Added MIMICS parameter \`mimics\_fi\` (fraction of litter inputs that bypass litter pools, directly contributing to SOM) and updated other MIMICS parameters (\[PR \\\#2365\]([https://github.com/ESCOMP/CTSM/pull/2365](https://github.com/ESCOMP/CTSM/pull/2365))) to remove NPP control on turnover, fix density dependent control on turnover, add litterfall fluxes that bypass litter pools and contribute directly to soil organic matter. +* FATES parameter file updated: ([PR \\\#2965](https://github.com/ESCOMP/CTSM/pull/2965), [PR \\\#2904](https://github.com/ESCOMP/CTSM/pull/2904), [PR \\\#1344](https://github.com/NGEET/fates/pull/1344), [PR \\\#3087](https://github.com/ESCOMP/CTSM/pull/3087)). See “FATES parameter file” section below for details. +* New surface datasets and landuse timeseries files (see “surface datasets” section below). -* History tapes now split into two files from hX to hXi and hXa, where X is the tape number (e.g. h0i/h0a) and where "i" stands for history file containing instantaneous fields, while "a" stands for history file containing non-instantaneous fields. Details below and in the PRs [\#2445](https://github.com/ESCOMP/ctsm/pull/2445) [\#117](https://github.com/ESCOMP/MOSART/pull/117) [\#61](https://github.com/ESCOMP/RTM/pull/61) and the correspondng issues. -* As of ctsm5.3.040, the new ctsm_pylib conda environment is incompatible with our tools from before ctsm5.3.040 and vice versa. If you have a ctsm_pylib conda environment installed from before ctsm5.3.040, keep that under a different name. We suggest the following command for doing this in a local copy of ctsm5.3.040 or later: +## Heads up -./py_env_create -r ctsm_pylib_old - -This first renames your existing ctsm_pylib to ctsm_pylib_old and then installs the Python 3.13.2 version as ctsm_pylib. If you are unsure whether you already have ctsm_pylib installed, use the same command regardless, as it will skip the rename step if necessary. +* History tapes now split into two files from hX to hXi and hXa, where X is the tape number (e.g. h0i/h0a) and where "i" stands for history file containing instantaneous fields, while "a" stands for history file containing non-instantaneous fields. Details in the “history files” section below and in the PRs \[\\\#2445\](https://github.com/ESCOMP/ctsm/pull/2445) \[\\\#117\](https://github.com/ESCOMP/MOSART/pull/117) \[\\\#61\](https://github.com/ESCOMP/RTM/pull/61) and the corresponding issues. +* Adding time to 1d weighting fields in transient simulations PR \\[\#3328](https://github.com/ESCOMP/CTSM/pull/3328) +* Regarding CMIP7 vs. CMIP6 inputs: + * We supply only CMIP7 C13/C14 isotope datasets, so these get used regardless of CLM\_CMIP\_ERA setting. + * We supply only CMIP7 population density with clm6 physics in non-SSP cases, because the fire model is calibrated to that; conversely, we supply only CMIP6 population density for pre-clm6 physics and for SSP cases. + * We supply only CESM2 nitrogen deposition (ndep), so this gets used regardless of CLM\_CMIP\_ERA setting. + * For DATM we supply only CMIP6 aerosols. + * For DATM we supply only CMIP6 CO2. +* Issue with DOUT\_S\_SAVE\_INTERIM\_REST [https://github.com/ESCOMP/CTSM/issues/3351](https://github.com/ESCOMP/CTSM/issues/3351) was fixed. +* As of ctsm5.3.040, the new ctsm\_pylib conda environment is incompatible with our tools from before ctsm5.3.040 and vice versa. More under “Additional detail” below. -Information about additional py_env_create options — including how to install a fresh copy of the old conda environment — is available as follows: - -./py_env_create --help +# Additional detail -## +## Changes related to history files -## Additional detail +(Note 1: The same information in this section applies to MOSART and RTM. +Note 2: The gist of the information in this section also appears in the CTSM User’s Guide here [https://escomp.github.io/CTSM/users\_guide/setting-up-and-running-a-case/customizing-the-clm-namelist.html\#various-ways-to-change-history-output-averaging-flags](https://escomp.github.io/CTSM/users_guide/setting-up-and-running-a-case/customizing-the-clm-namelist.html#various-ways-to-change-history-output-averaging-flags)) -### Changes related to history files +Following ctsm5.3.018 "Change history time to be the middle of the time bounds" and keeping CLM history consistent with CAM history, the CTSM5.4 change intends to prevent confusion associated with the time corresponding to instantaneous history fields by putting them on separate files than non-instantaneous fields. -(Note that the same information in this section applies to MOSART and RTM.) +The now separate instantaneous history files represent the exact time step when they were written and do not include a time\_bounds variable. Conversely, non-instantaneous history files represent the period of their time\_bounds variable. As a result, time data on non-instantaneous history files are now read correctly during post processing (e.g. by xarray). Special handling may still be needed for instantaneous history files, whose timestamps represent the date and time at the END of the history timestep. So, e.g., an instantaneous variable saved at the end of year 2023 will get the timestamp 2024-01-01 00:00:00. -Following ctsm5.3.018 "Change history time to be the middle of the time bounds" and to keep CLM history consistent with CAM history, the CTSM5.4 change intends to prevent confusion associated with the time corresponding to instantaneous history fields by putting them on separate files than non-instantaneous fields. The result is +Users will now see: -1) two history files per clm, mosart, and rtm history tape: - tape h0 becomes h0a and h0i - tape h1 becomes h1a and h1i - ... +1\) Two history files per clm, mosart, and rtm history tape: + tape h0 becomes h0a and h0i + tape h1 becomes h1a and h1i + ... tape hX becomes hXa and hXi -2) two history restart files per history restart tape: - rh0 becomes rh0a and rh0i - rh1 becomes rh1a and rh1i - ... +2\) Two history-restart files per history restart tape: + rh0 becomes rh0a and rh0i + rh1 becomes rh1a and rh1i + ... rhX becomes rhXa and rhXi -The CLM handles empty history (and corresponding history restart) files by not generating them, while rtm and mosart give an error. Instead of refactoring rtm and mosart to behave like the clm (considered out of scope), we have introduced one active instantaneous field in mosart and one in rtm to bypass the "empty file" error. - -### New surface datasets and landuse timeseries files ([PR \#xxxx](https://github.com/ESCOMP/CTSM/pull/xxxx)) +The CLM handles empty history (and corresponding history-restart) files by not generating them, while rtm and mosart give an error. Instead of refactoring rtm and mosart to behave like the clm (considered out of scope), we have introduced one active instantaneous field in mosart and one in rtm to bypass the "empty file" error. + +## New surface datasets and landuse timeseries files (\[PR \\\#3482\](https://github.com/ESCOMP/CTSM/pull/3482)) + +* Transient landuse timeseries files going back to 1700 made for f09 and 360x720 grids. +* New resolutions now supported: ne3np4.pg3, mpasa30, ne0np4.NATL.ne30x8 (\[PR \\\#3482\](https://github.com/ESCOMP/CTSM/pull/3482)) +* Updates to input datasets (also referred to as raw datasets): + * PFT/LAI/soil-color raw datasets; now from the CMIP7 timeseries that ends in 2023 (Issues [\\\#2851](https://github.com/ESCOMP/CTSM/issues/2851)). + * Two fire datasets: crop fire peak month and population density (Issue + * \[\\\#2701\]([https://github.com/ESCOMP/CTSM/issues/2701](https://github.com/ESCOMP/CTSM/issues/2701)) \[\\\#3302\](https://github.com/ESCOMP/CTSM/issues/3302)). + * Transient (historical) urban datasets are now based on CMIP7 urban data, partitioned into TBD, HD, and MD classes in proportion to GaoOneill present day classification. + +## Changes to FATES and the FATES parameter file + +* See [HLM-FATES compatibility table](https://fates-users-guide.readthedocs.io/en/latest/user/release-tags-compat-table.html) in the FATES user’s guide for all FATES tags associated with CTSM tag updates +* FATES answer changing updates + * The default hydro solver is updated to 2D Picard from 1D Taylor ([ctsm5.3.027](https://github.com/ESCOMP/CTSM/releases/tag/ctsm5.3.027)) + * Simplified leaf sun-shade fraction for two-stream radiation ([sci.1.83.0\_api.39.0.0](https://github.com/NGEET/fates/releases/tag/sci.1.83.0_api.39.0.0)) + * Default maximum canopy layer updated from 2 to 3 ([sci.1.87.1\_api.41.0.0](https://github.com/NGEET/fates/releases/tag/sci.1.87.1_api.41.0.0)) + * Various bug fixes (see compatibility table) +* FATES Parameter File Updates + * ctsm5.3.025 (API 37\) + * Adds pft-dependent btran model switches + * Adds parameters for land use grazing + * Updates the FATES z0mr turbulence parameters for consistency with CLM + * ctsm5.3.027 (API 38\) + * Migrates a number of global parameter file variables to the namelist + * Adds \`fates\_leaf\_fnps\` parameter for the electron transport model + * \`fates\_leaf\_theta\_cj\_c3\` and \`fates\_leaf\_theta\_cj\_c4\` depricated + * ctsm5.3.045 (API 40\) + * Changes to the default competitive exclusion parameter from probabilistic to rank-ordered sorting of cohorts by default + * Sets the logging default to clear cut + * Refactors the pft-specific phenology habit selection into a single parameter + * ctsm5.3.070 (API 41\) + * Add parameters for the managed fire feature addition + * Corrects the fates landuse crop pft to c3 cool grass + +## New ctsm\_pylib conda environment + +If you have a ctsm\_pylib conda environment installed from before ctsm5.3.040, you may want to keep that under a different name. We suggest the following command for doing this in a local copy of ctsm5.3.040 or later: + +```shell +./py_env_create -r ctsm_pylib_old +``` -* Transient landuse timeseries files going back to 1700 made for f09. -* Surface datasets now provided for the `xxxx` grid. ([PR \#xxxx](https://github.com/ESCOMP/CTSM/pull/xxxx), [issue \#xxxx](https://github.com/ESCOMP/CTSM/issues/xxxx)) -* Updates to input datasets: - * PFT/LAI/soil-color raw datasets; now from the xxxx timeseries that ends in 2023. (Issues [\#xxxx](https://github.com/ESCOMP/CTSM/issues/xxxx) - * Two fire datasets: crop fire peak month and population density. (Issue [\#xxxx](https://github.com/ESCOMP/CTSM/issues/xxxx)) +This first renames your existing ctsm\_pylib to ctsm\_pylib\_old and then installs the Python 3.13.2 version as ctsm\_pylib. If you are unsure whether you already have ctsm\_pylib installed, use the same command regardless, as it will skip the renaming step if necessary. -### Changes to FATES parameter file +Information about additional py\_env\_create options — including how to install a fresh copy of the old conda environment — is available as follows: - * +```shell +./py_env_create --help +``` -### Changes to rpointer files +## Potentially time-evolving \`leafcn\_target\` replaces time-constant \`leafcn\` +The former is calculated as a function of the latter and can be time-evolving depending on new paramfile parameter \`leafcn\_co2\_slope\` (\[PR \\\#1654\](https://github.com/ESCOMP/ctsm/pull/1654). The time-evolving effect defaults to off with \`leafcn\_co2\_slope\` \= 0 on the parameter file. -## Simulations supporting this release +# Simulations supporting this release by providing initial conditions -- f19 `Clm60Bgc` 16pft: [https://github.com/NCAR/LMWG\_dev/issues/xxx](https://github.com/NCAR/LMWG_dev/issues/xxx) -- f09 with `Clm60BgcCrop`: [https://github.com/NCAR/LMWG\_dev/issues/xxx](https://github.com/NCAR/LMWG_dev/issues/xxx) -- ne30 with `Clm60BgcCrop`: [https://github.com/NCAR/LMWG\_dev/issues/xxx](https://github.com/NCAR/LMWG_dev/issues/xxx) +* f19 \`Clm60BgcCruJra\` 16pft: https://github.com/NCAR/LMWG\_dev/issues/125 +* f09 with \`Clm60BgcCropCruJra\`: https://github.com/NCAR/LMWG\_dev/issues/124 +* ne30 with \`Clm60BgcCropCruJra\`: [https://github.com/NCAR/LMWG\_dev/issues/123](https://github.com/NCAR/LMWG_dev/issues/123) (123\_HIST\_popDens) +* ne30 SP https://github.com/NCAR/LMWG\_dev/issues/126 +* f09 SP https://github.com/NCAR/LMWG\_dev/issues/127 From a8b1afeccebaf90cb091b6032bede0e6c59cfa81 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Mon, 24 Nov 2025 17:17:25 -0700 Subject: [PATCH 116/129] Minor improvements to documentation --- WhatsNewInCTSM5.4.md | 1 - .../setting-up-and-running-a-case/history_fields_fates.rst | 2 +- .../setting-up-and-running-a-case/history_fields_nofates.rst | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/WhatsNewInCTSM5.4.md b/WhatsNewInCTSM5.4.md index 35806d6f13..d868d87321 100755 --- a/WhatsNewInCTSM5.4.md +++ b/WhatsNewInCTSM5.4.md @@ -6,7 +6,6 @@ * New surface datasets from CMIP7 data including PFT and urban distributions, land use transitions, population density, and atmospheric C isotopes. These data are only available through the historical record (1850-2023), and * are not available for future periods (presently known as SSP), - * nitrogen deposition is calculated by CAM-CHEM, and not yet available from CESM3, * for future periods and N deposition we continue to use CMIP6 data from CESM2. * Option to use CRUJRA2024 atmospheric driver data with clm6 and clm5 physics options ([PR \\\#2956](https://github.com/ESCOMP/ctsm/pull/2956)), this is the default data-atmosphere (DATM) for clm6. This CRUJRA dataset covers 1901-2023, whereas previous GSWP3 only covers 1901-2014. * Capability to run single-point PLUMBER tower sites, similar to the NEON tower capability ([issue \\\#1487](https://github.com/ESCOMP/CTSM/issues/1487)). Initial conditions are not provided for PLUMBER sites. diff --git a/doc/source/users_guide/setting-up-and-running-a-case/history_fields_fates.rst b/doc/source/users_guide/setting-up-and-running-a-case/history_fields_fates.rst index 6c037f707d..ea964fc433 100644 --- a/doc/source/users_guide/setting-up-and-running-a-case/history_fields_fates.rst +++ b/doc/source/users_guide/setting-up-and-running-a-case/history_fields_fates.rst @@ -3,7 +3,7 @@ CTSM History Fields (fates) ============================= CAUTION: Not all variables are relevant / present for all CTSM cases. -NOTE: Instantaneous fields will appear in history files labeled with h0i, h1i, ... and non-instantaneous fields will appear in history fields labeled with h0a, h1a, ... +NOTE: Instantaneous fields will appear in history files labeled with h0i, h1i, ... and non-instantaneous fields will appear in history files labeled with h0a, h1a, ... Key flags used in this CTSM case: use_cn = F diff --git a/doc/source/users_guide/setting-up-and-running-a-case/history_fields_nofates.rst b/doc/source/users_guide/setting-up-and-running-a-case/history_fields_nofates.rst index a38b8a9c9b..5322ae79a2 100644 --- a/doc/source/users_guide/setting-up-and-running-a-case/history_fields_nofates.rst +++ b/doc/source/users_guide/setting-up-and-running-a-case/history_fields_nofates.rst @@ -3,7 +3,7 @@ CTSM History Fields (nofates) ============================= CAUTION: Not all variables are relevant / present for all CTSM cases. -NOTE: Instantaneous fields will appear in history files labeled with h0i, h1i, ... and non-instantaneous fields will appear in history fields labeled with h0a, h1a, ... +NOTE: Instantaneous fields will appear in history files labeled with h0i, h1i, ... and non-instantaneous fields will appear in history files labeled with h0a, h1a, ... Key flags used in this CTSM case: use_cn = T From 060bd7c5a48c9ead38151ce069591e0833b27fea Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Mon, 24 Nov 2025 17:51:48 -0700 Subject: [PATCH 117/129] Update README and default_data*.cfg files to refer to 5.4, not 5.3 --- README | 6 +++--- python/ctsm/test/testinputs/default_data.cfg | 4 ++-- python/ctsm/test/testinputs/default_data_gswp3.cfg | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/README b/README index b752d07660..dc38231173 100644 --- a/README +++ b/README @@ -1,6 +1,6 @@ -$CTSMROOT/README 09/05/2024 +$CTSMROOT/README 11/24/2025 -Community Terrestrial Systems Model (CTSM) science version 5.3 series -- source code, tools, +Community Terrestrial Systems Model (CTSM) science version 5.4 series -- source code, tools, offline-build and test scripts. This gives you everything you need to run CTSM with CESM with the CMEPS driver and CDEPS data models to provide CRUJRA or GSWP3 forcing data (some older options also available) in place of a modeled atmosphere. @@ -76,7 +76,7 @@ README ------------------- This file README.md ---------------- File that displays on github under https::/github.com/ESCOMP/CTSM.git README.rst --------------- File that displays under the project in github README_GITFLEXIMOD.rst --- Information on how to work with git-fleximod for CTSM -WhatsNewInCTSM5.3.md ----- Overview document of the changes between ctsm5.2.0 and ctsm5.3.0 +WhatsNewInCTSM5.4.md ----- Overview document of the changes between ctsm5.3 and ctsm5.4 CODE_OF_CONDUCT.md ------- Code of Conduct for how to work with each other on the CTSM project Copyright ---------------- CESM Copyright file doc/UpdateChangeLog.pl --- Script to add documentation on a tag to the diff --git a/python/ctsm/test/testinputs/default_data.cfg b/python/ctsm/test/testinputs/default_data.cfg index 60c012561c..9d9a781947 100644 --- a/python/ctsm/test/testinputs/default_data.cfg +++ b/python/ctsm/test/testinputs/default_data.cfg @@ -15,14 +15,14 @@ precname = CLMCRUJRA2024.Precip tpqwname = CLMCRUJRA2024.TPQW [surfdat] -dir = lnd/clm2/surfdata_esmf/ctsm5.3.0 +dir = lnd/clm2/surfdata_esmf/ctsm5.4.0 surfdat_16pft = surfdata_0.9x1.25_hist_2000_16pfts_c240908.nc surfdat_78pft = surfdata_0.9x1.25_hist_2000_78pfts_c240908.nc mesh_dir = share/meshes/ mesh_surf = fv0.9x1.25_141008_ESMFmesh.nc [landuse] -dir = lnd/clm2/surfdata_esmf/ctsm5.3.0 +dir = lnd/clm2/surfdata_esmf/ctsm5.4.0 landuse_16pft = landuse.timeseries_0.9x1.25_SSP2-4.5_1850-2100_78pfts_c240908.nc landuse_78pft = landuse.timeseries_0.9x1.25_SSP2-4.5_1850-2100_78pfts_c240908.nc diff --git a/python/ctsm/test/testinputs/default_data_gswp3.cfg b/python/ctsm/test/testinputs/default_data_gswp3.cfg index 09e1463eb2..e5eb46d681 100644 --- a/python/ctsm/test/testinputs/default_data_gswp3.cfg +++ b/python/ctsm/test/testinputs/default_data_gswp3.cfg @@ -15,14 +15,14 @@ precname = CLMGSWP3v1.Precip tpqwname = CLMGSWP3v1.TPQW [surfdat] -dir = lnd/clm2/surfdata_esmf/ctsm5.3.0 +dir = lnd/clm2/surfdata_esmf/ctsm5.4.0 surfdat_16pft = surfdata_0.9x1.25_hist_2000_16pfts_c240908.nc surfdat_78pft = surfdata_0.9x1.25_hist_2000_78pfts_c240908.nc mesh_dir = share/meshes/ mesh_surf = fv0.9x1.25_141008_ESMFmesh.nc [landuse] -dir = lnd/clm2/surfdata_esmf/ctsm5.3.0 +dir = lnd/clm2/surfdata_esmf/ctsm5.4.0 landuse_16pft = landuse.timeseries_0.9x1.25_SSP2-4.5_1850-2100_78pfts_c240908.nc landuse_78pft = landuse.timeseries_0.9x1.25_SSP2-4.5_1850-2100_78pfts_c240908.nc From addc86e067f2127f3eb03b324f6cd0e7a6b2d98f Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Mon, 24 Nov 2025 18:08:12 -0700 Subject: [PATCH 118/129] Corrections to the WhatsNew markdown file --- WhatsNewInCTSM5.4.md | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/WhatsNewInCTSM5.4.md b/WhatsNewInCTSM5.4.md index d868d87321..248008ea74 100755 --- a/WhatsNewInCTSM5.4.md +++ b/WhatsNewInCTSM5.4.md @@ -7,15 +7,15 @@ * New surface datasets from CMIP7 data including PFT and urban distributions, land use transitions, population density, and atmospheric C isotopes. These data are only available through the historical record (1850-2023), and * are not available for future periods (presently known as SSP), * for future periods and N deposition we continue to use CMIP6 data from CESM2. -* Option to use CRUJRA2024 atmospheric driver data with clm6 and clm5 physics options ([PR \\\#2956](https://github.com/ESCOMP/ctsm/pull/2956)), this is the default data-atmosphere (DATM) for clm6. This CRUJRA dataset covers 1901-2023, whereas previous GSWP3 only covers 1901-2014. -* Capability to run single-point PLUMBER tower sites, similar to the NEON tower capability ([issue \\\#1487](https://github.com/ESCOMP/CTSM/issues/1487)). Initial conditions are not provided for PLUMBER sites. +* Option to use CRUJRA2024 atmospheric driver data with clm6 and clm5 physics options ([PR \#2956](https://github.com/ESCOMP/ctsm/pull/2956)), this is the default data-atmosphere (DATM) for clm6. This CRUJRA dataset covers 1901-2023, whereas previous GSWP3 only covers 1901-2014. +* Capability to run single-point PLUMBER tower sites, similar to the NEON tower capability ([issue \#1487](https://github.com/ESCOMP/CTSM/issues/1487)). Initial conditions are not provided for PLUMBER sites. * New CLM\_CMIP\_ERA flag in env\_run.xml. Valid options are cmip7 and cmip6. Defaults to cmip7 except in compsets containing SSP for which it defaults to cmip6 because there are no future-period datasets yet available for CMIP7. * Automatic, more flexible use of anomaly forcings for CMIP6 ISSP cases, which also use the cmip6 CLM\_CMIP\_ERA flag: [Documentation](https://escomp.github.io/CTSM/users_guide/running-special-cases/Running-with-anomaly-forcing.html) -* Unsupported script that checks for spinup equilibrium in `tools/contrib/` for spectral element grids ([PR \\\#2991](https://github.com/ESCOMP/ctsm/pull/2991)). +* Unsupported script that checks for spinup equilibrium in `tools/contrib/` for spectral element grids ([PR \#2991](https://github.com/ESCOMP/ctsm/pull/2991)). * New paramfile tools that allow users to query and modify CLM parameter files ([documentation](https://escomp.github.io/CTSM/users_guide/using-clm-tools/paramfile-tools.html)) * Optional time-evolving \`leafcn\_target\`. More under “Additional detail” below. -* New vertical movement scheme for soil nitrate, which is off by default (PR \\[\#2992](https://github.com/ESCOMP/CTSM/pull/2992)). +* New vertical movement scheme for soil nitrate, which is off by default (PR [\#2992](https://github.com/ESCOMP/CTSM/pull/2992)). * Documentation improvements and new URL: https://escomp.github.io/CTSM/index.html. * FATES: * Grazing ([sci.1.81.0\_api.37.1.0](https://github.com/NGEET/fates/releases/tag/sci.1.81.0_api.37.1.0)). @@ -27,9 +27,9 @@ Changes to defaults for \`clm6\` physics: * New CMIP7 surface and landuse timeseries datasets (see in Additional Details below). -* New namelist variables \`snow\_thermal\_cond\_glc\_method\` and \`snow\_thermal\_cond\_lake\_method\` ([PR \\\#3072](https://github.com/ESCOMP/CTSM/pull/3072)). Snow thermal conductivity uses Jordan1991 over glaciers to reduce Greenland melt rates by default and Sturm over land and lake land units. -* Bytnerowicz is now the default nfix\_method for clm6 (\[PR \\\#2972\]([https://github.com/ESCOMP/ctsm/pull/2972](https://github.com/ESCOMP/ctsm/pull/2972))) which revises the temperature function for nitrogen fixation, replacing the Houlton *et al.* function. -* Updates to MEGAN for BVOCs (\[PR \\\#3065\](https://github.com/ESCOMP/CTSM/pull/3065) [PR \\\#3309](https://github.com/ESCOMP/CTSM/pull/3309)). Removes dependence on soil moisture from clm6 physics. +* New namelist variables \`snow\_thermal\_cond\_glc\_method\` and \`snow\_thermal\_cond\_lake\_method\` ([PR \#3072](https://github.com/ESCOMP/CTSM/pull/3072)). Snow thermal conductivity uses Jordan1991 over glaciers to reduce Greenland melt rates by default and Sturm over land and lake land units. +* Bytnerowicz is now the default nfix\_method for clm6 (https://github.com/ESCOMP/ctsm/pull/2972) which revises the temperature function for nitrogen fixation, replacing the Houlton *et al.* function. +* Updates to MEGAN for BVOCs (https://github.com/ESCOMP/CTSM/pull/3065 https://github.com/ESCOMP/CTSM/pull/3309). Removes dependence on soil moisture from clm6 physics. * New model parameter values that were calibrated to improve carbon cycle representation with CRUJRA. * New model parameter values that were calibrated to improve the fire model. Now using li2024 fire code. * New initial conditions files for f09 ("1-degree" 1850, 2000), f19 (“2-degree” 1850), and ne30 (1850, 1979, 2000\) resolutions. @@ -42,13 +42,13 @@ Changes to defaults for \`clm6\` physics: Changes for all physics versions: -* Parameters updated: Added MIMICS parameter \`mimics\_fi\` (fraction of litter inputs that bypass litter pools, directly contributing to SOM) and updated other MIMICS parameters (\[PR \\\#2365\]([https://github.com/ESCOMP/CTSM/pull/2365](https://github.com/ESCOMP/CTSM/pull/2365))) to remove NPP control on turnover, fix density dependent control on turnover, add litterfall fluxes that bypass litter pools and contribute directly to soil organic matter. -* FATES parameter file updated: ([PR \\\#2965](https://github.com/ESCOMP/CTSM/pull/2965), [PR \\\#2904](https://github.com/ESCOMP/CTSM/pull/2904), [PR \\\#1344](https://github.com/NGEET/fates/pull/1344), [PR \\\#3087](https://github.com/ESCOMP/CTSM/pull/3087)). See “FATES parameter file” section below for details. +* Parameters updated: Added MIMICS parameter \`mimics\_fi\` (fraction of litter inputs that bypass litter pools, directly contributing to SOM) and updated other MIMICS parameters (\[PR \#2365\]([https://github.com/ESCOMP/CTSM/pull/2365](https://github.com/ESCOMP/CTSM/pull/2365))) to remove NPP control on turnover, fix density dependent control on turnover, add litterfall fluxes that bypass litter pools and contribute directly to soil organic matter. +* FATES parameter file updated: ([PR \#2965](https://github.com/ESCOMP/CTSM/pull/2965), [PR \#2904](https://github.com/ESCOMP/CTSM/pull/2904), [PR \#1344](https://github.com/NGEET/fates/pull/1344), [PR \#3087](https://github.com/ESCOMP/CTSM/pull/3087)). See “FATES parameter file” section below for details. * New surface datasets and landuse timeseries files (see “surface datasets” section below). ## Heads up -* History tapes now split into two files from hX to hXi and hXa, where X is the tape number (e.g. h0i/h0a) and where "i" stands for history file containing instantaneous fields, while "a" stands for history file containing non-instantaneous fields. Details in the “history files” section below and in the PRs \[\\\#2445\](https://github.com/ESCOMP/ctsm/pull/2445) \[\\\#117\](https://github.com/ESCOMP/MOSART/pull/117) \[\\\#61\](https://github.com/ESCOMP/RTM/pull/61) and the corresponding issues. +* History tapes now split into two files from hX to hXi and hXa, where X is the tape number (e.g. h0i/h0a) and where "i" stands for history file containing instantaneous fields, while "a" stands for history file containing non-instantaneous fields. Details in the “history files” section below and in the PRs \[\#2445\](https://github.com/ESCOMP/ctsm/pull/2445) \[\#117\](https://github.com/ESCOMP/MOSART/pull/117) \[\#61\](https://github.com/ESCOMP/RTM/pull/61) and the corresponding issues. * Adding time to 1d weighting fields in transient simulations PR \\[\#3328](https://github.com/ESCOMP/CTSM/pull/3328) * Regarding CMIP7 vs. CMIP6 inputs: * We supply only CMIP7 C13/C14 isotope datasets, so these get used regardless of CLM\_CMIP\_ERA setting. @@ -64,7 +64,7 @@ Changes for all physics versions: ## Changes related to history files (Note 1: The same information in this section applies to MOSART and RTM. -Note 2: The gist of the information in this section also appears in the CTSM User’s Guide here [https://escomp.github.io/CTSM/users\_guide/setting-up-and-running-a-case/customizing-the-clm-namelist.html\#various-ways-to-change-history-output-averaging-flags](https://escomp.github.io/CTSM/users_guide/setting-up-and-running-a-case/customizing-the-clm-namelist.html#various-ways-to-change-history-output-averaging-flags)) +Note 2: The gist of the information in this section also appears in the [CTSM User’s Guide](https://escomp.github.io/CTSM/users_guide/setting-up-and-running-a-case/customizing-the-clm-namelist.html#various-ways-to-change-history-output-averaging-flags)). Following ctsm5.3.018 "Change history time to be the middle of the time bounds" and keeping CLM history consistent with CAM history, the CTSM5.4 change intends to prevent confusion associated with the time corresponding to instantaneous history fields by putting them on separate files than non-instantaneous fields. @@ -86,14 +86,14 @@ Users will now see: The CLM handles empty history (and corresponding history-restart) files by not generating them, while rtm and mosart give an error. Instead of refactoring rtm and mosart to behave like the clm (considered out of scope), we have introduced one active instantaneous field in mosart and one in rtm to bypass the "empty file" error. -## New surface datasets and landuse timeseries files (\[PR \\\#3482\](https://github.com/ESCOMP/CTSM/pull/3482)) +## New surface datasets and landuse timeseries files (\[PR \#3482\](https://github.com/ESCOMP/CTSM/pull/3482)) * Transient landuse timeseries files going back to 1700 made for f09 and 360x720 grids. -* New resolutions now supported: ne3np4.pg3, mpasa30, ne0np4.NATL.ne30x8 (\[PR \\\#3482\](https://github.com/ESCOMP/CTSM/pull/3482)) +* New resolutions now supported: ne3np4.pg3, mpasa30, ne0np4.NATL.ne30x8 (\[PR \#3482\](https://github.com/ESCOMP/CTSM/pull/3482)) * Updates to input datasets (also referred to as raw datasets): - * PFT/LAI/soil-color raw datasets; now from the CMIP7 timeseries that ends in 2023 (Issues [\\\#2851](https://github.com/ESCOMP/CTSM/issues/2851)). + * PFT/LAI/soil-color raw datasets; now from the CMIP7 timeseries that ends in 2023 (Issues [\#2851](https://github.com/ESCOMP/CTSM/issues/2851)). * Two fire datasets: crop fire peak month and population density (Issue - * \[\\\#2701\]([https://github.com/ESCOMP/CTSM/issues/2701](https://github.com/ESCOMP/CTSM/issues/2701)) \[\\\#3302\](https://github.com/ESCOMP/CTSM/issues/3302)). + * \[\#2701\]([https://github.com/ESCOMP/CTSM/issues/2701](https://github.com/ESCOMP/CTSM/issues/2701)) \[\#3302\](https://github.com/ESCOMP/CTSM/issues/3302)). * Transient (historical) urban datasets are now based on CMIP7 urban data, partitioned into TBD, HD, and MD classes in proportion to GaoOneill present day classification. ## Changes to FATES and the FATES parameter file @@ -139,13 +139,13 @@ Information about additional py\_env\_create options — including how to instal ## Potentially time-evolving \`leafcn\_target\` replaces time-constant \`leafcn\` -The former is calculated as a function of the latter and can be time-evolving depending on new paramfile parameter \`leafcn\_co2\_slope\` (\[PR \\\#1654\](https://github.com/ESCOMP/ctsm/pull/1654). The time-evolving effect defaults to off with \`leafcn\_co2\_slope\` \= 0 on the parameter file. +The former is calculated as a function of the latter and can be time-evolving depending on new paramfile parameter \`leafcn\_co2\_slope\` https://github.com/ESCOMP/ctsm/pull/1654. The time-evolving effect defaults to off with \`leafcn\_co2\_slope\` \= 0 on the parameter file. # Simulations supporting this release by providing initial conditions -* f19 \`Clm60BgcCruJra\` 16pft: https://github.com/NCAR/LMWG\_dev/issues/125 -* f09 with \`Clm60BgcCropCruJra\`: https://github.com/NCAR/LMWG\_dev/issues/124 -* ne30 with \`Clm60BgcCropCruJra\`: [https://github.com/NCAR/LMWG\_dev/issues/123](https://github.com/NCAR/LMWG_dev/issues/123) (123\_HIST\_popDens) -* ne30 SP https://github.com/NCAR/LMWG\_dev/issues/126 -* f09 SP https://github.com/NCAR/LMWG\_dev/issues/127 +* f19 \`Clm60BgcCruJra\` 16pft: https://github.com/NCAR/LMWG_dev/issues/125 +* f09 with \`Clm60BgcCropCruJra\`: https://github.com/NCAR/LMWG_dev/issues/124 +* ne30 with \`Clm60BgcCropCruJra\`: https://github.com/NCAR/LMWG_dev/issues/123 (123\_HIST\_popDens) +* ne30 SP https://github.com/NCAR/LMWG_dev/issues/126 +* f09 SP https://github.com/NCAR/LMWG_dev/issues/127 From cd3558f73e115645004f7ec1ea6d2336a820086e Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Mon, 24 Nov 2025 18:12:11 -0700 Subject: [PATCH 119/129] More corrections to the WhatsNew file --- WhatsNewInCTSM5.4.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/WhatsNewInCTSM5.4.md b/WhatsNewInCTSM5.4.md index 248008ea74..6f1015757e 100755 --- a/WhatsNewInCTSM5.4.md +++ b/WhatsNewInCTSM5.4.md @@ -7,15 +7,15 @@ * New surface datasets from CMIP7 data including PFT and urban distributions, land use transitions, population density, and atmospheric C isotopes. These data are only available through the historical record (1850-2023), and * are not available for future periods (presently known as SSP), * for future periods and N deposition we continue to use CMIP6 data from CESM2. -* Option to use CRUJRA2024 atmospheric driver data with clm6 and clm5 physics options ([PR \#2956](https://github.com/ESCOMP/ctsm/pull/2956)), this is the default data-atmosphere (DATM) for clm6. This CRUJRA dataset covers 1901-2023, whereas previous GSWP3 only covers 1901-2014. -* Capability to run single-point PLUMBER tower sites, similar to the NEON tower capability ([issue \#1487](https://github.com/ESCOMP/CTSM/issues/1487)). Initial conditions are not provided for PLUMBER sites. +* Option to use CRUJRA2024 atmospheric driver data with clm6 and clm5 physics options ([PR #2956](https://github.com/ESCOMP/ctsm/pull/2956)), this is the default data-atmosphere (DATM) for clm6. This CRUJRA dataset covers 1901-2023, whereas previous GSWP3 only covers 1901-2014. +* Capability to run single-point PLUMBER tower sites, similar to the NEON tower capability ([issue #1487](https://github.com/ESCOMP/CTSM/issues/1487)). Initial conditions are not provided for PLUMBER sites. * New CLM\_CMIP\_ERA flag in env\_run.xml. Valid options are cmip7 and cmip6. Defaults to cmip7 except in compsets containing SSP for which it defaults to cmip6 because there are no future-period datasets yet available for CMIP7. * Automatic, more flexible use of anomaly forcings for CMIP6 ISSP cases, which also use the cmip6 CLM\_CMIP\_ERA flag: [Documentation](https://escomp.github.io/CTSM/users_guide/running-special-cases/Running-with-anomaly-forcing.html) -* Unsupported script that checks for spinup equilibrium in `tools/contrib/` for spectral element grids ([PR \#2991](https://github.com/ESCOMP/ctsm/pull/2991)). +* Unsupported script that checks for spinup equilibrium in `tools/contrib/` for spectral element grids ([PR #2991](https://github.com/ESCOMP/ctsm/pull/2991)). * New paramfile tools that allow users to query and modify CLM parameter files ([documentation](https://escomp.github.io/CTSM/users_guide/using-clm-tools/paramfile-tools.html)) * Optional time-evolving \`leafcn\_target\`. More under “Additional detail” below. -* New vertical movement scheme for soil nitrate, which is off by default (PR [\#2992](https://github.com/ESCOMP/CTSM/pull/2992)). +* New vertical movement scheme for soil nitrate, which is off by default (PR [#2992](https://github.com/ESCOMP/CTSM/pull/2992)). * Documentation improvements and new URL: https://escomp.github.io/CTSM/index.html. * FATES: * Grazing ([sci.1.81.0\_api.37.1.0](https://github.com/NGEET/fates/releases/tag/sci.1.81.0_api.37.1.0)). @@ -27,7 +27,7 @@ Changes to defaults for \`clm6\` physics: * New CMIP7 surface and landuse timeseries datasets (see in Additional Details below). -* New namelist variables \`snow\_thermal\_cond\_glc\_method\` and \`snow\_thermal\_cond\_lake\_method\` ([PR \#3072](https://github.com/ESCOMP/CTSM/pull/3072)). Snow thermal conductivity uses Jordan1991 over glaciers to reduce Greenland melt rates by default and Sturm over land and lake land units. +* New namelist variables \`snow\_thermal\_cond\_glc\_method\` and \`snow\_thermal\_cond\_lake\_method\` ([PR #3072](https://github.com/ESCOMP/CTSM/pull/3072)). Snow thermal conductivity uses Jordan1991 over glaciers to reduce Greenland melt rates by default and Sturm over land and lake land units. * Bytnerowicz is now the default nfix\_method for clm6 (https://github.com/ESCOMP/ctsm/pull/2972) which revises the temperature function for nitrogen fixation, replacing the Houlton *et al.* function. * Updates to MEGAN for BVOCs (https://github.com/ESCOMP/CTSM/pull/3065 https://github.com/ESCOMP/CTSM/pull/3309). Removes dependence on soil moisture from clm6 physics. * New model parameter values that were calibrated to improve carbon cycle representation with CRUJRA. @@ -42,7 +42,7 @@ Changes to defaults for \`clm6\` physics: Changes for all physics versions: -* Parameters updated: Added MIMICS parameter \`mimics\_fi\` (fraction of litter inputs that bypass litter pools, directly contributing to SOM) and updated other MIMICS parameters (\[PR \#2365\]([https://github.com/ESCOMP/CTSM/pull/2365](https://github.com/ESCOMP/CTSM/pull/2365))) to remove NPP control on turnover, fix density dependent control on turnover, add litterfall fluxes that bypass litter pools and contribute directly to soil organic matter. +* Parameters updated: Added MIMICS parameter \`mimics\_fi\` (fraction of litter inputs that bypass litter pools, directly contributing to SOM) and updated other MIMICS parameters (https://github.com/ESCOMP/CTSM/pull/2365) to remove NPP control on turnover, fix density dependent control on turnover, add litterfall fluxes that bypass litter pools and contribute directly to soil organic matter. * FATES parameter file updated: ([PR \#2965](https://github.com/ESCOMP/CTSM/pull/2965), [PR \#2904](https://github.com/ESCOMP/CTSM/pull/2904), [PR \#1344](https://github.com/NGEET/fates/pull/1344), [PR \#3087](https://github.com/ESCOMP/CTSM/pull/3087)). See “FATES parameter file” section below for details. * New surface datasets and landuse timeseries files (see “surface datasets” section below). From b5fa1cf8ac3597d36b27732fdf96b94a063685f1 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Mon, 24 Nov 2025 18:20:09 -0700 Subject: [PATCH 120/129] More corrections to the WhatsNew file --- WhatsNewInCTSM5.4.md | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/WhatsNewInCTSM5.4.md b/WhatsNewInCTSM5.4.md index 6f1015757e..fe721ae312 100755 --- a/WhatsNewInCTSM5.4.md +++ b/WhatsNewInCTSM5.4.md @@ -48,8 +48,8 @@ Changes for all physics versions: ## Heads up -* History tapes now split into two files from hX to hXi and hXa, where X is the tape number (e.g. h0i/h0a) and where "i" stands for history file containing instantaneous fields, while "a" stands for history file containing non-instantaneous fields. Details in the “history files” section below and in the PRs \[\#2445\](https://github.com/ESCOMP/ctsm/pull/2445) \[\#117\](https://github.com/ESCOMP/MOSART/pull/117) \[\#61\](https://github.com/ESCOMP/RTM/pull/61) and the corresponding issues. -* Adding time to 1d weighting fields in transient simulations PR \\[\#3328](https://github.com/ESCOMP/CTSM/pull/3328) +* History tapes now split into two files from hX to hXi and hXa, where X is the tape number (e.g. h0i/h0a) and where "i" stands for history file containing instantaneous fields, while "a" stands for history file containing non-instantaneous fields. Details in the “history files” section below and in the PRs https://github.com/ESCOMP/ctsm/pull/2445 https://github.com/ESCOMP/MOSART/pull/117 https://github.com/ESCOMP/RTM/pull/61 and the corresponding issues. +* Adding time to 1d weighting fields in transient simulations PR https://github.com/ESCOMP/CTSM/pull/3328 * Regarding CMIP7 vs. CMIP6 inputs: * We supply only CMIP7 C13/C14 isotope datasets, so these get used regardless of CLM\_CMIP\_ERA setting. * We supply only CMIP7 population density with clm6 physics in non-SSP cases, because the fire model is calibrated to that; conversely, we supply only CMIP6 population density for pre-clm6 physics and for SSP cases. @@ -86,14 +86,13 @@ Users will now see: The CLM handles empty history (and corresponding history-restart) files by not generating them, while rtm and mosart give an error. Instead of refactoring rtm and mosart to behave like the clm (considered out of scope), we have introduced one active instantaneous field in mosart and one in rtm to bypass the "empty file" error. -## New surface datasets and landuse timeseries files (\[PR \#3482\](https://github.com/ESCOMP/CTSM/pull/3482)) +## New surface datasets and landuse timeseries files (https://github.com/ESCOMP/CTSM/pull/3482) * Transient landuse timeseries files going back to 1700 made for f09 and 360x720 grids. -* New resolutions now supported: ne3np4.pg3, mpasa30, ne0np4.NATL.ne30x8 (\[PR \#3482\](https://github.com/ESCOMP/CTSM/pull/3482)) +* New resolutions now supported: ne3np4.pg3, mpasa30, ne0np4.NATL.ne30x8 (https://github.com/ESCOMP/CTSM/pull/3482) * Updates to input datasets (also referred to as raw datasets): - * PFT/LAI/soil-color raw datasets; now from the CMIP7 timeseries that ends in 2023 (Issues [\#2851](https://github.com/ESCOMP/CTSM/issues/2851)). - * Two fire datasets: crop fire peak month and population density (Issue - * \[\#2701\]([https://github.com/ESCOMP/CTSM/issues/2701](https://github.com/ESCOMP/CTSM/issues/2701)) \[\#3302\](https://github.com/ESCOMP/CTSM/issues/3302)). + * PFT/LAI/soil-color raw datasets; now from the CMIP7 timeseries that ends in 2023 (Issue [\#2851](https://github.com/ESCOMP/CTSM/issues/2851)). + * Two fire datasets: crop fire peak month and population density (https://github.com/ESCOMP/CTSM/issues/2701 https://github.com/ESCOMP/CTSM/issues/3302). * Transient (historical) urban datasets are now based on CMIP7 urban data, partitioned into TBD, HD, and MD classes in proportion to GaoOneill present day classification. ## Changes to FATES and the FATES parameter file From 7d56d4b84c1f75cc8e4aa65660d2002cbab23c4f Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Wed, 26 Nov 2025 12:14:23 -0700 Subject: [PATCH 121/129] Small corrections to README and CONTRIBUTING.md --- CONTRIBUTING.md | 2 +- README | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 70bf041ba7..a0a98d507e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -45,4 +45,4 @@ Code conventions: https://github.com/ESCOMP/ctsm/wiki/CTSM-coding-guidelines #### Code of Conduct: -See the `CODE_OF_CONDUCT.md` file for expectations of how to work in the community. +See https://github.com/ESCOMP/CTSM?tab=coc-ov-file for expectations of how to work in the community. diff --git a/README b/README index dc38231173..deca3cd8d2 100644 --- a/README +++ b/README @@ -15,6 +15,10 @@ For lists of current bugs (issues) and current development see the CTSM GitHub p https://github.com/ESCOMP/CTSM +For Code of Conduct (how to work with each other on the CTSM project): + +https://github.com/ESCOMP/CTSM?tab=coc-ov-file + INFORMATION ON THE CMEPS DRIVER: https://escomp.github.io/CMEPS @@ -77,7 +81,6 @@ README.md ---------------- File that displays on github under https::/github.com README.rst --------------- File that displays under the project in github README_GITFLEXIMOD.rst --- Information on how to work with git-fleximod for CTSM WhatsNewInCTSM5.4.md ----- Overview document of the changes between ctsm5.3 and ctsm5.4 -CODE_OF_CONDUCT.md ------- Code of Conduct for how to work with each other on the CTSM project Copyright ---------------- CESM Copyright file doc/UpdateChangeLog.pl --- Script to add documentation on a tag to the ChangeLog/ChangeSum files @@ -168,7 +171,7 @@ src/unit_test_stubs Unit test stubs that replicate CTSM code simpler cd $CIMEROOT/scripts ./create_newcase # get help on how to run create_newcase - ./create_newcase --case testI --res f19_g17_gl4 --compset I2000Clm60BgcCrop + ./create_newcase --case testI --res f09_t232 --compset I2000Clm60BgcCrop # create new "I" case for default machine at 1.9x2.5_gx1v7 # "I2000Clm60BgcCrop" case is clm6_0 physics, CDEPS, and inactive ice/ocn/glc # and MOSART for river-routing From 90a165f27a1c7aa388f2647d3b98108e3fa6822d Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Wed, 26 Nov 2025 12:24:37 -0700 Subject: [PATCH 122/129] Revert updates to two default_data*cfg files to avoid testing in this PR Reverts part of 060bd7c5a48c9ead38151ce069591e0833b27fea --- python/ctsm/test/testinputs/default_data.cfg | 4 ++-- python/ctsm/test/testinputs/default_data_gswp3.cfg | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/python/ctsm/test/testinputs/default_data.cfg b/python/ctsm/test/testinputs/default_data.cfg index 9d9a781947..60c012561c 100644 --- a/python/ctsm/test/testinputs/default_data.cfg +++ b/python/ctsm/test/testinputs/default_data.cfg @@ -15,14 +15,14 @@ precname = CLMCRUJRA2024.Precip tpqwname = CLMCRUJRA2024.TPQW [surfdat] -dir = lnd/clm2/surfdata_esmf/ctsm5.4.0 +dir = lnd/clm2/surfdata_esmf/ctsm5.3.0 surfdat_16pft = surfdata_0.9x1.25_hist_2000_16pfts_c240908.nc surfdat_78pft = surfdata_0.9x1.25_hist_2000_78pfts_c240908.nc mesh_dir = share/meshes/ mesh_surf = fv0.9x1.25_141008_ESMFmesh.nc [landuse] -dir = lnd/clm2/surfdata_esmf/ctsm5.4.0 +dir = lnd/clm2/surfdata_esmf/ctsm5.3.0 landuse_16pft = landuse.timeseries_0.9x1.25_SSP2-4.5_1850-2100_78pfts_c240908.nc landuse_78pft = landuse.timeseries_0.9x1.25_SSP2-4.5_1850-2100_78pfts_c240908.nc diff --git a/python/ctsm/test/testinputs/default_data_gswp3.cfg b/python/ctsm/test/testinputs/default_data_gswp3.cfg index e5eb46d681..09e1463eb2 100644 --- a/python/ctsm/test/testinputs/default_data_gswp3.cfg +++ b/python/ctsm/test/testinputs/default_data_gswp3.cfg @@ -15,14 +15,14 @@ precname = CLMGSWP3v1.Precip tpqwname = CLMGSWP3v1.TPQW [surfdat] -dir = lnd/clm2/surfdata_esmf/ctsm5.4.0 +dir = lnd/clm2/surfdata_esmf/ctsm5.3.0 surfdat_16pft = surfdata_0.9x1.25_hist_2000_16pfts_c240908.nc surfdat_78pft = surfdata_0.9x1.25_hist_2000_78pfts_c240908.nc mesh_dir = share/meshes/ mesh_surf = fv0.9x1.25_141008_ESMFmesh.nc [landuse] -dir = lnd/clm2/surfdata_esmf/ctsm5.4.0 +dir = lnd/clm2/surfdata_esmf/ctsm5.3.0 landuse_16pft = landuse.timeseries_0.9x1.25_SSP2-4.5_1850-2100_78pfts_c240908.nc landuse_78pft = landuse.timeseries_0.9x1.25_SSP2-4.5_1850-2100_78pfts_c240908.nc From 74ed7a52f1b68b3ba59f072132a3b4899eeac8c8 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Wed, 26 Nov 2025 12:47:33 -0700 Subject: [PATCH 123/129] Update tools in /contrib to make h0a the default option (instead of h0) --- tools/contrib/SpinupStability_BGC_v11.ncl | 4 ++-- tools/contrib/SpinupStability_BGC_v12_SE.ncl | 2 +- tools/contrib/SpinupStability_SP_v10.ncl | 2 +- tools/contrib/run_clm_historical.v11.csh | 6 ++++-- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/tools/contrib/SpinupStability_BGC_v11.ncl b/tools/contrib/SpinupStability_BGC_v11.ncl index d81b38ad9c..92a06e123e 100644 --- a/tools/contrib/SpinupStability_BGC_v11.ncl +++ b/tools/contrib/SpinupStability_BGC_v11.ncl @@ -36,7 +36,7 @@ begin region = "Global" ; Global, Arctic, or SPT (single point) subper = 20 ; Subsampling period in years paleo = False ; Use paleo map - hist_ext = "h0" ; Set to either h0 (ctsm5.3.061 or earlier) or h0a (ctsm5.3.062 or later) + hist_ext = "h0a" ; Valid options: h0a, h0 ; SPT (single point) EXAMPLE ; caseid = "clm50_release-clm5.0.15_SPT_GSWP3V1_1850spin" @@ -45,7 +45,7 @@ begin ; region = "SPT" ; Global, Arctic, or SPT (single point) ; subper = 20 ; Subsampling period in years ; paleo = False ; Use paleo map -; hist_ext = "h0" ; Set to either h0 (ctsm5.3.061 or earlier) or h0a (ctsm5.3.062 or later) +; hist_ext = "h0a" ; Valid options: h0a, h0 do_plot = True ; do_plot = False diff --git a/tools/contrib/SpinupStability_BGC_v12_SE.ncl b/tools/contrib/SpinupStability_BGC_v12_SE.ncl index aa044b9c17..25e909b696 100644 --- a/tools/contrib/SpinupStability_BGC_v12_SE.ncl +++ b/tools/contrib/SpinupStability_BGC_v12_SE.ncl @@ -41,7 +41,7 @@ begin region = "Global" ; Global subper = 20 ; Subsampling period in years paleo = False ; Use paleo map ; UNTESTED IN THIS VERSION - hist_ext = "h0" ; Set to either h0 (ctsm5.3.061 or earlier) or h0a (ctsm5.3.062 or later) + hist_ext = "h0a" ; Valid options: h0a, h0 ;--- ARH mods --- map_method = "conserve" ;bilinear,conserve or patch diff --git a/tools/contrib/SpinupStability_SP_v10.ncl b/tools/contrib/SpinupStability_SP_v10.ncl index 6b3d310234..97eccd8183 100644 --- a/tools/contrib/SpinupStability_SP_v10.ncl +++ b/tools/contrib/SpinupStability_SP_v10.ncl @@ -32,7 +32,7 @@ begin subper = 20 h2osoi_layer = 8 ; Desired soil layer (layer 8 is about 1m) tsoi_layer = 10 ; Desired soil layer (layer 10 is about 3m) - hist_ext = "h0" ; Set to either h0 (ctsm5.3.061 or earlier) or h0a (ctsm5.3.062 or later) + hist_ext = "h0a" ; Valid options: h0a, h0 do_plot = "True" ;=======================================================================; diff --git a/tools/contrib/run_clm_historical.v11.csh b/tools/contrib/run_clm_historical.v11.csh index 04e22aa31a..7398487a13 100755 --- a/tools/contrib/run_clm_historical.v11.csh +++ b/tools/contrib/run_clm_historical.v11.csh @@ -72,6 +72,8 @@ # ./run_clm_historical.v10.csh ! > & run_clm_historical.out & # - Modify to look for either h0 or h0a files - Keith Oleson July, 2025 # ./run_clm_historical.v11.csh ! > & run_clm_historical.out & +# - Update the comment about h0a/h0 files - slevis Nov, 2025 +# ./run_clm_historical.v11.csh ! > & run_clm_historical.out & ######################################################################################### ######################################################################################### @@ -85,8 +87,8 @@ # --- CASENAME is your case name set CASENAME = 'ctsm530_f19_PPE_TESTv11_hist' -# --- Set to either h0 (ctsm5.3.061 or earlier) or h0a (ctsm5.3.062 or later) -set HIST_EXT = 'h0' +# HIST_EXT valid options: h0a, h0 +set HIST_EXT = 'h0a' # --- Set the user namelist file. cp original_user_nl_clm user_nl_clm From 83f35cbf30eea63cec47407e02a74150a771053f Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Wed, 26 Nov 2025 18:31:04 -0700 Subject: [PATCH 124/129] Three user_nl_clm and two .cfg files with ctsm5.4 updates --- .../clm/smallville_dynlakes_monthly/user_nl_clm | 2 +- .../clm/smallville_dynurban_monthly/user_nl_clm | 2 +- .../usermods_dirs/clm/PLUMBER2/defaults/user_nl_clm | 2 +- python/ctsm/test/testinputs/default_data.cfg | 12 ++++++------ python/ctsm/test/testinputs/default_data_gswp3.cfg | 12 ++++++------ 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/cime_config/testdefs/testmods_dirs/clm/smallville_dynlakes_monthly/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/smallville_dynlakes_monthly/user_nl_clm index 6223cc203f..46680fd36d 100644 --- a/cime_config/testdefs/testmods_dirs/clm/smallville_dynlakes_monthly/user_nl_clm +++ b/cime_config/testdefs/testmods_dirs/clm/smallville_dynlakes_monthly/user_nl_clm @@ -6,7 +6,7 @@ do_transient_lakes = .true. ! Key points are that lake area starts as 0, increases after the first year, then decreases after the second year. ! PCT_CROP is also changed so that PCT_LAKE + PCT_CROP <= 100. (Here, PCT_CROP increases and decreases at the same time as PCT_LAKE in order to exercise the simultaneous increase or decrease of two landunits, but that isn't a critical part of this test.) ! Note that the use of this file means that this testmod can only be used with the 1x1_smallvilleIA grid. -flanduse_timeseries = '$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/ctsm5.3.0/synthetic/landuse.timeseries_1x1_smallvilleIA_synth_SSP2-4.5_1850-1855_78pfts_dynLakes_c240912.nc' +flanduse_timeseries = '$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/ctsm5.4.0/synthetic/landuse.timeseries_1x1_smallvilleIA_synth_1850-1855_78pfts_dynLakes_c251023.nc' ! NOTE slevis (2024/2/23) Adding option for tests to pass. In the long term ! ensure that subset_data generates fsurdat and landuse files consistent with diff --git a/cime_config/testdefs/testmods_dirs/clm/smallville_dynurban_monthly/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/smallville_dynurban_monthly/user_nl_clm index 958265cffc..bb18638158 100644 --- a/cime_config/testdefs/testmods_dirs/clm/smallville_dynurban_monthly/user_nl_clm +++ b/cime_config/testdefs/testmods_dirs/clm/smallville_dynurban_monthly/user_nl_clm @@ -7,7 +7,7 @@ do_transient_urban = .true. ! Medium density urban is set to zero to test the memory-saving behavior of PCT_URBAN_MAX. ! PCT_CROP is also changed so that PCT_URBAN + PCT_CROP <= 100. (Here, PCT_CROP increases and decreases at the same time as PCT_URBAN in order to exercise the simultaneous increase or decrease of two landunits, but that isn't a critical part of this test.) ! Note that the use of this file means that this testmod can only be used with the 1x1_smallvilleIA grid. -flanduse_timeseries = '$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/ctsm5.3.0/synthetic/landuse.timeseries_1x1_smallvilleIA_synth_SSP2-4.5_1850-1855_78pfts_dynUrban_c240912.nc' +flanduse_timeseries = '$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/ctsm5.4.0/synthetic/landuse.timeseries_1x1_smallvilleIA_synth_1850-1855_78pfts_dynUrban_c251023.nc' ! NOTE slevis (2024/2/23) Adding option for tests to pass. In the long term ! ensure that subset_data generates fsurdat and landuse files consistent with diff --git a/cime_config/usermods_dirs/clm/PLUMBER2/defaults/user_nl_clm b/cime_config/usermods_dirs/clm/PLUMBER2/defaults/user_nl_clm index 5216afb381..ff20dae0b4 100644 --- a/cime_config/usermods_dirs/clm/PLUMBER2/defaults/user_nl_clm +++ b/cime_config/usermods_dirs/clm/PLUMBER2/defaults/user_nl_clm @@ -19,6 +19,6 @@ !---------------------------------------------------------------------------------- flanduse_timeseries = ' ' ! This isn't needed for a non transient case, but will be once we start using transient compsets -fsurdat = "$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/ctsm5.3.0/surfdata_1x1_PLUMBER2_${PLUMBER2SITE}_hist_2000_16pfts_c240912.nc" +fsurdat = "$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/ctsm5.4.0/surfdata_1x1_PLUMBER2_${PLUMBER2SITE}_hist_2000_16pfts_c251023.nc" ! custom namelist changes for each site / case diff --git a/python/ctsm/test/testinputs/default_data.cfg b/python/ctsm/test/testinputs/default_data.cfg index 60c012561c..a220a0ee90 100644 --- a/python/ctsm/test/testinputs/default_data.cfg +++ b/python/ctsm/test/testinputs/default_data.cfg @@ -15,16 +15,16 @@ precname = CLMCRUJRA2024.Precip tpqwname = CLMCRUJRA2024.TPQW [surfdat] -dir = lnd/clm2/surfdata_esmf/ctsm5.3.0 -surfdat_16pft = surfdata_0.9x1.25_hist_2000_16pfts_c240908.nc -surfdat_78pft = surfdata_0.9x1.25_hist_2000_78pfts_c240908.nc +dir = lnd/clm2/surfdata_esmf/ctsm5.4.0 +surfdat_16pft = surfdata_0.9x1.25_hist_2000_16pfts_c251022.nc +surfdat_78pft = surfdata_0.9x1.25_hist_2000_78pfts_c251022.nc mesh_dir = share/meshes/ mesh_surf = fv0.9x1.25_141008_ESMFmesh.nc [landuse] -dir = lnd/clm2/surfdata_esmf/ctsm5.3.0 -landuse_16pft = landuse.timeseries_0.9x1.25_SSP2-4.5_1850-2100_78pfts_c240908.nc -landuse_78pft = landuse.timeseries_0.9x1.25_SSP2-4.5_1850-2100_78pfts_c240908.nc +dir = lnd/clm2/surfdata_esmf/ctsm5.4.0 +landuse_16pft = landuse.timeseries_0.9x1.25_hist_1850-2023_16pfts_c251022.nc +landuse_78pft = landuse.timeseries_0.9x1.25_hist_1850-2023_78pfts_c251022.nc [domain] file = share/domains/domain.lnd.fv0.9x1.25_gx1v7.151020.nc diff --git a/python/ctsm/test/testinputs/default_data_gswp3.cfg b/python/ctsm/test/testinputs/default_data_gswp3.cfg index 09e1463eb2..a7da53cea3 100644 --- a/python/ctsm/test/testinputs/default_data_gswp3.cfg +++ b/python/ctsm/test/testinputs/default_data_gswp3.cfg @@ -15,16 +15,16 @@ precname = CLMGSWP3v1.Precip tpqwname = CLMGSWP3v1.TPQW [surfdat] -dir = lnd/clm2/surfdata_esmf/ctsm5.3.0 -surfdat_16pft = surfdata_0.9x1.25_hist_2000_16pfts_c240908.nc -surfdat_78pft = surfdata_0.9x1.25_hist_2000_78pfts_c240908.nc +dir = lnd/clm2/surfdata_esmf/ctsm5.4.0 +surfdat_16pft = surfdata_0.9x1.25_hist_2000_16pfts_c251022.nc +surfdat_78pft = surfdata_0.9x1.25_hist_2000_78pfts_c251022.nc mesh_dir = share/meshes/ mesh_surf = fv0.9x1.25_141008_ESMFmesh.nc [landuse] -dir = lnd/clm2/surfdata_esmf/ctsm5.3.0 -landuse_16pft = landuse.timeseries_0.9x1.25_SSP2-4.5_1850-2100_78pfts_c240908.nc -landuse_78pft = landuse.timeseries_0.9x1.25_SSP2-4.5_1850-2100_78pfts_c240908.nc +dir = lnd/clm2/surfdata_esmf/ctsm5.4.0 +landuse_16pft = landuse.timeseries_0.9x1.25_hist_1850-2023_16pfts_c251022.nc +landuse_78pft = landuse.timeseries_0.9x1.25_hist_1850-2023_78pfts_c251022.nc [domain] file = share/domains/domain.lnd.fv0.9x1.25_gx1v7.151020.nc From 8b49fe389a009dc3e5037e255edc1cbdbab05dae Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Mon, 1 Dec 2025 16:31:38 -0700 Subject: [PATCH 125/129] Update ExpectedTestFails.xml according to Erik's comments --- cime_config/testdefs/ExpectedTestFails.xml | 24 +--------------------- 1 file changed, 1 insertion(+), 23 deletions(-) diff --git a/cime_config/testdefs/ExpectedTestFails.xml b/cime_config/testdefs/ExpectedTestFails.xml index d21fc39c42..0cee0d9ba1 100644 --- a/cime_config/testdefs/ExpectedTestFails.xml +++ b/cime_config/testdefs/ExpectedTestFails.xml @@ -29,13 +29,6 @@ - - - FAIL - #3529 - We will generate new fsurdat files with the new raw lai file to resolve this issue. - - FAIL @@ -73,6 +66,7 @@ FAIL #3495 + Problem getting gdds_20250809_025305.tweaked_latlons.nc on izumi. @@ -338,22 +332,6 @@ - - - FAIL - #3252 - This should be resolved for the 5.4 release. - - - - - - FAIL - #3252 - This should be resolved for the 5.4 release. - - - From 2dbc28d073797fac181c522f6dff206f75fa784b Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Mon, 1 Dec 2025 18:56:53 -0700 Subject: [PATCH 126/129] Remove one more previously-expected failure from ExpectedTestFails.xml --- cime_config/testdefs/ExpectedTestFails.xml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/cime_config/testdefs/ExpectedTestFails.xml b/cime_config/testdefs/ExpectedTestFails.xml index 0cee0d9ba1..f7f4e8ba24 100644 --- a/cime_config/testdefs/ExpectedTestFails.xml +++ b/cime_config/testdefs/ExpectedTestFails.xml @@ -62,13 +62,6 @@ - - - FAIL - #3495 - Problem getting gdds_20250809_025305.tweaked_latlons.nc on izumi. - - FAIL From 89a4caee7072aa75a0516335cef0366f11e5e345 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Tue, 2 Dec 2025 15:20:02 -0700 Subject: [PATCH 127/129] Add H2OSNO to default hist_fincl1 for clm_accelerated_spinup ON or SASU --- bld/namelist_files/namelist_defaults_ctsm.xml | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index 627f1d54d0..bf3f9effc7 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -70,21 +70,19 @@ attributes from the config_cache.xml file (with keys converted to upper-case). .true. .true. 'TOTECOSYSC','TOTECOSYSN','TOTSOMC','TOTSOMN','TOTVEGC','TOTVEGN','TLAI','GPP','NPP','TWS','TSAI','HTOP','HBOT' +>'TOTECOSYSC','TOTECOSYSN','TOTSOMC','TOTSOMN','TOTVEGC','TOTVEGN','TLAI','GPP','NPP','TWS','TSAI','HTOP','HBOT','H2OSNO' 'TOTECOSYSC','TOTECOSYSN','TOTSOMC','TOTSOMN','TOTVEGC','TOTVEGN','TLAI','GPP','CPOOL','NPP','TWS' +>'TOTECOSYSC','TOTECOSYSN','TOTSOMC','TOTSOMN','TOTVEGC','TOTVEGN','TLAI','GPP','CPOOL','NPP','TWS','H2OSNO' 'TOTSOMC','TOTSOMN','TLAI','GPP','NPP','TWS' +>'TOTSOMC','TOTSOMN','TLAI','GPP','NPP','TWS','H2OSNO' 'TLAI','TWS' +>'TLAI','TWS','H2OSNO' 'TOTECOSYSC','TOTECOSYSN','TOTSOMC','TOTSOMN','TOTVEGC','TOTVEGN','TLAI','GPP','NPP','TWS','TSAI','HTOP','HBOT' +>'TOTECOSYSC','TOTECOSYSN','TOTSOMC','TOTSOMN','TOTVEGC','TOTVEGN','TLAI','GPP','NPP','TWS','TSAI','HTOP','HBOT','H2OSNO' 'TOTECOSYSC','TOTECOSYSN','TOTSOMC','TOTSOMN','TOTVEGC','TOTVEGN','TLAI','GPP','CPOOL','NPP','TWS' +>'TOTECOSYSC','TOTECOSYSN','TOTSOMC','TOTSOMN','TOTVEGC','TOTVEGN','TLAI','GPP','CPOOL','NPP','TWS','H2OSNO' 'TOTSOMC','TOTSOMN','TLAI','GPP','NPP','TWS' -'TLAI','TWS' +>'TOTSOMC','TOTSOMN','TLAI','GPP','NPP','TWS','H2OSNO' -8760 -8760 20 From 5372e5c1f63d956aab3467232e7482e82dd2d850 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Thu, 4 Dec 2025 13:26:37 -0700 Subject: [PATCH 128/129] First draft ChangeLog/ChangeSum --- doc/ChangeLog | 121 ++++++++++++++++++++++++++++++++++++++++++++++++++ doc/ChangeSum | 1 + 2 files changed, 122 insertions(+) diff --git a/doc/ChangeLog b/doc/ChangeLog index 655b56af19..142258c29b 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,4 +1,125 @@ =============================================================== +Tag name: ctsm5.4.000 +Originator(s): slevis (Samuel Levis,UCAR/TSS), ekluzek (Erik Kluzek,UCAR/TSS) +Date: Thu Dec 4 12:15:31 PM MST 2025 +One-line Summary: Merge alpha-ctsm5.4.CMIP7 to master + +Purpose and description of changes +---------------------------------- + + Merging alpha-ctsm5.4.CMIP7 to master in preparation for the official ctsm5.4 release. + + WhatsNewInCTSM5.4.md documents the updates from ctsm5.3.021 (the official ctsm5.3 release) to present and will be updated with the exact ctsm5.4 release tag in the near future, once we identify such tag. + + Here we summarize updates from ctsm5.3.085 (the most recent tag) to ctsm5.4.000 (the current tag): + - Updating ALL the fsurdat/landuse files to version ctsm5.4, though this version is backwards compatible with ctsm5.3 datasets, so ctsm5.3 files can still be used. + - Updating "agricultural fire peak month" raw dataset, as well as the algorithm determining this field's dominant values in mksurfdata_esmf + - Future scenarios are done using the cmip6 ctsm5.3 surface datasets. The new XML variable CLM_CMIP_ERA controls this. + - A few other updates come in as well for clm6_0: + * New Initial Condition (IC) files + * New parameter file + * New crop calendar datasets + * Changes to fire parameters along with new fire_method "li2024crujra" + * New population density file + +Significant changes to scientifically-supported configurations +-------------------------------------------------------------- + +Does this tag change answers significantly for any of the following physics configurations? +(Details of any changes will be given in the "Answer changes" section below.) + + [Put an [X] in the box for any configuration with significant answer changes.] + +[X] clm6_0 + +[ ] clm5_0 + +[ ] ctsm5_0-nwp + +[ ] clm4_5 + + +Bugs fixed +---------- +List of CTSM issues fixed (include CTSM Issue # and description) [one per line]: + Resolves #2851 Update to CMIP7 LULCC forcings (umbrella issue with the main ctsm5.4 checklist) + +Notes of particular relevance for users +--------------------------------------- +Changes to the datasets (e.g., parameter, surface or initial files): + New fsurdat/landuse files + For clm6: New paramfile, finidat files, crop calendar datasets, population density stream file + +Changes to documentation: + Updates about history files splitting into separate non-instantaneous and instantaneous files + +Notes of particular relevance for developers: +--------------------------------------------- +Caveats for developers (e.g., code that is duplicated that requires double maintenance): None + ccs_config points to temporary tag ccs_config_cesm1.0.61_add_domain_ne3np4.pg2_1 to allow use of a new grid. The temporary tag will get replaced appropriately in the next merge of b4b-dev to master. + +Changes to tests or testing: + The ctsm_sci test-suite now includes new tests for a few newly introduced grids. + +Testing summary: +---------------- + [PASS means all tests PASS; OK means tests PASS other than expected fails.] + + build-namelist tests (if CLMBuildNamelist.pm has changed): + + derecho - OK + + python testing (if python code has changed; see instructions in python/README.md; document testing done): + + derecho - PASS + + regular tests (aux_clm: https://github.com/ESCOMP/CTSM/wiki/System-Testing-Guide#pre-merge-system-testing): + derecho ----- OK + izumi ------- OK + + fates tests compared to fates-sci.1.88.0_api.42.0.0-ctsm5.3.083 on derecho and fates-sci.1.88.0_api.41.0.0-ctsm5.3.082 on izumi + derecho ----- OK + izumi ------- OK + + ctsm_sci compared to ctsm_sci-alpha-ctsm5.4.CMIP7.19.ctsm5.3.082 + derecho ---- OK + + mosart tests compared to mosart1.1.12-ctsm5.3.066 + derecho ----- OK + izumi ------- OK + + rtm tests compared to rtm1_0_89-ctsm5.3.065 + derecho ----- OK + izumi ------- OK + +Answer changes +-------------- + +Changes answers relative to baseline: Yes + + Summarize any changes to answers, i.e., + - what code configurations: All + - what platforms/compilers: All + - nature of change: larger than roundoff/same climate; possibly new climate in clm6 + + If this tag changes climate describe the run(s) done to evaluate the new + climate (put details of the simulations in the experiment database) + - https://github.com/NCAR/LMWG_dev/issues/123 + - https://github.com/NCAR/LMWG_dev/issues/124 + - https://github.com/NCAR/LMWG_dev/issues/125 + - https://github.com/NCAR/LMWG_dev/issues/126 + - https://github.com/NCAR/LMWG_dev/issues/127 + +Other details +------------- +List any git submodules updated (cime, rtm, mosart, cism, fates, etc.): + ccs_config_cesm1.0.61 to ccs_config_cesm1.0.61_add_domain_ne3np4.pg2_1 as explained in "Caveats for developers" above + +Pull Requests that document the changes (include PR ids): + https://github.com/ESCOMP/ctsm/pull/3638 + +=============================================================== +=============================================================== Tag name: ctsm5.3.085 Originator(s): slevis (Samuel Levis,UCAR/TSS,303-665-1310) Date: Fri Nov 14 11:08:54 AM MST 2025 diff --git a/doc/ChangeSum b/doc/ChangeSum index 135ae3ac13..1167d51b0f 100644 --- a/doc/ChangeSum +++ b/doc/ChangeSum @@ -1,5 +1,6 @@ Tag Who Date Summary ============================================================================================================================ + ctsm5.4.000 slevis 12/04/2025 Merge alpha-ctsm5.4.CMIP7 to master ctsm5.3.085 slevis 11/14/2025 Merge b4b-dev to master ctsm5.3.084 erik 10/31/2025 Merge b4b-dev to master ctsm5.3.083 rgknox 10/29/2025 Changes to coupling of supplementation status with FATES. From 13e09b312f360d2fb5d632e6a7523bcdefc750f6 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Thu, 4 Dec 2025 17:04:00 -0700 Subject: [PATCH 129/129] Updated ChangeLog/ChangeSum --- doc/ChangeLog | 44 ++++++++++++++++++++++++++++++++++++++++---- doc/ChangeSum | 2 +- 2 files changed, 41 insertions(+), 5 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index 142258c29b..d5616d7829 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -22,6 +22,8 @@ Purpose and description of changes * Changes to fire parameters along with new fire_method "li2024crujra" * New population density file +Contributors: Sam Levis @slevis-lmwg, Peter Lawrence @lawrencepj1, Erik Kluzek @ekluzek, Will Wieder @wwieder, Keith Oleson @olyson, Sam Rabin @samsrabin, Fang Li @lifang0209 + Significant changes to scientifically-supported configurations -------------------------------------------------------------- @@ -32,11 +34,11 @@ Does this tag change answers significantly for any of the following physics conf [X] clm6_0 -[ ] clm5_0 +[X] clm5_0 -[ ] ctsm5_0-nwp +[X] ctsm5_0-nwp -[ ] clm4_5 +[X] clm4_5 Bugs fixed @@ -46,6 +48,21 @@ List of CTSM issues fixed (include CTSM Issue # and description) [one per line]: Notes of particular relevance for users --------------------------------------- +Caveats for users (e.g., need to interpolate initial conditions): + The new ctsm5.4 fsurdat/flanduse_timeseries datasets are used by default, but the model will work with previous ctsm5.3 datasets. The new initial conditions (finidat) for clm6_0 will work without having to interpolate them. The initial conditions for previous physics (so previous finidat files you've been using) do need to be interpolated (so add use_init_interp=TRUE to user_nl_clm). + +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): + New XML variable: CLM_CMIP_ERA (can be cmip6 or cmip7) + Defaults to cmip7 except for the SSP scenarios which use cmip6 + +Changes made to namelist defaults (e.g., changed parameter values): + init_interp_fill_missing_urban_with_HD is set to TRUE all of the time even when not needed + + Fire parameters update: (li2024gswp3, and li2024crujra fire_method): + - defo_fire_precip_thresh_bet + - cli_scale + - cropfire_a1 + Changes to the datasets (e.g., parameter, surface or initial files): New fsurdat/landuse files For clm6: New paramfile, finidat files, crop calendar datasets, population density stream file @@ -55,9 +72,11 @@ Changes to documentation: Notes of particular relevance for developers: --------------------------------------------- -Caveats for developers (e.g., code that is duplicated that requires double maintenance): None +Caveats for developers (e.g., code that is duplicated that requires double maintenance): ccs_config points to temporary tag ccs_config_cesm1.0.61_add_domain_ne3np4.pg2_1 to allow use of a new grid. The temporary tag will get replaced appropriately in the next merge of b4b-dev to master. + fsurdat/landuse files are associated with a cmip_era flag in namelist_defaults to describe if it's a cmip6 or cmip7 version. + Changes to tests or testing: The ctsm_sci test-suite now includes new tests for a few newly introduced grids. @@ -69,6 +88,10 @@ Testing summary: derecho - OK + Also namelist comparisons as outlined here: + https://github.com/ESCOMP/CTSM/wiki/Minor-Version-Update-Protocols#namelist-validation + We compared against ctsm5.3.021 namelists, i.e. against the ctsm5.3 release tag + python testing (if python code has changed; see instructions in python/README.md; document testing done): derecho - PASS @@ -92,6 +115,12 @@ Testing summary: derecho ----- OK izumi ------- OK + mksurfdata_esmf + derecho ----- OK tested a single resolution for b4b with different number of cpus; ran "make all" to create all datasets (completes in 6 hours, longest mksrf_crop-global-hist-low-res) + + fsurdat verification + derecho ----- OK validate_fsurdat_files.sh script added in tools/mksurfdata_esmf + Answer changes -------------- @@ -118,6 +147,13 @@ List any git submodules updated (cime, rtm, mosart, cism, fates, etc.): Pull Requests that document the changes (include PR ids): https://github.com/ESCOMP/ctsm/pull/3638 + 35 PRs went onto the alpha-ctsm5.4.CMIP7 branch + Dates span from Apr/23/2025 to Dec/4/2025 (7.5 months) + 29 Tags on the branch from alpha-ctsm5.4.CMIP7.01.ctsm5.3.040 to alpha-ctsm5.4.CMIP7.21.ctsm5.3.085 + + For the list of PRs see: + https://github.com/ESCOMP/CTSM/pulls?page=2&q=is%3Apr+base%3Aalpha-ctsm5.4.CMIP7+is%3Aclosed + =============================================================== =============================================================== Tag name: ctsm5.3.085 diff --git a/doc/ChangeSum b/doc/ChangeSum index 1167d51b0f..0f516c584f 100644 --- a/doc/ChangeSum +++ b/doc/ChangeSum @@ -1,6 +1,6 @@ Tag Who Date Summary ============================================================================================================================ - ctsm5.4.000 slevis 12/04/2025 Merge alpha-ctsm5.4.CMIP7 to master + ctsm5.4.000 multiple 12/04/2025 Merge alpha-ctsm5.4.CMIP7 to master ctsm5.3.085 slevis 11/14/2025 Merge b4b-dev to master ctsm5.3.084 erik 10/31/2025 Merge b4b-dev to master ctsm5.3.083 rgknox 10/29/2025 Changes to coupling of supplementation status with FATES.