From 2785caf1882324ffaeced04f6ec2aede2b57cda6 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Fri, 27 May 2022 09:25:13 -0600 Subject: [PATCH 0001/1248] Seperate out nrepr loops into ones for matrixcn off and on --- src/biogeochem/CNCStateUpdate1Mod.F90 | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/biogeochem/CNCStateUpdate1Mod.F90 b/src/biogeochem/CNCStateUpdate1Mod.F90 index 717b524383..8c6fc11602 100644 --- a/src/biogeochem/CNCStateUpdate1Mod.F90 +++ b/src/biogeochem/CNCStateUpdate1Mod.F90 @@ -430,18 +430,18 @@ subroutine CStateUpdate1( num_soilc, filter_soilc, num_soilp, filter_soilp, & end if cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%cpool_to_livestemc_patch(p)*dt cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%cpool_to_livestemc_storage_patch(p)*dt - cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%cpool_to_reproductivec_patch(p,1)*dt - cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%cpool_to_reproductivec_storage_patch(p,1)*dt + do k = 1, nrepr + cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%cpool_to_reproductivec_patch(p,k)*dt + cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%cpool_to_reproductivec_storage_patch(p,k)*dt + end do if(.not. use_matrixcn)then cs_veg%livestemc_patch(p) = cs_veg%livestemc_patch(p) + cf_veg%cpool_to_livestemc_patch(p)*dt cs_veg%livestemc_storage_patch(p) = cs_veg%livestemc_storage_patch(p) + cf_veg%cpool_to_livestemc_storage_patch(p)*dt do k = 1, nrepr - cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%cpool_to_reproductivec_patch(p,k)*dt - cs_veg%reproductivec_patch(p,k) = cs_veg%reproductivec_patch(p,k) & - + cf_veg%cpool_to_reproductivec_patch(p,k)*dt - cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%cpool_to_reproductivec_storage_patch(p,k)*dt + cs_veg%reproductivec_patch(p,k) = cs_veg%reproductivec_patch(p,k) & + + cf_veg%cpool_to_reproductivec_patch(p,k)*dt cs_veg%reproductivec_storage_patch(p,k) = cs_veg%reproductivec_storage_patch(p,k) & - + cf_veg%cpool_to_reproductivec_storage_patch(p,k)*dt + + cf_veg%cpool_to_reproductivec_storage_patch(p,k)*dt end do else ! NOTE: The equivalent changes for matrix code are in CNPhenology EBK (11/26/2019) From 266cc6212e1f8bbdd303575b32bfffd4da5bff46 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Mon, 22 Aug 2022 12:06:43 -0600 Subject: [PATCH 0002/1248] Apply dust branch based off of release-clm5.0.34 to dev branch Do a diff of the dmleung DUSTEMIS branch based off of release-clm5.0.34 to ctsm5.1.dev106 and apply the diff after updating the paths for namelist_definition and lnd_import_export.F90 in the diff. git apply -3 dust.diff Diffs with conflicts: modified: src/biogeochem/DUSTMod.F90 modified: src/biogeophys/SoilStateInitTimeConstMod.F90 modified: src/main/controlMod.F90 modified: src/cpl/mct/lnd_import_export.F90 The changes in lnd_import_export were to change a check for negative LW that seems to be removed in the latest version. --- .../namelist_definition_ctsm.xml | 9 + src/biogeochem/DUSTMod.F90 | 466 ++++++++++++++++-- src/biogeophys/SoilStateInitTimeConstMod.F90 | 24 +- src/biogeophys/SoilStateType.F90 | 8 +- src/main/clm_varctl.F90 | 1 + src/main/controlMod.F90 | 13 + src/main/lnd2atmMod.F90 | 8 + 7 files changed, 496 insertions(+), 33 deletions(-) diff --git a/bld/namelist_files/namelist_definition_ctsm.xml b/bld/namelist_files/namelist_definition_ctsm.xml index a08795dd1f..ddc5d8372c 100644 --- a/bld/namelist_files/namelist_definition_ctsm.xml +++ b/bld/namelist_files/namelist_definition_ctsm.xml @@ -2796,4 +2796,13 @@ use case.) + + + +Full pathname of time-invariant roughness factor dataset for calculating drag partition of dust emission. + + + + diff --git a/src/biogeochem/DUSTMod.F90 b/src/biogeochem/DUSTMod.F90 index a86531ba62..7f7c92722c 100644 --- a/src/biogeochem/DUSTMod.F90 +++ b/src/biogeochem/DUSTMod.F90 @@ -15,7 +15,8 @@ module DUSTMod use shr_kind_mod , only : r8 => shr_kind_r8 use shr_log_mod , only : errMsg => shr_log_errMsg use shr_infnan_mod , only : nan => shr_infnan_nan, assignment(=) - use clm_varpar , only : dst_src_nbr, ndst, sz_nbr + use clm_varpar , only : dst_src_nbr, ndst, sz_nbr, & + natpft_lb, natpft_ub, natpft_size ! -dmleung added 24 Jul 2022 use clm_varcon , only : grav, spval use landunit_varcon , only : istcrop, istsoil use clm_varctl , only : iulog @@ -30,6 +31,9 @@ module DUSTMod use LandunitType , only : lun use ColumnType , only : col use PatchType , only : patch + use clm_instur , only : wt_lunit, wt_nat_patch ! dmleung added 24 Jul 2022 + use landunit_varcon , only : istsoil, istcrop ! dmleung added 24 Jul 2022 (refering to main/landunit_varcon.F90, for wt_lunit, istsoil=1 is nat veg, istcrop=2 is crop) + use pftconMod , only : noveg ! dmleung added 24 Jul 2022 ! ! !PUBLIC TYPES implicit none @@ -60,7 +64,32 @@ module DUSTMod real(r8), pointer, private :: vlc_trb_3_patch (:) ! turbulent deposition velocity 3(m/s) real(r8), pointer, private :: vlc_trb_4_patch (:) ! turbulent deposition velocity 4(m/s) real(r8), pointer, private :: mbl_bsn_fct_col (:) ! basin factor - + !########### added by dmleung 27 Nov 2021 ######################################################################## + real(r8), pointer, private :: dst_emiss_coeff_patch (:) ! dust emission coefficient (unitless) + real(r8), pointer, private :: wnd_frc_thr_patch (:) ! wet fluid threshold (m/s) + real(r8), pointer, private :: wnd_frc_thr_dry_patch (:) ! dry fluid threshold (m/s) + real(r8), pointer, private :: lnd_frc_mble_patch (:) ! land mobile fraction -dmleung + real(r8), pointer, private :: liq_frac_patch (:) ! liquid fraction of total water + real(r8), pointer, private :: wnd_frc_soil_patch (:) ! soil wind friction velocity (m/s) + real(r8), pointer, private :: gwc_patch (:) ! gravimetric water content (kg/kg) + !########### added by dmleung 2 Dec 2021 ######################################################################### + real(r8), pointer, private :: intrmtncy_fct_patch (:) ! intermittency factor, accounting for turbulence shutting down dust emissions (unitless) + real(r8), pointer, private :: stblty_patch (:) ! stability parameter for checking stability condition (stblty < 0 is unstable atmosphere) + real(r8), pointer, private :: u_mean_slt_patch (:) ! wind speed 0.1 m level of dust saltation (m/s) + real(r8), pointer, private :: u_sd_slt_patch (:) ! sd of wind speed 0.1 m level of dust saltation (m/s) + real(r8), pointer, private :: u_fld_thr_patch (:) ! fluid threshold wind speed 0.1 m level of dust saltation (m/s) + real(r8), pointer, private :: u_impct_thr_patch (:) ! impact threshold wind speed at 0.1 m level of dust saltation (m/s) + real(r8), pointer, private :: thr_crs_rate_patch (:) ! threshold crossing rate (unitless) + real(r8), pointer, private :: prb_crs_fld_thr_patch (:) ! probability of wind speed crossing fluid threshold + real(r8), pointer, private :: prb_crs_impct_thr_patch (:) ! probability of wind speed crossing impact threshold + !########### added by dmleung 17 Dec 2021 ######################################################################## + real(r8), pointer, private :: ustar_patch (:) ! output friction velocity for SP mode (m/s) + !########### added by dmleung 20 Dec 2021 ######################################################################## + real(r8), pointer, private :: ssr_patch (:) ! [dimless] integrated shear stress ratiio, defined by Okin (2008) and then integrated by Caroline Pierre et al. (2014) + real(r8), pointer, private :: lai_patch (:) ! [m2 leaf /m2 land] LAI+SAI for calculating Okin's drag partition, averaged to landunit level + real(r8), pointer, private :: frc_thr_rghn_fct_patch (:) ! [dimless] hybrid drag partition (or called roughness) factor + !########### added by dmleung 28 Jul 2022 ######################################################################## + real(r8), pointer, private :: wnd_frc_thr_std_patch (:) ! standardized fluid threshold friction velocity (m/s) contains procedure , public :: Init @@ -113,7 +142,32 @@ subroutine InitAllocate(this, bounds) allocate(this%vlc_trb_3_patch (begp:endp)) ; this%vlc_trb_3_patch (:) = nan allocate(this%vlc_trb_4_patch (begp:endp)) ; this%vlc_trb_4_patch (:) = nan allocate(this%mbl_bsn_fct_col (begc:endc)) ; this%mbl_bsn_fct_col (:) = nan - + !#### added by dmleung 27 Nov 2021 ##################################### + allocate(this%dst_emiss_coeff_patch (begp:endp)) ; this%dst_emiss_coeff_patch (:) = nan + allocate(this%wnd_frc_thr_patch (begp:endp)) ; this%wnd_frc_thr_patch (:) = nan + allocate(this%wnd_frc_thr_dry_patch (begp:endp)) ; this%wnd_frc_thr_dry_patch (:) = nan + allocate(this%lnd_frc_mble_patch (begp:endp)) ; this%lnd_frc_mble_patch (:) = nan + allocate(this%wnd_frc_soil_patch (begp:endp)) ; this%wnd_frc_soil_patch (:) = nan + allocate(this%gwc_patch (begp:endp)) ; this%gwc_patch (:) = nan + allocate(this%liq_frac_patch (begp:endp)) ; this%liq_frac_patch (:) = nan + !#### added by dmleung 2 Dec 2021 ###################################### + allocate(this%intrmtncy_fct_patch (begp:endp)) ; this%intrmtncy_fct_patch (:) = nan + allocate(this%stblty_patch (begp:endp)) ; this%stblty_patch (:) = nan + allocate(this%u_mean_slt_patch (begp:endp)) ; this%u_mean_slt_patch (:) = nan + allocate(this%u_sd_slt_patch (begp:endp)) ; this%u_sd_slt_patch (:) = nan + allocate(this%u_fld_thr_patch (begp:endp)) ; this%u_fld_thr_patch (:) = nan + allocate(this%u_impct_thr_patch (begp:endp)) ; this%u_impct_thr_patch (:) = nan + allocate(this%thr_crs_rate_patch (begp:endp)) ; this%thr_crs_rate_patch (:) = nan + allocate(this%prb_crs_fld_thr_patch (begp:endp)) ; this%prb_crs_fld_thr_patch (:) = nan + allocate(this%prb_crs_impct_thr_patch (begp:endp)) ; this%prb_crs_impct_thr_patch (:) = nan + !#### added by dmleung 17 Dec 2021 ###################################### + allocate(this%ustar_patch (begp:endp)) ; this%ustar_patch (:) = nan + !#### added by dmleung 17 Dec 2021 ###################################### + allocate(this%ssr_patch (begp:endp)) ; this%ssr_patch (:) = nan + allocate(this%lai_patch (begp:endp)) ; this%lai_patch (:) = nan + allocate(this%frc_thr_rghn_fct_patch (begp:endp)) ; this%frc_thr_rghn_fct_patch (:) = nan + !#### added by dmleung 28 Jul 2022 ###################################### + allocate(this%wnd_frc_thr_std_patch (begp:endp)) ; this%wnd_frc_thr_std_patch (:) = nan end subroutine InitAllocate !------------------------------------------------------------------------ @@ -158,6 +212,97 @@ subroutine InitHistory(this, bounds) avgflag='A', long_name='turbulent deposition velocity 4', & ptr_patch=this%vlc_trb_4_patch, default='inactive') + !#####added by dmleung 27 Nov 2021######################################### + this%dst_emiss_coeff_patch(begp:endp) = spval + call hist_addfld1d (fname='C_d', units='dimensionless', & + avgflag='A', long_name='dust emission coefficient', & + ptr_patch=this%dst_emiss_coeff_patch, set_lake=0._r8, set_urb=0._r8) + this%wnd_frc_thr_patch(begp:endp) = spval + call hist_addfld1d (fname='WND_FRC_FT', units='m/s', & + avgflag='A', long_name='fluid threshold friction velocity', & + ptr_patch=this%wnd_frc_thr_patch, set_lake=0._r8, set_urb=0._r8) + this%wnd_frc_thr_dry_patch(begp:endp) = spval + call hist_addfld1d (fname='WND_FRC_FT_DRY', units='m/s', & + avgflag='A', long_name='dry fluid threshold friction velocity', & + ptr_patch=this%wnd_frc_thr_dry_patch, set_lake=0._r8, set_urb=0._r8) + this%wnd_frc_soil_patch(begp:endp) = spval + call hist_addfld1d (fname='WND_FRC_SOIL', units='m/s', & + avgflag='A', long_name='soil surface wind friction velocity', & + ptr_patch=this%wnd_frc_soil_patch, set_lake=0._r8, set_urb=0._r8) + this%lnd_frc_mble_patch(begp:endp) = spval + call hist_addfld1d (fname='LND_FRC_MBLE', units='dimensionless', & + avgflag='A', long_name='land mobile fraction', & + ptr_patch=this%lnd_frc_mble_patch, set_lake=0._r8, set_urb=0._r8) + this%gwc_patch(begp:endp) = spval + call hist_addfld1d (fname='GWC', units='kg/kg', & + avgflag='A', long_name='gravimetric water content', & + ptr_patch=this%gwc_patch, set_lake=0._r8, set_urb=0._r8) + this%liq_frac_patch(begp:endp) = spval + call hist_addfld1d (fname='LIQ_FRAC', units='dimensionless', & + avgflag='A', long_name='fraction of total water that is liquid', & + ptr_patch=this%liq_frac_patch, set_lake=0._r8, set_urb=0._r8) + !#####added by dmleung 2 Dec 2021 ######################################### + this%u_mean_slt_patch(begp:endp) = spval + call hist_addfld1d (fname='U_S_MEAN', units='m/s', & + avgflag='A', long_name='mean wind velocity at saltation level', & + ptr_patch=this%u_mean_slt_patch, set_lake=0._r8, set_urb=0._r8) + this%u_sd_slt_patch(begp:endp) = spval + call hist_addfld1d (fname='U_S_SIGMA', units='m/s', & + avgflag='A', long_name='sd of wind velocity at saltation level', & + ptr_patch=this%u_sd_slt_patch, set_lake=0._r8, set_urb=0._r8) + this%stblty_patch(begp:endp) = spval + call hist_addfld1d (fname='ZETA', units='', & + avgflag='A', long_name='stability parameter', & + ptr_patch=this%stblty_patch, set_lake=0._r8, set_urb=0._r8) + this%u_fld_thr_patch(begp:endp) = spval + call hist_addfld1d (fname='U_FT', units='m/s', & + avgflag='A', long_name='fluid threshold velocity at saltation level', & + ptr_patch=this%u_fld_thr_patch, set_lake=0._r8, set_urb=0._r8) + this%u_impct_thr_patch(begp:endp) = spval + call hist_addfld1d (fname='U_IT', units='m/s', & + avgflag='A', long_name='impact threshold velocity at saltation level', & + ptr_patch=this%u_impct_thr_patch, set_lake=0._r8, set_urb=0._r8) + this%thr_crs_rate_patch(begp:endp) = spval + call hist_addfld1d (fname='ALPHA', units='', & + avgflag='A', long_name='threshold crossing rate', & + ptr_patch=this%thr_crs_rate_patch, set_lake=0._r8, set_urb=0._r8) + this%prb_crs_fld_thr_patch(begp:endp) = spval + call hist_addfld1d (fname='P_FT', units='', & + avgflag='A', long_name='probability of crossing fluid threshold', & + ptr_patch=this%prb_crs_fld_thr_patch, set_lake=0._r8, set_urb=0._r8) + this%prb_crs_impct_thr_patch(begp:endp) = spval + call hist_addfld1d (fname='P_IT', units='', & + avgflag='A', long_name='probability of crossing impact threshold', & + ptr_patch=this%prb_crs_impct_thr_patch, set_lake=0._r8, set_urb=0._r8) + this%intrmtncy_fct_patch(begp:endp) = spval + call hist_addfld1d (fname='ETA', units='', & + avgflag='A', long_name='intermittency factor', & + ptr_patch=this%intrmtncy_fct_patch, set_lake=0._r8, set_urb=0._r8) + !#####added by dmleung 2 Dec 2021 ######################################### + this%ustar_patch(begp:endp) = spval + call hist_addfld1d (fname='USTAR', units='m/s', & + avgflag='A', long_name='friction velocity', & + ptr_patch=this%ustar_patch, set_lake=0._r8, set_urb=0._r8) + !#####added by dmleung 20 Dec 2021 ######################################## + this%ssr_patch(begp:endp) = spval + call hist_addfld1d (fname='SSR', units='m/s', & + avgflag='A', long_name='Okin-Pierre shear stress ratio', & + ptr_patch=this%ssr_patch, set_lake=0._r8, set_urb=0._r8) + this%lai_patch(begp:endp) = spval + call hist_addfld1d (fname='LAI', units='m/s', & + avgflag='A', long_name='landunit-mean LAI for Okin-Pierre scheme', & + ptr_patch=this%lai_patch, set_lake=0._r8, set_urb=0._r8) + this%frc_thr_rghn_fct_patch(begp:endp) = spval + call hist_addfld1d (fname='FRC_THR_RGHN_FCT', units='dimensionless', & + avgflag='A', long_name='hybrid drag partition (or roughness) factor', & + ptr_patch=this%frc_thr_rghn_fct_patch, set_lake=0._r8, set_urb=0._r8) + !#####added by dmleung 28 Jul 2022 ######################################## + this%wnd_frc_thr_std_patch(begp:endp) = spval + call hist_addfld1d (fname='WND_FRC_FT_STD', units='m/s', & + avgflag='A', long_name='standardized fluid threshold friction velocity', & + ptr_patch=this%wnd_frc_thr_std_patch, set_lake=0._r8, set_urb=0._r8) + !########################################################################## + end subroutine InitHistory !----------------------------------------------------------------------- @@ -224,7 +369,7 @@ subroutine DustEmission (bounds, & real(r8) :: flx_mss_vrt_dst_ttl(bounds%begp:bounds%endp) real(r8) :: frc_thr_wet_fct real(r8) :: frc_thr_rgh_fct - real(r8) :: wnd_frc_thr_slt + !real(r8) :: wnd_frc_thr_slt ! dmleung commented and put below 2 Dec 2021 real(r8) :: wnd_rfr_thr_slt real(r8) :: wnd_frc_slt real(r8) :: lnd_frc_mbl(bounds%begp:bounds%endp) @@ -235,13 +380,43 @@ subroutine DustEmission (bounds, & real(r8) :: sumwt(bounds%begl:bounds%endl) ! sum of weights logical :: found ! temporary for error check integer :: index + !########### added by dmleung 27 Nov 2021 ######################################### + real(r8) :: tmp2 ! calculates the dry fluid threshold using Shao and Lu (2000) scheme; replace the tmp1 (Iversen and White, 1982) that was passed from Dustini to DustEmission; tmp2 will be calculated here 23 May 2020 -dmleung + real(r8) :: wnd_frc_thr_slt_std ! [m/s] The soil threshold friction speed at standard air density (1.2250 kg/m3) -jfk + real(r8) :: frag_expt ! fragmentation exponent, -dmleung 22 Jun 2021 + !########### added by dmleung 2 Dec 2021 for intermittency scheme ################# + real(r8) :: wnd_frc_thr_slt_it ! [m/s] created for impact threshold friction velocity, dmleung 9 Jun 2021 + real(r8) :: wnd_frc_thr_slt ! [m/s] used for wet fluid threshold friction velocity, dmleung 9 Jun 2021 + !########### added by dmleung 20 Dec 2021 for drag partition effect ################# + real(r8) :: K_length ! [dimless] normalized mean interobstacle distance, or called gap length (Okin, 2008) + !########### added by dmleung 22 Jul 2022 for LUH2 land cover #################### + real(r8) :: bare_frc ! LUH2 bare soil land cover fraction + real(r8) :: veg_frc ! LUH2 natural vegetation + crop land cover fraction ! ! constants ! real(r8), parameter :: cst_slt = 2.61_r8 ! [frc] Saltation constant real(r8), parameter :: flx_mss_fdg_fct = 5.0e-4_r8 ! [frc] Empir. mass flx tuning eflx_lh_vegt - real(r8), parameter :: vai_mbl_thr = 0.3_r8 ! [m2 m-2] VAI threshold quenching dust mobilization + !real(r8), parameter :: vai_mbl_thr = 0.3_r8 ! [m2 m-2] VAI threshold quenching dust mobilization + !real(r8), parameter :: vai_mbl_thr = 0.3_r8 ! [m2 m-2] VAI threshold quenching dust mobilization + !####### added by dmleung 27 Nov 2021 ########################################################################### character(len=*),parameter :: subname = 'DUSTEmission' + real(r8), parameter :: vai_mbl_thr = 1.0_r8 ! [m2 m-2] new VAI threshold; dmleung suggests 1 or 0.5, and the default 0.3 seems a bit too small -dmleung 27 Nov 2021 + real(r8), parameter :: Cd0 = 4.4e-5_r8 ! [dimless] proportionality constant in calculation of dust emission coefficient -jfk + real(r8), parameter :: Ca = 2.7_r8 ! [dimless] proportionality constant in scaling of dust emission exponent -jfk + real(r8), parameter :: Ce = 2.0_r8 ! [dimless] proportionality constant scaling exponential dependence of dust emission coefficient on standardized soil threshold friction speed -jfk + real(r8), parameter :: C_tune = 0.05_r8 ! [dimless] global tuning constant for vertical dust flux; set to produce ~same global dust flux in control sim (I_2000) as old parameterization -jfk + real(r8), parameter :: wnd_frc_thr_slt_std_min = 0.16_r8 ! [m/s] minimum standardized soil threshold friction speed -jfk + real(r8), parameter :: forc_rho_std = 1.2250_r8 ! [kg/m3] density of air at standard pressure (101325) and temperature (293 K) -jfk + real(r8), parameter :: dns_slt = 2650.0_r8 ! [kg m-3] Density of optimal saltation particles, dml 23 May 2020 + !####### added by dmleung 2 Dec 2021 for intermittency ########################################################## + real(r8), parameter :: B_it = 0.82_r8 ! [dimless] ratio = u_star_it / u_star_ft0 (may need to change into a fn of moisture later on) -dml + real(r8), parameter :: k = 0.4_r8 ! [dimless] von Karman constant -dml + !####### added by dmleung 2 Dec 2021 for Okin (2008) drag partition for plants ########################################################## + real(r8), parameter :: f_0 = 0.32_r8 ! [dimless] SSR in the immediate lee of a plant, dimensionless + real(r8), parameter :: c_e = 4.8_r8 ! [dimless] e-folding distance velocity recovery, dimensionless + !################################################################################################################ + !################################################################################################################ !------------------------------------------------------------------------ associate( & @@ -264,7 +439,34 @@ subroutine DustEmission (bounds, & mbl_bsn_fct => dust_inst%mbl_bsn_fct_col , & ! Input: [real(r8) (:) ] basin factor flx_mss_vrt_dst => dust_inst%flx_mss_vrt_dst_patch , & ! Output: [real(r8) (:,:) ] surface dust emission (kg/m**2/s) - flx_mss_vrt_dst_tot => dust_inst%flx_mss_vrt_dst_tot_patch & ! Output: [real(r8) (:) ] total dust flux back to atmosphere (pft) + flx_mss_vrt_dst_tot => dust_inst%flx_mss_vrt_dst_tot_patch , & ! Output: [real(r8) (:) ] total dust flux back to atmosphere (pft) + ! the following are added by dmleung 27 Nov 2021 + dst_emiss_coeff => dust_inst%dst_emiss_coeff_patch , & ! Output dust emission coefficient + wnd_frc_thr => dust_inst%wnd_frc_thr_patch , & ! output impact threshold -dmleung + wnd_frc_thr_dry => dust_inst%wnd_frc_thr_dry_patch , & ! output dry threshold + lnd_frc_mble => dust_inst%lnd_frc_mble_patch , & ! -dmleung, 3 Feb 2020 + wnd_frc_soil => dust_inst%wnd_frc_soil_patch , & ! soil friction velocity u_*s = (u_*)(f_eff) + gwc => dust_inst%gwc_patch , & ! output gravimetric water content + liq_frac => dust_inst%liq_frac_patch , & + ! added by dmleung 8 Jul 2019, recoded 2 Dec 2021 + intrmtncy_fct => dust_inst%intrmtncy_fct_patch , & + stblty => dust_inst%stblty_patch , & + u_mean_slt => dust_inst%u_mean_slt_patch , & + u_sd_slt => dust_inst%u_sd_slt_patch , & + u_fld_thr => dust_inst%u_fld_thr_patch , & + u_impct_thr => dust_inst%u_impct_thr_patch , & + thr_crs_rate => dust_inst%thr_crs_rate_patch , & + prb_crs_fld_thr => dust_inst%prb_crs_fld_thr_patch , & + prb_crs_impct_thr => dust_inst%prb_crs_impct_thr_patch , & + ! added by dmleung 17 Dec 2021 + roughfct => soilstate_inst%roughfct_patch , & + ustar => dust_inst%ustar_patch , & ! Output friction velocity for SP mode + ! added by dmleung 20 Dec 2021 + ssr => dust_inst%ssr_patch , & + lai => dust_inst%lai_patch , & + frc_thr_rghn_fct => dust_inst%frc_thr_rghn_fct_patch , & + ! added by dmleung 28 Jul 2022 + wnd_frc_thr_std => dust_inst%wnd_frc_thr_std_patch & ) ttlai(bounds%begp : bounds%endp) = 0._r8 @@ -342,6 +544,32 @@ subroutine DustEmission (bounds, & do fp = 1,num_nolakep p = filter_nolakep(fp) flx_mss_vrt_dst_tot(p) = 0.0_r8 + ! the following are added by dmleung 27 Nov 2021 + dst_emiss_coeff(p) = 0.0_r8 + wnd_frc_thr(p) = 0.0_r8 + wnd_frc_thr_dry(p) = 0.0_r8 + lnd_frc_mble(p) = 0.0_r8 + wnd_frc_soil(p) = 0.0_r8 + gwc(p) = 0.0_r8 + liq_frac(p) = 0.0_r8 + ! dmleung's edit, 8 Jul 2019; added by dmleung 2 Dec 2021 + u_mean_slt(p) = 0.0_r8 + u_sd_slt(p) = 0.0_r8 + stblty(p) = 0.0_r8 + u_fld_thr(p) = 0.0_r8 + u_impct_thr(p) = 0.0_r8 + thr_crs_rate(p) = 0.0_r8 + prb_crs_fld_thr(p) = 0.0_r8 + prb_crs_impct_thr(p) = 0.0_r8 + intrmtncy_fct(p) = 0.0_r8 + ! dmleung's edit for including friction velcoity for SP mode output, 17 Dec 2021 + ustar(p) = 0.0_r8 + ! dmleung's edit, 20 Dec 2021 + ssr(p) = 0.0_r8 + lai(p) = 0.0_r8 + frc_thr_rghn_fct(p) = 0.0_r8 + ! dmleung added 28 Jul 2022 + wnd_frc_thr_std(p) = 0.0_r8 end do do n = 1, ndst do fp = 1,num_nolakep @@ -356,6 +584,109 @@ subroutine DustEmission (bounds, & l = patch%landunit(p) g = patch%gridcell(p) + !################################################################################################ + ! put dust emission calculation here to output threshold friction velocity for the whole globe, + ! not just when lnd_frc_mbl = 0. Edited by dmleung 27 Nov 2021 + bd = (1._r8-watsat(c,1))*2.7e3_r8 ![kg m-3] Bulk density of dry surface soil + gwc_sfc = h2osoi_vol(c,1)*SHR_CONST_RHOFW/bd ![kg kg-1] Gravimetric H2O cont + if (gwc_sfc > gwc_thr(c)) then + frc_thr_wet_fct = sqrt(1.0_r8 + 1.21_r8 * (100.0_r8*(gwc_sfc - gwc_thr(c)))**0.68_r8) + else + frc_thr_wet_fct = 1.0_r8 + end if + + ! output moisture variables -dmleung, coded Jul 2020, recoded 18 Mar 2021, added to CLM5 27 Nov 2021 + gwc(p) = gwc_sfc ! output surface gravimetric water content + + ! slevis: adding liqfrac here, because related to effects from soil water + liqfrac = max( 0.0_r8, min( 1.0_r8, h2osoi_liq(c,1) / (h2osoi_ice(c,1)+h2osoi_liq(c,1)+1.0e-6_r8) ) ) !-dmleung 27 Nov 2021 + ! output liquid fraction -dmleung 27 Nov 2021 + liq_frac(p) = liqfrac + + !####################################################################################################### + ! calculate Shao & Lu (2000) dust emission threshold scheme here + ! use tmp1 from DUSTini for Iversen and White I&W (1982) (75 um is optimal); use tmp2 for S&L (2000) (107 um is optimal) + ! recoded to CLM5 27 Nov 2021 + !####################################################################################################### + + tmp2 = 1.0_r8*sqrt(0.0123_r8 * (dns_slt*grav*130.0e-6_r8 + 1.65e-4_r8/130.0e-6_r8)) ! calculate S&L (2000) scheme here for threshold; gamma = 1.65e-4 following S&L00, D_p = 127 um ~ 130 um following dmleung's dust paper. As this is a global constant, this line can be put outside the loop to save computational power. + wnd_frc_thr_dry(p) = tmp2 / sqrt(forc_rho(c)) ! output dry fluid threshold + wnd_frc_thr_slt = tmp2 / sqrt(forc_rho(c)) * frc_thr_wet_fct !* frc_thr_rgh_fct ! use as threshold in this module + wnd_frc_thr_slt_it = B_it * tmp2 / sqrt(forc_rho(c)) ! define impact threshold -dml 9 Jun 2021, recoded to CLM5 27 Nov 2021 + + !wnd_frc_thr_dry(p) = tmp1 / sqrt(forc_rho(c)) ! output dry fluid threshold + !wnd_frc_thr_slt = tmp1 / sqrt(forc_rho(c)) * frc_thr_wet_fct !* frc_thr_rgh_fct ! use as threshold in this module + !wnd_frc_thr_slt_it = B_it * tmp1 / sqrt(forc_rho(c)) ! define impact threshold -dmleung 9 Jun 2021, recoded to CLM5 27 Nov 2021 + ! the above formula is true for Iversen and White (1982) and Shao and Lu (2000) scheme -dmleung, 23 Feb 2020, added to CLM5 27 Nov 2021 + wnd_frc_thr(p) = wnd_frc_thr_slt ! output fluid threshold -dmleung + + ! use emission threshold to calculate standardized threshold and dust emission coefficient dmleung 27 Nov 2021 + wnd_frc_thr_slt_std = wnd_frc_thr_slt * sqrt(forc_rho(c) / forc_rho_std) ! standardized soil threshold friction speed -jfk (defined using fluid threshold + wnd_frc_thr_std(p) = wnd_frc_thr_slt_std ! output standardized fluid threshold -dmleung added 28 Jul 2022 + dst_emiss_coeff(p) = Cd0 * exp(-Ce * (wnd_frc_thr_slt_std - wnd_frc_thr_slt_std_min) / wnd_frc_thr_slt_std_min) ! save dust emission coefficient here for all grids, -dml, 1 Mar 2021 + + ! framentation exponent dmleung 27 Nov 2021; moved to this block 23 Dec 2021 + frag_expt = (Ca * (wnd_frc_thr_slt_std - wnd_frc_thr_slt_std_min) / wnd_frc_thr_slt_std_min) ! fragmentation exponent, defined in Kok et al. (2014a) -dmleung 27 Nov 2021 + if (frag_expt > 3_r8) then ! set fragmentation exponent to be 3 or 5 at maximum, to avoid local AOD blowup + frag_expt = 3_r8 + end if + + !################ drag partition effect, and soil friction velocity############################ + ! subsection on computing vegetation drag partition and hybrid drag partition factors + ! in our scheme, drag partition effect is applied on the wind instead of the threshold + ! -dmleung, 7 Jul 2021 , coded to CLM5 27 Nov 2021 + !############################################################################################## + ! the following comes from subr. frc_thr_rgh_fct_get + ! purpose: compute factor by which surface roughness increases threshold + ! friction velocity (currently a constant) + + if (lnd_frc_mbl(p) > 0.0_r8 .AND. tlai_lu(l)<=1_r8) then + ! vegetation drag partition equation following Gregory Okin (2008) + Caroline Pierre et al. (2014), dmleung 20 Dec 2021 + lai(p) = tlai_lu(l) ! LAI+SAI averaged to landunit level; saved for output + if (lai(p) < 0.1_r8) then + lai(p) = 0.1_r8 ! setting LAI ~ 0.1 to be a threshold value as computing K involves 1 / LAI + end if + ! calculate Okin's shear stress ratio (which is drag partition factor) using Pierre's equation + K_length = 2_r8 * (1_r8/lai(p) - 1_r8) ! Here LAI has to be non-zero to avoid blowup + ssr(p) = (K_length+f_0*c_e)/(K_length+c_e) + + !frc_thr_rgh_fct = (rockfrc(p)*(roughfct(p))**3_r8 + (vegefrc(p)+sparfrc(p))*(ssr(p))**3_r8 )**(0.3333_r8) ! land cover weighted mean using static GLCNMo bare land fraction LC0, dmleung 20 Dec 2021i; dmleung commented 24 Jul 2022 + + ! dmleung added calculation of LUH2 bare vs veg fraction within a grid 24 Jul 2022 + bare_frc = wt_lunit(g,istsoil) * wt_nat_patch(g,noveg) + veg_frc = wt_lunit(g,istsoil) * sum(wt_nat_patch(g,(noveg+1):natpft_ub)) + wt_lunit(g,istcrop) + + frc_thr_rgh_fct = (bare_frc*(roughfct(p))**3_r8 + veg_frc*(ssr(p))**3_r8 )**(0.3333_r8) ! land cover weighted mean using LUH2 land cover, dmleung 24 Jul 2022 + + + wnd_frc_slt = fv(p) * frc_thr_rgh_fct ! wnd_frc_slt will be used in the dust emission equation -dmleung + + frc_thr_rghn_fct(p) = frc_thr_rgh_fct ! save hybrid drag partition factor, dmleung 20 Dec 2021 + else + wnd_frc_slt = fv(p) ! The value here is not important since once lnd_frc_mbl(p) <= 0.0_r8 there will be no emission. + frc_thr_rghn_fct(p) = 0.0_r8 ! save hybrid drag partition factor, dmleung 20 Dec 2021 + end if + + !##########end of drag partition effect ####################################################### + + !############ Add Owen effect; if not, comment out this block !-dmleung, 27 Nov 2021 ########### + ! the following if-block comes from subr. wnd_frc_slt_get + ! purpose: compute the saltating friction velocity + ! theory: saltation roughens the boundary layer, AKA "Owen's effect" + + !if (u10(p) >= wnd_rfr_thr_slt) then + ! wnd_rfr_dlt = u10(p) - wnd_rfr_thr_slt + ! wnd_frc_slt_dlt = 0.003_r8 * wnd_rfr_dlt * wnd_rfr_dlt + ! wnd_frc_slt = wnd_frc_slt + wnd_frc_slt_dlt ! careful that RHS is now wnd_frc_slt instead of fv(p) + ! ! because wnd_frc_slt takes drag partition effect into account, but fv(p) doesn't. dmleung 27 Nov 2021 + !end if + !########## end of Owen effect ################################################################ + + ! save soil friction velocity and roughness effect before the if-statement, -dml, 1 Mar 2021, coded to CLM5 27 Nov 2021 + wnd_frc_soil(p) = wnd_frc_slt ! save soil friction velocity for CLM output, which has drag partition and Owen effect -dml + ustar(p) = fv(p) ! save friction velocity for SP mode (use_cn=0) since only CN/BGC mode (use_cn=1) has FV output -dmleung 17 Dec 2021 + ! save land mobile fraction + lnd_frc_mble(p) = lnd_frc_mbl(p) ! save land mobile fraction first, before the if-statement, -dml, 1 Mar 2021 ! only perform the following calculations if lnd_frc_mbl is non-zero if (lnd_frc_mbl(p) > 0.0_r8) then @@ -364,7 +695,7 @@ subroutine DustEmission (bounds, & ! purpose: compute factor by which surface roughness increases threshold ! friction velocity (currently a constant) - frc_thr_rgh_fct = 1.0_r8 + !frc_thr_rgh_fct = 1.0_r8 ! the following comes from subr. frc_thr_wet_fct_get ! purpose: compute factor by which soil moisture increases threshold friction velocity @@ -372,17 +703,17 @@ subroutine DustEmission (bounds, & ! modified 4/5/2002 (slevis) to use gravimetric instead of volumetric ! water content - bd = (1._r8-watsat(c,1))*2.7e3_r8 ![kg m-3] Bulk density of dry surface soil - gwc_sfc = h2osoi_vol(c,1)*SHR_CONST_RHOFW/bd ![kg kg-1] Gravimetric H2O cont - if (gwc_sfc > gwc_thr(c)) then - frc_thr_wet_fct = sqrt(1.0_r8 + 1.21_r8 * (100.0_r8*(gwc_sfc - gwc_thr(c)))**0.68_r8) - else - frc_thr_wet_fct = 1.0_r8 - end if + !bd = (1._r8-watsat(c,1))*2.7e3_r8 ![kg m-3] Bulk density of dry surface soil + !gwc_sfc = h2osoi_vol(c,1)*SHR_CONST_RHOFW/bd ![kg kg-1] Gravimetric H2O cont + !if (gwc_sfc > gwc_thr(c)) then + ! frc_thr_wet_fct = sqrt(1.0_r8 + 1.21_r8 * (100.0_r8*(gwc_sfc - gwc_thr(c)))**0.68_r8) + !else + ! frc_thr_wet_fct = 1.0_r8 + !end if ! slevis: adding liqfrac here, because related to effects from soil water - liqfrac = max( 0.0_r8, min( 1.0_r8, h2osoi_liq(c,1) / (h2osoi_ice(c,1)+h2osoi_liq(c,1)+1.0e-6_r8) ) ) + !liqfrac = max( 0.0_r8, min( 1.0_r8, h2osoi_liq(c,1) / (h2osoi_ice(c,1)+h2osoi_liq(c,1)+1.0e-6_r8) ) ) ! the following lines come from subr. dst_mbl ! purpose: adjust threshold friction velocity to acct for moisture and @@ -390,52 +721,125 @@ subroutine DustEmission (bounds, & ! subr. wnd_frc_thr_slt_get which computes dry threshold ! friction velocity for saltation - wnd_frc_thr_slt = tmp1 / sqrt(forc_rho(c)) * frc_thr_wet_fct * frc_thr_rgh_fct + !wnd_frc_thr_slt = tmp1 / sqrt(forc_rho(c)) * frc_thr_wet_fct * frc_thr_rgh_fct ! reset these variables which will be updated in the following if-block - wnd_frc_slt = fv(p) + !wnd_frc_slt = fv(p) flx_mss_hrz_slt_ttl = 0.0_r8 flx_mss_vrt_dst_ttl(p) = 0.0_r8 ! the following line comes from subr. dst_mbl ! purpose: threshold saltation wind speed - wnd_rfr_thr_slt = u10(p) * wnd_frc_thr_slt / fv(p) + wnd_rfr_thr_slt = u10(p) * wnd_frc_thr_slt / fv(p) ! keep and use if I want Z03 scheme -dmleung ! the following if-block comes from subr. wnd_frc_slt_get ! purpose: compute the saltating friction velocity ! theory: saltation roughens the boundary layer, AKA "Owen's effect" - if (u10(p) >= wnd_rfr_thr_slt) then - wnd_rfr_dlt = u10(p) - wnd_rfr_thr_slt - wnd_frc_slt_dlt = 0.003_r8 * wnd_rfr_dlt * wnd_rfr_dlt - wnd_frc_slt = fv(p) + wnd_frc_slt_dlt - end if + !if (u10(p) >= wnd_rfr_thr_slt) then + ! wnd_rfr_dlt = u10(p) - wnd_rfr_thr_slt + ! wnd_frc_slt_dlt = 0.003_r8 * wnd_rfr_dlt * wnd_rfr_dlt + ! wnd_frc_slt = fv(p) + wnd_frc_slt_dlt + !end if ! the following comes from subr. flx_mss_hrz_slt_ttl_Whi79_get ! purpose: compute vertically integrated streamwise mass flux of particles - if (wnd_frc_slt > wnd_frc_thr_slt) then - wnd_frc_rat = wnd_frc_thr_slt / wnd_frc_slt - flx_mss_hrz_slt_ttl = cst_slt * forc_rho(c) * (wnd_frc_slt**3.0_r8) * & - (1.0_r8 - wnd_frc_rat) * (1.0_r8 + wnd_frc_rat) * (1.0_r8 + wnd_frc_rat) / grav + !if (wnd_frc_slt > wnd_frc_thr_slt) then! if want to use fluid threshold for dust emission, uncomment this one, -dmleung 2 Dec 2021 + if (wnd_frc_slt > wnd_frc_thr_slt_it) then! if want to use impact threshold for dust emission, uncomment this one, -dmleung 2 Dec 2021 + + !################### for Zender et al. (2003) scheme -dmleung ########################### + !################ uncomment the below block if want to use Z03 scheme ################### + !wnd_frc_rat = wnd_frc_thr_slt / wnd_frc_slt + !flx_mss_hrz_slt_ttl = cst_slt * forc_rho(c) * (wnd_frc_slt**3.0_r8) * & + ! (1.0_r8 - wnd_frc_rat) * (1.0_r8 + wnd_frc_rat) * (1.0_r8 + wnd_frc_rat) / grav ! the following loop originates from subr. dst_mbl ! purpose: apply land sfc and veg limitations and global tuning factor ! slevis: multiply flx_mss_hrz_slt_ttl by liqfrac to incude the effect ! of frozen soil - flx_mss_hrz_slt_ttl = flx_mss_hrz_slt_ttl * lnd_frc_mbl(p) * mbl_bsn_fct(c) * & - flx_mss_fdg_fct * liqfrac + !flx_mss_hrz_slt_ttl = flx_mss_hrz_slt_ttl * lnd_frc_mbl(p) * mbl_bsn_fct(c) * & + ! flx_mss_fdg_fct * liqfrac + + ! dmleung moved to this block + !dst_slt_flx_rat_ttl = 100.0_r8 * exp( log(10.0_r8) * (13.4_r8 * mss_frc_cly_vld(c) - 6.0_r8) ) + !flx_mss_vrt_dst_ttl(p) = flx_mss_hrz_slt_ttl * dst_slt_flx_rat_ttl + !######################################################################################## + + !################### for Kok et al. (2014) scheme -dmleung ############################## + !################ uncomment the below block if want to use K14 scheme ################### + + ! if want to use fluid threshold for dust emission, uncomment this one, -dmleung 27 Nov 2021 + !flx_mss_vrt_dst_ttl(p) = dst_emiss_coeff(p) * mss_frc_cly_vld(c) * forc_rho(c) * ((wnd_frc_slt**2.0_r8 - wnd_frc_thr_slt**2.0_r8) / wnd_frc_thr_slt_std) * (wnd_frc_slt / wnd_frc_thr_slt)**frag_expt ! change forc_rho(g) to forc_rho(c) to avoid passing Nan values to the coupler -Longlei ! if want to use fluid threshold for dust emission, uncomment this one, -dml 27 Nov 2021 + + ! if want to use impact threshold for dust emission, uncomment this one, -dmleung 2 Dec 2021 + flx_mss_vrt_dst_ttl(p) = dst_emiss_coeff(p) * mss_frc_cly_vld(c) * forc_rho(c) * ((wnd_frc_slt**2.0_r8 - wnd_frc_thr_slt_it**2.0_r8) / wnd_frc_thr_slt_std) * (wnd_frc_slt / wnd_frc_thr_slt_it)**frag_expt ! if want to use impact threshold for dust emission, uncomment this one, -dml 2 Dec 2021 + + ! account for bare soil fraction, frozen soil fraction, and apply global tuning parameter (Kok et al. 2014) + flx_mss_vrt_dst_ttl(p) = flx_mss_vrt_dst_ttl(p) * lnd_frc_mbl(p) * C_tune * liqfrac + !######################################################################################## end if ! the following comes from subr. flx_mss_vrt_dst_ttl_MaB95_get ! purpose: diagnose total vertical mass flux of dust from vertically ! integrated streamwise mass flux - dst_slt_flx_rat_ttl = 100.0_r8 * exp( log(10.0_r8) * (13.4_r8 * mss_frc_cly_vld(c) - 6.0_r8) ) - flx_mss_vrt_dst_ttl(p) = flx_mss_hrz_slt_ttl * dst_slt_flx_rat_ttl + !dst_slt_flx_rat_ttl = 100.0_r8 * exp( log(10.0_r8) * (13.4_r8 * mss_frc_cly_vld(c) - 6.0_r8) ) ! dmleung commented and moved to the previous block + !flx_mss_vrt_dst_ttl(p) = flx_mss_hrz_slt_ttl * dst_slt_flx_rat_ttl + + !############## added by dmleung 2 Dec 2021 ############################################# + ! subsection for intermittency factor calculation + ! need to use with impact threshold and cannot be used with fluid threshold + ! Danny M. Leung, 24 Jun 2019, readded into CLM5 by dmleung 2 Dec 2021 + ! 2 Dec 2021 note: assume no buoyancy contribution to the wind fluctuation (u_sd_slt), so no obul(p) is needed. It is shown to be important for the wind fluctuations contribute little to the intermittency factor. We might add this back in the future revisions. + + ! mean lowpass-filtered wind speed at 0.1 m saltation height (assuming aerodynamic roughness length = 1e-4 m globally for ease; also assuming neutral condition) + u_mean_slt(p) = (wnd_frc_slt/k) * log(0.1_r8 / 1e-4_r8) + + ! sd of lowpass-filtered wind speed + !if (obul(p)==0) then + ! zetaobu = 0 + !else + !zetaobu = zii(p) / obul(p) ! For now zii is a constant of 1000 m in CLM -dml, 24 Aug 2021 + ! zetaobu = 1000_r8 / obul(p) ! For now zii is a constant of 1000 m in CLM -dml, 24 Aug 2021 + !end if + !stblty(p) = zetaobu ! zetaobu get outputted as the Obukhov stability parameter + stblty(p) = 0 ! -dmleung 2 Dec 2021: use 0 for now, assuming no buoyancy contribution. Might uncomment the above lines in future revisions. + if ((12_r8 - 0.5_r8 * stblty(p)) .GE. 0.001_r8) then + u_sd_slt(p) = wnd_frc_slt * (12_r8 - 0.5_r8 * stblty(p))**0.333_r8 + else + u_sd_slt(p) = 0.001_r8 ! should have used 0 theoretically; used 0.001 here to avoid undefined values + end if + + ! threshold velocities + ! Here wnd_frc_thr_slt is the fluid threshold; wnd_frc_thr_dry(p) is the dry fluid threshold; B_it*wnd_frc_thr_dry(p) is the impact threshold, -dml, 1 Mar 2021 + ! fluid threshold wind at 0.1 m saltation height + u_fld_thr(p) = (wnd_frc_thr_slt/k) * log(0.1_r8 / 1e-4_r8) + ! impact threshold wind at 0.1 m saltation height + u_impct_thr(p) = (wnd_frc_thr_slt_it/k) * log(0.1_r8 / 1e-4_r8) ! to avoid model error + + ! threshold crossing rate + thr_crs_rate(p) = (exp((u_fld_thr(p)**2_r8 - u_impct_thr(p)**2_r8 - 2_r8 * u_mean_slt(p) * (u_fld_thr(p) - u_impct_thr(p))) / (2_r8 * u_sd_slt(p)**2_r8)) + 1_r8)**(-1_r8) + + ! probability that lowpass-filtered wind speed does not exceed u_ft + prb_crs_fld_thr(p) = 0.5_r8 * (1_r8 + erf((u_fld_thr(p) - u_mean_slt(p)) / (1.414_r8 * u_sd_slt(p)))) + ! probability that lowpass-filtered wind speed does not exceed u_it + prb_crs_impct_thr(p) = 0.5_r8 * (1_r8 + erf((u_impct_thr(p) - u_mean_slt(p)) / (1.414_r8 * u_sd_slt(p)))) + + ! intermittency factor (from 0 to 1) + intrmtncy_fct(p) = 1_r8 - prb_crs_fld_thr(p) + thr_crs_rate(p) * (prb_crs_fld_thr(p) - prb_crs_impct_thr(p)) + + ! multiply dust emission flux by intermittency factor + if (intrmtncy_fct(p) /= intrmtncy_fct(p)) then ! if intrmtncy_fct(p) is not NaN then multiply by intermittency factor; this statement is needed because dust emission flx_mss_vrt_dst_ttl(p) has to be non NaN (at least zero) to be outputted, dmleung 9 Jun 2021 + flx_mss_vrt_dst_ttl(p) = flx_mss_vrt_dst_ttl(p) ! -dmleung + else + flx_mss_vrt_dst_ttl(p) = flx_mss_vrt_dst_ttl(p) * intrmtncy_fct(p) ! multiply dust flux by intermittency -dmleung + end if + + !############### end my subsection here -dmleung ######################################## end if ! lnd_frc_mbl > 0.0 diff --git a/src/biogeophys/SoilStateInitTimeConstMod.F90 b/src/biogeophys/SoilStateInitTimeConstMod.F90 index 9122b56890..2c1b00a8f6 100644 --- a/src/biogeophys/SoilStateInitTimeConstMod.F90 +++ b/src/biogeophys/SoilStateInitTimeConstMod.F90 @@ -172,6 +172,7 @@ subroutine SoilStateInitTimeConst(bounds, soilstate_inst, nlfilename) use clm_varcon , only : secspday, denh2o, denice, grlnd use clm_varctl , only : use_cn, use_lch4, use_fates use clm_varctl , only : iulog, fsurdat, paramfile, soil_layerstruct_predefined + use clm_varctl , only : rough_fct ! -dmleung added to CESM2/CLM5 17 Dec 2021 use landunit_varcon , only : istdlak, istwet, istsoil, istcrop, istice use column_varcon , only : icol_roof, icol_sunwall, icol_shadewall, icol_road_perv, icol_road_imperv use fileutils , only : getfil @@ -220,6 +221,7 @@ subroutine SoilStateInitTimeConst(bounds, soilstate_inst, nlfilename) real(r8) ,pointer :: sand3d (:,:) ! read in - soil texture: percent sand (needs to be a pointer for use in ncdio) real(r8) ,pointer :: clay3d (:,:) ! read in - soil texture: percent clay (needs to be a pointer for use in ncdio) real(r8) ,pointer :: organic3d (:,:) ! read in - organic matter: kg/m3 (needs to be a pointer for use in ncdio) + real(r8) ,pointer :: roughfct2d(:) ! read in - time-invariant roughness factor, dmleung added 17 Dec 2021 character(len=256) :: locfn ! local filename integer :: ipedof integer :: begp, endp @@ -369,6 +371,25 @@ subroutine SoilStateInitTimeConst(bounds, soilstate_inst, nlfilename) call ncd_pio_closefile(ncid) + !############ subsection for input data for new dust emission scheme ############## + + ! dmleung added to CESM2/CLM5 17 Dec 2021 + allocate(roughfct2d(begg:endg)) ! dmleung, 16 Jul 2020 + ! here to read roughness factor file, 16 Jul 2020 + !write(iulog,*) 'Attempting to read roughness factor data, by dmleung .....' + call getfil (rough_fct, locfn, 0) + call ncd_pio_openfile (ncid, locfn, 0) + call ncd_io(ncid=ncid, varname='F_eff', flag='read', data=roughfct2d, dim1name=grlnd, readvar=readvar) + !write(iulog,*) 'initialize pft level roughness factor from roughfct2d(g) to roughfct(p)' + + do p = begp,endp + g = patch%gridcell(p) + soilstate_inst%roughfct_patch(p) = roughfct2d(g) + end do + + call ncd_pio_closefile(ncid) + !################################################################################## + ! -------------------------------------------------------------------- ! get original soil depths to be used in interpolation of sand and clay ! -------------------------------------------------------------------- @@ -702,7 +723,8 @@ subroutine SoilStateInitTimeConst(bounds, soilstate_inst, nlfilename) do c = begc,endc g = col%gridcell(c) - soilstate_inst%gwc_thr_col(c) = 0.17_r8 + 0.14_r8 * clay3d(g,1) * 0.01_r8 + soilstate_inst%gwc_thr_col(c) = 0.01_r8*(0.17_r8*clay3d(g,1) + 0.0014_r8*clay3d(g,1)*clay3d(g,1)) !Fecan et al. (1999) -jfk, dmleung coded 27 Nov 2021 for CLM clay fraction + !soilstate_inst%gwc_thr_col(c) = 0.17_r8 + 0.14_r8 * clay3d(g,1) * 0.01_r8 -dmleung commented 27 Nov 2021 soilstate_inst%mss_frc_cly_vld_col(c) = min(clay3d(g,1) * 0.01_r8, 0.20_r8) end do diff --git a/src/biogeophys/SoilStateType.F90 b/src/biogeophys/SoilStateType.F90 index e301cc27b9..fa3d5a6aaf 100644 --- a/src/biogeophys/SoilStateType.F90 +++ b/src/biogeophys/SoilStateType.F90 @@ -24,12 +24,15 @@ module SoilStateType ! sand/ clay/ organic matter real(r8), pointer :: sandfrac_patch (:) ! patch sand fraction - real(r8), pointer :: clayfrac_patch (:) ! patch clay fraction + real(r8), pointer :: clayfrac_patch (:) ! patch clay fraction real(r8), pointer :: mss_frc_cly_vld_col (:) ! col mass fraction clay limited to 0.20 real(r8), pointer :: cellorg_col (:,:) ! col organic matter for gridcell containing column (1:nlevsoi) real(r8), pointer :: cellsand_col (:,:) ! sand value for gridcell containing column (1:nlevsoi) real(r8), pointer :: cellclay_col (:,:) ! clay value for gridcell containing column (1:nlevsoi) real(r8), pointer :: bd_col (:,:) ! col bulk density of dry soil material [kg/m^3] (CN) + !####################### for new dust emission scheme -dmleung ############################ + real(r8), pointer :: roughfct_patch (:) ! roughness factor, 17 dec 2021 + !########################################################################################### ! hydraulic properties real(r8), pointer :: hksat_col (:,:) ! col hydraulic conductivity at saturation (mm H2O /s) @@ -131,6 +134,9 @@ subroutine InitAllocate(this, bounds) allocate(this%cellclay_col (begc:endc,nlevsoi)) ; this%cellclay_col (:,:) = nan allocate(this%bd_col (begc:endc,nlevgrnd)) ; this%bd_col (:,:) = nan + !################ dmleung added 14 Dec 2021 ######################## + allocate(this%roughfct_patch (begp:endp)) ; this%roughfct_patch (:) = nan + !################################################################### allocate(this%hksat_col (begc:endc,nlevgrnd)) ; this%hksat_col (:,:) = spval allocate(this%hksat_min_col (begc:endc,nlevgrnd)) ; this%hksat_min_col (:,:) = spval allocate(this%hk_l_col (begc:endc,nlevgrnd)) ; this%hk_l_col (:,:) = nan diff --git a/src/main/clm_varctl.F90 b/src/main/clm_varctl.F90 index 9be9af2f73..3b7b1321ea 100644 --- a/src/main/clm_varctl.F90 +++ b/src/main/clm_varctl.F90 @@ -113,6 +113,7 @@ module clm_varctl character(len=fname_len), public :: nrevsn = ' ' ! restart data file name for branch run character(len=fname_len), public :: fsnowoptics = ' ' ! snow optical properties file name character(len=fname_len), public :: fsnowaging = ' ' ! snow aging parameters file name + character(len=fname_len), public :: rough_fct = ' ' ! roughness factor, dmleung, added 17 Dec 2021 character(len=fname_len), public :: fatmlndfrc = ' ' ! lnd frac file on atm grid ! only needed for LILAC and MCT drivers diff --git a/src/main/controlMod.F90 b/src/main/controlMod.F90 index a7bca1aa87..5645c8a0ca 100644 --- a/src/main/controlMod.F90 +++ b/src/main/controlMod.F90 @@ -282,6 +282,9 @@ subroutine control_init(dtime) use_grainproduct, use_snicar_frc, use_vancouver, use_mexicocity, use_noio, & use_nguardrail + ! dust emission, dmleung 14 Dec 2021 + namelist /clm_inparm/ & + rough_fct !-dmleung 17 Dec 2021 ! ---------------------------------------------------------------------- ! Default values @@ -653,6 +656,9 @@ subroutine control_spmd() call mpi_bcast (fsnowoptics, len(fsnowoptics), MPI_CHARACTER, 0, mpicom, ier) call mpi_bcast (fsnowaging, len(fsnowaging), MPI_CHARACTER, 0, mpicom, ier) + ! initialize input data for new dust emission module dmleung 14 Dec 2021 + call mpi_bcast (rough_fct, len(rough_fct), MPI_CHARACTER, 0, mpicom, ier)! added by dmleung, 17 Dec 2021 + ! Irrigation call mpi_bcast(irrigate, 1, MPI_LOGICAL, 0, mpicom, ier) @@ -904,6 +910,13 @@ subroutine control_print () write(iulog,*) ' Threshold above which the model keeps the lake landunit =', toosmall_lake write(iulog,*) ' Threshold above which the model keeps the wetland landunit =', toosmall_wetland write(iulog,*) ' Threshold above which the model keeps the urban landunits =', toosmall_urban + !##### for dmleung's input data for new dust emission module ##### + if (rough_fct == ' ') then ! -dmleung, 17 Dec 2021 + write(iulog,*) ' rough_fct surface dataset not set' + else + write(iulog,*) ' surface data = ',trim(rough_fct) + end if + !################################################################# if (use_cn) then if (suplnitro /= suplnNon)then write(iulog,*) ' Supplemental Nitrogen mode is set to run over Patches: ', & diff --git a/src/main/lnd2atmMod.F90 b/src/main/lnd2atmMod.F90 index ff7324e428..2638aa5f46 100644 --- a/src/main/lnd2atmMod.F90 +++ b/src/main/lnd2atmMod.F90 @@ -140,6 +140,14 @@ subroutine lnd2atm_minimal(bounds, & p2c_scale_type='unity', c2l_scale_type= 'urbanf', l2g_scale_type='unity') do g = bounds%begg,bounds%endg + !#####added by dmleung to avoid negative eflx_lwrad_out_grc(g) 11 Dec 2021 ################### + if (lnd2atm_inst%eflx_lwrad_out_grc(g) < 0) then + write(iulog,*) 'FIRE = ', lnd2atm_inst%eflx_lwrad_out_grc(g) + write(iulog,*) 'gridcell index = ', g + !write(iulog,*) 'sb constant = ', sb + lnd2atm_inst%eflx_lwrad_out_grc(g) = 100_r8 + end if + !##### should not be here but I am not sure why sometimes LW radiation is negative yet ####### lnd2atm_inst%t_rad_grc(g) = sqrt(sqrt(lnd2atm_inst%eflx_lwrad_out_grc(g)/sb)) end do From 33dcd9feed81a07177bc57b48d0ab2723614c374 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Mon, 22 Aug 2022 18:04:20 -0600 Subject: [PATCH 0003/1248] Set roughfct2d to 1.0 if rough_fct dataset is not being used --- src/biogeophys/SoilStateInitTimeConstMod.F90 | 33 ++++++++++++-------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/src/biogeophys/SoilStateInitTimeConstMod.F90 b/src/biogeophys/SoilStateInitTimeConstMod.F90 index 2c1b00a8f6..c5e2a72977 100644 --- a/src/biogeophys/SoilStateInitTimeConstMod.F90 +++ b/src/biogeophys/SoilStateInitTimeConstMod.F90 @@ -374,20 +374,27 @@ subroutine SoilStateInitTimeConst(bounds, soilstate_inst, nlfilename) !############ subsection for input data for new dust emission scheme ############## ! dmleung added to CESM2/CLM5 17 Dec 2021 - allocate(roughfct2d(begg:endg)) ! dmleung, 16 Jul 2020 - ! here to read roughness factor file, 16 Jul 2020 - !write(iulog,*) 'Attempting to read roughness factor data, by dmleung .....' - call getfil (rough_fct, locfn, 0) - call ncd_pio_openfile (ncid, locfn, 0) - call ncd_io(ncid=ncid, varname='F_eff', flag='read', data=roughfct2d, dim1name=grlnd, readvar=readvar) - !write(iulog,*) 'initialize pft level roughness factor from roughfct2d(g) to roughfct(p)' + if (rough_fct /= ' ') then + allocate(roughfct2d(begg:endg)) ! dmleung, 16 Jul 2020 + ! here to read roughness factor file, 16 Jul 2020 + !write(iulog,*) 'Attempting to read roughness factor data, by dmleung .....' + call getfil (rough_fct, locfn, 0) + call ncd_pio_openfile (ncid, locfn, 0) + call ncd_io(ncid=ncid, varname='F_eff', flag='read', data=roughfct2d, dim1name=grlnd, readvar=readvar) + !write(iulog,*) 'initialize pft level roughness factor from roughfct2d(g) to roughfct(p)' + + do p = begp,endp + g = patch%gridcell(p) + soilstate_inst%roughfct_patch(p) = roughfct2d(g) + end do + + call ncd_pio_closefile(ncid) + else + do p = begp,endp + soilstate_inst%roughfct_patch(p) = 1.0_r8 + end do - do p = begp,endp - g = patch%gridcell(p) - soilstate_inst%roughfct_patch(p) = roughfct2d(g) - end do - - call ncd_pio_closefile(ncid) + end if !################################################################################## ! -------------------------------------------------------------------- From c8c885ae4e6a1f06296ac9803b183f08234174c4 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Mon, 22 Aug 2022 18:05:01 -0600 Subject: [PATCH 0004/1248] Distinguish between normal fsurdat surface dataset and the rough_fct dataset --- src/main/controlMod.F90 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/controlMod.F90 b/src/main/controlMod.F90 index 5645c8a0ca..49788b351c 100644 --- a/src/main/controlMod.F90 +++ b/src/main/controlMod.F90 @@ -912,9 +912,9 @@ subroutine control_print () write(iulog,*) ' Threshold above which the model keeps the urban landunits =', toosmall_urban !##### for dmleung's input data for new dust emission module ##### if (rough_fct == ' ') then ! -dmleung, 17 Dec 2021 - write(iulog,*) ' rough_fct surface dataset not set' + write(iulog,*) ' rough_fct surface roughness dataset not set' else - write(iulog,*) ' surface data = ',trim(rough_fct) + write(iulog,*) ' surface roughness data = ',trim(rough_fct) end if !################################################################# if (use_cn) then From 564875ed626419bd3867669786eb9083c212a473 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Mon, 22 Aug 2022 18:05:23 -0600 Subject: [PATCH 0005/1248] Always output FV --- src/biogeophys/FrictionVelocityMod.F90 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/biogeophys/FrictionVelocityMod.F90 b/src/biogeophys/FrictionVelocityMod.F90 index 21a09fbc13..43f82495b7 100644 --- a/src/biogeophys/FrictionVelocityMod.F90 +++ b/src/biogeophys/FrictionVelocityMod.F90 @@ -231,12 +231,12 @@ subroutine InitHistory(this, bounds) ptr_patch=this%ram1_patch, default='inactive') end if - if (use_cn) then + !if (use_cn) then this%fv_patch(begp:endp) = spval call hist_addfld1d (fname='FV', units='m/s', & avgflag='A', long_name='friction velocity', & ptr_patch=this%fv_patch) - end if + !end if call hist_addfld1d (fname='RAH1', units='s/m', & avgflag='A', long_name='aerodynamical resistance ', & From f71bb054eaaaa0fbdb7bb760604edb55583cee3b Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Mon, 22 Aug 2022 18:06:27 -0600 Subject: [PATCH 0006/1248] Make sure to distinquish history variable names as it will otherwise abort, don't output USTAR as FV is already output in FrictionVelocity --- src/biogeochem/DUSTMod.F90 | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/biogeochem/DUSTMod.F90 b/src/biogeochem/DUSTMod.F90 index 7f7c92722c..b51468a62f 100644 --- a/src/biogeochem/DUSTMod.F90 +++ b/src/biogeochem/DUSTMod.F90 @@ -251,7 +251,7 @@ subroutine InitHistory(this, bounds) avgflag='A', long_name='sd of wind velocity at saltation level', & ptr_patch=this%u_sd_slt_patch, set_lake=0._r8, set_urb=0._r8) this%stblty_patch(begp:endp) = spval - call hist_addfld1d (fname='ZETA', units='', & + call hist_addfld1d (fname='ZETAOBU', units='', & avgflag='A', long_name='stability parameter', & ptr_patch=this%stblty_patch, set_lake=0._r8, set_urb=0._r8) this%u_fld_thr_patch(begp:endp) = spval @@ -263,7 +263,7 @@ subroutine InitHistory(this, bounds) avgflag='A', long_name='impact threshold velocity at saltation level', & ptr_patch=this%u_impct_thr_patch, set_lake=0._r8, set_urb=0._r8) this%thr_crs_rate_patch(begp:endp) = spval - call hist_addfld1d (fname='ALPHA', units='', & + call hist_addfld1d (fname='ALPHA_TC_RATE', units='', & avgflag='A', long_name='threshold crossing rate', & ptr_patch=this%thr_crs_rate_patch, set_lake=0._r8, set_urb=0._r8) this%prb_crs_fld_thr_patch(begp:endp) = spval @@ -279,10 +279,11 @@ subroutine InitHistory(this, bounds) avgflag='A', long_name='intermittency factor', & ptr_patch=this%intrmtncy_fct_patch, set_lake=0._r8, set_urb=0._r8) !#####added by dmleung 2 Dec 2021 ######################################### - this%ustar_patch(begp:endp) = spval - call hist_addfld1d (fname='USTAR', units='m/s', & - avgflag='A', long_name='friction velocity', & - ptr_patch=this%ustar_patch, set_lake=0._r8, set_urb=0._r8) + ! This is already output as FV in FrictionVelocityMod + !this%ustar_patch(begp:endp) = spval + !call hist_addfld1d (fname='USTAR', units='m/s', & + !avgflag='A', long_name='friction velocity', & + !ptr_patch=this%ustar_patch, set_lake=0._r8, set_urb=0._r8) !#####added by dmleung 20 Dec 2021 ######################################## this%ssr_patch(begp:endp) = spval call hist_addfld1d (fname='SSR', units='m/s', & From 9a4ec5702f84db07d18b9dbbba7366ca684fa95c Mon Sep 17 00:00:00 2001 From: cathyxinchangli <55264121+cathyxinchangli@users.noreply.github.com> Date: Mon, 3 Oct 2022 17:51:53 -0500 Subject: [PATCH 0007/1248] Modify Urban Time Varying data 1. `src\cpl\share_esmf\UrbanTimeVarType.F90`: Modify `stream_varnames` dimensions so that it becomes independent of urban density type indices (7-9), to prepare for future time varying data input for `p_ac` (and `p_h`, possibly); 2. `src\biogeophys\UrbBuildTempOleson2015Mod.F90`: Add `p_ac` to the equation of `eflx_urban_ac`; not being implemented yet. --- src/biogeophys/UrbBuildTempOleson2015Mod.F90 | 4 + src/cpl/share_esmf/UrbanTimeVarType.F90 | 82 +++++++++++++++----- 2 files changed, 66 insertions(+), 20 deletions(-) diff --git a/src/biogeophys/UrbBuildTempOleson2015Mod.F90 b/src/biogeophys/UrbBuildTempOleson2015Mod.F90 index bf8b68c7eb..e13f7e1b47 100644 --- a/src/biogeophys/UrbBuildTempOleson2015Mod.F90 +++ b/src/biogeophys/UrbBuildTempOleson2015Mod.F90 @@ -924,8 +924,12 @@ subroutine BuildingTemperature (bounds, num_urbanl, filter_urbanl, num_nolakec, if (t_building_bef_hac(l) > t_building_max(l)) then t_building(l) = t_building_max(l) + ! [Cathy] orig: eflx_urban_ac(l) = wtlunit_roof(l) * abs( (ht_roof(l) * rho_dair(l) * cpair / dtime) * t_building(l) & - (ht_roof(l) * rho_dair(l) * cpair / dtime) * t_building_bef_hac(l) ) + ! [Cathy] dev: + ! eflx_urban_ac(l) = wtlunit_roof(l) * p_ac(l) * abs( (ht_roof(l) * rho_dair(l) * cpair / dtime) * t_building(l) & + ! - (ht_roof(l) * rho_dair(l) * cpair / dtime) * t_building_bef_hac(l) ) else if (t_building_bef_hac(l) < t_building_min(l)) then t_building(l) = t_building_min(l) eflx_urban_heat(l) = wtlunit_roof(l) * abs( (ht_roof(l) * rho_dair(l) * cpair / dtime) * t_building(l) & diff --git a/src/cpl/share_esmf/UrbanTimeVarType.F90 b/src/cpl/share_esmf/UrbanTimeVarType.F90 index cc48bf4833..a76c176f1c 100644 --- a/src/cpl/share_esmf/UrbanTimeVarType.F90 +++ b/src/cpl/share_esmf/UrbanTimeVarType.F90 @@ -12,7 +12,7 @@ module UrbanTimeVarType use abortutils , only : endrun use decompMod , only : bounds_type, subgrid_level_landunit use clm_varctl , only : iulog - use landunit_varcon , only : isturb_MIN, isturb_MAX + use landunit_varcon , only : isturb_MIN, isturb_MAX ! Cathy: min and max types urban; equals 7 and 9, resp. use clm_varcon , only : spval use LandunitType , only : lun use GridcellType , only : grc @@ -24,6 +24,8 @@ module UrbanTimeVarType type, public :: urbantv_type ! real(r8), public, pointer :: t_building_max(:) ! lun maximum internal building air temperature (K) + ! ! Cathy [dev] + ! real(r8), public, pointer :: p_ac(:) ! lun air-conditioning ownership rate (unitless, between 0 and 1) type(shr_strdata_type) :: sdat_urbantv ! urban time varying input data stream contains ! !PUBLIC MEMBER FUNCTIONS: @@ -31,8 +33,11 @@ module UrbanTimeVarType procedure, public :: urbantv_init ! Initialize urban time varying stream procedure, public :: urbantv_interp ! Interpolate urban time varying stream end type urbantv_type - - character(15), private :: stream_varnames(isturb_MIN:isturb_MAX) + + ! Cathy [orig] + ! character(15), private :: stream_varnames(isturb_MIN:isturb_MAX) + ! Cathy [dev] + character(15), private :: stream_varnames(1:3) character(len=*), parameter, private :: sourcefile = & __FILE__ @@ -63,6 +68,8 @@ subroutine Init(this, bounds, NLFilename) ! Allocate urbantv data structure allocate(this%t_building_max(begl:endl)); this%t_building_max(:) = nan + ! ! Cathy [dev] + ! allocate(this%p_ac(begl:endl)); this%p_ac(:) = nan call this%urbantv_init(bounds, NLFilename) call this%urbantv_interp(bounds) @@ -72,6 +79,11 @@ subroutine Init(this, bounds, NLFilename) avgflag='A', long_name='prescribed maximum interior building temperature', & ptr_lunit=this%t_building_max, default='inactive', set_nourb=spval, & l2g_scale_type='unity') + ! ! Cathy [dev] + ! call hist_addfld1d (fname='P_AC', units='unitless', & + avgflag='A', long_name='prescribed air-conditioning ownership rate (decimal)', & + ptr_lunit=this%p_ac, default='inactive', set_nourb=spval, & + l2g_scale_type='unity') end subroutine Init @@ -85,7 +97,7 @@ subroutine urbantv_init(this, bounds, NLFilename) use clm_nlUtilsMod , only : find_nlgroup_name use spmdMod , only : masterproc, mpicom, iam use shr_mpi_mod , only : shr_mpi_bcast - use landunit_varcon , only : isturb_tbd, isturb_hd, isturb_md + use landunit_varcon , only : isturb_tbd, isturb_hd, isturb_md ! Cathy: equals 7, 8 and 9 use dshr_strdata_mod , only : shr_strdata_init_from_inline use lnd_comp_shr , only : mesh, model_clock ! @@ -93,22 +105,23 @@ subroutine urbantv_init(this, bounds, NLFilename) implicit none class(urbantv_type) :: this type(bounds_type), intent(in) :: bounds - character(len=*), intent(in) :: NLFilename ! Namelist filename + character(len=*), intent(in) :: NLFilename ! Namelist filename ???is this the netCDF file name? ! ! !LOCAL VARIABLES: integer :: n integer :: stream_year_first_urbantv ! first year in urban tv stream to use integer :: stream_year_last_urbantv ! last year in urban tv stream to use integer :: model_year_align_urbantv ! align stream_year_first_urbantv with this model year - integer :: nu_nml ! unit for namelist file + integer :: nu_nml ! unit for namelist file ??? integer :: nml_error ! namelist i/o error flag - character(len=CL) :: stream_fldFileName_urbantv ! urban tv streams filename - character(len=CL) :: stream_meshfile_urbantv ! urban tv streams filename - character(len=CL) :: urbantvmapalgo = 'nn' ! mapping alogrithm for urban ac + character(len=CL) :: stream_fldFileName_urbantv ! urban tv streams filename ??? + character(len=CL) :: stream_meshfile_urbantv ! urban tv streams filename ??? + character(len=CL) :: urbantvmapalgo = 'nn' ! mapping alogrithm for urban ac ??? character(len=CL) :: urbantv_tintalgo = 'linear' ! time interpolation alogrithm integer :: rc ! error code - character(*), parameter :: urbantvString = "tbuildmax_" ! base string for field string - character(*), parameter :: subName = "('urbantv_init')" + ! Cathy [orig] + ! character(*), parameter :: urbantvString = "tbuildmax_" ! base string for field string ??? + character(*), parameter :: subName = "('urbantv_init')" ! ??? !----------------------------------------------------------------------- namelist /urbantv_streams/ & @@ -126,9 +139,14 @@ subroutine urbantv_init(this, bounds, NLFilename) model_year_align_urbantv = 1 ! align stream_year_first_urbantv with this model year stream_fldFileName_urbantv = ' ' stream_meshfile_urbantv = ' ' - stream_varnames(isturb_tbd) = urbantvString//"TBD" - stream_varnames(isturb_hd) = urbantvString//"HD" - stream_varnames(isturb_md) = urbantvString//"MD" + ! Cathy [orig] + ! stream_varnames(isturb_tbd) = urbantvString//"TBD" + ! stream_varnames(isturb_hd) = urbantvString//"HD" + ! stream_varnames(isturb_md) = urbantvString//"MD" + ! Cathy [dev] + stream_varnames(1) = "tbuildmax_TBD" + stream_varnames(2) = "tbuildmax_HD" + stream_varnames(3) = "tbuildmax_MD" ! Read urbantv_streams namelist if (masterproc) then @@ -159,7 +177,10 @@ subroutine urbantv_init(this, bounds, NLFilename) write(iulog,'(a,a)' ) ' stream_fldFileName_urbantv = ',stream_fldFileName_urbantv write(iulog,'(a,a)' ) ' stream_meshfile_urbantv = ',stream_meshfile_urbantv write(iulog,'(a,a)' ) ' urbantv_tintalgo = ',urbantv_tintalgo - do n = isturb_tbd,isturb_md + ! Cathy [orig] + ! do n = isturb_tbd,isturb_md + ! Cathy [dev] + do n = 1,3 write(iulog,'(a,a)' ) ' stream_varname = ',trim(stream_varnames(n)) end do write(iulog,*) ' ' @@ -176,8 +197,12 @@ subroutine urbantv_init(this, bounds, NLFilename) stream_lev_dimname = 'null', & stream_mapalgo = trim(urbantvmapalgo), & stream_filenames = (/trim(stream_fldfilename_urbantv)/), & - stream_fldlistFile = stream_varnames(isturb_tbd:isturb_md),& - stream_fldListModel = stream_varnames(isturb_tbd:isturb_md),& + ! Cathy [orig] + ! stream_fldlistFile = stream_varnames(isturb_tbd:isturb_md),& + ! stream_fldListModel = stream_varnames(isturb_tbd:isturb_md),& + ! Cathy [dev] + stream_fldlistFile = stream_varnames(1:3), & + stream_fldListModel = stream_varnames(1:3), & stream_yearFirst = stream_year_first_urbantv, & stream_yearLast = stream_year_last_urbantv, & stream_yearAlign = model_year_align_urbantv, & @@ -235,8 +260,12 @@ subroutine urbantv_interp(this, bounds) ! Create 2d array for all stream variable data lsize = bounds%endg - bounds%begg + 1 - allocate(dataptr2d(lsize, isturb_MIN:isturb_MAX)) - do n = isturb_MIN,isturb_MAX + ! Cathy [orig] + ! allocate(dataptr2d(lsize, isturb_MIN:isturb_MAX)) + ! do n = isturb_MIN,isturb_MAX + ! Cathy [dev] + allocate(dataptr2d(lsize, 1:3)) + do n = 1,3 call dshr_fldbun_getFldPtr(this%sdat_urbantv%pstrm(1)%fldbun_model, trim(stream_varnames(n)), & fldptr1=dataptr1d, rc=rc) if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) then @@ -257,13 +286,20 @@ subroutine urbantv_interp(this, bounds) ig = ig+1 if (g == lun%gridcell(l)) exit end do - do n = isturb_MIN,isturb_MAX + ! Cathy [orig] + ! do n = isturb_MIN,isturb_MAX + ! Cathy [dev] + do n = 1,3 if (stream_varnames(lun%itype(l)) == stream_varnames(n)) then this%t_building_max(l) = dataptr2d(ig,n) + ! ! Cathy [dev] + ! this%p_ac(l) = dataptr2d(ig,n) ! ??? end if end do else this%t_building_max(l) = spval + ! ! Cathy [dev] + ! this%p_ac(l) = spval end if end do deallocate(dataptr2d) @@ -277,7 +313,11 @@ subroutine urbantv_interp(this, bounds) ig = ig+1 if (g == lun%gridcell(l)) exit end do + ! Cathy [orig] if ( .not. urban_valid(g) .or. (this%t_building_max(l) <= 0._r8)) then + ! Cathy [dev] + ! if ( .not. urban_valid(g) .or. (this%t_building_max(l) <= 0._r8) + ! & .or. (this%p_ac(l) <= 0._r8) .or. (this%p_ac(l) >= 1._r8)) then found = .true. gindx = g lindx = l @@ -290,6 +330,8 @@ subroutine urbantv_interp(this, bounds) write(iulog,*)'landunit type: ',lun%itype(lindx) write(iulog,*)'urban_valid: ',urban_valid(gindx) write(iulog,*)'t_building_max: ',this%t_building_max(lindx) + ! ! Cathy [dev] + ! write(iulog,*)'p_ac: ',this%p_ac(lindx) call endrun(subgrid_index=lindx, subgrid_level=subgrid_level_landunit, & msg=errmsg(sourcefile, __LINE__)) end if From eb160f2827f14666e06e38ac390802138620cb04 Mon Sep 17 00:00:00 2001 From: cathyxinchangli <55264121+cathyxinchangli@users.noreply.github.com> Date: Wed, 5 Oct 2022 17:07:24 -0500 Subject: [PATCH 0008/1248] Update UrbanTimeVarType.F90 Add missing comment signs --- src/cpl/share_esmf/UrbanTimeVarType.F90 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/cpl/share_esmf/UrbanTimeVarType.F90 b/src/cpl/share_esmf/UrbanTimeVarType.F90 index a76c176f1c..cf379801ce 100644 --- a/src/cpl/share_esmf/UrbanTimeVarType.F90 +++ b/src/cpl/share_esmf/UrbanTimeVarType.F90 @@ -81,9 +81,9 @@ subroutine Init(this, bounds, NLFilename) l2g_scale_type='unity') ! ! Cathy [dev] ! call hist_addfld1d (fname='P_AC', units='unitless', & - avgflag='A', long_name='prescribed air-conditioning ownership rate (decimal)', & - ptr_lunit=this%p_ac, default='inactive', set_nourb=spval, & - l2g_scale_type='unity') + ! avgflag='A', long_name='prescribed air-conditioning ownership rate (decimal)', & + ! ptr_lunit=this%p_ac, default='inactive', set_nourb=spval, & + ! l2g_scale_type='unity') end subroutine Init From 8cec89cefeec0f5ac5a523ec260430be7258b489 Mon Sep 17 00:00:00 2001 From: cathyxinchangli <55264121+cathyxinchangli@users.noreply.github.com> Date: Thu, 6 Oct 2022 16:44:51 -0500 Subject: [PATCH 0009/1248] Update UrbanTimeVarType.F90 [dev.01] Debugging after first test run. Problem: First test run (job 6762983) returned all URBAN_AC results as 0. Suspect a mismatch between the indices of `stream_varnames` and `t_building_max`, which may have resulted in all `t_building_max` being set to nan/very large number. Solution: Modify subroutine `urbantv_interp` by hard-coding *land unit type - 6* to ensure the if statement criterion returns true. --- src/cpl/share_esmf/UrbanTimeVarType.F90 | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/cpl/share_esmf/UrbanTimeVarType.F90 b/src/cpl/share_esmf/UrbanTimeVarType.F90 index cf379801ce..1bed4e2967 100644 --- a/src/cpl/share_esmf/UrbanTimeVarType.F90 +++ b/src/cpl/share_esmf/UrbanTimeVarType.F90 @@ -60,7 +60,7 @@ subroutine Init(this, bounds, NLFilename) character(len=*) , intent(in) :: NLFilename ! Namelist filename ! ! !LOCAL VARIABLES: - integer :: begl, endl + integer :: begl, endl ! Cathy: beginning and ending landunit index, from src/main/decompMod !--------------------------------------------------------------------- begl = bounds%begl; endl = bounds%endl @@ -75,6 +75,7 @@ subroutine Init(this, bounds, NLFilename) call this%urbantv_interp(bounds) ! Add history fields + ! Cathy: the subroutine is in scr/main/histFileMod.F90 call hist_addfld1d (fname='TBUILD_MAX', units='K', & avgflag='A', long_name='prescribed maximum interior building temperature', & ptr_lunit=this%t_building_max, default='inactive', set_nourb=spval, & @@ -290,14 +291,17 @@ subroutine urbantv_interp(this, bounds) ! do n = isturb_MIN,isturb_MAX ! Cathy [dev] do n = 1,3 - if (stream_varnames(lun%itype(l)) == stream_varnames(n)) then + ! Cathy [orig] + ! if (stream_varnames(lun%itype(l)) == stream_varnames(n)) then + ! Cathy [dev.01] + if (stream_varnames((lun%itype(l)-6)) == stream_varnames(n)) then this%t_building_max(l) = dataptr2d(ig,n) ! ! Cathy [dev] ! this%p_ac(l) = dataptr2d(ig,n) ! ??? end if end do else - this%t_building_max(l) = spval + this%t_building_max(l) = spval ! Cathy: special value for real data, set to 1.e36 in src/main/clm_varcon ! ! Cathy [dev] ! this%p_ac(l) = spval end if From fd7e5e0e12f326de981fe75761e25d9b46aa77ce Mon Sep 17 00:00:00 2001 From: "Danny M. Leung" Date: Fri, 14 Oct 2022 12:46:03 -0600 Subject: [PATCH 0010/1248] 14 Oct 2022: dmleung edited DUSTMod to properly use LUH2 to compute hybrid drag partitioning. (previous use of wt_lunit in DUSTMod was not working because wt_lunit was deallocated after CTSM initialization.) --- src/biogeochem/DUSTMod.F90 | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/src/biogeochem/DUSTMod.F90 b/src/biogeochem/DUSTMod.F90 index b51468a62f..56721e2536 100644 --- a/src/biogeochem/DUSTMod.F90 +++ b/src/biogeochem/DUSTMod.F90 @@ -31,8 +31,8 @@ module DUSTMod use LandunitType , only : lun use ColumnType , only : col use PatchType , only : patch - use clm_instur , only : wt_lunit, wt_nat_patch ! dmleung added 24 Jul 2022 - use landunit_varcon , only : istsoil, istcrop ! dmleung added 24 Jul 2022 (refering to main/landunit_varcon.F90, for wt_lunit, istsoil=1 is nat veg, istcrop=2 is crop) + !use clm_instur , only : wt_lunit, wt_nat_patch ! dmleung added 24 Jul 2022 + !use landunit_varcon , only : istsoil, istcrop ! dmleung added 24 Jul 2022 (refering to main/landunit_varcon.F90, for wt_lunit, istsoil=1 is nat veg, istcrop=2 is crop) use pftconMod , only : noveg ! dmleung added 24 Jul 2022 ! ! !PUBLIC TYPES @@ -345,6 +345,9 @@ subroutine DustEmission (bounds, & ! !USES use shr_const_mod, only : SHR_CONST_RHOFW use subgridaveMod, only : p2g + !use clm_instur , only : wt_lunit, wt_nat_patch ! dmleung added 24 Jul 2022 + !use landunit_varcon , only : istsoil, istcrop ! dmleung added 24 Jul 2022 (refering to main/landunit_varcon.F90, for wt_lunit, istsoil=1 is nat veg, istcrop=2 is crop) + use pftconMod , only : noveg ! dmleung added 24 Jul 2022 ! ! !ARGUMENTS: type(bounds_type) , intent(in) :: bounds @@ -540,6 +543,8 @@ subroutine DustEmission (bounds, & end if end do + ! dmleung add output for bare_frc and veg_frc here if wanted !!!!!!!!!---------------------- + ! reset history output variables before next if-statement to avoid output = inf do fp = 1,num_nolakep @@ -654,11 +659,21 @@ subroutine DustEmission (bounds, & !frc_thr_rgh_fct = (rockfrc(p)*(roughfct(p))**3_r8 + (vegefrc(p)+sparfrc(p))*(ssr(p))**3_r8 )**(0.3333_r8) ! land cover weighted mean using static GLCNMo bare land fraction LC0, dmleung 20 Dec 2021i; dmleung commented 24 Jul 2022 ! dmleung added calculation of LUH2 bare vs veg fraction within a grid 24 Jul 2022 - bare_frc = wt_lunit(g,istsoil) * wt_nat_patch(g,noveg) - veg_frc = wt_lunit(g,istsoil) * sum(wt_nat_patch(g,(noveg+1):natpft_ub)) + wt_lunit(g,istcrop) + !bare_frc = wt_lunit(g,istsoil) * wt_nat_patch(g,noveg) + !veg_frc = wt_lunit(g,istsoil) * sum(wt_nat_patch(g,(noveg+1):natpft_ub)) + wt_lunit(g,istcrop) - frc_thr_rgh_fct = (bare_frc*(roughfct(p))**3_r8 + veg_frc*(ssr(p))**3_r8 )**(0.3333_r8) ! land cover weighted mean using LUH2 land cover, dmleung 24 Jul 2022 + !frc_thr_rgh_fct = (bare_frc*(roughfct(p))**3_r8 + veg_frc*(ssr(p))**3_r8 )**(0.3333_r8) ! land cover weighted mean using LUH2 land cover, dmleung 24 Jul 2022 + ! dmleung added calculation of LUH2 bare vs veg fraction within a grid 6 Oct 2022 + if (lun%itype(l) == istsoil .or. lun%itype(l) == istcrop) then + if (patch%itype(p) == noveg) then + frc_thr_rgh_fct = roughfct(p) + else + frc_thr_rgh_fct = ssr(p) + end if + else + frc_thr_rgh_fct = 1.0_r8 + end if wnd_frc_slt = fv(p) * frc_thr_rgh_fct ! wnd_frc_slt will be used in the dust emission equation -dmleung From c7e0cf8d001fee1772cadad518c2b7e4929e0f2c Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Fri, 21 Oct 2022 14:54:10 -0600 Subject: [PATCH 0011/1248] Add in externals to run a FHIST compset with CAM, CICE, and CICE5 from the cesm2_3_beta09 tag --- Externals.cfg | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/Externals.cfg b/Externals.cfg index ff9882d574..a020acc12d 100644 --- a/Externals.cfg +++ b/Externals.cfg @@ -33,6 +33,29 @@ repo_url = https://github.com/nmizukami/mizuRoute hash = 34723c2 required = True +[cice5] +tag = cice5_20220204 +protocol = git +repo_url = https://github.com/ESCOMP/CESM_CICE5 +local_path = components/cice5 +required = True + +[cice6] +tag = cesm_cice6_2_0_22 +protocol = git +repo_url = https://github.com/ESCOMP/CESM_CICE +local_path = components/cice +externals = Externals.cfg +required = True + +[cam6] +tag = cam6_3_058 +protocol = git +repo_url = https://github.com/ESCOMP/CAM +local_path = components/cam +externals = Externals_CAM.cfg +required = True + [ccs_config] tag = ccs_config_cesm0.0.38 protocol = git From 5b6d00e9c8a6397ffbba7e51f80ef1b6bff24abf Mon Sep 17 00:00:00 2001 From: "Danny M. Leung" Date: Fri, 11 Nov 2022 12:53:49 -0700 Subject: [PATCH 0012/1248] dmleung 11 Nov 2022: removed the added lines in lnd2atmMod.F90 that force the outgoing longwave radiation to be non-negative. --- src/main/lnd2atmMod.F90 | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/main/lnd2atmMod.F90 b/src/main/lnd2atmMod.F90 index 2638aa5f46..ff7324e428 100644 --- a/src/main/lnd2atmMod.F90 +++ b/src/main/lnd2atmMod.F90 @@ -140,14 +140,6 @@ subroutine lnd2atm_minimal(bounds, & p2c_scale_type='unity', c2l_scale_type= 'urbanf', l2g_scale_type='unity') do g = bounds%begg,bounds%endg - !#####added by dmleung to avoid negative eflx_lwrad_out_grc(g) 11 Dec 2021 ################### - if (lnd2atm_inst%eflx_lwrad_out_grc(g) < 0) then - write(iulog,*) 'FIRE = ', lnd2atm_inst%eflx_lwrad_out_grc(g) - write(iulog,*) 'gridcell index = ', g - !write(iulog,*) 'sb constant = ', sb - lnd2atm_inst%eflx_lwrad_out_grc(g) = 100_r8 - end if - !##### should not be here but I am not sure why sometimes LW radiation is negative yet ####### lnd2atm_inst%t_rad_grc(g) = sqrt(sqrt(lnd2atm_inst%eflx_lwrad_out_grc(g)/sb)) end do From 1592ebbf154782c3eac16f6ca2fa3843b2c57f6b Mon Sep 17 00:00:00 2001 From: "Danny M. Leung" Date: Mon, 14 Nov 2022 16:37:39 -0700 Subject: [PATCH 0013/1248] dmleung changed the upper limit of the gragmentation exponent from 3 to 5. (14 Nov 2022) --- src/biogeochem/DUSTMod.F90 | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/biogeochem/DUSTMod.F90 b/src/biogeochem/DUSTMod.F90 index 56721e2536..421b046030 100644 --- a/src/biogeochem/DUSTMod.F90 +++ b/src/biogeochem/DUSTMod.F90 @@ -268,11 +268,11 @@ subroutine InitHistory(this, bounds) ptr_patch=this%thr_crs_rate_patch, set_lake=0._r8, set_urb=0._r8) this%prb_crs_fld_thr_patch(begp:endp) = spval call hist_addfld1d (fname='P_FT', units='', & - avgflag='A', long_name='probability of crossing fluid threshold', & + avgflag='A', long_name='probability of winds crossing fluid threshold', & ptr_patch=this%prb_crs_fld_thr_patch, set_lake=0._r8, set_urb=0._r8) this%prb_crs_impct_thr_patch(begp:endp) = spval call hist_addfld1d (fname='P_IT', units='', & - avgflag='A', long_name='probability of crossing impact threshold', & + avgflag='A', long_name='probability of winds crossing impact threshold', & ptr_patch=this%prb_crs_impct_thr_patch, set_lake=0._r8, set_urb=0._r8) this%intrmtncy_fct_patch(begp:endp) = spval call hist_addfld1d (fname='ETA', units='', & @@ -287,7 +287,7 @@ subroutine InitHistory(this, bounds) !#####added by dmleung 20 Dec 2021 ######################################## this%ssr_patch(begp:endp) = spval call hist_addfld1d (fname='SSR', units='m/s', & - avgflag='A', long_name='Okin-Pierre shear stress ratio', & + avgflag='A', long_name='Okin-Pierre vegetation shear stress ratio (drag partition factor)', & ptr_patch=this%ssr_patch, set_lake=0._r8, set_urb=0._r8) this%lai_patch(begp:endp) = spval call hist_addfld1d (fname='LAI', units='m/s', & @@ -611,7 +611,7 @@ subroutine DustEmission (bounds, & !####################################################################################################### ! calculate Shao & Lu (2000) dust emission threshold scheme here - ! use tmp1 from DUSTini for Iversen and White I&W (1982) (75 um is optimal); use tmp2 for S&L (2000) (107 um is optimal) + ! use tmp1 from DUSTini for Iversen and White I&W (1982) (75 um is optimal); use tmp2 for S&L (2000) (80 um is optimal) ! recoded to CLM5 27 Nov 2021 !####################################################################################################### @@ -633,8 +633,8 @@ subroutine DustEmission (bounds, & ! framentation exponent dmleung 27 Nov 2021; moved to this block 23 Dec 2021 frag_expt = (Ca * (wnd_frc_thr_slt_std - wnd_frc_thr_slt_std_min) / wnd_frc_thr_slt_std_min) ! fragmentation exponent, defined in Kok et al. (2014a) -dmleung 27 Nov 2021 - if (frag_expt > 3_r8) then ! set fragmentation exponent to be 3 or 5 at maximum, to avoid local AOD blowup - frag_expt = 3_r8 + if (frag_expt > 5_r8) then ! set fragmentation exponent to be 3 or 5 at maximum, to avoid local AOD blowup + frag_expt = 5_r8 end if !################ drag partition effect, and soil friction velocity############################ From 571dc5edb82fc3b12ed0cdb6f3543ca2f863c92c Mon Sep 17 00:00:00 2001 From: "Danny M. Leung" Date: Mon, 14 Nov 2022 16:44:42 -0700 Subject: [PATCH 0014/1248] dmleung changed the upper limit of the fragmentation exponent from 3 to 5. (14 Nov 2022) --- src/biogeochem/DUSTMod.F90 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/biogeochem/DUSTMod.F90 b/src/biogeochem/DUSTMod.F90 index 421b046030..0374d9e645 100644 --- a/src/biogeochem/DUSTMod.F90 +++ b/src/biogeochem/DUSTMod.F90 @@ -633,8 +633,8 @@ subroutine DustEmission (bounds, & ! framentation exponent dmleung 27 Nov 2021; moved to this block 23 Dec 2021 frag_expt = (Ca * (wnd_frc_thr_slt_std - wnd_frc_thr_slt_std_min) / wnd_frc_thr_slt_std_min) ! fragmentation exponent, defined in Kok et al. (2014a) -dmleung 27 Nov 2021 - if (frag_expt > 5_r8) then ! set fragmentation exponent to be 3 or 5 at maximum, to avoid local AOD blowup - frag_expt = 5_r8 + if (frag_expt > 5.0_r8) then ! set fragmentation exponent to be 3 or 5 at maximum, to avoid local AOD blowup + frag_expt = 5.0_r8 end if !################ drag partition effect, and soil friction velocity############################ From db585020d6c3742ba11115be4f367012030f0864 Mon Sep 17 00:00:00 2001 From: "Danny M. Leung" Date: Mon, 14 Nov 2022 16:56:34 -0700 Subject: [PATCH 0015/1248] set 0.1 as the minimum LAI for the Okin-Pierre drag partioning equation; code cleanup dmleung 14 Nov 2022 --- src/biogeochem/DUSTMod.F90 | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/biogeochem/DUSTMod.F90 b/src/biogeochem/DUSTMod.F90 index 0374d9e645..8935c50585 100644 --- a/src/biogeochem/DUSTMod.F90 +++ b/src/biogeochem/DUSTMod.F90 @@ -648,10 +648,11 @@ subroutine DustEmission (bounds, & if (lnd_frc_mbl(p) > 0.0_r8 .AND. tlai_lu(l)<=1_r8) then ! vegetation drag partition equation following Gregory Okin (2008) + Caroline Pierre et al. (2014), dmleung 20 Dec 2021 - lai(p) = tlai_lu(l) ! LAI+SAI averaged to landunit level; saved for output - if (lai(p) < 0.1_r8) then - lai(p) = 0.1_r8 ! setting LAI ~ 0.1 to be a threshold value as computing K involves 1 / LAI - end if + lai(p) = tlai_lu(l)+0.1_r8 ! LAI+SAI averaged to landunit level; saved for output + if (lai(p) > 1_r8) then + lai(p) = 1_r8 ! setting LAI ~ 0.1 to be a min value (since the value goes to infinity when LAI=0) + end if ! and 1 to be a max value as computing K involves 1 / LAI + ! calculate Okin's shear stress ratio (which is drag partition factor) using Pierre's equation K_length = 2_r8 * (1_r8/lai(p) - 1_r8) ! Here LAI has to be non-zero to avoid blowup ssr(p) = (K_length+f_0*c_e)/(K_length+c_e) @@ -677,13 +678,13 @@ subroutine DustEmission (bounds, & wnd_frc_slt = fv(p) * frc_thr_rgh_fct ! wnd_frc_slt will be used in the dust emission equation -dmleung - frc_thr_rghn_fct(p) = frc_thr_rgh_fct ! save hybrid drag partition factor, dmleung 20 Dec 2021 + frc_thr_rghn_fct(p) = frc_thr_rgh_fct ! save and output hybrid drag partition factor, dmleung 20 Dec 2021 else wnd_frc_slt = fv(p) ! The value here is not important since once lnd_frc_mbl(p) <= 0.0_r8 there will be no emission. - frc_thr_rghn_fct(p) = 0.0_r8 ! save hybrid drag partition factor, dmleung 20 Dec 2021 + frc_thr_rghn_fct(p) = 0.0_r8 ! save and output hybrid drag partition factor, dmleung 20 Dec 2021 end if - !##########end of drag partition effect ####################################################### + !########## end of drag partition effect ####################################################### !############ Add Owen effect; if not, comment out this block !-dmleung, 27 Nov 2021 ########### ! the following if-block comes from subr. wnd_frc_slt_get @@ -855,7 +856,7 @@ subroutine DustEmission (bounds, & flx_mss_vrt_dst_ttl(p) = flx_mss_vrt_dst_ttl(p) * intrmtncy_fct(p) ! multiply dust flux by intermittency -dmleung end if - !############### end my subsection here -dmleung ######################################## + !############### end my intermittency subsection here -dmleung ######################################## end if ! lnd_frc_mbl > 0.0 From 5830686b1dbf5541a96648b6bc834b3c52ef29ec Mon Sep 17 00:00:00 2001 From: "Danny M. Leung" Date: Mon, 14 Nov 2022 18:53:27 -0700 Subject: [PATCH 0016/1248] dmleung removed outputting ustar (USTAR) in the DustMod.F90 since Erik enabled outputting fv (FV) in FrictionVelocityMod.F90 14 Nov 2022 --- src/biogeochem/DUSTMod.F90 | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/src/biogeochem/DUSTMod.F90 b/src/biogeochem/DUSTMod.F90 index 8935c50585..5ec021a01d 100644 --- a/src/biogeochem/DUSTMod.F90 +++ b/src/biogeochem/DUSTMod.F90 @@ -82,8 +82,6 @@ module DUSTMod real(r8), pointer, private :: thr_crs_rate_patch (:) ! threshold crossing rate (unitless) real(r8), pointer, private :: prb_crs_fld_thr_patch (:) ! probability of wind speed crossing fluid threshold real(r8), pointer, private :: prb_crs_impct_thr_patch (:) ! probability of wind speed crossing impact threshold - !########### added by dmleung 17 Dec 2021 ######################################################################## - real(r8), pointer, private :: ustar_patch (:) ! output friction velocity for SP mode (m/s) !########### added by dmleung 20 Dec 2021 ######################################################################## real(r8), pointer, private :: ssr_patch (:) ! [dimless] integrated shear stress ratiio, defined by Okin (2008) and then integrated by Caroline Pierre et al. (2014) real(r8), pointer, private :: lai_patch (:) ! [m2 leaf /m2 land] LAI+SAI for calculating Okin's drag partition, averaged to landunit level @@ -161,8 +159,6 @@ subroutine InitAllocate(this, bounds) allocate(this%prb_crs_fld_thr_patch (begp:endp)) ; this%prb_crs_fld_thr_patch (:) = nan allocate(this%prb_crs_impct_thr_patch (begp:endp)) ; this%prb_crs_impct_thr_patch (:) = nan !#### added by dmleung 17 Dec 2021 ###################################### - allocate(this%ustar_patch (begp:endp)) ; this%ustar_patch (:) = nan - !#### added by dmleung 17 Dec 2021 ###################################### allocate(this%ssr_patch (begp:endp)) ; this%ssr_patch (:) = nan allocate(this%lai_patch (begp:endp)) ; this%lai_patch (:) = nan allocate(this%frc_thr_rghn_fct_patch (begp:endp)) ; this%frc_thr_rghn_fct_patch (:) = nan @@ -278,12 +274,6 @@ subroutine InitHistory(this, bounds) call hist_addfld1d (fname='ETA', units='', & avgflag='A', long_name='intermittency factor', & ptr_patch=this%intrmtncy_fct_patch, set_lake=0._r8, set_urb=0._r8) - !#####added by dmleung 2 Dec 2021 ######################################### - ! This is already output as FV in FrictionVelocityMod - !this%ustar_patch(begp:endp) = spval - !call hist_addfld1d (fname='USTAR', units='m/s', & - !avgflag='A', long_name='friction velocity', & - !ptr_patch=this%ustar_patch, set_lake=0._r8, set_urb=0._r8) !#####added by dmleung 20 Dec 2021 ######################################## this%ssr_patch(begp:endp) = spval call hist_addfld1d (fname='SSR', units='m/s', & @@ -402,7 +392,6 @@ subroutine DustEmission (bounds, & real(r8), parameter :: cst_slt = 2.61_r8 ! [frc] Saltation constant real(r8), parameter :: flx_mss_fdg_fct = 5.0e-4_r8 ! [frc] Empir. mass flx tuning eflx_lh_vegt !real(r8), parameter :: vai_mbl_thr = 0.3_r8 ! [m2 m-2] VAI threshold quenching dust mobilization - !real(r8), parameter :: vai_mbl_thr = 0.3_r8 ! [m2 m-2] VAI threshold quenching dust mobilization !####### added by dmleung 27 Nov 2021 ########################################################################### character(len=*),parameter :: subname = 'DUSTEmission' real(r8), parameter :: vai_mbl_thr = 1.0_r8 ! [m2 m-2] new VAI threshold; dmleung suggests 1 or 0.5, and the default 0.3 seems a bit too small -dmleung 27 Nov 2021 @@ -464,7 +453,6 @@ subroutine DustEmission (bounds, & prb_crs_impct_thr => dust_inst%prb_crs_impct_thr_patch , & ! added by dmleung 17 Dec 2021 roughfct => soilstate_inst%roughfct_patch , & - ustar => dust_inst%ustar_patch , & ! Output friction velocity for SP mode ! added by dmleung 20 Dec 2021 ssr => dust_inst%ssr_patch , & lai => dust_inst%lai_patch , & @@ -568,8 +556,6 @@ subroutine DustEmission (bounds, & prb_crs_fld_thr(p) = 0.0_r8 prb_crs_impct_thr(p) = 0.0_r8 intrmtncy_fct(p) = 0.0_r8 - ! dmleung's edit for including friction velcoity for SP mode output, 17 Dec 2021 - ustar(p) = 0.0_r8 ! dmleung's edit, 20 Dec 2021 ssr(p) = 0.0_r8 lai(p) = 0.0_r8 @@ -701,7 +687,6 @@ subroutine DustEmission (bounds, & ! save soil friction velocity and roughness effect before the if-statement, -dml, 1 Mar 2021, coded to CLM5 27 Nov 2021 wnd_frc_soil(p) = wnd_frc_slt ! save soil friction velocity for CLM output, which has drag partition and Owen effect -dml - ustar(p) = fv(p) ! save friction velocity for SP mode (use_cn=0) since only CN/BGC mode (use_cn=1) has FV output -dmleung 17 Dec 2021 ! save land mobile fraction lnd_frc_mble(p) = lnd_frc_mbl(p) ! save land mobile fraction first, before the if-statement, -dml, 1 Mar 2021 ! only perform the following calculations if lnd_frc_mbl is non-zero From 07b787382cf4fcce7a445a1c196373aa816eb081 Mon Sep 17 00:00:00 2001 From: cathyxinchangli <55264121+cathyxinchangli@users.noreply.github.com> Date: Tue, 24 Jan 2023 18:22:03 -0600 Subject: [PATCH 0017/1248] Add p_ac to urban time varying data 1. `src\cpl\share_esmf\UrbanTimeVarType.F90`: Add 3 more dimensions to `stream_varnames` (4,5,6) for `p_ac`; 2. `src\biogeophys\UrbBuildTempOleson2015Mod.F90`: Use `p_ac` in the equation of `eflx_urban_ac`. --- src/biogeophys/UrbBuildTempOleson2015Mod.F90 | 6 +- src/cpl/share_esmf/UrbanTimeVarType.F90 | 64 ++++++++++---------- 2 files changed, 36 insertions(+), 34 deletions(-) diff --git a/src/biogeophys/UrbBuildTempOleson2015Mod.F90 b/src/biogeophys/UrbBuildTempOleson2015Mod.F90 index e13f7e1b47..260c6658af 100644 --- a/src/biogeophys/UrbBuildTempOleson2015Mod.F90 +++ b/src/biogeophys/UrbBuildTempOleson2015Mod.F90 @@ -925,11 +925,11 @@ subroutine BuildingTemperature (bounds, num_urbanl, filter_urbanl, num_nolakec, if (t_building_bef_hac(l) > t_building_max(l)) then t_building(l) = t_building_max(l) ! [Cathy] orig: - eflx_urban_ac(l) = wtlunit_roof(l) * abs( (ht_roof(l) * rho_dair(l) * cpair / dtime) * t_building(l) & + ! eflx_urban_ac(l) = wtlunit_roof(l) * abs( (ht_roof(l) * rho_dair(l) * cpair / dtime) * t_building(l) & - (ht_roof(l) * rho_dair(l) * cpair / dtime) * t_building_bef_hac(l) ) ! [Cathy] dev: - ! eflx_urban_ac(l) = wtlunit_roof(l) * p_ac(l) * abs( (ht_roof(l) * rho_dair(l) * cpair / dtime) * t_building(l) & - ! - (ht_roof(l) * rho_dair(l) * cpair / dtime) * t_building_bef_hac(l) ) + eflx_urban_ac(l) = wtlunit_roof(l) * p_ac(l) * abs( (ht_roof(l) * rho_dair(l) * cpair / dtime) * t_building(l) & + - (ht_roof(l) * rho_dair(l) * cpair / dtime) * t_building_bef_hac(l) ) else if (t_building_bef_hac(l) < t_building_min(l)) then t_building(l) = t_building_min(l) eflx_urban_heat(l) = wtlunit_roof(l) * abs( (ht_roof(l) * rho_dair(l) * cpair / dtime) * t_building(l) & diff --git a/src/cpl/share_esmf/UrbanTimeVarType.F90 b/src/cpl/share_esmf/UrbanTimeVarType.F90 index 01f924935e..d96cc11157 100644 --- a/src/cpl/share_esmf/UrbanTimeVarType.F90 +++ b/src/cpl/share_esmf/UrbanTimeVarType.F90 @@ -24,8 +24,8 @@ module UrbanTimeVarType type, public :: urbantv_type ! real(r8), public, pointer :: t_building_max(:) ! lun maximum internal building air temperature (K) - ! ! Cathy [dev] - ! real(r8), public, pointer :: p_ac(:) ! lun air-conditioning ownership rate (unitless, between 0 and 1) + ! Cathy [dev] + real(r8), public, pointer :: p_ac(:) ! lun air-conditioning ownership rate (unitless, between 0 and 1) type(shr_strdata_type) :: sdat_urbantv ! urban time varying input data stream contains ! !PUBLIC MEMBER FUNCTIONS: @@ -36,8 +36,8 @@ module UrbanTimeVarType ! Cathy [orig] ! character(15), private :: stream_varnames(isturb_MIN:isturb_MAX) - ! Cathy [dev] - character(15), private :: stream_varnames(1:3) + ! Cathy [dev]: + character(15), private :: stream_varnames(1:6) ! 1-3 for t_building_max, 4-6 for p_ac character(len=*), parameter, private :: sourcefile = & __FILE__ @@ -68,23 +68,22 @@ subroutine Init(this, bounds, NLFilename) ! Allocate urbantv data structure allocate(this%t_building_max(begl:endl)); this%t_building_max(:) = nan - ! ! Cathy [dev] - ! allocate(this%p_ac(begl:endl)); this%p_ac(:) = nan + ! Cathy [dev] + allocate(this%p_ac(begl:endl)); this%p_ac(:) = nan call this%urbantv_init(bounds, NLFilename) call this%urbantv_interp(bounds) - ! Add history fields - ! Cathy: the subroutine is in scr/main/histFileMod.F90 + ! Add history fields ! Cathy: this adds an output field. the subroutine is in scr/main/histFileMod.F90 call hist_addfld1d (fname='TBUILD_MAX', units='K', & avgflag='A', long_name='prescribed maximum interior building temperature', & ptr_lunit=this%t_building_max, default='inactive', set_nourb=spval, & l2g_scale_type='unity') - ! ! Cathy [dev] - ! call hist_addfld1d (fname='P_AC', units='unitless', & - ! avgflag='A', long_name='prescribed air-conditioning ownership rate (decimal)', & - ! ptr_lunit=this%p_ac, default='inactive', set_nourb=spval, & - ! l2g_scale_type='unity') + ! Cathy [dev] + call hist_addfld1d (fname='P_AC', units='unitless', & + avgflag='A', long_name='prescribed air-conditioning ownership rate (decimal)', & + ptr_lunit=this%p_ac, default='inactive', set_nourb=spval, & + l2g_scale_type='unity') end subroutine Init @@ -120,8 +119,8 @@ subroutine urbantv_init(this, bounds, NLFilename) character(len=CL) :: urbantvmapalgo = 'nn' ! mapping alogrithm for urban ac ??? character(len=CL) :: urbantv_tintalgo = 'linear' ! time interpolation alogrithm integer :: rc ! error code - ! Cathy [orig] - ! character(*), parameter :: urbantvString = "tbuildmax_" ! base string for field string ??? + ! Cathy [orig]: this is taken out because field strings are now hard coded in + ! character(*), parameter :: urbantvString = "tbuildmax_" ! base string for field string character(*), parameter :: subName = "('urbantv_init')" ! ??? !----------------------------------------------------------------------- @@ -148,6 +147,9 @@ subroutine urbantv_init(this, bounds, NLFilename) stream_varnames(1) = "tbuildmax_TBD" stream_varnames(2) = "tbuildmax_HD" stream_varnames(3) = "tbuildmax_MD" + stream_varnames(4) = "p_ac_TBD" + stream_varnames(5) = "p_ac_HD" + stream_varnames(6) = "p_ac_MD" ! Read urbantv_streams namelist if (masterproc) then @@ -181,7 +183,7 @@ subroutine urbantv_init(this, bounds, NLFilename) ! Cathy [orig] ! do n = isturb_tbd,isturb_md ! Cathy [dev] - do n = 1,3 + do n = 1,6 write(iulog,'(a,a)' ) ' stream_varname = ',trim(stream_varnames(n)) end do write(iulog,*) ' ' @@ -202,8 +204,8 @@ subroutine urbantv_init(this, bounds, NLFilename) ! stream_fldlistFile = stream_varnames(isturb_tbd:isturb_md),& ! stream_fldListModel = stream_varnames(isturb_tbd:isturb_md),& ! Cathy [dev] - stream_fldlistFile = stream_varnames(1:3), & - stream_fldListModel = stream_varnames(1:3), & + stream_fldlistFile = stream_varnames(1:6), & + stream_fldListModel = stream_varnames(1:6), & stream_yearFirst = stream_year_first_urbantv, & stream_yearLast = stream_year_last_urbantv, & stream_yearAlign = model_year_align_urbantv, & @@ -265,8 +267,8 @@ subroutine urbantv_interp(this, bounds) ! allocate(dataptr2d(lsize, isturb_MIN:isturb_MAX)) ! do n = isturb_MIN,isturb_MAX ! Cathy [dev] - allocate(dataptr2d(lsize, 1:3)) - do n = 1,3 + allocate(dataptr2d(lsize, 1:6)) + do n = 1,6 call dshr_fldbun_getFldPtr(this%sdat_urbantv%pstrm(1)%fldbun_model, trim(stream_varnames(n)), & fldptr1=dataptr1d, rc=rc) if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) then @@ -290,20 +292,20 @@ subroutine urbantv_interp(this, bounds) ! Cathy [orig] ! do n = isturb_MIN,isturb_MAX ! Cathy [dev] - do n = 1,3 + do n = 1,6 ! Cathy [orig] ! if (stream_varnames(lun%itype(l)) == stream_varnames(n)) then - ! Cathy [dev.01] + ! Cathy [dev.02] if (stream_varnames((lun%itype(l)-6)) == stream_varnames(n)) then this%t_building_max(l) = dataptr2d(ig,n) - ! ! Cathy [dev] - ! this%p_ac(l) = dataptr2d(ig,n) ! ??? + if (stream_varnames((lun%itype(l)-3)) == stream_varnames(n)) then + this%p_ac(l) = dataptr2d(ig,n) end if end do else this%t_building_max(l) = spval ! Cathy: special value for real data, set to 1.e36 in src/main/clm_varcon - ! ! Cathy [dev] - ! this%p_ac(l) = spval + ! Cathy [dev] + this%p_ac(l) = 0._r8 ! Cathy: set to 0 for non-urban landunit end if end do deallocate(dataptr2d) @@ -318,10 +320,10 @@ subroutine urbantv_interp(this, bounds) if (g == lun%gridcell(l)) exit end do ! Cathy [orig] - if ( .not. urban_valid(g) .or. (this%t_building_max(l) <= 0._r8)) then + ! if ( .not. urban_valid(g) .or. (this%t_building_max(l) <= 0._r8)) then ! Cathy [dev] - ! if ( .not. urban_valid(g) .or. (this%t_building_max(l) <= 0._r8) - ! & .or. (this%p_ac(l) <= 0._r8) .or. (this%p_ac(l) >= 1._r8)) then + if ( .not. urban_valid(g) .or. (this%t_building_max(l) <= 0._r8) & + .or. (this%p_ac(l) < 0._r8) .or. (this%p_ac(l) > 1._r8)) then found = .true. gindx = g lindx = l @@ -334,8 +336,8 @@ subroutine urbantv_interp(this, bounds) write(iulog,*)'landunit type: ',lun%itype(lindx) write(iulog,*)'urban_valid: ',urban_valid(gindx) write(iulog,*)'t_building_max: ',this%t_building_max(lindx) - ! ! Cathy [dev] - ! write(iulog,*)'p_ac: ',this%p_ac(lindx) + ! Cathy [dev] + write(iulog,*)'p_ac: ',this%p_ac(lindx) call endrun(subgrid_index=lindx, subgrid_level=subgrid_level_landunit, & msg=errmsg(sourcefile, __LINE__)) end if From e621628352f457bfadb118ca67b7b4c4634d668a Mon Sep 17 00:00:00 2001 From: cathyxinchangli <55264121+cathyxinchangli@users.noreply.github.com> Date: Wed, 25 Jan 2023 00:13:28 -0600 Subject: [PATCH 0018/1248] Update UrbanTimeVarType.F90 Bug fix: added missing "end if" --- src/cpl/share_esmf/UrbanTimeVarType.F90 | 1 + 1 file changed, 1 insertion(+) diff --git a/src/cpl/share_esmf/UrbanTimeVarType.F90 b/src/cpl/share_esmf/UrbanTimeVarType.F90 index d96cc11157..bc0c82af6a 100644 --- a/src/cpl/share_esmf/UrbanTimeVarType.F90 +++ b/src/cpl/share_esmf/UrbanTimeVarType.F90 @@ -298,6 +298,7 @@ subroutine urbantv_interp(this, bounds) ! Cathy [dev.02] if (stream_varnames((lun%itype(l)-6)) == stream_varnames(n)) then this%t_building_max(l) = dataptr2d(ig,n) + end if if (stream_varnames((lun%itype(l)-3)) == stream_varnames(n)) then this%p_ac(l) = dataptr2d(ig,n) end if From eabe116800f8cf40c1a17755205e2d72b80df033 Mon Sep 17 00:00:00 2001 From: cathyxinchangli <55264121+cathyxinchangli@users.noreply.github.com> Date: Wed, 25 Jan 2023 10:58:24 -0600 Subject: [PATCH 0019/1248] Update UrbBuildTempOleson2015Mod.F90 Bug fix: declare p_ac type; comment out original code --- src/biogeophys/UrbBuildTempOleson2015Mod.F90 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/biogeophys/UrbBuildTempOleson2015Mod.F90 b/src/biogeophys/UrbBuildTempOleson2015Mod.F90 index 260c6658af..d54d3ff86d 100644 --- a/src/biogeophys/UrbBuildTempOleson2015Mod.F90 +++ b/src/biogeophys/UrbBuildTempOleson2015Mod.F90 @@ -324,6 +324,8 @@ subroutine BuildingTemperature (bounds, num_urbanl, filter_urbanl, num_nolakec, t_floor => temperature_inst%t_floor_lun , & ! InOut: [real(r8) (:)] floor temperature (K) t_building => temperature_inst%t_building_lun , & ! InOut: [real(r8) (:)] internal building air temperature (K) + ! Cathy [dev] + p_ac => urbantv_inst%p_ac , & ! Input: [real(r8) (:)] air-conditioning penetration rate (-) t_building_max => urbantv_inst%t_building_max , & ! Input: [real(r8) (:)] maximum internal building air temperature (K) t_building_min => urbanparams_inst%t_building_min , & ! Input: [real(r8) (:)] minimum internal building air temperature (K) @@ -926,7 +928,7 @@ subroutine BuildingTemperature (bounds, num_urbanl, filter_urbanl, num_nolakec, t_building(l) = t_building_max(l) ! [Cathy] orig: ! eflx_urban_ac(l) = wtlunit_roof(l) * abs( (ht_roof(l) * rho_dair(l) * cpair / dtime) * t_building(l) & - - (ht_roof(l) * rho_dair(l) * cpair / dtime) * t_building_bef_hac(l) ) + ! - (ht_roof(l) * rho_dair(l) * cpair / dtime) * t_building_bef_hac(l) ) ! [Cathy] dev: eflx_urban_ac(l) = wtlunit_roof(l) * p_ac(l) * abs( (ht_roof(l) * rho_dair(l) * cpair / dtime) * t_building(l) & - (ht_roof(l) * rho_dair(l) * cpair / dtime) * t_building_bef_hac(l) ) From ed26fd3a2b66429204b47a043a43ca5051786659 Mon Sep 17 00:00:00 2001 From: cathyxinchangli <55264121+cathyxinchangli@users.noreply.github.com> Date: Thu, 26 Jan 2023 12:22:47 -0600 Subject: [PATCH 0020/1248] Debug dev.02 --- src/cpl/share_esmf/UrbanTimeVarType.F90 | 27 +++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/src/cpl/share_esmf/UrbanTimeVarType.F90 b/src/cpl/share_esmf/UrbanTimeVarType.F90 index bc0c82af6a..d542d2440e 100644 --- a/src/cpl/share_esmf/UrbanTimeVarType.F90 +++ b/src/cpl/share_esmf/UrbanTimeVarType.F90 @@ -72,6 +72,10 @@ subroutine Init(this, bounds, NLFilename) allocate(this%p_ac(begl:endl)); this%p_ac(:) = nan call this%urbantv_init(bounds, NLFilename) + + ! Cathy [dev.02] + write(*,*) 'Cathy: urbantv_init done.' + call this%urbantv_interp(bounds) ! Add history fields ! Cathy: this adds an output field. the subroutine is in scr/main/histFileMod.F90 @@ -188,6 +192,9 @@ subroutine urbantv_init(this, bounds, NLFilename) end do write(iulog,*) ' ' endif + + ! Cathy [dev.02] + write(*,*) 'Cathy: before shr_strdata_init_from_inline' ! Initialize the cdeps data type this%sdat_urbantv call shr_strdata_init_from_inline(this%sdat_urbantv, & @@ -215,6 +222,10 @@ subroutine urbantv_init(this, bounds, NLFilename) stream_tintalgo = urbantv_tintalgo, & stream_name = 'Urban time varying data', & rc = rc) + + ! Cathy [dev.02] + write(*,*) 'Cathy: before shr_strdata_init_from_inline' + if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) then call ESMF_Finalize(endflag=ESMF_END_ABORT) end if @@ -253,14 +264,24 @@ subroutine urbantv_interp(this, bounds) real(r8), pointer :: dataptr2d(:,:) !----------------------------------------------------------------------- + ! Cathy [dev.02] + write(*,*) 'Cathy: before get_curr_date' + ! Advance sdat stream call get_curr_date(year, mon, day, sec) mcdate = year*10000 + mon*100 + day + + ! Cathy [dev.02] + write(*,*) 'Cathy: after get_curr_date, before shr_strdata_advance' + call shr_strdata_advance(this%sdat_urbantv, ymd=mcdate, tod=sec, logunit=iulog, istr='hdmdyn', rc=rc) if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) then call ESMF_Finalize(endflag=ESMF_END_ABORT) end if + ! Cathy [dev.02] + write(*,*) 'Cathy: before creating 2d array' + ! Create 2d array for all stream variable data lsize = bounds%endg - bounds%begg + 1 ! Cathy [orig] @@ -281,6 +302,9 @@ subroutine urbantv_interp(this, bounds) end do end do + ! Cathy [dev.02] + write(*,*) 'Cathy: after creating 2d array, before determining t_building_max and p_ac for all landunits' + ! Determine this%tbuilding_max for all landunits do l = bounds%begl,bounds%endl if (lun%urbpoi(l)) then @@ -311,6 +335,9 @@ subroutine urbantv_interp(this, bounds) end do deallocate(dataptr2d) + ! Cathy [dev.02] + write(*,*) 'Cathy: after determining t_building_max and p_ac for all landunits' + ! Error check found = .false. do l = bounds%begl,bounds%endl From e10e338f2b165a2c8dbe122598e5caf5efd620c4 Mon Sep 17 00:00:00 2001 From: cathyxinchangli <55264121+cathyxinchangli@users.noreply.github.com> Date: Thu, 26 Jan 2023 13:41:40 -0600 Subject: [PATCH 0021/1248] Update UrbanTimeVarType.F90 --- src/cpl/share_esmf/UrbanTimeVarType.F90 | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/src/cpl/share_esmf/UrbanTimeVarType.F90 b/src/cpl/share_esmf/UrbanTimeVarType.F90 index d542d2440e..1f679b88a3 100644 --- a/src/cpl/share_esmf/UrbanTimeVarType.F90 +++ b/src/cpl/share_esmf/UrbanTimeVarType.F90 @@ -74,7 +74,7 @@ subroutine Init(this, bounds, NLFilename) call this%urbantv_init(bounds, NLFilename) ! Cathy [dev.02] - write(*,*) 'Cathy: urbantv_init done.' + write(iulog,*) 'Cathy: urbantv_init done.' call this%urbantv_interp(bounds) @@ -190,11 +190,14 @@ subroutine urbantv_init(this, bounds, NLFilename) do n = 1,6 write(iulog,'(a,a)' ) ' stream_varname = ',trim(stream_varnames(n)) end do - write(iulog,*) ' ' + ! Cathy [orig] + ! write(iulog,*) ' ' + ! Cathy [dev.02] + write(iulog,*) 'Cathy: does write statements have to be inside if?' endif ! Cathy [dev.02] - write(*,*) 'Cathy: before shr_strdata_init_from_inline' + write(iulog,*) 'Cathy: before shr_strdata_init_from_inline' ! Initialize the cdeps data type this%sdat_urbantv call shr_strdata_init_from_inline(this%sdat_urbantv, & @@ -224,7 +227,7 @@ subroutine urbantv_init(this, bounds, NLFilename) rc = rc) ! Cathy [dev.02] - write(*,*) 'Cathy: before shr_strdata_init_from_inline' + write(iulog,*) 'Cathy: before shr_strdata_init_from_inline' if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) then call ESMF_Finalize(endflag=ESMF_END_ABORT) @@ -265,14 +268,14 @@ subroutine urbantv_interp(this, bounds) !----------------------------------------------------------------------- ! Cathy [dev.02] - write(*,*) 'Cathy: before get_curr_date' + write(iulog,*) 'Cathy: before get_curr_date' ! Advance sdat stream call get_curr_date(year, mon, day, sec) mcdate = year*10000 + mon*100 + day ! Cathy [dev.02] - write(*,*) 'Cathy: after get_curr_date, before shr_strdata_advance' + write(iulog,*) 'Cathy: after get_curr_date, before shr_strdata_advance' call shr_strdata_advance(this%sdat_urbantv, ymd=mcdate, tod=sec, logunit=iulog, istr='hdmdyn', rc=rc) if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) then @@ -280,7 +283,7 @@ subroutine urbantv_interp(this, bounds) end if ! Cathy [dev.02] - write(*,*) 'Cathy: before creating 2d array' + write(iulog,*) 'Cathy: before creating 2d array' ! Create 2d array for all stream variable data lsize = bounds%endg - bounds%begg + 1 @@ -303,7 +306,7 @@ subroutine urbantv_interp(this, bounds) end do ! Cathy [dev.02] - write(*,*) 'Cathy: after creating 2d array, before determining t_building_max and p_ac for all landunits' + write(iulog,*) 'Cathy: after creating 2d array, before determining t_building_max and p_ac for all landunits' ! Determine this%tbuilding_max for all landunits do l = bounds%begl,bounds%endl @@ -336,7 +339,7 @@ subroutine urbantv_interp(this, bounds) deallocate(dataptr2d) ! Cathy [dev.02] - write(*,*) 'Cathy: after determining t_building_max and p_ac for all landunits' + write(iulog,*) 'Cathy: after determining t_building_max and p_ac for all landunits' ! Error check found = .false. From 36d1feec1da582f8c4280ee5ea1393aa8ca5c8de Mon Sep 17 00:00:00 2001 From: "Danny M. Leung" Date: Tue, 31 Jan 2023 01:29:30 -0700 Subject: [PATCH 0022/1248] 31 Jan 2023: dmleung added capabilities of reading stream files for Prigent's roughness data --- bld/CLMBuildNamelist.pm | 10 + bld/namelist_files/namelist_defaults_ctsm.xml | 11 + .../namelist_definition_ctsm.xml | 15 + src/biogeochem/DUSTMod.F90 | 42 +- .../share_esmf/PrigentRoughnessStreamType.F90 | 397 ++++++++++++++++++ 5 files changed, 469 insertions(+), 6 deletions(-) create mode 100644 src/cpl/share_esmf/PrigentRoughnessStreamType.F90 diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index cbd5e3ce44..d078b3869c 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -1560,6 +1560,7 @@ sub process_namelist_inline_logic { setup_logic_snowpack($opts, $nl_flags, $definition, $defaults, $nl); setup_logic_fates($opts, $nl_flags, $definition, $defaults, $nl); setup_logic_misc($opts, $nl_flags, $definition, $defaults, $nl); + setup_logic_prigent_roughness($opts, $nl_flags, $definition, $defaults, $nl); # dmleung added 31 Dec 2022 ######################################### # namelist group: atm2lnd_inparm @@ -4178,6 +4179,15 @@ sub setup_logic_misc { #------------------------------------------------------------------------------- +sub setup_logic_prigent_roughness { + # dmleung added on 31 Dec 2022 for reading Prigent's roughness stream file + my ($opts, $nl_flags, $definition, $defaults, $nl) = @_; + add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_fldfilename_prigentroughness' ); + add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_meshfile_prigentroughness' ); +} + +#------------------------------------------------------------------------------- + sub write_output_files { my ($opts, $nl_flags, $defaults, $nl) = @_; diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index 2686d62b9a..3d0f5ef5e1 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -2524,6 +2524,17 @@ lnd/clm2/surfdata_map/release-clm5.0.30/surfdata_ne0np4.CONUS.ne30x8_hist_78pfts lnd/clm2/paramdata/finundated_inversiondata_0.9x1_ESMFmesh_cdf5_130621.nc + + + + + + +/glade/u/home/dleung/CESM2/ctsm_dustemis_dev/cdf5_Z0a_Prigent-Globe-025x025-01242023.nc +/glade/u/home/dleung/CESM2/ctsm_dustemis_dev/lnd_mesh.nc + diff --git a/bld/namelist_files/namelist_definition_ctsm.xml b/bld/namelist_files/namelist_definition_ctsm.xml index ddc5d8372c..6cdf4e3ce5 100644 --- a/bld/namelist_files/namelist_definition_ctsm.xml +++ b/bld/namelist_files/namelist_definition_ctsm.xml @@ -1693,6 +1693,21 @@ Mapping method from Nitrogen deposition input file to the model resolution copy = copy using the same indices + + + + + + +Filename of input stream data for aeolian roughness length (from Prigent's roughness dataset) + + + +mesh filename of input stream data for aeolian roughness length (from Prigent's roughness dataset) + + diff --git a/src/biogeochem/DUSTMod.F90 b/src/biogeochem/DUSTMod.F90 index 5ec021a01d..381ecfe41d 100644 --- a/src/biogeochem/DUSTMod.F90 +++ b/src/biogeochem/DUSTMod.F90 @@ -88,6 +88,9 @@ module DUSTMod real(r8), pointer, private :: frc_thr_rghn_fct_patch (:) ! [dimless] hybrid drag partition (or called roughness) factor !########### added by dmleung 28 Jul 2022 ######################################################################## real(r8), pointer, private :: wnd_frc_thr_std_patch (:) ! standardized fluid threshold friction velocity (m/s) + !########### added by dmleung 31 Dec 2022 ######################################################################## + type(prigentroughnessstream_type), private :: prigentroughnessstream ! Prigent roughness stream data + real(r8), pointer, private :: dpfct_rock_patch (:) ! [fraction] rock drag partition factor, time-constant contains procedure , public :: Init @@ -105,13 +108,15 @@ module DUSTMod contains !------------------------------------------------------------------------ - subroutine Init(this, bounds) + !##### dmleung edited for initializing stream files 31 Dec 2022 ######## + subroutine Init(this, bounds, NLFilename) class(dust_type) :: this type(bounds_type), intent(in) :: bounds call this%InitAllocate (bounds) call this%InitHistory (bounds) + call this%prigentroughnessstream%Init( bounds, NLFilename ) ! dmleung added 31 Dec 2022 call this%InitCold (bounds) call this%InitDustVars (bounds) @@ -164,6 +169,8 @@ subroutine InitAllocate(this, bounds) allocate(this%frc_thr_rghn_fct_patch (begp:endp)) ; this%frc_thr_rghn_fct_patch (:) = nan !#### added by dmleung 28 Jul 2022 ###################################### allocate(this%wnd_frc_thr_std_patch (begp:endp)) ; this%wnd_frc_thr_std_patch (:) = nan + !#### added by dmleung 31 Dec 2022 ###################################### + allocate(this%dpfct_rock_patch (begp:endp)) ; this%dpfct_rock_patch (:) = nan end subroutine InitAllocate !------------------------------------------------------------------------ @@ -292,16 +299,23 @@ subroutine InitHistory(this, bounds) call hist_addfld1d (fname='WND_FRC_FT_STD', units='m/s', & avgflag='A', long_name='standardized fluid threshold friction velocity', & ptr_patch=this%wnd_frc_thr_std_patch, set_lake=0._r8, set_urb=0._r8) + !#####added by dmleung 31 Dec 2022 ######################################## + this%dpfct_rock_patch(begp:endp) = spval + call hist_addfld1d (fname='DPFCT_ROCK', units='m/s', & + avgflag='A', long_name='rock drag partition factor', & + ptr_patch=this%dpfct_rock_patch, set_lake=0._r8, set_urb=0._r8) !########################################################################## end subroutine InitHistory !----------------------------------------------------------------------- - subroutine InitCold(this, bounds) + subroutine InitCold(this, bounds) !dmleung commented 31 Dec 2022 + !subroutine InitCold(this, bounds) ! ! !ARGUMENTS: - class (dust_type) :: this + class(dust_type), intent(inout) :: this ! dmleung used class instead of type, 31 Dec 2022 type(bounds_type), intent(in) :: bounds + !type(dust_type), intent(inout) :: dust_inst ! ! !LOCAL VARIABLES: integer :: c,l @@ -317,6 +331,19 @@ subroutine InitCold(this, bounds) end if end do + !associate( & + ! dpfct_rock => this%dpfct_rock_patch & + ! ) + ! Caulculate Drag Partition factor, dmleung added 31 Dec 2022 + if ( this%prigentroughnessstream%useStreams() )then !if usestreams == true, and it should be always true + call this%prigentroughnessstream%CalcDragPartition( bounds, & + num_nolakep, filter_nolakep, this%dpfct_rock_patch(bounds%begp:bounds%endp) ) + else + + call endrun( "ERROR:: Drag partitioning MUST now use a streams file of aeolian roughness length to calculate, it can no longer read from the fsurdat file" ) + end if + !end associate + end subroutine InitCold !------------------------------------------------------------------------ @@ -452,13 +479,15 @@ subroutine DustEmission (bounds, & prb_crs_fld_thr => dust_inst%prb_crs_fld_thr_patch , & prb_crs_impct_thr => dust_inst%prb_crs_impct_thr_patch , & ! added by dmleung 17 Dec 2021 - roughfct => soilstate_inst%roughfct_patch , & + roughfct => soilstate_inst%roughfct_patch , & ! dmleung replaced it by dpfct_rock below, 31 Dec 2022 ! added by dmleung 20 Dec 2021 ssr => dust_inst%ssr_patch , & lai => dust_inst%lai_patch , & frc_thr_rghn_fct => dust_inst%frc_thr_rghn_fct_patch , & ! added by dmleung 28 Jul 2022 - wnd_frc_thr_std => dust_inst%wnd_frc_thr_std_patch & + wnd_frc_thr_std => dust_inst%wnd_frc_thr_std_patch , & + ! added by dmleung 31 Dec 2022 + dpfct_rock => dust_inst%dpfct_rock_patch & ! dmleung used roughfct (roughness factor) instead of dpfct_rock (rock drag partition factor) here. Could change it back to dpfct_rock here and below later, 31 Dec 2022 ) ttlai(bounds%begp : bounds%endp) = 0._r8 @@ -654,7 +683,8 @@ subroutine DustEmission (bounds, & ! dmleung added calculation of LUH2 bare vs veg fraction within a grid 6 Oct 2022 if (lun%itype(l) == istsoil .or. lun%itype(l) == istcrop) then if (patch%itype(p) == noveg) then - frc_thr_rgh_fct = roughfct(p) + !frc_thr_rgh_fct = roughfct(p) ! dmleung commented out 13 Dec 2022 and added next line + frc_thr_rgh_fct = dpfct_rock(p) else frc_thr_rgh_fct = ssr(p) end if diff --git a/src/cpl/share_esmf/PrigentRoughnessStreamType.F90 b/src/cpl/share_esmf/PrigentRoughnessStreamType.F90 new file mode 100644 index 0000000000..7da0e7bf50 --- /dev/null +++ b/src/cpl/share_esmf/PrigentRoughnessStreamType.F90 @@ -0,0 +1,397 @@ +module PrigentRoughnessStreamType +!dmleung modified based on ch4FInundatedStreamType on 17 Nov 2022 +#include "shr_assert.h" ! What is this? In many modules but not dust module + + !----------------------------------------------------------------------- + ! !DESCRIPTION: + ! Contains methods for reading in the Prigent et al. (1997) roughness length streams file. dmleung 22 Nov 2022 + ! + ! !USES + use ESMF + use dshr_strdata_mod , only : shr_strdata_type + use shr_kind_mod , only : r8 => shr_kind_r8, CL => shr_kind_cl + use shr_log_mod , only : errMsg => shr_log_errMsg + use spmdMod , only : mpicom, masterproc + use clm_varctl , only : iulog + use abortutils , only : endrun + use decompMod , only : bounds_type + !use ch4varcon , only : finundation_mtd ! dmleung commented out. need to replace anything here? + + ! !PUBLIC TYPES: + implicit none + private + + type, public :: prigentroughnessstream_type + ! dmleung commented the next five lines. Does it need any replacement here? + real(r8), pointer, private :: prigent_rghn (:) ! Prigent et al. (1997) roughness length (m) + !real(r8), pointer, private :: zwt0_gdc (:) ! col coefficient for determining finundated (m) + !real(r8), pointer, private :: f0_gdc (:) ! col maximum inundated fraction for a gridcell (for methane code) + !real(r8), pointer, private :: p3_gdc (:) ! col coefficient for determining finundated (m) + !real(r8), pointer, private :: fws_slope_gdc (:) ! col slope in fws = slope * tws + intercept (A coefficient) + !real(r8), pointer, private :: fws_intercept_gdc (:) ! col slope in fws = slope * tws + intercept (B coefficient) + contains + + ! !PUBLIC MEMBER FUNCTIONS: + procedure, public :: Init ! Initialize and read data in + !procedure, public :: CalcFinundated ! Calculate finundated based on input streams + procedure, public :: CalcDragPartition ! Calculate drag partitioning based on input streams + procedure, public :: UseStreams ! If streams will be used -- dmleung set default as yes + + ! !PRIVATE MEMBER FUNCTIONS: + procedure, private :: InitAllocate ! Allocate data + + end type prigentroughnessstream_type + + ! ! PRIVATE DATA: + type, private :: streamcontrol_type + character(len=CL) :: stream_fldFileName_prigentroughness ! data Filename + character(len=CL) :: stream_meshfile_prigentroughness ! mesh Filename + character(len=CL) :: prigentroughnessmapalgo ! map algo + contains + procedure, private :: ReadNML ! Read in namelist + end type streamcontrol_type + + type(streamcontrol_type), private :: control ! Stream control data + + character(len=*), parameter, private :: sourcefile = & + __FILE__ + +!============================================================================== +contains +!============================================================================== + + subroutine Init(this, bounds, NLFilename) + ! + ! Initialize the prigent roughness stream object + ! + ! Uses: + use spmdMod , only : iam !what is this and do I need this + !use ch4varcon , only : finundation_mtd_h2osfc + !use ch4varcon , only : finundation_mtd_ZWT_inversion, finundation_mtd_TWS_inversion + use lnd_comp_shr , only : mesh, model_clock + use dshr_strdata_mod , only : shr_strdata_init_from_inline, shr_strdata_print + use dshr_strdata_mod , only : shr_strdata_advance + use dshr_methods_mod , only : dshr_fldbun_getfldptr !what is this and do I need this (read ncdata?) + ! + ! arguments + implicit none + class(prigentroughnessstream_type) :: this + type(bounds_type), intent(in) :: bounds + character(len=*), intent(in) :: NLFilename ! Namelist filename + ! + ! local variables + integer :: ig, g, n ! Indices + 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) + type(shr_strdata_type) :: sdat_rghn ! input data stream + character(len=16), allocatable :: stream_varnames(:) ! array of stream field names + integer :: rc ! error code + real(r8), pointer :: dataptr1d(:) ! temporary pointer + !character(len=*), parameter :: stream_name = 'prigentroughness' + !----------------------------------------------------------------------- + + !if ( finundation_mtd /= finundation_mtd_h2osfc )then ! how should I change this? comment out for now + call this%InitAllocate( bounds ) + call control%ReadNML( bounds, NLFileName ) + + if ( this%useStreams() )then ! is this a namelist input and is it set in namelist default + + !if (finundation_mtd == finundation_mtd_ZWT_inversion )then + ! allocate(stream_varnames(3)) + ! stream_varnames = (/"ZWT0","F0 ","P3 "/) + !else if ( finundation_mtd == finundation_mtd_TWS_inversion )then + allocate(stream_varnames(1)) + stream_varnames = (/"Z0a"/) ! varname in cdf5_Z0a_Prigent-Globe-025x025-09262022.nc, in centimeter + !else + ! call endrun(msg=' ERROR do NOT know what list of variables to read for this finundation_mtd type'// & + ! errMsg(sourcefile, __LINE__)) + !end if + + if (masterproc) then + write(iulog,*) ' stream_varnames = ',stream_varnames + end if + + ! Initialize the cdeps data type sdat_rghn + call shr_strdata_init_from_inline(sdat_rghn, & ! what is this function and where does it come from? + my_task = iam, & + logunit = iulog, & + compname = 'LND', & + model_clock = model_clock, & + model_mesh = mesh, & + stream_meshfile = control%stream_meshfile_prigentroughness, & + stream_lev_dimname = 'null', & + stream_mapalgo = control%prigentroughnessmapalgo, & + stream_filenames = (/trim(control%stream_fldFileName_prigentroughness)/), & + stream_fldlistFile = stream_varnames, & + stream_fldListModel = stream_varnames, & + stream_yearFirst = 1997, & + stream_yearLast = 1997, & + stream_yearAlign = 1, & + stream_offset = 0, & + stream_taxmode = 'extend', & + stream_dtlimit = 1.0e30_r8, & + stream_tintalgo = 'linear', & + stream_name = 'Prigent roughness', & + rc = rc) + if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) then + call ESMF_Finalize(endflag=ESMF_END_ABORT) + end if + + ! Explicitly set current date to a hardcoded constant value. Otherwise + ! using the real date can cause roundoff differences that are + ! detrected as issues with exact restart. EBK M05/20/2017 + ! call get_curr_date(year, mon, day, sec) + year = 1997 + mon = 12 + day = 31 + sec = 0 + mcdate = year*10000 + mon*100 + day + + call shr_strdata_advance(sdat_rghn, ymd=mcdate, tod=sec, logunit=iulog, istr='prigentrghn', rc=rc) ! what is istr and do I need to change elsewhere because the change of istr here + if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) then + call ESMF_Finalize(endflag=ESMF_END_ABORT) + end if + + ! Get pointer for stream data that is time and spatially interpolate to model time and grid + do n = 1,size(stream_varnames) + call dshr_fldbun_getFldPtr(sdat_rghn%pstrm(1)%fldbun_model, stream_varnames(n), fldptr1=dataptr1d, rc=rc) ! is the ncdf datasets read here, looping across all available variables in the files? Also, not sure about pstrm and fldbun_model + if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) then + call ESMF_Finalize(endflag=ESMF_END_ABORT) + end if + if (trim(stream_varnames(n)) == 'Z0a') then + ig = 0 + do g = bounds%begg,bounds%endg + ig = ig+1 ! not sure why +1 is needed but it's okay + this%prigent_rghn(g) = dataptr1d(ig) + end do + + end if + + end do + end if + !end if !comment out for now + + end subroutine Init + + !============================================================================== + logical function UseStreams(this) + ! + ! !DESCRIPTION: + ! Return true if + ! + ! !USES: + ! + ! !ARGUMENTS: + implicit none + class(prigentroughnessstream_type) :: this + ! + ! !LOCAL VARIABLES: + if ( trim(control%stream_fldFileName_prigentroughness) == '' )then + UseStreams = .false. ! dmleung: this won't happen and UseStreams will always be true + else + UseStreams = .true. + end if + end function UseStreams + + !============================================================================== + subroutine InitAllocate(this, bounds) + ! + ! !DESCRIPTION: + ! Allocate module variables and data structures + ! + ! !USES: + use shr_infnan_mod, only: nan => shr_infnan_nan, assignment(=) + !use ch4varcon , only: finundation_mtd_ZWT_inversion, finundation_mtd_TWS_inversion + ! + ! !ARGUMENTS: + implicit none + class(prigentroughnessstream_type) :: this + type(bounds_type), intent(in) :: bounds + ! + ! !LOCAL VARIABLES: + !integer :: begc, endc + integer :: begg, endg + !--------------------------------------------------------------------- + + !begc = bounds%begc; endc = bounds%endc + begg = bounds%begg; endg = bounds%endg + + !if( finundation_mtd == finundation_mtd_ZWT_inversion )then + allocate(this%prigent_rghn (begg:endg)) ; this%prigent_rghn (:) = nan + ! allocate(this%zwt0_gdc (begg:endg)) ; this%zwt0_gdc (:) = nan + ! allocate(this%f0_gdc (begg:endg)) ; this%f0_gdc (:) = nan + ! allocate(this%p3_gdc (begg:endg)) ; this%p3_gdc (:) = nan + !else if( finundation_mtd == finundation_mtd_TWS_inversion )then + ! allocate(this%fws_slope_gdc (begg:endg)) ; this%fws_slope_gdc (:) = nan + ! allocate(this%fws_intercept_gdc(begg:endg)) ; this%fws_intercept_gdc(:) = nan + !end if + + end subroutine InitAllocate + + !============================================================================== + !subroutine CalcFinundated(this, bounds, num_soilc, filter_soilc, soilhydrology_inst, & + ! waterdiagnosticbulk_inst, qflx_surf_lag_col, finundated ) + subroutine CalcDragPartition(this, bounds, num_nolakep, filter_nolakep, dpfct_rock) + ! + ! !DESCRIPTION: + ! Commented below by dmleung 31 Dec 2022 + ! Calculate the drag partition effect of friction velocity due to surface roughness following + ! Leung et al. (2022). This module is used in the dust emission module DUSTMod.F90 for + ! calculating drag partitioning. The drag partition equation comes from Marticorena and + ! Bergametti (1995) with constants modified by Darmenova et al. (2009). Here it is assumed + ! that this equation is used only over arid/desertic regions, such that Catherine Prigent's + ! roughness measurements represents mostly rocks. For more vegetated areas, the vegetation + ! roughness and drag partitioning are calculated in the DustEmission subroutine. This + ! subroutine is used in the InitCold subroutine of DUSTMod.F90. + ! + ! !USES: + !use ColumnType , only : col + use PatchType , only : patch + !use ch4varcon , only : finundation_mtd_h2osfc, finundation_mtd_ZWT_inversion + !use ch4varcon , only : finundation_mtd_TWS_inversion + !use clm_varpar , only : nlevsoi + !use SoilHydrologyType , only : soilhydrology_type + !use WaterDiagnosticBulkType , only : waterdiagnosticbulk_type + ! + ! !ARGUMENTS: + implicit none + class(prigentroughnessstream_type) :: this + type(bounds_type) , intent(in) :: bounds + !integer , intent(in) :: num_soilc ! number of column soil points in column filter + !integer , intent(in) :: filter_soilc(:) ! column filter for soil points + integer , intent(in) :: num_nolakep ! + integer , intent(in) :: filter_nolakep(num_nolakep) ! + !type(soilhydrology_type) , intent(in) :: soilhydrology_inst + !type(waterdiagnosticbulk_type) , intent(in) :: waterdiagnosticbulk_inst + !real(r8) , intent(in) :: qflx_surf_lag_col(bounds%begc:) !time-lagged surface runoff (mm H2O /s) + !real(r8) , intent(inout) :: finundated(bounds%begc:) ! fractional inundated area in soil column (excluding dedicated wetland columns) + real(r8) , intent(inout) :: dpfct_rock(bounds%begp:) ! [fraction] rock drag partition factor (roughness effect) + ! + ! !LOCAL VARIABLES: + !integer :: g, c, fc ! Indices + integer :: g, p, fp ! Indices + real(r8) :: z0s ! smooth roughness length (m) + !real(r8) :: zwt_actual ! Total water storage (ZWT) to use either perched or total depending on conditions + + ! constants + real(r8), parameter :: D_p = 130e-6_r8 ! [m] Medium soil particle diameter, assuming a global constant of ~130 um following Leung et al. (2022) + real(r8), parameter :: X = 10_r8 ! [m] distance downwind of the roughness element (rock). Assume estimating roughness effect at a distance of 10 m following Leung et al. (2022) + !--------------------------------------------------------------------- + + !SHR_ASSERT_ALL_FL((ubound(qflx_surf_lag_col) == (/bounds%endc/)), sourcefile, __LINE__) ! not sure what this is + !SHR_ASSERT_ALL_FL((ubound(finundated) == (/bounds%endc/)), sourcefile, __LINE__) + SHR_ASSERT_ALL_FL((ubound(dpfct_rock) == (/bounds%endp/)), sourcefile, __LINE__) !what's the use of this + + !associate( & + !z => col%z & ! Input: [real(r8) (:,:) ] layer depth (m) (-nlevsno+1:nlevsoi) + !zwt => soilhydrology_inst%zwt_col , & ! Input: [real(r8) (:) ] water table depth (m) + !zwt_perched => soilhydrology_inst%zwt_perched_col , & ! Input: [real(r8) (:) ] perched water table depth (m) + !tws => waterdiagnosticbulk_inst%tws_grc , & ! Input: [real(r8) (:) ] total water storage (kg m-2) + !frac_h2osfc => waterdiagnosticbulk_inst%frac_h2osfc_col & ! Input: [real(r8) (:) ] fraction of ground covered by surface water (0 to 1) + !) + + ! Calculate finundated + !do fc = 1, num_soilc + ! c = filter_soilc(fc) + ! g = col%gridcell(c) + ! select case( finundation_mtd ) + ! case ( finundation_mtd_h2osfc ) + ! finundated(c) = frac_h2osfc(c) + ! case ( finundation_mtd_ZWT_inversion ) + ! if (this%zwt0_gdc(g) > 0._r8) then + ! if (zwt_perched(c) < z(c,nlevsoi)-1.e-5_r8 .and. zwt_perched(c) < zwt(c)) then + ! zwt_actual = zwt_perched(c) + ! else + ! zwt_actual = zwt(c) + ! end if + ! finundated(c) = this%f0_gdc(g) * exp(-zwt_actual/this%zwt0_gdc(g)) + this%p3_gdc(g)*qflx_surf_lag_col(c) + ! else + ! finundated(c) = this%p3_gdc(g)*qflx_surf_lag_col(c) + ! end if + ! case ( finundation_mtd_TWS_inversion ) + ! finundated(c) = this%fws_slope_gdc(g) * tws(g) + this%fws_intercept_gdc(g) + ! end select + ! finundated(c) = min( 1.0_r8, max( 0.0_r8, finundated(c) ) ) + !end do + + ! dmleung: this loop calculates the drag partition effect (or roughness effect) of rocks. We save the drag partition factor as a patch level quantity. + z0s = 2_r8 * D_p / 30_r8 ! equation from Frank M. White (2006). Here we assume soil medium size is a global constant, and so is smooth roughness length. + do fp = 1,num_nolakep + p = filter_nolakep(fp) + g = patch%gridcell(p) + + dpfct_rock(p) = 1._r8 - ( log(this%prigent_rghn(g)*0.01_r8/z0s) / log(0.7_r8*(X/z0s)^0.8_r8) ) ! Calculating rock drag partition factor using Marticorena and Bergametti (1995). 0.01 is used to convert Z0a from centimeter to meter. + end do + + !end associate + + end subroutine CalcDragPartition + + !============================================================================== + subroutine ReadNML(this, bounds, NLFilename) + ! + ! Read the namelist data stream information. + ! + ! Uses: + use shr_nl_mod , only : shr_nl_find_group_name + use shr_log_mod , only : errMsg => shr_log_errMsg + use shr_mpi_mod , only : shr_mpi_bcast + !use ch4varcon , only : finundation_mtd_ZWT_inversion, finundation_mtd_TWS_inversion + ! + ! arguments + implicit none + class(streamcontrol_type) :: this + type(bounds_type), intent(in) :: bounds + character(len=*), intent(in) :: NLFilename ! Namelist filename + ! + ! local variables + integer :: nu_nml ! unit for namelist file + integer :: nml_error ! namelist i/o error flag + character(len=CL) :: stream_fldFileName_prigentroughness = ' ' + character(len=CL) :: stream_meshfile_prigentroughness = ' ' + character(len=CL) :: prigentroughnessmapalgo = 'bilinear' + character(len=*), parameter :: namelist_name = 'prigentroughness' ! MUST agree with group name in namelist definition to read. dmleung commented + !character(len=*), parameter :: subName = "('prigentroughness::ReadNML')" + !----------------------------------------------------------------------- + + namelist /prigentroughness/ & ! MUST agree with namelist_name above + prigentroughnessmapalgo, stream_fldFileName_prigentroughness, stream_meshfile_prigentroughness + + ! Default values for namelist + + ! Read prigentroughness namelist + if (masterproc) then + open( newunit=nu_nml, file=trim(NLFilename), status='old', iostat=nml_error ) + call shr_nl_find_group_name(nu_nml, namelist_name, status=nml_error) + if (nml_error == 0) then + read(nu_nml, nml=prigentroughness,iostat=nml_error) ! MUST agree with namelist_name above + if (nml_error /= 0) then + call endrun(msg=' ERROR reading '//namelist_name//' namelist'//errMsg(sourcefile, __LINE__)) + end if + else + call endrun(msg=' ERROR finding '//namelist_name//' namelist'//errMsg(sourcefile, __LINE__)) + end if + close(nu_nml) + endif + + call shr_mpi_bcast(prigentroughnessmapalgo , mpicom) + call shr_mpi_bcast(stream_fldFileName_prigentroughness , mpicom) + call shr_mpi_bcast(stream_meshfile_prigentroughness , mpicom) + + if (masterproc) then + write(iulog,*) ' ' + write(iulog,*) namelist_name, ' stream settings:' + write(iulog,*) ' stream_fldFileName_prigentroughness = ',stream_fldFileName_prigentroughness + write(iulog,*) ' stream_meshfile_prigentroughness = ',stream_meshfile_prigentroughness + write(iulog,*) ' prigentroughnessmapalgo = ',prigentroughnessmapalgo + endif + this%stream_fldFileName_prigentroughness = stream_fldFileName_prigentroughness + this%stream_meshfile_prigentroughness = stream_meshfile_prigentroughness + this%prigentroughnessmapalgo = prigentroughnessmapalgo + + end subroutine ReadNML + +end module PrigentRoughnessStreamType From 512c7027e86e18ee7826f0eaa9903c817d2e22ff Mon Sep 17 00:00:00 2001 From: "Danny M. Leung" Date: Tue, 31 Jan 2023 16:36:45 -0700 Subject: [PATCH 0023/1248] dmleung fixed some bugs for the streams capability and further modified clm_instMod.F90. Now CTSM can compile successfully. 31 Jan 2023 --- src/biogeochem/DUSTMod.F90 | 20 ++++++++++++++----- .../share_esmf/PrigentRoughnessStreamType.F90 | 14 +++++++------ src/main/clm_instMod.F90 | 2 +- 3 files changed, 24 insertions(+), 12 deletions(-) diff --git a/src/biogeochem/DUSTMod.F90 b/src/biogeochem/DUSTMod.F90 index 381ecfe41d..8425a413c5 100644 --- a/src/biogeochem/DUSTMod.F90 +++ b/src/biogeochem/DUSTMod.F90 @@ -34,6 +34,7 @@ module DUSTMod !use clm_instur , only : wt_lunit, wt_nat_patch ! dmleung added 24 Jul 2022 !use landunit_varcon , only : istsoil, istcrop ! dmleung added 24 Jul 2022 (refering to main/landunit_varcon.F90, for wt_lunit, istsoil=1 is nat veg, istcrop=2 is crop) use pftconMod , only : noveg ! dmleung added 24 Jul 2022 + use PrigentRoughnessStreamType , only : prigentroughnessstream_type ! ! !PUBLIC TYPES implicit none @@ -109,14 +110,19 @@ module DUSTMod !------------------------------------------------------------------------ !##### dmleung edited for initializing stream files 31 Dec 2022 ######## + !subroutine Init(this, bounds, NLFilename, num_nolakep, filter_nolakep) subroutine Init(this, bounds, NLFilename) class(dust_type) :: this - type(bounds_type), intent(in) :: bounds + type(bounds_type), intent(in) :: bounds + character(len=*), intent(in) :: NLFilename ! dmleung added 31 Dec 2022 + !integer , intent(in) :: num_nolakep ! number of column non-lake points in patch filter + !integer , intent(in) :: filter_nolakep(num_nolakep) ! patch filter for non-lake points call this%InitAllocate (bounds) call this%InitHistory (bounds) call this%prigentroughnessstream%Init( bounds, NLFilename ) ! dmleung added 31 Dec 2022 + !call this%InitCold (bounds, num_nolakep, filter_nolakep) call this%InitCold (bounds) call this%InitDustVars (bounds) @@ -309,12 +315,15 @@ subroutine InitHistory(this, bounds) end subroutine InitHistory !----------------------------------------------------------------------- - subroutine InitCold(this, bounds) !dmleung commented 31 Dec 2022 - !subroutine InitCold(this, bounds) + !subroutine InitCold(this, bounds, num_nolakep, filter_nolakep) !dmleung commented 31 Dec 2022 + subroutine InitCold(this, bounds) ! ! !ARGUMENTS: class(dust_type), intent(inout) :: this ! dmleung used class instead of type, 31 Dec 2022 - type(bounds_type), intent(in) :: bounds + type(bounds_type), intent(in) :: bounds + ! dmleung also added the below no-lake filter 31 Dec 2022 + !integer , intent(in) :: num_nolakep ! number of column non-lake points in patch filter + !integer , intent(in) :: filter_nolakep(num_nolakep) ! patch filter for non-lake points !type(dust_type), intent(inout) :: dust_inst ! ! !LOCAL VARIABLES: @@ -337,7 +346,8 @@ subroutine InitCold(this, bounds) !dmleung commented 31 Dec 2022 ! Caulculate Drag Partition factor, dmleung added 31 Dec 2022 if ( this%prigentroughnessstream%useStreams() )then !if usestreams == true, and it should be always true call this%prigentroughnessstream%CalcDragPartition( bounds, & - num_nolakep, filter_nolakep, this%dpfct_rock_patch(bounds%begp:bounds%endp) ) + ! num_nolakep, filter_nolakep, this%dpfct_rock_patch(bounds%begp:bounds%endp) ) + this%dpfct_rock_patch(bounds%begp:bounds%endp) ) else call endrun( "ERROR:: Drag partitioning MUST now use a streams file of aeolian roughness length to calculate, it can no longer read from the fsurdat file" ) diff --git a/src/cpl/share_esmf/PrigentRoughnessStreamType.F90 b/src/cpl/share_esmf/PrigentRoughnessStreamType.F90 index 7da0e7bf50..246d25aee0 100644 --- a/src/cpl/share_esmf/PrigentRoughnessStreamType.F90 +++ b/src/cpl/share_esmf/PrigentRoughnessStreamType.F90 @@ -234,7 +234,8 @@ end subroutine InitAllocate !============================================================================== !subroutine CalcFinundated(this, bounds, num_soilc, filter_soilc, soilhydrology_inst, & ! waterdiagnosticbulk_inst, qflx_surf_lag_col, finundated ) - subroutine CalcDragPartition(this, bounds, num_nolakep, filter_nolakep, dpfct_rock) + !subroutine CalcDragPartition(this, bounds, num_nolakep, filter_nolakep, dpfct_rock) + subroutine CalcDragPartition(this, bounds, dpfct_rock) ! ! !DESCRIPTION: ! Commented below by dmleung 31 Dec 2022 @@ -262,8 +263,8 @@ subroutine CalcDragPartition(this, bounds, num_nolakep, filter_nolakep, dpfct_ro type(bounds_type) , intent(in) :: bounds !integer , intent(in) :: num_soilc ! number of column soil points in column filter !integer , intent(in) :: filter_soilc(:) ! column filter for soil points - integer , intent(in) :: num_nolakep ! - integer , intent(in) :: filter_nolakep(num_nolakep) ! + !integer , intent(in) :: num_nolakep ! + !integer , intent(in) :: filter_nolakep(num_nolakep) ! !type(soilhydrology_type) , intent(in) :: soilhydrology_inst !type(waterdiagnosticbulk_type) , intent(in) :: waterdiagnosticbulk_inst !real(r8) , intent(in) :: qflx_surf_lag_col(bounds%begc:) !time-lagged surface runoff (mm H2O /s) @@ -319,11 +320,12 @@ subroutine CalcDragPartition(this, bounds, num_nolakep, filter_nolakep, dpfct_ro ! dmleung: this loop calculates the drag partition effect (or roughness effect) of rocks. We save the drag partition factor as a patch level quantity. z0s = 2_r8 * D_p / 30_r8 ! equation from Frank M. White (2006). Here we assume soil medium size is a global constant, and so is smooth roughness length. - do fp = 1,num_nolakep - p = filter_nolakep(fp) + !do fp = 1,num_nolakep + ! p = filter_nolakep(fp) + do p = bounds%begp,bounds%endp g = patch%gridcell(p) - dpfct_rock(p) = 1._r8 - ( log(this%prigent_rghn(g)*0.01_r8/z0s) / log(0.7_r8*(X/z0s)^0.8_r8) ) ! Calculating rock drag partition factor using Marticorena and Bergametti (1995). 0.01 is used to convert Z0a from centimeter to meter. + dpfct_rock(p) = 1._r8 - ( log(this%prigent_rghn(g)*0.01_r8/z0s) / log(0.7_r8*(X/z0s)**0.8_r8) ) ! Calculating rock drag partition factor using Marticorena and Bergametti (1995). 0.01 is used to convert Z0a from centimeter to meter. end do !end associate diff --git a/src/main/clm_instMod.F90 b/src/main/clm_instMod.F90 index 7924c2111e..13390d3417 100644 --- a/src/main/clm_instMod.F90 +++ b/src/main/clm_instMod.F90 @@ -340,7 +340,7 @@ subroutine clm_instInit(bounds) call surfrad_inst%Init(bounds) - call dust_inst%Init(bounds) + call dust_inst%Init(bounds, NLFilename) ! dmleung added NLFilename 31 Dec 2022 allocate(scf_method, source = CreateAndInitSnowCoverFraction( & snow_cover_fraction_method = snow_cover_fraction_method, & From 059597c896e8c2593ff1b740f32df163208bc159 Mon Sep 17 00:00:00 2001 From: "Danny M. Leung" Date: Mon, 6 Feb 2023 13:05:05 -0700 Subject: [PATCH 0024/1248] code cleanup by dmleung; 6 Feb 2023 --- bld/CLMBuildNamelist.pm | 1 + .../share_esmf/PrigentRoughnessStreamType.F90 | 88 ++----------------- 2 files changed, 10 insertions(+), 79 deletions(-) diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index d078b3869c..0a548a857f 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -4236,6 +4236,7 @@ sub write_output_files { push @groups, "ch4finundated"; push @groups, "soilbgc_decomp"; push @groups, "clm_canopy_inparm"; + push @groups, "prigentroughness"; 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/src/cpl/share_esmf/PrigentRoughnessStreamType.F90 b/src/cpl/share_esmf/PrigentRoughnessStreamType.F90 index 246d25aee0..e3f8b68014 100644 --- a/src/cpl/share_esmf/PrigentRoughnessStreamType.F90 +++ b/src/cpl/share_esmf/PrigentRoughnessStreamType.F90 @@ -4,7 +4,7 @@ module PrigentRoughnessStreamType !----------------------------------------------------------------------- ! !DESCRIPTION: - ! Contains methods for reading in the Prigent et al. (1997) roughness length streams file. dmleung 22 Nov 2022 + ! Contains methods for reading in the Prigent et al. (2005) roughness length streams file. dmleung 22 Nov 2022 ! ! !USES use ESMF @@ -15,25 +15,17 @@ module PrigentRoughnessStreamType use clm_varctl , only : iulog use abortutils , only : endrun use decompMod , only : bounds_type - !use ch4varcon , only : finundation_mtd ! dmleung commented out. need to replace anything here? ! !PUBLIC TYPES: implicit none private type, public :: prigentroughnessstream_type - ! dmleung commented the next five lines. Does it need any replacement here? real(r8), pointer, private :: prigent_rghn (:) ! Prigent et al. (1997) roughness length (m) - !real(r8), pointer, private :: zwt0_gdc (:) ! col coefficient for determining finundated (m) - !real(r8), pointer, private :: f0_gdc (:) ! col maximum inundated fraction for a gridcell (for methane code) - !real(r8), pointer, private :: p3_gdc (:) ! col coefficient for determining finundated (m) - !real(r8), pointer, private :: fws_slope_gdc (:) ! col slope in fws = slope * tws + intercept (A coefficient) - !real(r8), pointer, private :: fws_intercept_gdc (:) ! col slope in fws = slope * tws + intercept (B coefficient) contains ! !PUBLIC MEMBER FUNCTIONS: procedure, public :: Init ! Initialize and read data in - !procedure, public :: CalcFinundated ! Calculate finundated based on input streams procedure, public :: CalcDragPartition ! Calculate drag partitioning based on input streams procedure, public :: UseStreams ! If streams will be used -- dmleung set default as yes @@ -65,13 +57,11 @@ subroutine Init(this, bounds, NLFilename) ! Initialize the prigent roughness stream object ! ! Uses: - use spmdMod , only : iam !what is this and do I need this - !use ch4varcon , only : finundation_mtd_h2osfc - !use ch4varcon , only : finundation_mtd_ZWT_inversion, finundation_mtd_TWS_inversion + use spmdMod , only : iam use lnd_comp_shr , only : mesh, model_clock use dshr_strdata_mod , only : shr_strdata_init_from_inline, shr_strdata_print use dshr_strdata_mod , only : shr_strdata_advance - use dshr_methods_mod , only : dshr_fldbun_getfldptr !what is this and do I need this (read ncdata?) + use dshr_methods_mod , only : dshr_fldbun_getfldptr ! ! arguments implicit none @@ -90,7 +80,7 @@ subroutine Init(this, bounds, NLFilename) character(len=16), allocatable :: stream_varnames(:) ! array of stream field names integer :: rc ! error code real(r8), pointer :: dataptr1d(:) ! temporary pointer - !character(len=*), parameter :: stream_name = 'prigentroughness' + character(len=*), parameter :: stream_name = 'prigentroughness' !----------------------------------------------------------------------- !if ( finundation_mtd /= finundation_mtd_h2osfc )then ! how should I change this? comment out for now @@ -99,16 +89,8 @@ subroutine Init(this, bounds, NLFilename) if ( this%useStreams() )then ! is this a namelist input and is it set in namelist default - !if (finundation_mtd == finundation_mtd_ZWT_inversion )then - ! allocate(stream_varnames(3)) - ! stream_varnames = (/"ZWT0","F0 ","P3 "/) - !else if ( finundation_mtd == finundation_mtd_TWS_inversion )then - allocate(stream_varnames(1)) - stream_varnames = (/"Z0a"/) ! varname in cdf5_Z0a_Prigent-Globe-025x025-09262022.nc, in centimeter - !else - ! call endrun(msg=' ERROR do NOT know what list of variables to read for this finundation_mtd type'// & - ! errMsg(sourcefile, __LINE__)) - !end if + allocate(stream_varnames(1)) + stream_varnames = (/"Z0a"/) ! varname in cdf5_Z0a_Prigent-Globe-025x025-09262022.nc, in centimeter if (masterproc) then write(iulog,*) ' stream_varnames = ',stream_varnames @@ -157,7 +139,7 @@ subroutine Init(this, bounds, NLFilename) ! Get pointer for stream data that is time and spatially interpolate to model time and grid do n = 1,size(stream_varnames) - call dshr_fldbun_getFldPtr(sdat_rghn%pstrm(1)%fldbun_model, stream_varnames(n), fldptr1=dataptr1d, rc=rc) ! is the ncdf datasets read here, looping across all available variables in the files? Also, not sure about pstrm and fldbun_model + call dshr_fldbun_getFldPtr(sdat_rghn%pstrm(1)%fldbun_model, stream_varnames(n), fldptr1=dataptr1d, rc=rc) if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) then call ESMF_Finalize(endflag=ESMF_END_ABORT) end if @@ -204,7 +186,6 @@ subroutine InitAllocate(this, bounds) ! ! !USES: use shr_infnan_mod, only: nan => shr_infnan_nan, assignment(=) - !use ch4varcon , only: finundation_mtd_ZWT_inversion, finundation_mtd_TWS_inversion ! ! !ARGUMENTS: implicit none @@ -219,15 +200,7 @@ subroutine InitAllocate(this, bounds) !begc = bounds%begc; endc = bounds%endc begg = bounds%begg; endg = bounds%endg - !if( finundation_mtd == finundation_mtd_ZWT_inversion )then - allocate(this%prigent_rghn (begg:endg)) ; this%prigent_rghn (:) = nan - ! allocate(this%zwt0_gdc (begg:endg)) ; this%zwt0_gdc (:) = nan - ! allocate(this%f0_gdc (begg:endg)) ; this%f0_gdc (:) = nan - ! allocate(this%p3_gdc (begg:endg)) ; this%p3_gdc (:) = nan - !else if( finundation_mtd == finundation_mtd_TWS_inversion )then - ! allocate(this%fws_slope_gdc (begg:endg)) ; this%fws_slope_gdc (:) = nan - ! allocate(this%fws_intercept_gdc(begg:endg)) ; this%fws_intercept_gdc(:) = nan - !end if + allocate(this%prigent_rghn (begg:endg)) ; this%prigent_rghn (:) = nan end subroutine InitAllocate @@ -251,73 +224,31 @@ subroutine CalcDragPartition(this, bounds, dpfct_rock) ! !USES: !use ColumnType , only : col use PatchType , only : patch - !use ch4varcon , only : finundation_mtd_h2osfc, finundation_mtd_ZWT_inversion - !use ch4varcon , only : finundation_mtd_TWS_inversion - !use clm_varpar , only : nlevsoi - !use SoilHydrologyType , only : soilhydrology_type - !use WaterDiagnosticBulkType , only : waterdiagnosticbulk_type ! ! !ARGUMENTS: implicit none class(prigentroughnessstream_type) :: this type(bounds_type) , intent(in) :: bounds - !integer , intent(in) :: num_soilc ! number of column soil points in column filter - !integer , intent(in) :: filter_soilc(:) ! column filter for soil points !integer , intent(in) :: num_nolakep ! !integer , intent(in) :: filter_nolakep(num_nolakep) ! - !type(soilhydrology_type) , intent(in) :: soilhydrology_inst - !type(waterdiagnosticbulk_type) , intent(in) :: waterdiagnosticbulk_inst - !real(r8) , intent(in) :: qflx_surf_lag_col(bounds%begc:) !time-lagged surface runoff (mm H2O /s) - !real(r8) , intent(inout) :: finundated(bounds%begc:) ! fractional inundated area in soil column (excluding dedicated wetland columns) real(r8) , intent(inout) :: dpfct_rock(bounds%begp:) ! [fraction] rock drag partition factor (roughness effect) ! ! !LOCAL VARIABLES: !integer :: g, c, fc ! Indices integer :: g, p, fp ! Indices real(r8) :: z0s ! smooth roughness length (m) - !real(r8) :: zwt_actual ! Total water storage (ZWT) to use either perched or total depending on conditions ! constants real(r8), parameter :: D_p = 130e-6_r8 ! [m] Medium soil particle diameter, assuming a global constant of ~130 um following Leung et al. (2022) real(r8), parameter :: X = 10_r8 ! [m] distance downwind of the roughness element (rock). Assume estimating roughness effect at a distance of 10 m following Leung et al. (2022) !--------------------------------------------------------------------- - !SHR_ASSERT_ALL_FL((ubound(qflx_surf_lag_col) == (/bounds%endc/)), sourcefile, __LINE__) ! not sure what this is - !SHR_ASSERT_ALL_FL((ubound(finundated) == (/bounds%endc/)), sourcefile, __LINE__) SHR_ASSERT_ALL_FL((ubound(dpfct_rock) == (/bounds%endp/)), sourcefile, __LINE__) !what's the use of this !associate( & !z => col%z & ! Input: [real(r8) (:,:) ] layer depth (m) (-nlevsno+1:nlevsoi) - !zwt => soilhydrology_inst%zwt_col , & ! Input: [real(r8) (:) ] water table depth (m) - !zwt_perched => soilhydrology_inst%zwt_perched_col , & ! Input: [real(r8) (:) ] perched water table depth (m) - !tws => waterdiagnosticbulk_inst%tws_grc , & ! Input: [real(r8) (:) ] total water storage (kg m-2) - !frac_h2osfc => waterdiagnosticbulk_inst%frac_h2osfc_col & ! Input: [real(r8) (:) ] fraction of ground covered by surface water (0 to 1) !) - ! Calculate finundated - !do fc = 1, num_soilc - ! c = filter_soilc(fc) - ! g = col%gridcell(c) - ! select case( finundation_mtd ) - ! case ( finundation_mtd_h2osfc ) - ! finundated(c) = frac_h2osfc(c) - ! case ( finundation_mtd_ZWT_inversion ) - ! if (this%zwt0_gdc(g) > 0._r8) then - ! if (zwt_perched(c) < z(c,nlevsoi)-1.e-5_r8 .and. zwt_perched(c) < zwt(c)) then - ! zwt_actual = zwt_perched(c) - ! else - ! zwt_actual = zwt(c) - ! end if - ! finundated(c) = this%f0_gdc(g) * exp(-zwt_actual/this%zwt0_gdc(g)) + this%p3_gdc(g)*qflx_surf_lag_col(c) - ! else - ! finundated(c) = this%p3_gdc(g)*qflx_surf_lag_col(c) - ! end if - ! case ( finundation_mtd_TWS_inversion ) - ! finundated(c) = this%fws_slope_gdc(g) * tws(g) + this%fws_intercept_gdc(g) - ! end select - ! finundated(c) = min( 1.0_r8, max( 0.0_r8, finundated(c) ) ) - !end do - ! dmleung: this loop calculates the drag partition effect (or roughness effect) of rocks. We save the drag partition factor as a patch level quantity. z0s = 2_r8 * D_p / 30_r8 ! equation from Frank M. White (2006). Here we assume soil medium size is a global constant, and so is smooth roughness length. !do fp = 1,num_nolakep @@ -341,7 +272,6 @@ subroutine ReadNML(this, bounds, NLFilename) use shr_nl_mod , only : shr_nl_find_group_name use shr_log_mod , only : errMsg => shr_log_errMsg use shr_mpi_mod , only : shr_mpi_bcast - !use ch4varcon , only : finundation_mtd_ZWT_inversion, finundation_mtd_TWS_inversion ! ! arguments implicit none @@ -356,7 +286,7 @@ subroutine ReadNML(this, bounds, NLFilename) character(len=CL) :: stream_meshfile_prigentroughness = ' ' character(len=CL) :: prigentroughnessmapalgo = 'bilinear' character(len=*), parameter :: namelist_name = 'prigentroughness' ! MUST agree with group name in namelist definition to read. dmleung commented - !character(len=*), parameter :: subName = "('prigentroughness::ReadNML')" + character(len=*), parameter :: subName = "('prigentroughness::ReadNML')" !----------------------------------------------------------------------- namelist /prigentroughness/ & ! MUST agree with namelist_name above From 436329500392af185d640b1200e4a72c46200141 Mon Sep 17 00:00:00 2001 From: cathyxinchangli <55264121+cathyxinchangli@users.noreply.github.com> Date: Wed, 8 Feb 2023 12:43:44 -0600 Subject: [PATCH 0025/1248] [dev.03] Fix interior building temperature update 1. changed how interior building temperature is updated based on proposed scheme, by adding back the heat not removed by AC; 2. added an intermediate local variable `efllx_urban_ac_sat`; 3. `t_building_max` now indicates the saturation setpoints. --- src/biogeophys/UrbBuildTempOleson2015Mod.F90 | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/biogeophys/UrbBuildTempOleson2015Mod.F90 b/src/biogeophys/UrbBuildTempOleson2015Mod.F90 index d54d3ff86d..024922348a 100644 --- a/src/biogeophys/UrbBuildTempOleson2015Mod.F90 +++ b/src/biogeophys/UrbBuildTempOleson2015Mod.F90 @@ -236,6 +236,8 @@ subroutine BuildingTemperature (bounds, num_urbanl, filter_urbanl, num_nolakec, real(r8) :: t_floor_bef(bounds%begl:bounds%endl) ! floor temperature at previous time step (K) real(r8) :: t_building_bef(bounds%begl:bounds%endl) ! internal building air temperature at previous time step [K] real(r8) :: t_building_bef_hac(bounds%begl:bounds%endl)! internal building air temperature before applying HAC [K] + ! Cathy [dev.03] + real(r8) :: eflx_urban_ac_sat(bounds%begl:bounds%endl) ! urban air conditioning flux under AC adoption saturation (W/m**2) real(r8) :: hcv_roofi(bounds%begl:bounds%endl) ! roof convective heat transfer coefficient (W m-2 K-1) real(r8) :: hcv_sunwi(bounds%begl:bounds%endl) ! sunwall convective heat transfer coefficient (W m-2 K-1) real(r8) :: hcv_shdwi(bounds%begl:bounds%endl) ! shadewall convective heat transfer coefficient (W m-2 K-1) @@ -925,13 +927,17 @@ subroutine BuildingTemperature (bounds, num_urbanl, filter_urbanl, num_nolakec, ! rho_dair(l) = pstd / (rair*t_building(l)) if (t_building_bef_hac(l) > t_building_max(l)) then - t_building(l) = t_building_max(l) - ! [Cathy] orig: + ! Cathy [orig] + ! t_building(l) = t_building_max(l) ! eflx_urban_ac(l) = wtlunit_roof(l) * abs( (ht_roof(l) * rho_dair(l) * cpair / dtime) * t_building(l) & ! - (ht_roof(l) * rho_dair(l) * cpair / dtime) * t_building_bef_hac(l) ) - ! [Cathy] dev: - eflx_urban_ac(l) = wtlunit_roof(l) * p_ac(l) * abs( (ht_roof(l) * rho_dair(l) * cpair / dtime) * t_building(l) & - - (ht_roof(l) * rho_dair(l) * cpair / dtime) * t_building_bef_hac(l) ) + ! Cathy [dev.03] ! after the change, t_building_max is saturation setpoint + eflx_urban_ac_sat(l) = wtlunit_roof(l) * abs( (ht_roof(l) * rho_dair(l) * cpair / dtime) * t_building_max(l) & + - (ht_roof(l) * rho_dair(l) * cpair / dtime) * t_building_bef_hac(l) ) + t_building(l) = t_building_max(l) + ( 1._r8 - p_ac(l) ) * eflx_urbann_ac_sat(l) & + * dtime / (ht_roof(l) * rho_dair(l) * cpair) + eflx_urban_ac(l) = p_ac(l) * eflx_urban_ac_sat(l) + else if (t_building_bef_hac(l) < t_building_min(l)) then t_building(l) = t_building_min(l) eflx_urban_heat(l) = wtlunit_roof(l) * abs( (ht_roof(l) * rho_dair(l) * cpair / dtime) * t_building(l) & From ab0f8e15a64b8391a49b02d9a1f789a3cbbeaa4b Mon Sep 17 00:00:00 2001 From: cathyxinchangli <55264121+cathyxinchangli@users.noreply.github.com> Date: Wed, 8 Feb 2023 16:47:07 -0600 Subject: [PATCH 0026/1248] [dev03] Fix typo --- src/biogeophys/UrbBuildTempOleson2015Mod.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/biogeophys/UrbBuildTempOleson2015Mod.F90 b/src/biogeophys/UrbBuildTempOleson2015Mod.F90 index 024922348a..e5626cb65c 100644 --- a/src/biogeophys/UrbBuildTempOleson2015Mod.F90 +++ b/src/biogeophys/UrbBuildTempOleson2015Mod.F90 @@ -934,7 +934,7 @@ subroutine BuildingTemperature (bounds, num_urbanl, filter_urbanl, num_nolakec, ! Cathy [dev.03] ! after the change, t_building_max is saturation setpoint eflx_urban_ac_sat(l) = wtlunit_roof(l) * abs( (ht_roof(l) * rho_dair(l) * cpair / dtime) * t_building_max(l) & - (ht_roof(l) * rho_dair(l) * cpair / dtime) * t_building_bef_hac(l) ) - t_building(l) = t_building_max(l) + ( 1._r8 - p_ac(l) ) * eflx_urbann_ac_sat(l) & + t_building(l) = t_building_max(l) + ( 1._r8 - p_ac(l) ) * eflx_urban_ac_sat(l) & * dtime / (ht_roof(l) * rho_dair(l) * cpair) eflx_urban_ac(l) = p_ac(l) * eflx_urban_ac_sat(l) From aa68753b6a7339808350ba8c23b83e6d494131ac Mon Sep 17 00:00:00 2001 From: cathyxinchangli <55264121+cathyxinchangli@users.noreply.github.com> Date: Wed, 22 Feb 2023 23:56:54 -0600 Subject: [PATCH 0027/1248] [dev.03] Remove write statements Remove 8 write to log statements (added in as part of dev.02 for debugging) to fix the timing issues --- src/cpl/share_esmf/UrbanTimeVarType.F90 | 32 ++----------------------- 1 file changed, 2 insertions(+), 30 deletions(-) diff --git a/src/cpl/share_esmf/UrbanTimeVarType.F90 b/src/cpl/share_esmf/UrbanTimeVarType.F90 index 1f679b88a3..ae34449c1e 100644 --- a/src/cpl/share_esmf/UrbanTimeVarType.F90 +++ b/src/cpl/share_esmf/UrbanTimeVarType.F90 @@ -72,10 +72,6 @@ subroutine Init(this, bounds, NLFilename) allocate(this%p_ac(begl:endl)); this%p_ac(:) = nan call this%urbantv_init(bounds, NLFilename) - - ! Cathy [dev.02] - write(iulog,*) 'Cathy: urbantv_init done.' - call this%urbantv_interp(bounds) ! Add history fields ! Cathy: this adds an output field. the subroutine is in scr/main/histFileMod.F90 @@ -190,14 +186,8 @@ subroutine urbantv_init(this, bounds, NLFilename) do n = 1,6 write(iulog,'(a,a)' ) ' stream_varname = ',trim(stream_varnames(n)) end do - ! Cathy [orig] - ! write(iulog,*) ' ' - ! Cathy [dev.02] - write(iulog,*) 'Cathy: does write statements have to be inside if?' + write(iulog,*) ' ' endif - - ! Cathy [dev.02] - write(iulog,*) 'Cathy: before shr_strdata_init_from_inline' ! Initialize the cdeps data type this%sdat_urbantv call shr_strdata_init_from_inline(this%sdat_urbantv, & @@ -226,9 +216,6 @@ subroutine urbantv_init(this, bounds, NLFilename) stream_name = 'Urban time varying data', & rc = rc) - ! Cathy [dev.02] - write(iulog,*) 'Cathy: before shr_strdata_init_from_inline' - if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) then call ESMF_Finalize(endflag=ESMF_END_ABORT) end if @@ -267,23 +254,14 @@ subroutine urbantv_interp(this, bounds) real(r8), pointer :: dataptr2d(:,:) !----------------------------------------------------------------------- - ! Cathy [dev.02] - write(iulog,*) 'Cathy: before get_curr_date' - ! Advance sdat stream call get_curr_date(year, mon, day, sec) mcdate = year*10000 + mon*100 + day - ! Cathy [dev.02] - write(iulog,*) 'Cathy: after get_curr_date, before shr_strdata_advance' - call shr_strdata_advance(this%sdat_urbantv, ymd=mcdate, tod=sec, logunit=iulog, istr='hdmdyn', rc=rc) if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) then call ESMF_Finalize(endflag=ESMF_END_ABORT) - end if - - ! Cathy [dev.02] - write(iulog,*) 'Cathy: before creating 2d array' + end if ! Create 2d array for all stream variable data lsize = bounds%endg - bounds%begg + 1 @@ -305,9 +283,6 @@ subroutine urbantv_interp(this, bounds) end do end do - ! Cathy [dev.02] - write(iulog,*) 'Cathy: after creating 2d array, before determining t_building_max and p_ac for all landunits' - ! Determine this%tbuilding_max for all landunits do l = bounds%begl,bounds%endl if (lun%urbpoi(l)) then @@ -338,9 +313,6 @@ subroutine urbantv_interp(this, bounds) end do deallocate(dataptr2d) - ! Cathy [dev.02] - write(iulog,*) 'Cathy: after determining t_building_max and p_ac for all landunits' - ! Error check found = .false. do l = bounds%begl,bounds%endl From cc7696eb8c6f4fca96020e0679df0fc9c486d5eb Mon Sep 17 00:00:00 2001 From: "Danny M. Leung" Date: Sat, 25 Feb 2023 21:47:12 -0700 Subject: [PATCH 0028/1248] dmleung added a nolake filter in calculating the drag partition effect (25 Feb 2023). --- src/biogeochem/DUSTMod.F90 | 10 +- .../share_esmf/PrigentRoughnessStreamType.F90 | 97 ++++++++++++++++--- 2 files changed, 93 insertions(+), 14 deletions(-) diff --git a/src/biogeochem/DUSTMod.F90 b/src/biogeochem/DUSTMod.F90 index 8425a413c5..8488fdf682 100644 --- a/src/biogeochem/DUSTMod.F90 +++ b/src/biogeochem/DUSTMod.F90 @@ -123,7 +123,7 @@ subroutine Init(this, bounds, NLFilename) call this%InitHistory (bounds) call this%prigentroughnessstream%Init( bounds, NLFilename ) ! dmleung added 31 Dec 2022 !call this%InitCold (bounds, num_nolakep, filter_nolakep) - call this%InitCold (bounds) + call this%InitCold (bounds) ! dmleung commented 31 Dec 2022 call this%InitDustVars (bounds) end subroutine Init @@ -309,7 +309,7 @@ subroutine InitHistory(this, bounds) this%dpfct_rock_patch(begp:endp) = spval call hist_addfld1d (fname='DPFCT_ROCK', units='m/s', & avgflag='A', long_name='rock drag partition factor', & - ptr_patch=this%dpfct_rock_patch, set_lake=0._r8, set_urb=0._r8) + ptr_patch=this%dpfct_rock_patch) !########################################################################## end subroutine InitHistory @@ -317,6 +317,10 @@ end subroutine InitHistory !----------------------------------------------------------------------- !subroutine InitCold(this, bounds, num_nolakep, filter_nolakep) !dmleung commented 31 Dec 2022 subroutine InitCold(this, bounds) + ! + !USES dmleung added 31 Dec 2022 + !use landunit_varcon , only : istdlak + !use LandunitType , only : lun ! ! !ARGUMENTS: class(dust_type), intent(inout) :: this ! dmleung used class instead of type, 31 Dec 2022 @@ -346,7 +350,7 @@ subroutine InitCold(this, bounds) ! Caulculate Drag Partition factor, dmleung added 31 Dec 2022 if ( this%prigentroughnessstream%useStreams() )then !if usestreams == true, and it should be always true call this%prigentroughnessstream%CalcDragPartition( bounds, & - ! num_nolakep, filter_nolakep, this%dpfct_rock_patch(bounds%begp:bounds%endp) ) + ! num_nolakep, filter_nolakep, this%dpfct_rock_patch(bounds%begp:bounds%endp) ) this%dpfct_rock_patch(bounds%begp:bounds%endp) ) else diff --git a/src/cpl/share_esmf/PrigentRoughnessStreamType.F90 b/src/cpl/share_esmf/PrigentRoughnessStreamType.F90 index e3f8b68014..ad8843b706 100644 --- a/src/cpl/share_esmf/PrigentRoughnessStreamType.F90 +++ b/src/cpl/share_esmf/PrigentRoughnessStreamType.F90 @@ -4,7 +4,7 @@ module PrigentRoughnessStreamType !----------------------------------------------------------------------- ! !DESCRIPTION: - ! Contains methods for reading in the Prigent et al. (2005) roughness length streams file. dmleung 22 Nov 2022 + ! Contains methods for reading in the Prigent et al. (1997) roughness length streams file. dmleung 22 Nov 2022 ! ! !USES use ESMF @@ -15,17 +15,25 @@ module PrigentRoughnessStreamType use clm_varctl , only : iulog use abortutils , only : endrun use decompMod , only : bounds_type + !use ch4varcon , only : finundation_mtd ! dmleung commented out. need to replace anything here? ! !PUBLIC TYPES: implicit none private type, public :: prigentroughnessstream_type + ! dmleung commented the next five lines. Does it need any replacement here? real(r8), pointer, private :: prigent_rghn (:) ! Prigent et al. (1997) roughness length (m) + !real(r8), pointer, private :: zwt0_gdc (:) ! col coefficient for determining finundated (m) + !real(r8), pointer, private :: f0_gdc (:) ! col maximum inundated fraction for a gridcell (for methane code) + !real(r8), pointer, private :: p3_gdc (:) ! col coefficient for determining finundated (m) + !real(r8), pointer, private :: fws_slope_gdc (:) ! col slope in fws = slope * tws + intercept (A coefficient) + !real(r8), pointer, private :: fws_intercept_gdc (:) ! col slope in fws = slope * tws + intercept (B coefficient) contains ! !PUBLIC MEMBER FUNCTIONS: procedure, public :: Init ! Initialize and read data in + !procedure, public :: CalcFinundated ! Calculate finundated based on input streams procedure, public :: CalcDragPartition ! Calculate drag partitioning based on input streams procedure, public :: UseStreams ! If streams will be used -- dmleung set default as yes @@ -57,11 +65,13 @@ subroutine Init(this, bounds, NLFilename) ! Initialize the prigent roughness stream object ! ! Uses: - use spmdMod , only : iam + use spmdMod , only : iam !what is this and do I need this + !use ch4varcon , only : finundation_mtd_h2osfc + !use ch4varcon , only : finundation_mtd_ZWT_inversion, finundation_mtd_TWS_inversion use lnd_comp_shr , only : mesh, model_clock use dshr_strdata_mod , only : shr_strdata_init_from_inline, shr_strdata_print use dshr_strdata_mod , only : shr_strdata_advance - use dshr_methods_mod , only : dshr_fldbun_getfldptr + use dshr_methods_mod , only : dshr_fldbun_getfldptr !what is this and do I need this (read ncdata?) ! ! arguments implicit none @@ -89,8 +99,16 @@ subroutine Init(this, bounds, NLFilename) if ( this%useStreams() )then ! is this a namelist input and is it set in namelist default - allocate(stream_varnames(1)) - stream_varnames = (/"Z0a"/) ! varname in cdf5_Z0a_Prigent-Globe-025x025-09262022.nc, in centimeter + !if (finundation_mtd == finundation_mtd_ZWT_inversion )then + ! allocate(stream_varnames(3)) + ! stream_varnames = (/"ZWT0","F0 ","P3 "/) + !else if ( finundation_mtd == finundation_mtd_TWS_inversion )then + allocate(stream_varnames(1)) + stream_varnames = (/"Z0a"/) ! varname in cdf5_Z0a_Prigent-Globe-025x025-09262022.nc, in centimeter + !else + ! call endrun(msg=' ERROR do NOT know what list of variables to read for this finundation_mtd type'// & + ! errMsg(sourcefile, __LINE__)) + !end if if (masterproc) then write(iulog,*) ' stream_varnames = ',stream_varnames @@ -139,7 +157,7 @@ subroutine Init(this, bounds, NLFilename) ! Get pointer for stream data that is time and spatially interpolate to model time and grid do n = 1,size(stream_varnames) - call dshr_fldbun_getFldPtr(sdat_rghn%pstrm(1)%fldbun_model, stream_varnames(n), fldptr1=dataptr1d, rc=rc) + call dshr_fldbun_getFldPtr(sdat_rghn%pstrm(1)%fldbun_model, stream_varnames(n), fldptr1=dataptr1d, rc=rc) ! is the ncdf datasets read here, looping across all available variables in the files? Also, not sure about pstrm and fldbun_model if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) then call ESMF_Finalize(endflag=ESMF_END_ABORT) end if @@ -186,6 +204,7 @@ subroutine InitAllocate(this, bounds) ! ! !USES: use shr_infnan_mod, only: nan => shr_infnan_nan, assignment(=) + !use ch4varcon , only: finundation_mtd_ZWT_inversion, finundation_mtd_TWS_inversion ! ! !ARGUMENTS: implicit none @@ -200,7 +219,15 @@ subroutine InitAllocate(this, bounds) !begc = bounds%begc; endc = bounds%endc begg = bounds%begg; endg = bounds%endg - allocate(this%prigent_rghn (begg:endg)) ; this%prigent_rghn (:) = nan + !if( finundation_mtd == finundation_mtd_ZWT_inversion )then + allocate(this%prigent_rghn (begg:endg)) ; this%prigent_rghn (:) = nan + ! allocate(this%zwt0_gdc (begg:endg)) ; this%zwt0_gdc (:) = nan + ! allocate(this%f0_gdc (begg:endg)) ; this%f0_gdc (:) = nan + ! allocate(this%p3_gdc (begg:endg)) ; this%p3_gdc (:) = nan + !else if( finundation_mtd == finundation_mtd_TWS_inversion )then + ! allocate(this%fws_slope_gdc (begg:endg)) ; this%fws_slope_gdc (:) = nan + ! allocate(this%fws_intercept_gdc(begg:endg)) ; this%fws_intercept_gdc(:) = nan + !end if end subroutine InitAllocate @@ -224,39 +251,86 @@ subroutine CalcDragPartition(this, bounds, dpfct_rock) ! !USES: !use ColumnType , only : col use PatchType , only : patch + !USES dmleung added 31 Dec 2022 + use landunit_varcon , only : istdlak + use LandunitType , only : lun + !use ch4varcon , only : finundation_mtd_h2osfc, finundation_mtd_ZWT_inversion + !use ch4varcon , only : finundation_mtd_TWS_inversion + !use clm_varpar , only : nlevsoi + !use SoilHydrologyType , only : soilhydrology_type + !use WaterDiagnosticBulkType , only : waterdiagnosticbulk_type ! ! !ARGUMENTS: implicit none class(prigentroughnessstream_type) :: this type(bounds_type) , intent(in) :: bounds + !integer , intent(in) :: num_soilc ! number of column soil points in column filter + !integer , intent(in) :: filter_soilc(:) ! column filter for soil points !integer , intent(in) :: num_nolakep ! !integer , intent(in) :: filter_nolakep(num_nolakep) ! + !type(soilhydrology_type) , intent(in) :: soilhydrology_inst + !type(waterdiagnosticbulk_type) , intent(in) :: waterdiagnosticbulk_inst + !real(r8) , intent(in) :: qflx_surf_lag_col(bounds%begc:) !time-lagged surface runoff (mm H2O /s) + !real(r8) , intent(inout) :: finundated(bounds%begc:) ! fractional inundated area in soil column (excluding dedicated wetland columns) real(r8) , intent(inout) :: dpfct_rock(bounds%begp:) ! [fraction] rock drag partition factor (roughness effect) ! ! !LOCAL VARIABLES: !integer :: g, c, fc ! Indices - integer :: g, p, fp ! Indices + integer :: g, p, fp, l ! Indices real(r8) :: z0s ! smooth roughness length (m) + !real(r8) :: zwt_actual ! Total water storage (ZWT) to use either perched or total depending on conditions ! constants real(r8), parameter :: D_p = 130e-6_r8 ! [m] Medium soil particle diameter, assuming a global constant of ~130 um following Leung et al. (2022) real(r8), parameter :: X = 10_r8 ! [m] distance downwind of the roughness element (rock). Assume estimating roughness effect at a distance of 10 m following Leung et al. (2022) !--------------------------------------------------------------------- + !SHR_ASSERT_ALL_FL((ubound(qflx_surf_lag_col) == (/bounds%endc/)), sourcefile, __LINE__) ! not sure what this is + !SHR_ASSERT_ALL_FL((ubound(finundated) == (/bounds%endc/)), sourcefile, __LINE__) SHR_ASSERT_ALL_FL((ubound(dpfct_rock) == (/bounds%endp/)), sourcefile, __LINE__) !what's the use of this !associate( & !z => col%z & ! Input: [real(r8) (:,:) ] layer depth (m) (-nlevsno+1:nlevsoi) + !zwt => soilhydrology_inst%zwt_col , & ! Input: [real(r8) (:) ] water table depth (m) + !zwt_perched => soilhydrology_inst%zwt_perched_col , & ! Input: [real(r8) (:) ] perched water table depth (m) + !tws => waterdiagnosticbulk_inst%tws_grc , & ! Input: [real(r8) (:) ] total water storage (kg m-2) + !frac_h2osfc => waterdiagnosticbulk_inst%frac_h2osfc_col & ! Input: [real(r8) (:) ] fraction of ground covered by surface water (0 to 1) !) + ! Calculate finundated + !do fc = 1, num_soilc + ! c = filter_soilc(fc) + ! g = col%gridcell(c) + ! select case( finundation_mtd ) + ! case ( finundation_mtd_h2osfc ) + ! finundated(c) = frac_h2osfc(c) + ! case ( finundation_mtd_ZWT_inversion ) + ! if (this%zwt0_gdc(g) > 0._r8) then + ! if (zwt_perched(c) < z(c,nlevsoi)-1.e-5_r8 .and. zwt_perched(c) < zwt(c)) then + ! zwt_actual = zwt_perched(c) + ! else + ! zwt_actual = zwt(c) + ! end if + ! finundated(c) = this%f0_gdc(g) * exp(-zwt_actual/this%zwt0_gdc(g)) + this%p3_gdc(g)*qflx_surf_lag_col(c) + ! else + ! finundated(c) = this%p3_gdc(g)*qflx_surf_lag_col(c) + ! end if + ! case ( finundation_mtd_TWS_inversion ) + ! finundated(c) = this%fws_slope_gdc(g) * tws(g) + this%fws_intercept_gdc(g) + ! end select + ! finundated(c) = min( 1.0_r8, max( 0.0_r8, finundated(c) ) ) + !end do + ! dmleung: this loop calculates the drag partition effect (or roughness effect) of rocks. We save the drag partition factor as a patch level quantity. z0s = 2_r8 * D_p / 30_r8 ! equation from Frank M. White (2006). Here we assume soil medium size is a global constant, and so is smooth roughness length. !do fp = 1,num_nolakep - ! p = filter_nolakep(fp) + !p = filter_nolakep(fp) do p = bounds%begp,bounds%endp g = patch%gridcell(p) - - dpfct_rock(p) = 1._r8 - ( log(this%prigent_rghn(g)*0.01_r8/z0s) / log(0.7_r8*(X/z0s)**0.8_r8) ) ! Calculating rock drag partition factor using Marticorena and Bergametti (1995). 0.01 is used to convert Z0a from centimeter to meter. + l = patch%landunit(p) + if (lun%itype(l) /= istdlak) then + dpfct_rock(p) = 1._r8 - ( log(this%prigent_rghn(g)*0.01_r8/z0s) / log(0.7_r8*(X/z0s)**0.8_r8) ) ! Calculating rock drag partition factor using Marticorena and Bergametti (1995). 0.01 is used to convert Z0a from centimeter to meter. + end if end do !end associate @@ -272,6 +346,7 @@ subroutine ReadNML(this, bounds, NLFilename) use shr_nl_mod , only : shr_nl_find_group_name use shr_log_mod , only : errMsg => shr_log_errMsg use shr_mpi_mod , only : shr_mpi_bcast + !use ch4varcon , only : finundation_mtd_ZWT_inversion, finundation_mtd_TWS_inversion ! ! arguments implicit none From 53ea16556f8de0c99e2bd1e9573a104ccc3c0ce0 Mon Sep 17 00:00:00 2001 From: "Danny M. Leung" Date: Sat, 25 Feb 2023 22:10:07 -0700 Subject: [PATCH 0029/1248] code cleanup by dmleung 25 Feb 2023 --- .../share_esmf/PrigentRoughnessStreamType.F90 | 85 ++----------------- 1 file changed, 7 insertions(+), 78 deletions(-) diff --git a/src/cpl/share_esmf/PrigentRoughnessStreamType.F90 b/src/cpl/share_esmf/PrigentRoughnessStreamType.F90 index ad8843b706..19ab3cb573 100644 --- a/src/cpl/share_esmf/PrigentRoughnessStreamType.F90 +++ b/src/cpl/share_esmf/PrigentRoughnessStreamType.F90 @@ -15,25 +15,17 @@ module PrigentRoughnessStreamType use clm_varctl , only : iulog use abortutils , only : endrun use decompMod , only : bounds_type - !use ch4varcon , only : finundation_mtd ! dmleung commented out. need to replace anything here? ! !PUBLIC TYPES: implicit none private type, public :: prigentroughnessstream_type - ! dmleung commented the next five lines. Does it need any replacement here? real(r8), pointer, private :: prigent_rghn (:) ! Prigent et al. (1997) roughness length (m) - !real(r8), pointer, private :: zwt0_gdc (:) ! col coefficient for determining finundated (m) - !real(r8), pointer, private :: f0_gdc (:) ! col maximum inundated fraction for a gridcell (for methane code) - !real(r8), pointer, private :: p3_gdc (:) ! col coefficient for determining finundated (m) - !real(r8), pointer, private :: fws_slope_gdc (:) ! col slope in fws = slope * tws + intercept (A coefficient) - !real(r8), pointer, private :: fws_intercept_gdc (:) ! col slope in fws = slope * tws + intercept (B coefficient) contains ! !PUBLIC MEMBER FUNCTIONS: procedure, public :: Init ! Initialize and read data in - !procedure, public :: CalcFinundated ! Calculate finundated based on input streams procedure, public :: CalcDragPartition ! Calculate drag partitioning based on input streams procedure, public :: UseStreams ! If streams will be used -- dmleung set default as yes @@ -65,13 +57,11 @@ subroutine Init(this, bounds, NLFilename) ! Initialize the prigent roughness stream object ! ! Uses: - use spmdMod , only : iam !what is this and do I need this - !use ch4varcon , only : finundation_mtd_h2osfc - !use ch4varcon , only : finundation_mtd_ZWT_inversion, finundation_mtd_TWS_inversion + use spmdMod , only : iam use lnd_comp_shr , only : mesh, model_clock use dshr_strdata_mod , only : shr_strdata_init_from_inline, shr_strdata_print use dshr_strdata_mod , only : shr_strdata_advance - use dshr_methods_mod , only : dshr_fldbun_getfldptr !what is this and do I need this (read ncdata?) + use dshr_methods_mod , only : dshr_fldbun_getfldptr ! ! arguments implicit none @@ -99,23 +89,15 @@ subroutine Init(this, bounds, NLFilename) if ( this%useStreams() )then ! is this a namelist input and is it set in namelist default - !if (finundation_mtd == finundation_mtd_ZWT_inversion )then - ! allocate(stream_varnames(3)) - ! stream_varnames = (/"ZWT0","F0 ","P3 "/) - !else if ( finundation_mtd == finundation_mtd_TWS_inversion )then allocate(stream_varnames(1)) stream_varnames = (/"Z0a"/) ! varname in cdf5_Z0a_Prigent-Globe-025x025-09262022.nc, in centimeter - !else - ! call endrun(msg=' ERROR do NOT know what list of variables to read for this finundation_mtd type'// & - ! errMsg(sourcefile, __LINE__)) - !end if if (masterproc) then write(iulog,*) ' stream_varnames = ',stream_varnames - end if + end if - ! Initialize the cdeps data type sdat_rghn - call shr_strdata_init_from_inline(sdat_rghn, & ! what is this function and where does it come from? + ! Initialize the cdeps data type sdat_rghn + call shr_strdata_init_from_inline(sdat_rghn, & ! what is this function and where does it come from? my_task = iam, & logunit = iulog, & compname = 'LND', & @@ -157,7 +139,7 @@ subroutine Init(this, bounds, NLFilename) ! Get pointer for stream data that is time and spatially interpolate to model time and grid do n = 1,size(stream_varnames) - call dshr_fldbun_getFldPtr(sdat_rghn%pstrm(1)%fldbun_model, stream_varnames(n), fldptr1=dataptr1d, rc=rc) ! is the ncdf datasets read here, looping across all available variables in the files? Also, not sure about pstrm and fldbun_model + call dshr_fldbun_getFldPtr(sdat_rghn%pstrm(1)%fldbun_model, stream_varnames(n), fldptr1=dataptr1d, rc=rc) if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) then call ESMF_Finalize(endflag=ESMF_END_ABORT) end if @@ -204,7 +186,6 @@ subroutine InitAllocate(this, bounds) ! ! !USES: use shr_infnan_mod, only: nan => shr_infnan_nan, assignment(=) - !use ch4varcon , only: finundation_mtd_ZWT_inversion, finundation_mtd_TWS_inversion ! ! !ARGUMENTS: implicit none @@ -219,15 +200,7 @@ subroutine InitAllocate(this, bounds) !begc = bounds%begc; endc = bounds%endc begg = bounds%begg; endg = bounds%endg - !if( finundation_mtd == finundation_mtd_ZWT_inversion )then - allocate(this%prigent_rghn (begg:endg)) ; this%prigent_rghn (:) = nan - ! allocate(this%zwt0_gdc (begg:endg)) ; this%zwt0_gdc (:) = nan - ! allocate(this%f0_gdc (begg:endg)) ; this%f0_gdc (:) = nan - ! allocate(this%p3_gdc (begg:endg)) ; this%p3_gdc (:) = nan - !else if( finundation_mtd == finundation_mtd_TWS_inversion )then - ! allocate(this%fws_slope_gdc (begg:endg)) ; this%fws_slope_gdc (:) = nan - ! allocate(this%fws_intercept_gdc(begg:endg)) ; this%fws_intercept_gdc(:) = nan - !end if + allocate(this%prigent_rghn (begg:endg)) ; this%prigent_rghn (:) = nan end subroutine InitAllocate @@ -254,72 +227,29 @@ subroutine CalcDragPartition(this, bounds, dpfct_rock) !USES dmleung added 31 Dec 2022 use landunit_varcon , only : istdlak use LandunitType , only : lun - !use ch4varcon , only : finundation_mtd_h2osfc, finundation_mtd_ZWT_inversion - !use ch4varcon , only : finundation_mtd_TWS_inversion - !use clm_varpar , only : nlevsoi - !use SoilHydrologyType , only : soilhydrology_type - !use WaterDiagnosticBulkType , only : waterdiagnosticbulk_type ! ! !ARGUMENTS: implicit none class(prigentroughnessstream_type) :: this type(bounds_type) , intent(in) :: bounds - !integer , intent(in) :: num_soilc ! number of column soil points in column filter - !integer , intent(in) :: filter_soilc(:) ! column filter for soil points - !integer , intent(in) :: num_nolakep ! - !integer , intent(in) :: filter_nolakep(num_nolakep) ! - !type(soilhydrology_type) , intent(in) :: soilhydrology_inst - !type(waterdiagnosticbulk_type) , intent(in) :: waterdiagnosticbulk_inst - !real(r8) , intent(in) :: qflx_surf_lag_col(bounds%begc:) !time-lagged surface runoff (mm H2O /s) - !real(r8) , intent(inout) :: finundated(bounds%begc:) ! fractional inundated area in soil column (excluding dedicated wetland columns) real(r8) , intent(inout) :: dpfct_rock(bounds%begp:) ! [fraction] rock drag partition factor (roughness effect) ! ! !LOCAL VARIABLES: !integer :: g, c, fc ! Indices integer :: g, p, fp, l ! Indices real(r8) :: z0s ! smooth roughness length (m) - !real(r8) :: zwt_actual ! Total water storage (ZWT) to use either perched or total depending on conditions ! constants real(r8), parameter :: D_p = 130e-6_r8 ! [m] Medium soil particle diameter, assuming a global constant of ~130 um following Leung et al. (2022) real(r8), parameter :: X = 10_r8 ! [m] distance downwind of the roughness element (rock). Assume estimating roughness effect at a distance of 10 m following Leung et al. (2022) !--------------------------------------------------------------------- - !SHR_ASSERT_ALL_FL((ubound(qflx_surf_lag_col) == (/bounds%endc/)), sourcefile, __LINE__) ! not sure what this is - !SHR_ASSERT_ALL_FL((ubound(finundated) == (/bounds%endc/)), sourcefile, __LINE__) SHR_ASSERT_ALL_FL((ubound(dpfct_rock) == (/bounds%endp/)), sourcefile, __LINE__) !what's the use of this !associate( & !z => col%z & ! Input: [real(r8) (:,:) ] layer depth (m) (-nlevsno+1:nlevsoi) - !zwt => soilhydrology_inst%zwt_col , & ! Input: [real(r8) (:) ] water table depth (m) - !zwt_perched => soilhydrology_inst%zwt_perched_col , & ! Input: [real(r8) (:) ] perched water table depth (m) - !tws => waterdiagnosticbulk_inst%tws_grc , & ! Input: [real(r8) (:) ] total water storage (kg m-2) - !frac_h2osfc => waterdiagnosticbulk_inst%frac_h2osfc_col & ! Input: [real(r8) (:) ] fraction of ground covered by surface water (0 to 1) !) - ! Calculate finundated - !do fc = 1, num_soilc - ! c = filter_soilc(fc) - ! g = col%gridcell(c) - ! select case( finundation_mtd ) - ! case ( finundation_mtd_h2osfc ) - ! finundated(c) = frac_h2osfc(c) - ! case ( finundation_mtd_ZWT_inversion ) - ! if (this%zwt0_gdc(g) > 0._r8) then - ! if (zwt_perched(c) < z(c,nlevsoi)-1.e-5_r8 .and. zwt_perched(c) < zwt(c)) then - ! zwt_actual = zwt_perched(c) - ! else - ! zwt_actual = zwt(c) - ! end if - ! finundated(c) = this%f0_gdc(g) * exp(-zwt_actual/this%zwt0_gdc(g)) + this%p3_gdc(g)*qflx_surf_lag_col(c) - ! else - ! finundated(c) = this%p3_gdc(g)*qflx_surf_lag_col(c) - ! end if - ! case ( finundation_mtd_TWS_inversion ) - ! finundated(c) = this%fws_slope_gdc(g) * tws(g) + this%fws_intercept_gdc(g) - ! end select - ! finundated(c) = min( 1.0_r8, max( 0.0_r8, finundated(c) ) ) - !end do ! dmleung: this loop calculates the drag partition effect (or roughness effect) of rocks. We save the drag partition factor as a patch level quantity. z0s = 2_r8 * D_p / 30_r8 ! equation from Frank M. White (2006). Here we assume soil medium size is a global constant, and so is smooth roughness length. @@ -346,7 +276,6 @@ subroutine ReadNML(this, bounds, NLFilename) use shr_nl_mod , only : shr_nl_find_group_name use shr_log_mod , only : errMsg => shr_log_errMsg use shr_mpi_mod , only : shr_mpi_bcast - !use ch4varcon , only : finundation_mtd_ZWT_inversion, finundation_mtd_TWS_inversion ! ! arguments implicit none From e6b80df3c8d37f7d262123e2ac5f82227bd04a45 Mon Sep 17 00:00:00 2001 From: cathyxinchangli <55264121+cathyxinchangli@users.noreply.github.com> Date: Wed, 1 Mar 2023 17:41:22 -0600 Subject: [PATCH 0030/1248] [dev.04] Add toggle `urban_explicit_ac` 1. Add a new logical variable `urban_explicit_ac` (default true) in __UrbanParamsType.F90__; 2. Add if-else block to building interior building temperature and AC flux calculation in __UrbBuildTempOleson2015Mod.F90__: use p_ac if `urban_explicit_ac` is set to true, otherwise use the original way of calculation; 3. Add `urban_explicit_ac` to __namelist_definition_ctsm.xml__; and 4. Add `urban_explicit_ac` default value (.true.) to __namelist_defaults_ctsm.xml__. --- bld/namelist_files/namelist_defaults_ctsm.xml | 6 +++++ .../namelist_definition_ctsm.xml | 8 +++++++ src/biogeophys/UrbBuildTempOleson2015Mod.F90 | 24 ++++++++++++------- src/biogeophys/UrbanParamsType.F90 | 11 ++++++++- 4 files changed, 39 insertions(+), 10 deletions(-) diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index 69643041a4..5be2604c36 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -166,6 +166,12 @@ attributes from the config_cache.xml file (with keys converted to upper-case). FAST NONE + + + +.true. +.true. + .false. diff --git a/bld/namelist_files/namelist_definition_ctsm.xml b/bld/namelist_files/namelist_definition_ctsm.xml index bc1dd034aa..aae38a5cec 100644 --- a/bld/namelist_files/namelist_definition_ctsm.xml +++ b/bld/namelist_files/namelist_definition_ctsm.xml @@ -947,6 +947,14 @@ Turn urban air conditioning/heating ON or OFF and add wasteheat: ON_WASTEHEAT = Air conditioning/heating is ON and waste-heat sent to urban canyon + + + + +If TRUE, use explicit, time-varying AC adoption rate for air-conditioning flux and interior building temperature calculations. + + If TRUE, urban traffic flux will be activated (Currently NOT implemented). diff --git a/src/biogeophys/UrbBuildTempOleson2015Mod.F90 b/src/biogeophys/UrbBuildTempOleson2015Mod.F90 index e5626cb65c..0ab72ac0a6 100644 --- a/src/biogeophys/UrbBuildTempOleson2015Mod.F90 +++ b/src/biogeophys/UrbBuildTempOleson2015Mod.F90 @@ -210,7 +210,10 @@ subroutine BuildingTemperature (bounds, num_urbanl, filter_urbanl, num_nolakec, use clm_varctl , only : iulog use abortutils , only : endrun use clm_varpar , only : nlevurb, nlevsno, nlevmaxurbgrnd - use UrbanParamsType , only : urban_hac, urban_hac_off, urban_hac_on, urban_wasteheat_on + ! Cathy [orig]: + ! use UrbanParamsType , only : urban_hac, urban_hac_off, urban_hac_on, urban_wasteheat_on + ! Cathy [dev.04]: + use UrbanParamsType , only : urban_hac, urban_hac_off, urban_hac_on, urban_wasteheat_on, urban_explicit_ac ! ! !ARGUMENTS: implicit none @@ -927,16 +930,19 @@ subroutine BuildingTemperature (bounds, num_urbanl, filter_urbanl, num_nolakec, ! rho_dair(l) = pstd / (rair*t_building(l)) if (t_building_bef_hac(l) > t_building_max(l)) then - ! Cathy [orig] - ! t_building(l) = t_building_max(l) - ! eflx_urban_ac(l) = wtlunit_roof(l) * abs( (ht_roof(l) * rho_dair(l) * cpair / dtime) * t_building(l) & - ! - (ht_roof(l) * rho_dair(l) * cpair / dtime) * t_building_bef_hac(l) ) - ! Cathy [dev.03] ! after the change, t_building_max is saturation setpoint - eflx_urban_ac_sat(l) = wtlunit_roof(l) * abs( (ht_roof(l) * rho_dair(l) * cpair / dtime) * t_building_max(l) & + ! Cathy [dev.04] + if (urban_explicit_ac) then ! use explicit ac adoption rate: + ! Cathy [dev.03] ! after the change, t_building_max is saturation setpoint + eflx_urban_ac_sat(l) = wtlunit_roof(l) * abs( (ht_roof(l) * rho_dair(l) * cpair / dtime) * t_building_max(l) & - (ht_roof(l) * rho_dair(l) * cpair / dtime) * t_building_bef_hac(l) ) - t_building(l) = t_building_max(l) + ( 1._r8 - p_ac(l) ) * eflx_urban_ac_sat(l) & + t_building(l) = t_building_max(l) + ( 1._r8 - p_ac(l) ) * eflx_urban_ac_sat(l) & * dtime / (ht_roof(l) * rho_dair(l) * cpair) - eflx_urban_ac(l) = p_ac(l) * eflx_urban_ac_sat(l) + eflx_urban_ac(l) = p_ac(l) * eflx_urban_ac_sat(l) + else + ! Cathy [orig] + t_building(l) = t_building_max(l) + eflx_urban_ac(l) = wtlunit_roof(l) * abs( (ht_roof(l) * rho_dair(l) * cpair / dtime) * t_building(l) & + - (ht_roof(l) * rho_dair(l) * cpair / dtime) * t_building_bef_hac(l) ) else if (t_building_bef_hac(l) < t_building_min(l)) then t_building(l) = t_building_min(l) diff --git a/src/biogeophys/UrbanParamsType.F90 b/src/biogeophys/UrbanParamsType.F90 index c490ad27cc..c674aac2db 100644 --- a/src/biogeophys/UrbanParamsType.F90 +++ b/src/biogeophys/UrbanParamsType.F90 @@ -101,6 +101,8 @@ module UrbanParamsType character(len= *), parameter, public :: urban_hac_on = 'ON' character(len= *), parameter, public :: urban_wasteheat_on = 'ON_WASTEHEAT' character(len= 16), public :: urban_hac = urban_hac_off + ! Cathy [dev.04] + logical, public :: urban_explicit_ac = .true. ! whether to use explicit, time-varying AC adoption rate logical, public :: urban_traffic = .false. ! urban traffic fluxes ! !PRIVATE MEMBER DATA: @@ -847,7 +849,10 @@ subroutine UrbanReadNML ( NLFilename ) integer :: unitn ! unit for namelist file character(len=32) :: subname = 'UrbanReadNML' ! subroutine name - namelist / clmu_inparm / urban_hac, urban_traffic, building_temp_method + ! Cathy [orig]: + ! namelist / clmu_inparm / urban_hac, urban_traffic, building_temp_method + ! Cathy [dev.04]: + namelist / clmu_inparm / urban_hac, urban_explicit_ac, urban_traffic, building_temp_method !EOP !----------------------------------------------------------------------- @@ -875,6 +880,8 @@ subroutine UrbanReadNML ( NLFilename ) ! Broadcast namelist variables read in call shr_mpi_bcast(urban_hac, mpicom) + ! Cathy [dev.04]: + call shr_mpi_bcast(urban_explicit_ac, mpicom) call shr_mpi_bcast(urban_traffic, mpicom) call shr_mpi_bcast(building_temp_method, mpicom) @@ -886,6 +893,8 @@ subroutine UrbanReadNML ( NLFilename ) ! if ( masterproc )then write(iulog,*) ' urban air conditioning/heating and wasteheat = ', urban_hac + ! Cathy [dev.04]: + write(iulog,*) ' urban explicit air-conditioning adoption rate = ', urban_explicit_ac write(iulog,*) ' urban traffic flux = ', urban_traffic end if From 30af382df1b3bb0b00ba7c9cfb3b115fa751eee4 Mon Sep 17 00:00:00 2001 From: cathyxinchangli <55264121+cathyxinchangli@users.noreply.github.com> Date: Wed, 1 Mar 2023 17:51:09 -0600 Subject: [PATCH 0031/1248] [dev. 04] Add toggle `urban_explicit_ac` (cont'd) 5. Add `urban_explicit_ac` to __CLMBuildNamelist.pm__. --- bld/CLMBuildNamelist.pm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index c2a32da4ac..a56e5b12b7 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -2111,6 +2111,8 @@ sub setup_logic_urban { add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'building_temp_method'); add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'urban_hac'); + # Cathy [dev.04] + 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'); } From 4726cede9bb015acdcf8090440eda62d252314b8 Mon Sep 17 00:00:00 2001 From: cathyxinchangli <55264121+cathyxinchangli@users.noreply.github.com> Date: Wed, 1 Mar 2023 18:01:23 -0600 Subject: [PATCH 0032/1248] [dev.04] debug Add missing ";" --- bld/CLMBuildNamelist.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index a56e5b12b7..7c185ff6a0 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -2112,7 +2112,7 @@ sub setup_logic_urban { add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'building_temp_method'); add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'urban_hac'); # Cathy [dev.04] - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'urban_explicit_ac') + 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'); } From ab2e87aa8fd6e591c7721011ecc14788fb9d87b9 Mon Sep 17 00:00:00 2001 From: cathyxinchangli <55264121+cathyxinchangli@users.noreply.github.com> Date: Wed, 1 Mar 2023 18:13:04 -0600 Subject: [PATCH 0033/1248] [dev.04] debug Add "`end if`" --- src/biogeophys/UrbBuildTempOleson2015Mod.F90 | 1 + 1 file changed, 1 insertion(+) diff --git a/src/biogeophys/UrbBuildTempOleson2015Mod.F90 b/src/biogeophys/UrbBuildTempOleson2015Mod.F90 index 0ab72ac0a6..2a5440e324 100644 --- a/src/biogeophys/UrbBuildTempOleson2015Mod.F90 +++ b/src/biogeophys/UrbBuildTempOleson2015Mod.F90 @@ -943,6 +943,7 @@ subroutine BuildingTemperature (bounds, num_urbanl, filter_urbanl, num_nolakec, t_building(l) = t_building_max(l) eflx_urban_ac(l) = wtlunit_roof(l) * abs( (ht_roof(l) * rho_dair(l) * cpair / dtime) * t_building(l) & - (ht_roof(l) * rho_dair(l) * cpair / dtime) * t_building_bef_hac(l) ) + end if else if (t_building_bef_hac(l) < t_building_min(l)) then t_building(l) = t_building_min(l) From 23f44daea7cb26b21fcf0d357389be5aecf86a28 Mon Sep 17 00:00:00 2001 From: "Danny M. Leung" Date: Fri, 31 Mar 2023 15:00:22 -0600 Subject: [PATCH 0034/1248] remove the older methods of reading in prigent's roughenss data (rough_fct) since the stream methods is here (dmleung 31 Mar 2023) --- bld/CLMBuildNamelist.pm | 7 ++++- .../namelist_definition_ctsm.xml | 8 +----- src/biogeochem/DUSTMod.F90 | 2 -- src/biogeophys/SoilStateInitTimeConstMod.F90 | 27 ------------------- src/biogeophys/SoilStateType.F90 | 6 ----- src/main/clm_varctl.F90 | 1 - src/main/controlMod.F90 | 13 --------- 7 files changed, 7 insertions(+), 57 deletions(-) diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index 0a548a857f..3b0c79d000 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -1663,6 +1663,11 @@ sub process_namelist_inline_logic { ################################## setup_logic_lai_streams($opts, $nl_flags, $definition, $defaults, $nl); + ################################## + # namelist group: dust_emis_streams # + ################################## + #setup_logic_dustemis_streams($opts, $nl_flags, $definition, $defaults, $nl); + ########################################## # namelist group: soil_moisture_streams # ########################################## @@ -4236,7 +4241,7 @@ sub write_output_files { push @groups, "ch4finundated"; push @groups, "soilbgc_decomp"; push @groups, "clm_canopy_inparm"; - push @groups, "prigentroughness"; + push @groups, "prigentroughness"; # dmleung 31 Dec 2022 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 6cdf4e3ce5..ec29018081 100644 --- a/bld/namelist_files/namelist_definition_ctsm.xml +++ b/bld/namelist_files/namelist_definition_ctsm.xml @@ -1768,6 +1768,7 @@ If true, will ignore the prescribed soilm data for that point and let the model prescribed data. + @@ -2811,13 +2812,6 @@ use case.) - - - -Full pathname of time-invariant roughness factor dataset for calculating drag partition of dust emission. - - diff --git a/src/biogeochem/DUSTMod.F90 b/src/biogeochem/DUSTMod.F90 index 8488fdf682..f1de13902a 100644 --- a/src/biogeochem/DUSTMod.F90 +++ b/src/biogeochem/DUSTMod.F90 @@ -492,8 +492,6 @@ subroutine DustEmission (bounds, & thr_crs_rate => dust_inst%thr_crs_rate_patch , & prb_crs_fld_thr => dust_inst%prb_crs_fld_thr_patch , & prb_crs_impct_thr => dust_inst%prb_crs_impct_thr_patch , & - ! added by dmleung 17 Dec 2021 - roughfct => soilstate_inst%roughfct_patch , & ! dmleung replaced it by dpfct_rock below, 31 Dec 2022 ! added by dmleung 20 Dec 2021 ssr => dust_inst%ssr_patch , & lai => dust_inst%lai_patch , & diff --git a/src/biogeophys/SoilStateInitTimeConstMod.F90 b/src/biogeophys/SoilStateInitTimeConstMod.F90 index c5e2a72977..fc96a878bc 100644 --- a/src/biogeophys/SoilStateInitTimeConstMod.F90 +++ b/src/biogeophys/SoilStateInitTimeConstMod.F90 @@ -172,7 +172,6 @@ subroutine SoilStateInitTimeConst(bounds, soilstate_inst, nlfilename) use clm_varcon , only : secspday, denh2o, denice, grlnd use clm_varctl , only : use_cn, use_lch4, use_fates use clm_varctl , only : iulog, fsurdat, paramfile, soil_layerstruct_predefined - use clm_varctl , only : rough_fct ! -dmleung added to CESM2/CLM5 17 Dec 2021 use landunit_varcon , only : istdlak, istwet, istsoil, istcrop, istice use column_varcon , only : icol_roof, icol_sunwall, icol_shadewall, icol_road_perv, icol_road_imperv use fileutils , only : getfil @@ -221,7 +220,6 @@ subroutine SoilStateInitTimeConst(bounds, soilstate_inst, nlfilename) real(r8) ,pointer :: sand3d (:,:) ! read in - soil texture: percent sand (needs to be a pointer for use in ncdio) real(r8) ,pointer :: clay3d (:,:) ! read in - soil texture: percent clay (needs to be a pointer for use in ncdio) real(r8) ,pointer :: organic3d (:,:) ! read in - organic matter: kg/m3 (needs to be a pointer for use in ncdio) - real(r8) ,pointer :: roughfct2d(:) ! read in - time-invariant roughness factor, dmleung added 17 Dec 2021 character(len=256) :: locfn ! local filename integer :: ipedof integer :: begp, endp @@ -371,31 +369,6 @@ subroutine SoilStateInitTimeConst(bounds, soilstate_inst, nlfilename) call ncd_pio_closefile(ncid) - !############ subsection for input data for new dust emission scheme ############## - - ! dmleung added to CESM2/CLM5 17 Dec 2021 - if (rough_fct /= ' ') then - allocate(roughfct2d(begg:endg)) ! dmleung, 16 Jul 2020 - ! here to read roughness factor file, 16 Jul 2020 - !write(iulog,*) 'Attempting to read roughness factor data, by dmleung .....' - call getfil (rough_fct, locfn, 0) - call ncd_pio_openfile (ncid, locfn, 0) - call ncd_io(ncid=ncid, varname='F_eff', flag='read', data=roughfct2d, dim1name=grlnd, readvar=readvar) - !write(iulog,*) 'initialize pft level roughness factor from roughfct2d(g) to roughfct(p)' - - do p = begp,endp - g = patch%gridcell(p) - soilstate_inst%roughfct_patch(p) = roughfct2d(g) - end do - - call ncd_pio_closefile(ncid) - else - do p = begp,endp - soilstate_inst%roughfct_patch(p) = 1.0_r8 - end do - - end if - !################################################################################## ! -------------------------------------------------------------------- ! get original soil depths to be used in interpolation of sand and clay diff --git a/src/biogeophys/SoilStateType.F90 b/src/biogeophys/SoilStateType.F90 index fa3d5a6aaf..2ee4894ece 100644 --- a/src/biogeophys/SoilStateType.F90 +++ b/src/biogeophys/SoilStateType.F90 @@ -30,9 +30,6 @@ module SoilStateType real(r8), pointer :: cellsand_col (:,:) ! sand value for gridcell containing column (1:nlevsoi) real(r8), pointer :: cellclay_col (:,:) ! clay value for gridcell containing column (1:nlevsoi) real(r8), pointer :: bd_col (:,:) ! col bulk density of dry soil material [kg/m^3] (CN) - !####################### for new dust emission scheme -dmleung ############################ - real(r8), pointer :: roughfct_patch (:) ! roughness factor, 17 dec 2021 - !########################################################################################### ! hydraulic properties real(r8), pointer :: hksat_col (:,:) ! col hydraulic conductivity at saturation (mm H2O /s) @@ -134,9 +131,6 @@ subroutine InitAllocate(this, bounds) allocate(this%cellclay_col (begc:endc,nlevsoi)) ; this%cellclay_col (:,:) = nan allocate(this%bd_col (begc:endc,nlevgrnd)) ; this%bd_col (:,:) = nan - !################ dmleung added 14 Dec 2021 ######################## - allocate(this%roughfct_patch (begp:endp)) ; this%roughfct_patch (:) = nan - !################################################################### allocate(this%hksat_col (begc:endc,nlevgrnd)) ; this%hksat_col (:,:) = spval allocate(this%hksat_min_col (begc:endc,nlevgrnd)) ; this%hksat_min_col (:,:) = spval allocate(this%hk_l_col (begc:endc,nlevgrnd)) ; this%hk_l_col (:,:) = nan diff --git a/src/main/clm_varctl.F90 b/src/main/clm_varctl.F90 index 3b7b1321ea..9be9af2f73 100644 --- a/src/main/clm_varctl.F90 +++ b/src/main/clm_varctl.F90 @@ -113,7 +113,6 @@ module clm_varctl character(len=fname_len), public :: nrevsn = ' ' ! restart data file name for branch run character(len=fname_len), public :: fsnowoptics = ' ' ! snow optical properties file name character(len=fname_len), public :: fsnowaging = ' ' ! snow aging parameters file name - character(len=fname_len), public :: rough_fct = ' ' ! roughness factor, dmleung, added 17 Dec 2021 character(len=fname_len), public :: fatmlndfrc = ' ' ! lnd frac file on atm grid ! only needed for LILAC and MCT drivers diff --git a/src/main/controlMod.F90 b/src/main/controlMod.F90 index 49788b351c..a7bca1aa87 100644 --- a/src/main/controlMod.F90 +++ b/src/main/controlMod.F90 @@ -282,9 +282,6 @@ subroutine control_init(dtime) use_grainproduct, use_snicar_frc, use_vancouver, use_mexicocity, use_noio, & use_nguardrail - ! dust emission, dmleung 14 Dec 2021 - namelist /clm_inparm/ & - rough_fct !-dmleung 17 Dec 2021 ! ---------------------------------------------------------------------- ! Default values @@ -656,9 +653,6 @@ subroutine control_spmd() call mpi_bcast (fsnowoptics, len(fsnowoptics), MPI_CHARACTER, 0, mpicom, ier) call mpi_bcast (fsnowaging, len(fsnowaging), MPI_CHARACTER, 0, mpicom, ier) - ! initialize input data for new dust emission module dmleung 14 Dec 2021 - call mpi_bcast (rough_fct, len(rough_fct), MPI_CHARACTER, 0, mpicom, ier)! added by dmleung, 17 Dec 2021 - ! Irrigation call mpi_bcast(irrigate, 1, MPI_LOGICAL, 0, mpicom, ier) @@ -910,13 +904,6 @@ subroutine control_print () write(iulog,*) ' Threshold above which the model keeps the lake landunit =', toosmall_lake write(iulog,*) ' Threshold above which the model keeps the wetland landunit =', toosmall_wetland write(iulog,*) ' Threshold above which the model keeps the urban landunits =', toosmall_urban - !##### for dmleung's input data for new dust emission module ##### - if (rough_fct == ' ') then ! -dmleung, 17 Dec 2021 - write(iulog,*) ' rough_fct surface roughness dataset not set' - else - write(iulog,*) ' surface roughness data = ',trim(rough_fct) - end if - !################################################################# if (use_cn) then if (suplnitro /= suplnNon)then write(iulog,*) ' Supplemental Nitrogen mode is set to run over Patches: ', & From 70125066da34fb3aa6a90cea491b3b99e9429db3 Mon Sep 17 00:00:00 2001 From: cathyxinchangli <55264121+cathyxinchangli@users.noreply.github.com> Date: Mon, 24 Apr 2023 16:30:53 -0500 Subject: [PATCH 0035/1248] Update clm_varpar.F90 Changed nlevurb to 10 (line 207) to conform to the new surfdata file. --- src/main/clm_varpar.F90 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/clm_varpar.F90 b/src/main/clm_varpar.F90 index f54b750181..7c7c1681b7 100644 --- a/src/main/clm_varpar.F90 +++ b/src/main/clm_varpar.F90 @@ -203,7 +203,8 @@ subroutine clm_varpar_init(actual_maxsoil_patches, surf_numpft, surf_numcft) max_patch_per_col= max(maxsoil_patches, surf_numcft, maxpatch_urb) nlevsoifl = 10 - nlevurb = 5 + [Cathy: to run prod.02 using new surf data from Keer, changed below from 5 to 10] + nlevurb = 10 ! originally 5 if ( masterproc ) write(iulog, *) 'soil_layerstruct_predefined varpar ', soil_layerstruct_predefined if ( masterproc ) write(iulog, *) 'soil_layerstruct_userdefined varpar ', soil_layerstruct_userdefined From 23876810d4f7eefd81dbe9d442edaf01b83b58de Mon Sep 17 00:00:00 2001 From: cathyxinchangli <55264121+cathyxinchangli@users.noreply.github.com> Date: Mon, 24 Apr 2023 16:38:52 -0500 Subject: [PATCH 0036/1248] Update clm_varpar.F90 Fix syntax error --- src/main/clm_varpar.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/clm_varpar.F90 b/src/main/clm_varpar.F90 index 7c7c1681b7..e1179e43b3 100644 --- a/src/main/clm_varpar.F90 +++ b/src/main/clm_varpar.F90 @@ -203,7 +203,7 @@ subroutine clm_varpar_init(actual_maxsoil_patches, surf_numpft, surf_numcft) max_patch_per_col= max(maxsoil_patches, surf_numcft, maxpatch_urb) nlevsoifl = 10 - [Cathy: to run prod.02 using new surf data from Keer, changed below from 5 to 10] + ![Cathy: to run prod.02 using new surf data from Keer, changed below from 5 to 10] nlevurb = 10 ! originally 5 if ( masterproc ) write(iulog, *) 'soil_layerstruct_predefined varpar ', soil_layerstruct_predefined From 2bcfc13acde7b2b42b1a316fb3d6ea1c5770be38 Mon Sep 17 00:00:00 2001 From: "Danny M. Leung" Date: Fri, 26 May 2023 13:57:31 -0600 Subject: [PATCH 0037/1248] 26 May 2023: dmleung removed the markers from the codes. Comments stay. --- bld/CLMBuildNamelist.pm | 5 +- bld/namelist_files/namelist_defaults_ctsm.xml | 2 - .../namelist_definition_ctsm.xml | 1 - src/biogeochem/DUSTMod.F90 | 300 ++++++------------ src/biogeophys/SoilStateInitTimeConstMod.F90 | 4 +- .../share_esmf/PrigentRoughnessStreamType.F90 | 43 +-- src/main/clm_instMod.F90 | 2 +- 7 files changed, 112 insertions(+), 245 deletions(-) diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index 3b0c79d000..ab1b6ac579 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -1560,7 +1560,7 @@ sub process_namelist_inline_logic { setup_logic_snowpack($opts, $nl_flags, $definition, $defaults, $nl); setup_logic_fates($opts, $nl_flags, $definition, $defaults, $nl); setup_logic_misc($opts, $nl_flags, $definition, $defaults, $nl); - setup_logic_prigent_roughness($opts, $nl_flags, $definition, $defaults, $nl); # dmleung added 31 Dec 2022 + setup_logic_prigent_roughness($opts, $nl_flags, $definition, $defaults, $nl); ######################################### # namelist group: atm2lnd_inparm @@ -4185,7 +4185,6 @@ sub setup_logic_misc { #------------------------------------------------------------------------------- sub setup_logic_prigent_roughness { - # dmleung added on 31 Dec 2022 for reading Prigent's roughness stream file my ($opts, $nl_flags, $definition, $defaults, $nl) = @_; add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_fldfilename_prigentroughness' ); add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_meshfile_prigentroughness' ); @@ -4241,7 +4240,7 @@ sub write_output_files { push @groups, "ch4finundated"; push @groups, "soilbgc_decomp"; push @groups, "clm_canopy_inparm"; - push @groups, "prigentroughness"; # dmleung 31 Dec 2022 + push @groups, "prigentroughness"; 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_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index 3d0f5ef5e1..36719a55b7 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -2526,8 +2526,6 @@ lnd/clm2/surfdata_map/release-clm5.0.30/surfdata_ne0np4.CONUS.ne30x8_hist_78pfts - - - shr_log_errMsg use shr_infnan_mod , only : nan => shr_infnan_nan, assignment(=) use clm_varpar , only : dst_src_nbr, ndst, sz_nbr, & - natpft_lb, natpft_ub, natpft_size ! -dmleung added 24 Jul 2022 + natpft_lb, natpft_ub, natpft_size use clm_varcon , only : grav, spval use landunit_varcon , only : istcrop, istsoil use clm_varctl , only : iulog @@ -31,9 +31,7 @@ module DUSTMod use LandunitType , only : lun use ColumnType , only : col use PatchType , only : patch - !use clm_instur , only : wt_lunit, wt_nat_patch ! dmleung added 24 Jul 2022 - !use landunit_varcon , only : istsoil, istcrop ! dmleung added 24 Jul 2022 (refering to main/landunit_varcon.F90, for wt_lunit, istsoil=1 is nat veg, istcrop=2 is crop) - use pftconMod , only : noveg ! dmleung added 24 Jul 2022 + use pftconMod , only : noveg use PrigentRoughnessStreamType , only : prigentroughnessstream_type ! ! !PUBLIC TYPES @@ -65,15 +63,13 @@ module DUSTMod real(r8), pointer, private :: vlc_trb_3_patch (:) ! turbulent deposition velocity 3(m/s) real(r8), pointer, private :: vlc_trb_4_patch (:) ! turbulent deposition velocity 4(m/s) real(r8), pointer, private :: mbl_bsn_fct_col (:) ! basin factor - !########### added by dmleung 27 Nov 2021 ######################################################################## real(r8), pointer, private :: dst_emiss_coeff_patch (:) ! dust emission coefficient (unitless) real(r8), pointer, private :: wnd_frc_thr_patch (:) ! wet fluid threshold (m/s) real(r8), pointer, private :: wnd_frc_thr_dry_patch (:) ! dry fluid threshold (m/s) - real(r8), pointer, private :: lnd_frc_mble_patch (:) ! land mobile fraction -dmleung + real(r8), pointer, private :: lnd_frc_mble_patch (:) ! land mobile fraction real(r8), pointer, private :: liq_frac_patch (:) ! liquid fraction of total water real(r8), pointer, private :: wnd_frc_soil_patch (:) ! soil wind friction velocity (m/s) real(r8), pointer, private :: gwc_patch (:) ! gravimetric water content (kg/kg) - !########### added by dmleung 2 Dec 2021 ######################################################################### real(r8), pointer, private :: intrmtncy_fct_patch (:) ! intermittency factor, accounting for turbulence shutting down dust emissions (unitless) real(r8), pointer, private :: stblty_patch (:) ! stability parameter for checking stability condition (stblty < 0 is unstable atmosphere) real(r8), pointer, private :: u_mean_slt_patch (:) ! wind speed 0.1 m level of dust saltation (m/s) @@ -83,13 +79,10 @@ module DUSTMod real(r8), pointer, private :: thr_crs_rate_patch (:) ! threshold crossing rate (unitless) real(r8), pointer, private :: prb_crs_fld_thr_patch (:) ! probability of wind speed crossing fluid threshold real(r8), pointer, private :: prb_crs_impct_thr_patch (:) ! probability of wind speed crossing impact threshold - !########### added by dmleung 20 Dec 2021 ######################################################################## real(r8), pointer, private :: ssr_patch (:) ! [dimless] integrated shear stress ratiio, defined by Okin (2008) and then integrated by Caroline Pierre et al. (2014) real(r8), pointer, private :: lai_patch (:) ! [m2 leaf /m2 land] LAI+SAI for calculating Okin's drag partition, averaged to landunit level real(r8), pointer, private :: frc_thr_rghn_fct_patch (:) ! [dimless] hybrid drag partition (or called roughness) factor - !########### added by dmleung 28 Jul 2022 ######################################################################## real(r8), pointer, private :: wnd_frc_thr_std_patch (:) ! standardized fluid threshold friction velocity (m/s) - !########### added by dmleung 31 Dec 2022 ######################################################################## type(prigentroughnessstream_type), private :: prigentroughnessstream ! Prigent roughness stream data real(r8), pointer, private :: dpfct_rock_patch (:) ! [fraction] rock drag partition factor, time-constant contains @@ -109,21 +102,16 @@ module DUSTMod contains !------------------------------------------------------------------------ - !##### dmleung edited for initializing stream files 31 Dec 2022 ######## - !subroutine Init(this, bounds, NLFilename, num_nolakep, filter_nolakep) subroutine Init(this, bounds, NLFilename) class(dust_type) :: this type(bounds_type), intent(in) :: bounds - character(len=*), intent(in) :: NLFilename ! dmleung added 31 Dec 2022 - !integer , intent(in) :: num_nolakep ! number of column non-lake points in patch filter - !integer , intent(in) :: filter_nolakep(num_nolakep) ! patch filter for non-lake points + character(len=*), intent(in) :: NLFilename call this%InitAllocate (bounds) call this%InitHistory (bounds) - call this%prigentroughnessstream%Init( bounds, NLFilename ) ! dmleung added 31 Dec 2022 - !call this%InitCold (bounds, num_nolakep, filter_nolakep) - call this%InitCold (bounds) ! dmleung commented 31 Dec 2022 + call this%prigentroughnessstream%Init( bounds, NLFilename ) + call this%InitCold (bounds) call this%InitDustVars (bounds) end subroutine Init @@ -151,7 +139,6 @@ subroutine InitAllocate(this, bounds) allocate(this%vlc_trb_3_patch (begp:endp)) ; this%vlc_trb_3_patch (:) = nan allocate(this%vlc_trb_4_patch (begp:endp)) ; this%vlc_trb_4_patch (:) = nan allocate(this%mbl_bsn_fct_col (begc:endc)) ; this%mbl_bsn_fct_col (:) = nan - !#### added by dmleung 27 Nov 2021 ##################################### allocate(this%dst_emiss_coeff_patch (begp:endp)) ; this%dst_emiss_coeff_patch (:) = nan allocate(this%wnd_frc_thr_patch (begp:endp)) ; this%wnd_frc_thr_patch (:) = nan allocate(this%wnd_frc_thr_dry_patch (begp:endp)) ; this%wnd_frc_thr_dry_patch (:) = nan @@ -159,7 +146,6 @@ subroutine InitAllocate(this, bounds) allocate(this%wnd_frc_soil_patch (begp:endp)) ; this%wnd_frc_soil_patch (:) = nan allocate(this%gwc_patch (begp:endp)) ; this%gwc_patch (:) = nan allocate(this%liq_frac_patch (begp:endp)) ; this%liq_frac_patch (:) = nan - !#### added by dmleung 2 Dec 2021 ###################################### allocate(this%intrmtncy_fct_patch (begp:endp)) ; this%intrmtncy_fct_patch (:) = nan allocate(this%stblty_patch (begp:endp)) ; this%stblty_patch (:) = nan allocate(this%u_mean_slt_patch (begp:endp)) ; this%u_mean_slt_patch (:) = nan @@ -169,13 +155,10 @@ subroutine InitAllocate(this, bounds) allocate(this%thr_crs_rate_patch (begp:endp)) ; this%thr_crs_rate_patch (:) = nan allocate(this%prb_crs_fld_thr_patch (begp:endp)) ; this%prb_crs_fld_thr_patch (:) = nan allocate(this%prb_crs_impct_thr_patch (begp:endp)) ; this%prb_crs_impct_thr_patch (:) = nan - !#### added by dmleung 17 Dec 2021 ###################################### allocate(this%ssr_patch (begp:endp)) ; this%ssr_patch (:) = nan allocate(this%lai_patch (begp:endp)) ; this%lai_patch (:) = nan allocate(this%frc_thr_rghn_fct_patch (begp:endp)) ; this%frc_thr_rghn_fct_patch (:) = nan - !#### added by dmleung 28 Jul 2022 ###################################### allocate(this%wnd_frc_thr_std_patch (begp:endp)) ; this%wnd_frc_thr_std_patch (:) = nan - !#### added by dmleung 31 Dec 2022 ###################################### allocate(this%dpfct_rock_patch (begp:endp)) ; this%dpfct_rock_patch (:) = nan end subroutine InitAllocate @@ -221,7 +204,6 @@ subroutine InitHistory(this, bounds) avgflag='A', long_name='turbulent deposition velocity 4', & ptr_patch=this%vlc_trb_4_patch, default='inactive') - !#####added by dmleung 27 Nov 2021######################################### this%dst_emiss_coeff_patch(begp:endp) = spval call hist_addfld1d (fname='C_d', units='dimensionless', & avgflag='A', long_name='dust emission coefficient', & @@ -250,7 +232,6 @@ subroutine InitHistory(this, bounds) call hist_addfld1d (fname='LIQ_FRAC', units='dimensionless', & avgflag='A', long_name='fraction of total water that is liquid', & ptr_patch=this%liq_frac_patch, set_lake=0._r8, set_urb=0._r8) - !#####added by dmleung 2 Dec 2021 ######################################### this%u_mean_slt_patch(begp:endp) = spval call hist_addfld1d (fname='U_S_MEAN', units='m/s', & avgflag='A', long_name='mean wind velocity at saltation level', & @@ -287,7 +268,6 @@ subroutine InitHistory(this, bounds) call hist_addfld1d (fname='ETA', units='', & avgflag='A', long_name='intermittency factor', & ptr_patch=this%intrmtncy_fct_patch, set_lake=0._r8, set_urb=0._r8) - !#####added by dmleung 20 Dec 2021 ######################################## this%ssr_patch(begp:endp) = spval call hist_addfld1d (fname='SSR', units='m/s', & avgflag='A', long_name='Okin-Pierre vegetation shear stress ratio (drag partition factor)', & @@ -300,35 +280,24 @@ subroutine InitHistory(this, bounds) call hist_addfld1d (fname='FRC_THR_RGHN_FCT', units='dimensionless', & avgflag='A', long_name='hybrid drag partition (or roughness) factor', & ptr_patch=this%frc_thr_rghn_fct_patch, set_lake=0._r8, set_urb=0._r8) - !#####added by dmleung 28 Jul 2022 ######################################## this%wnd_frc_thr_std_patch(begp:endp) = spval call hist_addfld1d (fname='WND_FRC_FT_STD', units='m/s', & avgflag='A', long_name='standardized fluid threshold friction velocity', & ptr_patch=this%wnd_frc_thr_std_patch, set_lake=0._r8, set_urb=0._r8) - !#####added by dmleung 31 Dec 2022 ######################################## this%dpfct_rock_patch(begp:endp) = spval call hist_addfld1d (fname='DPFCT_ROCK', units='m/s', & avgflag='A', long_name='rock drag partition factor', & ptr_patch=this%dpfct_rock_patch) - !########################################################################## end subroutine InitHistory !----------------------------------------------------------------------- - !subroutine InitCold(this, bounds, num_nolakep, filter_nolakep) !dmleung commented 31 Dec 2022 subroutine InitCold(this, bounds) ! - !USES dmleung added 31 Dec 2022 - !use landunit_varcon , only : istdlak - !use LandunitType , only : lun ! ! !ARGUMENTS: - class(dust_type), intent(inout) :: this ! dmleung used class instead of type, 31 Dec 2022 + class(dust_type), intent(inout) :: this ! Danny M. Leung used class instead of type type(bounds_type), intent(in) :: bounds - ! dmleung also added the below no-lake filter 31 Dec 2022 - !integer , intent(in) :: num_nolakep ! number of column non-lake points in patch filter - !integer , intent(in) :: filter_nolakep(num_nolakep) ! patch filter for non-lake points - !type(dust_type), intent(inout) :: dust_inst ! ! !LOCAL VARIABLES: integer :: c,l @@ -344,19 +313,14 @@ subroutine InitCold(this, bounds) end if end do - !associate( & - ! dpfct_rock => this%dpfct_rock_patch & - ! ) - ! Caulculate Drag Partition factor, dmleung added 31 Dec 2022 + ! Caulculate Drag Partition factor if ( this%prigentroughnessstream%useStreams() )then !if usestreams == true, and it should be always true call this%prigentroughnessstream%CalcDragPartition( bounds, & - ! num_nolakep, filter_nolakep, this%dpfct_rock_patch(bounds%begp:bounds%endp) ) this%dpfct_rock_patch(bounds%begp:bounds%endp) ) else call endrun( "ERROR:: Drag partitioning MUST now use a streams file of aeolian roughness length to calculate, it can no longer read from the fsurdat file" ) end if - !end associate end subroutine InitCold @@ -376,9 +340,7 @@ subroutine DustEmission (bounds, & ! !USES use shr_const_mod, only : SHR_CONST_RHOFW use subgridaveMod, only : p2g - !use clm_instur , only : wt_lunit, wt_nat_patch ! dmleung added 24 Jul 2022 - !use landunit_varcon , only : istsoil, istcrop ! dmleung added 24 Jul 2022 (refering to main/landunit_varcon.F90, for wt_lunit, istsoil=1 is nat veg, istcrop=2 is crop) - use pftconMod , only : noveg ! dmleung added 24 Jul 2022 + use pftconMod , only : noveg ! ! !ARGUMENTS: type(bounds_type) , intent(in) :: bounds @@ -404,7 +366,7 @@ subroutine DustEmission (bounds, & real(r8) :: flx_mss_vrt_dst_ttl(bounds%begp:bounds%endp) real(r8) :: frc_thr_wet_fct real(r8) :: frc_thr_rgh_fct - !real(r8) :: wnd_frc_thr_slt ! dmleung commented and put below 2 Dec 2021 + !real(r8) :: wnd_frc_thr_slt ! Danny M. Leung commented and put below real(r8) :: wnd_rfr_thr_slt real(r8) :: wnd_frc_slt real(r8) :: lnd_frc_mbl(bounds%begp:bounds%endp) @@ -415,16 +377,13 @@ subroutine DustEmission (bounds, & real(r8) :: sumwt(bounds%begl:bounds%endl) ! sum of weights logical :: found ! temporary for error check integer :: index - !########### added by dmleung 27 Nov 2021 ######################################### - real(r8) :: tmp2 ! calculates the dry fluid threshold using Shao and Lu (2000) scheme; replace the tmp1 (Iversen and White, 1982) that was passed from Dustini to DustEmission; tmp2 will be calculated here 23 May 2020 -dmleung - real(r8) :: wnd_frc_thr_slt_std ! [m/s] The soil threshold friction speed at standard air density (1.2250 kg/m3) -jfk - real(r8) :: frag_expt ! fragmentation exponent, -dmleung 22 Jun 2021 - !########### added by dmleung 2 Dec 2021 for intermittency scheme ################# - real(r8) :: wnd_frc_thr_slt_it ! [m/s] created for impact threshold friction velocity, dmleung 9 Jun 2021 - real(r8) :: wnd_frc_thr_slt ! [m/s] used for wet fluid threshold friction velocity, dmleung 9 Jun 2021 - !########### added by dmleung 20 Dec 2021 for drag partition effect ################# + + real(r8) :: tmp2 ! calculates the dry fluid threshold using Shao and Lu (2000) scheme; replace the tmp1 (Iversen and White, 1982) that was passed from Dustini to DustEmission; tmp2 will be calculated here + real(r8) :: wnd_frc_thr_slt_std ! [m/s] The soil threshold friction speed at standard air density (1.2250 kg/m3) + real(r8) :: frag_expt ! fragmentation exponent + real(r8) :: wnd_frc_thr_slt_it ! [m/s] created for impact threshold friction velocity + real(r8) :: wnd_frc_thr_slt ! [m/s] used for wet fluid threshold friction velocity real(r8) :: K_length ! [dimless] normalized mean interobstacle distance, or called gap length (Okin, 2008) - !########### added by dmleung 22 Jul 2022 for LUH2 land cover #################### real(r8) :: bare_frc ! LUH2 bare soil land cover fraction real(r8) :: veg_frc ! LUH2 natural vegetation + crop land cover fraction ! @@ -433,24 +392,19 @@ subroutine DustEmission (bounds, & real(r8), parameter :: cst_slt = 2.61_r8 ! [frc] Saltation constant real(r8), parameter :: flx_mss_fdg_fct = 5.0e-4_r8 ! [frc] Empir. mass flx tuning eflx_lh_vegt !real(r8), parameter :: vai_mbl_thr = 0.3_r8 ! [m2 m-2] VAI threshold quenching dust mobilization - !####### added by dmleung 27 Nov 2021 ########################################################################### character(len=*),parameter :: subname = 'DUSTEmission' - real(r8), parameter :: vai_mbl_thr = 1.0_r8 ! [m2 m-2] new VAI threshold; dmleung suggests 1 or 0.5, and the default 0.3 seems a bit too small -dmleung 27 Nov 2021 - real(r8), parameter :: Cd0 = 4.4e-5_r8 ! [dimless] proportionality constant in calculation of dust emission coefficient -jfk - real(r8), parameter :: Ca = 2.7_r8 ! [dimless] proportionality constant in scaling of dust emission exponent -jfk - real(r8), parameter :: Ce = 2.0_r8 ! [dimless] proportionality constant scaling exponential dependence of dust emission coefficient on standardized soil threshold friction speed -jfk - real(r8), parameter :: C_tune = 0.05_r8 ! [dimless] global tuning constant for vertical dust flux; set to produce ~same global dust flux in control sim (I_2000) as old parameterization -jfk - real(r8), parameter :: wnd_frc_thr_slt_std_min = 0.16_r8 ! [m/s] minimum standardized soil threshold friction speed -jfk - real(r8), parameter :: forc_rho_std = 1.2250_r8 ! [kg/m3] density of air at standard pressure (101325) and temperature (293 K) -jfk - real(r8), parameter :: dns_slt = 2650.0_r8 ! [kg m-3] Density of optimal saltation particles, dml 23 May 2020 - !####### added by dmleung 2 Dec 2021 for intermittency ########################################################## - real(r8), parameter :: B_it = 0.82_r8 ! [dimless] ratio = u_star_it / u_star_ft0 (may need to change into a fn of moisture later on) -dml - real(r8), parameter :: k = 0.4_r8 ! [dimless] von Karman constant -dml - !####### added by dmleung 2 Dec 2021 for Okin (2008) drag partition for plants ########################################################## - real(r8), parameter :: f_0 = 0.32_r8 ! [dimless] SSR in the immediate lee of a plant, dimensionless - real(r8), parameter :: c_e = 4.8_r8 ! [dimless] e-folding distance velocity recovery, dimensionless - !################################################################################################################ - !################################################################################################################ + real(r8), parameter :: vai_mbl_thr = 1.0_r8 ! [m2 m-2] new VAI threshold; Danny M. Leung suggests 1, and the old 0.3 seems a bit too small + real(r8), parameter :: Cd0 = 4.4e-5_r8 ! [dimless] proportionality constant in calculation of dust emission coefficient + real(r8), parameter :: Ca = 2.7_r8 ! [dimless] proportionality constant in scaling of dust emission exponent + real(r8), parameter :: Ce = 2.0_r8 ! [dimless] proportionality constant scaling exponential dependence of dust emission coefficient on standardized soil threshold friction speed + real(r8), parameter :: C_tune = 0.05_r8 ! [dimless] global tuning constant for vertical dust flux; set to produce ~same global dust flux in control sim (I_2000) as old parameterization + real(r8), parameter :: wnd_frc_thr_slt_std_min = 0.16_r8 ! [m/s] minimum standardized soil threshold friction speed + real(r8), parameter :: forc_rho_std = 1.2250_r8 ! [kg/m3] density of air at standard pressure (101325) and temperature (293 K) + real(r8), parameter :: dns_slt = 2650.0_r8 ! [kg m-3] Density of optimal saltation particles + real(r8), parameter :: B_it = 0.82_r8 ! [dimless] ratio = u_star_it / u_star_ft0 + real(r8), parameter :: k = 0.4_r8 ! [dimless] von Karman constant + real(r8), parameter :: f_0 = 0.32_r8 ! [dimless] SSR in the immediate lee of a plant + real(r8), parameter :: c_e = 4.8_r8 ! [dimless] e-folding distance velocity recovery !------------------------------------------------------------------------ associate( & @@ -474,15 +428,14 @@ subroutine DustEmission (bounds, & mbl_bsn_fct => dust_inst%mbl_bsn_fct_col , & ! Input: [real(r8) (:) ] basin factor flx_mss_vrt_dst => dust_inst%flx_mss_vrt_dst_patch , & ! Output: [real(r8) (:,:) ] surface dust emission (kg/m**2/s) flx_mss_vrt_dst_tot => dust_inst%flx_mss_vrt_dst_tot_patch , & ! Output: [real(r8) (:) ] total dust flux back to atmosphere (pft) - ! the following are added by dmleung 27 Nov 2021 + dst_emiss_coeff => dust_inst%dst_emiss_coeff_patch , & ! Output dust emission coefficient - wnd_frc_thr => dust_inst%wnd_frc_thr_patch , & ! output impact threshold -dmleung + wnd_frc_thr => dust_inst%wnd_frc_thr_patch , & ! output impact threshold wnd_frc_thr_dry => dust_inst%wnd_frc_thr_dry_patch , & ! output dry threshold - lnd_frc_mble => dust_inst%lnd_frc_mble_patch , & ! -dmleung, 3 Feb 2020 + lnd_frc_mble => dust_inst%lnd_frc_mble_patch , & ! output bare land fraction wnd_frc_soil => dust_inst%wnd_frc_soil_patch , & ! soil friction velocity u_*s = (u_*)(f_eff) gwc => dust_inst%gwc_patch , & ! output gravimetric water content liq_frac => dust_inst%liq_frac_patch , & - ! added by dmleung 8 Jul 2019, recoded 2 Dec 2021 intrmtncy_fct => dust_inst%intrmtncy_fct_patch , & stblty => dust_inst%stblty_patch , & u_mean_slt => dust_inst%u_mean_slt_patch , & @@ -492,14 +445,11 @@ subroutine DustEmission (bounds, & thr_crs_rate => dust_inst%thr_crs_rate_patch , & prb_crs_fld_thr => dust_inst%prb_crs_fld_thr_patch , & prb_crs_impct_thr => dust_inst%prb_crs_impct_thr_patch , & - ! added by dmleung 20 Dec 2021 ssr => dust_inst%ssr_patch , & lai => dust_inst%lai_patch , & frc_thr_rghn_fct => dust_inst%frc_thr_rghn_fct_patch , & - ! added by dmleung 28 Jul 2022 wnd_frc_thr_std => dust_inst%wnd_frc_thr_std_patch , & - ! added by dmleung 31 Dec 2022 - dpfct_rock => dust_inst%dpfct_rock_patch & ! dmleung used roughfct (roughness factor) instead of dpfct_rock (rock drag partition factor) here. Could change it back to dpfct_rock here and below later, 31 Dec 2022 + dpfct_rock => dust_inst%dpfct_rock_patch & ) ttlai(bounds%begp : bounds%endp) = 0._r8 @@ -572,14 +522,13 @@ subroutine DustEmission (bounds, & end if end do - ! dmleung add output for bare_frc and veg_frc here if wanted !!!!!!!!!---------------------- + ! dmleung add output for bare_frc and veg_frc here if wanted !!!!---------------------- ! reset history output variables before next if-statement to avoid output = inf do fp = 1,num_nolakep p = filter_nolakep(fp) flx_mss_vrt_dst_tot(p) = 0.0_r8 - ! the following are added by dmleung 27 Nov 2021 dst_emiss_coeff(p) = 0.0_r8 wnd_frc_thr(p) = 0.0_r8 wnd_frc_thr_dry(p) = 0.0_r8 @@ -587,7 +536,6 @@ subroutine DustEmission (bounds, & wnd_frc_soil(p) = 0.0_r8 gwc(p) = 0.0_r8 liq_frac(p) = 0.0_r8 - ! dmleung's edit, 8 Jul 2019; added by dmleung 2 Dec 2021 u_mean_slt(p) = 0.0_r8 u_sd_slt(p) = 0.0_r8 stblty(p) = 0.0_r8 @@ -597,11 +545,9 @@ subroutine DustEmission (bounds, & prb_crs_fld_thr(p) = 0.0_r8 prb_crs_impct_thr(p) = 0.0_r8 intrmtncy_fct(p) = 0.0_r8 - ! dmleung's edit, 20 Dec 2021 ssr(p) = 0.0_r8 lai(p) = 0.0_r8 frc_thr_rghn_fct(p) = 0.0_r8 - ! dmleung added 28 Jul 2022 wnd_frc_thr_std(p) = 0.0_r8 end do do n = 1, ndst @@ -617,9 +563,9 @@ subroutine DustEmission (bounds, & l = patch%landunit(p) g = patch%gridcell(p) - !################################################################################################ + !-------------------------------------------------------------------------------------------------- ! put dust emission calculation here to output threshold friction velocity for the whole globe, - ! not just when lnd_frc_mbl = 0. Edited by dmleung 27 Nov 2021 + ! not just when lnd_frc_mbl = 0. Danny M. Leung 27 Nov 2021 bd = (1._r8-watsat(c,1))*2.7e3_r8 ![kg m-3] Bulk density of dry surface soil gwc_sfc = h2osoi_vol(c,1)*SHR_CONST_RHOFW/bd ![kg kg-1] Gravimetric H2O cont if (gwc_sfc > gwc_thr(c)) then @@ -628,54 +574,52 @@ subroutine DustEmission (bounds, & frc_thr_wet_fct = 1.0_r8 end if - ! output moisture variables -dmleung, coded Jul 2020, recoded 18 Mar 2021, added to CLM5 27 Nov 2021 + ! output moisture variables gwc(p) = gwc_sfc ! output surface gravimetric water content ! slevis: adding liqfrac here, because related to effects from soil water - liqfrac = max( 0.0_r8, min( 1.0_r8, h2osoi_liq(c,1) / (h2osoi_ice(c,1)+h2osoi_liq(c,1)+1.0e-6_r8) ) ) !-dmleung 27 Nov 2021 - ! output liquid fraction -dmleung 27 Nov 2021 + liqfrac = max( 0.0_r8, min( 1.0_r8, h2osoi_liq(c,1) / (h2osoi_ice(c,1)+h2osoi_liq(c,1)+1.0e-6_r8) ) ) + ! output liquid fraction liq_frac(p) = liqfrac !####################################################################################################### ! calculate Shao & Lu (2000) dust emission threshold scheme here - ! use tmp1 from DUSTini for Iversen and White I&W (1982) (75 um is optimal); use tmp2 for S&L (2000) (80 um is optimal) - ! recoded to CLM5 27 Nov 2021 + ! use tmp1 from DUSTini for Iversen and White I&W (1982) (~75 um is optimal); use tmp2 for S&L (2000) (~80 um is optimal) !####################################################################################################### - tmp2 = 1.0_r8*sqrt(0.0123_r8 * (dns_slt*grav*130.0e-6_r8 + 1.65e-4_r8/130.0e-6_r8)) ! calculate S&L (2000) scheme here for threshold; gamma = 1.65e-4 following S&L00, D_p = 127 um ~ 130 um following dmleung's dust paper. As this is a global constant, this line can be put outside the loop to save computational power. + tmp2 = 1.0_r8*sqrt(0.0123_r8 * (dns_slt*grav*130.0e-6_r8 + 1.65e-4_r8/130.0e-6_r8)) ! calculate S&L (2000) scheme here for threshold; gamma = 1.65e-4 following S&L00, D_p = 127 um ~ 130 um following Leung et al. (2022). As this is a global constant, this line can be put outside the loop to save computational power. wnd_frc_thr_dry(p) = tmp2 / sqrt(forc_rho(c)) ! output dry fluid threshold - wnd_frc_thr_slt = tmp2 / sqrt(forc_rho(c)) * frc_thr_wet_fct !* frc_thr_rgh_fct ! use as threshold in this module - wnd_frc_thr_slt_it = B_it * tmp2 / sqrt(forc_rho(c)) ! define impact threshold -dml 9 Jun 2021, recoded to CLM5 27 Nov 2021 - - !wnd_frc_thr_dry(p) = tmp1 / sqrt(forc_rho(c)) ! output dry fluid threshold - !wnd_frc_thr_slt = tmp1 / sqrt(forc_rho(c)) * frc_thr_wet_fct !* frc_thr_rgh_fct ! use as threshold in this module - !wnd_frc_thr_slt_it = B_it * tmp1 / sqrt(forc_rho(c)) ! define impact threshold -dmleung 9 Jun 2021, recoded to CLM5 27 Nov 2021 - ! the above formula is true for Iversen and White (1982) and Shao and Lu (2000) scheme -dmleung, 23 Feb 2020, added to CLM5 27 Nov 2021 - wnd_frc_thr(p) = wnd_frc_thr_slt ! output fluid threshold -dmleung - - ! use emission threshold to calculate standardized threshold and dust emission coefficient dmleung 27 Nov 2021 - wnd_frc_thr_slt_std = wnd_frc_thr_slt * sqrt(forc_rho(c) / forc_rho_std) ! standardized soil threshold friction speed -jfk (defined using fluid threshold - wnd_frc_thr_std(p) = wnd_frc_thr_slt_std ! output standardized fluid threshold -dmleung added 28 Jul 2022 - dst_emiss_coeff(p) = Cd0 * exp(-Ce * (wnd_frc_thr_slt_std - wnd_frc_thr_slt_std_min) / wnd_frc_thr_slt_std_min) ! save dust emission coefficient here for all grids, -dml, 1 Mar 2021 - - ! framentation exponent dmleung 27 Nov 2021; moved to this block 23 Dec 2021 - frag_expt = (Ca * (wnd_frc_thr_slt_std - wnd_frc_thr_slt_std_min) / wnd_frc_thr_slt_std_min) ! fragmentation exponent, defined in Kok et al. (2014a) -dmleung 27 Nov 2021 + wnd_frc_thr_slt = tmp2 / sqrt(forc_rho(c)) * frc_thr_wet_fct !* frc_thr_rgh_fct ! fluid threshold + wnd_frc_thr_slt_it = B_it * tmp2 / sqrt(forc_rho(c)) ! define impact threshold + + !wnd_frc_thr_dry(p) = tmp1 / sqrt(forc_rho(c)) ! output dry fluid threshold; tmp1 uses I&W 1982 + !wnd_frc_thr_slt = tmp1 / sqrt(forc_rho(c)) * frc_thr_wet_fct !* frc_thr_rgh_fct ! fluid threshold + !wnd_frc_thr_slt_it = B_it * tmp1 / sqrt(forc_rho(c)) ! define impact threshold + ! the above formula is true for Iversen and White (1982) and Shao and Lu (2000) scheme + wnd_frc_thr(p) = wnd_frc_thr_slt ! output fluid threshold + + ! use emission threshold to calculate standardized threshold and dust emission coefficient + wnd_frc_thr_slt_std = wnd_frc_thr_slt * sqrt(forc_rho(c) / forc_rho_std) ! standardized soil threshold friction speed (defined using fluid threshold) + wnd_frc_thr_std(p) = wnd_frc_thr_slt_std ! output standardized fluid threshold + dst_emiss_coeff(p) = Cd0 * exp(-Ce * (wnd_frc_thr_slt_std - wnd_frc_thr_slt_std_min) / wnd_frc_thr_slt_std_min) ! save dust emission coefficient here for all grids + + ! framentation exponent + frag_expt = (Ca * (wnd_frc_thr_slt_std - wnd_frc_thr_slt_std_min) / wnd_frc_thr_slt_std_min) ! fragmentation exponent, defined in Kok et al. (2014a) if (frag_expt > 5.0_r8) then ! set fragmentation exponent to be 3 or 5 at maximum, to avoid local AOD blowup frag_expt = 5.0_r8 end if - !################ drag partition effect, and soil friction velocity############################ + !################ drag partition effect, and soil friction velocity ########################### ! subsection on computing vegetation drag partition and hybrid drag partition factors - ! in our scheme, drag partition effect is applied on the wind instead of the threshold - ! -dmleung, 7 Jul 2021 , coded to CLM5 27 Nov 2021 + ! in Leung et al. (2022), drag partition effect is applied on the wind instead of the threshold !############################################################################################## ! the following comes from subr. frc_thr_rgh_fct_get ! purpose: compute factor by which surface roughness increases threshold ! friction velocity (currently a constant) if (lnd_frc_mbl(p) > 0.0_r8 .AND. tlai_lu(l)<=1_r8) then - ! vegetation drag partition equation following Gregory Okin (2008) + Caroline Pierre et al. (2014), dmleung 20 Dec 2021 - lai(p) = tlai_lu(l)+0.1_r8 ! LAI+SAI averaged to landunit level; saved for output + ! vegetation drag partition equation following Gregory Okin (2008) + Caroline Pierre et al. (2014) + lai(p) = tlai_lu(l)+0.1_r8 ! LAI+SAI averaged to landunit level; the equation is undefined at lai=0 so we add in a small number. Then lai is saved for output if (lai(p) > 1_r8) then lai(p) = 1_r8 ! setting LAI ~ 0.1 to be a min value (since the value goes to infinity when LAI=0) end if ! and 1 to be a max value as computing K involves 1 / LAI @@ -684,18 +628,15 @@ subroutine DustEmission (bounds, & K_length = 2_r8 * (1_r8/lai(p) - 1_r8) ! Here LAI has to be non-zero to avoid blowup ssr(p) = (K_length+f_0*c_e)/(K_length+c_e) - !frc_thr_rgh_fct = (rockfrc(p)*(roughfct(p))**3_r8 + (vegefrc(p)+sparfrc(p))*(ssr(p))**3_r8 )**(0.3333_r8) ! land cover weighted mean using static GLCNMo bare land fraction LC0, dmleung 20 Dec 2021i; dmleung commented 24 Jul 2022 - - ! dmleung added calculation of LUH2 bare vs veg fraction within a grid 24 Jul 2022 + ! dmleung added calculation of LUH2 bare vs veg fraction within a grid !bare_frc = wt_lunit(g,istsoil) * wt_nat_patch(g,noveg) !veg_frc = wt_lunit(g,istsoil) * sum(wt_nat_patch(g,(noveg+1):natpft_ub)) + wt_lunit(g,istcrop) - !frc_thr_rgh_fct = (bare_frc*(roughfct(p))**3_r8 + veg_frc*(ssr(p))**3_r8 )**(0.3333_r8) ! land cover weighted mean using LUH2 land cover, dmleung 24 Jul 2022 + !frc_thr_rgh_fct = (bare_frc*(roughfct(p))**3_r8 + veg_frc*(ssr(p))**3_r8 )**(0.3333_r8) ! land cover weighted mean using LUH2 land cover - ! dmleung added calculation of LUH2 bare vs veg fraction within a grid 6 Oct 2022 + ! calculation of drag partition effect using LUH2 bare and veg fractions within a grid if (lun%itype(l) == istsoil .or. lun%itype(l) == istcrop) then if (patch%itype(p) == noveg) then - !frc_thr_rgh_fct = roughfct(p) ! dmleung commented out 13 Dec 2022 and added next line frc_thr_rgh_fct = dpfct_rock(p) else frc_thr_rgh_fct = ssr(p) @@ -704,17 +645,18 @@ subroutine DustEmission (bounds, & frc_thr_rgh_fct = 1.0_r8 end if - wnd_frc_slt = fv(p) * frc_thr_rgh_fct ! wnd_frc_slt will be used in the dust emission equation -dmleung + wnd_frc_slt = fv(p) * frc_thr_rgh_fct ! wnd_frc_slt will be used in the dust emission equation + + frc_thr_rghn_fct(p) = frc_thr_rgh_fct ! save and output hybrid drag partition factor - frc_thr_rghn_fct(p) = frc_thr_rgh_fct ! save and output hybrid drag partition factor, dmleung 20 Dec 2021 else wnd_frc_slt = fv(p) ! The value here is not important since once lnd_frc_mbl(p) <= 0.0_r8 there will be no emission. - frc_thr_rghn_fct(p) = 0.0_r8 ! save and output hybrid drag partition factor, dmleung 20 Dec 2021 + frc_thr_rghn_fct(p) = 0.0_r8 ! save and output hybrid drag partition factor end if !########## end of drag partition effect ####################################################### - !############ Add Owen effect; if not, comment out this block !-dmleung, 27 Nov 2021 ########### + !############ comment out Owen's offect this block; dust emission does not need to consider it ########### ! the following if-block comes from subr. wnd_frc_slt_get ! purpose: compute the saltating friction velocity ! theory: saltation roughens the boundary layer, AKA "Owen's effect" @@ -723,82 +665,41 @@ subroutine DustEmission (bounds, & ! wnd_rfr_dlt = u10(p) - wnd_rfr_thr_slt ! wnd_frc_slt_dlt = 0.003_r8 * wnd_rfr_dlt * wnd_rfr_dlt ! wnd_frc_slt = wnd_frc_slt + wnd_frc_slt_dlt ! careful that RHS is now wnd_frc_slt instead of fv(p) - ! ! because wnd_frc_slt takes drag partition effect into account, but fv(p) doesn't. dmleung 27 Nov 2021 + ! ! because wnd_frc_slt takes drag partition effect into account, but fv(p) doesn't. !end if !########## end of Owen effect ################################################################ - ! save soil friction velocity and roughness effect before the if-statement, -dml, 1 Mar 2021, coded to CLM5 27 Nov 2021 - wnd_frc_soil(p) = wnd_frc_slt ! save soil friction velocity for CLM output, which has drag partition and Owen effect -dml + ! save soil friction velocity and roughness effect before the if-statement + wnd_frc_soil(p) = wnd_frc_slt ! save soil friction velocity for CLM output, which has drag partition and Owen effect ! save land mobile fraction - lnd_frc_mble(p) = lnd_frc_mbl(p) ! save land mobile fraction first, before the if-statement, -dml, 1 Mar 2021 + lnd_frc_mble(p) = lnd_frc_mbl(p) ! save land mobile fraction first, before the if-statement ! only perform the following calculations if lnd_frc_mbl is non-zero - if (lnd_frc_mbl(p) > 0.0_r8) then - - ! the following comes from subr. frc_thr_rgh_fct_get - ! purpose: compute factor by which surface roughness increases threshold - ! friction velocity (currently a constant) - - !frc_thr_rgh_fct = 1.0_r8 - - ! the following comes from subr. frc_thr_wet_fct_get - ! purpose: compute factor by which soil moisture increases threshold friction velocity - ! adjust threshold velocity for inhibition by moisture - ! modified 4/5/2002 (slevis) to use gravimetric instead of volumetric - ! water content - - !bd = (1._r8-watsat(c,1))*2.7e3_r8 ![kg m-3] Bulk density of dry surface soil - !gwc_sfc = h2osoi_vol(c,1)*SHR_CONST_RHOFW/bd ![kg kg-1] Gravimetric H2O cont - !if (gwc_sfc > gwc_thr(c)) then - ! frc_thr_wet_fct = sqrt(1.0_r8 + 1.21_r8 * (100.0_r8*(gwc_sfc - gwc_thr(c)))**0.68_r8) - !else - ! frc_thr_wet_fct = 1.0_r8 - !end if - - ! slevis: adding liqfrac here, because related to effects from soil water - - !liqfrac = max( 0.0_r8, min( 1.0_r8, h2osoi_liq(c,1) / (h2osoi_ice(c,1)+h2osoi_liq(c,1)+1.0e-6_r8) ) ) - - ! the following lines come from subr. dst_mbl - ! purpose: adjust threshold friction velocity to acct for moisture and - ! roughness. The ratio tmp1 / sqrt(forc_rho) comes from - ! subr. wnd_frc_thr_slt_get which computes dry threshold - ! friction velocity for saltation - - !wnd_frc_thr_slt = tmp1 / sqrt(forc_rho(c)) * frc_thr_wet_fct * frc_thr_rgh_fct + if (lnd_frc_mbl(p) > 0.0_r8) then ! if bare land fraction is larger than 0 then calculate the dust emission equation ! reset these variables which will be updated in the following if-block - !wnd_frc_slt = fv(p) + !wnd_frc_slt = fv(p) ! we don't need this line because its calculation is moved upward flx_mss_hrz_slt_ttl = 0.0_r8 flx_mss_vrt_dst_ttl(p) = 0.0_r8 ! the following line comes from subr. dst_mbl ! purpose: threshold saltation wind speed - wnd_rfr_thr_slt = u10(p) * wnd_frc_thr_slt / fv(p) ! keep and use if I want Z03 scheme -dmleung - - ! the following if-block comes from subr. wnd_frc_slt_get - ! purpose: compute the saltating friction velocity - ! theory: saltation roughens the boundary layer, AKA "Owen's effect" - - !if (u10(p) >= wnd_rfr_thr_slt) then - ! wnd_rfr_dlt = u10(p) - wnd_rfr_thr_slt - ! wnd_frc_slt_dlt = 0.003_r8 * wnd_rfr_dlt * wnd_rfr_dlt - ! wnd_frc_slt = fv(p) + wnd_frc_slt_dlt - !end if + wnd_rfr_thr_slt = u10(p) * wnd_frc_thr_slt / fv(p) ! keep and use if we want the default Z03 scheme + ! the following comes from subr. flx_mss_hrz_slt_ttl_Whi79_get ! purpose: compute vertically integrated streamwise mass flux of particles - !if (wnd_frc_slt > wnd_frc_thr_slt) then! if want to use fluid threshold for dust emission, uncomment this one, -dmleung 2 Dec 2021 - if (wnd_frc_slt > wnd_frc_thr_slt_it) then! if want to use impact threshold for dust emission, uncomment this one, -dmleung 2 Dec 2021 + !if (wnd_frc_slt > wnd_frc_thr_slt) then! if using Zender's scheme, use fluid threshold for dust emission equation below + if (wnd_frc_slt > wnd_frc_thr_slt_it) then! if using Leung's scheme, use impact threshold for dust emission equation !################### for Zender et al. (2003) scheme -dmleung ########################### !################ uncomment the below block if want to use Z03 scheme ################### !wnd_frc_rat = wnd_frc_thr_slt / wnd_frc_slt !flx_mss_hrz_slt_ttl = cst_slt * forc_rho(c) * (wnd_frc_slt**3.0_r8) * & - ! (1.0_r8 - wnd_frc_rat) * (1.0_r8 + wnd_frc_rat) * (1.0_r8 + wnd_frc_rat) / grav + ! (1.0_r8 - wnd_frc_rat) * (1.0_r8 + wnd_frc_rat) * (1.0_r8 + wnd_frc_rat) / grav ! Zender dust emission equation for emission flux ! the following loop originates from subr. dst_mbl ! purpose: apply land sfc and veg limitations and global tuning factor @@ -808,40 +709,27 @@ subroutine DustEmission (bounds, & !flx_mss_hrz_slt_ttl = flx_mss_hrz_slt_ttl * lnd_frc_mbl(p) * mbl_bsn_fct(c) * & ! flx_mss_fdg_fct * liqfrac - ! dmleung moved to this block + ! !dst_slt_flx_rat_ttl = 100.0_r8 * exp( log(10.0_r8) * (13.4_r8 * mss_frc_cly_vld(c) - 6.0_r8) ) !flx_mss_vrt_dst_ttl(p) = flx_mss_hrz_slt_ttl * dst_slt_flx_rat_ttl !######################################################################################## - !################### for Kok et al. (2014) scheme -dmleung ############################## - !################ uncomment the below block if want to use K14 scheme ################### - - ! if want to use fluid threshold for dust emission, uncomment this one, -dmleung 27 Nov 2021 - !flx_mss_vrt_dst_ttl(p) = dst_emiss_coeff(p) * mss_frc_cly_vld(c) * forc_rho(c) * ((wnd_frc_slt**2.0_r8 - wnd_frc_thr_slt**2.0_r8) / wnd_frc_thr_slt_std) * (wnd_frc_slt / wnd_frc_thr_slt)**frag_expt ! change forc_rho(g) to forc_rho(c) to avoid passing Nan values to the coupler -Longlei ! if want to use fluid threshold for dust emission, uncomment this one, -dml 27 Nov 2021 + !################### for Leung et al. (2022) ################################################ + !################ uncomment the below block if want to use Leung's scheme ################### - ! if want to use impact threshold for dust emission, uncomment this one, -dmleung 2 Dec 2021 - flx_mss_vrt_dst_ttl(p) = dst_emiss_coeff(p) * mss_frc_cly_vld(c) * forc_rho(c) * ((wnd_frc_slt**2.0_r8 - wnd_frc_thr_slt_it**2.0_r8) / wnd_frc_thr_slt_std) * (wnd_frc_slt / wnd_frc_thr_slt_it)**frag_expt ! if want to use impact threshold for dust emission, uncomment this one, -dml 2 Dec 2021 + flx_mss_vrt_dst_ttl(p) = dst_emiss_coeff(p) * mss_frc_cly_vld(c) * forc_rho(c) * ((wnd_frc_slt**2.0_r8 - wnd_frc_thr_slt_it**2.0_r8) / wnd_frc_thr_slt_std) * (wnd_frc_slt / wnd_frc_thr_slt_it)**frag_expt ! Leung et al. (2022) uses Kok et al. (2014) dust emission euqation for emission flux ! account for bare soil fraction, frozen soil fraction, and apply global tuning parameter (Kok et al. 2014) flx_mss_vrt_dst_ttl(p) = flx_mss_vrt_dst_ttl(p) * lnd_frc_mbl(p) * C_tune * liqfrac !######################################################################################## end if - ! the following comes from subr. flx_mss_vrt_dst_ttl_MaB95_get - ! purpose: diagnose total vertical mass flux of dust from vertically - ! integrated streamwise mass flux - - !dst_slt_flx_rat_ttl = 100.0_r8 * exp( log(10.0_r8) * (13.4_r8 * mss_frc_cly_vld(c) - 6.0_r8) ) ! dmleung commented and moved to the previous block - !flx_mss_vrt_dst_ttl(p) = flx_mss_hrz_slt_ttl * dst_slt_flx_rat_ttl - - !############## added by dmleung 2 Dec 2021 ############################################# - ! subsection for intermittency factor calculation - ! need to use with impact threshold and cannot be used with fluid threshold - ! Danny M. Leung, 24 Jun 2019, readded into CLM5 by dmleung 2 Dec 2021 - ! 2 Dec 2021 note: assume no buoyancy contribution to the wind fluctuation (u_sd_slt), so no obul(p) is needed. It is shown to be important for the wind fluctuations contribute little to the intermittency factor. We might add this back in the future revisions. + !############## Danny M. Leung added the intermittency calculation ################################# + ! subsection for intermittency factor calculation (only used by Leung's scheme, not Zender's scheme) + ! 2 Dec 2021: assume no buoyancy contribution to the wind fluctuation (u_sd_slt), so no obul(p) is needed. It is shown to be important for the wind fluctuations contribute little to the intermittency factor. We might add this back in the future revisions. ! mean lowpass-filtered wind speed at 0.1 m saltation height (assuming aerodynamic roughness length = 1e-4 m globally for ease; also assuming neutral condition) - u_mean_slt(p) = (wnd_frc_slt/k) * log(0.1_r8 / 1e-4_r8) + u_mean_slt(p) = (wnd_frc_slt/k) * log(0.1_r8 / 1e-4_r8) ! translating from ustar (velocity scale) to actual wind ! sd of lowpass-filtered wind speed !if (obul(p)==0) then @@ -851,15 +739,15 @@ subroutine DustEmission (bounds, & ! zetaobu = 1000_r8 / obul(p) ! For now zii is a constant of 1000 m in CLM -dml, 24 Aug 2021 !end if !stblty(p) = zetaobu ! zetaobu get outputted as the Obukhov stability parameter - stblty(p) = 0 ! -dmleung 2 Dec 2021: use 0 for now, assuming no buoyancy contribution. Might uncomment the above lines in future revisions. - if ((12_r8 - 0.5_r8 * stblty(p)) .GE. 0.001_r8) then + stblty(p) = 0 ! -dmleung 2 Dec 2021: use stability = 0 for now, assuming no buoyancy contribution. Might uncomment the above lines in future revisions. + if ((12_r8 - 0.5_r8 * stblty(p)) .GE. 0.001_r8) then ! should have used 0 theoretically; used 0.001 here to avoid undefined values u_sd_slt(p) = wnd_frc_slt * (12_r8 - 0.5_r8 * stblty(p))**0.333_r8 else u_sd_slt(p) = 0.001_r8 ! should have used 0 theoretically; used 0.001 here to avoid undefined values end if ! threshold velocities - ! Here wnd_frc_thr_slt is the fluid threshold; wnd_frc_thr_dry(p) is the dry fluid threshold; B_it*wnd_frc_thr_dry(p) is the impact threshold, -dml, 1 Mar 2021 + ! Here wnd_frc_thr_slt is the fluid threshold; wnd_frc_thr_dry(p) is the dry fluid threshold; B_it*wnd_frc_thr_dry(p) is the impact threshold ! fluid threshold wind at 0.1 m saltation height u_fld_thr(p) = (wnd_frc_thr_slt/k) * log(0.1_r8 / 1e-4_r8) ! impact threshold wind at 0.1 m saltation height @@ -877,13 +765,13 @@ subroutine DustEmission (bounds, & intrmtncy_fct(p) = 1_r8 - prb_crs_fld_thr(p) + thr_crs_rate(p) * (prb_crs_fld_thr(p) - prb_crs_impct_thr(p)) ! multiply dust emission flux by intermittency factor - if (intrmtncy_fct(p) /= intrmtncy_fct(p)) then ! if intrmtncy_fct(p) is not NaN then multiply by intermittency factor; this statement is needed because dust emission flx_mss_vrt_dst_ttl(p) has to be non NaN (at least zero) to be outputted, dmleung 9 Jun 2021 - flx_mss_vrt_dst_ttl(p) = flx_mss_vrt_dst_ttl(p) ! -dmleung + if (intrmtncy_fct(p) /= intrmtncy_fct(p)) then ! if intrmtncy_fct(p) is not NaN then multiply by intermittency factor; this statement is needed because dust emission flx_mss_vrt_dst_ttl(p) has to be non NaN (at least zero) to be outputted + flx_mss_vrt_dst_ttl(p) = flx_mss_vrt_dst_ttl(p) else - flx_mss_vrt_dst_ttl(p) = flx_mss_vrt_dst_ttl(p) * intrmtncy_fct(p) ! multiply dust flux by intermittency -dmleung + flx_mss_vrt_dst_ttl(p) = flx_mss_vrt_dst_ttl(p) * intrmtncy_fct(p) ! multiply dust flux by intermittency end if - !############### end my intermittency subsection here -dmleung ######################################## + !############ end the intermittency subsection here; only use for Leung's scheme ########################## end if ! lnd_frc_mbl > 0.0 diff --git a/src/biogeophys/SoilStateInitTimeConstMod.F90 b/src/biogeophys/SoilStateInitTimeConstMod.F90 index fc96a878bc..0e31cc2c53 100644 --- a/src/biogeophys/SoilStateInitTimeConstMod.F90 +++ b/src/biogeophys/SoilStateInitTimeConstMod.F90 @@ -703,8 +703,8 @@ subroutine SoilStateInitTimeConst(bounds, soilstate_inst, nlfilename) do c = begc,endc g = col%gridcell(c) - soilstate_inst%gwc_thr_col(c) = 0.01_r8*(0.17_r8*clay3d(g,1) + 0.0014_r8*clay3d(g,1)*clay3d(g,1)) !Fecan et al. (1999) -jfk, dmleung coded 27 Nov 2021 for CLM clay fraction - !soilstate_inst%gwc_thr_col(c) = 0.17_r8 + 0.14_r8 * clay3d(g,1) * 0.01_r8 -dmleung commented 27 Nov 2021 + soilstate_inst%gwc_thr_col(c) = 0.01_r8*(0.17_r8*clay3d(g,1) + 0.0014_r8*clay3d(g,1)*clay3d(g,1)) ! Danny M. Leung modified the equation of soil moisture effect for dust emissions using a scale factor of 1. 0.01 is to convert from % to fraction. + !soilstate_inst%gwc_thr_col(c) = 0.17_r8 + 0.14_r8 * clay3d(g,1) * 0.01_r8 ! This was the original equation with 1 / (clay fraction) being the scaling factor. soilstate_inst%mss_frc_cly_vld_col(c) = min(clay3d(g,1) * 0.01_r8, 0.20_r8) end do diff --git a/src/cpl/share_esmf/PrigentRoughnessStreamType.F90 b/src/cpl/share_esmf/PrigentRoughnessStreamType.F90 index 19ab3cb573..cef34682c9 100644 --- a/src/cpl/share_esmf/PrigentRoughnessStreamType.F90 +++ b/src/cpl/share_esmf/PrigentRoughnessStreamType.F90 @@ -1,11 +1,10 @@ module PrigentRoughnessStreamType -!dmleung modified based on ch4FInundatedStreamType on 17 Nov 2022 -#include "shr_assert.h" ! What is this? In many modules but not dust module +#include "shr_assert.h" !----------------------------------------------------------------------- ! !DESCRIPTION: - ! Contains methods for reading in the Prigent et al. (1997) roughness length streams file. dmleung 22 Nov 2022 - ! + ! Contains methods for reading in the Prigent et al. (1997) roughness length streams file + ! Created by Danny M. Leung 22 Nov 2022 ! !USES use ESMF use dshr_strdata_mod , only : shr_strdata_type @@ -83,11 +82,11 @@ subroutine Init(this, bounds, NLFilename) character(len=*), parameter :: stream_name = 'prigentroughness' !----------------------------------------------------------------------- - !if ( finundation_mtd /= finundation_mtd_h2osfc )then ! how should I change this? comment out for now + !if ( finundation_mtd /= finundation_mtd_h2osfc )then call this%InitAllocate( bounds ) call control%ReadNML( bounds, NLFileName ) - if ( this%useStreams() )then ! is this a namelist input and is it set in namelist default + if ( this%useStreams() )then allocate(stream_varnames(1)) stream_varnames = (/"Z0a"/) ! varname in cdf5_Z0a_Prigent-Globe-025x025-09262022.nc, in centimeter @@ -97,7 +96,7 @@ subroutine Init(this, bounds, NLFilename) end if ! Initialize the cdeps data type sdat_rghn - call shr_strdata_init_from_inline(sdat_rghn, & ! what is this function and where does it come from? + call shr_strdata_init_from_inline(sdat_rghn, & my_task = iam, & logunit = iulog, & compname = 'LND', & @@ -132,7 +131,7 @@ subroutine Init(this, bounds, NLFilename) sec = 0 mcdate = year*10000 + mon*100 + day - call shr_strdata_advance(sdat_rghn, ymd=mcdate, tod=sec, logunit=iulog, istr='prigentrghn', rc=rc) ! what is istr and do I need to change elsewhere because the change of istr here + call shr_strdata_advance(sdat_rghn, ymd=mcdate, tod=sec, logunit=iulog, istr='prigentrghn', rc=rc) if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) then call ESMF_Finalize(endflag=ESMF_END_ABORT) end if @@ -146,7 +145,7 @@ subroutine Init(this, bounds, NLFilename) if (trim(stream_varnames(n)) == 'Z0a') then ig = 0 do g = bounds%begg,bounds%endg - ig = ig+1 ! not sure why +1 is needed but it's okay + ig = ig+1 this%prigent_rghn(g) = dataptr1d(ig) end do @@ -154,7 +153,7 @@ subroutine Init(this, bounds, NLFilename) end do end if - !end if !comment out for now + !end if !commented out end subroutine Init @@ -172,7 +171,7 @@ logical function UseStreams(this) ! ! !LOCAL VARIABLES: if ( trim(control%stream_fldFileName_prigentroughness) == '' )then - UseStreams = .false. ! dmleung: this won't happen and UseStreams will always be true + UseStreams = .false. ! this won't happen and UseStreams will always be true else UseStreams = .true. end if @@ -193,11 +192,9 @@ subroutine InitAllocate(this, bounds) type(bounds_type), intent(in) :: bounds ! ! !LOCAL VARIABLES: - !integer :: begc, endc integer :: begg, endg !--------------------------------------------------------------------- - !begc = bounds%begc; endc = bounds%endc begg = bounds%begg; endg = bounds%endg allocate(this%prigent_rghn (begg:endg)) ; this%prigent_rghn (:) = nan @@ -205,13 +202,10 @@ subroutine InitAllocate(this, bounds) end subroutine InitAllocate !============================================================================== - !subroutine CalcFinundated(this, bounds, num_soilc, filter_soilc, soilhydrology_inst, & - ! waterdiagnosticbulk_inst, qflx_surf_lag_col, finundated ) - !subroutine CalcDragPartition(this, bounds, num_nolakep, filter_nolakep, dpfct_rock) subroutine CalcDragPartition(this, bounds, dpfct_rock) ! ! !DESCRIPTION: - ! Commented below by dmleung 31 Dec 2022 + ! Commented below by Danny M. Leung 31 Dec 2022 ! Calculate the drag partition effect of friction velocity due to surface roughness following ! Leung et al. (2022). This module is used in the dust emission module DUSTMod.F90 for ! calculating drag partitioning. The drag partition equation comes from Marticorena and @@ -222,9 +216,7 @@ subroutine CalcDragPartition(this, bounds, dpfct_rock) ! subroutine is used in the InitCold subroutine of DUSTMod.F90. ! ! !USES: - !use ColumnType , only : col use PatchType , only : patch - !USES dmleung added 31 Dec 2022 use landunit_varcon , only : istdlak use LandunitType , only : lun ! @@ -235,7 +227,6 @@ subroutine CalcDragPartition(this, bounds, dpfct_rock) real(r8) , intent(inout) :: dpfct_rock(bounds%begp:) ! [fraction] rock drag partition factor (roughness effect) ! ! !LOCAL VARIABLES: - !integer :: g, c, fc ! Indices integer :: g, p, fp, l ! Indices real(r8) :: z0s ! smooth roughness length (m) @@ -244,17 +235,11 @@ subroutine CalcDragPartition(this, bounds, dpfct_rock) real(r8), parameter :: X = 10_r8 ! [m] distance downwind of the roughness element (rock). Assume estimating roughness effect at a distance of 10 m following Leung et al. (2022) !--------------------------------------------------------------------- - SHR_ASSERT_ALL_FL((ubound(dpfct_rock) == (/bounds%endp/)), sourcefile, __LINE__) !what's the use of this - - !associate( & - !z => col%z & ! Input: [real(r8) (:,:) ] layer depth (m) (-nlevsno+1:nlevsoi) - !) + SHR_ASSERT_ALL_FL((ubound(dpfct_rock) == (/bounds%endp/)), sourcefile, __LINE__) ! dmleung: this loop calculates the drag partition effect (or roughness effect) of rocks. We save the drag partition factor as a patch level quantity. z0s = 2_r8 * D_p / 30_r8 ! equation from Frank M. White (2006). Here we assume soil medium size is a global constant, and so is smooth roughness length. - !do fp = 1,num_nolakep - !p = filter_nolakep(fp) do p = bounds%begp,bounds%endp g = patch%gridcell(p) l = patch%landunit(p) @@ -263,8 +248,6 @@ subroutine CalcDragPartition(this, bounds, dpfct_rock) end if end do - !end associate - end subroutine CalcDragPartition !============================================================================== @@ -289,7 +272,7 @@ subroutine ReadNML(this, bounds, NLFilename) character(len=CL) :: stream_fldFileName_prigentroughness = ' ' character(len=CL) :: stream_meshfile_prigentroughness = ' ' character(len=CL) :: prigentroughnessmapalgo = 'bilinear' - character(len=*), parameter :: namelist_name = 'prigentroughness' ! MUST agree with group name in namelist definition to read. dmleung commented + character(len=*), parameter :: namelist_name = 'prigentroughness' ! MUST agree with group name in namelist definition to read. character(len=*), parameter :: subName = "('prigentroughness::ReadNML')" !----------------------------------------------------------------------- diff --git a/src/main/clm_instMod.F90 b/src/main/clm_instMod.F90 index 13390d3417..099959581f 100644 --- a/src/main/clm_instMod.F90 +++ b/src/main/clm_instMod.F90 @@ -340,7 +340,7 @@ subroutine clm_instInit(bounds) call surfrad_inst%Init(bounds) - call dust_inst%Init(bounds, NLFilename) ! dmleung added NLFilename 31 Dec 2022 + call dust_inst%Init(bounds, NLFilename) allocate(scf_method, source = CreateAndInitSnowCoverFraction( & snow_cover_fraction_method = snow_cover_fraction_method, & From 62b7bcd6f8f8d72b209accb1bff0daff992826c3 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Fri, 9 Jun 2023 16:52:23 -0600 Subject: [PATCH 0038/1248] Truncate threshold crossing rate to zero, if the term going into the exp is going to be large and thus end up with a very small term --- src/biogeochem/DUSTMod.F90 | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/biogeochem/DUSTMod.F90 b/src/biogeochem/DUSTMod.F90 index f1de13902a..496553dd24 100644 --- a/src/biogeochem/DUSTMod.F90 +++ b/src/biogeochem/DUSTMod.F90 @@ -432,14 +432,14 @@ subroutine DustEmission (bounds, & ! real(r8), parameter :: cst_slt = 2.61_r8 ! [frc] Saltation constant real(r8), parameter :: flx_mss_fdg_fct = 5.0e-4_r8 ! [frc] Empir. mass flx tuning eflx_lh_vegt - !real(r8), parameter :: vai_mbl_thr = 0.3_r8 ! [m2 m-2] VAI threshold quenching dust mobilization + !real(r8), parameter :: vai_mbl_thr = 0.3_r8 ! [m2 m-2] VAI threshold quenching dust mobilization !####### added by dmleung 27 Nov 2021 ########################################################################### character(len=*),parameter :: subname = 'DUSTEmission' real(r8), parameter :: vai_mbl_thr = 1.0_r8 ! [m2 m-2] new VAI threshold; dmleung suggests 1 or 0.5, and the default 0.3 seems a bit too small -dmleung 27 Nov 2021 real(r8), parameter :: Cd0 = 4.4e-5_r8 ! [dimless] proportionality constant in calculation of dust emission coefficient -jfk real(r8), parameter :: Ca = 2.7_r8 ! [dimless] proportionality constant in scaling of dust emission exponent -jfk real(r8), parameter :: Ce = 2.0_r8 ! [dimless] proportionality constant scaling exponential dependence of dust emission coefficient on standardized soil threshold friction speed -jfk - real(r8), parameter :: C_tune = 0.05_r8 ! [dimless] global tuning constant for vertical dust flux; set to produce ~same global dust flux in control sim (I_2000) as old parameterization -jfk + real(r8), parameter :: C_tune = 0.05_r8 ! [dimless] global tuning constant for vertical dust flux; set to produce ~same global dust flux in control sim (I_2000) as old parameterization -jfk real(r8), parameter :: wnd_frc_thr_slt_std_min = 0.16_r8 ! [m/s] minimum standardized soil threshold friction speed -jfk real(r8), parameter :: forc_rho_std = 1.2250_r8 ! [kg/m3] density of air at standard pressure (101325) and temperature (293 K) -jfk real(r8), parameter :: dns_slt = 2650.0_r8 ! [kg m-3] Density of optimal saltation particles, dml 23 May 2020 @@ -448,7 +448,9 @@ subroutine DustEmission (bounds, & real(r8), parameter :: k = 0.4_r8 ! [dimless] von Karman constant -dml !####### added by dmleung 2 Dec 2021 for Okin (2008) drag partition for plants ########################################################## real(r8), parameter :: f_0 = 0.32_r8 ! [dimless] SSR in the immediate lee of a plant, dimensionless - real(r8), parameter :: c_e = 4.8_r8 ! [dimless] e-folding distance velocity recovery, dimensionless + real(r8), parameter :: c_e = 4.8_r8 ! [dimless] e-folding distance velocity recovery, dimensionless + real(r8) :: numer ! Numerator term for threshold crossing rate + real(r8) :: denom ! Denominator term for threshold crossing rate !################################################################################################################ !################################################################################################################ !------------------------------------------------------------------------ @@ -866,7 +868,14 @@ subroutine DustEmission (bounds, & u_impct_thr(p) = (wnd_frc_thr_slt_it/k) * log(0.1_r8 / 1e-4_r8) ! to avoid model error ! threshold crossing rate - thr_crs_rate(p) = (exp((u_fld_thr(p)**2_r8 - u_impct_thr(p)**2_r8 - 2_r8 * u_mean_slt(p) * (u_fld_thr(p) - u_impct_thr(p))) / (2_r8 * u_sd_slt(p)**2_r8)) + 1_r8)**(-1_r8) + numer = (u_fld_thr(p)**2_r8 - u_impct_thr(p)**2_r8 - 2_r8 * u_mean_slt(p) * (u_fld_thr(p) - u_impct_thr(p))) + denom = (2_r8 * u_sd_slt(p)**2_r8) + ! Truncate to zero if the expression inside exp is becoming too large + if ( numer/denom < 30._r8 )then + thr_crs_rate(p) = (exp((u_fld_thr(p)**2_r8 - u_impct_thr(p)**2_r8 - 2_r8 * u_mean_slt(p) * (u_fld_thr(p) - u_impct_thr(p))) / (2_r8 * u_sd_slt(p)**2_r8)) + 1_r8)**(-1_r8) + else + thr_crs_rate(p) = 0.0_r8 + end if ! probability that lowpass-filtered wind speed does not exceed u_ft prb_crs_fld_thr(p) = 0.5_r8 * (1_r8 + erf((u_fld_thr(p) - u_mean_slt(p)) / (1.414_r8 * u_sd_slt(p)))) From 3868bdccb30c8d85042c8f0869cbbabf8e62d4c1 Mon Sep 17 00:00:00 2001 From: John Alex Date: Wed, 21 Jun 2023 11:16:14 -0600 Subject: [PATCH 0039/1248] Document that fincl1 maps to 'h0' history file. And fexcl1. --- src/main/histFileMod.F90 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/histFileMod.F90 b/src/main/histFileMod.F90 index 2497a14667..b6bda0cea6 100644 --- a/src/main/histFileMod.F90 +++ b/src/main/histFileMod.F90 @@ -90,6 +90,7 @@ module histFileMod character(len=max_namlen+2), public :: & hist_fincl1(max_flds) = ' ' ! namelist: list of fields to include in history tape 1 + ! aka 'h0' history file. character(len=max_namlen+2), public :: & hist_fincl2(max_flds) = ' ' ! namelist: list of fields to include in history tape 2 character(len=max_namlen+2), public :: & @@ -115,6 +116,7 @@ module histFileMod character(len=max_namlen+2), public :: & hist_fexcl1(max_flds) = ' ' ! namelist: list of fields to exclude from history tape 1 + ! aka 'h0' history file. character(len=max_namlen+2), public :: & hist_fexcl2(max_flds) = ' ' ! namelist: list of fields to exclude from history tape 2 character(len=max_namlen+2), public :: & From 302556635395e7d30c58ef097219a1b242ff4dbf Mon Sep 17 00:00:00 2001 From: cathyxinchangli <55264121+cathyxinchangli@users.noreply.github.com> Date: Thu, 13 Jul 2023 12:49:08 +0800 Subject: [PATCH 0040/1248] Update UrbBuildTempOleson2015Mod.F90 Bug fix: t_building calculation --- src/biogeophys/UrbBuildTempOleson2015Mod.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/biogeophys/UrbBuildTempOleson2015Mod.F90 b/src/biogeophys/UrbBuildTempOleson2015Mod.F90 index 2a5440e324..e8f7555e0e 100644 --- a/src/biogeophys/UrbBuildTempOleson2015Mod.F90 +++ b/src/biogeophys/UrbBuildTempOleson2015Mod.F90 @@ -936,7 +936,7 @@ subroutine BuildingTemperature (bounds, num_urbanl, filter_urbanl, num_nolakec, eflx_urban_ac_sat(l) = wtlunit_roof(l) * abs( (ht_roof(l) * rho_dair(l) * cpair / dtime) * t_building_max(l) & - (ht_roof(l) * rho_dair(l) * cpair / dtime) * t_building_bef_hac(l) ) t_building(l) = t_building_max(l) + ( 1._r8 - p_ac(l) ) * eflx_urban_ac_sat(l) & - * dtime / (ht_roof(l) * rho_dair(l) * cpair) + * dtime / (ht_roof(l) * rho_dair(l) * cpair * wtlunit_roof(l)) eflx_urban_ac(l) = p_ac(l) * eflx_urban_ac_sat(l) else ! Cathy [orig] From af82c41c4ec51f471552295475e63d5d2b31bde5 Mon Sep 17 00:00:00 2001 From: cathyxinchangli <55264121+cathyxinchangli@users.noreply.github.com> Date: Wed, 11 Oct 2023 15:51:57 -0500 Subject: [PATCH 0041/1248] Bug fix Bug fix on view factor and radiative energy balance check --- src/biogeophys/UrbBuildTempOleson2015Mod.F90 | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/biogeophys/UrbBuildTempOleson2015Mod.F90 b/src/biogeophys/UrbBuildTempOleson2015Mod.F90 index e8f7555e0e..f6330ec10b 100644 --- a/src/biogeophys/UrbBuildTempOleson2015Mod.F90 +++ b/src/biogeophys/UrbBuildTempOleson2015Mod.F90 @@ -432,7 +432,10 @@ subroutine BuildingTemperature (bounds, num_urbanl, filter_urbanl, num_nolakec, vf_wf(l) = 0.5_r8*(1._r8 - vf_rf(l)) ! This view factor implicitly converts from per unit floor area to per unit wall area - vf_fw(l) = vf_wf(l) / building_hwr(l) + ! Cathy [orig] + ! vf_fw(l) = vf_wf(l) / building_hwr(l) + ! Cathy [bugfix] + vf_fw(l) = vf_wf(l) ! This view factor implicitly converts from per unit roof area to per unit wall area vf_rw(l) = vf_fw(l) @@ -838,7 +841,10 @@ subroutine BuildingTemperature (bounds, num_urbanl, filter_urbanl, num_nolakec, + em_floori(l)*sb*t_floor_bef(l)**4._r8 & + 4._r8*em_floori(l)*sb*t_floor_bef(l)**3.*(t_floor(l) - t_floor_bef(l)) - qrd_building(l) = qrd_roof(l) + building_hwr(l)*(qrd_sunw(l) + qrd_shdw(l)) + qrd_floor(l) + ! Cathy [orig] + ! qrd_building(l) = qrd_roof(l) + building_hwr(l)*(qrd_sunw(l) + qrd_shdw(l)) + qrd_floor(l) + ! Cathy [bugfix] + qrd_building(l) = qrd_roof(l) + qrd_sunw(l) + qrd_shdw(l) + qrd_floor(l) if (abs(qrd_building(l)) > .10_r8 ) then write (iulog,*) 'urban inside building net longwave radiation balance error ',qrd_building(l) From effacf2b1db196c7bf4c4fa87d45628fd25e9e00 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Tue, 28 Nov 2023 14:27:07 -0700 Subject: [PATCH 0042/1248] Corrections for cheyenne test-suite to pass --- src/biogeochem/CNCStateUpdate1Mod.F90 | 6 ------ src/biogeochem/CNNStateUpdate1Mod.F90 | 14 ++++++++------ 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/src/biogeochem/CNCStateUpdate1Mod.F90 b/src/biogeochem/CNCStateUpdate1Mod.F90 index 8c6fc11602..76b14585b4 100644 --- a/src/biogeochem/CNCStateUpdate1Mod.F90 +++ b/src/biogeochem/CNCStateUpdate1Mod.F90 @@ -325,15 +325,9 @@ subroutine CStateUpdate1( num_soilc, filter_soilc, num_soilp, filter_soilp, & cs_veg%cropseedc_deficit_patch(p) = cs_veg%cropseedc_deficit_patch(p) & - cf_veg%crop_seedc_to_leaf_patch(p) * dt do k = repr_grain_min, repr_grain_max - cs_veg%reproductivec_patch(p,k) = cs_veg%reproductivec_patch(p,k) & - - (cf_veg%repr_grainc_to_food_patch(p,k) + cf_veg%repr_grainc_to_seed_patch(p,k))*dt cs_veg%cropseedc_deficit_patch(p) = cs_veg%cropseedc_deficit_patch(p) & + cf_veg%repr_grainc_to_seed_patch(p,k) * dt end do - do k = repr_structure_min, repr_structure_max - cs_veg%reproductivec_patch(p,k) = cs_veg%reproductivec_patch(p,k) & - - (cf_veg%repr_structurec_to_cropprod_patch(p,k) + cf_veg%repr_structurec_to_litter_patch(p,k))*dt - end do end if end if !not use_matrixcn diff --git a/src/biogeochem/CNNStateUpdate1Mod.F90 b/src/biogeochem/CNNStateUpdate1Mod.F90 index 8aa24e3aa3..4a9e081583 100644 --- a/src/biogeochem/CNNStateUpdate1Mod.F90 +++ b/src/biogeochem/CNNStateUpdate1Mod.F90 @@ -226,21 +226,23 @@ subroutine NStateUpdate1(num_soilc, filter_soilc, num_soilp, filter_soilp, & ns_veg%leafn_patch(p) = ns_veg%leafn_patch(p) - nf_veg%leafn_to_biofueln_patch(p)*dt ns_veg%livestemn_patch(p) = ns_veg%livestemn_patch(p) - nf_veg%livestemn_to_retransn_patch(p)*dt ns_veg%retransn_patch(p) = ns_veg%retransn_patch(p) + nf_veg%livestemn_to_retransn_patch(p)*dt + do k = repr_grain_min, repr_grain_max + ns_veg%reproductiven_patch(p,k) = ns_veg%reproductiven_patch(p,k) & + - (nf_veg%repr_grainn_to_food_patch(p,k) + nf_veg%repr_grainn_to_seed_patch(p,k))*dt + end do + do k = repr_structure_min, repr_structure_max + ns_veg%reproductiven_patch(p,k) = ns_veg%reproductiven_patch(p,k) & + - (nf_veg%repr_structuren_to_cropprod_patch(p,k) + nf_veg%repr_structuren_to_litter_patch(p,k))*dt + end do else ! NOTE: The equivalent changes for matrix code are in CNPhenology EBK (11/26/2019) end if !not use_matrixcn ns_veg%cropseedn_deficit_patch(p) = ns_veg%cropseedn_deficit_patch(p) & - nf_veg%crop_seedn_to_leaf_patch(p) * dt do k = repr_grain_min, repr_grain_max - ns_veg%reproductiven_patch(p,k) = ns_veg%reproductiven_patch(p,k) & - - (nf_veg%repr_grainn_to_food_patch(p,k) + nf_veg%repr_grainn_to_seed_patch(p,k))*dt ns_veg%cropseedn_deficit_patch(p) = ns_veg%cropseedn_deficit_patch(p) & + nf_veg%repr_grainn_to_seed_patch(p,k) * dt end do - do k = repr_structure_min, repr_structure_max - ns_veg%reproductiven_patch(p,k) = ns_veg%reproductiven_patch(p,k) & - - (nf_veg%repr_structuren_to_cropprod_patch(p,k) + nf_veg%repr_structuren_to_litter_patch(p,k))*dt - end do end if ! uptake from soil mineral N pool From ffc6acc0184df317314d5d2cdd36076627d854a1 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Wed, 29 Nov 2023 17:47:40 -0700 Subject: [PATCH 0043/1248] Upd. expected fails, test list, and relevant error checks --- bld/CLMBuildNamelist.pm | 7 ++++ cime_config/testdefs/ExpectedTestFails.xml | 28 +++++++++++++++ cime_config/testdefs/testlist_clm.xml | 40 ++++++++++++++++++++++ src/biogeochem/CropReprPoolsMod.F90 | 11 ++++++ 4 files changed, 86 insertions(+) diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index b0d533ebde..b92acc34c7 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -4222,6 +4222,13 @@ sub setup_logic_cnmatrix { } # Otherwise for CN or BGC mode } else { + # If matrixcn is on, for_testing_use_second_grain_pool and for_testing_use_repr_structure_pool must be off + if ( &value_is_true($nl->get_value("use_matrixcn")) && &value_is_true($nl_flags->{"for_testing_use_second_grain_pool"}) ) { + $log->fatal_error("for_testing_use_second_grain_pool can NOT be on when use_matrixcn is on" ); + } + if ( &value_is_true($nl->get_value("use_matrixcn")) && &value_is_true($nl_flags->{"for_testing_use_repr_structure_pool"}) ) { + $log->fatal_error("for_testing_use_repr_structure_pool can NOT be on when use_matrixcn is on" ); + } # If both matrixcn and soil_matrix are off outmatrix can't be on if ( ! &value_is_true($nl->get_value("use_matrixcn")) && ! &value_is_true($nl_flags->{"use_soil_matrixcn"}) ) { my $var = "is_outmatrix"; diff --git a/cime_config/testdefs/ExpectedTestFails.xml b/cime_config/testdefs/ExpectedTestFails.xml index 2656079bf7..a55ce73634 100644 --- a/cime_config/testdefs/ExpectedTestFails.xml +++ b/cime_config/testdefs/ExpectedTestFails.xml @@ -44,6 +44,34 @@ + + + FAIL + #640, same test with clm-ciso_soil_matrixcn_only works + + + + + + FAIL + #640, same test with clm-ciso_soil_matrixcn_only works + + + + + + FAIL + #640, same test with clm-ciso_soil_matrixcn_only works + + + + + + FAIL + #640, same test with clm-ciso_soil_matrixcn_only works + + + diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index e570603ff7..100067f90d 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -2599,6 +2599,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/biogeochem/CropReprPoolsMod.F90 b/src/biogeochem/CropReprPoolsMod.F90 index 780b9f2d52..82469b074f 100644 --- a/src/biogeochem/CropReprPoolsMod.F90 +++ b/src/biogeochem/CropReprPoolsMod.F90 @@ -57,6 +57,11 @@ subroutine crop_repr_pools_init() ! !DESCRIPTION: ! Initialize module-level data ! + ! !USES: + use clm_varctl, only: use_matrixcn + use abortutils, only: endrun + use shr_log_mod, only: errmsg => shr_log_errMsg + ! ! !ARGUMENTS: ! ! !LOCAL VARIABLES: @@ -77,11 +82,17 @@ subroutine crop_repr_pools_init() ! repr_hist_fnames(1) = 'GRAIN_MEAL', grain_hist_fnames(2) = 'GRAIN_OIL', etc. if (for_testing_use_second_grain_pool) then nrepr_grain = 2 + if (use_matrixcn) then + call endrun(msg="ERROR: for_testing_use_second_grain_pool should be .false. when use_matrixcn = .true."//errmsg(sourcefile, __LINE__)) + end if else nrepr_grain = 1 end if if (for_testing_use_repr_structure_pool) then nrepr_structure = 2 + if (use_matrixcn) then + call endrun(msg="ERROR: for_testing_use_repr_structure_pool should be .false. when use_matrixcn = .true."//errMsg(sourcefile, __LINE__)) + end if else nrepr_structure = 0 end if From 040111314eb439f6815b4519174d179882650c42 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Fri, 1 Dec 2023 15:50:14 -0700 Subject: [PATCH 0044/1248] Update expected fails and testlist files --- bld/CLMBuildNamelist.pm | 5 +++++ cime_config/testdefs/ExpectedTestFails.xml | 13 +++---------- cime_config/testdefs/testlist_clm.xml | 12 ------------ 3 files changed, 8 insertions(+), 22 deletions(-) diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index b92acc34c7..f02be0c91a 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -4222,6 +4222,11 @@ sub setup_logic_cnmatrix { } # Otherwise for CN or BGC mode } else { + # TODO (slevis 2023/12/1) The next two if statements do nothing. Erik K and Sam L found that + # for_testing_use_second_grain_pool and for_testing_use_repr_structure_pool + # are empty rather than .true. or .false., but we did not get to the bottom + # of why, yet. The same error-check in the code does get triggered at run-time, + # so we will not pursue fixing this right now. # If matrixcn is on, for_testing_use_second_grain_pool and for_testing_use_repr_structure_pool must be off if ( &value_is_true($nl->get_value("use_matrixcn")) && &value_is_true($nl_flags->{"for_testing_use_second_grain_pool"}) ) { $log->fatal_error("for_testing_use_second_grain_pool can NOT be on when use_matrixcn is on" ); diff --git a/cime_config/testdefs/ExpectedTestFails.xml b/cime_config/testdefs/ExpectedTestFails.xml index a55ce73634..18619818fa 100644 --- a/cime_config/testdefs/ExpectedTestFails.xml +++ b/cime_config/testdefs/ExpectedTestFails.xml @@ -30,17 +30,10 @@ - - + + FAIL - PGI problems with the nuopc driver - - - - - - FAIL - PGI problems with the nuopc driver + Accessing incorrect url for neon data; will resolve itself when we update cnmatrix to some newer tag diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index 100067f90d..ede4f6d278 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -1177,7 +1177,6 @@ - @@ -1431,7 +1430,6 @@ - @@ -1446,15 +1444,6 @@ - - - - - - - - - @@ -1548,7 +1537,6 @@ - From 529bd1593064060ef5234089ccaa43fba379775b Mon Sep 17 00:00:00 2001 From: cathyxinchangli <55264121+cathyxinchangli@users.noreply.github.com> Date: Fri, 1 Dec 2023 17:26:58 -0600 Subject: [PATCH 0045/1248] preparing for PR Formalized comments in the code --- bld/CLMBuildNamelist.pm | 2 +- bld/namelist_files/namelist_defaults_ctsm.xml | 2 +- .../namelist_definition_ctsm.xml | 2 +- src/biogeophys/UrbBuildTempOleson2015Mod.F90 | 22 ++++---- src/biogeophys/UrbanParamsType.F90 | 10 ++-- src/cpl/share_esmf/UrbanTimeVarType.F90 | 56 +++++++++---------- src/main/clm_varpar.F90 | 2 +- 7 files changed, 48 insertions(+), 48 deletions(-) diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index 7c185ff6a0..0895a89ebb 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -2111,7 +2111,7 @@ sub setup_logic_urban { add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'building_temp_method'); add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'urban_hac'); - # Cathy [dev.04] + # X. Li [dev.04] 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'); } diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index 5be2604c36..a3f488b8f9 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -167,7 +167,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). NONE - + .true. .true. diff --git a/bld/namelist_files/namelist_definition_ctsm.xml b/bld/namelist_files/namelist_definition_ctsm.xml index aae38a5cec..5f89da9d29 100644 --- a/bld/namelist_files/namelist_definition_ctsm.xml +++ b/bld/namelist_files/namelist_definition_ctsm.xml @@ -948,7 +948,7 @@ Turn urban air conditioning/heating ON or OFF and add wasteheat: - + diff --git a/src/biogeophys/UrbBuildTempOleson2015Mod.F90 b/src/biogeophys/UrbBuildTempOleson2015Mod.F90 index f6330ec10b..c07b1ad0e3 100644 --- a/src/biogeophys/UrbBuildTempOleson2015Mod.F90 +++ b/src/biogeophys/UrbBuildTempOleson2015Mod.F90 @@ -210,9 +210,9 @@ subroutine BuildingTemperature (bounds, num_urbanl, filter_urbanl, num_nolakec, use clm_varctl , only : iulog use abortutils , only : endrun use clm_varpar , only : nlevurb, nlevsno, nlevmaxurbgrnd - ! Cathy [orig]: + ! X. Li [orig]: ! use UrbanParamsType , only : urban_hac, urban_hac_off, urban_hac_on, urban_wasteheat_on - ! Cathy [dev.04]: + ! X. Li [dev.04]: use UrbanParamsType , only : urban_hac, urban_hac_off, urban_hac_on, urban_wasteheat_on, urban_explicit_ac ! ! !ARGUMENTS: @@ -239,7 +239,7 @@ subroutine BuildingTemperature (bounds, num_urbanl, filter_urbanl, num_nolakec, real(r8) :: t_floor_bef(bounds%begl:bounds%endl) ! floor temperature at previous time step (K) real(r8) :: t_building_bef(bounds%begl:bounds%endl) ! internal building air temperature at previous time step [K] real(r8) :: t_building_bef_hac(bounds%begl:bounds%endl)! internal building air temperature before applying HAC [K] - ! Cathy [dev.03] + ! X. Li [dev.03] real(r8) :: eflx_urban_ac_sat(bounds%begl:bounds%endl) ! urban air conditioning flux under AC adoption saturation (W/m**2) real(r8) :: hcv_roofi(bounds%begl:bounds%endl) ! roof convective heat transfer coefficient (W m-2 K-1) real(r8) :: hcv_sunwi(bounds%begl:bounds%endl) ! sunwall convective heat transfer coefficient (W m-2 K-1) @@ -329,7 +329,7 @@ subroutine BuildingTemperature (bounds, num_urbanl, filter_urbanl, num_nolakec, t_floor => temperature_inst%t_floor_lun , & ! InOut: [real(r8) (:)] floor temperature (K) t_building => temperature_inst%t_building_lun , & ! InOut: [real(r8) (:)] internal building air temperature (K) - ! Cathy [dev] + ! X. Li [dev] p_ac => urbantv_inst%p_ac , & ! Input: [real(r8) (:)] air-conditioning penetration rate (-) t_building_max => urbantv_inst%t_building_max , & ! Input: [real(r8) (:)] maximum internal building air temperature (K) t_building_min => urbanparams_inst%t_building_min , & ! Input: [real(r8) (:)] minimum internal building air temperature (K) @@ -432,9 +432,9 @@ subroutine BuildingTemperature (bounds, num_urbanl, filter_urbanl, num_nolakec, vf_wf(l) = 0.5_r8*(1._r8 - vf_rf(l)) ! This view factor implicitly converts from per unit floor area to per unit wall area - ! Cathy [orig] + ! X. Li [orig] ! vf_fw(l) = vf_wf(l) / building_hwr(l) - ! Cathy [bugfix] + ! X. Li [bugfix] vf_fw(l) = vf_wf(l) ! This view factor implicitly converts from per unit roof area to per unit wall area @@ -841,9 +841,9 @@ subroutine BuildingTemperature (bounds, num_urbanl, filter_urbanl, num_nolakec, + em_floori(l)*sb*t_floor_bef(l)**4._r8 & + 4._r8*em_floori(l)*sb*t_floor_bef(l)**3.*(t_floor(l) - t_floor_bef(l)) - ! Cathy [orig] + ! X. Li [orig] ! qrd_building(l) = qrd_roof(l) + building_hwr(l)*(qrd_sunw(l) + qrd_shdw(l)) + qrd_floor(l) - ! Cathy [bugfix] + ! X. Li [bugfix] qrd_building(l) = qrd_roof(l) + qrd_sunw(l) + qrd_shdw(l) + qrd_floor(l) if (abs(qrd_building(l)) > .10_r8 ) then @@ -936,16 +936,16 @@ subroutine BuildingTemperature (bounds, num_urbanl, filter_urbanl, num_nolakec, ! rho_dair(l) = pstd / (rair*t_building(l)) if (t_building_bef_hac(l) > t_building_max(l)) then - ! Cathy [dev.04] + ! X. Li [dev.04] if (urban_explicit_ac) then ! use explicit ac adoption rate: - ! Cathy [dev.03] ! after the change, t_building_max is saturation setpoint + ! X. Li [dev.03] ! after the change, t_building_max is saturation setpoint eflx_urban_ac_sat(l) = wtlunit_roof(l) * abs( (ht_roof(l) * rho_dair(l) * cpair / dtime) * t_building_max(l) & - (ht_roof(l) * rho_dair(l) * cpair / dtime) * t_building_bef_hac(l) ) t_building(l) = t_building_max(l) + ( 1._r8 - p_ac(l) ) * eflx_urban_ac_sat(l) & * dtime / (ht_roof(l) * rho_dair(l) * cpair * wtlunit_roof(l)) eflx_urban_ac(l) = p_ac(l) * eflx_urban_ac_sat(l) else - ! Cathy [orig] + ! X. Li [orig] t_building(l) = t_building_max(l) eflx_urban_ac(l) = wtlunit_roof(l) * abs( (ht_roof(l) * rho_dair(l) * cpair / dtime) * t_building(l) & - (ht_roof(l) * rho_dair(l) * cpair / dtime) * t_building_bef_hac(l) ) diff --git a/src/biogeophys/UrbanParamsType.F90 b/src/biogeophys/UrbanParamsType.F90 index c674aac2db..16da4b3ad0 100644 --- a/src/biogeophys/UrbanParamsType.F90 +++ b/src/biogeophys/UrbanParamsType.F90 @@ -101,7 +101,7 @@ module UrbanParamsType character(len= *), parameter, public :: urban_hac_on = 'ON' character(len= *), parameter, public :: urban_wasteheat_on = 'ON_WASTEHEAT' character(len= 16), public :: urban_hac = urban_hac_off - ! Cathy [dev.04] + ! X. Li [dev.04] logical, public :: urban_explicit_ac = .true. ! whether to use explicit, time-varying AC adoption rate logical, public :: urban_traffic = .false. ! urban traffic fluxes @@ -849,9 +849,9 @@ subroutine UrbanReadNML ( NLFilename ) integer :: unitn ! unit for namelist file character(len=32) :: subname = 'UrbanReadNML' ! subroutine name - ! Cathy [orig]: + ! X. Li [orig]: ! namelist / clmu_inparm / urban_hac, urban_traffic, building_temp_method - ! Cathy [dev.04]: + ! X. Li [dev.04]: namelist / clmu_inparm / urban_hac, urban_explicit_ac, urban_traffic, building_temp_method !EOP !----------------------------------------------------------------------- @@ -880,7 +880,7 @@ subroutine UrbanReadNML ( NLFilename ) ! Broadcast namelist variables read in call shr_mpi_bcast(urban_hac, mpicom) - ! Cathy [dev.04]: + ! X. Li [dev.04]: call shr_mpi_bcast(urban_explicit_ac, mpicom) call shr_mpi_bcast(urban_traffic, mpicom) call shr_mpi_bcast(building_temp_method, mpicom) @@ -893,7 +893,7 @@ subroutine UrbanReadNML ( NLFilename ) ! if ( masterproc )then write(iulog,*) ' urban air conditioning/heating and wasteheat = ', urban_hac - ! Cathy [dev.04]: + ! X. Li [dev.04]: write(iulog,*) ' urban explicit air-conditioning adoption rate = ', urban_explicit_ac write(iulog,*) ' urban traffic flux = ', urban_traffic end if diff --git a/src/cpl/share_esmf/UrbanTimeVarType.F90 b/src/cpl/share_esmf/UrbanTimeVarType.F90 index ae34449c1e..23dbf54086 100644 --- a/src/cpl/share_esmf/UrbanTimeVarType.F90 +++ b/src/cpl/share_esmf/UrbanTimeVarType.F90 @@ -12,7 +12,7 @@ module UrbanTimeVarType use abortutils , only : endrun use decompMod , only : bounds_type, subgrid_level_landunit use clm_varctl , only : iulog - use landunit_varcon , only : isturb_MIN, isturb_MAX ! Cathy: min and max types urban; equals 7 and 9, resp. + use landunit_varcon , only : isturb_MIN, isturb_MAX ! X. Li: min and max types urban; equals 7 and 9, resp. use clm_varcon , only : spval use LandunitType , only : lun use GridcellType , only : grc @@ -24,7 +24,7 @@ module UrbanTimeVarType type, public :: urbantv_type ! real(r8), public, pointer :: t_building_max(:) ! lun maximum internal building air temperature (K) - ! Cathy [dev] + ! X. Li [dev] real(r8), public, pointer :: p_ac(:) ! lun air-conditioning ownership rate (unitless, between 0 and 1) type(shr_strdata_type) :: sdat_urbantv ! urban time varying input data stream contains @@ -34,9 +34,9 @@ module UrbanTimeVarType procedure, public :: urbantv_interp ! Interpolate urban time varying stream end type urbantv_type - ! Cathy [orig] + ! X. Li [orig] ! character(15), private :: stream_varnames(isturb_MIN:isturb_MAX) - ! Cathy [dev]: + ! X. Li [dev]: character(15), private :: stream_varnames(1:6) ! 1-3 for t_building_max, 4-6 for p_ac character(len=*), parameter, private :: sourcefile = & @@ -60,7 +60,7 @@ subroutine Init(this, bounds, NLFilename) character(len=*) , intent(in) :: NLFilename ! Namelist filename ! ! !LOCAL VARIABLES: - integer :: begl, endl ! Cathy: beginning and ending landunit index, from src/main/decompMod + integer :: begl, endl ! X. Li: beginning and ending landunit index, from src/main/decompMod !--------------------------------------------------------------------- begl = bounds%begl; endl = bounds%endl @@ -68,18 +68,18 @@ subroutine Init(this, bounds, NLFilename) ! Allocate urbantv data structure allocate(this%t_building_max(begl:endl)); this%t_building_max(:) = nan - ! Cathy [dev] + ! X. Li [dev] allocate(this%p_ac(begl:endl)); this%p_ac(:) = nan call this%urbantv_init(bounds, NLFilename) call this%urbantv_interp(bounds) - ! Add history fields ! Cathy: this adds an output field. the subroutine is in scr/main/histFileMod.F90 + ! Add history fields ! X. Li: this adds an output field. the subroutine is in scr/main/histFileMod.F90 call hist_addfld1d (fname='TBUILD_MAX', units='K', & avgflag='A', long_name='prescribed maximum interior building temperature', & ptr_lunit=this%t_building_max, default='inactive', set_nourb=spval, & l2g_scale_type='unity') - ! Cathy [dev] + ! X. Li [dev] call hist_addfld1d (fname='P_AC', units='unitless', & avgflag='A', long_name='prescribed air-conditioning ownership rate (decimal)', & ptr_lunit=this%p_ac, default='inactive', set_nourb=spval, & @@ -97,7 +97,7 @@ subroutine urbantv_init(this, bounds, NLFilename) use clm_nlUtilsMod , only : find_nlgroup_name use spmdMod , only : masterproc, mpicom, iam use shr_mpi_mod , only : shr_mpi_bcast - use landunit_varcon , only : isturb_tbd, isturb_hd, isturb_md ! Cathy: equals 7, 8 and 9 + use landunit_varcon , only : isturb_tbd, isturb_hd, isturb_md ! X. Li: equals 7, 8 and 9 use dshr_strdata_mod , only : shr_strdata_init_from_inline use lnd_comp_shr , only : mesh, model_clock ! @@ -119,7 +119,7 @@ subroutine urbantv_init(this, bounds, NLFilename) character(len=CL) :: urbantvmapalgo = 'nn' ! mapping alogrithm for urban ac ??? character(len=CL) :: urbantv_tintalgo = 'linear' ! time interpolation alogrithm integer :: rc ! error code - ! Cathy [orig]: this is taken out because field strings are now hard coded in + ! X. Li [orig]: this is taken out because field strings are now hard coded in ! character(*), parameter :: urbantvString = "tbuildmax_" ! base string for field string character(*), parameter :: subName = "('urbantv_init')" ! ??? !----------------------------------------------------------------------- @@ -139,11 +139,11 @@ subroutine urbantv_init(this, bounds, NLFilename) model_year_align_urbantv = 1 ! align stream_year_first_urbantv with this model year stream_fldFileName_urbantv = ' ' stream_meshfile_urbantv = ' ' - ! Cathy [orig] + ! X. Li [orig] ! stream_varnames(isturb_tbd) = urbantvString//"TBD" ! stream_varnames(isturb_hd) = urbantvString//"HD" ! stream_varnames(isturb_md) = urbantvString//"MD" - ! Cathy [dev] + ! X. Li [dev] stream_varnames(1) = "tbuildmax_TBD" stream_varnames(2) = "tbuildmax_HD" stream_varnames(3) = "tbuildmax_MD" @@ -180,9 +180,9 @@ subroutine urbantv_init(this, bounds, NLFilename) write(iulog,'(a,a)' ) ' stream_fldFileName_urbantv = ',stream_fldFileName_urbantv write(iulog,'(a,a)' ) ' stream_meshfile_urbantv = ',stream_meshfile_urbantv write(iulog,'(a,a)' ) ' urbantv_tintalgo = ',urbantv_tintalgo - ! Cathy [orig] + ! X. Li [orig] ! do n = isturb_tbd,isturb_md - ! Cathy [dev] + ! X. Li [dev] do n = 1,6 write(iulog,'(a,a)' ) ' stream_varname = ',trim(stream_varnames(n)) end do @@ -200,10 +200,10 @@ subroutine urbantv_init(this, bounds, NLFilename) stream_lev_dimname = 'null', & stream_mapalgo = trim(urbantvmapalgo), & stream_filenames = (/trim(stream_fldfilename_urbantv)/), & - ! Cathy [orig] + ! X. Li [orig] ! stream_fldlistFile = stream_varnames(isturb_tbd:isturb_md),& ! stream_fldListModel = stream_varnames(isturb_tbd:isturb_md),& - ! Cathy [dev] + ! X. Li [dev] stream_fldlistFile = stream_varnames(1:6), & stream_fldListModel = stream_varnames(1:6), & stream_yearFirst = stream_year_first_urbantv, & @@ -265,10 +265,10 @@ subroutine urbantv_interp(this, bounds) ! Create 2d array for all stream variable data lsize = bounds%endg - bounds%begg + 1 - ! Cathy [orig] + ! X. Li [orig] ! allocate(dataptr2d(lsize, isturb_MIN:isturb_MAX)) ! do n = isturb_MIN,isturb_MAX - ! Cathy [dev] + ! X. Li [dev] allocate(dataptr2d(lsize, 1:6)) do n = 1,6 call dshr_fldbun_getFldPtr(this%sdat_urbantv%pstrm(1)%fldbun_model, trim(stream_varnames(n)), & @@ -291,13 +291,13 @@ subroutine urbantv_interp(this, bounds) ig = ig+1 if (g == lun%gridcell(l)) exit end do - ! Cathy [orig] + ! X. Li [orig] ! do n = isturb_MIN,isturb_MAX - ! Cathy [dev] + ! X. Li [dev] do n = 1,6 - ! Cathy [orig] + ! X. Li [orig] ! if (stream_varnames(lun%itype(l)) == stream_varnames(n)) then - ! Cathy [dev.02] + ! X. Li [dev.02] if (stream_varnames((lun%itype(l)-6)) == stream_varnames(n)) then this%t_building_max(l) = dataptr2d(ig,n) end if @@ -306,9 +306,9 @@ subroutine urbantv_interp(this, bounds) end if end do else - this%t_building_max(l) = spval ! Cathy: special value for real data, set to 1.e36 in src/main/clm_varcon - ! Cathy [dev] - this%p_ac(l) = 0._r8 ! Cathy: set to 0 for non-urban landunit + this%t_building_max(l) = spval ! X. Li: special value for real data, set to 1.e36 in src/main/clm_varcon + ! X. Li [dev] + this%p_ac(l) = 0._r8 ! X. Li: set to 0 for non-urban landunit end if end do deallocate(dataptr2d) @@ -322,9 +322,9 @@ subroutine urbantv_interp(this, bounds) ig = ig+1 if (g == lun%gridcell(l)) exit end do - ! Cathy [orig] + ! X. Li [orig] ! if ( .not. urban_valid(g) .or. (this%t_building_max(l) <= 0._r8)) then - ! Cathy [dev] + ! X. Li [dev] if ( .not. urban_valid(g) .or. (this%t_building_max(l) <= 0._r8) & .or. (this%p_ac(l) < 0._r8) .or. (this%p_ac(l) > 1._r8)) then found = .true. @@ -339,7 +339,7 @@ subroutine urbantv_interp(this, bounds) write(iulog,*)'landunit type: ',lun%itype(lindx) write(iulog,*)'urban_valid: ',urban_valid(gindx) write(iulog,*)'t_building_max: ',this%t_building_max(lindx) - ! Cathy [dev] + ! X. Li [dev] write(iulog,*)'p_ac: ',this%p_ac(lindx) call endrun(subgrid_index=lindx, subgrid_level=subgrid_level_landunit, & msg=errmsg(sourcefile, __LINE__)) diff --git a/src/main/clm_varpar.F90 b/src/main/clm_varpar.F90 index e1179e43b3..3ef9cf48a2 100644 --- a/src/main/clm_varpar.F90 +++ b/src/main/clm_varpar.F90 @@ -203,7 +203,7 @@ subroutine clm_varpar_init(actual_maxsoil_patches, surf_numpft, surf_numcft) max_patch_per_col= max(maxsoil_patches, surf_numcft, maxpatch_urb) nlevsoifl = 10 - ![Cathy: to run prod.02 using new surf data from Keer, changed below from 5 to 10] + ! X. Li: changed below from 5 to 10 to match new surface data nlevurb = 10 ! originally 5 if ( masterproc ) write(iulog, *) 'soil_layerstruct_predefined varpar ', soil_layerstruct_predefined From def2f7506284508182898bc0d1edeb2c12812572 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Tue, 12 Dec 2023 12:16:39 -0700 Subject: [PATCH 0046/1248] Change failing SMS_Ln9_P72x2 test to passing SMS_Ln9_P360x2 --- cime_config/testdefs/testlist_clm.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index 81ad8bced4..52ccfbf2db 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -322,7 +322,7 @@ - + From 08768f9b877caed6efd3c8fbb38f1ac3bbf29991 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Mon, 18 Dec 2023 15:25:38 -0700 Subject: [PATCH 0047/1248] To pass test, add use_matrixcn=.false. to luna testmod --- cime_config/testdefs/testmods_dirs/clm/luna/user_nl_clm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cime_config/testdefs/testmods_dirs/clm/luna/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/luna/user_nl_clm index cbfbb9f525..fb796ebfaf 100644 --- a/cime_config/testdefs/testmods_dirs/clm/luna/user_nl_clm +++ b/cime_config/testdefs/testmods_dirs/clm/luna/user_nl_clm @@ -1,3 +1,3 @@ use_luna = .true. use_flexibleCN = .false. - + use_matrixcn = .false. From 8b2cb728ac99a2e6c8a7be5738f8b709b5e336b5 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Tue, 19 Dec 2023 12:46:43 -0700 Subject: [PATCH 0048/1248] Remove two clm45 tests from ExpectedTestFails --- 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 18619818fa..8a43eb0acc 100644 --- a/cime_config/testdefs/ExpectedTestFails.xml +++ b/cime_config/testdefs/ExpectedTestFails.xml @@ -44,13 +44,6 @@ - - - FAIL - #640, same test with clm-ciso_soil_matrixcn_only works - - - FAIL @@ -58,13 +51,6 @@ - - - FAIL - #640, same test with clm-ciso_soil_matrixcn_only works - - - From ddfac7b299d8143fdf2c2d7438cf2729fe1a047d Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Fri, 22 Dec 2023 15:35:13 -0700 Subject: [PATCH 0049/1248] Backed dev100 mods out of 3 more files for 1x1_brazil test to pass --- src/biogeochem/CNCStateUpdate1Mod.F90 | 232 ++---- src/biogeochem/CNPhenologyMod.F90 | 680 +++++++++--------- .../SoilBiogeochemNStateUpdate1Mod.F90 | 70 +- 3 files changed, 429 insertions(+), 553 deletions(-) diff --git a/src/biogeochem/CNCStateUpdate1Mod.F90 b/src/biogeochem/CNCStateUpdate1Mod.F90 index 8cac85824e..f73453476e 100644 --- a/src/biogeochem/CNCStateUpdate1Mod.F90 +++ b/src/biogeochem/CNCStateUpdate1Mod.F90 @@ -2,9 +2,6 @@ module CNCStateUpdate1Mod !----------------------------------------------------------------------- ! Module for carbon state variable update, non-mortality fluxes. - ! When the matrix solution is being used (use_matrixcn and use_soil_matrixcn) - ! only some state updates are done here, the other state updates happen - ! after the matrix is solved in VegMatrix and SoilMatrix. ! ! !USES: use shr_kind_mod , only : r8 => shr_kind_r8 @@ -19,7 +16,8 @@ module CNCStateUpdate1Mod use CNVegCarbonFluxType , only : cnveg_carbonflux_type use CropType , only : crop_type use CropReprPoolsMod , only : nrepr, repr_grain_min, repr_grain_max, repr_structure_min, repr_structure_max - use SoilBiogeochemDecompCascadeConType , only : decomp_cascade_con, use_soil_matrixcn + use SoilBiogeochemDecompCascadeConType , only : decomp_cascade_con + use SoilBiogeochemDecompCascadeConType , only : use_soil_matrixcn use SoilBiogeochemCarbonFluxType , only : soilbiogeochem_carbonflux_type use SoilBiogeochemCarbonStateType , only : soilbiogeochem_carbonstate_type use PatchType , only : patch @@ -193,9 +191,6 @@ subroutine CStateUpdate1( num_soilc, filter_soilc, num_soilp, filter_soilp, & do j = 1,nlevdecomp do fc = 1,num_soilc c = filter_soilc(fc) - ! - ! State update without the matrix solution - ! if (.not. use_soil_matrixcn) then ! phenology and dynamic land cover fluxes do i = i_litr_min, i_litr_max @@ -207,12 +202,6 @@ subroutine CStateUpdate1( num_soilc, filter_soilc, num_soilp, filter_soilp, & ! terms have been moved to CStateUpdateDynPatch. I think this is zeroed every ! time step, but to be safe, I'm explicitly setting it to zero here. cf_soil%decomp_cpools_sourcesink_col(c,j,i_cwd) = 0._r8 - ! - ! For the matrix solution the actual state update comes after the matrix - ! multiply in SoilMatrix, but the matrix needs to be setup with - ! the equivalent of above. Those changes can be here or in the - ! native subroutines dealing with that field - ! else ! phenology and dynamic land cover fluxes do i = i_litr_min, i_litr_max @@ -243,15 +232,11 @@ subroutine CStateUpdate1( num_soilc, filter_soilc, num_soilp, filter_soilp, & do j = 1,nlevdecomp do fc = 1,num_soilc c = filter_soilc(fc) - ! - ! State update without the matrix solution - ! if (.not. use_soil_matrixcn) then cf_soil%decomp_cpools_sourcesink_col(c,j,cascade_donor_pool(k)) = & - cf_soil%decomp_cpools_sourcesink_col(c,j,cascade_donor_pool(k)) & - - ( cf_soil%decomp_cascade_hr_vr_col(c,j,k) + cf_soil%decomp_cascade_ctransfer_vr_col(c,j,k)) *dt - ! else ! not needed here? - end if !not use_soil_matrixcn + cf_soil%decomp_cpools_sourcesink_col(c,j,cascade_donor_pool(k)) & + - ( cf_soil%decomp_cascade_hr_vr_col(c,j,k) + cf_soil%decomp_cascade_ctransfer_vr_col(c,j,k)) *dt + end if !not use_soil_matrixcn end do end do end do @@ -260,14 +245,10 @@ subroutine CStateUpdate1( num_soilc, filter_soilc, num_soilp, filter_soilp, & do j = 1,nlevdecomp do fc = 1,num_soilc c = filter_soilc(fc) - ! - ! State update without the matrix solution - ! if (.not. use_soil_matrixcn) then cf_soil%decomp_cpools_sourcesink_col(c,j,cascade_receiver_pool(k)) = & - cf_soil%decomp_cpools_sourcesink_col(c,j,cascade_receiver_pool(k)) & - + cf_soil%decomp_cascade_ctransfer_vr_col(c,j,k)*dt - ! else ! not needed here? + cf_soil%decomp_cpools_sourcesink_col(c,j,cascade_receiver_pool(k)) & + + cf_soil%decomp_cascade_ctransfer_vr_col(c,j,k)*dt end if !not use_soil_matrixcn end do end do @@ -275,17 +256,13 @@ subroutine CStateUpdate1( num_soilc, filter_soilc, num_soilp, filter_soilp, & end do end if - if (.not. use_fates) then + if (.not. use_fates) then ptch: do fp = 1,num_soilp p = filter_soilp(fp) c = patch%column(p) ! phenology: transfer growth fluxes - - ! - ! State update without the matrix solution - ! - if(.not. use_matrixcn)then + if(.not. use_matrixcn)then ! NOTE: Any changes that go here MUST be applied to the matrix ! version as well cs_veg%leafc_patch(p) = cs_veg%leafc_patch(p) + cf_veg%leafc_xfer_to_leafc_patch(p)*dt @@ -314,11 +291,11 @@ subroutine CStateUpdate1( num_soilc, filter_soilc, num_soilp, filter_soilp, & end do end if - ! phenology: litterfall fluxes + ! phenology: litterfall fluxes cs_veg%leafc_patch(p) = cs_veg%leafc_patch(p) - cf_veg%leafc_to_litter_patch(p)*dt cs_veg%frootc_patch(p) = cs_veg%frootc_patch(p) - cf_veg%frootc_to_litter_patch(p)*dt - - ! livewood turnover fluxes + + ! livewood turnover fluxes if (woody(ivt(p)) == 1._r8) then cs_veg%livestemc_patch(p) = cs_veg%livestemc_patch(p) - cf_veg%livestemc_to_deadstemc_patch(p)*dt cs_veg%deadstemc_patch(p) = cs_veg%deadstemc_patch(p) + cf_veg%livestemc_to_deadstemc_patch(p)*dt @@ -342,81 +319,57 @@ subroutine CStateUpdate1( num_soilc, filter_soilc, num_soilp, filter_soilp, & - (cf_veg%repr_structurec_to_cropprod_patch(p,k) + cf_veg%repr_structurec_to_litter_patch(p,k))*dt end do end if - ! - ! For the matrix solution the actual state update comes after the matrix - ! multiply in VegMatrix, but the matrix needs to be setup with - ! the equivalent of above. Those changes can be here or in the - ! native subroutines dealing with that field - ! - else - ! NOTE: Changes for above that apply for matrix code are in CNPhenology EBK (11/26/2019) - - ! This part below MUST match exactly the code for the non-matrix part - ! above! - if (ivt(p) >= npcropmin) then - cs_veg%cropseedc_deficit_patch(p) = cs_veg%cropseedc_deficit_patch(p) & - - cf_veg%crop_seedc_to_leaf_patch(p) * dt - do k = repr_grain_min, repr_grain_max - cs_veg%cropseedc_deficit_patch(p) = cs_veg%cropseedc_deficit_patch(p) & - + cf_veg%repr_grainc_to_seed_patch(p,k) * dt - end do -! else ! slevis: I think I rejected this alternative due to a balance error -! ! NOTE: Changes for above that apply for matrix code are in CNPhenology EBK (11/26/2019) - -! ! This part below MUST match exactly the code for the non-matrix part -! ! above! -! if (ivt(p) >= npcropmin) then -! cs_veg%cropseedc_deficit_patch(p) = cs_veg%cropseedc_deficit_patch(p) & -! - cf_veg%crop_seedc_to_leaf_patch(p) * dt -! do k = repr_grain_min, repr_grain_max -! cs_veg%reproductivec_patch(p,k) = cs_veg%reproductivec_patch(p,k) & -! - (cf_veg%repr_grainc_to_food_patch(p,k) + cf_veg%repr_grainc_to_seed_patch(p,k))*dt -! cs_veg%cropseedc_deficit_patch(p) = cs_veg%cropseedc_deficit_patch(p) & -! + cf_veg%repr_grainc_to_seed_patch(p,k) * dt -! end do -! do k = repr_structure_min, repr_structure_max -! cs_veg%reproductivec_patch(p,k) = cs_veg%reproductivec_patch(p,k) & -! - (cf_veg%repr_structurec_to_cropprod_patch(p,k) + cf_veg%repr_structurec_to_litter_patch(p,k))*dt -! end do - end if - end if !not use_matrixcn + else + ! NOTE: Changes for above that apply for matrix code are in CNPhenology EBK (11/26/2019) + + ! This part below MUST match exactly the code for the non-matrix part + ! above! + if (ivt(p) >= npcropmin) then + cs_veg%cropseedc_deficit_patch(p) = cs_veg%cropseedc_deficit_patch(p) & + - cf_veg%crop_seedc_to_leaf_patch(p) * dt + do k = repr_grain_min, repr_grain_max + cs_veg%cropseedc_deficit_patch(p) = cs_veg%cropseedc_deficit_patch(p) & + + cf_veg%repr_grainc_to_seed_patch(p,k) * dt + end do + end if + end if !not use_matrixcn - check_cpool = cs_veg%cpool_patch(p)- cf_veg%psnsun_to_cpool_patch(p)*dt-cf_veg%psnshade_to_cpool_patch(p)*dt - cpool_delta = cs_veg%cpool_patch(p) + check_cpool = cs_veg%cpool_patch(p)- cf_veg%psnsun_to_cpool_patch(p)*dt-cf_veg%psnshade_to_cpool_patch(p)*dt + cpool_delta = cs_veg%cpool_patch(p) - ! maintenance respiration fluxes from cpool + ! maintenance respiration fluxes from cpool - cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%cpool_to_xsmrpool_patch(p)*dt - cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%leaf_curmr_patch(p)*dt - cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%froot_curmr_patch(p)*dt - If (woody(ivt(p)) == 1._r8) then + cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%cpool_to_xsmrpool_patch(p)*dt + cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%leaf_curmr_patch(p)*dt + cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%froot_curmr_patch(p)*dt + If (woody(ivt(p)) == 1._r8) then cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%livestem_curmr_patch(p)*dt cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%livecroot_curmr_patch(p)*dt - end if - if (ivt(p) >= npcropmin) then ! skip 2 generic crops + end if + if (ivt(p) >= npcropmin) then ! skip 2 generic crops cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%livestem_curmr_patch(p)*dt do k = 1, nrepr cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%reproductive_curmr_patch(p,k)*dt end do - end if + end if - cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%cpool_to_resp_patch(p)*dt + cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%cpool_to_resp_patch(p)*dt - !RF Add in the carbon spent on uptake respiration - cs_veg%cpool_patch(p)= cs_veg%cpool_patch(p) - cf_veg%soilc_change_patch(p)*dt + !RF Add in the carbon spent on uptake respiration. + cs_veg%cpool_patch(p)= cs_veg%cpool_patch(p) - cf_veg%soilc_change_patch(p)*dt - ! maintenance respiration fluxes from xsmrpool - cs_veg%xsmrpool_patch(p) = cs_veg%xsmrpool_patch(p) + cf_veg%cpool_to_xsmrpool_patch(p)*dt - cs_veg%xsmrpool_patch(p) = cs_veg%xsmrpool_patch(p) - cf_veg%leaf_xsmr_patch(p)*dt - cs_veg%xsmrpool_patch(p) = cs_veg%xsmrpool_patch(p) - cf_veg%froot_xsmr_patch(p)*dt - if (woody(ivt(p)) == 1._r8) then + ! maintenance respiration fluxes from xsmrpool + cs_veg%xsmrpool_patch(p) = cs_veg%xsmrpool_patch(p) + cf_veg%cpool_to_xsmrpool_patch(p)*dt + cs_veg%xsmrpool_patch(p) = cs_veg%xsmrpool_patch(p) - cf_veg%leaf_xsmr_patch(p)*dt + cs_veg%xsmrpool_patch(p) = cs_veg%xsmrpool_patch(p) - cf_veg%froot_xsmr_patch(p)*dt + if (woody(ivt(p)) == 1._r8) then cs_veg%xsmrpool_patch(p) = cs_veg%xsmrpool_patch(p) - cf_veg%livestem_xsmr_patch(p)*dt cs_veg%xsmrpool_patch(p) = cs_veg%xsmrpool_patch(p) - cf_veg%livecroot_xsmr_patch(p)*dt - end if + end if - ! allocation fluxes - if (carbon_resp_opt == 1) then + ! allocation fluxes + if (carbon_resp_opt == 1) then cf_veg%cpool_to_leafc_patch(p) = cf_veg%cpool_to_leafc_patch(p) - cf_veg%cpool_to_leafc_resp_patch(p) cf_veg%cpool_to_leafc_storage_patch(p) = cf_veg%cpool_to_leafc_storage_patch(p) - & cf_veg%cpool_to_leafc_storage_resp_patch(p) @@ -427,21 +380,12 @@ subroutine CStateUpdate1( num_soilc, filter_soilc, num_soilp, filter_soilp, & cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%cpool_to_leafc_patch(p)*dt cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%cpool_to_leafc_storage_patch(p)*dt cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%cpool_to_frootc_patch(p)*dt - cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%cpool_to_frootc_storage_patch(p)*dt - ! - ! State update without the matrix solution - ! - if(.not. use_matrixcn) then + cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%cpool_to_frootc_storage_patch(p)*dt + if(.not. use_matrixcn) then cs_veg%leafc_patch(p) = cs_veg%leafc_patch(p) + cf_veg%cpool_to_leafc_patch(p)*dt cs_veg%leafc_storage_patch(p) = cs_veg%leafc_storage_patch(p) + cf_veg%cpool_to_leafc_storage_patch(p)*dt cs_veg%frootc_patch(p) = cs_veg%frootc_patch(p) + cf_veg%cpool_to_frootc_patch(p)*dt cs_veg%frootc_storage_patch(p) = cs_veg%frootc_storage_patch(p) + cf_veg%cpool_to_frootc_storage_patch(p)*dt - ! - ! For the matrix solution the actual state update comes after the matrix - ! multiply in VegMatrix, but the matrix needs to be setup with - ! the equivalent of above. Those changes can be here or in the - ! native subroutines dealing with that field - ! else ! NOTE: The equivalent changes for matrix code are in CNPhenology EBK (11/26/2019) end if !not use_matrixcn @@ -461,10 +405,7 @@ subroutine CStateUpdate1( num_soilc, filter_soilc, num_soilp, filter_soilp, & cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%cpool_to_livecrootc_patch(p)*dt cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%cpool_to_livecrootc_storage_patch(p)*dt cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%cpool_to_deadcrootc_patch(p)*dt - cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%cpool_to_deadcrootc_storage_patch(p)*dt - ! - ! State update without the matrix solution - ! + cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%cpool_to_deadcrootc_storage_patch(p)*dt if(.not. use_matrixcn)then cs_veg%livestemc_patch(p) = cs_veg%livestemc_patch(p) + cf_veg%cpool_to_livestemc_patch(p)*dt cs_veg%livestemc_storage_patch(p) = cs_veg%livestemc_storage_patch(p) + cf_veg%cpool_to_livestemc_storage_patch(p)*dt @@ -474,12 +415,6 @@ subroutine CStateUpdate1( num_soilc, filter_soilc, num_soilp, filter_soilp, & cs_veg%livecrootc_storage_patch(p) = cs_veg%livecrootc_storage_patch(p) + cf_veg%cpool_to_livecrootc_storage_patch(p)*dt cs_veg%deadcrootc_patch(p) = cs_veg%deadcrootc_patch(p) + cf_veg%cpool_to_deadcrootc_patch(p)*dt cs_veg%deadcrootc_storage_patch(p) = cs_veg%deadcrootc_storage_patch(p) + cf_veg%cpool_to_deadcrootc_storage_patch(p)*dt - ! - ! For the matrix solution the actual state update comes after the matrix - ! multiply in VegMatrix, but the matrix needs to be setup with - ! the equivalent of above. Those changes can be here or in the - ! native subroutines dealing with that field - ! else ! NOTE: The equivalent changes for matrix code are in CNPhenology EBK (11/26/2019) end if !not use_matrixcn @@ -496,9 +431,6 @@ subroutine CStateUpdate1( num_soilc, filter_soilc, num_soilp, filter_soilp, & cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%cpool_to_reproductivec_patch(p,k)*dt cs_veg%cpool_patch(p) = cs_veg%cpool_patch(p) - cf_veg%cpool_to_reproductivec_storage_patch(p,k)*dt end do - ! - ! State update without the matrix solution - ! if(.not. use_matrixcn)then cs_veg%livestemc_patch(p) = cs_veg%livestemc_patch(p) + cf_veg%cpool_to_livestemc_patch(p)*dt cs_veg%livestemc_storage_patch(p) = cs_veg%livestemc_storage_patch(p) + cf_veg%cpool_to_livestemc_storage_patch(p)*dt @@ -508,12 +440,6 @@ subroutine CStateUpdate1( num_soilc, filter_soilc, num_soilp, filter_soilp, & cs_veg%reproductivec_storage_patch(p,k) = cs_veg%reproductivec_storage_patch(p,k) & + cf_veg%cpool_to_reproductivec_storage_patch(p,k)*dt end do - ! - ! For the matrix solution the actual state update comes after the matrix - ! multiply in VegMatrix, but the matrix needs to be setup with - ! the equivalent of above. Those changes can be here or in the - ! native subroutines dealing with that field - ! else ! NOTE: The equivalent changes for matrix code are in CNPhenology EBK (11/26/2019) end if !not use_matrixcn @@ -576,30 +502,17 @@ subroutine CStateUpdate1( num_soilc, filter_soilc, num_soilp, filter_soilp, & cs_veg%gresp_storage_patch(p) = cs_veg%gresp_storage_patch(p) + cf_veg%cpool_to_gresp_storage_patch(p)*dt ! move storage pools into transfer pools - - ! - ! State update without the matrix solution - ! - if(.not. use_matrixcn)then - cs_veg%leafc_storage_patch(p) = cs_veg%leafc_storage_patch(p) - cf_veg%leafc_storage_to_xfer_patch(p)*dt - cs_veg%leafc_xfer_patch(p) = cs_veg%leafc_xfer_patch(p) + cf_veg%leafc_storage_to_xfer_patch(p)*dt - cs_veg%frootc_storage_patch(p) = cs_veg%frootc_storage_patch(p) - cf_veg%frootc_storage_to_xfer_patch(p)*dt - cs_veg%frootc_xfer_patch(p) = cs_veg%frootc_xfer_patch(p) + cf_veg%frootc_storage_to_xfer_patch(p)*dt - ! - ! For the matrix solution the actual state update comes after the matrix - ! multiply in VegMatrix, but the matrix needs to be setup with - ! the equivalent of above. Those changes can be here or in the - ! native subroutines dealing with that field - ! + if(.not. use_matrixcn)then + cs_veg%leafc_storage_patch(p) = cs_veg%leafc_storage_patch(p) - cf_veg%leafc_storage_to_xfer_patch(p)*dt + cs_veg%leafc_xfer_patch(p) = cs_veg%leafc_xfer_patch(p) + cf_veg%leafc_storage_to_xfer_patch(p)*dt + cs_veg%frootc_storage_patch(p) = cs_veg%frootc_storage_patch(p) - cf_veg%frootc_storage_to_xfer_patch(p)*dt + cs_veg%frootc_xfer_patch(p) = cs_veg%frootc_xfer_patch(p) + cf_veg%frootc_storage_to_xfer_patch(p)*dt else - ! NOTE: The equivalent changes for matrix code are in CNPhenology EBK (11/26/2019) + ! NOTE: The equivalent changes for matrix code are in CNPhenology EBK (11/26/2019) end if !not use_matrixcn if (woody(ivt(p)) == 1._r8) then cs_veg%gresp_storage_patch(p) = cs_veg%gresp_storage_patch(p) - cf_veg%gresp_storage_to_xfer_patch(p)*dt cs_veg%gresp_xfer_patch(p) = cs_veg%gresp_xfer_patch(p) + cf_veg%gresp_storage_to_xfer_patch(p)*dt - ! - ! State update without the matrix solution - ! if(.not. use_matrixcn)then cs_veg%livestemc_storage_patch(p) = cs_veg%livestemc_storage_patch(p) - cf_veg%livestemc_storage_to_xfer_patch(p)*dt cs_veg%livestemc_xfer_patch(p) = cs_veg%livestemc_xfer_patch(p) + cf_veg%livestemc_storage_to_xfer_patch(p)*dt @@ -609,21 +522,12 @@ subroutine CStateUpdate1( num_soilc, filter_soilc, num_soilp, filter_soilp, & cs_veg%livecrootc_xfer_patch(p) = cs_veg%livecrootc_xfer_patch(p) + cf_veg%livecrootc_storage_to_xfer_patch(p)*dt cs_veg%deadcrootc_storage_patch(p) = cs_veg%deadcrootc_storage_patch(p)- cf_veg%deadcrootc_storage_to_xfer_patch(p)*dt cs_veg%deadcrootc_xfer_patch(p) = cs_veg%deadcrootc_xfer_patch(p) + cf_veg%deadcrootc_storage_to_xfer_patch(p)*dt - ! - ! For the matrix solution the actual state update comes after the matrix - ! multiply in VegMatrix, but the matrix needs to be setup with - ! the equivalent of above. Those changes can be here or in the - ! native subroutines dealing with that field - ! else ! NOTE: The equivalent changes for matrix code are in CNPhenology EBK (11/26/2019) end if !not use_matrixcn end if if (ivt(p) >= npcropmin) then ! skip 2 generic crops ! lines here for consistency; the transfer terms are zero - ! - ! State update without the matrix solution - ! if(.not. use_matrixcn)then ! lines here for consistency; the transfer terms are zero cs_veg%livestemc_storage_patch(p) = cs_veg%livestemc_storage_patch(p) - cf_veg%livestemc_storage_to_xfer_patch(p)*dt @@ -634,12 +538,6 @@ subroutine CStateUpdate1( num_soilc, filter_soilc, num_soilp, filter_soilp, & cs_veg%reproductivec_xfer_patch(p,k) = cs_veg%reproductivec_xfer_patch(p,k) & + cf_veg%reproductivec_storage_to_xfer_patch(p,k)*dt end do - ! - ! For the matrix solution the actual state update comes after the matrix - ! multiply in VegMatrix, but the matrix needs to be setup with - ! the equivalent of above. Those changes can be here or in the - ! native subroutines dealing with that field - ! else ! NOTE: The equivalent changes for matrix code are in CNPhenology EBK (11/26/2019) end if !not use_matrixcn @@ -655,20 +553,16 @@ subroutine CStateUpdate1( num_soilc, filter_soilc, num_soilp, filter_soilp, & ! an intent(inout) ! fluxes should not be updated in this module - not sure where ! this belongs - ! DML (06-20-2017) While debugging crop isotope code, found that cpool_patch and frootc_patch - ! could occasionally be very small but nonzero numbers after crop harvest, which persists + ! DML (06-20-2017) While debugging crop isotope code, found that cpool_patch and frootc_patch + ! could occasionally be very small but nonzero numbers after crop harvest, which persists ! through to next planting and for reasons that could not 100% ! isolate, caused C12/C13 ratios to occasionally go out of ! bounds. Zeroing out these small pools and putting them into the flux to the ! atmosphere solved many of the crop isotope problems - ! Instantly release XSMRPOOL to atmosphere if ( .not. dribble_crophrv_xsmrpool_2atm ) then cf_veg%xsmrpool_to_atm_patch(p) = cf_veg%xsmrpool_to_atm_patch(p) + cs_veg%xsmrpool_patch(p)/dt cf_veg%xsmrpool_to_atm_patch(p) = cf_veg%xsmrpool_to_atm_patch(p) + cs_veg%cpool_patch(p)/dt - ! - ! State update without the matrix solution - ! if(.not. use_matrixcn)then cf_veg%xsmrpool_to_atm_patch(p) = cf_veg%xsmrpool_to_atm_patch(p) + cs_veg%frootc_patch(p)/dt else @@ -684,9 +578,6 @@ subroutine CStateUpdate1( num_soilc, filter_soilc, num_soilp, filter_soilp, & cs_veg%xsmrpool_loss_patch(p) = cs_veg%xsmrpool_loss_patch(p) + & cs_veg%xsmrpool_patch(p) + & cs_veg%cpool_patch(p) - ! - ! State update without the matrix solution - ! if(.not. use_matrixcn)then cs_veg%xsmrpool_loss_patch(p) = cs_veg%xsmrpool_loss_patch(p) + cs_veg%frootc_patch(p) else @@ -694,9 +585,6 @@ subroutine CStateUpdate1( num_soilc, filter_soilc, num_soilp, filter_soilp, & + cs_veg%frootc_patch(p) * matrix_update_phc(p,cf_veg%ifroot_to_iout_ph,1._r8/dt,dt,cnveg_carbonflux_inst,.true.,.true.) end if end if - ! - ! State update without the matrix solution - ! if (.not. use_matrixcn) then cs_veg%frootc_patch(p) = 0._r8 end if @@ -713,8 +601,8 @@ subroutine CStateUpdate1( num_soilc, filter_soilc, num_soilp, filter_soilp, & end if end if - end do ptch ! end of patch loop - end if ! end of NOT fates + end do ptch ! end of patch loop + end if ! end of NOT fates end associate diff --git a/src/biogeochem/CNPhenologyMod.F90 b/src/biogeochem/CNPhenologyMod.F90 index 5d666c0ffb..e804c0658b 100644 --- a/src/biogeochem/CNPhenologyMod.F90 +++ b/src/biogeochem/CNPhenologyMod.F90 @@ -136,10 +136,8 @@ module CNPhenologyMod integer, allocatable :: maxplantjday(:,:) ! maximum planting julian day integer :: jdayyrstart(inSH) ! julian day of start of year - ! Two matrix check parameters that will be invoked when the matrix solution - ! comes in (use_matrixcn) - logical,parameter :: matrixcheck_ph = .True. ! Matrix solution check - logical,parameter :: acc_ph = .False. ! Another matrix solution check + logical,parameter :: matrixcheck_ph = .True. ! Matrix check + logical,parameter :: acc_ph = .False. ! Another matrix check real(r8), private :: initial_seed_at_planting = 3._r8 ! Initial seed at planting @@ -641,114 +639,115 @@ subroutine CNEvergreenPhenology (num_soilp, filter_soilp , & integer :: p ! indices integer :: fp ! lake filter patch index - real(r8):: tranr + real(r8):: tranr real(r8):: t1 ! temporary variable !----------------------------------------------------------------------- associate( & - ivt => patch%itype , & ! Input: [integer (:) ] patch vegetation type + ivt => patch%itype , & ! Input: [integer (:) ] patch vegetation type - evergreen => pftcon%evergreen , & ! Input: binary flag for evergreen leaf habit (0 or 1) - leaf_long => pftcon%leaf_long , & ! Input: leaf longevity (yrs) + evergreen => pftcon%evergreen , & ! Input: binary flag for evergreen leaf habit (0 or 1) + leaf_long => pftcon%leaf_long , & ! Input: leaf longevity (yrs) - woody => pftcon%woody , & ! Input: binary flag for woody lifeform (1=woody, 0=not woody) + woody => pftcon%woody , & ! Input: binary flag for woody lifeform (1=woody, 0=not woody) - leafc_storage => cnveg_carbonstate_inst%leafc_storage_patch , & ! Input: [real(r8) (:)] (gC/m2) leaf C storage - frootc_storage => cnveg_carbonstate_inst%frootc_storage_patch , & ! Input: [real(r8) (:)] (gC/m2) fine root C storage - livestemc_storage => cnveg_carbonstate_inst%livestemc_storage_patch , & ! Input: [real(r8) (:)] (gC/m2) live stem C storage - deadstemc_storage => cnveg_carbonstate_inst%deadstemc_storage_patch , & ! Input: [real(r8) (:)] (gC/m2) dead stem C storage - livecrootc_storage => cnveg_carbonstate_inst%livecrootc_storage_patch , & ! Input: [real(r8) (:)] (gC/m2) live coarse root C storage - deadcrootc_storage => cnveg_carbonstate_inst%deadcrootc_storage_patch , & ! Input: [real(r8) (:)] (gC/m2) dead coarse root C storage - gresp_storage => cnveg_carbonstate_inst%gresp_storage_patch , & ! Input: [real(r8) (:)] (gC/m2) growth respiration storage - leafc_xfer => cnveg_carbonstate_inst%leafc_xfer_patch , & ! InOut: [real(r8) (:)] (gC/m2) leaf C transfer - frootc_xfer => cnveg_carbonstate_inst%frootc_xfer_patch , & ! InOut: [real(r8) (:)] (gC/m2) fine root C transfer - livestemc_xfer => cnveg_carbonstate_inst%livestemc_xfer_patch , & ! InOut: [real(r8) (:)] (gC/m2) live stem C transfer - deadstemc_xfer => cnveg_carbonstate_inst%deadstemc_xfer_patch , & ! InOut: [real(r8) (:)] (gC/m2) dead stem C transfer - livecrootc_xfer => cnveg_carbonstate_inst%livecrootc_xfer_patch , & ! InOut: [real(r8) (:)] (gC/m2) live coarse root C transfer - deadcrootc_xfer => cnveg_carbonstate_inst%deadcrootc_xfer_patch , & ! InOut: [real(r8) (:)] (gC/m2) dead coarse root C transfer - - leafn_storage => cnveg_nitrogenstate_inst%leafn_storage_patch , & ! Input: [real(r8) (:)] (gN/m2) leaf N storage - frootn_storage => cnveg_nitrogenstate_inst%frootn_storage_patch , & ! Input: [real(r8) (:)] (gN/m2) fine root N storage - livestemn_storage => cnveg_nitrogenstate_inst%livestemn_storage_patch , & ! Input: [real(r8) (:)] (gN/m2) live stem N storage - deadstemn_storage => cnveg_nitrogenstate_inst%deadstemn_storage_patch , & ! Input: [real(r8) (:)] (gN/m2) dead stem N storage - livecrootn_storage => cnveg_nitrogenstate_inst%livecrootn_storage_patch , & ! Input: [real(r8) (:)] (gN/m2) live coarse root N storage - deadcrootn_storage => cnveg_nitrogenstate_inst%deadcrootn_storage_patch , & ! Input: [real(r8) (:)] (gN/m2) dead coarse root N storage - leafn_xfer => cnveg_nitrogenstate_inst%leafn_xfer_patch , & ! InOut: [real(r8) (:)] (gN/m2) leaf N transfer - frootn_xfer => cnveg_nitrogenstate_inst%frootn_xfer_patch , & ! InOut: [real(r8) (:)] (gN/m2) fine root N transfer - livestemn_xfer => cnveg_nitrogenstate_inst%livestemn_xfer_patch , & ! InOut: [real(r8) (:)] (gN/m2) live stem N transfer - deadstemn_xfer => cnveg_nitrogenstate_inst%deadstemn_xfer_patch , & ! InOut: [real(r8) (:)] (gN/m2) dead stem N transfer - livecrootn_xfer => cnveg_nitrogenstate_inst%livecrootn_xfer_patch , & ! InOut: [real(r8) (:)] (gN/m2) live coarse root N transfer - deadcrootn_xfer => cnveg_nitrogenstate_inst%deadcrootn_xfer_patch , & ! InOut: [real(r8) (:)] (gN/m2) dead coarse root N transfer - - leafc_storage_to_xfer => cnveg_carbonflux_inst%leafc_storage_to_xfer_patch , & ! InOut: [real(r8) (:)] - frootc_storage_to_xfer => cnveg_carbonflux_inst%frootc_storage_to_xfer_patch , & ! InOut: [real(r8) (:)] - livestemc_storage_to_xfer => cnveg_carbonflux_inst%livestemc_storage_to_xfer_patch , & ! InOut: [real(r8) (:)] - deadstemc_storage_to_xfer => cnveg_carbonflux_inst%deadstemc_storage_to_xfer_patch , & ! InOut: [real(r8) (:)] - livecrootc_storage_to_xfer => cnveg_carbonflux_inst%livecrootc_storage_to_xfer_patch , & ! InOut: [real(r8) (:)] - deadcrootc_storage_to_xfer => cnveg_carbonflux_inst%deadcrootc_storage_to_xfer_patch , & ! InOut: [real(r8) (:)] - gresp_storage_to_xfer => cnveg_carbonflux_inst%gresp_storage_to_xfer_patch , & ! InOut: [real(r8) (:)] - leafc_xfer_to_leafc => cnveg_carbonflux_inst%leafc_xfer_to_leafc_patch , & ! InOut: [real(r8) (:)] - frootc_xfer_to_frootc => cnveg_carbonflux_inst%frootc_xfer_to_frootc_patch , & ! InOut: [real(r8) (:)] - livestemc_xfer_to_livestemc => cnveg_carbonflux_inst%livestemc_xfer_to_livestemc_patch , & ! InOut: [real(r8) (:)] - deadstemc_xfer_to_deadstemc => cnveg_carbonflux_inst%deadstemc_xfer_to_deadstemc_patch , & ! InOut: [real(r8) (:)] - livecrootc_xfer_to_livecrootc => cnveg_carbonflux_inst%livecrootc_xfer_to_livecrootc_patch , & ! InOut: [real(r8) (:)] - deadcrootc_xfer_to_deadcrootc => cnveg_carbonflux_inst%deadcrootc_xfer_to_deadcrootc_patch , & ! InOut: [real(r8) (:)] - - leafn_storage_to_xfer => cnveg_nitrogenflux_inst%leafn_storage_to_xfer_patch , & ! InOut: [real(r8) (:)] - frootn_storage_to_xfer => cnveg_nitrogenflux_inst%frootn_storage_to_xfer_patch , & ! InOut: [real(r8) (:)] - livestemn_storage_to_xfer => cnveg_nitrogenflux_inst%livestemn_storage_to_xfer_patch , & ! InOut: [real(r8) (:)] - deadstemn_storage_to_xfer => cnveg_nitrogenflux_inst%deadstemn_storage_to_xfer_patch , & ! InOut: [real(r8) (:)] - livecrootn_storage_to_xfer => cnveg_nitrogenflux_inst%livecrootn_storage_to_xfer_patch , & ! InOut: [real(r8) (:)] - deadcrootn_storage_to_xfer => cnveg_nitrogenflux_inst%deadcrootn_storage_to_xfer_patch , & ! InOut: [real(r8) (:)] - leafn_xfer_to_leafn => cnveg_nitrogenflux_inst%leafn_xfer_to_leafn_patch , & ! InOut: [real(r8) (:)] - frootn_xfer_to_frootn => cnveg_nitrogenflux_inst%frootn_xfer_to_frootn_patch , & ! InOut: [real(r8) (:)] - livestemn_xfer_to_livestemn => cnveg_nitrogenflux_inst%livestemn_xfer_to_livestemn_patch , & ! InOut: [real(r8) (:)] - deadstemn_xfer_to_deadstemn => cnveg_nitrogenflux_inst%deadstemn_xfer_to_deadstemn_patch , & ! InOut: [real(r8) (:)] - livecrootn_xfer_to_livecrootn => cnveg_nitrogenflux_inst%livecrootn_xfer_to_livecrootn_patch , & ! InOut: [real(r8) (:)] - deadcrootn_xfer_to_deadcrootn => cnveg_nitrogenflux_inst%deadcrootn_xfer_to_deadcrootn_patch , & ! InOut: [real(r8) (:)] - - bglfr => cnveg_state_inst%bglfr_patch , & ! Output: [real(r8) (:) ] background litterfall rate (1/s) - bgtr => cnveg_state_inst%bgtr_patch , & ! Output: [real(r8) (:) ] background transfer growth rate (1/s) - lgsf => cnveg_state_inst%lgsf_patch , & ! Output: [real(r8) (:) ] long growing season factor [0-1] - ileafst_to_ileafxf_phc => cnveg_carbonflux_inst%ileafst_to_ileafxf_ph , & ! Input: [integer (:)] Index of phenology related C transfer from leaf storage pool to leaf transfer pool - ileafxf_to_ileaf_phc => cnveg_carbonflux_inst%ileafxf_to_ileaf_ph , & ! Input: [integer (:)] Index of phenology related C transfer from leaf transfer pool to leaf pool - ifrootst_to_ifrootxf_phc => cnveg_carbonflux_inst%ifrootst_to_ifrootxf_ph , & ! Input: [integer (:)] Index of phenology related C transfer from fine root storage pool to fine root transfer pool - ifrootxf_to_ifroot_phc => cnveg_carbonflux_inst%ifrootxf_to_ifroot_ph , & ! Input: [integer (:)] Index of phenology related C transfer from fine root transfer pool to fine root pool - ilivestemst_to_ilivestemxf_phc => cnveg_carbonflux_inst%ilivestemst_to_ilivestemxf_ph , & ! Input: [integer (:)] Index of phenology related C transfer from live stem storage pool to live stem transfer pool - ilivestemxf_to_ilivestem_phc => cnveg_carbonflux_inst%ilivestemxf_to_ilivestem_ph , & ! Input: [integer (:)] Index of phenology related C transfer from live stem transfer pool to live stem pool - ideadstemst_to_ideadstemxf_phc => cnveg_carbonflux_inst%ideadstemst_to_ideadstemxf_ph , & ! Input: [integer (:)] Index of phenology related C transfer from dead stem storage pool to dead stem transfer pool - ideadstemxf_to_ideadstem_phc => cnveg_carbonflux_inst%ideadstemxf_to_ideadstem_ph , & ! Input: [integer (:)] Index of phenology related C transfer from dead stem transfer pool to dead stem pool - ilivecrootst_to_ilivecrootxf_phc => cnveg_carbonflux_inst%ilivecrootst_to_ilivecrootxf_ph , & ! Input: [integer (:)] Index of phenology related C transfer from live coarse root storage pool to live coarse root transfer pool - ilivecrootxf_to_ilivecroot_phc => cnveg_carbonflux_inst%ilivecrootxf_to_ilivecroot_ph , & ! Input: [integer (:)] Index of phenology related C transfer from live coarse root transfer pool to live coarse root pool - ideadcrootst_to_ideadcrootxf_phc => cnveg_carbonflux_inst%ideadcrootst_to_ideadcrootxf_ph , & ! Input: [integer (:)] Index of phenology related C transfer from dead coarse root storage pool to dead coarse root transfer pool - ideadcrootxf_to_ideadcroot_phc => cnveg_carbonflux_inst%ideadcrootxf_to_ideadcroot_ph , & ! Input: [integer (:)] Index of phenology related C transfer from dead coarse root transfer pool to dead coarse root pool - ilivestem_to_ideadstem_phc => cnveg_carbonflux_inst%ilivestem_to_ideadstem_ph , & ! Input: [integer (:)] Index of phenology related C transfer from live stem pool to dead stem pool - ilivecroot_to_ideadcroot_phc => cnveg_carbonflux_inst%ilivecroot_to_ideadcroot_ph , & ! Input: [integer (:)] Index of phenology related C transfer from live coarse root to dead coarse root pool - ileaf_to_iout_phc => cnveg_carbonflux_inst%ileaf_to_iout_ph , & ! Input: [integer (:)] Index of phenology related C transfer from leaf pool to outside of vegetation pools - ifroot_to_iout_phc => cnveg_carbonflux_inst%ifroot_to_iout_ph , & ! Input: [integer (:)] Index of phenology related C transfer from fine root pool to outside of vegetation pools - ilivestem_to_iout_phc => cnveg_carbonflux_inst%ilivestem_to_iout_ph , & ! Input: [integer (:)] Index of phenology related C transfer from live stem pool to outside of vegetation pools - igrain_to_iout_phc => cnveg_carbonflux_inst%igrain_to_iout_ph , & ! Input: [integer (:)] Index of phenology related C transfer from grain pool to outside of vegetation pools - ileafst_to_ileafxf_phn => cnveg_nitrogenflux_inst%ileafst_to_ileafxf_ph , & ! Input: [integer (:)] Index of phenology related C transfer from leaf storage pool to leaf transfer pool - ileafxf_to_ileaf_phn => cnveg_nitrogenflux_inst%ileafxf_to_ileaf_ph , & ! Input: [integer (:)] Index of phenology related C transfer from leaf transfer pool to leaf pool - ifrootst_to_ifrootxf_phn => cnveg_nitrogenflux_inst%ifrootst_to_ifrootxf_ph , & ! Input: [integer (:)] Index of phenology related C transfer from fine root storage pool to fine root transfer pool - ifrootxf_to_ifroot_phn => cnveg_nitrogenflux_inst%ifrootxf_to_ifroot_ph , & ! Input: [integer (:)] Index of phenology related C transfer from fine root transfer pool to fine root pool - ilivestemst_to_ilivestemxf_phn => cnveg_nitrogenflux_inst%ilivestemst_to_ilivestemxf_ph , & ! Input: [integer (:)] Index of phenology related C transfer from live stem storage pool to live stem transfer pool - ilivestemxf_to_ilivestem_phn => cnveg_nitrogenflux_inst%ilivestemxf_to_ilivestem_ph , & ! Input: [integer (:)] Index of phenology related C transfer from live stem transfer pool to live stem pool - ideadstemst_to_ideadstemxf_phn => cnveg_nitrogenflux_inst%ideadstemst_to_ideadstemxf_ph , & ! Input: [integer (:)] Index of phenology related C transfer from dead stem storage pool to dead stem transfer pool - ideadstemxf_to_ideadstem_phn => cnveg_nitrogenflux_inst%ideadstemxf_to_ideadstem_ph , & ! Input: [integer (:)] Index of phenology related C transfer from dead stem transfer pool to dead stem pool - ilivecrootst_to_ilivecrootxf_phn => cnveg_nitrogenflux_inst%ilivecrootst_to_ilivecrootxf_ph , & ! Input: [integer (:)] Index of phenology related C transfer from live coarse root storage pool to live coarse root transfer pool - ilivecrootxf_to_ilivecroot_phn => cnveg_nitrogenflux_inst%ilivecrootxf_to_ilivecroot_ph , & ! Input: [integer (:)] Index of phenology related C transfer from live coarse root transfer pool to live coarse root pool - ideadcrootst_to_ideadcrootxf_phn => cnveg_nitrogenflux_inst%ideadcrootst_to_ideadcrootxf_ph , & ! Input: [integer (:)] Index of phenology related C transfer from dead coarse root storage pool to dead coarse root transfer pool - ideadcrootxf_to_ideadcroot_phn => cnveg_nitrogenflux_inst%ideadcrootxf_to_ideadcroot_ph , & ! Input: [integer (:)] Index of phenology related C transfer from dead coarse root transfer pool to dead coarse root pool - ilivestem_to_ideadstem_phn => cnveg_nitrogenflux_inst%ilivestem_to_ideadstem_ph , & ! Input: [integer (:)] Index of phenology related C transfer from live stem pool to dead stem pool - ilivecroot_to_ideadcroot_phn => cnveg_nitrogenflux_inst%ilivecroot_to_ideadcroot_ph , & ! Input: [integer (:)] Index of phenology related C transfer from live coarse root to dead coarse root pool - ileaf_to_iout_phn => cnveg_nitrogenflux_inst%ileaf_to_iout_ph , & ! Input: [integer (:)] Index of phenology related C transfer from leaf pool to outside of vegetation pools - ifroot_to_iout_phn => cnveg_nitrogenflux_inst%ifroot_to_iout_ph , & ! Input: [integer (:)] Index of phenology related C transfer from fine root pool to outside of vegetation pools - ilivestem_to_iout_phn => cnveg_nitrogenflux_inst%ilivestem_to_iout_ph , & ! Input: [integer (:)] Index of phenology related C transfer from live stem pool to outside of vegetation pools - ileaf_to_iretransn_phn => cnveg_nitrogenflux_inst%ileaf_to_iretransn_ph , & ! Input: [integer (:)] Index of phenology related C transfer from leaf pool to retranslocation pool - ilivestem_to_iretransn_phn => cnveg_nitrogenflux_inst%ilivestem_to_iretransn_ph , & ! Input: [integer (:)] Index of phenology related C transfer from live stem pool to retranslocation pool - ilivecroot_to_iretransn_phn => cnveg_nitrogenflux_inst%ilivecroot_to_iretransn_ph , & ! Input: [integer (:)] Index of phenology related C transfer from live coarse root pool to retranslocation pool - igrain_to_iout_phn => cnveg_nitrogenflux_inst%igrain_to_iout_ph & ! Input: [integer (:)] Index of phenology related C transfer from grain pool to outside of vegetation pools + leafc_storage => cnveg_carbonstate_inst%leafc_storage_patch , & ! Input: [real(r8) (:)] (gC/m2) leaf C storage + frootc_storage => cnveg_carbonstate_inst%frootc_storage_patch , & ! Input: [real(r8) (:)] (gC/m2) fine root C storage + livestemc_storage => cnveg_carbonstate_inst%livestemc_storage_patch , & ! Input: [real(r8) (:)] (gC/m2) live stem C storage + deadstemc_storage => cnveg_carbonstate_inst%deadstemc_storage_patch , & ! Input: [real(r8) (:)] (gC/m2) dead stem C storage + livecrootc_storage => cnveg_carbonstate_inst%livecrootc_storage_patch , & ! Input: [real(r8) (:)] (gC/m2) live coarse root C storage + deadcrootc_storage => cnveg_carbonstate_inst%deadcrootc_storage_patch , & ! Input: [real(r8) (:)] (gC/m2) dead coarse root C storage + gresp_storage => cnveg_carbonstate_inst%gresp_storage_patch , & ! Input: [real(r8) (:)] (gC/m2) growth respiration storage + leafc_xfer => cnveg_carbonstate_inst%leafc_xfer_patch , & ! InOut: [real(r8) (:)] (gC/m2) leaf C transfer + frootc_xfer => cnveg_carbonstate_inst%frootc_xfer_patch , & ! InOut: [real(r8) (:)] (gC/m2) fine root C transfer + livestemc_xfer => cnveg_carbonstate_inst%livestemc_xfer_patch , & ! InOut: [real(r8) (:)] (gC/m2) live stem C transfer + deadstemc_xfer => cnveg_carbonstate_inst%deadstemc_xfer_patch , & ! InOut: [real(r8) (:)] (gC/m2) dead stem C transfer + livecrootc_xfer => cnveg_carbonstate_inst%livecrootc_xfer_patch , & ! InOut: [real(r8) (:)] (gC/m2) live coarse root C transfer + deadcrootc_xfer => cnveg_carbonstate_inst%deadcrootc_xfer_patch , & ! InOut: [real(r8) (:)] (gC/m2) dead coarse root C transfer + + leafn_storage => cnveg_nitrogenstate_inst%leafn_storage_patch , & ! Input: [real(r8) (:)] (gN/m2) leaf N storage + frootn_storage => cnveg_nitrogenstate_inst%frootn_storage_patch , & ! Input: [real(r8) (:)] (gN/m2) fine root N storage + livestemn_storage => cnveg_nitrogenstate_inst%livestemn_storage_patch , & ! Input: [real(r8) (:)] (gN/m2) live stem N storage + deadstemn_storage => cnveg_nitrogenstate_inst%deadstemn_storage_patch , & ! Input: [real(r8) (:)] (gN/m2) dead stem N storage + livecrootn_storage => cnveg_nitrogenstate_inst%livecrootn_storage_patch , & ! Input: [real(r8) (:)] (gN/m2) live coarse root N storage + deadcrootn_storage => cnveg_nitrogenstate_inst%deadcrootn_storage_patch , & ! Input: [real(r8) (:)] (gN/m2) dead coarse root N storage + leafn_xfer => cnveg_nitrogenstate_inst%leafn_xfer_patch , & ! InOut: [real(r8) (:)] (gN/m2) leaf N transfer + frootn_xfer => cnveg_nitrogenstate_inst%frootn_xfer_patch , & ! InOut: [real(r8) (:)] (gN/m2) fine root N transfer + livestemn_xfer => cnveg_nitrogenstate_inst%livestemn_xfer_patch , & ! InOut: [real(r8) (:)] (gN/m2) live stem N transfer + deadstemn_xfer => cnveg_nitrogenstate_inst%deadstemn_xfer_patch , & ! InOut: [real(r8) (:)] (gN/m2) dead stem N transfer + livecrootn_xfer => cnveg_nitrogenstate_inst%livecrootn_xfer_patch , & ! InOut: [real(r8) (:)] (gN/m2) live coarse root N transfer + deadcrootn_xfer => cnveg_nitrogenstate_inst%deadcrootn_xfer_patch , & ! InOut: [real(r8) (:)] (gN/m2) dead coarse root N transfer + + leafc_storage_to_xfer => cnveg_carbonflux_inst%leafc_storage_to_xfer_patch , & ! InOut: [real(r8) (:)] + frootc_storage_to_xfer => cnveg_carbonflux_inst%frootc_storage_to_xfer_patch , & ! InOut: [real(r8) (:)] + livestemc_storage_to_xfer => cnveg_carbonflux_inst%livestemc_storage_to_xfer_patch , & ! InOut: [real(r8) (:)] + deadstemc_storage_to_xfer => cnveg_carbonflux_inst%deadstemc_storage_to_xfer_patch , & ! InOut: [real(r8) (:)] + livecrootc_storage_to_xfer => cnveg_carbonflux_inst%livecrootc_storage_to_xfer_patch , & ! InOut: [real(r8) (:)] + deadcrootc_storage_to_xfer => cnveg_carbonflux_inst%deadcrootc_storage_to_xfer_patch , & ! InOut: [real(r8) (:)] + gresp_storage_to_xfer => cnveg_carbonflux_inst%gresp_storage_to_xfer_patch , & ! InOut: [real(r8) (:)] + leafc_xfer_to_leafc => cnveg_carbonflux_inst%leafc_xfer_to_leafc_patch , & ! InOut: [real(r8) (:)] + frootc_xfer_to_frootc => cnveg_carbonflux_inst%frootc_xfer_to_frootc_patch , & ! InOut: [real(r8) (:)] + livestemc_xfer_to_livestemc => cnveg_carbonflux_inst%livestemc_xfer_to_livestemc_patch , & ! InOut: [real(r8) (:)] + deadstemc_xfer_to_deadstemc => cnveg_carbonflux_inst%deadstemc_xfer_to_deadstemc_patch , & ! InOut: [real(r8) (:)] + livecrootc_xfer_to_livecrootc => cnveg_carbonflux_inst%livecrootc_xfer_to_livecrootc_patch , & ! InOut: [real(r8) (:)] + deadcrootc_xfer_to_deadcrootc => cnveg_carbonflux_inst%deadcrootc_xfer_to_deadcrootc_patch , & ! InOut: [real(r8) (:)] + + leafn_storage_to_xfer => cnveg_nitrogenflux_inst%leafn_storage_to_xfer_patch , & ! InOut: [real(r8) (:)] + frootn_storage_to_xfer => cnveg_nitrogenflux_inst%frootn_storage_to_xfer_patch , & ! InOut: [real(r8) (:)] + livestemn_storage_to_xfer => cnveg_nitrogenflux_inst%livestemn_storage_to_xfer_patch , & ! InOut: [real(r8) (:)] + deadstemn_storage_to_xfer => cnveg_nitrogenflux_inst%deadstemn_storage_to_xfer_patch , & ! InOut: [real(r8) (:)] + livecrootn_storage_to_xfer => cnveg_nitrogenflux_inst%livecrootn_storage_to_xfer_patch , & ! InOut: [real(r8) (:)] + deadcrootn_storage_to_xfer => cnveg_nitrogenflux_inst%deadcrootn_storage_to_xfer_patch , & ! InOut: [real(r8) (:)] + leafn_xfer_to_leafn => cnveg_nitrogenflux_inst%leafn_xfer_to_leafn_patch , & ! InOut: [real(r8) (:)] + frootn_xfer_to_frootn => cnveg_nitrogenflux_inst%frootn_xfer_to_frootn_patch , & ! InOut: [real(r8) (:)] + livestemn_xfer_to_livestemn => cnveg_nitrogenflux_inst%livestemn_xfer_to_livestemn_patch , & ! InOut: [real(r8) (:)] + deadstemn_xfer_to_deadstemn => cnveg_nitrogenflux_inst%deadstemn_xfer_to_deadstemn_patch , & ! InOut: [real(r8) (:)] + livecrootn_xfer_to_livecrootn => cnveg_nitrogenflux_inst%livecrootn_xfer_to_livecrootn_patch , & ! InOut: [real(r8) (:)] + deadcrootn_xfer_to_deadcrootn => cnveg_nitrogenflux_inst%deadcrootn_xfer_to_deadcrootn_patch , & ! InOut: [real(r8) (:)] + + bglfr => cnveg_state_inst%bglfr_patch , & ! Output: [real(r8) (:) ] background litterfall rate (1/s) + bgtr => cnveg_state_inst%bgtr_patch , & ! Output: [real(r8) (:) ] background transfer growth rate (1/s) + lgsf => cnveg_state_inst%lgsf_patch , & ! Output: [real(r8) (:) ] long growing season factor [0-1] + + ileafst_to_ileafxf_phc => cnveg_carbonflux_inst%ileafst_to_ileafxf_ph , & ! Input: [integer (:)] Index of phenology related C transfer from leaf storage pool to leaf transfer pool + ileafxf_to_ileaf_phc => cnveg_carbonflux_inst%ileafxf_to_ileaf_ph , & ! Input: [integer (:)] Index of phenology related C transfer from leaf transfer pool to leaf pool + ifrootst_to_ifrootxf_phc => cnveg_carbonflux_inst%ifrootst_to_ifrootxf_ph , & ! Input: [integer (:)] Index of phenology related C transfer from fine root storage pool to fine root transfer pool + ifrootxf_to_ifroot_phc => cnveg_carbonflux_inst%ifrootxf_to_ifroot_ph , & ! Input: [integer (:)] Index of phenology related C transfer from fine root transfer pool to fine root pool + ilivestemst_to_ilivestemxf_phc => cnveg_carbonflux_inst%ilivestemst_to_ilivestemxf_ph , & ! Input: [integer (:)] Index of phenology related C transfer from live stem storage pool to live stem transfer pool + ilivestemxf_to_ilivestem_phc => cnveg_carbonflux_inst%ilivestemxf_to_ilivestem_ph , & ! Input: [integer (:)] Index of phenology related C transfer from live stem transfer pool to live stem pool + ideadstemst_to_ideadstemxf_phc => cnveg_carbonflux_inst%ideadstemst_to_ideadstemxf_ph , & ! Input: [integer (:)] Index of phenology related C transfer from dead stem storage pool to dead stem transfer pool + ideadstemxf_to_ideadstem_phc => cnveg_carbonflux_inst%ideadstemxf_to_ideadstem_ph , & ! Input: [integer (:)] Index of phenology related C transfer from dead stem transfer pool to dead stem pool + ilivecrootst_to_ilivecrootxf_phc => cnveg_carbonflux_inst%ilivecrootst_to_ilivecrootxf_ph , & ! Input: [integer (:)] Index of phenology related C transfer from live coarse root storage pool to live coarse root transfer pool + ilivecrootxf_to_ilivecroot_phc => cnveg_carbonflux_inst%ilivecrootxf_to_ilivecroot_ph , & ! Input: [integer (:)] Index of phenology related C transfer from live coarse root transfer pool to live coarse root pool + ideadcrootst_to_ideadcrootxf_phc => cnveg_carbonflux_inst%ideadcrootst_to_ideadcrootxf_ph , & ! Input: [integer (:)] Index of phenology related C transfer from dead coarse root storage pool to dead coarse root transfer pool + ideadcrootxf_to_ideadcroot_phc => cnveg_carbonflux_inst%ideadcrootxf_to_ideadcroot_ph , & ! Input: [integer (:)] Index of phenology related C transfer from dead coarse root transfer pool to dead coarse root pool + ilivestem_to_ideadstem_phc => cnveg_carbonflux_inst%ilivestem_to_ideadstem_ph , & ! Input: [integer (:)] Index of phenology related C transfer from live stem pool to dead stem pool + ilivecroot_to_ideadcroot_phc => cnveg_carbonflux_inst%ilivecroot_to_ideadcroot_ph , & ! Input: [integer (:)] Index of phenology related C transfer from live coarse root to dead coarse root pool + ileaf_to_iout_phc => cnveg_carbonflux_inst%ileaf_to_iout_ph , & ! Input: [integer (:)] Index of phenology related C transfer from leaf pool to outside of vegetation pools + ifroot_to_iout_phc => cnveg_carbonflux_inst%ifroot_to_iout_ph , & ! Input: [integer (:)] Index of phenology related C transfer from fine root pool to outside of vegetation pools + ilivestem_to_iout_phc => cnveg_carbonflux_inst%ilivestem_to_iout_ph , & ! Input: [integer (:)] Index of phenology related C transfer from live stem pool to outside of vegetation pools + igrain_to_iout_phc => cnveg_carbonflux_inst%igrain_to_iout_ph , & ! Input: [integer (:)] Index of phenology related C transfer from grain pool to outside of vegetation pools + ileafst_to_ileafxf_phn => cnveg_nitrogenflux_inst%ileafst_to_ileafxf_ph , & ! Input: [integer (:)] Index of phenology related C transfer from leaf storage pool to leaf transfer pool + ileafxf_to_ileaf_phn => cnveg_nitrogenflux_inst%ileafxf_to_ileaf_ph , & ! Input: [integer (:)] Index of phenology related C transfer from leaf transfer pool to leaf pool + ifrootst_to_ifrootxf_phn => cnveg_nitrogenflux_inst%ifrootst_to_ifrootxf_ph , & ! Input: [integer (:)] Index of phenology related C transfer from fine root storage pool to fine root transfer pool + ifrootxf_to_ifroot_phn => cnveg_nitrogenflux_inst%ifrootxf_to_ifroot_ph , & ! Input: [integer (:)] Index of phenology related C transfer from fine root transfer pool to fine root pool + ilivestemst_to_ilivestemxf_phn => cnveg_nitrogenflux_inst%ilivestemst_to_ilivestemxf_ph , & ! Input: [integer (:)] Index of phenology related C transfer from live stem storage pool to live stem transfer pool + ilivestemxf_to_ilivestem_phn => cnveg_nitrogenflux_inst%ilivestemxf_to_ilivestem_ph , & ! Input: [integer (:)] Index of phenology related C transfer from live stem transfer pool to live stem pool + ideadstemst_to_ideadstemxf_phn => cnveg_nitrogenflux_inst%ideadstemst_to_ideadstemxf_ph , & ! Input: [integer (:)] Index of phenology related C transfer from dead stem storage pool to dead stem transfer pool + ideadstemxf_to_ideadstem_phn => cnveg_nitrogenflux_inst%ideadstemxf_to_ideadstem_ph , & ! Input: [integer (:)] Index of phenology related C transfer from dead stem transfer pool to dead stem pool + ilivecrootst_to_ilivecrootxf_phn => cnveg_nitrogenflux_inst%ilivecrootst_to_ilivecrootxf_ph , & ! Input: [integer (:)] Index of phenology related C transfer from live coarse root storage pool to live coarse root transfer pool + ilivecrootxf_to_ilivecroot_phn => cnveg_nitrogenflux_inst%ilivecrootxf_to_ilivecroot_ph , & ! Input: [integer (:)] Index of phenology related C transfer from live coarse root transfer pool to live coarse root pool + ideadcrootst_to_ideadcrootxf_phn => cnveg_nitrogenflux_inst%ideadcrootst_to_ideadcrootxf_ph , & ! Input: [integer (:)] Index of phenology related C transfer from dead coarse root storage pool to dead coarse root transfer pool + ideadcrootxf_to_ideadcroot_phn => cnveg_nitrogenflux_inst%ideadcrootxf_to_ideadcroot_ph , & ! Input: [integer (:)] Index of phenology related C transfer from dead coarse root transfer pool to dead coarse root pool + ilivestem_to_ideadstem_phn => cnveg_nitrogenflux_inst%ilivestem_to_ideadstem_ph , & ! Input: [integer (:)] Index of phenology related C transfer from live stem pool to dead stem pool + ilivecroot_to_ideadcroot_phn => cnveg_nitrogenflux_inst%ilivecroot_to_ideadcroot_ph , & ! Input: [integer (:)] Index of phenology related C transfer from live coarse root to dead coarse root pool + ileaf_to_iout_phn => cnveg_nitrogenflux_inst%ileaf_to_iout_ph , & ! Input: [integer (:)] Index of phenology related C transfer from leaf pool to outside of vegetation pools + ifroot_to_iout_phn => cnveg_nitrogenflux_inst%ifroot_to_iout_ph , & ! Input: [integer (:)] Index of phenology related C transfer from fine root pool to outside of vegetation pools + ilivestem_to_iout_phn => cnveg_nitrogenflux_inst%ilivestem_to_iout_ph , & ! Input: [integer (:)] Index of phenology related C transfer from live stem pool to outside of vegetation pools + ileaf_to_iretransn_phn => cnveg_nitrogenflux_inst%ileaf_to_iretransn_ph , & ! Input: [integer (:)] Index of phenology related C transfer from leaf pool to retranslocation pool + ilivestem_to_iretransn_phn => cnveg_nitrogenflux_inst%ilivestem_to_iretransn_ph , & ! Input: [integer (:)] Index of phenology related C transfer from live stem pool to retranslocation pool + ilivecroot_to_iretransn_phn => cnveg_nitrogenflux_inst%ilivecroot_to_iretransn_ph , & ! Input: [integer (:)] Index of phenology related C transfer from live coarse root pool to retranslocation pool + igrain_to_iout_phn => cnveg_nitrogenflux_inst%igrain_to_iout_ph & ! Input: [integer (:)] Index of phenology related C transfer from grain pool to outside of vegetation pools ) avg_dayspyr = get_average_days_per_year() @@ -770,17 +769,7 @@ subroutine CNEvergreenPhenology (num_soilp, filter_soilp , & tranr=0.0002_r8 ! set carbon fluxes for shifting storage pools to transfer pools - if (.not. use_matrixcn) then - leafc_storage_to_xfer(p) = tranr * leafc_storage(p)/dt - frootc_storage_to_xfer(p) = tranr * frootc_storage(p)/dt - if (woody(ivt(p)) == 1.0_r8) then - livestemc_storage_to_xfer(p) = tranr * livestemc_storage(p)/dt - deadstemc_storage_to_xfer(p) = tranr * deadstemc_storage(p)/dt - livecrootc_storage_to_xfer(p) = tranr * livecrootc_storage(p)/dt - deadcrootc_storage_to_xfer(p) = tranr * deadcrootc_storage(p)/dt - gresp_storage_to_xfer(p) = tranr * gresp_storage(p)/dt - end if - else + if (use_matrixcn) then leafc_storage_to_xfer(p) = leafc_storage(p) * matrix_update_phc(p,ileafst_to_ileafxf_phc,tranr/dt,dt,cnveg_carbonflux_inst,matrixcheck_ph,acc_ph) frootc_storage_to_xfer(p) = frootc_storage(p) * matrix_update_phc(p,ifrootst_to_ifrootxf_phc,tranr/dt,dt,cnveg_carbonflux_inst,matrixcheck_ph,acc_ph) if (woody(ivt(p)) == 1.0_r8) then @@ -789,7 +778,18 @@ subroutine CNEvergreenPhenology (num_soilp, filter_soilp , & livecrootc_storage_to_xfer(p) = livecrootc_storage(p) * matrix_update_phc(p,ilivecrootst_to_ilivecrootxf_phc,tranr/dt,dt,cnveg_carbonflux_inst,matrixcheck_ph,acc_ph) deadcrootc_storage_to_xfer(p) = deadcrootc_storage(p) * matrix_update_phc(p,ideadcrootst_to_ideadcrootxf_phc,tranr/dt,dt,cnveg_carbonflux_inst,matrixcheck_ph,acc_ph) end if - end if !not use_matrixcn + else + ! NOTE: The non matrix version of this is in CNCStateUpdate1::CStateUpdate1 EBK (11/26/2019) + leafc_storage_to_xfer(p) = tranr * leafc_storage(p)/dt + frootc_storage_to_xfer(p) = tranr * frootc_storage(p)/dt + if (woody(ivt(p)) == 1.0_r8) then + livestemc_storage_to_xfer(p) = tranr * livestemc_storage(p)/dt + deadstemc_storage_to_xfer(p) = tranr * deadstemc_storage(p)/dt + livecrootc_storage_to_xfer(p) = tranr * livecrootc_storage(p)/dt + deadcrootc_storage_to_xfer(p) = tranr * deadcrootc_storage(p)/dt + gresp_storage_to_xfer(p) = tranr * gresp_storage(p)/dt + end if + end if !use_matrixcn ! set nitrogen fluxes for shifting storage pools to transfer pools if (use_matrixcn) then @@ -1849,37 +1849,36 @@ subroutine CNStressDecidPhenology (num_soilp, filter_soilp , & ! between leafc and leafc_store in the flux. RosieF, Nov5 2015. leafc_storage_to_xfer(p) = max(0.0_r8,(leafc_storage(p)-leafc(p))) * bgtr(p) frootc_storage_to_xfer(p) = max(0.0_r8,(frootc_storage(p)-frootc(p))) * bgtr(p) - if (use_matrixcn) then - if(leafc_storage(p) > 0._r8)then + if(leafc_storage(p) .gt. 0)then leafc_storage_to_xfer(p) = leafc_storage(p) * matrix_update_phc(p,ileafst_to_ileafxf_phc,& leafc_storage_to_xfer(p) / leafc_storage(p), dt,cnveg_carbonflux_inst,matrixcheck_ph,acc_ph) else - leafc_storage_to_xfer(p) = 0._r8 + leafc_storage_to_xfer(p) = 0 end if - if(frootc_storage(p) > 0._r8)then + if(frootc_storage(p) .gt. 0)then frootc_storage_to_xfer(p) = frootc_storage(p) * matrix_update_phc(p,ifrootst_to_ifrootxf_phc,& frootc_storage_to_xfer(p) / frootc_storage(p), dt,cnveg_carbonflux_inst,matrixcheck_ph,acc_ph) else - frootc_storage_to_xfer(p) = 0._r8 + frootc_storage_to_xfer(p) = 0 end if - if (woody(ivt(p)) == 1.0_r8) then + if (woody(ivt(p)) == 1.0_r8) then livestemc_storage_to_xfer(p) = livestemc_storage(p) * matrix_update_phc(p,ilivestemst_to_ilivestemxf_phc ,bgtr(p),dt,cnveg_carbonflux_inst,matrixcheck_ph,acc_ph) deadstemc_storage_to_xfer(p) = deadstemc_storage(p) * matrix_update_phc(p,ideadstemst_to_ideadstemxf_phc ,bgtr(p),dt,cnveg_carbonflux_inst,matrixcheck_ph,acc_ph) livecrootc_storage_to_xfer(p) = livecrootc_storage(p) * matrix_update_phc(p,ilivecrootst_to_ilivecrootxf_phc,bgtr(p),dt,cnveg_carbonflux_inst,matrixcheck_ph,acc_ph) deadcrootc_storage_to_xfer(p) = deadcrootc_storage(p) * matrix_update_phc(p,ideadcrootst_to_ideadcrootxf_phc,bgtr(p),dt,cnveg_carbonflux_inst,matrixcheck_ph,acc_ph) - end if - else - ! NOTE: The non matrix version of this is in CNCStateUpdate1::CStateUpdate1 EBK (11/26/2019) - ! and CNNStateUpdate1::NStateUpdate1 - if (woody(ivt(p)) == 1.0_r8) then - livestemc_storage_to_xfer(p) = livestemc_storage(p) * bgtr(p) - deadstemc_storage_to_xfer(p) = deadstemc_storage(p) * bgtr(p) - livecrootc_storage_to_xfer(p) = livecrootc_storage(p) * bgtr(p) - deadcrootc_storage_to_xfer(p) = deadcrootc_storage(p) * bgtr(p) - gresp_storage_to_xfer(p) = gresp_storage(p) * bgtr(p) - end if - end if !use_matrixcn + end if + else + ! NOTE: The non matrix version of this is in CNCStateUpdate1::CStateUpdate1 EBK (11/26/2019) + ! and CNNStateUpdate1::NStateUpdate1 + if (woody(ivt(p)) == 1.0_r8) then + livestemc_storage_to_xfer(p) = livestemc_storage(p) * bgtr(p) + deadstemc_storage_to_xfer(p) = deadstemc_storage(p) * bgtr(p) + livecrootc_storage_to_xfer(p) = livecrootc_storage(p) * bgtr(p) + deadcrootc_storage_to_xfer(p) = deadcrootc_storage(p) * bgtr(p) + gresp_storage_to_xfer(p) = gresp_storage(p) * bgtr(p) + end if + end if !use_matrixcn ! set nitrogen fluxes for shifting storage pools to transfer pools if (use_matrixcn) then @@ -2920,22 +2919,7 @@ subroutine CNOnsetGrowth (num_soilp, filter_soilp, & ! pools should be moved to displayed growth in each timestep. if (bgtr(p) > 0._r8) then - if(.not. use_matrixcn)then - leafc_xfer_to_leafc(p) = leafc_xfer(p) / dt - frootc_xfer_to_frootc(p) = frootc_xfer(p) / dt - leafn_xfer_to_leafn(p) = leafn_xfer(p) / dt - frootn_xfer_to_frootn(p) = frootn_xfer(p) / dt - if (woody(ivt(p)) == 1.0_r8) then - livestemc_xfer_to_livestemc(p) = livestemc_xfer(p) / dt - deadstemc_xfer_to_deadstemc(p) = deadstemc_xfer(p) / dt - livecrootc_xfer_to_livecrootc(p) = livecrootc_xfer(p) / dt - deadcrootc_xfer_to_deadcrootc(p) = deadcrootc_xfer(p) / dt - livestemn_xfer_to_livestemn(p) = livestemn_xfer(p) / dt - deadstemn_xfer_to_deadstemn(p) = deadstemn_xfer(p) / dt - livecrootn_xfer_to_livecrootn(p) = livecrootn_xfer(p) / dt - deadcrootn_xfer_to_deadcrootn(p) = deadcrootn_xfer(p) / dt - end if - else + if(use_matrixcn)then leafc_xfer_to_leafc(p) = leafc_xfer(p) * matrix_update_phc(p,ileafxf_to_ileaf_phc,1._r8 / dt,dt,cnveg_carbonflux_inst,matrixcheck_ph,acc_ph) frootc_xfer_to_frootc(p) = frootc_xfer(p) * matrix_update_phc(p,ifrootxf_to_ifroot_phc,1._r8 / dt,dt,cnveg_carbonflux_inst,matrixcheck_ph,acc_ph) leafn_xfer_to_leafn(p) = leafn_xfer(p) * matrix_update_phn(p,ileafxf_to_ileaf_phn,1._r8 / dt,dt,cnveg_nitrogenflux_inst,matrixcheck_ph,acc_ph) @@ -2952,7 +2936,24 @@ subroutine CNOnsetGrowth (num_soilp, filter_soilp, & livecrootn_xfer_to_livecrootn(p) = livecrootn_xfer(p) * matrix_update_phn(p,ilivecrootxf_to_ilivecroot_phn,1._r8 / dt,dt,cnveg_nitrogenflux_inst,matrixcheck_ph,acc_ph) deadcrootn_xfer_to_deadcrootn(p) = deadcrootn_xfer(p) * matrix_update_phn(p,ideadcrootxf_to_ideadcroot_phn,1._r8 / dt,dt,cnveg_nitrogenflux_inst,matrixcheck_ph,acc_ph) end if - end if !not use_matrixcn + else + ! NOTE: The non matrix version of this is in CNCStateUpdate1::CStateUpdate1 EBK (11/26/2019) + ! and CNNStateUpdate1::NStateUpdate1 + leafc_xfer_to_leafc(p) = leafc_xfer(p) / dt + frootc_xfer_to_frootc(p) = frootc_xfer(p) / dt + leafn_xfer_to_leafn(p) = leafn_xfer(p) / dt + frootn_xfer_to_frootn(p) = frootn_xfer(p) / dt + if (woody(ivt(p)) == 1.0_r8) then + livestemc_xfer_to_livestemc(p) = livestemc_xfer(p) / dt + deadstemc_xfer_to_deadstemc(p) = deadstemc_xfer(p) / dt + livecrootc_xfer_to_livecrootc(p) = livecrootc_xfer(p) / dt + deadcrootc_xfer_to_deadcrootc(p) = deadcrootc_xfer(p) / dt + livestemn_xfer_to_livestemn(p) = livestemn_xfer(p) / dt + deadstemn_xfer_to_deadstemn(p) = deadstemn_xfer(p) / dt + livecrootn_xfer_to_livecrootn(p) = livecrootn_xfer(p) / dt + deadcrootn_xfer_to_deadcrootn(p) = deadcrootn_xfer(p) / dt + end if + end if !use_matrixcn end if ! end if bgtr end do ! end patch loop @@ -3113,26 +3114,26 @@ subroutine CNOffsetLitterfall (num_soilp, filter_soilp, & if (abs(offset_counter(p) - dt) <= dt/2._r8) then t1 = 1.0_r8 / dt + frootc_to_litter(p) = t1 * frootc(p) + cpool_to_frootc(p) + + ! biofuel_harvfrac is only non-zero for prognostic crops. + leafc_to_litter(p) = t1 * leafc(p)*(1._r8-biofuel_harvfrac(ivt(p))) + cpool_to_leafc(p) - ! leafc_litter and frootc_to_litter for matrix if (use_matrixcn) then - if(leafc(p) > 0._r8)then + if(leafc(p) .gt. 0)then leafc_to_litter(p) = leafc(p) * matrix_update_phc(p,ileaf_to_iout_phc,leafc_to_litter(p) / leafc(p),dt,cnveg_carbonflux_inst,matrixcheck_ph,acc_ph) else - leafc_to_litter(p) = 0._r8 + leafc_to_litter(p) = 0 end if - if(frootc(p) > 0._r8)then + if(frootc(p) .gt. 0)then frootc_to_litter(p) = frootc(p) * matrix_update_phc(p,ifroot_to_iout_phc,frootc_to_litter(p) / frootc(p),dt,cnveg_carbonflux_inst,matrixcheck_ph,acc_ph) else - frootc_to_litter(p) = 0._r8 + frootc_to_litter(p) = 0 end if else - frootc_to_litter(p) = t1 * frootc(p) + cpool_to_frootc(p) - - ! biofuel_harvfrac is only non-zero for prognostic crops. - leafc_to_litter(p) = t1 * leafc(p)*(1._r8-biofuel_harvfrac(ivt(p))) + cpool_to_leafc(p) + ! NOTE: The non matrix version of this is in CNCStateUpdate1::CStateUpdate1 EBK (11/26/2019) + ! and CNNStateUpdate1::NStateUpdate1 end if ! use_matrixcn - ! this assumes that offset_counter == dt for crops ! if this were ever changed, we'd need to add code to the "else" if (ivt(p) >= npcropmin) then @@ -3176,101 +3177,105 @@ subroutine CNOffsetLitterfall (num_soilp, filter_soilp, & * (1._r8 - repr_structure_harvfrac(ivt(p), k)) end do - ! Matrix for grain, livestem to litter and biofuel + ! Cut a certain fraction (i.e., biofuel_harvfrac(ivt(p))) (e.g., biofuel_harvfrac(ivt(p)=70% for bioenergy crops) of leaf C + ! and move this fration of leaf C to biofuel C, rather than move it to litter + leafc_to_biofuelc(p) = t1 * leafc(p) * biofuel_harvfrac(ivt(p)) + leafn_to_biofueln(p) = t1 * leafn(p) * biofuel_harvfrac(ivt(p)) + + ! Cut a certain fraction (i.e., biofuel_harvfrac(ivt(p))) (e.g., biofuel_harvfrac(ivt(p)=70% for bioenergy crops) of livestem C + ! and move this fration of leaf C to biofuel C, rather than move it to litter + livestemc_to_litter(p) = t1 * livestemc(p)*(1._r8-biofuel_harvfrac(ivt(p))) + cpool_to_livestemc(p) + livestemc_to_biofuelc(p) = t1 * livestemc(p) * biofuel_harvfrac(ivt(p)) + livestemn_to_biofueln(p) = t1 * livestemn(p) * biofuel_harvfrac(ivt(p)) + if(use_matrixcn)then - if(reproductivec(p,1) > 0._r8)then + if(reproductivec(p,1) .gt. 0)then grainc_to_out = reproductivec(p,1) * matrix_update_phc(p,igrain_to_iout_phc,(repr_grainc_to_seed(p,1) + repr_grainc_to_food(p,1)) / reproductivec(p,1),dt,cnveg_carbonflux_inst,matrixcheck_ph,acc_ph) else - repr_grainc_to_seed(p,1) = 0._r8 - repr_grainc_to_food(p,1) = 0._r8 + repr_grainc_to_seed(p,1) = 0 + repr_grainc_to_food(p,1) = 0 end if - if(reproductiven(p,1) > 0._r8)then + if(reproductiven(p,1) .gt. 0)then grainn_to_out = reproductiven(p,1) * matrix_update_phn(p,igrain_to_iout_phn,(repr_grainn_to_seed(p,1) + repr_grainn_to_food(p,1)) / reproductiven(p,1),dt,cnveg_nitrogenflux_inst,matrixcheck_ph,acc_ph) else - repr_grainn_to_seed(p,1) = 0._r8 - repr_grainn_to_food(p,1) = 0._r8 + repr_grainn_to_seed(p,1) = 0 + repr_grainn_to_food(p,1) = 0 end if - if(livestemc(p) > 0._r8)then + if(livestemc(p) .gt. 0)then livestemc_to_litter(p) = livestemc(p) * matrix_update_phc(p,ilivestem_to_iout_phc,livestemc_to_litter(p) / livestemc(p),dt,cnveg_carbonflux_inst,matrixcheck_ph,acc_ph) else - livestemc_to_litter(p) = 0._r8 + livestemc_to_litter(p) = 0 end if - if(livestemn(p) > 0._r8)then + if(livestemn(p) .gt. 0)then livestemn_to_biofueln(p) = livestemn(p) * matrix_update_gmn(p,ilivestem_to_iout_gmn,livestemn_to_biofueln(p) / livestemn(p),dt,cnveg_nitrogenflux_inst,matrixcheck_ph,.True.) else - livestemn_to_biofueln(p) = 0._r8 + livestemn_to_biofueln(p) = 0 end if - if(leafn(p) > 0._r8)then + if(leafn(p) > 0)then leafn_to_biofueln(p) = leafn(p) * matrix_update_gmn(p,ileaf_to_iout_gmn,leafn_to_biofueln(p) / leafn(p),dt,cnveg_nitrogenflux_inst,matrixcheck_ph,.True.) else - leafn_to_biofueln(p) = 0._r8 + leafn_to_biofueln(p) = 0 end if - if (leafc(p) > 0._r8)then + if (leafc(p) > 0)then leafc_to_biofuelc(p) = leafc(p) * matrix_update_gmc(p,ileaf_to_iout_gmc,leafc_to_biofuelc(p) / leafc(p),dt,cnveg_carbonflux_inst,matrixcheck_ph,.True.) else - leafc_to_biofuelc(p) = 0._r8 + leafc_to_biofuelc(p) = 0 end if - if(livestemc(p) > 0._r8)then + if(livestemc(p) .gt. 0)then livestemc_to_biofuelc(p) = livestemc(p) * matrix_update_gmc(p,ilivestem_to_iout_gmc,livestemc_to_biofuelc(p) / livestemc(p),dt,cnveg_carbonflux_inst,matrixcheck_ph,.True.) else - livestemc_to_biofuelc(p) = 0._r8 + livestemc_to_biofuelc(p) = 0 end if else - ! Cut a certain fraction (i.e., biofuel_harvfrac(ivt(p))) (e.g., biofuel_harvfrac(ivt(p)=70% for bioenergy crops) of leaf C - ! and move this fration of leaf C to biofuel C, rather than move it to litter - leafc_to_biofuelc(p) = t1 * leafc(p) * biofuel_harvfrac(ivt(p)) - leafn_to_biofueln(p) = t1 * leafn(p) * biofuel_harvfrac(ivt(p)) - - ! Cut a certain fraction (i.e., biofuel_harvfrac(ivt(p))) (e.g., biofuel_harvfrac(ivt(p)=70% for bioenergy crops) of livestem C - ! and move this fration of leaf C to biofuel C, rather than move it to litter - livestemc_to_litter(p) = t1 * livestemc(p)*(1._r8-biofuel_harvfrac(ivt(p))) + cpool_to_livestemc(p) - livestemc_to_biofuelc(p) = t1 * livestemc(p) * biofuel_harvfrac(ivt(p)) - livestemn_to_biofueln(p) = t1 * livestemn(p) * biofuel_harvfrac(ivt(p)) + ! NOTE: The non matrix version of this is in CNCStateUpdate1::CStateUpdate1 EBK (11/26/2019) + ! and CNNStateUpdate1::NStateUpdate1 end if ! use_matrixcn end if else - ! Matrix for leafc and frootc to litter + t1 = dt * 2.0_r8 / (offset_counter(p) * offset_counter(p)) + leafc_to_litter(p) = prev_leafc_to_litter(p) + t1*(leafc(p) - prev_leafc_to_litter(p)*offset_counter(p)) + frootc_to_litter(p) = prev_frootc_to_litter(p) + t1*(frootc(p) - prev_frootc_to_litter(p)*offset_counter(p)) + if (use_matrixcn) then - if(leafc(p) > 0._r8)then + if(leafc(p) .gt. 0)then leafc_to_litter(p) = leafc(p) * matrix_update_phc(p,ileaf_to_iout_phc,leafc_to_litter(p) / leafc(p),dt,cnveg_carbonflux_inst,matrixcheck_ph,acc_ph) else - leafc_to_litter(p) = 0._r8 + leafc_to_litter(p) = 0 end if - if(frootc(p) > 0._r8)then + if(frootc(p) .gt. 0)then frootc_to_litter(p) = frootc(p) * matrix_update_phc(p,ifroot_to_iout_phc,frootc_to_litter(p) / frootc(p),dt,cnveg_carbonflux_inst,matrixcheck_ph,acc_ph) else - frootc_to_litter(p) = 0._r8 + frootc_to_litter(p) = 0 end if else - t1 = dt * 2.0_r8 / (offset_counter(p) * offset_counter(p)) - leafc_to_litter(p) = prev_leafc_to_litter(p) + t1*(leafc(p) - prev_leafc_to_litter(p)*offset_counter(p)) - frootc_to_litter(p) = prev_frootc_to_litter(p) + t1*(frootc(p) - prev_frootc_to_litter(p)*offset_counter(p)) + ! NOTE: The non matrix version of this is in CNCStateUpdate1::CStateUpdate1 EBK (11/26/2019) + ! and CNNStateUpdate1::NStateUpdate1 end if !use_matrixcn end if if ( use_fun ) then if(leafc_to_litter(p)*dt.gt.leafc(p))then - ! Matrix for leafc to litter - if (use_matrixcn) then - if(leafc(p) > 0._r8)then + leafc_to_litter(p) = leafc(p)/dt + cpool_to_leafc(p) + if (use_matrixcn) then + if(leafc(p) .gt. 0)then leafc_to_litter(p) = leafc(p) * matrix_update_phc(p,ileaf_to_iout_phc,leafc_to_litter(p) / leafc(p),dt,cnveg_carbonflux_inst,matrixcheck_ph,acc_ph) else - leafc_to_litter(p) = 0._r8 + leafc_to_litter(p) = 0 end if - else - leafc_to_litter(p) = leafc(p)/dt + cpool_to_leafc(p) - end if !use_matrixcn + else + ! NOTE: The non matrix version of this is in CNCStateUpdate1::CStateUpdate1 EBK (11/26/2019) + end if !use_matrixcn endif if(frootc_to_litter(p)*dt.gt.frootc(p))then - ! Matrix update for frootc to litter + frootc_to_litter(p) = frootc(p)/dt + cpool_to_frootc(p) if (use_matrixcn) then - if(frootc(p) > 0._r8)then + if(frootc(p) .gt. 0)then frootc_to_litter(p) = frootc(p) * matrix_update_phc(p,ifroot_to_iout_phc,frootc_to_litter(p) / frootc(p),dt,cnveg_carbonflux_inst,matrixcheck_ph,acc_ph) else - frootc_to_litter(p) = 0._r8 + frootc_to_litter(p) = 0 end if else - frootc_to_litter(p) = frootc(p)/dt + cpool_to_frootc(p) + ! NOTE: The non matrix version of this is in CNCStateUpdate1::CStateUpdate1 EBK (11/26/2019) end if !use_matrixcn endif end if @@ -3279,8 +3284,8 @@ subroutine CNOffsetLitterfall (num_soilp, filter_soilp, & if ( use_fun ) then leafc_to_litter_fun(p) = leafc_to_litter(p) leafn_to_retransn(p) = paid_retransn_to_npool(p) + free_retransn_to_npool(p) - if (leafn(p) > 0._r8) then - if (leafn(p)-leafn_to_retransn(p)*dt > 0._r8) then + if (leafn(p).gt.0._r8) then + if (leafn(p)-leafn_to_retransn(p)*dt.gt.0._r8) then leafcn_offset(p) = leafc(p)/(leafn(p)-leafn_to_retransn(p)*dt) else leafcn_offset(p) = leafc(p)/leafn(p) @@ -3290,15 +3295,13 @@ subroutine CNOffsetLitterfall (num_soilp, filter_soilp, & end if leafn_to_litter(p) = leafc_to_litter(p)/leafcn_offset(p) - leafn_to_retransn(p) leafn_to_litter(p) = max(leafn_to_litter(p),0._r8) - - ! Matrix update for leafn to litter and retrans if (use_matrixcn) then - if(leafn(p) > 0._r8)then + if(leafn(p) .gt. 0)then leafn_to_litter(p) = leafn(p) * matrix_update_phn(p,ileaf_to_iout_phn,leafn_to_litter(p) / leafn(p),dt,cnveg_nitrogenflux_inst,matrixcheck_ph,acc_ph) leafn_to_retransn(p) = leafn(p) * matrix_update_phn(p,ileaf_to_iretransn_phn,leafn_to_retransn(p) / leafn(p),dt,cnveg_nitrogenflux_inst,matrixcheck_ph,acc_ph) else - leafn_to_litter(p) = 0._r8 - leafn_to_retransn(p) = 0._r8 + leafn_to_litter(p) = 0 + leafn_to_retransn(p) = 0 end if else ! NOTE: The non matrix version of this is in CNCStateUpdate1::CStateUpdate1 EBK (11/26/2019) @@ -3315,21 +3318,20 @@ subroutine CNOffsetLitterfall (num_soilp, filter_soilp, & end if else - if (CNratio_floating) then + if (CNratio_floating .eqv. .true.) then fr_leafn_to_litter = 0.5_r8 ! assuming 50% of nitrogen turnover goes to litter end if ! calculate the leaf N litterfall and retranslocation leafn_to_litter(p) = leafc_to_litter(p) / lflitcn(ivt(p)) leafn_to_retransn(p) = (leafc_to_litter(p) / leafcn(ivt(p))) - leafn_to_litter(p) - ! Matrix update for leafn to litter and retrans if (use_matrixcn) then - if(leafn(p) > 0._r8)then + if(leafn(p) .gt. 0)then leafn_to_litter(p) = leafn(p) * matrix_update_phn(p,ileaf_to_iout_phn,leafn_to_litter(p) / leafn(p),dt,cnveg_nitrogenflux_inst,matrixcheck_ph,acc_ph) leafn_to_retransn(p) = leafn(p) * matrix_update_phn(p,ileaf_to_iretransn_phn,leafn_to_retransn(p) / leafn(p),dt,cnveg_nitrogenflux_inst,matrixcheck_ph,acc_ph) else - leafn_to_litter(p) = 0._r8 - leafn_to_retransn(p) = 0._r8 + leafn_to_litter(p) = 0 + leafn_to_retransn(p) = 0 end if else ! NOTE: The non matrix version of this is in CNNStateUpdate1::NStateUpdate1 EBK (11/26/2019) @@ -3338,49 +3340,44 @@ subroutine CNOffsetLitterfall (num_soilp, filter_soilp, & ! calculate fine root N litterfall (no retranslocation of fine root N) frootn_to_litter(p) = frootc_to_litter(p) / frootcn(ivt(p)) - - ! Matrix update for frootn to litter if (use_matrixcn) then - if(frootn(p) > 0._r8)then + if(frootn(p) .gt. 0)then frootn_to_litter(p) = frootn(p) * matrix_update_phn(p,ifroot_to_iout_phn,frootn_to_litter(p) / frootn(p),dt,cnveg_nitrogenflux_inst,matrixcheck_ph,acc_ph) else - frootn_to_litter(p) = 0._r8 + frootn_to_litter(p) = 0 end if else ! NOTE: The non matrix version of this is in CNNStateUpdate1::NStateUpdate1 EBK (11/26/2019) end if !use_matrixcn - if (CNratio_floating) then - if (.not. use_matrixcn) then - if (leafc(p) == 0.0_r8) then - ntovr_leaf = 0.0_r8 - else - ntovr_leaf = leafc_to_litter(p) * (leafn(p) / leafc(p)) - end if + if (CNratio_floating .eqv. .true.) then + if (leafc(p) == 0.0_r8) then + ntovr_leaf = 0.0_r8 + else + ntovr_leaf = leafc_to_litter(p) * (leafn(p) / leafc(p)) + end if - leafn_to_litter(p) = fr_leafn_to_litter * ntovr_leaf - leafn_to_retransn(p) = ntovr_leaf - leafn_to_litter(p) - else ! Matrix update for leafn to litter and retrans - if(leafn(p) > 0._r8)then + leafn_to_litter(p) = fr_leafn_to_litter * ntovr_leaf + leafn_to_retransn(p) = ntovr_leaf - leafn_to_litter(p) + if (use_matrixcn) then + if(leafn(p) .gt. 0)then leafn_to_litter(p) = leafn(p) * matrix_update_phn(p,ileaf_to_iout_phn,leafn_to_litter(p) / leafn(p),dt,cnveg_nitrogenflux_inst,matrixcheck_ph,acc_ph) leafn_to_retransn(p) = leafn(p) * matrix_update_phn(p,ileaf_to_iretransn_phn,leafn_to_retransn(p) / leafn(p),dt,cnveg_nitrogenflux_inst,matrixcheck_ph,acc_ph) else - leafn_to_litter(p) = 0._r8 - leafn_to_retransn(p) = 0._r8 + leafn_to_litter(p) = 0 + leafn_to_retransn(p) = 0 end if - end if ! .not. use_matrixcn + end if !use_matrixcn if (frootc(p) == 0.0_r8) then frootn_to_litter(p) = 0.0_r8 - else + else frootn_to_litter(p) = frootc_to_litter(p) * (frootn(p) / frootc(p)) - end if - - ! Matrix update for frootn to litter + end if if (use_matrixcn) then - if(frootn(p) > 0._r8)then + if(frootn(p) .gt. 0)then frootn_to_litter(p) = frootn(p) * matrix_update_phn(p,ifroot_to_iout_phn,frootn_to_litter(p) / frootn(p),dt,cnveg_nitrogenflux_inst,matrixcheck_ph,acc_ph) else - frootn_to_litter(p) = 0._r8 + frootn_to_litter(p) = 0 end if else ! NOTE: The non matrix version of this is in CNNStateUpdate1::NStateUpdate1 EBK (11/26/2019) @@ -3389,26 +3386,21 @@ subroutine CNOffsetLitterfall (num_soilp, filter_soilp, & if ( use_fun ) then if(frootn_to_litter(p)*dt.gt.frootn(p))then - - ! Send all frootn to litter if (.not. use_matrixcn) then frootn_to_litter(p) = frootn(p)/dt else - ! Matrix update for frootn to litter frootn_to_litter(p) = frootn(p) * matrix_update_phn(p,ifroot_to_iout_phn,1._r8/dt,dt,cnveg_nitrogenflux_inst,matrixcheck_ph,acc_ph) end if endif end if if (ivt(p) >= npcropmin) then - ! Matrix update for livestemn to litter + ! NOTE(slevis, 2014-12) results in -ve livestemn and -ve totpftn + !X! livestemn_to_litter(p) = livestemc_to_litter(p) / livewdcn(ivt(p)) + ! NOTE(slevis, 2014-12) Beth Drewniak suggested this instead + livestemn_to_litter(p) = livestemn(p) / dt * (1._r8 - biofuel_harvfrac(ivt(p))) if(use_matrixcn)then livestemn_to_litter(p) = livestemn(p) * matrix_update_phn(p,ilivestem_to_iout_phn, (1._r8- biofuel_harvfrac(ivt(p)))/dt, dt,cnveg_nitrogenflux_inst,matrixcheck_ph,acc_ph) - else - ! NOTE(slevis, 2014-12) results in -ve livestemn and -ve totpftn - !X! livestemn_to_litter(p) = livestemc_to_litter(p) / livewdcn(ivt(p)) - ! NOTE(slevis, 2014-12) Beth Drewniak suggested this instead - livestemn_to_litter(p) = livestemn(p) / dt * (1._r8 - biofuel_harvfrac(ivt(p))) end if end if @@ -3477,7 +3469,7 @@ subroutine CNBackgroundLitterfall (num_soilp, filter_soilp, & leafc_to_litter_fun => cnveg_carbonflux_inst%leafc_to_litter_fun_patch, & ! Output: [real(r8) (:) ] leaf C litterfall used by FUN (gC/m2/s) leafcn_offset => cnveg_state_inst%leafcn_offset_patch , & ! Output: [real(r8) (:) ] Leaf C:N used by FUN free_retransn_to_npool=> cnveg_nitrogenflux_inst%free_retransn_to_npool_patch , & ! Input: [real(r8) (:) ] free leaf N to retranslocated N pool (gN/m2/s) - paid_retransn_to_npool=> cnveg_nitrogenflux_inst%retransn_to_npool_patch , & ! Input: [real(r8) (:) ] free leaf N to retranslocated N pool (gN/m2/s) + paid_retransn_to_npool=> cnveg_nitrogenflux_inst%retransn_to_npool_patch , & ! Input: [real(r8) (:) ] free leaf N to retranslocated N pool (gN/m2/s) ileafst_to_ileafxf_phc => cnveg_carbonflux_inst%ileafst_to_ileafxf_ph , & ! Input: [integer (:)] Index of phenology related C transfer from leaf storage pool to leaf transfer pool ileafxf_to_ileaf_phc => cnveg_carbonflux_inst%ileafxf_to_ileaf_ph , & ! Input: [integer (:)] Index of phenology related C transfer from leaf transfer pool to leaf pool @@ -3526,36 +3518,35 @@ subroutine CNBackgroundLitterfall (num_soilp, filter_soilp, & ! only calculate these fluxes if the background litterfall rate is non-zero if (bglfr(p) > 0._r8) then - ! Matrix update for leafc and frootc to litter + ! units for bglfr are already 1/s + leafc_to_litter(p) = bglfr(p) * leafc(p) + frootc_to_litter(p) = bglfr(p) * frootc(p) if (use_matrixcn) then leafc_to_litter(p) = leafc(p) * matrix_update_phc(p,ileaf_to_iout_phc,bglfr(p),dt,cnveg_carbonflux_inst,matrixcheck_ph,acc_ph) frootc_to_litter(p) = frootc(p) * matrix_update_phc(p,ifroot_to_iout_phc,bglfr(p),dt,cnveg_carbonflux_inst,matrixcheck_ph,acc_ph) - else - ! units for bglfr are already 1/s - leafc_to_litter(p) = bglfr(p) * leafc(p) - frootc_to_litter(p) = bglfr(p) * frootc(p) end if if ( use_fun ) then - if(.not. use_matrixcn)then - leafc_to_litter_fun(p) = leafc_to_litter(p) - leafn_to_retransn(p) = paid_retransn_to_npool(p) + free_retransn_to_npool(p) - if (leafn(p).gt.0._r8) then - if (leafn(p)-leafn_to_retransn(p)*dt.gt.0._r8) then - leafcn_offset(p) = leafc(p)/(leafn(p)-leafn_to_retransn(p)*dt) - else - leafcn_offset(p) = leafc(p)/leafn(p) - end if + leafc_to_litter_fun(p) = leafc_to_litter(p) + leafn_to_retransn(p) = paid_retransn_to_npool(p) + free_retransn_to_npool(p) + if (leafn(p).gt.0._r8) then + if (leafn(p)-leafn_to_retransn(p)*dt.gt.0._r8) then + leafcn_offset(p) = leafc(p)/(leafn(p)-leafn_to_retransn(p)*dt) else - leafcn_offset(p) = leafcn(ivt(p)) + leafcn_offset(p) = leafc(p)/leafn(p) end if - leafn_to_litter(p) = leafc_to_litter(p)/leafcn_offset(p) - leafn_to_retransn(p) - leafn_to_litter(p) = max(leafn_to_litter(p),0._r8) - else ! Matrix update for leafn to litter and retrans + else + leafcn_offset(p) = leafcn(ivt(p)) + end if + leafn_to_litter(p) = leafc_to_litter(p)/leafcn_offset(p) - leafn_to_retransn(p) + leafn_to_litter(p) = max(leafn_to_litter(p),0._r8) + if(use_matrixcn)then if(leafn(p) .ne. 0._r8)then leafn_to_litter(p) = leafn(p) * matrix_update_phn(p,ileaf_to_iout_phn,leafn_to_litter(p) / leafn(p),dt,cnveg_nitrogenflux_inst,matrixcheck_ph,acc_ph) leafn_to_retransn(p) = leafn(p) * matrix_update_phn(p,ileaf_to_iretransn_phn,leafn_to_retransn(p) / leafn(p),dt,cnveg_nitrogenflux_inst,matrixcheck_ph,acc_ph) end if - end if ! .not. use_matrixcn + else + ! NOTE: The non matrix version of this is in CNNStateUpdate1::NStateUpdate1 EBK (11/26/2019) + end if !use_matrixcn denom = ( leafn_to_retransn(p) + leafn_to_litter(p) ) if ( denom /= 0.0_r8 ) then @@ -3568,45 +3559,46 @@ subroutine CNBackgroundLitterfall (num_soilp, filter_soilp, & else - if (CNratio_floating) then + if (CNratio_floating .eqv. .true.) then fr_leafn_to_litter = 0.5_r8 ! assuming 50% of nitrogen turnover goes to litter end if - ! Matrix update for leafn to litter and retrans + ! calculate the leaf N litterfall and retranslocation + leafn_to_litter(p) = leafc_to_litter(p) / lflitcn(ivt(p)) + leafn_to_retransn(p) = (leafc_to_litter(p) / leafcn(ivt(p))) - leafn_to_litter(p) + if (use_matrixcn) then - if(leafn(p) .ne. 0._r8)then + if(leafn(p) .ne. 0)then leafn_to_litter(p) = leafn(p) * matrix_update_phn(p,ileaf_to_iout_phn,leafn_to_litter(p) / leafn(p),dt,cnveg_nitrogenflux_inst,matrixcheck_ph,acc_ph) leafn_to_retransn(p) = leafn(p) * matrix_update_phn(p,ileaf_to_iretransn_phn,leafn_to_retransn(p) / leafn(p),dt,cnveg_nitrogenflux_inst,matrixcheck_ph,acc_ph) end if else ! NOTE: The non matrix version of this is in CNNStateUpdate1::NStateUpdate1 EBK (11/26/2019) - ! calculate the leaf N litterfall and retranslocation - leafn_to_litter(p) = leafc_to_litter(p) / lflitcn(ivt(p)) - leafn_to_retransn(p) = (leafc_to_litter(p) / leafcn(ivt(p))) - leafn_to_litter(p) end if !use_matrixcn end if ! calculate fine root N litterfall (no retranslocation of fine root N) frootn_to_litter(p) = frootc_to_litter(p) / frootcn(ivt(p)) - if (CNratio_floating) then - if (.not. use_matrixcn) then - if (leafc(p) == 0.0_r8) then - ntovr_leaf = 0.0_r8 - else - ntovr_leaf = leafc_to_litter(p) * (leafn(p) / leafc(p)) - end if + if (CNratio_floating .eqv. .true.) then + if (leafc(p) == 0.0_r8) then + ntovr_leaf = 0.0_r8 + else + ntovr_leaf = leafc_to_litter(p) * (leafn(p) / leafc(p)) + end if - leafn_to_litter(p) = fr_leafn_to_litter * ntovr_leaf - leafn_to_retransn(p) = ntovr_leaf - leafn_to_litter(p) - else ! Matrix update for leafn to litter and retrans - if(leafn(p) > 0._r8)then + leafn_to_litter(p) = fr_leafn_to_litter * ntovr_leaf + leafn_to_retransn(p) = ntovr_leaf - leafn_to_litter(p) + if (use_matrixcn) then + if(leafn(p) .gt. 0)then leafn_to_litter(p) = leafn(p) * matrix_update_phn(p,ileaf_to_iout_phn,leafn_to_litter(p) / leafn(p),dt,cnveg_nitrogenflux_inst,matrixcheck_ph,acc_ph) leafn_to_retransn(p) = leafn(p) * matrix_update_phn(p,ileaf_to_iretransn_phn,leafn_to_retransn(p) / leafn(p),dt,cnveg_nitrogenflux_inst,matrixcheck_ph,acc_ph) else - leafn_to_litter(p) = 0._r8 - leafn_to_retransn(p) = 0._r8 + leafn_to_litter(p) = 0 + leafn_to_retransn(p) = 0 end if - end if ! .not. use_matrixcn + else + ! NOTE: The non matrix version of this is in CNNStateUpdate1::NStateUpdate1 EBK (11/26/2019) + end if !use_matrixcn if (frootc(p) == 0.0_r8) then frootn_to_litter(p) = 0.0_r8 else @@ -3620,9 +3612,8 @@ subroutine CNBackgroundLitterfall (num_soilp, filter_soilp, & endif end if - ! Matrix update for frootn to litter if (use_matrixcn) then - if(frootn(p) /= 0._r8)then + if(frootn(p) .ne. 0)then frootn_to_litter(p) = frootn(p) * matrix_update_phn(p,ifroot_to_iout_phn,frootn_to_litter(p) / frootn(p),dt,cnveg_nitrogenflux_inst,matrixcheck_ph,acc_ph) end if else @@ -3682,7 +3673,7 @@ subroutine CNLivewoodTurnover (num_soilp, filter_soilp, & livestemn_to_retransn => cnveg_nitrogenflux_inst%livestemn_to_retransn_patch , & ! Output: [real(r8) (:) ] livecrootn_to_deadcrootn => cnveg_nitrogenflux_inst%livecrootn_to_deadcrootn_patch , & ! Output: [real(r8) (:) ] livecrootn_to_retransn => cnveg_nitrogenflux_inst%livecrootn_to_retransn_patch , & ! Output: [real(r8) (:) ] - free_retransn_to_npool => cnveg_nitrogenflux_inst%free_retransn_to_npool_patch , & ! Input: [real(r8) (:) ] free leaf N to retranslocated N pool (gN/m2/s) + free_retransn_to_npool => cnveg_nitrogenflux_inst%free_retransn_to_npool_patch , & ! Input: [real(r8) (:) ] free leaf N to retranslocated N pool (gN/m2/s) ileafst_to_ileafxf_phc => cnveg_carbonflux_inst%ileafst_to_ileafxf_ph , & ! Input: [integer (:)] Index of phenology related C transfer from leaf storage pool to leaf transfer pool ileafxf_to_ileaf_phc => cnveg_carbonflux_inst%ileafxf_to_ileaf_ph , & ! Input: [integer (:)] Index of phenology related C transfer from leaf transfer pool to leaf pool ifrootst_to_ifrootxf_phc => cnveg_carbonflux_inst%ifrootst_to_ifrootxf_ph , & ! Input: [integer (:)] Index of phenology related C transfer from fine root storage pool to fine root transfer pool @@ -3736,38 +3727,40 @@ subroutine CNLivewoodTurnover (num_soilp, filter_soilp, & ! live stem to dead stem turnover - ! Matrix update for livestemc to deadstem + ctovr = livestemc(p) * lwtop + ntovr = ctovr / livewdcn(ivt(p)) + livestemc_to_deadstemc(p) = ctovr + livestemn_to_deadstemn(p) = ctovr / deadwdcn(ivt(p)) if( use_matrixcn)then livestemc_to_deadstemc(p) = livestemc(p) * matrix_update_phc(p,ilivestem_to_ideadstem_phc,lwtop,dt,cnveg_carbonflux_inst,matrixcheck_ph,acc_ph) if (livestemn(p) .gt. 0.0_r8) then livestemn_to_deadstemn(p) = livestemn(p) * matrix_update_phn(p,ilivestem_to_ideadstem_phn,livestemn_to_deadstemn(p)/livestemn(p),dt,cnveg_nitrogenflux_inst,matrixcheck_ph,acc_ph) else - livestemn_to_deadstemn(p) = 0._r8 + livestemn_to_deadstemn(p) = 0 end if else ! NOTE: The non matrix version of this is in CNCStateUpdate1::CStateUpdate1 EBK (11/26/2019) ! and CNNStateUpdate1::NStateUpdate1 - ctovr = livestemc(p) * lwtop - ntovr = ctovr / livewdcn(ivt(p)) - livestemc_to_deadstemc(p) = ctovr - livestemn_to_deadstemn(p) = ctovr / deadwdcn(ivt(p)) end if - if (CNratio_floating) then + if (CNratio_floating .eqv. .true.) then if (livestemc(p) == 0.0_r8) then ntovr = 0.0_r8 livestemn_to_deadstemn(p) = 0.0_r8 - else + else ntovr = ctovr * (livestemn(p) / livestemc(p)) livestemn_to_deadstemn(p) = ctovr / deadwdcn(ivt(p)) - end if - if (use_matrixcn)then ! Matrix update for livestemn to deadstem + end if + + if (use_matrixcn)then if (livestemn(p) .gt. 0.0_r8) then livestemn_to_deadstemn(p) = livestemn(p) * matrix_update_phn(p,ilivestem_to_ideadstem_phn,& livestemn_to_deadstemn(p) / livestemn(p),dt,cnveg_nitrogenflux_inst,matrixcheck_ph,acc_ph) else livestemn_to_deadstemn(p) = 0 end if - end if ! use_matrixcn + else + ! NOTE: The non matrix version of this is in CNNStateUpdate1::NStateUpdate1 EBK (11/26/2019) + end if end if livestemn_to_retransn(p) = ntovr - livestemn_to_deadstemn(p) @@ -3777,19 +3770,17 @@ subroutine CNLivewoodTurnover (num_soilp, filter_soilp, & ctovr = livecrootc(p) * lwtop ntovr = ctovr / livewdcn(ivt(p)) - if(.not. use_matrixcn)then ! NOTE: The non matrix version of this is in CNCStateUpdate1::CStateUpdate1 EBK (11/26/2019) ! and CNNStateUpdate1::NStateUpdate1 livecrootc_to_deadcrootc(p) = ctovr livecrootn_to_deadcrootn(p) = ctovr / deadwdcn(ivt(p)) else - ! Matrix update for livecroot to deadcroot livecrootc_to_deadcrootc(p) = livecrootc(p) * matrix_update_phc(p,ilivecroot_to_ideadcroot_phc,lwtop,dt,cnveg_carbonflux_inst,matrixcheck_ph,acc_ph) livecrootn_to_deadcrootn(p) = livecrootn(p) * matrix_update_phn(p,ilivecroot_to_ideadcroot_phn,lwtop/deadwdcn(ivt(p)),dt,cnveg_nitrogenflux_inst,matrixcheck_ph,acc_ph) end if !use_matrixcn - if (CNratio_floating) then + if (CNratio_floating .eqv. .true.) then if (livecrootc(p) == 0.0_r8) then ntovr = 0.0_r8 livecrootn_to_deadcrootn(p) = 0.0_r8 @@ -3797,50 +3788,49 @@ subroutine CNLivewoodTurnover (num_soilp, filter_soilp, & ntovr = ctovr * (livecrootn(p) / livecrootc(p)) livecrootn_to_deadcrootn(p) = ctovr / deadwdcn(ivt(p)) end if - if (use_matrixcn)then ! Matrix update for livecroot to deadcroot + + if (use_matrixcn)then if (livecrootn(p) .ne.0.0_r8 )then livecrootn_to_deadcrootn(p) = matrix_update_phn(p,ilivecroot_to_ideadcroot_phn,& livecrootn_to_deadcrootn(p) / livecrootn(p),dt,cnveg_nitrogenflux_inst,matrixcheck_ph,acc_ph) * livecrootn(p) end if - end if ! use_matrixcn + else + ! NOTE: The non matrix version of this is in CNNStateUpdate1::NStateUpdate1 EBK (11/26/2019) + end if !use_matrixcn end if livecrootn_to_retransn(p) = ntovr - livecrootn_to_deadcrootn(p) - - ! Matrix update for livecrootn and livestemn to retrans as well as free retransn to npool with FUN - if(use_matrixcn)then - if(livecrootn(p) .gt. 0.0_r8) then - livecrootn_to_retransn(p) = matrix_update_phn(p,ilivecroot_to_iretransn_phn,& - livecrootn_to_retransn(p) / livecrootn(p),dt,cnveg_nitrogenflux_inst,matrixcheck_ph,acc_ph) * livecrootn(p) - else - livecrootn_to_retransn(p) = 0 - end if - if(livestemn(p) .gt. 0.0_r8) then - livestemn_to_retransn(p) = matrix_update_phn(p,ilivestem_to_iretransn_phn,& - livestemn_to_retransn(p) / livestemn(p),dt,cnveg_nitrogenflux_inst,matrixcheck_ph,acc_ph) * livestemn(p) - else - livestemn_to_retransn(p) = 0 - end if - ! WW change logic so livestem_retrans goes to npool (via - ! free_retrans flux) - ! this should likely be done more cleanly if it works, i.e. not - ! update fluxes w/ states - ! additional considerations for crop? - ! The non-matrix version of this is in NStateUpdate1 - if (use_fun) then - if (retransn(p) .gt. 0._r8) then - ! The acc matrix check MUST be turned on, or this will - ! fail with Nitrogen balance error EBK 03/11/2021 - free_retransn_to_npool(p) = free_retransn_to_npool(p) + retransn(p) * matrix_update_phn(p,iretransn_to_iout, & - (livestemn_to_retransn(p) + livecrootn_to_retransn(p)) / retransn(p),dt, & - cnveg_nitrogenflux_inst, matrixcheck_ph, acc=.true.) + if(use_matrixcn)then + if(livecrootn(p) .gt. 0.0_r8) then + livecrootn_to_retransn(p) = matrix_update_phn(p,ilivecroot_to_iretransn_phn,& + livecrootn_to_retransn(p) / livecrootn(p),dt,cnveg_nitrogenflux_inst,matrixcheck_ph,acc_ph) * livecrootn(p) else - free_retransn_to_npool(p) = 0._r8 + livecrootn_to_retransn(p) = 0 end if - end if - else - ! The non-matrix version of this is in NStateUpdate1 - end if !use_matrixcn + if(livestemn(p) .gt. 0.0_r8) then + livestemn_to_retransn(p) = matrix_update_phn(p,ilivestem_to_iretransn_phn,& + livestemn_to_retransn(p) / livestemn(p),dt,cnveg_nitrogenflux_inst,matrixcheck_ph,acc_ph) * livestemn(p) + else + livestemn_to_retransn(p) = 0 + end if + ! WW change logic so livestem_retrans goes to npool (via + ! free_retrans flux) + ! this should likely be done more cleanly if it works, i.e. not + ! update fluxes w/ states + ! additional considerations for crop? + ! The non-matrix version of this is in NStateUpdate1 + if (use_fun) then + if (retransn(p) .gt. 0._r8) then + ! The acc matrix check MUST be turned on, or this will + ! fail with Nitrogen balance error EBK 03/11/2021 + free_retransn_to_npool(p) = free_retransn_to_npool(p) + retransn(p) * matrix_update_phn(p,iretransn_to_iout, & + (livestemn_to_retransn(p) + livecrootn_to_retransn(p)) / retransn(p),dt, & + cnveg_nitrogenflux_inst, matrixcheck_ph, acc=.true.) + else + free_retransn_to_npool(p) = 0._r8 + end if + end if + end if !use_matrixcn end if diff --git a/src/soilbiogeochem/SoilBiogeochemNStateUpdate1Mod.F90 b/src/soilbiogeochem/SoilBiogeochemNStateUpdate1Mod.F90 index d7b3c01fc1..4f221c6910 100644 --- a/src/soilbiogeochem/SoilBiogeochemNStateUpdate1Mod.F90 +++ b/src/soilbiogeochem/SoilBiogeochemNStateUpdate1Mod.F90 @@ -9,11 +9,12 @@ module SoilBiogeochemNStateUpdate1Mod use clm_time_manager , only : get_step_size_real use clm_varpar , only : nlevdecomp, ndecomp_cascade_transitions use clm_varctl , only : iulog, use_nitrif_denitrif, use_crop + use SoilBiogeochemDecompCascadeConType , only : use_soil_matrixcn use clm_varcon , only : nitrif_n2o_loss_frac use SoilBiogeochemStateType , only : soilbiogeochem_state_type use SoilBiogeochemNitrogenStateType , only : soilbiogeochem_nitrogenstate_type use SoilBiogeochemNitrogenfluxType , only : soilbiogeochem_nitrogenflux_type - use SoilBiogeochemDecompCascadeConType , only : decomp_cascade_con, use_soil_matrixcn + use SoilBiogeochemDecompCascadeConType , only : decomp_cascade_con use CNSharedParamsMod , only : use_fun use ColumnType , only : col ! @@ -118,50 +119,47 @@ subroutine SoilBiogeochemNStateUpdate1(num_soilc, filter_soilc, & end if ! decomposition fluxes - if (.not. use_soil_matrixcn) then - do k = 1, ndecomp_cascade_transitions + if (.not. use_soil_matrixcn) then + do k = 1, ndecomp_cascade_transitions + do j = 1, nlevdecomp + ! column loop + do fc = 1,num_soilc + c = filter_soilc(fc) + + nf%decomp_npools_sourcesink_col(c,j,cascade_donor_pool(k)) = & + nf%decomp_npools_sourcesink_col(c,j,cascade_donor_pool(k)) - & + nf%decomp_cascade_ntransfer_vr_col(c,j,k) * dt + end do + end do + end do + + + do k = 1, ndecomp_cascade_transitions + if ( cascade_receiver_pool(k) /= 0 ) then ! skip terminal transitions do j = 1, nlevdecomp ! column loop do fc = 1,num_soilc c = filter_soilc(fc) + nf%decomp_npools_sourcesink_col(c,j,cascade_receiver_pool(k)) = & + nf%decomp_npools_sourcesink_col(c,j,cascade_receiver_pool(k)) + & + (nf%decomp_cascade_ntransfer_vr_col(c,j,k) + & + nf%decomp_cascade_sminn_flux_vr_col(c,j,k)) * dt + end do + end do + else ! terminal transitions + do j = 1, nlevdecomp + ! column loop + do fc = 1,num_soilc + c = filter_soilc(fc) nf%decomp_npools_sourcesink_col(c,j,cascade_donor_pool(k)) = & nf%decomp_npools_sourcesink_col(c,j,cascade_donor_pool(k)) - & - nf%decomp_cascade_ntransfer_vr_col(c,j,k) * dt + nf%decomp_cascade_sminn_flux_vr_col(c,j,k) * dt end do end do - end do - - - do k = 1, ndecomp_cascade_transitions - if ( cascade_receiver_pool(k) /= 0 ) then ! skip terminal transitions - do j = 1, nlevdecomp - ! column loop - do fc = 1,num_soilc - c = filter_soilc(fc) - - nf%decomp_npools_sourcesink_col(c,j,cascade_receiver_pool(k)) = & - nf%decomp_npools_sourcesink_col(c,j,cascade_receiver_pool(k)) + & - (nf%decomp_cascade_ntransfer_vr_col(c,j,k) + & - nf%decomp_cascade_sminn_flux_vr_col(c,j,k)) * dt - end do - end do - else ! terminal transitions - do j = 1, nlevdecomp - ! column loop - do fc = 1,num_soilc - c = filter_soilc(fc) - nf%decomp_npools_sourcesink_col(c,j,cascade_donor_pool(k)) = & - nf%decomp_npools_sourcesink_col(c,j,cascade_donor_pool(k)) - & - nf%decomp_cascade_sminn_flux_vr_col(c,j,k) * dt - end do - end do - end if - end do - else - ! Matrix solution equvalent to above is in CNSoilMatrixMod.F90? - ! TODO check on this - end if ! + end if + end do + end if ! if (.not. use_nitrif_denitrif) then From 42af57b7f6584610e5127874f55044fe16da2ccb Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Thu, 28 Dec 2023 13:18:15 -0700 Subject: [PATCH 0050/1248] Matrixcn updates pertaining to GULU (gross unrep. landuse chg) --- src/biogeochem/CNBalanceCheckMod.F90 | 1 - src/biogeochem/CNCStateUpdate2Mod.F90 | 132 ++++++++++------- src/biogeochem/CNNStateUpdate2Mod.F90 | 129 +++++++++------- src/biogeochem/dynGrossUnrepMod.F90 | 205 +++++++++++++++++++------- src/dyn_subgrid/dynHarvestMod.F90 | 19 +-- 5 files changed, 313 insertions(+), 173 deletions(-) diff --git a/src/biogeochem/CNBalanceCheckMod.F90 b/src/biogeochem/CNBalanceCheckMod.F90 index fbf30e9549..5b253fdd00 100644 --- a/src/biogeochem/CNBalanceCheckMod.F90 +++ b/src/biogeochem/CNBalanceCheckMod.F90 @@ -60,7 +60,6 @@ module CNBalanceCheckMod !----------------------------------------------------------------------- subroutine Init(this, bounds) - use CNSharedParamsMod, only : use_matrixcn class(cn_balance_type) :: this type(bounds_type) , intent(in) :: bounds diff --git a/src/biogeochem/CNCStateUpdate2Mod.F90 b/src/biogeochem/CNCStateUpdate2Mod.F90 index 76fcc340b6..2890c7d1fd 100644 --- a/src/biogeochem/CNCStateUpdate2Mod.F90 +++ b/src/biogeochem/CNCStateUpdate2Mod.F90 @@ -370,15 +370,27 @@ subroutine CStateUpdate2g(num_soilc, filter_soilc, num_soilp, filter_soilp, & do fc = 1,num_soilc c = filter_soilc(fc) - ! column gross unrepresented landcover change fluxes - do i = i_litr_min, i_litr_max - cs_soil%decomp_cpools_vr_col(c,j,i) = & - cs_soil%decomp_cpools_vr_col(c,j,i) + cf_veg%gru_c_to_litr_c_col(c,j,i) * dt - end do - cs_soil%decomp_cpools_vr_col(c,j,i_cwd) = & - cs_soil%decomp_cpools_vr_col(c,j,i_cwd) + cf_veg%gru_c_to_cwdc_col(c,j) * dt + if (.not. use_soil_matrixcn)then + ! column gross unrepresented landcover change fluxes + do i = i_litr_min, i_litr_max + cs_soil%decomp_cpools_vr_col(c,j,i) = & + cs_soil%decomp_cpools_vr_col(c,j,i) + cf_veg%gru_c_to_litr_c_col(c,j,i) * dt + end do + cs_soil%decomp_cpools_vr_col(c,j,i_cwd) = & + cs_soil%decomp_cpools_vr_col(c,j,i_cwd) + cf_veg%gru_c_to_cwdc_col(c,j) * dt - ! wood to product pools - states updated in CNProducts + ! wood to product pools - states updated in CNProducts + else + ! Match above for soil-matrix + do i = i_litr_min, i_litr_max + cf_soil%matrix_Cinput%V(c,j+(i-1)*nlevdecomp) = & + cf_soil%matrix_Cinput%V(c,j+(i-1)*nlevdecomp) + cf_veg%gru_c_to_litr_c_col(c,j,i) * dt + end do + ! Currently i_cwd .ne. i_litr_max + 1 if .not. fates and + ! i_cwd = 0 if fates, so not including in the i-loop + cf_soil%matrix_Cinput%V(c,j+(i_cwd-1)*nlevdecomp) = & + cf_soil%matrix_Cinput%V(c,j+(i_cwd-1)*nlevdecomp) + cf_veg%gru_c_to_cwdc_col(c,j) * dt + end if !soil_matrix end do end do @@ -387,58 +399,66 @@ subroutine CStateUpdate2g(num_soilc, filter_soilc, num_soilp, filter_soilp, & p = filter_soilp(fp) ! patch-level carbon fluxes from gross unrepresented landcover change mortality - ! displayed pools - cs_veg%leafc_patch(p) = cs_veg%leafc_patch(p) & - - cf_veg%gru_leafc_to_litter_patch(p) * dt - cs_veg%frootc_patch(p) = cs_veg%frootc_patch(p) & - - cf_veg%gru_frootc_to_litter_patch(p) * dt - cs_veg%livestemc_patch(p) = cs_veg%livestemc_patch(p) & - - cf_veg%gru_livestemc_to_atm_patch(p) * dt - cs_veg%deadstemc_patch(p) = cs_veg%deadstemc_patch(p) & - - cf_veg%gru_deadstemc_to_atm_patch(p) * dt - cs_veg%deadstemc_patch(p) = cs_veg%deadstemc_patch(p) & - - cf_veg%gru_wood_productc_gain_patch(p) * dt - cs_veg%livecrootc_patch(p) = cs_veg%livecrootc_patch(p) & - - cf_veg%gru_livecrootc_to_litter_patch(p) * dt - cs_veg%deadcrootc_patch(p) = cs_veg%deadcrootc_patch(p) & - - cf_veg%gru_deadcrootc_to_litter_patch(p) * dt + ! + ! State update without the matrix solution + ! + if(.not. use_matrixcn)then + ! displayed pools + cs_veg%leafc_patch(p) = cs_veg%leafc_patch(p) & + - cf_veg%gru_leafc_to_litter_patch(p) * dt + cs_veg%frootc_patch(p) = cs_veg%frootc_patch(p) & + - cf_veg%gru_frootc_to_litter_patch(p) * dt + cs_veg%livestemc_patch(p) = cs_veg%livestemc_patch(p) & + - cf_veg%gru_livestemc_to_atm_patch(p) * dt + cs_veg%deadstemc_patch(p) = cs_veg%deadstemc_patch(p) & + - cf_veg%gru_deadstemc_to_atm_patch(p) * dt + cs_veg%deadstemc_patch(p) = cs_veg%deadstemc_patch(p) & + - cf_veg%gru_wood_productc_gain_patch(p) * dt + cs_veg%livecrootc_patch(p) = cs_veg%livecrootc_patch(p) & + - cf_veg%gru_livecrootc_to_litter_patch(p) * dt + cs_veg%deadcrootc_patch(p) = cs_veg%deadcrootc_patch(p) & + - cf_veg%gru_deadcrootc_to_litter_patch(p) * dt - ! xsmrpool - cs_veg%xsmrpool_patch(p) = cs_veg%xsmrpool_patch(p) & - - cf_veg%gru_xsmrpool_to_atm_patch(p) * dt + ! xsmrpool + cs_veg%xsmrpool_patch(p) = cs_veg%xsmrpool_patch(p) & + - cf_veg%gru_xsmrpool_to_atm_patch(p) * dt - ! storage pools - cs_veg%leafc_storage_patch(p) = cs_veg%leafc_storage_patch(p) & - - cf_veg%gru_leafc_storage_to_atm_patch(p) * dt - cs_veg%frootc_storage_patch(p) = cs_veg%frootc_storage_patch(p) & - - cf_veg%gru_frootc_storage_to_atm_patch(p) * dt - cs_veg%livestemc_storage_patch(p) = cs_veg%livestemc_storage_patch(p) & - - cf_veg%gru_livestemc_storage_to_atm_patch(p) * dt - cs_veg%deadstemc_storage_patch(p) = cs_veg%deadstemc_storage_patch(p) & - - cf_veg%gru_deadstemc_storage_to_atm_patch(p) * dt - cs_veg%livecrootc_storage_patch(p) = cs_veg%livecrootc_storage_patch(p) & - - cf_veg%gru_livecrootc_storage_to_atm_patch(p) * dt - cs_veg%deadcrootc_storage_patch(p) = cs_veg%deadcrootc_storage_patch(p) & - - cf_veg%gru_deadcrootc_storage_to_atm_patch(p) * dt - cs_veg%gresp_storage_patch(p) = cs_veg%gresp_storage_patch(p) & - - cf_veg%gru_gresp_storage_to_atm_patch(p) * dt + ! storage pools + cs_veg%leafc_storage_patch(p) = cs_veg%leafc_storage_patch(p) & + - cf_veg%gru_leafc_storage_to_atm_patch(p) * dt + cs_veg%frootc_storage_patch(p) = cs_veg%frootc_storage_patch(p) & + - cf_veg%gru_frootc_storage_to_atm_patch(p) * dt + cs_veg%livestemc_storage_patch(p) = cs_veg%livestemc_storage_patch(p) & + - cf_veg%gru_livestemc_storage_to_atm_patch(p) * dt + cs_veg%deadstemc_storage_patch(p) = cs_veg%deadstemc_storage_patch(p) & + - cf_veg%gru_deadstemc_storage_to_atm_patch(p) * dt + cs_veg%livecrootc_storage_patch(p) = cs_veg%livecrootc_storage_patch(p) & + - cf_veg%gru_livecrootc_storage_to_atm_patch(p) * dt + cs_veg%deadcrootc_storage_patch(p) = cs_veg%deadcrootc_storage_patch(p) & + - cf_veg%gru_deadcrootc_storage_to_atm_patch(p) * dt + cs_veg%gresp_storage_patch(p) = cs_veg%gresp_storage_patch(p) & + - cf_veg%gru_gresp_storage_to_atm_patch(p) * dt - ! transfer pools - cs_veg%leafc_xfer_patch(p) = cs_veg%leafc_xfer_patch(p) & - - cf_veg%gru_leafc_xfer_to_atm_patch(p) * dt - cs_veg%frootc_xfer_patch(p) = cs_veg%frootc_xfer_patch(p) & - - cf_veg%gru_frootc_xfer_to_atm_patch(p) * dt - cs_veg%livestemc_xfer_patch(p) = cs_veg%livestemc_xfer_patch(p) & - - cf_veg%gru_livestemc_xfer_to_atm_patch(p) * dt - cs_veg%deadstemc_xfer_patch(p) = cs_veg%deadstemc_xfer_patch(p) & - - cf_veg%gru_deadstemc_xfer_to_atm_patch(p) * dt - cs_veg%livecrootc_xfer_patch(p) = cs_veg%livecrootc_xfer_patch(p) & - - cf_veg%gru_livecrootc_xfer_to_atm_patch(p) * dt - cs_veg%deadcrootc_xfer_patch(p) = cs_veg%deadcrootc_xfer_patch(p) & - - cf_veg%gru_deadcrootc_xfer_to_atm_patch(p) * dt - cs_veg%gresp_xfer_patch(p) = cs_veg%gresp_xfer_patch(p) & - - cf_veg%gru_gresp_xfer_to_atm_patch(p) * dt + ! transfer pools + cs_veg%leafc_xfer_patch(p) = cs_veg%leafc_xfer_patch(p) & + - cf_veg%gru_leafc_xfer_to_atm_patch(p) * dt + cs_veg%frootc_xfer_patch(p) = cs_veg%frootc_xfer_patch(p) & + - cf_veg%gru_frootc_xfer_to_atm_patch(p) * dt + cs_veg%livestemc_xfer_patch(p) = cs_veg%livestemc_xfer_patch(p) & + - cf_veg%gru_livestemc_xfer_to_atm_patch(p) * dt + cs_veg%deadstemc_xfer_patch(p) = cs_veg%deadstemc_xfer_patch(p) & + - cf_veg%gru_deadstemc_xfer_to_atm_patch(p) * dt + cs_veg%livecrootc_xfer_patch(p) = cs_veg%livecrootc_xfer_patch(p) & + - cf_veg%gru_livecrootc_xfer_to_atm_patch(p) * dt + cs_veg%deadcrootc_xfer_patch(p) = cs_veg%deadcrootc_xfer_patch(p) & + - cf_veg%gru_deadcrootc_xfer_to_atm_patch(p) * dt + cs_veg%gresp_xfer_patch(p) = cs_veg%gresp_xfer_patch(p) & + - cf_veg%gru_gresp_xfer_to_atm_patch(p) * dt + else + ! NB (slevis) The matrix equivalent of the above is in + ! dynGrossUnrepMod::CNGrossUnrep* + end if end do ! end of patch loop end associate diff --git a/src/biogeochem/CNNStateUpdate2Mod.F90 b/src/biogeochem/CNNStateUpdate2Mod.F90 index 2702b80de5..2dbba68b82 100644 --- a/src/biogeochem/CNNStateUpdate2Mod.F90 +++ b/src/biogeochem/CNNStateUpdate2Mod.F90 @@ -358,14 +358,29 @@ subroutine NStateUpdate2g(num_soilc, filter_soilc, num_soilp, filter_soilp, & do j = 1,nlevdecomp do fc = 1,num_soilc c = filter_soilc(fc) - do i = i_litr_min, i_litr_max - ns_soil%decomp_npools_vr_col(c,j,i) = & - ns_soil%decomp_npools_vr_col(c,j,i) + nf_veg%gru_n_to_litr_n_col(c,j,i) * dt - end do - ! Currently i_cwd .ne. i_litr_max + 1 if .not. fates and - ! i_cwd = 0 if fates, so not including in the i-loop - ns_soil%decomp_npools_vr_col(c,j,i_cwd) = & - ns_soil%decomp_npools_vr_col(c,j,i_cwd) + nf_veg%gru_n_to_cwdn_col(c,j) * dt + ! + ! State update without the matrix solution + ! + if (.not. use_soil_matrixcn)then + do i = i_litr_min, i_litr_max + ns_soil%decomp_npools_vr_col(c,j,i) = & + ns_soil%decomp_npools_vr_col(c,j,i) + nf_veg%gru_n_to_litr_n_col(c,j,i) * dt + end do + ! Currently i_cwd .ne. i_litr_max + 1 if .not. fates and + ! i_cwd = 0 if fates, so not including in the i-loop + ns_soil%decomp_npools_vr_col(c,j,i_cwd) = & + ns_soil%decomp_npools_vr_col(c,j,i_cwd) + nf_veg%gru_n_to_cwdn_col(c,j) * dt + else + ! Do above for the matrix solution + do i = i_litr_min, i_litr_max + nf_soil%matrix_Ninput%V(c,j+(i-1)*nlevdecomp) = & + nf_soil%matrix_Ninput%V(c,j+(i-1)*nlevdecomp) + nf_veg%gru_n_to_litr_n_col(c,j,i) * dt + end do + ! Currently i_cwd .ne. i_litr_max + 1 if .not. fates and + ! i_cwd = 0 if fates, so not including in the i-loop + nf_soil%matrix_Ninput%V(c,j+(i_cwd-1)*nlevdecomp) = & + nf_soil%matrix_Ninput%V(c,j+(i_cwd-1)*nlevdecomp) + nf_veg%gru_n_to_cwdn_col(c,j) * dt + end if !not use_soil_matrixcn end do end do @@ -374,51 +389,59 @@ subroutine NStateUpdate2g(num_soilc, filter_soilc, num_soilp, filter_soilp, & do fp = 1,num_soilp p = filter_soilp(fp) - ! displayed pools - ns_veg%leafn_patch(p) = ns_veg%leafn_patch(p) & - - nf_veg%gru_leafn_to_litter_patch(p) * dt - ns_veg%frootn_patch(p) = ns_veg%frootn_patch(p) & - - nf_veg%gru_frootn_to_litter_patch(p) * dt - ns_veg%livestemn_patch(p) = ns_veg%livestemn_patch(p) & - - nf_veg%gru_livestemn_to_atm_patch(p) * dt - ns_veg%deadstemn_patch(p) = ns_veg%deadstemn_patch(p) & - - nf_veg%gru_deadstemn_to_atm_patch(p) * dt - ns_veg%deadstemn_patch(p) = ns_veg%deadstemn_patch(p) & - - nf_veg%gru_wood_productn_gain_patch(p) * dt - ns_veg%livecrootn_patch(p) = ns_veg%livecrootn_patch(p) & - - nf_veg%gru_livecrootn_to_litter_patch(p) * dt - ns_veg%deadcrootn_patch(p) = ns_veg%deadcrootn_patch(p) & - - nf_veg%gru_deadcrootn_to_litter_patch(p) * dt - ns_veg%retransn_patch(p) = ns_veg%retransn_patch(p) & - - nf_veg%gru_retransn_to_litter_patch(p) * dt - - ! storage pools - ns_veg%leafn_storage_patch(p) = ns_veg%leafn_storage_patch(p) & - - nf_veg%gru_leafn_storage_to_atm_patch(p) * dt - ns_veg%frootn_storage_patch(p) = ns_veg%frootn_storage_patch(p) & - - nf_veg%gru_frootn_storage_to_atm_patch(p) * dt - ns_veg%livestemn_storage_patch(p) = ns_veg%livestemn_storage_patch(p) & - - nf_veg%gru_livestemn_storage_to_atm_patch(p) * dt - ns_veg%deadstemn_storage_patch(p) = ns_veg%deadstemn_storage_patch(p) & - - nf_veg%gru_deadstemn_storage_to_atm_patch(p) * dt - ns_veg%livecrootn_storage_patch(p) = ns_veg%livecrootn_storage_patch(p) & - - nf_veg%gru_livecrootn_storage_to_atm_patch(p) * dt - ns_veg%deadcrootn_storage_patch(p) = ns_veg%deadcrootn_storage_patch(p) & - - nf_veg%gru_deadcrootn_storage_to_atm_patch(p) * dt - - ! transfer pools - ns_veg%leafn_xfer_patch(p) = ns_veg%leafn_xfer_patch(p) & - - nf_veg%gru_leafn_xfer_to_atm_patch(p) *dt - ns_veg%frootn_xfer_patch(p) = ns_veg%frootn_xfer_patch(p) & - - nf_veg%gru_frootn_xfer_to_atm_patch(p) *dt - ns_veg%livestemn_xfer_patch(p) = ns_veg%livestemn_xfer_patch(p) & - - nf_veg%gru_livestemn_xfer_to_atm_patch(p) *dt - ns_veg%deadstemn_xfer_patch(p) = ns_veg%deadstemn_xfer_patch(p) & - - nf_veg%gru_deadstemn_xfer_to_atm_patch(p) *dt - ns_veg%livecrootn_xfer_patch(p) = ns_veg%livecrootn_xfer_patch(p) & - - nf_veg%gru_livecrootn_xfer_to_atm_patch(p) *dt - ns_veg%deadcrootn_xfer_patch(p) = ns_veg%deadcrootn_xfer_patch(p) & - - nf_veg%gru_deadcrootn_xfer_to_atm_patch(p) *dt + ! + ! State update without the matrix solution + ! + if(.not. use_matrixcn)then + ! displayed pools + ns_veg%leafn_patch(p) = ns_veg%leafn_patch(p) & + - nf_veg%gru_leafn_to_litter_patch(p) * dt + ns_veg%frootn_patch(p) = ns_veg%frootn_patch(p) & + - nf_veg%gru_frootn_to_litter_patch(p) * dt + ns_veg%livestemn_patch(p) = ns_veg%livestemn_patch(p) & + - nf_veg%gru_livestemn_to_atm_patch(p) * dt + ns_veg%deadstemn_patch(p) = ns_veg%deadstemn_patch(p) & + - nf_veg%gru_deadstemn_to_atm_patch(p) * dt + ns_veg%deadstemn_patch(p) = ns_veg%deadstemn_patch(p) & + - nf_veg%gru_wood_productn_gain_patch(p) * dt + ns_veg%livecrootn_patch(p) = ns_veg%livecrootn_patch(p) & + - nf_veg%gru_livecrootn_to_litter_patch(p) * dt + ns_veg%deadcrootn_patch(p) = ns_veg%deadcrootn_patch(p) & + - nf_veg%gru_deadcrootn_to_litter_patch(p) * dt + ns_veg%retransn_patch(p) = ns_veg%retransn_patch(p) & + - nf_veg%gru_retransn_to_litter_patch(p) * dt + + ! storage pools + ns_veg%leafn_storage_patch(p) = ns_veg%leafn_storage_patch(p) & + - nf_veg%gru_leafn_storage_to_atm_patch(p) * dt + ns_veg%frootn_storage_patch(p) = ns_veg%frootn_storage_patch(p) & + - nf_veg%gru_frootn_storage_to_atm_patch(p) * dt + ns_veg%livestemn_storage_patch(p) = ns_veg%livestemn_storage_patch(p) & + - nf_veg%gru_livestemn_storage_to_atm_patch(p) * dt + ns_veg%deadstemn_storage_patch(p) = ns_veg%deadstemn_storage_patch(p) & + - nf_veg%gru_deadstemn_storage_to_atm_patch(p) * dt + ns_veg%livecrootn_storage_patch(p) = ns_veg%livecrootn_storage_patch(p) & + - nf_veg%gru_livecrootn_storage_to_atm_patch(p) * dt + ns_veg%deadcrootn_storage_patch(p) = ns_veg%deadcrootn_storage_patch(p) & + - nf_veg%gru_deadcrootn_storage_to_atm_patch(p) * dt + + ! transfer pools + ns_veg%leafn_xfer_patch(p) = ns_veg%leafn_xfer_patch(p) & + - nf_veg%gru_leafn_xfer_to_atm_patch(p) *dt + ns_veg%frootn_xfer_patch(p) = ns_veg%frootn_xfer_patch(p) & + - nf_veg%gru_frootn_xfer_to_atm_patch(p) *dt + ns_veg%livestemn_xfer_patch(p) = ns_veg%livestemn_xfer_patch(p) & + - nf_veg%gru_livestemn_xfer_to_atm_patch(p) *dt + ns_veg%deadstemn_xfer_patch(p) = ns_veg%deadstemn_xfer_patch(p) & + - nf_veg%gru_deadstemn_xfer_to_atm_patch(p) *dt + ns_veg%livecrootn_xfer_patch(p) = ns_veg%livecrootn_xfer_patch(p) & + - nf_veg%gru_livecrootn_xfer_to_atm_patch(p) *dt + ns_veg%deadcrootn_xfer_patch(p) = ns_veg%deadcrootn_xfer_patch(p) & + - nf_veg%gru_deadcrootn_xfer_to_atm_patch(p) *dt + else + ! NB (slevis) The equivalent changes for matrix code are in + ! dynGrossUnrepMod::CNGrossUnrep* + end if !not use_matrixcn end do diff --git a/src/biogeochem/dynGrossUnrepMod.F90 b/src/biogeochem/dynGrossUnrepMod.F90 index bc49e72f4c..b354744b61 100644 --- a/src/biogeochem/dynGrossUnrepMod.F90 +++ b/src/biogeochem/dynGrossUnrepMod.F90 @@ -24,6 +24,7 @@ module dynGrossUnrepMod use clm_varpar , only : natpft_size, i_litr_min, i_litr_max, i_met_lit use ColumnType , only : col use PatchType , only : patch + use CNSharedParamsMod , only : use_matrixcn ! ! !PUBLIC MEMBER FUNCTIONS: implicit none @@ -296,61 +297,157 @@ subroutine CNGrossUnrep (num_soilc, filter_soilc, num_soilp, filter_soilp, & m = 0._r8 end if - ! patch-level gross unrepresented landcover change carbon fluxes - ! displayed pools - gru_leafc_to_litter(p) = leafc(p) * m - gru_frootc_to_litter(p) = frootc(p) * m - gru_livestemc_to_atm(p) = livestemc(p) * m - gru_deadstemc_to_atm(p) = deadstemc(p) * m * convfrac(ivt(p)) - gru_wood_productc_gain(p) = deadstemc(p) * m * (1._r8 - convfrac(ivt(p))) - gru_livecrootc_to_litter(p) = livecrootc(p) * m - gru_deadcrootc_to_litter(p) = deadcrootc(p) * m - gru_xsmrpool_to_atm(p) = xsmrpool(p) * m - - ! storage pools - gru_leafc_storage_to_atm(p) = leafc_storage(p) * m - gru_frootc_storage_to_atm(p) = frootc_storage(p) * m - gru_livestemc_storage_to_atm(p) = livestemc_storage(p) * m - gru_deadstemc_storage_to_atm(p) = deadstemc_storage(p) * m - gru_livecrootc_storage_to_atm(p) = livecrootc_storage(p) * m - gru_deadcrootc_storage_to_atm(p) = deadcrootc_storage(p) * m - gru_gresp_storage_to_atm(p) = gresp_storage(p) * m - - ! transfer pools - gru_leafc_xfer_to_atm(p) = leafc_xfer(p) * m - gru_frootc_xfer_to_atm(p) = frootc_xfer(p) * m - gru_livestemc_xfer_to_atm(p) = livestemc_xfer(p) * m - gru_deadstemc_xfer_to_atm(p) = deadstemc_xfer(p) * m - gru_livecrootc_xfer_to_atm(p) = livecrootc_xfer(p) * m - gru_deadcrootc_xfer_to_atm(p) = deadcrootc_xfer(p) * m - gru_gresp_xfer_to_atm(p) = gresp_xfer(p) * m + if(.not. use_matrixcn)then + ! patch-level gross unrepresented landcover change carbon fluxes + ! displayed pools + gru_leafc_to_litter(p) = leafc(p) * m + gru_frootc_to_litter(p) = frootc(p) * m + gru_livestemc_to_atm(p) = livestemc(p) * m + gru_deadstemc_to_atm(p) = deadstemc(p) * m * convfrac(ivt(p)) + gru_wood_productc_gain(p) = deadstemc(p) * m * (1._r8 - convfrac(ivt(p))) + gru_livecrootc_to_litter(p) = livecrootc(p) * m + gru_deadcrootc_to_litter(p) = deadcrootc(p) * m + gru_xsmrpool_to_atm(p) = xsmrpool(p) * m + + ! storage pools + gru_leafc_storage_to_atm(p) = leafc_storage(p) * m + gru_frootc_storage_to_atm(p) = frootc_storage(p) * m + gru_livestemc_storage_to_atm(p) = livestemc_storage(p) * m + gru_deadstemc_storage_to_atm(p) = deadstemc_storage(p) * m + gru_livecrootc_storage_to_atm(p) = livecrootc_storage(p) * m + gru_deadcrootc_storage_to_atm(p) = deadcrootc_storage(p) * m + gru_gresp_storage_to_atm(p) = gresp_storage(p) * m + + ! transfer pools + gru_leafc_xfer_to_atm(p) = leafc_xfer(p) * m + gru_frootc_xfer_to_atm(p) = frootc_xfer(p) * m + gru_livestemc_xfer_to_atm(p) = livestemc_xfer(p) * m + gru_deadstemc_xfer_to_atm(p) = deadstemc_xfer(p) * m + gru_livecrootc_xfer_to_atm(p) = livecrootc_xfer(p) * m + gru_deadcrootc_xfer_to_atm(p) = deadcrootc_xfer(p) * m + gru_gresp_xfer_to_atm(p) = gresp_xfer(p) * m - ! patch-level gross unrepresented landcover change mortality nitrogen fluxes - ! displayed pools - gru_leafn_to_litter(p) = leafn(p) * m - gru_frootn_to_litter(p) = frootn(p) * m - gru_livestemn_to_atm(p) = livestemn(p) * m - gru_deadstemn_to_atm(p) = deadstemn(p) * m * convfrac(ivt(p)) - gru_wood_productn_gain(p) = deadstemn(p) * m * (1._r8 - convfrac(ivt(p))) - gru_livecrootn_to_litter(p) = livecrootn(p) * m - gru_deadcrootn_to_litter(p) = deadcrootn(p) * m - gru_retransn_to_litter(p) = retransn(p) * m - - ! storage pools - gru_leafn_storage_to_atm(p) = leafn_storage(p) * m - gru_frootn_storage_to_atm(p) = frootn_storage(p) * m - gru_livestemn_storage_to_atm(p) = livestemn_storage(p) * m - gru_deadstemn_storage_to_atm(p) = deadstemn_storage(p) * m - gru_livecrootn_storage_to_atm(p) = livecrootn_storage(p) * m - gru_deadcrootn_storage_to_atm(p) = deadcrootn_storage(p) * m - - ! transfer pools - gru_leafn_xfer_to_atm(p) = leafn_xfer(p) * m - gru_frootn_xfer_to_atm(p) = frootn_xfer(p) * m - gru_livestemn_xfer_to_atm(p) = livestemn_xfer(p) * m - gru_deadstemn_xfer_to_atm(p) = deadstemn_xfer(p) * m - gru_livecrootn_xfer_to_atm(p) = livecrootn_xfer(p) * m - gru_deadcrootn_xfer_to_atm(p) = deadcrootn_xfer(p) * m + ! patch-level gross unrepresented landcover change mortality nitrogen fluxes + ! displayed pools + gru_leafn_to_litter(p) = leafn(p) * m + gru_frootn_to_litter(p) = frootn(p) * m + gru_livestemn_to_atm(p) = livestemn(p) * m + gru_deadstemn_to_atm(p) = deadstemn(p) * m * convfrac(ivt(p)) + gru_wood_productn_gain(p) = deadstemn(p) * m * (1._r8 - convfrac(ivt(p))) + gru_livecrootn_to_litter(p) = livecrootn(p) * m + gru_deadcrootn_to_litter(p) = deadcrootn(p) * m + gru_retransn_to_litter(p) = retransn(p) * m + + ! storage pools + gru_leafn_storage_to_atm(p) = leafn_storage(p) * m + gru_frootn_storage_to_atm(p) = frootn_storage(p) * m + gru_livestemn_storage_to_atm(p) = livestemn_storage(p) * m + gru_deadstemn_storage_to_atm(p) = deadstemn_storage(p) * m + gru_livecrootn_storage_to_atm(p) = livecrootn_storage(p) * m + gru_deadcrootn_storage_to_atm(p) = deadcrootn_storage(p) * m + + ! transfer pools + gru_leafn_xfer_to_atm(p) = leafn_xfer(p) * m + gru_frootn_xfer_to_atm(p) = frootn_xfer(p) * m + gru_livestemn_xfer_to_atm(p) = livestemn_xfer(p) * m + gru_deadstemn_xfer_to_atm(p) = deadstemn_xfer(p) * m + gru_livecrootn_xfer_to_atm(p) = livecrootn_xfer(p) * m + gru_deadcrootn_xfer_to_atm(p) = deadcrootn_xfer(p) * m + else ! matrixcn solution + ! patch-level gross unrepresented landcover change carbon fluxes + ! displayed pools + gru_leafc_to_litter(p) = matrix_update_gmc(p,ileaf_to_iout_gmc,m,dtime,cnveg_carbonflux_inst,.True.,.True.) * & + leafc(p) + gru_frootc_to_litter(p) = matrix_update_gmc(p,ifroot_to_iout_gmc,m,dtime,cnveg_carbonflux_inst,.True.,.True.) * & + frootc(p) + gru_livestemc_to_atm(p) = matrix_update_gmc(p,ilivestem_to_iout_gmc,m,dtime,cnveg_carbonflux_inst,.True.,.True.) * & + livestemc(p) + gru_deadstemc_to_atm(p) = matrix_update_gmc(p,ideadstem_to_iout_gmc,m * convfrac(ivt(p)),dtime,cnveg_carbonflux_inst,.True.,.True.) * & + deadstemc(p) + gru_wood_productc_gain(p) = matrix_update_gmc(p,ideadstem_to_iout_gmc,m * (1._r8 - convfrac(ivt(p))),dtime,cnveg_carbonflux_inst,.True.,.True.) * & + deadstemc(p) + gru_livecrootc_to_litter(p) = matrix_update_gmc(p,ilivecroot_to_iout_gmc,m,dtime,cnveg_carbonflux_inst,.True.,.True.) * & + livecrootc(p) + gru_deadcrootc_to_litter(p) = matrix_update_gmc(p,ideadcroot_to_iout_gmc,m,dtime,cnveg_carbonflux_inst,.True.,.True.) * & + deadcrootc(p) + gru_xsmrpool_to_atm(p) = xsmrpool(p) * m + + ! storage pools + gru_leafc_storage_to_atm(p) = matrix_update_gmc(p,ileafst_to_iout_gmc,m,dtime,cnveg_carbonflux_inst,.True.,.True.) * & + leafc_storage(p) + gru_frootc_storage_to_atm(p) = matrix_update_gmc(p,ifrootst_to_iout_gmc,m,dtime,cnveg_carbonflux_inst,.True.,.True.) * & + frootc_storage(p) + gru_livestemc_storage_to_atm(p) = matrix_update_gmc(p,ilivestemst_to_iout_gmc,m,dtime,cnveg_carbonflux_inst,.True.,.True.) * & + livestemc_storage(p) + gru_deadstemc_storage_to_atm(p) = matrix_update_gmc(p,ideadstemst_to_iout_gmc,m,dtime,cnveg_carbonflux_inst,.True.,.True.) * & + deadstemc_storage(p) + gru_livecrootc_storage_to_atm(p) = matrix_update_gmc(p,ilivecrootst_to_iout_gmc,m,dtime,cnveg_carbonflux_inst,.True.,.True.) * & + livecrootc_storage(p) + gru_deadcrootc_storage_to_atm(p) = matrix_update_gmc(p,ideadcrootst_to_iout_gmc,m,dtime,cnveg_carbonflux_inst,.True.,.True.) * & + deadcrootc_storage(p) + gru_gresp_storage_to_atm(p) = gresp_storage(p) * m + + ! transfer pools + gru_leafc_xfer_to_atm(p) = matrix_update_gmc(p,ileafxf_to_iout_gmc,m,dtime,cnveg_carbonflux_inst,.True.,.True.) * & + leafc_xfer(p) + gru_frootc_xfer_to_atm(p) = matrix_update_gmc(p,ifrootxf_to_iout_gmc,m,dtime,cnveg_carbonflux_inst,.True.,.True.) * & + frootc_xfer(p) + gru_livestemc_xfer_to_atm(p) = matrix_update_gmc(p,ilivestemxf_to_iout_gmc,m,dtime,cnveg_carbonflux_inst,.True.,.True.) * & + livestemc_xfer(p) + gru_deadstemc_xfer_to_atm(p) = matrix_update_gmc(p,ideadstemxf_to_iout_gmc,m,dtime,cnveg_carbonflux_inst,.True.,.True.) * & + deadstemc_xfer(p) + gru_livecrootc_xfer_to_atm(p) = matrix_update_gmc(p,ilivecrootxf_to_iout_gmc,m,dtime,cnveg_carbonflux_inst,.True.,.True.) * & + livecrootc_xfer(p) + gru_deadcrootc_xfer_to_atm(p) = matrix_update_gmc(p,ideadcrootxf_to_iout_gmc,m,dtime,cnveg_carbonflux_inst,.True.,.True.) * & + deadcrootc_xfer(p) + gru_gresp_xfer_to_atm(p) = gresp_xfer(p) * m + + ! patch-level gross unrepresented landcover change mortality nitrogen fluxes + ! displayed pools + gru_leafn_to_litter(p) = matrix_update_gmn(p,ileaf_to_iout_gmn,m,dtime,cnveg_nitrogenflux_inst,.True.,.True.) * & + leafn(p) + gru_frootn_to_litter(p) = matrix_update_gmn(p,ifroot_to_iout_gmn,m,dtime,cnveg_nitrogenflux_inst,.True.,.True.) * & + frootn(p) + gru_livestemn_to_atm(p) = matrix_update_gmn(p,ilivestem_to_iout_gmn,m,dtime,cnveg_nitrogenflux_inst,.True.,.True.) * & + livestemn(p) + gru_deadstemn_to_atm(p) = matrix_update_gmn(p,ideadstem_to_iout_gmn,m * convfrac(ivt(p)),dtime,cnveg_nitrogenflux_inst,.True.,.True.) * & + deadstemn(p) + gru_wood_productn_gain(p) = matrix_update_gmn(p,ideadstem_to_iout_gmn,m * (1._r8 - convfrac(ivt(p))),dtime,cnveg_nitrogenflux_inst,.True.,.True.) * & + deadstemn(p) + gru_livecrootn_to_litter(p) = matrix_update_gmn(p,ilivecroot_to_iout_gmn,m,dtime,cnveg_nitrogenflux_inst,.True.,.True.) * & + livecrootn(p) + gru_deadcrootn_to_litter(p) = matrix_update_gmn(p,ideadcroot_to_iout_gmn,m,dtime,cnveg_nitrogenflux_inst,.True.,.True.) * & + deadcrootn(p) + gru_retransn_to_litter(p) = matrix_update_gmn(p,iretransn_to_iout_gmn,m,dtime,cnveg_nitrogenflux_inst,.True.,.True.) * & + retransn(p) + + ! storage pools + gru_leafn_storage_to_atm(p) = matrix_update_gmn(p,ileafst_to_iout_gmn,m,dtime,cnveg_nitrogenflux_inst,.True.,.True.) * & + leafn_storage(p) + gru_frootn_storage_to_atm(p) = matrix_update_gmn(p,ifrootst_to_iout_gmn,m,dtime,cnveg_nitrogenflux_inst,.True.,.True.) * & + frootn_storage(p) + gru_livestemn_storage_to_atm(p) = matrix_update_gmn(p,ilivestemst_to_iout_gmn,m,dtime,cnveg_nitrogenflux_inst,.True.,.True.) * & + livestemn_storage(p) + gru_deadstemn_storage_to_atm(p) = matrix_update_gmn(p,ideadstemst_to_iout_gmn,m,dtime,cnveg_nitrogenflux_inst,.True.,.True.) * & + deadstemn_storage(p) + gru_livecrootn_storage_to_atm(p) = matrix_update_gmn(p,ilivecrootst_to_iout_gmn,m,dtime,cnveg_nitrogenflux_inst,.True.,.True.)* & + livecrootn_storage(p) + gru_deadcrootn_storage_to_atm(p) = matrix_update_gmn(p,ideadcrootst_to_iout_gmn,m,dtime,cnveg_nitrogenflux_inst,.True.,.True.)* & + deadcrootn_storage(p) + ! transfer pools + gru_leafn_xfer_to_atm(p) = matrix_update_gmn(p,ileafxf_to_iout_gmn,m,dtime,cnveg_nitrogenflux_inst,.True.,.True.) * & + leafn_xfer(p) + gru_frootn_xfer_to_atm(p) = matrix_update_gmn(p,ifrootxf_to_iout_gmn,m,dtime,cnveg_nitrogenflux_inst,.True.,.True.) * & + frootn_xfer(p) + gru_livestemn_xfer_to_atm(p) = matrix_update_gmn(p,ilivestemxf_to_iout_gmn,m,dtime,cnveg_nitrogenflux_inst,.True.,.True.) * & + livestemn_xfer(p) + gru_deadstemn_xfer_to_atm(p) = matrix_update_gmn(p,ideadstemxf_to_iout_gmn,m,dtime,cnveg_nitrogenflux_inst,.True.,.True.) * & + deadstemn_xfer(p) + gru_livecrootn_xfer_to_atm(p) = matrix_update_gmn(p,ilivecrootxf_to_iout_gmn,m,dtime,cnveg_nitrogenflux_inst,.True.,.True.) * & + livecrootn_xfer(p) + gru_deadcrootn_xfer_to_atm(p) = matrix_update_gmn(p,ideadcrootxf_to_iout_gmn,m,dtime,cnveg_nitrogenflux_inst,.True.,.True.) * & + deadcrootn_xfer(p) + end if end if ! end tree block diff --git a/src/dyn_subgrid/dynHarvestMod.F90 b/src/dyn_subgrid/dynHarvestMod.F90 index b662d67d73..609ba6679b 100644 --- a/src/dyn_subgrid/dynHarvestMod.F90 +++ b/src/dyn_subgrid/dynHarvestMod.F90 @@ -434,9 +434,9 @@ subroutine CNHarvest (num_soilc, filter_soilc, num_soilp, filter_soilp, & m = 0._r8 end if - ! patch-level harvest carbon fluxes - ! displayed pools if(.not. use_matrixcn)then + ! patch-level harvest carbon fluxes + ! displayed pools hrv_leafc_to_litter(p) = leafc(p) * m hrv_frootc_to_litter(p) = frootc(p) * m hrv_livestemc_to_litter(p) = livestemc(p) * m @@ -492,6 +492,8 @@ subroutine CNHarvest (num_soilc, filter_soilc, num_soilp, filter_soilp, & ! NOTE: The non-matrix part of this update is in CNCStatUpdate2 CStateUpdate2h (EBK 11/25/2019) ! and for Nitrogen The non-matrix part of this update is in CNNStatUpdate2 NStateUpdate2h (EBK 11/25/2019) else + ! patch-level harvest carbon fluxes + ! displayed pools hrv_leafc_to_litter(p) = matrix_update_gmc(p,ileaf_to_iout_gmc,m,dtime,cnveg_carbonflux_inst,.True.,.True.) * & leafc(p) hrv_frootc_to_litter(p) = matrix_update_gmc(p,ifroot_to_iout_gmc,m,dtime,cnveg_carbonflux_inst,.True.,.True.) * & @@ -506,7 +508,7 @@ subroutine CNHarvest (num_soilc, filter_soilc, num_soilp, filter_soilp, & deadcrootc(p) hrv_xsmrpool_to_atm(p) = xsmrpool(p) * m - ! storage pools + ! storage pools hrv_leafc_storage_to_litter(p) = matrix_update_gmc(p,ileafst_to_iout_gmc,m,dtime,cnveg_carbonflux_inst,.True.,.True.) * & leafc_storage(p) hrv_frootc_storage_to_litter(p) = matrix_update_gmc(p,ifrootst_to_iout_gmc,m,dtime,cnveg_carbonflux_inst,.True.,.True.) * & @@ -521,8 +523,7 @@ subroutine CNHarvest (num_soilc, filter_soilc, num_soilp, filter_soilp, & deadcrootc_storage(p) hrv_gresp_storage_to_litter(p) = gresp_storage(p) * m - - ! transfer pools + ! transfer pools hrv_leafc_xfer_to_litter(p) = matrix_update_gmc(p,ileafxf_to_iout_gmc,m,dtime,cnveg_carbonflux_inst,.True.,.True.) * & leafc_xfer(p) hrv_frootc_xfer_to_litter(p) = matrix_update_gmc(p,ifrootxf_to_iout_gmc,m,dtime,cnveg_carbonflux_inst,.True.,.True.) * & @@ -537,6 +538,8 @@ subroutine CNHarvest (num_soilc, filter_soilc, num_soilp, filter_soilp, & deadcrootc_xfer(p) hrv_gresp_xfer_to_litter(p) = gresp_xfer(p) * m + ! patch-level harvest mortality nitrogen fluxes + ! displayed pools hrv_leafn_to_litter(p) = matrix_update_gmn(p,ileaf_to_iout_gmn,m,dtime,cnveg_nitrogenflux_inst,.True.,.True.) * & leafn(p) hrv_frootn_to_litter(p) = matrix_update_gmn(p,ifroot_to_iout_gmn,m,dtime,cnveg_nitrogenflux_inst,.True.,.True.) * & @@ -552,7 +555,7 @@ subroutine CNHarvest (num_soilc, filter_soilc, num_soilp, filter_soilp, & hrv_retransn_to_litter(p) = matrix_update_gmn(p,iretransn_to_iout_gmn,m,dtime,cnveg_nitrogenflux_inst,.True.,.True.) * & retransn(p) - ! storage pools + ! storage pools hrv_leafn_storage_to_litter(p) = matrix_update_gmn(p,ileafst_to_iout_gmn,m,dtime,cnveg_nitrogenflux_inst,.True.,.True.) *& leafn_storage(p) hrv_frootn_storage_to_litter(p) = matrix_update_gmn(p,ifrootst_to_iout_gmn,m,dtime,cnveg_nitrogenflux_inst,.True.,.True.) *& @@ -565,7 +568,7 @@ subroutine CNHarvest (num_soilc, filter_soilc, num_soilp, filter_soilp, & livecrootn_storage(p) hrv_deadcrootn_storage_to_litter(p) = matrix_update_gmn(p,ideadcrootst_to_iout_gmn,m,dtime,cnveg_nitrogenflux_inst,.True.,.True.)*& deadcrootn_storage(p) - ! transfer pools + ! transfer pools hrv_leafn_xfer_to_litter(p) = matrix_update_gmn(p,ileafxf_to_iout_gmn,m,dtime,cnveg_nitrogenflux_inst,.True.,.True.) * & leafn_xfer(p) hrv_frootn_xfer_to_litter(p) = matrix_update_gmn(p,ifrootxf_to_iout_gmn,m,dtime,cnveg_nitrogenflux_inst,.True.,.True.) * & @@ -578,9 +581,7 @@ subroutine CNHarvest (num_soilc, filter_soilc, num_soilp, filter_soilp, & livecrootn_xfer(p) hrv_deadcrootn_xfer_to_litter(p) = matrix_update_gmn(p,ideadcrootxf_to_iout_gmn,m,dtime,cnveg_nitrogenflux_inst,.True.,.True.) * & deadcrootn_xfer(p) - end if - end if ! end tree block end do ! end of pft loop From 57aa176ae3f28dbea9a9a20c3953fe4c6c1bae12 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Thu, 28 Dec 2023 15:55:12 -0700 Subject: [PATCH 0051/1248] Additional updates for matrixcn to work with GULU --- src/biogeochem/CNCStateUpdate2Mod.F90 | 5 +++- src/biogeochem/CNDriverMod.F90 | 12 +++++--- src/biogeochem/CNNStateUpdate2Mod.F90 | 5 +++- src/biogeochem/dynGrossUnrepMod.F90 | 40 ++++++++++++++++++++++++++- 4 files changed, 55 insertions(+), 7 deletions(-) diff --git a/src/biogeochem/CNCStateUpdate2Mod.F90 b/src/biogeochem/CNCStateUpdate2Mod.F90 index 2890c7d1fd..c59d7d47f1 100644 --- a/src/biogeochem/CNCStateUpdate2Mod.F90 +++ b/src/biogeochem/CNCStateUpdate2Mod.F90 @@ -335,7 +335,8 @@ end subroutine CStateUpdate2h !----------------------------------------------------------------------- subroutine CStateUpdate2g(num_soilc, filter_soilc, num_soilp, filter_soilp, & - cnveg_carbonflux_inst, cnveg_carbonstate_inst, soilbiogeochem_carbonstate_inst) + cnveg_carbonflux_inst, cnveg_carbonstate_inst, & + soilbiogeochem_carbonstate_inst, soilbiogeochem_carbonflux_inst) ! ! !DESCRIPTION: ! Update all the prognostic carbon state @@ -348,6 +349,7 @@ subroutine CStateUpdate2g(num_soilc, filter_soilc, num_soilp, filter_soilp, & integer , intent(in) :: filter_soilp(:) ! filter for soil patches type(cnveg_carbonflux_type) , intent(in) :: cnveg_carbonflux_inst type(cnveg_carbonstate_type) , intent(inout) :: cnveg_carbonstate_inst + type(soilbiogeochem_carbonflux_type) , intent(inout) :: soilbiogeochem_carbonflux_inst type(soilbiogeochem_carbonstate_type) , intent(inout) :: soilbiogeochem_carbonstate_inst ! ! !LOCAL VARIABLES: @@ -359,6 +361,7 @@ subroutine CStateUpdate2g(num_soilc, filter_soilc, num_soilp, filter_soilp, & associate( & cf_veg => cnveg_carbonflux_inst , & cs_veg => cnveg_carbonstate_inst , & + cf_soil => soilbiogeochem_carbonflux_inst, & cs_soil => soilbiogeochem_carbonstate_inst & ) diff --git a/src/biogeochem/CNDriverMod.F90 b/src/biogeochem/CNDriverMod.F90 index 3d75ee51f0..d7eb964f1d 100644 --- a/src/biogeochem/CNDriverMod.F90 +++ b/src/biogeochem/CNDriverMod.F90 @@ -799,18 +799,22 @@ subroutine CNDriverNoLeaching(bounds, end if call CStateUpdate2g( num_soilc, filter_soilc, num_soilp, filter_soilp, & - cnveg_carbonflux_inst, cnveg_carbonstate_inst, soilbiogeochem_carbonstate_inst) + cnveg_carbonflux_inst, cnveg_carbonstate_inst, & + soilbiogeochem_carbonstate_inst, soilbiogeochem_carbonflux_inst) if ( use_c13 ) then call CStateUpdate2g(num_soilc, filter_soilc, num_soilp, filter_soilp, & - c13_cnveg_carbonflux_inst, c13_cnveg_carbonstate_inst, c13_soilbiogeochem_carbonstate_inst) + c13_cnveg_carbonflux_inst, c13_cnveg_carbonstate_inst, & + c13_soilbiogeochem_carbonstate_inst, c13_soilbiogeochem_carbonflux_inst) end if if ( use_c14 ) then call CStateUpdate2g(num_soilc, filter_soilc, num_soilp, filter_soilp, & - c14_cnveg_carbonflux_inst, c14_cnveg_carbonstate_inst, c14_soilbiogeochem_carbonstate_inst) + c14_cnveg_carbonflux_inst, c14_cnveg_carbonstate_inst, & + c14_soilbiogeochem_carbonstate_inst, c14_soilbiogeochem_carbonflux_inst) end if call NStateUpdate2g(num_soilc, filter_soilc, num_soilp, filter_soilp, & - cnveg_nitrogenflux_inst, cnveg_nitrogenstate_inst, soilbiogeochem_nitrogenstate_inst) + cnveg_nitrogenflux_inst, cnveg_nitrogenstate_inst, & + soilbiogeochem_nitrogenstate_inst, soilbiogeochem_nitrogenflux_inst) call t_stopf('CNUpdate2') diff --git a/src/biogeochem/CNNStateUpdate2Mod.F90 b/src/biogeochem/CNNStateUpdate2Mod.F90 index 2dbba68b82..4b6174195e 100644 --- a/src/biogeochem/CNNStateUpdate2Mod.F90 +++ b/src/biogeochem/CNNStateUpdate2Mod.F90 @@ -321,7 +321,8 @@ end subroutine NStateUpdate2h !----------------------------------------------------------------------- subroutine NStateUpdate2g(num_soilc, filter_soilc, num_soilp, filter_soilp, & - cnveg_nitrogenflux_inst, cnveg_nitrogenstate_inst, soilbiogeochem_nitrogenstate_inst) + cnveg_nitrogenflux_inst, cnveg_nitrogenstate_inst, & + soilbiogeochem_nitrogenstate_inst, soilbiogeochem_nitrogenflux_inst) ! ! !DESCRIPTION: ! Update all the prognostic nitrogen state @@ -337,6 +338,7 @@ subroutine NStateUpdate2g(num_soilc, filter_soilc, num_soilp, filter_soilp, & type(cnveg_nitrogenflux_type) , intent(in) :: cnveg_nitrogenflux_inst type(cnveg_nitrogenstate_type) , intent(inout) :: cnveg_nitrogenstate_inst type(soilbiogeochem_nitrogenstate_type) , intent(inout) :: soilbiogeochem_nitrogenstate_inst + type(soilbiogeochem_nitrogenflux_type) , intent(inout) :: soilbiogeochem_nitrogenflux_inst ! ! !LOCAL VARIABLES: integer :: c,p,j,l,i ! indices @@ -347,6 +349,7 @@ subroutine NStateUpdate2g(num_soilc, filter_soilc, num_soilp, filter_soilp, & associate( & nf_veg => cnveg_nitrogenflux_inst , & ns_veg => cnveg_nitrogenstate_inst , & + nf_soil => soilbiogeochem_nitrogenflux_inst, & ns_soil => soilbiogeochem_nitrogenstate_inst & ) diff --git a/src/biogeochem/dynGrossUnrepMod.F90 b/src/biogeochem/dynGrossUnrepMod.F90 index b354744b61..0c9b1e2c53 100644 --- a/src/biogeochem/dynGrossUnrepMod.F90 +++ b/src/biogeochem/dynGrossUnrepMod.F90 @@ -158,6 +158,7 @@ subroutine CNGrossUnrep (num_soilc, filter_soilc, num_soilp, filter_soilp, & use pftconMod , only : noveg, nbrdlf_evr_shrub, nc4_grass use clm_varcon , only : secspday use clm_time_manager, only : get_step_size_real, is_beg_curr_year + use CNVegMatrixMod , only : matrix_update_gmc, matrix_update_gmn ! ! !ARGUMENTS: integer , intent(in) :: num_soilc ! number of soil columns in filter @@ -269,7 +270,44 @@ subroutine CNGrossUnrep (num_soilc, filter_soilc, num_soilp, filter_soilp, & gru_livestemn_xfer_to_atm => cnveg_nitrogenflux_inst%gru_livestemn_xfer_to_atm_patch , & ! Output: [real(r8) (:)] gru_deadstemn_xfer_to_atm => cnveg_nitrogenflux_inst%gru_deadstemn_xfer_to_atm_patch , & ! Output: [real(r8) (:)] gru_livecrootn_xfer_to_atm => cnveg_nitrogenflux_inst%gru_livecrootn_xfer_to_atm_patch , & ! Output: [real(r8) (:)] - gru_deadcrootn_xfer_to_atm => cnveg_nitrogenflux_inst%gru_deadcrootn_xfer_to_atm_patch & ! Output: [real(r8) (:)] + gru_deadcrootn_xfer_to_atm => cnveg_nitrogenflux_inst%gru_deadcrootn_xfer_to_atm_patch , & ! Output: [real(r8) (:)] + ileaf_to_iout_gmc => cnveg_carbonflux_inst%ileaf_to_iout_gm , & + ileafst_to_iout_gmc => cnveg_carbonflux_inst%ileafst_to_iout_gm , & + ileafxf_to_iout_gmc => cnveg_carbonflux_inst%ileafxf_to_iout_gm , & + ifroot_to_iout_gmc => cnveg_carbonflux_inst%ifroot_to_iout_gm , & + ifrootst_to_iout_gmc => cnveg_carbonflux_inst%ifrootst_to_iout_gm , & + ifrootxf_to_iout_gmc => cnveg_carbonflux_inst%ifrootxf_to_iout_gm , & + ilivestem_to_iout_gmc => cnveg_carbonflux_inst%ilivestem_to_iout_gm , & + ilivestemst_to_iout_gmc => cnveg_carbonflux_inst%ilivestemst_to_iout_gm , & + ilivestemxf_to_iout_gmc => cnveg_carbonflux_inst%ilivestemxf_to_iout_gm , & + ideadstem_to_iout_gmc => cnveg_carbonflux_inst%ideadstem_to_iout_gm , & + ideadstemst_to_iout_gmc => cnveg_carbonflux_inst%ideadstemst_to_iout_gm , & + ideadstemxf_to_iout_gmc => cnveg_carbonflux_inst%ideadstemxf_to_iout_gm , & + ilivecroot_to_iout_gmc => cnveg_carbonflux_inst%ilivecroot_to_iout_gm , & + ilivecrootst_to_iout_gmc => cnveg_carbonflux_inst%ilivecrootst_to_iout_gm , & + ilivecrootxf_to_iout_gmc => cnveg_carbonflux_inst%ilivecrootxf_to_iout_gm , & + ideadcroot_to_iout_gmc => cnveg_carbonflux_inst%ideadcroot_to_iout_gm , & + ideadcrootst_to_iout_gmc => cnveg_carbonflux_inst%ideadcrootst_to_iout_gm , & + ideadcrootxf_to_iout_gmc => cnveg_carbonflux_inst%ideadcrootxf_to_iout_gm , & + ileaf_to_iout_gmn => cnveg_nitrogenflux_inst%ileaf_to_iout_gm , & + ileafst_to_iout_gmn => cnveg_nitrogenflux_inst%ileafst_to_iout_gm , & + ileafxf_to_iout_gmn => cnveg_nitrogenflux_inst%ileafxf_to_iout_gm , & + ifroot_to_iout_gmn => cnveg_nitrogenflux_inst%ifroot_to_iout_gm , & + ifrootst_to_iout_gmn => cnveg_nitrogenflux_inst%ifrootst_to_iout_gm , & + ifrootxf_to_iout_gmn => cnveg_nitrogenflux_inst%ifrootxf_to_iout_gm , & + ilivestem_to_iout_gmn => cnveg_nitrogenflux_inst%ilivestem_to_iout_gm , & + ilivestemst_to_iout_gmn => cnveg_nitrogenflux_inst%ilivestemst_to_iout_gm , & + ilivestemxf_to_iout_gmn => cnveg_nitrogenflux_inst%ilivestemxf_to_iout_gm , & + ideadstem_to_iout_gmn => cnveg_nitrogenflux_inst%ideadstem_to_iout_gm , & + ideadstemst_to_iout_gmn => cnveg_nitrogenflux_inst%ideadstemst_to_iout_gm , & + ideadstemxf_to_iout_gmn => cnveg_nitrogenflux_inst%ideadstemxf_to_iout_gm , & + ilivecroot_to_iout_gmn => cnveg_nitrogenflux_inst%ilivecroot_to_iout_gm , & + ilivecrootst_to_iout_gmn => cnveg_nitrogenflux_inst%ilivecrootst_to_iout_gm , & + ilivecrootxf_to_iout_gmn => cnveg_nitrogenflux_inst%ilivecrootxf_to_iout_gm , & + ideadcroot_to_iout_gmn => cnveg_nitrogenflux_inst%ideadcroot_to_iout_gm , & + ideadcrootst_to_iout_gmn => cnveg_nitrogenflux_inst%ideadcrootst_to_iout_gm , & + ideadcrootxf_to_iout_gmn => cnveg_nitrogenflux_inst%ideadcrootxf_to_iout_gm , & + iretransn_to_iout_gmn => cnveg_nitrogenflux_inst%iretransn_to_iout_gm & ) dtime = get_step_size_real() From 1242be2f5b74d65729682322c4c8228a0b6e07aa Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Thu, 28 Dec 2023 20:44:17 -0700 Subject: [PATCH 0052/1248] Cheyenne GULU test now passes with these additional updates --- src/biogeochem/CNCStateUpdate2Mod.F90 | 18 ++++++++++-------- src/biogeochem/CNGapMortalityMod.F90 | 5 ----- src/biogeochem/dynGrossUnrepMod.F90 | 2 +- src/dyn_subgrid/dynHarvestMod.F90 | 5 ----- 4 files changed, 11 insertions(+), 19 deletions(-) diff --git a/src/biogeochem/CNCStateUpdate2Mod.F90 b/src/biogeochem/CNCStateUpdate2Mod.F90 index c59d7d47f1..5fb7a283e9 100644 --- a/src/biogeochem/CNCStateUpdate2Mod.F90 +++ b/src/biogeochem/CNCStateUpdate2Mod.F90 @@ -401,6 +401,16 @@ subroutine CStateUpdate2g(num_soilc, filter_soilc, num_soilp, filter_soilp, & do fp = 1,num_soilp p = filter_soilp(fp) + ! xsmrpool + cs_veg%xsmrpool_patch(p) = cs_veg%xsmrpool_patch(p) & + - cf_veg%gru_xsmrpool_to_atm_patch(p) * dt + ! gresp storage pool + cs_veg%gresp_storage_patch(p) = cs_veg%gresp_storage_patch(p) & + - cf_veg%gru_gresp_storage_to_atm_patch(p) * dt + ! gresp transfer pool + cs_veg%gresp_xfer_patch(p) = cs_veg%gresp_xfer_patch(p) & + - cf_veg%gru_gresp_xfer_to_atm_patch(p) * dt + ! patch-level carbon fluxes from gross unrepresented landcover change mortality ! ! State update without the matrix solution @@ -422,10 +432,6 @@ subroutine CStateUpdate2g(num_soilc, filter_soilc, num_soilp, filter_soilp, & cs_veg%deadcrootc_patch(p) = cs_veg%deadcrootc_patch(p) & - cf_veg%gru_deadcrootc_to_litter_patch(p) * dt - ! xsmrpool - cs_veg%xsmrpool_patch(p) = cs_veg%xsmrpool_patch(p) & - - cf_veg%gru_xsmrpool_to_atm_patch(p) * dt - ! storage pools cs_veg%leafc_storage_patch(p) = cs_veg%leafc_storage_patch(p) & - cf_veg%gru_leafc_storage_to_atm_patch(p) * dt @@ -439,8 +445,6 @@ subroutine CStateUpdate2g(num_soilc, filter_soilc, num_soilp, filter_soilp, & - cf_veg%gru_livecrootc_storage_to_atm_patch(p) * dt cs_veg%deadcrootc_storage_patch(p) = cs_veg%deadcrootc_storage_patch(p) & - cf_veg%gru_deadcrootc_storage_to_atm_patch(p) * dt - cs_veg%gresp_storage_patch(p) = cs_veg%gresp_storage_patch(p) & - - cf_veg%gru_gresp_storage_to_atm_patch(p) * dt ! transfer pools cs_veg%leafc_xfer_patch(p) = cs_veg%leafc_xfer_patch(p) & @@ -455,8 +459,6 @@ subroutine CStateUpdate2g(num_soilc, filter_soilc, num_soilp, filter_soilp, & - cf_veg%gru_livecrootc_xfer_to_atm_patch(p) * dt cs_veg%deadcrootc_xfer_patch(p) = cs_veg%deadcrootc_xfer_patch(p) & - cf_veg%gru_deadcrootc_xfer_to_atm_patch(p) * dt - cs_veg%gresp_xfer_patch(p) = cs_veg%gresp_xfer_patch(p) & - - cf_veg%gru_gresp_xfer_to_atm_patch(p) * dt else ! NB (slevis) The matrix equivalent of the above is in diff --git a/src/biogeochem/CNGapMortalityMod.F90 b/src/biogeochem/CNGapMortalityMod.F90 index e9013e03b1..c99660e3c6 100644 --- a/src/biogeochem/CNGapMortalityMod.F90 +++ b/src/biogeochem/CNGapMortalityMod.F90 @@ -24,11 +24,6 @@ module CNGapMortalityMod use PatchType , only : patch use GridcellType , only : grc use CNSharedParamsMod , only : use_matrixcn - use clm_varpar , only : ileaf,ileaf_st,ileaf_xf,ifroot,ifroot_st,ifroot_xf,& - ilivestem,ilivestem_st,ilivestem_xf,& - ideadstem,ideadstem_st,ideadstem_xf,& - ilivecroot,ilivecroot_st,ilivecroot_xf,& - ideadcroot,ideadcroot_st,ideadcroot_xf,iretransn,ioutc,ioutn use CNVegMatrixMod , only : matrix_update_gmc, matrix_update_gmn ! implicit none diff --git a/src/biogeochem/dynGrossUnrepMod.F90 b/src/biogeochem/dynGrossUnrepMod.F90 index 0c9b1e2c53..1da39a0b64 100644 --- a/src/biogeochem/dynGrossUnrepMod.F90 +++ b/src/biogeochem/dynGrossUnrepMod.F90 @@ -364,7 +364,7 @@ subroutine CNGrossUnrep (num_soilc, filter_soilc, num_soilp, filter_soilp, & gru_livecrootc_xfer_to_atm(p) = livecrootc_xfer(p) * m gru_deadcrootc_xfer_to_atm(p) = deadcrootc_xfer(p) * m gru_gresp_xfer_to_atm(p) = gresp_xfer(p) * m - + ! patch-level gross unrepresented landcover change mortality nitrogen fluxes ! displayed pools gru_leafn_to_litter(p) = leafn(p) * m diff --git a/src/dyn_subgrid/dynHarvestMod.F90 b/src/dyn_subgrid/dynHarvestMod.F90 index 609ba6679b..2936a41545 100644 --- a/src/dyn_subgrid/dynHarvestMod.F90 +++ b/src/dyn_subgrid/dynHarvestMod.F90 @@ -25,11 +25,6 @@ module dynHarvestMod use PatchType , only : patch use CNSharedParamsMod , only : use_matrixcn use clm_varctl , only : use_fates - use clm_varpar , only : ileaf,ileaf_st,ileaf_xf,ifroot,ifroot_st,ifroot_xf,& - ilivestem,ilivestem_st,ilivestem_xf,& - ideadstem,ideadstem_st,ideadstem_xf,& - ilivecroot,ilivecroot_st,ilivecroot_xf,& - ideadcroot,ideadcroot_st,ideadcroot_xf,ioutc,ioutn ! ! !PUBLIC MEMBER FUNCTIONS: implicit none From 46cbf4b3e67b1b55260b6b5b6d57778c1cc54db7 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Fri, 29 Dec 2023 16:04:20 -0700 Subject: [PATCH 0053/1248] Remove PS from SMS_Ld3_PS test for it to work with matrixcn --- cime_config/testdefs/testlist_clm.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index e1f26f0703..3551d34b1a 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -536,7 +536,7 @@ - + From 2287bb6b7b4fdb66a97dc462d37173b72a46ec73 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Fri, 29 Dec 2023 19:04:24 -0700 Subject: [PATCH 0054/1248] Corrections for model to build and a test to pass Used this one for testing: SMS_D.1x1_brazil.I1850Clm51BgcCrop.cheyenne_gnu.clm-mimics_matrixcn --- src/biogeochem/CNCStateUpdate1Mod.F90 | 61 ++++--------------- src/biogeochem/CNDriverMod.F90 | 8 +-- .../SoilBiogeochemNitrogenStateType.F90 | 1 + 3 files changed, 17 insertions(+), 53 deletions(-) diff --git a/src/biogeochem/CNCStateUpdate1Mod.F90 b/src/biogeochem/CNCStateUpdate1Mod.F90 index c342e36a22..e839136e11 100644 --- a/src/biogeochem/CNCStateUpdate1Mod.F90 +++ b/src/biogeochem/CNCStateUpdate1Mod.F90 @@ -215,6 +215,18 @@ subroutine CStateUpdate1( num_soilc, filter_soilc, num_soilp, filter_soilp, & ! terms have been moved to CStateUpdateDynPatch. I think this is zeroed every ! time step, but to be safe, I'm explicitly setting it to zero here. cf_soil%decomp_cpools_sourcesink_col(c,j,i_cwd) = 0._r8 + + ! litter and SOM HR fluxes + do k = 1, ndecomp_cascade_transitions + cf_soil%decomp_cpools_sourcesink_col(c,j,cascade_donor_pool(k)) = & + cf_soil%decomp_cpools_sourcesink_col(c,j,cascade_donor_pool(k)) & + - ( cf_soil%decomp_cascade_hr_vr_col(c,j,k) + cf_soil%decomp_cascade_ctransfer_vr_col(c,j,k)) * dt + if ( cascade_receiver_pool(k) /= 0 ) then ! skip terminal transitions + cf_soil%decomp_cpools_sourcesink_col(c,j,cascade_receiver_pool(k)) = & + cf_soil%decomp_cpools_sourcesink_col(c,j,cascade_receiver_pool(k)) & + + cf_soil%decomp_cascade_ctransfer_vr_col(c,j,k) * dt + end if + end do else ! ! For the matrix solution the actual state update comes after the matrix @@ -233,55 +245,6 @@ subroutine CStateUpdate1( num_soilc, filter_soilc, num_soilp, filter_soilp, & end if fates_if end do fc_loop - - - ! litter and SOM HR fluxes - do k = 1, ndecomp_cascade_transitions - do j = 1,nlevdecomp - do fc = 1,num_soilc - c = filter_soilc(fc) - ! - ! State update without the matrix solution - ! - if (.not. use_soil_matrixcn) then - cf_soil%decomp_cpools_sourcesink_col(c,j,cascade_donor_pool(k)) = & - cf_soil%decomp_cpools_sourcesink_col(c,j,cascade_donor_pool(k)) & - - ( cf_soil%decomp_cascade_hr_vr_col(c,j,k) + cf_soil%decomp_cascade_ctransfer_vr_col(c,j,k)) *dt - end if !not use_soil_matrixcn - end do - end do - end do - do k = 1, ndecomp_cascade_transitions - if ( cascade_receiver_pool(k) /= 0 ) then ! skip terminal transitions - do j = 1,nlevdecomp - do fc = 1,num_soilc - c = filter_soilc(fc) - if (.not. use_soil_matrixcn) then - cf_soil%decomp_cpools_sourcesink_col(c,j,cascade_donor_pool(k)) = & - cf_soil%decomp_cpools_sourcesink_col(c,j,cascade_donor_pool(k)) & - - ( cf_soil%decomp_cascade_hr_vr_col(c,j,k) + cf_soil%decomp_cascade_ctransfer_vr_col(c,j,k)) *dt - end if !not use_soil_matrixcn - end do - end do - end do - do k = 1, ndecomp_cascade_transitions - if ( cascade_receiver_pool(k) /= 0 ) then ! skip terminal transitions - do j = 1,nlevdecomp - do fc = 1,num_soilc - c = filter_soilc(fc) - ! - ! State update without the matrix solution - ! - if (.not. use_soil_matrixcn) then - cf_soil%decomp_cpools_sourcesink_col(c,j,cascade_receiver_pool(k)) = & - cf_soil%decomp_cpools_sourcesink_col(c,j,cascade_receiver_pool(k)) & - + cf_soil%decomp_cascade_ctransfer_vr_col(c,j,k)*dt - end if !not use_soil_matrixcn - end do - end do - end do - end if - end do soilpatch_loop: do fp = 1,num_soilp p = filter_soilp(fp) diff --git a/src/biogeochem/CNDriverMod.F90 b/src/biogeochem/CNDriverMod.F90 index be341477a5..67eaba1013 100644 --- a/src/biogeochem/CNDriverMod.F90 +++ b/src/biogeochem/CNDriverMod.F90 @@ -1097,10 +1097,10 @@ subroutine CNDriverLeaching(bounds, & if ( use_matrixcn ) then call t_startf('CNVMatrix') - call CNVegMatrix(bounds,num_bgc_soilp,filter_bgc_soilp(1:num_bgc_soilp),num_actfirep,filter_actfirep,cnveg_carbonstate_inst,cnveg_nitrogenstate_inst,& - cnveg_carbonflux_inst, cnveg_nitrogenflux_inst,cnveg_state_inst,soilbiogeochem_nitrogenflux_inst,& - c13_cnveg_carbonstate_inst,c14_cnveg_carbonstate_inst,c13_cnveg_carbonflux_inst,& - c14_cnveg_carbonflux_inst) + call CNVegMatrix(bounds, num_bgc_vegp, filter_bgc_vegp(1:num_bgc_vegp), & + num_actfirep, filter_actfirep, cnveg_carbonstate_inst, cnveg_nitrogenstate_inst, & + cnveg_carbonflux_inst, cnveg_nitrogenflux_inst, cnveg_state_inst,soilbiogeochem_nitrogenflux_inst, & + c13_cnveg_carbonstate_inst, c14_cnveg_carbonstate_inst, c13_cnveg_carbonflux_inst, c14_cnveg_carbonflux_inst) call t_stopf('CNVMatrix') end if diff --git a/src/soilbiogeochem/SoilBiogeochemNitrogenStateType.F90 b/src/soilbiogeochem/SoilBiogeochemNitrogenStateType.F90 index e97ed3e6eb..a0cbc81a9e 100644 --- a/src/soilbiogeochem/SoilBiogeochemNitrogenStateType.F90 +++ b/src/soilbiogeochem/SoilBiogeochemNitrogenStateType.F90 @@ -15,6 +15,7 @@ module SoilBiogeochemNitrogenStateType use clm_varctl , only : iulog, override_bgc_restart_mismatch_dump, spinup_state use landunit_varcon , only : istcrop, istsoil use SoilBiogeochemDecompCascadeConType , only : decomp_cascade_con, use_soil_matrixcn + use SoilBiogeochemDecompCascadeConType , only : mimics_decomp, century_decomp, decomp_method use LandunitType , only : lun use ColumnType , only : col use GridcellType , only : grc From 107f854c89a237b2d1d99ad36b78ce2ef2ad2544 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Sat, 30 Dec 2023 21:42:36 -0700 Subject: [PATCH 0055/1248] Fix for FatesCold simulations to pass --- src/biogeochem/CNCStateUpdate1Mod.F90 | 30 +++++++++++++++++---------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/src/biogeochem/CNCStateUpdate1Mod.F90 b/src/biogeochem/CNCStateUpdate1Mod.F90 index e839136e11..4eb52d9c10 100644 --- a/src/biogeochem/CNCStateUpdate1Mod.F90 +++ b/src/biogeochem/CNCStateUpdate1Mod.F90 @@ -216,17 +216,6 @@ subroutine CStateUpdate1( num_soilc, filter_soilc, num_soilp, filter_soilp, & ! time step, but to be safe, I'm explicitly setting it to zero here. cf_soil%decomp_cpools_sourcesink_col(c,j,i_cwd) = 0._r8 - ! litter and SOM HR fluxes - do k = 1, ndecomp_cascade_transitions - cf_soil%decomp_cpools_sourcesink_col(c,j,cascade_donor_pool(k)) = & - cf_soil%decomp_cpools_sourcesink_col(c,j,cascade_donor_pool(k)) & - - ( cf_soil%decomp_cascade_hr_vr_col(c,j,k) + cf_soil%decomp_cascade_ctransfer_vr_col(c,j,k)) * dt - if ( cascade_receiver_pool(k) /= 0 ) then ! skip terminal transitions - cf_soil%decomp_cpools_sourcesink_col(c,j,cascade_receiver_pool(k)) = & - cf_soil%decomp_cpools_sourcesink_col(c,j,cascade_receiver_pool(k)) & - + cf_soil%decomp_cascade_ctransfer_vr_col(c,j,k) * dt - end if - end do else ! ! For the matrix solution the actual state update comes after the matrix @@ -243,6 +232,25 @@ subroutine CStateUpdate1( num_soilc, filter_soilc, num_soilp, filter_soilp, & end do end if fates_if + + do j = 1,nlevdecomp + ! + ! State update without the matrix solution + ! + if (.not. use_soil_matrixcn) then + ! litter and SOM HR fluxes + do k = 1, ndecomp_cascade_transitions + cf_soil%decomp_cpools_sourcesink_col(c,j,cascade_donor_pool(k)) = & + cf_soil%decomp_cpools_sourcesink_col(c,j,cascade_donor_pool(k)) & + - ( cf_soil%decomp_cascade_hr_vr_col(c,j,k) + cf_soil%decomp_cascade_ctransfer_vr_col(c,j,k)) * dt + if ( cascade_receiver_pool(k) /= 0 ) then ! skip terminal transitions + cf_soil%decomp_cpools_sourcesink_col(c,j,cascade_receiver_pool(k)) = & + cf_soil%decomp_cpools_sourcesink_col(c,j,cascade_receiver_pool(k)) & + + cf_soil%decomp_cascade_ctransfer_vr_col(c,j,k) * dt + end if + end do + end if + end do end do fc_loop From 3af4aedfbb8bc7a8b0076184197141c463e6c8fd Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Tue, 2 Jan 2024 18:39:00 -0700 Subject: [PATCH 0056/1248] Corrections from comparing model versions --- src/biogeochem/CNPhenologyMod.F90 | 40 +++++++++---------------------- 1 file changed, 11 insertions(+), 29 deletions(-) diff --git a/src/biogeochem/CNPhenologyMod.F90 b/src/biogeochem/CNPhenologyMod.F90 index e1b7b2edb6..2d9ab51473 100644 --- a/src/biogeochem/CNPhenologyMod.F90 +++ b/src/biogeochem/CNPhenologyMod.F90 @@ -3506,17 +3506,8 @@ subroutine CNOffsetLitterfall (num_soilp, filter_soilp, & t1 = 1.0_r8 / dt frootc_to_litter(p) = t1 * frootc(p) + cpool_to_frootc(p) - ! TODO slevis: This line didn't appear in dev159. Remove? - ! biofuel_harvfrac is only non-zero for prognostic crops. - leafc_to_litter(p) = t1 * leafc(p) * (1._r8 - biofuel_harvfrac(ivt(p))) + cpool_to_leafc(p) - - ! leafc_litter and frootc_to_litter for matrix + ! frootc_to_litter for matrix if (use_matrixcn) then - if(leafc(p) .gt. 0)then - leafc_to_litter(p) = leafc(p) * matrix_update_phc(p,ileaf_to_iout_phc,leafc_to_litter(p) / leafc(p),dt,cnveg_carbonflux_inst,matrixcheck_ph,acc_ph) - else - leafc_to_litter(p) = 0 - end if if(frootc(p) .gt. 0)then frootc_to_litter(p) = frootc(p) * matrix_update_phc(p,ifroot_to_iout_phc,frootc_to_litter(p) / frootc(p),dt,cnveg_carbonflux_inst,matrixcheck_ph,acc_ph) else @@ -3618,6 +3609,7 @@ subroutine CNOffsetLitterfall (num_soilp, filter_soilp, & ! as well as leaf C:N ratio (unaffected by biofuel harvest). It thus does not ! need to be updated here. + ! Matrix for grain, livestem to litter, leaf to litter, and biofuel if(use_matrixcn)then if(reproductivec(p,1) .gt. 0)then grainc_to_out = reproductivec(p,1) * matrix_update_phc(p,igrain_to_iout_phc,(repr_grainc_to_seed(p,1) + repr_grainc_to_food(p,1)) / reproductivec(p,1),dt,cnveg_carbonflux_inst,matrixcheck_ph,acc_ph) @@ -3633,13 +3625,17 @@ subroutine CNOffsetLitterfall (num_soilp, filter_soilp, & end if if(livestemc(p) .gt. 0)then livestemc_to_litter(p) = livestemc(p) * matrix_update_phc(p,ilivestem_to_iout_phc,livestemc_to_litter(p) / livestemc(p),dt,cnveg_carbonflux_inst,matrixcheck_ph,acc_ph) + livestemc_to_biofuelc(p) = livestemc(p) * matrix_update_gmc(p,ilivestem_to_iout_gmc,livestemc_to_biofuelc(p) / livestemc(p),dt,cnveg_carbonflux_inst,matrixcheck_ph,.True.) else livestemc_to_litter(p) = 0 + livestemc_to_biofuelc(p) = 0 end if if(livestemn(p) .gt. 0)then livestemn_to_biofueln(p) = livestemn(p) * matrix_update_gmn(p,ilivestem_to_iout_gmn,livestemn_to_biofueln(p) / livestemn(p),dt,cnveg_nitrogenflux_inst,matrixcheck_ph,.True.) + livestemn_to_litter(p) = livestemn(p) * matrix_update_phn(p,ilivestem_to_iout_phn, (1._r8- biofuel_harvfrac(ivt(p)))/dt, dt,cnveg_nitrogenflux_inst,matrixcheck_ph,acc_ph) else livestemn_to_biofueln(p) = 0 + livestemn_to_litter(p) = 0 end if if(leafn(p) > 0)then leafn_to_biofueln(p) = leafn(p) * matrix_update_gmn(p,ileaf_to_iout_gmn,leafn_to_biofueln(p) / leafn(p),dt,cnveg_nitrogenflux_inst,matrixcheck_ph,.True.) @@ -3647,14 +3643,11 @@ subroutine CNOffsetLitterfall (num_soilp, filter_soilp, & leafn_to_biofueln(p) = 0 end if if (leafc(p) > 0)then - leafc_to_biofuelc(p) = leafc(p) * matrix_update_gmc(p,ileaf_to_iout_gmc,leafc_to_biofuelc(p) / leafc(p),dt,cnveg_carbonflux_inst,matrixcheck_ph,.True.) - else - leafc_to_biofuelc(p) = 0 - end if - if(livestemc(p) .gt. 0)then - livestemc_to_biofuelc(p) = livestemc(p) * matrix_update_gmc(p,ilivestem_to_iout_gmc,livestemc_to_biofuelc(p) / livestemc(p),dt,cnveg_carbonflux_inst,matrixcheck_ph,.True.) + leafc_to_biofuelc(p) = leafc(p) * matrix_update_gmc(p,ileaf_to_iout_gmc,leafc_to_biofuelc(p) / leafc(p),dt,cnveg_carbonflux_inst,matrixcheck_ph,.True.) + leafc_to_litter(p) = leafc(p) * matrix_update_phc(p,ileaf_to_iout_phc,leafc_to_litter(p) / leafc(p),dt,cnveg_carbonflux_inst,matrixcheck_ph,acc_ph) else - livestemc_to_biofuelc(p) = 0 + leafc_to_biofuelc(p) = 0 + leafc_to_litter(p) = 0 end if else ! NOTE: The non matrix version of this is in CNCStateUpdate1::CStateUpdate1 EBK (11/26/2019) @@ -3675,7 +3668,7 @@ subroutine CNOffsetLitterfall (num_soilp, filter_soilp, & if(frootc(p) .gt. 0)then frootc_to_litter(p) = frootc(p) * matrix_update_phc(p,ifroot_to_iout_phc,frootc_to_litter(p) / frootc(p),dt,cnveg_carbonflux_inst,matrixcheck_ph,acc_ph) else - frootc_to_litter(p) = 0 + frootc_to_litter(p) = 0 ! TODO slevis here and elsewhere end if else ! NOTE: The non matrix version of this is in CNCStateUpdate1::CStateUpdate1 EBK (11/26/2019) @@ -3824,17 +3817,6 @@ subroutine CNOffsetLitterfall (num_soilp, filter_soilp, & endif end if - ! TODO slevis: This paragraph didn't appear in dev159. Remove? - if (ivt(p) >= npcropmin) then - ! NOTE(slevis, 2014-12) results in -ve livestemn and -ve totpftn - !X! livestemn_to_litter(p) = livestemc_to_litter(p) / livewdcn(ivt(p)) - ! NOTE(slevis, 2014-12) Beth Drewniak suggested this instead - livestemn_to_litter(p) = livestemn(p) / dt * (1._r8 - biofuel_harvfrac(ivt(p))) - if(use_matrixcn)then - livestemn_to_litter(p) = livestemn(p) * matrix_update_phn(p,ilivestem_to_iout_phn, (1._r8- biofuel_harvfrac(ivt(p)))/dt, dt,cnveg_nitrogenflux_inst,matrixcheck_ph,acc_ph) - end if - end if - ! save the current litterfall fluxes prev_leafc_to_litter(p) = leafc_to_litter(p) prev_frootc_to_litter(p) = frootc_to_litter(p) From 2ea1cecedd3a00cd98d962f9de1eaac2159ace05 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Tue, 2 Jan 2024 18:46:58 -0700 Subject: [PATCH 0057/1248] Corrections to lists of tests and expected failures --- cime_config/testdefs/ExpectedTestFails.xml | 4 ++-- cime_config/testdefs/testlist_clm.xml | 18 +++++++++--------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/cime_config/testdefs/ExpectedTestFails.xml b/cime_config/testdefs/ExpectedTestFails.xml index 6be036c485..b0f7fa860b 100644 --- a/cime_config/testdefs/ExpectedTestFails.xml +++ b/cime_config/testdefs/ExpectedTestFails.xml @@ -50,13 +50,13 @@ #1733 - + FAIL #640, same test with clm-ciso_soil_matrixcn_only works - + FAIL #640, same test with clm-ciso_soil_matrixcn_only works diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index 114e3781a0..5ec791b7d4 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -373,7 +373,7 @@ - + @@ -632,7 +632,7 @@ - + @@ -641,7 +641,7 @@ - + @@ -729,7 +729,7 @@ - + @@ -808,7 +808,7 @@ - + @@ -1005,7 +1005,7 @@ - + @@ -1014,7 +1014,7 @@ - + @@ -2383,7 +2383,7 @@ - + @@ -2603,7 +2603,7 @@ - + From 9208fde389712a1fc08a8f73760a781f2ff1cd02 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Fri, 26 Jan 2024 00:46:45 -0700 Subject: [PATCH 0058/1248] Update CAM and CICE6 to cesm2_3_beta16 versions --- Externals.cfg | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Externals.cfg b/Externals.cfg index ff0e28f4cd..d75b4683a6 100644 --- a/Externals.cfg +++ b/Externals.cfg @@ -41,7 +41,7 @@ local_path = components/cice5 required = True [cice6] -tag = cesm_cice6_2_0_22 +tag = cesm_cice6_4_1_10 protocol = git repo_url = https://github.com/ESCOMP/CESM_CICE local_path = components/cice @@ -49,7 +49,7 @@ externals = Externals.cfg required = True [cam6] -tag = cam6_3_058 +tag = cam6_3_133 protocol = git repo_url = https://github.com/ESCOMP/CAM local_path = components/cam From 896713bc0971108231cafb8dc0d392fce5e8131c Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Fri, 26 Jan 2024 00:47:04 -0700 Subject: [PATCH 0059/1248] Squashed 'manage_externals/' changes from 7b6d92ef6..0f884bfec 0f884bfec Merge pull request #205 from jedwards4b/sunset_svn_git_access 82a5edf79 merge in billsacks:svn_testing_no_github 17532c160 Use a local svn repo for testing 9c904341a different method to determine if in tests 539952ebd remove debug print statement cc5434fa7 fix submodule testing 1d7f28840 remove broken tests 04e94a519 provide a meaningful error message 38bcc0a8c Merge pull request #201 from jedwards4b/partial_match b4466a5aa remove debug print statement c3cf3ec35 fix issue with partial branch match git-subtree-dir: manage_externals git-subtree-split: 0f884bfec8e43d0c02261de858d6ec3f6d855e51 --- manic/repository_git.py | 18 +- manic/repository_svn.py | 3 + test/repos/README.md | 4 +- test/repos/simple-ext.svn/README.txt | 5 + test/repos/simple-ext.svn/conf/authz | 32 +++ test/repos/simple-ext.svn/conf/hooks-env.tmpl | 19 ++ test/repos/simple-ext.svn/conf/passwd | 8 + test/repos/simple-ext.svn/conf/svnserve.conf | 81 +++++++ test/repos/simple-ext.svn/db/current | 1 + test/repos/simple-ext.svn/db/format | 3 + test/repos/simple-ext.svn/db/fs-type | 1 + test/repos/simple-ext.svn/db/fsfs.conf | 200 ++++++++++++++++++ test/repos/simple-ext.svn/db/min-unpacked-rev | 1 + test/repos/simple-ext.svn/db/rep-cache.db | Bin 0 -> 8192 bytes .../simple-ext.svn/db/rep-cache.db-journal | 0 test/repos/simple-ext.svn/db/revprops/0/0 | 5 + test/repos/simple-ext.svn/db/revprops/0/1 | 13 ++ test/repos/simple-ext.svn/db/revprops/0/2 | 13 ++ test/repos/simple-ext.svn/db/revprops/0/3 | 13 ++ test/repos/simple-ext.svn/db/revs/0/0 | Bin 0 -> 253 bytes test/repos/simple-ext.svn/db/revs/0/1 | Bin 0 -> 725 bytes test/repos/simple-ext.svn/db/revs/0/2 | Bin 0 -> 816 bytes test/repos/simple-ext.svn/db/revs/0/3 | Bin 0 -> 769 bytes test/repos/simple-ext.svn/db/txn-current | 1 + test/repos/simple-ext.svn/db/txn-current-lock | 0 test/repos/simple-ext.svn/db/uuid | 2 + test/repos/simple-ext.svn/db/write-lock | 0 test/repos/simple-ext.svn/format | 1 + .../simple-ext.svn/hooks/post-commit.tmpl | 62 ++++++ .../repos/simple-ext.svn/hooks/post-lock.tmpl | 64 ++++++ .../hooks/post-revprop-change.tmpl | 69 ++++++ .../simple-ext.svn/hooks/post-unlock.tmpl | 61 ++++++ .../simple-ext.svn/hooks/pre-commit.tmpl | 91 ++++++++ test/repos/simple-ext.svn/hooks/pre-lock.tmpl | 95 +++++++++ .../hooks/pre-revprop-change.tmpl | 79 +++++++ .../simple-ext.svn/hooks/pre-unlock.tmpl | 87 ++++++++ .../simple-ext.svn/hooks/start-commit.tmpl | 81 +++++++ test/repos/simple-ext.svn/locks/db-logs.lock | 3 + test/repos/simple-ext.svn/locks/db.lock | 3 + test/test_sys_checkout.py | 51 ++--- 40 files changed, 1126 insertions(+), 44 deletions(-) create mode 100644 test/repos/simple-ext.svn/README.txt create mode 100644 test/repos/simple-ext.svn/conf/authz create mode 100644 test/repos/simple-ext.svn/conf/hooks-env.tmpl create mode 100644 test/repos/simple-ext.svn/conf/passwd create mode 100644 test/repos/simple-ext.svn/conf/svnserve.conf create mode 100644 test/repos/simple-ext.svn/db/current create mode 100644 test/repos/simple-ext.svn/db/format create mode 100644 test/repos/simple-ext.svn/db/fs-type create mode 100644 test/repos/simple-ext.svn/db/fsfs.conf create mode 100644 test/repos/simple-ext.svn/db/min-unpacked-rev create mode 100644 test/repos/simple-ext.svn/db/rep-cache.db create mode 100644 test/repos/simple-ext.svn/db/rep-cache.db-journal create mode 100644 test/repos/simple-ext.svn/db/revprops/0/0 create mode 100644 test/repos/simple-ext.svn/db/revprops/0/1 create mode 100644 test/repos/simple-ext.svn/db/revprops/0/2 create mode 100644 test/repos/simple-ext.svn/db/revprops/0/3 create mode 100644 test/repos/simple-ext.svn/db/revs/0/0 create mode 100644 test/repos/simple-ext.svn/db/revs/0/1 create mode 100644 test/repos/simple-ext.svn/db/revs/0/2 create mode 100644 test/repos/simple-ext.svn/db/revs/0/3 create mode 100644 test/repos/simple-ext.svn/db/txn-current create mode 100644 test/repos/simple-ext.svn/db/txn-current-lock create mode 100644 test/repos/simple-ext.svn/db/uuid create mode 100644 test/repos/simple-ext.svn/db/write-lock create mode 100644 test/repos/simple-ext.svn/format create mode 100755 test/repos/simple-ext.svn/hooks/post-commit.tmpl create mode 100755 test/repos/simple-ext.svn/hooks/post-lock.tmpl create mode 100755 test/repos/simple-ext.svn/hooks/post-revprop-change.tmpl create mode 100755 test/repos/simple-ext.svn/hooks/post-unlock.tmpl create mode 100755 test/repos/simple-ext.svn/hooks/pre-commit.tmpl create mode 100755 test/repos/simple-ext.svn/hooks/pre-lock.tmpl create mode 100755 test/repos/simple-ext.svn/hooks/pre-revprop-change.tmpl create mode 100755 test/repos/simple-ext.svn/hooks/pre-unlock.tmpl create mode 100755 test/repos/simple-ext.svn/hooks/start-commit.tmpl create mode 100644 test/repos/simple-ext.svn/locks/db-logs.lock create mode 100644 test/repos/simple-ext.svn/locks/db.lock mode change 100644 => 100755 test/test_sys_checkout.py diff --git a/manic/repository_git.py b/manic/repository_git.py index adc666cc57..aab1a468a8 100644 --- a/manic/repository_git.py +++ b/manic/repository_git.py @@ -7,6 +7,7 @@ import copy import os +import sys from .global_constants import EMPTY_STR, LOCAL_PATH_INDICATOR from .global_constants import VERBOSITY_VERBOSE @@ -380,7 +381,6 @@ def _check_for_valid_ref(self, ref, remote_name, dirname): is_tag = self._ref_is_tag(ref, dirname) is_branch = self._ref_is_branch(ref, remote_name, dirname) is_hash = self._ref_is_hash(ref, dirname) - is_valid = is_tag or is_branch or is_hash if not is_valid: msg = ('In repo "{0}": reference "{1}" does not appear to be a ' @@ -710,7 +710,10 @@ def _git_lsremote_branch(ref, remote_name, dirname): cmd = ('git -C {dirname} ls-remote --exit-code --heads ' '{remote_name} {ref}').format( dirname=dirname, remote_name=remote_name, ref=ref).split() - status = execute_subprocess(cmd, status_to_caller=True) + status, output = execute_subprocess(cmd, status_to_caller=True, output_to_caller=True) + if not status and not f"refs/heads/{ref}" in output: + # In this case the ref is contained in the branch name but is not the complete branch name + return -1 return status @staticmethod @@ -837,12 +840,19 @@ def _git_update_submodules(verbosity, dirname): """Run git submodule update for the side effect of updating this repo's submodules. """ + # due to https://vielmetti.typepad.com/logbook/2022/10/git-security-fixes-lead-to-fatal-transport-file-not-allowed-error-in-ci-systems-cve-2022-39253.html + # submodules from file doesn't work without overriding the protocol, this is done + # for testing submodule support but should not be done in practice + file_protocol = "" + if 'unittest' in sys.modules.keys(): + file_protocol = "-c protocol.file.allow=always" + # First, verify that we have a .gitmodules file if os.path.exists( os.path.join(dirname, ExternalsDescription.GIT_SUBMODULES_FILENAME)): - cmd = ('git -C {dirname} submodule update --init --recursive' - .format(dirname=dirname)).split() + cmd = ('git {file_protocol} -C {dirname} submodule update --init --recursive' + .format(file_protocol=file_protocol, dirname=dirname)).split() if verbosity >= VERBOSITY_VERBOSE: printlog(' {0}'.format(' '.join(cmd))) diff --git a/manic/repository_svn.py b/manic/repository_svn.py index 922855d34e..32a71184b4 100644 --- a/manic/repository_svn.py +++ b/manic/repository_svn.py @@ -42,6 +42,9 @@ def __init__(self, component_name, repo, ignore_ancestry=False): Parse repo (a XML element). """ Repository.__init__(self, component_name, repo) + if 'github.com' in self._url: + msg = "SVN access to github.com is no longer supported" + fatal_error(msg) self._ignore_ancestry = ignore_ancestry if self._url.endswith('/'): # there is already a '/' separator in the URL; no need to add another diff --git a/test/repos/README.md b/test/repos/README.md index 8a3502c35f..026b684ea3 100644 --- a/test/repos/README.md +++ b/test/repos/README.md @@ -1,6 +1,6 @@ -Git repositories for testing git-related behavior. For usage and terminology notes, see test/test_sys_checkout.py. +Git and svn repositories for testing git and svn-related behavior. For usage and terminology notes, see test/test_sys_checkout.py. -To list files and view file contents at HEAD: +For git repos: To list files and view file contents at HEAD: ``` cd git ls-tree --full-tree -r --name-only HEAD diff --git a/test/repos/simple-ext.svn/README.txt b/test/repos/simple-ext.svn/README.txt new file mode 100644 index 0000000000..9935818a1b --- /dev/null +++ b/test/repos/simple-ext.svn/README.txt @@ -0,0 +1,5 @@ +This is a Subversion repository; use the 'svnadmin' and 'svnlook' +tools to examine it. Do not add, delete, or modify files here +unless you know how to avoid corrupting the repository. + +Visit http://subversion.apache.org/ for more information. diff --git a/test/repos/simple-ext.svn/conf/authz b/test/repos/simple-ext.svn/conf/authz new file mode 100644 index 0000000000..0b9a41074e --- /dev/null +++ b/test/repos/simple-ext.svn/conf/authz @@ -0,0 +1,32 @@ +### This file is an example authorization file for svnserve. +### Its format is identical to that of mod_authz_svn authorization +### files. +### As shown below each section defines authorizations for the path and +### (optional) repository specified by the section name. +### The authorizations follow. An authorization line can refer to: +### - a single user, +### - a group of users defined in a special [groups] section, +### - an alias defined in a special [aliases] section, +### - all authenticated users, using the '$authenticated' token, +### - only anonymous users, using the '$anonymous' token, +### - anyone, using the '*' wildcard. +### +### A match can be inverted by prefixing the rule with '~'. Rules can +### grant read ('r') access, read-write ('rw') access, or no access +### (''). + +[aliases] +# joe = /C=XZ/ST=Dessert/L=Snake City/O=Snake Oil, Ltd./OU=Research Institute/CN=Joe Average + +[groups] +# harry_and_sally = harry,sally +# harry_sally_and_joe = harry,sally,&joe + +# [/foo/bar] +# harry = rw +# &joe = r +# * = + +# [repository:/baz/fuz] +# @harry_and_sally = rw +# * = r diff --git a/test/repos/simple-ext.svn/conf/hooks-env.tmpl b/test/repos/simple-ext.svn/conf/hooks-env.tmpl new file mode 100644 index 0000000000..ee965c316c --- /dev/null +++ b/test/repos/simple-ext.svn/conf/hooks-env.tmpl @@ -0,0 +1,19 @@ +### This file is an example hook script environment configuration file. +### Hook scripts run in an empty environment by default. +### As shown below each section defines environment variables for a +### particular hook script. The [default] section defines environment +### variables for all hook scripts, unless overridden by a hook-specific +### section. + +### This example configures a UTF-8 locale for all hook scripts, so that +### special characters, such as umlauts, may be printed to stderr. +### If UTF-8 is used with a mod_dav_svn server, the SVNUseUTF8 option must +### also be set to 'yes' in httpd.conf. +### With svnserve, the LANG environment variable of the svnserve process +### must be set to the same value as given here. +[default] +LANG = en_US.UTF-8 + +### This sets the PATH environment variable for the pre-commit hook. +[pre-commit] +PATH = /usr/local/bin:/usr/bin:/usr/sbin diff --git a/test/repos/simple-ext.svn/conf/passwd b/test/repos/simple-ext.svn/conf/passwd new file mode 100644 index 0000000000..ecaa08dcec --- /dev/null +++ b/test/repos/simple-ext.svn/conf/passwd @@ -0,0 +1,8 @@ +### This file is an example password file for svnserve. +### Its format is similar to that of svnserve.conf. As shown in the +### example below it contains one section labelled [users]. +### The name and password for each user follow, one account per line. + +[users] +# harry = harryssecret +# sally = sallyssecret diff --git a/test/repos/simple-ext.svn/conf/svnserve.conf b/test/repos/simple-ext.svn/conf/svnserve.conf new file mode 100644 index 0000000000..6cefc17b3e --- /dev/null +++ b/test/repos/simple-ext.svn/conf/svnserve.conf @@ -0,0 +1,81 @@ +### This file controls the configuration of the svnserve daemon, if you +### use it to allow access to this repository. (If you only allow +### access through http: and/or file: URLs, then this file is +### irrelevant.) + +### Visit http://subversion.apache.org/ for more information. + +[general] +### The anon-access and auth-access options control access to the +### repository for unauthenticated (a.k.a. anonymous) users and +### authenticated users, respectively. +### Valid values are "write", "read", and "none". +### Setting the value to "none" prohibits both reading and writing; +### "read" allows read-only access, and "write" allows complete +### read/write access to the repository. +### The sample settings below are the defaults and specify that anonymous +### users have read-only access to the repository, while authenticated +### users have read and write access to the repository. +# anon-access = read +# auth-access = write +### The password-db option controls the location of the password +### database file. Unless you specify a path starting with a /, +### the file's location is relative to the directory containing +### this configuration file. +### If SASL is enabled (see below), this file will NOT be used. +### Uncomment the line below to use the default password file. +# password-db = passwd +### The authz-db option controls the location of the authorization +### rules for path-based access control. Unless you specify a path +### starting with a /, the file's location is relative to the +### directory containing this file. The specified path may be a +### repository relative URL (^/) or an absolute file:// URL to a text +### file in a Subversion repository. If you don't specify an authz-db, +### no path-based access control is done. +### Uncomment the line below to use the default authorization file. +# authz-db = authz +### The groups-db option controls the location of the file with the +### group definitions and allows maintaining groups separately from the +### authorization rules. The groups-db file is of the same format as the +### authz-db file and should contain a single [groups] section with the +### group definitions. If the option is enabled, the authz-db file cannot +### contain a [groups] section. Unless you specify a path starting with +### a /, the file's location is relative to the directory containing this +### file. The specified path may be a repository relative URL (^/) or an +### absolute file:// URL to a text file in a Subversion repository. +### This option is not being used by default. +# groups-db = groups +### This option specifies the authentication realm of the repository. +### If two repositories have the same authentication realm, they should +### have the same password database, and vice versa. The default realm +### is repository's uuid. +# realm = My First Repository +### The force-username-case option causes svnserve to case-normalize +### usernames before comparing them against the authorization rules in the +### authz-db file configured above. Valid values are "upper" (to upper- +### case the usernames), "lower" (to lowercase the usernames), and +### "none" (to compare usernames as-is without case conversion, which +### is the default behavior). +# force-username-case = none +### The hooks-env options specifies a path to the hook script environment +### configuration file. This option overrides the per-repository default +### and can be used to configure the hook script environment for multiple +### repositories in a single file, if an absolute path is specified. +### Unless you specify an absolute path, the file's location is relative +### to the directory containing this file. +# hooks-env = hooks-env + +[sasl] +### This option specifies whether you want to use the Cyrus SASL +### library for authentication. Default is false. +### Enabling this option requires svnserve to have been built with Cyrus +### SASL support; to check, run 'svnserve --version' and look for a line +### reading 'Cyrus SASL authentication is available.' +# use-sasl = true +### These options specify the desired strength of the security layer +### that you want SASL to provide. 0 means no encryption, 1 means +### integrity-checking only, values larger than 1 are correlated +### to the effective key length for encryption (e.g. 128 means 128-bit +### encryption). The values below are the defaults. +# min-encryption = 0 +# max-encryption = 256 diff --git a/test/repos/simple-ext.svn/db/current b/test/repos/simple-ext.svn/db/current new file mode 100644 index 0000000000..00750edc07 --- /dev/null +++ b/test/repos/simple-ext.svn/db/current @@ -0,0 +1 @@ +3 diff --git a/test/repos/simple-ext.svn/db/format b/test/repos/simple-ext.svn/db/format new file mode 100644 index 0000000000..5dd0c22198 --- /dev/null +++ b/test/repos/simple-ext.svn/db/format @@ -0,0 +1,3 @@ +8 +layout sharded 1000 +addressing logical diff --git a/test/repos/simple-ext.svn/db/fs-type b/test/repos/simple-ext.svn/db/fs-type new file mode 100644 index 0000000000..4fdd95313f --- /dev/null +++ b/test/repos/simple-ext.svn/db/fs-type @@ -0,0 +1 @@ +fsfs diff --git a/test/repos/simple-ext.svn/db/fsfs.conf b/test/repos/simple-ext.svn/db/fsfs.conf new file mode 100644 index 0000000000..ac6877a727 --- /dev/null +++ b/test/repos/simple-ext.svn/db/fsfs.conf @@ -0,0 +1,200 @@ +### This file controls the configuration of the FSFS filesystem. + +[memcached-servers] +### These options name memcached servers used to cache internal FSFS +### data. See http://www.danga.com/memcached/ for more information on +### memcached. To use memcached with FSFS, run one or more memcached +### servers, and specify each of them as an option like so: +# first-server = 127.0.0.1:11211 +# remote-memcached = mymemcached.corp.example.com:11212 +### The option name is ignored; the value is of the form HOST:PORT. +### memcached servers can be shared between multiple repositories; +### however, if you do this, you *must* ensure that repositories have +### distinct UUIDs and paths, or else cached data from one repository +### might be used by another accidentally. Note also that memcached has +### no authentication for reads or writes, so you must ensure that your +### memcached servers are only accessible by trusted users. + +[caches] +### When a cache-related error occurs, normally Subversion ignores it +### and continues, logging an error if the server is appropriately +### configured (and ignoring it with file:// access). To make +### Subversion never ignore cache errors, uncomment this line. +# fail-stop = true + +[rep-sharing] +### To conserve space, the filesystem can optionally avoid storing +### duplicate representations. This comes at a slight cost in +### performance, as maintaining a database of shared representations can +### increase commit times. The space savings are dependent upon the size +### of the repository, the number of objects it contains and the amount of +### duplication between them, usually a function of the branching and +### merging process. +### +### The following parameter enables rep-sharing in the repository. It can +### be switched on and off at will, but for best space-saving results +### should be enabled consistently over the life of the repository. +### 'svnadmin verify' will check the rep-cache regardless of this setting. +### rep-sharing is enabled by default. +# enable-rep-sharing = true + +[deltification] +### To conserve space, the filesystem stores data as differences against +### existing representations. This comes at a slight cost in performance, +### as calculating differences can increase commit times. Reading data +### will also create higher CPU load and the data will be fragmented. +### Since deltification tends to save significant amounts of disk space, +### the overall I/O load can actually be lower. +### +### The options in this section allow for tuning the deltification +### strategy. Their effects on data size and server performance may vary +### from one repository to another. Versions prior to 1.8 will ignore +### this section. +### +### The following parameter enables deltification for directories. It can +### be switched on and off at will, but for best space-saving results +### should be enabled consistently over the lifetime of the repository. +### Repositories containing large directories will benefit greatly. +### In rarely accessed repositories, the I/O overhead may be significant +### as caches will most likely be low. +### directory deltification is enabled by default. +# enable-dir-deltification = true +### +### The following parameter enables deltification for properties on files +### and directories. Overall, this is a minor tuning option but can save +### some disk space if you merge frequently or frequently change node +### properties. You should not activate this if rep-sharing has been +### disabled because this may result in a net increase in repository size. +### property deltification is enabled by default. +# enable-props-deltification = true +### +### During commit, the server may need to walk the whole change history of +### of a given node to find a suitable deltification base. This linear +### process can impact commit times, svnadmin load and similar operations. +### This setting limits the depth of the deltification history. If the +### threshold has been reached, the node will be stored as fulltext and a +### new deltification history begins. +### Note, this is unrelated to svn log. +### Very large values rarely provide significant additional savings but +### can impact performance greatly - in particular if directory +### deltification has been activated. Very small values may be useful in +### repositories that are dominated by large, changing binaries. +### Should be a power of two minus 1. A value of 0 will effectively +### disable deltification. +### For 1.8, the default value is 1023; earlier versions have no limit. +# max-deltification-walk = 1023 +### +### The skip-delta scheme used by FSFS tends to repeatably store redundant +### delta information where a simple delta against the latest version is +### often smaller. By default, 1.8+ will therefore use skip deltas only +### after the linear chain of deltas has grown beyond the threshold +### specified by this setting. +### Values up to 64 can result in some reduction in repository size for +### the cost of quickly increasing I/O and CPU costs. Similarly, smaller +### numbers can reduce those costs at the cost of more disk space. For +### rarely read repositories or those containing larger binaries, this may +### present a better trade-off. +### Should be a power of two. A value of 1 or smaller will cause the +### exclusive use of skip-deltas (as in pre-1.8). +### For 1.8, the default value is 16; earlier versions use 1. +# max-linear-deltification = 16 +### +### After deltification, we compress the data to minimize on-disk size. +### This setting controls the compression algorithm, which will be used in +### future revisions. It can be used to either disable compression or to +### select between available algorithms (zlib, lz4). zlib is a general- +### purpose compression algorithm. lz4 is a fast compression algorithm +### which should be preferred for repositories with large and, possibly, +### incompressible files. Note that the compression ratio of lz4 is +### usually lower than the one provided by zlib, but using it can +### significantly speed up commits as well as reading the data. +### lz4 compression algorithm is supported, starting from format 8 +### repositories, available in Subversion 1.10 and higher. +### The syntax of this option is: +### compression = none | lz4 | zlib | zlib-1 ... zlib-9 +### Versions prior to Subversion 1.10 will ignore this option. +### The default value is 'lz4' if supported by the repository format and +### 'zlib' otherwise. 'zlib' is currently equivalent to 'zlib-5'. +# compression = lz4 +### +### DEPRECATED: The new 'compression' option deprecates previously used +### 'compression-level' option, which was used to configure zlib compression. +### For compatibility with previous versions of Subversion, this option can +### still be used (and it will result in zlib compression with the +### corresponding compression level). +### compression-level = 0 ... 9 (default is 5) + +[packed-revprops] +### This parameter controls the size (in kBytes) of packed revprop files. +### Revprops of consecutive revisions will be concatenated into a single +### file up to but not exceeding the threshold given here. However, each +### pack file may be much smaller and revprops of a single revision may be +### much larger than the limit set here. The threshold will be applied +### before optional compression takes place. +### Large values will reduce disk space usage at the expense of increased +### latency and CPU usage reading and changing individual revprops. +### Values smaller than 4 kByte will not improve latency any further and +### quickly render revprop packing ineffective. +### revprop-pack-size is 16 kBytes by default for non-compressed revprop +### pack files and 64 kBytes when compression has been enabled. +# revprop-pack-size = 16 +### +### To save disk space, packed revprop files may be compressed. Standard +### revprops tend to allow for very effective compression. Reading and +### even more so writing, become significantly more CPU intensive. +### Compressing packed revprops is disabled by default. +# compress-packed-revprops = false + +[io] +### Parameters in this section control the data access granularity in +### format 7 repositories and later. The defaults should translate into +### decent performance over a wide range of setups. +### +### When a specific piece of information needs to be read from disk, a +### data block is being read at once and its contents are being cached. +### If the repository is being stored on a RAID, the block size should be +### either 50% or 100% of RAID block size / granularity. Also, your file +### system blocks/clusters should be properly aligned and sized. In that +### setup, each access will hit only one disk (minimizes I/O load) but +### uses all the data provided by the disk in a single access. +### For SSD-based storage systems, slightly lower values around 16 kB +### may improve latency while still maximizing throughput. If block-read +### has not been enabled, this will be capped to 4 kBytes. +### Can be changed at any time but must be a power of 2. +### block-size is given in kBytes and with a default of 64 kBytes. +# block-size = 64 +### +### The log-to-phys index maps data item numbers to offsets within the +### rev or pack file. This index is organized in pages of a fixed maximum +### capacity. To access an item, the page table and the respective page +### must be read. +### This parameter only affects revisions with thousands of changed paths. +### If you have several extremely large revisions (~1 mio changes), think +### about increasing this setting. Reducing the value will rarely result +### in a net speedup. +### This is an expert setting. Must be a power of 2. +### l2p-page-size is 8192 entries by default. +# l2p-page-size = 8192 +### +### The phys-to-log index maps positions within the rev or pack file to +### to data items, i.e. describes what piece of information is being +### stored at any particular offset. The index describes the rev file +### in chunks (pages) and keeps a global list of all those pages. Large +### pages mean a shorter page table but a larger per-page description of +### data items in it. The latency sweetspot depends on the change size +### distribution but covers a relatively wide range. +### If the repository contains very large files, i.e. individual changes +### of tens of MB each, increasing the page size will shorten the index +### file at the expense of a slightly increased latency in sections with +### smaller changes. +### For source code repositories, this should be about 16x the block-size. +### Must be a power of 2. +### p2l-page-size is given in kBytes and with a default of 1024 kBytes. +# p2l-page-size = 1024 + +[debug] +### +### Whether to verify each new revision immediately before finalizing +### the commit. This is disabled by default except in maintainer-mode +### builds. +# verify-before-commit = false diff --git a/test/repos/simple-ext.svn/db/min-unpacked-rev b/test/repos/simple-ext.svn/db/min-unpacked-rev new file mode 100644 index 0000000000..573541ac97 --- /dev/null +++ b/test/repos/simple-ext.svn/db/min-unpacked-rev @@ -0,0 +1 @@ +0 diff --git a/test/repos/simple-ext.svn/db/rep-cache.db b/test/repos/simple-ext.svn/db/rep-cache.db new file mode 100644 index 0000000000000000000000000000000000000000..3193b2eaad046fba3704b0d28a50a68a94801da2 GIT binary patch literal 8192 zcmeIuK}!Nb6bJAbjiM;*RyW_VAR=4M^_JC;OPgEUhQTy(n&njm5*>#d|ehiI!uT zo%TC>#d3w1Jtzo300Izz00bZa0SG_<0uX?}pA`5U@~wkvm49vLDta+zt1RRiHZQ=L;CU@@4?#yhXLbg~~mc>fT`3nX?Ls&t(q_@;kd&|6q zPmnj!N-"j%`;)7F<&!^&p5-&NVNc`P`LVZ4M1vhI123LfW679Jk&yS}h4J?+gU zS3MZfY8^$e`Aiw@d{Ry%1dI`+SBZs%>uw7^VT{$-o>k4Xyk=x|K`9*$$d+#CX^Zv$ zf4Az(2{}^ad;78;-W-sx-=Fn>9+LNu&)3o0-}x~i0yI}C8O(!53mF)Lc9yx|g^G|c ej~cmPzoZI_YZ6{Gdr_88^Nk1hnf(AO7WJ=&dj!fDn0uL2;xcFgCGi};7P%MLA>_hL1!bWwMgk<=JI{-``-8Sx~2ler?X@>qvZhS z>jPT>)6KB%uk~`LVLed!QU%IMrh0nGt~zC~p7r~M2xW}B&Vh{`_(=}ATKsQ!Fzyy7 zc4uq7<>SMvwZ?-a) z)0B>oW87dZf4*6*J;dJdmgjkw&ZC`k2j2VA6K~^ji#5jLtJ2Wv5xP@BFE&4IU%WYq zems5i{p{Q%din14uL~NZ-LD^~H)6E)d2he;%)5-9fBCR^<=fA>YX}J*yI_JaqN6CX rO2(X~(lQ>UT$426lExq+3DoM8C~b*QiI&DOO{6l~rdCtJNj(1>+FjA$ literal 0 HcmV?d00001 diff --git a/test/repos/simple-ext.svn/db/revs/0/2 b/test/repos/simple-ext.svn/db/revs/0/2 new file mode 100644 index 0000000000000000000000000000000000000000..99a14cf4b7f76ee26eba753930dd53704627e1f5 GIT binary patch literal 816 zcmZvZJ!lj`6vt;bpA3nm2sW<~jBwfc+L_sFOu`))jUhw{0gGh577vfyac(dHi+~?R zh?R}CT|}_e+9r*qV5N;MStC{G3)m;lNk zCm~lv(?C<68Ar-%YL%o`uYzC#rkyZdVR9kD9Q-!%}%S;O#unUwLYMU_)@exaSbTJeGis^rnsBF zpQ$A6r{xuTL@SSJeWQcholp+qxI~k*M^FFKr;u_G6ohjsvpQAEc$GQHnKxDmExDoA zqy#EZIZ5|4d3k=%Gb>dAc}$Wl&XYP%bKGo< zTmjWejYqZH7n7Q%0^8yGT2lbUjl12Rz=7w$2rz4bdULXUmfC*4ic;URV zT5%(!r#bby^on`qSY{66?ef&aVF)RMbPpw2dC8>a+6zOarB*P`g_V_4QdROm3)2?cKX5He8X8kD zRTa09dUI>+4($Ie?{8&&x)?7E=6hH1%;vc$isp`@N5_6ekGpR>52FX2McUt&KhAE3 z8yY={3bg&={dRN#qtCB?emH(VI)R>Tecg&qWAyFm%XhPPH2SpjWe4}>(DxsApLgH< zK6?@&t~A)(Gf_HKN~e|J&g9-2E__xI=82{tXa=RNLR*{|XCxC^W?VX{y(YOLf>dnb E4; /dev/null || exit 1 + +# Check that the author of this commit has the rights to perform +# the commit on the files and directories being modified. +commit-access-control.pl "$REPOS" "$TXN" commit-access-control.cfg || exit 1 + +# All checks passed, so allow the commit. +exit 0 diff --git a/test/repos/simple-ext.svn/hooks/pre-lock.tmpl b/test/repos/simple-ext.svn/hooks/pre-lock.tmpl new file mode 100755 index 0000000000..148582a689 --- /dev/null +++ b/test/repos/simple-ext.svn/hooks/pre-lock.tmpl @@ -0,0 +1,95 @@ +#!/bin/sh + +# PRE-LOCK HOOK +# +# The pre-lock hook is invoked before an exclusive lock is +# created. Subversion runs this hook by invoking a program +# (script, executable, binary, etc.) named 'pre-lock' (for which +# this file is a template), with the following ordered arguments: +# +# [1] REPOS-PATH (the path to this repository) +# [2] PATH (the path in the repository about to be locked) +# [3] USER (the user creating the lock) +# [4] COMMENT (the comment of the lock) +# [5] STEAL-LOCK (1 if the user is trying to steal the lock, else 0) +# +# If the hook program outputs anything on stdout, the output string will +# be used as the lock token for this lock operation. If you choose to use +# this feature, you must guarantee the tokens generated are unique across +# the repository each time. +# +# If the hook program exits with success, the lock is created; but +# if it exits with failure (non-zero), the lock action is aborted +# and STDERR is returned to the client. +# +# The default working directory for the invocation is undefined, so +# the program should set one explicitly if it cares. +# +# On a Unix system, the normal procedure is to have 'pre-lock' +# invoke other programs to do the real work, though it may do the +# work itself too. +# +# Note that 'pre-lock' must be executable by the user(s) who will +# invoke it (typically the user httpd runs as), and that user must +# have filesystem-level permission to access the repository. +# +# On a Windows system, you should name the hook program +# 'pre-lock.bat' or 'pre-lock.exe', +# but the basic idea is the same. +# +# The hook program runs in an empty environment, unless the server is +# explicitly configured otherwise. For example, a common problem is for +# the PATH environment variable to not be set to its usual value, so +# that subprograms fail to launch unless invoked via absolute path. +# If you're having unexpected problems with a hook program, the +# culprit may be unusual (or missing) environment variables. +# +# CAUTION: +# For security reasons, you MUST always properly quote arguments when +# you use them, as those arguments could contain whitespace or other +# problematic characters. Additionally, you should delimit the list +# of options with "--" before passing the arguments, so malicious +# clients cannot bootleg unexpected options to the commands your +# script aims to execute. +# For similar reasons, you should also add a trailing @ to URLs which +# are passed to SVN commands accepting URLs with peg revisions. +# +# Here is an example hook script, for a Unix /bin/sh interpreter. +# For more examples and pre-written hooks, see those in +# the Subversion repository at +# http://svn.apache.org/repos/asf/subversion/trunk/tools/hook-scripts/ and +# http://svn.apache.org/repos/asf/subversion/trunk/contrib/hook-scripts/ + + +REPOS="$1" +PATH="$2" +USER="$3" +COMMENT="$4" +STEAL="$5" + +# If a lock exists and is owned by a different person, don't allow it +# to be stolen (e.g., with 'svn lock --force ...'). + +# (Maybe this script could send email to the lock owner?) +SVNLOOK=/opt/homebrew/Cellar/subversion/1.14.2_1/bin/svnlook +GREP=/bin/grep +SED=/bin/sed + +LOCK_OWNER=`$SVNLOOK lock "$REPOS" "$PATH" | \ + $GREP '^Owner: ' | $SED 's/Owner: //'` + +# If we get no result from svnlook, there's no lock, allow the lock to +# happen: +if [ "$LOCK_OWNER" = "" ]; then + exit 0 +fi + +# If the person locking matches the lock's owner, allow the lock to +# happen: +if [ "$LOCK_OWNER" = "$USER" ]; then + exit 0 +fi + +# Otherwise, we've got an owner mismatch, so return failure: +echo "Error: $PATH already locked by ${LOCK_OWNER}." 1>&2 +exit 1 diff --git a/test/repos/simple-ext.svn/hooks/pre-revprop-change.tmpl b/test/repos/simple-ext.svn/hooks/pre-revprop-change.tmpl new file mode 100755 index 0000000000..8b065d7c79 --- /dev/null +++ b/test/repos/simple-ext.svn/hooks/pre-revprop-change.tmpl @@ -0,0 +1,79 @@ +#!/bin/sh + +# PRE-REVPROP-CHANGE HOOK +# +# The pre-revprop-change hook is invoked before a revision property +# is added, modified or deleted. Subversion runs this hook by invoking +# a program (script, executable, binary, etc.) named 'pre-revprop-change' +# (for which this file is a template), with the following ordered +# arguments: +# +# [1] REPOS-PATH (the path to this repository) +# [2] REV (the revision being tweaked) +# [3] USER (the username of the person tweaking the property) +# [4] PROPNAME (the property being set on the revision) +# [5] ACTION (the property is being 'A'dded, 'M'odified, or 'D'eleted) +# +# [STDIN] PROPVAL ** the new property value is passed via STDIN. +# +# If the hook program exits with success, the propchange happens; but +# if it exits with failure (non-zero), the propchange doesn't happen. +# The hook program can use the 'svnlook' utility to examine the +# existing value of the revision property. +# +# WARNING: unlike other hooks, this hook MUST exist for revision +# properties to be changed. If the hook does not exist, Subversion +# will behave as if the hook were present, but failed. The reason +# for this is that revision properties are UNVERSIONED, meaning that +# a successful propchange is destructive; the old value is gone +# forever. We recommend the hook back up the old value somewhere. +# +# The default working directory for the invocation is undefined, so +# the program should set one explicitly if it cares. +# +# On a Unix system, the normal procedure is to have 'pre-revprop-change' +# invoke other programs to do the real work, though it may do the +# work itself too. +# +# Note that 'pre-revprop-change' must be executable by the user(s) who will +# invoke it (typically the user httpd runs as), and that user must +# have filesystem-level permission to access the repository. +# +# On a Windows system, you should name the hook program +# 'pre-revprop-change.bat' or 'pre-revprop-change.exe', +# but the basic idea is the same. +# +# The hook program runs in an empty environment, unless the server is +# explicitly configured otherwise. For example, a common problem is for +# the PATH environment variable to not be set to its usual value, so +# that subprograms fail to launch unless invoked via absolute path. +# If you're having unexpected problems with a hook program, the +# culprit may be unusual (or missing) environment variables. +# +# CAUTION: +# For security reasons, you MUST always properly quote arguments when +# you use them, as those arguments could contain whitespace or other +# problematic characters. Additionally, you should delimit the list +# of options with "--" before passing the arguments, so malicious +# clients cannot bootleg unexpected options to the commands your +# script aims to execute. +# For similar reasons, you should also add a trailing @ to URLs which +# are passed to SVN commands accepting URLs with peg revisions. +# +# Here is an example hook script, for a Unix /bin/sh interpreter. +# For more examples and pre-written hooks, see those in +# the Subversion repository at +# http://svn.apache.org/repos/asf/subversion/trunk/tools/hook-scripts/ and +# http://svn.apache.org/repos/asf/subversion/trunk/contrib/hook-scripts/ + + +REPOS="$1" +REV="$2" +USER="$3" +PROPNAME="$4" +ACTION="$5" + +if [ "$ACTION" = "M" -a "$PROPNAME" = "svn:log" ]; then exit 0; fi + +echo "Changing revision properties other than svn:log is prohibited" >&2 +exit 1 diff --git a/test/repos/simple-ext.svn/hooks/pre-unlock.tmpl b/test/repos/simple-ext.svn/hooks/pre-unlock.tmpl new file mode 100755 index 0000000000..9ba99d071b --- /dev/null +++ b/test/repos/simple-ext.svn/hooks/pre-unlock.tmpl @@ -0,0 +1,87 @@ +#!/bin/sh + +# PRE-UNLOCK HOOK +# +# The pre-unlock hook is invoked before an exclusive lock is +# destroyed. Subversion runs this hook by invoking a program +# (script, executable, binary, etc.) named 'pre-unlock' (for which +# this file is a template), with the following ordered arguments: +# +# [1] REPOS-PATH (the path to this repository) +# [2] PATH (the path in the repository about to be unlocked) +# [3] USER (the user destroying the lock) +# [4] TOKEN (the lock token to be destroyed) +# [5] BREAK-UNLOCK (1 if the user is breaking the lock, else 0) +# +# If the hook program exits with success, the lock is destroyed; but +# if it exits with failure (non-zero), the unlock action is aborted +# and STDERR is returned to the client. +# +# The default working directory for the invocation is undefined, so +# the program should set one explicitly if it cares. +# +# On a Unix system, the normal procedure is to have 'pre-unlock' +# invoke other programs to do the real work, though it may do the +# work itself too. +# +# Note that 'pre-unlock' must be executable by the user(s) who will +# invoke it (typically the user httpd runs as), and that user must +# have filesystem-level permission to access the repository. +# +# On a Windows system, you should name the hook program +# 'pre-unlock.bat' or 'pre-unlock.exe', +# but the basic idea is the same. +# +# The hook program runs in an empty environment, unless the server is +# explicitly configured otherwise. For example, a common problem is for +# the PATH environment variable to not be set to its usual value, so +# that subprograms fail to launch unless invoked via absolute path. +# If you're having unexpected problems with a hook program, the +# culprit may be unusual (or missing) environment variables. +# +# CAUTION: +# For security reasons, you MUST always properly quote arguments when +# you use them, as those arguments could contain whitespace or other +# problematic characters. Additionally, you should delimit the list +# of options with "--" before passing the arguments, so malicious +# clients cannot bootleg unexpected options to the commands your +# script aims to execute. +# For similar reasons, you should also add a trailing @ to URLs which +# are passed to SVN commands accepting URLs with peg revisions. +# +# Here is an example hook script, for a Unix /bin/sh interpreter. +# For more examples and pre-written hooks, see those in +# the Subversion repository at +# http://svn.apache.org/repos/asf/subversion/trunk/tools/hook-scripts/ and +# http://svn.apache.org/repos/asf/subversion/trunk/contrib/hook-scripts/ + + +REPOS="$1" +PATH="$2" +USER="$3" +TOKEN="$4" +BREAK="$5" + +# If a lock is owned by a different person, don't allow it be broken. +# (Maybe this script could send email to the lock owner?) + +SVNLOOK=/opt/homebrew/Cellar/subversion/1.14.2_1/bin/svnlook +GREP=/bin/grep +SED=/bin/sed + +LOCK_OWNER=`$SVNLOOK lock "$REPOS" "$PATH" | \ + $GREP '^Owner: ' | $SED 's/Owner: //'` + +# If we get no result from svnlook, there's no lock, return success: +if [ "$LOCK_OWNER" = "" ]; then + exit 0 +fi + +# If the person unlocking matches the lock's owner, return success: +if [ "$LOCK_OWNER" = "$USER" ]; then + exit 0 +fi + +# Otherwise, we've got an owner mismatch, so return failure: +echo "Error: $PATH locked by ${LOCK_OWNER}." 1>&2 +exit 1 diff --git a/test/repos/simple-ext.svn/hooks/start-commit.tmpl b/test/repos/simple-ext.svn/hooks/start-commit.tmpl new file mode 100755 index 0000000000..1395e8315a --- /dev/null +++ b/test/repos/simple-ext.svn/hooks/start-commit.tmpl @@ -0,0 +1,81 @@ +#!/bin/sh + +# START-COMMIT HOOK +# +# The start-commit hook is invoked immediately after a Subversion txn is +# created and populated with initial revprops in the process of doing a +# commit. Subversion runs this hook by invoking a program (script, +# executable, binary, etc.) named 'start-commit' (for which this file +# is a template) with the following ordered arguments: +# +# [1] REPOS-PATH (the path to this repository) +# [2] USER (the authenticated user attempting to commit) +# [3] CAPABILITIES (a colon-separated list of capabilities reported +# by the client; see note below) +# [4] TXN-NAME (the name of the commit txn just created) +# +# Note: The CAPABILITIES parameter is new in Subversion 1.5, and 1.5 +# clients will typically report at least the "mergeinfo" capability. +# If there are other capabilities, then the list is colon-separated, +# e.g.: "mergeinfo:some-other-capability" (the order is undefined). +# +# The list is self-reported by the client. Therefore, you should not +# make security assumptions based on the capabilities list, nor should +# you assume that clients reliably report every capability they have. +# +# Note: The TXN-NAME parameter is new in Subversion 1.8. Prior to version +# 1.8, the start-commit hook was invoked before the commit txn was even +# created, so the ability to inspect the commit txn and its metadata from +# within the start-commit hook was not possible. +# +# If the hook program exits with success, the commit continues; but +# if it exits with failure (non-zero), the commit is stopped before +# a Subversion txn is created, and STDERR is returned to the client. +# +# The default working directory for the invocation is undefined, so +# the program should set one explicitly if it cares. +# +# On a Unix system, the normal procedure is to have 'start-commit' +# invoke other programs to do the real work, though it may do the +# work itself too. +# +# Note that 'start-commit' must be executable by the user(s) who will +# invoke it (typically the user httpd runs as), and that user must +# have filesystem-level permission to access the repository. +# +# On a Windows system, you should name the hook program +# 'start-commit.bat' or 'start-commit.exe', +# but the basic idea is the same. +# +# The hook program runs in an empty environment, unless the server is +# explicitly configured otherwise. For example, a common problem is for +# the PATH environment variable to not be set to its usual value, so +# that subprograms fail to launch unless invoked via absolute path. +# If you're having unexpected problems with a hook program, the +# culprit may be unusual (or missing) environment variables. +# +# CAUTION: +# For security reasons, you MUST always properly quote arguments when +# you use them, as those arguments could contain whitespace or other +# problematic characters. Additionally, you should delimit the list +# of options with "--" before passing the arguments, so malicious +# clients cannot bootleg unexpected options to the commands your +# script aims to execute. +# For similar reasons, you should also add a trailing @ to URLs which +# are passed to SVN commands accepting URLs with peg revisions. +# +# Here is an example hook script, for a Unix /bin/sh interpreter. +# For more examples and pre-written hooks, see those in +# the Subversion repository at +# http://svn.apache.org/repos/asf/subversion/trunk/tools/hook-scripts/ and +# http://svn.apache.org/repos/asf/subversion/trunk/contrib/hook-scripts/ + + +REPOS="$1" +USER="$2" + +commit-allower.pl --repository "$REPOS" --user "$USER" || exit 1 +special-auth-check.py --user "$USER" --auth-level 3 || exit 1 + +# All checks passed, so allow the commit. +exit 0 diff --git a/test/repos/simple-ext.svn/locks/db-logs.lock b/test/repos/simple-ext.svn/locks/db-logs.lock new file mode 100644 index 0000000000..20dd6369be --- /dev/null +++ b/test/repos/simple-ext.svn/locks/db-logs.lock @@ -0,0 +1,3 @@ +This file is not used by Subversion 1.3.x or later. +However, its existence is required for compatibility with +Subversion 1.2.x or earlier. diff --git a/test/repos/simple-ext.svn/locks/db.lock b/test/repos/simple-ext.svn/locks/db.lock new file mode 100644 index 0000000000..20dd6369be --- /dev/null +++ b/test/repos/simple-ext.svn/locks/db.lock @@ -0,0 +1,3 @@ +This file is not used by Subversion 1.3.x or later. +However, its existence is required for compatibility with +Subversion 1.2.x or earlier. diff --git a/test/test_sys_checkout.py b/test/test_sys_checkout.py old mode 100644 new mode 100755 index ab4f77e88f..664160dc99 --- a/test/test_sys_checkout.py +++ b/test/test_sys_checkout.py @@ -97,6 +97,7 @@ SIMPLE_REPO = 'simple-ext.git' # Child repo SIMPLE_FORK_REPO = 'simple-ext-fork.git' # Child repo MIXED_REPO = 'mixed-cont-ext.git' # Both parent and child +SVN_TEST_REPO = 'simple-ext.svn' # Subversion repository # Standard (arbitrary) external names for test configs TAG_SECTION = 'simp_tag' @@ -120,8 +121,6 @@ # Branch that exists in both the simple and simple-fork repos. REMOTE_BRANCH_FEATURE2 = 'feature2' -SVN_TEST_REPO = 'https://github.com/escomp/cesm' - # Disable too-many-public-methods error # pylint: disable=R0904 @@ -354,7 +353,7 @@ def create_section_reference_to_subexternal(self, name): self._config.set(name, ExternalsDescription.EXTERNALS, CFG_SUB_NAME) - def create_svn_external(self, name, tag='', branch=''): + def create_svn_external(self, name, url, tag='', branch=''): """Create a config section for an svn repository. """ @@ -365,7 +364,7 @@ def create_svn_external(self, name, tag='', branch=''): self._config.set(name, ExternalsDescription.PROTOCOL, ExternalsDescription.PROTOCOL_SVN) - self._config.set(name, ExternalsDescription.REPO_URL, SVN_TEST_REPO) + self._config.set(name, ExternalsDescription.REPO_URL, url) self._config.set(name, ExternalsDescription.REQUIRED, str(True)) @@ -1387,36 +1386,10 @@ def test_container_sparse(self): 'simple_subdir', 'subdir_file.txt')) - class TestSysCheckoutSVN(BaseTestSysCheckout): """Run systems level tests of checkout_externals accessing svn repositories - SVN tests - these tests use the svn repository interface. Since - they require an active network connection, they are significantly - slower than the git tests. But svn testing is critical. So try to - design the tests to only test svn repository functionality - (checkout, switch) and leave generic testing of functionality like - 'optional' to the fast git tests. - - Example timing as of 2017-11: - - * All other git and unit tests combined take between 4-5 seconds - - * Just checking if svn is available for a single test takes 2 seconds. - - * The single svn test typically takes between 10 and 25 seconds - (depending on the network)! - - NOTE(bja, 2017-11) To enable CI testing we can't use a real remote - repository that restricts access and it seems inappropriate to hit - a random open source repo. For now we are just hitting one of our - own github repos using the github svn server interface. This - should be "good enough" for basic checkout and swich - functionality. But if additional svn functionality is required, a - better solution will be necessary. I think eventually we want to - create a small local svn repository on the fly (doesn't require an - svn server or network connection!) and use it for testing. - + SVN tests - these tests use the svn repository interface. """ @staticmethod @@ -1427,6 +1400,9 @@ def _svn_branch_name(): def _svn_tag_name(): return './{0}/svn_tag'.format(EXTERNALS_PATH) + def _svn_test_repo_url(self): + return 'file://' + os.path.join(self._bare_root, SVN_TEST_REPO) + def _check_tag_branch_svn_tag_clean(self, tree): self._check_sync_clean(tree[self._external_path(TAG_SECTION)], ExternalStatus.STATUS_OK, @@ -1438,13 +1414,12 @@ def _check_tag_branch_svn_tag_clean(self, tree): ExternalStatus.STATUS_OK, ExternalStatus.STATUS_OK) - @staticmethod - def _have_svn_access(): + def _have_svn_access(self): """Check if we have svn access so we can enable tests that use svn. """ have_svn = False - cmd = ['svn', 'ls', SVN_TEST_REPO, ] + cmd = ['svn', 'ls', self._svn_test_repo_url(), ] try: execute_subprocess(cmd) have_svn = True @@ -1472,8 +1447,8 @@ def test_container_simple_svn(self): self._generator.create_section(SIMPLE_REPO, TAG_SECTION, tag='tag1') # Svn repos. - self._generator.create_svn_external('svn_branch', branch='trunk') - self._generator.create_svn_external('svn_tag', tag='tags/cesm2.0.beta07') + self._generator.create_svn_external('svn_branch', self._svn_test_repo_url(), branch='trunk') + self._generator.create_svn_external('svn_tag', self._svn_test_repo_url(), tag='tags/cesm2.0.beta07') self._generator.write_config(cloned_repo_dir) @@ -1557,7 +1532,7 @@ def setUp(self): execute_subprocess(cmd) cmd = ['git', 'checkout', self._bare_branch_name] execute_subprocess(cmd) - cmd = ['git', 'submodule', 'add', fork_repo_dir] + cmd = ['git', '-c', 'protocol.file.allow=always','submodule', 'add', fork_repo_dir] execute_subprocess(cmd) cmd = ['git', 'commit', '-am', "'Added simple-ext-fork as a submodule'"] execute_subprocess(cmd) @@ -1571,7 +1546,7 @@ def setUp(self): execute_subprocess(cmd) cmd = ['git', 'checkout', self._config_branch_name] execute_subprocess(cmd) - cmd = ['git', 'submodule', 'add', '--name', SIMPLE_REPO, + cmd = ['git', '-c', 'protocol.file.allow=always', 'submodule', 'add', '--name', SIMPLE_REPO, simple_repo_dir, self._simple_ext_name] execute_subprocess(cmd) # Checkout feature2 From c4e14d165f90ac3dab2ba8bb2b778459c6c7ceaa Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Fri, 26 Jan 2024 02:06:07 -0700 Subject: [PATCH 0060/1248] Update to cam version that no longer uses svn, but git --- Externals.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Externals.cfg b/Externals.cfg index d75b4683a6..4e65a11aed 100644 --- a/Externals.cfg +++ b/Externals.cfg @@ -49,7 +49,7 @@ externals = Externals.cfg required = True [cam6] -tag = cam6_3_133 +tag = cam6_3_135 protocol = git repo_url = https://github.com/ESCOMP/CAM local_path = components/cam From 6abcc1d26a1d858ae0a035ee36ffee10c6a7aa72 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Fri, 26 Jan 2024 14:46:17 -0700 Subject: [PATCH 0061/1248] Update assign-to-project.yml --- .github/workflows/assign-to-project.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/assign-to-project.yml b/.github/workflows/assign-to-project.yml index 8c6c259c33..a5bcd10b64 100644 --- a/.github/workflows/assign-to-project.yml +++ b/.github/workflows/assign-to-project.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest name: Assign to High Priority project steps: - - name: Assign issues and pull requests with `priority: high` label to project 25 + - name: Assign issues and pull requests with priority high label to project 25 uses: srggrs/assign-one-project-github-action@1.3.1 if: | contains(github.event.issue.labels.*.name, 'priority: high') || From 9902724bb64579cc0aa84b567f62682c1f1d24c7 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Fri, 9 Feb 2024 00:27:30 -0700 Subject: [PATCH 0062/1248] Move datasets to under inputdata --- 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 57f5b3adf4..28a372de32 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -2749,9 +2749,9 @@ use_crop=".true.">lnd/clm2/surfdata_map/ctsm5.1.dev052/landuse.timeseries_mpasa1 /glade/u/home/dleung/CESM2/ctsm_dustemis_dev/cdf5_Z0a_Prigent-Globe-025x025-01242023.nc +>lnd/clm2/dustemisdata/Prigent_2005_roughness_0.25x0.25_cdf5_c240127.nc /glade/u/home/dleung/CESM2/ctsm_dustemis_dev/lnd_mesh.nc +>lnd/clm2/dustemisdata/dust_2x2_ESMFmesh_cdf5_c230730.nc From 158c878451b3b0916657cf84c2f02dc262dc4b4c Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Fri, 9 Feb 2024 01:20:16 -0700 Subject: [PATCH 0063/1248] Remove whitespace at end of lines, remove commented out code included commented out Zender code, remove unneeded markers by Danny Leung --- src/biogeochem/DUSTMod.F90 | 84 ++++++++------------------------------ 1 file changed, 18 insertions(+), 66 deletions(-) diff --git a/src/biogeochem/DUSTMod.F90 b/src/biogeochem/DUSTMod.F90 index 39aa5766f4..67c22e207a 100644 --- a/src/biogeochem/DUSTMod.F90 +++ b/src/biogeochem/DUSTMod.F90 @@ -16,7 +16,7 @@ module DUSTMod use shr_log_mod , only : errMsg => shr_log_errMsg use shr_infnan_mod , only : nan => shr_infnan_nan, assignment(=) use clm_varpar , only : dst_src_nbr, ndst, sz_nbr, & - natpft_lb, natpft_ub, natpft_size + natpft_lb, natpft_ub, natpft_size use clm_varcon , only : grav, spval use landunit_varcon , only : istcrop, istsoil use clm_varctl , only : iulog @@ -31,7 +31,7 @@ module DUSTMod use LandunitType , only : lun use ColumnType , only : col use PatchType , only : patch - use pftconMod , only : noveg + use pftconMod , only : noveg use PrigentRoughnessStreamType , only : prigentroughnessstream_type ! ! !PUBLIC TYPES @@ -105,7 +105,7 @@ module DUSTMod subroutine Init(this, bounds, NLFilename) class(dust_type) :: this - type(bounds_type), intent(in) :: bounds + type(bounds_type), intent(in) :: bounds character(len=*), intent(in) :: NLFilename call this%InitAllocate (bounds) @@ -296,8 +296,8 @@ subroutine InitCold(this, bounds) ! ! ! !ARGUMENTS: - class(dust_type), intent(inout) :: this ! Danny M. Leung used class instead of type - type(bounds_type), intent(in) :: bounds + class(dust_type), intent(inout) :: this + type(bounds_type), intent(in) :: bounds ! ! !LOCAL VARIABLES: integer :: c,l @@ -340,7 +340,7 @@ subroutine DustEmission (bounds, & ! !USES use shr_const_mod, only : SHR_CONST_RHOFW use subgridaveMod, only : p2g - use pftconMod , only : noveg + use pftconMod , only : noveg ! ! !ARGUMENTS: type(bounds_type) , intent(in) :: bounds @@ -366,7 +366,6 @@ subroutine DustEmission (bounds, & real(r8) :: flx_mss_vrt_dst_ttl(bounds%begp:bounds%endp) real(r8) :: frc_thr_wet_fct real(r8) :: frc_thr_rgh_fct - !real(r8) :: wnd_frc_thr_slt ! Danny M. Leung commented and put below real(r8) :: wnd_rfr_thr_slt real(r8) :: wnd_frc_slt real(r8) :: lnd_frc_mbl(bounds%begp:bounds%endp) @@ -377,8 +376,10 @@ subroutine DustEmission (bounds, & real(r8) :: sumwt(bounds%begl:bounds%endl) ! sum of weights logical :: found ! temporary for error check integer :: index - - real(r8) :: tmp2 ! calculates the dry fluid threshold using Shao and Lu (2000) scheme; replace the tmp1 (Iversen and White, 1982) that was passed from Dustini to DustEmission; tmp2 will be calculated here + + real(r8) :: tmp2 ! calculates the dry fluid threshold using Shao and Lu (2000) scheme; + ! replace the tmp1 (Iversen and White, 1982) that was passed from Dustini to DustEmission; + ! tmp2 will be calculated here real(r8) :: wnd_frc_thr_slt_std ! [m/s] The soil threshold friction speed at standard air density (1.2250 kg/m3) real(r8) :: frag_expt ! fragmentation exponent real(r8) :: wnd_frc_thr_slt_it ! [m/s] created for impact threshold friction velocity @@ -430,7 +431,7 @@ subroutine DustEmission (bounds, & mbl_bsn_fct => dust_inst%mbl_bsn_fct_col , & ! Input: [real(r8) (:) ] basin factor flx_mss_vrt_dst => dust_inst%flx_mss_vrt_dst_patch , & ! Output: [real(r8) (:,:) ] surface dust emission (kg/m**2/s) flx_mss_vrt_dst_tot => dust_inst%flx_mss_vrt_dst_tot_patch , & ! Output: [real(r8) (:) ] total dust flux back to atmosphere (pft) - + dst_emiss_coeff => dust_inst%dst_emiss_coeff_patch , & ! Output dust emission coefficient wnd_frc_thr => dust_inst%wnd_frc_thr_patch , & ! output impact threshold wnd_frc_thr_dry => dust_inst%wnd_frc_thr_dry_patch , & ! output dry threshold @@ -594,7 +595,7 @@ subroutine DustEmission (bounds, & wnd_frc_thr_slt = tmp2 / sqrt(forc_rho(c)) * frc_thr_wet_fct !* frc_thr_rgh_fct ! fluid threshold wnd_frc_thr_slt_it = B_it * tmp2 / sqrt(forc_rho(c)) ! define impact threshold - !wnd_frc_thr_dry(p) = tmp1 / sqrt(forc_rho(c)) ! output dry fluid threshold; tmp1 uses I&W 1982 + !wnd_frc_thr_dry(p) = tmp1 / sqrt(forc_rho(c)) ! output dry fluid threshold; tmp1 uses I&W 1982 !wnd_frc_thr_slt = tmp1 / sqrt(forc_rho(c)) * frc_thr_wet_fct !* frc_thr_rgh_fct ! fluid threshold !wnd_frc_thr_slt_it = B_it * tmp1 / sqrt(forc_rho(c)) ! define impact threshold ! the above formula is true for Iversen and White (1982) and Shao and Lu (2000) scheme @@ -612,7 +613,7 @@ subroutine DustEmission (bounds, & end if !################ drag partition effect, and soil friction velocity ########################### - ! subsection on computing vegetation drag partition and hybrid drag partition factors + ! subsection on computing vegetation drag partition and hybrid drag partition factors ! in Leung et al. (2022), drag partition effect is applied on the wind instead of the threshold !############################################################################################## ! the following comes from subr. frc_thr_rgh_fct_get @@ -626,24 +627,18 @@ subroutine DustEmission (bounds, & lai(p) = 1_r8 ! setting LAI ~ 0.1 to be a min value (since the value goes to infinity when LAI=0) end if ! and 1 to be a max value as computing K involves 1 / LAI - ! calculate Okin's shear stress ratio (which is drag partition factor) using Pierre's equation + ! calculate Okin's shear stress ratio (which is drag partition factor) using Pierre's equation K_length = 2_r8 * (1_r8/lai(p) - 1_r8) ! Here LAI has to be non-zero to avoid blowup ssr(p) = (K_length+f_0*c_e)/(K_length+c_e) - ! dmleung added calculation of LUH2 bare vs veg fraction within a grid - !bare_frc = wt_lunit(g,istsoil) * wt_nat_patch(g,noveg) - !veg_frc = wt_lunit(g,istsoil) * sum(wt_nat_patch(g,(noveg+1):natpft_ub)) + wt_lunit(g,istcrop) - - !frc_thr_rgh_fct = (bare_frc*(roughfct(p))**3_r8 + veg_frc*(ssr(p))**3_r8 )**(0.3333_r8) ! land cover weighted mean using LUH2 land cover - ! calculation of drag partition effect using LUH2 bare and veg fractions within a grid if (lun%itype(l) == istsoil .or. lun%itype(l) == istcrop) then if (patch%itype(p) == noveg) then frc_thr_rgh_fct = dpfct_rock(p) - else + else frc_thr_rgh_fct = ssr(p) end if - else + else frc_thr_rgh_fct = 1.0_r8 end if @@ -658,30 +653,16 @@ subroutine DustEmission (bounds, & !########## end of drag partition effect ####################################################### - !############ comment out Owen's offect this block; dust emission does not need to consider it ########### - ! the following if-block comes from subr. wnd_frc_slt_get - ! purpose: compute the saltating friction velocity - ! theory: saltation roughens the boundary layer, AKA "Owen's effect" - - !if (u10(p) >= wnd_rfr_thr_slt) then - ! wnd_rfr_dlt = u10(p) - wnd_rfr_thr_slt - ! wnd_frc_slt_dlt = 0.003_r8 * wnd_rfr_dlt * wnd_rfr_dlt - ! wnd_frc_slt = wnd_frc_slt + wnd_frc_slt_dlt ! careful that RHS is now wnd_frc_slt instead of fv(p) - ! ! because wnd_frc_slt takes drag partition effect into account, but fv(p) doesn't. - !end if - !########## end of Owen effect ################################################################ - ! save soil friction velocity and roughness effect before the if-statement wnd_frc_soil(p) = wnd_frc_slt ! save soil friction velocity for CLM output, which has drag partition and Owen effect ! save land mobile fraction lnd_frc_mble(p) = lnd_frc_mbl(p) ! save land mobile fraction first, before the if-statement - ! only perform the following calculations if lnd_frc_mbl is non-zero + ! only perform the following calculations if lnd_frc_mbl is non-zero if (lnd_frc_mbl(p) > 0.0_r8) then ! if bare land fraction is larger than 0 then calculate the dust emission equation ! reset these variables which will be updated in the following if-block - !wnd_frc_slt = fv(p) ! we don't need this line because its calculation is moved upward flx_mss_hrz_slt_ttl = 0.0_r8 flx_mss_vrt_dst_ttl(p) = 0.0_r8 @@ -690,32 +671,11 @@ subroutine DustEmission (bounds, & wnd_rfr_thr_slt = u10(p) * wnd_frc_thr_slt / fv(p) ! keep and use if we want the default Z03 scheme - ! the following comes from subr. flx_mss_hrz_slt_ttl_Whi79_get ! purpose: compute vertically integrated streamwise mass flux of particles - !if (wnd_frc_slt > wnd_frc_thr_slt) then! if using Zender's scheme, use fluid threshold for dust emission equation below if (wnd_frc_slt > wnd_frc_thr_slt_it) then! if using Leung's scheme, use impact threshold for dust emission equation - !################### for Zender et al. (2003) scheme -dmleung ########################### - !################ uncomment the below block if want to use Z03 scheme ################### - !wnd_frc_rat = wnd_frc_thr_slt / wnd_frc_slt - !flx_mss_hrz_slt_ttl = cst_slt * forc_rho(c) * (wnd_frc_slt**3.0_r8) * & - ! (1.0_r8 - wnd_frc_rat) * (1.0_r8 + wnd_frc_rat) * (1.0_r8 + wnd_frc_rat) / grav ! Zender dust emission equation for emission flux - - ! the following loop originates from subr. dst_mbl - ! purpose: apply land sfc and veg limitations and global tuning factor - ! slevis: multiply flx_mss_hrz_slt_ttl by liqfrac to incude the effect - ! of frozen soil - - !flx_mss_hrz_slt_ttl = flx_mss_hrz_slt_ttl * lnd_frc_mbl(p) * mbl_bsn_fct(c) * & - ! flx_mss_fdg_fct * liqfrac - - ! - !dst_slt_flx_rat_ttl = 100.0_r8 * exp( log(10.0_r8) * (13.4_r8 * mss_frc_cly_vld(c) - 6.0_r8) ) - !flx_mss_vrt_dst_ttl(p) = flx_mss_hrz_slt_ttl * dst_slt_flx_rat_ttl - !######################################################################################## - !################### for Leung et al. (2022) ################################################ !################ uncomment the below block if want to use Leung's scheme ################### @@ -733,14 +693,6 @@ subroutine DustEmission (bounds, & ! mean lowpass-filtered wind speed at 0.1 m saltation height (assuming aerodynamic roughness length = 1e-4 m globally for ease; also assuming neutral condition) u_mean_slt(p) = (wnd_frc_slt/k) * log(0.1_r8 / 1e-4_r8) ! translating from ustar (velocity scale) to actual wind - ! sd of lowpass-filtered wind speed - !if (obul(p)==0) then - ! zetaobu = 0 - !else - !zetaobu = zii(p) / obul(p) ! For now zii is a constant of 1000 m in CLM -dml, 24 Aug 2021 - ! zetaobu = 1000_r8 / obul(p) ! For now zii is a constant of 1000 m in CLM -dml, 24 Aug 2021 - !end if - !stblty(p) = zetaobu ! zetaobu get outputted as the Obukhov stability parameter stblty(p) = 0 ! -dmleung 2 Dec 2021: use stability = 0 for now, assuming no buoyancy contribution. Might uncomment the above lines in future revisions. if ((12_r8 - 0.5_r8 * stblty(p)) .GE. 0.001_r8) then ! should have used 0 theoretically; used 0.001 here to avoid undefined values u_sd_slt(p) = wnd_frc_slt * (12_r8 - 0.5_r8 * stblty(p))**0.333_r8 @@ -775,7 +727,7 @@ subroutine DustEmission (bounds, & ! multiply dust emission flux by intermittency factor if (intrmtncy_fct(p) /= intrmtncy_fct(p)) then ! if intrmtncy_fct(p) is not NaN then multiply by intermittency factor; this statement is needed because dust emission flx_mss_vrt_dst_ttl(p) has to be non NaN (at least zero) to be outputted - flx_mss_vrt_dst_ttl(p) = flx_mss_vrt_dst_ttl(p) + flx_mss_vrt_dst_ttl(p) = flx_mss_vrt_dst_ttl(p) else flx_mss_vrt_dst_ttl(p) = flx_mss_vrt_dst_ttl(p) * intrmtncy_fct(p) ! multiply dust flux by intermittency end if From 1e6d8bee191777e6c1580080a1419ba07f5aa2dd Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Fri, 9 Feb 2024 01:22:53 -0700 Subject: [PATCH 0064/1248] Add use_prigent_roughness to determine if that streams dataset needs to be read in, this is important when we need to flip between Zender and Leung --- bld/CLMBuildNamelist.pm | 14 ++++++++++++-- bld/namelist_files/namelist_defaults_ctsm.xml | 1 + bld/namelist_files/namelist_definition_ctsm.xml | 5 +++++ bld/unit_testers/build-namelist_test.pl | 7 ++++++- 4 files changed, 24 insertions(+), 3 deletions(-) diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index 33299da345..7e9ae0e2d2 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -4575,9 +4575,19 @@ sub setup_logic_misc { #------------------------------------------------------------------------------- sub setup_logic_prigent_roughness { + # + # The Prigent roughness stream data set read in if needed + # my ($opts, $nl_flags, $definition, $defaults, $nl) = @_; - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_fldfilename_prigentroughness' ); - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_meshfile_prigentroughness' ); + my $var = "use_prigent_roughness"; + add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, $var ); + my $use_prigent = $nl->get_value($var); + if ( &value_is_true($use_prigent) ) { + add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_fldfilename_prigentroughness' ); + add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_meshfile_prigentroughness' ); + } else { + $log->fatal_error("variable \"$var\" MUST be true when Leung_2023 dust emission method is being used" ); + } } #------------------------------------------------------------------------------- diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index 28a372de32..a52477ce6c 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -2748,6 +2748,7 @@ use_crop=".true.">lnd/clm2/surfdata_map/ctsm5.1.dev052/landuse.timeseries_mpasa1 +.true. lnd/clm2/dustemisdata/Prigent_2005_roughness_0.25x0.25_cdf5_c240127.nc + +If TRUE use the Prigent roughness dataset + + Filename of input stream data for aeolian roughness length (from Prigent's roughness dataset) diff --git a/bld/unit_testers/build-namelist_test.pl b/bld/unit_testers/build-namelist_test.pl index 9b579dd9ce..e05e0857b7 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 = 1999; +my $ntests = 2000; if ( defined($opts{'compare'}) ) { $ntests += 1353; @@ -531,6 +531,11 @@ sub cat_and_create_namelistinfile { GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm4_5", }, + "LeungDust_WO_Prigent" =>{ options=>" -envxml_dir . -bgc sp", + namelst=>"use_prigent_roughness=.false.", + GLC_TWO_WAY_COUPLING=>"FALSE", + phys=>"clm5_1", + }, "soilm_stream off w file" =>{ options=>"-res 0.9x1.25 -envxml_dir .", namelst=>"use_soil_moisture_streams = .false.,stream_fldfilename_soilm='file_provided_when_off'", GLC_TWO_WAY_COUPLING=>"FALSE", From b9d118f4481e30fa056ac476100b4fbc9249e82a Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Fri, 9 Feb 2024 01:40:28 -0700 Subject: [PATCH 0065/1248] Remove more commented out code --- src/biogeochem/DUSTMod.F90 | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/biogeochem/DUSTMod.F90 b/src/biogeochem/DUSTMod.F90 index 67c22e207a..7a1bfcc092 100644 --- a/src/biogeochem/DUSTMod.F90 +++ b/src/biogeochem/DUSTMod.F90 @@ -595,9 +595,6 @@ subroutine DustEmission (bounds, & wnd_frc_thr_slt = tmp2 / sqrt(forc_rho(c)) * frc_thr_wet_fct !* frc_thr_rgh_fct ! fluid threshold wnd_frc_thr_slt_it = B_it * tmp2 / sqrt(forc_rho(c)) ! define impact threshold - !wnd_frc_thr_dry(p) = tmp1 / sqrt(forc_rho(c)) ! output dry fluid threshold; tmp1 uses I&W 1982 - !wnd_frc_thr_slt = tmp1 / sqrt(forc_rho(c)) * frc_thr_wet_fct !* frc_thr_rgh_fct ! fluid threshold - !wnd_frc_thr_slt_it = B_it * tmp1 / sqrt(forc_rho(c)) ! define impact threshold ! the above formula is true for Iversen and White (1982) and Shao and Lu (2000) scheme wnd_frc_thr(p) = wnd_frc_thr_slt ! output fluid threshold From 2d8a0cf52ff3918280e28672033415aaefc81c2a Mon Sep 17 00:00:00 2001 From: cathyxinchangli <55264121+cathyxinchangli@users.noreply.github.com> Date: Mon, 12 Feb 2024 18:17:23 -0600 Subject: [PATCH 0066/1248] Resolve comments on pull request 2275 to CTSM main Changes done: 1. Removed and modified comments as suggested 2. Changed `urban_explicit_ac` default under clm5_0 to .false. 3. Removed changes that are already/going to be on main (bugfix for view factor and number of urban layers) --- bld/CLMBuildNamelist.pm | 1 - bld/namelist_files/namelist_defaults_ctsm.xml | 6 +-- .../namelist_definition_ctsm.xml | 3 -- src/biogeophys/UrbBuildTempOleson2015Mod.F90 | 21 ++-------- src/biogeophys/UrbanParamsType.F90 | 6 --- src/cpl/share_esmf/UrbanTimeVarType.F90 | 42 +++++++------------ src/main/clm_varpar.F90 | 3 +- 7 files changed, 23 insertions(+), 59 deletions(-) diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index 0895a89ebb..0b9b161c20 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -2111,7 +2111,6 @@ sub setup_logic_urban { add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'building_temp_method'); add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'urban_hac'); - # X. Li [dev.04] 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'); } diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index a3f488b8f9..0d8e45a779 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -166,11 +166,9 @@ attributes from the config_cache.xml file (with keys converted to upper-case). FAST NONE - - - + .true. -.true. +.false. .false. diff --git a/bld/namelist_files/namelist_definition_ctsm.xml b/bld/namelist_files/namelist_definition_ctsm.xml index 5f89da9d29..8334b46d2a 100644 --- a/bld/namelist_files/namelist_definition_ctsm.xml +++ b/bld/namelist_files/namelist_definition_ctsm.xml @@ -947,9 +947,6 @@ Turn urban air conditioning/heating ON or OFF and add wasteheat: ON_WASTEHEAT = Air conditioning/heating is ON and waste-heat sent to urban canyon - - - If TRUE, use explicit, time-varying AC adoption rate for air-conditioning flux and interior building temperature calculations. diff --git a/src/biogeophys/UrbBuildTempOleson2015Mod.F90 b/src/biogeophys/UrbBuildTempOleson2015Mod.F90 index c07b1ad0e3..2e588e2e88 100644 --- a/src/biogeophys/UrbBuildTempOleson2015Mod.F90 +++ b/src/biogeophys/UrbBuildTempOleson2015Mod.F90 @@ -210,9 +210,6 @@ subroutine BuildingTemperature (bounds, num_urbanl, filter_urbanl, num_nolakec, use clm_varctl , only : iulog use abortutils , only : endrun use clm_varpar , only : nlevurb, nlevsno, nlevmaxurbgrnd - ! X. Li [orig]: - ! use UrbanParamsType , only : urban_hac, urban_hac_off, urban_hac_on, urban_wasteheat_on - ! X. Li [dev.04]: use UrbanParamsType , only : urban_hac, urban_hac_off, urban_hac_on, urban_wasteheat_on, urban_explicit_ac ! ! !ARGUMENTS: @@ -239,7 +236,6 @@ subroutine BuildingTemperature (bounds, num_urbanl, filter_urbanl, num_nolakec, real(r8) :: t_floor_bef(bounds%begl:bounds%endl) ! floor temperature at previous time step (K) real(r8) :: t_building_bef(bounds%begl:bounds%endl) ! internal building air temperature at previous time step [K] real(r8) :: t_building_bef_hac(bounds%begl:bounds%endl)! internal building air temperature before applying HAC [K] - ! X. Li [dev.03] real(r8) :: eflx_urban_ac_sat(bounds%begl:bounds%endl) ! urban air conditioning flux under AC adoption saturation (W/m**2) real(r8) :: hcv_roofi(bounds%begl:bounds%endl) ! roof convective heat transfer coefficient (W m-2 K-1) real(r8) :: hcv_sunwi(bounds%begl:bounds%endl) ! sunwall convective heat transfer coefficient (W m-2 K-1) @@ -329,7 +325,6 @@ subroutine BuildingTemperature (bounds, num_urbanl, filter_urbanl, num_nolakec, t_floor => temperature_inst%t_floor_lun , & ! InOut: [real(r8) (:)] floor temperature (K) t_building => temperature_inst%t_building_lun , & ! InOut: [real(r8) (:)] internal building air temperature (K) - ! X. Li [dev] p_ac => urbantv_inst%p_ac , & ! Input: [real(r8) (:)] air-conditioning penetration rate (-) t_building_max => urbantv_inst%t_building_max , & ! Input: [real(r8) (:)] maximum internal building air temperature (K) t_building_min => urbanparams_inst%t_building_min , & ! Input: [real(r8) (:)] minimum internal building air temperature (K) @@ -432,10 +427,7 @@ subroutine BuildingTemperature (bounds, num_urbanl, filter_urbanl, num_nolakec, vf_wf(l) = 0.5_r8*(1._r8 - vf_rf(l)) ! This view factor implicitly converts from per unit floor area to per unit wall area - ! X. Li [orig] - ! vf_fw(l) = vf_wf(l) / building_hwr(l) - ! X. Li [bugfix] - vf_fw(l) = vf_wf(l) + vf_fw(l) = vf_wf(l) / building_hwr(l) ! This view factor implicitly converts from per unit roof area to per unit wall area vf_rw(l) = vf_fw(l) @@ -841,10 +833,7 @@ subroutine BuildingTemperature (bounds, num_urbanl, filter_urbanl, num_nolakec, + em_floori(l)*sb*t_floor_bef(l)**4._r8 & + 4._r8*em_floori(l)*sb*t_floor_bef(l)**3.*(t_floor(l) - t_floor_bef(l)) - ! X. Li [orig] - ! qrd_building(l) = qrd_roof(l) + building_hwr(l)*(qrd_sunw(l) + qrd_shdw(l)) + qrd_floor(l) - ! X. Li [bugfix] - qrd_building(l) = qrd_roof(l) + qrd_sunw(l) + qrd_shdw(l) + qrd_floor(l) + qrd_building(l) = qrd_roof(l) + building_hwr(l)*(qrd_sunw(l) + qrd_shdw(l)) + qrd_floor(l) if (abs(qrd_building(l)) > .10_r8 ) then write (iulog,*) 'urban inside building net longwave radiation balance error ',qrd_building(l) @@ -936,16 +925,14 @@ subroutine BuildingTemperature (bounds, num_urbanl, filter_urbanl, num_nolakec, ! rho_dair(l) = pstd / (rair*t_building(l)) if (t_building_bef_hac(l) > t_building_max(l)) then - ! X. Li [dev.04] - if (urban_explicit_ac) then ! use explicit ac adoption rate: - ! X. Li [dev.03] ! after the change, t_building_max is saturation setpoint + if (urban_explicit_ac) then ! use explicit ac adoption rate parameterization scheme: + ! Here, t_building_max is the AC saturation setpoint eflx_urban_ac_sat(l) = wtlunit_roof(l) * abs( (ht_roof(l) * rho_dair(l) * cpair / dtime) * t_building_max(l) & - (ht_roof(l) * rho_dair(l) * cpair / dtime) * t_building_bef_hac(l) ) t_building(l) = t_building_max(l) + ( 1._r8 - p_ac(l) ) * eflx_urban_ac_sat(l) & * dtime / (ht_roof(l) * rho_dair(l) * cpair * wtlunit_roof(l)) eflx_urban_ac(l) = p_ac(l) * eflx_urban_ac_sat(l) else - ! X. Li [orig] t_building(l) = t_building_max(l) eflx_urban_ac(l) = wtlunit_roof(l) * abs( (ht_roof(l) * rho_dair(l) * cpair / dtime) * t_building(l) & - (ht_roof(l) * rho_dair(l) * cpair / dtime) * t_building_bef_hac(l) ) diff --git a/src/biogeophys/UrbanParamsType.F90 b/src/biogeophys/UrbanParamsType.F90 index 16da4b3ad0..4b7b80e4fe 100644 --- a/src/biogeophys/UrbanParamsType.F90 +++ b/src/biogeophys/UrbanParamsType.F90 @@ -101,7 +101,6 @@ module UrbanParamsType character(len= *), parameter, public :: urban_hac_on = 'ON' character(len= *), parameter, public :: urban_wasteheat_on = 'ON_WASTEHEAT' character(len= 16), public :: urban_hac = urban_hac_off - ! X. Li [dev.04] logical, public :: urban_explicit_ac = .true. ! whether to use explicit, time-varying AC adoption rate logical, public :: urban_traffic = .false. ! urban traffic fluxes @@ -849,9 +848,6 @@ subroutine UrbanReadNML ( NLFilename ) integer :: unitn ! unit for namelist file character(len=32) :: subname = 'UrbanReadNML' ! subroutine name - ! X. Li [orig]: - ! namelist / clmu_inparm / urban_hac, urban_traffic, building_temp_method - ! X. Li [dev.04]: namelist / clmu_inparm / urban_hac, urban_explicit_ac, urban_traffic, building_temp_method !EOP !----------------------------------------------------------------------- @@ -880,7 +876,6 @@ subroutine UrbanReadNML ( NLFilename ) ! Broadcast namelist variables read in call shr_mpi_bcast(urban_hac, mpicom) - ! X. Li [dev.04]: call shr_mpi_bcast(urban_explicit_ac, mpicom) call shr_mpi_bcast(urban_traffic, mpicom) call shr_mpi_bcast(building_temp_method, mpicom) @@ -893,7 +888,6 @@ subroutine UrbanReadNML ( NLFilename ) ! if ( masterproc )then write(iulog,*) ' urban air conditioning/heating and wasteheat = ', urban_hac - ! X. Li [dev.04]: write(iulog,*) ' urban explicit air-conditioning adoption rate = ', urban_explicit_ac write(iulog,*) ' urban traffic flux = ', urban_traffic end if diff --git a/src/cpl/share_esmf/UrbanTimeVarType.F90 b/src/cpl/share_esmf/UrbanTimeVarType.F90 index 23dbf54086..54d5c61d19 100644 --- a/src/cpl/share_esmf/UrbanTimeVarType.F90 +++ b/src/cpl/share_esmf/UrbanTimeVarType.F90 @@ -12,7 +12,7 @@ module UrbanTimeVarType use abortutils , only : endrun use decompMod , only : bounds_type, subgrid_level_landunit use clm_varctl , only : iulog - use landunit_varcon , only : isturb_MIN, isturb_MAX ! X. Li: min and max types urban; equals 7 and 9, resp. + use landunit_varcon , only : isturb_MIN, isturb_MAX use clm_varcon , only : spval use LandunitType , only : lun use GridcellType , only : grc @@ -24,8 +24,7 @@ module UrbanTimeVarType type, public :: urbantv_type ! real(r8), public, pointer :: t_building_max(:) ! lun maximum internal building air temperature (K) - ! X. Li [dev] - real(r8), public, pointer :: p_ac(:) ! lun air-conditioning ownership rate (unitless, between 0 and 1) + real(r8), public, pointer :: p_ac(:) ! lun air-conditioning adoption rate (unitless, between 0 and 1) type(shr_strdata_type) :: sdat_urbantv ! urban time varying input data stream contains ! !PUBLIC MEMBER FUNCTIONS: @@ -60,7 +59,7 @@ subroutine Init(this, bounds, NLFilename) character(len=*) , intent(in) :: NLFilename ! Namelist filename ! ! !LOCAL VARIABLES: - integer :: begl, endl ! X. Li: beginning and ending landunit index, from src/main/decompMod + integer :: begl, endl !--------------------------------------------------------------------- begl = bounds%begl; endl = bounds%endl @@ -68,20 +67,18 @@ subroutine Init(this, bounds, NLFilename) ! Allocate urbantv data structure allocate(this%t_building_max(begl:endl)); this%t_building_max(:) = nan - ! X. Li [dev] allocate(this%p_ac(begl:endl)); this%p_ac(:) = nan call this%urbantv_init(bounds, NLFilename) call this%urbantv_interp(bounds) - ! Add history fields ! X. Li: this adds an output field. the subroutine is in scr/main/histFileMod.F90 + ! Add history fields call hist_addfld1d (fname='TBUILD_MAX', units='K', & avgflag='A', long_name='prescribed maximum interior building temperature', & ptr_lunit=this%t_building_max, default='inactive', set_nourb=spval, & l2g_scale_type='unity') - ! X. Li [dev] call hist_addfld1d (fname='P_AC', units='unitless', & - avgflag='A', long_name='prescribed air-conditioning ownership rate (decimal)', & + avgflag='A', long_name='prescribed air-conditioning ownership rate (unitless, between 0 and 1)', & ptr_lunit=this%p_ac, default='inactive', set_nourb=spval, & l2g_scale_type='unity') @@ -97,7 +94,7 @@ subroutine urbantv_init(this, bounds, NLFilename) use clm_nlUtilsMod , only : find_nlgroup_name use spmdMod , only : masterproc, mpicom, iam use shr_mpi_mod , only : shr_mpi_bcast - use landunit_varcon , only : isturb_tbd, isturb_hd, isturb_md ! X. Li: equals 7, 8 and 9 + use landunit_varcon , only : isturb_tbd, isturb_hd, isturb_md use dshr_strdata_mod , only : shr_strdata_init_from_inline use lnd_comp_shr , only : mesh, model_clock ! @@ -105,23 +102,23 @@ subroutine urbantv_init(this, bounds, NLFilename) implicit none class(urbantv_type) :: this type(bounds_type), intent(in) :: bounds - character(len=*), intent(in) :: NLFilename ! Namelist filename ???is this the netCDF file name? + character(len=*), intent(in) :: NLFilename ! Namelist filename ! ! !LOCAL VARIABLES: integer :: n integer :: stream_year_first_urbantv ! first year in urban tv stream to use integer :: stream_year_last_urbantv ! last year in urban tv stream to use integer :: model_year_align_urbantv ! align stream_year_first_urbantv with this model year - integer :: nu_nml ! unit for namelist file ??? + integer :: nu_nml ! unit for namelist file integer :: nml_error ! namelist i/o error flag - character(len=CL) :: stream_fldFileName_urbantv ! urban tv streams filename ??? - character(len=CL) :: stream_meshfile_urbantv ! urban tv streams filename ??? - character(len=CL) :: urbantvmapalgo = 'nn' ! mapping alogrithm for urban ac ??? + character(len=CL) :: stream_fldFileName_urbantv ! urban tv streams filename + character(len=CL) :: stream_meshfile_urbantv ! urban tv streams filename + character(len=CL) :: urbantvmapalgo = 'nn' ! mapping alogrithm for urban ac character(len=CL) :: urbantv_tintalgo = 'linear' ! time interpolation alogrithm integer :: rc ! error code ! X. Li [orig]: this is taken out because field strings are now hard coded in ! character(*), parameter :: urbantvString = "tbuildmax_" ! base string for field string - character(*), parameter :: subName = "('urbantv_init')" ! ??? + character(*), parameter :: subName = "('urbantv_init')" !----------------------------------------------------------------------- namelist /urbantv_streams/ & @@ -215,7 +212,6 @@ subroutine urbantv_init(this, bounds, NLFilename) stream_tintalgo = urbantv_tintalgo, & stream_name = 'Urban time varying data', & rc = rc) - if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) then call ESMF_Finalize(endflag=ESMF_END_ABORT) end if @@ -257,11 +253,10 @@ subroutine urbantv_interp(this, bounds) ! Advance sdat stream call get_curr_date(year, mon, day, sec) mcdate = year*10000 + mon*100 + day - call shr_strdata_advance(this%sdat_urbantv, ymd=mcdate, tod=sec, logunit=iulog, istr='hdmdyn', rc=rc) if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) then call ESMF_Finalize(endflag=ESMF_END_ABORT) - end if + end if ! Create 2d array for all stream variable data lsize = bounds%endg - bounds%begg + 1 @@ -306,9 +301,8 @@ subroutine urbantv_interp(this, bounds) end if end do else - this%t_building_max(l) = spval ! X. Li: special value for real data, set to 1.e36 in src/main/clm_varcon - ! X. Li [dev] - this%p_ac(l) = 0._r8 ! X. Li: set to 0 for non-urban landunit + this%t_building_max(l) = spval + this%p_ac(l) = 0._r8 ! set to 0 for non-urban landunit end if end do deallocate(dataptr2d) @@ -322,11 +316,8 @@ subroutine urbantv_interp(this, bounds) ig = ig+1 if (g == lun%gridcell(l)) exit end do - ! X. Li [orig] - ! if ( .not. urban_valid(g) .or. (this%t_building_max(l) <= 0._r8)) then - ! X. Li [dev] if ( .not. urban_valid(g) .or. (this%t_building_max(l) <= 0._r8) & - .or. (this%p_ac(l) < 0._r8) .or. (this%p_ac(l) > 1._r8)) then + .or. (this%p_ac(l) < 0._r8) .or. (this%p_ac(l) > 1._r8)) then ! check if AC adoption rate is outside of range 0 to 1 found = .true. gindx = g lindx = l @@ -339,7 +330,6 @@ subroutine urbantv_interp(this, bounds) write(iulog,*)'landunit type: ',lun%itype(lindx) write(iulog,*)'urban_valid: ',urban_valid(gindx) write(iulog,*)'t_building_max: ',this%t_building_max(lindx) - ! X. Li [dev] write(iulog,*)'p_ac: ',this%p_ac(lindx) call endrun(subgrid_index=lindx, subgrid_level=subgrid_level_landunit, & msg=errmsg(sourcefile, __LINE__)) diff --git a/src/main/clm_varpar.F90 b/src/main/clm_varpar.F90 index 3ef9cf48a2..f54b750181 100644 --- a/src/main/clm_varpar.F90 +++ b/src/main/clm_varpar.F90 @@ -203,8 +203,7 @@ subroutine clm_varpar_init(actual_maxsoil_patches, surf_numpft, surf_numcft) max_patch_per_col= max(maxsoil_patches, surf_numcft, maxpatch_urb) nlevsoifl = 10 - ! X. Li: changed below from 5 to 10 to match new surface data - nlevurb = 10 ! originally 5 + nlevurb = 5 if ( masterproc ) write(iulog, *) 'soil_layerstruct_predefined varpar ', soil_layerstruct_predefined if ( masterproc ) write(iulog, *) 'soil_layerstruct_userdefined varpar ', soil_layerstruct_userdefined From 9a05842d4ad3d173b06b3d1559e62c51bfea2fb0 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Mon, 12 Feb 2024 22:43:10 -0700 Subject: [PATCH 0067/1248] Add in read of use_prigent_roughness to the FORTRAN source --- src/biogeochem/DUSTMod.F90 | 1 + .../share_esmf/PrigentRoughnessStreamType.F90 | 33 ++++++++++++++++--- 2 files changed, 29 insertions(+), 5 deletions(-) diff --git a/src/biogeochem/DUSTMod.F90 b/src/biogeochem/DUSTMod.F90 index 7a1bfcc092..f3b3a0cd68 100644 --- a/src/biogeochem/DUSTMod.F90 +++ b/src/biogeochem/DUSTMod.F90 @@ -63,6 +63,7 @@ module DUSTMod real(r8), pointer, private :: vlc_trb_3_patch (:) ! turbulent deposition velocity 3(m/s) real(r8), pointer, private :: vlc_trb_4_patch (:) ! turbulent deposition velocity 4(m/s) real(r8), pointer, private :: mbl_bsn_fct_col (:) ! basin factor + real(r8), pointer, private :: dst_emiss_coeff_patch (:) ! dust emission coefficient (unitless) real(r8), pointer, private :: wnd_frc_thr_patch (:) ! wet fluid threshold (m/s) real(r8), pointer, private :: wnd_frc_thr_dry_patch (:) ! dry fluid threshold (m/s) diff --git a/src/cpl/share_esmf/PrigentRoughnessStreamType.F90 b/src/cpl/share_esmf/PrigentRoughnessStreamType.F90 index cef34682c9..0766c0ca1a 100644 --- a/src/cpl/share_esmf/PrigentRoughnessStreamType.F90 +++ b/src/cpl/share_esmf/PrigentRoughnessStreamType.F90 @@ -39,7 +39,7 @@ module PrigentRoughnessStreamType character(len=CL) :: stream_meshfile_prigentroughness ! mesh Filename character(len=CL) :: prigentroughnessmapalgo ! map algo contains - procedure, private :: ReadNML ! Read in namelist + procedure, private :: ReadNML ! Read in namelist ! If will be used end type streamcontrol_type type(streamcontrol_type), private :: control ! Stream control data @@ -269,6 +269,7 @@ subroutine ReadNML(this, bounds, NLFilename) ! local variables integer :: nu_nml ! unit for namelist file integer :: nml_error ! namelist i/o error flag + logical :: use_prigent_roughness = .true. character(len=CL) :: stream_fldFileName_prigentroughness = ' ' character(len=CL) :: stream_meshfile_prigentroughness = ' ' character(len=CL) :: prigentroughnessmapalgo = 'bilinear' @@ -277,7 +278,8 @@ subroutine ReadNML(this, bounds, NLFilename) !----------------------------------------------------------------------- namelist /prigentroughness/ & ! MUST agree with namelist_name above - prigentroughnessmapalgo, stream_fldFileName_prigentroughness, stream_meshfile_prigentroughness + prigentroughnessmapalgo, stream_fldFileName_prigentroughness, stream_meshfile_prigentroughness, & + use_prigent_roughness ! Default values for namelist @@ -296,16 +298,37 @@ subroutine ReadNML(this, bounds, NLFilename) close(nu_nml) endif + call shr_mpi_bcast(use_prigent_roughness , mpicom) call shr_mpi_bcast(prigentroughnessmapalgo , mpicom) call shr_mpi_bcast(stream_fldFileName_prigentroughness , mpicom) call shr_mpi_bcast(stream_meshfile_prigentroughness , mpicom) + ! Error checking + if ( use_prigent_roughness == .false. )then + if ( len_trim(stream_fldFileName_prigentroughness) /= 0 )then + call endrun(msg=' ERROR stream_fldFileName_prigentroughness is set, but use_prigent_roughness is FALSE'//errMsg(sourcefile, __LINE__)) + end if + if ( len_trim(stream_meshfile_prigentroughness) /= 0 )then + call endrun(msg=' ERROR stream_meshfile_prigentroughness is set, but use_prigent_roughness is FALSE'//errMsg(sourcefile, __LINE__)) + end if + else + if ( len_trim(stream_fldFileName_prigentroughness) == 0 )then + call endrun(msg=' ERROR stream_fldFileName_prigentroughness is NOT set, but use_prigent_roughness is TRUE'//errMsg(sourcefile, __LINE__)) + end if + if ( len_trim(stream_meshfile_prigentroughness) == 0 )then + call endrun(msg=' ERROR stream_meshfile_prigentroughness is NOT set, but use_prigent_roughness is TRUE'//errMsg(sourcefile, __LINE__)) + end if + end if + if (masterproc) then write(iulog,*) ' ' write(iulog,*) namelist_name, ' stream settings:' - write(iulog,*) ' stream_fldFileName_prigentroughness = ',stream_fldFileName_prigentroughness - write(iulog,*) ' stream_meshfile_prigentroughness = ',stream_meshfile_prigentroughness - write(iulog,*) ' prigentroughnessmapalgo = ',prigentroughnessmapalgo + write(iulog,*) ' use_prigent_roughness = ',use_prigent_roughness + if ( use_prigent_roughness )then + write(iulog,*) ' stream_fldFileName_prigentroughness = ',trim(stream_fldFileName_prigentroughness) + write(iulog,*) ' stream_meshfile_prigentroughness = ',trim(stream_meshfile_prigentroughness) + write(iulog,*) ' prigentroughnessmapalgo = ',trim(prigentroughnessmapalgo) + end if endif this%stream_fldFileName_prigentroughness = stream_fldFileName_prigentroughness this%stream_meshfile_prigentroughness = stream_meshfile_prigentroughness From d8b6cb8f6c27186a252d23f8ae1d3521e9c1323e Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Tue, 13 Feb 2024 11:39:16 -0700 Subject: [PATCH 0068/1248] Remove an empty call the prigentRoughness call is what's being used --- bld/CLMBuildNamelist.pm | 5 ----- 1 file changed, 5 deletions(-) diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index 7e9ae0e2d2..8081f1277e 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -1706,11 +1706,6 @@ sub process_namelist_inline_logic { ################################## setup_logic_lai_streams($opts, $nl_flags, $definition, $defaults, $nl); - ################################## - # namelist group: dust_emis_streams # - ################################## - #setup_logic_dustemis_streams($opts, $nl_flags, $definition, $defaults, $nl); - ################################## # namelist group: cropcal_streams # ################################## From 4a72a1c9be9f1ba97a0f9ef98905a37addcc1771 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Tue, 13 Feb 2024 12:00:52 -0700 Subject: [PATCH 0069/1248] Work with some indentation, remove commented out code, add a deallocate that was missing, add underscore to a name for readability, always allocate, but allocate only 0th element if usestreams is false --- .../share_esmf/PrigentRoughnessStreamType.F90 | 24 ++++++++++++------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/src/cpl/share_esmf/PrigentRoughnessStreamType.F90 b/src/cpl/share_esmf/PrigentRoughnessStreamType.F90 index 0766c0ca1a..dec9fa86fd 100644 --- a/src/cpl/share_esmf/PrigentRoughnessStreamType.F90 +++ b/src/cpl/share_esmf/PrigentRoughnessStreamType.F90 @@ -79,17 +79,18 @@ subroutine Init(this, bounds, NLFilename) character(len=16), allocatable :: stream_varnames(:) ! array of stream field names integer :: rc ! error code real(r8), pointer :: dataptr1d(:) ! temporary pointer - character(len=*), parameter :: stream_name = 'prigentroughness' + character(len=*), parameter :: stream_name = 'prigent_roughness' !----------------------------------------------------------------------- - !if ( finundation_mtd /= finundation_mtd_h2osfc )then - call this%InitAllocate( bounds ) call control%ReadNML( bounds, NLFileName ) + call this%InitAllocate( bounds ) + if ( this%useStreams() )then - allocate(stream_varnames(1)) - stream_varnames = (/"Z0a"/) ! varname in cdf5_Z0a_Prigent-Globe-025x025-09262022.nc, in centimeter + + allocate(stream_varnames(1)) + stream_varnames = (/"Z0a"/) ! varname in cdf5_Z0a_Prigent-Globe-025x025-09262022.nc, in centimeter if (masterproc) then write(iulog,*) ' stream_varnames = ',stream_varnames @@ -152,8 +153,8 @@ subroutine Init(this, bounds, NLFilename) end if end do + deallocate(stream_varnames) end if - !end if !commented out end subroutine Init @@ -161,7 +162,7 @@ end subroutine Init logical function UseStreams(this) ! ! !DESCRIPTION: - ! Return true if + ! Return true if the Prigent Roughness stream is being used ! ! !USES: ! @@ -171,7 +172,7 @@ logical function UseStreams(this) ! ! !LOCAL VARIABLES: if ( trim(control%stream_fldFileName_prigentroughness) == '' )then - UseStreams = .false. ! this won't happen and UseStreams will always be true + UseStreams = .false. ! Prigent streams are off without a filename given else UseStreams = .true. end if @@ -197,7 +198,12 @@ subroutine InitAllocate(this, bounds) begg = bounds%begg; endg = bounds%endg - allocate(this%prigent_rghn (begg:endg)) ; this%prigent_rghn (:) = nan + if ( this%useStreams() )then + allocate(this%prigent_rghn(begg:endg)) + else + allocate(this%prigent_rghn(0)) + end if + this%prigent_rghn(:) = nan end subroutine InitAllocate From 3291040ae8d1fbe9fbf60d4e2d97f177cfba1983 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Tue, 13 Feb 2024 12:54:44 -0700 Subject: [PATCH 0070/1248] Shorten many lines (will help with nag compiler), add extra error checking around making sure namelist is read in and stream initialization has been done, this builds and runs --- .../share_esmf/PrigentRoughnessStreamType.F90 | 105 +++++++++++++----- 1 file changed, 79 insertions(+), 26 deletions(-) diff --git a/src/cpl/share_esmf/PrigentRoughnessStreamType.F90 b/src/cpl/share_esmf/PrigentRoughnessStreamType.F90 index dec9fa86fd..734c26ea8a 100644 --- a/src/cpl/share_esmf/PrigentRoughnessStreamType.F90 +++ b/src/cpl/share_esmf/PrigentRoughnessStreamType.F90 @@ -6,7 +6,7 @@ module PrigentRoughnessStreamType ! Contains methods for reading in the Prigent et al. (1997) roughness length streams file ! Created by Danny M. Leung 22 Nov 2022 ! !USES - use ESMF + use ESMF use dshr_strdata_mod , only : shr_strdata_type use shr_kind_mod , only : r8 => shr_kind_r8, CL => shr_kind_cl use shr_log_mod , only : errMsg => shr_log_errMsg @@ -20,13 +20,14 @@ module PrigentRoughnessStreamType private type, public :: prigentroughnessstream_type - real(r8), pointer, private :: prigent_rghn (:) ! Prigent et al. (1997) roughness length (m) + real(r8), pointer, public :: prigent_rghn (:) ! Prigent et al. (1997) roughness length (m) contains ! !PUBLIC MEMBER FUNCTIONS: procedure, public :: Init ! Initialize and read data in procedure, public :: CalcDragPartition ! Calculate drag partitioning based on input streams - procedure, public :: UseStreams ! If streams will be used -- dmleung set default as yes + procedure, public :: UseStreams ! If Prigent rougness streams will be used + procedure, public :: IsStreamInit ! If the streams have been initialized and read in, so data can be used ! !PRIVATE MEMBER FUNCTIONS: procedure, private :: InitAllocate ! Allocate data @@ -39,12 +40,14 @@ module PrigentRoughnessStreamType character(len=CL) :: stream_meshfile_prigentroughness ! mesh Filename character(len=CL) :: prigentroughnessmapalgo ! map algo contains - procedure, private :: ReadNML ! Read in namelist ! If will be used + procedure, private :: ReadNML ! Read in control namelist end type streamcontrol_type - type(streamcontrol_type), private :: control ! Stream control data + type(streamcontrol_type), private :: control ! Stream control data + logical , private :: NMLRead = .false. ! If namelist has been read + logical , private :: InitDone = .false. ! If initialization of streams has been done - character(len=*), parameter, private :: sourcefile = & + character(len=*), parameter, private :: sourcefile = & __FILE__ !============================================================================== @@ -80,6 +83,7 @@ subroutine Init(this, bounds, NLFilename) integer :: rc ! error code real(r8), pointer :: dataptr1d(:) ! temporary pointer character(len=*), parameter :: stream_name = 'prigent_roughness' + character(len=*), parameter :: subname = 'PrigentRoughnessStream::Init' !----------------------------------------------------------------------- call control%ReadNML( bounds, NLFileName ) @@ -138,7 +142,7 @@ subroutine Init(this, bounds, NLFilename) end if ! Get pointer for stream data that is time and spatially interpolate to model time and grid - do n = 1,size(stream_varnames) + do n = 1,size(stream_varnames) call dshr_fldbun_getFldPtr(sdat_rghn%pstrm(1)%fldbun_model, stream_varnames(n), fldptr1=dataptr1d, rc=rc) if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) then call ESMF_Finalize(endflag=ESMF_END_ABORT) @@ -154,6 +158,7 @@ subroutine Init(this, bounds, NLFilename) end do deallocate(stream_varnames) + InitDone = .true. end if end subroutine Init @@ -170,7 +175,11 @@ logical function UseStreams(this) implicit none class(prigentroughnessstream_type) :: this ! - ! !LOCAL VARIABLES: + character(len=*), parameter :: subname = 'PrigentRoughnessStream::UseStreams' + ! + if ( .not. NMLRead )then + call endrun(msg=subname//' ERROR Namelist has NOT been read first, call Init before this') + end if if ( trim(control%stream_fldFileName_prigentroughness) == '' )then UseStreams = .false. ! Prigent streams are off without a filename given else @@ -178,6 +187,30 @@ logical function UseStreams(this) end if end function UseStreams + !============================================================================== + logical function IsStreamInit(this) + ! + ! !DESCRIPTION: + ! Return true if the streams have been initialized + ! + ! !USES: + ! + ! !ARGUMENTS: + implicit none + class(prigentroughnessstream_type) :: this + ! + character(len=*), parameter :: subname = 'PrigentRoughnessStream::IsStreamInit' + ! + if ( .not. NMLRead )then + call endrun(msg=subname//' ERROR Namelist has NOT been read first, call Init before this') + end if + if ( InitDone )then + IsStreamInit = .true. + else + IsStreamInit = .false. + end if + end function IsStreamInit + !============================================================================== subroutine InitAllocate(this, bounds) ! @@ -212,13 +245,13 @@ subroutine CalcDragPartition(this, bounds, dpfct_rock) ! ! !DESCRIPTION: ! Commented below by Danny M. Leung 31 Dec 2022 - ! Calculate the drag partition effect of friction velocity due to surface roughness following - ! Leung et al. (2022). This module is used in the dust emission module DUSTMod.F90 for - ! calculating drag partitioning. The drag partition equation comes from Marticorena and - ! Bergametti (1995) with constants modified by Darmenova et al. (2009). Here it is assumed + ! Calculate the drag partition effect of friction velocity due to surface roughness following + ! Leung et al. (2022). This module is used in the dust emission module DUSTMod.F90 for + ! calculating drag partitioning. The drag partition equation comes from Marticorena and + ! Bergametti (1995) with constants modified by Darmenova et al. (2009). Here it is assumed ! that this equation is used only over arid/desertic regions, such that Catherine Prigent's ! roughness measurements represents mostly rocks. For more vegetated areas, the vegetation - ! roughness and drag partitioning are calculated in the DustEmission subroutine. This + ! roughness and drag partitioning are calculated in the DustEmission subroutine. This ! subroutine is used in the InitCold subroutine of DUSTMod.F90. ! ! !USES: @@ -228,29 +261,42 @@ subroutine CalcDragPartition(this, bounds, dpfct_rock) ! ! !ARGUMENTS: implicit none - class(prigentroughnessstream_type) :: this - type(bounds_type) , intent(in) :: bounds - real(r8) , intent(inout) :: dpfct_rock(bounds%begp:) ! [fraction] rock drag partition factor (roughness effect) + class(prigentroughnessstream_type) :: this + type(bounds_type) , intent(in) :: bounds + real(r8) , intent(inout) :: dpfct_rock(bounds%begp:) ! [fraction] rock drag partition factor (roughness effect) ! ! !LOCAL VARIABLES: integer :: g, p, fp, l ! Indices real(r8) :: z0s ! smooth roughness length (m) - + ! constants - real(r8), parameter :: D_p = 130e-6_r8 ! [m] Medium soil particle diameter, assuming a global constant of ~130 um following Leung et al. (2022) - real(r8), parameter :: X = 10_r8 ! [m] distance downwind of the roughness element (rock). Assume estimating roughness effect at a distance of 10 m following Leung et al. (2022) + real(r8), parameter :: D_p = 130e-6_r8 ! [m] Medium soil particle diameter, assuming a global constant + ! of ~130 um following Leung et al. (2022) + real(r8), parameter :: X = 10_r8 ! [m] distance downwind of the roughness element (rock). Assume + ! estimating roughness effect at a distance of 10 m following Leung et al. (2022) + character(len=*), parameter :: subname = 'PrigentRoughnessStream::CalcDragPartition' !--------------------------------------------------------------------- SHR_ASSERT_ALL_FL((ubound(dpfct_rock) == (/bounds%endp/)), sourcefile, __LINE__) + ! Make sure we've been initialized + if ( .not. this%IsStreamInit() )then + call endrun(msg=subname//' ERROR Streams have not been initialized, make sure Init is called first' & + //', and streams are on') + end if - ! dmleung: this loop calculates the drag partition effect (or roughness effect) of rocks. We save the drag partition factor as a patch level quantity. - z0s = 2_r8 * D_p / 30_r8 ! equation from Frank M. White (2006). Here we assume soil medium size is a global constant, and so is smooth roughness length. + ! dmleung: this loop calculates the drag partition effect (or roughness effect) of rocks. + ! We save the drag partition factor as a patch level quantity. + ! TODO: EBK 02/13/2024: Several magic numbers here that should become parameters so the meaning is preserved + z0s = 2_r8 * D_p / 30_r8 ! equation from Frank M. White (2006). + ! Here we assume soil medium size is a global constant, and so is smooth roughness length. do p = bounds%begp,bounds%endp g = patch%gridcell(p) l = patch%landunit(p) if (lun%itype(l) /= istdlak) then - dpfct_rock(p) = 1._r8 - ( log(this%prigent_rghn(g)*0.01_r8/z0s) / log(0.7_r8*(X/z0s)**0.8_r8) ) ! Calculating rock drag partition factor using Marticorena and Bergametti (1995). 0.01 is used to convert Z0a from centimeter to meter. + ! Calculating rock drag partition factor using Marticorena and Bergametti (1995). + ! 0.01 is used to convert Z0a from centimeter to meter. + dpfct_rock(p) = 1._r8 - ( log(this%prigent_rghn(g)*0.01_r8/z0s) / log(0.7_r8*(X/z0s)**0.8_r8) ) end if end do @@ -312,17 +358,21 @@ subroutine ReadNML(this, bounds, NLFilename) ! Error checking if ( use_prigent_roughness == .false. )then if ( len_trim(stream_fldFileName_prigentroughness) /= 0 )then - call endrun(msg=' ERROR stream_fldFileName_prigentroughness is set, but use_prigent_roughness is FALSE'//errMsg(sourcefile, __LINE__)) + call endrun(msg=' ERROR stream_fldFileName_prigentroughness is set, but use_prigent_roughness is FALSE' & + //errMsg(sourcefile, __LINE__)) end if if ( len_trim(stream_meshfile_prigentroughness) /= 0 )then - call endrun(msg=' ERROR stream_meshfile_prigentroughness is set, but use_prigent_roughness is FALSE'//errMsg(sourcefile, __LINE__)) + call endrun(msg=' ERROR stream_meshfile_prigentroughness is set, but use_prigent_roughness is FALSE' & + //errMsg(sourcefile, __LINE__)) end if else if ( len_trim(stream_fldFileName_prigentroughness) == 0 )then - call endrun(msg=' ERROR stream_fldFileName_prigentroughness is NOT set, but use_prigent_roughness is TRUE'//errMsg(sourcefile, __LINE__)) + call endrun(msg=' ERROR stream_fldFileName_prigentroughness is NOT set, but use_prigent_roughness is TRUE' & + //errMsg(sourcefile, __LINE__)) end if if ( len_trim(stream_meshfile_prigentroughness) == 0 )then - call endrun(msg=' ERROR stream_meshfile_prigentroughness is NOT set, but use_prigent_roughness is TRUE'//errMsg(sourcefile, __LINE__)) + call endrun(msg=' ERROR stream_meshfile_prigentroughness is NOT set, but use_prigent_roughness is TRUE' & + //errMsg(sourcefile, __LINE__)) end if end if @@ -340,6 +390,9 @@ subroutine ReadNML(this, bounds, NLFilename) this%stream_meshfile_prigentroughness = stream_meshfile_prigentroughness this%prigentroughnessmapalgo = prigentroughnessmapalgo + ! Mark namelist read as having been done + NMLRead = .true. + end subroutine ReadNML end module PrigentRoughnessStreamType From 2886a18151b35cf6ee4c60433ee696a2ecce4327 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Tue, 13 Feb 2024 15:35:29 -0700 Subject: [PATCH 0071/1248] Move CalcDragPartition to DUSTMod from PrigentRoughnessStream object --- src/biogeochem/DUSTMod.F90 | 75 +++++++++++++++++++++++++++++++++++--- 1 file changed, 69 insertions(+), 6 deletions(-) diff --git a/src/biogeochem/DUSTMod.F90 b/src/biogeochem/DUSTMod.F90 index f3b3a0cd68..e3f9dd669c 100644 --- a/src/biogeochem/DUSTMod.F90 +++ b/src/biogeochem/DUSTMod.F90 @@ -84,7 +84,7 @@ module DUSTMod real(r8), pointer, private :: lai_patch (:) ! [m2 leaf /m2 land] LAI+SAI for calculating Okin's drag partition, averaged to landunit level real(r8), pointer, private :: frc_thr_rghn_fct_patch (:) ! [dimless] hybrid drag partition (or called roughness) factor real(r8), pointer, private :: wnd_frc_thr_std_patch (:) ! standardized fluid threshold friction velocity (m/s) - type(prigentroughnessstream_type), private :: prigentroughnessstream ! Prigent roughness stream data + type(prigentroughnessstream_type), private :: prigent_roughness_stream ! Prigent roughness stream data real(r8), pointer, private :: dpfct_rock_patch (:) ! [fraction] rock drag partition factor, time-constant contains @@ -92,7 +92,8 @@ module DUSTMod procedure , private :: InitAllocate procedure , private :: InitHistory procedure , private :: InitCold - procedure , private :: InitDustVars ! Initialize variables used in subroutine Dust + procedure , private :: InitDustVars ! Initialize variables used in subroutine Dust + procedure , private :: CalcDragPartition ! Calculate drag partitioning based on Prigent roughness stream end type dust_type !------------------------------------------------------------------------ @@ -111,7 +112,7 @@ subroutine Init(this, bounds, NLFilename) call this%InitAllocate (bounds) call this%InitHistory (bounds) - call this%prigentroughnessstream%Init( bounds, NLFilename ) + call this%prigent_roughness_stream%Init( bounds, NLFilename ) call this%InitCold (bounds) call this%InitDustVars (bounds) @@ -315,9 +316,8 @@ subroutine InitCold(this, bounds) end do ! Caulculate Drag Partition factor - if ( this%prigentroughnessstream%useStreams() )then !if usestreams == true, and it should be always true - call this%prigentroughnessstream%CalcDragPartition( bounds, & - this%dpfct_rock_patch(bounds%begp:bounds%endp) ) + if ( this%prigent_roughness_stream%useStreams() )then !if usestreams == true, and it should be always true + call this%CalcDragPartition( bounds, this%prigent_roughness_stream ) else call endrun( "ERROR:: Drag partitioning MUST now use a streams file of aeolian roughness length to calculate, it can no longer read from the fsurdat file" ) @@ -1219,4 +1219,67 @@ subroutine InitDustVars(this, bounds) end subroutine InitDustVars + !============================================================================== + subroutine CalcDragPartition(this, bounds, prigent_roughness_stream ) + ! + ! !DESCRIPTION: + ! Commented below by Danny M. Leung 31 Dec 2022 + ! Calculate the drag partition effect of friction velocity due to surface roughness following + ! Leung et al. (2022). This module is used in the dust emission module DUSTMod.F90 for + ! calculating drag partitioning. The drag partition equation comes from Marticorena and + ! Bergametti (1995) with constants modified by Darmenova et al. (2009). Here it is assumed + ! that this equation is used only over arid/desertic regions, such that Catherine Prigent's + ! roughness measurements represents mostly rocks. For more vegetated areas, the vegetation + ! roughness and drag partitioning are calculated in the DustEmission subroutine. This + ! subroutine is used in the InitCold subroutine of DUSTMod.F90. + ! + ! !USES: + use PatchType , only : patch + use landunit_varcon , only : istdlak + use LandunitType , only : lun + ! + ! !ARGUMENTS: + implicit none + class(dust_type) , intent(inout) :: this + type(bounds_type), intent(in) :: bounds + type(prigentroughnessstream_type), intent(in) :: prigent_roughness_stream + ! + ! !LOCAL VARIABLES: + integer :: g, p, fp, l ! Indices + real(r8) :: z0s ! smooth roughness length (m) + + ! constants + real(r8), parameter :: D_p = 130e-6_r8 ! [m] Medium soil particle diameter, assuming a global constant + ! of ~130 um following Leung et al. (2022) + real(r8), parameter :: X = 10_r8 ! [m] distance downwind of the roughness element (rock). Assume + ! estimating roughness effect at a distance of 10 m following Leung et al. (2022) + character(len=*), parameter :: subname = 'PrigentRoughnessStream::CalcDragPartition' + !--------------------------------------------------------------------- + + ! Make sure we've been initialized + if ( .not. prigent_roughness_stream%IsStreamInit() )then + call endrun(msg=subname//' ERROR Streams have not been initialized, make sure Init is called first' & + //', and streams are on') + end if + + ! dmleung: this loop calculates the drag partition effect (or roughness effect) of rocks. + ! We save the drag partition factor as a patch level quantity. + ! TODO: EBK 02/13/2024: Several magic numbers here that should become parameters so the meaning is preserved + z0s = 2_r8 * D_p / 30_r8 ! equation from Frank M. White (2006). + ! Here we assume soil medium size is a global constant, and so is smooth roughness length. + do p = bounds%begp,bounds%endp + g = patch%gridcell(p) + l = patch%landunit(p) + if (lun%itype(l) /= istdlak) then + ! Calculating rock drag partition factor using Marticorena and Bergametti (1995). + ! 0.01 is used to convert Z0a from centimeter to meter. + this%dpfct_rock_patch(p) = 1._r8 - ( log(prigent_roughness_stream%prigent_rghn(g)*0.01_r8/z0s) & + / log(0.7_r8*(X/z0s)**0.8_r8) ) + end if + end do + + end subroutine CalcDragPartition + + !============================================================================== + end module DUSTMod From e2123b0215d8228e03f9f12d4b47ed34a3106bfe Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Tue, 13 Feb 2024 16:02:33 -0700 Subject: [PATCH 0072/1248] Move CalcDragPartition to DUSTMod from PrigentRoughnessStream object --- .../share_esmf/PrigentRoughnessStreamType.F90 | 73 ++----------------- 1 file changed, 5 insertions(+), 68 deletions(-) diff --git a/src/cpl/share_esmf/PrigentRoughnessStreamType.F90 b/src/cpl/share_esmf/PrigentRoughnessStreamType.F90 index 734c26ea8a..751fe8458c 100644 --- a/src/cpl/share_esmf/PrigentRoughnessStreamType.F90 +++ b/src/cpl/share_esmf/PrigentRoughnessStreamType.F90 @@ -1,5 +1,5 @@ module PrigentRoughnessStreamType -#include "shr_assert.h" + !----------------------------------------------------------------------- ! !DESCRIPTION: @@ -25,7 +25,6 @@ module PrigentRoughnessStreamType ! !PUBLIC MEMBER FUNCTIONS: procedure, public :: Init ! Initialize and read data in - procedure, public :: CalcDragPartition ! Calculate drag partitioning based on input streams procedure, public :: UseStreams ! If Prigent rougness streams will be used procedure, public :: IsStreamInit ! If the streams have been initialized and read in, so data can be used @@ -101,15 +100,15 @@ subroutine Init(this, bounds, NLFilename) end if ! Initialize the cdeps data type sdat_rghn - call shr_strdata_init_from_inline(sdat_rghn, & + call shr_strdata_init_from_inline(sdat_rghn, & my_task = iam, & logunit = iulog, & compname = 'LND', & model_clock = model_clock, & model_mesh = mesh, & - stream_meshfile = control%stream_meshfile_prigentroughness, & + stream_meshfile = control%stream_meshfile_prigentroughness, & stream_lev_dimname = 'null', & - stream_mapalgo = control%prigentroughnessmapalgo, & + stream_mapalgo = control%prigentroughnessmapalgo, & stream_filenames = (/trim(control%stream_fldFileName_prigentroughness)/), & stream_fldlistFile = stream_varnames, & stream_fldListModel = stream_varnames, & @@ -120,7 +119,7 @@ subroutine Init(this, bounds, NLFilename) stream_taxmode = 'extend', & stream_dtlimit = 1.0e30_r8, & stream_tintalgo = 'linear', & - stream_name = 'Prigent roughness', & + stream_name = 'Prigent roughness', & rc = rc) if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) then call ESMF_Finalize(endflag=ESMF_END_ABORT) @@ -240,68 +239,6 @@ subroutine InitAllocate(this, bounds) end subroutine InitAllocate - !============================================================================== - subroutine CalcDragPartition(this, bounds, dpfct_rock) - ! - ! !DESCRIPTION: - ! Commented below by Danny M. Leung 31 Dec 2022 - ! Calculate the drag partition effect of friction velocity due to surface roughness following - ! Leung et al. (2022). This module is used in the dust emission module DUSTMod.F90 for - ! calculating drag partitioning. The drag partition equation comes from Marticorena and - ! Bergametti (1995) with constants modified by Darmenova et al. (2009). Here it is assumed - ! that this equation is used only over arid/desertic regions, such that Catherine Prigent's - ! roughness measurements represents mostly rocks. For more vegetated areas, the vegetation - ! roughness and drag partitioning are calculated in the DustEmission subroutine. This - ! subroutine is used in the InitCold subroutine of DUSTMod.F90. - ! - ! !USES: - use PatchType , only : patch - use landunit_varcon , only : istdlak - use LandunitType , only : lun - ! - ! !ARGUMENTS: - implicit none - class(prigentroughnessstream_type) :: this - type(bounds_type) , intent(in) :: bounds - real(r8) , intent(inout) :: dpfct_rock(bounds%begp:) ! [fraction] rock drag partition factor (roughness effect) - ! - ! !LOCAL VARIABLES: - integer :: g, p, fp, l ! Indices - real(r8) :: z0s ! smooth roughness length (m) - - ! constants - real(r8), parameter :: D_p = 130e-6_r8 ! [m] Medium soil particle diameter, assuming a global constant - ! of ~130 um following Leung et al. (2022) - real(r8), parameter :: X = 10_r8 ! [m] distance downwind of the roughness element (rock). Assume - ! estimating roughness effect at a distance of 10 m following Leung et al. (2022) - character(len=*), parameter :: subname = 'PrigentRoughnessStream::CalcDragPartition' - !--------------------------------------------------------------------- - - SHR_ASSERT_ALL_FL((ubound(dpfct_rock) == (/bounds%endp/)), sourcefile, __LINE__) - - ! Make sure we've been initialized - if ( .not. this%IsStreamInit() )then - call endrun(msg=subname//' ERROR Streams have not been initialized, make sure Init is called first' & - //', and streams are on') - end if - - ! dmleung: this loop calculates the drag partition effect (or roughness effect) of rocks. - ! We save the drag partition factor as a patch level quantity. - ! TODO: EBK 02/13/2024: Several magic numbers here that should become parameters so the meaning is preserved - z0s = 2_r8 * D_p / 30_r8 ! equation from Frank M. White (2006). - ! Here we assume soil medium size is a global constant, and so is smooth roughness length. - do p = bounds%begp,bounds%endp - g = patch%gridcell(p) - l = patch%landunit(p) - if (lun%itype(l) /= istdlak) then - ! Calculating rock drag partition factor using Marticorena and Bergametti (1995). - ! 0.01 is used to convert Z0a from centimeter to meter. - dpfct_rock(p) = 1._r8 - ( log(this%prigent_rghn(g)*0.01_r8/z0s) / log(0.7_r8*(X/z0s)**0.8_r8) ) - end if - end do - - end subroutine CalcDragPartition - !============================================================================== subroutine ReadNML(this, bounds, NLFilename) ! From 3e9d6b67c2af06cd2a9d699640ee3d242245cc01 Mon Sep 17 00:00:00 2001 From: "Danny M. Leung" Date: Tue, 20 Feb 2024 00:37:15 -0700 Subject: [PATCH 0073/1248] dmleung fixed many of ekluzek's comments: defining magic values into physical parameters, changing numbers into double precisions, and putting more comments into the code. 20 Feb 2024 --- src/biogeochem/DUSTMod.F90 | 117 +++++++++++-------- src/biogeophys/SoilStateInitTimeConstMod.F90 | 4 +- 2 files changed, 68 insertions(+), 53 deletions(-) diff --git a/src/biogeochem/DUSTMod.F90 b/src/biogeochem/DUSTMod.F90 index e3f9dd669c..275f0a4c10 100644 --- a/src/biogeochem/DUSTMod.F90 +++ b/src/biogeochem/DUSTMod.F90 @@ -228,7 +228,7 @@ subroutine InitHistory(this, bounds) ptr_patch=this%lnd_frc_mble_patch, set_lake=0._r8, set_urb=0._r8) this%gwc_patch(begp:endp) = spval call hist_addfld1d (fname='GWC', units='kg/kg', & - avgflag='A', long_name='gravimetric water content', & + avgflag='A', long_name='gravimetric soil moisture at the topmost soil layer', & ptr_patch=this%gwc_patch, set_lake=0._r8, set_urb=0._r8) this%liq_frac_patch(begp:endp) = spval call hist_addfld1d (fname='LIQ_FRAC', units='dimensionless', & @@ -276,7 +276,7 @@ subroutine InitHistory(this, bounds) ptr_patch=this%ssr_patch, set_lake=0._r8, set_urb=0._r8) this%lai_patch(begp:endp) = spval call hist_addfld1d (fname='LAI', units='m/s', & - avgflag='A', long_name='landunit-mean LAI for Okin-Pierre scheme', & + avgflag='A', long_name='leaf area index for Okin-Pierre scheme', & ptr_patch=this%lai_patch, set_lake=0._r8, set_urb=0._r8) this%frc_thr_rghn_fct_patch(begp:endp) = spval call hist_addfld1d (fname='FRC_THR_RGHN_FCT', units='dimensionless', & @@ -395,7 +395,7 @@ subroutine DustEmission (bounds, & real(r8), parameter :: flx_mss_fdg_fct = 5.0e-4_r8 ! [frc] Empir. mass flx tuning eflx_lh_vegt !real(r8), parameter :: vai_mbl_thr = 0.3_r8 ! [m2 m-2] VAI threshold quenching dust mobilization character(len=*),parameter :: subname = 'DUSTEmission' - real(r8), parameter :: vai_mbl_thr = 1.0_r8 ! [m2 m-2] new VAI threshold; Danny M. Leung suggests 1, and the old 0.3 seems a bit too small + real(r8), parameter :: vai_mbl_thr = 1.0_r8 ! [m2 m-2] new VAI threshold; Danny M. Leung suggests 1, and Zender's scheme uses 0.3 real(r8), parameter :: Cd0 = 4.4e-5_r8 ! [dimless] proportionality constant in calculation of dust emission coefficient real(r8), parameter :: Ca = 2.7_r8 ! [dimless] proportionality constant in scaling of dust emission exponent real(r8), parameter :: Ce = 2.0_r8 ! [dimless] proportionality constant scaling exponential dependence of dust emission coefficient on standardized soil threshold friction speed @@ -407,6 +407,12 @@ subroutine DustEmission (bounds, & real(r8), parameter :: k = 0.4_r8 ! [dimless] von Karman constant real(r8), parameter :: f_0 = 0.32_r8 ! [dimless] SSR in the immediate lee of a plant real(r8), parameter :: c_e = 4.8_r8 ! [dimless] e-folding distance velocity recovery + real(r8), parameter :: D_p = 130e-6_r8 ! [m] Medium soil particle diameter, assuming a global constant of ~130 um following Leung et al. (2023). dmleung 16 Feb 2024 + real(r8), parameter :: gamma_Shao = 1.65e-4_r8 ! [kg s-2] interparticle cohesion: fitting parameter in Shao and Lu (2000) (S&L00). dmleung 16 Feb 2024 + real(r8), parameter :: A_Shao = 0.0123_r8 ! [dimless] coefficient for aerodynamic force: fitting parameter in Shao and Lu (2000). dmleung 16 Feb 2024 + real(r8), parameter :: frag_expt_thr = 5.0_r8 ! [dimless] threshold for fragmentation exponent defined in Leung et al. (2023), somewhere within 3 to 5. It is used to prevent a local AOD blowup (over Patagonia, Argentina), but one can test larger values and relax the threshold if wanted. dmleung 16 Feb 2024 + real(r8), parameter :: z0a_glob = 1e-4 ! [m] assumed globally constant aeolian roughness length value in Leung et al. (2023), for the log law of the wall for Comola et al. (2019) intermittency scheme. dmleung 20 Feb 2024 + real(r8), parameter :: hgt_sal = 0.1 ! [m] saltation height used by Comola et al. (2019) intermittency scheme for the log law of the wall. dmleung 20 Feb 2024 real(r8) :: numer ! Numerator term for threshold crossing rate real(r8) :: denom ! Denominator term for threshold crossing rate !------------------------------------------------------------------------ @@ -432,28 +438,28 @@ subroutine DustEmission (bounds, & mbl_bsn_fct => dust_inst%mbl_bsn_fct_col , & ! Input: [real(r8) (:) ] basin factor flx_mss_vrt_dst => dust_inst%flx_mss_vrt_dst_patch , & ! Output: [real(r8) (:,:) ] surface dust emission (kg/m**2/s) flx_mss_vrt_dst_tot => dust_inst%flx_mss_vrt_dst_tot_patch , & ! Output: [real(r8) (:) ] total dust flux back to atmosphere (pft) - + ! below variables are defined in Kok et al. (2014) or (mostly) Leung et al. (2023) dust emission scheme. dmleung 16 Feb 2024 dst_emiss_coeff => dust_inst%dst_emiss_coeff_patch , & ! Output dust emission coefficient wnd_frc_thr => dust_inst%wnd_frc_thr_patch , & ! output impact threshold wnd_frc_thr_dry => dust_inst%wnd_frc_thr_dry_patch , & ! output dry threshold lnd_frc_mble => dust_inst%lnd_frc_mble_patch , & ! output bare land fraction wnd_frc_soil => dust_inst%wnd_frc_soil_patch , & ! soil friction velocity u_*s = (u_*)(f_eff) gwc => dust_inst%gwc_patch , & ! output gravimetric water content - liq_frac => dust_inst%liq_frac_patch , & - intrmtncy_fct => dust_inst%intrmtncy_fct_patch , & - stblty => dust_inst%stblty_patch , & - u_mean_slt => dust_inst%u_mean_slt_patch , & - u_sd_slt => dust_inst%u_sd_slt_patch , & - u_fld_thr => dust_inst%u_fld_thr_patch , & - u_impct_thr => dust_inst%u_impct_thr_patch , & - thr_crs_rate => dust_inst%thr_crs_rate_patch , & - prb_crs_fld_thr => dust_inst%prb_crs_fld_thr_patch , & - prb_crs_impct_thr => dust_inst%prb_crs_impct_thr_patch , & - ssr => dust_inst%ssr_patch , & - lai => dust_inst%lai_patch , & - frc_thr_rghn_fct => dust_inst%frc_thr_rghn_fct_patch , & - wnd_frc_thr_std => dust_inst%wnd_frc_thr_std_patch , & - dpfct_rock => dust_inst%dpfct_rock_patch & + liq_frac => dust_inst%liq_frac_patch , & ! output fraction of liquid moisture + intrmtncy_fct => dust_inst%intrmtncy_fct_patch , & ! output intermittency factor eta (fraction of time that dust emission is active within a timestep) + stblty => dust_inst%stblty_patch , & ! stability in similarity theory (no need to output) + u_mean_slt => dust_inst%u_mean_slt_patch , & ! output mean wind speed at 0.1 m height translated from friction velocity using the log law of the wall, assuming neutral condition + u_sd_slt => dust_inst%u_sd_slt_patch , & ! output standard deviation of wind speed from similarity theory + u_fld_thr => dust_inst%u_fld_thr_patch , & ! output fluid threshold wind speed at 0.1 m height translated from the log law of the wall + u_impct_thr => dust_inst%u_impct_thr_patch , & ! output impact threshold wind speed at 0.1 m height translated from the log law of the wall + thr_crs_rate => dust_inst%thr_crs_rate_patch , & ! output threshold crossing rate in Comola 2019 intermittency parameterization + prb_crs_fld_thr => dust_inst%prb_crs_fld_thr_patch , & ! output probability of instantaneous wind crossing fluid threshold in Comola 2019 intermittency parameterization + prb_crs_impct_thr => dust_inst%prb_crs_impct_thr_patch , & ! output probability of instantaneous wind crossing impact threshold in Comola 2019 intermittency parameterization + ssr => dust_inst%ssr_patch , & ! output vegetation drag partition factor in Okin 2008 vegetation roughness effect (called shear stress ratio, SSR in Okin 2008) + lai => dust_inst%lai_patch , & ! leaf area index for calculating vegetation drag partitioning. lai=0 in the ssr equation will lead to infinity, so for now a small value is added into this lai dmleung defined. (no need to output) 16 Feb 2024 + frc_thr_rghn_fct => dust_inst%frc_thr_rghn_fct_patch , & ! output hybrid/total drag partition factor considering both rock and vegetation drag partition factors. + wnd_frc_thr_std => dust_inst%wnd_frc_thr_std_patch , & ! standardized dust emission threshold friction velocity defined in Jasper Kok et al. (2014). + dpfct_rock => dust_inst%dpfct_rock_patch & ! output rock drag partition factor defined in Marticorena and Bergametti 1995. A fraction between 0 and 1. ) ttlai(bounds%begp : bounds%endp) = 0._r8 @@ -570,10 +576,17 @@ subroutine DustEmission (bounds, & !-------------------------------------------------------------------------------------------------- ! put dust emission calculation here to output threshold friction velocity for the whole globe, ! not just when lnd_frc_mbl = 0. Danny M. Leung 27 Nov 2021 - bd = (1._r8-watsat(c,1))*2.7e3_r8 ![kg m-3] Bulk density of dry surface soil + + !#################################################################################################### + ! calculate soil moisture effect for dust emission threshold + ! following Fecan, Marticorena et al. (1999) + ! also see Zender et al. (2003) for DEAD emission scheme and Kok et al. (2014b) for K14 emission scheme in CESM + bd = (1._r8-watsat(c,1))*dns_slt ![kg m-3] Bulk density of dry surface soil (dmleung changed from 2700 to dns_slt, soil particle density, on 16 Feb 2024. Note that dns_slt=2650 kg m-3 so the value is changed by a tiny bit from 2700 to 2650. dns_slt has been here for many years so dns_slt should be used here instead of explicitly tpying the value out. dmleung 16 Feb 2024) + + ! Here convert h2osoi_vol (H2OSOI) at the topmost CTSM soil layer from volumetric (m3 water / m3 soil) to gravimetric soil moisture (kg water / kg soil) gwc_sfc = h2osoi_vol(c,1)*SHR_CONST_RHOFW/bd ![kg kg-1] Gravimetric H2O cont if (gwc_sfc > gwc_thr(c)) then - frc_thr_wet_fct = sqrt(1.0_r8 + 1.21_r8 * (100.0_r8*(gwc_sfc - gwc_thr(c)))**0.68_r8) + frc_thr_wet_fct = sqrt(1.0_r8 + 1.21_r8 * (100.0_r8*(gwc_sfc - gwc_thr(c)))**0.68_r8) ! dmleung's comment: this is an empirical equation by Fecan, Marticorena et al. (1999) on relating the soil moisture factor on enhancing dust emission threshold to gravimetric soil moisture. 1.21 and 0.68 are fitting parameters in the regression done by Fecan; 100 is to convert gracimetric soil moisture from fraction (kg water / kg soil) to percentage. Note that gwc_thr was defined in SoilStateInitConst.F90 as a fraction. 1.0_r8 means there is no soil moisture effect on enhancing dust emission threhsold. dmleung 16 Feb 2024. else frc_thr_wet_fct = 1.0_r8 end if @@ -583,17 +596,17 @@ subroutine DustEmission (bounds, & ! slevis: adding liqfrac here, because related to effects from soil water liqfrac = max( 0.0_r8, min( 1.0_r8, h2osoi_liq(c,1) / (h2osoi_ice(c,1)+h2osoi_liq(c,1)+1.0e-6_r8) ) ) - ! output liquid fraction + ! dmleung: output liquid fraction liq_frac(p) = liqfrac !####################################################################################################### ! calculate Shao & Lu (2000) dust emission threshold scheme here ! use tmp1 from DUSTini for Iversen and White I&W (1982) (~75 um is optimal); use tmp2 for S&L (2000) (~80 um is optimal) + ! see Danny M. Leung et al. (2023) !####################################################################################################### - - tmp2 = 1.0_r8*sqrt(0.0123_r8 * (dns_slt*grav*130.0e-6_r8 + 1.65e-4_r8/130.0e-6_r8)) ! calculate S&L (2000) scheme here for threshold; gamma = 1.65e-4 following S&L00, D_p = 127 um ~ 130 um following Leung et al. (2022). As this is a global constant, this line can be put outside the loop to save computational power. - wnd_frc_thr_dry(p) = tmp2 / sqrt(forc_rho(c)) ! output dry fluid threshold - wnd_frc_thr_slt = tmp2 / sqrt(forc_rho(c)) * frc_thr_wet_fct !* frc_thr_rgh_fct ! fluid threshold + tmp2 = sqrt(A_Shao * (dns_slt*grav*D_p + gamma_Shao/D_p)) ! calculate S&L (2000) scheme here for threshold; gamma = 1.65e-4 following S&L00, D_p = 127 um ~ 130 um following Leung et al. (2023). dmleung use defined parameters instead of typing numerical values 16 Feb 2024 + wnd_frc_thr_dry(p) = tmp2 / sqrt(forc_rho(c)) ! dry fluid threshold + wnd_frc_thr_slt = tmp2 / sqrt(forc_rho(c)) * frc_thr_wet_fct !* frc_thr_rgh_fct ! fluid threshold. dmleung commented out frc_thr_rgh_fct since it is used to modify the wind, not the wind threshold. wnd_frc_thr_slt_it = B_it * tmp2 / sqrt(forc_rho(c)) ! define impact threshold ! the above formula is true for Iversen and White (1982) and Shao and Lu (2000) scheme @@ -606,13 +619,13 @@ subroutine DustEmission (bounds, & ! framentation exponent frag_expt = (Ca * (wnd_frc_thr_slt_std - wnd_frc_thr_slt_std_min) / wnd_frc_thr_slt_std_min) ! fragmentation exponent, defined in Kok et al. (2014a) - if (frag_expt > 5.0_r8) then ! set fragmentation exponent to be 3 or 5 at maximum, to avoid local AOD blowup - frag_expt = 5.0_r8 + if (frag_expt > frag_expt_thr) then ! set fragmentation exponent to be 3 or 5 at maximum, to avoid local AOD blowup + frag_expt = frag_expt_thr end if !################ drag partition effect, and soil friction velocity ########################### ! subsection on computing vegetation drag partition and hybrid drag partition factors - ! in Leung et al. (2022), drag partition effect is applied on the wind instead of the threshold + ! in Leung et al. (2023), drag partition effect is applied on the wind instead of the threshold !############################################################################################## ! the following comes from subr. frc_thr_rgh_fct_get ! purpose: compute factor by which surface roughness increases threshold @@ -620,7 +633,7 @@ subroutine DustEmission (bounds, & if (lnd_frc_mbl(p) > 0.0_r8 .AND. tlai_lu(l)<=1_r8) then ! vegetation drag partition equation following Gregory Okin (2008) + Caroline Pierre et al. (2014) - lai(p) = tlai_lu(l)+0.1_r8 ! LAI+SAI averaged to landunit level; the equation is undefined at lai=0 so we add in a small number. Then lai is saved for output + lai(p) = tlai_lu(l)+0.01_r8 ! LAI+SAI averaged to landunit level; the equation is undefined at lai=0 so we add in a small number. if (lai(p) > 1_r8) then lai(p) = 1_r8 ! setting LAI ~ 0.1 to be a min value (since the value goes to infinity when LAI=0) end if ! and 1 to be a max value as computing K involves 1 / LAI @@ -629,7 +642,7 @@ subroutine DustEmission (bounds, & K_length = 2_r8 * (1_r8/lai(p) - 1_r8) ! Here LAI has to be non-zero to avoid blowup ssr(p) = (K_length+f_0*c_e)/(K_length+c_e) - ! calculation of drag partition effect using LUH2 bare and veg fractions within a grid + ! calculation of the hybrid/total drag partition effect considering both rock and vegetation drag partitioning using LUH2 bare and veg fractions within a grid if (lun%itype(l) == istsoil .or. lun%itype(l) == istcrop) then if (patch%itype(p) == noveg) then frc_thr_rgh_fct = dpfct_rock(p) @@ -646,7 +659,7 @@ subroutine DustEmission (bounds, & else wnd_frc_slt = fv(p) ! The value here is not important since once lnd_frc_mbl(p) <= 0.0_r8 there will be no emission. - frc_thr_rghn_fct(p) = 0.0_r8 ! save and output hybrid drag partition factor + frc_thr_rghn_fct(p) = 0.0_r8 ! When LAI > 1, the drag partition effect is zero. dmleung 16 Feb 2024. end if !########## end of drag partition effect ####################################################### @@ -674,7 +687,7 @@ subroutine DustEmission (bounds, & if (wnd_frc_slt > wnd_frc_thr_slt_it) then! if using Leung's scheme, use impact threshold for dust emission equation - !################### for Leung et al. (2022) ################################################ + !################### for Leung et al. (2023) ################################################ !################ uncomment the below block if want to use Leung's scheme ################### flx_mss_vrt_dst_ttl(p) = dst_emiss_coeff(p) * mss_frc_cly_vld(c) * forc_rho(c) * ((wnd_frc_slt**2.0_r8 - wnd_frc_thr_slt_it**2.0_r8) / wnd_frc_thr_slt_std) * (wnd_frc_slt / wnd_frc_thr_slt_it)**frag_expt ! Leung et al. (2022) uses Kok et al. (2014) dust emission euqation for emission flux @@ -688,8 +701,8 @@ subroutine DustEmission (bounds, & ! subsection for intermittency factor calculation (only used by Leung's scheme, not Zender's scheme) ! 2 Dec 2021: assume no buoyancy contribution to the wind fluctuation (u_sd_slt), so no obul(p) is needed. It is shown to be important for the wind fluctuations contribute little to the intermittency factor. We might add this back in the future revisions. - ! mean lowpass-filtered wind speed at 0.1 m saltation height (assuming aerodynamic roughness length = 1e-4 m globally for ease; also assuming neutral condition) - u_mean_slt(p) = (wnd_frc_slt/k) * log(0.1_r8 / 1e-4_r8) ! translating from ustar (velocity scale) to actual wind + ! mean lowpass-filtered wind speed at hgt_sal = 0.1 m saltation height (assuming aerodynamic roughness length z0a_glob = 1e-4 m globally for ease; also assuming neutral condition) + u_mean_slt(p) = (wnd_frc_slt/k) * log(hgt_sal / z0a_glob) ! translating from ustar (velocity scale) to actual wind stblty(p) = 0 ! -dmleung 2 Dec 2021: use stability = 0 for now, assuming no buoyancy contribution. Might uncomment the above lines in future revisions. if ((12_r8 - 0.5_r8 * stblty(p)) .GE. 0.001_r8) then ! should have used 0 theoretically; used 0.001 here to avoid undefined values @@ -701,27 +714,27 @@ subroutine DustEmission (bounds, & ! threshold velocities ! Here wnd_frc_thr_slt is the fluid threshold; wnd_frc_thr_dry(p) is the dry fluid threshold; B_it*wnd_frc_thr_dry(p) is the impact threshold ! fluid threshold wind at 0.1 m saltation height - u_fld_thr(p) = (wnd_frc_thr_slt/k) * log(0.1_r8 / 1e-4_r8) + u_fld_thr(p) = (wnd_frc_thr_slt/k) * log(hgt_sal / z0a_glob) ! assume a globally constant z0a value for the log law of the wall, but it can be z0m from CLM or, better, z0a from Prigent's roughness dataset. Danny M. Leung et al. (2023) chose to assume a global constant z0a = 1e-4 m. dmleung 20 Feb 2024 ! impact threshold wind at 0.1 m saltation height - u_impct_thr(p) = (wnd_frc_thr_slt_it/k) * log(0.1_r8 / 1e-4_r8) ! to avoid model error + u_impct_thr(p) = (wnd_frc_thr_slt_it/k) * log(hgt_sal / z0a_glob) ! threshold crossing rate - numer = (u_fld_thr(p)**2_r8 - u_impct_thr(p)**2_r8 - 2_r8 * u_mean_slt(p) * (u_fld_thr(p) - u_impct_thr(p))) - denom = (2_r8 * u_sd_slt(p)**2_r8) + numer = (u_fld_thr(p)**2.0_r8 - u_impct_thr(p)**2.0_r8 - 2.0_r8 * u_mean_slt(p) * (u_fld_thr(p) - u_impct_thr(p))) + denom = (2.0_r8 * u_sd_slt(p)**2.0_r8) ! Truncate to zero if the expression inside exp is becoming too large if ( numer/denom < 30._r8 )then - thr_crs_rate(p) = (exp((u_fld_thr(p)**2_r8 - u_impct_thr(p)**2_r8 - 2_r8 * u_mean_slt(p) * (u_fld_thr(p) - u_impct_thr(p))) / (2_r8 * u_sd_slt(p)**2_r8)) + 1_r8)**(-1_r8) + thr_crs_rate(p) = (exp((u_fld_thr(p)**2.0_r8 - u_impct_thr(p)**2.0_r8 - 2.0_r8 * u_mean_slt(p) * (u_fld_thr(p) - u_impct_thr(p))) / (2.0_r8 * u_sd_slt(p)**2.0_r8)) + 1.0_r8)**(-1.0_r8) else thr_crs_rate(p) = 0.0_r8 end if ! probability that lowpass-filtered wind speed does not exceed u_ft - prb_crs_fld_thr(p) = 0.5_r8 * (1_r8 + erf((u_fld_thr(p) - u_mean_slt(p)) / (1.414_r8 * u_sd_slt(p)))) + prb_crs_fld_thr(p) = 0.5_r8 * (1.0_r8 + erf((u_fld_thr(p) - u_mean_slt(p)) / ( sqrt(2.0_r8) * u_sd_slt(p)))) ! probability that lowpass-filtered wind speed does not exceed u_it - prb_crs_impct_thr(p) = 0.5_r8 * (1_r8 + erf((u_impct_thr(p) - u_mean_slt(p)) / (1.414_r8 * u_sd_slt(p)))) + prb_crs_impct_thr(p) = 0.5_r8 * (1.0_r8 + erf((u_impct_thr(p) - u_mean_slt(p)) / ( sqrt(2.0_r8 * u_sd_slt(p)))) - ! intermittency factor (from 0 to 1) - intrmtncy_fct(p) = 1_r8 - prb_crs_fld_thr(p) + thr_crs_rate(p) * (prb_crs_fld_thr(p) - prb_crs_impct_thr(p)) + ! intermittency factor (eta; ranging from 0 to 1) + intrmtncy_fct(p) = 1.0_r8 - prb_crs_fld_thr(p) + thr_crs_rate(p) * (prb_crs_fld_thr(p) - prb_crs_impct_thr(p)) ! multiply dust emission flux by intermittency factor if (intrmtncy_fct(p) /= intrmtncy_fct(p)) then ! if intrmtncy_fct(p) is not NaN then multiply by intermittency factor; this statement is needed because dust emission flx_mss_vrt_dst_ttl(p) has to be non NaN (at least zero) to be outputted @@ -1250,31 +1263,33 @@ subroutine CalcDragPartition(this, bounds, prigent_roughness_stream ) ! constants real(r8), parameter :: D_p = 130e-6_r8 ! [m] Medium soil particle diameter, assuming a global constant - ! of ~130 um following Leung et al. (2022) + ! of ~130 um following Leung et al. (2023) real(r8), parameter :: X = 10_r8 ! [m] distance downwind of the roughness element (rock). Assume - ! estimating roughness effect at a distance of 10 m following Leung et al. (2022) + ! estimating roughness effect at a distance of 10 m following Leung et al. (2023) + real(r8), parameter :: b1 = 0.7_r8 ! [dimless] first fitting coefficient for the drag partition equation by Marticorena and Bergametti (1995), later modified by Darmenova et al. (2009). + real(r8), parameter :: b2 = 0.8_r8 ! [dimless] second fitting coefficient for the drag partition equation by Marticorena and Bergametti (1995), later modified by Darmenova et al. (2009). character(len=*), parameter :: subname = 'PrigentRoughnessStream::CalcDragPartition' !--------------------------------------------------------------------- - ! Make sure we've been initialized + ! Make sure we've initialized the Prigent roughness streams if ( .not. prigent_roughness_stream%IsStreamInit() )then - call endrun(msg=subname//' ERROR Streams have not been initialized, make sure Init is called first' & + call endrun(msg=subname//' ERROR: Streams have not been initialized, make sure Init is called first' & //', and streams are on') end if ! dmleung: this loop calculates the drag partition effect (or roughness effect) of rocks. ! We save the drag partition factor as a patch level quantity. ! TODO: EBK 02/13/2024: Several magic numbers here that should become parameters so the meaning is preserved - z0s = 2_r8 * D_p / 30_r8 ! equation from Frank M. White (2006). + z0s = 2_r8/30_r8 * D_p ! equation for smooth roughness length for soil grain. See Danny M. Leung et al. (2023) and Martin Klose et al. (2021) for instance. 1/15 is a coefficient that relates roughness to soil particle diameter D_p. ! Here we assume soil medium size is a global constant, and so is smooth roughness length. do p = bounds%begp,bounds%endp g = patch%gridcell(p) l = patch%landunit(p) if (lun%itype(l) /= istdlak) then ! Calculating rock drag partition factor using Marticorena and Bergametti (1995). - ! 0.01 is used to convert Z0a from centimeter to meter. + ! 0.01 is used to convert Prigent's roughness length dataset from centimeter to meter. this%dpfct_rock_patch(p) = 1._r8 - ( log(prigent_roughness_stream%prigent_rghn(g)*0.01_r8/z0s) & - / log(0.7_r8*(X/z0s)**0.8_r8) ) + / log(b1 * (X/z0s)**b2 ) ) end if end do diff --git a/src/biogeophys/SoilStateInitTimeConstMod.F90 b/src/biogeophys/SoilStateInitTimeConstMod.F90 index 0e31cc2c53..bf2de65a29 100644 --- a/src/biogeophys/SoilStateInitTimeConstMod.F90 +++ b/src/biogeophys/SoilStateInitTimeConstMod.F90 @@ -703,8 +703,8 @@ subroutine SoilStateInitTimeConst(bounds, soilstate_inst, nlfilename) do c = begc,endc g = col%gridcell(c) - soilstate_inst%gwc_thr_col(c) = 0.01_r8*(0.17_r8*clay3d(g,1) + 0.0014_r8*clay3d(g,1)*clay3d(g,1)) ! Danny M. Leung modified the equation of soil moisture effect for dust emissions using a scale factor of 1. 0.01 is to convert from % to fraction. - !soilstate_inst%gwc_thr_col(c) = 0.17_r8 + 0.14_r8 * clay3d(g,1) * 0.01_r8 ! This was the original equation with 1 / (clay fraction) being the scaling factor. + !soilstate_inst%gwc_thr_col(c) = 0.01_r8*(0.17_r8*clay3d(g,1) + 0.0014_r8*clay3d(g,1)*clay3d(g,1)) ! Jasper Kok et al. (2014) modified the equation of soil moisture effect for dust emissions using a tuning factor of a = 1. 0.01 is to convert the threshold gravimetric soil moisture from % to fraction. Danny M. Leung et al. (2023) followed K14 and used this equation for the paper's results. However, Danny Leung later (Dec 2023) decided to revert to Zender's choice and use a = 1 / (clay fraction), which overall encourages more dust emissions from seriamid and more marginal dust sources. dmleung added this detailed comment on 19 Feb 2024. + soilstate_inst%gwc_thr_col(c) = 0.17_r8 + 0.14_r8 * clay3d(g,1) * 0.01_r8 ! This was the original equation with a = 1 / (clay fraction) being the tuning factor for soil moisture effect in Zender's dust emission scheme. Danny M. Leung decided (Dec, 2023) that the Leung et al. (2023) dust emission scheme in the CESM will use Zender's tuning of a = 1 / (clay fraction), which overall encourages more dust emissions from seriamid and more marginal dust sources. Another advantage of using this tuning factor instead of a = 1 is that the dust emission threshold is linearly dependent on the clay fraction instead of parabolically dependent on clay fraction as in the above line. This means that dust emission becomes a little less sensitive to clay content (soil texture). 0.17 and 0.14 are fitting coefficients in Fecan et al. (1999), and 0.01 is used to convert surface clay fraction from percentage to fraction. dmleung added this detailed comment on 19 Feb 2024. soilstate_inst%mss_frc_cly_vld_col(c) = min(clay3d(g,1) * 0.01_r8, 0.20_r8) end do From fcf1fb93aef1d813d4eeeeb2bc5b4b2920a9775c Mon Sep 17 00:00:00 2001 From: "Danny M. Leung" Date: Tue, 20 Feb 2024 00:44:54 -0700 Subject: [PATCH 0074/1248] small bug fix to the previous commit. dmleung 20 Feb 2024 --- src/biogeochem/DUSTMod.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/biogeochem/DUSTMod.F90 b/src/biogeochem/DUSTMod.F90 index 275f0a4c10..d096cc9e2a 100644 --- a/src/biogeochem/DUSTMod.F90 +++ b/src/biogeochem/DUSTMod.F90 @@ -731,7 +731,7 @@ subroutine DustEmission (bounds, & ! probability that lowpass-filtered wind speed does not exceed u_ft prb_crs_fld_thr(p) = 0.5_r8 * (1.0_r8 + erf((u_fld_thr(p) - u_mean_slt(p)) / ( sqrt(2.0_r8) * u_sd_slt(p)))) ! probability that lowpass-filtered wind speed does not exceed u_it - prb_crs_impct_thr(p) = 0.5_r8 * (1.0_r8 + erf((u_impct_thr(p) - u_mean_slt(p)) / ( sqrt(2.0_r8 * u_sd_slt(p)))) + prb_crs_impct_thr(p) = 0.5_r8 * (1.0_r8 + erf((u_impct_thr(p) - u_mean_slt(p)) / ( sqrt(2.0_r8) * u_sd_slt(p)))) ! intermittency factor (eta; ranging from 0 to 1) intrmtncy_fct(p) = 1.0_r8 - prb_crs_fld_thr(p) + thr_crs_rate(p) * (prb_crs_fld_thr(p) - prb_crs_impct_thr(p)) From b1fad336249cc7e9c0870d85375ec4f30c366716 Mon Sep 17 00:00:00 2001 From: "Danny M. Leung" Date: Tue, 20 Feb 2024 16:43:46 -0700 Subject: [PATCH 0075/1248] dmleung added more comments in the code blocks for the dust emission process in the DustEmission subroutine. 20 Feb 2024 --- src/biogeochem/DUSTMod.F90 | 36 +++++++++++++++++++++++------------- 1 file changed, 23 insertions(+), 13 deletions(-) diff --git a/src/biogeochem/DUSTMod.F90 b/src/biogeochem/DUSTMod.F90 index d096cc9e2a..9b72549e3c 100644 --- a/src/biogeochem/DUSTMod.F90 +++ b/src/biogeochem/DUSTMod.F90 @@ -530,7 +530,7 @@ subroutine DustEmission (bounds, & write(iulog,*)'Error dstmbl: pft= ',p,' lnd_frc_mbl(p)= ',lnd_frc_mbl(p) call endrun(subgrid_index=p, subgrid_level=subgrid_level_patch, msg=errMsg(sourcefile, __LINE__)) end if - end do + end doflx_mss_hrz_slt_ttl = 0.0_r8 ! dmleung add output for bare_frc and veg_frc here if wanted !!!!---------------------- @@ -581,7 +581,9 @@ subroutine DustEmission (bounds, & ! calculate soil moisture effect for dust emission threshold ! following Fecan, Marticorena et al. (1999) ! also see Zender et al. (2003) for DEAD emission scheme and Kok et al. (2014b) for K14 emission scheme in CESM - bd = (1._r8-watsat(c,1))*dns_slt ![kg m-3] Bulk density of dry surface soil (dmleung changed from 2700 to dns_slt, soil particle density, on 16 Feb 2024. Note that dns_slt=2650 kg m-3 so the value is changed by a tiny bit from 2700 to 2650. dns_slt has been here for many years so dns_slt should be used here instead of explicitly tpying the value out. dmleung 16 Feb 2024) + bd = (1._r8-watsat(c,1))*dns_slt ![kg m-3] Bulk density of dry surface soil (dmleung changed from 2700 to dns_slt, soil particle density, on 16 Feb 2024. Note that dns_slt=2650 kg m-3 so the value is changed by a tiny bit from 2700 to 2650. dns_slt has been here for many years so dns_slt should be used here instead of explicitly typing the value out. dmleung 16 Feb 2024) + + ! use emission threshold to calculate standardized threshold and dust emission coefficient ! Here convert h2osoi_vol (H2OSOI) at the topmost CTSM soil layer from volumetric (m3 water / m3 soil) to gravimetric soil moisture (kg water / kg soil) gwc_sfc = h2osoi_vol(c,1)*SHR_CONST_RHOFW/bd ![kg kg-1] Gravimetric H2O cont @@ -612,18 +614,22 @@ subroutine DustEmission (bounds, & ! the above formula is true for Iversen and White (1982) and Shao and Lu (2000) scheme wnd_frc_thr(p) = wnd_frc_thr_slt ! output fluid threshold - ! use emission threshold to calculate standardized threshold and dust emission coefficient + !############################################################################################## + ! dmleung: here, calculate quantities relevant to the fluid threshold + ! standardized fluid threshold wnd_frc_thr_slt_std = wnd_frc_thr_slt * sqrt(forc_rho(c) / forc_rho_std) ! standardized soil threshold friction speed (defined using fluid threshold) wnd_frc_thr_std(p) = wnd_frc_thr_slt_std ! output standardized fluid threshold + ! dust emission coefficient or soil erodibility coefficient (this is analogous to the soil erodibility map or prefenertial source filter in Zender; see zendersoilerodstream) dst_emiss_coeff(p) = Cd0 * exp(-Ce * (wnd_frc_thr_slt_std - wnd_frc_thr_slt_std_min) / wnd_frc_thr_slt_std_min) ! save dust emission coefficient here for all grids - ! framentation exponent + ! framentation exponent (dependent on fluid threshold) frag_expt = (Ca * (wnd_frc_thr_slt_std - wnd_frc_thr_slt_std_min) / wnd_frc_thr_slt_std_min) ! fragmentation exponent, defined in Kok et al. (2014a) if (frag_expt > frag_expt_thr) then ! set fragmentation exponent to be 3 or 5 at maximum, to avoid local AOD blowup frag_expt = frag_expt_thr end if - !################ drag partition effect, and soil friction velocity ########################### + !############################################################################################## + !################ drag partition effect, and soil-surface friction velocity ################### ! subsection on computing vegetation drag partition and hybrid drag partition factors ! in Leung et al. (2023), drag partition effect is applied on the wind instead of the threshold !############################################################################################## @@ -644,12 +650,12 @@ subroutine DustEmission (bounds, & ! calculation of the hybrid/total drag partition effect considering both rock and vegetation drag partitioning using LUH2 bare and veg fractions within a grid if (lun%itype(l) == istsoil .or. lun%itype(l) == istcrop) then - if (patch%itype(p) == noveg) then + if (patch%itype(p) == noveg) then ! if bare, uses rock drag partition factor frc_thr_rgh_fct = dpfct_rock(p) - else - frc_thr_rgh_fct = ssr(p) + else ! if vegetation, uses vegetation drag partition factor + frc_thr_rgh_fct = ssr(p) end if - else + else frc_thr_rgh_fct = 1.0_r8 end if @@ -657,7 +663,7 @@ subroutine DustEmission (bounds, & frc_thr_rghn_fct(p) = frc_thr_rgh_fct ! save and output hybrid drag partition factor - else + else ! for lnd_frc_mbl=0, do not change friction velocity and assume drag partition factor = 0 wnd_frc_slt = fv(p) ! The value here is not important since once lnd_frc_mbl(p) <= 0.0_r8 there will be no emission. frc_thr_rghn_fct(p) = 0.0_r8 ! When LAI > 1, the drag partition effect is zero. dmleung 16 Feb 2024. end if @@ -666,6 +672,8 @@ subroutine DustEmission (bounds, & ! save soil friction velocity and roughness effect before the if-statement wnd_frc_soil(p) = wnd_frc_slt ! save soil friction velocity for CLM output, which has drag partition and Owen effect + ! 20 Feb 2024: dmleung notes that Leung does not consider the Owen's effect. This is Jasper Kok's decision. The Owen's effect should be in Zender's DEAD emission scheme. + ! save land mobile fraction lnd_frc_mble(p) = lnd_frc_mbl(p) ! save land mobile fraction first, before the if-statement ! only perform the following calculations if lnd_frc_mbl is non-zero @@ -673,19 +681,18 @@ subroutine DustEmission (bounds, & if (lnd_frc_mbl(p) > 0.0_r8) then ! if bare land fraction is larger than 0 then calculate the dust emission equation ! reset these variables which will be updated in the following if-block - flx_mss_hrz_slt_ttl = 0.0_r8 flx_mss_vrt_dst_ttl(p) = 0.0_r8 ! the following line comes from subr. dst_mbl ! purpose: threshold saltation wind speed - wnd_rfr_thr_slt = u10(p) * wnd_frc_thr_slt / fv(p) ! keep and use if we want the default Z03 scheme + wnd_rfr_thr_slt = u10(p) * wnd_frc_thr_slt / fv(p) ! use if we want the default Z03 scheme; for Leung 2023 this is not needed ! the following comes from subr. flx_mss_hrz_slt_ttl_Whi79_get ! purpose: compute vertically integrated streamwise mass flux of particles - if (wnd_frc_slt > wnd_frc_thr_slt_it) then! if using Leung's scheme, use impact threshold for dust emission equation + if (wnd_frc_slt > wnd_frc_thr_slt_it) then! if using Leung's scheme, use impact threshold for dust emission equation; if Zender, uses fluid threshold (wnd_frc_thr_slt) for dust emission equation !################### for Leung et al. (2023) ################################################ !################ uncomment the below block if want to use Leung's scheme ################### @@ -699,7 +706,10 @@ subroutine DustEmission (bounds, & !############## Danny M. Leung added the intermittency calculation ################################# ! subsection for intermittency factor calculation (only used by Leung's scheme, not Zender's scheme) + ! Leung et al. (2023) uses the Comola et al. (2019) intermittency scheme for the calculation of intermittent dust emissions. + ! This part takes care of the sub-timestep, high-frequency (< 1 minute period) turblent wind fluctuations occuring at the planetary boundary layer (PBL) near surface. Subtimestep wind gusts and episodes are important for generating emissions in marginal dust source regions, such as semiarid areas and high-latitude polar deserts. ! 2 Dec 2021: assume no buoyancy contribution to the wind fluctuation (u_sd_slt), so no obul(p) is needed. It is shown to be important for the wind fluctuations contribute little to the intermittency factor. We might add this back in the future revisions. + ! 20 Feb 2024: dmleung notes that dmleung may revise Comola's scheme in the future to improve Comola's formulation of the statistical parameterization. ! mean lowpass-filtered wind speed at hgt_sal = 0.1 m saltation height (assuming aerodynamic roughness length z0a_glob = 1e-4 m globally for ease; also assuming neutral condition) u_mean_slt(p) = (wnd_frc_slt/k) * log(hgt_sal / z0a_glob) ! translating from ustar (velocity scale) to actual wind From 4d732449d6dcd6094ca028aacbadca9908ab5212 Mon Sep 17 00:00:00 2001 From: "Danny M. Leung" Date: Tue, 20 Feb 2024 17:23:18 -0700 Subject: [PATCH 0076/1248] dmleung: small bug fix to the previous commit. 20 Feb 2024 --- src/biogeochem/DUSTMod.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/biogeochem/DUSTMod.F90 b/src/biogeochem/DUSTMod.F90 index 9b72549e3c..f0b8931459 100644 --- a/src/biogeochem/DUSTMod.F90 +++ b/src/biogeochem/DUSTMod.F90 @@ -530,7 +530,7 @@ subroutine DustEmission (bounds, & write(iulog,*)'Error dstmbl: pft= ',p,' lnd_frc_mbl(p)= ',lnd_frc_mbl(p) call endrun(subgrid_index=p, subgrid_level=subgrid_level_patch, msg=errMsg(sourcefile, __LINE__)) end if - end doflx_mss_hrz_slt_ttl = 0.0_r8 + end do ! dmleung add output for bare_frc and veg_frc here if wanted !!!!---------------------- From 5aa94945e03fff81ef9c76ad30e74820dd2402b8 Mon Sep 17 00:00:00 2001 From: "Danny M. Leung" Date: Thu, 22 Feb 2024 21:46:37 -0700 Subject: [PATCH 0077/1248] A bug fix for z0s inside CalcDragPartition in DUSTMod.F90. dmleung 22 Feb 2024 --- bld/namelist_files/namelist_defaults_ctsm.xml | 2 +- src/biogeochem/DUSTMod.F90 | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index a52477ce6c..e57a768e67 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -2752,7 +2752,7 @@ use_crop=".true.">lnd/clm2/surfdata_map/ctsm5.1.dev052/landuse.timeseries_mpasa1 lnd/clm2/dustemisdata/Prigent_2005_roughness_0.25x0.25_cdf5_c240127.nc lnd/clm2/dustemisdata/dust_2x2_ESMFmesh_cdf5_c230730.nc +>lnd/clm2/dustemisdata/dust_2x2_ESMFmesh_cdf5_c240221.nc diff --git a/src/biogeochem/DUSTMod.F90 b/src/biogeochem/DUSTMod.F90 index f0b8931459..8b77d355e1 100644 --- a/src/biogeochem/DUSTMod.F90 +++ b/src/biogeochem/DUSTMod.F90 @@ -1290,7 +1290,8 @@ subroutine CalcDragPartition(this, bounds, prigent_roughness_stream ) ! dmleung: this loop calculates the drag partition effect (or roughness effect) of rocks. ! We save the drag partition factor as a patch level quantity. ! TODO: EBK 02/13/2024: Several magic numbers here that should become parameters so the meaning is preserved - z0s = 2_r8/30_r8 * D_p ! equation for smooth roughness length for soil grain. See Danny M. Leung et al. (2023) and Martin Klose et al. (2021) for instance. 1/15 is a coefficient that relates roughness to soil particle diameter D_p. + !z0s = 2_r8/30_r8 * D_p ! equation for smooth roughness length for soil grain. See Danny M. Leung et al. (2023) and Martina Klose et al. (2021) for instance. 1/15 is a coefficient that relates roughness to soil particle diameter D_p. + z0s = 2_r8 * D_p / 30_r8 ! equation for smooth roughness length for soil grain. See Danny M. Leung et al. (2023) and Martina Klose et al. (2021) for instance. 1/15 is a coefficient that relates roughness to soil particle diameter D_p. ! Here we assume soil medium size is a global constant, and so is smooth roughness length. do p = bounds%begp,bounds%endp g = patch%gridcell(p) From 0c62e5bde7016a60bf07d4d9eb9ef990d37d3b9a Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Sat, 24 Feb 2024 21:39:22 -0700 Subject: [PATCH 0078/1248] Fix meshfile names so the resolution name is correct, as pointed out by @dmleung --- 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 e57a768e67..7bb58dcd61 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -2752,7 +2752,7 @@ use_crop=".true.">lnd/clm2/surfdata_map/ctsm5.1.dev052/landuse.timeseries_mpasa1 lnd/clm2/dustemisdata/Prigent_2005_roughness_0.25x0.25_cdf5_c240127.nc lnd/clm2/dustemisdata/dust_2x2_ESMFmesh_cdf5_c240221.nc +>lnd/clm2/dustemisdata/dust_0.25x0.25_ESMFmesh_cdf5_c240222.nc From 942a3aecdc985c056b4231acf4422cb978da04f2 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Sun, 25 Feb 2024 20:50:25 -0700 Subject: [PATCH 0079/1248] Fix a logical comparison so will compile with gnu on Derecho --- src/cpl/share_esmf/PrigentRoughnessStreamType.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cpl/share_esmf/PrigentRoughnessStreamType.F90 b/src/cpl/share_esmf/PrigentRoughnessStreamType.F90 index 751fe8458c..6287b5f552 100644 --- a/src/cpl/share_esmf/PrigentRoughnessStreamType.F90 +++ b/src/cpl/share_esmf/PrigentRoughnessStreamType.F90 @@ -293,7 +293,7 @@ subroutine ReadNML(this, bounds, NLFilename) call shr_mpi_bcast(stream_meshfile_prigentroughness , mpicom) ! Error checking - if ( use_prigent_roughness == .false. )then + if ( .not. use_prigent_roughness )then if ( len_trim(stream_fldFileName_prigentroughness) /= 0 )then call endrun(msg=' ERROR stream_fldFileName_prigentroughness is set, but use_prigent_roughness is FALSE' & //errMsg(sourcefile, __LINE__)) From c27f2093b1a803af46d666de8f464d25b41f9b85 Mon Sep 17 00:00:00 2001 From: "Danny M. Leung" Date: Mon, 26 Feb 2024 18:13:33 -0700 Subject: [PATCH 0080/1248] dmleung: improved LAI treatment in Okin's vegetation drag partitioning. Also added precision in other defined parameters. 26 Feb 2024 --- src/biogeochem/DUSTMod.F90 | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/src/biogeochem/DUSTMod.F90 b/src/biogeochem/DUSTMod.F90 index 8b77d355e1..4eb33c625d 100644 --- a/src/biogeochem/DUSTMod.F90 +++ b/src/biogeochem/DUSTMod.F90 @@ -275,10 +275,10 @@ subroutine InitHistory(this, bounds) avgflag='A', long_name='Okin-Pierre vegetation shear stress ratio (drag partition factor)', & ptr_patch=this%ssr_patch, set_lake=0._r8, set_urb=0._r8) this%lai_patch(begp:endp) = spval - call hist_addfld1d (fname='LAI', units='m/s', & - avgflag='A', long_name='leaf area index for Okin-Pierre scheme', & - ptr_patch=this%lai_patch, set_lake=0._r8, set_urb=0._r8) - this%frc_thr_rghn_fct_patch(begp:endp) = spval + !call hist_addfld1d (fname='LAI', units='m/s', & + ! avgflag='A', long_name='leaf area index for Okin-Pierre scheme', & + ! ptr_patch=this%lai_patch, set_lake=0._r8, set_urb=0._r8) + !this%frc_thr_rghn_fct_patch(begp:endp) = spval call hist_addfld1d (fname='FRC_THR_RGHN_FCT', units='dimensionless', & avgflag='A', long_name='hybrid drag partition (or roughness) factor', & ptr_patch=this%frc_thr_rghn_fct_patch, set_lake=0._r8, set_urb=0._r8) @@ -411,8 +411,9 @@ subroutine DustEmission (bounds, & real(r8), parameter :: gamma_Shao = 1.65e-4_r8 ! [kg s-2] interparticle cohesion: fitting parameter in Shao and Lu (2000) (S&L00). dmleung 16 Feb 2024 real(r8), parameter :: A_Shao = 0.0123_r8 ! [dimless] coefficient for aerodynamic force: fitting parameter in Shao and Lu (2000). dmleung 16 Feb 2024 real(r8), parameter :: frag_expt_thr = 5.0_r8 ! [dimless] threshold for fragmentation exponent defined in Leung et al. (2023), somewhere within 3 to 5. It is used to prevent a local AOD blowup (over Patagonia, Argentina), but one can test larger values and relax the threshold if wanted. dmleung 16 Feb 2024 - real(r8), parameter :: z0a_glob = 1e-4 ! [m] assumed globally constant aeolian roughness length value in Leung et al. (2023), for the log law of the wall for Comola et al. (2019) intermittency scheme. dmleung 20 Feb 2024 - real(r8), parameter :: hgt_sal = 0.1 ! [m] saltation height used by Comola et al. (2019) intermittency scheme for the log law of the wall. dmleung 20 Feb 2024 + real(r8), parameter :: z0a_glob = 1e-4_r8 ! [m] assumed globally constant aeolian roughness length value in Leung et al. (2023), for the log law of the wall for Comola et al. (2019) intermittency scheme. dmleung 20 Feb 2024 + real(r8), parameter :: hgt_sal = 0.1_r8 ! [m] saltation height used by Comola et al. (2019) intermittency scheme for the log law of the wall. dmleung 20 Feb 2024 + real(r8), parameter :: lai0_Okin = 0.1_r8 ! [m2/m2] minimum LAI needed for Okin-Pierre's vegetation drag partition equation. lai=0 in the equation will lead to infinity, so a small value is added into this lai dmleung defined. real(r8) :: numer ! Numerator term for threshold crossing rate real(r8) :: denom ! Denominator term for threshold crossing rate !------------------------------------------------------------------------ @@ -456,7 +457,7 @@ subroutine DustEmission (bounds, & prb_crs_fld_thr => dust_inst%prb_crs_fld_thr_patch , & ! output probability of instantaneous wind crossing fluid threshold in Comola 2019 intermittency parameterization prb_crs_impct_thr => dust_inst%prb_crs_impct_thr_patch , & ! output probability of instantaneous wind crossing impact threshold in Comola 2019 intermittency parameterization ssr => dust_inst%ssr_patch , & ! output vegetation drag partition factor in Okin 2008 vegetation roughness effect (called shear stress ratio, SSR in Okin 2008) - lai => dust_inst%lai_patch , & ! leaf area index for calculating vegetation drag partitioning. lai=0 in the ssr equation will lead to infinity, so for now a small value is added into this lai dmleung defined. (no need to output) 16 Feb 2024 + lai => dust_inst%lai_patch , & ! leaf area index for calculating Okin-Pierre vegetation drag partitioning. lai=0 in the ssr equation will lead to infinity, so a small value is added into this lai dmleung defined. (no need to output) 16 Feb 2024 frc_thr_rghn_fct => dust_inst%frc_thr_rghn_fct_patch , & ! output hybrid/total drag partition factor considering both rock and vegetation drag partition factors. wnd_frc_thr_std => dust_inst%wnd_frc_thr_std_patch , & ! standardized dust emission threshold friction velocity defined in Jasper Kok et al. (2014). dpfct_rock => dust_inst%dpfct_rock_patch & ! output rock drag partition factor defined in Marticorena and Bergametti 1995. A fraction between 0 and 1. @@ -639,14 +640,15 @@ subroutine DustEmission (bounds, & if (lnd_frc_mbl(p) > 0.0_r8 .AND. tlai_lu(l)<=1_r8) then ! vegetation drag partition equation following Gregory Okin (2008) + Caroline Pierre et al. (2014) - lai(p) = tlai_lu(l)+0.01_r8 ! LAI+SAI averaged to landunit level; the equation is undefined at lai=0 so we add in a small number. + !lai(p) = tlai_lu(l)+0.1_r8 ! LAI+SAI averaged to landunit level; the equation is undefined at lai=0, and LAI in CTSM has some zeros over deserts, so we add in a small number. + lai(p) = ttlai(p) + lai0_Okin ! ttlai = tlai+tsai. Okin-Pierre's equation is undefined at lai=0, and LAI in CTSM has some zeros over deserts, so we add in a small number. On 26 Feb 2024, dmleung changed from tlai_lu(l) to ttlai(p) if (lai(p) > 1_r8) then - lai(p) = 1_r8 ! setting LAI ~ 0.1 to be a min value (since the value goes to infinity when LAI=0) - end if ! and 1 to be a max value as computing K involves 1 / LAI + lai(p) = 1_r8 ! setting LAI = 1 to be a max value (since K_length goes to negative when LAI>1) + end if ! ! calculate Okin's shear stress ratio (which is drag partition factor) using Pierre's equation - K_length = 2_r8 * (1_r8/lai(p) - 1_r8) ! Here LAI has to be non-zero to avoid blowup - ssr(p) = (K_length+f_0*c_e)/(K_length+c_e) + K_length = 2_r8 * (1_r8/lai(p) - 1_r8) ! Here LAI has to be non-zero to avoid blowup, and < 1 to avoid -ve K_length. See this equation in Leung et al. (2023) + ssr(p) = (K_length+f_0*c_e)/(K_length+c_e) ! see this equation in Caroline Pierre et al. (2014) or Leung et al. (2023). ! calculation of the hybrid/total drag partition effect considering both rock and vegetation drag partitioning using LUH2 bare and veg fractions within a grid if (lun%itype(l) == istsoil .or. lun%itype(l) == istcrop) then From ac5873b968f0a9dabaa460b9d052a1d76c276683 Mon Sep 17 00:00:00 2001 From: "Danny M. Leung" Date: Tue, 27 Feb 2024 15:47:48 -0700 Subject: [PATCH 0081/1248] dmleung: Now we call the vegetation in Okin scheme VAI instead of LAI. Also set output for impact threshold. 27 Feb 2024 --- src/biogeochem/DUSTMod.F90 | 63 +++++++++++++++++++++++--------------- 1 file changed, 38 insertions(+), 25 deletions(-) diff --git a/src/biogeochem/DUSTMod.F90 b/src/biogeochem/DUSTMod.F90 index 4eb33c625d..17deda7375 100644 --- a/src/biogeochem/DUSTMod.F90 +++ b/src/biogeochem/DUSTMod.F90 @@ -67,6 +67,7 @@ module DUSTMod real(r8), pointer, private :: dst_emiss_coeff_patch (:) ! dust emission coefficient (unitless) real(r8), pointer, private :: wnd_frc_thr_patch (:) ! wet fluid threshold (m/s) real(r8), pointer, private :: wnd_frc_thr_dry_patch (:) ! dry fluid threshold (m/s) + real(r8), pointer, private :: wnd_frc_thr_it_patch (:) ! impact threshold (m/s) real(r8), pointer, private :: lnd_frc_mble_patch (:) ! land mobile fraction real(r8), pointer, private :: liq_frac_patch (:) ! liquid fraction of total water real(r8), pointer, private :: wnd_frc_soil_patch (:) ! soil wind friction velocity (m/s) @@ -81,7 +82,7 @@ module DUSTMod real(r8), pointer, private :: prb_crs_fld_thr_patch (:) ! probability of wind speed crossing fluid threshold real(r8), pointer, private :: prb_crs_impct_thr_patch (:) ! probability of wind speed crossing impact threshold real(r8), pointer, private :: ssr_patch (:) ! [dimless] integrated shear stress ratiio, defined by Okin (2008) and then integrated by Caroline Pierre et al. (2014) - real(r8), pointer, private :: lai_patch (:) ! [m2 leaf /m2 land] LAI+SAI for calculating Okin's drag partition, averaged to landunit level + real(r8), pointer, private :: vai_Okin_patch (:) ! [m2 leaf /m2 land] LAI+SAI for calculating Okin drag partition real(r8), pointer, private :: frc_thr_rghn_fct_patch (:) ! [dimless] hybrid drag partition (or called roughness) factor real(r8), pointer, private :: wnd_frc_thr_std_patch (:) ! standardized fluid threshold friction velocity (m/s) type(prigentroughnessstream_type), private :: prigent_roughness_stream ! Prigent roughness stream data @@ -144,6 +145,7 @@ subroutine InitAllocate(this, bounds) allocate(this%dst_emiss_coeff_patch (begp:endp)) ; this%dst_emiss_coeff_patch (:) = nan allocate(this%wnd_frc_thr_patch (begp:endp)) ; this%wnd_frc_thr_patch (:) = nan allocate(this%wnd_frc_thr_dry_patch (begp:endp)) ; this%wnd_frc_thr_dry_patch (:) = nan + allocate(this%wnd_frc_thr_it_patch (begp:endp)) ; this%wnd_frc_thr_it_patch (:) = nan allocate(this%lnd_frc_mble_patch (begp:endp)) ; this%lnd_frc_mble_patch (:) = nan allocate(this%wnd_frc_soil_patch (begp:endp)) ; this%wnd_frc_soil_patch (:) = nan allocate(this%gwc_patch (begp:endp)) ; this%gwc_patch (:) = nan @@ -158,7 +160,7 @@ subroutine InitAllocate(this, bounds) allocate(this%prb_crs_fld_thr_patch (begp:endp)) ; this%prb_crs_fld_thr_patch (:) = nan allocate(this%prb_crs_impct_thr_patch (begp:endp)) ; this%prb_crs_impct_thr_patch (:) = nan allocate(this%ssr_patch (begp:endp)) ; this%ssr_patch (:) = nan - allocate(this%lai_patch (begp:endp)) ; this%lai_patch (:) = nan + allocate(this%vai_Okin_patch (begp:endp)) ; this%vai_Okin_patch (:) = nan allocate(this%frc_thr_rghn_fct_patch (begp:endp)) ; this%frc_thr_rghn_fct_patch (:) = nan allocate(this%wnd_frc_thr_std_patch (begp:endp)) ; this%wnd_frc_thr_std_patch (:) = nan allocate(this%dpfct_rock_patch (begp:endp)) ; this%dpfct_rock_patch (:) = nan @@ -207,8 +209,8 @@ subroutine InitHistory(this, bounds) ptr_patch=this%vlc_trb_4_patch, default='inactive') this%dst_emiss_coeff_patch(begp:endp) = spval - call hist_addfld1d (fname='C_d', units='dimensionless', & - avgflag='A', long_name='dust emission coefficient', & + call hist_addfld1d (fname='DUST_EMIS_COEFF', units='dimensionless', & + avgflag='A', long_name='soil erodibility or dust emission coefficient for Kok emission scheme', & ptr_patch=this%dst_emiss_coeff_patch, set_lake=0._r8, set_urb=0._r8) this%wnd_frc_thr_patch(begp:endp) = spval call hist_addfld1d (fname='WND_FRC_FT', units='m/s', & @@ -218,6 +220,10 @@ subroutine InitHistory(this, bounds) call hist_addfld1d (fname='WND_FRC_FT_DRY', units='m/s', & avgflag='A', long_name='dry fluid threshold friction velocity', & ptr_patch=this%wnd_frc_thr_dry_patch, set_lake=0._r8, set_urb=0._r8) + this%wnd_frc_thr_it_patch(begp:endp) = spval + call hist_addfld1d (fname='WND_FRC_IT', units='m/s', & + avgflag='A', long_name='impact threshold friction velocity', & + ptr_patch=this%wnd_frc_thr_it_patch, set_lake=0._r8, set_urb=0._r8) this%wnd_frc_soil_patch(begp:endp) = spval call hist_addfld1d (fname='WND_FRC_SOIL', units='m/s', & avgflag='A', long_name='soil surface wind friction velocity', & @@ -274,11 +280,11 @@ subroutine InitHistory(this, bounds) call hist_addfld1d (fname='SSR', units='m/s', & avgflag='A', long_name='Okin-Pierre vegetation shear stress ratio (drag partition factor)', & ptr_patch=this%ssr_patch, set_lake=0._r8, set_urb=0._r8) - this%lai_patch(begp:endp) = spval - !call hist_addfld1d (fname='LAI', units='m/s', & - ! avgflag='A', long_name='leaf area index for Okin-Pierre scheme', & - ! ptr_patch=this%lai_patch, set_lake=0._r8, set_urb=0._r8) - !this%frc_thr_rghn_fct_patch(begp:endp) = spval + this%vai_Okin_patch(begp:endp) = spval + call hist_addfld1d (fname='VAI_OKIN', units='m/s', & + avgflag='A', long_name='vegetation area index used in the Okin-Pierre plant drag partition scheme', & + ptr_patch=this%vai_Okin_patch, set_lake=0._r8, set_urb=0._r8) + this%frc_thr_rghn_fct_patch(begp:endp) = spval call hist_addfld1d (fname='FRC_THR_RGHN_FCT', units='dimensionless', & avgflag='A', long_name='hybrid drag partition (or roughness) factor', & ptr_patch=this%frc_thr_rghn_fct_patch, set_lake=0._r8, set_urb=0._r8) @@ -315,7 +321,7 @@ subroutine InitCold(this, bounds) end if end do - ! Caulculate Drag Partition factor + ! Caulculate Drag Partition factor (Marticorena and Bergametti 1995 formulation) if ( this%prigent_roughness_stream%useStreams() )then !if usestreams == true, and it should be always true call this%CalcDragPartition( bounds, this%prigent_roughness_stream ) else @@ -413,7 +419,7 @@ subroutine DustEmission (bounds, & real(r8), parameter :: frag_expt_thr = 5.0_r8 ! [dimless] threshold for fragmentation exponent defined in Leung et al. (2023), somewhere within 3 to 5. It is used to prevent a local AOD blowup (over Patagonia, Argentina), but one can test larger values and relax the threshold if wanted. dmleung 16 Feb 2024 real(r8), parameter :: z0a_glob = 1e-4_r8 ! [m] assumed globally constant aeolian roughness length value in Leung et al. (2023), for the log law of the wall for Comola et al. (2019) intermittency scheme. dmleung 20 Feb 2024 real(r8), parameter :: hgt_sal = 0.1_r8 ! [m] saltation height used by Comola et al. (2019) intermittency scheme for the log law of the wall. dmleung 20 Feb 2024 - real(r8), parameter :: lai0_Okin = 0.1_r8 ! [m2/m2] minimum LAI needed for Okin-Pierre's vegetation drag partition equation. lai=0 in the equation will lead to infinity, so a small value is added into this lai dmleung defined. + real(r8), parameter :: vai0_Okin = 0.1_r8 ! [m2/m2] minimum VAI needed for Okin-Pierre's vegetation drag partition equation. lai=0 in the equation will lead to infinity, so a small value is added into this lai dmleung defined. real(r8) :: numer ! Numerator term for threshold crossing rate real(r8) :: denom ! Denominator term for threshold crossing rate !------------------------------------------------------------------------ @@ -441,8 +447,9 @@ subroutine DustEmission (bounds, & flx_mss_vrt_dst_tot => dust_inst%flx_mss_vrt_dst_tot_patch , & ! Output: [real(r8) (:) ] total dust flux back to atmosphere (pft) ! below variables are defined in Kok et al. (2014) or (mostly) Leung et al. (2023) dust emission scheme. dmleung 16 Feb 2024 dst_emiss_coeff => dust_inst%dst_emiss_coeff_patch , & ! Output dust emission coefficient - wnd_frc_thr => dust_inst%wnd_frc_thr_patch , & ! output impact threshold - wnd_frc_thr_dry => dust_inst%wnd_frc_thr_dry_patch , & ! output dry threshold + wnd_frc_thr => dust_inst%wnd_frc_thr_patch , & ! output fluid threshold + wnd_frc_thr_dry => dust_inst%wnd_frc_thr_dry_patch , & ! output dry fluid threshold + wnd_frc_thr_it => dust_inst%wnd_frc_thr_it_patch , & ! output impact threshold lnd_frc_mble => dust_inst%lnd_frc_mble_patch , & ! output bare land fraction wnd_frc_soil => dust_inst%wnd_frc_soil_patch , & ! soil friction velocity u_*s = (u_*)(f_eff) gwc => dust_inst%gwc_patch , & ! output gravimetric water content @@ -457,7 +464,7 @@ subroutine DustEmission (bounds, & prb_crs_fld_thr => dust_inst%prb_crs_fld_thr_patch , & ! output probability of instantaneous wind crossing fluid threshold in Comola 2019 intermittency parameterization prb_crs_impct_thr => dust_inst%prb_crs_impct_thr_patch , & ! output probability of instantaneous wind crossing impact threshold in Comola 2019 intermittency parameterization ssr => dust_inst%ssr_patch , & ! output vegetation drag partition factor in Okin 2008 vegetation roughness effect (called shear stress ratio, SSR in Okin 2008) - lai => dust_inst%lai_patch , & ! leaf area index for calculating Okin-Pierre vegetation drag partitioning. lai=0 in the ssr equation will lead to infinity, so a small value is added into this lai dmleung defined. (no need to output) 16 Feb 2024 + vai_Okin => dust_inst%vai_Okin_patch , & ! vegetation area index for calculating Okin-Pierre vegetation drag partitioning. vai=0 in the ssr equation will lead to infinity, so a small value is added into this vai dmleung defined. (no need to output) 16 Feb 2024 frc_thr_rghn_fct => dust_inst%frc_thr_rghn_fct_patch , & ! output hybrid/total drag partition factor considering both rock and vegetation drag partition factors. wnd_frc_thr_std => dust_inst%wnd_frc_thr_std_patch , & ! standardized dust emission threshold friction velocity defined in Jasper Kok et al. (2014). dpfct_rock => dust_inst%dpfct_rock_patch & ! output rock drag partition factor defined in Marticorena and Bergametti 1995. A fraction between 0 and 1. @@ -557,7 +564,7 @@ subroutine DustEmission (bounds, & prb_crs_impct_thr(p) = 0.0_r8 intrmtncy_fct(p) = 0.0_r8 ssr(p) = 0.0_r8 - lai(p) = 0.0_r8 + vai_Okin(p) = 0.0_r8 frc_thr_rghn_fct(p) = 0.0_r8 wnd_frc_thr_std(p) = 0.0_r8 end do @@ -614,6 +621,7 @@ subroutine DustEmission (bounds, & ! the above formula is true for Iversen and White (1982) and Shao and Lu (2000) scheme wnd_frc_thr(p) = wnd_frc_thr_slt ! output fluid threshold + wnd_frc_thr_it(p) = wnd_frc_thr_slt_it ! output impact threshold !############################################################################################## ! dmleung: here, calculate quantities relevant to the fluid threshold @@ -638,17 +646,22 @@ subroutine DustEmission (bounds, & ! purpose: compute factor by which surface roughness increases threshold ! friction velocity (currently a constant) - if (lnd_frc_mbl(p) > 0.0_r8 .AND. tlai_lu(l)<=1_r8) then + !if (lnd_frc_mbl(p) > 0.0_r8 .AND. tlai_lu(l)<=1_r8) then + if (lnd_frc_mbl(p) > 0.0_r8 .AND. ttlai(p)<=1_r8) then ! vegetation drag partition equation following Gregory Okin (2008) + Caroline Pierre et al. (2014) !lai(p) = tlai_lu(l)+0.1_r8 ! LAI+SAI averaged to landunit level; the equation is undefined at lai=0, and LAI in CTSM has some zeros over deserts, so we add in a small number. - lai(p) = ttlai(p) + lai0_Okin ! ttlai = tlai+tsai. Okin-Pierre's equation is undefined at lai=0, and LAI in CTSM has some zeros over deserts, so we add in a small number. On 26 Feb 2024, dmleung changed from tlai_lu(l) to ttlai(p) - if (lai(p) > 1_r8) then - lai(p) = 1_r8 ! setting LAI = 1 to be a max value (since K_length goes to negative when LAI>1) - end if ! + !lai(p) = ttlai(p) + lai0_Okin ! ttlai = tlai+tsai. Okin-Pierre's equation is undefined at lai=0, and LAI in CTSM has some zeros over deserts, so we add in a small number. On 26 Feb 2024, dmleung changed from tlai_lu(l) to ttlai(p) + !if (lai(p) > 1_r8) then + ! lai(p) = 1_r8 ! setting LAI = 1 to be a max value (since K_length goes to negative when LAI>1) + !end if ! - ! calculate Okin's shear stress ratio (which is drag partition factor) using Pierre's equation - K_length = 2_r8 * (1_r8/lai(p) - 1_r8) ! Here LAI has to be non-zero to avoid blowup, and < 1 to avoid -ve K_length. See this equation in Leung et al. (2023) - ssr(p) = (K_length+f_0*c_e)/(K_length+c_e) ! see this equation in Caroline Pierre et al. (2014) or Leung et al. (2023). + if (ttlai(p) + vai0_Okin <= 1_r8) then + vai_Okin(p) = ttlai(p) + vai0_Okin ! ttlai = vai = tlai+tsai. Okin-Pierre's equation is undefined at vai=0, and VAI in CTSM has some zeros over deserts, so we add in a small number. On 26 Feb 2024, dmleung changed from tlai_lu(l) to ttlai(p) + end if ! In the Okin-Pierre formulation, VAI has to be 0 < VAI <= 1. + + ! calculate Okin's shear stress ratio (SSR, which is vegetation drag partition factor) using Pierre's equation + K_length = 2_r8 * (1_r8/vai_Okin(p) - 1_r8) ! Here LAI has to be non-zero to avoid blowup, and < 1 to avoid -ve K_length. See this equation in Leung et al. (2023). This line is Okin's formulation + ssr(p) = (K_length+f_0*c_e)/(K_length+c_e) ! see this equation in Caroline Pierre et al. (2014) or Leung et al. (2023). This line is Pierre's formulation. ! calculation of the hybrid/total drag partition effect considering both rock and vegetation drag partitioning using LUH2 bare and veg fractions within a grid if (lun%itype(l) == istsoil .or. lun%itype(l) == istcrop) then @@ -1250,7 +1263,7 @@ subroutine CalcDragPartition(this, bounds, prigent_roughness_stream ) ! !DESCRIPTION: ! Commented below by Danny M. Leung 31 Dec 2022 ! Calculate the drag partition effect of friction velocity due to surface roughness following - ! Leung et al. (2022). This module is used in the dust emission module DUSTMod.F90 for + ! Leung et al. (2023). This module is used in the dust emission module DUSTMod.F90 for ! calculating drag partitioning. The drag partition equation comes from Marticorena and ! Bergametti (1995) with constants modified by Darmenova et al. (2009). Here it is assumed ! that this equation is used only over arid/desertic regions, such that Catherine Prigent's @@ -1299,7 +1312,7 @@ subroutine CalcDragPartition(this, bounds, prigent_roughness_stream ) g = patch%gridcell(p) l = patch%landunit(p) if (lun%itype(l) /= istdlak) then - ! Calculating rock drag partition factor using Marticorena and Bergametti (1995). + ! Calculating rock drag partition factor using the Marticorena and Bergametti (1995) formulation. ! 0.01 is used to convert Prigent's roughness length dataset from centimeter to meter. this%dpfct_rock_patch(p) = 1._r8 - ( log(prigent_roughness_stream%prigent_rghn(g)*0.01_r8/z0s) & / log(b1 * (X/z0s)**b2 ) ) From 3b4d882878204b3dcda3a651375d12a9a074940f Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Tue, 12 Mar 2024 15:51:13 -0600 Subject: [PATCH 0082/1248] Add matrixcn code for residue removal variables --- src/biogeochem/CNPhenologyMod.F90 | 42 ++++++++++++++++++------------- 1 file changed, 25 insertions(+), 17 deletions(-) diff --git a/src/biogeochem/CNPhenologyMod.F90 b/src/biogeochem/CNPhenologyMod.F90 index 619b28801b..b53c195418 100644 --- a/src/biogeochem/CNPhenologyMod.F90 +++ b/src/biogeochem/CNPhenologyMod.F90 @@ -3605,43 +3605,51 @@ subroutine CNOffsetLitterfall (num_soilp, filter_soilp, & ! Matrix for grain, livestem to litter, leaf to litter, and biofuel if(use_matrixcn)then - if(reproductivec(p,1) .gt. 0)then + if(reproductivec(p,1) > 0._r8)then grainc_to_out = reproductivec(p,1) * matrix_update_phc(p,igrain_to_iout_phc,(repr_grainc_to_seed(p,1) + repr_grainc_to_food(p,1)) / reproductivec(p,1),dt,cnveg_carbonflux_inst,matrixcheck_ph,acc_ph) else - repr_grainc_to_seed(p,1) = 0 - repr_grainc_to_food(p,1) = 0 + repr_grainc_to_seed(p,1) = 0._r8 + repr_grainc_to_food(p,1) = 0._r8 end if - if(reproductiven(p,1) .gt. 0)then + if(reproductiven(p,1) > 0._r8)then grainn_to_out = reproductiven(p,1) * matrix_update_phn(p,igrain_to_iout_phn,(repr_grainn_to_seed(p,1) + repr_grainn_to_food(p,1)) / reproductiven(p,1),dt,cnveg_nitrogenflux_inst,matrixcheck_ph,acc_ph) else - repr_grainn_to_seed(p,1) = 0 - repr_grainn_to_food(p,1) = 0 + repr_grainn_to_seed(p,1) = 0._r8 + repr_grainn_to_food(p,1) = 0._r8 end if - if(livestemc(p) .gt. 0)then + if(livestemc(p) > 0._r8)then livestemc_to_litter(p) = livestemc(p) * matrix_update_phc(p,ilivestem_to_iout_phc,livestemc_to_litter(p) / livestemc(p),dt,cnveg_carbonflux_inst,matrixcheck_ph,acc_ph) + livestemc_to_removedresiduec(p) = livestemc(p) * matrix_update_gmc(p,ilivestem_to_iout_gmc,livestemc_to_removedresiduec(p) / livestemc(p),dt,cnveg_carbonflux_inst,matrixcheck_ph,.True.) livestemc_to_biofuelc(p) = livestemc(p) * matrix_update_gmc(p,ilivestem_to_iout_gmc,livestemc_to_biofuelc(p) / livestemc(p),dt,cnveg_carbonflux_inst,matrixcheck_ph,.True.) else - livestemc_to_litter(p) = 0 - livestemc_to_biofuelc(p) = 0 + livestemc_to_litter(p) = 0._r8 + livestemc_to_removedresiduec(p) = 0._r8 + livestemc_to_biofuelc(p) = 0._r8 end if - if(livestemn(p) .gt. 0)then + if(livestemn(p) > 0._r8)then livestemn_to_biofueln(p) = livestemn(p) * matrix_update_gmn(p,ilivestem_to_iout_gmn,livestemn_to_biofueln(p) / livestemn(p),dt,cnveg_nitrogenflux_inst,matrixcheck_ph,.True.) + livestemn_to_removedresiduen(p) = livestemn(p) * matrix_update_gmn(p,ilivestem_to_iout_gmn,livestemn_to_removedresiduen(p) / livestemn(p),dt,cnveg_nitrogenflux_inst,matrixcheck_ph,.True.) livestemn_to_litter(p) = livestemn(p) * matrix_update_phn(p,ilivestem_to_iout_phn, (1._r8- biofuel_harvfrac(ivt(p)))/dt, dt,cnveg_nitrogenflux_inst,matrixcheck_ph,acc_ph) else - livestemn_to_biofueln(p) = 0 - livestemn_to_litter(p) = 0 + livestemn_to_biofueln(p) = 0._r8 + livestemn_to_removedresiduen(p) = 0._r8 + livestemn_to_litter(p) = 0._r8 end if - if(leafn(p) > 0)then + if(leafn(p) > 0._r8)then leafn_to_biofueln(p) = leafn(p) * matrix_update_gmn(p,ileaf_to_iout_gmn,leafn_to_biofueln(p) / leafn(p),dt,cnveg_nitrogenflux_inst,matrixcheck_ph,.True.) + leafn_to_removedresiduen(p) = leafn(p) * matrix_update_gmn(p,ileaf_to_iout_gmn,leafn_to_removedresiduen(p) / leafn(p),dt,cnveg_nitrogenflux_inst,matrixcheck_ph,.True.) else - leafn_to_biofueln(p) = 0 + leafn_to_biofueln(p) = 0._r8 + leafn_to_removedresiduen(p) = 0._r8 end if - if (leafc(p) > 0)then + if (leafc(p) > 0._r8)then leafc_to_biofuelc(p) = leafc(p) * matrix_update_gmc(p,ileaf_to_iout_gmc,leafc_to_biofuelc(p) / leafc(p),dt,cnveg_carbonflux_inst,matrixcheck_ph,.True.) + leafc_to_removedresiduec(p) = leafc(p) * matrix_update_gmc(p,ileaf_to_iout_gmc,leafc_to_removedresiduec(p) / leafc(p),dt,cnveg_nitrogenflux_inst,matrixcheck_ph,.True.) leafc_to_litter(p) = leafc(p) * matrix_update_phc(p,ileaf_to_iout_phc,leafc_to_litter(p) / leafc(p),dt,cnveg_carbonflux_inst,matrixcheck_ph,acc_ph) else - leafc_to_biofuelc(p) = 0 - leafc_to_litter(p) = 0 + leafc_to_biofuelc(p) = 0._r8 + leafc_to_removedresiduec(p) = 0._r8 + leafc_to_litter(p) = 0._r8 end if else ! NOTE: The non matrix version of this is in CNCStateUpdate1::CStateUpdate1 EBK (11/26/2019) From fe50ce16c03446c86b7018d1c655ca9a71b61982 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Tue, 12 Mar 2024 16:08:18 -0600 Subject: [PATCH 0083/1248] Update comment based on most recent code changes --- src/biogeochem/CNPhenologyMod.F90 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/biogeochem/CNPhenologyMod.F90 b/src/biogeochem/CNPhenologyMod.F90 index b53c195418..c6e6cf3635 100644 --- a/src/biogeochem/CNPhenologyMod.F90 +++ b/src/biogeochem/CNPhenologyMod.F90 @@ -3603,7 +3603,8 @@ subroutine CNOffsetLitterfall (num_soilp, filter_soilp, & ! as well as leaf C:N ratio (unaffected by biofuel harvest). It thus does not ! need to be updated here. - ! Matrix for grain, livestem to litter, leaf to litter, and biofuel + ! Matrix for grain + ! Matrix for livestem/leaf to litter, biofuel, and removed residue if(use_matrixcn)then if(reproductivec(p,1) > 0._r8)then grainc_to_out = reproductivec(p,1) * matrix_update_phc(p,igrain_to_iout_phc,(repr_grainc_to_seed(p,1) + repr_grainc_to_food(p,1)) / reproductivec(p,1),dt,cnveg_carbonflux_inst,matrixcheck_ph,acc_ph) From acd1413ef75868c873e72c17810704049495c00f Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Tue, 12 Mar 2024 16:25:36 -0600 Subject: [PATCH 0084/1248] Correction to latest code mods --- src/biogeochem/CNPhenologyMod.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/biogeochem/CNPhenologyMod.F90 b/src/biogeochem/CNPhenologyMod.F90 index c6e6cf3635..c81dd4215d 100644 --- a/src/biogeochem/CNPhenologyMod.F90 +++ b/src/biogeochem/CNPhenologyMod.F90 @@ -3645,7 +3645,7 @@ subroutine CNOffsetLitterfall (num_soilp, filter_soilp, & end if if (leafc(p) > 0._r8)then leafc_to_biofuelc(p) = leafc(p) * matrix_update_gmc(p,ileaf_to_iout_gmc,leafc_to_biofuelc(p) / leafc(p),dt,cnveg_carbonflux_inst,matrixcheck_ph,.True.) - leafc_to_removedresiduec(p) = leafc(p) * matrix_update_gmc(p,ileaf_to_iout_gmc,leafc_to_removedresiduec(p) / leafc(p),dt,cnveg_nitrogenflux_inst,matrixcheck_ph,.True.) + leafc_to_removedresiduec(p) = leafc(p) * matrix_update_gmc(p,ileaf_to_iout_gmc,leafc_to_removedresiduec(p) / leafc(p),dt,cnveg_carbonflux_inst,matrixcheck_ph,.True.) leafc_to_litter(p) = leafc(p) * matrix_update_phc(p,ileaf_to_iout_phc,leafc_to_litter(p) / leafc(p),dt,cnveg_carbonflux_inst,matrixcheck_ph,acc_ph) else leafc_to_biofuelc(p) = 0._r8 From 82c1903287d254dc5b8ed5084c38118029eab90c Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Tue, 19 Mar 2024 11:23:05 -0600 Subject: [PATCH 0085/1248] Corrections for PEM...till test to PASS --- .../SoilBiogeochemDecompCascadeBGCMod.F90 | 21 +++++---------- .../SoilBiogeochemDecompCascadeMIMICSMod.F90 | 26 +++++++++++++++++-- 2 files changed, 31 insertions(+), 16 deletions(-) diff --git a/src/soilbiogeochem/SoilBiogeochemDecompCascadeBGCMod.F90 b/src/soilbiogeochem/SoilBiogeochemDecompCascadeBGCMod.F90 index 139cdbba32..49fc95d6f5 100644 --- a/src/soilbiogeochem/SoilBiogeochemDecompCascadeBGCMod.F90 +++ b/src/soilbiogeochem/SoilBiogeochemDecompCascadeBGCMod.F90 @@ -911,23 +911,16 @@ subroutine decomp_rate_constants_bgc(bounds, num_bgc_soilc, filter_bgc_soilc, & ! Above into soil matrix if(use_soil_matrixcn)then - Ksoil%DM(c,j+nlevdecomp*(i_met_lit-1)) = k_l1 * t_scalar(c,j) * w_scalar(c,j) * & - depth_scalar(c,j) * o_scalar(c,j) * spinup_geogterm_l1(c) * dt - Ksoil%DM(c,j+nlevdecomp*(i_cel_lit-1)) = k_l2_l3 * t_scalar(c,j) * w_scalar(c,j) * & - depth_scalar(c,j) * o_scalar(c,j) * spinup_geogterm_l23(c) * dt - Ksoil%DM(c,j+nlevdecomp*(i_lig_lit-1)) = k_l2_l3 * t_scalar(c,j) * w_scalar(c,j) * & - depth_scalar(c,j) * o_scalar(c,j) * spinup_geogterm_l23(c) * dt - Ksoil%DM(c,j+nlevdecomp*(i_act_som-1)) = k_s1 * t_scalar(c,j) * w_scalar(c,j) * & - depth_scalar(c,j) * o_scalar(c,j) * spinup_geogterm_s1(c) * dt - Ksoil%DM(c,j+nlevdecomp*(i_slo_som-1)) = k_s2 * t_scalar(c,j) * w_scalar(c,j) * & - depth_scalar(c,j) * o_scalar(c,j) * spinup_geogterm_s2(c) * dt - Ksoil%DM(c,j+nlevdecomp*(i_pas_som-1)) = k_s3 * t_scalar(c,j) * w_scalar(c,j) * & - depth_scalar(c,j) * o_scalar(c,j) * spinup_geogterm_s3(c) * dt + Ksoil%DM(c,j+nlevdecomp*(i_met_lit-1)) = decomp_k(c,j,i_met_lit) * dt + Ksoil%DM(c,j+nlevdecomp*(i_cel_lit-1)) = decomp_k(c,j,i_cel_lit) * dt + Ksoil%DM(c,j+nlevdecomp*(i_lig_lit-1)) = decomp_k(c,j,i_lig_lit) * dt + Ksoil%DM(c,j+nlevdecomp*(i_act_som-1)) = decomp_k(c,j,i_act_som) * dt + Ksoil%DM(c,j+nlevdecomp*(i_slo_som-1)) = decomp_k(c,j,i_slo_som) * dt + Ksoil%DM(c,j+nlevdecomp*(i_pas_som-1)) = decomp_k(c,j,i_pas_som) * dt ! same for cwd but only if fates is not enabled; fates handles CWD ! on its own structure if (.not. use_fates) then - Ksoil%DM(c,j+nlevdecomp*(i_cwd-1)) = k_frag * t_scalar(c,j) * w_scalar(c,j) * depth_scalar(c,j) * & - o_scalar(c,j) * spinup_geogterm_cwd(c) * dt + Ksoil%DM(c,j+nlevdecomp*(i_cwd-1)) = decomp_k(c,j,i_cwd) * dt end if end if !use_soil_matrixcn end do diff --git a/src/soilbiogeochem/SoilBiogeochemDecompCascadeMIMICSMod.F90 b/src/soilbiogeochem/SoilBiogeochemDecompCascadeMIMICSMod.F90 index 65091755f5..e9bb60bcec 100644 --- a/src/soilbiogeochem/SoilBiogeochemDecompCascadeMIMICSMod.F90 +++ b/src/soilbiogeochem/SoilBiogeochemDecompCascadeMIMICSMod.F90 @@ -18,7 +18,7 @@ module SoilBiogeochemDecompCascadeMIMICSMod use spmdMod , only : masterproc use abortutils , only : endrun use CNSharedParamsMod , only : CNParamsShareInst, nlev_soildecomp_standard - use SoilBiogeochemDecompCascadeConType , only : decomp_cascade_con + use SoilBiogeochemDecompCascadeConType , only : decomp_cascade_con, InitSoilTransfer, use_soil_matrixcn use SoilBiogeochemStateType , only : soilbiogeochem_state_type use SoilBiogeochemCarbonFluxType , only : soilbiogeochem_carbonflux_type use SoilBiogeochemCarbonStateType , only : soilbiogeochem_carbonstate_type @@ -734,6 +734,8 @@ subroutine init_decompcascade_mimics(bounds, soilbiogeochem_state_inst, soilstat nue_decomp_cascade(i_cwdl2) = 1.0_r8 end if + if (use_soil_matrixcn) call InitSoilTransfer() + deallocate(params_inst%mimics_mge) deallocate(params_inst%mimics_vmod) deallocate(params_inst%mimics_vint) @@ -763,7 +765,7 @@ subroutine decomp_rates_mimics(bounds, num_bgc_soilc, filter_bgc_soilc, & ! decomposition cascade model ! ! !USES: - use clm_time_manager , only : get_average_days_per_year + use clm_time_manager , only : get_average_days_per_year, get_step_size use clm_varcon , only : secspday, secsphr, tfrz use clm_varcon , only : g_to_mg, cm3_to_m3 use subgridAveMod , only : p2c @@ -822,6 +824,7 @@ subroutine decomp_rates_mimics(bounds, num_bgc_soilc, filter_bgc_soilc, & integer :: p, fp, c, fc, j, k, l, s ! indices integer :: pf ! fates patch index integer :: nc ! clump index + real(r8):: dt ! decomposition time step real(r8):: days_per_year ! days per year real(r8):: depth_scalar(bounds%begc:bounds%endc,1:nlevdecomp) real(r8):: w_d_o_scalars ! product of w_scalar * depth_scalar * o_scalar @@ -882,6 +885,7 @@ subroutine decomp_rates_mimics(bounds, num_bgc_soilc, filter_bgc_soilc, & cn_col => soilbiogeochem_carbonflux_inst%cn_col , & ! Output: [real(r8) (:,:) ] C:N ratio ligninNratioAvg => soilbiogeochem_carbonflux_inst%litr_lig_c_to_n_col, & ! Input: [real(r8) (:) ] C:N ratio of litter lignin decomp_k => soilbiogeochem_carbonflux_inst%decomp_k_col , & ! Output: [real(r8) (:,:,:) ] rate for decomposition (1./sec) + Ksoil => soilbiogeochem_carbonflux_inst%Ksoil , & ! Output: [real(r8) (:,:,:) ] rate constant for decomposition (1./sec) spinup_factor => decomp_cascade_con%spinup_factor & ! Input: [real(r8) (:) ] factor for AD spinup associated with each pool ) @@ -892,6 +896,7 @@ subroutine decomp_rates_mimics(bounds, num_bgc_soilc, filter_bgc_soilc, & mino2lim = CNParamsShareInst%mino2lim days_per_year = get_average_days_per_year() + dt = real( get_step_size(), r8 ) ! ! Set "decomp_depth_efolding" parameter ! decomp_depth_efolding = CNParamsShareInst%decomp_depth_efolding @@ -1311,6 +1316,23 @@ subroutine decomp_rates_mimics(bounds, num_bgc_soilc, filter_bgc_soilc, & if (get_do_tillage()) then call get_apply_tillage_multipliers(idop, c, j, decomp_k(c,j,:)) end if + +! Above into soil matrix + if(use_soil_matrixcn)then + Ksoil%DM(c,j+nlevdecomp*(i_met_lit-1)) = decomp_k(c,j,i_met_lit) * dt + Ksoil%DM(c,j+nlevdecomp*(i_str_lit-1)) = decomp_k(c,j,i_str_lit) * dt + Ksoil%DM(c,j+nlevdecomp*(i_avl_som-1)) = decomp_k(c,j,i_avl_som) * dt + Ksoil%DM(c,j+nlevdecomp*(i_phys_som-1)) = decomp_k(c,j,i_phys_som) * dt + Ksoil%DM(c,j+nlevdecomp*(i_chem_som-1)) = decomp_k(c,j,i_chem_som) * dt + Ksoil%DM(c,j+nlevdecomp*(i_cop_mic-1)) = decomp_k(c,j,i_cop_mic) * dt + Ksoil%DM(c,j+nlevdecomp*(i_oli_mic-1)) = decomp_k(c,j,i_oli_mic) * dt + ! same for cwd but only if fates is not enabled; fates handles + ! CWD + ! on its own structure + if (.not. use_fates) then + Ksoil%DM(c,j+nlevdecomp*(i_cwd-1)) = decomp_k(c,j,i_cwd) * dt + end if + end if !use_soil_matrixcn end do end do From d1d21137041ea091b8743ce3801eb7ff99960a34 Mon Sep 17 00:00:00 2001 From: cathyxinchangli <55264121+cathyxinchangli@users.noreply.github.com> Date: Wed, 20 Mar 2024 15:17:23 -0500 Subject: [PATCH 0086/1248] Fix backward compatibility & p_ac dynamic read-in 1. set different paths for default stream_fldfilename_urbantv based on urban_explicit_ac (currently points to the file in my work directory when urban_explicit_ac=.true.) 2. only read in p_ac when urban_explicit_ac is true --- bld/namelist_files/namelist_defaults_ctsm.xml | 15 +++++ src/biogeophys/UrbBuildTempOleson2015Mod.F90 | 2 +- src/cpl/share_esmf/UrbanTimeVarType.F90 | 57 ++++++++++++++----- 3 files changed, 60 insertions(+), 14 deletions(-) diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index 0d8e45a779..0f7d9b948a 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -1744,6 +1744,7 @@ lnd/clm2/surfdata_map/release-clm5.0.30/surfdata_ne0np4.CONUS.ne30x8_hist_78pfts 1850 2106 + +lnd/clm2/urbandata/CLM50_tbuildmax_Oleson_2016_0.9x1.25_simyr1849-2106_c160923.nc +/glade/work/xinchang/02_Explicit_AC_Adoption/02_data_present_day/CTSM52_urbantv_0.9x1.25_simyr1849-2106_c20230621.nc +lnd/clm2/urbandata/CLM50_tbuildmax_Oleson_2016_0.9x1_ESMFmesh_cdf5_100621.nc + +lnd/clm2/urbandata/CLM50_tbuildmax_Oleson_2016_0.9x1.25_simyr1849-2106_c160923.nc +/glade/work/xinchang/02_Explicit_AC_Adoption/02_data_present_day/CTSM52_urbantv_0.9x1.25_simyr1849-2106_c20230621.nc +lnd/clm2/urbandata/CLM50_tbuildmax_Oleson_2016_0.9x1_ESMFmesh_cdf5_100621.nc lnd/clm2/urbandata/CLM45_tbuildmax_Oleson_2016_0.9x1.25_simyr1849-2106_c160923.nc diff --git a/src/biogeophys/UrbBuildTempOleson2015Mod.F90 b/src/biogeophys/UrbBuildTempOleson2015Mod.F90 index 2e588e2e88..ee824931cd 100644 --- a/src/biogeophys/UrbBuildTempOleson2015Mod.F90 +++ b/src/biogeophys/UrbBuildTempOleson2015Mod.F90 @@ -325,7 +325,7 @@ subroutine BuildingTemperature (bounds, num_urbanl, filter_urbanl, num_nolakec, t_floor => temperature_inst%t_floor_lun , & ! InOut: [real(r8) (:)] floor temperature (K) t_building => temperature_inst%t_building_lun , & ! InOut: [real(r8) (:)] internal building air temperature (K) - p_ac => urbantv_inst%p_ac , & ! Input: [real(r8) (:)] air-conditioning penetration rate (-) + p_ac => urbantv_inst%p_ac , & ! Input: [real(r8) (:)] air-conditioning penetration rate (a fraction between 0 and 1) t_building_max => urbantv_inst%t_building_max , & ! Input: [real(r8) (:)] maximum internal building air temperature (K) t_building_min => urbanparams_inst%t_building_min , & ! Input: [real(r8) (:)] minimum internal building air temperature (K) diff --git a/src/cpl/share_esmf/UrbanTimeVarType.F90 b/src/cpl/share_esmf/UrbanTimeVarType.F90 index 54d5c61d19..5f507a1e9c 100644 --- a/src/cpl/share_esmf/UrbanTimeVarType.F90 +++ b/src/cpl/share_esmf/UrbanTimeVarType.F90 @@ -36,7 +36,11 @@ module UrbanTimeVarType ! X. Li [orig] ! character(15), private :: stream_varnames(isturb_MIN:isturb_MAX) ! X. Li [dev]: - character(15), private :: stream_varnames(1:6) ! 1-3 for t_building_max, 4-6 for p_ac + ! character(15), private :: stream_varnames(1:6) ! 1-3 for t_building_max, 4-6 for p_ac + ! X. Li [03.19] + integer , private :: stream_varname_MIN ! minimum index for stream_varnames + integer , private :: stream_varname_MAX ! maximum index for stream_varnames + character(15), private :: stream_varnames(:) ! urban time varying variable names character(len=*), parameter, private :: sourcefile = & __FILE__ @@ -67,7 +71,9 @@ subroutine Init(this, bounds, NLFilename) ! Allocate urbantv data structure allocate(this%t_building_max(begl:endl)); this%t_building_max(:) = nan - allocate(this%p_ac(begl:endl)); this%p_ac(:) = nan + ! X. Li [03.19] + ! allocate(this%p_ac(begl:endl)); this%p_ac(:) = nan + allocate(this%p_ac(begl:endl)); this%p_ac(:) = 0._r8 call this%urbantv_init(bounds, NLFilename) call this%urbantv_interp(bounds) @@ -77,8 +83,8 @@ subroutine Init(this, bounds, NLFilename) avgflag='A', long_name='prescribed maximum interior building temperature', & ptr_lunit=this%t_building_max, default='inactive', set_nourb=spval, & l2g_scale_type='unity') - call hist_addfld1d (fname='P_AC', units='unitless', & - avgflag='A', long_name='prescribed air-conditioning ownership rate (unitless, between 0 and 1)', & + call hist_addfld1d (fname='P_AC', units='a fraction between 0 and 1', & + avgflag='A', long_name='prescribed air-conditioning ownership rate', & ptr_lunit=this%p_ac, default='inactive', set_nourb=spval, & l2g_scale_type='unity') @@ -97,6 +103,8 @@ subroutine urbantv_init(this, bounds, NLFilename) use landunit_varcon , only : isturb_tbd, isturb_hd, isturb_md use dshr_strdata_mod , only : shr_strdata_init_from_inline use lnd_comp_shr , only : mesh, model_clock + ! X. Li [03.19] + use UrbanParamsType , only : urban_explicit_ac ! ! !ARGUMENTS: implicit none @@ -136,6 +144,15 @@ subroutine urbantv_init(this, bounds, NLFilename) model_year_align_urbantv = 1 ! align stream_year_first_urbantv with this model year stream_fldFileName_urbantv = ' ' stream_meshfile_urbantv = ' ' + ! X. Li [03.19] + stream_varname_MIN = 1 + ! Get value for the maximum index for stream_varnames: if using explicit AC adoption scheme, + ! then set maximum index to 6 for reading in tbuildmax and p_ac for three urban density classes; + ! otherwise, set to 3 to only read in tbuildmax for three urban density classes. + if (urban_explicit_ac) then + stream_varname_MAX = 6 + else + stream_varname_MAX = 3 ! X. Li [orig] ! stream_varnames(isturb_tbd) = urbantvString//"TBD" ! stream_varnames(isturb_hd) = urbantvString//"HD" @@ -144,9 +161,11 @@ subroutine urbantv_init(this, bounds, NLFilename) stream_varnames(1) = "tbuildmax_TBD" stream_varnames(2) = "tbuildmax_HD" stream_varnames(3) = "tbuildmax_MD" - stream_varnames(4) = "p_ac_TBD" - stream_varnames(5) = "p_ac_HD" - stream_varnames(6) = "p_ac_MD" + ! X. Li [03.19] + if (urban_explicit_ac) then + stream_varnames(4) = "p_ac_TBD" + stream_varnames(5) = "p_ac_HD" + stream_varnames(6) = "p_ac_MD" ! Read urbantv_streams namelist if (masterproc) then @@ -180,7 +199,9 @@ subroutine urbantv_init(this, bounds, NLFilename) ! X. Li [orig] ! do n = isturb_tbd,isturb_md ! X. Li [dev] - do n = 1,6 + ! do n = 1,6 + ! X. Li [03.19] + do n = stream_varname_MIN,stream_varname_MAX write(iulog,'(a,a)' ) ' stream_varname = ',trim(stream_varnames(n)) end do write(iulog,*) ' ' @@ -201,8 +222,11 @@ subroutine urbantv_init(this, bounds, NLFilename) ! stream_fldlistFile = stream_varnames(isturb_tbd:isturb_md),& ! stream_fldListModel = stream_varnames(isturb_tbd:isturb_md),& ! X. Li [dev] - stream_fldlistFile = stream_varnames(1:6), & - stream_fldListModel = stream_varnames(1:6), & + ! stream_fldlistFile = stream_varnames(1:6), & + ! stream_fldListModel = stream_varnames(1:6), & + ! X. Li [03.19] + stream_fldlistFile = stream_varnames(stream_varname_MIN:stream_varname_MAX), & + stream_fldListModel = stream_varnames(stream_varname_MIN:stream_varname_MAX), & stream_yearFirst = stream_year_first_urbantv, & stream_yearLast = stream_year_last_urbantv, & stream_yearAlign = model_year_align_urbantv, & @@ -266,6 +290,9 @@ subroutine urbantv_interp(this, bounds) ! X. Li [dev] allocate(dataptr2d(lsize, 1:6)) do n = 1,6 + ! X. Li [03.19] + allocate(dataptr2d(lsize, stream_varname_MIN:stream_varname_MAX)) + do n = stream_varname_MIN,stream_varname_MAX call dshr_fldbun_getFldPtr(this%sdat_urbantv%pstrm(1)%fldbun_model, trim(stream_varnames(n)), & fldptr1=dataptr1d, rc=rc) if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) then @@ -278,7 +305,7 @@ subroutine urbantv_interp(this, bounds) end do end do - ! Determine this%tbuilding_max for all landunits + ! Determine this%tbuilding_max (and this%p_ac, if applicable) for all landunits do l = bounds%begl,bounds%endl if (lun%urbpoi(l)) then ig = 0 @@ -289,7 +316,9 @@ subroutine urbantv_interp(this, bounds) ! X. Li [orig] ! do n = isturb_MIN,isturb_MAX ! X. Li [dev] - do n = 1,6 + ! do n = 1,6 + ! X. Li [03.19] + do n = stream_varname_MIN,stream_varname_MAX ! X. Li [orig] ! if (stream_varnames(lun%itype(l)) == stream_varnames(n)) then ! X. Li [dev.02] @@ -302,7 +331,9 @@ subroutine urbantv_interp(this, bounds) end do else this%t_building_max(l) = spval - this%p_ac(l) = 0._r8 ! set to 0 for non-urban landunit + ! this%p_ac(l) = 0._r8 ! set to 0 for non-urban landunit + ! X. Li [03.19] + this%p_ac(l) = nan ! set to nan for non-urban landunit end if end do deallocate(dataptr2d) From 79790a0d392178ca95b4a0bcf2b7e3a02618896c Mon Sep 17 00:00:00 2001 From: cathyxinchangli <55264121+cathyxinchangli@users.noreply.github.com> Date: Thu, 21 Mar 2024 16:08:23 -0500 Subject: [PATCH 0087/1248] Bug fix Closed if blocks, commented out extra lines, defined nan --- src/cpl/share_esmf/UrbanTimeVarType.F90 | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/cpl/share_esmf/UrbanTimeVarType.F90 b/src/cpl/share_esmf/UrbanTimeVarType.F90 index 5f507a1e9c..fc670ca830 100644 --- a/src/cpl/share_esmf/UrbanTimeVarType.F90 +++ b/src/cpl/share_esmf/UrbanTimeVarType.F90 @@ -38,9 +38,9 @@ module UrbanTimeVarType ! X. Li [dev]: ! character(15), private :: stream_varnames(1:6) ! 1-3 for t_building_max, 4-6 for p_ac ! X. Li [03.19] - integer , private :: stream_varname_MIN ! minimum index for stream_varnames - integer , private :: stream_varname_MAX ! maximum index for stream_varnames - character(15), private :: stream_varnames(:) ! urban time varying variable names + integer , private :: stream_varname_MIN ! minimum index for stream_varnames + integer , private :: stream_varname_MAX ! maximum index for stream_varnames + character(15), private, allocatable :: stream_varnames(:) ! urban time varying variable names character(len=*), parameter, private :: sourcefile = & __FILE__ @@ -153,6 +153,7 @@ subroutine urbantv_init(this, bounds, NLFilename) stream_varname_MAX = 6 else stream_varname_MAX = 3 + end if ! X. Li [orig] ! stream_varnames(isturb_tbd) = urbantvString//"TBD" ! stream_varnames(isturb_hd) = urbantvString//"HD" @@ -166,6 +167,7 @@ subroutine urbantv_init(this, bounds, NLFilename) stream_varnames(4) = "p_ac_TBD" stream_varnames(5) = "p_ac_HD" stream_varnames(6) = "p_ac_MD" + end if ! Read urbantv_streams namelist if (masterproc) then @@ -253,6 +255,7 @@ subroutine urbantv_interp(this, bounds) use clm_instur , only : urban_valid use dshr_methods_mod , only : dshr_fldbun_getfldptr use dshr_strdata_mod , only : shr_strdata_advance + use shr_infnan_mod , only : nan => shr_infnan_nan, assignment(=) ! ! !ARGUMENTS: class(urbantv_type) :: this @@ -288,8 +291,8 @@ subroutine urbantv_interp(this, bounds) ! allocate(dataptr2d(lsize, isturb_MIN:isturb_MAX)) ! do n = isturb_MIN,isturb_MAX ! X. Li [dev] - allocate(dataptr2d(lsize, 1:6)) - do n = 1,6 + ! allocate(dataptr2d(lsize, 1:6)) + ! do n = 1,6 ! X. Li [03.19] allocate(dataptr2d(lsize, stream_varname_MIN:stream_varname_MAX)) do n = stream_varname_MIN,stream_varname_MAX From c383dee0be598f52766c330ff59965fd6b4eaa0c Mon Sep 17 00:00:00 2001 From: cathyxinchangli <55264121+cathyxinchangli@users.noreply.github.com> Date: Fri, 22 Mar 2024 16:55:12 -0500 Subject: [PATCH 0088/1248] Fixing error SIGSEGV, segmentation fault occurred Trying to fix this error by changing "allocatable" to "pointer" for the variable `stream_varnames`, since the error message points to the line where this variable was first assigned values. --- src/cpl/share_esmf/UrbanTimeVarType.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cpl/share_esmf/UrbanTimeVarType.F90 b/src/cpl/share_esmf/UrbanTimeVarType.F90 index fc670ca830..5cd3f607ca 100644 --- a/src/cpl/share_esmf/UrbanTimeVarType.F90 +++ b/src/cpl/share_esmf/UrbanTimeVarType.F90 @@ -40,7 +40,7 @@ module UrbanTimeVarType ! X. Li [03.19] integer , private :: stream_varname_MIN ! minimum index for stream_varnames integer , private :: stream_varname_MAX ! maximum index for stream_varnames - character(15), private, allocatable :: stream_varnames(:) ! urban time varying variable names + character(15), private, pointer :: stream_varnames(:) ! urban time varying variable names character(len=*), parameter, private :: sourcefile = & __FILE__ From 0081443d8662dacce74da1790b922c98a7edfd64 Mon Sep 17 00:00:00 2001 From: cathyxinchangli <55264121+cathyxinchangli@users.noreply.github.com> Date: Fri, 22 Mar 2024 18:12:21 -0500 Subject: [PATCH 0089/1248] Fixing the error SIGSEGV cont'd Adding parameter" attribute to `stream_varname_MIN/MAX` to see if it helps --- src/cpl/share_esmf/UrbanTimeVarType.F90 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/cpl/share_esmf/UrbanTimeVarType.F90 b/src/cpl/share_esmf/UrbanTimeVarType.F90 index 5cd3f607ca..ffecf07c2d 100644 --- a/src/cpl/share_esmf/UrbanTimeVarType.F90 +++ b/src/cpl/share_esmf/UrbanTimeVarType.F90 @@ -38,9 +38,9 @@ module UrbanTimeVarType ! X. Li [dev]: ! character(15), private :: stream_varnames(1:6) ! 1-3 for t_building_max, 4-6 for p_ac ! X. Li [03.19] - integer , private :: stream_varname_MIN ! minimum index for stream_varnames - integer , private :: stream_varname_MAX ! maximum index for stream_varnames - character(15), private, pointer :: stream_varnames(:) ! urban time varying variable names + integer , private, parameter :: stream_varname_MIN ! minimum index for stream_varnames + integer , private, parameter :: stream_varname_MAX ! maximum index for stream_varnames + character(15), private, pointer :: stream_varnames(stream_varname_MIN:stream_varname_MAX) ! urban time varying variable names character(len=*), parameter, private :: sourcefile = & __FILE__ From e4a42c8fec448dacd53bcb37c18fd05bc05161cb Mon Sep 17 00:00:00 2001 From: cathyxinchangli <55264121+cathyxinchangli@users.noreply.github.com> Date: Fri, 22 Mar 2024 18:55:02 -0500 Subject: [PATCH 0090/1248] Fixing the error SIGSEGV cont'd Trying out determining `stream_varname_MIN/MAX` and allocating `stream_varnames` in a different subroutine, before stream_varnames are assigned values --- src/cpl/share_esmf/UrbanTimeVarType.F90 | 39 +++++++++++++++++-------- 1 file changed, 27 insertions(+), 12 deletions(-) diff --git a/src/cpl/share_esmf/UrbanTimeVarType.F90 b/src/cpl/share_esmf/UrbanTimeVarType.F90 index ffecf07c2d..f9aab74b09 100644 --- a/src/cpl/share_esmf/UrbanTimeVarType.F90 +++ b/src/cpl/share_esmf/UrbanTimeVarType.F90 @@ -38,9 +38,9 @@ module UrbanTimeVarType ! X. Li [dev]: ! character(15), private :: stream_varnames(1:6) ! 1-3 for t_building_max, 4-6 for p_ac ! X. Li [03.19] - integer , private, parameter :: stream_varname_MIN ! minimum index for stream_varnames - integer , private, parameter :: stream_varname_MAX ! maximum index for stream_varnames - character(15), private, pointer :: stream_varnames(stream_varname_MIN:stream_varname_MAX) ! urban time varying variable names + integer , private :: stream_varname_MIN ! minimum index for stream_varnames + integer , private :: stream_varname_MAX ! maximum index for stream_varnames + character(15), private, pointer :: stream_varnames(:) ! urban time varying variable names character(len=*), parameter, private :: sourcefile = & __FILE__ @@ -56,6 +56,8 @@ subroutine Init(this, bounds, NLFilename) ! !USES: use shr_infnan_mod , only : nan => shr_infnan_nan, assignment(=) use histFileMod , only : hist_addfld1d + ! X. Li [03.22] + use UrbanParamsType , only : urban_explicit_ac ! ! !ARGUMENTS: class(urbantv_type) :: this @@ -68,12 +70,25 @@ subroutine Init(this, bounds, NLFilename) begl = bounds%begl; endl = bounds%endl + ! X. Li [03.22] + ! Determine the minimum and maximum indices for stream_varnames + stream_varname_MIN = 1 + ! Get value for the maximum index for stream_varnames: if using explicit AC adoption scheme, + ! then set maximum index to 6 for reading in tbuildmax and p_ac for three urban density classes; + ! otherwise, set to 3 to only read in tbuildmax for three urban density classes. + if (urban_explicit_ac) then + stream_varname_MAX = 6 + else + stream_varname_MAX = 3 + end if + ! Allocate urbantv data structure allocate(this%t_building_max(begl:endl)); this%t_building_max(:) = nan ! X. Li [03.19] ! allocate(this%p_ac(begl:endl)); this%p_ac(:) = nan allocate(this%p_ac(begl:endl)); this%p_ac(:) = 0._r8 + allocate(this%stream_varnames(stream_varname_MIN:stream_varname_MAX)) call this%urbantv_init(bounds, NLFilename) call this%urbantv_interp(bounds) @@ -145,15 +160,15 @@ subroutine urbantv_init(this, bounds, NLFilename) stream_fldFileName_urbantv = ' ' stream_meshfile_urbantv = ' ' ! X. Li [03.19] - stream_varname_MIN = 1 - ! Get value for the maximum index for stream_varnames: if using explicit AC adoption scheme, - ! then set maximum index to 6 for reading in tbuildmax and p_ac for three urban density classes; - ! otherwise, set to 3 to only read in tbuildmax for three urban density classes. - if (urban_explicit_ac) then - stream_varname_MAX = 6 - else - stream_varname_MAX = 3 - end if + ! stream_varname_MIN = 1 + ! ! Get value for the maximum index for stream_varnames: if using explicit AC adoption scheme, + ! ! then set maximum index to 6 for reading in tbuildmax and p_ac for three urban density classes; + ! ! otherwise, set to 3 to only read in tbuildmax for three urban density classes. + ! if (urban_explicit_ac) then + ! stream_varname_MAX = 6 + ! else + ! stream_varname_MAX = 3 + ! end if ! X. Li [orig] ! stream_varnames(isturb_tbd) = urbantvString//"TBD" ! stream_varnames(isturb_hd) = urbantvString//"HD" From f69173523060c05c06a665fd9c500fae43f5dab2 Mon Sep 17 00:00:00 2001 From: cathyxinchangli <55264121+cathyxinchangli@users.noreply.github.com> Date: Fri, 22 Mar 2024 19:05:49 -0500 Subject: [PATCH 0091/1248] Fixing the error SIGSEGV cont'd Previous build had error "This is not a component name that is defined in the encompassing structure" for `stream_varnames` allocation, so removed "this%" --- src/cpl/share_esmf/UrbanTimeVarType.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cpl/share_esmf/UrbanTimeVarType.F90 b/src/cpl/share_esmf/UrbanTimeVarType.F90 index f9aab74b09..1a29abb9af 100644 --- a/src/cpl/share_esmf/UrbanTimeVarType.F90 +++ b/src/cpl/share_esmf/UrbanTimeVarType.F90 @@ -88,7 +88,7 @@ subroutine Init(this, bounds, NLFilename) ! X. Li [03.19] ! allocate(this%p_ac(begl:endl)); this%p_ac(:) = nan allocate(this%p_ac(begl:endl)); this%p_ac(:) = 0._r8 - allocate(this%stream_varnames(stream_varname_MIN:stream_varname_MAX)) + allocate(stream_varnames(stream_varname_MIN:stream_varname_MAX)) call this%urbantv_init(bounds, NLFilename) call this%urbantv_interp(bounds) From 64870fa5b51fef1f93a4d05488c0a18e2d65d7d4 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Mon, 25 Mar 2024 09:53:37 -0600 Subject: [PATCH 0092/1248] Getting around "file not found" error for /run directory --- cime_config/SystemTests/sspmatrixcn.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cime_config/SystemTests/sspmatrixcn.py b/cime_config/SystemTests/sspmatrixcn.py index bd41d84651..5f2d3e065e 100644 --- a/cime_config/SystemTests/sspmatrixcn.py +++ b/cime_config/SystemTests/sspmatrixcn.py @@ -207,7 +207,9 @@ def run_phase(self): linkfile = os.path.join(rundir, os.path.basename(item)) if os.path.exists(linkfile): os.remove( linkfile ) - os.symlink(item, linkfile ) + self._case.flush() + if os.path.exists(rundir): + os.symlink(item, linkfile ) for item in glob.glob("{}/*rpointer*".format(rest_path)): shutil.copy(item, rundir) @@ -215,7 +217,8 @@ def run_phase(self): # # Run the case (Archiving on) # - self._case.flush() + if not os.path.exists(rundir): + self._case.flush() self.run_indv(suffix="step{}".format(self.steps[n]), st_archive=True) # From ccb91e21abd4f8bb6437f551b025444126787c94 Mon Sep 17 00:00:00 2001 From: cathyxinchangli <55264121+cathyxinchangli@users.noreply.github.com> Date: Mon, 25 Mar 2024 20:03:01 -0500 Subject: [PATCH 0093/1248] Prepare for PR review Remove comments no longer needed to prepare for PR review --- bld/namelist_files/namelist_defaults_ctsm.xml | 11 ---- src/cpl/share_esmf/UrbanTimeVarType.F90 | 57 ------------------- 2 files changed, 68 deletions(-) diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index 0f7d9b948a..be3d776c2f 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -1744,17 +1744,6 @@ lnd/clm2/surfdata_map/release-clm5.0.30/surfdata_ne0np4.CONUS.ne30x8_hist_78pfts 1850 2106 - lnd/clm2/urbandata/CLM50_tbuildmax_Oleson_2016_0.9x1.25_simyr1849-2106_c160923.nc shr_infnan_nan, assignment(=) use histFileMod , only : hist_addfld1d - ! X. Li [03.22] use UrbanParamsType , only : urban_explicit_ac ! ! !ARGUMENTS: @@ -70,7 +64,6 @@ subroutine Init(this, bounds, NLFilename) begl = bounds%begl; endl = bounds%endl - ! X. Li [03.22] ! Determine the minimum and maximum indices for stream_varnames stream_varname_MIN = 1 ! Get value for the maximum index for stream_varnames: if using explicit AC adoption scheme, @@ -85,8 +78,6 @@ subroutine Init(this, bounds, NLFilename) ! Allocate urbantv data structure allocate(this%t_building_max(begl:endl)); this%t_building_max(:) = nan - ! X. Li [03.19] - ! allocate(this%p_ac(begl:endl)); this%p_ac(:) = nan allocate(this%p_ac(begl:endl)); this%p_ac(:) = 0._r8 allocate(stream_varnames(stream_varname_MIN:stream_varname_MAX)) @@ -118,7 +109,6 @@ subroutine urbantv_init(this, bounds, NLFilename) use landunit_varcon , only : isturb_tbd, isturb_hd, isturb_md use dshr_strdata_mod , only : shr_strdata_init_from_inline use lnd_comp_shr , only : mesh, model_clock - ! X. Li [03.19] use UrbanParamsType , only : urban_explicit_ac ! ! !ARGUMENTS: @@ -139,8 +129,6 @@ subroutine urbantv_init(this, bounds, NLFilename) character(len=CL) :: urbantvmapalgo = 'nn' ! mapping alogrithm for urban ac character(len=CL) :: urbantv_tintalgo = 'linear' ! time interpolation alogrithm integer :: rc ! error code - ! X. Li [orig]: this is taken out because field strings are now hard coded in - ! character(*), parameter :: urbantvString = "tbuildmax_" ! base string for field string character(*), parameter :: subName = "('urbantv_init')" !----------------------------------------------------------------------- @@ -159,25 +147,9 @@ subroutine urbantv_init(this, bounds, NLFilename) model_year_align_urbantv = 1 ! align stream_year_first_urbantv with this model year stream_fldFileName_urbantv = ' ' stream_meshfile_urbantv = ' ' - ! X. Li [03.19] - ! stream_varname_MIN = 1 - ! ! Get value for the maximum index for stream_varnames: if using explicit AC adoption scheme, - ! ! then set maximum index to 6 for reading in tbuildmax and p_ac for three urban density classes; - ! ! otherwise, set to 3 to only read in tbuildmax for three urban density classes. - ! if (urban_explicit_ac) then - ! stream_varname_MAX = 6 - ! else - ! stream_varname_MAX = 3 - ! end if - ! X. Li [orig] - ! stream_varnames(isturb_tbd) = urbantvString//"TBD" - ! stream_varnames(isturb_hd) = urbantvString//"HD" - ! stream_varnames(isturb_md) = urbantvString//"MD" - ! X. Li [dev] stream_varnames(1) = "tbuildmax_TBD" stream_varnames(2) = "tbuildmax_HD" stream_varnames(3) = "tbuildmax_MD" - ! X. Li [03.19] if (urban_explicit_ac) then stream_varnames(4) = "p_ac_TBD" stream_varnames(5) = "p_ac_HD" @@ -213,11 +185,6 @@ subroutine urbantv_init(this, bounds, NLFilename) write(iulog,'(a,a)' ) ' stream_fldFileName_urbantv = ',stream_fldFileName_urbantv write(iulog,'(a,a)' ) ' stream_meshfile_urbantv = ',stream_meshfile_urbantv write(iulog,'(a,a)' ) ' urbantv_tintalgo = ',urbantv_tintalgo - ! X. Li [orig] - ! do n = isturb_tbd,isturb_md - ! X. Li [dev] - ! do n = 1,6 - ! X. Li [03.19] do n = stream_varname_MIN,stream_varname_MAX write(iulog,'(a,a)' ) ' stream_varname = ',trim(stream_varnames(n)) end do @@ -235,13 +202,6 @@ subroutine urbantv_init(this, bounds, NLFilename) stream_lev_dimname = 'null', & stream_mapalgo = trim(urbantvmapalgo), & stream_filenames = (/trim(stream_fldfilename_urbantv)/), & - ! X. Li [orig] - ! stream_fldlistFile = stream_varnames(isturb_tbd:isturb_md),& - ! stream_fldListModel = stream_varnames(isturb_tbd:isturb_md),& - ! X. Li [dev] - ! stream_fldlistFile = stream_varnames(1:6), & - ! stream_fldListModel = stream_varnames(1:6), & - ! X. Li [03.19] stream_fldlistFile = stream_varnames(stream_varname_MIN:stream_varname_MAX), & stream_fldListModel = stream_varnames(stream_varname_MIN:stream_varname_MAX), & stream_yearFirst = stream_year_first_urbantv, & @@ -302,13 +262,6 @@ subroutine urbantv_interp(this, bounds) ! Create 2d array for all stream variable data lsize = bounds%endg - bounds%begg + 1 - ! X. Li [orig] - ! allocate(dataptr2d(lsize, isturb_MIN:isturb_MAX)) - ! do n = isturb_MIN,isturb_MAX - ! X. Li [dev] - ! allocate(dataptr2d(lsize, 1:6)) - ! do n = 1,6 - ! X. Li [03.19] allocate(dataptr2d(lsize, stream_varname_MIN:stream_varname_MAX)) do n = stream_varname_MIN,stream_varname_MAX call dshr_fldbun_getFldPtr(this%sdat_urbantv%pstrm(1)%fldbun_model, trim(stream_varnames(n)), & @@ -331,15 +284,7 @@ subroutine urbantv_interp(this, bounds) ig = ig+1 if (g == lun%gridcell(l)) exit end do - ! X. Li [orig] - ! do n = isturb_MIN,isturb_MAX - ! X. Li [dev] - ! do n = 1,6 - ! X. Li [03.19] do n = stream_varname_MIN,stream_varname_MAX - ! X. Li [orig] - ! if (stream_varnames(lun%itype(l)) == stream_varnames(n)) then - ! X. Li [dev.02] if (stream_varnames((lun%itype(l)-6)) == stream_varnames(n)) then this%t_building_max(l) = dataptr2d(ig,n) end if @@ -349,8 +294,6 @@ subroutine urbantv_interp(this, bounds) end do else this%t_building_max(l) = spval - ! this%p_ac(l) = 0._r8 ! set to 0 for non-urban landunit - ! X. Li [03.19] this%p_ac(l) = nan ! set to nan for non-urban landunit end if end do From 25f0236576b01044df8509e865dbce35587983ca Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Tue, 26 Mar 2024 09:49:24 -0600 Subject: [PATCH 0094/1248] Getting around "file not found" error for rundir (this time test passes) --- cime_config/SystemTests/sspmatrixcn.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/cime_config/SystemTests/sspmatrixcn.py b/cime_config/SystemTests/sspmatrixcn.py index 5f2d3e065e..eec462e72c 100644 --- a/cime_config/SystemTests/sspmatrixcn.py +++ b/cime_config/SystemTests/sspmatrixcn.py @@ -207,9 +207,9 @@ def run_phase(self): linkfile = os.path.join(rundir, os.path.basename(item)) if os.path.exists(linkfile): os.remove( linkfile ) - self._case.flush() - if os.path.exists(rundir): - os.symlink(item, linkfile ) + if not os.path.isdir(rundir): + os.makedirs(rundir) + os.symlink(item, linkfile ) for item in glob.glob("{}/*rpointer*".format(rest_path)): shutil.copy(item, rundir) @@ -217,8 +217,7 @@ def run_phase(self): # # Run the case (Archiving on) # - if not os.path.exists(rundir): - self._case.flush() + self._case.flush() self.run_indv(suffix="step{}".format(self.steps[n]), st_archive=True) # From d4cbc8c58570b027adbc155b7f39d0c2faaf3f38 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Tue, 26 Mar 2024 13:03:46 -0600 Subject: [PATCH 0095/1248] Bug-fix discovered by izumi_nag test --- src/main/surfrdUtilsMod.F90 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/surfrdUtilsMod.F90 b/src/main/surfrdUtilsMod.F90 index 97f5b7d80f..ac7c1304b8 100644 --- a/src/main/surfrdUtilsMod.F90 +++ b/src/main/surfrdUtilsMod.F90 @@ -282,8 +282,8 @@ subroutine collapse_to_dominant(weight, lower_bound, upper_bound, begg, endg, n_ ! original sum of all the weights wt_sum(g) = sum(weight(g,:)) - if (present(do_not_collapse) .and. do_not_collapse(g)) then - cycle + if (present(do_not_collapse)) then + if (do_not_collapse(g)) cycle end if max_indices = 0 ! initialize From f06ceb8c8e3b47d96f363a7d2c681c7a68c1432e Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Tue, 26 Mar 2024 13:15:26 -0600 Subject: [PATCH 0096/1248] Update derecho test from failing P64x2 to passing P24x2 --- cime_config/testdefs/testlist_clm.xml | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index 3d713e98ec..04200b7271 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -2835,19 +2835,7 @@ - - - - - - - - - - - - - + From 0ebb7e0415809c49250ecbc1bbd355227068ae35 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Wed, 27 Mar 2024 13:22:13 -0600 Subject: [PATCH 0097/1248] Rename isspinup -> spinup_matrixcn, is_outmatrix -> hist_wrt_matrixcn_diag Ran aux_clm on derecho and got expected results --- bld/CLMBuildNamelist.pm | 28 +++++++++---------- bld/namelist_files/namelist_defaults_ctsm.xml | 16 +++++------ .../namelist_definition_ctsm.xml | 6 ++-- bld/unit_testers/build-namelist_test.pl | 18 ++++++------ cime_config/SystemTests/sspmatrixcn.py | 2 +- .../clm/ciso_monthly_matrixcn/user_nl_clm | 2 +- src/biogeochem/CNVegMatrixMod.F90 | 14 +++++----- src/main/clm_varctl.F90 | 4 +-- src/main/controlMod.F90 | 10 +++---- src/soilbiogeochem/CNSoilMatrixMod.F90 | 16 +++++------ 10 files changed, 58 insertions(+), 58 deletions(-) diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index 67b8bd3b5c..ca0221277f 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -114,7 +114,7 @@ OPTIONS off : run in normal mode (spinup_state = 0) To spinup using the CN soil matrix method use "sasu" SemiAnalytic Spin-Up (SASU) - sasu: Turn on matrix spinup (isspinup=T) + sasu: Turn on matrix spinup (spinup_matrixcn=T) Normal spinup sequence is: on, sasu, off Default is set by clm_accelerated_spinup mode. @@ -1234,21 +1234,21 @@ sub setup_cmdl_spinup { } $nl_flags->{$var} = $val; if ( &value_is_true($nl_flags->{'use_soil_matrixcn'}) ) { - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, "isspinup", + add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, "spinup_matrixcn", , 'use_fates'=>$nl_flags->{'use_fates'}, 'bgc_mode'=>$nl_flags->{'bgc_mode'} , 'phys'=>$nl_flags->{'phys'}, 'use_soil_matrixcn'=>$nl_flags->{'use_soil_matrixcn'}, , clm_accelerated_spinup=>$nl_flags->{'clm_accelerated_spinup'} ); my $spinup; - if ( &value_is_true($nl->get_value("isspinup") ) ) { + if ( &value_is_true($nl->get_value("spinup_matrixcn") ) ) { $spinup = ".true."; } else { $spinup = ".false."; } - $nl_flags->{'isspinup'} = $spinup; - if ( &value_is_true($nl_flags->{'isspinup'}) ) { + $nl_flags->{'spinup_matrixcn'} = $spinup; + if ( &value_is_true($nl_flags->{'spinup_matrixcn'}) ) { $nl_flags->{'bgc_spinup'} = "on"; if ( $nl_flags->{'clm_accelerated_spinup'} eq "off" ) { - $log->fatal_error("matrix spinup (isspinup) is True, but clm_accelerated_spinup is off, change one or the other"); + $log->fatal_error("matrix spinup (spinup_matrixcn) is True, but clm_accelerated_spinup is off, change one or the other"); } } else { $nl_flags->{'bgc_spinup'} = "off"; @@ -4569,14 +4569,14 @@ sub setup_logic_cnmatrix { # my ($opts, $nl_flags, $definition, $defaults, $nl) = @_; - my @matrixlist = ( "use_matrixcn", "is_outmatrix" ); + my @matrixlist = ( "use_matrixcn", "hist_wrt_matrixcn_diag" ); foreach my $var ( @matrixlist ) { add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, $var , 'use_fates'=>$nl_flags->{'use_fates'}, 'bgc_mode'=>$nl_flags->{'bgc_mode'} , 'phys'=>$nl_flags->{'phys'}, 'use_soil_matrixcn'=>$nl_flags->{'use_soil_matrixcn'}, - , 'isspinup'=>$nl_flags->{'isspinup'}, 'clm_accelerated_spinup'=>$nl_flags->{'clm_accelerated_spinup'} ); + , 'spinup_matrixcn'=>$nl_flags->{'spinup_matrixcn'}, 'clm_accelerated_spinup'=>$nl_flags->{'clm_accelerated_spinup'} ); } - @matrixlist = ( "use_matrixcn", "use_soil_matrixcn", "is_outmatrix", "isspinup" ); + @matrixlist = ( "use_matrixcn", "use_soil_matrixcn", "hist_wrt_matrixcn_diag", "spinup_matrixcn" ); # Matrix items can't be on for SP mode if ( $nl_flags->{'bgc_mode'} eq "sp" ) { foreach my $var ( @matrixlist ) { @@ -4607,14 +4607,14 @@ sub setup_logic_cnmatrix { } # If both matrixcn and soil_matrix are off outmatrix can't be on if ( ! &value_is_true($nl->get_value("use_matrixcn")) && ! &value_is_true($nl_flags->{"use_soil_matrixcn"}) ) { - my $var = "is_outmatrix"; + my $var = "hist_wrt_matrixcn_diag"; if ( &value_is_true($nl->get_value($var)) ) { $log->fatal_error("$var can NOT be on when both use_matrixcn and use_soil_matrixcn are off" ); } } # If soil_matrix is off ispspinup can't be on if ( ! &value_is_true($nl_flags->{"use_soil_matrixcn"}) ) { - my $var = "isspinup"; + my $var = "spinup_matrixcn"; if ( &value_is_true($nl->get_value($var)) ) { $log->fatal_error("$var can NOT be on when use_soil_matrixcn is off" ); } @@ -4623,10 +4623,10 @@ sub setup_logic_cnmatrix { # if soil matrix is on and spinup is on, set spinup specific variables my @spinup_vars = ( "nyr_forcing", "nyr_sasu", "iloop_avg" ); foreach my $var ( @spinup_vars ) { - if ( &value_is_true($nl_flags->{"use_soil_matrixcn"}) && &value_is_true($nl_flags->{'isspinup'}) ) { + if ( &value_is_true($nl_flags->{"use_soil_matrixcn"}) && &value_is_true($nl_flags->{'spinup_matrixcn'}) ) { if ( $var ne "nyr_sasu" ) { add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, $var, - , 'phys'=>$nl_flags->{'phys'}, 'isspinup'=>$nl_flags->{'isspinup'} ); + , 'phys'=>$nl_flags->{'phys'}, 'spinup_matrixcn'=>$nl_flags->{'spinup_matrixcn'} ); } else { # Set SASU spinup period to nyr_forcing (slow mode) by default add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, $var, @@ -4644,7 +4644,7 @@ sub setup_logic_cnmatrix { } } } - if ( &value_is_true($nl_flags->{"use_soil_matrixcn"}) && &value_is_true($nl_flags->{'isspinup'}) ) { + if ( &value_is_true($nl_flags->{"use_soil_matrixcn"}) && &value_is_true($nl_flags->{'spinup_matrixcn'}) ) { my $nyr_forcing = $nl->get_value('nyr_forcing'); my $nyr_sasu = $nl->get_value('nyr_sasu'); if ( $nyr_sasu > $nyr_forcing ) { diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index f2e42dd6e0..1455bbf873 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -661,18 +661,18 @@ attributes from the config_cache.xml file (with keys converted to upper-case). .false. .false. -.false. -.false. -.false. -.true. -.true. -.false. +.false. +.false. +.false. +.true. +.true. +.false. 1 -20 +20 1 -999 --999 +-999 diff --git a/bld/namelist_files/namelist_definition_ctsm.xml b/bld/namelist_files/namelist_definition_ctsm.xml index 5214c20942..4cf8b8ad7d 100644 --- a/bld/namelist_files/namelist_definition_ctsm.xml +++ b/bld/namelist_files/namelist_definition_ctsm.xml @@ -1149,12 +1149,12 @@ Turn on the Matrix solution for above ground biogeochemistry, requires CN to be Turn on the Matrix solution for soil biogeochemistry - Turn on extra output for the matrix solution - Turn on semi-analytic spinup solution for the CN/Soil matrix, requires soil matrix to be on This will drive the solution to equilibrium @@ -1162,7 +1162,7 @@ This will drive the solution to equilibrium -Number of years to average the storage capacitance over for the soil Matrix solution during semi-analytic spinup (isspinup=T) +Number of years to average the storage capacitance over for the soil Matrix solution during semi-analytic spinup (spinup_matrixcn=T) Normally should be the same as the number of years the atmospheric forcing is run over diff --git a/bld/unit_testers/build-namelist_test.pl b/bld/unit_testers/build-namelist_test.pl index 3c3a42abc9..83429d2f18 100755 --- a/bld/unit_testers/build-namelist_test.pl +++ b/bld/unit_testers/build-namelist_test.pl @@ -326,8 +326,8 @@ sub cat_and_create_namelistinfile { "-res 0.9x1.25 -use_case 1850_control", "-res 1x1pt_US-UMB -clm_usr_name 1x1pt_US-UMB -namelist '&a fsurdat=\"/dev/null\"/'", "-res 1x1_brazil", - "-namelist '&a use_matrixcn=F,use_soil_matrixcn=F,is_outmatrix=F,isspinup=F/' -bgc sp", - "-namelist '&a use_matrixcn=T,use_soil_matrixcn=T,is_outmatrix=T,isspinup=T/' -bgc bgc -crop -clm_accelerated_spinup on", + "-namelist '&a use_matrixcn=F,use_soil_matrixcn=F,hist_wrt_matrixcn_diag=F,spinup_matrixcn=F/' -bgc sp", + "-namelist '&a use_matrixcn=T,use_soil_matrixcn=T,hist_wrt_matrixcn_diag=T,spinup_matrixcn=T/' -bgc bgc -crop -clm_accelerated_spinup on", "-namelist \"&a soil_decomp_method='MIMICSWieder2015',use_matrixcn=F/\" -bgc bgc -crop", "-namelist \"&a soil_decomp_method='MIMICSWieder2015',use_matrixcn=T/\" -bgc bgc -crop", "-bgc bgc -crop -clm_accelerated_spinup sasu", @@ -970,12 +970,12 @@ sub cat_and_create_namelistinfile { phys=>"clm5_0", }, "outmatrixWOmatrix" =>{ options=>"-envxml_dir . -bgc bgc", - namelst=>"use_soil_matrixcn=.false.,use_matrixcn=F,is_outmatrix=T", + namelst=>"use_soil_matrixcn=.false.,use_matrixcn=F,hist_wrt_matrixcn_diag=T", GLC_TWO_WAY_COUPLING=>"TRUE", phys=>"clm5_0", }, "spinupWOsoilmatrix" =>{ options=>"-envxml_dir . -bgc bgc", - namelst=>"use_soil_matrixcn=F,use_matrixcn=T,isspinup=T", + namelst=>"use_soil_matrixcn=F,use_matrixcn=T,spinup_matrixcn=T", GLC_TWO_WAY_COUPLING=>"TRUE", phys=>"clm5_0", }, @@ -990,27 +990,27 @@ sub cat_and_create_namelistinfile { phys=>"clm5_1", }, "nyrforceWOspinup" =>{ options=>"-envxml_dir . -bgc bgc -clm_accelerated_spinup sasu", - namelst=>"use_matrixcn=.false.,isspinup=F,nyr_forcing=20", + namelst=>"use_matrixcn=.false.,spinup_matrixcn=F,nyr_forcing=20", GLC_TWO_WAY_COUPLING=>"TRUE", phys=>"clm5_0", }, "nyrsasuGTnyrforce" =>{ options=>"-envxml_dir . -bgc bgc -clm_accelerated_spinup sasu", - namelst=>"use_matrixcn=.false.,isspinup=T,nyr_forcing=20,nyr_sasu=21", + namelst=>"use_matrixcn=.false.,spinup_matrixcn=T,nyr_forcing=20,nyr_sasu=21", GLC_TWO_WAY_COUPLING=>"TRUE", phys=>"clm5_0", }, "iloopZero" =>{ options=>"-envxml_dir . -bgc bgc -clm_accelerated_spinup sasu", - namelst=>"use_matrixcn=.false.,isspinup=T,iloop_avg=0", + namelst=>"use_matrixcn=.false.,spinup_matrixcn=T,iloop_avg=0", GLC_TWO_WAY_COUPLING=>"TRUE", phys=>"clm5_0", }, "matrixspinupWADmode" =>{ options=>"-envxml_dir . -bgc bgc -clm_accelerated_spinup sasu", - namelst=>"isspinup=T,spinup_state=2", + namelst=>"spinup_matrixcn=T,spinup_state=2", GLC_TWO_WAY_COUPLING=>"TRUE", phys=>"clm5_0", }, "matrixspinupWclmaccell" =>{ options=>"-envxml_dir . -bgc bgc -clm_accelerated_spinup off", - namelst=>"use_soil_matrixcn=T,isspinup=T", + namelst=>"use_soil_matrixcn=T,spinup_matrixcn=T", GLC_TWO_WAY_COUPLING=>"TRUE", phys=>"clm5_0", }, diff --git a/cime_config/SystemTests/sspmatrixcn.py b/cime_config/SystemTests/sspmatrixcn.py index eec462e72c..0e0d57e6c2 100644 --- a/cime_config/SystemTests/sspmatrixcn.py +++ b/cime_config/SystemTests/sspmatrixcn.py @@ -130,7 +130,7 @@ def append_user_nl(self, caseroot, n=0): # For all but last step turn extra matrix output to off b4last = self.n_steps() - 1 if ( n < b4last ): - contents_to_append = contents_to_append + ", is_outmatrix = .False." + contents_to_append = contents_to_append + ", hist_wrt_matrixcn_diag = .False." # For matrix spinup steps, set the matrix spinup and other variables associated with it if ( self.spin[n] == "sasu" ): contents_to_append = contents_to_append + ", nyr_forcing = "+str(self.nyr_forcing) diff --git a/cime_config/testdefs/testmods_dirs/clm/ciso_monthly_matrixcn/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/ciso_monthly_matrixcn/user_nl_clm index 56d4261a45..6b7eb4347d 100644 --- a/cime_config/testdefs/testmods_dirs/clm/ciso_monthly_matrixcn/user_nl_clm +++ b/cime_config/testdefs/testmods_dirs/clm/ciso_monthly_matrixcn/user_nl_clm @@ -1,3 +1,3 @@ use_matrixcn = .true. use_soil_matrixcn = .true. - is_outmatrix = .true. + hist_wrt_matrixcn_diag = .true. diff --git a/src/biogeochem/CNVegMatrixMod.F90 b/src/biogeochem/CNVegMatrixMod.F90 index c171490bf0..bf7527bc71 100644 --- a/src/biogeochem/CNVegMatrixMod.F90 +++ b/src/biogeochem/CNVegMatrixMod.F90 @@ -41,7 +41,7 @@ module CNVegMatrixMod use CNVegNitrogenFluxType , only : cnveg_nitrogenflux_type use CNVegStateType , only : cnveg_state_type use SoilBiogeochemNitrogenFluxType , only : soilbiogeochem_nitrogenflux_type - use clm_varctl , only : isspinup, is_outmatrix, nyr_forcing, nyr_SASU, iloop_avg + use clm_varctl , only : spinup_matrixcn, hist_wrt_matrixcn_diag, nyr_forcing, nyr_SASU, iloop_avg use clm_varctl , only : use_c13, use_c14 use SparseMatrixMultiplyMod , only : sparse_matrix_type,diag_matrix_type,vector_type use MatrixMod , only : inverse @@ -1253,7 +1253,7 @@ subroutine CNVegMatrix(bounds,num_soilp,filter_soilp,num_actfirep,filter_actfire if(mod(iyr-1,nyr_forcing) .eq. 0)then iloop = iloop + 1 end if - if(.not. isspinup .or. isspinup .and. mod(iyr-1,nyr_SASU) .eq. 0)then + if(.not. spinup_matrixcn .or. spinup_matrixcn .and. mod(iyr-1,nyr_SASU) .eq. 0)then do fp = 1,num_soilp p = filter_soilp(fp) leafc0(p) = max(leafc(p), epsi) @@ -1683,7 +1683,7 @@ subroutine CNVegMatrix(bounds,num_soilp,filter_soilp,num_actfirep,filter_actfire ! Accumulate transfers during the whole calendar year call t_startf('CN veg matrix-accum. trans.') - if(isspinup .or. is_outmatrix)then + if(spinup_matrixcn .or. hist_wrt_matrixcn_diag)then do fp = 1,num_soilp p = filter_soilp(fp) matrix_calloc_leaf_acc(p) = matrix_calloc_leaf_acc(p) + vegmatrixc_input%V(p,ileaf) @@ -2439,8 +2439,8 @@ subroutine CNVegMatrix(bounds,num_soilp,filter_soilp,num_actfirep,filter_actfire call t_stopf('CN veg matrix-assign new value') ! Calculate C storage capacity. 2D matrix instead of sparse matrix is still used when calculating the inverse - if(isspinup .or. is_outmatrix)then - if((.not. isspinup .and. is_end_curr_year()) .or. (isspinup .and. is_end_curr_year() .and. mod(iyr,nyr_SASU) .eq. 0))then + if(spinup_matrixcn .or. hist_wrt_matrixcn_diag)then + if((.not. spinup_matrixcn .and. is_end_curr_year()) .or. (spinup_matrixcn .and. is_end_curr_year() .and. mod(iyr,nyr_SASU) .eq. 0))then do fp = 1,num_soilp call t_startf('CN veg matrix-prepare AK^-1') p = filter_soilp(fp) @@ -2881,7 +2881,7 @@ subroutine CNVegMatrix(bounds,num_soilp,filter_soilp,num_actfirep,filter_actfire call t_startf('CN veg matrix-finalize spinup') - if(isspinup .and. .not. is_first_step_of_this_run_segment())then + if(spinup_matrixcn .and. .not. is_first_step_of_this_run_segment())then deadstemc(p) = vegmatrixc_rt(ideadstem) deadstemc_storage(p) = vegmatrixc_rt(ideadstem_st) deadcrootc(p) = vegmatrixc_rt(ideadcroot) @@ -3184,7 +3184,7 @@ subroutine CNVegMatrix(bounds,num_soilp,filter_soilp,num_actfirep,filter_actfire end if ! Save C storage capacity from temporary variables to module variables - if(is_outmatrix)then + if(hist_wrt_matrixcn_diag)then matrix_cap_leafc(p) = vegmatrixc_rt(ileaf) matrix_cap_leafc_storage(p) = vegmatrixc_rt(ileaf_st) matrix_cap_leafc_xfer(p) = vegmatrixc_rt(ileaf_xf) diff --git a/src/main/clm_varctl.F90 b/src/main/clm_varctl.F90 index ffc43b4200..faead44399 100644 --- a/src/main/clm_varctl.F90 +++ b/src/main/clm_varctl.F90 @@ -280,8 +280,8 @@ module clm_varctl !---------------------------------------------------------- ! CN matrix !---------------------------------------------------------- - logical, public :: isspinup = .false. !.false. ! true => use acc spinup - logical, public :: is_outmatrix = .false.!.false. ! true => use acc spinup + logical, public :: spinup_matrixcn = .false. !.false. ! true => use acc spinup + logical, public :: hist_wrt_matrixcn_diag = .false.!.false. ! true => use acc spinup ! SASU integer, public :: nyr_forcing = 10 ! length of forcing years for the spin up. eg. if DATM_CLMNCEP_YR_START=1901;DATM_CLMNCEP_YR_END=1920, then nyr_forcing = 20 integer, public :: nyr_SASU = 1 ! length of each semi-analytic solution. eg. nyr_SASU=5, analytic solutions will be calculated every five years. diff --git a/src/main/controlMod.F90 b/src/main/controlMod.F90 index ef006bcc42..acb4d6491b 100644 --- a/src/main/controlMod.F90 +++ b/src/main/controlMod.F90 @@ -189,7 +189,7 @@ subroutine control_init(dtime) ! CN Matrix solution namelist /clm_inparm / & - use_matrixcn, use_soil_matrixcn, is_outmatrix, isspinup, nyr_forcing, nyr_sasu, iloop_avg + use_matrixcn, use_soil_matrixcn, hist_wrt_matrixcn_diag, spinup_matrixcn, nyr_forcing, nyr_sasu, iloop_avg ! lake_melt_icealb is of dimension numrad @@ -325,8 +325,8 @@ subroutine control_init(dtime) if(use_fates)then use_matrixcn = .false. use_soil_matrixcn = .false. - is_outmatrix = .false. - isspinup = .false. + hist_wrt_matrixcn_diag = .false. + spinup_matrixcn = .false. end if nyr_forcing = 10 @@ -850,8 +850,8 @@ subroutine control_spmd() call mpi_bcast (use_dynroot, 1, MPI_LOGICAL, 0, mpicom, ier) call mpi_bcast (use_matrixcn, 1, MPI_LOGICAL, 0, mpicom, ier) call mpi_bcast (use_soil_matrixcn, 1, MPI_LOGICAL, 0, mpicom, ier) - call mpi_bcast (is_outmatrix, 1, MPI_LOGICAL, 0, mpicom, ier) - call mpi_bcast (isspinup, 1, MPI_LOGICAL, 0, mpicom, ier) + call mpi_bcast (hist_wrt_matrixcn_diag, 1, MPI_LOGICAL, 0, mpicom, ier) + call mpi_bcast (spinup_matrixcn, 1, MPI_LOGICAL, 0, mpicom, ier) call mpi_bcast (nyr_forcing, 1, MPI_INTEGER, 0, mpicom, ier) call mpi_bcast (nyr_sasu, 1, MPI_INTEGER, 0, mpicom, ier) call mpi_bcast (iloop_avg, 1, MPI_INTEGER, 0, mpicom, ier) diff --git a/src/soilbiogeochem/CNSoilMatrixMod.F90 b/src/soilbiogeochem/CNSoilMatrixMod.F90 index 1248c5e1d6..56c1f11b5c 100644 --- a/src/soilbiogeochem/CNSoilMatrixMod.F90 +++ b/src/soilbiogeochem/CNSoilMatrixMod.F90 @@ -34,7 +34,7 @@ module CNSoilMatrixMod use SoilBiogeochemNitrogenFluxType , only : soilbiogeochem_nitrogenflux_type use CNSharedParamsMod , only : CNParamsShareInst use SoilStateType , only : soilstate_type - use clm_varctl , only : isspinup, is_outmatrix, nyr_forcing, nyr_SASU, iloop_avg + use clm_varctl , only : spinup_matrixcn, hist_wrt_matrixcn_diag, nyr_forcing, nyr_SASU, iloop_avg use ColumnType , only : col use GridcellType , only : grc use clm_varctl , only : use_c13, use_c14, iulog @@ -67,14 +67,14 @@ subroutine CNSoilMatrixInit( ) if ( use_soil_matrixcn ) then write(iulog,*) 'CN Soil matrix solution is on' write(iulog,*) '*****************************' - if ( isspinup ) then + if ( spinup_matrixcn ) then write(iulog,*) ' Matrix spinup is on' write(iulog,*) ' *******************' write(iulog,*) ' nyr_forcing = ', nyr_forcing write(iulog,*) ' nyr_SASU = ', nyr_SASU write(iulog,*) ' iloop_avg = ', iloop_avg end if - if ( is_outmatrix )then + if ( hist_wrt_matrixcn_diag )then write(iulog,*) ' Extra matrix solution tracability output is turned on' else write(iulog,*) ' no extra matrix solution tracability output' @@ -343,7 +343,7 @@ subroutine CNSoilMatrix(bounds,num_soilc, filter_soilc, num_actfirec, filter_act if(mod(iyr-1,nyr_forcing) .eq. 0)then iloop = iloop + 1 end if - if(.not. isspinup .or. isspinup .and. mod(iyr-1,nyr_SASU) .eq. 0)then + if(.not. spinup_matrixcn .or. spinup_matrixcn .and. mod(iyr-1,nyr_SASU) .eq. 0)then do i = 1,ndecomp_pools do j = 1, nlevdecomp do fc = 1,num_soilc @@ -550,7 +550,7 @@ subroutine CNSoilMatrix(bounds,num_soilc, filter_soilc, num_actfirec, filter_act call t_stopf('CN Soil matrix-assign back') - if(use_soil_matrixcn .and. (is_outmatrix .or. isspinup))then + if(use_soil_matrixcn .and. (hist_wrt_matrixcn_diag .or. spinup_matrixcn))then ! Accumulate C transfers during a whole calendar year to calculate the C and N capacity do j=1,ndecomp_pools*nlevdecomp @@ -665,7 +665,7 @@ subroutine CNSoilMatrix(bounds,num_soilc, filter_soilc, num_actfirec, filter_act end if call t_startf('CN Soil matrix-calc. C capacity') - if((.not. isspinup .and. is_end_curr_year()) .or. (isspinup .and. is_end_curr_year() .and. mod(iyr,nyr_SASU) .eq. 0))then + if((.not. spinup_matrixcn .and. is_end_curr_year()) .or. (spinup_matrixcn .and. is_end_curr_year() .and. mod(iyr,nyr_SASU) .eq. 0))then ! Copy C transfers from sparse matrix to 2D temporary variables tran_acc and tran_nacc ! Calculate the C and N transfer rate by dividing CN transfer by base value saved at begin of each year. do fc = 1,num_soilc @@ -816,7 +816,7 @@ subroutine CNSoilMatrix(bounds,num_soilc, filter_soilc, num_actfirec, filter_act do j = 1,nlevdecomp do fc = 1,num_soilc c = filter_soilc(fc) - if(isspinup .and. .not. is_first_step_of_this_run_segment())then + if(spinup_matrixcn .and. .not. is_first_step_of_this_run_segment())then cs_soil%decomp_cpools_vr_col(c,j,i) = soilmatrixc_cap(c,j+(i-1)*nlevdecomp,1) if(use_c13)then cs13_soil%decomp_cpools_vr_col(c,j,i) = soilmatrixc13_cap(c,j+(i-1)*nlevdecomp,1) @@ -871,7 +871,7 @@ subroutine CNSoilMatrix(bounds,num_soilc, filter_soilc, num_actfirec, filter_act end do end do - if(isspinup)call update_DA_nstep() + if(spinup_matrixcn)call update_DA_nstep() if(iloop .eq. iloop_avg .and. iyr .eq. nyr_forcing)iloop = 0 if(iyr .eq. nyr_forcing)iyr = 0 From 1a2ddffdffbae8b3140b0e751b530f21db9c5afb Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Wed, 27 Mar 2024 13:24:58 -0600 Subject: [PATCH 0098/1248] Replace 1.e+36 with spval in cnmatrix code --- src/biogeochem/CNVegMatrixMod.F90 | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/biogeochem/CNVegMatrixMod.F90 b/src/biogeochem/CNVegMatrixMod.F90 index bf7527bc71..5582afeffe 100644 --- a/src/biogeochem/CNVegMatrixMod.F90 +++ b/src/biogeochem/CNVegMatrixMod.F90 @@ -23,6 +23,7 @@ module CNVegMatrixMod use clm_time_manager , only : get_step_size,is_end_curr_year,is_first_step_of_this_run_segment,& is_beg_curr_year,update_DA_nstep use decompMod , only : bounds_type + use clm_varcon , only : spval use clm_varpar , only : nlevdecomp, nvegcpool, nvegnpool use clm_varpar , only : ileaf,ileaf_st,ileaf_xf,ifroot,ifroot_st,ifroot_xf,& ilivestem,ilivestem_st,ilivestem_xf,& @@ -2711,27 +2712,27 @@ subroutine CNVegMatrix(bounds,num_soilp,filter_soilp,num_actfirep,filter_actfire matrix_ntransfer_acc(iretransn,iretransn) = -matrix_nturnover_retransn_acc(p) do i=1,nvegcpool - if(matrix_ctransfer_acc(i,i) .eq. 0)then - matrix_ctransfer_acc(i,i) = 1.e+36 + if(matrix_ctransfer_acc(i,i) == 0)then + matrix_ctransfer_acc(i,i) = spval end if end do if(use_c13)then do i=1,nvegcpool - if(matrix_c13transfer_acc(i,i) .eq. 0)then - matrix_c13transfer_acc(i,i) = 1.e+36 + if(matrix_c13transfer_acc(i,i) == 0)then + matrix_c13transfer_acc(i,i) = spval end if end do end if if(use_c14)then do i=1,nvegcpool - if(matrix_c14transfer_acc(i,i) .eq. 0)then - matrix_c14transfer_acc(i,i) = 1.e+36 + if(matrix_c14transfer_acc(i,i) == 0)then + matrix_c14transfer_acc(i,i) = spval end if end do end if do i=1,nvegnpool - if(matrix_ntransfer_acc(i,i) .eq. 0)then - matrix_ntransfer_acc(i,i) = 1.e+36 + if(matrix_ntransfer_acc(i,i) == 0)then + matrix_ntransfer_acc(i,i) = spval end if end do From 47839a77229c61555e3b8932927bb54cdc511b27 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Wed, 27 Mar 2024 14:39:43 -0600 Subject: [PATCH 0099/1248] Black reformatting of two files --- cime_config/SystemTests/sspmatrixcn.py | 455 ++++++++++++++----------- cime_config/buildnml | 72 ++-- 2 files changed, 295 insertions(+), 232 deletions(-) diff --git a/cime_config/SystemTests/sspmatrixcn.py b/cime_config/SystemTests/sspmatrixcn.py index 0e0d57e6c2..37d4154121 100644 --- a/cime_config/SystemTests/sspmatrixcn.py +++ b/cime_config/SystemTests/sspmatrixcn.py @@ -14,15 +14,15 @@ """ import shutil, glob, os, sys -if __name__ == '__main__': - CIMEROOT = os.environ.get("CIMEROOT") - if CIMEROOT is None: - CIMEROOT = "../../cime"; +if __name__ == "__main__": + CIMEROOT = os.environ.get("CIMEROOT") + if CIMEROOT is None: + CIMEROOT = "../../cime" - sys.path.append(os.path.join( CIMEROOT, "scripts", "lib")) - sys.path.append(os.path.join( CIMEROOT, "scripts" ) ) + sys.path.append(os.path.join(CIMEROOT, "scripts", "lib")) + sys.path.append(os.path.join(CIMEROOT, "scripts")) else: - from CIME.utils import append_testlog + from CIME.utils import append_testlog from CIME.XML.standard_module_setup import * from CIME.SystemTests.system_tests_common import SystemTestsCommon @@ -31,123 +31,170 @@ logger = logging.getLogger(__name__) + class SSPMATRIXCN(SystemTestsCommon): # Class data nyr_forcing = 2 # Get different integer multiples of the number of forcing years - full = nyr_forcing - twice = 2 * nyr_forcing + full = nyr_forcing + twice = 2 * nyr_forcing thrice = 3 * nyr_forcing # Define the settings that will be used for each step - steps = ["0-AD", "1-SASU", "2-norm" ] - desc = ["Accell-Decomp(AD)-coldstart", "slow-mode Semi-Analytic SpinUp(SASU)", "normal" ] - runtyp = ["startup", "hybrid", "branch" ] - spin = ["on", "sasu", "off" ] - stop_n = [5, thrice, thrice ] - cold = [True, False, False ] - iloop = [-999, -999, -999 ] - sasu = [-999, -999, -999 ] + steps = ["0-AD", "1-SASU", "2-norm"] + desc = [ + "Accell-Decomp(AD)-coldstart", + "slow-mode Semi-Analytic SpinUp(SASU)", + "normal", + ] + runtyp = ["startup", "hybrid", "branch"] + spin = ["on", "sasu", "off"] + stop_n = [5, thrice, thrice] + cold = [True, False, False] + iloop = [-999, -999, -999] + sasu = [-999, -999, -999] def __init__(self, case=None): """ initialize an object interface to the SSPMATRIXCN system test """ - expect ( len(self.steps) == len(self.sasu), "length of steps must be the same as sasu" ) - expect ( len(self.steps) == len(self.spin), "length of steps must be the same as spin" ) - expect ( len(self.steps) == len(self.desc), "length of steps must be the same as desc" ) - expect ( len(self.steps) == len(self.cold), "length of steps must be the same as cold" ) - expect ( len(self.steps) == len(self.runtyp), "length of steps must be the same as runtyp" ) - expect ( len(self.steps) == len(self.iloop), "length of steps must be the same as iloop" ) - expect ( len(self.steps) == len(self.stop_n), "length of steps must be the same as stop_n" ) - - if __name__ != '__main__': - SystemTestsCommon.__init__(self, case) - ystart = int(self._case.get_value("DATM_YR_START")) - yend = int(self._case.get_value("DATM_YR_END")) - self.comp = self._case.get_value("COMP_LND") + expect( + len(self.steps) == len(self.sasu), + "length of steps must be the same as sasu", + ) + expect( + len(self.steps) == len(self.spin), + "length of steps must be the same as spin", + ) + expect( + len(self.steps) == len(self.desc), + "length of steps must be the same as desc", + ) + expect( + len(self.steps) == len(self.cold), + "length of steps must be the same as cold", + ) + expect( + len(self.steps) == len(self.runtyp), + "length of steps must be the same as runtyp", + ) + expect( + len(self.steps) == len(self.iloop), + "length of steps must be the same as iloop", + ) + expect( + len(self.steps) == len(self.stop_n), + "length of steps must be the same as stop_n", + ) + + if __name__ != "__main__": + SystemTestsCommon.__init__(self, case) + ystart = int(self._case.get_value("DATM_YR_START")) + yend = int(self._case.get_value("DATM_YR_END")) + self.comp = self._case.get_value("COMP_LND") else: - self._case = None - self.comp = "clm" - ystart = 2000 - yend = 2001 + self._case = None + self.comp = "clm" + ystart = 2000 + yend = 2001 for n in range(len(self.steps)): - if ( n == 0 ): - expect( self.cold[n] == True, "First step MUST be a cold-start" ) - expect( self.runtyp[n] == "startup", "First step MUST be a startup" ) - else: - expect( self.cold[n] == False, "Other steps must NOT be a cold-start" ) - expect( self.runtyp[n] != "startup", "Other steps MUST NOT be a startup" ) - - if ( self.spin[n] == "sasu" ): - expect( self.cold[n] == False, "SASU step should NOT be a cold-start" ) - if ( self.sasu[n] != -999 ): - expect( self.sasu[n] > 0, "SASU steps must set SASU cycle" ) - expect( self.sasu[n] <= self.nyr_forcing, "SASU cycles can't be greater than a full forcing cycle" ) - - expect( yend-ystart+1 == self.nyr_forcing, "Number of years run over MUST correspond to nyr_forcing" ) + if n == 0: + expect(self.cold[n] == True, "First step MUST be a cold-start") + expect(self.runtyp[n] == "startup", "First step MUST be a startup") + else: + expect(self.cold[n] == False, "Other steps must NOT be a cold-start") + expect(self.runtyp[n] != "startup", "Other steps MUST NOT be a startup") + + if self.spin[n] == "sasu": + expect(self.cold[n] == False, "SASU step should NOT be a cold-start") + if self.sasu[n] != -999: + expect(self.sasu[n] > 0, "SASU steps must set SASU cycle") + expect( + self.sasu[n] <= self.nyr_forcing, + "SASU cycles can't be greater than a full forcing cycle", + ) + + expect( + yend - ystart + 1 == self.nyr_forcing, + "Number of years run over MUST correspond to nyr_forcing", + ) self._testname = "SSPMATRIX" - def check_n( self, n): + def check_n(self, n): "Check if n is within range" - expect( ( (n >= 0) and (n < self.n_steps()) ), "Step number is out of range = " + str(n) ) + expect( + ((n >= 0) and (n < self.n_steps())), + "Step number is out of range = " + str(n), + ) def __logger__(self, n=0): "Log info on this step" - self.check_n( n ) - msg = "Step {}: {}: doing a {} run for {} years".format( self.steps[n], self.runtyp[n], self.desc[n], self.stop_n[n] ) + self.check_n(n) + msg = "Step {}: {}: doing a {} run for {} years".format( + self.steps[n], self.runtyp[n], self.desc[n], self.stop_n[n] + ) logger.info(msg) - logger.info(" spinup type: {}".format( self.spin[n] ) ) - if __name__ != '__main__': - append_testlog(msg) - if ( n+1 < self.n_steps() ): - logger.info(" writing restarts at end of run") - logger.info(" short term archiving is on ") + logger.info(" spinup type: {}".format(self.spin[n])) + if __name__ != "__main__": + append_testlog(msg) + if n + 1 < self.n_steps(): + logger.info(" writing restarts at end of run") + logger.info(" short term archiving is on ") def n_steps(self): "Total number of steps" - return( len(self.steps) ) + return len(self.steps) def total_years(self): "Total number of years needed to do the full spinup" ysum = 0 for nyr in self.stop_n: - ysum = ysum + nyr + ysum = ysum + nyr - return( ysum ) + return ysum def append_user_nl(self, caseroot, n=0): "Append needed settings to the user_nl files" - self.check_n( n ) + self.check_n(n) # For all set output to yearly contents_to_append = "hist_nhtfrq = -8760" - contents_to_append = contents_to_append + ", hist_mfilt = "+str(self.nyr_forcing) + contents_to_append = ( + contents_to_append + ", hist_mfilt = " + str(self.nyr_forcing) + ) # For all but last step turn extra matrix output to off b4last = self.n_steps() - 1 - if ( n < b4last ): - contents_to_append = contents_to_append + ", hist_wrt_matrixcn_diag = .False." + if n < b4last: + contents_to_append = ( + contents_to_append + ", hist_wrt_matrixcn_diag = .False." + ) # For matrix spinup steps, set the matrix spinup and other variables associated with it - if ( self.spin[n] == "sasu" ): - contents_to_append = contents_to_append + ", nyr_forcing = "+str(self.nyr_forcing) - if ( self.sasu[n] != -999 ): - contents_to_append = contents_to_append + ", nyr_sasu = " + str(self.sasu[n]) - if ( self.iloop[n] != -999 ): - contents_to_append = contents_to_append + ", iloop_avg = " + str(self.iloop[n]) + if self.spin[n] == "sasu": + contents_to_append = ( + contents_to_append + ", nyr_forcing = " + str(self.nyr_forcing) + ) + if self.sasu[n] != -999: + contents_to_append = ( + contents_to_append + ", nyr_sasu = " + str(self.sasu[n]) + ) + if self.iloop[n] != -999: + contents_to_append = ( + contents_to_append + ", iloop_avg = " + str(self.iloop[n]) + ) # For cold start, run with matrix off - if ( self.cold[n] ): + if self.cold[n]: contents_to_append = contents_to_append + ", use_matrixcn = .False." contents_to_append = contents_to_append + ", use_soil_matrixcn = .False." # Always append to the end - user_nl_utils.append_to_user_nl_files(caseroot = caseroot, - component = self.comp, - contents = contents_to_append) + user_nl_utils.append_to_user_nl_files( + caseroot=caseroot, component=self.comp, contents=contents_to_append + ) def run_phase(self): "Run phase" @@ -156,77 +203,80 @@ def run_phase(self): orig_case = self._case orig_casevar = self._case.get_value("CASE") - # Get a clone of each step except the last one b4last = self.n_steps() - 1 for n in range(b4last): - # - # Clone the main case, and get it setup for the next step - # - clone_path = "{}.step{}".format(caseroot,self.steps[n]) - if os.path.exists(clone_path): - shutil.rmtree(clone_path) - if ( n > 0 ): - del clone - self._set_active_case(orig_case) - clone = self._case.create_clone(clone_path, keepexe=True) - os.chdir(clone_path) - self._set_active_case(clone) - - self.__logger__(n) - - with clone: - clone.set_value("RUN_TYPE", self.runtyp[n] ) - clone.set_value("STOP_N", self.stop_n[n] ) - - clone.set_value("CLM_ACCELERATED_SPINUP", self.spin[n] ) - - if ( self.cold[n] ): - clone.set_value("CLM_FORCE_COLDSTART", "on" ) - else: - clone.set_value("CLM_FORCE_COLDSTART", "off" ) - - self.append_user_nl( clone_path, n ) - - dout_sr = clone.get_value("DOUT_S_ROOT") - - self._skip_pnl = False - # - # Start up from the previous case - # - rundir = clone.get_value("RUNDIR") - with clone: - if ( n > 0 ): - clone.set_value("GET_REFCASE", False) - expect( "refcase" in locals(), "refcase was NOT previously set" ) - clone.set_value("RUN_REFCASE", refcase ) - expect( "refdate" in locals(), "refdate was NOT previously set" ) - clone.set_value("RUN_STARTDATE", refdate ) - clone.set_value("RUN_REFDATE", refdate ) - for item in glob.glob("{}/*{}*".format(rest_path, refdate)): - linkfile = os.path.join(rundir, os.path.basename(item)) - if os.path.exists(linkfile): - os.remove( linkfile ) - if not os.path.isdir(rundir): - os.makedirs(rundir) - os.symlink(item, linkfile ) - - for item in glob.glob("{}/*rpointer*".format(rest_path)): - shutil.copy(item, rundir) - - # - # Run the case (Archiving on) - # - self._case.flush() - self.run_indv(suffix="step{}".format(self.steps[n]), st_archive=True) - - # - # Get the reference case from this step for the next step - # - refcase = clone.get_value("CASE") - refdate = run_cmd_no_fail(r'ls -1dt {}/rest/*-00000* | head -1 | sed "s/-00000.*//" | sed "s/^.*rest\///"'.format(dout_sr)) - refsec = "00000" - rest_path = os.path.join(dout_sr, "rest", "{}-{}".format(refdate, refsec)) + # + # Clone the main case, and get it setup for the next step + # + clone_path = "{}.step{}".format(caseroot, self.steps[n]) + if os.path.exists(clone_path): + shutil.rmtree(clone_path) + if n > 0: + del clone + self._set_active_case(orig_case) + clone = self._case.create_clone(clone_path, keepexe=True) + os.chdir(clone_path) + self._set_active_case(clone) + + self.__logger__(n) + + with clone: + clone.set_value("RUN_TYPE", self.runtyp[n]) + clone.set_value("STOP_N", self.stop_n[n]) + + clone.set_value("CLM_ACCELERATED_SPINUP", self.spin[n]) + + if self.cold[n]: + clone.set_value("CLM_FORCE_COLDSTART", "on") + else: + clone.set_value("CLM_FORCE_COLDSTART", "off") + + self.append_user_nl(clone_path, n) + + dout_sr = clone.get_value("DOUT_S_ROOT") + + self._skip_pnl = False + # + # Start up from the previous case + # + rundir = clone.get_value("RUNDIR") + with clone: + if n > 0: + clone.set_value("GET_REFCASE", False) + expect("refcase" in locals(), "refcase was NOT previously set") + clone.set_value("RUN_REFCASE", refcase) + expect("refdate" in locals(), "refdate was NOT previously set") + clone.set_value("RUN_STARTDATE", refdate) + clone.set_value("RUN_REFDATE", refdate) + for item in glob.glob("{}/*{}*".format(rest_path, refdate)): + linkfile = os.path.join(rundir, os.path.basename(item)) + if os.path.exists(linkfile): + os.remove(linkfile) + if not os.path.isdir(rundir): + os.makedirs(rundir) + os.symlink(item, linkfile) + + for item in glob.glob("{}/*rpointer*".format(rest_path)): + shutil.copy(item, rundir) + + # + # Run the case (Archiving on) + # + self._case.flush() + self.run_indv(suffix="step{}".format(self.steps[n]), st_archive=True) + + # + # Get the reference case from this step for the next step + # + refcase = clone.get_value("CASE") + refdate = run_cmd_no_fail( + r'ls -1dt {}/rest/*-00000* | head -1 | sed "s/-00000.*//" | sed "s/^.*rest\///"'.format( + dout_sr + ) + ) + refsec = "00000" + rest_path = os.path.join(dout_sr, "rest", "{}-{}".format(refdate, refsec)) # # Last step in original case @@ -239,25 +289,25 @@ def run_phase(self): self._set_active_case(orig_case) self.__logger__(n) self._case.set_value("DOUT_S", False) - self._case.set_value("RUN_TYPE", self.runtyp[n] ) - self._case.set_value("STOP_N", self.stop_n[n] ) + self._case.set_value("RUN_TYPE", self.runtyp[n]) + self._case.set_value("STOP_N", self.stop_n[n]) rundir = self._case.get_value("RUNDIR") self._case.set_value("GET_REFCASE", False) - expect( "refcase" in locals(), "refcase was NOT previously set" ) + expect("refcase" in locals(), "refcase was NOT previously set") self._case.set_value("RUN_REFCASE", refcase) - expect( "refdate" in locals(), "refdate was NOT previously set" ) + expect("refdate" in locals(), "refdate was NOT previously set") self._case.set_value("RUN_REFDATE", refdate) - self._case.set_value("RUN_STARTDATE", refdate ) + self._case.set_value("RUN_STARTDATE", refdate) for item in glob.glob("{}/*{}*".format(rest_path, refdate)): linkfile = os.path.join(rundir, os.path.basename(item)) if os.path.exists(linkfile): - os.remove( linkfile ) - os.symlink(item, linkfile ) + os.remove(linkfile) + os.symlink(item, linkfile) for item in glob.glob("{}/*rpointer*".format(rest_path)): shutil.copy(item, rundir) - self.append_user_nl( clone_path, n ) + self.append_user_nl(clone_path, n) # # Don't need to set COLDSTART or ACCEL_SPINUP # @@ -266,7 +316,8 @@ def run_phase(self): # Run the case (short term archiving is off) # self._case.flush() - self.run_indv( suffix="step{}".format(self.steps[n]), st_archive=False ) + self.run_indv(suffix="step{}".format(self.steps[n]), st_archive=False) + # # Unit testing for above @@ -274,59 +325,57 @@ def run_phase(self): import unittest from CIME.case import Case from CIME.utils import _LessThanFilter -from argparse import RawTextHelpFormatter +from argparse import RawTextHelpFormatter + class test_ssp_matrixcn(unittest.TestCase): + def setUp(self): + self.ssp = SSPMATRIXCN() + + def test_logger(self): + # Test the logger + stream_handler = logging.StreamHandler(sys.stdout) + logger.addHandler(stream_handler) + logger.level = logging.DEBUG + logger.info("nyr_forcing = {}".format(self.ssp.nyr_forcing)) + for n in range(self.ssp.n_steps()): + self.ssp.__logger__(n) + if self.ssp.spin[n] == "sasu": + logger.info(" SASU spinup is .true.") + if self.ssp.sasu[n] != -999: + logger.info(" nyr_sasu = {}".format(self.ssp.sasu[n])) + if self.ssp.iloop[n] != -999: + logger.info(" iloop_avg = {}".format(self.ssp.iloop[n])) + + logger.info("Total number of years {}".format(self.ssp.total_years())) + logger.removeHandler(stream_handler) + + def test_n_steps(self): + self.assertTrue(self.ssp.n_steps() == 3) + + def test_valid_n(self): + for n in range(self.ssp.n_steps()): + self.ssp.check_n(n) + + def test_negative_n(self): + self.assertRaises(SystemExit, self.ssp.check_n, -1) + + def test_n_too_big(self): + self.assertRaises(SystemExit, self.ssp.check_n, self.ssp.n_steps()) + + def test_append_user_nl_step2(self): + ufile = "user_nl_clm" + if not os.path.exists(ufile): + os.mknod(ufile) + else: + expect(0, ufile + " file already exists, not overwritting it") - def setUp( self ): - self.ssp = SSPMATRIXCN() - - def test_logger( self ): - # Test the logger - stream_handler = logging.StreamHandler(sys.stdout) - logger.addHandler(stream_handler) - logger.level = logging.DEBUG - logger.info( "nyr_forcing = {}".format(self.ssp.nyr_forcing) ) - for n in range(self.ssp.n_steps()): - self.ssp.__logger__(n) - if ( self.ssp.spin[n] == "sasu" ): - logger.info( " SASU spinup is .true." ) - if ( self.ssp.sasu[n] != -999 ): - logger.info( " nyr_sasu = {}".format(self.ssp.sasu[n]) ) - if ( self.ssp.iloop[n] != -999 ): - logger.info( " iloop_avg = {}".format(self.ssp.iloop[n]) ) - - logger.info( "Total number of years {}".format( self.ssp.total_years() ) ) - logger.removeHandler(stream_handler) - - def test_n_steps( self ): - self.assertTrue( self.ssp.n_steps() == 3) - - def test_valid_n( self ): - for n in range(self.ssp.n_steps()): - self.ssp.check_n(n) - - def test_negative_n( self ): - self.assertRaises(SystemExit, self.ssp.check_n, -1 ) - - def test_n_too_big( self ): - self.assertRaises(SystemExit, self.ssp.check_n, self.ssp.n_steps() ) - - def test_append_user_nl_step2( self ): - ufile = "user_nl_clm" - if not os.path.exists(ufile): - os.mknod(ufile) - else: - expect( 0, ufile+" file already exists, not overwritting it" ) - - self.ssp.append_user_nl( caseroot=".", n=2) - print( ufile+" for step 2" ) - log = open(ufile, "r").read() - print( log ) - os.remove(ufile) - - -if __name__ == '__main__': - unittest.main() + self.ssp.append_user_nl(caseroot=".", n=2) + print(ufile + " for step 2") + log = open(ufile, "r").read() + print(log) + os.remove(ufile) +if __name__ == "__main__": + unittest.main() diff --git a/cime_config/buildnml b/cime_config/buildnml index 11112b81f0..2f27473732 100755 --- a/cime_config/buildnml +++ b/cime_config/buildnml @@ -51,24 +51,24 @@ def buildnml(case, caseroot, compname): clm_accelerated_spinup = case.get_value("CLM_ACCELERATED_SPINUP") comp_interface = case.get_value("COMP_INTERFACE") lilac_mode = case.get_value("LILAC_MODE") - if ( comp_interface == "nuopc" ): - yr_start = case.get_value("DATM_YR_START") - yr_end = case.get_value("DATM_YR_END") + if comp_interface == "nuopc": + yr_start = case.get_value("DATM_YR_START") + yr_end = case.get_value("DATM_YR_END") else: - yr_start = case.get_value("DATM_CLMNCEP_YR_START") - yr_end = case.get_value("DATM_CLMNCEP_YR_END") + yr_start = case.get_value("DATM_CLMNCEP_YR_START") + yr_end = case.get_value("DATM_CLMNCEP_YR_END") - if ( yr_start != None and yr_start < 0 ): - yr_start = case.get_value("DATM_CPLHIST_YR_START") - yr_end = case.get_value("DATM_CPLHIST_YR_END") + if yr_start != None and yr_start < 0: + yr_start = case.get_value("DATM_CPLHIST_YR_START") + yr_end = case.get_value("DATM_CPLHIST_YR_END") # For LILAC - if ( yr_start == None or lilac_mode == "on" ): - yr_start = "0" - yr_end = "0" + if yr_start == None or lilac_mode == "on": + yr_start = "0" + yr_end = "0" yr_start = int(yr_start) - yr_end = int(yr_end) + yr_end = int(yr_end) comp_atm = case.get_value("COMP_ATM") lnd_grid = case.get_value("LND_GRID") @@ -117,7 +117,9 @@ def buildnml(case, caseroot, compname): clm_phys = case.get_value("CLM_PHYSICS_VERSION") config_cache_text = _config_cache_template.format(clm_phys=clm_phys) - config_cache_path = os.path.join(caseroot, "Buildconf", compname + "conf", "config_cache.xml") + config_cache_path = os.path.join( + caseroot, "Buildconf", compname + "conf", "config_cache.xml" + ) with open(config_cache_path, "w") as config_cache_file: config_cache_file.write(config_cache_text) @@ -206,22 +208,28 @@ def buildnml(case, caseroot, compname): else: ignore = "-ignore_ic_date" - tuning = "-lnd_tuning_mode %s "%lnd_tuning_mode - + tuning = "-lnd_tuning_mode %s " % lnd_tuning_mode + # # Spinup settings and specifics for SASU spinup # - spinup = "-clm_accelerated_spinup %s "%clm_accelerated_spinup - if ( clm_accelerated_spinup == "sasu" ): - if ( (yr_start != None) and (yr_end != None) ): - nyr = yr_end - yr_start + 1 - if ( (yr_end <= 0) or (yr_start <= 0) ): - logger.error( "ERROR: Year start and end are both negative and should not be" ) - clm_namelist_opts = "nyr_forcing={} {}".format(nyr, clm_namelist_opts) - else: - logger.warning( "WARNING: It does not make sense to do a SASU spinup with a prognostic atmosphere model" ) - logger.warning( " as it expects regular atmosphere forcing that is cycled over" ) - + spinup = "-clm_accelerated_spinup %s " % clm_accelerated_spinup + if clm_accelerated_spinup == "sasu": + if (yr_start != None) and (yr_end != None): + nyr = yr_end - yr_start + 1 + if (yr_end <= 0) or (yr_start <= 0): + logger.error( + "ERROR: Year start and end are both negative and should not be" + ) + clm_namelist_opts = "nyr_forcing={} {}".format(nyr, clm_namelist_opts) + else: + logger.warning( + "WARNING: It does not make sense to do a SASU spinup with a prognostic atmosphere model" + ) + logger.warning( + " as it expects regular atmosphere forcing that is cycled over" + ) + infile = os.path.join(ctsmconf, "namelist") inputdata_file = os.path.join(caseroot, "Buildconf", "ctsm.input_data_list") @@ -234,7 +242,9 @@ def buildnml(case, caseroot, compname): lndfrac_file = os.path.join(lnd_domain_path, lnd_domain_file) lndfrac_setting = "-lnd_frac " + lndfrac_file - config_cache_file = os.path.join(caseroot, "Buildconf", compname + "conf", "config_cache.xml") + config_cache_file = os.path.join( + caseroot, "Buildconf", compname + "conf", "config_cache.xml" + ) # ----------------------------------------------------- # Clear out old data @@ -297,7 +307,9 @@ def buildnml(case, caseroot, compname): break if not os.path.exists(os.path.join(rundir, clm_startfile)): - logger.warning("WARNING: Could NOT find a start file to use using" + clm_startfile) + logger.warning( + "WARNING: Could NOT find a start file to use using" + clm_startfile + ) clm_icfile = "%s = '%s'" % (startfile_type, clm_startfile) else: clm_icfile = "" @@ -308,7 +320,9 @@ def buildnml(case, caseroot, compname): user_nl_file = os.path.join(caseroot, "user_nl_clm" + inst_string) namelist_infile = os.path.join(ctsmconf, "namelist") - create_namelist_infile(case, user_nl_file, namelist_infile, "\n".join(infile_lines)) + create_namelist_infile( + case, user_nl_file, namelist_infile, "\n".join(infile_lines) + ) cmd = os.path.join(lnd_root, "bld", "build-namelist") From 4cef2cc63b6282c1792ef45803cfad33f2dc3737 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Wed, 27 Mar 2024 14:45:05 -0600 Subject: [PATCH 0100/1248] Update .git-blame-ignore-revs --- .git-blame-ignore-revs | 1 + 1 file changed, 1 insertion(+) diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs index 4798c37853..2c92251e93 100644 --- a/.git-blame-ignore-revs +++ b/.git-blame-ignore-revs @@ -32,3 +32,4 @@ d866510188d26d51bcd6d37239283db690af7e82 6fccf682eaf718615407d9bacdd3903b8786a03d 2500534eb0a83cc3aff94b30fb62e915054030bf 78d05967c2b027dc9776a884716597db6ef7f57c +47839a77229c61555e3b8932927bb54cdc511b27 From eede6f8fa03d00f997fa8b4a5b39535be6d89a00 Mon Sep 17 00:00:00 2001 From: "Danny M. Leung" Date: Mon, 1 Apr 2024 17:08:52 -0600 Subject: [PATCH 0101/1248] dmleung reverted to the landunit level VAI for Okin's vegetation drag partitioning, which worked much better than the patch level VAI. 1 Apr 2024 --- src/biogeochem/DUSTMod.F90 | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/biogeochem/DUSTMod.F90 b/src/biogeochem/DUSTMod.F90 index 17deda7375..9161076e4f 100644 --- a/src/biogeochem/DUSTMod.F90 +++ b/src/biogeochem/DUSTMod.F90 @@ -646,8 +646,8 @@ subroutine DustEmission (bounds, & ! purpose: compute factor by which surface roughness increases threshold ! friction velocity (currently a constant) - !if (lnd_frc_mbl(p) > 0.0_r8 .AND. tlai_lu(l)<=1_r8) then - if (lnd_frc_mbl(p) > 0.0_r8 .AND. ttlai(p)<=1_r8) then + if (lnd_frc_mbl(p) > 0.0_r8 .AND. tlai_lu(l)<=1_r8) then + !if (lnd_frc_mbl(p) > 0.0_r8 .AND. ttlai(p)<=1_r8) then ! vegetation drag partition equation following Gregory Okin (2008) + Caroline Pierre et al. (2014) !lai(p) = tlai_lu(l)+0.1_r8 ! LAI+SAI averaged to landunit level; the equation is undefined at lai=0, and LAI in CTSM has some zeros over deserts, so we add in a small number. !lai(p) = ttlai(p) + lai0_Okin ! ttlai = tlai+tsai. Okin-Pierre's equation is undefined at lai=0, and LAI in CTSM has some zeros over deserts, so we add in a small number. On 26 Feb 2024, dmleung changed from tlai_lu(l) to ttlai(p) @@ -655,9 +655,17 @@ subroutine DustEmission (bounds, & ! lai(p) = 1_r8 ! setting LAI = 1 to be a max value (since K_length goes to negative when LAI>1) !end if ! - if (ttlai(p) + vai0_Okin <= 1_r8) then - vai_Okin(p) = ttlai(p) + vai0_Okin ! ttlai = vai = tlai+tsai. Okin-Pierre's equation is undefined at vai=0, and VAI in CTSM has some zeros over deserts, so we add in a small number. On 26 Feb 2024, dmleung changed from tlai_lu(l) to ttlai(p) - end if ! In the Okin-Pierre formulation, VAI has to be 0 < VAI <= 1. + !if (ttlai(p) + vai0_Okin <= 1_r8) then + ! vai_Okin(p) = ttlai(p) + vai0_Okin ! ttlai = vai = tlai+tsai. Okin-Pierre's equation is undefined at vai=0, and VAI in CTSM has some zeros over deserts, so we add in a small number. On 26 Feb 2024, dmleung changed from tlai_lu(l) to ttlai(p) + !if (tlai_lu(l) + vai0_Okin <= 1_r8) then + ! vai_Okin(p) = tlai_lu(l) + vai0_Okin ! testing on 27 Feb 2024 + !end if ! In the Okin-Pierre formulation, VAI has to be 0 < VAI <= 1. + + vai_Okin(p) = tlai_lu(l)+vai0_Okin ! LAI+SAI averaged to landunit level; the equation is undefined at lai=0, and LAI in CTSM has some zeros over deserts, so we add in a small number. + if (vai_Okin(p) > 1_r8) then + vai_Okin(p) = 1_r8 ! setting LAI = 1 to be a max value (since K_length goes to negative when LAI>1) + end if + ! calculate Okin's shear stress ratio (SSR, which is vegetation drag partition factor) using Pierre's equation K_length = 2_r8 * (1_r8/vai_Okin(p) - 1_r8) ! Here LAI has to be non-zero to avoid blowup, and < 1 to avoid -ve K_length. See this equation in Leung et al. (2023). This line is Okin's formulation From 53871f47af026a51210e5feacb6fd43f9b3c5bd2 Mon Sep 17 00:00:00 2001 From: "Danny M. Leung" Date: Mon, 1 Apr 2024 17:15:21 -0600 Subject: [PATCH 0102/1248] Typo fix: Some users told me that the denominator of the dust emission equation in Leung 2023 should be impact threshold instead of standardized fluid threshold. So, that was corrected in the code. dmleung 1 Apr 2024 --- src/biogeochem/DUSTMod.F90 | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/biogeochem/DUSTMod.F90 b/src/biogeochem/DUSTMod.F90 index 9161076e4f..438468a532 100644 --- a/src/biogeochem/DUSTMod.F90 +++ b/src/biogeochem/DUSTMod.F90 @@ -657,15 +657,12 @@ subroutine DustEmission (bounds, & !if (ttlai(p) + vai0_Okin <= 1_r8) then ! vai_Okin(p) = ttlai(p) + vai0_Okin ! ttlai = vai = tlai+tsai. Okin-Pierre's equation is undefined at vai=0, and VAI in CTSM has some zeros over deserts, so we add in a small number. On 26 Feb 2024, dmleung changed from tlai_lu(l) to ttlai(p) - !if (tlai_lu(l) + vai0_Okin <= 1_r8) then - ! vai_Okin(p) = tlai_lu(l) + vai0_Okin ! testing on 27 Feb 2024 !end if ! In the Okin-Pierre formulation, VAI has to be 0 < VAI <= 1. vai_Okin(p) = tlai_lu(l)+vai0_Okin ! LAI+SAI averaged to landunit level; the equation is undefined at lai=0, and LAI in CTSM has some zeros over deserts, so we add in a small number. if (vai_Okin(p) > 1_r8) then vai_Okin(p) = 1_r8 ! setting LAI = 1 to be a max value (since K_length goes to negative when LAI>1) - end if - + end if ! calculate Okin's shear stress ratio (SSR, which is vegetation drag partition factor) using Pierre's equation K_length = 2_r8 * (1_r8/vai_Okin(p) - 1_r8) ! Here LAI has to be non-zero to avoid blowup, and < 1 to avoid -ve K_length. See this equation in Leung et al. (2023). This line is Okin's formulation @@ -720,7 +717,8 @@ subroutine DustEmission (bounds, & !################### for Leung et al. (2023) ################################################ !################ uncomment the below block if want to use Leung's scheme ################### - flx_mss_vrt_dst_ttl(p) = dst_emiss_coeff(p) * mss_frc_cly_vld(c) * forc_rho(c) * ((wnd_frc_slt**2.0_r8 - wnd_frc_thr_slt_it**2.0_r8) / wnd_frc_thr_slt_std) * (wnd_frc_slt / wnd_frc_thr_slt_it)**frag_expt ! Leung et al. (2022) uses Kok et al. (2014) dust emission euqation for emission flux + !flx_mss_vrt_dst_ttl(p) = dst_emiss_coeff(p) * mss_frc_cly_vld(c) * forc_rho(c) * ((wnd_frc_slt**2.0_r8 - wnd_frc_thr_slt_it**2.0_r8) / wnd_frc_thr_slt_std) * (wnd_frc_slt / wnd_frc_thr_slt_it)**frag_expt ! Leung et al. (2022) uses Kok et al. (2014) dust emission euqation for emission flux + flx_mss_vrt_dst_ttl(p) = dst_emiss_coeff(p) * mss_frc_cly_vld(c) * forc_rho(c) * ((wnd_frc_slt**2.0_r8 - wnd_frc_thr_slt_it**2.0_r8) / wnd_frc_thr_slt_it) * (wnd_frc_slt / wnd_frc_thr_slt_it)**frag_expt ! Leung et al. (2022) uses Kok et al. (2014) dust emission euqation for emission flux ! account for bare soil fraction, frozen soil fraction, and apply global tuning parameter (Kok et al. 2014) flx_mss_vrt_dst_ttl(p) = flx_mss_vrt_dst_ttl(p) * lnd_frc_mbl(p) * C_tune * liqfrac From f488309777bd6cd3ba8ac61bc1d60c4448e905f2 Mon Sep 17 00:00:00 2001 From: "Danny M. Leung" Date: Mon, 1 Apr 2024 17:25:47 -0600 Subject: [PATCH 0103/1248] Important change: Used Monin-Obukhov length to calculate the buoyancy contribution to the subtimestep wind fluctuations, instead of assuming zero buoyancy contributions. dmleung 1 Apr 2024 --- src/biogeochem/DUSTMod.F90 | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/biogeochem/DUSTMod.F90 b/src/biogeochem/DUSTMod.F90 index 438468a532..2986ed579b 100644 --- a/src/biogeochem/DUSTMod.F90 +++ b/src/biogeochem/DUSTMod.F90 @@ -420,6 +420,7 @@ subroutine DustEmission (bounds, & real(r8), parameter :: z0a_glob = 1e-4_r8 ! [m] assumed globally constant aeolian roughness length value in Leung et al. (2023), for the log law of the wall for Comola et al. (2019) intermittency scheme. dmleung 20 Feb 2024 real(r8), parameter :: hgt_sal = 0.1_r8 ! [m] saltation height used by Comola et al. (2019) intermittency scheme for the log law of the wall. dmleung 20 Feb 2024 real(r8), parameter :: vai0_Okin = 0.1_r8 ! [m2/m2] minimum VAI needed for Okin-Pierre's vegetation drag partition equation. lai=0 in the equation will lead to infinity, so a small value is added into this lai dmleung defined. + real(r8), parameter :: zii = 1000.0_r8 ! [m] convective boundary layer height added by dmleung 20 Feb 2024, following other CTSM modules (e.g., CanopyFluxesMod). Should we transfer PBL height (PBLH) from CAM? real(r8) :: numer ! Numerator term for threshold crossing rate real(r8) :: denom ! Denominator term for threshold crossing rate !------------------------------------------------------------------------ @@ -467,7 +468,8 @@ subroutine DustEmission (bounds, & vai_Okin => dust_inst%vai_Okin_patch , & ! vegetation area index for calculating Okin-Pierre vegetation drag partitioning. vai=0 in the ssr equation will lead to infinity, so a small value is added into this vai dmleung defined. (no need to output) 16 Feb 2024 frc_thr_rghn_fct => dust_inst%frc_thr_rghn_fct_patch , & ! output hybrid/total drag partition factor considering both rock and vegetation drag partition factors. wnd_frc_thr_std => dust_inst%wnd_frc_thr_std_patch , & ! standardized dust emission threshold friction velocity defined in Jasper Kok et al. (2014). - dpfct_rock => dust_inst%dpfct_rock_patch & ! output rock drag partition factor defined in Marticorena and Bergametti 1995. A fraction between 0 and 1. + dpfct_rock => dust_inst%dpfct_rock_patch , & ! output rock drag partition factor defined in Marticorena and Bergametti 1995. A fraction between 0 and 1. + obu => frictionvel_inst%obu_patch & ! Input: [real(r8) (:) ] Monin-Obukhov length from the friction Velocity module ) ttlai(bounds%begp : bounds%endp) = 0._r8 @@ -735,7 +737,8 @@ subroutine DustEmission (bounds, & ! mean lowpass-filtered wind speed at hgt_sal = 0.1 m saltation height (assuming aerodynamic roughness length z0a_glob = 1e-4 m globally for ease; also assuming neutral condition) u_mean_slt(p) = (wnd_frc_slt/k) * log(hgt_sal / z0a_glob) ! translating from ustar (velocity scale) to actual wind - stblty(p) = 0 ! -dmleung 2 Dec 2021: use stability = 0 for now, assuming no buoyancy contribution. Might uncomment the above lines in future revisions. + !stblty(p) = 0_r8 ! -dmleung 2 Dec 2021: use stability = 0 for now, assuming no buoyancy contribution. Might uncomment the above lines in future revisions. + stblty(p) = zii / obu(p) ! -dmleung 20 Feb 2024: use obu from CTSM and PBL height = zii (= 1000_r8) which is default in CTSM. Should we transfer PBL height from CAM? if ((12_r8 - 0.5_r8 * stblty(p)) .GE. 0.001_r8) then ! should have used 0 theoretically; used 0.001 here to avoid undefined values u_sd_slt(p) = wnd_frc_slt * (12_r8 - 0.5_r8 * stblty(p))**0.333_r8 else From e79364382b7f6a555a60070c6f84f52366c9c663 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Tue, 2 Apr 2024 18:08:20 -0600 Subject: [PATCH 0104/1248] testlist updates for LGRAIN2 and LREPRSTRUCT tests --- cime_config/testdefs/testlist_clm.xml | 67 ++------------------------- 1 file changed, 4 insertions(+), 63 deletions(-) diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index 04200b7271..f44a8e84ab 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -3377,9 +3377,9 @@ - + - + @@ -3387,19 +3387,9 @@ - - - - - - - - - - - + - + @@ -3407,26 +3397,6 @@ - - - - - - - - - - - - - - - - - - - - @@ -3436,16 +3406,6 @@ - - - - - - - - - - @@ -3455,16 +3415,6 @@ - - - - - - - - - - @@ -3474,15 +3424,6 @@ - - - - - - - - - From 306d11a6dcb9c16f29fbc3937b1110110a5d436c Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Wed, 3 Apr 2024 14:15:58 -0600 Subject: [PATCH 0105/1248] testlist updates for already existing matrixcn tests --- cime_config/testdefs/testlist_clm.xml | 30 ++++++--------------------- 1 file changed, 6 insertions(+), 24 deletions(-) diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index f44a8e84ab..a47d74de5d 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -530,7 +530,7 @@ - + @@ -540,7 +540,7 @@ - + @@ -548,27 +548,9 @@ - - - - - - - - - - - - - - - - - - - + @@ -578,7 +560,7 @@ - + @@ -587,7 +569,7 @@ - + @@ -804,7 +786,7 @@ - + From 99ba6ced5d9fbfcfb42d3b4c4cd253ccc7d72c9c Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Thu, 4 Apr 2024 18:05:23 -0600 Subject: [PATCH 0106/1248] Removed testmod directory not in use --- .../clm/ciso_decStart_monthly_matrixcn_spinup/include_user_mods | 2 -- 1 file changed, 2 deletions(-) delete mode 100644 cime_config/testdefs/testmods_dirs/clm/ciso_decStart_monthly_matrixcn_spinup/include_user_mods diff --git a/cime_config/testdefs/testmods_dirs/clm/ciso_decStart_monthly_matrixcn_spinup/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/ciso_decStart_monthly_matrixcn_spinup/include_user_mods deleted file mode 100644 index 442d7afb24..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/ciso_decStart_monthly_matrixcn_spinup/include_user_mods +++ /dev/null @@ -1,2 +0,0 @@ -../decStart -../ciso_monthly_matrixcn_spinup From 45dbe6247da94965e4c37593ca38592f3e25da9e Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Thu, 4 Apr 2024 18:16:10 -0600 Subject: [PATCH 0107/1248] Adding matrixcnOn testmods --- .../testdefs/testmods_dirs/clm/matrixcnOn/include_user_mods | 1 + cime_config/testdefs/testmods_dirs/clm/matrixcnOn/user_nl_clm | 3 +++ 2 files changed, 4 insertions(+) create mode 100644 cime_config/testdefs/testmods_dirs/clm/matrixcnOn/include_user_mods create mode 100644 cime_config/testdefs/testmods_dirs/clm/matrixcnOn/user_nl_clm diff --git a/cime_config/testdefs/testmods_dirs/clm/matrixcnOn/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/matrixcnOn/include_user_mods new file mode 100644 index 0000000000..fe0e18cf88 --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/matrixcnOn/include_user_mods @@ -0,0 +1 @@ +../default diff --git a/cime_config/testdefs/testmods_dirs/clm/matrixcnOn/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/matrixcnOn/user_nl_clm new file mode 100644 index 0000000000..185d6a2410 --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/matrixcnOn/user_nl_clm @@ -0,0 +1,3 @@ +hist_wrt_matrixcn_diag = .true. +use_matrixcn = .true. +use_soil_matrixcn = .true. From fef58b6d383fd750233ab4fe64086a738a41f2e2 Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Thu, 4 Apr 2024 20:23:43 -0600 Subject: [PATCH 0108/1248] Relax tolerance for truncating small snocan values in CanopyFluxes The default of 1e-13 was letting through some state updates that look like they should have been truncated to 0: each time step, snocan was decreasing by about 12 orders of magnitude. Addresses ESCOMP/CTSM#2444 --- src/biogeophys/CanopyFluxesMod.F90 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/biogeophys/CanopyFluxesMod.F90 b/src/biogeophys/CanopyFluxesMod.F90 index 58334a70c0..a969dc0583 100644 --- a/src/biogeophys/CanopyFluxesMod.F90 +++ b/src/biogeophys/CanopyFluxesMod.F90 @@ -1624,7 +1624,8 @@ subroutine CanopyFluxes(bounds, num_exposedvegp, filter_exposedvegp, ! snocan < rel_epsilon * snocan_baseline will be set to zero ! See NumericsMod for rel_epsilon value call truncate_small_values(fn, filterp, begp, endp, & - snocan_baseline(begp:endp), snocan(begp:endp)) + snocan_baseline(begp:endp), snocan(begp:endp), & + custom_rel_epsilon=1.e-10_r8) if ( use_fates ) then From 0d07eb28518db409863bab811dbc3b7919f967c7 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Mon, 8 Apr 2024 16:46:20 -0600 Subject: [PATCH 0109/1248] 45 new tests with matrixcnOn testmods --- cime_config/testdefs/testlist_clm.xml | 456 +++++++++++++++++++------- 1 file changed, 343 insertions(+), 113 deletions(-) diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index a47d74de5d..6056439278 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -2,17 +2,23 @@ - + + + + + + + + + - - @@ -21,6 +27,16 @@ + + + + + + + + + + @@ -139,13 +155,21 @@ - + + + + + + + + + @@ -350,13 +374,21 @@ - + + + + + + + + + @@ -378,13 +410,21 @@ - + + + + + + + + + @@ -396,8 +436,6 @@ - - @@ -405,6 +443,15 @@ + + + + + + + + + @@ -501,7 +548,6 @@ - @@ -509,9 +555,17 @@ + + + + + + + + + - @@ -519,15 +573,32 @@ + + + + + + + + + - + + + + + + + + + @@ -675,13 +746,13 @@ - + - + - - + + @@ -693,13 +764,13 @@ - + - + - + @@ -711,9 +782,17 @@ + + + + + + + + + - @@ -721,6 +800,15 @@ + + + + + + + + + @@ -759,12 +847,14 @@ - + - + + + @@ -775,13 +865,13 @@ - + - + - + @@ -820,36 +910,38 @@ - + - + - + + - + - + - + + @@ -961,6 +1053,16 @@ + + + + + + + + + + @@ -972,8 +1074,6 @@ - - @@ -981,6 +1081,15 @@ + + + + + + + + + @@ -1007,6 +1116,15 @@ + + + + + + + + + @@ -1035,6 +1153,15 @@ + + + + + + + + + @@ -1043,6 +1170,15 @@ + + + + + + + + + @@ -1051,27 +1187,26 @@ - + - + - + - + - @@ -1117,14 +1252,6 @@ - - - - - - - - @@ -1133,13 +1260,13 @@ - + - + - + @@ -1238,16 +1365,6 @@ - - - - - - - - - - @@ -1258,14 +1375,14 @@ - + - - + - - + + + @@ -1278,16 +1395,6 @@ - - - - - - - - - - @@ -1446,13 +1553,21 @@ - + + + + + + + + + @@ -1531,10 +1646,6 @@ - - - - @@ -1544,6 +1655,16 @@ + + + + + + + + + + @@ -1619,6 +1740,15 @@ + + + + + + + + + @@ -1647,6 +1777,16 @@ + + + + + + + + + + @@ -1666,15 +1806,6 @@ - - - - - - - - - @@ -1684,13 +1815,13 @@ - + - + - + @@ -1702,13 +1833,13 @@ - + - + - - + + @@ -1762,6 +1893,16 @@ + + + + + + + + + + @@ -1774,7 +1915,6 @@ - @@ -1782,13 +1922,13 @@ - + - + - + @@ -1800,6 +1940,15 @@ + + + + + + + + + @@ -1812,8 +1961,6 @@ - - @@ -1822,6 +1969,16 @@ + + + + + + + + + + @@ -1853,14 +2010,14 @@ - + - + + - - + @@ -1873,6 +2030,16 @@ + + + + + + + + + + @@ -1896,8 +2063,6 @@ - - @@ -1905,6 +2070,16 @@ + + + + + + + + + + @@ -2091,10 +2266,6 @@ - - - - @@ -2104,6 +2275,18 @@ + + + + + + + + + + + + @@ -2170,6 +2353,17 @@ + + + + + + + + + + + @@ -2255,7 +2449,6 @@ - @@ -2263,6 +2456,15 @@ + + + + + + + + + @@ -2427,6 +2629,15 @@ + + + + + + + + + @@ -2756,7 +2967,6 @@ - @@ -2765,6 +2975,16 @@ + + + + + + + + + + @@ -3312,7 +3532,6 @@ - @@ -3322,6 +3541,17 @@ + + + + + + + + + + + From 3e0ee1a0a4150e3cc3daf80549c0cf665001afe3 Mon Sep 17 00:00:00 2001 From: mvdebolskiy Date: Thu, 11 Apr 2024 05:14:22 -0600 Subject: [PATCH 0110/1248] Add tsoi coldstart, get streams out of waterstate and plumb them back --- src/biogeophys/TemperatureType.F90 | 25 ++++++--- src/biogeophys/WaterStateType.F90 | 90 +++++++++++++----------------- src/main/clm_instMod.F90 | 22 +++++++- 3 files changed, 77 insertions(+), 60 deletions(-) diff --git a/src/biogeophys/TemperatureType.F90 b/src/biogeophys/TemperatureType.F90 index ab310650c8..7906773b26 100644 --- a/src/biogeophys/TemperatureType.F90 +++ b/src/biogeophys/TemperatureType.F90 @@ -8,7 +8,7 @@ module TemperatureType use decompMod , only : bounds_type use abortutils , only : endrun use clm_varctl , only : use_cndv, iulog, use_luna, use_crop, use_biomass_heat_storage - use clm_varpar , only : nlevsno, nlevgrnd, nlevlak, nlevurb, nlevmaxurbgrnd + use clm_varpar , only : nlevsno, nlevgrnd, nlevlak, nlevurb, nlevmaxurbgrnd, nlevsoi use clm_varcon , only : spval, ispval use GridcellType , only : grc use LandunitType , only : lun @@ -141,7 +141,7 @@ module TemperatureType !------------------------------------------------------------------------ subroutine Init(this, bounds, & em_roof_lun, em_wall_lun, em_improad_lun, em_perroad_lun, & - is_simple_buildtemp, is_prog_buildtemp) + is_simple_buildtemp, is_prog_buildtemp, exice_init_stream_col) ! ! !DESCRIPTION: ! @@ -156,6 +156,7 @@ subroutine Init(this, bounds, & real(r8) , intent(in) :: em_perroad_lun(bounds%begl:) logical , intent(in) :: is_simple_buildtemp ! Simple building temp is being used logical , intent(in) :: is_prog_buildtemp ! Prognostic building temp is being used + real(r8) , intent(in) :: exice_init_stream_col(bounds%begc:) ! initial excess ice concentration from the stream file call this%InitAllocate ( bounds ) call this%InitHistory ( bounds, is_simple_buildtemp, is_prog_buildtemp ) @@ -164,7 +165,8 @@ subroutine Init(this, bounds, & em_wall_lun(bounds%begl:bounds%endl), & em_improad_lun(bounds%begl:bounds%endl), & em_perroad_lun(bounds%begl:bounds%endl), & - is_simple_buildtemp, is_prog_buildtemp) + is_simple_buildtemp, is_prog_buildtemp, & + exice_init_stream_col(bounds%begc:bounds%endc) ) end subroutine Init @@ -639,7 +641,7 @@ end subroutine InitHistory !----------------------------------------------------------------------- subroutine InitCold(this, bounds, & em_roof_lun, em_wall_lun, em_improad_lun, em_perroad_lun, & - is_simple_buildtemp, is_prog_buildtemp) + is_simple_buildtemp, is_prog_buildtemp, exice_init_stream_col) ! ! !DESCRIPTION: ! Initialize cold start conditions for module variables @@ -647,11 +649,12 @@ subroutine InitCold(this, bounds, & ! !USES: use shr_kind_mod , only : r8 => shr_kind_r8 use shr_const_mod , only : SHR_CONST_TKFRZ - use clm_varcon , only : denice, denh2o + use clm_varcon , only : denice, denh2o, zisoi use landunit_varcon, only : istwet, istsoil, istdlak, istice, istcrop use column_varcon , only : icol_road_imperv, icol_roof, icol_sunwall use column_varcon , only : icol_shadewall, icol_road_perv use clm_varctl , only : iulog, use_vancouver, use_mexicocity, use_excess_ice + use initVerticalMod , only : find_soil_layer_containing_depth ! ! !ARGUMENTS: class(temperature_type) :: this @@ -662,6 +665,7 @@ subroutine InitCold(this, bounds, & real(r8) , intent(in) :: em_perroad_lun(bounds%begl:) logical , intent(in) :: is_simple_buildtemp ! Simple building temp is being used logical , intent(in) :: is_prog_buildtemp ! Prognostic building temp is being used + real(r8) , intent(in) :: exice_init_stream_col(bounds%begc:) ! initial ammount of excess ice from the stream file ! ! !LOCAL VARIABLES: integer :: j,l,c,p ! indices @@ -669,6 +673,7 @@ subroutine InitCold(this, bounds, & real(r8) :: snowbd ! temporary calculation of snow bulk density (kg/m3) real(r8) :: fmelt ! snowbd/100 integer :: lev + integer :: n05m ! layer number containing 0.5 meter depth !----------------------------------------------------------------------- SHR_ASSERT_ALL_FL((ubound(em_roof_lun) == (/bounds%endl/)), sourcefile, __LINE__) @@ -742,8 +747,14 @@ subroutine InitCold(this, bounds, & end if else this%t_soisno_col(c,1:nlevgrnd) = 272._r8 - if (use_excess_ice .and. (lun%itype(l) == istsoil .or. lun%itype(l) == istcrop)) then - this%t_soisno_col(c,1:nlevgrnd) = SHR_CONST_TKFRZ - 5.0_r8 !needs to be below freezing to properly initiate excess ice + if (use_excess_ice .and. exice_init_stream_col(c) > 0.0_r8) then + n05m = nlevsoi - 1 + if (zisoi(nlevsoi) >= 0.5_r8) then + call find_soil_layer_containing_depth(0.5_r8,n05m) + else + n05m=nlevsoi-1 + endif + this%t_soisno_col(c,n05m:nlevgrnd) = SHR_CONST_TKFRZ - 12.15_r8 !needs to be below freezing to properly initiate excess ice end if endif endif diff --git a/src/biogeophys/WaterStateType.F90 b/src/biogeophys/WaterStateType.F90 index 390e9e8691..4c82e4efa6 100644 --- a/src/biogeophys/WaterStateType.F90 +++ b/src/biogeophys/WaterStateType.F90 @@ -56,8 +56,6 @@ module WaterStateType real(r8), pointer :: excess_ice_col (:,:) ! col excess ice (kg/m2) (new) (-nlevsno+1:nlevgrnd) real(r8), pointer :: exice_bulk_init (:) ! inital value for excess ice (new) (unitless) - type(excessicestream_type), private :: exicestream ! stream type for excess ice initialization NUOPC only - ! Hillslope stream variables real(r8), pointer :: stream_water_volume_lun(:) ! landunit volume of water in the streams (m3) @@ -82,7 +80,7 @@ module WaterStateType !------------------------------------------------------------------------ subroutine Init(this, bounds, info, tracer_vars, & - h2osno_input_col, watsat_col, t_soisno_col, use_aquifer_layer, NLFilename) + h2osno_input_col, watsat_col, t_soisno_col, use_aquifer_layer, NLFilename, exice_init_stream_col) class(waterstate_type), intent(inout) :: this type(bounds_type) , intent(in) :: bounds @@ -91,8 +89,9 @@ subroutine Init(this, bounds, info, tracer_vars, & real(r8) , intent(in) :: h2osno_input_col(bounds%begc:) real(r8) , intent(in) :: watsat_col(bounds%begc:, 1:) ! volumetric soil water at saturation (porosity) real(r8) , intent(in) :: t_soisno_col(bounds%begc:, -nlevsno+1:) ! col soil temperature (Kelvin) - logical , intent(in) :: use_aquifer_layer ! whether an aquifer layer is used in this run - character(len=*) , intent(in) :: NLFilename ! Namelist filename + logical , intent(in) :: use_aquifer_layer ! whether an aquifer layer is used in this run + character(len=*) , intent(in) :: NLFilename ! Namelist filename + real(r8) , intent(in) :: exice_init_stream_col(bounds%begc:bounds%endc) ! initial ammount of excess ice from stream this%info => info @@ -104,7 +103,7 @@ subroutine Init(this, bounds, info, tracer_vars, & watsat_col = watsat_col, & t_soisno_col = t_soisno_col, & use_aquifer_layer = use_aquifer_layer, & - NLFilename = NLFilename) + NLFilename = NLFilename, exice_init_stream_col = exice_init_stream_col) end subroutine Init @@ -323,7 +322,7 @@ end subroutine InitHistory !----------------------------------------------------------------------- subroutine InitCold(this, bounds, & - h2osno_input_col, watsat_col, t_soisno_col, use_aquifer_layer, NLFilename) + h2osno_input_col, watsat_col, t_soisno_col, use_aquifer_layer, NLFilename, exice_init_stream_col) ! ! !DESCRIPTION: ! Initialize time constant variables and cold start conditions @@ -344,6 +343,7 @@ subroutine InitCold(this, bounds, & real(r8) , intent(in) :: t_soisno_col(bounds%begc:, -nlevsno+1:) ! col soil temperature (Kelvin) logical , intent(in) :: use_aquifer_layer ! whether an aquifer layer is used in this run character(len=*) , intent(in) :: NLFilename ! Namelist filename + real(r8) , intent(in) :: exice_init_stream_col(bounds%begc:bounds%endc) ! initial ammount of excess ice from stream ! ! !LOCAL VARIABLES: integer :: c,j,l,nlevs,g @@ -550,52 +550,40 @@ subroutine InitCold(this, bounds, & this%dynbal_baseline_ice_col(bounds%begc:bounds%endc) = 0._r8 !Initialize excess ice - if (use_excess_ice .and. NLFilename /= '') then - ! enforce initialization with 0 for everything - this%excess_ice_col(bounds%begc:bounds%endc,-nlevsno+1:nlevmaxurbgrnd)=0.0_r8 - this%exice_bulk_init(bounds%begc:bounds%endc)=0.0_r8 - call this%exicestream%Init(bounds, NLFilename) ! get initial fraction of excess ice per column - ! - ! If excess ice is being read from streams, use the streams to - ! initialize - ! - if ( UseExcessIceStreams() )then - call this%exicestream%CalcExcessIce(bounds, this%exice_bulk_init) - do c = bounds%begc,bounds%endc - g = col%gridcell(c) - l = col%landunit(c) - if (.not. lun%lakpoi(l)) then !not lake - if (lun%itype(l) == istsoil .or. lun%itype(l) == istcrop) then - if (zisoi(nlevsoi) >= 0.5_r8) then - call find_soil_layer_containing_depth(0.5_r8,n05m) - else - n05m=nlevsoi-1 - endif - if (use_bedrock .and. col%nbedrock(c) <=nlevsoi) then - nbedrock = col%nbedrock(c) - else - nbedrock = nlevsoi - endif - do j = 2, nlevmaxurbgrnd ! ignore first layer - if (n05m= n05m .and. j= 0.5_r8) then + call find_soil_layer_containing_depth(0.5_r8,n05m) + else + n05m=nlevsoi-1 + endif + if (use_bedrock .and. col%nbedrock(c) <=nlevsoi) then + nbedrock = col%nbedrock(c) + else + nbedrock = nlevsoi endif - else ! just in case zeros for lakes and other columns - this%excess_ice_col(c,-nlevsno+1:nlevmaxurbgrnd) = 0.0_r8 + do j = 2, nlevmaxurbgrnd ! ignore first layer + if (n05m= n05m .and. j Date: Thu, 11 Apr 2024 05:14:52 -0600 Subject: [PATCH 0111/1248] Add use_streams default for coldstart --- bld/CLMBuildNamelist.pm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index fd8def8845..4a338201d5 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -4564,6 +4564,10 @@ sub setup_logic_exice { my $use_exice = $nl->get_value( 'use_excess_ice' ); my $use_exice_streams = $nl->get_value( 'use_excess_ice_streams' ); # IF excess ice streams is on + if ( (not defined($use_exice_streams) && value_is_true($use_exice)) && ($nl_flags->{'clm_start_type'} == /cold/ || $nl_flags->{'clm_start_type'} == /arb_ic/ ) ) { + $nl->set_variable_value('exice_streams', 'use_excess_ice_streams' , '.true.'); + $use_exice_streams = '.true.' + } if (defined($use_exice_streams) && value_is_true($use_exice_streams)) { # Can only be true if excess ice is also on, otherwise fail if (defined($use_exice) && not value_is_true($use_exice)) { From a3179995bcd7149edf1de4cc5aa32e23ae71ac9c Mon Sep 17 00:00:00 2001 From: mvdebolskiy Date: Thu, 11 Apr 2024 05:15:04 -0600 Subject: [PATCH 0112/1248] plumbing --- src/biogeophys/WaterStateBulkType.F90 | 5 +++-- src/biogeophys/WaterType.F90 | 23 +++++++++++++++-------- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/src/biogeophys/WaterStateBulkType.F90 b/src/biogeophys/WaterStateBulkType.F90 index ba3f0513c5..4f03ba177e 100644 --- a/src/biogeophys/WaterStateBulkType.F90 +++ b/src/biogeophys/WaterStateBulkType.F90 @@ -47,7 +47,7 @@ module WaterStateBulkType !------------------------------------------------------------------------ subroutine InitBulk(this, bounds, info, vars, & - h2osno_input_col, watsat_col, t_soisno_col, use_aquifer_layer, NLFilename) + h2osno_input_col, watsat_col, t_soisno_col, use_aquifer_layer, NLFilename, exice_init_stream_col) class(waterstatebulk_type), intent(inout) :: this type(bounds_type) , intent(in) :: bounds @@ -58,6 +58,7 @@ subroutine InitBulk(this, bounds, info, vars, & real(r8) , intent(in) :: t_soisno_col(bounds%begc:, -nlevsno+1:) ! col soil temperature (Kelvin) logical , intent(in) :: use_aquifer_layer ! whether an aquifer layer is used in this run character(len=*) , intent(in) :: NLFilename ! Namelist filename + real(r8) , intent(in) :: exice_init_stream_col(bounds%begc:) ! initial ammount of excess ice from stream call this%Init(bounds = bounds, & info = info, & @@ -66,7 +67,7 @@ subroutine InitBulk(this, bounds, info, vars, & watsat_col = watsat_col, & t_soisno_col = t_soisno_col, & use_aquifer_layer = use_aquifer_layer, & - NLFilename = NLFilename) + NLFilename = NLFilename, exice_init_stream_col = exice_init_stream_col(bounds%begc:bounds%endc)) call this%InitBulkAllocate(bounds) diff --git a/src/biogeophys/WaterType.F90 b/src/biogeophys/WaterType.F90 index bc257f27ad..e92dc0c759 100644 --- a/src/biogeophys/WaterType.F90 +++ b/src/biogeophys/WaterType.F90 @@ -213,7 +213,7 @@ end function water_params_constructor !----------------------------------------------------------------------- subroutine Init(this, bounds, NLFilename, & - h2osno_col, snow_depth_col, watsat_col, t_soisno_col, use_aquifer_layer) + h2osno_col, snow_depth_col, watsat_col, t_soisno_col, use_aquifer_layer, exice_init_stream_col) ! ! !DESCRIPTION: ! Initialize all water variables @@ -227,6 +227,7 @@ subroutine Init(this, bounds, NLFilename, & real(r8) , intent(in) :: watsat_col(bounds%begc:, 1:) ! volumetric soil water at saturation (porosity) real(r8) , intent(in) :: t_soisno_col(bounds%begc:, -nlevsno+1:) ! col soil temperature (Kelvin) logical , intent(in) :: use_aquifer_layer ! whether an aquifer layer is used in this run + real(r8) , intent(in) :: exice_init_stream_col(bounds%begc:) ! initial ammount of excess ice from stream ! ! !LOCAL VARIABLES: @@ -240,14 +241,14 @@ subroutine Init(this, bounds, NLFilename, & watsat_col = watsat_col, & t_soisno_col = t_soisno_col, & use_aquifer_layer = use_aquifer_layer, & - NLFilename = NLFilename) + NLFilename = NLFilename, exice_init_stream_col = exice_init_stream_col) end subroutine Init !----------------------------------------------------------------------- subroutine InitForTesting(this, bounds, params, & h2osno_col, snow_depth_col, watsat_col, & - t_soisno_col, use_aquifer_layer, NLFilename) + t_soisno_col, use_aquifer_layer, NLFilename, exice_init_stream_col) ! ! !DESCRIPTION: ! Version of Init routine just for unit tests @@ -262,8 +263,9 @@ subroutine InitForTesting(this, bounds, params, & real(r8) , intent(in) :: snow_depth_col(bounds%begc:) real(r8) , intent(in) :: watsat_col(bounds%begc:, 1:) ! volumetric soil water at saturation (porosity) real(r8) , intent(in) :: t_soisno_col(bounds%begc:, -nlevsno+1:) ! col soil temperature (Kelvin) - character(len=*) , intent(in) :: NLFilename ! Namelist filename + character(len=*) , intent(in) :: NLFilename ! Namelist filename logical , intent(in), optional :: use_aquifer_layer ! whether an aquifer layer is used in this run (false by default) + real(r8) , intent(in) :: exice_init_stream_col(bounds%begc:) ! initial ammount of excess ice from stream ! ! !LOCAL VARIABLES: logical :: l_use_aquifer_layer @@ -283,13 +285,14 @@ subroutine InitForTesting(this, bounds, params, & watsat_col = watsat_col, & t_soisno_col = t_soisno_col, & use_aquifer_layer = l_use_aquifer_layer, & - NLFilename = NLFilename) + NLFilename = NLFilename, & + exice_init_stream_col = exice_init_stream_col ) end subroutine InitForTesting !----------------------------------------------------------------------- subroutine DoInit(this, bounds, & - h2osno_col, snow_depth_col, watsat_col, t_soisno_col, use_aquifer_layer, NLFilename) + h2osno_col, snow_depth_col, watsat_col, t_soisno_col, use_aquifer_layer, NLFilename, exice_init_stream_col) ! ! !DESCRIPTION: ! Actually do the initialization (shared between main Init routine and InitForTesting) @@ -305,6 +308,7 @@ subroutine DoInit(this, bounds, & real(r8) , intent(in) :: t_soisno_col(bounds%begc:, -nlevsno+1:) ! col soil temperature (Kelvin) logical , intent(in) :: use_aquifer_layer ! whether an aquifer layer is used in this run character(len=*) , intent(in) :: NLFilename ! Namelist filename + real(r8) , intent(in) :: exice_init_stream_col(bounds%begc:) ! initial ammount of excess ice from stream ! ! !LOCAL VARIABLES: integer :: begc, endc @@ -321,6 +325,7 @@ subroutine DoInit(this, bounds, & SHR_ASSERT_ALL_FL((ubound(snow_depth_col) == [endc]), sourcefile, __LINE__) SHR_ASSERT_ALL_FL((ubound(watsat_col, 1) == endc), sourcefile, __LINE__) SHR_ASSERT_ALL_FL((ubound(t_soisno_col, 1) == endc), sourcefile, __LINE__) + SHR_ASSERT_ALL_FL((ubound(exice_init_stream_col, 1) == endc), sourcefile, __LINE__) call this%SetupTracerInfo() @@ -340,7 +345,8 @@ subroutine DoInit(this, bounds, & watsat_col = watsat_col(begc:endc, 1:), & t_soisno_col = t_soisno_col(begc:endc, -nlevsno+1:), & use_aquifer_layer = use_aquifer_layer, & - NLFilename = NLFilename) + NLFilename = NLFilename, & + exice_init_stream_col = exice_init_stream_col) call this%waterdiagnosticbulk_inst%InitBulk(bounds, & bulk_info, & @@ -381,7 +387,8 @@ subroutine DoInit(this, bounds, & watsat_col = watsat_col(begc:endc, 1:), & t_soisno_col = t_soisno_col(begc:endc, -nlevsno+1:), & use_aquifer_layer = use_aquifer_layer, & - NLFilename = NLFilename) + NLFilename = NLFilename, & + exice_init_stream_col = exice_init_stream_col) call this%bulk_and_tracers(i)%waterdiagnostic_inst%Init(bounds, & this%bulk_and_tracers(i)%info, & From a8fad1df11260ce6f106a067399b2d008e926a1a Mon Sep 17 00:00:00 2001 From: mvdebolskiy Date: Thu, 11 Apr 2024 06:50:53 -0600 Subject: [PATCH 0113/1248] add parameters for coldstart initialization. rename vars. --- bld/CLMBuildNamelist.pm | 4 +++- bld/namelist_files/namelist_defaults_ctsm.xml | 2 ++ bld/namelist_files/namelist_definition_ctsm.xml | 11 +++++++++++ src/biogeophys/TemperatureType.F90 | 15 ++++++++------- src/main/clm_varctl.F90 | 6 +++++- src/main/controlMod.F90 | 11 ++++++++++- 6 files changed, 39 insertions(+), 10 deletions(-) diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index 4a338201d5..1a69d59d0c 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -4575,7 +4575,7 @@ sub setup_logic_exice { } # Otherwise if ice streams are off } else { - my @list = ( "stream_meshfile_exice", "stream_fldfilename_exice" ); + my @list = ( "stream_meshfile_exice", "stream_fldfilename_exice" , "excess_ice_coldstart_temp" , "excess_ice_coldstart_depth"); # fail is excess ice streams files are set foreach my $var ( @list ) { if ( defined($nl->get_value($var)) ) { @@ -4594,6 +4594,8 @@ sub setup_logic_exice { if (defined($use_exice_streams) && value_is_true($use_exice_streams)) { add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_fldfilename_exice'); add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_mapalgo_exice'); + add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'excess_ice_coldstart_temp'); + add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'excess_ice_coldstart_depth'); # If excess ice streams on, but NOT the NUOPC driver fail if ( not $opts->{'driver'} eq "nuopc" ) { $log->fatal_error("nuopc driver is required when use_excess_ice_streams is set to true" ); diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index a01839836d..380e3f875a 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -2891,6 +2891,8 @@ use_crop=".true.">lnd/clm2/surfdata_map/ctsm5.1.dev052/landuse.timeseries_mpasa1 .false. +-12.15 +1.5 lnd/clm2/paramdata/exice_init_0.125x0.125_c20220516.nc lnd/clm2/paramdata/exice_init_0.125x0.125_ESMFmesh_cdf5_c20220802.nc bilinear diff --git a/bld/namelist_files/namelist_definition_ctsm.xml b/bld/namelist_files/namelist_definition_ctsm.xml index a2e9fb86da..61c16cd4cb 100644 --- a/bld/namelist_files/namelist_definition_ctsm.xml +++ b/bld/namelist_files/namelist_definition_ctsm.xml @@ -3050,6 +3050,17 @@ use case.) If TRUE turn on the excess ice physics, (Lee et al., 2014; Cai et al., 2020) + +Initial soil temperature to use for gridcells with excess ice present during a run starting with coldstart (deg C) + + + +Soil depth below which initial excess ice concentration will be applied during a run starting with coldstart (m) + + + If TRUE and use_excess_ice is TRUE, use the excess ice stream to determine the initial values of the excess ice field diff --git a/src/biogeophys/TemperatureType.F90 b/src/biogeophys/TemperatureType.F90 index 7906773b26..0a31bba6e6 100644 --- a/src/biogeophys/TemperatureType.F90 +++ b/src/biogeophys/TemperatureType.F90 @@ -653,7 +653,8 @@ subroutine InitCold(this, bounds, & use landunit_varcon, only : istwet, istsoil, istdlak, istice, istcrop use column_varcon , only : icol_road_imperv, icol_roof, icol_sunwall use column_varcon , only : icol_shadewall, icol_road_perv - use clm_varctl , only : iulog, use_vancouver, use_mexicocity, use_excess_ice + use clm_varctl , only : iulog, use_vancouver, use_mexicocity + use clm_varctl , only : use_excess_ice, excess_ice_coldstart_depth, excess_ice_coldstart_temp use initVerticalMod , only : find_soil_layer_containing_depth ! ! !ARGUMENTS: @@ -673,7 +674,7 @@ subroutine InitCold(this, bounds, & real(r8) :: snowbd ! temporary calculation of snow bulk density (kg/m3) real(r8) :: fmelt ! snowbd/100 integer :: lev - integer :: n05m ! layer number containing 0.5 meter depth + integer :: nexice_start ! layer number containing 0.5 meter depth !----------------------------------------------------------------------- SHR_ASSERT_ALL_FL((ubound(em_roof_lun) == (/bounds%endl/)), sourcefile, __LINE__) @@ -748,13 +749,13 @@ subroutine InitCold(this, bounds, & else this%t_soisno_col(c,1:nlevgrnd) = 272._r8 if (use_excess_ice .and. exice_init_stream_col(c) > 0.0_r8) then - n05m = nlevsoi - 1 - if (zisoi(nlevsoi) >= 0.5_r8) then - call find_soil_layer_containing_depth(0.5_r8,n05m) + nexice_start = nlevsoi - 1 + if (zisoi(nlevsoi) >= excess_ice_coldstart_depth) then + call find_soil_layer_containing_depth(0.5_r8,nexice_start) else - n05m=nlevsoi-1 + nexice_start=nlevsoi-1 endif - this%t_soisno_col(c,n05m:nlevgrnd) = SHR_CONST_TKFRZ - 12.15_r8 !needs to be below freezing to properly initiate excess ice + this%t_soisno_col(c,nexice_start:nlevgrnd) = SHR_CONST_TKFRZ + excess_ice_coldstart_temp !needs to be below freezing to properly initiate excess ice end if endif endif diff --git a/src/main/clm_varctl.F90 b/src/main/clm_varctl.F90 index 389ed50f88..09f3dd176a 100644 --- a/src/main/clm_varctl.F90 +++ b/src/main/clm_varctl.F90 @@ -411,10 +411,14 @@ module clm_varctl logical, public :: use_hillslope_routing = .false. ! true => use surface water routing in hillslope hydrology !---------------------------------------------------------- - ! excess ice physics switch + ! excess ice physics switch and params !---------------------------------------------------------- logical, public :: use_excess_ice = .false. ! true. => use excess ice physics + real(r8), public :: excess_ice_coldstart_temp = rundef ! initial coldstart soil temperature for gridcells where excess ice is present + + real(r8), public :: excess_ice_coldstart_depth = rundef ! initial coldstart depth at which excess ice might be present and excess_ice_coldstart_temp will be applied + !---------------------------------------------------------- ! plant hydraulic stress switch !---------------------------------------------------------- diff --git a/src/main/controlMod.F90 b/src/main/controlMod.F90 index dc9622ddac..8ec95c9e81 100644 --- a/src/main/controlMod.F90 +++ b/src/main/controlMod.F90 @@ -256,7 +256,8 @@ subroutine control_init(dtime) namelist /clm_inparm/ use_soil_moisture_streams - namelist /clm_inparm/ use_excess_ice + ! excess ice flag and parameters + namelist /clm_inparm/ use_excess_ice , excess_ice_coldstart_depth, excess_ice_coldstart_temp namelist /clm_inparm/ use_lai_streams @@ -823,6 +824,10 @@ subroutine control_spmd() call mpi_bcast (use_excess_ice, 1, MPI_LOGICAL, 0, mpicom,ier) + call mpi_bcast (excess_ice_coldstart_depth, 1, MPI_REAL8, 0, mpicom, ier) + + call mpi_bcast (excess_ice_coldstart_temp, 1, MPI_REAL8, 0, mpicom, ier) + call mpi_bcast (use_lai_streams, 1, MPI_LOGICAL, 0, mpicom, ier) call mpi_bcast (use_cropcal_streams, 1, MPI_LOGICAL, 0, mpicom, ier) @@ -977,6 +982,10 @@ subroutine control_print () write(iulog,*) ' use_extralakelayers = ', use_extralakelayers write(iulog,*) ' use_vichydro = ', use_vichydro write(iulog,*) ' use_excess_ice = ', use_excess_ice + if (use_excess_ice) then + write(iulog,*) ' excess_ice_coldstart_depth = ', excess_ice_coldstart_depth + write(iulog,*) ' excess_ice_coldstart_temp = ', excess_ice_coldstart_temp + endif write(iulog,*) ' use_cn = ', use_cn write(iulog,*) ' use_cndv = ', use_cndv write(iulog,*) ' use_crop = ', use_crop From 9b3527e333ae50e300a363af1a20b9e2e2a3c04c Mon Sep 17 00:00:00 2001 From: mvdebolskiy Date: Thu, 11 Apr 2024 07:04:41 -0600 Subject: [PATCH 0114/1248] change default values for new namelist vars --- 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 380e3f875a..2e346038f4 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -2891,8 +2891,8 @@ use_crop=".true.">lnd/clm2/surfdata_map/ctsm5.1.dev052/landuse.timeseries_mpasa1 .false. --12.15 -1.5 +-2.15 +0.5 lnd/clm2/paramdata/exice_init_0.125x0.125_c20220516.nc lnd/clm2/paramdata/exice_init_0.125x0.125_ESMFmesh_cdf5_c20220802.nc bilinear From a2fc12b8be573434ef95e23e00efecffc87a6c18 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Thu, 11 Apr 2024 12:44:38 -0600 Subject: [PATCH 0115/1248] Change matrixcnOn tests to Clm51 and remove redundant tests --- cime_config/testdefs/testlist_clm.xml | 95 ++++++++------------------- 1 file changed, 29 insertions(+), 66 deletions(-) diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index 6056439278..c3bda24655 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -27,7 +27,7 @@ - + @@ -161,7 +161,7 @@ - + @@ -380,7 +380,7 @@ - + @@ -555,7 +555,7 @@ - + @@ -573,7 +573,7 @@ - + @@ -590,7 +590,7 @@ - + @@ -800,7 +800,7 @@ - + @@ -847,10 +847,10 @@ - + - - + + @@ -918,7 +918,7 @@ - + @@ -935,7 +935,7 @@ - + @@ -1081,15 +1081,6 @@ - - - - - - - - - @@ -1116,15 +1107,6 @@ - - - - - - - - - @@ -1153,7 +1135,7 @@ - + @@ -1170,7 +1152,7 @@ - + @@ -1196,7 +1178,7 @@ - + @@ -1260,7 +1242,7 @@ - + @@ -1559,7 +1541,7 @@ - + @@ -1655,16 +1637,6 @@ - - - - - - - - - - @@ -1740,7 +1712,7 @@ - + @@ -1777,7 +1749,7 @@ - + @@ -1815,15 +1787,6 @@ - - - - - - - - - @@ -1893,7 +1856,7 @@ - + @@ -1922,7 +1885,7 @@ - + @@ -1940,7 +1903,7 @@ - + @@ -2030,7 +1993,7 @@ - + @@ -2070,7 +2033,7 @@ - + @@ -2275,7 +2238,7 @@ - + @@ -2456,7 +2419,7 @@ - + @@ -2629,7 +2592,7 @@ - + @@ -2975,7 +2938,7 @@ - + @@ -3541,7 +3504,7 @@ - + From bd7d031760665a5cdc920ef61c2a519bb5116b6e Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Thu, 11 Apr 2024 14:51:17 -0600 Subject: [PATCH 0116/1248] Rename failing Clm51 tests back to Clm50 due to missing compsets --- cime_config/testdefs/testlist_clm.xml | 28 +++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index b730b62720..54c9d0fb62 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -27,7 +27,7 @@ - + @@ -199,7 +199,7 @@ - + @@ -418,7 +418,7 @@ - + @@ -611,7 +611,7 @@ - + @@ -628,7 +628,7 @@ - + @@ -956,7 +956,7 @@ - + @@ -973,7 +973,7 @@ - + @@ -1173,7 +1173,7 @@ - + @@ -1190,7 +1190,7 @@ - + @@ -1750,7 +1750,7 @@ - + @@ -1787,7 +1787,7 @@ - + @@ -1894,7 +1894,7 @@ - + @@ -2071,7 +2071,7 @@ - + @@ -2457,7 +2457,7 @@ - + From 5d0a037a71c8e97e6f7e4c12535715bfbc16722d Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Thu, 11 Apr 2024 19:45:40 -0600 Subject: [PATCH 0117/1248] Remove a clm/FatesCold--clm/matrixcnOn test as invalid --- cime_config/testdefs/testlist_clm.xml | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index 54c9d0fb62..aea06d7f1e 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -2976,16 +2976,6 @@ - - - - - - - - - - From 7cc2965bef7a75966fdc69c52513bb88f027027a Mon Sep 17 00:00:00 2001 From: Keith Oleson Date: Wed, 17 Apr 2024 14:51:22 -0600 Subject: [PATCH 0118/1248] Fix to get correct urbantv streams file --- bld/CLMBuildNamelist.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index 0b9b161c20..0b4893dbb6 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -3610,7 +3610,7 @@ sub setup_logic_urbantv_streams { 'sim_year_range'=>$nl_flags->{'sim_year_range'}); } add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_fldfilename_urbantv', 'phys'=>$nl_flags->{'phys'}, - 'hgrid'=>"0.9x1.25" ); + 'hgrid'=>"0.9x1.25", 'urban_explicit_ac'=>$nl->get_value('urban_explicit_ac') ); if ($opts->{'driver'} eq "nuopc" ) { add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_meshfile_urbantv', 'phys'=>$nl_flags->{'phys'}, 'hgrid'=>"0.9x1.25" ); From 48b52dc5179a4ba3388a911a8aea7f1c682ce62c Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Wed, 17 Apr 2024 17:08:50 -0600 Subject: [PATCH 0119/1248] Point FATES external at Charlie's LUH2 branch. --- Externals_CLM.cfg | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Externals_CLM.cfg b/Externals_CLM.cfg index dc1bc3f0e7..1494217277 100644 --- a/Externals_CLM.cfg +++ b/Externals_CLM.cfg @@ -1,8 +1,8 @@ [fates] local_path = src/fates protocol = git -repo_url = https://github.com/NGEET/fates -tag = sci.1.70.0_api.32.0.0 +repo_url = https://github.com/ckoven/fates +hash = d37d9733b5970dfe67a required = True [externals_description] From 52962a5e9e5f9ada9119a0beb7bccc313c71d955 Mon Sep 17 00:00:00 2001 From: cathyxinchangli <55264121+cathyxinchangli@users.noreply.github.com> Date: Thu, 18 Apr 2024 16:46:42 -0500 Subject: [PATCH 0120/1248] Fix stream_varnames out of bounds error --- src/cpl/share_esmf/UrbanTimeVarType.F90 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/cpl/share_esmf/UrbanTimeVarType.F90 b/src/cpl/share_esmf/UrbanTimeVarType.F90 index e6ceed7173..b4bb592e91 100644 --- a/src/cpl/share_esmf/UrbanTimeVarType.F90 +++ b/src/cpl/share_esmf/UrbanTimeVarType.F90 @@ -288,8 +288,10 @@ subroutine urbantv_interp(this, bounds) if (stream_varnames((lun%itype(l)-6)) == stream_varnames(n)) then this%t_building_max(l) = dataptr2d(ig,n) end if - if (stream_varnames((lun%itype(l)-3)) == stream_varnames(n)) then - this%p_ac(l) = dataptr2d(ig,n) + if (urban_explicit_ac) then + if (stream_varnames((lun%itype(l)-3)) == stream_varnames(n)) then + this%p_ac(l) = dataptr2d(ig,n) + end if end if end do else From d9402b92d78b016603342dcff668ecef1435ce78 Mon Sep 17 00:00:00 2001 From: cathyxinchangli <55264121+cathyxinchangli@users.noreply.github.com> Date: Thu, 18 Apr 2024 17:00:39 -0500 Subject: [PATCH 0121/1248] Add missing "use" statement --- src/cpl/share_esmf/UrbanTimeVarType.F90 | 1 + 1 file changed, 1 insertion(+) diff --git a/src/cpl/share_esmf/UrbanTimeVarType.F90 b/src/cpl/share_esmf/UrbanTimeVarType.F90 index b4bb592e91..98d1d51989 100644 --- a/src/cpl/share_esmf/UrbanTimeVarType.F90 +++ b/src/cpl/share_esmf/UrbanTimeVarType.F90 @@ -231,6 +231,7 @@ subroutine urbantv_interp(this, bounds) use dshr_methods_mod , only : dshr_fldbun_getfldptr use dshr_strdata_mod , only : shr_strdata_advance use shr_infnan_mod , only : nan => shr_infnan_nan, assignment(=) + use UrbanParamsType , only : urban_explicit_ac ! ! !ARGUMENTS: class(urbantv_type) :: this From a1cb4db82f7709677fa7d1311358600cfe75a05a Mon Sep 17 00:00:00 2001 From: cathyxinchangli <55264121+cathyxinchangli@users.noreply.github.com> Date: Thu, 18 Apr 2024 23:22:02 -0500 Subject: [PATCH 0122/1248] Trying to fix "floating invalid" error Previous commit has "floating invalid" error if I try to output P_AC as an h0 history field. After P_AC is taken out from history field, it allows I2000Clm51Sp to run without an error under DEBUG mode, but leads to "floating invalid" error for I2000Clm50Sp run after 18-20mins. --- src/cpl/share_esmf/UrbanTimeVarType.F90 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/cpl/share_esmf/UrbanTimeVarType.F90 b/src/cpl/share_esmf/UrbanTimeVarType.F90 index 98d1d51989..c8566dcc82 100644 --- a/src/cpl/share_esmf/UrbanTimeVarType.F90 +++ b/src/cpl/share_esmf/UrbanTimeVarType.F90 @@ -297,7 +297,8 @@ subroutine urbantv_interp(this, bounds) end do else this%t_building_max(l) = spval - this%p_ac(l) = nan ! set to nan for non-urban landunit + ! this%p_ac(l) = nan ! set to nan for non-urban landunit + this%p_ac(l) = 0._r8 end if end do deallocate(dataptr2d) From 496d0903ad5bea1c1935e93f9666450579abcfa2 Mon Sep 17 00:00:00 2001 From: Keith Oleson Date: Tue, 23 Apr 2024 08:32:34 -0600 Subject: [PATCH 0123/1248] Only output P_AC if urban_explicit_ac is .true. --- src/cpl/share_esmf/UrbanTimeVarType.F90 | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/cpl/share_esmf/UrbanTimeVarType.F90 b/src/cpl/share_esmf/UrbanTimeVarType.F90 index c8566dcc82..23e30f3909 100644 --- a/src/cpl/share_esmf/UrbanTimeVarType.F90 +++ b/src/cpl/share_esmf/UrbanTimeVarType.F90 @@ -89,10 +89,12 @@ subroutine Init(this, bounds, NLFilename) avgflag='A', long_name='prescribed maximum interior building temperature', & ptr_lunit=this%t_building_max, default='inactive', set_nourb=spval, & l2g_scale_type='unity') - call hist_addfld1d (fname='P_AC', units='a fraction between 0 and 1', & - avgflag='A', long_name='prescribed air-conditioning ownership rate', & - ptr_lunit=this%p_ac, default='inactive', set_nourb=spval, & - l2g_scale_type='unity') + if (urban_explicit_ac) then + call hist_addfld1d (fname='P_AC', units='a fraction between 0 and 1', & + avgflag='A', long_name='prescribed air-conditioning ownership rate', & + ptr_lunit=this%p_ac, default='inactive', set_nourb=spval, & + l2g_scale_type='unity') + end if end subroutine Init From 1ae7a195ffcf5cbfe312d9e83497c36cd97876f2 Mon Sep 17 00:00:00 2001 From: Keith Oleson Date: Tue, 23 Apr 2024 12:11:42 -0600 Subject: [PATCH 0124/1248] Make P_AC history output consistent with TBUILD_MAX, TSA_U, etc. and only check for valid p_ac data if urban_explicit_ac is .true. --- src/cpl/share_esmf/UrbanTimeVarType.F90 | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/cpl/share_esmf/UrbanTimeVarType.F90 b/src/cpl/share_esmf/UrbanTimeVarType.F90 index 23e30f3909..01f37da564 100644 --- a/src/cpl/share_esmf/UrbanTimeVarType.F90 +++ b/src/cpl/share_esmf/UrbanTimeVarType.F90 @@ -78,7 +78,7 @@ subroutine Init(this, bounds, NLFilename) ! Allocate urbantv data structure allocate(this%t_building_max(begl:endl)); this%t_building_max(:) = nan - allocate(this%p_ac(begl:endl)); this%p_ac(:) = 0._r8 + allocate(this%p_ac(begl:endl)); this%p_ac(:) = nan allocate(stream_varnames(stream_varname_MIN:stream_varname_MAX)) call this%urbantv_init(bounds, NLFilename) @@ -299,8 +299,7 @@ subroutine urbantv_interp(this, bounds) end do else this%t_building_max(l) = spval - ! this%p_ac(l) = nan ! set to nan for non-urban landunit - this%p_ac(l) = 0._r8 + this%p_ac(l) = spval end if end do deallocate(dataptr2d) @@ -314,8 +313,13 @@ subroutine urbantv_interp(this, bounds) ig = ig+1 if (g == lun%gridcell(l)) exit end do - if ( .not. urban_valid(g) .or. (this%t_building_max(l) <= 0._r8) & - .or. (this%p_ac(l) < 0._r8) .or. (this%p_ac(l) > 1._r8)) then ! check if AC adoption rate is outside of range 0 to 1 + ! Check for valid urban data + if ( .not. urban_valid(g) .or. (this%t_building_max(l) <= 0._r8)) then + found = .true. + gindx = g + lindx = l + exit + else if (urban_explicit_ac .and. (this%p_ac(l) < 0._r8 .or. this%p_ac(l) > 1._r8)) then found = .true. gindx = g lindx = l From d863c13be015ec1624bf74b8eb1b4a993f6cfb49 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Thu, 25 Apr 2024 17:51:28 -0600 Subject: [PATCH 0125/1248] Add 1979 and 1979-2026 ne0np4 files to namelist defaults --- bld/namelist_files/namelist_defaults_ctsm.xml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index ecced7a6e2..e4f4c331d9 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -1428,6 +1428,14 @@ lnd/clm2/surfdata_esmf/ctsm5.2.0/surfdata_1x1_mexicocityMEX_hist_2000_78pfts_c24 lnd/clm2/surfdata_esmf/ctsm5.2.0/surfdata_1x1_urbanc_alpha_hist_2000_78pfts_c240221.nc + + +lnd/clm2/surfdata_esmf/ctsm5.2.0/surfdata_ne0np4.ARCTICGRIS.ne30x8_SSP2-4.5_1979_78pfts_c240425.nc + +lnd/clm2/surfdata_esmf/ctsm5.2.0/surfdata_ne0np4.ARCTIC.ne30x4_SSP2-4.5_1979_78pfts_c240425.nc + +lnd/clm2/surfdata_esmf/ctsm5.2.0/surfdata_ne0np4CONUS.ne30x8_SSP2-4.5_1979_78pfts_c240425.nc + @@ -1498,6 +1506,7 @@ lnd/clm2/surfdata_esmf/NEON/surfdata_1x1_NEON_TOOL_hist_78pfts_CMIP6_simyr2000_c >lnd/clm2/surfdata_esmf/NEON/landuse.timeseries_NEON_${NEONSITE}_hist_78pfts_simyr2018-2023_c230931.nc --> + lnd/clm2/surfdata_esmf/ctsm5.2.0/landuse.timeseries_0.9x1.25_SSP2-4.5_1850-2100_78pfts_c240216.nc lnd/clm2/surfdata_esmf/ctsm5.2.0/landuse.timeseries_C96_SSP2-4.5_1850-2100_78pfts_c240216.nc +lnd/clm2/surfdata_esmf/ctsm5.2.0/landuse.timeseries_ne0np4.ARCTICGRIS.ne30x8_SSP2-4.5_1979-2026_78pfts_c240425.nc +lnd/clm2/surfdata_esmf/ctsm5.2.0/landuse.timeseries_ne0np4.ARCTIC.ne30x4_SSP2-4.5_1979-2026_78pfts_c240425.nc +lnd/clm2/surfdata_esmf/ctsm5.2.0/landuse.timeseries_ne0np4CONUS.ne30x8_SSP2-4.5_1979-2026_78pfts_c240425.nc + lnd/clm2/surfdata_esmf/ctsm5.2.0/landuse.timeseries_0.9x1.25_SSP3-7.0_1850-2100_78pfts_c240216.nc From 66c100482afdb26bb431d5c1e71deda28e3cdb69 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Fri, 26 Apr 2024 13:56:24 -0600 Subject: [PATCH 0126/1248] Update cmeps to the branch --- Externals.cfg | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Externals.cfg b/Externals.cfg index 185f412cab..1aa8991883 100644 --- a/Externals.cfg +++ b/Externals.cfg @@ -48,9 +48,12 @@ tag = cime6.0.217_httpsbranch03 required = True [cmeps] -tag = cmeps0.14.50 +#tag = cmeps0.14.50 +#branch = dust_emis_mod +hash = d79e34f67df825f9265bdaaf3091f8995d5df1a2 protocol = git -repo_url = https://github.com/ESCOMP/CMEPS.git +#repo_url = https://github.com/ESCOMP/CMEPS.git +repo_url = https://github.com/ekluzek/CMEPS.git local_path = components/cmeps required = True From c4debee33f97dc0ac503683e7cbc956c2380c377 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Fri, 26 Apr 2024 14:34:10 -0600 Subject: [PATCH 0127/1248] Replace 3 vr-grid test compsets with ISSP245Clm50BgcCrop compset --- cime_config/testdefs/testlist_clm.xml | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index 05526b3529..918d86c213 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -2034,17 +2034,16 @@ - + - + - + @@ -2059,10 +2058,10 @@ - + - + @@ -2141,12 +2140,11 @@ - - + From 73ac9d72a9a478ed839238d2e73c5fae45f0a24f Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Fri, 26 Apr 2024 14:37:07 -0600 Subject: [PATCH 0128/1248] Remove sim_year_range from new flanduse_timeseries for xml file to work --- 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 e4f4c331d9..ac4f7252d2 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -1580,11 +1580,11 @@ lnd/clm2/surfdata_esmf/NEON/surfdata_1x1_NEON_TOOL_hist_78pfts_CMIP6_simyr2000_c lnd/clm2/surfdata_esmf/ctsm5.2.0/landuse.timeseries_C96_SSP2-4.5_1850-2100_78pfts_c240216.nc -lnd/clm2/surfdata_esmf/ctsm5.2.0/landuse.timeseries_ne0np4.ARCTICGRIS.ne30x8_SSP2-4.5_1979-2026_78pfts_c240425.nc -lnd/clm2/surfdata_esmf/ctsm5.2.0/landuse.timeseries_ne0np4.ARCTIC.ne30x4_SSP2-4.5_1979-2026_78pfts_c240425.nc -lnd/clm2/surfdata_esmf/ctsm5.2.0/landuse.timeseries_ne0np4CONUS.ne30x8_SSP2-4.5_1979-2026_78pfts_c240425.nc From f8aa6eac32a00c821824478860c06a26fbdb9010 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Fri, 26 Apr 2024 15:02:04 -0600 Subject: [PATCH 0129/1248] Add shr_dust_emis_mod.F90 to the files needed for unit testing, fails, because ESMF is currently needed and not available --- src/CMakeLists.txt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 568b53cd15..9d2e6041b5 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -20,9 +20,11 @@ add_subdirectory(${CLM_ROOT}/share/src csm_share) add_subdirectory(${CLM_ROOT}/share/unit_test_stubs/util csm_share_stubs) add_subdirectory(${CLM_ROOT}/share/src/esmf_wrf_timemgr esmf_wrf_timemgr) -# Add the single file we need from CMEPS -set (drv_sources_needed - ${CLM_ROOT}/components/cmeps/cesm/nuopc_cap_share/glc_elevclass_mod.F90) +# 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 + ) # Add CLM source directories add_subdirectory(${CLM_ROOT}/src/utils clm_utils) From e95f9eaa9bcb4c85d57335fd9e4ae57d5e1ad827 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Fri, 26 Apr 2024 17:08:35 -0600 Subject: [PATCH 0130/1248] Add to Makefile for automatic generation 1979-2026 fsurdat/landuse files --- .../ctsm/toolchain/gen_mksurfdata_jobscript_multi.py | 10 ++++++++++ tools/mksurfdata_esmf/Makefile | 5 +++++ 2 files changed, 15 insertions(+) diff --git a/python/ctsm/toolchain/gen_mksurfdata_jobscript_multi.py b/python/ctsm/toolchain/gen_mksurfdata_jobscript_multi.py index 6deb50ebfb..6c38efdd0d 100755 --- a/python/ctsm/toolchain/gen_mksurfdata_jobscript_multi.py +++ b/python/ctsm/toolchain/gen_mksurfdata_jobscript_multi.py @@ -48,6 +48,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-ne3", "crop-global-SSP2-4.5-ne16", "crop-global-SSP2-4.5-ne30", @@ -204,6 +205,11 @@ def main(): "ne3": ["ne3np4.pg3"], "ne16": ["ne16np4.pg3"], "ne30": ["ne30np4.pg3", "ne30np4.pg2", "ne30np4"], + "ne0np4": [ + "ne0np4.ARCTICGRIS.ne30x8", + "ne0np4.ARCTIC.ne30x4", + "ne0np4CONUS.ne30x8", + ], "ne120": [ "ne0np4.ARCTICGRIS.ne30x8", "ne0np4.ARCTIC.ne30x4", @@ -333,6 +339,10 @@ 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-ne3": ( "--start-year 1850 --end-year 2100 --nosurfdata --ssp-rcp SSP2-4.5 --res", "ne3", diff --git a/tools/mksurfdata_esmf/Makefile b/tools/mksurfdata_esmf/Makefile index fc81d48079..00e90efa45 100644 --- a/tools/mksurfdata_esmf/Makefile +++ b/tools/mksurfdata_esmf/Makefile @@ -275,6 +275,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-C96 \ crop-global-SSP2-4.5-mpasa120 @@ -318,6 +319,10 @@ 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 + $(MKSURFDATA) --number-of-nodes 9 --scenario $@ --jobscript-file $@.sh --walltime 12:00:00 + $(BATCHJOBS) $@.sh + crop-global-SSP2-4.5-C96 : FORCE $(MKSURFDATA) --number-of-nodes 9 --scenario $@ --jobscript-file $@.sh --walltime 12:00:00 $(BATCHJOBS) $@.sh From 526bc19b068546e4d92828cf44c86596010e9482 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Wed, 17 Apr 2024 15:39:56 -0600 Subject: [PATCH 0131/1248] Update CTSM to work with FATES LUH2. Some issues remain. --- bld/CLMBuildNamelist.pm | 26 +- bld/namelist_files/namelist_defaults_ctsm.xml | 10 +- .../namelist_definition_ctsm.xml | 26 +- bld/unit_testers/build-namelist_test.pl | 1 + .../testmods_dirs/clm/Fates/user_nl_clm | 2 +- .../clm/FatesColdLogging/user_nl_clm | 1 + .../usermods_dirs/fates_sp/user_nl_clm | 2 +- src/dyn_subgrid/dynFATESLandUseChangeMod.F90 | 80 +++++- src/main/clm_instMod.F90 | 3 +- src/main/clm_varctl.F90 | 4 +- src/main/controlMod.F90 | 14 +- src/utils/clmfates_interfaceMod.F90 | 227 ++++++++++++++++-- 12 files changed, 351 insertions(+), 45 deletions(-) diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index 4df42d5e74..bcf68a8d61 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -783,7 +783,7 @@ sub setup_cmdl_fates_mode { # dis-allow fates specific namelist items with non-fates runs my @list = ( "fates_spitfire_mode", "use_fates_planthydro", "use_fates_ed_st3", "use_fates_ed_prescribed_phys", "use_fates_cohort_age_tracking","use_fates_inventory_init","use_fates_fixed_biogeog", - "use_fates_nocomp","use_fates_sp","fates_inventory_ctrl_filename","use_fates_logging", + "use_fates_nocomp","use_fates_sp","fates_inventory_ctrl_filename","fates_harvest_mode", "fates_parteh_mode","use_fates_tree_damage","fates_seeddisp_cadence","use_fates_luh","fluh_timeseries" ); # dis-allow fates specific namelist items with non-fates runs foreach my $var ( @list ) { @@ -4370,7 +4370,7 @@ sub setup_logic_fates { add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'fates_paramfile', 'phys'=>$nl_flags->{'phys'}); my @list = ( "fates_spitfire_mode", "use_fates_planthydro", "use_fates_ed_st3", "use_fates_ed_prescribed_phys", "use_fates_inventory_init","use_fates_fixed_biogeog","use_fates_nocomp","fates_seeddisp_cadence", - "use_fates_logging","fates_parteh_mode", "use_fates_cohort_age_tracking","use_fates_tree_damage","use_fates_luh" ); + "fates_harvest_mode","fates_parteh_mode", "use_fates_cohort_age_tracking","use_fates_tree_damage","use_fates_luh" ); foreach my $var ( @list ) { add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, $var, 'use_fates'=>$nl_flags->{'use_fates'}, 'use_fates_sp'=>$nl_flags->{'use_fates_sp'} ); @@ -4426,6 +4426,28 @@ sub setup_logic_fates { } } } + + # Check fates_harvest_mode compatibility + my $var = "fates_harvest_mode"; + if ( defined($nl->get_value($var)) ) { + # using fates_harvest_mode with CLM landuse driver data - for user convienence + # if ( $nl->get_value($var) == 2) { + # # Make sure that do_harvest is set to true + # if ( ! &value_is_true($nl->get_value('do_harvest')) ) { + # fatal_error("do_harvest must be true when $var is equal to 2" ); + # } + # using fates_harvest mode with raw luh2 harvest data + if ( $nl->get_value($var) > 2) { + # Make sure that use_fates_luh is true when using raw fates luh2 harvest data + if ( ! &value_is_true($nl->get_value('use_fates_luh')) ) { + fatal_error("use_fates_luh is required to be true when $var is greater than 2" ); + } + # do_harvest can not be on if we are using the raw fates luh2 harvest data + if ( &value_is_true($nl->get_value('do_harvest')) ) { + fatal_error("do_harvest can not be true when $var is greater than 2" ); + } + } + } } } diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index 7891361238..bc962d1b0f 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -1572,11 +1572,14 @@ use_crop=".true.">lnd/clm2/surfdata_map/ctsm5.1.dev052/landuse.timeseries_mpasa1 lnd/clm2/surfdata_map/release-clm5.0.18/landuse.timeseries_10x15_SSP5-3.4_16pfts_Irrig_CMIP6_simyr1850-2100_c190228.nc - + lnd/clm2/surfdata_map/fates-sci.1.68.3_api.31.0.0_tools.1.0.1/LUH2_states_transitions_management.timeseries_4x5_hist_simyr1850-2015_c231101.nc + +lnd/clm2/surfdata_map/fates-sci.1.73.0_api.33.0.0/fates_landuse_pft_map_4x5_240206.nc + lnd/clm2/surfdata_map/fates-sci.1.68.3_api.31.0.0_tools.1.0.1/LUH2_states_transitions_management.timeseries_4x5_hist_simyr1850-2015_c231101.nc @@ -2756,14 +2759,17 @@ use_crop=".true.">lnd/clm2/surfdata_map/ctsm5.1.dev052/landuse.timeseries_mpasa1 0 +0 .false. .false. .false. .false. .false. -.false. .false. .false. +.false. +.true. +.true. .false. 1 0 diff --git a/bld/namelist_files/namelist_definition_ctsm.xml b/bld/namelist_files/namelist_definition_ctsm.xml index b672b43125..fa2d83a3c9 100644 --- a/bld/namelist_files/namelist_definition_ctsm.xml +++ b/bld/namelist_files/namelist_definition_ctsm.xml @@ -734,10 +734,15 @@ Toggle to turn on no competition mode (only relevant if FATES is being used). Toggle to turn on FATES satellite phenology mode (only relevant if FATES is being used). - -Toggle to turn on the logging module -(Only relevant if FATES is on) + +Set FATES harvesting mode by setting fates_harvest_mode > 0. +Allowed values are: + 0 : no fates harvesting of any kind + 1 : fates logging via fates logging event codes (see fates parameter file) only + 2 : fates harvest driven by CLM landuse timeseries data (dynHarvestMod) + 3 : fates harvest driven by LUH2 raw harvest data, area-based (dynFATESLandUseChangeMod) + 4 : fates harvest driven by LUH2 raw harvest data, mass-based (dynFATESLandUseChangeMod) If TRUE, enable use of land use harmonization (LUH) state and transition data from luh_timeseries file. +This is enabled by default if fates_harvest_mode is set to use the raw LUH2 harvest +data (fates_harvest_mode >= 3) (Also, only valid for use_fates = true and is incompatible with transient runs currently.) + +If TRUE, ignore the land-use state vector and transitions, and assert that all lands +are primary, and that there is no harvest. + + @@ -793,6 +806,11 @@ types to vary over time. (Only relevant if FATES is on). + +Full pathname of fates landuse x pft data map. + + Toggle to turn on the LUNA model, to effect Photosynthesis by leaf Nitrogen diff --git a/bld/unit_testers/build-namelist_test.pl b/bld/unit_testers/build-namelist_test.pl index 9b579dd9ce..899bd10b9c 100755 --- a/bld/unit_testers/build-namelist_test.pl +++ b/bld/unit_testers/build-namelist_test.pl @@ -1046,6 +1046,7 @@ sub cat_and_create_namelistinfile { GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm4_5", }, + # TODO SSR: Replace this with fates_harvest_mode "useloggingButNOTFATES" =>{ options=>"-envxml_dir . -no-megan", namelst=>"use_fates_logging=.true.", GLC_TWO_WAY_COUPLING=>"FALSE", diff --git a/cime_config/testdefs/testmods_dirs/clm/Fates/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/Fates/user_nl_clm index 406fb598f6..91df3e2e61 100644 --- a/cime_config/testdefs/testmods_dirs/clm/Fates/user_nl_clm +++ b/cime_config/testdefs/testmods_dirs/clm/Fates/user_nl_clm @@ -16,7 +16,7 @@ hist_fincl1 = 'FATES_NCOHORTS', 'FATES_TRIMMING', 'FATES_AREA_PLANTS', 'FATES_SAPWOODC', 'FATES_LEAFC', 'FATES_FROOTC', 'FATES_REPROC', 'FATES_STRUCTC', 'FATES_NONSTRUCTC', 'FATES_VEGC_ABOVEGROUND', 'FATES_CANOPY_VEGC', 'FATES_USTORY_VEGC', 'FATES_PRIMARY_PATCHFUSION_ERR', -'FATES_HARVEST_CARBON_FLUX', 'FATES_DISTURBANCE_RATE_FIRE', +'FATES_HARVEST_WOODPROD_C_FLUX', 'FATES_DISTURBANCE_RATE_FIRE', 'FATES_DISTURBANCE_RATE_LOGGING', 'FATES_DISTURBANCE_RATE_TREEFALL', 'FATES_STOMATAL_COND', 'FATES_LBLAYER_COND', 'FATES_NPP', 'FATES_GPP', 'FATES_AUTORESP', 'FATES_GROWTH_RESP', 'FATES_MAINT_RESP', 'FATES_GPP_CANOPY', diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesColdLogging/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/FatesColdLogging/user_nl_clm index 3b74a4fd37..5f457f3f1c 100644 --- a/cime_config/testdefs/testmods_dirs/clm/FatesColdLogging/user_nl_clm +++ b/cime_config/testdefs/testmods_dirs/clm/FatesColdLogging/user_nl_clm @@ -1 +1,2 @@ +! TODO SSR: Replace this with fates_harvest_mode use_fates_logging= .true. diff --git a/cime_config/usermods_dirs/fates_sp/user_nl_clm b/cime_config/usermods_dirs/fates_sp/user_nl_clm index 093ecd7eda..37da8d1c67 100644 --- a/cime_config/usermods_dirs/fates_sp/user_nl_clm +++ b/cime_config/usermods_dirs/fates_sp/user_nl_clm @@ -22,7 +22,7 @@ hist_fexcl1 = 'FATES_TRIMMING', 'FATES_COLD_STATUS', 'FATES_GDD', 'FATES_NCHILLD 'FATES_SAPWOODC', 'FATES_FROOTC', 'FATES_REPROC', 'FATES_STRUCTC', 'FATES_NONSTRUCTC', 'FATES_VEGC_ABOVEGROUND', 'FATES_CANOPY_VEGC', 'FATES_USTORY_VEGC', 'FATES_PRIMARY_PATCHFUSION_ERR', 'FATES_DISTURBANCE_RATE_FIRE', 'FATES_DISTURBANCE_RATE_LOGGING', 'FATES_DISTURBANCE_RATE_TREEFALL', - 'FATES_HARVEST_CARBON_FLUX', 'FATES_GPP_CANOPY', 'FATES_AUTORESP_CANOPY', + 'FATES_HARVEST_WOODPROD_C_FLUX', 'FATES_GPP_CANOPY', 'FATES_AUTORESP_CANOPY', 'FATES_GPP_USTORY', 'FATES_AUTORESP_USTORY', 'FATES_CROWNAREA_CL', 'FATES_DEMOTION_CARBONFLUX', 'FATES_PROMOTION_CARBONFLUX', 'FATES_MORTALITY_CFLUX_CANOPY', 'FATES_MORTALITY_CFLUX_USTORY', 'FATES_DDBH_CANOPY_SZ', 'FATES_DDBH_USTORY_SZ', 'FATES_BASALAREA_SZ', diff --git a/src/dyn_subgrid/dynFATESLandUseChangeMod.F90 b/src/dyn_subgrid/dynFATESLandUseChangeMod.F90 index 45f4340d6a..4f326d82a5 100644 --- a/src/dyn_subgrid/dynFATESLandUseChangeMod.F90 +++ b/src/dyn_subgrid/dynFATESLandUseChangeMod.F90 @@ -26,13 +26,39 @@ module dynFATESLandUseChangeMod ! Landuse state at beginning of year (fraction of gridcell), landuse state name x gridcell real(r8), allocatable, public :: landuse_states(:,:) + ! TODO SSR: Ask Charlie for description to go here + real(r8), allocatable, public :: landuse_harvest(:,:) + ! Number of landuse transition and state names integer, public, parameter :: num_landuse_transition_vars = 108 integer, public, parameter :: num_landuse_state_vars = 12 + integer, public, parameter :: num_landuse_harvest_vars = 5 + + ! Define the fates landuse namelist mode switch values + integer, public, parameter :: fates_harvest_no_logging = 0 + integer, public, parameter :: fates_harvest_logging_only = 1 + integer, public, parameter :: fates_harvest_clmlanduse = 2 + integer, public, parameter :: fates_harvest_luh_area = 3 + integer, public, parameter :: fates_harvest_luh_mass = 4 + + ! Define landuse harvest unit integer representation + integer, public, parameter :: landuse_harvest_area_units = 1 + integer, public, parameter :: landuse_harvest_mass_units = 2 + integer, public :: landuse_harvest_units ! landuse filename type(dyn_file_type), target :: dynFatesLandUse_file + ! LUH2 raw wood harvest area fraction + character(len=10), target :: landuse_harvest_area_varnames(num_landuse_harvest_vars) = & + [character(len=10) :: 'primf_harv', 'primn_harv', 'secmf_harv', 'secyf_harv', 'secnf_harv'] + + ! LUH2 raw wood harvest biomass carbon + character(len=10), target :: landuse_harvest_mass_varnames(num_landuse_harvest_vars) = & + [character(len=10) :: 'primf_bioh', 'primn_bioh', 'secmf_bioh', 'secyf_bioh', 'secnf_bioh'] + + character(len=10), public, pointer :: landuse_harvest_varnames(:) => null() + ! Land use name arrays character(len=5), public, parameter :: landuse_state_varnames(num_landuse_state_vars) = & [character(len=5) :: 'primf','primn','secdf','secdn','pastr','range', & @@ -64,8 +90,9 @@ module dynFATESLandUseChangeMod 'c3nfx_to_c3ann','c3nfx_to_c4ann','c3nfx_to_c3per','c3nfx_to_c4per', & 'c3nfx_to_secdf','c3nfx_to_secdn','c3nfx_to_pastr','c3nfx_to_range','c3nfx_to_urban'] - type(dyn_var_time_uninterp_type) :: landuse_transition_vars(num_landuse_transition_vars) ! value of each landuse variable - type(dyn_var_time_uninterp_type) :: landuse_state_vars(num_landuse_state_vars) ! value of each landuse variable + type(dyn_var_time_uninterp_type) :: landuse_transition_vars(num_landuse_transition_vars) ! value of each transitions variable + type(dyn_var_time_uninterp_type) :: landuse_state_vars(num_landuse_state_vars) ! value of each state variable + type(dyn_var_time_uninterp_type) :: landuse_harvest_vars(num_landuse_harvest_vars) ! value of each harvest variable public :: dynFatesLandUseInit public :: dynFatesLandUseInterp @@ -79,14 +106,14 @@ subroutine dynFatesLandUseInit(bounds, landuse_filename) ! Initialize data structures for land use information. ! !USES: - use clm_varctl , only : use_cn, use_fates_luh + use clm_varctl , only : use_cn, use_fates_luh, fates_harvest_mode use dynVarTimeUninterpMod , only : dyn_var_time_uninterp_type use dynTimeInfoMod , only : YEAR_POSITION_START_OF_TIMESTEP use dynTimeInfoMod , only : YEAR_POSITION_END_OF_TIMESTEP ! !ARGUMENTS: type(bounds_type), intent(in) :: bounds ! proc-level bounds - character(len=*) , intent(in) :: landuse_filename ! name of file containing land use information + character(len=*) , intent(in) :: landuse_filename ! name of file containing landuse timeseries information (fates luh2) ! !LOCAL VARIABLES integer :: varnum, i ! counter for harvest variables @@ -111,17 +138,23 @@ subroutine dynFatesLandUseInit(bounds, landuse_filename) if (ier /= 0) then call endrun(msg=' allocation error for landuse_transitions'//errMsg(__FILE__, __LINE__)) end if + allocate(landuse_harvest(num_landuse_harvest_vars,bounds%begg:bounds%endg),stat=ier) + if (ier /= 0) then + call endrun(msg=' allocation error for landuse_harvest'//errMsg(__FILE__, __LINE__)) + end if + ! Initialize the states, transitions and harvest mapping percentages as zero by default landuse_states = 0._r8 landuse_transitions = 0._r8 + landuse_harvest = 0._r8 if (use_fates_luh) then - ! Generate the dyn_file_type object. Note that the land use data being read in is for the - ! transitions occuring within the current year + ! Generate the dyn_file_type object. + ! Start calls get_prev_date, whereas end calls get_curr_date dynFatesLandUse_file = dyn_file_type(landuse_filename, YEAR_POSITION_END_OF_TIMESTEP) - ! Get initial land use data + ! Get initial land use data from the fates luh2 timeseries dataset num_points = (bounds%endg - bounds%begg + 1) landuse_shape(1) = num_points ! Does this need an explicit array shape to be passed to the constructor? do varnum = 1, num_landuse_transition_vars @@ -136,6 +169,28 @@ subroutine dynFatesLandUseInit(bounds, landuse_filename) dim1name=grlnd, conversion_factor=1.0_r8, & do_check_sums_equal_1=.false., data_shape=landuse_shape) end do + + ! Get the harvest rate data from the fates luh2 timeseries dataset if enabled + if (fates_harvest_mode .ge. fates_harvest_luh_area ) then + + ! change the harvest varnames being used depending on the mode selected + if (fates_harvest_mode .eq. fates_harvest_luh_area ) then + landuse_harvest_varnames => landuse_harvest_area_varnames + landuse_harvest_units = landuse_harvest_area_units + elseif (fates_harvest_mode .eq. fates_harvest_luh_mass ) then + landuse_harvest_varnames => landuse_harvest_mass_varnames + landuse_harvest_units = landuse_harvest_mass_units + else + call endrun(msg=' undefined fates harvest mode selected'//errMsg(__FILE__, __LINE__)) + end if + + do varnum = 1, num_landuse_harvest_vars + landuse_harvest_vars(varnum) = dyn_var_time_uninterp_type( & + dyn_file=dynFatesLandUse_file, varname=landuse_harvest_varnames(varnum), & + dim1name=grlnd, conversion_factor=1.0_r8, & + do_check_sums_equal_1=.false., data_shape=landuse_shape) + end do + end if end if ! Since fates needs state data during initialization, make sure to call @@ -159,7 +214,7 @@ subroutine dynFatesLandUseInterp(bounds, init_state) ! !USES: use dynTimeInfoMod , only : time_info_type - use clm_varctl , only : use_cn + use clm_varctl , only : use_cn, fates_harvest_mode ! !ARGUMENTS: type(bounds_type), intent(in) :: bounds ! proc-level bounds @@ -181,13 +236,14 @@ subroutine dynFatesLandUseInterp(bounds, init_state) init_flag = init_state end if - ! Get the current year + ! Get the data for the current year call dynFatesLandUse_file%time_info%set_current_year() if (dynFatesLandUse_file%time_info%is_before_time_series() .and. .not.(init_flag)) then ! Reset the land use transitions to zero for safety landuse_transitions(1:num_landuse_transition_vars,bounds%begg:bounds%endg) = 0._r8 landuse_states(1:num_landuse_state_vars,bounds%begg:bounds%endg) = 0._r8 + landuse_harvest(1:num_landuse_harvest_vars,bounds%begg:bounds%endg) = 0._r8 else ! Loop through all variables on the data file and put data into the temporary array ! then update the global state and transitions array. @@ -200,6 +256,12 @@ subroutine dynFatesLandUseInterp(bounds, init_state) call landuse_state_vars(varnum)%get_current_data(this_data) landuse_states(varnum,bounds%begg:bounds%endg) = this_data(bounds%begg:bounds%endg) end do + if (fates_harvest_mode .ge. fates_harvest_luh_area ) then + do varnum = 1, num_landuse_harvest_vars + call landuse_harvest_vars(varnum)%get_current_data(this_data) + landuse_harvest(varnum,bounds%begg:bounds%endg) = this_data(bounds%begg:bounds%endg) + end do + end if deallocate(this_data) end if diff --git a/src/main/clm_instMod.F90 b/src/main/clm_instMod.F90 index 1ca450b48d..830dcfcca7 100644 --- a/src/main/clm_instMod.F90 +++ b/src/main/clm_instMod.F90 @@ -200,6 +200,7 @@ subroutine clm_instInit(bounds) use SoilWaterRetentionCurveFactoryMod , only : create_soil_water_retention_curve use decompMod , only : get_proc_bounds use BalanceCheckMod , only : GetBalanceCheckSkipSteps + use clm_varctl , only : flandusepftdat ! ! !ARGUMENTS type(bounds_type), intent(in) :: bounds ! processor bounds @@ -436,7 +437,7 @@ subroutine clm_instInit(bounds) ! Initialize the Functionaly Assembled Terrestrial Ecosystem Simulator (FATES) ! if (use_fates) then - call clm_fates%Init(bounds) + call clm_fates%Init(bounds, flandusepftdat) end if deallocate (h2osno_col) diff --git a/src/main/clm_varctl.F90 b/src/main/clm_varctl.F90 index e0d142bffd..9ab6c631c7 100644 --- a/src/main/clm_varctl.F90 +++ b/src/main/clm_varctl.F90 @@ -302,7 +302,7 @@ module clm_varctl ! > 1 for external data (lightning and/or anthropogenic ignitions) ! see bld/namelist_files/namelist_definition_clm4_5.xml for details logical, public :: use_fates_tree_damage = .false. ! true => turn on tree damage module - logical, public :: use_fates_logging = .false. ! true => turn on logging module + integer, public :: fates_harvest_mode = 0 ! 0 for no harvest/logging; 1-4 for harvest mode options logical, public :: use_fates_planthydro = .false. ! true => turn on fates hydro logical, public :: use_fates_cohort_age_tracking = .false. ! true => turn on cohort age tracking logical, public :: use_fates_ed_st3 = .false. ! true => static stand structure @@ -311,7 +311,9 @@ module clm_varctl logical, public :: use_fates_fixed_biogeog = .false. ! true => use fixed biogeography mode logical, public :: use_fates_nocomp = .false. ! true => use no comopetition mode logical, public :: use_fates_luh = .false. ! true => use FATES landuse data mode + logical, public :: use_fates_potentialveg = .false. ! true => FATES potential veg only character(len=256), public :: fluh_timeseries = '' ! filename for fates landuse timeseries data + character(len=256), public :: flandusepftdat = '' ! filename for fates landuse x pft data character(len=256), public :: fates_inventory_ctrl_filename = '' ! filename for inventory control ! FATES SP AND FATES BGC are MUTUTALLY EXCLUSIVE, THEY CAN'T BOTH BE ON diff --git a/src/main/controlMod.F90 b/src/main/controlMod.F90 index 44efec4eeb..196bc141ff 100644 --- a/src/main/controlMod.F90 +++ b/src/main/controlMod.F90 @@ -222,7 +222,7 @@ subroutine control_init(dtime) ! FATES Flags namelist /clm_inparm/ fates_paramfile, use_fates, & - fates_spitfire_mode, use_fates_logging, & + fates_spitfire_mode, fates_harvest_mode, & use_fates_planthydro, use_fates_ed_st3, & use_fates_cohort_age_tracking, & use_fates_ed_prescribed_phys, & @@ -231,7 +231,9 @@ subroutine control_init(dtime) use_fates_nocomp, & use_fates_sp, & use_fates_luh, & + use_fates_potentialveg, & fluh_timeseries, & + flandusepftdat, & fates_inventory_ctrl_filename, & fates_parteh_mode, & fates_seeddisp_cadence, & @@ -772,7 +774,7 @@ subroutine control_spmd() call mpi_bcast (for_testing_allow_interp_non_ciso_to_ciso, 1, MPI_LOGICAL, 0, mpicom, ier) call mpi_bcast (fates_spitfire_mode, 1, MPI_INTEGER, 0, mpicom, ier) - call mpi_bcast (use_fates_logging, 1, MPI_LOGICAL, 0, mpicom, ier) + call mpi_bcast (fates_harvest_mode, 1, MPI_INTEGER, 0, mpicom, ier) call mpi_bcast (use_fates_planthydro, 1, MPI_LOGICAL, 0, mpicom, ier) call mpi_bcast (use_fates_tree_damage, 1, MPI_LOGICAL, 0, mpicom, ier) call mpi_bcast (use_fates_cohort_age_tracking, 1, MPI_LOGICAL, 0, mpicom, ier) @@ -783,10 +785,12 @@ subroutine control_spmd() call mpi_bcast (use_fates_nocomp, 1, MPI_LOGICAL, 0, mpicom, ier) call mpi_bcast (use_fates_sp, 1, MPI_LOGICAL, 0, mpicom, ier) call mpi_bcast (use_fates_luh, 1, MPI_LOGICAL, 0, mpicom, ier) + call mpi_bcast (use_fates_potentialveg, 1, MPI_LOGICAL, 0, mpicom, ier) call mpi_bcast (use_fates_bgc, 1, MPI_LOGICAL, 0, mpicom, ier) call mpi_bcast (fates_inventory_ctrl_filename, len(fates_inventory_ctrl_filename), MPI_CHARACTER, 0, mpicom, ier) call mpi_bcast (fates_paramfile, len(fates_paramfile) , MPI_CHARACTER, 0, mpicom, ier) - call mpi_bcast (fluh_timeseries, len(fates_paramfile) , MPI_CHARACTER, 0, mpicom, ier) + call mpi_bcast (fluh_timeseries, len(fluh_timeseries) , MPI_CHARACTER, 0, mpicom, ier) + call mpi_bcast (flandusepftdat, len(flandusepftdat) , MPI_CHARACTER, 0, mpicom, ier) call mpi_bcast (fates_parteh_mode, 1, MPI_INTEGER, 0, mpicom, ier) call mpi_bcast (fates_seeddisp_cadence, 1, MPI_INTEGER, 0, mpicom, ier) @@ -1144,7 +1148,7 @@ subroutine control_print () write(iulog, *) ' use_fates = ', use_fates if (use_fates) then write(iulog, *) ' fates_spitfire_mode = ', fates_spitfire_mode - write(iulog, *) ' use_fates_logging = ', use_fates_logging + write(iulog, *) ' fates_harvest_mode = ', fates_harvest_mode write(iulog, *) ' fates_paramfile = ', fates_paramfile write(iulog, *) ' fates_parteh_mode = ', fates_parteh_mode write(iulog, *) ' use_fates_planthydro = ', use_fates_planthydro @@ -1157,7 +1161,9 @@ subroutine control_print () write(iulog, *) ' use_fates_nocomp = ', use_fates_nocomp write(iulog, *) ' use_fates_sp = ', use_fates_sp write(iulog, *) ' use_fates_luh= ', use_fates_luh + write(iulog, *) ' use_fates_potentialveg = ', use_fates_potentialveg write(iulog, *) ' fluh_timeseries = ', trim(fluh_timeseries) + write(iulog, *) ' flandusepftdat = ', trim(flandusepftdat) write(iulog, *) ' fates_seeddisp_cadence = ', fates_seeddisp_cadence write(iulog, *) ' fates_seeddisp_cadence: 0, 1, 2, 3 => off, daily, monthly, or yearly dispersal' write(iulog, *) ' fates_inventory_ctrl_filename = ', trim(fates_inventory_ctrl_filename) diff --git a/src/utils/clmfates_interfaceMod.F90 b/src/utils/clmfates_interfaceMod.F90 index 83d7186021..3f84a28508 100644 --- a/src/utils/clmfates_interfaceMod.F90 +++ b/src/utils/clmfates_interfaceMod.F90 @@ -54,12 +54,14 @@ module CLMFatesInterfaceMod use clm_varctl , only : use_fates_cohort_age_tracking use clm_varctl , only : use_fates_ed_st3 use clm_varctl , only : use_fates_ed_prescribed_phys - use clm_varctl , only : use_fates_logging + use clm_varctl , only : fates_harvest_mode use clm_varctl , only : use_fates_inventory_init use clm_varctl , only : use_fates_fixed_biogeog use clm_varctl , only : use_fates_nocomp use clm_varctl , only : use_fates_sp use clm_varctl , only : use_fates_luh + use clm_varctl , only : use_fates_potentialveg + use clm_varctl , only : flandusepftdat use clm_varctl , only : fates_seeddisp_cadence use clm_varctl , only : fates_inventory_ctrl_filename use clm_varctl , only : use_nitrif_denitrif @@ -180,6 +182,12 @@ module CLMFatesInterfaceMod use dynFATESLandUseChangeMod, only : landuse_transitions, landuse_states use dynFATESLandUseChangeMod, only : landuse_transition_varnames, landuse_state_varnames use dynFATESLandUseChangeMod, only : dynFatesLandUseInterp + use dynFATESLandUseChangeMod, only : num_landuse_harvest_vars + use dynFATESLandUseChangeMod, only : fates_harvest_no_logging + use dynFATESLandUseChangeMod, only : fates_harvest_luh_area + use dynFATESLandUseChangeMod, only : landuse_harvest + use dynFATESLandUseChangeMod, only : landuse_harvest_units + use dynFATESLandUseChangeMod, only : landuse_harvest_varnames implicit none @@ -272,6 +280,8 @@ module CLMFatesInterfaceMod character(len=*), parameter, private :: sourcefile = & __FILE__ + integer, parameter :: num_landuse_pft_vars = 4 + public :: CLMFatesGlobals1 public :: CLMFatesGlobals2 @@ -384,8 +394,10 @@ subroutine CLMFatesGlobals2() integer :: pass_cohort_age_tracking integer :: pass_tree_damage integer :: pass_use_luh + integer :: pass_use_potentialveg integer :: pass_num_luh_states integer :: pass_num_luh_transitions + integer :: pass_lupftdat call t_startf('fates_globals2') @@ -477,7 +489,7 @@ subroutine CLMFatesGlobals2() end if call set_fates_ctrlparms('use_ed_st3',ival=pass_ed_st3) - if(use_fates_logging) then + if (fates_harvest_mode > fates_harvest_no_logging) then pass_logging = 1 else pass_logging = 0 @@ -505,8 +517,8 @@ subroutine CLMFatesGlobals2() end if call set_fates_ctrlparms('use_cohort_age_tracking',ival=pass_cohort_age_tracking) - ! check fates logging namelist value first because hlm harvest overrides it - if(use_fates_logging) then + ! check fates logging namelist value first because hlm harvest can override it + if (fates_harvest_mode > fates_harvest_no_logging) then pass_logging = 1 else pass_logging = 0 @@ -521,23 +533,53 @@ subroutine CLMFatesGlobals2() pass_num_lu_harvest_cats = 0 end if - call set_fates_ctrlparms('use_lu_harvest',ival=pass_lu_harvest) - call set_fates_ctrlparms('num_lu_harvest_cats',ival=pass_num_lu_harvest_cats) - call set_fates_ctrlparms('use_logging',ival=pass_logging) - if(use_fates_luh) then pass_use_luh = 1 pass_num_luh_states = num_landuse_state_vars pass_num_luh_transitions = num_landuse_transition_vars + + ! Do not set harvest passing variables to zero not in luh harvest modes + ! as the user may want to use the CLM landuse harvest with luh2 transitions + if(fates_harvest_mode >= fates_harvest_luh_area) then + ! End the run if do_harvest is true with this run mode. + ! This should be caught be the build namelist. + if(get_do_harvest()) then + call endrun(msg="do_harvest and fates_harvest_mode using luh2 harvest data are incompatible"//& + errmsg(sourcefile, __LINE__)) + else + pass_lu_harvest = 1 + end if + end if else pass_use_luh = 0 pass_num_luh_states = 0 pass_num_luh_transitions = 0 end if + call set_fates_ctrlparms('use_luh2',ival=pass_use_luh) call set_fates_ctrlparms('num_luh2_states',ival=pass_num_luh_states) call set_fates_ctrlparms('num_luh2_transitions',ival=pass_num_luh_transitions) + if ( use_fates_potentialveg ) then + pass_use_potentialveg = 1 + else + pass_use_potentialveg = 0 + end if + call set_fates_ctrlparms('use_fates_potentialveg',ival=pass_use_potentialveg) + + if(flandusepftdat /= '') then + pass_lupftdat = 1 + else + pass_lupftdat = 0 + end if + call set_fates_ctrlparms('use_landusepft_data',ival=pass_lupftdat) + + ! Wait to set the harvest and logging variables after checking get_do_harvest + ! and fates_harvest_modes + call set_fates_ctrlparms('use_lu_harvest',ival=pass_lu_harvest) + call set_fates_ctrlparms('num_lu_harvest_cats',ival=pass_num_lu_harvest_cats) + call set_fates_ctrlparms('use_logging',ival=pass_logging) + if(use_fates_inventory_init) then pass_inventory_init = 1 else @@ -585,7 +627,7 @@ end subroutine CLMFatesTimesteps ! ==================================================================================== - subroutine init(this, bounds_proc ) + subroutine init(this, bounds_proc, flandusepftdat) ! --------------------------------------------------------------------------------- ! This initializes the hlm_fates_interface_type @@ -614,6 +656,7 @@ subroutine init(this, bounds_proc ) ! Input Arguments class(hlm_fates_interface_type), intent(inout) :: this type(bounds_type),intent(in) :: bounds_proc + character(len=*), intent(in) :: flandusepftdat ! local variables integer :: nclumps ! Number of threads @@ -631,6 +674,9 @@ subroutine init(this, bounds_proc ) integer :: ndecomp integer :: numg + real(r8), allocatable :: landuse_pft_map(:,:,:) + real(r8), allocatable :: landuse_bareground(:) + ! Initialize the FATES communicators with the HLM ! This involves to stages ! 1) allocate the vectors @@ -663,6 +709,13 @@ subroutine init(this, bounds_proc ) write(iulog,*) 'clm_fates%init(): allocating for ',nclumps,' threads' end if + ! Retrieve the landuse x pft static data if the file is present + if (flandusepftdat /= '') then + call GetLandusePFTData(bounds_proc, flandusepftdat, landuse_pft_map, landuse_bareground) + end if + + nclumps = get_proc_clumps() + allocate(copy_fates_var(bounds_proc%begc:bounds_proc%endc)) copy_fates_var(:) = .false. @@ -767,18 +820,26 @@ subroutine init(this, bounds_proc ) this%fates(nc)%sites(s)%lat = grc%latdeg(g) this%fates(nc)%sites(s)%lon = grc%londeg(g) - this%fates(nc)%bc_in(s)%pft_areafrac(:)=0._r8 - ! initialize static layers for reduced complexity FATES versions from HLM - ! maybe make this into a subroutine of it's own later. - do m = surfpft_lb,surfpft_ub - ft = m - surfpft_lb - this%fates(nc)%bc_in(s)%pft_areafrac(ft)=wt_nat_patch(g,m) - end do + ! Transfer the landuse x pft data to fates via bc_in if file is given + if (flandusepftdat /= '') then + this%fates(nc)%bc_in(s)%pft_areafrac_lu(:,1:num_landuse_pft_vars) = landuse_pft_map(g,:,1:num_landuse_pft_vars) + this%fates(nc)%bc_in(s)%baregroundfrac = landuse_bareground(g) + end if - if (abs(sum(this%fates(nc)%bc_in(s)%pft_areafrac(surfpft_lb:surfpft_ub)) - 1.0_r8) > sum_to_1_tol) then - write(iulog,*) 'pft_area error in interfc ', s, sum(this%fates(nc)%bc_in(s)%pft_areafrac(:)) - 1.0_r8 - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if + if (flandusepftdat == '') then + ! initialize static layers for reduced complexity FATES versions from HLM + ! maybe make this into a subroutine of it's own later. + this%fates(nc)%bc_in(s)%pft_areafrac(:)=0._r8 + do m = surfpft_lb,surfpft_ub + ft = m - surfpft_lb + this%fates(nc)%bc_in(s)%pft_areafrac(ft)=wt_nat_patch(g,m) + end do + + if (abs(sum(this%fates(nc)%bc_in(s)%pft_areafrac(surfpft_lb:surfpft_ub)) - 1.0_r8) > sum_to_1_tol) then + write(iulog,*) 'pft_area error in interfc ', s, sum(this%fates(nc)%bc_in(s) %pft_areafrac(:)) - 1.0_r8 + call endrun(msg=errMsg(sourcefile, __LINE__)) + end if + end if end do !site ! Initialize site-level static quantities dictated by the HLM @@ -820,6 +881,12 @@ subroutine init(this, bounds_proc ) ! Fire data to send to FATES call create_fates_fire_data_method( this%fates_fire_data_method ) + ! deallocate the local landuse x pft array + if (flandusepftdat /= '') then + deallocate(landuse_pft_map) + deallocate(landuse_bareground) + end if + call t_stopf('fates_init') end subroutine init @@ -1087,6 +1154,12 @@ subroutine dynamics_driv(this, nc, bounds_clump, & this%fates(nc)%bc_in(s)%hlm_luh_state_names = landuse_state_varnames this%fates(nc)%bc_in(s)%hlm_luh_transitions = landuse_transitions(:,g) this%fates(nc)%bc_in(s)%hlm_luh_transition_names = landuse_transition_varnames + + if (fates_harvest_mode >= fates_harvest_luh_area) then + this%fates(nc)%bc_in(s)%hlm_harvest_rates = landuse_harvest(:,g) + this%fates(nc)%bc_in(s)%hlm_harvest_catnames = landuse_harvest_varnames + this%fates(nc)%bc_in(s)%hlm_harvest_units = landuse_harvest_units + end if end if end do @@ -2033,6 +2106,12 @@ subroutine init_coldstart(this, waterstatebulk_inst, waterdiagnosticbulk_inst, & this%fates(nc)%bc_in(s)%hlm_luh_state_names = landuse_state_varnames this%fates(nc)%bc_in(s)%hlm_luh_transitions = landuse_transitions(:,g) this%fates(nc)%bc_in(s)%hlm_luh_transition_names = landuse_transition_varnames + + if (fates_harvest_mode >= fates_harvest_luh_area ) then + this%fates(nc)%bc_in(s)%hlm_harvest_rates = landuse_harvest(:,g) + this%fates(nc)%bc_in(s)%hlm_harvest_catnames = landuse_harvest_varnames + this%fates(nc)%bc_in(s)%hlm_harvest_units = landuse_harvest_units + end if end if end do @@ -3646,6 +3725,114 @@ subroutine GetAndSetTime() end subroutine GetAndSetTime + ! ====================================================================================== + + subroutine GetLandusePFTData(bounds, landuse_pft_file, landuse_pft_map, landuse_bareground) + + ! !DESCRIPTION: + ! Read in static landuse x pft file + + ! !USES: + use fileutils , only : getfil + use ncdio_pio , only : file_desc_t, ncd_io, ncd_inqdlen + use ncdio_pio , only : ncd_pio_openfile, ncd_pio_closefile + use decompMod , only : BOUNDS_LEVEL_PROC + use clm_varcon, only : grlnd + use FatesConstantsMod, only : fates_unset_r8 + + + ! !ARGUMENTS: + type(bounds_type), intent(in) :: bounds ! proc-level bounds + character(len=*) , intent(in) :: landuse_pft_file ! name of file containing static landuse x pft information + real(r8), allocatable, intent(inout) :: landuse_pft_map(:,:,:) + real(r8), allocatable, intent(inout) :: landuse_bareground(:) + + ! !LOCAL VARIABLES + integer :: varnum ! variable number + integer :: dimid, dimlen ! dimension id number and length + integer :: ier ! error id + character(len=256) :: locfn ! local file name + type(file_desc_t) :: ncid ! netcdf id + real(r8), pointer :: arraylocal(:,:) ! local array for reading fraction data + real(r8), pointer :: arraylocal_bareground(:) ! local array for reading bareground data + logical :: readvar ! true => variable is on dataset + !character(len=16), parameter :: grlnd = 'lndgrid' ! name of lndgrid + + integer, parameter :: dim_landuse_pft = 14 + + ! Land use name arrays + character(len=10), parameter :: landuse_pft_map_varnames(num_landuse_pft_vars) = & + [character(len=10) :: 'frac_primr','frac_secnd','frac_pastr','frac_range'] !need to move 'frac_surf' to a different variable + + character(len=*), parameter :: subname = 'GetLandusePFTData' + + !----------------------------------------------------------------------- + + ! Check to see if the landuse file name has been provided + ! Note: getfile checks this as well + if (masterproc) then + write(iulog,*) 'Attempting to read landuse x pft data .....' + if (landuse_pft_file == ' ') then + write(iulog,*)'landuse_pft_file must be specified' + call endrun(msg=errMsg(__FILE__, __LINE__)) + endif + endif + + ! Initialize the landuse x pft arrays and initialize to unset + allocate(landuse_pft_map(bounds%begg:bounds%endg,dim_landuse_pft,num_landuse_pft_vars),stat=ier) + if (ier /= 0) then + call endrun(msg=' allocation error for landuse_pft_map'//errMsg(__FILE__, __LINE__)) + end if + landuse_pft_map = fates_unset_r8 + + allocate(landuse_bareground(bounds%begg:bounds%endg),stat=ier) + if (ier /= 0) then + call endrun(msg=' allocation error for landuse_bareground'//errMsg(__FILE__, __LINE__)) + end if + landuse_bareground = fates_unset_r8 + + + ! Get the local filename and open the file + call getfil(landuse_pft_file, locfn, 0) + call ncd_pio_openfile (ncid, trim(locfn), 0) + + ! Check that natpft dimension on the file matches the target array dimensions + call ncd_inqdlen(ncid, dimid, dimlen, 'natpft') + if (dimlen /= dim_landuse_pft) then + write(iulog,*) 'natpft dimensions on the landuse x pft file do not match target array size' + call endrun(msg=errMsg(__FILE__, __LINE__)) + end if + + ! Allocate a temporary array since ncdio expects a pointer + allocate(arraylocal(bounds%begg:bounds%endg,dim_landuse_pft)) + allocate(arraylocal_bareground(bounds%begg:bounds%endg)) + + ! Read the landuse x pft data from file + do varnum = 1, num_landuse_pft_vars + call ncd_io(ncid=ncid, varname=landuse_pft_map_varnames(varnum), flag='read', & + data=arraylocal, dim1name=grlnd, readvar=readvar) + if (.not. readvar) & + call endrun(msg='ERROR: '//trim(landuse_pft_map_varnames(varnum))// & + ' NOT on landuse x pft file'//errMsg(__FILE__, __LINE__)) + landuse_pft_map(bounds%begg:bounds%endg,:,varnum) = arraylocal(bounds%begg:bounds%endg,:) + end do + + ! Read the bareground data from file. This is per gridcell only. + call ncd_io(ncid=ncid, varname='frac_brgnd', flag='read', & + data=arraylocal_bareground, dim1name=grlnd, readvar=readvar) + if (.not. readvar) call endrun(msg='ERROR: frac_brgnd NOT on landuse x pft file'//errMsg(__FILE__, __LINE__)) + landuse_bareground(bounds%begg:bounds%endg) = arraylocal_bareground(bounds%begg:bounds%endg) + + ! Deallocate the temporary local array point and close the file + deallocate(arraylocal) + deallocate(arraylocal_bareground) + call ncd_pio_closefile(ncid) + + ! Check that sums equal to unity + + end subroutine GetLandusePFTData + + !----------------------------------------------------------------------- end module CLMFatesInterfaceMod From 46420cfb64f4ebb2b092daef9071a3f070b403bf Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Thu, 18 Apr 2024 09:40:21 -0600 Subject: [PATCH 0132/1248] Add fates_landuse_v2 test suite. --- cime_config/testdefs/testlist_clm.xml | 36 +++++++++++++++++++ .../clm/FatesColdLUH2Mode1/include_user_mods | 1 + .../clm/FatesColdLUH2Mode1/user_nl_clm | 1 + .../clm/FatesColdLUH2Mode2/include_user_mods | 1 + .../clm/FatesColdLUH2Mode2/user_nl_clm | 1 + .../clm/FatesColdLUH2Mode3/include_user_mods | 1 + .../clm/FatesColdLUH2Mode3/user_nl_clm | 1 + .../clm/FatesColdLUH2Mode4/include_user_mods | 1 + .../clm/FatesColdLUH2Mode4/user_nl_clm | 1 + 9 files changed, 44 insertions(+) create mode 100644 cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2Mode1/include_user_mods create mode 100644 cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2Mode1/user_nl_clm create mode 100644 cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2Mode2/include_user_mods create mode 100644 cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2Mode2/user_nl_clm create mode 100644 cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2Mode3/include_user_mods create mode 100644 cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2Mode3/user_nl_clm create mode 100644 cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2Mode4/include_user_mods create mode 100644 cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2Mode4/user_nl_clm diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index dec8cf49d8..4184cc7e1f 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -2910,6 +2910,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2Mode1/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2Mode1/include_user_mods new file mode 100644 index 0000000000..7eb8bb1579 --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2Mode1/include_user_mods @@ -0,0 +1 @@ +../FatesColdLUH2 diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2Mode1/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2Mode1/user_nl_clm new file mode 100644 index 0000000000..dea75b71e7 --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2Mode1/user_nl_clm @@ -0,0 +1 @@ +fates_harvest_mode = 1 diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2Mode2/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2Mode2/include_user_mods new file mode 100644 index 0000000000..7eb8bb1579 --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2Mode2/include_user_mods @@ -0,0 +1 @@ +../FatesColdLUH2 diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2Mode2/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2Mode2/user_nl_clm new file mode 100644 index 0000000000..fd4c74fe57 --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2Mode2/user_nl_clm @@ -0,0 +1 @@ +fates_harvest_mode = 2 diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2Mode3/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2Mode3/include_user_mods new file mode 100644 index 0000000000..7eb8bb1579 --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2Mode3/include_user_mods @@ -0,0 +1 @@ +../FatesColdLUH2 diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2Mode3/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2Mode3/user_nl_clm new file mode 100644 index 0000000000..3332e9e526 --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2Mode3/user_nl_clm @@ -0,0 +1 @@ +fates_harvest_mode = 3 diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2Mode4/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2Mode4/include_user_mods new file mode 100644 index 0000000000..7eb8bb1579 --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2Mode4/include_user_mods @@ -0,0 +1 @@ +../FatesColdLUH2 diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2Mode4/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2Mode4/user_nl_clm new file mode 100644 index 0000000000..13dae9efee --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2Mode4/user_nl_clm @@ -0,0 +1 @@ +fates_harvest_mode = 4 From e4c8b6a0f1dfd0392fc956cf5d3f41e197508ba5 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Thu, 18 Apr 2024 11:32:05 -0600 Subject: [PATCH 0133/1248] Point FATES external to my repo: Nag array index fix. --- Externals_CLM.cfg | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Externals_CLM.cfg b/Externals_CLM.cfg index 1494217277..ef4406545e 100644 --- a/Externals_CLM.cfg +++ b/Externals_CLM.cfg @@ -1,8 +1,8 @@ [fates] local_path = src/fates protocol = git -repo_url = https://github.com/ckoven/fates -hash = d37d9733b5970dfe67a +repo_url = https://github.com/samsrabin/fates +hash = c03a4ba64a7e59817658f1c3357ffff681d8b958 required = True [externals_description] From 7216006b1c2400d1ca2932899671f9bcec85b6af Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Thu, 18 Apr 2024 16:48:41 -0600 Subject: [PATCH 0134/1248] Apply relevant changes from rgknox/fates-auto-params. --- .../testdefs/testmods_dirs/clm/Fates/shell_commands | 5 +++++ .../testdefs/testmods_dirs/clm/Fates/user_nl_clm | 1 + .../testdefs/testmods_dirs/clm/_scripts/README | 2 ++ .../clm/_scripts/get_fates_shell_commands_vars.sh | 11 +++++++++++ 4 files changed, 19 insertions(+) create mode 100644 cime_config/testdefs/testmods_dirs/clm/_scripts/README create mode 100755 cime_config/testdefs/testmods_dirs/clm/_scripts/get_fates_shell_commands_vars.sh diff --git a/cime_config/testdefs/testmods_dirs/clm/Fates/shell_commands b/cime_config/testdefs/testmods_dirs/clm/Fates/shell_commands index 41a2342a51..3443bacef0 100644 --- a/cime_config/testdefs/testmods_dirs/clm/Fates/shell_commands +++ b/cime_config/testdefs/testmods_dirs/clm/Fates/shell_commands @@ -1,2 +1,7 @@ ./xmlchange CLM_BLDNML_OPTS="-no-megan" --append ./xmlchange BFBFLAG="TRUE" + +SRCROOT=`./xmlquery SRCROOT --value` +. "${SRCROOT}"/cime_config/testdefs/testmods_dirs/clm/_scripts/get_fates_shell_commands_vars.sh + +ncgen -o $FATESPARAMFILE $FATESDIR/parameter_files/fates_params_default.cdl diff --git a/cime_config/testdefs/testmods_dirs/clm/Fates/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/Fates/user_nl_clm index 91df3e2e61..57adea1ff6 100644 --- a/cime_config/testdefs/testmods_dirs/clm/Fates/user_nl_clm +++ b/cime_config/testdefs/testmods_dirs/clm/Fates/user_nl_clm @@ -4,6 +4,7 @@ hist_nhtfrq = -24 hist_empty_htapes = .true. hist_ndens = 1 fates_spitfire_mode = 1 +fates_paramfile='${SRCROOT}/src/fates/parameter_files/binaries/${CASE}-params.nc' hist_fincl1 = 'FATES_NCOHORTS', 'FATES_TRIMMING', 'FATES_AREA_PLANTS', 'FATES_AREA_TREES', 'FATES_COLD_STATUS', 'FATES_GDD', 'FATES_NCHILLDAYS', 'FATES_NCOLDDAYS', 'FATES_DAYSINCE_COLDLEAFOFF','FATES_DAYSINCE_COLDLEAFON', diff --git a/cime_config/testdefs/testmods_dirs/clm/_scripts/README b/cime_config/testdefs/testmods_dirs/clm/_scripts/README new file mode 100644 index 0000000000..66eb22a375 --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/_scripts/README @@ -0,0 +1,2 @@ +This directory contains scripts that can be called in +shell_commands of multiple testmods. diff --git a/cime_config/testdefs/testmods_dirs/clm/_scripts/get_fates_shell_commands_vars.sh b/cime_config/testdefs/testmods_dirs/clm/_scripts/get_fates_shell_commands_vars.sh new file mode 100755 index 0000000000..382fb4e53e --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/_scripts/get_fates_shell_commands_vars.sh @@ -0,0 +1,11 @@ +# This script should be called in shell_commands with +# . "${SRCROOT}"/cime_config/testdefs/testmods_dirs/clm/_scripts/get_fates_shell_commands_vars.sh +# where the leading period ensures it's run in the same shell. + +CASE=`./xmlquery CASE --value` +FATESDIR="${SRCROOT}/src/fates" +FATESPARAMDIR="${SRCROOT}/src/fates/parameter_files/binaries" +mkdir -p "${FATESPARAMDIR}" +FATESPARAMFILE="${FATESPARAMDIR}/${CASE}-params.nc" + +# No exit status because it should be called in the same shell. From a7c21a752224c09361b4280a730e5c61273244fa Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Tue, 23 Apr 2024 12:26:35 -0600 Subject: [PATCH 0135/1248] Don't allow flandusepftdat to be set in non-FATES runs. --- bld/CLMBuildNamelist.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index bcf68a8d61..e3ceedeccc 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -784,7 +784,7 @@ sub setup_cmdl_fates_mode { my @list = ( "fates_spitfire_mode", "use_fates_planthydro", "use_fates_ed_st3", "use_fates_ed_prescribed_phys", "use_fates_cohort_age_tracking","use_fates_inventory_init","use_fates_fixed_biogeog", "use_fates_nocomp","use_fates_sp","fates_inventory_ctrl_filename","fates_harvest_mode", - "fates_parteh_mode","use_fates_tree_damage","fates_seeddisp_cadence","use_fates_luh","fluh_timeseries" ); + "fates_parteh_mode","use_fates_tree_damage","fates_seeddisp_cadence","use_fates_luh","fluh_timeseries","flandusepftdat"); # dis-allow fates specific namelist items with non-fates runs foreach my $var ( @list ) { if ( defined($nl->get_value($var)) ) { From 90a40281134953f3d371a6454642773035efe137 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Tue, 23 Apr 2024 12:27:16 -0600 Subject: [PATCH 0136/1248] Actually set flandusepftdat in CLMBuildNamelist.pm. --- bld/CLMBuildNamelist.pm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index e3ceedeccc..0f7f6891c5 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -4424,6 +4424,9 @@ sub setup_logic_fates { } elsif ( ! -f "$fname" ) { $log->fatal_error("$fname does NOT point to a valid filename" ); } + + $var = "flandusepftdat"; + add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, $var, 'phys'=>$nl_flags->{'phys'}, 'hgrid'=>$nl_flags->{'res'}, 'sim_year_range'=>$nl_flags->{'sim_year_range'}, nofail=>1 ); } } From d88fda01ba5904e80cf432f609cc10d4392f2767 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Tue, 23 Apr 2024 12:27:43 -0600 Subject: [PATCH 0137/1248] Update path for default flandusepftdat. --- 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 bc962d1b0f..66c0f837e0 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -1578,7 +1578,7 @@ use_crop=".true.">lnd/clm2/surfdata_map/ctsm5.1.dev052/landuse.timeseries_mpasa1 >lnd/clm2/surfdata_map/fates-sci.1.68.3_api.31.0.0_tools.1.0.1/LUH2_states_transitions_management.timeseries_4x5_hist_simyr1850-2015_c231101.nc -lnd/clm2/surfdata_map/fates-sci.1.73.0_api.33.0.0/fates_landuse_pft_map_4x5_240206.nc +lnd/clm2/surfdata_map/fates-sci.1.73.0_api.36.0.0/fates_landuse_pft_map_4x5_240206.nc Date: Sun, 28 Apr 2024 13:45:50 -0600 Subject: [PATCH 0138/1248] Point FATES external back at Charlie's branch. --- Externals_CLM.cfg | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Externals_CLM.cfg b/Externals_CLM.cfg index ef4406545e..b689141aaf 100644 --- a/Externals_CLM.cfg +++ b/Externals_CLM.cfg @@ -1,8 +1,8 @@ [fates] local_path = src/fates protocol = git -repo_url = https://github.com/samsrabin/fates -hash = c03a4ba64a7e59817658f1c3357ffff681d8b958 +repo_url = https://github.com/ckoven/fates +hash = c1a7453c8331277a156a0ee158a870c1b8598a9f required = True [externals_description] From 0191278f95a35f90c76b7922fb51d8e42d68b24e Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Sun, 28 Apr 2024 13:48:21 -0600 Subject: [PATCH 0139/1248] Add missing potential veg to build list. Manually cherry-picked from Greg Lemieux's b33a722. --- bld/CLMBuildNamelist.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index 0f7f6891c5..7e2e4294af 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -784,7 +784,8 @@ sub setup_cmdl_fates_mode { my @list = ( "fates_spitfire_mode", "use_fates_planthydro", "use_fates_ed_st3", "use_fates_ed_prescribed_phys", "use_fates_cohort_age_tracking","use_fates_inventory_init","use_fates_fixed_biogeog", "use_fates_nocomp","use_fates_sp","fates_inventory_ctrl_filename","fates_harvest_mode", - "fates_parteh_mode","use_fates_tree_damage","fates_seeddisp_cadence","use_fates_luh","fluh_timeseries","flandusepftdat"); + "fates_parteh_mode","use_fates_tree_damage","fates_seeddisp_cadence","use_fates_luh","fluh_timeseries","flandusepftdat", + "use_fates_potentialveg"); # dis-allow fates specific namelist items with non-fates runs foreach my $var ( @list ) { if ( defined($nl->get_value($var)) ) { From ee5efecb0630adae98b5839bb206edf14fe01144 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Mon, 29 Apr 2024 17:12:41 -0600 Subject: [PATCH 0140/1248] Fix the clm6_0 issues identified in #2492 --- 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 147a23f49a..03b5afd1ef 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -116,9 +116,9 @@ attributes from the config_cache.xml file (with keys converted to upper-case). lnd/clm2/isotopes/atm_delta_C14_CMIP6_SSP5B_3x1_global_1850-2100_yearly_c181209.nc -.false. .true. .false. +.false. .false. @@ -430,6 +430,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). Jordan1991 Sturm1997 +Sturm1997 - lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c20230226/mksrf_landuse_ctsm52_histLUH2_%y.c20230226.nc + /glade/campaign/cesm/development/lmwg/landuse_source_data/CTSM52RawData/globalctsm52histLUH2Deg025_231228/mksrf_landuse_ctsm52_histLUH2_%y.c231228.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/historical/urban_properties_GaoOneil_05deg_ThreeClass_%y_cdf5_c20220910.nc @@ -272,7 +272,7 @@ version of the raw dataset will probably go away. - lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-2.6.simyr2015-2100.c20230226/mksrf_landuse_ctsm52_SSP1-2.6_%y.c20230226.nc + /glade/campaign/cesm/development/lmwg/landuse_source_data/CTSM52RawData/globalctsm52SSP126Deg025_231228/mksrf_landuse_ctsm52_SSP126_%y.c231228.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 @@ -285,21 +285,21 @@ version of the raw dataset will probably go away. - lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP1-1.9.simyr2015-2100.c20230226/mksrf_landuse_ctsm52_SSP1-1.9_%y.c20230226.nc + /glade/campaign/cesm/development/lmwg/landuse_source_data/CTSM52RawData/globalctsm52SSP119Deg025_231228/mksrf_landuse_ctsm52_SSP119_%y.c231228.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 - lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP2-4.5.simyr2015-2100.c20230226/mksrf_landuse_ctsm52_SSP2-4.5_%y.c20230226.nc + /glade/campaign/cesm/development/lmwg/landuse_source_data/CTSM52RawData/globalctsm52SSP245Deg025_231228/mksrf_landuse_ctsm52_SSP245_%y.c231228.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 - lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP3-7.0.simyr2015-2100.c20230226/mksrf_landuse_ctsm52_SSP3-7.0_%y.c20230226.nc + /glade/campaign/cesm/development/lmwg/landuse_source_data/CTSM52RawData/globalctsm52SSP370Deg025_231228/mksrf_landuse_ctsm52_SSP370_2100.c231228.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 @@ -313,14 +313,14 @@ version of the raw dataset will probably go away. - lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-6.0.simyr2015-2100.c20230226/mksrf_landuse_ctsm52_SSP4-6.0_%y.c20230226.nc + /glade/campaign/cesm/development/lmwg/landuse_source_data/CTSM52RawData/globalctsm52SSP460Deg025_231228/mksrf_landuse_ctsm52_SSP460_%y.c231228.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 - lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-8.5.simyr2015-2100.c20230226/mksrf_landuse_ctsm52_SSP5-8.5_%y.c20230226.nc + /glade/campaign/cesm/development/lmwg/landuse_source_data/CTSM52RawData/globalctsm52SSP585Deg025_231228/mksrf_landuse_ctsm52_SSP585_%y.c231228.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 From b767a82b5eb448817e2e36609bde1633e105e358 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Mon, 29 Apr 2024 18:59:30 -0600 Subject: [PATCH 0144/1248] Start adding the unit testing for dust emission in cmeps --- Externals.cfg | 2 +- src/CMakeLists.txt | 4 ++ src/drv_test/CMakeLists.txt | 1 + .../shr_dust_emis_test/CMakeLists.txt | 3 ++ .../shr_dust_emis_test/test_shr_dust_emis.pf | 50 +++++++++++++++++++ 5 files changed, 59 insertions(+), 1 deletion(-) create mode 100644 src/drv_test/CMakeLists.txt create mode 100644 src/drv_test/shr_dust_emis_test/CMakeLists.txt create mode 100644 src/drv_test/shr_dust_emis_test/test_shr_dust_emis.pf diff --git a/Externals.cfg b/Externals.cfg index 1aa8991883..70c0bd6124 100644 --- a/Externals.cfg +++ b/Externals.cfg @@ -50,7 +50,7 @@ required = True [cmeps] #tag = cmeps0.14.50 #branch = dust_emis_mod -hash = d79e34f67df825f9265bdaaf3091f8995d5df1a2 +hash = 492faf0014ad9d91c22bb92e2570e558a76093fe protocol = git #repo_url = https://github.com/ESCOMP/CMEPS.git repo_url = https://github.com/ekluzek/CMEPS.git diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 9d2e6041b5..9388e65bc2 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -105,3 +105,7 @@ add_subdirectory(${CLM_ROOT}/src/dyn_subgrid/test clm_dyn_subgrid_test) add_subdirectory(${CLM_ROOT}/src/main/test clm_main_test) add_subdirectory(${CLM_ROOT}/src/init_interp/test clm_init_interp_test) add_subdirectory(${CLM_ROOT}/src/self_tests/test clm_self_tests_test) + +# Add driver unit test directories +add_subdirectory(${CLM_ROOT}/src/drv_test drv_test) + diff --git a/src/drv_test/CMakeLists.txt b/src/drv_test/CMakeLists.txt new file mode 100644 index 0000000000..adf66b8b92 --- /dev/null +++ b/src/drv_test/CMakeLists.txt @@ -0,0 +1 @@ +add_subdirectory(shr_dust_emis_test) diff --git a/src/drv_test/shr_dust_emis_test/CMakeLists.txt b/src/drv_test/shr_dust_emis_test/CMakeLists.txt new file mode 100644 index 0000000000..21fb9c8d47 --- /dev/null +++ b/src/drv_test/shr_dust_emis_test/CMakeLists.txt @@ -0,0 +1,3 @@ +add_pfunit_ctest(dust_emis + TEST_SOURCES "test_shr_dust_emis.pf" + LINK_LIBRARIES clm csm_share) diff --git a/src/drv_test/shr_dust_emis_test/test_shr_dust_emis.pf b/src/drv_test/shr_dust_emis_test/test_shr_dust_emis.pf new file mode 100644 index 0000000000..aa60427eac --- /dev/null +++ b/src/drv_test/shr_dust_emis_test/test_shr_dust_emis.pf @@ -0,0 +1,50 @@ +module test_shr_dust_emis + + ! Tests of shr_dust_emis_mod.F90 from CMEPS nuopc_cap_share + + use funit + use shr_dust_emis_mod, only : check_if_initialized + use unittestUtils, only : endrun_msg + + implicit none + + @TestCase + type, extends(TestCase) :: TestDustEmis + contains + procedure :: setUp + procedure :: tearDown + end type TestDustEmis + +contains + + ! ======================================================================== + ! Helper routines + ! ======================================================================== + + subroutine setUp(this) + class(TestDustEmis), intent(inout) :: this + end subroutine setUp + + subroutine tearDown(this) + class(TestDustEmis), intent(inout) :: this + + end subroutine tearDown + + + + ! ======================================================================== + ! Begin tests + ! ======================================================================== + + @Test + subroutine check_if_initialized_aborts(this) + ! Test that the check_if_initialized check aborts when called initially + class(TestDustEmis), intent(inout) :: this + + call check_if_initialized() + @assertExceptionRaised(endrun_msg('ERROR: dust emission namelist has NOT been read in yet, shr_dust_emis_mod is NOT initialized') ) + + end subroutine check_if_initialized_aborts + + +end module test_shr_dust_emis From 82704fe7e86aa68f2bd7254d83bb62c53f4aabeb Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Tue, 30 Apr 2024 09:21:16 -0600 Subject: [PATCH 0145/1248] Change call to is_NOT_initialized function, unit test works --- src/drv_test/shr_dust_emis_test/test_shr_dust_emis.pf | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/drv_test/shr_dust_emis_test/test_shr_dust_emis.pf b/src/drv_test/shr_dust_emis_test/test_shr_dust_emis.pf index aa60427eac..a619618e1d 100644 --- a/src/drv_test/shr_dust_emis_test/test_shr_dust_emis.pf +++ b/src/drv_test/shr_dust_emis_test/test_shr_dust_emis.pf @@ -3,7 +3,7 @@ module test_shr_dust_emis ! Tests of shr_dust_emis_mod.F90 from CMEPS nuopc_cap_share use funit - use shr_dust_emis_mod, only : check_if_initialized + use shr_dust_emis_mod, only : is_NOT_initialized use unittestUtils, only : endrun_msg implicit none @@ -40,9 +40,11 @@ contains subroutine check_if_initialized_aborts(this) ! Test that the check_if_initialized check aborts when called initially class(TestDustEmis), intent(inout) :: this + logical :: not_init - call check_if_initialized() + not_init = is_NOT_initialized() @assertExceptionRaised(endrun_msg('ERROR: dust emission namelist has NOT been read in yet, shr_dust_emis_mod is NOT initialized') ) + @assertTrue(not_init) end subroutine check_if_initialized_aborts From 118010da9524fa08401ba6af3c2b6be560b0d2c7 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Tue, 30 Apr 2024 10:51:45 -0600 Subject: [PATCH 0146/1248] add a test that is expected to fail --- .../shr_dust_emis_test/test_shr_dust_emis.pf | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/drv_test/shr_dust_emis_test/test_shr_dust_emis.pf b/src/drv_test/shr_dust_emis_test/test_shr_dust_emis.pf index a619618e1d..646b3cfce1 100644 --- a/src/drv_test/shr_dust_emis_test/test_shr_dust_emis.pf +++ b/src/drv_test/shr_dust_emis_test/test_shr_dust_emis.pf @@ -3,8 +3,8 @@ module test_shr_dust_emis ! Tests of shr_dust_emis_mod.F90 from CMEPS nuopc_cap_share use funit - use shr_dust_emis_mod, only : is_NOT_initialized - use unittestUtils, only : endrun_msg + use shr_dust_emis_mod + use unittestUtils , only : endrun_msg implicit none @@ -48,5 +48,16 @@ contains end subroutine check_if_initialized_aborts + @Test + subroutine check_when_initialized_runs(this) + ! Test that the initializiation check runs when it is initialized + class(TestDustEmis), intent(inout) :: this + logical :: not_init + + call dust_emis_set_options( 'Zender_2003', 'lnd') + not_init = is_NOT_initialized() + @assertFalse(not_init) + + end subroutine check_when_initialized_runs end module test_shr_dust_emis From 516d14721ae3f29c40316c6fb7fbd4fd7d9970d2 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Tue, 30 Apr 2024 11:10:03 -0600 Subject: [PATCH 0147/1248] Update cmeps version so will work --- Externals.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Externals.cfg b/Externals.cfg index 70c0bd6124..3753aac874 100644 --- a/Externals.cfg +++ b/Externals.cfg @@ -50,7 +50,7 @@ required = True [cmeps] #tag = cmeps0.14.50 #branch = dust_emis_mod -hash = 492faf0014ad9d91c22bb92e2570e558a76093fe +hash = ecb6d45aa00a4960564ea963b00754fb4c3b7d2c protocol = git #repo_url = https://github.com/ESCOMP/CMEPS.git repo_url = https://github.com/ekluzek/CMEPS.git From 5cf5dc04734ff81fc77b43e8a003af826e9553a4 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Tue, 30 Apr 2024 14:31:23 -0600 Subject: [PATCH 0148/1248] Add more tests that pass --- .../shr_dust_emis_test/test_shr_dust_emis.pf | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/src/drv_test/shr_dust_emis_test/test_shr_dust_emis.pf b/src/drv_test/shr_dust_emis_test/test_shr_dust_emis.pf index 646b3cfce1..efe6a5c2a8 100644 --- a/src/drv_test/shr_dust_emis_test/test_shr_dust_emis.pf +++ b/src/drv_test/shr_dust_emis_test/test_shr_dust_emis.pf @@ -60,4 +60,35 @@ contains end subroutine check_when_initialized_runs + @Test + subroutine check_dust_emis(this) + ! Test that the dust_emis logical functions work as expected + class(TestDustEmis), intent(inout) :: this + logical :: not_init + + call dust_emis_set_options( 'Zender_2003', 'lnd') + @assertTrue( is_dust_emis_zender() ) + @assertFalse( is_dust_emis_leung() ) + call dust_emis_set_options( 'Leung_2023', 'lnd') + @assertFalse( is_dust_emis_zender() ) + @assertTrue( is_dust_emis_leung() ) + + end subroutine check_dust_emis + + + @Test + subroutine check_zender_soil(this) + ! Test that the dust_emis_Zender logical functions work as expected + class(TestDustEmis), intent(inout) :: this + logical :: not_init + + call dust_emis_set_options( 'Zender_2003', 'lnd') + @assertTrue( is_zender_soil_erod_from_land() ) + @assertFalse( is_zender_soil_erod_from_atm() ) + call dust_emis_set_options( 'Zender_2003', 'atm') + @assertFalse( is_zender_soil_erod_from_land() ) + @assertTrue( is_zender_soil_erod_from_atm() ) + + end subroutine check_zender_soil + end module test_shr_dust_emis From de8406be596eb73e593645190d5e8eb1f839c357 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Tue, 30 Apr 2024 17:11:38 -0600 Subject: [PATCH 0149/1248] Update namelist_defaults_ctsm.xml for 1979 fsurdat files --- bld/namelist_files/namelist_defaults_ctsm.xml | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index ac4f7252d2..6b98dc1482 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -1428,14 +1428,6 @@ lnd/clm2/surfdata_esmf/ctsm5.2.0/surfdata_1x1_mexicocityMEX_hist_2000_78pfts_c24 lnd/clm2/surfdata_esmf/ctsm5.2.0/surfdata_1x1_urbanc_alpha_hist_2000_78pfts_c240221.nc - - -lnd/clm2/surfdata_esmf/ctsm5.2.0/surfdata_ne0np4.ARCTICGRIS.ne30x8_SSP2-4.5_1979_78pfts_c240425.nc - -lnd/clm2/surfdata_esmf/ctsm5.2.0/surfdata_ne0np4.ARCTIC.ne30x4_SSP2-4.5_1979_78pfts_c240425.nc - -lnd/clm2/surfdata_esmf/ctsm5.2.0/surfdata_ne0np4CONUS.ne30x8_SSP2-4.5_1979_78pfts_c240425.nc - @@ -1477,11 +1469,11 @@ lnd/clm2/surfdata_esmf/ctsm5.2.0/surfdata_ne16np4.pg3_hist_1850_78pfts_c240216.n lnd/clm2/surfdata_esmf/ctsm5.2.0/surfdata_ne120np4.pg3_hist_1850_78pfts_c240216.nc -lnd/clm2/surfdata_esmf/ctsm5.2.0/surfdata_ne0np4.ARCTICGRIS.ne30x8_hist_1850_78pfts_c240216.nc +lnd/clm2/surfdata_esmf/ctsm5.2.0/surfdata_ne0np4.ARCTICGRIS.ne30x8_hist_1979_78pfts_c240425.nc -lnd/clm2/surfdata_esmf/ctsm5.2.0/surfdata_ne0np4.ARCTIC.ne30x4_hist_1850_78pfts_c240216.nc +lnd/clm2/surfdata_esmf/ctsm5.2.0/surfdata_ne0np4.ARCTIC.ne30x4_hist_1979_78pfts_c240425.nc -lnd/clm2/surfdata_esmf/ctsm5.2.0/surfdata_ne0np4CONUS.ne30x8_hist_1850_78pfts_c240216.nc +lnd/clm2/surfdata_esmf/ctsm5.2.0/surfdata_ne0np4CONUS.ne30x8_hist_1979_78pfts_c240425.nc Date: Tue, 30 Apr 2024 17:22:15 -0600 Subject: [PATCH 0150/1248] Draft modifications to address new compset and new test for 1979-2026 --- bld/namelist_files/namelist_defaults_ctsm.xml | 6 +++--- cime_config/config_component.xml | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index 6b98dc1482..2f3a7efd72 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -1572,11 +1572,11 @@ lnd/clm2/surfdata_esmf/NEON/surfdata_1x1_NEON_TOOL_hist_78pfts_CMIP6_simyr2000_c lnd/clm2/surfdata_esmf/ctsm5.2.0/landuse.timeseries_C96_SSP2-4.5_1850-2100_78pfts_c240216.nc -lnd/clm2/surfdata_esmf/ctsm5.2.0/landuse.timeseries_ne0np4.ARCTICGRIS.ne30x8_SSP2-4.5_1979-2026_78pfts_c240425.nc -lnd/clm2/surfdata_esmf/ctsm5.2.0/landuse.timeseries_ne0np4.ARCTIC.ne30x4_SSP2-4.5_1979-2026_78pfts_c240425.nc -lnd/clm2/surfdata_esmf/ctsm5.2.0/landuse.timeseries_ne0np4CONUS.ne30x8_SSP2-4.5_1979-2026_78pfts_c240425.nc diff --git a/cime_config/config_component.xml b/cime_config/config_component.xml index f7adab268f..984ba5ecdf 100644 --- a/cime_config/config_component.xml +++ b/cime_config/config_component.xml @@ -210,6 +210,7 @@ 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 75cdcd24a4c19ec66aa53fc895b17090c35f6a7a Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Tue, 30 Apr 2024 17:38:27 -0600 Subject: [PATCH 0151/1248] Improve a comment in namelist_defaults_ctsm.xml --- 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 2f3a7efd72..0f533a56ff 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -1498,7 +1498,7 @@ lnd/clm2/surfdata_esmf/NEON/surfdata_1x1_NEON_TOOL_hist_78pfts_CMIP6_simyr2000_c >lnd/clm2/surfdata_esmf/NEON/landuse.timeseries_NEON_${NEONSITE}_hist_78pfts_simyr2018-2023_c230931.nc --> - + lnd/clm2/surfdata_esmf/ctsm5.2.0/landuse.timeseries_0.9x1.25_SSP2-4.5_1850-2100_78pfts_c240216.nc Date: Tue, 30 Apr 2024 17:44:17 -0600 Subject: [PATCH 0152/1248] Request same #tasks in Makefile as when I generated the ne0np4 files ...which I generated manually one at a time --- 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 00e90efa45..d8bacdc5dd 100644 --- a/tools/mksurfdata_esmf/Makefile +++ b/tools/mksurfdata_esmf/Makefile @@ -320,7 +320,7 @@ crop-global-SSP2-4.5-ne30 : FORCE $(BATCHJOBS) $@.sh crop-global-SSP2-4.5-ne0np4 : FORCE - $(MKSURFDATA) --number-of-nodes 9 --scenario $@ --jobscript-file $@.sh --walltime 12:00:00 + $(MKSURFDATA) --number-of-nodes 2 --scenario $@ --jobscript-file $@.sh --walltime 12:00:00 $(BATCHJOBS) $@.sh crop-global-SSP2-4.5-C96 : FORCE From c2d226c20c1ae3cbbf5f3e2b91a7bee67fd0e5aa Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 1 May 2024 13:50:29 -0600 Subject: [PATCH 0153/1248] Add new tests and get working again --- .../shr_dust_emis_test/test_shr_dust_emis.pf | 22 ++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/src/drv_test/shr_dust_emis_test/test_shr_dust_emis.pf b/src/drv_test/shr_dust_emis_test/test_shr_dust_emis.pf index efe6a5c2a8..467d00de59 100644 --- a/src/drv_test/shr_dust_emis_test/test_shr_dust_emis.pf +++ b/src/drv_test/shr_dust_emis_test/test_shr_dust_emis.pf @@ -69,7 +69,7 @@ contains call dust_emis_set_options( 'Zender_2003', 'lnd') @assertTrue( is_dust_emis_zender() ) @assertFalse( is_dust_emis_leung() ) - call dust_emis_set_options( 'Leung_2023', 'lnd') + call dust_emis_set_options( 'Leung_2023', 'none') @assertFalse( is_dust_emis_zender() ) @assertTrue( is_dust_emis_leung() ) @@ -90,5 +90,25 @@ contains @assertTrue( is_zender_soil_erod_from_atm() ) end subroutine check_zender_soil + + + @Test + subroutine check_options(this) + ! Test that the check_options subroutine catches errors that should die + class(TestDustEmis), intent(inout) :: this + logical :: not_init + + call dust_emis_set_options( 'zztop', 'zztop') + @assertExceptionRaised(endrun_msg('(check_options_finish_init) ERROR: dust_emis_method namelist item is not valid')) + call dust_emis_set_options( 'Leung_2023', 'lnd') + @assertExceptionRaised(endrun_msg('(check_options_finish_init) ERROR: zender_soil_erod_source should NOT be set, when dust_emis_method=Leung_2023')) + call dust_emis_set_options( 'Leung_2023', 'atm') + @assertExceptionRaised(endrun_msg('(check_options_finish_init) ERROR: zender_soil_erod_source should NOT be set, when dust_emis_method=Leung_2023')) + call dust_emis_set_options( 'Zender_2003', 'none') + @assertExceptionRaised(endrun_msg('(check_options_finish_init) ERROR: zender_soil_erod_source can only be lnd or atm')) + call dust_emis_set_options( 'Zender_2003', 'zztop') + @assertExceptionRaised(endrun_msg('(check_options_finish_init) ERROR: zender_soil_erod_source can only be lnd or atm')) + + end subroutine check_options end module test_shr_dust_emis From 0ff68d77dc824f6dbb0c8f6cac0a9ec3773e0b8c Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 1 May 2024 14:05:25 -0600 Subject: [PATCH 0154/1248] Update cmeps with unit-testing completed --- Externals.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Externals.cfg b/Externals.cfg index 3753aac874..39818b0fdc 100644 --- a/Externals.cfg +++ b/Externals.cfg @@ -50,7 +50,7 @@ required = True [cmeps] #tag = cmeps0.14.50 #branch = dust_emis_mod -hash = ecb6d45aa00a4960564ea963b00754fb4c3b7d2c +hash = 0285eeb59605df44bc3abf38a61e8436361e7e8c protocol = git #repo_url = https://github.com/ESCOMP/CMEPS.git repo_url = https://github.com/ekluzek/CMEPS.git From fffb79409b29ed741c119d9fb37496898a689cd9 Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Wed, 1 May 2024 15:46:26 -0700 Subject: [PATCH 0155/1248] add use_fates_lupft switch --- bld/CLMBuildNamelist.pm | 25 +++++++++++++++++++ bld/namelist_files/namelist_defaults_ctsm.xml | 18 +++++++------ .../namelist_definition_ctsm.xml | 6 +++++ src/main/clm_varctl.F90 | 1 + src/main/controlMod.F90 | 3 +++ src/utils/clmfates_interfaceMod.F90 | 16 ++++-------- 6 files changed, 51 insertions(+), 18 deletions(-) diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index 7e2e4294af..021381a18e 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -4414,6 +4414,31 @@ sub setup_logic_fates { } } } + # make sure that fates landuse x pft mode has the necessary run mode configurations + # and add the necessary landuse x pft static mapping data default if not defined + my $var = "use_fates_lupft"; + if ( defined($nl->get_value($var)) ) { + if ( &value_is_true($nl->get_value($var)) ) { + $var = "flandusepftdat"; + add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, $var, + 'phys'=>$nl_flags->{'phys'}, 'hgrid'=>$nl_flags->{'res'}, nofail=>1 ); + my $fname = remove_leading_and_trailing_quotes( $nl->get_value($var) ); + if ( ! defined($nl->get_value($var)) ) { + fatal_error("$var is required when use_fates_lupft is set" ); + } elsif ( ! -f "$fname" ) { + fatal_error("$fname does NOT point to a valid filename" ); + } + } + # make sure that nocomp and fbg mode are enabled as well as use_fates_luh + my @list = ( "use_fates_nocomp", "use_fates_fixed_biogeog, use_fates_luh" ); + foreach my $var ( @list ) { + if ( ! &value_is_true($nl->get_value($var)) ) { + fatal_error("$var is required when use_fates_lupft is true" ); + } + } + } + # check that fates landuse change mode has the necessary luh2 landuse timeseries data + # and add the default if not defined my $var = "use_fates_luh"; if ( defined($nl->get_value($var)) ) { if ( &value_is_true($nl->get_value($var)) ) { diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index 66c0f837e0..49109c6591 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -2767,17 +2767,21 @@ use_crop=".true.">lnd/clm2/surfdata_map/ctsm5.1.dev052/landuse.timeseries_mpasa1 .false. .false. .false. +.false. .false. -.true. -.true. -.false. +.true. +.true. +.true. +.false. 1 0 -.true. -.false. -.true. -.false. +.true. +.true. +.false. +.true. +.true. +.false. diff --git a/bld/namelist_files/namelist_definition_ctsm.xml b/bld/namelist_files/namelist_definition_ctsm.xml index fa2d83a3c9..a2df9b1d1e 100644 --- a/bld/namelist_files/namelist_definition_ctsm.xml +++ b/bld/namelist_files/namelist_definition_ctsm.xml @@ -791,6 +791,12 @@ data (fates_harvest_mode >= 3) (Also, only valid for use_fates = true and is incompatible with transient runs currently.) + +If TRUE, enable use of fates land use x pft mapping data file. +(Only valid for use_fates = true and is incompatible with transient runs currently.) + + If TRUE, ignore the land-use state vector and transitions, and assert that all lands diff --git a/src/main/clm_varctl.F90 b/src/main/clm_varctl.F90 index 9ab6c631c7..64d6e15747 100644 --- a/src/main/clm_varctl.F90 +++ b/src/main/clm_varctl.F90 @@ -311,6 +311,7 @@ module clm_varctl logical, public :: use_fates_fixed_biogeog = .false. ! true => use fixed biogeography mode logical, public :: use_fates_nocomp = .false. ! true => use no comopetition mode logical, public :: use_fates_luh = .false. ! true => use FATES landuse data mode + logical, public :: use_fates_lupft = .false. ! true => use FATES landuse x pft static mapping mode logical, public :: use_fates_potentialveg = .false. ! true => FATES potential veg only character(len=256), public :: fluh_timeseries = '' ! filename for fates landuse timeseries data character(len=256), public :: flandusepftdat = '' ! filename for fates landuse x pft data diff --git a/src/main/controlMod.F90 b/src/main/controlMod.F90 index 196bc141ff..55dd92305d 100644 --- a/src/main/controlMod.F90 +++ b/src/main/controlMod.F90 @@ -231,6 +231,7 @@ subroutine control_init(dtime) use_fates_nocomp, & use_fates_sp, & use_fates_luh, & + use_fates_lupft, & use_fates_potentialveg, & fluh_timeseries, & flandusepftdat, & @@ -785,6 +786,7 @@ subroutine control_spmd() call mpi_bcast (use_fates_nocomp, 1, MPI_LOGICAL, 0, mpicom, ier) call mpi_bcast (use_fates_sp, 1, MPI_LOGICAL, 0, mpicom, ier) call mpi_bcast (use_fates_luh, 1, MPI_LOGICAL, 0, mpicom, ier) + call mpi_bcast (use_fates_lupft, 1, MPI_LOGICAL, 0, mpicom, ier) call mpi_bcast (use_fates_potentialveg, 1, MPI_LOGICAL, 0, mpicom, ier) call mpi_bcast (use_fates_bgc, 1, MPI_LOGICAL, 0, mpicom, ier) call mpi_bcast (fates_inventory_ctrl_filename, len(fates_inventory_ctrl_filename), MPI_CHARACTER, 0, mpicom, ier) @@ -1161,6 +1163,7 @@ subroutine control_print () write(iulog, *) ' use_fates_nocomp = ', use_fates_nocomp write(iulog, *) ' use_fates_sp = ', use_fates_sp write(iulog, *) ' use_fates_luh= ', use_fates_luh + write(iulog, *) ' use_fates_lupft= ', use_fates_lupft write(iulog, *) ' use_fates_potentialveg = ', use_fates_potentialveg write(iulog, *) ' fluh_timeseries = ', trim(fluh_timeseries) write(iulog, *) ' flandusepftdat = ', trim(flandusepftdat) diff --git a/src/utils/clmfates_interfaceMod.F90 b/src/utils/clmfates_interfaceMod.F90 index 3f84a28508..b0ae0044f3 100644 --- a/src/utils/clmfates_interfaceMod.F90 +++ b/src/utils/clmfates_interfaceMod.F90 @@ -60,6 +60,7 @@ module CLMFatesInterfaceMod use clm_varctl , only : use_fates_nocomp use clm_varctl , only : use_fates_sp use clm_varctl , only : use_fates_luh + use clm_varctl , only : use_fates_lupft use clm_varctl , only : use_fates_potentialveg use clm_varctl , only : flandusepftdat use clm_varctl , only : fates_seeddisp_cadence @@ -567,13 +568,6 @@ subroutine CLMFatesGlobals2() end if call set_fates_ctrlparms('use_fates_potentialveg',ival=pass_use_potentialveg) - if(flandusepftdat /= '') then - pass_lupftdat = 1 - else - pass_lupftdat = 0 - end if - call set_fates_ctrlparms('use_landusepft_data',ival=pass_lupftdat) - ! Wait to set the harvest and logging variables after checking get_do_harvest ! and fates_harvest_modes call set_fates_ctrlparms('use_lu_harvest',ival=pass_lu_harvest) @@ -710,7 +704,7 @@ subroutine init(this, bounds_proc, flandusepftdat) end if ! Retrieve the landuse x pft static data if the file is present - if (flandusepftdat /= '') then + if (use_fates_lupft) then call GetLandusePFTData(bounds_proc, flandusepftdat, landuse_pft_map, landuse_bareground) end if @@ -821,12 +815,12 @@ subroutine init(this, bounds_proc, flandusepftdat) this%fates(nc)%sites(s)%lon = grc%londeg(g) ! Transfer the landuse x pft data to fates via bc_in if file is given - if (flandusepftdat /= '') then + if (use_fates_lupft) then this%fates(nc)%bc_in(s)%pft_areafrac_lu(:,1:num_landuse_pft_vars) = landuse_pft_map(g,:,1:num_landuse_pft_vars) this%fates(nc)%bc_in(s)%baregroundfrac = landuse_bareground(g) end if - if (flandusepftdat == '') then + if (.not. use_fates_lupft) then ! initialize static layers for reduced complexity FATES versions from HLM ! maybe make this into a subroutine of it's own later. this%fates(nc)%bc_in(s)%pft_areafrac(:)=0._r8 @@ -882,7 +876,7 @@ subroutine init(this, bounds_proc, flandusepftdat) call create_fates_fire_data_method( this%fates_fire_data_method ) ! deallocate the local landuse x pft array - if (flandusepftdat /= '') then + if (use_fates_lupft) then deallocate(landuse_pft_map) deallocate(landuse_bareground) end if From 5d11bcf5c1ad64bb8898e54f15852315439c5d57 Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Wed, 1 May 2024 15:52:27 -0700 Subject: [PATCH 0156/1248] add fates use_potentialveg namelist defaults settings and checks --- bld/CLMBuildNamelist.pm | 13 ++++++++++++- bld/namelist_files/namelist_defaults_ctsm.xml | 9 +++++---- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index 021381a18e..7999e9a31d 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -4455,7 +4455,18 @@ sub setup_logic_fates { add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, $var, 'phys'=>$nl_flags->{'phys'}, 'hgrid'=>$nl_flags->{'res'}, 'sim_year_range'=>$nl_flags->{'sim_year_range'}, nofail=>1 ); } } - + # check that fates landuse is on and harvest mode is off when potential veg switch is true + my $var = "use_potentialveg"; + if ( defined($nl->get_value($var)) ) { + if ( &value_is_true($nl->get_value($var)) ) { + if ( ! &value_is_true($nl->get_value('use_fates_luh')) ) { + fatal_error("use_fates_luh must be true when $var is true" ); + } + if ( $nl->get_value('fates_harvest_mode') > 0) { + fatal_error("fates_harvest_mode must be off (i.e. set to zero) when $var is true" ); + } + } + } # Check fates_harvest_mode compatibility my $var = "fates_harvest_mode"; if ( defined($nl->get_value($var)) ) { diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index 49109c6591..68a122e9bc 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -2769,10 +2769,11 @@ use_crop=".true.">lnd/clm2/surfdata_map/ctsm5.1.dev052/landuse.timeseries_mpasa1 .false. .false. .false. -.true. -.true. -.true. -.false. +.true. +.true. +.true. +.true. +.false. 1 0 From f0f2b9e17c17cc095832e4439313192fdea28a75 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Wed, 1 May 2024 16:58:18 -0600 Subject: [PATCH 0157/1248] Additional conflict resolution in testlist_clm.xml --- cime_config/testdefs/testlist_clm.xml | 35 +-------------------------- 1 file changed, 1 insertion(+), 34 deletions(-) diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index d3ee1eae35..ff3d113c53 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -955,14 +955,6 @@ - - - - - - - - @@ -981,14 +973,6 @@ - - - - - - - - @@ -1062,15 +1046,6 @@ - - - - - - - - - @@ -1088,14 +1063,6 @@ - - - - - - - - @@ -2875,7 +2842,7 @@ - + From 4c07dcc2a5079a0d30cca0c520632f24925ea789 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 1 May 2024 18:50:43 -0600 Subject: [PATCH 0158/1248] Add basic script to compare testlist baseline lnd_in files --- bld/unit_testers/cmp_baseline_lnd_in_files.sh | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100755 bld/unit_testers/cmp_baseline_lnd_in_files.sh diff --git a/bld/unit_testers/cmp_baseline_lnd_in_files.sh b/bld/unit_testers/cmp_baseline_lnd_in_files.sh new file mode 100755 index 0000000000..de32cddf76 --- /dev/null +++ b/bld/unit_testers/cmp_baseline_lnd_in_files.sh @@ -0,0 +1,46 @@ +#!/bin/bash + +baseline=$1 +compare=$2 + +cwd=`pwd` +if [ -z "$1" ]; then + echo "Need to enter a baseline directory tag name" + exit 1 +fi +if [ -z "$2" ]; then + echo "Need to enter a comparison directory tag name" + exit 1 +fi + +BASELINE_ROOT=/glade/campaign/cgd/tss/ctsm_baselines +root=$BASELINE_ROOT/$baseline +if ! test -d "$root"; then + echo "Root directory of $root does NOT exist" + exit 1 +fi +comp_root=$BASELINE_ROOT/$compare +if ! test -d "$comp_root"; then + echo "Root comparison directory of $comp_root does NOT exist" + exit 1 +fi +cd $root +filepat="*" +dirnames=($filepat) +if [ "${filenames[*]}" = "$filepat" ]; then + echo "No directoctories exist in this directory" + exit 1 +fi +for dir in ${dirnames[*]} +do + echo $dir + base=$dir/CaseDocs/lnd_in + comp=$BASELINE_ROOT/$compare/$dir/CaseDocs/lnd_in + if ! test -f "$base"; then + echo "$base, does NOT exist, skipping" + elif ! test -f "$comp"; then + echo "$comp, does NOT exist, skipping" + else + $cwd/../../cime/CIME/Tools/compare_namelists $base $comp + fi +done From 5192bd1520f93a00f085d31b266e3913f722652e Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 1 May 2024 22:16:32 -0600 Subject: [PATCH 0159/1248] Fix for #2504 so tests of use-cases is done, and also done over all physics options --- bld/unit_testers/build-namelist_test.pl | 44 +++++++++++++++---------- 1 file changed, 26 insertions(+), 18 deletions(-) diff --git a/bld/unit_testers/build-namelist_test.pl b/bld/unit_testers/build-namelist_test.pl index 7b654337af..74dbcef3f4 100755 --- a/bld/unit_testers/build-namelist_test.pl +++ b/bld/unit_testers/build-namelist_test.pl @@ -163,10 +163,10 @@ sub cat_and_create_namelistinfile { # # Figure out number of tests that will run # -my $ntests = 2513; +my $ntests = 3665; if ( defined($opts{'compare'}) ) { - $ntests += 1545; + $ntests += 2313; } plan( tests=>$ntests ); @@ -1421,32 +1421,40 @@ sub cat_and_create_namelistinfile { } print "\n==================================================\n"; -print " Rest all use-cases \n"; +print " Test all use-cases over all physics options\n"; print "==================================================\n"; # Run over all use-cases... my $list = `$bldnml -use_case list 2>&1 | grep "use case"`; my @usecases; if ( $list =~ /build-namelist : use cases : (.+)$/ ) { - my @usecases = split( / /, $list ); + @usecases = split( / /, $1 ); } else { die "ERROR:: Trouble getting list of use-cases\n"; } -foreach my $usecase ( @usecases ) { - $options = "-use_case $usecase -envxml_dir ."; - &make_env_run(); - eval{ system( "$bldnml $options > $tempfile 2>&1 " ); }; - is( $@, '', "options: $options" ); - $cfiles->checkfilesexist( "$options", $mode ); - $cfiles->shownmldiff( "default", "standard" ); - if ( defined($opts{'compare'}) ) { - $cfiles->doNOTdodiffonfile( "$tempfile", "$options", $mode ); - $cfiles->comparefiles( "$options", $mode, $opts{'compare'} ); - } - if ( defined($opts{'generate'}) ) { - $cfiles->copyfiles( "$options", $mode ); +if ( $#usecases != 15 ) { + print "use-cases = @usecases\n"; + die "ERROR:: Number of use-cases isn't what's expected\n"; +} +foreach my $phys ( "clm4_5", "clm5_0", "clm5_1", "clm6_0" ) { + print "physics = $phys\n"; + foreach my $usecase ( @usecases ) { + print "usecase = $usecase\n"; + $options = "-use_case $usecase -envxml_dir ."; + &make_env_run(); + eval{ system( "$bldnml $options > $tempfile 2>&1 " ); }; + is( $@, '', "options: $options" ); + $cfiles->checkfilesexist( "$options", $mode ); + $cfiles->shownmldiff( "default", "standard" ); + if ( defined($opts{'compare'}) ) { + $cfiles->doNOTdodiffonfile( "$tempfile", "$options", $mode ); + $cfiles->comparefiles( "$options", $mode, $opts{'compare'} ); + } + if ( defined($opts{'generate'}) ) { + $cfiles->copyfiles( "$options", $mode ); + } + &cleanup(); } - &cleanup(); } print "\n==================================================\n"; From 480ae1b5ce1557f1848447bd8981690a25bbeaa1 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Thu, 2 May 2024 00:53:17 -0600 Subject: [PATCH 0160/1248] Simplify and correct the use-cases, with this the difference between clm5_1 and clm6_0 physics options is only the params_file which is what's expected this finishes out issues in #2492 --- bld/namelist_files/use_cases/1850_control.xml | 45 +++------------ .../use_cases/1850_noanthro_control.xml | 33 ++--------- bld/namelist_files/use_cases/2000_control.xml | 38 +++---------- bld/namelist_files/use_cases/2010_control.xml | 45 +++------------ .../use_cases/20thC_transient.xml | 56 +++++-------------- bld/namelist_files/use_cases/stdurbpt_pd.xml | 8 +-- 6 files changed, 50 insertions(+), 175 deletions(-) diff --git a/bld/namelist_files/use_cases/1850_control.xml b/bld/namelist_files/use_cases/1850_control.xml index 94ee8c5d0d..6ea033629f 100644 --- a/bld/namelist_files/use_cases/1850_control.xml +++ b/bld/namelist_files/use_cases/1850_control.xml @@ -8,47 +8,18 @@ constant -.false. -.false. -.false. +.false. -1850 -1850 +1850 +1850 -1850 -1850 +1850 +1850 -1850 -1850 +1850 +1850 -1850 -1850 - -1850 -1850 - -1850 -1850 - -1850 -1850 - -1850 -1850 - -1850 -1850 - -lnd/clm2/ndepdata/fndep_clm_WACCM6_CMIP6piControl001_y21-50avg_1850monthly_0.95x1.25_c180802.nc - -lnd/clm2/ndepdata/fndep_clm_WACCM6_CMIP6piControl001_y21-50avg_1850monthly_0.95x1.25_c180802.nc - -lnd/clm2/ndepdata/fndep_clm_WACCM6_CMIP6piControl001_y21-50avg_1850monthly_0.95x1.25_c180802.nc - -cycle -cycle diff --git a/bld/namelist_files/use_cases/1850_noanthro_control.xml b/bld/namelist_files/use_cases/1850_noanthro_control.xml index 636164a729..d84903f43c 100644 --- a/bld/namelist_files/use_cases/1850_noanthro_control.xml +++ b/bld/namelist_files/use_cases/1850_noanthro_control.xml @@ -10,26 +10,11 @@ .false. -1850 -1850 +1850 +1850 -1850 -1850 - -1850 -1850 - -cycle -cycle - -1925 -1925 - -1925 -1925 - -1925 -1925 +1925 +1925 none nn -1850 -1850 - -1850 -1850 - -1850 -1850 +1850 +1850 NONE diff --git a/bld/namelist_files/use_cases/2000_control.xml b/bld/namelist_files/use_cases/2000_control.xml index f3c4980fc8..2fce7c5cce 100644 --- a/bld/namelist_files/use_cases/2000_control.xml +++ b/bld/namelist_files/use_cases/2000_control.xml @@ -8,37 +8,17 @@ constant -.true. -.false. -.true. -.false. -.false. +.true. +.false. +.false. -2000 -2000 +2000 +2000 -2000 -2000 +2000 +2000 -2000 -2000 - -2000 -2000 - -2000 -2000 - -2000 -2000 - -2000 -2000 - -2000 -2000 - -2000 -2000 +2000 +2000 diff --git a/bld/namelist_files/use_cases/2010_control.xml b/bld/namelist_files/use_cases/2010_control.xml index 9316ecfb7f..d4c2a9c9c0 100644 --- a/bld/namelist_files/use_cases/2010_control.xml +++ b/bld/namelist_files/use_cases/2010_control.xml @@ -8,44 +8,17 @@ constant -.true. -.true. -.false. -.true. -.false. -.false. +.true. +.true. +.false. -2010 -2010 +2010 +2010 -2010 -2010 +2010 +2010 -2010 -2010 - -2010 -2010 - -2010 -2010 - -2010 -2010 - -2010 -2010 - -2010 -2010 - -2010 -2010 - -2010 -2010 - -2010 -2010 +2010 +2010 diff --git a/bld/namelist_files/use_cases/20thC_transient.xml b/bld/namelist_files/use_cases/20thC_transient.xml index d6dd729b35..b88ca3d3b1 100644 --- a/bld/namelist_files/use_cases/20thC_transient.xml +++ b/bld/namelist_files/use_cases/20thC_transient.xml @@ -18,46 +18,20 @@ flanduse_timeseries -.true. -.false. -.true. -.false. -.false. - -1850 -2015 -1850 - -1850 -2015 -1850 - -1850 -2015 -1850 - -1850 -2016 -1850 - -1850 -2016 -1850 - -1850 -2016 -1850 - -1850 -2106 -1850 - -1850 -2106 -1850 - -1850 -2106 -1850 +.true. +.false. +.false. + +1850 +2015 +1850 + +1850 +2016 +1850 + +1850 +2106 +1850 diff --git a/bld/namelist_files/use_cases/stdurbpt_pd.xml b/bld/namelist_files/use_cases/stdurbpt_pd.xml index 65786f32ae..6f5e754ba0 100644 --- a/bld/namelist_files/use_cases/stdurbpt_pd.xml +++ b/bld/namelist_files/use_cases/stdurbpt_pd.xml @@ -18,10 +18,8 @@ 'OFF' -.true. -.false. -.true. -.false. -.false. +.true. +.false. +.false. From 3900cc438ca9888efa1ae5c31adf7eeab3b0ff49 Mon Sep 17 00:00:00 2001 From: Keith Oleson Date: Thu, 2 May 2024 10:09:05 -0600 Subject: [PATCH 0161/1248] Fix RH2M_R long_name --- src/biogeophys/WaterDiagnosticBulkType.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/biogeophys/WaterDiagnosticBulkType.F90 b/src/biogeophys/WaterDiagnosticBulkType.F90 index dd556a2df6..f91aaca761 100644 --- a/src/biogeophys/WaterDiagnosticBulkType.F90 +++ b/src/biogeophys/WaterDiagnosticBulkType.F90 @@ -346,7 +346,7 @@ subroutine InitBulkHistory(this, bounds) fname=this%info%fname('RH2M_R'), & units='%', & avgflag='A', & - long_name=this%info%lname('Rural 2m specific humidity'), & + long_name=this%info%lname('Rural 2m relative humidity'), & ptr_patch=this%rh_ref2m_r_patch, set_spec=spval, default='inactive') this%rh_ref2m_u_patch(begp:endp) = spval From feda43c5c4199a1b2981980502a23f7ee489fefa Mon Sep 17 00:00:00 2001 From: Keith Oleson Date: Thu, 2 May 2024 11:57:16 -0600 Subject: [PATCH 0162/1248] Fix long name for AZSUN --- src/biogeophys/SurfaceAlbedoType.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/biogeophys/SurfaceAlbedoType.F90 b/src/biogeophys/SurfaceAlbedoType.F90 index ddb57d88f7..e90caeecbb 100644 --- a/src/biogeophys/SurfaceAlbedoType.F90 +++ b/src/biogeophys/SurfaceAlbedoType.F90 @@ -226,7 +226,7 @@ subroutine InitHistory(this, bounds) this%azsun_grc(begg:endg) = spval call hist_addfld1d (fname='AZSUN', units='radians', & - avgflag='A', long_name='cosine of solar zenith angle', & + avgflag='A', long_name='azimuth angle of the sun', & ptr_lnd=this%azsun_grc, default='inactive') this%coszen_grc(begg:endg) = spval From 3cc33e59813be988d983cfca47f2e9ef99819f1d Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Thu, 2 May 2024 12:24:55 -0600 Subject: [PATCH 0163/1248] Update test to use a valid compset --- cime_config/testdefs/testlist_clm.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index ff3d113c53..cfd81a5a2b 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -830,7 +830,7 @@ - + From 6bd7d37a956edb0fc2bb20f7d593c64e4fa6eb0c Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Thu, 2 May 2024 11:49:28 -0700 Subject: [PATCH 0164/1248] add use_fates_lupft to default namelist --- bld/CLMBuildNamelist.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index 7999e9a31d..23505492bd 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -785,7 +785,7 @@ sub setup_cmdl_fates_mode { "use_fates_cohort_age_tracking","use_fates_inventory_init","use_fates_fixed_biogeog", "use_fates_nocomp","use_fates_sp","fates_inventory_ctrl_filename","fates_harvest_mode", "fates_parteh_mode","use_fates_tree_damage","fates_seeddisp_cadence","use_fates_luh","fluh_timeseries","flandusepftdat", - "use_fates_potentialveg"); + "use_fates_potentialveg","use_fates_lupft"); # dis-allow fates specific namelist items with non-fates runs foreach my $var ( @list ) { if ( defined($nl->get_value($var)) ) { @@ -4371,7 +4371,8 @@ sub setup_logic_fates { add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'fates_paramfile', 'phys'=>$nl_flags->{'phys'}); my @list = ( "fates_spitfire_mode", "use_fates_planthydro", "use_fates_ed_st3", "use_fates_ed_prescribed_phys", "use_fates_inventory_init","use_fates_fixed_biogeog","use_fates_nocomp","fates_seeddisp_cadence", - "fates_harvest_mode","fates_parteh_mode", "use_fates_cohort_age_tracking","use_fates_tree_damage","use_fates_luh" ); + "fates_harvest_mode","fates_parteh_mode", "use_fates_cohort_age_tracking","use_fates_tree_damage", + "use_fates_luh","use_fates_lupft" ); foreach my $var ( @list ) { add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, $var, 'use_fates'=>$nl_flags->{'use_fates'}, 'use_fates_sp'=>$nl_flags->{'use_fates_sp'} ); From 115281fde88bb91999609d77511a8b41df33d403 Mon Sep 17 00:00:00 2001 From: Keith Oleson Date: Thu, 2 May 2024 13:00:00 -0600 Subject: [PATCH 0165/1248] Updates to history field list documentation in User's Guide --- .../history_fields_fates.rst | 158 +++++++++++------- .../history_fields_nofates.rst | 56 +++++-- 2 files changed, 144 insertions(+), 70 deletions(-) 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 ec10de5080..84caf92465 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 @@ -1,18 +1,18 @@ ============================= CTSM History Fields (fates) ============================= - + CAUTION: Not all variables are relevant / present for all CTSM cases. Key flags used in this CTSM case: use_cn = F use_crop = F use_fates = T - -=================================== ================ ============================================================================================== ================================================================= ======= + +=================================== ================ ============================================================================================== ================================================================= ======= CTSM History Fields ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Variable Name Level Dim. Long Description Units Active? -=================================== ================ ============================================================================================== ================================================================= ======= +=================================== ================ ============================================================================================== ================================================================= ======= A5TMIN - 5-day running mean of min 2-m temperature K F ACTUAL_IMMOB - actual N immobilization gN/m^2/s T AGLB - Aboveground leaf biomass kg/m^2 F @@ -22,13 +22,27 @@ ALTMAX - maximum annual active layer ALTMAX_LASTYEAR - maximum prior year active layer thickness m F ATM_O3 - atmospheric ozone partial pressure mol/mol F ATM_TOPO - atmospheric surface height m T +AZSUN - azimuth angle of the sun radians F AnnET - Annual ET mm/s F BCDEP - total BC deposition (dry+wet) from atmosphere kg/m^2/s T +BCPHIDRY - black carbon deposition (phidry) from atmosphere kg/m^2/s F +BCPHIWET - black carbon deposition (phiwet) from atmosphere kg/m^2/s F +BCPHODRY - black carbon deposition (phodry) from atmosphere kg/m^2/s F BTRAN - transpiration beta factor unitless T BTRANMN - daily minimum of transpiration beta factor unitless T +CH4PROD - Gridcell total production of CH4 gC/m2/s T +CH4_EBUL_TOTAL_SAT - ebullition surface CH4 flux; (+ to atm) mol/m2/s F +CH4_EBUL_TOTAL_UNSAT - ebullition surface CH4 flux; (+ to atm) mol/m2/s F +CH4_SURF_AERE_SAT - aerenchyma surface CH4 flux for inundated area; (+ to atm) mol/m2/s T +CH4_SURF_AERE_UNSAT - aerenchyma surface CH4 flux for non-inundated area; (+ to atm) mol/m2/s T +CH4_SURF_DIFF_SAT - diffusive surface CH4 flux for inundated / lake area; (+ to atm) mol/m2/s T +CH4_SURF_DIFF_UNSAT - diffusive surface CH4 flux for non-inundated area; (+ to atm) mol/m2/s T +CH4_SURF_EBUL_SAT - ebullition surface CH4 flux for inundated / lake area; (+ to atm) mol/m2/s T +CH4_SURF_EBUL_UNSAT - ebullition surface CH4 flux for non-inundated area; (+ to atm) mol/m2/s T COL_CTRUNC - column-level sink for C truncation gC/m^2 F COL_NTRUNC - column-level sink for N truncation gN/m^2 F -COSZEN - cosine of solar zenith angle none F +COSZEN - cosine of solar zenith angle (downscaled if downscaling is activated) none F +COSZEN_GRC - cosine of solar zenith angle none F CROPPROD1C - 1-yr crop product (grain+biofuel) C gC/m^2 T CROPPROD1C_LOSS - loss from 1-yr crop product pool gC/m^2/s T CROPPROD1N - 1-yr crop product (grain+biofuel) N gN/m^2 T @@ -43,7 +57,15 @@ DPVLTRB3 - turbulent deposition veloci DPVLTRB4 - turbulent deposition velocity 4 m/s F DSL - dry surface layer thickness mm T DSTDEP - total dust deposition (dry+wet) from atmosphere kg/m^2/s T +DSTDRY1 - dust deposition (dry1) from atmosphere kg/m^2/s F +DSTDRY2 - dust deposition (dry2) from atmosphere kg/m^2/s F +DSTDRY3 - dust deposition (dry3) from atmosphere kg/m^2/s F +DSTDRY4 - dust deposition (dry4) from atmosphere kg/m^2/s F DSTFLXT - total surface dust emission kg/m2/s T +DSTWET1 - dust deposition (wet1) from atmosphere kg/m^2/s F +DSTWET2 - dust deposition (wet2) from atmosphere kg/m^2/s F +DSTWET3 - dust deposition (wet3) from atmosphere kg/m^2/s F +DSTWET4 - dust deposition (wet4) from atmosphere kg/m^2/s F DWT_CROPPROD1C_GAIN - landcover change-driven addition to 1-year crop product pool gC/m^2/s T DWT_CROPPROD1N_GAIN - landcover change-driven addition to 1-year crop product pool gN/m^2/s T DWT_PROD100C_GAIN - landcover change-driven addition to 100-yr wood product pool gC/m^2/s F @@ -52,6 +74,7 @@ DWT_PROD10C_GAIN - landcover change-driven add DWT_PROD10N_GAIN - landcover change-driven addition to 10-yr wood product pool gN/m^2/s F DWT_WOODPRODC_GAIN - landcover change-driven addition to wood product pools gC/m^2/s T DWT_WOODPRODN_GAIN - landcover change-driven addition to wood product pools gN/m^2/s T +DYN_COL_ADJUSTMENTS_CH4 - Adjustments in ch4 due to dynamic column areas; only makes sense at the column level: should n gC/m^2 F DYN_COL_SOIL_ADJUSTMENTS_C - Adjustments in soil carbon due to dynamic column areas; only makes sense at the column level: gC/m^2 F DYN_COL_SOIL_ADJUSTMENTS_N - Adjustments in soil nitrogen due to dynamic column areas; only makes sense at the column level gN/m^2 F DYN_COL_SOIL_ADJUSTMENTS_NH4 - Adjustments in soil NH4 due to dynamic column areas; only makes sense at the column level: sho gN/m^2 F @@ -95,10 +118,6 @@ FATES_DAYSINCE_COLDLEAFON - site-level days elapsed sin FATES_DEMOTION_CARBONFLUX - demotion-associated biomass carbon flux from canopy to understory in kg carbon per m2 per seco kg m-2 s-1 T FATES_DISTURBANCE_RATE_FIRE - disturbance rate from fire m2 m-2 yr-1 T FATES_DISTURBANCE_RATE_LOGGING - disturbance rate from logging m2 m-2 yr-1 T -FATES_DISTURBANCE_RATE_P2P - disturbance rate from primary to primary lands m2 m-2 yr-1 T -FATES_DISTURBANCE_RATE_P2S - disturbance rate from primary to secondary lands m2 m-2 yr-1 T -FATES_DISTURBANCE_RATE_POTENTIAL - potential (i.e., including unresolved) disturbance rate m2 m-2 yr-1 T -FATES_DISTURBANCE_RATE_S2S - disturbance rate from secondary to secondary lands m2 m-2 yr-1 T FATES_DISTURBANCE_RATE_TREEFALL - disturbance rate from treefall m2 m-2 yr-1 T FATES_EFFECT_WSPEED - effective wind speed for fire spread in meters per second m s-1 T FATES_EXCESS_RESP - respiration of un-allocatable carbon gain kg m-2 s-1 T @@ -128,6 +147,7 @@ FATES_HARVEST_DEBT - Accumulated carbon failed t FATES_HARVEST_DEBT_SEC - Accumulated carbon failed to be harvested from secondary patches kg C T FATES_HET_RESP - heterotrophic respiration in kg carbon per m2 per second kg m-2 s-1 T FATES_IGNITIONS - number of successful fire ignitions per m2 land area per second m-2 s-1 T +FATES_L2FR - The leaf to fineroot biomass multiplier for target allometry kg kg-1 T FATES_LAI - leaf area index per m2 land area m2 m-2 T FATES_LAI_SECONDARY - leaf area index per m2 land area, secondary patches m2 m-2 T FATES_LBLAYER_COND - mean leaf boundary layer conductance mol m-2 s-1 T @@ -139,7 +159,7 @@ FATES_LITTER_OUT - litter flux out in kg carbo FATES_LSTEMMAINTAR - live stem maintenance autotrophic respiration in kg carbon per m2 per second kg m-2 s-1 T FATES_MAINT_RESP - maintenance respiration in kg carbon per m2 land area per second kg m-2 s-1 T FATES_MAINT_RESP_SECONDARY - maintenance respiration in kg carbon per m2 land area per second, secondary patches kg m-2 s-1 T -FATES_MAINT_RESP_UNREDUCED - diagnostic maintenance respiration if the low-carbon-storage reduction is ignored kg m-2 s-1 F +FATES_MAINT_RESP_UNREDUCED - diagnostic maintenance respiration if the low-carbon-storage reduction is ignored kg m-2 s-1 T FATES_MORTALITY_CFLUX_CANOPY - flux of biomass carbon from live to dead pools from mortality of canopy plants in kg carbon pe kg m-2 s-1 T FATES_MORTALITY_CFLUX_USTORY - flux of biomass carbon from live to dead pools from mortality of understory plants in kg carbo kg m-2 s-1 T FATES_NCHILLDAYS - site-level number of chill days days T @@ -148,6 +168,7 @@ FATES_NCOHORTS_SECONDARY - total number of cohorts per FATES_NCOLDDAYS - site-level number of cold days days T FATES_NEP - net ecosystem production in kg carbon per m2 per second kg m-2 s-1 T FATES_NESTEROV_INDEX - nesterov fire danger index T +FATES_NIR_RAD_ERROR - mean two-stream solver error for NIR - T FATES_NONSTRUCTC - non-structural biomass (sapwood + leaf + fineroot) in kg carbon per m2 kg m-2 T FATES_NPATCHES - total number of patches per site T FATES_NPATCHES_SECONDARY - total number of patches per site T @@ -155,7 +176,6 @@ FATES_NPP - net primary production in k FATES_NPP_SECONDARY - net primary production in kg carbon per m2 per second, secondary patches kg m-2 s-1 T FATES_PRIMARY_PATCHFUSION_ERR - error in total primary lands associated with patch fusion m2 m-2 yr-1 T FATES_PROMOTION_CARBONFLUX - promotion-associated biomass carbon flux from understory to canopy in kg carbon per m2 per sec kg m-2 s-1 T -FATES_RAD_ERROR - radiation error in FATES RTM W m-2 T FATES_REPROC - total biomass in live plant reproductive tissues in kg carbon per m2 kg m-2 T FATES_ROS - fire rate of spread in meters per second m s-1 T FATES_SAPWOODC - total biomass in live plant sapwood in kg carbon per m2 kg m-2 T @@ -181,8 +201,12 @@ FATES_UNGERM_SEED_BANK - ungerminated seed mass of a FATES_USTORY_VEGC - biomass of understory plants in kg carbon per m2 land area kg m-2 T FATES_VEGC - total biomass in live plants in kg carbon per m2 land area kg m-2 T FATES_VEGC_ABOVEGROUND - aboveground biomass in kg carbon per m2 land area kg m-2 T +FATES_VIS_RAD_ERROR - mean two-stream solver error for VIS - T FATES_WOOD_PRODUCT - total wood product from logging in kg carbon per m2 land area kg m-2 T FCEV - canopy evaporation W/m^2 T +FCH4 - Gridcell surface CH4 flux to atmosphere (+ to atm) kgC/m2/s T +FCH4TOCO2 - Gridcell oxidation of CH4 to CO2 gC/m2/s T +FCH4_DFSAT - CH4 additional flux due to changing fsat, natural vegetated and crop landunits only kgC/m2/s T FCO2 - CO2 flux to atmosphere (+ to atm) kgCO2/m2/s F FCOV - fractional impermeable area unitless T FCTR - canopy transpiration W/m^2 T @@ -194,6 +218,8 @@ FGR_R - Rural heat flux into soil/s FGR_U - Urban heat flux into soil/snow including snow melt W/m^2 F FH2OSFC - fraction of ground covered by surface water unitless T FH2OSFC_NOSNOW - fraction of ground covered by surface water (if no snow present) unitless F +FINUNDATED - fractional inundated area of vegetated columns unitless T +FINUNDATED_LAG - time-lagged inundated fraction of vegetated columns unitless F FIRA - net infrared (longwave) radiation W/m^2 T FIRA_ICE - net infrared (longwave) radiation (ice landunits only) W/m^2 F FIRA_R - Rural net infrared (longwave) radiation W/m^2 T @@ -202,8 +228,9 @@ FIRE - emitted infrared (longwave) FIRE_ICE - emitted infrared (longwave) radiation (ice landunits only) W/m^2 F FIRE_R - Rural emitted infrared (longwave) radiation W/m^2 T FIRE_U - Urban emitted infrared (longwave) radiation W/m^2 F -FLDS - atmospheric longwave radiation (downscaled to columns in glacier regions) W/m^2 T -FLDS_ICE - atmospheric longwave radiation (downscaled to columns in glacier regions) (ice landunits only) W/m^2 F +FLDS - atmospheric longwave radiation (downscaled for glacier and hillslope columns) W/m^2 T +FLDS_ICE - atmospheric longwave radiation (downscaled for glacier and hillslope columns) (ice landunits o W/m^2 F +FLDS_NOT_DOWNSCALED - atmospheric longwave radiation (pre-downscaling) W/m^2 F FPG - fraction of potential gpp proportion T FPI - fraction of potential immobilization proportion T FROST_TABLE - frost table depth (natural vegetated and crop landunits only) m F @@ -214,7 +241,7 @@ FSA_R - Rural absorbed solar radiat FSA_U - Urban absorbed solar radiation W/m^2 F FSD24 - direct radiation (last 24hrs) K F FSD240 - direct radiation (last 240hrs) K F -FSDS - atmospheric incident solar radiation W/m^2 T +FSDS - atmospheric incident solar radiation (downscaled for glacier and hillslope columns) W/m^2 T FSDSND - direct nir incident solar radiation W/m^2 T FSDSNDLN - direct nir incident solar radiation at local noon W/m^2 T FSDSNI - diffuse nir incident solar radiation W/m^2 T @@ -222,6 +249,7 @@ FSDSVD - direct vis incident solar r FSDSVDLN - direct vis incident solar radiation at local noon W/m^2 T FSDSVI - diffuse vis incident solar radiation W/m^2 T FSDSVILN - diffuse vis incident solar radiation at local noon W/m^2 T +FSDS_from_atm - atmospheric incident solar radiation received from atmosphere (pre-downscaling) W/m^2 T FSH - sensible heat not including correction for land use change and rain/snow conversion W/m^2 T FSH_G - sensible heat from ground W/m^2 T FSH_ICE - sensible heat not including correction for land use change and rain/snow conversion (ice landu W/m^2 F @@ -320,7 +348,7 @@ LIT_MET_N - LIT_MET N LIT_MET_N_1m - LIT_MET N to 1 meter gN/m^2 F LIT_MET_N_TO_SOM_ACT_N - decomp. of metabolic litter N to active soil organic N gN/m^2 F LNC - leaf N concentration gN leaf/m^2 T -LWdown - atmospheric longwave radiation (downscaled to columns in glacier regions) W/m^2 F +LWdown - atmospheric longwave radiation (downscaled for glacier and hillslope columns) W/m^2 F LWup - upwelling longwave radiation W/m^2 F MORTALITY_CROWNAREA_CANOPY - Crown area of canopy trees that died m2/ha/year T MORTALITY_CROWNAREA_UNDERSTORY - Crown aera of understory trees that died m2/ha/year T @@ -337,13 +365,19 @@ M_SOM_PAS_N_TO_LEACHING - passive soil organic N leac M_SOM_SLO_C_TO_LEACHING - slow soil organic ma C leaching loss gC/m^2/s F M_SOM_SLO_N_TO_LEACHING - slow soil organic ma N leaching loss gN/m^2/s F NDEP_TO_SMINN - atmospheric N deposition to soil mineral N gN/m^2/s T +NEM - Gridcell net adjustment to net carbon exchange passed to atm. for methane production gC/m2/s T NET_NMIN - net rate of N mineralization gN/m^2/s T NFIX_TO_SMINN - symbiotic/asymbiotic N fixation to soil mineral N gN/m^2/s T NSUBSTEPS - number of adaptive timesteps in CLM timestep unitless F OBU - Monin-Obukhov length m F OCDEP - total OC deposition (dry+wet) from atmosphere kg/m^2/s T +OCPHIDRY - organic carbon deposition (phidry) from atmosphere kg/m^2/s F +OCPHIWET - organic carbon deposition (phiwet) from atmosphere kg/m^2/s F +OCPHODRY - black carbon deposition (phodry) from atmosphere kg/m^2/s F PARVEGLN - absorbed par by vegetation at local noon W/m^2 T -PBOT - atmospheric pressure at surface (downscaled to columns in glacier regions) Pa T +PBOT - atmospheric pressure at surface (downscaled for glacier and hillslope columns) Pa T +PBOT_NOT_DOWNSCALED - atmospheric pressure at surface (pre-downscaling) Pa F +PCH4 - atmospheric partial pressure of CH4 Pa T PCO2 - atmospheric partial pressure of CO2 Pa T POTENTIAL_IMMOB - potential N immobilization gN/m^2/s T POT_F_DENIT - potential denitrification flux gN/m^2/s T @@ -356,10 +390,11 @@ PROD10C - 10-yr wood product C PROD10C_LOSS - loss from 10-yr wood product pool gC/m^2/s F PROD10N - 10-yr wood product N gN/m^2 F PROD10N_LOSS - loss from 10-yr wood product pool gN/m^2/s F -PSurf - atmospheric pressure at surface (downscaled to columns in glacier regions) Pa F +PSurf - atmospheric pressure at surface (downscaled for glacier and hillslope columns) Pa F Q2M - 2m specific humidity kg/kg T QAF - canopy air humidity kg/kg F QBOT - atmospheric specific humidity (downscaled to columns in glacier regions) kg/kg T +QBOT_NOT_DOWNSCALED - atmospheric specific humidity (pre-downscaling) kg/kg F QDIRECT_THROUGHFALL - direct throughfall of liquid (rain + above-canopy irrigation) mm/s F QDIRECT_THROUGHFALL_SNOW - direct throughfall of snow mm/s F QDRAI - sub-surface drainage mm/s T @@ -396,6 +431,7 @@ QIRRIG_FROM_GW_UNCONFINED - water added through unconfi QIRRIG_FROM_SURFACE - water added through surface water irrigation mm/s T QIRRIG_SPRINKLER - water added via sprinkler irrigation mm/s F QOVER - total surface runoff (includes QH2OSFC) mm/s T +QOVER_LAG - time-lagged surface runoff for soil columns mm/s F QPHSNEG - net negative hydraulic redistribution flux mm/s F QRGWL - surface runoff at glaciers (liquid only), wetlands, lakes; also includes melted ice runoff fro mm/s T QRUNOFF - total liquid runoff not including correction for land use change mm/s T @@ -436,7 +472,7 @@ RAW2 - aerodynamical resistance RB - leaf boundary resistance s/m F RH - atmospheric relative humidity % F RH2M - 2m relative humidity % T -RH2M_R - Rural 2m specific humidity % F +RH2M_R - Rural 2m relative humidity % F RH2M_U - Urban 2m relative humidity % F RHAF - fractional humidity of canopy air fraction F RH_LEAF - fractional humidity at leaf surface fraction F @@ -444,6 +480,7 @@ RSCANOPY - canopy resistance RSSHA - shaded leaf stomatal resistance s/m T RSSUN - sunlit leaf stomatal resistance s/m T Rainf - atmospheric rain, after rain/snow repartitioning based on temperature mm/s F +Rho_from_atm - atmospheric density (pre-downscaling) kg/m^3 F Rnet - net radiation W/m^2 F SABG - solar rad absorbed by ground W/m^2 T SABG_PEN - Rural solar rad penetrating top soil or snow layer watt/m^2 T @@ -546,21 +583,24 @@ T10 - 10-day running mean of 2-m TAF - canopy air temperature K F TAUX - zonal surface stress kg/m/s^2 T TAUY - meridional surface stress kg/m/s^2 T -TBOT - atmospheric air temperature (downscaled to columns in glacier regions) K T +TBOT - atmospheric air temperature (downscaled for glacier and hillslope columns) K T TBUILD - internal urban building air temperature K T TBUILD_MAX - prescribed maximum interior building temperature K F +TDEPTH - tributary water depth m F +TDEPTHMAX - tributary bankfull water depth m F TFLOOR - floor temperature K F TG - ground temperature K T TG_ICE - ground temperature (ice landunits only) K F TG_R - Rural ground temperature K F TG_U - Urban ground temperature K F TH2OSFC - surface water temperature K T -THBOT - atmospheric air potential temperature (downscaled to columns in glacier regions) K T +THBOT - atmospheric air potential temperature (downscaled for glacier and hillslope columns) K T TKE1 - top lake level eddy thermal conductivity W/(mK) T TLAI - total projected leaf area index m^2/m^2 T TOPO_COL - column-level topographic height m F TOPO_COL_ICE - column-level topographic height (ice landunits only) m F TOTCOLC - total column carbon, incl veg and cpool but excl product pools gC/m^2 T +TOTCOLCH4 - total belowground CH4 (0 for non-lake special landunits in the absence of dynamic landunits) gC/m2 T TOTCOLN - total column-level N, excluding product pools gN/m^2 T TOTECOSYSC - total ecosystem carbon, incl veg but excl cpool and product pools gC/m^2 T TOTECOSYSN - total ecosystem N, excluding product pools gN/m^2 T @@ -600,8 +640,9 @@ TV - vegetation temperature TV24 - vegetation temperature (last 24hrs) K F TV240 - vegetation temperature (last 240hrs) K F TWS - total water storage mm T -Tair - atmospheric air temperature (downscaled to columns in glacier regions) K F +Tair - atmospheric air temperature (downscaled for glacier and hillslope columns) K F Tair_from_atm - atmospheric air temperature received from atmosphere (pre-downscaling) K F +Thair_from_atm - atmospheric air potential temperature (pre-downscaling) K F U10 - 10-m wind m/s T U10_DUST - 10-m wind for dust model m/s T U10_ICE - 10-m wind (ice landunits only) m/s F @@ -611,6 +652,7 @@ URBAN_AC - urban air conditioning flux URBAN_HEAT - urban heating flux W/m^2 T USTAR - aerodynamical resistance s/m F UST_LAKE - friction velocity (lakes only) m/s F +UWIND - atmospheric U wind velocity magnitude m/s F VA - atmospheric wind speed plus convective velocity m/s F VENTILATION - sensible heat flux from building ventilation W/m^2 T VOLR - river channel total water storage m3 T @@ -618,11 +660,13 @@ VOLRMCH - river channel main channel VPD - vpd Pa F VPD2M - 2m vapor pressure deficit Pa T VPD_CAN - canopy vapor pressure deficit kPa T +VWIND - atmospheric V wind velocity magnitude m/s F WASTEHEAT - sensible heat flux from heating/cooling sources of urban waste heat W/m^2 T WBT - 2 m Stull Wet Bulb C T WBT_R - Rural 2 m Stull Wet Bulb C T WBT_U - Urban 2 m Stull Wet Bulb C T WIND - atmospheric wind velocity magnitude m/s T +WTGQ - surface tracer conductance m/s T Wind - atmospheric wind velocity magnitude m/s F Z0HG - roughness length over ground, sensible heat (vegetated landunits only) m F Z0MG - roughness length over ground, momentum (vegetated landunits only) m F @@ -633,6 +677,7 @@ ZBOT - atmospheric reference heigh ZETA - dimensionless stability parameter unitless F ZII - convective boundary height m F ZWT - water table depth (natural vegetated and crop landunits only) m T +ZWT_CH4_UNSAT - depth of water table for methane production used in non-inundated area m T ZWT_PERCH - perched water table depth (natural vegetated and crop landunits only) m T num_iter - number of iterations unitless F QICE_FORC elevclas qice forcing sent to GLC mm/s F @@ -660,39 +705,28 @@ FATES_SCORCH_HEIGHT_APPF fates_levagepft SPITFIRE flame Scorch Heigh FATES_VEGC_APPF fates_levagepft biomass per PFT in each age bin in kg carbon per m2 kg m-2 F FATES_MORTALITY_AGESCEN_AC fates_levcacls age senescence mortality by cohort age in number of plants per m2 per year m-2 yr-1 T FATES_NPLANT_AC fates_levcacls number of plants per m2 by cohort age class m-2 T -FATES_CROWNAREA_CL fates_levcan total crown area in each canopy layer m2 m-2 T -FATES_FABD_SHA_TOPLF_CL fates_levcan shade fraction of direct light absorbed by the top leaf layer of each canopy layer 1 F -FATES_FABD_SUN_TOPLF_CL fates_levcan sun fraction of direct light absorbed by the top leaf layer of each canopy layer 1 F -FATES_FABI_SHA_TOPLF_CL fates_levcan shade fraction of indirect light absorbed by the top leaf layer of each canopy layer 1 F -FATES_FABI_SUN_TOPLF_CL fates_levcan sun fraction of indirect light absorbed by the top leaf layer of each canopy layer 1 F -FATES_LAISHA_TOP_CL fates_levcan LAI in the shade by the top leaf layer of each canopy layer m2 m-2 F -FATES_LAISUN_TOP_CL fates_levcan LAI in the sun by the top leaf layer of each canopy layer m2 m-2 F -FATES_PARSHA_Z_CL fates_levcan PAR absorbed in the shade by top leaf layer in each canopy layer W m-2 F -FATES_PARSUN_Z_CL fates_levcan PAR absorbed in the sun by top leaf layer in each canopy layer W m-2 F +FATES_CROWNAREA_CL fates_levcan area fraction of the canopy footprint occupied by each canopy-leaf layer m2 m-2 T +FATES_LAISHA_CL fates_levcan LAI of shaded leaves by canopy layer m2 m-2 F +FATES_LAISUN_CL fates_levcan LAI of sunlit leaves by canopy layer m2 m-2 F +FATES_PARSHA_CL fates_levcan PAR absorbed by shaded leaves in each canopy layer W m-2 F +FATES_PARSUN_CL fates_levcan PAR absorbed by sunlit leaves in each canopy layer W m-2 F FATES_MORTALITY_AGESCEN_ACPF fates_levcapf age senescence mortality by pft/cohort age in number of plants per m2 per year m-2 yr-1 F FATES_NPLANT_ACPF fates_levcapf stem number density by pft and age class m-2 F -FATES_CROWNAREA_CLLL fates_levcnlf total crown area that is occupied by leaves in each canopy and leaf layer m2 m-2 F -FATES_FABD_SHA_CLLL fates_levcnlf shade fraction of direct light absorbed by each canopy and leaf layer 1 F -FATES_FABD_SUN_CLLL fates_levcnlf sun fraction of direct light absorbed by each canopy and leaf layer 1 F -FATES_FABI_SHA_CLLL fates_levcnlf shade fraction of indirect light absorbed by each canopy and leaf layer 1 F -FATES_FABI_SUN_CLLL fates_levcnlf sun fraction of indirect light absorbed by each canopy and leaf layer 1 F -FATES_LAISHA_Z_CLLL fates_levcnlf LAI in the shade by each canopy and leaf layer m2 m-2 F -FATES_LAISUN_Z_CLLL fates_levcnlf LAI in the sun by each canopy and leaf layer m2 m-2 F +FATES_CROWNAREA_CLLL fates_levcnlf area fraction of the total ground occupied by each canopy-leaf layer m2 m-2 F +FATES_LAISHA_CLLL fates_levcnlf LAI in the shade by each canopy and leaf layer m2 m-2 F +FATES_LAISUN_CLLL fates_levcnlf LAI in the sun by each canopy and leaf layer m2 m-2 F FATES_NET_C_UPTAKE_CLLL fates_levcnlf net carbon uptake in kg carbon per m2 per second by each canopy and leaf layer per unit ground kg m-2 s-1 F FATES_PARPROF_DIF_CLLL fates_levcnlf radiative profile of diffuse PAR through each canopy and leaf layer (averaged across PFTs) W m-2 F FATES_PARPROF_DIR_CLLL fates_levcnlf radiative profile of direct PAR through each canopy and leaf layer (averaged across PFTs) W m-2 F -FATES_PARSHA_Z_CLLL fates_levcnlf PAR absorbed in the shade by each canopy and leaf layer W m-2 F -FATES_PARSUN_Z_CLLL fates_levcnlf PAR absorbed in the sun by each canopy and leaf layer W m-2 F -FATES_FABD_SHA_CLLLPF fates_levcnlfpf shade fraction of direct light absorbed by each canopy, leaf, and PFT 1 F -FATES_FABD_SUN_CLLLPF fates_levcnlfpf sun fraction of direct light absorbed by each canopy, leaf, and PFT 1 F -FATES_FABI_SHA_CLLLPF fates_levcnlfpf shade fraction of indirect light absorbed by each canopy, leaf, and PFT 1 F -FATES_FABI_SUN_CLLLPF fates_levcnlfpf sun fraction of indirect light absorbed by each canopy, leaf, and PFT 1 F -FATES_LAISHA_Z_CLLLPF fates_levcnlfpf LAI in the shade by each canopy, leaf, and PFT m2 m-2 F -FATES_LAISUN_Z_CLLLPF fates_levcnlfpf LAI in the sun by each canopy, leaf, and PFT m2 m-2 F +FATES_PARSHA_CLLL fates_levcnlf PAR absorbed in the shade by each canopy and leaf layer W m-2 F +FATES_PARSUN_CLLL fates_levcnlf PAR absorbed in the sun by each canopy and leaf layer W m-2 F +FATES_CROWNFRAC_CLLLPF fates_levcnlfpf area fraction of the canopy footprint occupied by each canopy-leaf-pft layer m2 m-2 F +FATES_LAISHA_CLLLPF fates_levcnlfpf Shaded leaf area by each canopy, leaf, and PFT m2 m-2 F +FATES_LAISUN_CLLLPF fates_levcnlfpf Sunlit leaf area by each canopy, leaf, and PFT m2 m-2 F FATES_PARPROF_DIF_CLLLPF fates_levcnlfpf radiative profile of diffuse PAR through each canopy, leaf, and PFT W m-2 F FATES_PARPROF_DIR_CLLLPF fates_levcnlfpf radiative profile of direct PAR through each canopy, leaf, and PFT W m-2 F -FATES_PARSHA_Z_CLLLPF fates_levcnlfpf PAR absorbed in the shade by each canopy, leaf, and PFT W m-2 F -FATES_PARSUN_Z_CLLLPF fates_levcnlfpf PAR absorbed in the sun by each canopy, leaf, and PFT W m-2 F +FATES_PARSHA_CLLLPF fates_levcnlfpf PAR absorbed in the shade by each canopy, leaf, and PFT W m-2 F +FATES_PARSUN_CLLLPF fates_levcnlfpf PAR absorbed in the sun by each canopy, leaf, and PFT W m-2 F FATES_CWD_ABOVEGROUND_DC fates_levcwdsc debris class-level aboveground coarse woody debris stocks in kg carbon per m2 kg m-2 F FATES_CWD_ABOVEGROUND_IN_DC fates_levcwdsc debris class-level aboveground coarse woody debris input in kg carbon per m2 per second kg m-2 s-1 F FATES_CWD_ABOVEGROUND_OUT_DC fates_levcwdsc debris class-level aboveground coarse woody debris output in kg carbon per m2 per second kg m-2 s-1 F @@ -718,6 +752,8 @@ FATES_FUEL_BURNT_BURNFRAC_FC fates_levfuel product of fraction (0-1) o FATES_FUEL_MOISTURE_FC fates_levfuel spitfire fuel class-level fuel moisture (volumetric) m3 m-3 T FATES_CANOPYAREA_HT fates_levheight canopy area height distribution m2 m-2 T FATES_LEAFAREA_HT fates_levheight leaf area height distribution m2 m-2 T +FATES_PATCHAREA_LU fates_levlanduse patch area by land use type m2 m-2 T +FATES_DISTURBANCE_RATE_MATRIX_LULU fates_levlulu disturbance rates by land use type x land use type matrix m2 m-2 yr-1 T FATES_CANOPYCROWNAREA_PF fates_levpft total PFT-level canopy-layer crown area per m2 land area m2 m-2 T FATES_CROWNAREA_PF fates_levpft total PFT-level crown area per m2 land area m2 m-2 T FATES_DAYSINCE_DROUGHTLEAFOFF_PF fates_levpft PFT-level days elapsed since drought leaf drop days T @@ -726,14 +762,17 @@ FATES_DROUGHT_STATUS_PF fates_levpft PFT-level drought status, < FATES_ELONG_FACTOR_PF fates_levpft PFT-level mean elongation factor (partial flushing/abscission) 1 T FATES_GPP_PF fates_levpft total PFT-level GPP in kg carbon per m2 land area per second kg m-2 s-1 T FATES_GPP_SE_PF fates_levpft total PFT-level GPP in kg carbon per m2 land area per second, secondary patches kg m-2 s-1 T +FATES_L2FR_CANOPY_REC_PF fates_levpft The leaf to fineroot biomass multiplier for recruits (canopy) kg kg-1 T +FATES_L2FR_USTORY_REC_PF fates_levpft The leaf to fineroot biomass multiplier for recruits (understory) kg kg-1 T FATES_LEAFC_PF fates_levpft total PFT-level leaf biomass in kg carbon per m2 land area kg m-2 T FATES_MEANLIQVOL_DROUGHTPHEN_PF fates_levpft PFT-level mean liquid water volume for drought phenolgy m3 m-3 T FATES_MEANSMP_DROUGHTPHEN_PF fates_levpft PFT-level mean soil matric potential for drought phenology Pa T FATES_MORTALITY_CFLUX_PF fates_levpft PFT-level flux of biomass carbon from live to dead pool from mortality kg m-2 s-1 T -FATES_MORTALITY_CSTARV_CFLUX_PF fates_levpft PFT-level flux of biomass carbon from live to dead pool from carbon starvation mortality kg m-2 s-1 T +FATES_MORTALITY_CSTARV_CFLUX_PF fates_levpft PFT-level flux of biomass carbon from live to dead pool from carbon starvation mortality (both kg m-2 s-1 T FATES_MORTALITY_FIRE_CFLUX_PF fates_levpft PFT-level flux of biomass carbon from live to dead pool from fire mortality kg m-2 s-1 T FATES_MORTALITY_HYDRO_CFLUX_PF fates_levpft PFT-level flux of biomass carbon from live to dead pool from hydraulic failure mortality kg m-2 s-1 T FATES_MORTALITY_PF fates_levpft PFT-level mortality rate in number of individuals per m2 land area per year m-2 yr-1 T +FATES_MORT_CSTARV_CONT_CFLUX_PF fates_levpft PFT-level flux of biomass carbon from live to dead pool from carbon starvation mortality (Cont kg m-2 s-1 T FATES_NPLANT_PF fates_levpft total PFT-level number of individuals per m2 land area m-2 T FATES_NPLANT_SEC_PF fates_levpft total PFT-level number of individuals per m2 land area, secondary patches m-2 T FATES_NPP_PF fates_levpft total PFT-level NPP in kg carbon per m2 land area per second kg m-2 s-1 T @@ -776,8 +815,8 @@ FATES_LEAF_ALLOC_CANOPY_SZ fates_levscls allocation to leaves for ca FATES_LEAF_ALLOC_USTORY_SZ fates_levscls allocation to leaves for understory plants by size class in kg carbon per m2 per second kg m-2 s-1 F FATES_LSTEMMAINTAR_CANOPY_SZ fates_levscls live stem maintenance autotrophic respiration for canopy plants in kg carbon per m2 per second kg m-2 s-1 F FATES_LSTEMMAINTAR_USTORY_SZ fates_levscls live stem maintenance autotrophic respiration for understory plants in kg carbon per m2 per se kg m-2 s-1 F -FATES_M3_MORTALITY_CANOPY_SZ fates_levscls C starvation mortality of canopy plants by size N/ha/yr F -FATES_M3_MORTALITY_USTORY_SZ fates_levscls C starvation mortality of understory plants by size N/ha/yr F +FATES_M3_MORTALITY_CANOPY_SZ fates_levscls C starvation mortality of canopy plants by size m-2 yr-1 F +FATES_M3_MORTALITY_USTORY_SZ fates_levscls C starvation mortality of understory plants by size m-2 yr-1 F FATES_MAINTAR_CANOPY_SZ fates_levscls maintenance autotrophic respiration of canopy plants in kg carbon per m2 per second by size kg m-2 s-1 F FATES_MAINTAR_USTORY_SZ fates_levscls maintenance autotrophic respiration of understory plants in kg carbon per m2 per second by siz kg m-2 s-1 F FATES_MORTALITY_AGESCEN_SE_SZ fates_levscls age senescence mortality by size in number of plants per m2 per year, secondary patches m-2 yr-1 T @@ -787,7 +826,7 @@ FATES_MORTALITY_BACKGROUND_SZ fates_levscls background mortality by siz FATES_MORTALITY_CANOPY_SE_SZ fates_levscls total mortality of canopy trees by size class in number of plants per m2, secondary patches m-2 yr-1 T FATES_MORTALITY_CANOPY_SZ fates_levscls total mortality of canopy trees by size class in number of plants per m2 m-2 yr-1 T FATES_MORTALITY_CSTARV_SE_SZ fates_levscls carbon starvation mortality by size in number of plants per m2 per year, secondary patches m-2 yr-1 T -FATES_MORTALITY_CSTARV_SZ fates_levscls carbon starvation mortality by size in number of plants per m2 per year m-2 yr-1 T +FATES_MORTALITY_CSTARV_SZ fates_levscls carbon starvation mortality by size in number of plants per m2 per year (both continous and te m-2 yr-1 T FATES_MORTALITY_FIRE_SZ fates_levscls fire mortality by size in number of plants per m2 per year m-2 yr-1 T FATES_MORTALITY_FREEZING_SE_SZ fates_levscls freezing mortality by size in number of plants per m2 per event, secondary patches m-2 event-1 T FATES_MORTALITY_FREEZING_SZ fates_levscls freezing mortality by size in number of plants per m2 per year m-2 yr-1 T @@ -798,7 +837,7 @@ FATES_MORTALITY_LOGGING_SE_SZ fates_levscls logging mortality by size i FATES_MORTALITY_LOGGING_SZ fates_levscls logging mortality by size in number of plants per m2 per year m-2 yr-1 T FATES_MORTALITY_SENESCENCE_SE_SZ fates_levscls senescence mortality by size in number of plants per m2 per event, secondary patches m-2 yr-1 T FATES_MORTALITY_SENESCENCE_SZ fates_levscls senescence mortality by size in number of plants per m2 per year m-2 yr-1 T -FATES_MORTALITY_TERMINATION_SZ fates_levscls termination mortality by size in number of plants per m2 per year m-2 yr-1 T +FATES_MORTALITY_TERMINATION_SZ fates_levscls termination mortality (excluding C-starvation) by size in number of plants per m2 per year m-2 yr-1 T FATES_MORTALITY_USTORY_SZ fates_levscls total mortality of understory trees by size class in individuals per m2 per year m-2 yr-1 T FATES_NPLANT_CANOPY_SZ fates_levscls number of canopy plants per m2 by size class m-2 T FATES_NPLANT_SZ fates_levscls number of plants per m2 by size class m-2 T @@ -845,6 +884,8 @@ FATES_BGSAPMAINTAR_SZPF fates_levscpf below-ground sapwood mainte FATES_BGSAPWOOD_ALLOC_SZPF fates_levscpf allocation to below-ground sapwood by pft/size in kg carbon per m2 per second kg m-2 s-1 F FATES_BGSTRUCT_ALLOC_SZPF fates_levscpf allocation to below-ground structural (deadwood) by pft/size in kg carbon per m2 per second kg m-2 s-1 F FATES_C13DISC_SZPF fates_levscpf C13 discrimination by pft/size per mil F +FATES_CROWNAREA_CANOPY_SZPF fates_levscpf Total crown area of canopy plants by pft/size m2 m-2 F +FATES_CROWNAREA_USTORY_SZPF fates_levscpf Total crown area of understory plants by pft/size m2 m-2 F FATES_DDBH_CANOPY_SZPF fates_levscpf diameter growth increment by pft/size m m-2 yr-1 F FATES_DDBH_SZPF fates_levscpf diameter growth increment by pft/size m m-2 yr-1 F FATES_DDBH_USTORY_SZPF fates_levscpf diameter growth increment by pft/size m m-2 yr-1 F @@ -863,22 +904,22 @@ FATES_LEAFC_CANOPY_SZPF fates_levscpf biomass in leaves of canopy FATES_LEAFC_SZPF fates_levscpf leaf carbon mass by size-class x pft in kg carbon per m2 kg m-2 F FATES_LEAFC_USTORY_SZPF fates_levscpf biomass in leaves of understory plants by pft/size in kg carbon per m2 kg m-2 F FATES_LEAF_ALLOC_SZPF fates_levscpf allocation to leaves by pft/size in kg carbon per m2 per second kg m-2 s-1 F -FATES_M3_MORTALITY_CANOPY_SZPF fates_levscpf C starvation mortality of canopy plants by pft/size N/ha/yr F -FATES_M3_MORTALITY_USTORY_SZPF fates_levscpf C starvation mortality of understory plants by pft/size N/ha/yr F +FATES_M3_MORTALITY_CANOPY_SZPF fates_levscpf C starvation mortality of canopy plants by pft/size m-2 yr-1 F +FATES_M3_MORTALITY_USTORY_SZPF fates_levscpf C starvation mortality of understory plants by pft/size m-2 yr-1 F FATES_MAINTAR_SZPF fates_levscpf maintenance autotrophic respiration in kg carbon per m2 per second by pft/size kg m-2 s-1 F FATES_MORTALITY_AGESCEN_SZPF fates_levscpf age senescence mortality by pft/size in number of plants per m2 per year m-2 yr-1 F FATES_MORTALITY_BACKGROUND_SZPF fates_levscpf background mortality by pft/size in number of plants per m2 per year m-2 yr-1 F FATES_MORTALITY_CAMBIALBURN_SZPF fates_levscpf fire mortality from cambial burn by pft/size in number of plants per m2 per year m-2 yr-1 F FATES_MORTALITY_CANOPY_SZPF fates_levscpf total mortality of canopy plants by pft/size in number of plants per m2 per year m-2 yr-1 F FATES_MORTALITY_CROWNSCORCH_SZPF fates_levscpf fire mortality from crown scorch by pft/size in number of plants per m2 per year m-2 yr-1 F -FATES_MORTALITY_CSTARV_SZPF fates_levscpf carbon starvation mortality by pft/size in number of plants per m2 per year m-2 yr-1 F +FATES_MORTALITY_CSTARV_SZPF fates_levscpf carbon starvation mortality by pft/size in number of plants per m2 per year (both continous an m-2 yr-1 F FATES_MORTALITY_FIRE_SZPF fates_levscpf fire mortality by pft/size in number of plants per m2 per year m-2 yr-1 F FATES_MORTALITY_FREEZING_SZPF fates_levscpf freezing mortality by pft/size in number of plants per m2 per year m-2 yr-1 F FATES_MORTALITY_HYDRAULIC_SZPF fates_levscpf hydraulic mortality by pft/size in number of plants per m2 per year m-2 yr-1 F FATES_MORTALITY_IMPACT_SZPF fates_levscpf impact mortality by pft/size in number of plants per m2 per year m-2 yr-1 F FATES_MORTALITY_LOGGING_SZPF fates_levscpf logging mortality by pft/size in number of plants per m2 per year m-2 yr-1 F FATES_MORTALITY_SENESCENCE_SZPF fates_levscpf senescence mortality by pft/size in number of plants per m2 per year m-2 yr-1 F -FATES_MORTALITY_TERMINATION_SZPF fates_levscpf termination mortality by pft/size in number pf plants per m2 per year m-2 yr-1 F +FATES_MORTALITY_TERMINATION_SZPF fates_levscpf termination mortality (excluding C-starvation) by pft/size in number pf plants per m2 per year m-2 yr-1 F FATES_MORTALITY_USTORY_SZPF fates_levscpf total mortality of understory plants by pft/size in number of plants per m2 per year m-2 yr-1 F FATES_NPLANT_CANOPY_SZPF fates_levscpf number of canopy plants by size/pft per m2 m-2 F FATES_NPLANT_SZPF fates_levscpf stem number density by pft/size m-2 F @@ -1008,8 +1049,11 @@ ratio_k1 levdcmp ratio_k1 ratio_no3_co2 levdcmp ratio_no3_co2 ratio F soil_bulkdensity levdcmp soil_bulkdensity kg/m3 F soil_co2_prod levdcmp soil_co2_prod ug C / g soil / day F +CONC_CH4_SAT levgrnd CH4 soil Concentration for inundated / lake area mol/m3 F +CONC_CH4_UNSAT levgrnd CH4 soil Concentration for non-inundated area mol/m3 F FGR_SOIL_R levgrnd Rural downward heat flux at interface below each soil layer watt/m^2 F HK levgrnd hydraulic conductivity (natural vegetated and crop landunits only) mm/s F +O2_DECOMP_DEPTH_UNSAT levgrnd O2 consumption from HR and AR for non-inundated area mol/m3/s F SMP levgrnd soil matric potential (natural vegetated and crop landunits only) mm T SOILPSI levgrnd soil water potential in each soil layer MPa F TSOI levgrnd soil temperature (natural vegetated and crop landunits only) K T @@ -1035,6 +1079,8 @@ SNO_TK_ICE levsno Thermal conductivity (ice l SNO_T_ICE levsno Snow temperatures (ice landunits only) K F SNO_Z levsno Snow layer thicknesses m F SNO_Z_ICE levsno Snow layer thicknesses (ice landunits only) m F +CONC_O2_SAT levsoi O2 soil Concentration for inundated / lake area mol/m3 T +CONC_O2_UNSAT levsoi O2 soil Concentration for non-inundated area mol/m3 T FATES_FRAGMENTATION_SCALER_SL levsoi factor (0-1) by which litter/cwd fragmentation proceeds relative to max rate by soil layer T FATES_FROOTC_SL levsoi Total carbon in live plant fine-roots over depth kg m-3 T H2OSOI levsoi volumetric soil water (natural vegetated and crop landunits only) mm3/mm3 T 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 89e7dd23fc..67868f75b1 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 @@ -8,11 +8,11 @@ use_cn = T use_crop = T use_fates = F -=================================== ================ ============================================================================================== ================================================================= ======= +=================================== ================ ============================================================================================== ================================================================= ======= CTSM History Fields ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Variable Name Level Dim. Long Description Units Active? -=================================== ================ ============================================================================================== ================================================================= ======= +=================================== ================ ============================================================================================== ================================================================= ======= A10TMIN - 10-day running mean of min 2-m temperature K F A5TMIN - 5-day running mean of min 2-m temperature K F ACTUAL_IMMOB - actual N immobilization gN/m^2/s T @@ -36,10 +36,14 @@ ATM_O3 - atmospheric ozone partial p ATM_TOPO - atmospheric surface height m T AVAILC - C flux available for allocation gC/m^2/s F AVAIL_RETRANSN - N flux available from retranslocation pool gN/m^2/s F +AZSUN - azimuth angle of the sun radians F AnnET - Annual ET mm/s F BAF_CROP - fractional area burned for crop s-1 T BAF_PEATF - fractional area burned in peatland s-1 T BCDEP - total BC deposition (dry+wet) from atmosphere kg/m^2/s T +BCPHIDRY - black carbon deposition (phidry) from atmosphere kg/m^2/s F +BCPHIWET - black carbon deposition (phiwet) from atmosphere kg/m^2/s F +BCPHODRY - black carbon deposition (phodry) from atmosphere kg/m^2/s F BETA - coefficient of convective velocity none F BGLFR - background litterfall rate 1/s F BGNPP - belowground NPP gC/m^2/s T @@ -66,7 +70,8 @@ COL_NTRUNC - column-level sink for N tru COST_NACTIVE - Cost of active uptake gN/gC T COST_NFIX - Cost of fixation gN/gC T COST_NRETRANS - Cost of retranslocation gN/gC T -COSZEN - cosine of solar zenith angle none F +COSZEN - cosine of solar zenith angle (downscaled if downscaling is activated) none F +COSZEN_GRC - cosine of solar zenith angle none F CPHASE - crop phenology phase 0-not planted, 1-planted, 2-leaf emerge, 3-grain fill, 4-harvest T CPOOL - temporary photosynthate C pool gC/m^2 T CPOOL_DEADCROOT_GR - dead coarse root growth respiration gC/m^2/s F @@ -158,7 +163,15 @@ DPVLTRB3 - turbulent deposition veloci DPVLTRB4 - turbulent deposition velocity 4 m/s F DSL - dry surface layer thickness mm T DSTDEP - total dust deposition (dry+wet) from atmosphere kg/m^2/s T +DSTDRY1 - dust deposition (dry1) from atmosphere kg/m^2/s F +DSTDRY2 - dust deposition (dry2) from atmosphere kg/m^2/s F +DSTDRY3 - dust deposition (dry3) from atmosphere kg/m^2/s F +DSTDRY4 - dust deposition (dry4) from atmosphere kg/m^2/s F DSTFLXT - total surface dust emission kg/m2/s T +DSTWET1 - dust deposition (wet1) from atmosphere kg/m^2/s F +DSTWET2 - dust deposition (wet2) from atmosphere kg/m^2/s F +DSTWET3 - dust deposition (wet3) from atmosphere kg/m^2/s F +DSTWET4 - dust deposition (wet4) from atmosphere kg/m^2/s F DT_VEG - change in t_veg, last iteration K F DWT_CONV_CFLUX - conversion C flux (immediate loss to atm) (0 at all times except first timestep of year) gC/m^2/s T DWT_CONV_CFLUX_DRIBBLED - conversion C flux (immediate loss to atm), dribbled throughout the year gC/m^2/s T @@ -246,8 +259,9 @@ FIRE - emitted infrared (longwave) FIRE_ICE - emitted infrared (longwave) radiation (ice landunits only) W/m^2 F FIRE_R - Rural emitted infrared (longwave) radiation W/m^2 T FIRE_U - Urban emitted infrared (longwave) radiation W/m^2 F -FLDS - atmospheric longwave radiation (downscaled to columns in glacier regions) W/m^2 T -FLDS_ICE - atmospheric longwave radiation (downscaled to columns in glacier regions) (ice landunits only) W/m^2 F +FLDS - atmospheric longwave radiation (downscaled for glacier and hillslope columns) W/m^2 T +FLDS_ICE - atmospheric longwave radiation (downscaled for glacier and hillslope columns) (ice landunits o W/m^2 F +FLDS_NOT_DOWNSCALED - atmospheric longwave radiation (pre-downscaling) W/m^2 F FPI - fraction of potential immobilization proportion T FPSN - photosynthesis umol m-2 s-1 T FPSN24 - 24 hour accumulative patch photosynthesis starting from mid-night umol CO2/m^2 ground/day F @@ -278,7 +292,7 @@ FSA_R - Rural absorbed solar radiat FSA_U - Urban absorbed solar radiation W/m^2 F FSD24 - direct radiation (last 24hrs) K F FSD240 - direct radiation (last 240hrs) K F -FSDS - atmospheric incident solar radiation W/m^2 T +FSDS - atmospheric incident solar radiation (downscaled for glacier and hillslope columns) W/m^2 T FSDSND - direct nir incident solar radiation W/m^2 T FSDSNDLN - direct nir incident solar radiation at local noon W/m^2 T FSDSNI - diffuse nir incident solar radiation W/m^2 T @@ -286,6 +300,7 @@ FSDSVD - direct vis incident solar r FSDSVDLN - direct vis incident solar radiation at local noon W/m^2 T FSDSVI - diffuse vis incident solar radiation W/m^2 T FSDSVILN - diffuse vis incident solar radiation at local noon W/m^2 T +FSDS_from_atm - atmospheric incident solar radiation received from atmosphere (pre-downscaling) W/m^2 T FSH - sensible heat not including correction for land use change and rain/snow conversion W/m^2 T FSH_G - sensible heat from ground W/m^2 T FSH_ICE - sensible heat not including correction for land use change and rain/snow conversion (ice landu W/m^2 F @@ -426,6 +441,7 @@ LEAFC_STORAGE_XFER_ACC - Accumulated leaf C transfer LEAFC_TO_BIOFUELC - leaf C to biofuel C gC/m^2/s T LEAFC_TO_LITTER - leaf C litterfall gC/m^2/s F LEAFC_TO_LITTER_FUN - leaf C litterfall used by FUN gC/m^2/s T +LEAFC_TO_REMOVEDRESIDUEC - leaf C to removed residue C gC/m^2/s F LEAFC_XFER - leaf C transfer gC/m^2 F LEAFC_XFER_TO_LEAFC - leaf C growth from storage gC/m^2/s F LEAFN - leaf N gN/m^2 T @@ -487,6 +503,7 @@ LIVESTEMC_STORAGE - live stem C storage LIVESTEMC_STORAGE_TO_XFER - live stem C shift storage to transfer gC/m^2/s F LIVESTEMC_TO_BIOFUELC - livestem C to biofuel C gC/m^2/s T LIVESTEMC_TO_DEADSTEMC - live stem C turnover gC/m^2/s F +LIVESTEMC_TO_REMOVEDRESIDUEC - livestem C to removed residue C gC/m^2/s F LIVESTEMC_XFER - live stem C transfer gC/m^2 F LIVESTEMC_XFER_TO_LIVESTEMC - live stem C growth from storage gC/m^2/s F LIVESTEMN - live stem N gN/m^2 T @@ -498,7 +515,7 @@ LIVESTEMN_XFER - live stem N transfer LIVESTEMN_XFER_TO_LIVESTEMN - live stem N growth from storage gN/m^2/s F LIVESTEM_MR - live stem maintenance respiration gC/m^2/s F LNC - leaf N concentration gN leaf/m^2 T -LWdown - atmospheric longwave radiation (downscaled to columns in glacier regions) W/m^2 F +LWdown - atmospheric longwave radiation (downscaled for glacier and hillslope columns) W/m^2 F LWup - upwelling longwave radiation W/m^2 F MEG_acetaldehyde - MEGAN flux kg/m2/sec T MEG_acetic_acid - MEGAN flux kg/m2/sec T @@ -700,6 +717,9 @@ NUPTAKE_NPP_FRACTION - frac of NPP used in N uptak N_ALLOMETRY - N allocation index none F OBU - Monin-Obukhov length m F OCDEP - total OC deposition (dry+wet) from atmosphere kg/m^2/s T +OCPHIDRY - organic carbon deposition (phidry) from atmosphere kg/m^2/s F +OCPHIWET - organic carbon deposition (phiwet) from atmosphere kg/m^2/s F +OCPHODRY - black carbon deposition (phodry) from atmosphere kg/m^2/s F OFFSET_COUNTER - offset days counter days F OFFSET_FDD - offset freezing degree days counter C degree-days F OFFSET_FLAG - offset flag none F @@ -719,8 +739,9 @@ PAR24_sun - sunlit PAR (24 hrs) PARVEGLN - absorbed par by vegetation at local noon W/m^2 T PAR_shade - shade PAR umol/m2/s F PAR_sun - sunlit PAR umol/m2/s F -PBOT - atmospheric pressure at surface (downscaled to columns in glacier regions) Pa T +PBOT - atmospheric pressure at surface (downscaled for glacier and hillslope columns) Pa T PBOT_240 - 10 day running mean of air pressure Pa F +PBOT_NOT_DOWNSCALED - atmospheric pressure at surface (pre-downscaling) Pa F PCH4 - atmospheric partial pressure of CH4 Pa T PCO2 - atmospheric partial pressure of CO2 Pa T PCO2_240 - 10 day running mean of CO2 pressure Pa F @@ -754,10 +775,11 @@ PSNSHA - shaded leaf photosynthesis PSNSHADE_TO_CPOOL - C fixation from shaded canopy gC/m^2/s T PSNSUN - sunlit leaf photosynthesis umolCO2/m^2/s T PSNSUN_TO_CPOOL - C fixation from sunlit canopy gC/m^2/s T -PSurf - atmospheric pressure at surface (downscaled to columns in glacier regions) Pa F +PSurf - atmospheric pressure at surface (downscaled for glacier and hillslope columns) Pa F Q2M - 2m specific humidity kg/kg T QAF - canopy air humidity kg/kg F QBOT - atmospheric specific humidity (downscaled to columns in glacier regions) kg/kg T +QBOT_NOT_DOWNSCALED - atmospheric specific humidity (pre-downscaling) kg/kg F QDIRECT_THROUGHFALL - direct throughfall of liquid (rain + above-canopy irrigation) mm/s F QDIRECT_THROUGHFALL_SNOW - direct throughfall of snow mm/s F QDRAI - sub-surface drainage mm/s T @@ -839,7 +861,7 @@ RETRANSN - plant pool of retranslocate RETRANSN_TO_NPOOL - deployment of retranslocated N gN/m^2/s T RH - atmospheric relative humidity % F RH2M - 2m relative humidity % T -RH2M_R - Rural 2m specific humidity % F +RH2M_R - Rural 2m relative humidity % F RH2M_U - Urban 2m relative humidity % F RH30 - 30-day running mean of relative humidity % F RHAF - fractional humidity of canopy air fraction F @@ -849,6 +871,7 @@ RR - root respiration (fine root RSSHA - shaded leaf stomatal resistance s/m T RSSUN - sunlit leaf stomatal resistance s/m T Rainf - atmospheric rain, after rain/snow repartitioning based on temperature mm/s F +Rho_from_atm - atmospheric density (pre-downscaling) kg/m^3 F Rnet - net radiation W/m^2 F SABG - solar rad absorbed by ground W/m^2 T SABG_PEN - Rural solar rad penetrating top soil or snow layer watt/m^2 T @@ -977,9 +1000,11 @@ T10 - 10-day running mean of 2-m TAF - canopy air temperature K F TAUX - zonal surface stress kg/m/s^2 T TAUY - meridional surface stress kg/m/s^2 T -TBOT - atmospheric air temperature (downscaled to columns in glacier regions) K T +TBOT - atmospheric air temperature (downscaled for glacier and hillslope columns) K T TBUILD - internal urban building air temperature K T TBUILD_MAX - prescribed maximum interior building temperature K F +TDEPTH - tributary water depth m F +TDEPTHMAX - tributary bankfull water depth m F TEMPAVG_T2M - temporary average 2m air temperature K F TEMPMAX_RETRANSN - temporary annual max of retranslocated N pool gN/m^2 F TEMPSUM_POTENTIAL_GPP - temporary annual sum of potential GPP gC/m^2/yr F @@ -992,7 +1017,7 @@ TG_ICE - ground temperature (ice lan TG_R - Rural ground temperature K F TG_U - Urban ground temperature K F TH2OSFC - surface water temperature K T -THBOT - atmospheric air potential temperature (downscaled to columns in glacier regions) K T +THBOT - atmospheric air potential temperature (downscaled for glacier and hillslope columns) K T THIC - 2 m Temp Hum Index Comfort C T THIC_R - Rural 2 m Temp Hum Index Comfort C T THIC_U - Urban 2 m Temp Hum Index Comfort C T @@ -1060,8 +1085,9 @@ TV240 - vegetation temperature (las TVEGD10 - 10 day running mean of patch daytime vegetation temperature Kelvin F TVEGN10 - 10 day running mean of patch night-time vegetation temperature Kelvin F TWS - total water storage mm T -Tair - atmospheric air temperature (downscaled to columns in glacier regions) K F +Tair - atmospheric air temperature (downscaled for glacier and hillslope columns) K F Tair_from_atm - atmospheric air temperature received from atmosphere (pre-downscaling) K F +Thair_from_atm - atmospheric air potential temperature (pre-downscaling) K F U10 - 10-m wind m/s T U10_DUST - 10-m wind for dust model m/s T U10_ICE - 10-m wind (ice landunits only) m/s F @@ -1072,6 +1098,7 @@ URBAN_AC - urban air conditioning flux URBAN_HEAT - urban heating flux W/m^2 T USTAR - aerodynamical resistance s/m F UST_LAKE - friction velocity (lakes only) m/s F +UWIND - atmospheric U wind velocity magnitude m/s F VA - atmospheric wind speed plus convective velocity m/s F VCMX25T - canopy profile of vcmax25 umol/m2/s T VENTILATION - sensible heat flux from building ventilation W/m^2 T @@ -1081,6 +1108,7 @@ VOLRMCH - river channel main channel VPD - vpd Pa F VPD2M - 2m vapor pressure deficit Pa T VPD_CAN - canopy vapor pressure deficit kPa T +VWIND - atmospheric V wind velocity magnitude m/s F Vcmx25Z - canopy profile of vcmax25 predicted by LUNA model umol/m2/s T WASTEHEAT - sensible heat flux from heating/cooling sources of urban waste heat W/m^2 T WBA - 2 m Wet Bulb C T @@ -1261,7 +1289,7 @@ STEM_PROF levdcmp profile for litter C and N SUPPLEMENT_TO_SMINN_vr levdcmp supplemental N supply gN/m^3/s F WFPS levdcmp WFPS percent F anaerobic_frac levdcmp anaerobic_frac m3/m3 F -diffus levdcmp diffusivity (from nitrification-denitrification) m^2/s F +diffus levdcmp diffusivity m^2/s F fr_WFPS levdcmp fr_WFPS fraction F n2_n2o_ratio_denit levdcmp n2_n2o_ratio_denit gN/gN F r_psi levdcmp r_psi m F From bbfe2b4542fc56b08cfeeffefc1b4e54f9572181 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Thu, 2 May 2024 15:07:50 -0600 Subject: [PATCH 0166/1248] Correction to last commit (1850 should have been 2000) --- cime_config/testdefs/testlist_clm.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index cfd81a5a2b..bf20c1241a 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -830,7 +830,7 @@ - + From 57004d92e39e6f83393f6f7c74cf3e21062e18c3 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Fri, 3 May 2024 17:34:08 -0600 Subject: [PATCH 0167/1248] New conflict resolution in testlist_clm.xml, this time for an izumi test --- cime_config/testdefs/testlist_clm.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index bf20c1241a..c2bb819572 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -1652,7 +1652,7 @@ - + From f65de8fc0968316fe7e9a4c99bbc6e897dee5a92 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Sat, 4 May 2024 11:08:24 -0600 Subject: [PATCH 0168/1248] Add LND_SETS_DUST_EMIS_DRV_FLDS which will be used to NOT set dust_emis drv_flds_in settings when CAM is going to set them --- cime_config/config_component.xml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/cime_config/config_component.xml b/cime_config/config_component.xml index f7adab268f..c474b7e0c1 100644 --- a/cime_config/config_component.xml +++ b/cime_config/config_component.xml @@ -162,6 +162,20 @@ This is typically set by the compset. + + logical + TRUE,FALSE + TRUE + + + + run_component_cpl + env_run.xml + If CTSM will set the dust settings in drv_flds_in (TRUE), or if ATM (i.e. CAM) will - DO NOT EDIT (set by compset name) + + char clm,nwp From 89f08710f61275cb0ac1dea22b5de849787682b2 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Sat, 4 May 2024 11:17:34 -0600 Subject: [PATCH 0169/1248] Move dust_emis and soil_erod namelist items to the drv_fld_in namelist file in CMEPS --- bld/CLMBuildNamelist.pm | 13 ++++++++----- bld/namelist_files/namelist_defaults_ctsm.xml | 2 -- bld/namelist_files/namelist_definition_ctsm.xml | 14 -------------- .../namelist_definition_drv_flds.xml | 13 +++++++++++++ bld/unit_testers/build-namelist_test.pl | 14 +++++++++++++- 5 files changed, 34 insertions(+), 22 deletions(-) diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index fb44023cd5..ce2c2a81d2 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -517,6 +517,7 @@ sub read_namelist_defaults { "$cfgdir/namelist_files/namelist_defaults_ctsm.xml", "$cfgdir/namelist_files/namelist_defaults_drv.xml", "$cfgdir/namelist_files/namelist_defaults_fire_emis.xml", + "$cfgdir/namelist_files/namelist_defaults_dust_emis.xml", "$cfgdir/namelist_files/namelist_defaults_drydep.xml" ); # Add the location of the use case defaults files to the options hash @@ -3988,7 +3989,7 @@ sub setup_logic_fire_emis { #------------------------------------------------------------------------------- sub setup_logic_dust_emis { - # Logic to handle the dust emissions + # Logic to handle the dust emissions namelists, both drv_flds_in and lnd_in files my ($opts, $nl_flags, $definition, $defaults, $nl) = @_; # First get the dust emission method @@ -4011,14 +4012,16 @@ sub setup_logic_dust_emis { 'dust_emis_method'=>$dust_emis_method, 'zender_soil_erod_source'=>$zender_source, 'hgrid'=>$nl_flags->{'res'}, 'lnd_tuning_mod'=>$nl_flags->{'lnd_tuning_mode'} ); } - } else { + } elsif ( $zender_source eq "atm" ) { foreach my $option ( @zender_files_in_lnd_opts ) { if ( defined($nl->get_value($option)) ) { - $log->fatal_error("zender_soil_erod_source is NOT lnd, but the file option $option is being set" . - " and should NOT be unless you want it handled here in the LAND model, " . + $log->fatal_error("zender_soil_erod_source is atm, and the file option $option is being set" . + " which should NOT be unless you want it handled here in the LAND model, " . "otherwise the equivalent option is set in CAM" ); } } + } elsif ( $zender_source eq "none" ) { + $log->fatal_error("zender_soil_erod_source is set to none and only atm or lnd should be used when $var is Zender_2002" ); } } else { # Verify that NONE of the Zender options are being set if Zender is NOT being used @@ -4736,7 +4739,7 @@ sub write_output_files { $log->verbose_message("Writing clm namelist to $outfile"); # Drydep, fire-emission or MEGAN namelist for driver - @groups = qw(drydep_inparm megan_emis_nl fire_emis_nl carma_inparm); + @groups = qw(drydep_inparm megan_emis_nl fire_emis_nl carma_inparm dust_emis_inparm); $outfile = "$opts->{'dir'}/drv_flds_in"; $nl->write($outfile, 'groups'=>\@groups, 'note'=>"$note" ); $log->verbose_message("Writing @groups namelists to $outfile"); diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index 147a23f49a..6fde63ee02 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -1991,8 +1991,6 @@ lnd/clm2/surfdata_esmf/NEON/surfdata_1x1_NEON_TOOL_hist_78pfts_CMIP6_simyr2000_c -Zender_2003 -atm bilinear lnd/clm2/dustemisdata/dst_source2x2tunedcam6-2x2-forCLM_cdf5_c230312.nc diff --git a/bld/namelist_files/namelist_definition_ctsm.xml b/bld/namelist_files/namelist_definition_ctsm.xml index 37c457141c..e730082e90 100644 --- a/bld/namelist_files/namelist_definition_ctsm.xml +++ b/bld/namelist_files/namelist_definition_ctsm.xml @@ -1612,20 +1612,6 @@ Mapping method from Nitrogen deposition input file to the model resolution - -Which dust emission method is going to be used. Either the Zender 2003 scheme or the Leung 2023 -scheme. -(NOTE: The Leung 2023 method is NOT currently available) - - - -Option only applying for the Zender_2003 method for whether the soil erodibility file is handled -here in CTSM, or in the ATM model. -(only used when dust_emis_method is Zender_2003) - - Option only applying for the Zender_2003 method for whether the soil erodibility file is handled diff --git a/bld/namelist_files/namelist_definition_drv_flds.xml b/bld/namelist_files/namelist_definition_drv_flds.xml index 088f5c5fa9..89bab07f4f 100644 --- a/bld/namelist_files/namelist_definition_drv_flds.xml +++ b/bld/namelist_files/namelist_definition_drv_flds.xml @@ -123,4 +123,17 @@ List of fluxes needed by the CARMA model, from CLM to CAM. + + Which dust emission method is going to be used. Either the Zender 2003 scheme or the Leung 2023 scheme. + (NOTE: The Leung 2023 method is NOT currently available) + + + + Option only applying for the Zender_2003 method for whether the soil erodibility file is handled + in the active LAND model or in the ATM model. + (only used when dust_emis_method is Zender_2003) + + diff --git a/bld/unit_testers/build-namelist_test.pl b/bld/unit_testers/build-namelist_test.pl index 7b654337af..114fb0c36c 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 = 2513; +my $ntests = 2515; if ( defined($opts{'compare'}) ) { $ntests += 1545; @@ -1255,6 +1255,18 @@ sub cat_and_create_namelistinfile { GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm5_1", }, + "soil_erod_none_w_Zender" =>{ options=>"--envxml_dir .", + namelst=>"dust_emis_method='Zender_2003', " . + "zender_soil_erod_source='none'", + GLC_TWO_WAY_COUPLING=>"FALSE", + phys=>"clm5_1", + }, + "soil_erod_bad_w_Zender" =>{ options=>"--envxml_dir .", + namelst=>"dust_emis_method='Zender_2003', " . + "zender_soil_erod_source='zztop'", + GLC_TWO_WAY_COUPLING=>"FALSE", + phys=>"clm5_1", + }, ); foreach my $key ( keys(%failtest) ) { print( "$key\n" ); From edae95a1013439e234e7d56d57c01efc74ce063f Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Sat, 4 May 2024 13:08:16 -0600 Subject: [PATCH 0170/1248] manually revert defaults for use_fates_lupft and fix calls to fatal_error --- bld/CLMBuildNamelist.pm | 25 +++++++++++-------- bld/namelist_files/namelist_defaults_ctsm.xml | 7 ++---- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index 23505492bd..01d583eb16 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -4371,12 +4371,16 @@ sub setup_logic_fates { add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'fates_paramfile', 'phys'=>$nl_flags->{'phys'}); my @list = ( "fates_spitfire_mode", "use_fates_planthydro", "use_fates_ed_st3", "use_fates_ed_prescribed_phys", "use_fates_inventory_init","use_fates_fixed_biogeog","use_fates_nocomp","fates_seeddisp_cadence", - "fates_harvest_mode","fates_parteh_mode", "use_fates_cohort_age_tracking","use_fates_tree_damage", - "use_fates_luh","use_fates_lupft" ); + "fates_harvest_mode","fates_parteh_mode", "use_fates_cohort_age_tracking","use_fates_tree_damage"); foreach my $var ( @list ) { add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, $var, 'use_fates'=>$nl_flags->{'use_fates'}, 'use_fates_sp'=>$nl_flags->{'use_fates_sp'} ); } + + add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'use_fates_lupft', 'use_fates'=>$nl_flags->{'use_fates'}); + add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'use_fates_luh', 'use_fates'=>$nl_flags->{'use_fates'}, + 'use_fates_lupft'=>$nl_flags->{'use_fates_lupft'} ); + my $suplnitro = $nl->get_value('suplnitro'); my $parteh_mode = $nl->get_value('fates_parteh_mode'); if ( ($parteh_mode == 1) && ($suplnitro !~ /ALL/) && not &value_is_true( $nl_flags->{'use_fates_sp'}) ) { @@ -4384,6 +4388,7 @@ sub setup_logic_fates { "but and FATES-SP is not active, but fates_parteh_mode is 1, so Nitrogen is not active" . "Change suplnitro back to ALL"); } + # # For FATES SP mode make sure no-competetiion, and fixed-biogeography are also set # And also check for other settings that can't be trigged on as well @@ -4425,16 +4430,16 @@ sub setup_logic_fates { 'phys'=>$nl_flags->{'phys'}, 'hgrid'=>$nl_flags->{'res'}, nofail=>1 ); my $fname = remove_leading_and_trailing_quotes( $nl->get_value($var) ); if ( ! defined($nl->get_value($var)) ) { - fatal_error("$var is required when use_fates_lupft is set" ); + $log->fatal_error("$var is required when use_fates_lupft is set" ); } elsif ( ! -f "$fname" ) { - fatal_error("$fname does NOT point to a valid filename" ); + $log->fatal_error("$fname does NOT point to a valid filename" ); } } # make sure that nocomp and fbg mode are enabled as well as use_fates_luh my @list = ( "use_fates_nocomp", "use_fates_fixed_biogeog, use_fates_luh" ); foreach my $var ( @list ) { if ( ! &value_is_true($nl->get_value($var)) ) { - fatal_error("$var is required when use_fates_lupft is true" ); + $log->fatal_error("$var is required when use_fates_lupft is true" ); } } } @@ -4461,10 +4466,10 @@ sub setup_logic_fates { if ( defined($nl->get_value($var)) ) { if ( &value_is_true($nl->get_value($var)) ) { if ( ! &value_is_true($nl->get_value('use_fates_luh')) ) { - fatal_error("use_fates_luh must be true when $var is true" ); + $log->fatal_error("use_fates_luh must be true when $var is true" ); } if ( $nl->get_value('fates_harvest_mode') > 0) { - fatal_error("fates_harvest_mode must be off (i.e. set to zero) when $var is true" ); + $log->fatal_error("fates_harvest_mode must be off (i.e. set to zero) when $var is true" ); } } } @@ -4475,17 +4480,17 @@ sub setup_logic_fates { # if ( $nl->get_value($var) == 2) { # # Make sure that do_harvest is set to true # if ( ! &value_is_true($nl->get_value('do_harvest')) ) { - # fatal_error("do_harvest must be true when $var is equal to 2" ); + # $log->fatal_error("do_harvest must be true when $var is equal to 2" ); # } # using fates_harvest mode with raw luh2 harvest data if ( $nl->get_value($var) > 2) { # Make sure that use_fates_luh is true when using raw fates luh2 harvest data if ( ! &value_is_true($nl->get_value('use_fates_luh')) ) { - fatal_error("use_fates_luh is required to be true when $var is greater than 2" ); + $log->fatal_error("use_fates_luh is required to be true when $var is greater than 2" ); } # do_harvest can not be on if we are using the raw fates luh2 harvest data if ( &value_is_true($nl->get_value('do_harvest')) ) { - fatal_error("do_harvest can not be true when $var is greater than 2" ); + $log->fatal_error("do_harvest can not be true when $var is greater than 2" ); } } } diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index 68a122e9bc..1195ba5329 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -2769,19 +2769,16 @@ use_crop=".true.">lnd/clm2/surfdata_map/ctsm5.1.dev052/landuse.timeseries_mpasa1 .false. .false. .false. -.true. -.true. + .true. -.true. .false. + 1 0 .true. -.true. .false. .true. -.true. .false. From af6a1c0e87a4f3d03e3fe6976b00af3ac94398f1 Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Sat, 4 May 2024 13:37:22 -0600 Subject: [PATCH 0171/1248] remove old flandusepftdat add_default and fix use_fates_lupft check this also temporarily removes the use_fates_lupft check for the use_fates_luh namelist defaults --- bld/CLMBuildNamelist.pm | 17 +++++++---------- bld/namelist_files/namelist_defaults_ctsm.xml | 6 +----- 2 files changed, 8 insertions(+), 15 deletions(-) diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index 01d583eb16..1cb14878e7 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -4389,7 +4389,6 @@ sub setup_logic_fates { "Change suplnitro back to ALL"); } - # # For FATES SP mode make sure no-competetiion, and fixed-biogeography are also set # And also check for other settings that can't be trigged on as well # @@ -4434,12 +4433,13 @@ sub setup_logic_fates { } elsif ( ! -f "$fname" ) { $log->fatal_error("$fname does NOT point to a valid filename" ); } - } - # make sure that nocomp and fbg mode are enabled as well as use_fates_luh - my @list = ( "use_fates_nocomp", "use_fates_fixed_biogeog, use_fates_luh" ); - foreach my $var ( @list ) { - if ( ! &value_is_true($nl->get_value($var)) ) { - $log->fatal_error("$var is required when use_fates_lupft is true" ); + + # make sure that nocomp and fbg mode are enabled as well as use_fates_luh + my @list = ( "use_fates_nocomp", "use_fates_fixed_biogeog, use_fates_luh" ); + foreach my $var ( @list ) { + if ( ! &value_is_true($nl->get_value($var)) ) { + $log->fatal_error("$var is required when use_fates_lupft is true" ); + } } } } @@ -4456,9 +4456,6 @@ sub setup_logic_fates { } elsif ( ! -f "$fname" ) { $log->fatal_error("$fname does NOT point to a valid filename" ); } - - $var = "flandusepftdat"; - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, $var, 'phys'=>$nl_flags->{'phys'}, 'hgrid'=>$nl_flags->{'res'}, 'sim_year_range'=>$nl_flags->{'sim_year_range'}, nofail=>1 ); } } # check that fates landuse is on and harvest mode is off when potential veg switch is true diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index 1195ba5329..e6f6b736a6 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -2769,13 +2769,9 @@ use_crop=".true.">lnd/clm2/surfdata_map/ctsm5.1.dev052/landuse.timeseries_mpasa1 .false. .false. .false. - -.true. -.false. - +.false. 1 0 - .true. .false. .true. From d5575d5c31e0013b8e303b3bc6966f6c8e405f55 Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Sat, 4 May 2024 14:42:15 -0600 Subject: [PATCH 0172/1248] correct call to add_default for use_fates_lupft dependency with use_fates_luh --- bld/CLMBuildNamelist.pm | 2 +- bld/namelist_files/namelist_defaults_ctsm.xml | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index 1cb14878e7..7ad35584aa 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -4379,7 +4379,7 @@ sub setup_logic_fates { add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'use_fates_lupft', 'use_fates'=>$nl_flags->{'use_fates'}); add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'use_fates_luh', 'use_fates'=>$nl_flags->{'use_fates'}, - 'use_fates_lupft'=>$nl_flags->{'use_fates_lupft'} ); + 'use_fates_lupft'=>$nl->get_value('use_fates_lupft') ); my $suplnitro = $nl->get_value('suplnitro'); my $parteh_mode = $nl->get_value('fates_parteh_mode'); diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index e6f6b736a6..38a0fe6493 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -2769,7 +2769,8 @@ use_crop=".true.">lnd/clm2/surfdata_map/ctsm5.1.dev052/landuse.timeseries_mpasa1 .false. .false. .false. -.false. +.true. +.false. 1 0 .true. From ea773e451b78b3b7011a534a73352693600be95e Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Sat, 4 May 2024 14:53:16 -0600 Subject: [PATCH 0173/1248] add use_fates_lupft dependencies for nocomp and fbg --- bld/CLMBuildNamelist.pm | 10 ++++++++-- bld/namelist_files/namelist_defaults_ctsm.xml | 2 ++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index 7ad35584aa..261c775fbd 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -4370,7 +4370,7 @@ sub setup_logic_fates { if (&value_is_true( $nl_flags->{'use_fates'}) ) { add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'fates_paramfile', 'phys'=>$nl_flags->{'phys'}); my @list = ( "fates_spitfire_mode", "use_fates_planthydro", "use_fates_ed_st3", "use_fates_ed_prescribed_phys", - "use_fates_inventory_init","use_fates_fixed_biogeog","use_fates_nocomp","fates_seeddisp_cadence", + "use_fates_inventory_init","fates_seeddisp_cadence", "fates_harvest_mode","fates_parteh_mode", "use_fates_cohort_age_tracking","use_fates_tree_damage"); foreach my $var ( @list ) { add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, $var, 'use_fates'=>$nl_flags->{'use_fates'}, @@ -4380,6 +4380,12 @@ sub setup_logic_fates { add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'use_fates_lupft', 'use_fates'=>$nl_flags->{'use_fates'}); add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'use_fates_luh', 'use_fates'=>$nl_flags->{'use_fates'}, 'use_fates_lupft'=>$nl->get_value('use_fates_lupft') ); + add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'use_fates_nocomp', 'use_fates'=>$nl_flags->{'use_fates'}, + 'use_fates_lupft'=>$nl->get_value('use_fates_lupft'), + 'use_fates_sp'=>$nl_flags->{'use_fates_sp'} ); + add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'use_fates_fixed_biogeog', 'use_fates'=>$nl_flags->{'use_fates'}, + 'use_fates_lupft'=>$nl->get_value('use_fates_lupft'), + 'use_fates_sp'=>$nl_flags->{'use_fates_sp'} ); my $suplnitro = $nl->get_value('suplnitro'); my $parteh_mode = $nl->get_value('fates_parteh_mode'); @@ -4435,7 +4441,7 @@ sub setup_logic_fates { } # make sure that nocomp and fbg mode are enabled as well as use_fates_luh - my @list = ( "use_fates_nocomp", "use_fates_fixed_biogeog, use_fates_luh" ); + my @list = ( "use_fates_luh", "use_fates_nocomp", "use_fates_fixed_biogeog" ); foreach my $var ( @list ) { if ( ! &value_is_true($nl->get_value($var)) ) { $log->fatal_error("$var is required when use_fates_lupft is true" ); diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index 38a0fe6493..216ad74ca1 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -2774,8 +2774,10 @@ use_crop=".true.">lnd/clm2/surfdata_map/ctsm5.1.dev052/landuse.timeseries_mpasa1 1 0 .true. +.true. .false. .true. +.true. .false. From a21181f1b3e4a89f426e4b9bdce52e76b06ffc39 Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Sun, 5 May 2024 12:24:05 -0600 Subject: [PATCH 0174/1248] add fates_harvest_mode to use_fates_luh check --- bld/CLMBuildNamelist.pm | 3 ++- bld/namelist_files/namelist_defaults_ctsm.xml | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index 261c775fbd..8af5f035e9 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -4379,7 +4379,8 @@ sub setup_logic_fates { add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'use_fates_lupft', 'use_fates'=>$nl_flags->{'use_fates'}); add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'use_fates_luh', 'use_fates'=>$nl_flags->{'use_fates'}, - 'use_fates_lupft'=>$nl->get_value('use_fates_lupft') ); + 'use_fates_lupft'=>$nl->get_value('use_fates_lupft'), + 'fates_harvest_mode'=>$nl->get_value('fates_harvest_mode') ); add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'use_fates_nocomp', 'use_fates'=>$nl_flags->{'use_fates'}, 'use_fates_lupft'=>$nl->get_value('use_fates_lupft'), 'use_fates_sp'=>$nl_flags->{'use_fates_sp'} ); diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index 216ad74ca1..206ab7cd1b 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -2769,6 +2769,8 @@ use_crop=".true.">lnd/clm2/surfdata_map/ctsm5.1.dev052/landuse.timeseries_mpasa1 .false. .false. .false. +.true. +.true. .true. .false. 1 From d8178e415a399f2f0fd61b15f92b4c43f9dd4484 Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Sun, 5 May 2024 12:54:52 -0600 Subject: [PATCH 0175/1248] add use_fates_potentialveg to use_fates_luh check --- bld/CLMBuildNamelist.pm | 4 +++- bld/namelist_files/namelist_defaults_ctsm.xml | 7 ++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index 8af5f035e9..b450060736 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -4377,9 +4377,11 @@ sub setup_logic_fates { 'use_fates_sp'=>$nl_flags->{'use_fates_sp'} ); } + add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'use_fates_potentialveg', 'use_fates'=>$nl_flags->{'use_fates'}); add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'use_fates_lupft', 'use_fates'=>$nl_flags->{'use_fates'}); add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'use_fates_luh', 'use_fates'=>$nl_flags->{'use_fates'}, 'use_fates_lupft'=>$nl->get_value('use_fates_lupft'), + 'use_fates_potentialveg'=>$nl->get_value('use_fates_potentialveg'), 'fates_harvest_mode'=>$nl->get_value('fates_harvest_mode') ); add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'use_fates_nocomp', 'use_fates'=>$nl_flags->{'use_fates'}, 'use_fates_lupft'=>$nl->get_value('use_fates_lupft'), @@ -4466,7 +4468,7 @@ sub setup_logic_fates { } } # check that fates landuse is on and harvest mode is off when potential veg switch is true - my $var = "use_potentialveg"; + my $var = "use_fates_potentialveg"; if ( defined($nl->get_value($var)) ) { if ( &value_is_true($nl->get_value($var)) ) { if ( ! &value_is_true($nl->get_value('use_fates_luh')) ) { diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index 206ab7cd1b..9d2a34b7bf 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -2769,10 +2769,11 @@ use_crop=".true.">lnd/clm2/surfdata_map/ctsm5.1.dev052/landuse.timeseries_mpasa1 .false. .false. .false. -.true. -.true. +.true. +.true. .true. -.false. +.true. +.false. 1 0 .true. From 9751fb68174903134e301472087edc263bc4822e Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Sun, 5 May 2024 13:01:20 -0600 Subject: [PATCH 0176/1248] add check to fates sp mode to make sure landuse isn't enabled --- bld/CLMBuildNamelist.pm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index b450060736..54f0c0c997 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -4414,6 +4414,10 @@ sub setup_logic_fates { if ( $nl->get_value('fates_spitfire_mode') > 0 ) { $log->fatal_error('fates_spitfire_mode can NOT be set to greater than 0 when use_fates_sp is true'); } + # fates landuse can't be on with FATES SP mode is active + if ( &value_is_true($nl->get_value('use_fates_luh')) ) { + $log->fatal_error('use_fates_luh can NOT be true when use_fates_sp is true'); + } } } my $var = "use_fates_inventory_init"; From 39cd37dd5d1da5ea96b2327ecc10ac7f72d37383 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Mon, 6 May 2024 13:05:29 -0600 Subject: [PATCH 0177/1248] Provide scalar cth and cbh in unit tests. Failing. --- python/ctsm/test/test_unit_singlept_data_surfdata.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/python/ctsm/test/test_unit_singlept_data_surfdata.py b/python/ctsm/test/test_unit_singlept_data_surfdata.py index a29fa05b33..2106799a4b 100755 --- a/python/ctsm/test/test_unit_singlept_data_surfdata.py +++ b/python/ctsm/test/test_unit_singlept_data_surfdata.py @@ -47,8 +47,8 @@ class TestSinglePointCaseSurfaceNoCrop(unittest.TestCase): evenly_split_cropland = False pct_pft = None num_pft = 16 - cth = [0.9, 0.9, 0.9, 0.9, 0.9, 0.9, 0.9, 0.9, 0.9, 0.9, 0.9, 0.9] - cbh = [0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1] + cth = 0.9 + cbh = 0.1 include_nonveg = False uni_snow = True cap_saturation = True @@ -668,8 +668,8 @@ class TestSinglePointCaseSurfaceCrop(unittest.TestCase): evenly_split_cropland = False pct_pft = None num_pft = 78 - cth = [0.9, 0.9, 0.9, 0.9, 0.9, 0.9, 0.9, 0.9, 0.9, 0.9, 0.9, 0.9] - cbh = [0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1] + cth = 0.9 + cbh = 0.1 include_nonveg = False uni_snow = False cap_saturation = False From 486d634d9e930987a61a3609eafaf6c35ffeb133 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Mon, 6 May 2024 13:17:17 -0600 Subject: [PATCH 0178/1248] Ensure cth and cbh are iterable before zipping. Unit tests now pass. --- python/ctsm/site_and_regional/single_point_case.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/python/ctsm/site_and_regional/single_point_case.py b/python/ctsm/site_and_regional/single_point_case.py index 86dabe609d..b197b29578 100644 --- a/python/ctsm/site_and_regional/single_point_case.py +++ b/python/ctsm/site_and_regional/single_point_case.py @@ -27,6 +27,14 @@ LAST_MONTH = 12 +def _ensure_iterable(thing_we_want_iterable, iterable_length): + try: + iter(thing_we_want_iterable) + return thing_we_want_iterable + except TypeError: + return [thing_we_want_iterable] * iterable_length + + class SinglePointCase(BaseCase): """ A class to encapsulate everything for single point cases. @@ -415,7 +423,10 @@ def modify_surfdata_atpoint(self, f_orig): # f_mod["PCT_CROP"][:, :] = 0 # -- loop over all dom_pft and pct_pft - zip_pfts = zip(self.dom_pft, self.pct_pft, self.cth, self.cbh) + iterable_length = len(self.dom_pft) + cth_to_zip = _ensure_iterable(self.cth, iterable_length) + cbh_to_zip = _ensure_iterable(self.cbh, iterable_length) + zip_pfts = zip(self.dom_pft, self.pct_pft, cth_to_zip, cbh_to_zip) for dom_pft, pct_pft, cth, cbh in zip_pfts: if cth is not None: f_mod["MONTHLY_HEIGHT_TOP"][:, :, :, dom_pft] = cth From af672fb3f0727bad7490c131499e9c151779c574 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Mon, 6 May 2024 13:53:07 -0600 Subject: [PATCH 0179/1248] Fix comparison to a baseline directory --- bld/unit_testers/compare_namelists | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/bld/unit_testers/compare_namelists b/bld/unit_testers/compare_namelists index e0c6263555..7a8badc288 100755 --- a/bld/unit_testers/compare_namelists +++ b/bld/unit_testers/compare_namelists @@ -80,9 +80,10 @@ if [ "$PHYSB" = "all" ] && [ "$PHYSA" != "all" ]; then fi if [ "$verbose" = "YES" ]; then echo "Get list of lnd_in.* files"; fi +if [ "$verbose" = "YES" ]; then pwd; fi filepat="lnd_in.*" filenames=($filepat) -if [ "$verbose" = "YES" ]; then echo "filename list = $filenames"; fi +if [ "$verbose" = "YES" ]; then echo "filename list = ${filenames[*]}"; fi if [ "${filenames[*]}" = "$filepat" ]; then echo "No lnd_in files exist in the current directory -- run ./build-namelist_test.pl first" exit 1 @@ -92,9 +93,11 @@ do fileA="./$file" fileB="$baseline/$file" # If physicsA option used and the file matches the physics input - if [[ $fileA =~ "-phys+$PHYSA" ]]; then + if [[ "$fileA" =~ "-phys+$PHYSA" ]] || [ "$PHYSA" = "all" ]; then # Replace physicsB for fileB - fileB=${fileB/-phys+$PHYSA/-phys+$PHYSB} + if [ ! "$PHYSA" = "all" ]; then + fileB=${fileB/-phys+$PHYSA/-phys+$PHYSB} + fi if ! test -f $fileB; then if [ "$verbose" = "YES" ]; then echo "$fileB does NOT exist -- skipping"; fi else @@ -109,4 +112,4 @@ do fi fi done -if [ "$verbose" = "YES" ]; then echo "Successfully ran through lnd_in files to compare"; fi \ No newline at end of file +if [ "$verbose" = "YES" ]; then echo "Successfully ran through lnd_in files to compare"; fi From cfeb9d6301b4ef455762f83262da831fe5e2b129 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Mon, 6 May 2024 14:00:33 -0600 Subject: [PATCH 0180/1248] Move ensure_iterable() to utils.py and add testing. One failure. --- .../site_and_regional/single_point_case.py | 14 ++------ python/ctsm/test/test_unit_utils.py | 34 ++++++++++++++++++- python/ctsm/utils.py | 11 ++++++ 3 files changed, 47 insertions(+), 12 deletions(-) diff --git a/python/ctsm/site_and_regional/single_point_case.py b/python/ctsm/site_and_regional/single_point_case.py index b197b29578..2c2aebad52 100644 --- a/python/ctsm/site_and_regional/single_point_case.py +++ b/python/ctsm/site_and_regional/single_point_case.py @@ -14,7 +14,7 @@ # -- import local classes for this script from ctsm.site_and_regional.base_case import BaseCase, USRDAT_DIR, DatmFiles -from ctsm.utils import add_tag_to_filename +from ctsm.utils import add_tag_to_filename, ensure_iterable logger = logging.getLogger(__name__) @@ -27,14 +27,6 @@ LAST_MONTH = 12 -def _ensure_iterable(thing_we_want_iterable, iterable_length): - try: - iter(thing_we_want_iterable) - return thing_we_want_iterable - except TypeError: - return [thing_we_want_iterable] * iterable_length - - class SinglePointCase(BaseCase): """ A class to encapsulate everything for single point cases. @@ -424,8 +416,8 @@ def modify_surfdata_atpoint(self, f_orig): # -- loop over all dom_pft and pct_pft iterable_length = len(self.dom_pft) - cth_to_zip = _ensure_iterable(self.cth, iterable_length) - cbh_to_zip = _ensure_iterable(self.cbh, iterable_length) + cth_to_zip = ensure_iterable(self.cth, iterable_length) + cbh_to_zip = ensure_iterable(self.cbh, iterable_length) zip_pfts = zip(self.dom_pft, self.pct_pft, cth_to_zip, cbh_to_zip) for dom_pft, pct_pft, cth, cbh in zip_pfts: if cth is not None: diff --git a/python/ctsm/test/test_unit_utils.py b/python/ctsm/test/test_unit_utils.py index 85ba2515dd..cc22401d1e 100755 --- a/python/ctsm/test/test_unit_utils.py +++ b/python/ctsm/test/test_unit_utils.py @@ -9,7 +9,7 @@ import os from ctsm import unit_testing -from ctsm.utils import fill_template_file +from ctsm.utils import fill_template_file, ensure_iterable from ctsm.config_utils import lon_range_0_to_360, _handle_config_value # Allow names that pylint doesn't like, because otherwise I find it hard @@ -328,6 +328,38 @@ def test_handleConfigValue_isListFalse(self): self.assertEqual(val_out, float(val_in)) +class TestUtilsEnsureIterable(unittest.TestCase): + """Tests of utils: ensure_iterable""" + + def test_ensure_iterable_number(self): + """ + Tests that ensure_iterable(NUMBER, 3) produces a list of 3 NUMBERs + """ + val = 724.1987 + self.assertEqual(ensure_iterable(val, 3), [val, val, val]) + + def test_ensure_iterable_none(self): + """ + Tests that ensure_iterable(None, 2) produces a list of 2 Nones + """ + val = None + self.assertEqual(ensure_iterable(val, 2), [val, val]) + + def test_ensure_iterable_already(self): + """ + Tests that ensure_iterable() returns the input if it's already iterable + """ + val = [11, 12] + self.assertEqual(ensure_iterable(val, 2), val) + + def test_ensure_iterable_error_wrong_length(self): + """ + Tests that ensure_iterable() errors if input is iterable but of the wrong length + """ + with self.assertRaisesRegex(SystemExit, "Input is iterable but wrong length"): + ensure_iterable([11, 12], 3) + + if __name__ == "__main__": unit_testing.setup_for_tests() unittest.main() diff --git a/python/ctsm/utils.py b/python/ctsm/utils.py index 8578ea860c..f7d4e163c6 100644 --- a/python/ctsm/utils.py +++ b/python/ctsm/utils.py @@ -26,6 +26,17 @@ def abort(errmsg): sys.exit("ERROR: {}".format(errmsg)) +def ensure_iterable(thing_we_want_iterable, iterable_length): + """ + Ensure that a variable is iterable + """ + try: + iter(thing_we_want_iterable) + return thing_we_want_iterable + except TypeError: + return [thing_we_want_iterable] * iterable_length + + def fill_template_file(path_to_template, path_to_final, substitutions): """Given a template file (based on python's template strings), write a copy of the file with template values filled in. From a696d9551f619d58e307aa09b95239e6e2a6874b Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Mon, 6 May 2024 14:05:52 -0600 Subject: [PATCH 0181/1248] ensure_iterable() now errors if already iterable but wrong length. Tests pass. --- python/ctsm/test/test_unit_utils.py | 2 +- python/ctsm/utils.py | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/python/ctsm/test/test_unit_utils.py b/python/ctsm/test/test_unit_utils.py index cc22401d1e..aed43cfede 100755 --- a/python/ctsm/test/test_unit_utils.py +++ b/python/ctsm/test/test_unit_utils.py @@ -356,7 +356,7 @@ def test_ensure_iterable_error_wrong_length(self): """ Tests that ensure_iterable() errors if input is iterable but of the wrong length """ - with self.assertRaisesRegex(SystemExit, "Input is iterable but wrong length"): + with self.assertRaisesRegex(ValueError, "Input is iterable but wrong length"): ensure_iterable([11, 12], 3) diff --git a/python/ctsm/utils.py b/python/ctsm/utils.py index f7d4e163c6..3f4149c163 100644 --- a/python/ctsm/utils.py +++ b/python/ctsm/utils.py @@ -30,11 +30,18 @@ def ensure_iterable(thing_we_want_iterable, iterable_length): """ Ensure that a variable is iterable """ + already_iterable = True try: iter(thing_we_want_iterable) - return thing_we_want_iterable except TypeError: - return [thing_we_want_iterable] * iterable_length + already_iterable = False + + if not already_iterable: + thing_we_want_iterable = [thing_we_want_iterable] * iterable_length + elif len(thing_we_want_iterable) != iterable_length: + raise ValueError(f"Input is iterable but wrong length") + + return thing_we_want_iterable def fill_template_file(path_to_template, path_to_final, substitutions): From 475831f0fb0e31e97f630eac4e078c886558b61c Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Mon, 6 May 2024 14:08:50 -0600 Subject: [PATCH 0182/1248] Clean up ctsm/utils.py with black and pylint. --- python/ctsm/utils.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/python/ctsm/utils.py b/python/ctsm/utils.py index 3f4149c163..a5a02a5c9d 100644 --- a/python/ctsm/utils.py +++ b/python/ctsm/utils.py @@ -35,12 +35,12 @@ def ensure_iterable(thing_we_want_iterable, iterable_length): iter(thing_we_want_iterable) except TypeError: already_iterable = False - + if not already_iterable: thing_we_want_iterable = [thing_we_want_iterable] * iterable_length elif len(thing_we_want_iterable) != iterable_length: - raise ValueError(f"Input is iterable but wrong length") - + raise ValueError("Input is iterable but wrong length") + return thing_we_want_iterable From 0819983f37aadf9f7c9dde290dd7f65b4870b3f6 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Mon, 6 May 2024 14:09:27 -0600 Subject: [PATCH 0183/1248] Add previous commit to .git-blame-ignore-revs. --- .git-blame-ignore-revs | 1 + 1 file changed, 1 insertion(+) diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs index f86a330408..e769d3187c 100644 --- a/.git-blame-ignore-revs +++ b/.git-blame-ignore-revs @@ -25,6 +25,7 @@ a9d96219902cf609636886c7073a84407f450d9a d866510188d26d51bcd6d37239283db690af7e82 0dcd0a3c1abcaffe5529f8d79a6bc34734b195c7 e096358c832ab292ddfd22dd5878826c7c788968 +475831f0fb0e31e97f630eac4e078c886558b61c # Ran SystemTests and python/ctsm through black python formatter 5364ad66eaceb55dde2d3d598fe4ce37ac83a93c 8056ae649c1b37f5e10aaaac79005d6e3a8b2380 From 75f9cc54227f39f7baabc430de7a12506b892192 Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Mon, 6 May 2024 15:35:56 -0700 Subject: [PATCH 0184/1248] rename luh unit test that matched old test --- 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 899bd10b9c..0bf0ea5390 100755 --- a/bld/unit_testers/build-namelist_test.pl +++ b/bld/unit_testers/build-namelist_test.pl @@ -1062,7 +1062,7 @@ sub cat_and_create_namelistinfile { GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm4_5", }, - "useinventorybutnotfile" =>{ options=>"--res 0.9x1.25 --bgc fates --envxml_dir . --no-megan", + "useLUH2butnotfile" =>{ options=>"--res 0.9x1.25 --bgc fates --envxml_dir . --no-megan", namelst=>"use_fates_luh=.true.", GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm4_5", From ff3af55931b98e9cb7b9553717d10f2388954197 Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Mon, 6 May 2024 16:24:30 -0700 Subject: [PATCH 0185/1248] add build namelist unit tests for fates landuse v2 --- bld/unit_testers/build-namelist_test.pl | 41 +++++++++++++++++++++++-- 1 file changed, 38 insertions(+), 3 deletions(-) diff --git a/bld/unit_testers/build-namelist_test.pl b/bld/unit_testers/build-namelist_test.pl index 0bf0ea5390..70243c5843 100755 --- a/bld/unit_testers/build-namelist_test.pl +++ b/bld/unit_testers/build-namelist_test.pl @@ -163,10 +163,10 @@ sub cat_and_create_namelistinfile { # # Figure out number of tests that will run # -my $ntests = 1999; +my $ntests = 2006; if ( defined($opts{'compare'}) ) { - $ntests += 1353; + $ntests += 1360; } plan( tests=>$ntests ); @@ -1062,11 +1062,16 @@ sub cat_and_create_namelistinfile { GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm4_5", }, - "useLUH2butnotfile" =>{ options=>"--res 0.9x1.25 --bgc fates --envxml_dir . --no-megan", + "useFATESLUH2butnotfile" =>{ options=>"--res 0.9x1.25 --bgc fates --envxml_dir . --no-megan", namelst=>"use_fates_luh=.true.", GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm4_5", }, + "useFATESLUPFTbutnotfile" =>{ options=>"--res 0.9x1.25 --bgc fates --envxml_dir . --no-megan", + namelst=>"use_fates_lupft=.true.", + GLC_TWO_WAY_COUPLING=>"FALSE", + phys=>"clm4_5", + }, "inventoryfileDNE" =>{ options=>"-bgc fates -envxml_dir . -no-megan", namelst=>"use_fates_luh=.true., fluh_timeseries='zztop'", GLC_TWO_WAY_COUPLING=>"FALSE", @@ -1092,6 +1097,36 @@ sub cat_and_create_namelistinfile { GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm5_0", }, + "useFATESSPwithLUH" =>{ options=>"-bgc fates -envxml_dir . -no-megan", + namelst=>"use_fates_sp=T,use_fates_luh=T", + GLC_TWO_WAY_COUPLING=>"FALSE", + phys=>"clm5_0", + }, + "useFATESPOTVEGwithHARVEST" =>{ options=>"-bgc fates -envxml_dir . -no-megan", + namelst=>"use_fates_potentialveg=T,fates_harvest_mode=1", + GLC_TWO_WAY_COUPLING=>"FALSE", + phys=>"clm5_0", + }, + "useFATESHARVEST3WOLUH" =>{ options=>"-bgc fates -envxml_dir . -no-megan", + namelst=>"use_fates_luh=F,fates_harvest_mode=3", + GLC_TWO_WAY_COUPLING=>"FALSE", + phys=>"clm5_0", + }, + "useFATESLUPFTWOLUH" =>{ options=>"-bgc fates -envxml_dir . -no-megan", + namelst=>"use_fates_lupft=T,use_fates_luh=F", + GLC_TWO_WAY_COUPLING=>"FALSE", + phys=>"clm5_0", + }, + "useFATESLUPFTWONOCOMP" =>{ options=>"-bgc fates -envxml_dir . -no-megan", + namelst=>"use_fates_lupft=T,use_fates_nocomp=F", + GLC_TWO_WAY_COUPLING=>"FALSE", + phys=>"clm5_0", + }, + "useFATESLUPFTWOFBG" =>{ options=>"-bgc fates -envxml_dir . -no-megan", + namelst=>"use_fates_lupft=T,use_fates_fixedbiogeog=F", + GLC_TWO_WAY_COUPLING=>"FALSE", + phys=>"clm5_0", + }, "useFATESTRANSWdynPFT" =>{ options=>"-bgc fates -envxml_dir . -use_case 20thC_transient -no-megan", namelst=>"do_transient_pfts=T", GLC_TWO_WAY_COUPLING=>"FALSE", From 69154dab7b33706491bdabc634d9a80142bf0b35 Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Mon, 6 May 2024 16:37:07 -0700 Subject: [PATCH 0186/1248] update fates logging unit test to use new fates harvest mode --- bld/namelist_files/namelist_definition_ctsm.xml | 2 +- bld/unit_testers/build-namelist_test.pl | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/bld/namelist_files/namelist_definition_ctsm.xml b/bld/namelist_files/namelist_definition_ctsm.xml index a2df9b1d1e..edcfa36d27 100644 --- a/bld/namelist_files/namelist_definition_ctsm.xml +++ b/bld/namelist_files/namelist_definition_ctsm.xml @@ -814,7 +814,7 @@ types to vary over time. -Full pathname of fates landuse x pft data map. +Full pathname of fates landuse x pft static data map. "FALSE", phys=>"clm4_5", }, - # TODO SSR: Replace this with fates_harvest_mode "useloggingButNOTFATES" =>{ options=>"-envxml_dir . -no-megan", - namelst=>"use_fates_logging=.true.", + namelst=>"fates_harvest_mode=1", GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm4_5", }, From 5c5ca6f8e40cc6fe69d9b9a7edf32ce5242a7629 Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Mon, 6 May 2024 17:49:34 -0600 Subject: [PATCH 0187/1248] minor update --- 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 3b2dabd057..f674849b6f 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 = 2006; +my $ntests = 2007; if ( defined($opts{'compare'}) ) { $ntests += 1360; From eec4e79bb867aa671ad52a9c52028f1df00358e1 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Tue, 7 May 2024 03:23:41 -0600 Subject: [PATCH 0188/1248] Update testlist based on what's needed for CAM and CESM test lists --- cime_config/testdefs/testlist_clm.xml | 32 +++++++++++++++++++++------ 1 file changed, 25 insertions(+), 7 deletions(-) diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index c2a90507ba..56ba176cfe 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -73,7 +73,7 @@ - + @@ -102,7 +102,7 @@ - + @@ -111,7 +111,7 @@ - + @@ -120,7 +120,7 @@ - + @@ -129,7 +129,7 @@ - + @@ -138,7 +138,7 @@ - + @@ -331,6 +331,24 @@ + + + + + + + + + + + + + + + + + + @@ -685,7 +703,7 @@ - + From e529c2f119f8561a7203f0f3588ded549094e6e6 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Tue, 7 May 2024 03:27:31 -0600 Subject: [PATCH 0189/1248] Add IHistClm60BgcCropG which is needed for CESM testing, change NoAnthro compsets to run with RTM as required for Paleo work, best guess as to what needs science support --- cime_config/config_compsets.xml | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/cime_config/config_compsets.xml b/cime_config/config_compsets.xml index 2de911da86..538329e523 100644 --- a/cime_config/config_compsets.xml +++ b/cime_config/config_compsets.xml @@ -91,6 +91,8 @@ I2000Clm60Sp 2000_DATM%GSWP3v1_CLM60%SP_SICE_SOCN_MOSART_SGLC_SWAV + + @@ -182,6 +184,8 @@ I1850Clm60Sp 1850_DATM%GSWP3v1_CLM60%SP_SICE_SOCN_MOSART_SGLC_SWAV + + @@ -291,22 +295,24 @@ I1850Clm60BgcNoAnthro - 1850_DATM%GSWP3v1_CLM60%BGC-NOANTHRO_SICE_SOCN_MOSART_SGLC_SWAV + 1850_DATM%GSWP3v1_CLM60%BGC-NOANTHRO_SICE_SOCN_RTM_SGLC_SWAV + I1850Clm60SpNoAnthro - 1850_DATM%GSWP3v1_CLM60%SP-NOANTHRO_SICE_SOCN_MOSART_SGLC_SWAV + 1850_DATM%GSWP3v1_CLM60%SP-NOANTHRO_SICE_SOCN_RTM_SGLC_SWAV + I1850Clm50BgcNoAnthro - 1850_DATM%GSWP3v1_CLM50%BGC-NOANTHRO_SICE_SOCN_MOSART_SGLC_SWAV + 1850_DATM%GSWP3v1_CLM50%BGC-NOANTHRO_SICE_SOCN_RTM_SGLC_SWAV I1850Clm50SpNoAnthro - 1850_DATM%GSWP3v1_CLM50%SP-NOANTHRO_SICE_SOCN_MOSART_SGLC_SWAV + 1850_DATM%GSWP3v1_CLM50%SP-NOANTHRO_SICE_SOCN_RTM_SGLC_SWAV @@ -319,12 +325,15 @@ I1850Clm60SpNoAnthro - 1850_DATM%GSWP3v1_CLM60%SP-NOANTHRO_SICE_SOCN_MOSART_SGLC_SWAV + 1850_DATM%GSWP3v1_CLM60%SP-NOANTHRO_SICE_SOCN_RTM_SGLC_SWAV + IHistClm60Sp HIST_DATM%GSWP3v1_CLM60%SP_SICE_SOCN_MOSART_SGLC_SWAV + + @@ -631,6 +640,17 @@ I1850Clm60BgcCropG 1850_DATM%GSWP3v1_CLM60%BGC-CROP_SICE_SOCN_MOSART_CISM2%GRIS-EVOLVE_SWAV + + + + + + + IHistClm60BgcCropG + HIST_DATM%GSWP3v1_CLM60%BGC-CROP_SICE_SOCN_MOSART_CISM2%GRIS-EVOLVE_SWAV + + + From 6f8021cb9be81521f4f905b27b353ce9de1980be Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Tue, 7 May 2024 03:30:20 -0600 Subject: [PATCH 0190/1248] Start adding reference for LND_SETS_DUST_EMIS_DRV_FLDS in unit tester --- 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 114fb0c36c..30110d92f7 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", NEONSITE=>"" ); + my %env_vars = ( DIN_LOC_ROOT=>"MYDINLOCROOT", GLC_TWO_WAY_COUPLING=>"FALSE", LND_SETS_DUST_EMIS_DRV_FLDS=>"TRUE", NEONSITE=>"" ); # Set any settings that came in from function call foreach my $item ( keys(%settings) ) { $env_vars{$item} = $settings{$item}; From f52f76fc0c71f3521a0680207141b1545dd6098a Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Tue, 7 May 2024 03:31:04 -0600 Subject: [PATCH 0191/1248] Add dust emis namelist default for drv_flds_in --- .../namelist_defaults_dust_emis.xml | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 bld/namelist_files/namelist_defaults_dust_emis.xml diff --git a/bld/namelist_files/namelist_defaults_dust_emis.xml b/bld/namelist_files/namelist_defaults_dust_emis.xml new file mode 100644 index 0000000000..40bf3d9078 --- /dev/null +++ b/bld/namelist_files/namelist_defaults_dust_emis.xml @@ -0,0 +1,21 @@ + + + + + + + + + +Zender_2003 + +atm + + From 2a88002ea1a916d21da69b05c6621774cca74b39 Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Tue, 7 May 2024 10:26:16 -0700 Subject: [PATCH 0192/1248] change lupft check to fbg + luh check to mirror fates-side logic --- src/utils/clmfates_interfaceMod.F90 | 37 ++++++++++++++--------------- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/src/utils/clmfates_interfaceMod.F90 b/src/utils/clmfates_interfaceMod.F90 index b0ae0044f3..048824a83a 100644 --- a/src/utils/clmfates_interfaceMod.F90 +++ b/src/utils/clmfates_interfaceMod.F90 @@ -398,7 +398,6 @@ subroutine CLMFatesGlobals2() integer :: pass_use_potentialveg integer :: pass_num_luh_states integer :: pass_num_luh_transitions - integer :: pass_lupftdat call t_startf('fates_globals2') @@ -704,7 +703,7 @@ subroutine init(this, bounds_proc, flandusepftdat) end if ! Retrieve the landuse x pft static data if the file is present - if (use_fates_lupft) then + if (use_fates_fixed_biogeog .and. use_fates_luh) then call GetLandusePFTData(bounds_proc, flandusepftdat, landuse_pft_map, landuse_bareground) end if @@ -815,23 +814,23 @@ subroutine init(this, bounds_proc, flandusepftdat) this%fates(nc)%sites(s)%lon = grc%londeg(g) ! Transfer the landuse x pft data to fates via bc_in if file is given - if (use_fates_lupft) then - this%fates(nc)%bc_in(s)%pft_areafrac_lu(:,1:num_landuse_pft_vars) = landuse_pft_map(g,:,1:num_landuse_pft_vars) - this%fates(nc)%bc_in(s)%baregroundfrac = landuse_bareground(g) - end if - - if (.not. use_fates_lupft) then - ! initialize static layers for reduced complexity FATES versions from HLM - ! maybe make this into a subroutine of it's own later. - this%fates(nc)%bc_in(s)%pft_areafrac(:)=0._r8 - do m = surfpft_lb,surfpft_ub - ft = m - surfpft_lb - this%fates(nc)%bc_in(s)%pft_areafrac(ft)=wt_nat_patch(g,m) - end do + if (use_fates_fixed_biogeog) then + if (use_fates_luh) then + this%fates(nc)%bc_in(s)%pft_areafrac_lu(:,1:num_landuse_pft_vars) = landuse_pft_map(g,:,1:num_landuse_pft_vars) + this%fates(nc)%bc_in(s)%baregroundfrac = landuse_bareground(g) + else + ! initialize static layers for reduced complexity FATES versions from HLM + ! maybe make this into a subroutine of it's own later. + this%fates(nc)%bc_in(s)%pft_areafrac(:)=0._r8 + do m = surfpft_lb,surfpft_ub + ft = m - surfpft_lb + this%fates(nc)%bc_in(s)%pft_areafrac(ft)=wt_nat_patch(g,m) + end do - if (abs(sum(this%fates(nc)%bc_in(s)%pft_areafrac(surfpft_lb:surfpft_ub)) - 1.0_r8) > sum_to_1_tol) then - write(iulog,*) 'pft_area error in interfc ', s, sum(this%fates(nc)%bc_in(s) %pft_areafrac(:)) - 1.0_r8 - call endrun(msg=errMsg(sourcefile, __LINE__)) + if (abs(sum(this%fates(nc)%bc_in(s)%pft_areafrac(surfpft_lb:surfpft_ub)) - 1.0_r8) > sum_to_1_tol) then + write(iulog,*) 'pft_area error in interfc ', s, sum(this%fates(nc)%bc_in(s) %pft_areafrac(:)) - 1.0_r8 + call endrun(msg=errMsg(sourcefile, __LINE__)) + end if end if end if end do !site @@ -876,7 +875,7 @@ subroutine init(this, bounds_proc, flandusepftdat) call create_fates_fire_data_method( this%fates_fire_data_method ) ! deallocate the local landuse x pft array - if (use_fates_lupft) then + if (use_fates_fixed_biogeog .and. use_fates_luh) then deallocate(landuse_pft_map) deallocate(landuse_bareground) end if From 9b5001d0026e0de26bc0b20608f3924ea0cca214 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Tue, 7 May 2024 17:02:30 -0600 Subject: [PATCH 0193/1248] Fix #2519 so that the mksurfdata_esmf build can work in a CESM checkout --- tools/mksurfdata_esmf/gen_mksurfdata_build | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tools/mksurfdata_esmf/gen_mksurfdata_build b/tools/mksurfdata_esmf/gen_mksurfdata_build index 974c1929a5..864b5915b9 100755 --- a/tools/mksurfdata_esmf/gen_mksurfdata_build +++ b/tools/mksurfdata_esmf/gen_mksurfdata_build @@ -127,7 +127,16 @@ if [ "$existing_bld" = "No" ]; then if [ "$verbose" != "YES" ]; then options="$options --silent" fi - $cwd/../../cime/CIME/scripts/configure --macros-format CMake --machine $MACH $options + # Try finding configure file assuming a CTSM standalone checkout and then try for a CESM checkout + configure="$cwd/../../cime/CIME/scripts/configure" + if [ ! -f "$configure" ]; then + configure="$cwd/../../../../cime/CIME/scripts/configure" + if [ ! -f "$configure" ]; then + echo "Error $configure file does NOT exist in expected location, either for a standalone checkout or CESM/CAM checkout" + exit 1 + fi + fi + $configure --macros-format CMake --machine $MACH $options if [ $? != 0 ]; then echo "Error doing configure for machine name: $MACH" From 89a4d1d0d02b655a10790fdee043dd65f8c65ab5 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Tue, 7 May 2024 17:42:19 -0600 Subject: [PATCH 0194/1248] Update ctsm_sci tests for 3 VR grids --- bld/namelist_files/namelist_defaults_ctsm.xml | 6 +++--- cime_config/config_component.xml | 2 +- cime_config/testdefs/testlist_clm.xml | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index 0f533a56ff..67b21c1259 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -939,12 +939,12 @@ attributes from the config_cache.xml file (with keys converted to upper-case). >hgrid=1.9x2.5 maxpft=17 mask=gx1v7 use_cn=.false. use_crop=.false. irrigate=.true. glc_nec=10 do_transient_pfts=.false. -hgrid=ne0np4.ARCTIC.ne30x4 maxpft=17 mask=tx0.1v2 use_cn=.false. use_crop=.false. irrigate=.true. glc_nec=10 do_transient_pfts=.false. -hgrid=ne0np4.ARCTICGRIS.ne30x8 maxpft=17 mask=tx0.1v2 use_cn=.false. use_crop=.false. irrigate=.true. glc_nec=10 do_transient_pfts=.false. @@ -956,7 +956,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). -hgrid=ne0np4CONUS.ne30x8 maxpft=17 mask=tx0.1v2 use_cn=.false. use_crop=.false. irrigate=.true. glc_nec=10 do_transient_pfts=.false. diff --git a/cime_config/config_component.xml b/cime_config/config_component.xml index 984ba5ecdf..be6916ae0c 100644 --- a/cime_config/config_component.xml +++ b/cime_config/config_component.xml @@ -210,7 +210,7 @@ 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_SSP2-4.5_transient 1850-2100_SSP1-1.9_transient 1850-2100_SSP4-3.4_transient 1850-2100_SSP4-6.0_transient diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index 918d86c213..f8c0a1bd79 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -2034,7 +2034,7 @@ - + @@ -2043,7 +2043,7 @@ - + @@ -2061,7 +2061,7 @@ - + From 0bcf80acea865f2df37d13911aa6b9d167622a66 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Wed, 1 May 2024 16:37:32 -0600 Subject: [PATCH 0195/1248] FatesColdLUH2 tests now use use_fates_nocomp false. --- cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2/user_nl_clm | 1 + 1 file changed, 1 insertion(+) diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2/user_nl_clm index 854c21407f..917ba314b3 100644 --- a/cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2/user_nl_clm +++ b/cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2/user_nl_clm @@ -1 +1,2 @@ use_fates_luh = .true. +use_fates_nocomp = .false. From 0edcb1b5b118c7029807a05e1ce3773396c6ec7f Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Wed, 8 May 2024 10:22:47 -0600 Subject: [PATCH 0196/1248] Update FATES external to latest ckoven/luh2_nocomp_merge. --- Externals_CLM.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Externals_CLM.cfg b/Externals_CLM.cfg index b689141aaf..e1bc1696af 100644 --- a/Externals_CLM.cfg +++ b/Externals_CLM.cfg @@ -2,7 +2,7 @@ local_path = src/fates protocol = git repo_url = https://github.com/ckoven/fates -hash = c1a7453c8331277a156a0ee158a870c1b8598a9f +hash = 153b0bda9c96f18e8d2a93887a082bc7a31b574b required = True [externals_description] From b64ceb6b1f7a5a462842c88861f2c5becc7e8c1e Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Wed, 8 May 2024 11:05:37 -0600 Subject: [PATCH 0197/1248] Change an expected failure "status" from PEND to FAIL --- cime_config/testdefs/ExpectedTestFails.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cime_config/testdefs/ExpectedTestFails.xml b/cime_config/testdefs/ExpectedTestFails.xml index fe6a54c221..e346e6e7af 100644 --- a/cime_config/testdefs/ExpectedTestFails.xml +++ b/cime_config/testdefs/ExpectedTestFails.xml @@ -31,7 +31,7 @@ - PEND + FAIL #2460 From 92fb80687f707c1799cacea85bc64bc9c1cd9f89 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Wed, 8 May 2024 13:25:19 -0600 Subject: [PATCH 0198/1248] Update FatesColdLUH2 testdef. --- .../testmods_dirs/clm/FatesColdLUH2/user_nl_clm | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2/user_nl_clm index 917ba314b3..970e7df7cd 100644 --- a/cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2/user_nl_clm +++ b/cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2/user_nl_clm @@ -1,2 +1,11 @@ + +! Run a transient case, with vegetation starting from bare ground, but land use starting from LUH state vector on starting date, in a nocomp configuration. +! From Charlie's list of valid FATES configurations: +! https://docs.google.com/spreadsheets/d/1eE3sRMYxfocZKbT8uIQhXpjjtfM2feXPRSWXJNoo4jM/edit#gid=0 +flandusepftdat = '$DIN_LOC_ROOT/lnd/clm2/surfdata_map/fates-sci.1.73.0_api.36.0.0/fates_landuse_pft_map_4x5_240206.nc' use_fates_luh = .true. -use_fates_nocomp = .false. +use_fates_nocomp = .true. +use_fates_fixed_biogeog = .true. +use_fates_sp = .false. +use_fates_potentialveg = .false. +fluh_timeseries = '$DIN_LOC_ROOT/lnd/clm2/surfdata_map/fates-sci.1.68.3_api.31.0.0_tools.1.0.1/LUH2_states_transitions_management.timeseries_4x5_hist_simyr1850-2015_c231101.nc' From f6728017c7726f947492179f88031cccfa81181f Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Wed, 8 May 2024 13:26:56 -0600 Subject: [PATCH 0199/1248] Add FatesColdLUH2Mode0 testdef. --- cime_config/testdefs/testlist_clm.xml | 9 +++++++++ .../clm/FatesColdLUH2Mode0/include_user_mods | 1 + .../testmods_dirs/clm/FatesColdLUH2Mode0/user_nl_clm | 1 + 3 files changed, 11 insertions(+) create mode 100644 cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2Mode0/include_user_mods create mode 100644 cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2Mode0/user_nl_clm diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index 4184cc7e1f..022bb9ad73 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -2910,6 +2910,15 @@ + + + + + + + + + diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2Mode0/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2Mode0/include_user_mods new file mode 100644 index 0000000000..7eb8bb1579 --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2Mode0/include_user_mods @@ -0,0 +1 @@ +../FatesColdLUH2 diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2Mode0/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2Mode0/user_nl_clm new file mode 100644 index 0000000000..929a8e6e14 --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2Mode0/user_nl_clm @@ -0,0 +1 @@ +fates_harvest_mode = 0 From f33040751bcf1fdb566119f6f91d5c9695e97386 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 8 May 2024 13:55:17 -0600 Subject: [PATCH 0200/1248] Change comments about clm5_1 to clm6_0 --- cime_config/testdefs/testlist_clm.xml | 32 +++++++++++++-------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index 56ba176cfe..5350b4716b 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -312,14 +312,14 @@ - + - + @@ -328,7 +328,7 @@ - + @@ -337,7 +337,7 @@ - + @@ -346,7 +346,7 @@ - + @@ -586,14 +586,14 @@ - + - + @@ -602,7 +602,7 @@ - + @@ -749,14 +749,14 @@ - + - + @@ -765,7 +765,7 @@ - + @@ -2108,14 +2108,14 @@ - + - + @@ -2124,7 +2124,7 @@ - + @@ -2798,7 +2798,7 @@ - + @@ -2808,7 +2808,7 @@ - + From 524cbc06a30a6820f72c60e9c44d9748977afe48 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 8 May 2024 13:58:33 -0600 Subject: [PATCH 0201/1248] Revert order of irrigate and add note that it's also set in the use-cases --- 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 25b0c80cf9..6f2f265da4 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -115,10 +115,10 @@ attributes from the config_cache.xml file (with keys converted to upper-case). lnd/clm2/isotopes/atm_delta_C14_CMIP6_SSP534os_3x1_global_1850-2100_yearly_c181209.nc lnd/clm2/isotopes/atm_delta_C14_CMIP6_SSP5B_3x1_global_1850-2100_yearly_c181209.nc - + +.false. .true. .false. -.false. .false. From b9e947d76e40fbf39c0bdcfbae3de9e14b751b1c Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 8 May 2024 16:58:20 -0600 Subject: [PATCH 0202/1248] Get mksurfdata_esmf build and namelist build working under a CESM checkout --- python/ctsm/.pylintrc | 2 ++ python/ctsm/toolchain/gen_mksurfdata_namelist.py | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/python/ctsm/.pylintrc b/python/ctsm/.pylintrc index db78949288..230f8acba8 100644 --- a/python/ctsm/.pylintrc +++ b/python/ctsm/.pylintrc @@ -436,6 +436,8 @@ good-names=i, ds, m, n, + ni, + nj, l1, l2, ax, diff --git a/python/ctsm/toolchain/gen_mksurfdata_namelist.py b/python/ctsm/toolchain/gen_mksurfdata_namelist.py index 8a953c39df..361616419f 100755 --- a/python/ctsm/toolchain/gen_mksurfdata_namelist.py +++ b/python/ctsm/toolchain/gen_mksurfdata_namelist.py @@ -12,7 +12,7 @@ from datetime import datetime import netCDF4 -from ctsm.path_utils import path_to_ctsm_root +from ctsm.path_utils import path_to_ctsm_root, path_to_cime from ctsm.ctsm_logging import setup_logging_pre_config, add_logging_args, process_logging_args logger = logging.getLogger(__name__) @@ -326,7 +326,7 @@ def main(): ) # determine output mesh - determine_output_mesh(res, force_model_mesh_file, input_path, rawdata_files, tool_path) + determine_output_mesh(res, force_model_mesh_file, input_path, rawdata_files) # Determine num_pft if nocrop_flag: @@ -752,11 +752,11 @@ def handle_transient_run( return landuse_fname, must_run_download_input_data -def determine_output_mesh(res, force_model_mesh_file, input_path, rawdata_files, tool_path): +def determine_output_mesh(res, force_model_mesh_file, input_path, rawdata_files): """ determine output mesh """ - xml_path = os.path.join(tool_path, "../../ccs_config/component_grids_nuopc.xml") + xml_path = os.path.join(path_to_cime(), "../ccs_config/component_grids_nuopc.xml") tree2 = ET.parse(xml_path) root = tree2.getroot() model_mesh = "" From 7d91ac1d991003e9c953f5e1bb903064d789e1bd Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 8 May 2024 17:16:23 -0600 Subject: [PATCH 0203/1248] Correct clm60 typo in testlist --- cime_config/testdefs/testlist_clm.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index 5350b4716b..75bdf63e19 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -331,22 +331,22 @@ - + - + - + - + From 010a008396e8edab3870270da919a706a543ee71 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 8 May 2024 17:32:03 -0600 Subject: [PATCH 0204/1248] Add a description and usage and error check command line args --- bld/unit_testers/cmp_baseline_lnd_in_files.sh | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/bld/unit_testers/cmp_baseline_lnd_in_files.sh b/bld/unit_testers/cmp_baseline_lnd_in_files.sh index de32cddf76..ebeeffc72a 100755 --- a/bld/unit_testers/cmp_baseline_lnd_in_files.sh +++ b/bld/unit_testers/cmp_baseline_lnd_in_files.sh @@ -1,15 +1,39 @@ #!/bin/bash +# +# A simple script to compare lnd_in namelists between two baselines on Derecho +# +#---------------------------------------------------------------------- +# Usage subroutine +usage() { + echo "" + echo "***********************************************************************" + echo "usage:" + echo "./cmp_baseline_lnd_in_files.sh " + echo " " + echo "Compares lnd_in files between two baselines on Derecho" + echo "***********************************************************************" +} + +#---------------------------------------------------------------------- + +if [ "$#" -ne 2 ]; then + echo "Need to give two baseline directories to compare" + usage + exit 1 +fi baseline=$1 compare=$2 cwd=`pwd` if [ -z "$1" ]; then echo "Need to enter a baseline directory tag name" + usage exit 1 fi if [ -z "$2" ]; then echo "Need to enter a comparison directory tag name" + usage exit 1 fi @@ -22,6 +46,7 @@ fi comp_root=$BASELINE_ROOT/$compare if ! test -d "$comp_root"; then echo "Root comparison directory of $comp_root does NOT exist" + usage exit 1 fi cd $root From fc0261376e1499fe06d6b41adfc3c2270bd373a6 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 8 May 2024 17:47:52 -0600 Subject: [PATCH 0205/1248] Adjustments to the testlist Make sure CESM testing compsets with cam6 forcing are being exercised. Update NoAnthro to Clm60. --- cime_config/testdefs/testlist_clm.xml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index 75bdf63e19..1b825f0d40 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -21,11 +21,10 @@ - + - - + @@ -33,6 +32,15 @@ + + + + + + + + + @@ -141,6 +149,7 @@ + From f8c6a49539c3b1ce86dd2ca491c953b0c8856766 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Thu, 9 May 2024 02:05:20 -0600 Subject: [PATCH 0206/1248] Add a ctsm_sci test for I1850Clm50BgcCropG to verify that current B1850 will work --- 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 1b825f0d40..f0dc3ee270 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -576,6 +576,15 @@ + + + + + + + + + From 05332fb117e7ed94abcc09c5c66f5db8d8885638 Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Thu, 9 May 2024 10:53:59 -0700 Subject: [PATCH 0207/1248] Remove get_do_harvest dependency for fates harvest modes --- src/dyn_subgrid/dynSubgridDriverMod.F90 | 7 ++- src/utils/clmfates_interfaceMod.F90 | 71 +++++++++---------------- 2 files changed, 32 insertions(+), 46 deletions(-) diff --git a/src/dyn_subgrid/dynSubgridDriverMod.F90 b/src/dyn_subgrid/dynSubgridDriverMod.F90 index e5ca3f002e..b12b135b59 100644 --- a/src/dyn_subgrid/dynSubgridDriverMod.F90 +++ b/src/dyn_subgrid/dynSubgridDriverMod.F90 @@ -89,6 +89,11 @@ subroutine dynSubgrid_init(bounds_proc, glc_behavior, crop_inst) ! Note that dynpft_init needs to be called from outside any loops over clumps - so ! this routine needs to be called from outside any loops over clumps. ! + ! + ! !USES: + use clm_varctl , only : fates_harvest_mode + use dynFATESLandUseChangeMod , only : fates_harvest_clmlanduse + ! ! !ARGUMENTS: type(bounds_type) , intent(in) :: bounds_proc ! processor-level bounds type(glc_behavior_type) , intent(in) :: glc_behavior @@ -123,7 +128,7 @@ subroutine dynSubgrid_init(bounds_proc, glc_behavior, crop_inst) ! flanduse_timeseries file. However, this could theoretically be changed so that the ! harvest data were separated from the pftdyn data, allowing them to differ in the ! years over which they apply. - if (get_do_harvest()) then + if (get_do_harvest() .or. fates_harvest_mode >= fates_harvest_clmlanduse) then call dynHarvest_init(bounds_proc, harvest_filename=get_flanduse_timeseries()) end if diff --git a/src/utils/clmfates_interfaceMod.F90 b/src/utils/clmfates_interfaceMod.F90 index 048824a83a..308d5cee8e 100644 --- a/src/utils/clmfates_interfaceMod.F90 +++ b/src/utils/clmfates_interfaceMod.F90 @@ -169,7 +169,6 @@ module CLMFatesInterfaceMod use FATESFireBase , only : fates_fire_base_type use FATESFireFactoryMod , only : no_fire, scalar_lightning, successful_ignitions,& anthro_ignitions, anthro_suppression - use dynSubgridControlMod , only : get_do_harvest use dynHarvestMod , only : num_harvest_inst, harvest_varnames use dynHarvestMod , only : harvest_units, mass_units, unitless_units use dynHarvestMod , only : dynHarvest_interp_resolve_harvesttypes @@ -185,6 +184,7 @@ module CLMFatesInterfaceMod use dynFATESLandUseChangeMod, only : dynFatesLandUseInterp use dynFATESLandUseChangeMod, only : num_landuse_harvest_vars use dynFATESLandUseChangeMod, only : fates_harvest_no_logging + use dynFATESLandUseChangeMod, only : fates_harvest_clmlanduse use dynFATESLandUseChangeMod, only : fates_harvest_luh_area use dynFATESLandUseChangeMod, only : landuse_harvest use dynFATESLandUseChangeMod, only : landuse_harvest_units @@ -489,13 +489,6 @@ subroutine CLMFatesGlobals2() end if call set_fates_ctrlparms('use_ed_st3',ival=pass_ed_st3) - if (fates_harvest_mode > fates_harvest_no_logging) then - pass_logging = 1 - else - pass_logging = 0 - end if - call set_fates_ctrlparms('use_logging',ival=pass_logging) - if(use_fates_ed_prescribed_phys) then pass_ed_prescribed_phys = 1 else @@ -517,39 +510,28 @@ subroutine CLMFatesGlobals2() end if call set_fates_ctrlparms('use_cohort_age_tracking',ival=pass_cohort_age_tracking) - ! check fates logging namelist value first because hlm harvest can override it + ! FATES logging and harvest modes if (fates_harvest_mode > fates_harvest_no_logging) then - pass_logging = 1 - else - pass_logging = 0 - end if - - if(get_do_harvest()) then - pass_logging = 1 - pass_num_lu_harvest_cats = num_harvest_inst - pass_lu_harvest = 1 - else - pass_lu_harvest = 0 - pass_num_lu_harvest_cats = 0 - end if + pass_logging = 1 ! Time driven logging, without landuse harvest + ! CLM landuse timeseries driven harvest rates + if (fates_harvest_mode == fates_harvest_clmlanduse) + pass_num_lu_harvest_cats = num_harvest_inst + pass_lu_harvest = 1 + + ! LUH2 landuse timeseries driven harvest rates + else if (fates_harvest_mode >= fates_harvest_luh_area) then + pass_lu_harvest = 1 + pass_num_lu_harvest_types = num_landuse_harvest_vars + else + pass_lu_harvest = 0 + pass_num_lu_harvest_cats = 0 + end if + ! FATES landuse modes if(use_fates_luh) then pass_use_luh = 1 pass_num_luh_states = num_landuse_state_vars pass_num_luh_transitions = num_landuse_transition_vars - - ! Do not set harvest passing variables to zero not in luh harvest modes - ! as the user may want to use the CLM landuse harvest with luh2 transitions - if(fates_harvest_mode >= fates_harvest_luh_area) then - ! End the run if do_harvest is true with this run mode. - ! This should be caught be the build namelist. - if(get_do_harvest()) then - call endrun(msg="do_harvest and fates_harvest_mode using luh2 harvest data are incompatible"//& - errmsg(sourcefile, __LINE__)) - else - pass_lu_harvest = 1 - end if - end if else pass_use_luh = 0 pass_num_luh_states = 0 @@ -567,8 +549,7 @@ subroutine CLMFatesGlobals2() end if call set_fates_ctrlparms('use_fates_potentialveg',ival=pass_use_potentialveg) - ! Wait to set the harvest and logging variables after checking get_do_harvest - ! and fates_harvest_modes + ! Wait to set the harvest and logging variables after checking fates_harvest_modes call set_fates_ctrlparms('use_lu_harvest',ival=pass_lu_harvest) call set_fates_ctrlparms('num_lu_harvest_cats',ival=pass_num_lu_harvest_cats) call set_fates_ctrlparms('use_logging',ival=pass_logging) @@ -996,7 +977,8 @@ subroutine dynamics_driv(this, nc, bounds_clump, & ! Set the FATES global time and date variables call GetAndSetTime - if (get_do_harvest()) then + ! Get harvest rates for CLM landuse timeseries driven rates + if (fates_harvest_mode == fates_harvest_clmlanduse) call dynHarvest_interp_resolve_harvesttypes(bounds_clump, & harvest_rates=harvest_rates(begg:endg,1:num_harvest_inst), & after_start_of_harvest_ts=after_start_of_harvest_ts) @@ -1122,7 +1104,7 @@ subroutine dynamics_driv(this, nc, bounds_clump, & ! for now there is one veg column per gridcell, so store all harvest data in each site ! this will eventually change ! today's hlm harvest flag needs to be set no matter what - if (get_do_harvest()) then + if (fates_harvest_mode == fates_harvest_clmlanduse) if (after_start_of_harvest_ts) then this%fates(nc)%bc_in(s)%hlm_harvest_rates(1:num_harvest_inst) = harvest_rates(g,1:num_harvest_inst) else @@ -1140,6 +1122,11 @@ subroutine dynamics_driv(this, nc, bounds_clump, & write(iulog,*) harvest_units call endrun(msg=errMsg(sourcefile, __LINE__)) end if + + else if (fates_harvest_mode >= fates_harvest_luh_area) then + this%fates(nc)%bc_in(s)%hlm_harvest_rates = landuse_harvest(:,g) + this%fates(nc)%bc_in(s)%hlm_harvest_catnames = landuse_harvest_varnames + this%fates(nc)%bc_in(s)%hlm_harvest_units = landuse_harvest_units endif if (use_fates_luh) then @@ -1147,12 +1134,6 @@ subroutine dynamics_driv(this, nc, bounds_clump, & this%fates(nc)%bc_in(s)%hlm_luh_state_names = landuse_state_varnames this%fates(nc)%bc_in(s)%hlm_luh_transitions = landuse_transitions(:,g) this%fates(nc)%bc_in(s)%hlm_luh_transition_names = landuse_transition_varnames - - if (fates_harvest_mode >= fates_harvest_luh_area) then - this%fates(nc)%bc_in(s)%hlm_harvest_rates = landuse_harvest(:,g) - this%fates(nc)%bc_in(s)%hlm_harvest_catnames = landuse_harvest_varnames - this%fates(nc)%bc_in(s)%hlm_harvest_units = landuse_harvest_units - end if end if end do From a35f91d53444c2ac7af2ee1434ae0f85431208b4 Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Thu, 9 May 2024 11:15:18 -0700 Subject: [PATCH 0208/1248] fix check to be only during use of clm landuse timeseries for fates --- src/dyn_subgrid/dynSubgridDriverMod.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dyn_subgrid/dynSubgridDriverMod.F90 b/src/dyn_subgrid/dynSubgridDriverMod.F90 index b12b135b59..162247a0ff 100644 --- a/src/dyn_subgrid/dynSubgridDriverMod.F90 +++ b/src/dyn_subgrid/dynSubgridDriverMod.F90 @@ -128,7 +128,7 @@ subroutine dynSubgrid_init(bounds_proc, glc_behavior, crop_inst) ! flanduse_timeseries file. However, this could theoretically be changed so that the ! harvest data were separated from the pftdyn data, allowing them to differ in the ! years over which they apply. - if (get_do_harvest() .or. fates_harvest_mode >= fates_harvest_clmlanduse) then + if (get_do_harvest() .or. fates_harvest_mode == fates_harvest_clmlanduse) then call dynHarvest_init(bounds_proc, harvest_filename=get_flanduse_timeseries()) end if From 74e86669d21c18043a057d955f55e17bd5e7913e Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Thu, 9 May 2024 11:48:57 -0700 Subject: [PATCH 0209/1248] fix passing num landuse harvest vars to the fates landuse harvest categories --- src/utils/clmfates_interfaceMod.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/clmfates_interfaceMod.F90 b/src/utils/clmfates_interfaceMod.F90 index 308d5cee8e..cd94b6a15c 100644 --- a/src/utils/clmfates_interfaceMod.F90 +++ b/src/utils/clmfates_interfaceMod.F90 @@ -521,7 +521,7 @@ subroutine CLMFatesGlobals2() ! LUH2 landuse timeseries driven harvest rates else if (fates_harvest_mode >= fates_harvest_luh_area) then pass_lu_harvest = 1 - pass_num_lu_harvest_types = num_landuse_harvest_vars + pass_num_lu_harvest_cats = num_landuse_harvest_vars else pass_lu_harvest = 0 pass_num_lu_harvest_cats = 0 From fd07890223b3e92d91caa1a034055d1184bcff2e Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Thu, 9 May 2024 11:51:20 -0700 Subject: [PATCH 0210/1248] fix missing end if --- src/utils/clmfates_interfaceMod.F90 | 1 + 1 file changed, 1 insertion(+) diff --git a/src/utils/clmfates_interfaceMod.F90 b/src/utils/clmfates_interfaceMod.F90 index cd94b6a15c..b9e9bf3031 100644 --- a/src/utils/clmfates_interfaceMod.F90 +++ b/src/utils/clmfates_interfaceMod.F90 @@ -526,6 +526,7 @@ subroutine CLMFatesGlobals2() pass_lu_harvest = 0 pass_num_lu_harvest_cats = 0 end if + end if ! FATES landuse modes if(use_fates_luh) then From c37f743023dc4bf8fd26b7bd88336cbb7bc61d68 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Thu, 9 May 2024 14:57:59 -0600 Subject: [PATCH 0211/1248] Add more tests of finidat file settings, a bunch of things fail because of a problem in the use-case changes I made --- bld/unit_testers/build-namelist_test.pl | 164 ++++++++++++++++-------- 1 file changed, 114 insertions(+), 50 deletions(-) diff --git a/bld/unit_testers/build-namelist_test.pl b/bld/unit_testers/build-namelist_test.pl index 74dbcef3f4..2b65b18f38 100755 --- a/bld/unit_testers/build-namelist_test.pl +++ b/bld/unit_testers/build-namelist_test.pl @@ -163,10 +163,10 @@ sub cat_and_create_namelistinfile { # # Figure out number of tests that will run # -my $ntests = 3665; +my $ntests = 3385; if ( defined($opts{'compare'}) ) { - $ntests += 2313; + $ntests += 2097; } plan( tests=>$ntests ); @@ -1424,7 +1424,7 @@ sub cat_and_create_namelistinfile { print " Test all use-cases over all physics options\n"; print "==================================================\n"; -# Run over all use-cases... +# Run over all use-cases for f09 and all physics... my $list = `$bldnml -use_case list 2>&1 | grep "use case"`; my @usecases; if ( $list =~ /build-namelist : use cases : (.+)$/ ) { @@ -1436,27 +1436,128 @@ sub cat_and_create_namelistinfile { print "use-cases = @usecases\n"; die "ERROR:: Number of use-cases isn't what's expected\n"; } +my @expect_fails = ( "1850-2100_SSP5-3.4_transient", "1850-2100_SSP4-3.4", "1850-2100_SSP1-1.9_transient", + "1850-2100_SSP4-6.0_transient" ); foreach my $phys ( "clm4_5", "clm5_0", "clm5_1", "clm6_0" ) { print "physics = $phys\n"; foreach my $usecase ( @usecases ) { print "usecase = $usecase\n"; - $options = "-use_case $usecase -envxml_dir ."; + $options = "-res 0.9x1.25 -use_case $usecase -envxml_dir ."; &make_env_run(); eval{ system( "$bldnml $options > $tempfile 2>&1 " ); }; - is( $@, '', "options: $options" ); - $cfiles->checkfilesexist( "$options", $mode ); - $cfiles->shownmldiff( "default", "standard" ); - if ( defined($opts{'compare'}) ) { - $cfiles->doNOTdodiffonfile( "$tempfile", "$options", $mode ); - $cfiles->comparefiles( "$options", $mode, $opts{'compare'} ); + my $expect_fail = 0; + foreach my $failusecase ( @expect_fails ) { + if ( $failusecase eq $usecase ) { + $expect_fail = 1; + } } - if ( defined($opts{'generate'}) ) { - $cfiles->copyfiles( "$options", $mode ); + if ( not $expect_fail ) { + is( $@, '', "options: $options" ); + $cfiles->checkfilesexist( "$options", $mode ); + $cfiles->shownmldiff( "default", "standard" ); + if ( defined($opts{'compare'}) ) { + $cfiles->doNOTdodiffonfile( "$tempfile", "$options", $mode ); + $cfiles->comparefiles( "$options", $mode, $opts{'compare'} ); + } + if ( defined($opts{'generate'}) ) { + $cfiles->copyfiles( "$options", $mode ); + } + } else { + isnt( $@, '', "options: $options" ); } &cleanup(); } } +print "\n=======================================================================================\n"; +print " Test the seperate initial condition files, for ones not tested elsewhere\n"; +print "=========================================================================================\n"; + +my %finidat_files = ( + "f091850Clm45BgcGSW" =>{ phys =>"clm4_5", + atm_forc=>"GSWP3v1", + res => "0.9x1.25", + bgc => "bgc", + use_case => "1850_control", + start_ymd => "18500101", + }, + "f091850Clm45BgcCRU" =>{ phys =>"clm4_5", + atm_forc=>"CRUv7", + res => "0.9x1.25", + bgc => "bgc", + use_case => "1850_control", + start_ymd => "18500101", + }, + "f091850Clm45BgcCAM6" =>{ phys =>"clm4_5", + atm_forc=>"cam6.0", + res => "0.9x1.25", + bgc => "bgc", + use_case => "1850_control", + start_ymd => "18500101", + }, + "f091850Clm50BgcGSW" =>{ phys =>"clm5_0", + atm_forc=>"GSWP3v1", + res => "0.9x1.25", + bgc => "bgc", + use_case => "1850_control", + start_ymd => "18500101", + }, + "f091850Clm50SpGSW" =>{ phys =>"clm5_0", + atm_forc=>"GSWP3v1", + res => "0.9x1.25", + bgc => "sp", + use_case => "1850_control", + start_ymd => "18500101", + }, + "f091850Clm50BgcCRU" =>{ phys =>"clm5_0", + atm_forc=>"CRUv7", + res => "0.9x1.25", + bgc => "bgc", + use_case => "1850_control", + start_ymd => "18500101", + }, + "f091850Clm50SpCRU" =>{ phys =>"clm5_0", + atm_forc=>"CRUv7", + res => "0.9x1.25", + bgc => "sp", + use_case => "1850_control", + start_ymd => "18500101", + }, + "f091850Clm50BgcCAM6" =>{ phys =>"clm5_0", + atm_forc=>"cam6.0", + res => "0.9x1.25", + bgc => "bgc", + use_case => "1850_control", + start_ymd => "18500101", + }, + ); + +foreach my $key ( keys(%finidat_files) ) { + print( "$key\n" ); + my $phys = $finidat_files{$key}{'phys'}; + print "physics = $phys\n"; + &make_config_cache($phys); + my $usecase = $finidat_files{$key}{'use_case'}; + my $bgc = $finidat_files{$key}{'bgc'}; + my $res = $finidat_files{$key}{'res'}; + my $start_ymd = $finidat_files{$key}{'start_ymd'}; + my $lnd_tuning_mode = "${phys}_" . $finidat_files{$key}{'atm_forc'}; + $options = "-bgc $bgc -res $res -use_case $usecase -envxml_dir . --lnd_tuning_mode $lnd_tuning_mode -namelist '&a start_ymd=$start_ymd/'"; + &make_env_run(); + eval{ system( "$bldnml $options > $tempfile 2>&1 " ); }; + is( $@, '', "options: $options" ); + $cfiles->checkfilesexist( "$options", $mode ); + $cfiles->shownmldiff( "default", "standard" ); + if ( defined($opts{'compare'}) ) { + $cfiles->doNOTdodiffonfile( "$tempfile", "$options", $mode ); + $cfiles->comparefiles( "$options", $mode, $opts{'compare'} ); + } + if ( defined($opts{'generate'}) ) { + $cfiles->copyfiles( "$options", $mode ); + } + &cleanup(); +} + print "\n==================================================\n"; print "Test crop resolutions \n"; print "==================================================\n"; @@ -1519,7 +1620,7 @@ sub cat_and_create_namelistinfile { "20thC_transient", ); foreach my $res ( @glc_res ) { - foreach my $usecase ( @usecases ) { + foreach my $usecase ( @use_cases ) { my $startymd = undef; if ( ($usecase eq "1850_control") || ($usecase eq "20thC_transient") ) { $startymd = 18500101; @@ -1591,43 +1692,6 @@ sub cat_and_create_namelistinfile { # # End loop over versions # -# -# Test ALL SSP's for f09... -# -$phys = "clm6_0"; -$mode = "-phys $phys"; -&make_config_cache($phys); -my $res = "0.9x1.25"; -foreach my $usecase ( "1850-2100_SSP5-8.5_transient", "1850-2100_SSP2-4.5_transient", "1850-2100_SSP1-2.6_transient", "1850-2100_SSP3-7.0_transient" ) { - $options = "-res $res -bgc bgc -crop -use_case $usecase -envxml_dir . -namelist '&a start_ymd=20150101/'"; - &make_env_run(); - eval{ system( "$bldnml $options > $tempfile 2>&1 " ); }; - is( $@, '', "$options" ); - $cfiles->checkfilesexist( "$options", $mode ); - $cfiles->shownmldiff( "default", "standard" ); - if ( defined($opts{'compare'}) ) { - $cfiles->doNOTdodiffonfile( "$tempfile", "$options", $mode ); - $cfiles->comparefiles( "$options", $mode, $opts{'compare'} ); - } - if ( defined($opts{'generate'}) ) { - $cfiles->copyfiles( "$options", $mode ); - } - &cleanup(); -} - -# The SSP's that fail because of missing ndep files... -$phys = "clm5_0"; -$mode = "-phys $phys"; -&make_config_cache($phys); -my $res = "0.9x1.25"; -foreach my $usecase ( "1850-2100_SSP5-3.4_transient", "1850-2100_SSP4-3.4", "1850-2100_SSP1-1.9_transient", - "1850-2100_SSP4-6.0_transient" ) { - $options = "-res $res -bgc bgc -crop -use_case $usecase -envxml_dir . -namelist '&a start_ymd=20150101/'"; - &make_env_run(); - eval{ system( "$bldnml $options > $tempfile 2>&1 " ); }; - isnt( $?, 0, $usecase ); - system( "cat $tempfile" ); -} print "\n==================================================\n"; print "Test clm4.5/clm5.0/clm5_1/clm6_0 resolutions \n"; From f9974947dfebaba2c02bca5c3c87f0a2424b2849 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Thu, 9 May 2024 15:14:30 -0600 Subject: [PATCH 0212/1248] Updated ChangeLog/ChangeSum --- doc/ChangeLog | 105 ++++++++++++++++++++++++++++++++++++++++++++++++++ doc/ChangeSum | 1 + 2 files changed, 106 insertions(+) diff --git a/doc/ChangeLog b/doc/ChangeLog index e0a5e45cb6..3307c8df88 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,4 +1,109 @@ =============================================================== +Tag name: ctsm5.2.004 +Originator(s): slevis (Samuel Levis,UCAR/TSS,303-665-1310) +Date: Thu 09 May 2024 03:10:52 PM MDT +One-line Summary: CTSM5.2 1979 fsurdat and 1979-2026 landuse ne0np4 files + two fixes + +Purpose and description of changes +---------------------------------- + + Includes work by multiple people: + @slevis-lmwg: new fsurdat/landuse files and corresponding infrastructure for + the three so-called VR grids (ne0np4) + @samsrabin: a subset_data fix + @olyson: corrections to a couple of history long-names and updates to + history_fields_fates.rst and history_fields_nofates.rst + + +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_1 + +[ ] clm5_0 + +[ ] ctsm5_0-nwp + +[ ] clm4_5 + + +Bugs fixed +---------- +List of CTSM issues fixed (include CTSM Issue # and description) [one per line]: + Fixes #2487 VR grids + Fixes #2527 subset_data is broken + Fixes #2511 a hist long name is incorrect + Fixes #2506 a hist long name is incorrect + +Notes of particular relevance for users +--------------------------------------- +Changes made to namelist defaults (e.g., changed parameter values): + The so-called VR grids now use 1979 fsurdat files for 1850 compsets + and 1979-2026 landuse for historical compsets. The latter cross over into + SSP years and use SSP2-4.5 for that. + +Changes to the datasets (e.g., parameter, surface or initial files): + Same comment. + +Changes to documentation: + See Purpose and Description above. + +Substantial timing or memory changes: + Not considered. + +Notes of particular relevance for developers: +--------------------------------------------- +Changes to tests or testing: + Updated the ctsm_sci tests for the three VR 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 - PASS + + 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 + + any other testing (give details below): + + ctsm_sci + derecho ---- OK + + +Answer changes +-------------- + +Changes answers relative to baseline: NO + + However, note that the ctsm_sci test-suite showed diffs in + - Fates cases as expected since the last available baseline was ctsm_sci-ctsm5.2.0. + - the preexisting VR grid test for 1850 as expected since the fsurdat changed to 1979. + +Other details +------------- +Pull Requests that document the changes (include PR ids): + https://github.com/ESCOMP/ctsm/pull/2590 + https://github.com/ESCOMP/ctsm/pull/2512 + https://github.com/ESCOMP/ctsm/pull/2528 + +=============================================================== +=============================================================== Tag name: ctsm5.2.003 Originator(s): samrabin (Sam Rabin, UCAR/TSS, samrabin@ucar.edu) Date: Thu May 2 14:06:54 MDT 2024 diff --git a/doc/ChangeSum b/doc/ChangeSum index b48e04889d..17ad670f17 100644 --- a/doc/ChangeSum +++ b/doc/ChangeSum @@ -1,5 +1,6 @@ Tag Who Date Summary ============================================================================================================================ + ctsm5.2.004 multiple 05/09/2024 CTSM5.2 1979 fsurdat and 1979-2026 landuse ne0np4 files + two fixes ctsm5.2.003 samrabin 05/02/2024 Merge b4b-dev ctsm5.2.002 glemieux 04/26/2024 FATES default allometry parameter file update ctsm5.2.001 erik 04/22/2024 Merge b4b-dev From 72ed62381b8312b0f0355b938d30c8b1a852cb31 Mon Sep 17 00:00:00 2001 From: loaner Date: Thu, 9 May 2024 16:25:53 -0700 Subject: [PATCH 0213/1248] update do_harvest to not be compatible with fates --- bld/CLMBuildNamelist.pm | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index 54f0c0c997..e422109078 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -2932,7 +2932,7 @@ sub setup_logic_do_harvest { $cannot_be_true = "$var can only be set to true when running a transient case (flanduse_timeseries non-blank)"; } - elsif (!&value_is_true($nl->get_value('use_cn')) && !&value_is_true($nl->get_value('use_fates'))) { + elsif (!&value_is_true($nl->get_value('use_cn')) && &value_is_true($nl->get_value('use_fates'))) { $cannot_be_true = "$var can only be set to true when running with either CN or FATES"; } @@ -4486,22 +4486,12 @@ sub setup_logic_fates { # Check fates_harvest_mode compatibility my $var = "fates_harvest_mode"; if ( defined($nl->get_value($var)) ) { - # using fates_harvest_mode with CLM landuse driver data - for user convienence - # if ( $nl->get_value($var) == 2) { - # # Make sure that do_harvest is set to true - # if ( ! &value_is_true($nl->get_value('do_harvest')) ) { - # $log->fatal_error("do_harvest must be true when $var is equal to 2" ); - # } # using fates_harvest mode with raw luh2 harvest data if ( $nl->get_value($var) > 2) { # Make sure that use_fates_luh is true when using raw fates luh2 harvest data if ( ! &value_is_true($nl->get_value('use_fates_luh')) ) { $log->fatal_error("use_fates_luh is required to be true when $var is greater than 2" ); } - # do_harvest can not be on if we are using the raw fates luh2 harvest data - if ( &value_is_true($nl->get_value('do_harvest')) ) { - $log->fatal_error("do_harvest can not be true when $var is greater than 2" ); - } } } } From cf1a297864938fae60288ce742adfb2150e5caf8 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Thu, 9 May 2024 17:28:23 -0600 Subject: [PATCH 0214/1248] Update Externals.cfg to cesm2_3_beta17 --- Externals.cfg | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Externals.cfg b/Externals.cfg index 185f412cab..80bfb45db8 100644 --- a/Externals.cfg +++ b/Externals.cfg @@ -8,7 +8,7 @@ required = True local_path = components/cism protocol = git repo_url = https://github.com/ESCOMP/CISM-wrapper -tag = cismwrap_2_1_99 +tag = cismwrap_2_1_100 externals = Externals_CISM.cfg required = True @@ -29,12 +29,12 @@ required = True [mizuRoute] local_path = components/mizuRoute protocol = git -repo_url = https://github.com/nmizukami/mizuRoute -hash = 34723c2 +repo_url = https://github.com/ESCOMP/mizuRoute +hash = 81c720c required = True [ccs_config] -tag = ccs_config_cesm0.0.92 +tag = ccs_config_cesm0.0.106 protocol = git repo_url = https://github.com/ESMCI/ccs_config_cesm.git local_path = ccs_config @@ -44,18 +44,18 @@ required = True local_path = cime protocol = git repo_url = https://github.com/ESMCI/cime -tag = cime6.0.217_httpsbranch03 +tag = cime6.0.238_httpsbranch01 required = True [cmeps] -tag = cmeps0.14.50 +tag = cmeps0.14.60 protocol = git repo_url = https://github.com/ESCOMP/CMEPS.git local_path = components/cmeps required = True [cdeps] -tag = cdeps1.0.28 +tag = cdeps1.0.33 protocol = git repo_url = https://github.com/ESCOMP/CDEPS.git local_path = components/cdeps From 2aa76c4b3f841d35d465a254285daeb075f9d7cc Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Thu, 9 May 2024 17:46:05 -0600 Subject: [PATCH 0215/1248] Remove mct from Externals.cfg --- Externals.cfg | 7 ------- 1 file changed, 7 deletions(-) diff --git a/Externals.cfg b/Externals.cfg index 80bfb45db8..e8a2121df5 100644 --- a/Externals.cfg +++ b/Externals.cfg @@ -76,13 +76,6 @@ repo_url = https://github.com/ESCOMP/CESM_share local_path = share required = True -[mct] -tag = MCT_2.11.0 -protocol = git -repo_url = https://github.com/MCSclimate/MCT -local_path = libraries/mct -required = True - [parallelio] tag = pio2_6_2 protocol = git From ccce061987e7dc193aec37e53d7f46fa441d2147 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Thu, 9 May 2024 17:49:34 -0600 Subject: [PATCH 0216/1248] Remove cpl7 from Externals.cfg --- Externals.cfg | 7 ------- 1 file changed, 7 deletions(-) diff --git a/Externals.cfg b/Externals.cfg index e8a2121df5..a8a77a40f1 100644 --- a/Externals.cfg +++ b/Externals.cfg @@ -62,13 +62,6 @@ local_path = components/cdeps externals = Externals_CDEPS.cfg required = True -[cpl7] -tag = cpl77.0.7 -protocol = git -repo_url = https://github.com/ESCOMP/CESM_CPL7andDataComps -local_path = components/cpl7 -required = True - [share] tag = share1.0.18 protocol = git From f00ba49d552a3dc3578012f1cf32e6925ac224f9 Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Thu, 9 May 2024 17:58:07 -0600 Subject: [PATCH 0217/1248] remove fates from the do_harvest section altogether --- bld/CLMBuildNamelist.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index e422109078..aafc7739a3 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -2932,8 +2932,8 @@ sub setup_logic_do_harvest { $cannot_be_true = "$var can only be set to true when running a transient case (flanduse_timeseries non-blank)"; } - elsif (!&value_is_true($nl->get_value('use_cn')) && &value_is_true($nl->get_value('use_fates'))) { - $cannot_be_true = "$var can only be set to true when running with either CN or FATES"; + elsif (!&value_is_true($nl->get_value('use_cn'))) { + $cannot_be_true = "$var can only be set to true when running with CN. Please set use_cn to true."; } if ($cannot_be_true) { From 278a901fc4821e0c6abef4e0c5ed9bbf41f64516 Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Fri, 10 May 2024 10:43:41 -0700 Subject: [PATCH 0218/1248] fix if statements --- src/utils/clmfates_interfaceMod.F90 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/utils/clmfates_interfaceMod.F90 b/src/utils/clmfates_interfaceMod.F90 index b9e9bf3031..5c23f1c1dc 100644 --- a/src/utils/clmfates_interfaceMod.F90 +++ b/src/utils/clmfates_interfaceMod.F90 @@ -514,7 +514,7 @@ subroutine CLMFatesGlobals2() if (fates_harvest_mode > fates_harvest_no_logging) then pass_logging = 1 ! Time driven logging, without landuse harvest ! CLM landuse timeseries driven harvest rates - if (fates_harvest_mode == fates_harvest_clmlanduse) + if (fates_harvest_mode == fates_harvest_clmlanduse) then pass_num_lu_harvest_cats = num_harvest_inst pass_lu_harvest = 1 @@ -979,7 +979,7 @@ subroutine dynamics_driv(this, nc, bounds_clump, & call GetAndSetTime ! Get harvest rates for CLM landuse timeseries driven rates - if (fates_harvest_mode == fates_harvest_clmlanduse) + if (fates_harvest_mode == fates_harvest_clmlanduse) then call dynHarvest_interp_resolve_harvesttypes(bounds_clump, & harvest_rates=harvest_rates(begg:endg,1:num_harvest_inst), & after_start_of_harvest_ts=after_start_of_harvest_ts) @@ -1105,7 +1105,7 @@ subroutine dynamics_driv(this, nc, bounds_clump, & ! for now there is one veg column per gridcell, so store all harvest data in each site ! this will eventually change ! today's hlm harvest flag needs to be set no matter what - if (fates_harvest_mode == fates_harvest_clmlanduse) + if (fates_harvest_mode == fates_harvest_clmlanduse) then if (after_start_of_harvest_ts) then this%fates(nc)%bc_in(s)%hlm_harvest_rates(1:num_harvest_inst) = harvest_rates(g,1:num_harvest_inst) else From 4861125a7a9c81008de5cb218755cd9792db0bb9 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Fri, 10 May 2024 13:11:58 -0600 Subject: [PATCH 0219/1248] Remove MCT from README and .config_files.xml --- .config_files.xml | 3 --- README | 5 ++--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/.config_files.xml b/.config_files.xml index d1a592e5db..7f0d6bb11a 100644 --- a/.config_files.xml +++ b/.config_files.xml @@ -19,11 +19,8 @@ $SRCROOT $SRCROOT/components/slim/ - $SRCROOT/components/cpl7/components/data_comps_$COMP_INTERFACE/dlnd $SRCROOT/components/cdeps/dlnd - $SRCROOT/components/cpl7/components/stub_comps_$COMP_INTERFACE/slnd $CIMEROOT/CIME/non_py/src/components/stub_comps_$COMP_INTERFACE/slnd - $SRCROOT/components/cpl7/components/xcpl_comps_$COMP_INTERFACE/xlnd $CIMEROOT/CIME/non_py/src/components/xcpl_comps_$COMP_INTERFACE/xlnd case_comps diff --git a/README b/README index 18cc2b1458..4699fec858 100644 --- a/README +++ b/README @@ -57,7 +57,7 @@ python ------------ Python modules used in tools and testing and automated check Directory structure only for a CTSM checkout: components -------- Other active sub-components needed for CTSM to run (river routing and land-ice models) -libraries --------- CESM libraries: MCT (Model Coupling Toolkit) and PIO (deprecated) +libraries --------- CESM libraries: PIO (deprecated) share ------------- CESM shared code ccs_config -------- CIME configure files (for grids, compsets, and machines) for CESM @@ -68,7 +68,6 @@ components/cdeps -------------------- CESM top level data model shared code (for components/cism --------------------- CESM Community land Ice Sheet Model. components/mosart ------------------- Model for Scale Adaptive River Transport components/rtm ---------------------- CESM River Transport Model. -components/cpl7 --------------------- CESM top level driver for MCT driver (deprecated will be removed) Top level documentation ($CTSMROOT): @@ -154,7 +153,7 @@ Source code directory structure: src/biogeochem ---- Biogeochemisty src/main ---------- Main control and high level code -src/cpl ----------- Land model high level caps for NUOPC driver (and MCT and LILAC) +src/cpl ----------- Land model high level caps for NUOPC driver (and LILAC) src/biogeophys ---- Biogeophysics (Hydrology) src/dyn_subgrid --- Dynamic land unit change src/init_interp --- Online interpolation From db147cd616ea8a52e4bc64e88299c8fe76036396 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Fri, 10 May 2024 13:57:37 -0600 Subject: [PATCH 0220/1248] Remove MCT from CLMBuildNamelist.pm --- bld/CLMBuildNamelist.pm | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index fb44023cd5..731589289c 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -71,7 +71,7 @@ REQUIRED OPTIONS (if read they allow user_nl_clm and CLM_BLDNML_OPTS to expand variables [for example to use \$DIN_LOC_ROOT]) (default current directory) - -lnd_frac "domainfile" Land fraction file (the input domain file) (needed for MCT driver and LILAC) + -lnd_frac "domainfile" Land fraction file (the input domain file) (needed for LILAC) -res "resolution" Specify horizontal grid. Use nlatxnlon for spectral grids; dlatxdlon for fv grids (dlat and dlon are the grid cell size in degrees for latitude and longitude respectively) @@ -83,7 +83,7 @@ REQUIRED OPTIONS (default 2000) -structure "structure" The overall structure being used [ standard | fast ] OPTIONS - -driver "value" CESM driver type you will run with [ mct | nuopc ] + -driver "value" CESM driver type you will run with [ nuopc ] -bgc "value" Build CLM with BGC package [ sp | bgc | fates ] (default is sp). CLM Biogeochemistry mode @@ -1893,10 +1893,10 @@ sub setup_logic_lnd_frac { my ($opts, $nl_flags, $definition, $defaults, $nl, $envxml_ref) = @_; # - # fatmlndfrc is required for the MCT driver (or LILAC), but uneeded for NUOPC + # fatmlndfrc is required for LILAC but uneeded for NUOPC # my $var = "lnd_frac"; - if ( ($opts->{'driver'} eq "mct") || $opts->{'lilac'} ) { + if ( $opts->{'lilac'} ) { if ( defined($opts->{$var}) ) { if ( defined($nl->get_value('fatmlndfrc')) ) { $log->fatal_error("Can NOT set both -lnd_frac option (set via LND_DOMAIN_PATH/LND_DOMAIN_FILE " . @@ -3838,9 +3838,7 @@ sub setup_logic_popd_streams { } add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_fldfilename_popdens', 'phys'=>$nl_flags->{'phys'}, 'cnfireson'=>$nl_flags->{'cnfireson'}, 'hgrid'=>"0.5x0.5", 'ssp_rcp'=>$nl_flags->{'ssp_rcp'} ); - # - # TODO (mvertens, 2021-06-22) the following is needed for MCT since a use case enforces this - so for now stream_meshfile_popdens will be added to the mct - # stream namelist but simply not used + if ($opts->{'driver'} eq "nuopc" ) { add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_meshfile_popdens', 'hgrid'=>"0.5x0.5"); my $inputdata_rootdir = $nl_flags->{'inputdata_rootdir'}; @@ -3854,12 +3852,6 @@ sub setup_logic_popd_streams { $val = "e_string( $val ); $nl->set_variable_value($group, $var, $val); } - } else { - my $var = 'stream_meshfile_popdens'; - my $group = $definition->get_group_name($var); - my $val = "none"; - $val = "e_string( $val ); - $nl->set_variable_value($group, $var, $val); } } else { # If bgc is NOT CN/CNDV or fire_method==nofire then make sure none of the popdens settings are set From 68d46b68f92ebe08ce04d61527638d6997275b38 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Fri, 10 May 2024 14:03:49 -0600 Subject: [PATCH 0221/1248] Remove MCT from build-namelist_test.pl --- bld/unit_testers/build-namelist_test.pl | 30 ++----------------------- 1 file changed, 2 insertions(+), 28 deletions(-) diff --git a/bld/unit_testers/build-namelist_test.pl b/bld/unit_testers/build-namelist_test.pl index 7b654337af..12a5f4bd38 100755 --- a/bld/unit_testers/build-namelist_test.pl +++ b/bld/unit_testers/build-namelist_test.pl @@ -314,7 +314,7 @@ sub cat_and_create_namelistinfile { print "=================================================================================\n"; my $startfile = "clmrun.clm2.r.1964-05-27-00000.nc"; -foreach my $driver ( "mct", "nuopc" ) { +foreach my $driver ( "nuopc" ) { print " For $driver driver\n\n"; # configuration, structure, irrigate, verbose, clm_demand, ssp_rcp, test, sim_year, use_case foreach my $options ( "-res 0.9x1.25 -configuration nwp", @@ -335,13 +335,7 @@ sub cat_and_create_namelistinfile { my $file = $startfile; &make_env_run(); my $base_options = "-envxml_dir . -driver $driver"; - if ( $driver eq "mct" ) { - $base_options = "$base_options -lnd_frac $DOMFILE"; - # Skip the MCT test for excess ice streams - if ( $options =~ /use_excess_ice_streams=.true./ ) { - next; - } - } else { + if ( $driver eq "nuopc" ) { $base_options = "$base_options -namelist '&a force_send_to_atm = .false./'"; } eval{ system( "$bldnml $base_options $options > $tempfile 2>&1 " ); }; @@ -548,11 +542,6 @@ sub cat_and_create_namelistinfile { GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm5_0", }, - "exice stream on, but mct" =>{ options=>"--res 0.9x1.25 --envxml_dir . --driver mct --lnd_frac $DOMFILE ", - namelst=>"use_excess_ice=.true., use_excess_ice_streams=.true.", - GLC_TWO_WAY_COUPLING=>"FALSE", - phys=>"clm5_0", - }, "clm50CNDVwtransient" =>{ options=>" -envxml_dir . -use_case 20thC_transient -dynamic_vegetation -res 10x15 -ignore_warnings", namelst=>"", GLC_TWO_WAY_COUPLING=>"FALSE", @@ -898,16 +887,6 @@ sub cat_and_create_namelistinfile { GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm5_0", }, - "both lnd_frac and on nml" =>{ options=>"-driver mct -lnd_frac $DOMFILE -envxml_dir .", - namelst=>"fatmlndfrc='frac.nc'", - GLC_TWO_WAY_COUPLING=>"FALSE", - phys=>"clm5_0", - }, - "lnd_frac set to UNSET" =>{ options=>"-driver mct -lnd_frac UNSET -envxml_dir .", - namelst=>"", - GLC_TWO_WAY_COUPLING=>"FALSE", - phys=>"clm6_0", - }, "lnd_frac set but nuopc" =>{ options=>"-driver nuopc -lnd_frac $DOMFILE -envxml_dir .", namelst=>"", GLC_TWO_WAY_COUPLING=>"FALSE", @@ -923,11 +902,6 @@ sub cat_and_create_namelistinfile { GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm6_0", }, - "force_send but not nuopc" =>{ options=>"-driver mct -lnd_frac $DOMFILE -envxml_dir .", - namelst=>"force_send_to_atm = .false.", - GLC_TWO_WAY_COUPLING=>"FALSE", - phys=>"clm6_0", - }, "branch but NO nrevsn" =>{ options=>"-clm_start_type branch -envxml_dir .", namelst=>"", GLC_TWO_WAY_COUPLING=>"FALSE", From 190be8bd937ce545ad636c7c339f8b5497968ab6 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Fri, 10 May 2024 14:21:11 -0600 Subject: [PATCH 0222/1248] Fix the 2010 use case, and get the namelist testing working better --- bld/namelist_files/use_cases/2010_control.xml | 4 ++-- bld/unit_testers/build-namelist_test.pl | 24 ++++++++++++------- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/bld/namelist_files/use_cases/2010_control.xml b/bld/namelist_files/use_cases/2010_control.xml index d4c2a9c9c0..d16177301c 100644 --- a/bld/namelist_files/use_cases/2010_control.xml +++ b/bld/namelist_files/use_cases/2010_control.xml @@ -12,8 +12,8 @@ .true. .false. -2010 -2010 +2010 +2010 2010 2010 diff --git a/bld/unit_testers/build-namelist_test.pl b/bld/unit_testers/build-namelist_test.pl index 2b65b18f38..25545dcf8a 100755 --- a/bld/unit_testers/build-namelist_test.pl +++ b/bld/unit_testers/build-namelist_test.pl @@ -163,10 +163,10 @@ sub cat_and_create_namelistinfile { # # Figure out number of tests that will run # -my $ntests = 3385; +my $ntests = 3313; if ( defined($opts{'compare'}) ) { - $ntests += 2097; + $ntests += 2001; } plan( tests=>$ntests ); @@ -1436,22 +1436,24 @@ sub cat_and_create_namelistinfile { print "use-cases = @usecases\n"; die "ERROR:: Number of use-cases isn't what's expected\n"; } -my @expect_fails = ( "1850-2100_SSP5-3.4_transient", "1850-2100_SSP4-3.4", "1850-2100_SSP1-1.9_transient", - "1850-2100_SSP4-6.0_transient" ); +my @expect_fails = ( "1850-2100_SSP5-3.4_transient", "1850-2100_SSP4-3.4_transient", "2018-PD_transient", "1850-2100_SSP1-1.9_transient", + "1850-2100_SSP4-6.0_transient", "2018_control" ); foreach my $phys ( "clm4_5", "clm5_0", "clm5_1", "clm6_0" ) { print "physics = $phys\n"; + &make_config_cache($phys); foreach my $usecase ( @usecases ) { print "usecase = $usecase\n"; $options = "-res 0.9x1.25 -use_case $usecase -envxml_dir ."; &make_env_run(); - eval{ system( "$bldnml $options > $tempfile 2>&1 " ); }; - my $expect_fail = 0; + my $expect_fail = undef; foreach my $failusecase ( @expect_fails ) { if ( $failusecase eq $usecase ) { $expect_fail = 1; + last; } } - if ( not $expect_fail ) { + eval{ system( "$bldnml $options > $tempfile 2>&1 " ); }; + if ( ! defined($expect_fail) ) { is( $@, '', "options: $options" ); $cfiles->checkfilesexist( "$options", $mode ); $cfiles->shownmldiff( "default", "standard" ); @@ -1463,7 +1465,7 @@ sub cat_and_create_namelistinfile { $cfiles->copyfiles( "$options", $mode ); } } else { - isnt( $@, '', "options: $options" ); + isnt( $@, 0, "options: $options" ); } &cleanup(); } @@ -1546,6 +1548,12 @@ sub cat_and_create_namelistinfile { &make_env_run(); eval{ system( "$bldnml $options > $tempfile 2>&1 " ); }; is( $@, '', "options: $options" ); + my $finidat = `grep finidat lnd_in`; + if ( $finidat =~ /initdata_map/ ) { + my $result; + eval( $result = `grep use_init_interp lnd_in` ); + isnt( $#, 0, "use_init_interp needs to be set here and was not: $result") + } $cfiles->checkfilesexist( "$options", $mode ); $cfiles->shownmldiff( "default", "standard" ); if ( defined($opts{'compare'}) ) { From f3386bcd5c0ec78d6d2be660aaa7b4c257910030 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Fri, 10 May 2024 15:58:49 -0600 Subject: [PATCH 0223/1248] Remove MCT from config_definition_ctsm.xml --- bld/config_files/config_definition_ctsm.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bld/config_files/config_definition_ctsm.xml b/bld/config_files/config_definition_ctsm.xml index dfe6378f17..e6628b1d94 100644 --- a/bld/config_files/config_definition_ctsm.xml +++ b/bld/config_files/config_definition_ctsm.xml @@ -18,11 +18,11 @@ Root directory of CLM source distribution (directory above CLM configure). Component framework interface to use -(Model Coupling Toolkit, or Earth System Modeling Framework) +(Earth System Modeling Framework) Date: Fri, 10 May 2024 16:08:42 -0600 Subject: [PATCH 0224/1248] Remove MCT from ExpectedTestFails.xml and update README.NUOPC_driver.md --- README.NUOPC_driver.md | 5 +---- cime_config/testdefs/ExpectedTestFails.xml | 7 ------- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/README.NUOPC_driver.md b/README.NUOPC_driver.md index ba0b70c2c0..9eb5d5b2cb 100644 --- a/README.NUOPC_driver.md +++ b/README.NUOPC_driver.md @@ -43,9 +43,6 @@ by having an updated copy in your case directory. ## What if I want to use the MCT driver? -The MCT driver is now deprecated, and will be removed. So at this point we don't -suggest using it anymore. - -For more notes see: +The MCT driver is now removed. For more notes see: https://docs.google.com/presentation/d/1yjiKSEV53JDAJbYxhpY2T9GTxlWFzQAn diff --git a/cime_config/testdefs/ExpectedTestFails.xml b/cime_config/testdefs/ExpectedTestFails.xml index 8ee60cf4b8..f600444547 100644 --- a/cime_config/testdefs/ExpectedTestFails.xml +++ b/cime_config/testdefs/ExpectedTestFails.xml @@ -51,13 +51,6 @@ - - - FAIL - #1887 - - - FAIL From 629961c2afa8d86be3101b90dfe040a8d9603ac2 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Fri, 10 May 2024 16:11:33 -0600 Subject: [PATCH 0225/1248] Remove reference to MCT in fsurdat_modifier.py --- python/ctsm/modify_input_files/fsurdat_modifier.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/ctsm/modify_input_files/fsurdat_modifier.py b/python/ctsm/modify_input_files/fsurdat_modifier.py index bd060cb9dc..1a45590872 100644 --- a/python/ctsm/modify_input_files/fsurdat_modifier.py +++ b/python/ctsm/modify_input_files/fsurdat_modifier.py @@ -254,8 +254,8 @@ def modify_optional( """Modify the dataset according to the optional settings""" # Set fsurdat variables in a rectangle that could be global (default). - # Note that the land/ocean mask gets specified in the domain file for - # MCT or the ocean mesh files for NUOPC. Here the user may specify + # Note that the land/ocean mask gets specified in + # the ocean mesh files. Here the user may specify # fsurdat variables inside a box but cannot change which points will # run as land and which as ocean. if idealized: From fb5b6310be60477a7c4cb67656a68a9c71cb8b6e Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Fri, 10 May 2024 16:15:09 -0600 Subject: [PATCH 0226/1248] Remove src/unit_test_stubs/csm_share/CMakeLists.txt --- src/unit_test_stubs/csm_share/CMakeLists.txt | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 src/unit_test_stubs/csm_share/CMakeLists.txt diff --git a/src/unit_test_stubs/csm_share/CMakeLists.txt b/src/unit_test_stubs/csm_share/CMakeLists.txt deleted file mode 100644 index 33ddbfb342..0000000000 --- a/src/unit_test_stubs/csm_share/CMakeLists.txt +++ /dev/null @@ -1,5 +0,0 @@ -list(APPEND share_sources - shr_mpi_mod_stub.F90 - ) - -sourcelist_to_parent(share_sources) From 3d1ab9be7da02a53107786a952582462049611db Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Fri, 10 May 2024 16:18:43 -0600 Subject: [PATCH 0227/1248] Remove MCT from test_driver.sh --- test/tools/test_driver.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/tools/test_driver.sh b/test/tools/test_driver.sh index f93301a530..307d1accf8 100755 --- a/test/tools/test_driver.sh +++ b/test/tools/test_driver.sh @@ -463,8 +463,7 @@ if [ ! -d \$CLM_TESTDIR ]; then fi fi -## MCT and PIO build directorys -export MCT_LIBDIR=\$CLM_TESTDIR/mct +## PIO build directory export PIO_LIBDIR=\$CLM_TESTDIR/pio ##set our own environment vars From 371f093e02a7820e8beec823c97dd23b94277c05 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Fri, 10 May 2024 16:20:13 -0600 Subject: [PATCH 0228/1248] Remove the src/cpl/mct directory --- src/cpl/mct/ExcessIceStreamType.F90 | 144 ----- src/cpl/mct/FireDataBaseType.F90 | 561 ------------------- src/cpl/mct/SoilMoistureStreamMod.F90 | 418 -------------- src/cpl/mct/UrbanTimeVarType.F90 | 314 ----------- src/cpl/mct/ch4FInundatedStreamType.F90 | 389 ------------- src/cpl/mct/clm_cpl_indices.F90 | 330 ----------- src/cpl/mct/laiStreamMod.F90 | 241 --------- src/cpl/mct/lnd_comp_mct.F90 | 632 ---------------------- src/cpl/mct/lnd_import_export.F90 | 354 ------------ src/cpl/mct/lnd_set_decomp_and_domain.F90 | 352 ------------ src/cpl/mct/ndepStreamMod.F90 | 376 ------------- 11 files changed, 4111 deletions(-) delete mode 100644 src/cpl/mct/ExcessIceStreamType.F90 delete mode 100644 src/cpl/mct/FireDataBaseType.F90 delete mode 100644 src/cpl/mct/SoilMoistureStreamMod.F90 delete mode 100644 src/cpl/mct/UrbanTimeVarType.F90 delete mode 100644 src/cpl/mct/ch4FInundatedStreamType.F90 delete mode 100644 src/cpl/mct/clm_cpl_indices.F90 delete mode 100644 src/cpl/mct/laiStreamMod.F90 delete mode 100644 src/cpl/mct/lnd_comp_mct.F90 delete mode 100644 src/cpl/mct/lnd_import_export.F90 delete mode 100644 src/cpl/mct/lnd_set_decomp_and_domain.F90 delete mode 100644 src/cpl/mct/ndepStreamMod.F90 diff --git a/src/cpl/mct/ExcessIceStreamType.F90 b/src/cpl/mct/ExcessIceStreamType.F90 deleted file mode 100644 index 5c5394233c..0000000000 --- a/src/cpl/mct/ExcessIceStreamType.F90 +++ /dev/null @@ -1,144 +0,0 @@ -module ExcessIceStreamType - - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! Stub for ExcessIceStreams for the MCT driver. So that MCT can be used - ! without excess ice streams. - ! - ! !USES - use shr_kind_mod , only : r8 => shr_kind_r8, CL => shr_kind_CL - use shr_log_mod , only : errMsg => shr_log_errMsg - use spmdMod , only : mpicom, masterproc - use clm_varctl , only : iulog - use abortutils , only : endrun - use decompMod , only : bounds_type - - ! !PUBLIC TYPES: - implicit none - private - - public :: UseExcessIceStreams ! If streams will be used - - type, public :: excessicestream_type - contains - - ! !PUBLIC MEMBER FUNCTIONS: - procedure, public :: Init ! Initialize and read data in - procedure, public :: CalcExcessIce ! Calculate excess ice ammount - - ! !PRIVATE MEMBER FUNCTIONS: - procedure, private :: ReadNML ! Read in namelist - - end type excessicestream_type - ! ! PRIVATE DATA: - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - -!============================================================================== -contains -!============================================================================== - - subroutine Init(this, bounds, NLFilename) - ! - ! - ! arguments - implicit none - class(excessicestream_type) :: this - type(bounds_type), intent(in) :: bounds - character(len=*), intent(in) :: NLFilename ! Namelist filename - - ! - ! local variables - - call this%ReadNML( bounds, NLFileName ) - end subroutine Init - - subroutine CalcExcessIce(this,bounds,exice_bulk_init) - - ! only transfers grid values to columns - implicit none - class(excessicestream_type) :: this - type(bounds_type), intent(in) :: bounds - real(r8) , intent(inout) :: exice_bulk_init(bounds%begc:bounds%endc) - ! - ! !LOCAL VARIABLES: - - end subroutine CalcExcessIce - - logical function UseExcessIceStreams() - ! - ! !DESCRIPTION: - ! Return true if - ! - ! !USES: - ! - ! !ARGUMENTS: - implicit none - ! - ! !LOCAL VARIABLES: - UseExcessIceStreams = .false. -end function UseExcessIceStreams - -subroutine ReadNML(this, bounds, NLFilename) - ! - ! Read the namelist data stream information. - ! - ! Uses: - use shr_nl_mod , only : shr_nl_find_group_name - use shr_log_mod , only : errMsg => shr_log_errMsg - use shr_mpi_mod , only : shr_mpi_bcast - ! - ! arguments - implicit none - class(excessicestream_type) :: this - type(bounds_type), intent(in) :: bounds - character(len=*), intent(in) :: NLFilename ! Namelist filename - ! - ! local variables - integer :: nu_nml ! unit for namelist file - integer :: nml_error ! namelist i/o error flag - logical :: use_excess_ice_streams = .false. ! logical to turn on use of excess ice streams - character(len=CL) :: stream_fldFileName_exice = ' ' - character(len=CL) :: stream_mapalgo_exice = 'none' - character(len=*), parameter :: namelist_name = 'exice_streams' ! MUST agree with name in namelist and read - character(len=*), parameter :: subName = "('exice_streams::ReadNML')" - !----------------------------------------------------------------------- - - namelist /exice_streams/ & ! MUST agree with namelist_name above - stream_mapalgo_exice, stream_fldFileName_exice, use_excess_ice_streams - !----------------------------------------------------------------------- - ! Default values for namelist - - ! Read excess ice namelist - if (masterproc) then - open( newunit=nu_nml, file=trim(NLFilename), status='old', iostat=nml_error ) - call shr_nl_find_group_name(nu_nml, namelist_name, status=nml_error) - if (nml_error == 0) then - read(nu_nml, nml=exice_streams,iostat=nml_error) ! MUST agree with namelist_name above - if (nml_error /= 0) then - call endrun(msg=' ERROR reading '//namelist_name//' namelist'//errMsg(sourcefile, __LINE__)) - end if - else - call endrun(msg=' ERROR finding '//namelist_name//' namelist'//errMsg(sourcefile, __LINE__)) - end if - close(nu_nml) - endif - - call shr_mpi_bcast(use_excess_ice_streams , mpicom) - - if (masterproc) then - if ( use_excess_ice_streams ) then - call endrun(msg=' ERROR excess ice streams can NOT be on for the MCT driver'//errMsg(sourcefile, __LINE__)) - end if - if ( trim(stream_fldFileName_exice) /= '' ) then - call endrun(msg=' ERROR stream_fldFileName_exice can NOT be set for the MCT driver'//errMsg(sourcefile, __LINE__)) - end if - if ( trim(stream_mapalgo_exice) /= 'none' ) then - call endrun(msg=' ERROR stream_mapalgo_exice can only be none for the MCT driver'//errMsg(sourcefile, __LINE__)) - end if - endif - -end subroutine ReadNML - -end module ExcessIceStreamType diff --git a/src/cpl/mct/FireDataBaseType.F90 b/src/cpl/mct/FireDataBaseType.F90 deleted file mode 100644 index 0ee635b2fa..0000000000 --- a/src/cpl/mct/FireDataBaseType.F90 +++ /dev/null @@ -1,561 +0,0 @@ -module FireDataBaseType - -#include "shr_assert.h" - - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! module for handling of fire data - ! - ! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8, CL => shr_kind_CL - use shr_strdata_mod , only : shr_strdata_type, shr_strdata_create, shr_strdata_print - use shr_strdata_mod , only : shr_strdata_advance - use shr_log_mod , only : errMsg => shr_log_errMsg - use clm_varctl , only : iulog, inst_name - use spmdMod , only : masterproc, mpicom, comp_id - use fileutils , only : getavu, relavu - use domainMod , only : ldomain - use abortutils , only : endrun - use decompMod , only : bounds_type - use FireMethodType , only : fire_method_type - use lnd_set_decomp_and_domain, only : gsmap_global - use mct_mod - ! - implicit none - private - ! - ! !PUBLIC TYPES: - public :: fire_base_type - - ! - type, abstract, extends(fire_method_type) :: fire_base_type - private - ! !PRIVATE MEMBER DATA: - - real(r8), public, pointer :: forc_lnfm(:) ! Lightning frequency - real(r8), public, pointer :: forc_hdm(:) ! Human population density - - real(r8), public, pointer :: gdp_lf_col(:) ! col global real gdp data (k US$/capita) - real(r8), public, pointer :: peatf_lf_col(:) ! col global peatland fraction data (0-1) - integer , public, pointer :: abm_lf_col(:) ! col global peak month of crop fire emissions - - type(shr_strdata_type) :: sdat_hdm ! Human population density input data stream - type(shr_strdata_type) :: sdat_lnfm ! Lightning input data stream - - contains - ! - ! !PUBLIC MEMBER FUNCTIONS: - procedure, public :: FireInit => BaseFireInit ! Initialization of Fire - procedure, public :: BaseFireInit ! Initialization of Fire - procedure(FireReadNML_interface), public, deferred :: FireReadNML ! Read in namelist for Fire - procedure, public :: FireInterp ! Interpolate fire data - procedure(need_lightning_and_popdens_interface), public, deferred :: & - need_lightning_and_popdens ! Returns true if need lightning & popdens - ! - ! !PRIVATE MEMBER FUNCTIONS: - procedure, private :: hdm_init ! position datasets for dynamic human population density - procedure, private :: hdm_interp ! interpolates between two years of human pop. density file data - procedure, private :: lnfm_init ! position datasets for Lightning - procedure, private :: lnfm_interp ! interpolates between two years of Lightning file data - procedure, private :: surfdataread ! read fire related data from surface data set - end type fire_base_type - !----------------------------------------------------------------------- - - abstract interface - !----------------------------------------------------------------------- - function need_lightning_and_popdens_interface(this) result(need_lightning_and_popdens) - ! - ! !DESCRIPTION: - ! Returns true if need lightning and popdens, false otherwise - ! - ! USES - import :: fire_base_type - ! - ! !ARGUMENTS: - class(fire_base_type), intent(in) :: this - logical :: need_lightning_and_popdens ! function result - !----------------------------------------------------------------------- - end function need_lightning_and_popdens_interface - end interface - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - -contains - - !----------------------------------------------------------------------- - subroutine FireReadNML_interface( this, NLFilename ) - ! - ! !DESCRIPTION: - ! Read the namelist for Fire - ! - ! !USES: - ! - ! !ARGUMENTS: - class(fire_base_type) :: this - character(len=*), intent(in) :: NLFilename ! Namelist filename - end subroutine FireReadNML_interface - - !----------------------------------------------------------------------- - subroutine BaseFireInit( this, bounds, NLFilename ) - ! - ! !DESCRIPTION: - ! Initialize CN Fire module - ! !USES: - use shr_infnan_mod , only : nan => shr_infnan_nan, assignment(=) - ! - ! !ARGUMENTS: - class(fire_base_type) :: this - type(bounds_type), intent(in) :: bounds - character(len=*), intent(in) :: NLFilename - !----------------------------------------------------------------------- - - if ( this%need_lightning_and_popdens() ) then - ! Allocate lightning forcing data - allocate( this%forc_lnfm(bounds%begg:bounds%endg) ) - this%forc_lnfm(bounds%begg:) = nan - ! Allocate pop dens forcing data - allocate( this%forc_hdm(bounds%begg:bounds%endg) ) - this%forc_hdm(bounds%begg:) = nan - - ! Allocate real gdp data - allocate(this%gdp_lf_col(bounds%begc:bounds%endc)) - ! Allocate peatland fraction data - allocate(this%peatf_lf_col(bounds%begc:bounds%endc)) - ! Allocates peak month of crop fire emissions - allocate(this%abm_lf_col(bounds%begc:bounds%endc)) - - - call this%hdm_init(bounds, NLFilename) - call this%hdm_interp(bounds) - call this%lnfm_init(bounds, NLFilename) - call this%lnfm_interp(bounds) - call this%surfdataread(bounds) - end if - - end subroutine BaseFireInit - - !----------------------------------------------------------------------- - subroutine FireInterp(this,bounds) - ! - ! !DESCRIPTION: - ! Interpolate CN Fire datasets - ! - ! !ARGUMENTS: - class(fire_base_type) :: this - type(bounds_type), intent(in) :: bounds - !----------------------------------------------------------------------- - - if ( this%need_lightning_and_popdens() ) then - call this%hdm_interp(bounds) - call this%lnfm_interp(bounds) - end if - - end subroutine FireInterp - - !----------------------------------------------------------------------- - subroutine hdm_init( this, bounds, NLFilename ) - ! - ! !DESCRIPTION: - ! Initialize data stream information for population density. - ! - ! !USES: - use clm_time_manager , only : get_calendar - use ncdio_pio , only : pio_subsystem - use shr_pio_mod , only : shr_pio_getiotype - use clm_nlUtilsMod , only : find_nlgroup_name - use ndepStreamMod , only : clm_domain_mct - use histFileMod , only : hist_addfld1d - ! - ! !ARGUMENTS: - implicit none - class(fire_base_type) :: this - type(bounds_type), intent(in) :: bounds - character(len=*), intent(in) :: NLFilename ! Namelist filename - ! - ! !LOCAL VARIABLES: - integer :: stream_year_first_popdens ! first year in pop. dens. stream to use - integer :: stream_year_last_popdens ! last year in pop. dens. stream to use - integer :: model_year_align_popdens ! align stream_year_first_hdm with - integer :: nu_nml ! unit for namelist file - integer :: nml_error ! namelist i/o error flag - type(mct_ggrid) :: dom_clm ! domain information - character(len=CL) :: stream_fldFileName_popdens ! population density streams filename - character(len=CL) :: popdensmapalgo = 'bilinear' ! mapping alogrithm for population density - character(len=CL) :: popdens_tintalgo = 'nearest'! time interpolation alogrithm for population density - character(len=CL) :: stream_meshfile_popdens ! not used - character(*), parameter :: subName = "('hdmdyn_init')" - character(*), parameter :: F00 = "('(hdmdyn_init) ',4a)" - !----------------------------------------------------------------------- - - namelist /popd_streams/ & - stream_year_first_popdens, & - stream_year_last_popdens, & - model_year_align_popdens, & - popdensmapalgo, & - stream_fldFileName_popdens, & - stream_meshfile_popdens , & - popdens_tintalgo - - ! Default values for namelist - stream_year_first_popdens = 1 ! first year in stream to use - stream_year_last_popdens = 1 ! last year in stream to use - model_year_align_popdens = 1 ! align stream_year_first_popdens with this model year - stream_fldFileName_popdens = ' ' - - ! Read popd_streams namelist - if (masterproc) then - nu_nml = getavu() - open( nu_nml, file=trim(NLFilename), status='old', iostat=nml_error ) - call find_nlgroup_name(nu_nml, 'popd_streams', status=nml_error) - if (nml_error == 0) then - read(nu_nml, nml=popd_streams,iostat=nml_error) - if (nml_error /= 0) then - call endrun(msg='ERROR reading popd_streams namelist'//errMsg(sourcefile, __LINE__)) - end if - end if - close(nu_nml) - call relavu( nu_nml ) - endif - - call shr_mpi_bcast(stream_year_first_popdens, mpicom) - call shr_mpi_bcast(stream_year_last_popdens, mpicom) - call shr_mpi_bcast(model_year_align_popdens, mpicom) - call shr_mpi_bcast(stream_fldFileName_popdens, mpicom) - call shr_mpi_bcast(popdens_tintalgo, mpicom) - - if (masterproc) then - write(iulog,*) ' ' - write(iulog,*) 'popdens_streams settings:' - write(iulog,*) ' stream_year_first_popdens = ',stream_year_first_popdens - write(iulog,*) ' stream_year_last_popdens = ',stream_year_last_popdens - write(iulog,*) ' model_year_align_popdens = ',model_year_align_popdens - write(iulog,*) ' stream_fldFileName_popdens = ',stream_fldFileName_popdens - write(iulog,*) ' popdens_tintalgo = ',popdens_tintalgo - write(iulog,*) ' ' - endif - - call clm_domain_mct (bounds, dom_clm) - - call shr_strdata_create(this%sdat_hdm,name="clmhdm", & - pio_subsystem=pio_subsystem, & - pio_iotype=shr_pio_getiotype(inst_name), & - mpicom=mpicom, compid=comp_id, & - gsmap=gsmap_global, ggrid=dom_clm, & - nxg=ldomain%ni, nyg=ldomain%nj, & - yearFirst=stream_year_first_popdens, & - yearLast=stream_year_last_popdens, & - yearAlign=model_year_align_popdens, & - offset=0, & - domFilePath='', & - domFileName=trim(stream_fldFileName_popdens), & - domTvarName='time', & - domXvarName='lon' , & - domYvarName='lat' , & - domAreaName='area', & - domMaskName='mask', & - filePath='', & - filename=(/trim(stream_fldFileName_popdens)/) , & - fldListFile='hdm', & - fldListModel='hdm', & - fillalgo='none', & - mapalgo=popdensmapalgo, & - calendar=get_calendar(), & - tintalgo=popdens_tintalgo, & - taxmode='extend' ) - - if (masterproc) then - call shr_strdata_print(this%sdat_hdm,'population density data') - endif - - ! Add history fields - call hist_addfld1d (fname='HDM', units='counts/km^2', & - avgflag='A', long_name='human population density', & - ptr_lnd=this%forc_hdm, default='inactive') - - end subroutine hdm_init - - !----------------------------------------------------------------------- - subroutine hdm_interp( this, bounds) - ! - ! !DESCRIPTION: - ! Interpolate data stream information for population density. - ! - ! !USES: - use clm_time_manager, only : get_curr_date - ! - ! !ARGUMENTS: - class(fire_base_type) :: this - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - integer :: g, ig - 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) - !----------------------------------------------------------------------- - - call get_curr_date(year, mon, day, sec) - mcdate = year*10000 + mon*100 + day - - call shr_strdata_advance(this%sdat_hdm, mcdate, sec, mpicom, 'hdmdyn') - - ig = 0 - do g = bounds%begg,bounds%endg - ig = ig+1 - this%forc_hdm(g) = this%sdat_hdm%avs(1)%rAttr(1,ig) - end do - - end subroutine hdm_interp - - !----------------------------------------------------------------------- - subroutine lnfm_init( this, bounds, NLFilename ) - ! - ! !DESCRIPTION: - ! - ! Initialize data stream information for Lightning. - ! - ! !USES: - use clm_time_manager , only : get_calendar - use ncdio_pio , only : pio_subsystem - use shr_pio_mod , only : shr_pio_getiotype - use clm_nlUtilsMod , only : find_nlgroup_name - use ndepStreamMod , only : clm_domain_mct - use histFileMod , only : hist_addfld1d - ! - ! !ARGUMENTS: - implicit none - class(fire_base_type) :: this - type(bounds_type), intent(in) :: bounds - character(len=*), intent(in) :: NLFilename - ! - ! !LOCAL VARIABLES: - integer :: stream_year_first_lightng ! first year in Lightning stream to use - integer :: stream_year_last_lightng ! last year in Lightning stream to use - integer :: model_year_align_lightng ! align stream_year_first_lnfm with - integer :: nu_nml ! unit for namelist file - integer :: nml_error ! namelist i/o error flag - type(mct_ggrid) :: dom_clm ! domain information - character(len=CL) :: stream_fldFileName_lightng ! lightning stream filename to read - character(len=CL) :: lightng_tintalgo = 'linear'! time interpolation alogrithm - character(len=CL) :: lightngmapalgo = 'bilinear'! Mapping alogrithm - character(*), parameter :: subName = "('lnfmdyn_init')" - character(*), parameter :: F00 = "('(lnfmdyn_init) ',4a)" - !----------------------------------------------------------------------- - - namelist /light_streams/ & - stream_year_first_lightng, & - stream_year_last_lightng, & - model_year_align_lightng, & - lightngmapalgo, & - stream_fldFileName_lightng, & - lightng_tintalgo - - ! Default values for namelist - stream_year_first_lightng = 1 ! first year in stream to use - stream_year_last_lightng = 1 ! last year in stream to use - model_year_align_lightng = 1 ! align stream_year_first_lnfm with this model year - stream_fldFileName_lightng = ' ' - - ! Read light_streams namelist - if (masterproc) then - nu_nml = getavu() - open( nu_nml, file=trim(NLFilename), status='old', iostat=nml_error ) - call find_nlgroup_name(nu_nml, 'light_streams', status=nml_error) - if (nml_error == 0) then - read(nu_nml, nml=light_streams,iostat=nml_error) - if (nml_error /= 0) then - call endrun(msg='ERROR reading light_streams namelist'//errMsg(sourcefile, __LINE__)) - end if - end if - close(nu_nml) - call relavu( nu_nml ) - endif - - call shr_mpi_bcast(stream_year_first_lightng, mpicom) - call shr_mpi_bcast(stream_year_last_lightng, mpicom) - call shr_mpi_bcast(model_year_align_lightng, mpicom) - call shr_mpi_bcast(stream_fldFileName_lightng, mpicom) - call shr_mpi_bcast(lightng_tintalgo, mpicom) - - if (masterproc) then - write(iulog,*) ' ' - write(iulog,*) 'light_stream settings:' - write(iulog,*) ' stream_year_first_lightng = ',stream_year_first_lightng - write(iulog,*) ' stream_year_last_lightng = ',stream_year_last_lightng - write(iulog,*) ' model_year_align_lightng = ',model_year_align_lightng - write(iulog,*) ' stream_fldFileName_lightng = ',stream_fldFileName_lightng - write(iulog,*) ' lightng_tintalgo = ',lightng_tintalgo - write(iulog,*) ' ' - endif - - call clm_domain_mct (bounds, dom_clm) - - call shr_strdata_create(this%sdat_lnfm,name="clmlnfm", & - pio_subsystem=pio_subsystem, & - pio_iotype=shr_pio_getiotype(inst_name), & - mpicom=mpicom, compid=comp_id, & - gsmap=gsmap_global, ggrid=dom_clm, & - nxg=ldomain%ni, nyg=ldomain%nj, & - yearFirst=stream_year_first_lightng, & - yearLast=stream_year_last_lightng, & - yearAlign=model_year_align_lightng, & - offset=0, & - domFilePath='', & - domFileName=trim(stream_fldFileName_lightng), & - domTvarName='time', & - domXvarName='lon' , & - domYvarName='lat' , & - domAreaName='area', & - domMaskName='mask', & - filePath='', & - filename=(/trim(stream_fldFileName_lightng)/), & - fldListFile='lnfm', & - fldListModel='lnfm', & - fillalgo='none', & - tintalgo=lightng_tintalgo, & - mapalgo=lightngmapalgo, & - calendar=get_calendar(), & - taxmode='cycle' ) - - if (masterproc) then - call shr_strdata_print(this%sdat_lnfm,'Lightning data') - endif - - ! Add history fields - call hist_addfld1d (fname='LNFM', units='counts/km^2/hr', & - avgflag='A', long_name='Lightning frequency', & - ptr_lnd=this%forc_lnfm, default='inactive') - - end subroutine lnfm_init - - !----------------------------------------------------------------------- - subroutine lnfm_interp(this, bounds ) - ! - ! !DESCRIPTION: - ! Interpolate data stream information for Lightning. - ! - ! !USES: - use clm_time_manager, only : get_curr_date - ! - ! !ARGUMENTS: - class(fire_base_type) :: this - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - integer :: g, ig - 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) - !----------------------------------------------------------------------- - - call get_curr_date(year, mon, day, sec) - mcdate = year*10000 + mon*100 + day - - call shr_strdata_advance(this%sdat_lnfm, mcdate, sec, mpicom, 'lnfmdyn') - - ig = 0 - do g = bounds%begg,bounds%endg - ig = ig+1 - this%forc_lnfm(g) = this%sdat_lnfm%avs(1)%rAttr(1,ig) - end do - - end subroutine lnfm_interp - - !----------------------------------------------------------------------- - subroutine surfdataread(this, bounds) - ! - ! !DESCRIPTION: - ! Read surface data set to populate relevant fire-related variables - ! - ! !USES: - use spmdMod , only : masterproc - use clm_varctl , only : nsrest, nsrStartup, fsurdat - use clm_varcon , only : grlnd - use ColumnType , only : col - use fileutils , only : getfil - use ncdio_pio - ! - ! !ARGUMENTS: - class(fire_base_type) :: this - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - integer :: g,c ! indices - type(file_desc_t) :: ncid ! netcdf id - logical :: readvar ! true => variable is on initial dataset - character(len=256) :: locfn ! local filename - real(r8), pointer :: gdp(:) ! global gdp data (needs to be a pointer for use in ncdio) - real(r8), pointer :: peatf(:) ! global peatf data (needs to be a pointer for use in ncdio) - integer, pointer :: abm(:) ! global abm data (needs to be a pointer for use in ncdio) - !----------------------------------------------------------------------- - - ! -------------------------------------------------------------------- - ! Open surface dataset - ! -------------------------------------------------------------------- - - call getfil (fsurdat, locfn, 0) - call ncd_pio_openfile (ncid, locfn, 0) - - ! -------------------------------------------------------------------- - ! Read in GDP data - ! -------------------------------------------------------------------- - - allocate(gdp(bounds%begg:bounds%endg)) - call ncd_io(ncid=ncid, varname='gdp', flag='read', data=gdp, dim1name=grlnd, readvar=readvar) - if (.not. readvar) then - call endrun(msg=' ERROR: gdp NOT on surfdata file'//errMsg(sourcefile, __LINE__)) - end if - do c = bounds%begc, bounds%endc - g = col%gridcell(c) - this%gdp_lf_col(c) = gdp(g) - end do - deallocate(gdp) - - ! -------------------------------------------------------------------- - ! Read in peatf data - ! -------------------------------------------------------------------- - - allocate(peatf(bounds%begg:bounds%endg)) - call ncd_io(ncid=ncid, varname='peatf', flag='read', data=peatf, dim1name=grlnd, readvar=readvar) - if (.not. readvar) then - call endrun(msg=' ERROR: peatf NOT on surfdata file'//errMsg(sourcefile, __LINE__)) - end if - do c = bounds%begc, bounds%endc - g = col%gridcell(c) - this%peatf_lf_col(c) = peatf(g) - end do - deallocate(peatf) - - ! -------------------------------------------------------------------- - ! Read in ABM data - ! -------------------------------------------------------------------- - - allocate(abm(bounds%begg:bounds%endg)) - call ncd_io(ncid=ncid, varname='abm', flag='read', data=abm, dim1name=grlnd, readvar=readvar) - if (.not. readvar) then - call endrun(msg=' ERROR: abm NOT on surfdata file'//errMsg(sourcefile, __LINE__)) - end if - do c = bounds%begc, bounds%endc - g = col%gridcell(c) - this%abm_lf_col(c) = abm(g) - end do - deallocate(abm) - - ! Close file - - call ncd_pio_closefile(ncid) - - if (masterproc) then - write(iulog,*) 'Successfully read fmax, soil color, sand and clay boundary data' - write(iulog,*) - endif - - end subroutine surfdataread - - -end module FireDataBaseType diff --git a/src/cpl/mct/SoilMoistureStreamMod.F90 b/src/cpl/mct/SoilMoistureStreamMod.F90 deleted file mode 100644 index 8b366d6c8e..0000000000 --- a/src/cpl/mct/SoilMoistureStreamMod.F90 +++ /dev/null @@ -1,418 +0,0 @@ -module SoilMoistureStreamMod - - ! ********************************************************************** - ! --------------------------- IMPORTANT NOTE --------------------------- - ! - ! In cases using the NUOPC driver/mediator, we use a different version of this module, - ! based on CDEPS, which resides in src/cpl/nuopc/. Changes to the science here should - ! also be made in the similar file in src/cpl/nuopc. Once we start using CDEPS by - ! default, we can remove this version and move the CDEPS-based version into its place. - ! ********************************************************************** - -#include "shr_assert.h" - - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! Read in soil moisture from data stream - ! - ! !USES: - use shr_strdata_mod , only : shr_strdata_type, shr_strdata_create - use shr_strdata_mod , only : shr_strdata_print, shr_strdata_advance - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_kind_mod , only : CL => shr_kind_CL, CXX => shr_kind_CXX - use shr_log_mod , only : errMsg => shr_log_errMsg - use decompMod , only : bounds_type, subgrid_level_column - use abortutils , only : endrun - use clm_varctl , only : iulog, use_soil_moisture_streams, inst_name - use clm_varcon , only : grlnd - use controlMod , only : NLFilename - use domainMod , only : ldomain - use LandunitType , only : lun - use ColumnType , only : col - use SoilStateType , only : soilstate_type - use WaterStateBulkType , only : waterstatebulk_type - use perf_mod , only : t_startf, t_stopf - use spmdMod , only : masterproc, mpicom, comp_id - use lnd_set_decomp_and_domain , only : gsMap_lnd2Dsoi_gdc2glo - use mct_mod - use ncdio_pio - ! - ! !PUBLIC TYPES: - implicit none - private - ! - ! !PUBLIC MEMBER FUNCTIONS: - public :: PrescribedSoilMoistureInit ! position datasets for soil moisture - public :: PrescribedSoilMoistureAdvance ! Advance the soil moisture stream (outside of Open-MP loops) - public :: PrescribedSoilMoistureInterp ! interpolates between two periods of soil moisture data - - ! !PRIVATE MEMBER DATA: - type(shr_strdata_type) :: sdat_soilm ! soil moisture input data stream - integer :: ism ! Soil moisture steram index - integer, allocatable :: g_to_ig(:) ! Array matching gridcell index to data index - logical :: soilm_ignore_data_if_missing ! If should ignore overridding a point with soil moisture data - ! from the streams file, if the streams file shows that point - ! as missing (namelist item) - ! - ! !PRIVATE TYPES: - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - !----------------------------------------------------------------------- - -contains - - !----------------------------------------------------------------------- - ! - ! soil_moisture_init - ! - !----------------------------------------------------------------------- - subroutine PrescribedSoilMoistureInit(bounds) - ! - ! Initialize data stream information for soil moisture. - ! - ! - ! !USES: - use clm_time_manager , only : get_calendar - use ncdio_pio , only : pio_subsystem - use shr_pio_mod , only : shr_pio_getiotype - use clm_nlUtilsMod , only : find_nlgroup_name - use ndepStreamMod , only : clm_domain_mct - use shr_stream_mod , only : shr_stream_file_null - use shr_string_mod , only : shr_string_listCreateField - use clm_varpar , only : nlevsoi - ! - ! !ARGUMENTS: - implicit none - type(bounds_type), intent(in) :: bounds ! bounds - ! - ! !LOCAL VARIABLES: - integer :: i ! index - integer :: stream_year_first_soilm ! first year in Ustar stream to use - integer :: stream_year_last_soilm ! last year in Ustar stream to use - integer :: model_year_align_soilm ! align stream_year_first_soilm with - integer :: nu_nml ! unit for namelist file - integer :: nml_error ! namelist i/o error flag - integer :: soilm_offset ! Offset in time for dataset (sec) - type(mct_ggrid) :: dom_clm ! domain information - character(len=CL) :: stream_fldfilename_soilm ! ustar stream filename to read - character(len=CL) :: soilm_tintalgo = 'linear' ! Time interpolation alogrithm - - character(*), parameter :: subName = "('PrescribedSoilMoistureInit')" - character(*), parameter :: F00 = "('(PrescribedSoilMoistureInit) ',4a)" - character(*), parameter :: soilmString = "H2OSOI" ! base string for field string - character(CXX) :: fldList ! field string - !----------------------------------------------------------------------- - ! - ! deal with namelist variables here in init - ! - namelist /soil_moisture_streams/ & - stream_year_first_soilm, & - stream_year_last_soilm, & - model_year_align_soilm, & - soilm_tintalgo, & - soilm_offset, & - soilm_ignore_data_if_missing, & - stream_fldfilename_soilm - - ! Default values for namelist - stream_year_first_soilm = 1 ! first year in stream to use - stream_year_last_soilm = 1 ! last year in stream to use - model_year_align_soilm = 1 ! align stream_year_first_soilm with this model year - stream_fldfilename_soilm = shr_stream_file_null - soilm_offset = 0 - soilm_ignore_data_if_missing = .false. - - ! Read soilm_streams namelist - if (masterproc) then - open( newunit=nu_nml, file=trim(NLFilename), status='old', iostat=nml_error ) - call find_nlgroup_name(nu_nml, 'soil_moisture_streams', status=nml_error) - if (nml_error == 0) then - read(nu_nml, nml=soil_moisture_streams,iostat=nml_error) - if (nml_error /= 0) then - call endrun(subname // ':: ERROR reading soil_moisture_streams namelist') - end if - else - call endrun(subname // ':: ERROR finding soilm_streams namelist') - end if - close(nu_nml) - endif - - call shr_mpi_bcast(stream_year_first_soilm, mpicom) - call shr_mpi_bcast(stream_year_last_soilm, mpicom) - call shr_mpi_bcast(model_year_align_soilm, mpicom) - call shr_mpi_bcast(stream_fldfilename_soilm, mpicom) - call shr_mpi_bcast(soilm_tintalgo, mpicom) - call shr_mpi_bcast(soilm_offset, mpicom) - call shr_mpi_bcast(soilm_ignore_data_if_missing, mpicom) - - if (masterproc) then - - write(iulog,*) ' ' - write(iulog,*) 'soil_moisture_stream settings:' - write(iulog,*) ' stream_year_first_soilm = ',stream_year_first_soilm - write(iulog,*) ' stream_year_last_soilm = ',stream_year_last_soilm - write(iulog,*) ' model_year_align_soilm = ',model_year_align_soilm - write(iulog,*) ' stream_fldfilename_soilm = ',trim(stream_fldfilename_soilm) - write(iulog,*) ' soilm_tintalgo = ',trim(soilm_tintalgo) - write(iulog,*) ' soilm_offset = ',soilm_offset - if ( soilm_ignore_data_if_missing )then - write(iulog,*) ' Do NOT override a point with streams data if the streams data is missing' - else - write(iulog,*) ' Abort, if you find a model point where the input streams data is set to missing value' - end if - - endif - - call clm_domain_mct (bounds, dom_clm, nlevels=nlevsoi) - - ! create the field list for these fields...use in shr_strdata_create - fldList = trim(soilmString) - if (masterproc) write(iulog,*) 'fieldlist: ', trim(fldList) - - call shr_strdata_create(sdat_soilm,name="soil_moisture", & - pio_subsystem=pio_subsystem, & - pio_iotype=shr_pio_getiotype(inst_name), & - mpicom=mpicom, compid=comp_id, & - gsmap=gsMap_lnd2Dsoi_gdc2glo, ggrid=dom_clm, & - nxg=ldomain%ni, nyg=ldomain%nj, & - nzg=nlevsoi, & - yearFirst=stream_year_first_soilm, & - yearLast=stream_year_last_soilm, & - yearAlign=model_year_align_soilm, & - offset=soilm_offset, & - domFilePath='', & - domFileName=trim(stream_fldFileName_soilm), & - domTvarName='time', & - domXvarName='lon' , & - domYvarName='lat' , & - domZvarName='levsoi' , & - domAreaName='area', & - domMaskName='mask', & - filePath='', & - filename=(/stream_fldFileName_soilm/), & - fldListFile=fldList, & - fldListModel=fldList, & - fillalgo='none', & - mapalgo='none', & - tintalgo=soilm_tintalgo, & - calendar=get_calendar(), & - dtlimit = 15._r8, & - taxmode='cycle' ) - - if (masterproc) then - call shr_strdata_print(sdat_soilm,'soil moisture data') - endif - - end subroutine PrescribedSoilMoistureInit - - - !----------------------------------------------------------------------- - ! - ! PrescribedSoilMoistureAdvance - ! - !----------------------------------------------------------------------- - subroutine PrescribedSoilMoistureAdvance( bounds ) - ! - ! Advanace the prescribed soil moisture stream - ! - ! !USES: - use clm_time_manager, only : get_curr_date - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - character(len=CL) :: stream_var_name - integer :: g, ig - integer :: ier ! error code - 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) - - call get_curr_date(year, mon, day, sec) - mcdate = year*10000 + mon*100 + day - - stream_var_name = 'H2OSOI' - - ! Determine variable index - ism = mct_aVect_indexRA(sdat_soilm%avs(1),trim(stream_var_name)) - - call shr_strdata_advance(sdat_soilm, mcdate, sec, mpicom, trim(stream_var_name)) - - ! Map gridcell to AV index - ier = 0 - if ( .not. allocated(g_to_ig) )then - allocate (g_to_ig(bounds%begg:bounds%endg), stat=ier) - if (ier /= 0) then - write(iulog,*) 'Prescribed soil moisture allocation error' - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if - - ig = 0 - do g = bounds%begg,bounds%endg - ig = ig+1 - g_to_ig(g) = ig - end do - end if - - end subroutine PrescribedSoilMoistureAdvance - - !----------------------------------------------------------------------- - ! - ! PrescribedSoilMoistureInterp - ! - !----------------------------------------------------------------------- - subroutine PrescribedSoilMoistureInterp(bounds, soilstate_inst, & - waterstatebulk_inst) - ! - ! Assign data stream information for prescribed soil moisture. - ! - ! !USES: - use clm_time_manager, only : get_curr_date - use clm_varpar , only : nlevsoi - use clm_varcon , only : denh2o, denice, watmin, spval - use landunit_varcon , only : istsoil, istcrop - ! - ! !ARGUMENTS: - implicit none - type(bounds_type) , intent(in) :: bounds - type(soilstate_type) , intent(in) :: soilstate_inst - type(waterstatebulk_type) , intent(inout) :: waterstatebulk_inst - ! - ! !LOCAL VARIABLES: - integer :: c, g, j, ig, n - real(r8) :: soilm_liq_frac ! liquid fraction of soil moisture - real(r8) :: soilm_ice_frac ! ice fraction of soil moisture - real(r8) :: moisture_increment ! soil moisture adjustment increment - real(r8) :: h2osoi_vol_initial ! initial vwc value - character(*), parameter :: subName = "('PrescribedSoilMoistureInterp')" - - !----------------------------------------------------------------------- - - SHR_ASSERT_FL( (lbound(sdat_soilm%avs(1)%rAttr,1) == ism ), sourcefile, __LINE__) - SHR_ASSERT_FL( (ubound(sdat_soilm%avs(1)%rAttr,1) == ism ), sourcefile, __LINE__) - SHR_ASSERT_FL( (lbound(g_to_ig,1) <= bounds%begg ), sourcefile, __LINE__) - SHR_ASSERT_FL( (ubound(g_to_ig,1) >= bounds%endg ), sourcefile, __LINE__) - SHR_ASSERT_FL( (lbound(sdat_soilm%avs(1)%rAttr,2) <= g_to_ig(bounds%begg) ), sourcefile, __LINE__) - SHR_ASSERT_FL( (ubound(sdat_soilm%avs(1)%rAttr,2) >= g_to_ig(bounds%endg)+(nlevsoi-1)*size(g_to_ig) ), sourcefile, __LINE__) - associate( & - dz => col%dz , & ! Input: [real(r8) (:,:) ] layer depth (m) - watsat => soilstate_inst%watsat_col , & ! Input: [real(r8) (:,:) ] volumetric soil water at saturation (porosity) - h2osoi_liq => waterstatebulk_inst%h2osoi_liq_col , & ! Input/Output: [real(r8) (:,:) ] liquid water (kg/m2) - h2osoi_ice => waterstatebulk_inst%h2osoi_ice_col , & ! Input/Output: [real(r8) (:,:) ] ice water (kg/m2) - h2osoi_vol => waterstatebulk_inst%h2osoi_vol_col , & ! Output: volumetric soil water (m3/m3) - h2osoi_vol_prs => waterstatebulk_inst%h2osoi_vol_prs_grc & ! Output: prescribed volumetric soil water (m3/m3) - ) - SHR_ASSERT_FL( (lbound(h2osoi_vol,1) <= bounds%begc ), sourcefile, __LINE__) - SHR_ASSERT_FL( (ubound(h2osoi_vol,1) >= bounds%endc ), sourcefile, __LINE__) - SHR_ASSERT_FL( (lbound(h2osoi_vol,2) == 1 ), sourcefile, __LINE__) - SHR_ASSERT_FL( (ubound(h2osoi_vol,2) >= nlevsoi ), sourcefile, __LINE__) - SHR_ASSERT_FL( (lbound(dz,1) <= bounds%begc ), sourcefile, __LINE__) - SHR_ASSERT_FL( (ubound(dz,1) >= bounds%endc ), sourcefile, __LINE__) - SHR_ASSERT_FL( (lbound(dz,2) <= 1 ), sourcefile, __LINE__) - SHR_ASSERT_FL( (ubound(dz,2) >= nlevsoi ), sourcefile, __LINE__) - SHR_ASSERT_FL( (lbound(watsat,1) <= bounds%begc ), sourcefile, __LINE__) - SHR_ASSERT_FL( (ubound(watsat,1) >= bounds%endc ), sourcefile, __LINE__) - SHR_ASSERT_FL( (lbound(watsat,2) <= 1 ), sourcefile, __LINE__) - SHR_ASSERT_FL( (ubound(watsat,2) >= nlevsoi ), sourcefile, __LINE__) - SHR_ASSERT_FL( (lbound(h2osoi_liq,1) <= bounds%begc ), sourcefile, __LINE__) - SHR_ASSERT_FL( (ubound(h2osoi_liq,1) >= bounds%endc ), sourcefile, __LINE__) - SHR_ASSERT_FL( (lbound(h2osoi_liq,2) <= 1 ), sourcefile, __LINE__) - SHR_ASSERT_FL( (ubound(h2osoi_liq,2) >= nlevsoi ), sourcefile, __LINE__) - SHR_ASSERT_FL( (lbound(h2osoi_ice,1) <= bounds%begc ), sourcefile, __LINE__) - SHR_ASSERT_FL( (ubound(h2osoi_ice,1) >= bounds%endc ), sourcefile, __LINE__) - SHR_ASSERT_FL( (lbound(h2osoi_ice,2) <= 1 ), sourcefile, __LINE__) - SHR_ASSERT_FL( (ubound(h2osoi_ice,2) >= nlevsoi ), sourcefile, __LINE__) - SHR_ASSERT_FL( (lbound(h2osoi_vol_prs,1) <= bounds%begg ), sourcefile, __LINE__) - SHR_ASSERT_FL( (ubound(h2osoi_vol_prs,1) >= bounds%endg ), sourcefile, __LINE__) - SHR_ASSERT_FL( (lbound(h2osoi_vol_prs,2) == 1 ), sourcefile, __LINE__) - SHR_ASSERT_FL( (ubound(h2osoi_vol_prs,2) >= nlevsoi ), sourcefile, __LINE__) - ! - ! Set the prescribed soil moisture read from the file everywhere - ! - do g = bounds%begg, bounds%endg - ig = g_to_ig(g) - do j = 1, nlevsoi - - !n = ig + (j-1)*size(g_to_ig) - n = ig + (j-1)*size(g_to_ig) - - h2osoi_vol_prs(g,j) = sdat_soilm%avs(1)%rAttr(ism,n) - - ! If soil moiture is being interpolated in time and the result is - ! large that probably means one of the two data points is missing (set to spval) - if ( h2osoi_vol_prs(g,j) > 10.0_r8 .and. (h2osoi_vol_prs(g,j) /= spval) )then - h2osoi_vol_prs(g,j) = spval - end if - - end do - end do - - do c = bounds%begc, bounds%endc - ! - ! Set variable for each gridcell/column combination - ! - g = col%gridcell(c) - ig = g_to_ig(g) - - ! EBK Jan/2020, also check weights on gridcell (See https://github.com/ESCOMP/CTSM/issues/847) - if ( (lun%itype(col%landunit(c)) == istsoil) .or. (lun%itype(col%landunit(c)) == istcrop) .and. & - (col%wtgcell(c) /= 0._r8) ) then - ! this is a 2d field (gridcell/nlevsoi) ! - do j = 1, nlevsoi - - n = ig + (j-1)*size(g_to_ig) - - ! if soil water is zero, liq/ice fractions cannot be calculated - if((h2osoi_liq(c, j) + h2osoi_ice(c, j)) > 0._r8) then - - ! save original soil moisture value - h2osoi_vol_initial = h2osoi_vol(c,j) - - ! Check if the vegetated land mask from the dataset on the - ! file is different - if ( (h2osoi_vol_prs(g,j) == spval) .and. (h2osoi_vol_initial /= spval) )then - if ( soilm_ignore_data_if_missing )then - cycle - else - write(iulog,*) 'Input soil moisture dataset is not vegetated as expected: gridcell=', & - g, ' active = ', col%active(c) - call endrun(subgrid_index=c, subgrid_level=subgrid_level_column, & - msg = subname // & - ' ERROR:: The input soil moisture stream is NOT vegetated for one of the land points' ) - end if - end if - - ! update volumetric soil moisture from data prescribed from the file - h2osoi_vol(c,j) = h2osoi_vol_prs(g,j) - - - ! calculate liq/ice mass fractions - soilm_liq_frac = h2osoi_liq(c, j) /(h2osoi_liq(c, j) + h2osoi_ice(c, j)) - soilm_ice_frac = h2osoi_ice(c, j) /(h2osoi_liq(c, j) + h2osoi_ice(c, j)) - - ! calculate moisture increment - moisture_increment = h2osoi_vol(c,j) - h2osoi_vol_initial - ! add limitation check - moisture_increment = min((watsat(c,j) - h2osoi_vol_initial),max(-(h2osoi_vol_initial-watmin),moisture_increment)) - - ! update liq/ice water mass due to (volumetric) moisture increment - h2osoi_liq(c,j) = h2osoi_liq(c,j) + (soilm_liq_frac * moisture_increment * dz(c, j) * denh2o) - h2osoi_ice(c,j) = h2osoi_ice(c,j) + (soilm_ice_frac * moisture_increment * dz(c, j) * denice) - - else - call endrun(subgrid_index=c, subgrid_level=subgrid_level_column, & - msg = subname // ':: ERROR h2osoil liquid plus ice is zero') - endif - enddo - endif - end do - - end associate - - end subroutine PrescribedSoilMoistureInterp - -end module SoilMoistureStreamMod diff --git a/src/cpl/mct/UrbanTimeVarType.F90 b/src/cpl/mct/UrbanTimeVarType.F90 deleted file mode 100644 index 805ac47fbf..0000000000 --- a/src/cpl/mct/UrbanTimeVarType.F90 +++ /dev/null @@ -1,314 +0,0 @@ -module UrbanTimeVarType - - !------------------------------------------------------------------------------ - ! !DESCRIPTION: - ! Urban Time Varying Data - ! - ! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8, CL => shr_kind_CL - use shr_log_mod , only : errMsg => shr_log_errMsg - use abortutils , only : endrun - use decompMod , only : bounds_type, subgrid_level_landunit - use clm_varctl , only : iulog, inst_name - use landunit_varcon , only : isturb_MIN, isturb_MAX - use clm_varcon , only : spval - use LandunitType , only : lun - use GridcellType , only : grc - use mct_mod - use shr_strdata_mod , only : shr_strdata_type - ! - implicit none - save - private - ! - ! - - ! !PUBLIC TYPE - type, public :: urbantv_type - - real(r8), public, pointer :: t_building_max(:) ! lun maximum internal building air temperature (K) - type(shr_strdata_type) :: sdat_urbantv ! urban time varying input data stream - contains - - ! !PUBLIC MEMBER FUNCTIONS: - procedure, public :: Init ! Allocate and initialize urbantv - procedure, public :: urbantv_init ! Initialize urban time varying stream - procedure, public :: urbantv_interp ! Interpolate urban time varying stream - - end type urbantv_type - - !----------------------------------------------------------------------- - character(15), private :: stream_var_name(isturb_MIN:isturb_MAX) - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - -contains - - !----------------------------------------------------------------------- - subroutine Init(this, bounds, NLFilename) - ! - ! Allocate module variables and data structures - ! - ! !USES: - use shr_infnan_mod , only : nan => shr_infnan_nan, assignment(=) - use histFileMod , only : hist_addfld1d - ! - ! !ARGUMENTS: - class(urbantv_type) :: this - type(bounds_type) , intent(in) :: bounds - character(len=*) , intent(in) :: NLFilename ! Namelist filename - ! - ! !LOCAL VARIABLES: - integer :: begl, endl - !--------------------------------------------------------------------- - - begl = bounds%begl; endl = bounds%endl - - ! Allocate urbantv data structure - - allocate(this%t_building_max (begl:endl)) ; this%t_building_max (:) = nan - - call this%urbantv_init(bounds, NLFilename) - call this%urbantv_interp(bounds) - - ! Add history fields - call hist_addfld1d (fname='TBUILD_MAX', units='K', & - avgflag='A', long_name='prescribed maximum interior building temperature', & - ptr_lunit=this%t_building_max, default='inactive', set_nourb=spval, & - l2g_scale_type='unity') - - - end subroutine Init - - !----------------------------------------------------------------------- - - !----------------------------------------------------------------------- - subroutine urbantv_init(this, bounds, NLFilename) - ! - ! !DESCRIPTION: - ! Initialize data stream information for urban time varying data - ! - ! !USES: - use clm_time_manager , only : get_calendar - use ncdio_pio , only : pio_subsystem - use shr_pio_mod , only : shr_pio_getiotype - use clm_nlUtilsMod , only : find_nlgroup_name - use ndepStreamMod , only : clm_domain_mct - use spmdMod , only : masterproc, mpicom, comp_id - use fileutils , only : getavu, relavu - use shr_mpi_mod , only : shr_mpi_bcast - use shr_string_mod , only : shr_string_listAppend - use shr_strdata_mod , only : shr_strdata_create, shr_strdata_print - use domainMod , only : ldomain - use shr_infnan_mod , only : nan => shr_infnan_nan, assignment(=) - use landunit_varcon , only : isturb_TBD, isturb_HD, isturb_MD - use lnd_set_decomp_and_domain , only : gsmap_global - ! - ! !ARGUMENTS: - implicit none - class(urbantv_type) :: this - type(bounds_type), intent(in) :: bounds - character(len=*), intent(in) :: NLFilename ! Namelist filename - ! - ! !LOCAL VARIABLES: - integer :: begl, endl ! landunits - integer :: ifield ! field index - integer :: stream_year_first_urbantv ! first year in urban tv stream to use - integer :: stream_year_last_urbantv ! last year in urban tv stream to use - integer :: model_year_align_urbantv ! align stream_year_first_urbantv - ! with this model year - integer :: nu_nml ! unit for namelist file - integer :: nml_error ! namelist i/o error flag - type(mct_ggrid) :: dom_clm ! domain information - character(len=CL) :: stream_fldFileName_urbantv ! urban tv streams filename - character(len=CL) :: urbantvmapalgo = 'nn' ! mapping alogrithm for urban ac - character(len=CL) :: urbantv_tintalgo = 'linear' ! time interpolation alogrithm - character(len=CL) :: fldList ! field string - character(*), parameter :: urbantvString = "tbuildmax_" ! base string for field string - character(*), parameter :: subName = "('urbantv_init')" - character(*), parameter :: F00 = "('(urbantv_init) ',4a)" - !----------------------------------------------------------------------- - namelist /urbantv_streams/ & - stream_year_first_urbantv, & - stream_year_last_urbantv, & - model_year_align_urbantv, & - urbantvmapalgo, & - stream_fldFileName_urbantv, & - urbantv_tintalgo - !----------------------------------------------------------------------- - - begl = bounds%begl; endl = bounds%endl - - ! Default values for namelist - stream_year_first_urbantv = 1 ! first year in stream to use - stream_year_last_urbantv = 1 ! last year in stream to use - model_year_align_urbantv = 1 ! align stream_year_first_urbantv with this model year - stream_fldFileName_urbantv = ' ' - - ! Read urbantv_streams namelist - if (masterproc) then - nu_nml = getavu() - open( nu_nml, file=trim(NLFilename), status='old', iostat=nml_error ) - call find_nlgroup_name(nu_nml, 'urbantv_streams', status=nml_error) - if (nml_error == 0) then - read(nu_nml, nml=urbantv_streams,iostat=nml_error) - if (nml_error /= 0) then - call endrun(msg='ERROR reading urbantv_streams namelist'//errMsg(sourcefile, __LINE__)) - end if - end if - close(nu_nml) - call relavu( nu_nml ) - endif - - call shr_mpi_bcast(stream_year_first_urbantv, mpicom) - call shr_mpi_bcast(stream_year_last_urbantv, mpicom) - call shr_mpi_bcast(model_year_align_urbantv, mpicom) - call shr_mpi_bcast(stream_fldFileName_urbantv, mpicom) - call shr_mpi_bcast(urbantv_tintalgo, mpicom) - - if (masterproc) then - write(iulog,*) ' ' - write(iulog,*) 'urbantv_streams settings:' - write(iulog,*) ' stream_year_first_urbantv = ',stream_year_first_urbantv - write(iulog,*) ' stream_year_last_urbantv = ',stream_year_last_urbantv - write(iulog,*) ' model_year_align_urbantv = ',model_year_align_urbantv - write(iulog,*) ' stream_fldFileName_urbantv = ',stream_fldFileName_urbantv - write(iulog,*) ' urbantv_tintalgo = ',urbantv_tintalgo - write(iulog,*) ' ' - endif - - call clm_domain_mct (bounds, dom_clm) - - ! create the field list for these urbantv fields...use in shr_strdata_create - stream_var_name(:) = "NOT_SET" - stream_var_name(isturb_TBD) = urbantvString//"TBD" - stream_var_name(isturb_HD) = urbantvString//"HD" - stream_var_name(isturb_MD) = urbantvString//"MD" - fldList = "" - do ifield = isturb_MIN, isturb_MAX - call shr_string_listAppend( fldList, stream_var_name(ifield) ) - end do - - call shr_strdata_create(this%sdat_urbantv,name="clmurbantv", & - pio_subsystem=pio_subsystem, & - pio_iotype=shr_pio_getiotype(inst_name), & - mpicom=mpicom, compid=comp_id, & - gsmap=gsmap_global, ggrid=dom_clm, & - nxg=ldomain%ni, nyg=ldomain%nj, & - yearFirst=stream_year_first_urbantv, & - yearLast=stream_year_last_urbantv, & - yearAlign=model_year_align_urbantv, & - offset=0, & - domFilePath='', & - domFileName=trim(stream_fldFileName_urbantv), & - domTvarName='time', & - domXvarName='lon' , & - domYvarName='lat' , & - domAreaName='area', & - domMaskName='LANDMASK', & - filePath='', & - filename=(/trim(stream_fldFileName_urbantv)/) , & - fldListFile=fldList, & - fldListModel=fldList, & - fillalgo='none', & - mapalgo=urbantvmapalgo, & - calendar=get_calendar(), & - tintalgo=urbantv_tintalgo, & - taxmode='extend' ) - - if (masterproc) then - call shr_strdata_print(this%sdat_urbantv,'urban time varying data') - endif - - - end subroutine urbantv_init - - !----------------------------------------------------------------------- - subroutine urbantv_interp(this, bounds) - ! - ! !DESCRIPTION: - ! Interpolate data stream information for urban time varying data. - ! - ! !USES: - use clm_time_manager, only : get_curr_date - use spmdMod , only : mpicom - use shr_strdata_mod , only : shr_strdata_advance - use clm_instur , only : urban_valid - ! - ! !ARGUMENTS: - class(urbantv_type) :: this - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - logical :: found - integer :: l, glun, ig, g, ip - 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 :: lindx ! landunit index - integer :: gindx ! gridcell index - !----------------------------------------------------------------------- - - call get_curr_date(year, mon, day, sec) - mcdate = year*10000 + mon*100 + day - - call shr_strdata_advance(this%sdat_urbantv, mcdate, sec, mpicom, 'urbantvdyn') - - do l = bounds%begl,bounds%endl - if (lun%urbpoi(l)) then - glun = lun%gridcell(l) - ip = mct_aVect_indexRA(this%sdat_urbantv%avs(1),trim(stream_var_name(lun%itype(l)))) - ! - ! Determine vector index corresponding to glun - ! - ig = 0 - do g = bounds%begg,bounds%endg - ig = ig+1 - if (g == glun) exit - end do - - this%t_building_max(l) = this%sdat_urbantv%avs(1)%rAttr(ip,ig) - else - this%t_building_max(l) = spval - end if - end do - - found = .false. - do l = bounds%begl,bounds%endl - if (lun%urbpoi(l)) then - glun = lun%gridcell(l) - ! - ! Determine vector index corresponding to glun - ! - ig = 0 - do g = bounds%begg,bounds%endg - ig = ig+1 - if (g == glun) exit - end do - - if ( .not. urban_valid(g) .or. (this%t_building_max(l) <= 0._r8)) then - found = .true. - gindx = g - lindx = l - exit - end if - end if - end do - if ( found ) then - write(iulog,*)'ERROR: no valid urban data for g= ',gindx - write(iulog,*)'landunit type: ',lun%itype(lindx) - write(iulog,*)'urban_valid: ',urban_valid(gindx) - write(iulog,*)'t_building_max: ',this%t_building_max(lindx) - call endrun(subgrid_index=lindx, subgrid_level=subgrid_level_landunit, & - msg=errmsg(sourcefile, __LINE__)) - end if - - - end subroutine urbantv_interp - - !----------------------------------------------------------------------- - -end module UrbanTimeVarType diff --git a/src/cpl/mct/ch4FInundatedStreamType.F90 b/src/cpl/mct/ch4FInundatedStreamType.F90 deleted file mode 100644 index 3c26f4d109..0000000000 --- a/src/cpl/mct/ch4FInundatedStreamType.F90 +++ /dev/null @@ -1,389 +0,0 @@ -module ch4FInundatedStreamType - -#include "shr_assert.h" - - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! Contains methods for reading in finundated streams file for methane code. - ! - ! !USES - use shr_kind_mod , only: r8 => shr_kind_r8, CL => shr_kind_cl - use spmdMod , only: mpicom, masterproc - use clm_varctl , only: iulog, inst_name - use abortutils , only: endrun - use decompMod , only: bounds_type - use ch4varcon , only: finundation_mtd - - ! !PUBLIC TYPES: - implicit none - private - save - - type, public :: ch4finundatedstream_type - real(r8), pointer, private :: zwt0_gdc (:) ! col coefficient for determining finundated (m) - real(r8), pointer, private :: f0_gdc (:) ! col maximum inundated fraction for a gridcell (for methane code) - real(r8), pointer, private :: p3_gdc (:) ! col coefficient for determining finundated (m) - real(r8), pointer, private :: fws_slope_gdc (:) ! col slope in fws = slope * tws + intercept (A coefficient) - real(r8), pointer, private :: fws_intercept_gdc (:) ! col slope in fws = slope * tws + intercept (B coefficient) - contains - - ! !PUBLIC MEMBER FUNCTIONS: - procedure, public :: Init ! Initialize and read data in - procedure, public :: CalcFinundated ! Calculate finundated based on input streams - procedure, public :: UseStreams ! If streams will be used - - ! !PRIVATE MEMBER FUNCTIONS: - procedure, private :: InitAllocate ! Allocate data - - end type ch4finundatedstream_type - - - ! ! PRIVATE DATA: - - type, private :: streamcontrol_type - character(len=CL) :: stream_fldFileName_ch4finundated ! Filename - character(len=CL) :: ch4finundatedmapalgo ! map algo - character(len=CL) :: fldList ! List of fields to read - contains - procedure, private :: ReadNML ! Read in namelist - end type streamcontrol_type - - type(streamcontrol_type), private :: control ! Stream control data - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - !============================================================================== - -contains - - !============================================================================== - - subroutine Init(this, bounds, NLFilename) - ! - ! Initialize the ch4 finundated stream object - ! - ! Uses: - use clm_time_manager , only : get_calendar, get_curr_date - use ncdio_pio , only : pio_subsystem - use shr_pio_mod , only : shr_pio_getiotype - use shr_nl_mod , only : shr_nl_find_group_name - use shr_mpi_mod , only : shr_mpi_bcast - use ndepStreamMod , only : clm_domain_mct - use domainMod , only : ldomain - use decompMod , only : bounds_type - use mct_mod , only : mct_ggrid, mct_avect_indexra - use shr_strdata_mod , only : shr_strdata_type, shr_strdata_create - use shr_strdata_mod , only : shr_strdata_print, shr_strdata_advance - use spmdMod , only : comp_id, iam - use ch4varcon , only : finundation_mtd_h2osfc - use ch4varcon , only : finundation_mtd_ZWT_inversion, finundation_mtd_TWS_inversion - use lnd_set_decomp_and_domain , only : gsmap_global - ! - ! arguments - implicit none - class(ch4finundatedstream_type) :: this - type(bounds_type), intent(in) :: bounds - character(len=*), intent(in) :: NLFilename ! Namelist filename - ! - ! local variables - integer :: ig, g ! Indices - type(mct_ggrid) :: dom_clm ! domain information - type(shr_strdata_type) :: sdat ! input data stream - integer :: index_ZWT0 = 0 ! Index of ZWT0 field - integer :: index_F0 = 0 ! Index of F0 field - integer :: index_P3 = 0 ! Index of P3 field - integer :: index_FWS_TWS_A = 0 ! Index of FWS_TWS_A field - integer :: index_FWS_TWS_B = 0 ! Index of FWS_TWS_B field - 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) - character(len=*), parameter :: stream_name = 'ch4finundated' - character(*), parameter :: subName = "('ch4finundatedstream::Init')" - !----------------------------------------------------------------------- - if ( finundation_mtd /= finundation_mtd_h2osfc )then - call this%InitAllocate( bounds ) - call control%ReadNML( bounds, NLFileName ) - - if ( this%useStreams() )then - call clm_domain_mct (bounds, dom_clm) - - call shr_strdata_create(sdat,name=stream_name, & - pio_subsystem=pio_subsystem, & - pio_iotype=shr_pio_getiotype(inst_name), & - mpicom=mpicom, compid=comp_id, & - gsmap=gsmap_global, ggrid=dom_clm, & - nxg=ldomain%ni, nyg=ldomain%nj, & - yearFirst=1996, & - yearLast=1996, & - yearAlign=1, & - offset=0, & - domFilePath='', & - domFileName=trim(control%stream_fldFileName_ch4finundated), & - domTvarName='time', & - domXvarName='LONGXY' , & - domYvarName='LATIXY' , & - domAreaName='AREA', & - domMaskName='LANDMASK', & - filePath='', & - filename=(/trim(control%stream_fldFileName_ch4finundated)/), & - fldListFile=control%fldList, & - fldListModel=control%fldList, & - fillalgo='none', & - mapalgo=control%ch4finundatedmapalgo, & - calendar=get_calendar(), & - taxmode='extend' ) - - if (masterproc) then - call shr_strdata_print(sdat,'CLM '//stream_name//' data') - endif - - if( finundation_mtd == finundation_mtd_ZWT_inversion )then - index_ZWT0 = mct_avect_indexra(sdat%avs(1),'ZWT0') - index_F0 = mct_avect_indexra(sdat%avs(1),'F0' ) - index_P3 = mct_avect_indexra(sdat%avs(1),'P3' ) - else if( finundation_mtd == finundation_mtd_TWS_inversion )then - index_FWS_TWS_A = mct_avect_indexra(sdat%avs(1),'FWS_TWS_A') - index_FWS_TWS_B = mct_avect_indexra(sdat%avs(1),'FWS_TWS_B') - end if - - - ! Explicitly set current date to a hardcoded constant value. Otherwise - ! using the real date can cause roundoff differences that are - ! detrected as issues with exact restart. EBK M05/20/2017 - !call get_curr_date(year, mon, day, sec) - year = 1996 - mon = 12 - day = 31 - sec = 0 - mcdate = year*10000 + mon*100 + day - - call shr_strdata_advance(sdat, mcdate, sec, mpicom, 'ch4finundated') - - ! Get the data - ig = 0 - do g = bounds%begg,bounds%endg - ig = ig+1 - if ( index_ZWT0 > 0 )then - this%zwt0_gdc(g) = sdat%avs(1)%rAttr(index_ZWT0,ig) - end if - if ( index_F0 > 0 )then - this%f0_gdc(g) = sdat%avs(1)%rAttr(index_F0,ig) - end if - if ( index_P3 > 0 )then - this%p3_gdc(g) = sdat%avs(1)%rAttr(index_P3,ig) - end if - if ( index_FWS_TWS_A > 0 )then - this%fws_slope_gdc(g) = sdat%avs(1)%rAttr(index_FWS_TWS_A,ig) - end if - if ( index_FWS_TWS_B > 0 )then - this%fws_intercept_gdc(g) = sdat%avs(1)%rAttr(index_FWS_TWS_B,ig) - end if - end do - end if - end if - - end subroutine Init - - !----------------------------------------------------------------------- - logical function UseStreams(this) - ! - ! !DESCRIPTION: - ! Return true if - ! - ! !USES: - ! - ! !ARGUMENTS: - implicit none - class(ch4finundatedstream_type) :: this - ! - ! !LOCAL VARIABLES: - if ( trim(control%stream_fldFileName_ch4finundated) == '' )then - UseStreams = .false. - else - UseStreams = .true. - end if - end function UseStreams - - !----------------------------------------------------------------------- - subroutine InitAllocate(this, bounds) - ! - ! !DESCRIPTION: - ! Allocate module variables and data structures - ! - ! !USES: - use shr_infnan_mod, only: nan => shr_infnan_nan, assignment(=) - use ch4varcon , only: finundation_mtd_ZWT_inversion, finundation_mtd_TWS_inversion - ! - ! !ARGUMENTS: - implicit none - class(ch4finundatedstream_type) :: this - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - integer :: begc, endc - integer :: begg, endg - !--------------------------------------------------------------------- - - begc = bounds%begc; endc = bounds%endc - begg = bounds%begg; endg = bounds%endg - - if( finundation_mtd == finundation_mtd_ZWT_inversion )then - allocate(this%zwt0_gdc (begg:endg)) ; this%zwt0_gdc (:) = nan - allocate(this%f0_gdc (begg:endg)) ; this%f0_gdc (:) = nan - allocate(this%p3_gdc (begg:endg)) ; this%p3_gdc (:) = nan - else if( finundation_mtd == finundation_mtd_TWS_inversion )then - allocate(this%fws_slope_gdc (begg:endg)) ; this%fws_slope_gdc (:) = nan - allocate(this%fws_intercept_gdc(begg:endg)) ; this%fws_intercept_gdc(:) = nan - end if - - end subroutine InitAllocate - - !----------------------------------------------------------------------- - subroutine CalcFinundated(this, bounds, num_soilc, filter_soilc, soilhydrology_inst, & - waterdiagnosticbulk_inst, qflx_surf_lag_col, finundated ) - ! - ! !DESCRIPTION: - ! - ! Calculate finundated according to the appropriate methodology - ! - ! !USES: - use ColumnType , only : col - use ch4varcon , only : finundation_mtd_h2osfc, finundation_mtd_ZWT_inversion - use ch4varcon , only : finundation_mtd_TWS_inversion - use clm_varpar , only : nlevsoi - use SoilHydrologyType, only : soilhydrology_type - use WaterDiagnosticBulkType , only : waterdiagnosticbulk_type - ! - ! !ARGUMENTS: - implicit none - class(ch4finundatedstream_type) :: this - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_soilc ! number of column soil points in column filter - integer , intent(in) :: filter_soilc(:) ! column filter for soil points - type(soilhydrology_type) , intent(in) :: soilhydrology_inst - type(waterdiagnosticbulk_type) , intent(in) :: waterdiagnosticbulk_inst - real(r8) , intent(in) :: qflx_surf_lag_col(bounds%begc:) !time-lagged surface runoff (mm H2O /s) - real(r8) , intent(inout) :: finundated(bounds%begc:) ! fractional inundated area in soil column (excluding dedicated wetland columns) - ! - ! !LOCAL VARIABLES: - integer :: g, c, fc ! Indices - real(r8) :: zwt_actual ! Total water storage (ZWT) to use either perched or total depending on conditions - - SHR_ASSERT_ALL_FL((ubound(qflx_surf_lag_col) == (/bounds%endc/)), sourcefile, __LINE__) - SHR_ASSERT_ALL_FL((ubound(finundated) == (/bounds%endc/)), sourcefile, __LINE__) - - associate( & - z => col%z , & ! Input: [real(r8) (:,:) ] layer depth (m) (-nlevsno+1:nlevsoi) - zwt => soilhydrology_inst%zwt_col , & ! Input: [real(r8) (:) ] water table depth (m) - zwt_perched => soilhydrology_inst%zwt_perched_col , & ! Input: [real(r8) (:) ] perched water table depth (m) - tws => waterdiagnosticbulk_inst%tws_grc , & ! Input: [real(r8) (:) ] total water storage (kg m-2) - frac_h2osfc => waterdiagnosticbulk_inst%frac_h2osfc_col & ! Input: [real(r8) (:) ] fraction of ground covered by surface water (0 to 1) - ) - - ! Calculate finundated - do fc = 1, num_soilc - c = filter_soilc(fc) - g = col%gridcell(c) - select case( finundation_mtd ) - case ( finundation_mtd_h2osfc ) - finundated(c) = frac_h2osfc(c) - case ( finundation_mtd_ZWT_inversion ) - if (this%zwt0_gdc(g) > 0._r8) then - if (zwt_perched(c) < z(c,nlevsoi)-1.e-5_r8 .and. zwt_perched(c) < zwt(c)) then - zwt_actual = zwt_perched(c) - else - zwt_actual = zwt(c) - end if - finundated(c) = this%f0_gdc(g) * exp(-zwt_actual/this%zwt0_gdc(g)) + this%p3_gdc(g)*qflx_surf_lag_col(c) - else - finundated(c) = this%p3_gdc(g)*qflx_surf_lag_col(c) - end if - case ( finundation_mtd_TWS_inversion ) - finundated(c) = this%fws_slope_gdc(g) * tws(g) + this%fws_intercept_gdc(g) - end select - finundated(c) = min( 1.0_r8, max( 0.0_r8, finundated(c) ) ) - end do - end associate - - end subroutine CalcFinundated - !============================================================================== - - subroutine ReadNML(this, bounds, NLFilename) - ! - ! Read the namelist data stream information. - ! - ! Uses: - use clm_time_manager , only : get_calendar - use ncdio_pio , only : pio_subsystem - use shr_pio_mod , only : shr_pio_getiotype - use shr_nl_mod , only : shr_nl_find_group_name - use shr_log_mod , only : errMsg => shr_log_errMsg - use shr_mpi_mod , only : shr_mpi_bcast - use fileutils , only : getavu, relavu - use ch4varcon , only : finundation_mtd_ZWT_inversion, finundation_mtd_TWS_inversion - ! - ! arguments - implicit none - class(streamcontrol_type) :: this - type(bounds_type), intent(in) :: bounds - character(len=*), intent(in) :: NLFilename ! Namelist filename - ! - ! local variables - integer :: nu_nml ! unit for namelist file - integer :: nml_error ! namelist i/o error flag - character(len=CL) :: stream_fldFileName_ch4finundated = ' ' - character(len=CL) :: ch4finundatedmapalgo = 'bilinear' - character(len=*), parameter :: namelist_name = 'ch4finundated' ! MUST agree with name in namelist and read - character(len=*), parameter :: shr_strdata_unset = 'NOT_SET' - character(len=*), parameter :: subName = "('ch4finundated::ReadNML')" - character(len=*), parameter :: F00 = "('(ch4finundated_readnml) ',4a)" - !----------------------------------------------------------------------- - - namelist /ch4finundated/ & ! MUST agree with namelist_name above - ch4finundatedmapalgo, stream_fldFileName_ch4finundated - - ! Default values for namelist - - ! Read ch4finundated namelist - if (masterproc) then - nu_nml = getavu() - open( nu_nml, file=trim(NLFilename), status='old', iostat=nml_error ) - call shr_nl_find_group_name(nu_nml, namelist_name, status=nml_error) - if (nml_error == 0) then - read(nu_nml, nml=ch4finundated,iostat=nml_error) ! MUST agree with namelist_name above - if (nml_error /= 0) then - call endrun(msg=' ERROR reading '//namelist_name//' namelist'//errMsg(sourcefile, __LINE__)) - end if - else - call endrun(msg=' ERROR finding '//namelist_name//' namelist'//errMsg(sourcefile, __LINE__)) - end if - close(nu_nml) - call relavu( nu_nml ) - endif - - call shr_mpi_bcast(stream_fldFileName_ch4finundated, mpicom) - call shr_mpi_bcast(ch4finundatedmapalgo , mpicom) - - if (masterproc) then - write(iulog,*) ' ' - write(iulog,*) namelist_name, ' stream settings:' - write(iulog,*) ' stream_fldFileName_ch4finundated = ',stream_fldFileName_ch4finundated - write(iulog,*) ' ch4finundatedmapalgo = ',ch4finundatedmapalgo - write(iulog,*) ' ' - endif - this%stream_fldFileName_ch4finundated = stream_fldFileName_ch4finundated - this%ch4finundatedmapalgo = ch4finundatedmapalgo - if ( finundation_mtd == finundation_mtd_ZWT_inversion )then - this%fldList = "ZWT0:F0:P3" - else if ( finundation_mtd == finundation_mtd_TWS_inversion )then - this%fldList = "FWS_TWS_A:FWS_TWS_B" - else - call endrun(msg=' ERROR do NOT know what list of variables to read for this finundation_mtd type'// & - errMsg(sourcefile, __LINE__)) - end if - - end subroutine ReadNML - -end module ch4FInundatedStreamType diff --git a/src/cpl/mct/clm_cpl_indices.F90 b/src/cpl/mct/clm_cpl_indices.F90 deleted file mode 100644 index 09ed89e92d..0000000000 --- a/src/cpl/mct/clm_cpl_indices.F90 +++ /dev/null @@ -1,330 +0,0 @@ -module clm_cpl_indices - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! Module containing the indices for the fields passed between CLM and - ! the driver. Includes the River Transport Model fields (RTM) and the - ! fields needed by the land-ice component (sno). - ! - ! !USES: - - use shr_sys_mod, only : shr_sys_abort - implicit none - - SAVE - private ! By default make data private - ! - ! !PUBLIC MEMBER FUNCTIONS: - public :: clm_cpl_indices_set ! Set the coupler indices - ! - ! !PUBLIC DATA MEMBERS: - ! - integer , public :: glc_nec ! number of elevation classes for glacier_mec landunits - ! (from coupler) - must equal maxpatch_glc from namelist - - ! lnd -> drv (required) - - integer, public ::index_l2x_Flrl_rofsur ! lnd->rtm input liquid surface fluxes - integer, public ::index_l2x_Flrl_rofgwl ! lnd->rtm input liquid gwl fluxes - integer, public ::index_l2x_Flrl_rofsub ! lnd->rtm input liquid subsurface fluxes - integer, public ::index_l2x_Flrl_rofi ! lnd->rtm input frozen fluxes - integer, public ::index_l2x_Flrl_irrig ! irrigation withdrawal - - integer, public ::index_l2x_Sl_t ! temperature - integer, public ::index_l2x_Sl_tref ! 2m reference temperature - integer, public ::index_l2x_Sl_qref ! 2m reference specific humidity - integer, public ::index_l2x_Sl_avsdr ! albedo: direct , visible - integer, public ::index_l2x_Sl_anidr ! albedo: direct , near-ir - integer, public ::index_l2x_Sl_avsdf ! albedo: diffuse, visible - integer, public ::index_l2x_Sl_anidf ! albedo: diffuse, near-ir - integer, public ::index_l2x_Sl_snowh ! snow height - integer, public ::index_l2x_Sl_u10 ! 10m wind - integer, public ::index_l2x_Sl_ddvel ! dry deposition velocities (optional) - integer, public ::index_l2x_Sl_fv ! friction velocity - integer, public ::index_l2x_Sl_ram1 ! aerodynamical resistance - integer, public ::index_l2x_Sl_soilw ! volumetric soil water - integer, public ::index_l2x_Fall_taux ! wind stress, zonal - integer, public ::index_l2x_Fall_tauy ! wind stress, meridional - integer, public ::index_l2x_Fall_lat ! latent heat flux - integer, public ::index_l2x_Fall_sen ! sensible heat flux - integer, public ::index_l2x_Fall_lwup ! upward longwave heat flux - integer, public ::index_l2x_Fall_evap ! evaporation water flux - integer, public ::index_l2x_Fall_swnet ! heat flux shortwave net - integer, public ::index_l2x_Fall_fco2_lnd ! co2 flux **For testing set to 0 - integer, public ::index_l2x_Fall_flxdst1 ! dust flux size bin 1 - integer, public ::index_l2x_Fall_flxdst2 ! dust flux size bin 2 - integer, public ::index_l2x_Fall_flxdst3 ! dust flux size bin 3 - integer, public ::index_l2x_Fall_flxdst4 ! dust flux size bin 4 - integer, public ::index_l2x_Fall_flxvoc ! MEGAN fluxes - integer, public ::index_l2x_Fall_flxfire ! Fire fluxes - integer, public ::index_l2x_Sl_ztopfire ! Top of fire emissions (m) - - ! In the following, index 0 is bare land, other indices are glc elevation classes - integer, allocatable, public ::index_l2x_Sl_tsrf(:) ! glc MEC temperature - integer, allocatable, public ::index_l2x_Sl_topo(:) ! glc MEC topo height - integer, allocatable, public ::index_l2x_Flgl_qice(:) ! glc MEC ice flux - - integer, public ::index_x2l_Sa_methane - integer, public ::index_l2x_Fall_methane - - integer, public :: nflds_l2x = 0 - - ! drv -> lnd (required) - - integer, public ::index_x2l_Sa_z ! bottom atm level height - integer, public ::index_x2l_Sa_topo ! atm surface height (m) - integer, public ::index_x2l_Sa_u ! bottom atm level zon wind - integer, public ::index_x2l_Sa_v ! bottom atm level mer wind - integer, public ::index_x2l_Sa_ptem ! bottom atm level pot temp - integer, public ::index_x2l_Sa_shum ! bottom atm level spec hum - integer, public ::index_x2l_Sa_pbot ! bottom atm level pressure - integer, public ::index_x2l_Sa_tbot ! bottom atm level temp - integer, public ::index_x2l_Faxa_lwdn ! downward lw heat flux - integer, public ::index_x2l_Faxa_rainc ! prec: liquid "convective" - integer, public ::index_x2l_Faxa_rainl ! prec: liquid "large scale" - integer, public ::index_x2l_Faxa_snowc ! prec: frozen "convective" - integer, public ::index_x2l_Faxa_snowl ! prec: frozen "large scale" - integer, public ::index_x2l_Faxa_swndr ! sw: nir direct downward - integer, public ::index_x2l_Faxa_swvdr ! sw: vis direct downward - integer, public ::index_x2l_Faxa_swndf ! sw: nir diffuse downward - integer, public ::index_x2l_Faxa_swvdf ! sw: vis diffuse downward - integer, public ::index_x2l_Sa_co2prog ! bottom atm level prognostic co2 - integer, public ::index_x2l_Sa_co2diag ! bottom atm level diagnostic co2 - integer, public ::index_x2l_Faxa_bcphidry ! flux: Black Carbon hydrophilic dry deposition - integer, public ::index_x2l_Faxa_bcphodry ! flux: Black Carbon hydrophobic dry deposition - integer, public ::index_x2l_Faxa_bcphiwet ! flux: Black Carbon hydrophilic wet deposition - integer, public ::index_x2l_Faxa_ocphidry ! flux: Organic Carbon hydrophilic dry deposition - integer, public ::index_x2l_Faxa_ocphodry ! flux: Organic Carbon hydrophobic dry deposition - integer, public ::index_x2l_Faxa_ocphiwet ! flux: Organic Carbon hydrophilic dry deposition - integer, public ::index_x2l_Faxa_dstwet1 ! flux: Size 1 dust -- wet deposition - integer, public ::index_x2l_Faxa_dstwet2 ! flux: Size 2 dust -- wet deposition - integer, public ::index_x2l_Faxa_dstwet3 ! flux: Size 3 dust -- wet deposition - integer, public ::index_x2l_Faxa_dstwet4 ! flux: Size 4 dust -- wet deposition - integer, public ::index_x2l_Faxa_dstdry1 ! flux: Size 1 dust -- dry deposition - integer, public ::index_x2l_Faxa_dstdry2 ! flux: Size 2 dust -- dry deposition - integer, public ::index_x2l_Faxa_dstdry3 ! flux: Size 3 dust -- dry deposition - integer, public ::index_x2l_Faxa_dstdry4 ! flux: Size 4 dust -- dry deposition - - integer, public ::index_x2l_Faxa_nhx ! flux nhx from atm - integer, public ::index_x2l_Faxa_noy ! flux noy from atm - - integer, public ::index_x2l_Flrr_flood ! rtm->lnd rof flood flux - integer, public ::index_x2l_Flrr_volr ! rtm->lnd rof volr total volume - integer, public ::index_x2l_Flrr_volrmch ! rtm->lnd rof volr main channel volume - - ! In the following, index 0 is bare land, other indices are glc elevation classes - integer, allocatable, public ::index_x2l_Sg_ice_covered(:) ! Fraction of glacier from glc model - integer, allocatable, public ::index_x2l_Sg_topo(:) ! Topo height from glc model - integer, allocatable, public ::index_x2l_Flgg_hflx(:) ! Heat flux from glc model - - integer, public ::index_x2l_Sg_icemask - integer, public ::index_x2l_Sg_icemask_coupled_fluxes - - integer, public :: nflds_x2l = 0 - - !----------------------------------------------------------------------- - -contains - - !----------------------------------------------------------------------- - subroutine clm_cpl_indices_set( ) - ! - ! !DESCRIPTION: - ! Set the coupler indices needed by the land model coupler - ! interface. - ! - ! !USES: - use seq_flds_mod , only: seq_flds_x2l_fields, seq_flds_l2x_fields - use mct_mod , only: mct_aVect, mct_aVect_init, mct_avect_indexra - use mct_mod , only: mct_aVect_clean, mct_avect_nRattr - use shr_drydep_mod , only: drydep_fields_token, n_drydep - use shr_megan_mod , only: shr_megan_fields_token, shr_megan_mechcomps_n - use shr_fire_emis_mod,only: shr_fire_emis_fields_token, shr_fire_emis_ztop_token, shr_fire_emis_mechcomps_n - use clm_varctl , only: ndep_from_cpl - use glc_elevclass_mod, only: glc_get_num_elevation_classes, glc_elevclass_as_string - ! - ! !ARGUMENTS: - implicit none - ! - ! !REVISION HISTORY: - ! Author: Mariana Vertenstein - ! 01/2011, Erik Kluzek: Added protex headers - ! - ! !LOCAL VARIABLES: - type(mct_aVect) :: l2x ! temporary, land to coupler - type(mct_aVect) :: x2l ! temporary, coupler to land - integer :: num - character(len=:), allocatable :: nec_str ! string version of glc elev. class number - character(len=64) :: name - character(len=32) :: subname = 'clm_cpl_indices_set' ! subroutine name - !----------------------------------------------------------------------- - - ! Determine attribute vector indices - - ! create temporary attribute vectors - call mct_aVect_init(x2l, rList=seq_flds_x2l_fields, lsize=1) - nflds_x2l = mct_avect_nRattr(x2l) - - call mct_aVect_init(l2x, rList=seq_flds_l2x_fields, lsize=1) - nflds_l2x = mct_avect_nRattr(l2x) - - !------------------------------------------------------------- - ! clm -> drv - !------------------------------------------------------------- - - index_l2x_Flrl_rofsur = mct_avect_indexra(l2x,'Flrl_rofsur') - index_l2x_Flrl_rofgwl = mct_avect_indexra(l2x,'Flrl_rofgwl') - index_l2x_Flrl_rofsub = mct_avect_indexra(l2x,'Flrl_rofsub') - index_l2x_Flrl_rofi = mct_avect_indexra(l2x,'Flrl_rofi') - index_l2x_Flrl_irrig = mct_avect_indexra(l2x,'Flrl_irrig') - - index_l2x_Sl_t = mct_avect_indexra(l2x,'Sl_t') - index_l2x_Sl_snowh = mct_avect_indexra(l2x,'Sl_snowh') - index_l2x_Sl_avsdr = mct_avect_indexra(l2x,'Sl_avsdr') - index_l2x_Sl_anidr = mct_avect_indexra(l2x,'Sl_anidr') - index_l2x_Sl_avsdf = mct_avect_indexra(l2x,'Sl_avsdf') - index_l2x_Sl_anidf = mct_avect_indexra(l2x,'Sl_anidf') - index_l2x_Sl_tref = mct_avect_indexra(l2x,'Sl_tref') - index_l2x_Sl_qref = mct_avect_indexra(l2x,'Sl_qref') - index_l2x_Sl_u10 = mct_avect_indexra(l2x,'Sl_u10') - index_l2x_Sl_ram1 = mct_avect_indexra(l2x,'Sl_ram1') - index_l2x_Sl_fv = mct_avect_indexra(l2x,'Sl_fv') - index_l2x_Sl_soilw = mct_avect_indexra(l2x,'Sl_soilw',perrwith='quiet') - - if ( n_drydep>0 )then - index_l2x_Sl_ddvel = mct_avect_indexra(l2x, trim(drydep_fields_token)) - else - index_l2x_Sl_ddvel = 0 - end if - - index_l2x_Fall_taux = mct_avect_indexra(l2x,'Fall_taux') - index_l2x_Fall_tauy = mct_avect_indexra(l2x,'Fall_tauy') - index_l2x_Fall_lat = mct_avect_indexra(l2x,'Fall_lat') - index_l2x_Fall_sen = mct_avect_indexra(l2x,'Fall_sen') - index_l2x_Fall_lwup = mct_avect_indexra(l2x,'Fall_lwup') - index_l2x_Fall_evap = mct_avect_indexra(l2x,'Fall_evap') - index_l2x_Fall_swnet = mct_avect_indexra(l2x,'Fall_swnet') - index_l2x_Fall_flxdst1 = mct_avect_indexra(l2x,'Fall_flxdst1') - index_l2x_Fall_flxdst2 = mct_avect_indexra(l2x,'Fall_flxdst2') - index_l2x_Fall_flxdst3 = mct_avect_indexra(l2x,'Fall_flxdst3') - index_l2x_Fall_flxdst4 = mct_avect_indexra(l2x,'Fall_flxdst4') - - index_l2x_Fall_fco2_lnd = mct_avect_indexra(l2x,'Fall_fco2_lnd',perrwith='quiet') - - index_l2x_Fall_methane = mct_avect_indexra(l2x,'Fall_methane',perrWith='quiet') - - ! MEGAN fluxes - if (shr_megan_mechcomps_n>0) then - index_l2x_Fall_flxvoc = mct_avect_indexra(l2x,trim(shr_megan_fields_token)) - else - index_l2x_Fall_flxvoc = 0 - endif - - ! Fire fluxes - if (shr_fire_emis_mechcomps_n>0) then - index_l2x_Fall_flxfire = mct_avect_indexra(l2x,trim(shr_fire_emis_fields_token)) - index_l2x_Sl_ztopfire = mct_avect_indexra(l2x,trim(shr_fire_emis_ztop_token)) - else - index_l2x_Fall_flxfire = 0 - index_l2x_Sl_ztopfire = 0 - endif - - !------------------------------------------------------------- - ! drv -> clm - !------------------------------------------------------------- - - index_x2l_Sa_z = mct_avect_indexra(x2l,'Sa_z') - index_x2l_Sa_topo = mct_avect_indexra(x2l,'Sa_topo') - index_x2l_Sa_u = mct_avect_indexra(x2l,'Sa_u') - index_x2l_Sa_v = mct_avect_indexra(x2l,'Sa_v') - index_x2l_Sa_ptem = mct_avect_indexra(x2l,'Sa_ptem') - index_x2l_Sa_pbot = mct_avect_indexra(x2l,'Sa_pbot') - index_x2l_Sa_tbot = mct_avect_indexra(x2l,'Sa_tbot') - index_x2l_Sa_shum = mct_avect_indexra(x2l,'Sa_shum') - index_x2l_Sa_co2prog = mct_avect_indexra(x2l,'Sa_co2prog',perrwith='quiet') - index_x2l_Sa_co2diag = mct_avect_indexra(x2l,'Sa_co2diag',perrwith='quiet') - - index_x2l_Sa_methane = mct_avect_indexra(x2l,'Sa_methane',perrWith='quiet') - - index_x2l_Flrr_volr = mct_avect_indexra(x2l,'Flrr_volr') - index_x2l_Flrr_volrmch = mct_avect_indexra(x2l,'Flrr_volrmch') - - index_x2l_Faxa_lwdn = mct_avect_indexra(x2l,'Faxa_lwdn') - index_x2l_Faxa_rainc = mct_avect_indexra(x2l,'Faxa_rainc') - index_x2l_Faxa_rainl = mct_avect_indexra(x2l,'Faxa_rainl') - index_x2l_Faxa_snowc = mct_avect_indexra(x2l,'Faxa_snowc') - index_x2l_Faxa_snowl = mct_avect_indexra(x2l,'Faxa_snowl') - index_x2l_Faxa_swndr = mct_avect_indexra(x2l,'Faxa_swndr') - index_x2l_Faxa_swvdr = mct_avect_indexra(x2l,'Faxa_swvdr') - index_x2l_Faxa_swndf = mct_avect_indexra(x2l,'Faxa_swndf') - index_x2l_Faxa_swvdf = mct_avect_indexra(x2l,'Faxa_swvdf') - index_x2l_Faxa_bcphidry = mct_avect_indexra(x2l,'Faxa_bcphidry') - index_x2l_Faxa_bcphodry = mct_avect_indexra(x2l,'Faxa_bcphodry') - index_x2l_Faxa_bcphiwet = mct_avect_indexra(x2l,'Faxa_bcphiwet') - index_x2l_Faxa_ocphidry = mct_avect_indexra(x2l,'Faxa_ocphidry') - index_x2l_Faxa_ocphodry = mct_avect_indexra(x2l,'Faxa_ocphodry') - index_x2l_Faxa_ocphiwet = mct_avect_indexra(x2l,'Faxa_ocphiwet') - index_x2l_Faxa_dstdry1 = mct_avect_indexra(x2l,'Faxa_dstdry1') - index_x2l_Faxa_dstdry2 = mct_avect_indexra(x2l,'Faxa_dstdry2') - index_x2l_Faxa_dstdry3 = mct_avect_indexra(x2l,'Faxa_dstdry3') - index_x2l_Faxa_dstdry4 = mct_avect_indexra(x2l,'Faxa_dstdry4') - index_x2l_Faxa_dstwet1 = mct_avect_indexra(x2l,'Faxa_dstwet1') - index_x2l_Faxa_dstwet2 = mct_avect_indexra(x2l,'Faxa_dstwet2') - index_x2l_Faxa_dstwet3 = mct_avect_indexra(x2l,'Faxa_dstwet3') - index_x2l_Faxa_dstwet4 = mct_avect_indexra(x2l,'Faxa_dstwet4') - - index_x2l_Faxa_nhx = mct_avect_indexra(x2l,'Faxa_nhx', perrWith='quiet') - index_x2l_Faxa_noy = mct_avect_indexra(x2l,'Faxa_noy', perrWith='quiet') - - if (index_x2l_Faxa_nhx > 0 .and. index_x2l_Faxa_noy > 0) then - ndep_from_cpl = .true. - end if - - index_x2l_Flrr_flood = mct_avect_indexra(x2l,'Flrr_flood') - - !------------------------------------------------------------- - ! glc coupling - !------------------------------------------------------------- - - index_x2l_Sg_icemask = mct_avect_indexra(x2l,'Sg_icemask') - index_x2l_Sg_icemask_coupled_fluxes = mct_avect_indexra(x2l,'Sg_icemask_coupled_fluxes') - - glc_nec = glc_get_num_elevation_classes() - if (glc_nec < 1) then - call shr_sys_abort('ERROR: In CLM4.5 and later, glc_nec must be at least 1.') - end if - - ! Create coupling fields for all glc elevation classes (1:glc_nec) plus bare land - ! (index 0). - allocate(index_l2x_Sl_tsrf(0:glc_nec)) - allocate(index_l2x_Sl_topo(0:glc_nec)) - allocate(index_l2x_Flgl_qice(0:glc_nec)) - allocate(index_x2l_Sg_ice_covered(0:glc_nec)) - allocate(index_x2l_Sg_topo(0:glc_nec)) - allocate(index_x2l_Flgg_hflx(0:glc_nec)) - - do num = 0,glc_nec - nec_str = glc_elevclass_as_string(num) - - name = 'Sg_ice_covered' // nec_str - index_x2l_Sg_ice_covered(num) = mct_avect_indexra(x2l,trim(name)) - name = 'Sg_topo' // nec_str - index_x2l_Sg_topo(num) = mct_avect_indexra(x2l,trim(name)) - name = 'Flgg_hflx' // nec_str - index_x2l_Flgg_hflx(num) = mct_avect_indexra(x2l,trim(name)) - - name = 'Sl_tsrf' // nec_str - index_l2x_Sl_tsrf(num) = mct_avect_indexra(l2x,trim(name)) - name = 'Sl_topo' // nec_str - index_l2x_Sl_topo(num) = mct_avect_indexra(l2x,trim(name)) - name = 'Flgl_qice' // nec_str - index_l2x_Flgl_qice(num) = mct_avect_indexra(l2x,trim(name)) - end do - - call mct_aVect_clean(x2l) - call mct_aVect_clean(l2x) - - end subroutine clm_cpl_indices_set - -!======================================================================= - -end module clm_cpl_indices diff --git a/src/cpl/mct/laiStreamMod.F90 b/src/cpl/mct/laiStreamMod.F90 deleted file mode 100644 index 47d25287b7..0000000000 --- a/src/cpl/mct/laiStreamMod.F90 +++ /dev/null @@ -1,241 +0,0 @@ -module laiStreamMod - -#include "shr_assert.h" - - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! Read LAI from stream - ! - ! !USES: - use shr_strdata_mod , only : shr_strdata_type, shr_strdata_create - use shr_strdata_mod , only : shr_strdata_print, shr_strdata_advance - use shr_kind_mod , only : r8=>shr_kind_r8, CL=>shr_kind_CL, CS=>shr_kind_CS, CXX=>shr_kind_CXX - use shr_log_mod , only : errMsg => shr_log_errMsg - use decompMod , only : bounds_type - use abortutils , only : endrun - use clm_varctl , only : iulog, inst_name - use perf_mod , only : t_startf, t_stopf - use spmdMod , only : masterproc, mpicom, comp_id - use ncdio_pio - use mct_mod - ! - ! !PUBLIC TYPES: - implicit none - private - - ! !PUBLIC MEMBER FUNCTIONS: - public :: lai_init ! position datasets for LAI - public :: lai_advance ! Advance the LAI streams (outside of a Open-MP threading loop) - public :: lai_interp ! interpolates between two years of LAI data (when LAI streams - - ! !PRIVATE MEMBER DATA: - integer, allocatable :: g_to_ig(:) ! Array matching gridcell index to data index - type(shr_strdata_type) :: sdat_lai ! LAI input data stream - - character(len=*), parameter :: sourcefile = & - __FILE__ - -!============================================================================== -contains -!============================================================================== - - subroutine lai_init(bounds) - ! - ! Initialize data stream information for LAI. - ! - ! !USES: - use clm_time_manager , only : get_calendar - use ncdio_pio , only : pio_subsystem - use shr_pio_mod , only : shr_pio_getiotype - use shr_stream_mod , only : shr_stream_file_null - use shr_string_mod , only : shr_string_listCreateField - use clm_nlUtilsMod , only : find_nlgroup_name - use ndepStreamMod , only : clm_domain_mct - use histFileMod , only : hist_addfld1d - use domainMod , only : ldomain - use controlMod , only : NLFilename - use lnd_set_decomp_and_domain , only : gsmap_global - ! - ! !ARGUMENTS: - implicit none - type(bounds_type), intent(in) :: bounds ! bounds - ! - ! !LOCAL VARIABLES: - integer :: stream_year_first_lai ! first year in Lai stream to use - integer :: stream_year_last_lai ! last year in Lai stream to use - integer :: model_year_align_lai ! align stream_year_first_lai with - integer :: nu_nml ! unit for namelist file - integer :: nml_error ! namelist i/o error flag - type(mct_ggrid) :: dom_clm ! domain information - character(len=CL) :: stream_fldFileName_lai ! lai stream filename to read - character(len=CL) :: lai_mapalgo = 'bilinear' ! Mapping alogrithm - character(len=CL) :: lai_tintalgo = 'linear' ! Time interpolation alogrithm - character(len=CXX) :: fldList ! field string - character(*), parameter :: laiString = "LAI" ! base string for field string - integer , parameter :: numLaiFields = 16 ! number of fields to build field string - character(*), parameter :: subName = "('laidyn_init')" - !----------------------------------------------------------------------- - ! - ! deal with namelist variables here in init - ! - namelist /lai_streams/ & - stream_year_first_lai, & - stream_year_last_lai, & - model_year_align_lai, & - lai_mapalgo, & - stream_fldFileName_lai, & - lai_tintalgo - - ! Default values for namelist - stream_year_first_lai = 1 ! first year in stream to use - stream_year_last_lai = 1 ! last year in stream to use - model_year_align_lai = 1 ! align stream_year_first_lai with this model year - stream_fldFileName_lai = shr_stream_file_null - - ! Read lai_streams namelist - if (masterproc) then - open( newunit=nu_nml, file=trim(NLFilename), status='old', iostat=nml_error ) - call find_nlgroup_name(nu_nml, 'lai_streams', status=nml_error) - if (nml_error == 0) then - read(nu_nml, nml=lai_streams,iostat=nml_error) - if (nml_error /= 0) then - call endrun(subname // ':: ERROR reading lai_streams namelist') - end if - else - call endrun(subname // ':: ERROR finding lai_streams namelist') - end if - close(nu_nml) - endif - call shr_mpi_bcast(stream_year_first_lai , mpicom) - call shr_mpi_bcast(stream_year_last_lai , mpicom) - call shr_mpi_bcast(model_year_align_lai , mpicom) - call shr_mpi_bcast(stream_fldFileName_lai , mpicom) - call shr_mpi_bcast(lai_tintalgo , mpicom) - - if (masterproc) then - write(iulog,*) ' ' - write(iulog,*) 'lai_stream settings:' - write(iulog,*) ' stream_year_first_lai = ',stream_year_first_lai - write(iulog,*) ' stream_year_last_lai = ',stream_year_last_lai - write(iulog,*) ' model_year_align_lai = ',model_year_align_lai - write(iulog,*) ' stream_fldFileName_lai = ',trim(stream_fldFileName_lai) - write(iulog,*) ' lai_tintalgo = ',trim(lai_tintalgo) - endif - - call clm_domain_mct (bounds, dom_clm) - - ! create the field list for these lai fields...use in shr_strdata_create - fldList = shr_string_listCreateField( numLaiFields, laiString ) - - call shr_strdata_create(sdat_lai,name="laidyn", & - pio_subsystem=pio_subsystem, & - pio_iotype=shr_pio_getiotype(inst_name), & - mpicom=mpicom, compid=comp_id, & - gsmap=gsmap_global, ggrid=dom_clm, & - nxg=ldomain%ni, nyg=ldomain%nj, & - yearFirst=stream_year_first_lai, & - yearLast=stream_year_last_lai, & - yearAlign=model_year_align_lai, & - offset=0, & - domFilePath='', & - domFileName=trim(stream_fldFileName_lai), & - domTvarName='time', & - domXvarName='lon' , & - domYvarName='lat' , & - domAreaName='area', & - domMaskName='mask', & - filePath='', & - filename=(/stream_fldFileName_lai/), & - fldListFile=fldList, & - fldListModel=fldList, & - fillalgo='none', & - mapalgo=lai_mapalgo, & - tintalgo=lai_tintalgo, & - calendar=get_calendar(), & - taxmode='cycle' ) - - if (masterproc) then - call shr_strdata_print(sdat_lai,'LAI data') - endif - - end subroutine lai_init - - !============================================================================== - subroutine lai_advance( bounds ) - ! - ! Advance LAI streams - ! - ! !USES: - use clm_time_manager, only : get_curr_date - ! - ! !ARGUMENTS: - implicit none - type(bounds_type) , intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - integer :: g, ig ! Indices - 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) - !----------------------------------------------------------------------- - - call get_curr_date(year, mon, day, sec) - mcdate = year*10000 + mon*100 + day - - call shr_strdata_advance(sdat_lai, mcdate, sec, mpicom, 'laidyn') - if ( .not. allocated(g_to_ig) )then - allocate (g_to_ig(bounds%begg:bounds%endg) ) - ig = 0 - do g = bounds%begg,bounds%endg - ig = ig+1 - g_to_ig(g) = ig - end do - end if - - end subroutine lai_advance - - !============================================================================== - subroutine lai_interp(bounds, canopystate_inst) - ! - ! Interpolate data stream information for Lai. - ! - ! !USES: - use pftconMod , only : noveg - use CanopyStateType , only : canopystate_type - use PatchType , only : patch - ! - ! !ARGUMENTS: - implicit none - type(bounds_type) , intent(in) :: bounds - type(canopystate_type) , intent(inout) :: canopystate_inst - ! - ! !LOCAL VARIABLES: - integer :: ivt, p, ip, ig - character(len=CL) :: stream_var_name - !----------------------------------------------------------------------- - SHR_ASSERT_FL( (lbound(g_to_ig,1) <= bounds%begg ), sourcefile, __LINE__) - SHR_ASSERT_FL( (ubound(g_to_ig,1) >= bounds%endg ), sourcefile, __LINE__) - SHR_ASSERT_FL( (lbound(sdat_lai%avs(1)%rAttr,2) <= g_to_ig(bounds%begg) ), sourcefile, __LINE__) - SHR_ASSERT_FL( (ubound(sdat_lai%avs(1)%rAttr,2) >= g_to_ig(bounds%endg) ), sourcefile, __LINE__) - - do p = bounds%begp, bounds%endp - ivt = patch%itype(p) - ! Set lai for each gridcell/patch combination - if (ivt /= noveg) then - ! vegetated pft - write(stream_var_name,"(i6)") ivt - stream_var_name = 'LAI_'//trim(adjustl(stream_var_name)) - ip = mct_aVect_indexRA(sdat_lai%avs(1),trim(stream_var_name)) - ig = g_to_ig(patch%gridcell(p)) - canopystate_inst%tlai_patch(p) = sdat_lai%avs(1)%rAttr(ip,ig) - else - ! non-vegetated pft - canopystate_inst%tlai_patch(p) = 0._r8 - endif - end do - - end subroutine lai_interp - -end module LaiStreamMod diff --git a/src/cpl/mct/lnd_comp_mct.F90 b/src/cpl/mct/lnd_comp_mct.F90 deleted file mode 100644 index e50602a378..0000000000 --- a/src/cpl/mct/lnd_comp_mct.F90 +++ /dev/null @@ -1,632 +0,0 @@ -module lnd_comp_mct - - !--------------------------------------------------------------------------- - ! !DESCRIPTION: - ! Interface of the active land model component of CESM the CLM (Community Land Model) - ! with the main CESM driver. This is a thin interface taking CESM driver information - ! in MCT (Model Coupling Toolkit) format and converting it to use by CLM. - ! - ! !uses: - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_sys_mod , only : shr_sys_flush - use shr_log_mod , only : errMsg => shr_log_errMsg - use mct_mod , only : mct_avect, mct_gsmap, mct_gGrid - use decompmod , only : bounds_type - use lnd_import_export, only : lnd_import, lnd_export - ! - ! !public member functions: - implicit none - private ! by default make data private - ! - ! !public member functions: - public :: lnd_init_mct ! clm initialization - public :: lnd_run_mct ! clm run phase - public :: lnd_final_mct ! clm finalization/cleanup - ! - ! !private member functions: - private :: lnd_domain_mct ! set the land model domain information - private :: lnd_handle_resume ! handle pause/resume signals from the coupler - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - -!==================================================================================== -contains -!==================================================================================== - - subroutine lnd_init_mct( EClock, cdata_l, x2l_l, l2x_l, NLFilename ) - ! - ! !DESCRIPTION: - ! Initialize land surface model and obtain relevant atmospheric model arrays - ! back from (i.e. albedos, surface temperature and snow cover over land). - ! - ! !USES: - use shr_kind_mod , only : shr_kind_cl - use abortutils , only : endrun - use clm_time_manager , only : get_nstep, set_timemgr_init - use clm_initializeMod, only : initialize1, initialize2 - use clm_instMod , only : water_inst, lnd2atm_inst, lnd2glc_inst - use clm_varctl , only : finidat, single_column, clm_varctl_set, iulog - use clm_varctl , only : inst_index, inst_suffix, inst_name - use clm_varorb , only : eccen, obliqr, lambm0, mvelpp - use controlMod , only : control_setNL - use decompMod , only : get_proc_bounds - use domainMod , only : ldomain - use shr_file_mod , only : shr_file_setLogUnit, shr_file_setLogLevel - use shr_file_mod , only : shr_file_getLogUnit, shr_file_getLogLevel - use shr_file_mod , only : shr_file_getUnit, shr_file_setIO - use seq_cdata_mod , only : seq_cdata, seq_cdata_setptrs - use seq_timemgr_mod , only : seq_timemgr_EClockGetData - use seq_infodata_mod , only : seq_infodata_type, seq_infodata_GetData, seq_infodata_PutData, & - seq_infodata_start_type_start, seq_infodata_start_type_cont, & - seq_infodata_start_type_brnch - use seq_comm_mct , only : seq_comm_suffix, seq_comm_inst, seq_comm_name - use seq_flds_mod , only : seq_flds_x2l_fields, seq_flds_l2x_fields - use spmdMod , only : masterproc, spmd_init - use clm_varctl , only : nsrStartup, nsrContinue, nsrBranch - use clm_cpl_indices , only : clm_cpl_indices_set - use mct_mod , only : mct_aVect_init, mct_aVect_zero, mct_gsMap, mct_gsMap_init - use decompMod , only : gindex_global - use lnd_set_decomp_and_domain, only : lnd_set_decomp_and_domain_from_surfrd, gsmap_global - use ESMF - ! - ! !ARGUMENTS: - type(ESMF_Clock), intent(inout) :: EClock ! Input synchronization clock - type(seq_cdata), intent(inout) :: cdata_l ! Input land-model driver data - type(mct_aVect), intent(inout) :: x2l_l, l2x_l ! land model import and export states - character(len=*), optional, intent(in) :: NLFilename ! Namelist filename to read - ! - ! !LOCAL VARIABLES: - integer :: LNDID ! Land identifyer - integer :: mpicom_lnd ! MPI communicator - type(mct_gsMap), pointer :: GSMap_lnd ! Land model MCT GS map - type(mct_gGrid), pointer :: dom_l ! Land model domain - type(seq_infodata_type), pointer :: infodata ! CESM driver level info data - integer :: lsize ! size of attribute vector - integer :: gsize ! global size - integer :: g,i,j ! indices - integer :: dtime_sync ! coupling time-step from the input synchronization clock - logical :: exists ! true if file exists - logical :: atm_aero ! Flag if aerosol data sent from atm model - real(r8) :: scmlat ! single-column latitude - real(r8) :: scmlon ! single-column longitude - character(len=SHR_KIND_CL) :: caseid ! case identifier name - character(len=SHR_KIND_CL) :: ctitle ! case description title - character(len=SHR_KIND_CL) :: starttype ! start-type (startup, continue, branch, hybrid) - character(len=SHR_KIND_CL) :: calendar ! calendar type name - character(len=SHR_KIND_CL) :: hostname ! hostname of machine running on - character(len=SHR_KIND_CL) :: version ! Model version - character(len=SHR_KIND_CL) :: username ! user running the model - integer :: nsrest ! clm restart type - integer :: ref_ymd ! reference date (YYYYMMDD) - integer :: ref_tod ! reference time of day (sec) - integer :: start_ymd ! start date (YYYYMMDD) - integer :: start_tod ! start time of day (sec) - logical :: brnch_retain_casename ! flag if should retain the case name on a branch start type - integer :: lbnum ! input to memory diagnostic - integer :: shrlogunit,shrloglev ! old values for log unit and log level - type(bounds_type) :: bounds ! bounds - logical :: noland - integer :: ni,nj - real(r8) , parameter :: rundef = -9999999._r8 - character(len=32), parameter :: sub = 'lnd_init_mct' - character(len=*), parameter :: format = "('("//trim(sub)//") :',A)" - !----------------------------------------------------------------------- - - ! Set cdata data - call seq_cdata_setptrs(cdata_l, ID=LNDID, mpicom=mpicom_lnd, & - gsMap=GSMap_lnd, dom=dom_l, infodata=infodata) - - ! Determine attriute vector indices - call clm_cpl_indices_set() - - ! Initialize clm MPI communicator - call spmd_init( mpicom_lnd, LNDID ) - -#if (defined _MEMTRACE) - if(masterproc) then - lbnum=1 - call memmon_dump_fort('memmon.out','lnd_init_mct:start::',lbnum) - endif -#endif - - inst_name = seq_comm_name(LNDID) - inst_index = seq_comm_inst(LNDID) - inst_suffix = seq_comm_suffix(LNDID) - ! Initialize io log unit - - call shr_file_getLogUnit (shrlogunit) - if (masterproc) then - inquire(file='lnd_modelio.nml'//trim(inst_suffix),exist=exists) - if (exists) then - iulog = shr_file_getUnit() - call shr_file_setIO('lnd_modelio.nml'//trim(inst_suffix),iulog) - end if - write(iulog,format) "CLM land model initialization" - else - iulog = shrlogunit - end if - - call shr_file_getLogLevel(shrloglev) - call shr_file_setLogUnit (iulog) - - ! Use infodata to set orbital values - call seq_infodata_GetData( infodata, orb_eccen=eccen, orb_mvelpp=mvelpp, & - orb_lambm0=lambm0, orb_obliqr=obliqr ) - - ! Consistency check on namelist filename - call control_setNL("lnd_in"//trim(inst_suffix)) - - ! Initialize clm - ! initialize1 reads namelists - ! decomp and domain are set in lnd_set_decomp_and_domain_from_surfrd - ! initialize2 performs the rest of initialization - call seq_timemgr_EClockGetData(EClock, & - start_ymd=start_ymd, & - start_tod=start_tod, ref_ymd=ref_ymd, & - ref_tod=ref_tod, & - calendar=calendar, & - dtime=dtime_sync) - if (masterproc) then - write(iulog,*)'dtime = ',dtime_sync - end if - call seq_infodata_GetData(infodata, case_name=caseid, & - case_desc=ctitle, single_column=single_column, & - scmlat=scmlat, scmlon=scmlon, & - brnch_retain_casename=brnch_retain_casename, & - start_type=starttype, model_version=version, & - hostname=hostname, username=username ) - - ! Single Column - if ( single_column .and. (scmlat == rundef .or. scmlon == rundef ) ) then - call endrun(msg=' ERROR:: single column mode on -- but scmlat and scmlon are NOT set'//& - errMsg(sourcefile, __LINE__)) - end if - - ! Note that we assume that CTSM's internal dtime matches the coupling time step. - ! i.e., we currently do NOT allow sub-cycling within a coupling time step. - call set_timemgr_init( calendar_in=calendar, start_ymd_in=start_ymd, start_tod_in=start_tod, & - ref_ymd_in=ref_ymd, ref_tod_in=ref_tod, dtime_in=dtime_sync) - - if ( trim(starttype) == trim(seq_infodata_start_type_start)) then - nsrest = nsrStartup - else if (trim(starttype) == trim(seq_infodata_start_type_cont) ) then - nsrest = nsrContinue - else if (trim(starttype) == trim(seq_infodata_start_type_brnch)) then - nsrest = nsrBranch - else - call endrun( sub//' ERROR: unknown starttype' ) - end if - - ! set default values for run control variables - call clm_varctl_set(caseid_in=caseid, ctitle_in=ctitle, & - brnch_retain_casename_in=brnch_retain_casename, & - single_column_in=single_column, scmlat_in=scmlat, & - scmlon_in=scmlon, nsrest_in=nsrest, version_in=version, & - hostname_in=hostname, username_in=username) - - ! Read namelists - call initialize1(dtime=dtime_sync) - - ! Initialize decomposition and domain (ldomain) type - call lnd_set_decomp_and_domain_from_surfrd(noland, ni, nj) - - ! If no land then exit out of initialization - if ( noland ) then - - call seq_infodata_PutData( infodata, lnd_present =.false.) - call seq_infodata_PutData( infodata, lnd_prognostic=.false.) - - else - - ! Determine if aerosol and dust deposition come from atmosphere component - call seq_infodata_GetData(infodata, atm_aero=atm_aero ) - if ( .not. atm_aero )then - call endrun( sub//' ERROR: atmosphere model MUST send aerosols to CLM' ) - end if - - ! Initialize clm gsMap, clm domain and clm attribute vectors - call get_proc_bounds( bounds ) - lsize = bounds%endg - bounds%begg + 1 - gsize = ldomain%ni * ldomain%nj - call mct_gsMap_init( gsMap_lnd, gindex_global, mpicom_lnd, LNDID, lsize, gsize ) - gsmap_global => gsmap_lnd ! module variable in lnd_set_decomp_and_domain - call lnd_domain_mct( bounds, lsize, gsMap_lnd, dom_l ) - call mct_aVect_init(x2l_l, rList=seq_flds_x2l_fields, lsize=lsize) - call mct_aVect_zero(x2l_l) - call mct_aVect_init(l2x_l, rList=seq_flds_l2x_fields, lsize=lsize) - call mct_aVect_zero(l2x_l) - - ! Finish initializing clm - call initialize2(ni,nj) - - ! Create land export state - call lnd_export(bounds, water_inst%waterlnd2atmbulk_inst, lnd2atm_inst, lnd2glc_inst, l2x_l%rattr) - - ! Fill in infodata settings - call seq_infodata_PutData(infodata, lnd_prognostic=.true.) - call seq_infodata_PutData(infodata, lnd_nx=ldomain%ni, lnd_ny=ldomain%nj) - call lnd_handle_resume( cdata_l ) - - ! Reset shr logging to original values - call shr_file_setLogUnit (shrlogunit) - call shr_file_setLogLevel(shrloglev) - -#if (defined _MEMTRACE) - if(masterproc) then - write(iulog,*) TRIM(Sub) // ':end::' - lbnum=1 - call memmon_dump_fort('memmon.out','lnd_int_mct:end::',lbnum) - call memmon_reset_addr() - endif -#endif - end if - - end subroutine lnd_init_mct - - !==================================================================================== - subroutine lnd_run_mct(EClock, cdata_l, x2l_l, l2x_l) - ! - ! !DESCRIPTION: - ! Run clm model - ! - ! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use clm_instMod , only : water_inst, lnd2atm_inst, atm2lnd_inst, lnd2glc_inst, glc2lnd_inst - use clm_driver , only : clm_drv - use clm_time_manager, only : get_curr_date, get_nstep, get_curr_calday, get_step_size - use clm_time_manager, only : advance_timestep, update_rad_dtime - use decompMod , only : get_proc_bounds - use abortutils , only : endrun - use clm_varctl , only : iulog - use clm_varorb , only : eccen, obliqr, lambm0, mvelpp - use shr_file_mod , only : shr_file_setLogUnit, shr_file_setLogLevel - use shr_file_mod , only : shr_file_getLogUnit, shr_file_getLogLevel - use seq_cdata_mod , only : seq_cdata, seq_cdata_setptrs - use seq_timemgr_mod , only : seq_timemgr_EClockGetData, seq_timemgr_StopAlarmIsOn - use seq_timemgr_mod , only : seq_timemgr_RestartAlarmIsOn, seq_timemgr_EClockDateInSync - use seq_infodata_mod, only : seq_infodata_type, seq_infodata_GetData - use spmdMod , only : masterproc, mpicom - use perf_mod , only : t_startf, t_stopf, t_barrierf - use shr_orb_mod , only : shr_orb_decl - use ESMF - ! - ! !ARGUMENTS: - type(ESMF_Clock) , intent(inout) :: EClock ! Input synchronization clock from driver - type(seq_cdata) , intent(inout) :: cdata_l ! Input driver data for land model - type(mct_aVect) , intent(inout) :: x2l_l ! Import state to land model - type(mct_aVect) , intent(inout) :: l2x_l ! Export state from land model - ! - ! !LOCAL VARIABLES: - integer :: ymd_sync ! Sync date (YYYYMMDD) - integer :: yr_sync ! Sync current year - integer :: mon_sync ! Sync current month - integer :: day_sync ! Sync current day - integer :: tod_sync ! Sync current time of day (sec) - integer :: ymd ! CLM current date (YYYYMMDD) - integer :: yr ! CLM current year - integer :: mon ! CLM current month - integer :: day ! CLM current day - integer :: tod ! CLM current time of day (sec) - integer :: dtime ! time step increment (sec) - integer :: nstep ! time step index - logical :: rstwr_sync ! .true. ==> write restart file before returning - logical :: rstwr ! .true. ==> write restart file before returning - logical :: nlend_sync ! Flag signaling last time-step - logical :: nlend ! .true. ==> last time-step - logical :: dosend ! true => send data back to driver - logical :: doalb ! .true. ==> do albedo calculation on this time step - logical :: rof_prognostic ! .true. => running with a prognostic ROF model - logical :: glc_present ! .true. => running with a non-stub GLC model - real(r8) :: nextsw_cday ! calday from clock of next radiation computation - real(r8) :: caldayp1 ! clm calday plus dtime offset - integer :: shrlogunit,shrloglev ! old values for share log unit and log level - integer :: lbnum ! input to memory diagnostic - integer :: g,i,lsize ! counters - real(r8) :: calday ! calendar day for nstep - real(r8) :: declin ! solar declination angle in radians for nstep - real(r8) :: declinp1 ! solar declination angle in radians for nstep+1 - real(r8) :: eccf ! earth orbit eccentricity factor - real(r8) :: recip ! reciprical - logical,save :: first_call = .true. ! first call work - type(seq_infodata_type),pointer :: infodata ! CESM information from the driver - type(mct_gGrid), pointer :: dom_l ! Land model domain data - type(bounds_type) :: bounds ! bounds - character(len=32) :: rdate ! date char string for restart file names - character(len=32), parameter :: sub = "lnd_run_mct" - !--------------------------------------------------------------------------- - - ! Determine processor bounds - - call get_proc_bounds(bounds) - -#if (defined _MEMTRACE) - if(masterproc) then - lbnum=1 - call memmon_dump_fort('memmon.out','lnd_run_mct:start::',lbnum) - endif -#endif - - ! Reset shr logging to my log file - call shr_file_getLogUnit (shrlogunit) - call shr_file_getLogLevel(shrloglev) - call shr_file_setLogUnit (iulog) - - ! Determine time of next atmospheric shortwave calculation - call seq_cdata_setptrs(cdata_l, infodata=infodata, dom=dom_l) - call seq_timemgr_EClockGetData(EClock, & - curr_ymd=ymd, curr_tod=tod_sync, & - curr_yr=yr_sync, curr_mon=mon_sync, curr_day=day_sync) - call seq_infodata_GetData(infodata, nextsw_cday=nextsw_cday ) - - dtime = get_step_size() - - ! Handle pause/resume signals from coupler - call lnd_handle_resume( cdata_l ) - - write(rdate,'(i4.4,"-",i2.2,"-",i2.2,"-",i5.5)') yr_sync,mon_sync,day_sync,tod_sync - nlend_sync = seq_timemgr_StopAlarmIsOn( EClock ) - rstwr_sync = seq_timemgr_RestartAlarmIsOn( EClock ) - - ! Determine if we're running with a prognostic ROF model, and if we're running with a - ! non-stub GLC model. These won't change throughout the run, but we can't count on - ! their being set in initialization, so need to get them in the run method. - - call seq_infodata_GetData( infodata, & - rof_prognostic=rof_prognostic, & - glc_present=glc_present) - - ! Map MCT to land data type - ! Perform downscaling if appropriate - - - ! Map to clm (only when state and/or fluxes need to be updated) - - call t_startf ('lc_lnd_import') - call lnd_import( bounds, & - x2l = x2l_l%rattr, & - glc_present = glc_present, & - atm2lnd_inst = atm2lnd_inst, & - glc2lnd_inst = glc2lnd_inst, & - wateratm2lndbulk_inst = water_inst%wateratm2lndbulk_inst) - call t_stopf ('lc_lnd_import') - - ! Use infodata to set orbital values if updated mid-run - - call seq_infodata_GetData( infodata, orb_eccen=eccen, orb_mvelpp=mvelpp, & - orb_lambm0=lambm0, orb_obliqr=obliqr ) - - ! Loop over time steps in coupling interval - - dosend = .false. - do while(.not. dosend) - - ! Determine if dosend - ! When time is not updated at the beginning of the loop - then return only if - ! are in sync with clock before time is updated - ! - ! NOTE(wjs, 2020-03-09) I think the do while (.not. dosend) loop only is important - ! for the first time step (when we run 2 steps). After that, we now assume that we - ! run one time step per coupling interval (based on setting the model's dtime from - ! the driver). (According to Mariana Vertenstein, sub-cycling (running multiple - ! land model time steps per coupling interval) used to be supported, but hasn't - ! been fully supported for a long time.) We may want to rework this logic to make - ! this more explicit, or - ideally - get rid of this extra time step at the start - ! of the run, at which point I think we could do away with this looping entirely. - - call get_curr_date( yr, mon, day, tod ) - ymd = yr*10000 + mon*100 + day - tod = tod - dosend = (seq_timemgr_EClockDateInSync( EClock, ymd, tod)) - - ! Determine doalb based on nextsw_cday sent from atm model - - nstep = get_nstep() - caldayp1 = get_curr_calday(offset=dtime, reuse_day_365_for_day_366=.true.) - if (nstep == 0) then - doalb = .false. - else if (nstep == 1) then - doalb = (abs(nextsw_cday- caldayp1) < 1.e-10_r8) - else - doalb = (nextsw_cday >= -0.5_r8) - end if - call update_rad_dtime(doalb) - - ! Determine if time to write restart and stop - - rstwr = .false. - if (rstwr_sync .and. dosend) rstwr = .true. - nlend = .false. - if (nlend_sync .and. dosend) nlend = .true. - - ! Run clm - - call t_barrierf('sync_clm_run1', mpicom) - call t_startf ('clm_run') - call t_startf ('shr_orb_decl') - calday = get_curr_calday(reuse_day_365_for_day_366=.true.) - call shr_orb_decl( calday , eccen, mvelpp, lambm0, obliqr, declin , eccf ) - call shr_orb_decl( nextsw_cday, eccen, mvelpp, lambm0, obliqr, declinp1, eccf ) - call t_stopf ('shr_orb_decl') - call clm_drv(doalb, nextsw_cday, declinp1, declin, rstwr, nlend, rdate, rof_prognostic) - call t_stopf ('clm_run') - - ! Create l2x_l export state - add river runoff input to l2x_l if appropriate - - call t_startf ('lc_lnd_export') - call lnd_export(bounds, water_inst%waterlnd2atmbulk_inst, lnd2atm_inst, lnd2glc_inst, l2x_l%rattr) - call t_stopf ('lc_lnd_export') - - ! Advance clm time step - - call t_startf ('lc_clm2_adv_timestep') - call advance_timestep() - call t_stopf ('lc_clm2_adv_timestep') - - end do - - ! Check that internal clock is in sync with master clock - - call get_curr_date( yr, mon, day, tod, offset=-dtime ) - ymd = yr*10000 + mon*100 + day - tod = tod - if ( .not. seq_timemgr_EClockDateInSync( EClock, ymd, tod ) )then - call seq_timemgr_EclockGetData( EClock, curr_ymd=ymd_sync, curr_tod=tod_sync ) - write(iulog,*)' clm ymd=',ymd ,' clm tod= ',tod - write(iulog,*)'sync ymd=',ymd_sync,' sync tod= ',tod_sync - call endrun( sub//":: CLM clock not in sync with Master Sync clock" ) - end if - - ! Reset shr logging to my original values - - call shr_file_setLogUnit (shrlogunit) - call shr_file_setLogLevel(shrloglev) - -#if (defined _MEMTRACE) - if(masterproc) then - lbnum=1 - call memmon_dump_fort('memmon.out','lnd_run_mct:end::',lbnum) - call memmon_reset_addr() - endif -#endif - - first_call = .false. - - end subroutine lnd_run_mct - - !==================================================================================== - subroutine lnd_final_mct( EClock, cdata_l, x2l_l, l2x_l) - ! - ! !DESCRIPTION: - ! Finalize land surface model - - use seq_cdata_mod ,only : seq_cdata, seq_cdata_setptrs - use seq_timemgr_mod ,only : seq_timemgr_EClockGetData, seq_timemgr_StopAlarmIsOn - use seq_timemgr_mod ,only : seq_timemgr_RestartAlarmIsOn, seq_timemgr_EClockDateInSync - use esmf - ! - ! !ARGUMENTS: - type(ESMF_Clock) , intent(inout) :: EClock ! Input synchronization clock from driver - type(seq_cdata) , intent(inout) :: cdata_l ! Input driver data for land model - type(mct_aVect) , intent(inout) :: x2l_l ! Import state to land model - type(mct_aVect) , intent(inout) :: l2x_l ! Export state from land model - !--------------------------------------------------------------------------- - - ! fill this in - end subroutine lnd_final_mct - - !==================================================================================== - subroutine lnd_domain_mct( bounds, lsize, gsMap_l, dom_l ) - ! - ! !DESCRIPTION: - ! Send the land model domain information to the coupler - ! - ! !USES: - use clm_varcon , only: re - use domainMod , only: ldomain - use spmdMod , only: iam - use mct_mod , only: mct_gGrid_importIAttr - use mct_mod , only: mct_gGrid_importRAttr, mct_gGrid_init, mct_gsMap_orderedPoints - use seq_flds_mod, only: seq_flds_dom_coord, seq_flds_dom_other - ! - ! !ARGUMENTS: - type(bounds_type), intent(in) :: bounds ! bounds - integer , intent(in) :: lsize ! land model domain data size - type(mct_gsMap), intent(inout) :: gsMap_l ! Output land model MCT GS map - type(mct_ggrid), intent(out) :: dom_l ! Output domain information for land model - ! - ! Local Variables - integer :: g,i,j ! index - real(r8), pointer :: data(:) ! temporary - integer , pointer :: idata(:) ! temporary - !--------------------------------------------------------------------------- - ! - ! Initialize mct domain type - ! lat/lon in degrees, area in radians^2, mask is 1 (land), 0 (non-land) - ! Note that in addition land carries around landfrac for the purposes of domain checking - ! - call mct_gGrid_init( GGrid=dom_l, CoordChars=trim(seq_flds_dom_coord), & - OtherChars=trim(seq_flds_dom_other), lsize=lsize ) - ! - ! Allocate memory - ! - allocate(data(lsize)) - ! - ! Determine global gridpoint number attribute, GlobGridNum, which is set automatically by MCT - ! - call mct_gsMap_orderedPoints(gsMap_l, iam, idata) - call mct_gGrid_importIAttr(dom_l,'GlobGridNum',idata,lsize) - ! - ! Determine domain (numbering scheme is: West to East and South to North to South pole) - ! Initialize attribute vector with special value - ! - data(:) = -9999.0_R8 - call mct_gGrid_importRAttr(dom_l,"lat" ,data,lsize) - call mct_gGrid_importRAttr(dom_l,"lon" ,data,lsize) - call mct_gGrid_importRAttr(dom_l,"area" ,data,lsize) - call mct_gGrid_importRAttr(dom_l,"aream",data,lsize) - data(:) = 0.0_R8 - call mct_gGrid_importRAttr(dom_l,"mask" ,data,lsize) - ! - ! Fill in correct values for domain components - ! Note aream will be filled in in the atm-lnd mapper - ! - do g = bounds%begg,bounds%endg - i = 1 + (g - bounds%begg) - data(i) = ldomain%lonc(g) - end do - call mct_gGrid_importRattr(dom_l,"lon",data,lsize) - - do g = bounds%begg,bounds%endg - i = 1 + (g - bounds%begg) - data(i) = ldomain%latc(g) - end do - call mct_gGrid_importRattr(dom_l,"lat",data,lsize) - - do g = bounds%begg,bounds%endg - i = 1 + (g - bounds%begg) - data(i) = ldomain%area(g)/(re*re) - end do - call mct_gGrid_importRattr(dom_l,"area",data,lsize) - - do g = bounds%begg,bounds%endg - i = 1 + (g - bounds%begg) - data(i) = real(ldomain%mask(g), r8) - end do - call mct_gGrid_importRattr(dom_l,"mask",data,lsize) - - do g = bounds%begg,bounds%endg - i = 1 + (g - bounds%begg) - data(i) = real(ldomain%frac(g), r8) - end do - call mct_gGrid_importRattr(dom_l,"frac",data,lsize) - - deallocate(data) - deallocate(idata) - - end subroutine lnd_domain_mct - - !==================================================================================== - subroutine lnd_handle_resume( cdata_l ) - ! - ! !DESCRIPTION: - ! Handle resume signals for Data Assimilation (DA) - ! - ! !USES: - use clm_time_manager , only : update_DA_nstep - use seq_cdata_mod , only : seq_cdata, seq_cdata_setptrs - implicit none - ! !ARGUMENTS: - type(seq_cdata), intent(inout) :: cdata_l ! Input land-model driver data - ! !LOCAL VARIABLES: - logical :: resume_from_data_assim ! flag if we are resuming after data assimulation was done - !--------------------------------------------------------------------------- - - ! Check to see if restart was modified and we are resuming from data - ! assimilation - call seq_cdata_setptrs(cdata_l, post_assimilation=resume_from_data_assim) - if ( resume_from_data_assim ) call update_DA_nstep() - - end subroutine lnd_handle_resume - -end module lnd_comp_mct diff --git a/src/cpl/mct/lnd_import_export.F90 b/src/cpl/mct/lnd_import_export.F90 deleted file mode 100644 index 537abd49d9..0000000000 --- a/src/cpl/mct/lnd_import_export.F90 +++ /dev/null @@ -1,354 +0,0 @@ -module lnd_import_export - - use shr_kind_mod , only: r8 => shr_kind_r8, cl=>shr_kind_cl - use abortutils , only: endrun - use decompmod , only: bounds_type, subgrid_level_gridcell - use lnd2atmType , only: lnd2atm_type - use lnd2glcMod , only: lnd2glc_type - use atm2lndType , only: atm2lnd_type - use glc2lndMod , only: glc2lnd_type - use Waterlnd2atmBulkType , only: waterlnd2atmbulk_type - use Wateratm2lndBulkType , only: wateratm2lndbulk_type - use clm_cpl_indices - use GridcellType , only : grc - ! - implicit none - !=============================================================================== - -contains - - !=============================================================================== - subroutine lnd_import( bounds, x2l, glc_present, atm2lnd_inst, glc2lnd_inst, wateratm2lndbulk_inst) - - !--------------------------------------------------------------------------- - ! !DESCRIPTION: - ! Convert the input data from the coupler to the land model - ! - ! !USES: - use seq_flds_mod , only: seq_flds_x2l_fields - use clm_varctl , only: co2_type, co2_ppmv, iulog, use_c13 - use clm_varctl , only: ndep_from_cpl - use clm_varcon , only: c13ratio - use domainMod , only: ldomain - use lnd_import_export_utils, only : derive_quantities, check_for_errors, check_for_nans - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds ! bounds - real(r8) , intent(in) :: x2l(:,:) ! driver import state to land model - logical , intent(in) :: glc_present ! .true. => running with a non-stub GLC model - type(atm2lnd_type) , intent(inout) :: atm2lnd_inst ! clm internal input data type - type(glc2lnd_type) , intent(inout) :: glc2lnd_inst ! clm internal input data type - type(wateratm2lndbulk_type), intent(inout) :: wateratm2lndbulk_inst ! clm internal input data type - ! - ! !LOCAL VARIABLES: - integer :: begg, endg ! bounds - integer :: g,i,k,nstep,ier ! indices, number of steps, and error code - real(r8) :: qsat_kg_kg ! saturation specific humidity (kg/kg) - real(r8) :: forc_pbot ! atmospheric pressure (Pa) - real(r8) :: forc_rainc(bounds%begg:bounds%endg) ! rainxy Atm flux mm/s - real(r8) :: forc_rainl(bounds%begg:bounds%endg) ! rainxy Atm flux mm/s - real(r8) :: forc_snowc(bounds%begg:bounds%endg) ! snowfxy Atm flux mm/s - real(r8) :: forc_snowl(bounds%begg:bounds%endg) ! snowfxl Atm flux mm/s - real(r8) :: co2_ppmv_diag ! temporary - real(r8) :: co2_ppmv_prog ! temporary - real(r8) :: co2_ppmv_val ! temporary - integer :: co2_type_idx ! integer flag for co2_type options - character(len=32) :: fname ! name of field that is NaN - character(len=32), parameter :: sub = 'lnd_import' - - !--------------------------------------------------------------------------- - - ! Set bounds - begg = bounds%begg; endg = bounds%endg - - co2_type_idx = 0 - if (co2_type == 'prognostic') then - co2_type_idx = 1 - else if (co2_type == 'diagnostic') then - co2_type_idx = 2 - end if - if (co2_type == 'prognostic' .and. index_x2l_Sa_co2prog == 0) then - call endrun( sub//' ERROR: must have nonzero index_x2l_Sa_co2prog for co2_type equal to prognostic' ) - else if (co2_type == 'diagnostic' .and. index_x2l_Sa_co2diag == 0) then - call endrun( sub//' ERROR: must have nonzero index_x2l_Sa_co2diag for co2_type equal to diagnostic' ) - end if - - ! Note that the precipitation fluxes received from the coupler - ! are in units of kg/s/m^2. To convert these precipitation rates - ! in units of mm/sec, one must divide by 1000 kg/m^3 and multiply - ! by 1000 mm/m resulting in an overall factor of unity. - ! Below the units are therefore given in mm/s. - - do g = begg,endg - i = 1 + (g - begg) - - ! Determine flooding input, sign convention is positive downward and - ! hierarchy is atm/glc/lnd/rof/ice/ocn. so water sent from rof to land is negative, - ! change the sign to indicate addition of water to system. - - wateratm2lndbulk_inst%forc_flood_grc(g) = -x2l(index_x2l_Flrr_flood,i) - - wateratm2lndbulk_inst%volr_grc(g) = x2l(index_x2l_Flrr_volr,i) * (ldomain%area(g) * 1.e6_r8) - wateratm2lndbulk_inst%volrmch_grc(g)= x2l(index_x2l_Flrr_volrmch,i) * (ldomain%area(g) * 1.e6_r8) - - ! Determine required receive fields - - atm2lnd_inst%forc_hgt_grc(g) = x2l(index_x2l_Sa_z,i) ! zgcmxy Atm state m - atm2lnd_inst%forc_topo_grc(g) = x2l(index_x2l_Sa_topo,i) ! Atm surface height (m) - atm2lnd_inst%forc_u_grc(g) = x2l(index_x2l_Sa_u,i) ! forc_uxy Atm state m/s - atm2lnd_inst%forc_v_grc(g) = x2l(index_x2l_Sa_v,i) ! forc_vxy Atm state m/s - atm2lnd_inst%forc_solad_not_downscaled_grc(g,2) = x2l(index_x2l_Faxa_swndr,i) ! forc_sollxy Atm flux W/m^2 - atm2lnd_inst%forc_solad_not_downscaled_grc(g,1) = x2l(index_x2l_Faxa_swvdr,i) ! forc_solsxy Atm flux W/m^2 - atm2lnd_inst%forc_solai_grc(g,2) = x2l(index_x2l_Faxa_swndf,i) ! forc_solldxy Atm flux W/m^2 - atm2lnd_inst%forc_solai_grc(g,1) = x2l(index_x2l_Faxa_swvdf,i) ! forc_solsdxy Atm flux W/m^2 - - atm2lnd_inst%forc_th_not_downscaled_grc(g) = x2l(index_x2l_Sa_ptem,i) ! forc_thxy Atm state K - wateratm2lndbulk_inst%forc_q_not_downscaled_grc(g) = x2l(index_x2l_Sa_shum,i) ! forc_qxy Atm state kg/kg - atm2lnd_inst%forc_pbot_not_downscaled_grc(g) = x2l(index_x2l_Sa_pbot,i) ! ptcmxy Atm state Pa - atm2lnd_inst%forc_t_not_downscaled_grc(g) = x2l(index_x2l_Sa_tbot,i) ! forc_txy Atm state K - atm2lnd_inst%forc_lwrad_not_downscaled_grc(g) = x2l(index_x2l_Faxa_lwdn,i) ! flwdsxy Atm flux W/m^2 - - forc_rainc(g) = x2l(index_x2l_Faxa_rainc,i) ! mm/s - forc_rainl(g) = x2l(index_x2l_Faxa_rainl,i) ! mm/s - forc_snowc(g) = x2l(index_x2l_Faxa_snowc,i) ! mm/s - forc_snowl(g) = x2l(index_x2l_Faxa_snowl,i) ! mm/s - - ! atmosphere coupling, for prognostic/prescribed aerosols - atm2lnd_inst%forc_aer_grc(g,1) = x2l(index_x2l_Faxa_bcphidry,i) - atm2lnd_inst%forc_aer_grc(g,2) = x2l(index_x2l_Faxa_bcphodry,i) - atm2lnd_inst%forc_aer_grc(g,3) = x2l(index_x2l_Faxa_bcphiwet,i) - atm2lnd_inst%forc_aer_grc(g,4) = x2l(index_x2l_Faxa_ocphidry,i) - atm2lnd_inst%forc_aer_grc(g,5) = x2l(index_x2l_Faxa_ocphodry,i) - atm2lnd_inst%forc_aer_grc(g,6) = x2l(index_x2l_Faxa_ocphiwet,i) - atm2lnd_inst%forc_aer_grc(g,7) = x2l(index_x2l_Faxa_dstwet1,i) - atm2lnd_inst%forc_aer_grc(g,8) = x2l(index_x2l_Faxa_dstdry1,i) - atm2lnd_inst%forc_aer_grc(g,9) = x2l(index_x2l_Faxa_dstwet2,i) - atm2lnd_inst%forc_aer_grc(g,10) = x2l(index_x2l_Faxa_dstdry2,i) - atm2lnd_inst%forc_aer_grc(g,11) = x2l(index_x2l_Faxa_dstwet3,i) - atm2lnd_inst%forc_aer_grc(g,12) = x2l(index_x2l_Faxa_dstdry3,i) - atm2lnd_inst%forc_aer_grc(g,13) = x2l(index_x2l_Faxa_dstwet4,i) - atm2lnd_inst%forc_aer_grc(g,14) = x2l(index_x2l_Faxa_dstdry4,i) - - if (index_x2l_Sa_methane /= 0) then - atm2lnd_inst%forc_pch4_grc(g) = x2l(index_x2l_Sa_methane,i) - endif - - !-------------------------- - ! Check for nans from coupler - !-------------------------- - - call check_for_nans(x2l(:,i), fname, begg, "x2l") - - end do - - !-------------------------- - ! Derived quantities for required fields - ! and corresponding error checks - !-------------------------- - - call derive_quantities(bounds, atm2lnd_inst, wateratm2lndbulk_inst, & - forc_rainc, forc_rainl, forc_snowc, forc_snowl) - - call check_for_errors(bounds, atm2lnd_inst, wateratm2lndbulk_inst) - - ! Determine derived quantities for optional fields - ! Note that the following does unit conversions from ppmv to partial pressures (Pa) - ! Note that forc_pbot is in Pa - - do g = begg,endg - i = 1 + (g - begg) - - forc_pbot = atm2lnd_inst%forc_pbot_not_downscaled_grc(g) - - ! Determine optional receive fields - if (index_x2l_Sa_co2prog /= 0) then - co2_ppmv_prog = x2l(index_x2l_Sa_co2prog,i) ! co2 atm state prognostic - else - co2_ppmv_prog = co2_ppmv - end if - if (index_x2l_Sa_co2diag /= 0) then - co2_ppmv_diag = x2l(index_x2l_Sa_co2diag,i) ! co2 atm state diagnostic - else - co2_ppmv_diag = co2_ppmv - end if - - if (co2_type_idx == 1) then - co2_ppmv_val = co2_ppmv_prog - else if (co2_type_idx == 2) then - co2_ppmv_val = co2_ppmv_diag - else - co2_ppmv_val = co2_ppmv - end if - if ( (co2_ppmv_val < 10.0_r8) .or. (co2_ppmv_val > 15000.0_r8) )then - call endrun(subgrid_index=g, subgrid_level=subgrid_level_gridcell, & - msg = sub//' ERROR: CO2 is outside of an expected range' ) - end if - atm2lnd_inst%forc_pco2_grc(g) = co2_ppmv_val * 1.e-6_r8 * forc_pbot - if (use_c13) then - atm2lnd_inst%forc_pc13o2_grc(g) = co2_ppmv_val * c13ratio * 1.e-6_r8 * forc_pbot - end if - - if (ndep_from_cpl) then - ! The coupler is sending ndep in units if kgN/m2/s - and clm uses units of gN/m2/sec - so the - ! following conversion needs to happen - atm2lnd_inst%forc_ndep_grc(g) = (x2l(index_x2l_Faxa_nhx, i) + x2l(index_x2l_faxa_noy, i))*1000._r8 - end if - - end do - - call glc2lnd_inst%set_glc2lnd_fields_mct( & - bounds = bounds, & - glc_present = glc_present, & - ! NOTE(wjs, 2017-12-13) the x2l argument doesn't have the typical bounds - ! subsetting (bounds%begg:bounds%endg). This mirrors the lack of these bounds in - ! the call to lnd_import from lnd_run_mct. This is okay as long as this code is - ! outside a clump loop. - x2l = x2l, & - index_x2l_Sg_ice_covered = index_x2l_Sg_ice_covered, & - index_x2l_Sg_topo = index_x2l_Sg_topo, & - index_x2l_Flgg_hflx = index_x2l_Flgg_hflx, & - index_x2l_Sg_icemask = index_x2l_Sg_icemask, & - index_x2l_Sg_icemask_coupled_fluxes = index_x2l_Sg_icemask_coupled_fluxes) - - end subroutine lnd_import - - !=============================================================================== - - subroutine lnd_export( bounds, waterlnd2atmbulk_inst, lnd2atm_inst, lnd2glc_inst, l2x) - - !--------------------------------------------------------------------------- - ! !DESCRIPTION: - ! Convert the data to be sent from the clm model to the coupler - ! - ! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use seq_flds_mod , only : seq_flds_l2x_fields - use clm_varctl , only : iulog - use shr_drydep_mod , only : n_drydep - use shr_megan_mod , only : shr_megan_mechcomps_n - use shr_fire_emis_mod , only : shr_fire_emis_mechcomps_n - use lnd_import_export_utils, only : check_for_nans - ! - ! !ARGUMENTS: - implicit none - type(bounds_type) , intent(in) :: bounds ! bounds - type(lnd2atm_type), intent(inout) :: lnd2atm_inst ! clm land to atmosphere exchange data type - type(lnd2glc_type), intent(inout) :: lnd2glc_inst ! clm land to atmosphere exchange data type - type(waterlnd2atmbulk_type), intent(in) :: waterlnd2atmbulk_inst - real(r8) , intent(out) :: l2x(:,:)! land to coupler export state on land grid - ! - ! !LOCAL VARIABLES: - integer :: begg, endg ! bounds - integer :: g,i,k ! indices - integer :: ier ! error status - integer :: nstep ! time step index - integer :: dtime ! time step - integer :: num ! counter - character(len=32) :: fname ! name of field that is NaN - character(len=32), parameter :: sub = 'lnd_export' - !--------------------------------------------------------------------------- - - ! Set bounds - begg = bounds%begg; endg = bounds%endg - - ! cesm sign convention is that fluxes are positive downward - - l2x(:,:) = 0.0_r8 - - do g = begg,endg - i = 1 + (g-begg) - l2x(index_l2x_Sl_t,i) = lnd2atm_inst%t_rad_grc(g) - l2x(index_l2x_Sl_snowh,i) = waterlnd2atmbulk_inst%h2osno_grc(g) - l2x(index_l2x_Sl_avsdr,i) = lnd2atm_inst%albd_grc(g,1) - l2x(index_l2x_Sl_anidr,i) = lnd2atm_inst%albd_grc(g,2) - l2x(index_l2x_Sl_avsdf,i) = lnd2atm_inst%albi_grc(g,1) - l2x(index_l2x_Sl_anidf,i) = lnd2atm_inst%albi_grc(g,2) - l2x(index_l2x_Sl_tref,i) = lnd2atm_inst%t_ref2m_grc(g) - l2x(index_l2x_Sl_qref,i) = waterlnd2atmbulk_inst%q_ref2m_grc(g) - l2x(index_l2x_Sl_u10,i) = lnd2atm_inst%u_ref10m_grc(g) - l2x(index_l2x_Fall_taux,i) = -lnd2atm_inst%taux_grc(g) - l2x(index_l2x_Fall_tauy,i) = -lnd2atm_inst%tauy_grc(g) - l2x(index_l2x_Fall_lat,i) = -lnd2atm_inst%eflx_lh_tot_grc(g) - l2x(index_l2x_Fall_sen,i) = -lnd2atm_inst%eflx_sh_tot_grc(g) - l2x(index_l2x_Fall_lwup,i) = -lnd2atm_inst%eflx_lwrad_out_grc(g) - l2x(index_l2x_Fall_evap,i) = -waterlnd2atmbulk_inst%qflx_evap_tot_grc(g) - l2x(index_l2x_Fall_swnet,i) = lnd2atm_inst%fsa_grc(g) - if (index_l2x_Fall_fco2_lnd /= 0) then - l2x(index_l2x_Fall_fco2_lnd,i) = -lnd2atm_inst%net_carbon_exchange_grc(g) - end if - - ! Additional fields for DUST, PROGSSLT, dry-deposition and VOC - ! These are now standard fields, but the check on the index makes sure the driver handles them - if (index_l2x_Sl_ram1 /= 0 ) l2x(index_l2x_Sl_ram1,i) = lnd2atm_inst%ram1_grc(g) - if (index_l2x_Sl_fv /= 0 ) l2x(index_l2x_Sl_fv,i) = lnd2atm_inst%fv_grc(g) - if (index_l2x_Sl_soilw /= 0 ) l2x(index_l2x_Sl_soilw,i) = waterlnd2atmbulk_inst%h2osoi_vol_grc(g,1) - if (index_l2x_Fall_flxdst1 /= 0 ) l2x(index_l2x_Fall_flxdst1,i)= -lnd2atm_inst%flxdst_grc(g,1) - if (index_l2x_Fall_flxdst2 /= 0 ) l2x(index_l2x_Fall_flxdst2,i)= -lnd2atm_inst%flxdst_grc(g,2) - if (index_l2x_Fall_flxdst3 /= 0 ) l2x(index_l2x_Fall_flxdst3,i)= -lnd2atm_inst%flxdst_grc(g,3) - if (index_l2x_Fall_flxdst4 /= 0 ) l2x(index_l2x_Fall_flxdst4,i)= -lnd2atm_inst%flxdst_grc(g,4) - - - ! for dry dep velocities - if (index_l2x_Sl_ddvel /= 0 ) then - l2x(index_l2x_Sl_ddvel:index_l2x_Sl_ddvel+n_drydep-1,i) = & - lnd2atm_inst%ddvel_grc(g,:n_drydep) - end if - - ! for MEGAN VOC emis fluxes - if (index_l2x_Fall_flxvoc /= 0 ) then - l2x(index_l2x_Fall_flxvoc:index_l2x_Fall_flxvoc+shr_megan_mechcomps_n-1,i) = & - -lnd2atm_inst%flxvoc_grc(g,:shr_megan_mechcomps_n) - end if - - - ! for fire emis fluxes - if (index_l2x_Fall_flxfire /= 0 ) then - l2x(index_l2x_Fall_flxfire:index_l2x_Fall_flxfire+shr_fire_emis_mechcomps_n-1,i) = & - -lnd2atm_inst%fireflx_grc(g,:shr_fire_emis_mechcomps_n) - l2x(index_l2x_Sl_ztopfire,i) = lnd2atm_inst%fireztop_grc(g) - end if - - if (index_l2x_Fall_methane /= 0) then - l2x(index_l2x_Fall_methane,i) = -lnd2atm_inst%ch4_surf_flux_tot_grc(g) - endif - - ! sign convention is positive downward with - ! hierarchy of atm/glc/lnd/rof/ice/ocn. - ! I.e. water sent from land to rof is positive - - l2x(index_l2x_Flrl_rofsur,i) = waterlnd2atmbulk_inst%qflx_rofliq_qsur_grc(g) - - ! subsurface runoff is the sum of qflx_drain and qflx_perched_drain - l2x(index_l2x_Flrl_rofsub,i) = waterlnd2atmbulk_inst%qflx_rofliq_qsub_grc(g) & - + waterlnd2atmbulk_inst%qflx_rofliq_drain_perched_grc(g) - - ! qgwl sent individually to coupler - l2x(index_l2x_Flrl_rofgwl,i) = waterlnd2atmbulk_inst%qflx_rofliq_qgwl_grc(g) - - ! ice sent individually to coupler - l2x(index_l2x_Flrl_rofi,i) = waterlnd2atmbulk_inst%qflx_rofice_grc(g) - - ! irrigation flux to be removed from main channel storage (negative) - l2x(index_l2x_Flrl_irrig,i) = - waterlnd2atmbulk_inst%qirrig_grc(g) - - ! glc coupling - ! We could avoid setting these fields if glc_present is .false., if that would - ! help with performance. (The downside would be that we wouldn't have these fields - ! available for diagnostic purposes or to force a later T compset with dlnd.) - do num = 0,glc_nec - l2x(index_l2x_Sl_tsrf(num),i) = lnd2glc_inst%tsrf_grc(g,num) - l2x(index_l2x_Sl_topo(num),i) = lnd2glc_inst%topo_grc(g,num) - l2x(index_l2x_Flgl_qice(num),i) = lnd2glc_inst%qice_grc(g,num) - end do - - !-------------------------- - ! Check for nans to coupler - !-------------------------- - - call check_for_nans(l2x(:,i), fname, begg, "l2x") - - end do - - end subroutine lnd_export - -end module lnd_import_export diff --git a/src/cpl/mct/lnd_set_decomp_and_domain.F90 b/src/cpl/mct/lnd_set_decomp_and_domain.F90 deleted file mode 100644 index 0a37554313..0000000000 --- a/src/cpl/mct/lnd_set_decomp_and_domain.F90 +++ /dev/null @@ -1,352 +0,0 @@ -module lnd_set_decomp_and_domain - - use shr_kind_mod , only : r8 => shr_kind_r8 - use spmdMod , only : masterproc - use clm_varctl , only : iulog - use mct_mod , only : mct_gsMap - - implicit none - private ! except - - ! public member routines - public :: lnd_set_decomp_and_domain_from_surfrd - - ! private member routines - private :: surfrd_get_globmask ! Reads global land mask (needed for setting domain decomp) - private :: surfrd_get_grid ! Read grid/ladnfrac data into domain (after domain decomp) - - ! translation between local and global indices at gridcell level - type(mct_gsmap), pointer, public :: gsmap_global - - ! translation between local and global indices at gridcell level for multiple levels - ! needed for 3d soil moisture stream - type(mct_gsmap), target , public :: gsMap_lnd2Dsoi_gdc2glo - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - -!=============================================================================== -contains -!=============================================================================== - - subroutine lnd_set_decomp_and_domain_from_surfrd(noland, ni, nj) - - ! Initialize ldomain data types - - use clm_varpar , only: nlevsoi - use clm_varctl , only: fatmlndfrc, use_soil_moisture_streams - use decompInitMod , only: decompInit_lnd - use decompMod , only: bounds_type, get_proc_bounds - use domainMod , only: ldomain, domain_check - - ! input/output variables - logical, intent(out) :: noland - integer, intent(out) :: ni, nj ! global grid sizes - - ! local variables - integer ,pointer :: amask(:) ! global land mask - integer :: begg, endg ! processor bounds - type(bounds_type) :: bounds ! bounds - character(len=32) :: subname = 'lnd_set_decomp_and_domain_from_surfrd' - !----------------------------------------------------------------------- - - ! Read in global land grid and land mask (amask)- needed to set decomposition - ! global memory for amask is allocate in surfrd_get_glomask - must be deallocated below - if (masterproc) then - write(iulog,*) 'Attempting to read global land mask from ',trim(fatmlndfrc) - endif - - ! Get global mask, ni and nj - call surfrd_get_globmask(filename=fatmlndfrc, mask=amask, ni=ni, nj=nj) - - ! Exit early if no valid land points - if ( all(amask == 0) )then - if (masterproc) write(iulog,*) trim(subname)//': no valid land points do NOT run clm' - noland = .true. - return - else - noland = .false. - end if - - ! Determine ctsm gridcell decomposition and processor bounds for gridcells - call decompInit_lnd(ni, nj, amask) - deallocate(amask) - if (use_soil_moisture_streams) call decompInit_lnd3D(ni, nj, nlevsoi) - - ! Initialize bounds for just gridcells - ! Remaining bounds (landunits, columns, patches) will be determined - ! after the call to decompInit_glcp - so get_proc_bounds is called - ! twice and the gridcell information is just filled in twice - call get_proc_bounds(bounds) - - ! Get grid cell bounds values - begg = bounds%begg - endg = bounds%endg - - ! Initialize ldomain data type - if (masterproc) then - write(iulog,*) 'Attempting to read ldomain from ',trim(fatmlndfrc) - endif - call surfrd_get_grid(begg, endg, ldomain, fatmlndfrc) - if (masterproc) then - call domain_check(ldomain) - endif - ldomain%mask = 1 !!! TODO - is this needed? - - end subroutine lnd_set_decomp_and_domain_from_surfrd - - !----------------------------------------------------------------------- - subroutine surfrd_get_globmask(filename, mask, ni, nj) - - ! Read the surface dataset grid related information - ! This is used to set the domain decomposition - so global data is read here - - use fileutils , only : getfil - use ncdio_pio , only : ncd_io, ncd_pio_openfile, ncd_pio_closefile, ncd_inqfdims, file_desc_t - use abortutils , only : endrun - use shr_log_mod, only : errMsg => shr_log_errMsg - - ! input/output variables - character(len=*), intent(in) :: filename ! grid filename - integer , pointer :: mask(:) ! grid mask - integer , intent(out) :: ni, nj ! global grid sizes - - ! local variables - logical :: isgrid2d - integer :: dimid,varid ! netCDF id's - integer :: ns ! size of grid on file - integer :: n,i,j ! index - integer :: ier ! error status - type(file_desc_t) :: ncid ! netcdf id - character(len=256) :: locfn ! local file name - logical :: readvar ! read variable in or not - integer , allocatable :: idata2d(:,:) - character(len=32) :: subname = 'surfrd_get_globmask' ! subroutine name - !----------------------------------------------------------------------- - - if (filename == ' ') then - mask(:) = 1 - else - ! Check if file exists - if (masterproc) then - if (filename == ' ') then - write(iulog,*) trim(subname),' ERROR: filename must be specified ' - call endrun(msg=errMsg(sourcefile, __LINE__)) - endif - end if - - ! Open file - call getfil( filename, locfn, 0 ) - call ncd_pio_openfile (ncid, trim(locfn), 0) - - ! Determine dimensions and if grid file is 2d or 1d - call ncd_inqfdims(ncid, isgrid2d, ni, nj, ns) - if (masterproc) then - write(iulog,*)'lat/lon grid flag (isgrid2d) is ',isgrid2d - end if - allocate(mask(ns)) - mask(:) = 1 - if (isgrid2d) then - ! Grid is 2d - allocate(idata2d(ni,nj)) - idata2d(:,:) = 1 - call ncd_io(ncid=ncid, varname='LANDMASK', data=idata2d, flag='read', readvar=readvar) - if (.not. readvar) then - call ncd_io(ncid=ncid, varname='mask', data=idata2d, flag='read', readvar=readvar) - end if - if (readvar) then - do j = 1,nj - do i = 1,ni - n = (j-1)*ni + i - mask(n) = idata2d(i,j) - enddo - enddo - end if - deallocate(idata2d) - else - ! Grid is not 2d - call ncd_io(ncid=ncid, varname='LANDMASK', data=mask, flag='read', readvar=readvar) - if (.not. readvar) then - call ncd_io(ncid=ncid, varname='mask', data=mask, flag='read', readvar=readvar) - end if - end if - if (.not. readvar) call endrun( msg=' ERROR: landmask not on fatmlndfrc file'//errMsg(sourcefile, __LINE__)) - - ! Close file - call ncd_pio_closefile(ncid) - end if - - end subroutine surfrd_get_globmask - - !----------------------------------------------------------------------- - subroutine surfrd_get_grid(begg, endg, ldomain, filename) - - ! Read the surface dataset grid related information: - ! This is called after the domain decomposition has been created - ! - real latitude of grid cell (degrees) - ! - real longitude of grid cell (degrees) - - use clm_varcon , only : spval, re, grlnd - use domainMod , only : domain_type, lon1d, lat1d, domain_init - use fileutils , only : getfil - use abortutils , only : endrun - use shr_log_mod , only : errMsg => shr_log_errMsg - use ncdio_pio , only : file_desc_t, ncd_pio_openfile, ncd_pio_closefile - use ncdio_pio , only : ncd_io, check_var, ncd_inqfdims, check_dim_size - use pio - - ! input/output variables - integer , intent(in) :: begg, endg - type(domain_type) , intent(inout) :: ldomain ! domain to init - character(len=*) , intent(in) :: filename ! grid filename - - ! local variables - type(file_desc_t) :: ncid ! netcdf id - integer :: beg ! local beg index - integer :: end ! local end index - integer :: ni,nj,ns ! size of grid on file - logical :: readvar ! true => variable is on input file - logical :: isgrid2d ! true => file is 2d lat/lon - logical :: istype_domain ! true => input file is of type domain - real(r8), allocatable :: rdata2d(:,:) ! temporary - character(len=16) :: vname ! temporary - character(len=256) :: locfn ! local file name - integer :: n ! indices - character(len=32) :: subname = 'surfrd_get_grid' ! subroutine name - !----------------------------------------------------------------------- - - if (masterproc) then - if (filename == ' ') then - write(iulog,*) trim(subname),' ERROR: filename must be specified ' - call endrun(msg=errMsg(sourcefile, __LINE__)) - endif - end if - - call getfil( filename, locfn, 0 ) - call ncd_pio_openfile (ncid, trim(locfn), 0) - - ! Determine dimensions - call ncd_inqfdims(ncid, isgrid2d, ni, nj, ns) - - ! Determine isgrid2d flag for domain - call domain_init(ldomain, isgrid2d=isgrid2d, ni=ni, nj=nj, nbeg=begg, nend=endg) - - ! Determine type of file - old style grid file or new style domain file - call check_var(ncid=ncid, varname='xc', readvar=readvar) - if (readvar)then - istype_domain = .true. - else - istype_domain = .false. - end if - - ! Read in area, lon, lat - if (istype_domain) then - call ncd_io(ncid=ncid, varname= 'area', flag='read', data=ldomain%area, & - dim1name=grlnd, readvar=readvar) - ! convert from radians**2 to km**2 - ldomain%area = ldomain%area * (re**2) - if (.not. readvar) call endrun( msg=' ERROR: area NOT on file'//errMsg(sourcefile, __LINE__)) - call ncd_io(ncid=ncid, varname= 'xc', flag='read', data=ldomain%lonc, & - dim1name=grlnd, readvar=readvar) - if (.not. readvar) call endrun( msg=' ERROR: xc NOT on file'//errMsg(sourcefile, __LINE__)) - call ncd_io(ncid=ncid, varname= 'yc', flag='read', data=ldomain%latc, & - dim1name=grlnd, readvar=readvar) - if (.not. readvar) call endrun( msg=' ERROR: yc NOT on file'//errMsg(sourcefile, __LINE__)) - else - call endrun( msg=" ERROR: can no longer read non domain files" ) - end if - - if (isgrid2d) then - allocate(rdata2d(ni,nj), lon1d(ni), lat1d(nj)) - if (istype_domain) vname = 'xc' - call ncd_io(ncid=ncid, varname=trim(vname), data=rdata2d, flag='read', readvar=readvar) - lon1d(:) = rdata2d(:,1) - if (istype_domain) vname = 'yc' - call ncd_io(ncid=ncid, varname=trim(vname), data=rdata2d, flag='read', readvar=readvar) - lat1d(:) = rdata2d(1,:) - deallocate(rdata2d) - end if - - ! Check lat limited to -90,90 - if (minval(ldomain%latc) < -90.0_r8 .or. & - maxval(ldomain%latc) > 90.0_r8) then - write(iulog,*) trim(subname),' WARNING: lat/lon min/max is ', & - minval(ldomain%latc),maxval(ldomain%latc) - endif - if ( any(ldomain%lonc < 0.0_r8) )then - call endrun( msg=' ERROR: lonc is negative (see https://github.com/ESCOMP/ctsm/issues/507)' & - //errMsg(sourcefile, __LINE__)) - endif - call ncd_io(ncid=ncid, varname='mask', flag='read', data=ldomain%mask, & - dim1name=grlnd, readvar=readvar) - if (.not. readvar) then - call endrun( msg=' ERROR: LANDMASK NOT on fracdata file'//errMsg(sourcefile, __LINE__)) - end if - call ncd_io(ncid=ncid, varname='frac', flag='read', data=ldomain%frac, & - dim1name=grlnd, readvar=readvar) - if (.not. readvar) then - call endrun( msg=' ERROR: LANDFRAC NOT on fracdata file'//errMsg(sourcefile, __LINE__)) - end if - - call ncd_pio_closefile(ncid) - - end subroutine surfrd_get_grid - - !------------------------------------------------------------------------------ - subroutine decompInit_lnd3D(lni,lnj,lnk) - ! - ! !DESCRIPTION: - ! Create a 3D decomposition gsmap for the global 2D grid with soil levels - ! as the 3rd dimesnion. - ! - ! !USES: - use decompMod, only : gindex_global, bounds_type, get_proc_bounds - use spmdMod , only : comp_id, mpicom - use mct_mod , only : mct_gsmap_init - ! - ! !ARGUMENTS: - integer , intent(in) :: lni,lnj,lnk ! domain global size - ! - ! !LOCAL VARIABLES: - integer :: m,n,k ! indices - integer :: begg,endg,lsize,gsize ! used for gsmap init - integer :: begg3d,endg3d - integer, pointer :: gindex(:) ! global index for gsmap init - type(bounds_type) :: bounds - !------------------------------------------------------------------------------ - - ! Initialize gsmap_lnd2dsoi_gdc2glo - call get_proc_bounds(bounds) - begg = bounds%begg; endg=bounds%endg - - begg3d = (begg-1)*lnk + 1 - endg3d = endg*lnk - lsize = (endg3d - begg3d + 1 ) - allocate(gindex(begg3d:endg3d)) - do k = 1, lnk - do n = begg,endg - m = (begg-1)*lnk + (k-1)*(endg-begg+1) + (n-begg+1) - gindex(m) = gindex_global(n-begg+1) + (k-1)*(lni*lnj) - enddo - enddo - gsize = lni * lnj * lnk - call mct_gsMap_init(gsMap_lnd2Dsoi_gdc2glo, gindex, mpicom, comp_id, lsize, gsize) - - ! Diagnostic output - - if (masterproc) then - write(iulog,*)' 3D GSMap' - write(iulog,*)' longitude points = ',lni - write(iulog,*)' latitude points = ',lnj - write(iulog,*)' soil levels = ',lnk - write(iulog,*)' gsize = ',gsize - write(iulog,*)' lsize = ',lsize - write(iulog,*)' bounds(gindex) = ',size(gindex) - write(iulog,*) - end if - - deallocate(gindex) - - end subroutine decompInit_lnd3D - -end module lnd_set_decomp_and_domain diff --git a/src/cpl/mct/ndepStreamMod.F90 b/src/cpl/mct/ndepStreamMod.F90 deleted file mode 100644 index d26ff7c95e..0000000000 --- a/src/cpl/mct/ndepStreamMod.F90 +++ /dev/null @@ -1,376 +0,0 @@ -module ndepStreamMod - - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! Contains methods for reading in nitrogen deposition data file - ! Also includes functions for dynamic ndep file handling and - ! interpolation. - ! - ! !USES - use shr_kind_mod, only: r8 => shr_kind_r8, CL => shr_kind_cl - use shr_strdata_mod, only: shr_strdata_type, shr_strdata_create - use shr_strdata_mod, only: shr_strdata_print, shr_strdata_advance - use mct_mod , only: mct_ggrid - use spmdMod , only: mpicom, masterproc, comp_id, iam - use clm_varctl , only: iulog, inst_name - use abortutils , only: endrun - use decompMod , only: bounds_type - use domainMod , only: ldomain - - ! !PUBLIC TYPES: - implicit none - private - - ! !PUBLIC MEMBER FUNCTIONS: - public :: ndep_init ! position datasets for dynamic ndep - public :: ndep_interp ! interpolates between two years of ndep file data - public :: clm_domain_mct ! Sets up MCT domain for this resolution - - ! !PRIVATE MEMBER FUNCTIONS: - private :: check_units ! Check the units and make sure they can be used - - ! ! PRIVATE TYPES - type(shr_strdata_type) :: sdat ! input data stream - integer :: stream_year_first_ndep ! first year in stream to use - integer :: stream_year_last_ndep ! last year in stream to use - integer :: model_year_align_ndep ! align stream_year_firstndep with - logical :: divide_by_secs_per_yr = .true. ! divide by the number of seconds per year - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - !============================================================================== - -contains - - !============================================================================== - - subroutine ndep_init(bounds, NLFilename) - ! - ! Initialize data stream information. - ! - ! Uses: - use shr_kind_mod , only : CS => shr_kind_cs - use clm_time_manager , only : get_calendar - use ncdio_pio , only : pio_subsystem - use shr_pio_mod , only : shr_pio_getiotype - use shr_nl_mod , only : shr_nl_find_group_name - use shr_log_mod , only : errMsg => shr_log_errMsg - use shr_mpi_mod , only : shr_mpi_bcast - use lnd_set_decomp_and_domain , only : gsMap_lnd2Dsoi_gdc2glo, gsmap_global - ! - ! arguments - implicit none - type(bounds_type), intent(in) :: bounds - character(len=*), intent(in) :: NLFilename ! Namelist filename - ! - ! local variables - integer :: nu_nml ! unit for namelist file - integer :: nml_error ! namelist i/o error flag - type(mct_ggrid) :: dom_clm ! domain information - character(len=CL) :: stream_fldFileName_ndep - character(len=CL) :: ndepmapalgo = 'bilinear' - character(len=CL) :: ndep_tintalgo = 'linear' - character(len=CS) :: ndep_taxmode = 'extend' - character(len=CL) :: ndep_varlist = 'NDEP_year' - character(*), parameter :: shr_strdata_unset = 'NOT_SET' - character(*), parameter :: subName = "('ndepdyn_init')" - character(*), parameter :: F00 = "('(ndepdyn_init) ',4a)" - !----------------------------------------------------------------------- - - namelist /ndepdyn_nml/ & - stream_year_first_ndep, & - stream_year_last_ndep, & - model_year_align_ndep, & - ndepmapalgo, ndep_taxmode, & - ndep_varlist, & - stream_fldFileName_ndep, & - ndep_tintalgo - - ! Default values for namelist - stream_year_first_ndep = 1 ! first year in stream to use - stream_year_last_ndep = 1 ! last year in stream to use - model_year_align_ndep = 1 ! align stream_year_first_ndep with this model year - stream_fldFileName_ndep = ' ' - - ! Read ndepdyn_nml namelist - if (masterproc) then - open( newunit=nu_nml, file=trim(NLFilename), status='old', iostat=nml_error ) - call shr_nl_find_group_name(nu_nml, 'ndepdyn_nml', status=nml_error) - if (nml_error == 0) then - read(nu_nml, nml=ndepdyn_nml,iostat=nml_error) - if (nml_error /= 0) then - call endrun(msg=' ERROR reading ndepdyn_nml namelist'//errMsg(sourcefile, __LINE__)) - end if - else - call endrun(msg=' ERROR finding ndepdyn_nml namelist'//errMsg(sourcefile, __LINE__)) - end if - close(nu_nml) - endif - - call shr_mpi_bcast(stream_year_first_ndep , mpicom) - call shr_mpi_bcast(stream_year_last_ndep , mpicom) - call shr_mpi_bcast(model_year_align_ndep , mpicom) - call shr_mpi_bcast(stream_fldFileName_ndep, mpicom) - call shr_mpi_bcast(ndep_varlist , mpicom) - call shr_mpi_bcast(ndep_taxmode , mpicom) - call shr_mpi_bcast(ndep_tintalgo , mpicom) - - if (masterproc) then - write(iulog,*) ' ' - write(iulog,*) 'ndepdyn stream settings:' - write(iulog,*) ' stream_year_first_ndep = ',stream_year_first_ndep - write(iulog,*) ' stream_year_last_ndep = ',stream_year_last_ndep - write(iulog,*) ' model_year_align_ndep = ',model_year_align_ndep - write(iulog,*) ' stream_fldFileName_ndep = ',stream_fldFileName_ndep - write(iulog,*) ' ndep_varList = ',ndep_varList - write(iulog,*) ' ndep_taxmode = ',ndep_taxmode - write(iulog,*) ' ndep_tintalgo = ',ndep_tintalgo - write(iulog,*) ' ' - endif - ! Read in units - call check_units( stream_fldFileName_ndep, ndep_varList ) - - ! Set domain and create streams - call clm_domain_mct (bounds, dom_clm) - - call shr_strdata_create(sdat,name="clmndep", & - pio_subsystem=pio_subsystem, & - pio_iotype=shr_pio_getiotype(inst_name), & - mpicom=mpicom, compid=comp_id, & - gsmap=gsmap_global, ggrid=dom_clm, & - nxg=ldomain%ni, nyg=ldomain%nj, & - yearFirst=stream_year_first_ndep, & - yearLast=stream_year_last_ndep, & - yearAlign=model_year_align_ndep, & - offset=0, & - domFilePath='', & - domFileName=trim(stream_fldFileName_ndep), & - domTvarName='time', & - domXvarName='lon' , & - domYvarName='lat' , & - domAreaName='area', & - domMaskName='mask', & - filePath='', & - filename=(/trim(stream_fldFileName_ndep)/),& - fldListFile=ndep_varlist, & - fldListModel=ndep_varlist, & - fillalgo='none', & - mapalgo=ndepmapalgo, & - tintalgo=ndep_tintalgo, & - calendar=get_calendar(), & - taxmode=ndep_taxmode ) - - - if (masterproc) then - call shr_strdata_print(sdat,'CLMNDEP data') - endif - - end subroutine ndep_init - !================================================================ - - subroutine check_units( stream_fldFileName_ndep, ndep_varList ) - !------------------------------------------------------------------- - ! Check that units are correct on the file and if need any conversion - use ncdio_pio , only : ncd_pio_openfile, ncd_inqvid, ncd_getatt, ncd_pio_closefile, ncd_nowrite - use ncdio_pio , only : file_desc_t, var_desc_t - use shr_kind_mod , only : CS => shr_kind_cs - use shr_log_mod , only : errMsg => shr_log_errMsg - use shr_string_mod, only : shr_string_listGetName - implicit none - - !----------------------------------------------------------------------- - ! - ! Arguments - character(len=*), intent(IN) :: stream_fldFileName_ndep ! ndep filename - character(len=*), intent(IN) :: ndep_varList ! ndep variable list to examine - ! - ! Local variables - type(file_desc_t) :: ncid ! NetCDF filehandle for ndep file - type(var_desc_t) :: vardesc ! variable descriptor - integer :: varid ! variable index - logical :: readvar ! If variable was read - character(len=CS) :: ndepunits! ndep units - character(len=CS) :: fname ! ndep field name - !----------------------------------------------------------------------- - call ncd_pio_openfile( ncid, trim(stream_fldFileName_ndep), ncd_nowrite ) - call shr_string_listGetName( ndep_varList, 1, fname ) - call ncd_inqvid( ncid, fname, varid, vardesc, readvar=readvar ) - if ( readvar ) then - call ncd_getatt( ncid, varid, "units", ndepunits ) - else - call endrun(msg=' ERROR finding variable: '//trim(fname)//" in file: "// & - trim(stream_fldFileName_ndep)//errMsg(sourcefile, __LINE__)) - end if - call ncd_pio_closefile( ncid ) - - ! Now check to make sure they are correct - if ( trim(ndepunits) == "g(N)/m2/s" )then - divide_by_secs_per_yr = .false. - else if ( trim(ndepunits) == "g(N)/m2/yr" )then - divide_by_secs_per_yr = .true. - else - call endrun(msg=' ERROR in units for nitrogen deposition equal to: '//trim(ndepunits)//" not units expected"// & - errMsg(sourcefile, __LINE__)) - end if - - end subroutine check_units - - !================================================================ - subroutine ndep_interp(bounds, atm2lnd_inst) - - !----------------------------------------------------------------------- - use clm_time_manager, only : get_curr_date, get_curr_days_per_year - use clm_varcon , only : secspday - use atm2lndType , only : atm2lnd_type - ! - ! Arguments - type(bounds_type) , intent(in) :: bounds - type(atm2lnd_type), intent(inout) :: atm2lnd_inst - ! - ! Local variables - integer :: g, ig - 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 :: dayspyr ! days per year - !----------------------------------------------------------------------- - - call get_curr_date(year, mon, day, sec) - mcdate = year*10000 + mon*100 + day - - call shr_strdata_advance(sdat, mcdate, sec, mpicom, 'ndepdyn') - - if ( divide_by_secs_per_yr )then - ig = 0 - dayspyr = get_curr_days_per_year( ) - do g = bounds%begg,bounds%endg - ig = ig+1 - atm2lnd_inst%forc_ndep_grc(g) = sdat%avs(1)%rAttr(1,ig) / (secspday * dayspyr) - end do - else - ig = 0 - do g = bounds%begg,bounds%endg - ig = ig+1 - atm2lnd_inst%forc_ndep_grc(g) = sdat%avs(1)%rAttr(1,ig) - end do - end if - - end subroutine ndep_interp - - !============================================================================== - subroutine clm_domain_mct(bounds, dom_clm, nlevels) - - !------------------------------------------------------------------- - ! Set domain data type for internal clm grid - use clm_varcon , only : re - use domainMod , only : ldomain - use mct_mod , only : mct_ggrid, mct_gsMap_lsize, mct_gGrid_init - use mct_mod , only : mct_gsMap_orderedPoints, mct_gGrid_importIAttr - use mct_mod , only : mct_gGrid_importRAttr, mct_gsMap - use lnd_set_decomp_and_domain , only : gsMap_lnd2Dsoi_gdc2glo, gsmap_global - implicit none - ! - ! arguments - type(bounds_type), intent(in) :: bounds - type(mct_ggrid), intent(out) :: dom_clm ! Output domain information for land model - integer, intent(in), optional :: nlevels ! Number of levels if this is a 3D field - ! - ! local variables - integer :: g,i,j,k ! index - integer :: lsize ! land model domain data size - real(r8), pointer :: data(:) ! temporary - integer , pointer :: idata(:) ! temporary - integer :: nlevs ! Number of vertical levels - type(mct_gsMap), pointer :: gsmap => null() ! MCT GS map - !------------------------------------------------------------------- - ! SEt number of levels, and get the GS map for either the 2D or 3D grid - nlevs = 1 - if ( present(nlevels) ) nlevs = nlevels - if ( nlevs == 1 ) then - gsmap => gsmap_global - else - gsmap => gsMap_lnd2Dsoi_gdc2glo - end if - ! - ! Initialize mct domain type - ! lat/lon in degrees, area in radians^2, mask is 1 (land), 0 (non-land) - ! Note that in addition land carries around landfrac for the purposes of domain checking - ! - lsize = mct_gsMap_lsize(gsmap, mpicom) - call mct_gGrid_init( GGrid=dom_clm, & - CoordChars='lat:lon:hgt', OtherChars='area:aream:mask:frac', lsize=lsize ) - ! - ! Allocate memory - ! - allocate(data(lsize)) - ! - ! Determine global gridpoint number attribute, GlobGridNum, which is set automatically by MCT - ! - call mct_gsMap_orderedPoints(gsmap, iam, idata) - gsmap => null() - call mct_gGrid_importIAttr(dom_clm,'GlobGridNum',idata,lsize) - ! - ! Determine domain (numbering scheme is: West to East and South to North to South pole) - ! Initialize attribute vector with special value - ! - data(:) = -9999.0_R8 - call mct_gGrid_importRAttr(dom_clm,"lat" ,data,lsize) - call mct_gGrid_importRAttr(dom_clm,"lon" ,data,lsize) - call mct_gGrid_importRAttr(dom_clm,"area" ,data,lsize) - call mct_gGrid_importRAttr(dom_clm,"aream",data,lsize) - data(:) = 0.0_R8 - call mct_gGrid_importRAttr(dom_clm,"mask" ,data,lsize) - ! - ! Determine bounds - ! - ! Fill in correct values for domain components - ! Note aream will be filled in in the atm-lnd mapper - ! - do k = 1, nlevs - do g = bounds%begg,bounds%endg - i = 1 + (g - bounds%begg) - data(i) = ldomain%lonc(g) - end do - end do - call mct_gGrid_importRattr(dom_clm,"lon",data,lsize) - - do k = 1, nlevs - do g = bounds%begg,bounds%endg - i = 1 + (g - bounds%begg) - data(i) = ldomain%latc(g) - end do - end do - call mct_gGrid_importRattr(dom_clm,"lat",data,lsize) - - do k = 1, nlevs - do g = bounds%begg,bounds%endg - i = 1 + (g - bounds%begg) - data(i) = ldomain%area(g)/(re*re) - end do - end do - call mct_gGrid_importRattr(dom_clm,"area",data,lsize) - - do k = 1, nlevs - do g = bounds%begg,bounds%endg - i = 1 + (g - bounds%begg) - data(i) = real(ldomain%mask(g), r8) - end do - end do - call mct_gGrid_importRattr(dom_clm,"mask",data,lsize) - - do k = 1, nlevs - do g = bounds%begg,bounds%endg - i = 1 + (g - bounds%begg) - data(i) = real(ldomain%frac(g), r8) - end do - end do - call mct_gGrid_importRattr(dom_clm,"frac",data,lsize) - - deallocate(data) - deallocate(idata) - - end subroutine clm_domain_mct - -end module ndepStreamMod From 788f4996c12dda3873af80d9875c4a6feda340c9 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Fri, 10 May 2024 16:35:53 -0600 Subject: [PATCH 0229/1248] Remove a couple more references to MCT --- .../customizing-the-clm-configuration.rst | 2 +- src/main/clm_varctl.F90 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/source/users_guide/setting-up-and-running-a-case/customizing-the-clm-configuration.rst b/doc/source/users_guide/setting-up-and-running-a-case/customizing-the-clm-configuration.rst index f8b5fee002..e76a9cc6f0 100644 --- a/doc/source/users_guide/setting-up-and-running-a-case/customizing-the-clm-configuration.rst +++ b/doc/source/users_guide/setting-up-and-running-a-case/customizing-the-clm-configuration.rst @@ -638,7 +638,7 @@ The output to the above command is as follows: -vichydro Turn VIC hydrologic parameterizations : [on | off] (default is off) -crop Toggle for prognostic crop model. [on | off] (default is off) (can ONLY be turned on when BGC type is CN or CNDV) - -comp_intf Component interface to use (ESMF or MCT) (default MCT) + -comp_intf Component interface to use (default ESMF, currently no other option) -defaults Specify full path to a configuration file which will be used to supply defaults instead of the defaults in bld/config_files. This file is used to specify model configuration parameters only. diff --git a/src/main/clm_varctl.F90 b/src/main/clm_varctl.F90 index 7d0b2b55ad..0daedbbb1f 100644 --- a/src/main/clm_varctl.F90 +++ b/src/main/clm_varctl.F90 @@ -115,7 +115,7 @@ module clm_varctl character(len=fname_len), public :: fsnowaging = ' ' ! snow aging parameters file name character(len=fname_len), public :: fatmlndfrc = ' ' ! lnd frac file on atm grid - ! only needed for LILAC and MCT drivers + ! only needed for LILAC !---------------------------------------------------------- ! Flag to read ndep rather than obtain it from coupler From cc0e04dafe87cb878a8d3333c7a16d1b41a8c7e0 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Fri, 10 May 2024 17:21:55 -0600 Subject: [PATCH 0230/1248] Update ntests in build-namelist_test.pl --- 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 12a5f4bd38..ec370749bb 100755 --- a/bld/unit_testers/build-namelist_test.pl +++ b/bld/unit_testers/build-namelist_test.pl @@ -163,10 +163,10 @@ sub cat_and_create_namelistinfile { # # Figure out number of tests that will run # -my $ntests = 2513; +my $ntests = 2454; if ( defined($opts{'compare'}) ) { - $ntests += 1545; + $ntests += 1486; } plan( tests=>$ntests ); From 2b8c042973bd383d986c64dda73b11ab9350d2d7 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Fri, 10 May 2024 18:05:52 -0600 Subject: [PATCH 0231/1248] Fix the tests so expected fails, actually fail --- bld/unit_testers/build-namelist_test.pl | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/bld/unit_testers/build-namelist_test.pl b/bld/unit_testers/build-namelist_test.pl index 25545dcf8a..b0ddb1e448 100755 --- a/bld/unit_testers/build-namelist_test.pl +++ b/bld/unit_testers/build-namelist_test.pl @@ -1480,57 +1480,73 @@ sub cat_and_create_namelistinfile { atm_forc=>"GSWP3v1", res => "0.9x1.25", bgc => "bgc", + crop => "--no-crop", use_case => "1850_control", start_ymd => "18500101", + namelist => "irrigate=T", }, "f091850Clm45BgcCRU" =>{ phys =>"clm4_5", atm_forc=>"CRUv7", res => "0.9x1.25", bgc => "bgc", + crop => "--no-crop", use_case => "1850_control", start_ymd => "18500101", + namelist => "irrigate=T", }, "f091850Clm45BgcCAM6" =>{ phys =>"clm4_5", atm_forc=>"cam6.0", res => "0.9x1.25", bgc => "bgc", + crop => "--crop", use_case => "1850_control", start_ymd => "18500101", + namelist => "irrigate=F", }, "f091850Clm50BgcGSW" =>{ phys =>"clm5_0", atm_forc=>"GSWP3v1", res => "0.9x1.25", bgc => "bgc", + crop => "--crop", use_case => "1850_control", start_ymd => "18500101", + namelist => "irrigate=F", }, "f091850Clm50SpGSW" =>{ phys =>"clm5_0", atm_forc=>"GSWP3v1", res => "0.9x1.25", bgc => "sp", + crop => "--no-crop", use_case => "1850_control", start_ymd => "18500101", + namelist => "irrigate=T", }, "f091850Clm50BgcCRU" =>{ phys =>"clm5_0", atm_forc=>"CRUv7", res => "0.9x1.25", bgc => "bgc", + crop => "--crop", use_case => "1850_control", start_ymd => "18500101", + namelist => "irrigate=F", }, "f091850Clm50SpCRU" =>{ phys =>"clm5_0", atm_forc=>"CRUv7", res => "0.9x1.25", bgc => "sp", + crop => "--no-crop", use_case => "1850_control", start_ymd => "18500101", + namelist => "irrigate=T", }, "f091850Clm50BgcCAM6" =>{ phys =>"clm5_0", atm_forc=>"cam6.0", res => "0.9x1.25", bgc => "bgc", + crop => "--crop", use_case => "1850_control", start_ymd => "18500101", + namelist => "irrigate=F", }, ); @@ -1542,9 +1558,12 @@ sub cat_and_create_namelistinfile { my $usecase = $finidat_files{$key}{'use_case'}; my $bgc = $finidat_files{$key}{'bgc'}; my $res = $finidat_files{$key}{'res'}; + my $crop = $finidat_files{$key}{'crop'}; + my $namelist = $finidat_files{$key}{'namelist'}; my $start_ymd = $finidat_files{$key}{'start_ymd'}; my $lnd_tuning_mode = "${phys}_" . $finidat_files{$key}{'atm_forc'}; - $options = "-bgc $bgc -res $res -use_case $usecase -envxml_dir . --lnd_tuning_mode $lnd_tuning_mode -namelist '&a start_ymd=$start_ymd/'"; + $options = "-bgc $bgc -res $res -use_case $usecase -envxml_dir . $crop --lnd_tuning_mode $lnd_tuning_mode " . + "-namelist '&a start_ymd=$start_ymd, $namelist/'"; &make_env_run(); eval{ system( "$bldnml $options > $tempfile 2>&1 " ); }; is( $@, '', "options: $options" ); @@ -1552,7 +1571,7 @@ sub cat_and_create_namelistinfile { if ( $finidat =~ /initdata_map/ ) { my $result; eval( $result = `grep use_init_interp lnd_in` ); - isnt( $#, 0, "use_init_interp needs to be set here and was not: $result") + is ( $result =~ /.true./, 1, "use_init_interp needs to be true here: $result"); } $cfiles->checkfilesexist( "$options", $mode ); $cfiles->shownmldiff( "default", "standard" ); From 8c109657651315ff83b98561108c6ac71a7f6b29 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Fri, 10 May 2024 21:05:33 -0600 Subject: [PATCH 0232/1248] Set use_init_interp=T for finidat files that are older than ctsm5.2 --- bld/namelist_files/namelist_defaults_ctsm.xml | 70 +++++++++---------- 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index 6f2f265da4..c99700289e 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -970,21 +970,21 @@ attributes from the config_cache.xml file (with keys converted to upper-case). lnd/clm2/initdata_map/clmi.I1850Clm45BgcGs.0901-01-01.0.9x1.25_gx1v7_simyr1850_c200806.nc lnd/clm2/initdata_map/clmi.I1850Clm45BgcCruGs.1101-01-01.0.9x1.25_gx1v7_simyr1850_c200806.nc lnd/clm2/initdata_map/clmi.B1850Clm45BgcGs.0161-01-01.0.9x1.25_gx1v7_simyr1850_c200806.nc @@ -992,7 +992,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). lnd/clm2/initdata_map/clmi.I1850Clm50Sp.0181-01-01.0.9x1.25_gx1v7_simyr1850_c200806.nc @@ -1016,14 +1016,14 @@ attributes from the config_cache.xml file (with keys converted to upper-case). lnd/clm2/initdata_map/clmi.B1850Clm50BgcCrop.0161-01-01.0.9x1.25_gx1v7_simyr1850_c200729.nc lnd/clm2/initdata_map/clmi.I1850Clm50SpCru.1706-01-01.0.9x1.25_gx1v7_simyr1850_c200806.nc @@ -1031,7 +1031,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). lnd/clm2/initdata_map/clmi.I1850Clm50Sp.0181-01-01.0.9x1.25_gx1v7_simyr1850_c200806.nc lnd/clm2/initdata_map/clmi.B1850Clm50BgcCrop.0161-01-01.0.9x1.25_gx1v7_simyr1850_c200729.nc @@ -1053,7 +1053,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). lnd/clm2/initdata_map/clmi.I1850Clm50Sp.0181-01-01.0.9x1.25_gx1v7_simyr1850_c200806.nc lnd/clm2/initdata_map/clmi.B1850Clm50BgcCrop.0161-01-01.0.9x1.25_gx1v7_simyr1850_c200729.nc @@ -1125,7 +1125,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). lnd/clm2/initdata_map/clmi.BHIST.2000-01-01.0.9x1.25_gx1v7_simyr1979_c200806.nc @@ -1136,14 +1136,14 @@ attributes from the config_cache.xml file (with keys converted to upper-case). lnd/clm2/initdata_map/clmi.BHIST.2000-01-01.0.9x1.25_gx1v7_simyr1979_c200806.nc lnd/clm2/initdata_map/clmi.BHIST.2000-01-01.1.9x2.5_gx1v7_simyr1979_c200806.nc @@ -1151,7 +1151,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). lnd/clm2/initdata_map/clmi.FHISTSp.1979-01-01.ARCTIC_ne30x4_mt12_simyr1979_c200806.nc @@ -1159,7 +1159,7 @@ 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 @@ -1167,7 +1167,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). lnd/clm2/initdata_map/clmi.F2000.2000-01-01.ne120pg3_mt13_simyr2000_c200728.nc @@ -1175,7 +1175,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). lnd/clm2/initdata_map/clmi.BHIST.2000-01-01.0.9x1.25_gx1v7_simyr2000_c200728.nc @@ -1197,7 +1197,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). lnd/clm2/initdata_map/clmi.BHISTSp.2000-01-01.1.9x2.5_gx1v7_simyr2003_c200807.nc @@ -1206,21 +1206,21 @@ attributes from the config_cache.xml file (with keys converted to upper-case). lnd/clm2/initdata_map/clmi.FHISTSp.2013-01-01.ne0CONUSne30x8_mt12_simyr2013_c200806.nc lnd/clm2/initdata_map/clmi.BHIST.2000-01-01.0.9x1.25_gx1v7_simyr1979_c200806.nc lnd/clm2/initdata_map/clmi.BHIST.2000-01-01.1.9x2.5_gx1v7_simyr1979_c200806.nc @@ -1228,7 +1228,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). lnd/clm2/initdata_map/clmi.FHISTSp.1979-01-01.ARCTIC_ne30x4_mt12_simyr1979_c200806.nc @@ -1236,7 +1236,7 @@ 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 @@ -1244,7 +1244,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). lnd/clm2/initdata_map/clmi.F2000.2000-01-01.ne120pg3_mt13_simyr2000_c200728.nc @@ -1252,7 +1252,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). lnd/clm2/initdata_map/clmi.BHIST.2000-01-01.0.9x1.25_gx1v7_simyr2000_c200728.nc @@ -1260,7 +1260,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). lnd/clm2/initdata_map/clmi.BHISTSp.2000-01-01.1.9x2.5_gx1v7_simyr2003_c200807.nc @@ -1269,21 +1269,21 @@ attributes from the config_cache.xml file (with keys converted to upper-case). lnd/clm2/initdata_map/clmi.FHISTSp.2013-01-01.ne0CONUSne30x8_mt12_simyr2013_c200806.nc lnd/clm2/initdata_map/clmi.BHIST.2000-01-01.0.9x1.25_gx1v7_simyr1979_c200806.nc lnd/clm2/initdata_map/clmi.BHIST.2000-01-01.1.9x2.5_gx1v7_simyr1979_c200806.nc @@ -1291,7 +1291,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). lnd/clm2/initdata_map/clmi.FHISTSp.1979-01-01.ARCTIC_ne30x4_mt12_simyr1979_c200806.nc @@ -1299,7 +1299,7 @@ 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 @@ -1307,7 +1307,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). lnd/clm2/initdata_map/clmi.F2000.2000-01-01.ne120pg3_mt13_simyr2000_c200728.nc @@ -1315,7 +1315,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). lnd/clm2/initdata_map/clmi.BHIST.2000-01-01.0.9x1.25_gx1v7_simyr2000_c200728.nc @@ -1323,7 +1323,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). lnd/clm2/initdata_map/clmi.BHISTSp.2000-01-01.1.9x2.5_gx1v7_simyr2003_c200807.nc @@ -1332,7 +1332,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). lnd/clm2/initdata_map/clmi.FHISTSp.2013-01-01.ne0CONUSne30x8_mt12_simyr2013_c200806.nc From e14303f9ac6bb7a8f36dfebec2ab73d0a6e20151 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Sun, 12 May 2024 20:21:29 -0600 Subject: [PATCH 0233/1248] Fix irrigate for two use-cases so namelists all agree with the ctsm5.1.dev176 version --- bld/namelist_files/use_cases/2010_control.xml | 6 +++--- bld/namelist_files/use_cases/20thC_transient.xml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/bld/namelist_files/use_cases/2010_control.xml b/bld/namelist_files/use_cases/2010_control.xml index d16177301c..2f72624077 100644 --- a/bld/namelist_files/use_cases/2010_control.xml +++ b/bld/namelist_files/use_cases/2010_control.xml @@ -8,9 +8,9 @@ constant -.true. -.true. -.false. +.true. +.false. +.false. 2010 2010 diff --git a/bld/namelist_files/use_cases/20thC_transient.xml b/bld/namelist_files/use_cases/20thC_transient.xml index b88ca3d3b1..6cbf9e0d38 100644 --- a/bld/namelist_files/use_cases/20thC_transient.xml +++ b/bld/namelist_files/use_cases/20thC_transient.xml @@ -20,7 +20,7 @@ .true. .false. -.false. +.false. 1850 2015 From 9fa2841b8ed6ad0d0696969ee3ea9d4b5627aec7 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Mon, 13 May 2024 00:56:57 -0600 Subject: [PATCH 0234/1248] New finidat files for clm5_1/clm6_0 for 1850 Use ne30np4.pg3_gx1v7 BgcCrop GSWP3v1 finidat file for 1850 clm5_1 and clm6_0. --- bld/namelist_files/namelist_defaults_ctsm.xml | 57 ++++--------------- 1 file changed, 11 insertions(+), 46 deletions(-) diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index 40ba339d65..fff414d82e 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -758,34 +758,13 @@ 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=.false. glc_nec=10 do_transient_pfts=.false. - - -hgrid=0.9x1.25 maxpft=17 mask=gx1v7 use_cn=.false. use_crop=.false. irrigate=.true. glc_nec=10 do_transient_pfts=.false. + +hgrid=ne30np4.pg3 mask=gx1v7 use_cn=.true. use_crop=.true. irrigate=.false. lnd_tuning_mode=clm6_0_GSWP3v1 -hgrid=0.9x1.25 maxpft=79 mask=gx1v7 use_cn=.true. use_crop=.true. irrigate=.false. glc_nec=10 do_transient_pfts=.false. - - - -hgrid=0.9x1.25 maxpft=79 mask=gx1v7 use_cn=.true. use_crop=.true. irrigate=.false. glc_nec=10 do_transient_pfts=.false. - - - - -hgrid=0.9x1.25 maxpft=17 mask=gx1v7 use_cn=.false. use_crop=.false. irrigate=.true. glc_nec=10 do_transient_pfts=.false. - - -hgrid=0.9x1.25 maxpft=79 mask=gx1v7 use_cn=.true. use_crop=.true. irrigate=.false. glc_nec=10 do_transient_pfts=.false. - - - -hgrid=0.9x1.25 maxpft=79 mask=gx1v7 use_cn=.true. use_crop=.true. irrigate=.false. glc_nec=10 do_transient_pfts=.false. +hgrid=ne30np4.pg3 mask=gx1v7 use_cn=.true. use_crop=.true. irrigate=.false. lnd_tuning_mode=clm6_0_GSWP3v1 @@ -1049,26 +1028,12 @@ attributes from the config_cache.xml file (with keys converted to upper-case). >lnd/clm2/initdata_map/clmi.B1850Clm50BgcCrop.0161-01-01.0.9x1.25_gx1v7_simyr1850_c200729.nc - -lnd/clm2/initdata_map/clmi.I1850Clm50Sp.0181-01-01.0.9x1.25_gx1v7_simyr1850_c200806.nc - -lnd/clm2/initdata_esmf/ctsm5.2/clmi.I1850Clm50BgcCrop-ciso.1366-01-01.0.9x1.25_gx1v7_simyr1850_c240223.nc - - - -lnd/clm2/initdata_map/clmi.B1850Clm50BgcCrop.0161-01-01.0.9x1.25_gx1v7_simyr1850_c200729.nc + + +lnd/clm2/initdata_esmf/ctsm5.2/clmi.I1850Clm60BgcCrop-ciso.1361-01-01.ne30pg3_mg17_c240317.nc Date: Mon, 13 May 2024 02:44:47 -0600 Subject: [PATCH 0238/1248] Start on Change files --- doc/ChangeLog | 117 ++++++++++++++++++++++++++++++++++++++++++++++++++ doc/ChangeSum | 1 + 2 files changed, 118 insertions(+) diff --git a/doc/ChangeLog b/doc/ChangeLog index 3307c8df88..172c203e7f 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,4 +1,121 @@ =============================================================== +Tag name: ctsm5.2.005 +Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326) +Date: Mon 13 May 2024 02:44:33 AM MDT +One-line Summary: Fix clm6_0 defaults and CESM testing issues, add tests to detect these problems + +Purpose and description of changes +---------------------------------- + +Fix the clm6_0 defaults that were incorrect in ctsm5.2.0. The use-cases needed to be changed to handle clm6_0. +And clm6_0 wasn't handled in the merge of ctsm5.1.dev174 for the two new settings. Simplified the use-cases which +should help prevent these problems in the future. use_init_interp will be set for ctsm5.1 finidat files. + +Fix some testing. mksurfdata_esmf and the MKSUIRFDATA test didn't work in a CESM checkout. build-namelist unit tests +weren't going over the use-cases. Also started adding some tests to go over finidat files, but didn't yet capture all of them. +Add some scripts to compare namelists in order to detect namelist issues for physics +version updates, and more easily see namelist changes in one place (bld/unit_testers/cmp_baseline_lnd_in_files, +bld/unit_testers/compare_namelists). + +Add some tests to detect issues in CESM and CAM testing (add more tests for cam6.0 forcing, add new IHistClm60BgcCropG +compset). Add a NoAnthro compset to the ctsm_sci testing. Add I1850Clm60Sp test for f09 and f19 to ctsm_sci. + +Change NoAnthro compsets to use RTM rather than MOSART. Add science support to some clm6_0 compsets, as was obvious. + + +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_1 + +[ ] clm5_0 + +[ ] ctsm5_0-nwp + +[ ] clm4_5 + + +Bugs fixed +---------- + +List of CTSM issues fixed (include CTSM Issue # and description) [one per line]: + Fixes #2492 -- Fix clm6_0 defaults + Fixes #2504 -- build-namelist unit tests for use-cases + Fixes #2519 -- MKSURFDATAESMF for CESM checkout + Fixes #2520 -- B1850 compsets are failing + One tick box in #2403 (new initial conditions) + +Notes of particular relevance for users +--------------------------------------- + +Changes made to namelist defaults (e.g., changed parameter values): + Fixes: snow_thermal_cond_method, irrigate and snicar_snobc_intmix for clm6_0 + +Changes to the datasets (e.g., parameter, surface or initial files): + New initial conditions for clm5_1/clm6_0 for 1850 from ne30pg3_g17 GSWP3v1 forcing for BgcCrop with ciso + +Notes of particular relevance for developers: +--------------------------------------------- + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): + build-namelist unit tester started to add some finidat tests, but only some of them were added to the list + +Changes to tests or testing: Add some tests to detect the CESM test issues + + +Testing summary: regular ctsm_sci +---------------- + [PASS means all tests PASS; OK means tests PASS other than expected fails.] + + build-namelist tests (if CLMBuildNamelist.pm has changed): + + derecho - PASS (except + + python testing (if python code has changed; see instructions in python/README.md; document testing done): + + derecho - PASS (except + + regular tests (aux_clm: https://github.com/ESCOMP/CTSM/wiki/System-Testing-Guide#pre-merge-system-testing): + + derecho ----- OK + izumi ------- OK + + any other testing (give details below): + + ctsm_sci + derecho ---- OK + +If the tag used for baseline comparisons was NOT the previous tag, note that here: + + +Answer changes +-------------- + +Changes answers relative to baseline: Yes! + + Summarize any changes to answers, i.e., + - what code configurations: clm6_0 (some clm4_5 see below) + - what platforms/compilers: All + - nature of change (roundoff; larger than roundoff/same climate; new climate): + new climate so agrees with clm5_1 namelists, and fixes irrigate for clm4_5 + +Other details +------------- + +Pull Requests that document the changes (include PR ids): +(https://github.com/ESCOMP/ctsm/pull) + + #2501 -- Fix clm6_0 defaults + +=============================================================== +=============================================================== Tag name: ctsm5.2.004 Originator(s): slevis (Samuel Levis,UCAR/TSS,303-665-1310) Date: Thu 09 May 2024 03:10:52 PM MDT diff --git a/doc/ChangeSum b/doc/ChangeSum index 17ad670f17..0edccb3a18 100644 --- a/doc/ChangeSum +++ b/doc/ChangeSum @@ -1,5 +1,6 @@ Tag Who Date Summary ============================================================================================================================ + ctsm5.2.005 erik 05/13/2024 Fix clm6_0 defaults and CESM testing issues, add tests to detect these problems ctsm5.2.004 multiple 05/09/2024 CTSM5.2 1979 fsurdat and 1979-2026 landuse ne0np4 files + two fixes ctsm5.2.003 samrabin 05/02/2024 Merge b4b-dev ctsm5.2.002 glemieux 04/26/2024 FATES default allometry parameter file update From d66ddff54439bd192b9ed8b07419a17cd3282656 Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Mon, 13 May 2024 11:21:08 -0700 Subject: [PATCH 0239/1248] update fates_harvest_mode to use chars to set namelist options initial commit --- src/dyn_subgrid/dynFATESLandUseChangeMod.F90 | 10 ++++++---- src/main/clm_varctl.F90 | 2 +- src/main/controlMod.F90 | 2 +- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/dyn_subgrid/dynFATESLandUseChangeMod.F90 b/src/dyn_subgrid/dynFATESLandUseChangeMod.F90 index 4f326d82a5..d9bd0352ca 100644 --- a/src/dyn_subgrid/dynFATESLandUseChangeMod.F90 +++ b/src/dyn_subgrid/dynFATESLandUseChangeMod.F90 @@ -171,13 +171,14 @@ subroutine dynFatesLandUseInit(bounds, landuse_filename) end do ! Get the harvest rate data from the fates luh2 timeseries dataset if enabled - if (fates_harvest_mode .ge. fates_harvest_luh_area ) then + if (trim(fates_harvest_mode) .eq. fates_harvest_luh_area .or. & + trim(fates_harvest_mode) .eq. fates_harvest_luh_mass) then ! change the harvest varnames being used depending on the mode selected - if (fates_harvest_mode .eq. fates_harvest_luh_area ) then + if (trim(fates_harvest_mode) .eq. fates_harvest_luh_area ) then landuse_harvest_varnames => landuse_harvest_area_varnames landuse_harvest_units = landuse_harvest_area_units - elseif (fates_harvest_mode .eq. fates_harvest_luh_mass ) then + elseif (trim(fates_harvest_mode) .eq. fates_harvest_luh_mass ) then landuse_harvest_varnames => landuse_harvest_mass_varnames landuse_harvest_units = landuse_harvest_mass_units else @@ -256,7 +257,8 @@ subroutine dynFatesLandUseInterp(bounds, init_state) call landuse_state_vars(varnum)%get_current_data(this_data) landuse_states(varnum,bounds%begg:bounds%endg) = this_data(bounds%begg:bounds%endg) end do - if (fates_harvest_mode .ge. fates_harvest_luh_area ) then + if (trim(fates_harvest_mode) .eq. fates_harvest_luh_area .or. & + trim(fates_harvest_mode) .eq. fates_harvest_luh_mass) then do varnum = 1, num_landuse_harvest_vars call landuse_harvest_vars(varnum)%get_current_data(this_data) landuse_harvest(varnum,bounds%begg:bounds%endg) = this_data(bounds%begg:bounds%endg) diff --git a/src/main/clm_varctl.F90 b/src/main/clm_varctl.F90 index 64d6e15747..59b72c8e74 100644 --- a/src/main/clm_varctl.F90 +++ b/src/main/clm_varctl.F90 @@ -302,7 +302,7 @@ module clm_varctl ! > 1 for external data (lightning and/or anthropogenic ignitions) ! see bld/namelist_files/namelist_definition_clm4_5.xml for details logical, public :: use_fates_tree_damage = .false. ! true => turn on tree damage module - integer, public :: fates_harvest_mode = 0 ! 0 for no harvest/logging; 1-4 for harvest mode options + character(len=256), public :: fates_harvest_mode = '' ! five different harvest modes; see namelist definition logical, public :: use_fates_planthydro = .false. ! true => turn on fates hydro logical, public :: use_fates_cohort_age_tracking = .false. ! true => turn on cohort age tracking logical, public :: use_fates_ed_st3 = .false. ! true => static stand structure diff --git a/src/main/controlMod.F90 b/src/main/controlMod.F90 index 55dd92305d..1dd432bb7e 100644 --- a/src/main/controlMod.F90 +++ b/src/main/controlMod.F90 @@ -775,7 +775,7 @@ subroutine control_spmd() call mpi_bcast (for_testing_allow_interp_non_ciso_to_ciso, 1, MPI_LOGICAL, 0, mpicom, ier) call mpi_bcast (fates_spitfire_mode, 1, MPI_INTEGER, 0, mpicom, ier) - call mpi_bcast (fates_harvest_mode, 1, MPI_INTEGER, 0, mpicom, ier) + call mpi_bcast (fates_harvest_mode, len(fates_harvest_mode) , MPI_CHARACTER, 0, mpicom, ier) call mpi_bcast (use_fates_planthydro, 1, MPI_LOGICAL, 0, mpicom, ier) call mpi_bcast (use_fates_tree_damage, 1, MPI_LOGICAL, 0, mpicom, ier) call mpi_bcast (use_fates_cohort_age_tracking, 1, MPI_LOGICAL, 0, mpicom, ier) From a09d22376f704ea37c30b19e6978f6fa19a261bf Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Mon, 13 May 2024 13:44:35 -0600 Subject: [PATCH 0240/1248] Some tests were failing to find the 1850 finidat file, more changes to match how the finidat matching is done so that it now works --- bld/namelist_files/namelist_defaults_ctsm.xml | 25 ++++--------------- 1 file changed, 5 insertions(+), 20 deletions(-) diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index 59a0d9ee75..655e97c47c 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -760,11 +760,11 @@ attributes from the config_cache.xml file (with keys converted to upper-case). hgrid=ne30np4.pg3 mask=gx1v7 use_cn=.true. use_crop=.true. irrigate=.false. lnd_tuning_mode=clm6_0_GSWP3v1 +>hgrid=ne30np4.pg3 maxpft=79 mask=gx1v7 use_cn=.true. use_crop=.true. irrigate=.false. glc_nex=10 do_transient_pfts=.false. lnd_tuning_mode=clm6_0_GSWP3v1 hgrid=ne30np4.pg3 mask=gx1v7 use_cn=.true. use_crop=.true. irrigate=.false. lnd_tuning_mode=clm6_0_GSWP3v1 +>hgrid=ne30np4.pg3 maxpft=79 mask=gx1v7 use_cn=.true. use_crop=.true. irrigate=.false. glc_nex=10 do_transient_pfts=.false. lnd_tuning_mode=clm6_0_GSWP3v1 @@ -1006,27 +1006,12 @@ attributes from the config_cache.xml file (with keys converted to upper-case). >lnd/clm2/initdata_map/clmi.I1850Clm50SpCru.1706-01-01.0.9x1.25_gx1v7_simyr1850_c200806.nc - -lnd/clm2/initdata_map/clmi.I1850Clm50Sp.0181-01-01.0.9x1.25_gx1v7_simyr1850_c200806.nc - - - -lnd/clm2/initdata_map/clmi.B1850Clm50BgcCrop.0161-01-01.0.9x1.25_gx1v7_simyr1850_c200729.nc - - lnd/clm2/initdata_esmf/ctsm5.2/clmi.I1850Clm60BgcCrop-ciso.1361-01-01.ne30pg3_mg17_c240317.nc From 458c788eb6b7ca8b6351a5c3e4ebfae7d8364e21 Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Mon, 13 May 2024 15:07:05 -0700 Subject: [PATCH 0241/1248] add default pass values for logging and harvest --- src/utils/clmfates_interfaceMod.F90 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/utils/clmfates_interfaceMod.F90 b/src/utils/clmfates_interfaceMod.F90 index 5c23f1c1dc..ba6c59143f 100644 --- a/src/utils/clmfates_interfaceMod.F90 +++ b/src/utils/clmfates_interfaceMod.F90 @@ -511,6 +511,9 @@ subroutine CLMFatesGlobals2() call set_fates_ctrlparms('use_cohort_age_tracking',ival=pass_cohort_age_tracking) ! FATES logging and harvest modes + pass_logging = 0 + pass_lu_harvest = 0 + pass_num_lu_harvest_cats = 0 if (fates_harvest_mode > fates_harvest_no_logging) then pass_logging = 1 ! Time driven logging, without landuse harvest ! CLM landuse timeseries driven harvest rates @@ -522,9 +525,6 @@ subroutine CLMFatesGlobals2() else if (fates_harvest_mode >= fates_harvest_luh_area) then pass_lu_harvest = 1 pass_num_lu_harvest_cats = num_landuse_harvest_vars - else - pass_lu_harvest = 0 - pass_num_lu_harvest_cats = 0 end if end if From 9ecc1bc79a1dd66a138fd398872ef8fa55e09fbf Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Mon, 13 May 2024 16:10:43 -0600 Subject: [PATCH 0242/1248] Fix a resoplution name in a test --- cime_config/testdefs/testlist_clm.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index da38a4e27d..9cfba6f5b3 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -576,7 +576,7 @@ - + From 28f5bc36108af5281f3fdfd286b43bac5a849786 Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Mon, 13 May 2024 15:25:00 -0700 Subject: [PATCH 0243/1248] update fates_harvest_mode to accept strings --- bld/CLMBuildNamelist.pm | 4 +-- bld/namelist_files/namelist_defaults_ctsm.xml | 6 ++--- .../namelist_definition_ctsm.xml | 17 ++++++------ bld/unit_testers/build-namelist_test.pl | 6 ++--- .../clm/FatesColdLUH2Mode0/user_nl_clm | 2 +- .../clm/FatesColdLUH2Mode1/user_nl_clm | 2 +- .../clm/FatesColdLUH2Mode2/user_nl_clm | 2 +- .../clm/FatesColdLUH2Mode3/user_nl_clm | 2 +- .../clm/FatesColdLUH2Mode4/user_nl_clm | 2 +- src/dyn_subgrid/dynSubgridDriverMod.F90 | 2 +- src/utils/clmfates_interfaceMod.F90 | 27 ++++++++++--------- 11 files changed, 37 insertions(+), 35 deletions(-) diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index aafc7739a3..456447925c 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -4478,7 +4478,7 @@ sub setup_logic_fates { if ( ! &value_is_true($nl->get_value('use_fates_luh')) ) { $log->fatal_error("use_fates_luh must be true when $var is true" ); } - if ( $nl->get_value('fates_harvest_mode') > 0) { + if ( $nl->get_value('fates_harvest_mode') ne 'no_harvest') { $log->fatal_error("fates_harvest_mode must be off (i.e. set to zero) when $var is true" ); } } @@ -4487,7 +4487,7 @@ sub setup_logic_fates { my $var = "fates_harvest_mode"; if ( defined($nl->get_value($var)) ) { # using fates_harvest mode with raw luh2 harvest data - if ( $nl->get_value($var) > 2) { + if ( $nl->get_value($var) eq 'luhdata_area' || $nl->get_value($var) eq 'luhdata_mass' ) { # Make sure that use_fates_luh is true when using raw fates luh2 harvest data if ( ! &value_is_true($nl->get_value('use_fates_luh')) ) { $log->fatal_error("use_fates_luh is required to be true when $var is greater than 2" ); diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index 9d2a34b7bf..5da9cb22bf 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -2759,7 +2759,7 @@ use_crop=".true.">lnd/clm2/surfdata_map/ctsm5.1.dev052/landuse.timeseries_mpasa1 0 -0 +no_harvest .false. .false. .false. @@ -2769,8 +2769,8 @@ use_crop=".true.">lnd/clm2/surfdata_map/ctsm5.1.dev052/landuse.timeseries_mpasa1 .false. .false. .false. -.true. -.true. +.true. +.true. .true. .true. .false. diff --git a/bld/namelist_files/namelist_definition_ctsm.xml b/bld/namelist_files/namelist_definition_ctsm.xml index edcfa36d27..03b1e9e64d 100644 --- a/bld/namelist_files/namelist_definition_ctsm.xml +++ b/bld/namelist_files/namelist_definition_ctsm.xml @@ -735,14 +735,14 @@ Toggle to turn on FATES satellite phenology mode (only relevant if FATES is bein -Set FATES harvesting mode by setting fates_harvest_mode > 0. + group="clm_inparm" valid_values="no_harvest_event_code,surfdata_file,luhdata_area,luhdata_mass"> +Set FATES harvesting mode by setting fates_harvest_mode to a valid string option. Allowed values are: - 0 : no fates harvesting of any kind - 1 : fates logging via fates logging event codes (see fates parameter file) only - 2 : fates harvest driven by CLM landuse timeseries data (dynHarvestMod) - 3 : fates harvest driven by LUH2 raw harvest data, area-based (dynFATESLandUseChangeMod) - 4 : fates harvest driven by LUH2 raw harvest data, mass-based (dynFATESLandUseChangeMod) + no_harvest: no fates harvesting of any kind + event_code: fates logging via fates logging event codes (see fates parameter file) only + surfdata_file: fates harvest driven by CLM landuse timeseries data (dynHarvestMod) + luhdata_area: fates harvest driven by LUH2 raw harvest data, area-based (dynFATESLandUseChangeMod) + luhdata_mass: fates harvest driven by LUH2 raw harvest data, mass-based (dynFATESLandUseChangeMod) If TRUE, enable use of land use harmonization (LUH) state and transition data from luh_timeseries file. -This is enabled by default if fates_harvest_mode is set to use the raw LUH2 harvest -data (fates_harvest_mode >= 3) +This is enabled by default if fates_harvest_mode is set to use the raw LUH2 harvest data (Also, only valid for use_fates = true and is incompatible with transient runs currently.) diff --git a/bld/unit_testers/build-namelist_test.pl b/bld/unit_testers/build-namelist_test.pl index f674849b6f..973fdffd16 100755 --- a/bld/unit_testers/build-namelist_test.pl +++ b/bld/unit_testers/build-namelist_test.pl @@ -1047,7 +1047,7 @@ sub cat_and_create_namelistinfile { phys=>"clm4_5", }, "useloggingButNOTFATES" =>{ options=>"-envxml_dir . -no-megan", - namelst=>"fates_harvest_mode=1", + namelst=>"fates_harvest_mode=event_code", GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm4_5", }, @@ -1102,12 +1102,12 @@ sub cat_and_create_namelistinfile { phys=>"clm5_0", }, "useFATESPOTVEGwithHARVEST" =>{ options=>"-bgc fates -envxml_dir . -no-megan", - namelst=>"use_fates_potentialveg=T,fates_harvest_mode=1", + namelst=>"use_fates_potentialveg=T,fates_harvest_mode=event_code", GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm5_0", }, "useFATESHARVEST3WOLUH" =>{ options=>"-bgc fates -envxml_dir . -no-megan", - namelst=>"use_fates_luh=F,fates_harvest_mode=3", + namelst=>"use_fates_luh=F,fates_harvest_mode=luhdata_area", GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm5_0", }, diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2Mode0/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2Mode0/user_nl_clm index 929a8e6e14..b3b338e232 100644 --- a/cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2Mode0/user_nl_clm +++ b/cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2Mode0/user_nl_clm @@ -1 +1 @@ -fates_harvest_mode = 0 +fates_harvest_mode = no_harvest diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2Mode1/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2Mode1/user_nl_clm index dea75b71e7..c0e1c476be 100644 --- a/cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2Mode1/user_nl_clm +++ b/cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2Mode1/user_nl_clm @@ -1 +1 @@ -fates_harvest_mode = 1 +fates_harvest_mode = event_code diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2Mode2/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2Mode2/user_nl_clm index fd4c74fe57..61e1daaa93 100644 --- a/cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2Mode2/user_nl_clm +++ b/cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2Mode2/user_nl_clm @@ -1 +1 @@ -fates_harvest_mode = 2 +fates_harvest_mode = surfdata_file diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2Mode3/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2Mode3/user_nl_clm index 3332e9e526..d760105e68 100644 --- a/cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2Mode3/user_nl_clm +++ b/cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2Mode3/user_nl_clm @@ -1 +1 @@ -fates_harvest_mode = 3 +fates_harvest_mode = luhdata_area diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2Mode4/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2Mode4/user_nl_clm index 13dae9efee..bb5f30f75d 100644 --- a/cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2Mode4/user_nl_clm +++ b/cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2Mode4/user_nl_clm @@ -1 +1 @@ -fates_harvest_mode = 4 +fates_harvest_mode = luhdata_mass diff --git a/src/dyn_subgrid/dynSubgridDriverMod.F90 b/src/dyn_subgrid/dynSubgridDriverMod.F90 index 162247a0ff..faef029b40 100644 --- a/src/dyn_subgrid/dynSubgridDriverMod.F90 +++ b/src/dyn_subgrid/dynSubgridDriverMod.F90 @@ -128,7 +128,7 @@ subroutine dynSubgrid_init(bounds_proc, glc_behavior, crop_inst) ! flanduse_timeseries file. However, this could theoretically be changed so that the ! harvest data were separated from the pftdyn data, allowing them to differ in the ! years over which they apply. - if (get_do_harvest() .or. fates_harvest_mode == fates_harvest_clmlanduse) then + if (get_do_harvest() .or. trim(fates_harvest_mode) == fates_harvest_clmlanduse) then call dynHarvest_init(bounds_proc, harvest_filename=get_flanduse_timeseries()) end if diff --git a/src/utils/clmfates_interfaceMod.F90 b/src/utils/clmfates_interfaceMod.F90 index ba6c59143f..4205802088 100644 --- a/src/utils/clmfates_interfaceMod.F90 +++ b/src/utils/clmfates_interfaceMod.F90 @@ -186,6 +186,7 @@ module CLMFatesInterfaceMod use dynFATESLandUseChangeMod, only : fates_harvest_no_logging use dynFATESLandUseChangeMod, only : fates_harvest_clmlanduse use dynFATESLandUseChangeMod, only : fates_harvest_luh_area + use dynFATESLandUseChangeMod, only : fates_harvest_luh_mass use dynFATESLandUseChangeMod, only : landuse_harvest use dynFATESLandUseChangeMod, only : landuse_harvest_units use dynFATESLandUseChangeMod, only : landuse_harvest_varnames @@ -514,20 +515,25 @@ subroutine CLMFatesGlobals2() pass_logging = 0 pass_lu_harvest = 0 pass_num_lu_harvest_cats = 0 - if (fates_harvest_mode > fates_harvest_no_logging) then + if (trim(fates_harvest_mode) /= fates_harvest_no_logging) then pass_logging = 1 ! Time driven logging, without landuse harvest ! CLM landuse timeseries driven harvest rates - if (fates_harvest_mode == fates_harvest_clmlanduse) then + if (trim(fates_harvest_mode) == fates_harvest_clmlanduse) then pass_num_lu_harvest_cats = num_harvest_inst pass_lu_harvest = 1 ! LUH2 landuse timeseries driven harvest rates - else if (fates_harvest_mode >= fates_harvest_luh_area) then + else if (trim(fates_harvest_mode)== fates_harvest_luh_area .or. & + trim(fates_harvest_mode)== fates_harvest_luh_mass) then pass_lu_harvest = 1 pass_num_lu_harvest_cats = num_landuse_harvest_vars end if end if + call set_fates_ctrlparms('use_lu_harvest',ival=pass_lu_harvest) + call set_fates_ctrlparms('num_lu_harvest_cats',ival=pass_num_lu_harvest_cats) + call set_fates_ctrlparms('use_logging',ival=pass_logging) + ! FATES landuse modes if(use_fates_luh) then pass_use_luh = 1 @@ -550,11 +556,6 @@ subroutine CLMFatesGlobals2() end if call set_fates_ctrlparms('use_fates_potentialveg',ival=pass_use_potentialveg) - ! Wait to set the harvest and logging variables after checking fates_harvest_modes - call set_fates_ctrlparms('use_lu_harvest',ival=pass_lu_harvest) - call set_fates_ctrlparms('num_lu_harvest_cats',ival=pass_num_lu_harvest_cats) - call set_fates_ctrlparms('use_logging',ival=pass_logging) - if(use_fates_inventory_init) then pass_inventory_init = 1 else @@ -979,7 +980,7 @@ subroutine dynamics_driv(this, nc, bounds_clump, & call GetAndSetTime ! Get harvest rates for CLM landuse timeseries driven rates - if (fates_harvest_mode == fates_harvest_clmlanduse) then + if (trim(fates_harvest_mode) == fates_harvest_clmlanduse) then call dynHarvest_interp_resolve_harvesttypes(bounds_clump, & harvest_rates=harvest_rates(begg:endg,1:num_harvest_inst), & after_start_of_harvest_ts=after_start_of_harvest_ts) @@ -1105,7 +1106,7 @@ subroutine dynamics_driv(this, nc, bounds_clump, & ! for now there is one veg column per gridcell, so store all harvest data in each site ! this will eventually change ! today's hlm harvest flag needs to be set no matter what - if (fates_harvest_mode == fates_harvest_clmlanduse) then + if (trim(fates_harvest_mode) == fates_harvest_clmlanduse) then if (after_start_of_harvest_ts) then this%fates(nc)%bc_in(s)%hlm_harvest_rates(1:num_harvest_inst) = harvest_rates(g,1:num_harvest_inst) else @@ -1124,7 +1125,8 @@ subroutine dynamics_driv(this, nc, bounds_clump, & call endrun(msg=errMsg(sourcefile, __LINE__)) end if - else if (fates_harvest_mode >= fates_harvest_luh_area) then + else if (trim(fates_harvest_mode) == fates_harvest_luh_area .or. & + trim(fates_harvest_mode) == fates_harvest_luh_mass) then this%fates(nc)%bc_in(s)%hlm_harvest_rates = landuse_harvest(:,g) this%fates(nc)%bc_in(s)%hlm_harvest_catnames = landuse_harvest_varnames this%fates(nc)%bc_in(s)%hlm_harvest_units = landuse_harvest_units @@ -2082,7 +2084,8 @@ subroutine init_coldstart(this, waterstatebulk_inst, waterdiagnosticbulk_inst, & this%fates(nc)%bc_in(s)%hlm_luh_transitions = landuse_transitions(:,g) this%fates(nc)%bc_in(s)%hlm_luh_transition_names = landuse_transition_varnames - if (fates_harvest_mode >= fates_harvest_luh_area ) then + if (trim(fates_harvest_mode) == fates_harvest_luh_area .or. & + trim(fates_harvest_mode) == fates_harvest_luh_mass) then this%fates(nc)%bc_in(s)%hlm_harvest_rates = landuse_harvest(:,g) this%fates(nc)%bc_in(s)%hlm_harvest_catnames = landuse_harvest_varnames this%fates(nc)%bc_in(s)%hlm_harvest_units = landuse_harvest_units From 8bf5f5abd69b4ccfe590b1b42ddebc1a91c8c2c1 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Mon, 13 May 2024 16:32:08 -0600 Subject: [PATCH 0244/1248] Add test to expected fails --- 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 8ee60cf4b8..9da502fd54 100644 --- a/cime_config/testdefs/ExpectedTestFails.xml +++ b/cime_config/testdefs/ExpectedTestFails.xml @@ -51,6 +51,13 @@ + + + FAIL + #2542 + + + FAIL From 672da6de229e5a1acb166adf33375d772615de44 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Mon, 13 May 2024 16:46:38 -0600 Subject: [PATCH 0245/1248] Update change log a bit --- doc/ChangeLog | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index 172c203e7f..de37d4934c 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,7 +1,7 @@ =============================================================== Tag name: ctsm5.2.005 Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326) -Date: Mon 13 May 2024 02:44:33 AM MDT +Date: Mon 13 May 2024 04:46:10 PM MDT One-line Summary: Fix clm6_0 defaults and CESM testing issues, add tests to detect these problems Purpose and description of changes @@ -76,11 +76,11 @@ Testing summary: regular ctsm_sci build-namelist tests (if CLMBuildNamelist.pm has changed): - derecho - PASS (except + derecho - PASS (737 compare different to baseline) python testing (if python code has changed; see instructions in python/README.md; document testing done): - derecho - PASS (except + derecho - PASS regular tests (aux_clm: https://github.com/ESCOMP/CTSM/wiki/System-Testing-Guide#pre-merge-system-testing): From 8aa0a708ca8751aa770ccc40a66fb962d26f5acc Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Fri, 26 Apr 2024 13:56:24 -0600 Subject: [PATCH 0246/1248] Update cmeps to the branch --- Externals.cfg | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Externals.cfg b/Externals.cfg index 185f412cab..1aa8991883 100644 --- a/Externals.cfg +++ b/Externals.cfg @@ -48,9 +48,12 @@ tag = cime6.0.217_httpsbranch03 required = True [cmeps] -tag = cmeps0.14.50 +#tag = cmeps0.14.50 +#branch = dust_emis_mod +hash = d79e34f67df825f9265bdaaf3091f8995d5df1a2 protocol = git -repo_url = https://github.com/ESCOMP/CMEPS.git +#repo_url = https://github.com/ESCOMP/CMEPS.git +repo_url = https://github.com/ekluzek/CMEPS.git local_path = components/cmeps required = True From 603d2677f85eff3a15a284ded3d89722371b81be Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Fri, 26 Apr 2024 15:02:04 -0600 Subject: [PATCH 0247/1248] Add shr_dust_emis_mod.F90 to the files needed for unit testing, fails, because ESMF is currently needed and not available --- src/CMakeLists.txt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 568b53cd15..9d2e6041b5 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -20,9 +20,11 @@ add_subdirectory(${CLM_ROOT}/share/src csm_share) add_subdirectory(${CLM_ROOT}/share/unit_test_stubs/util csm_share_stubs) add_subdirectory(${CLM_ROOT}/share/src/esmf_wrf_timemgr esmf_wrf_timemgr) -# Add the single file we need from CMEPS -set (drv_sources_needed - ${CLM_ROOT}/components/cmeps/cesm/nuopc_cap_share/glc_elevclass_mod.F90) +# 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 + ) # Add CLM source directories add_subdirectory(${CLM_ROOT}/src/utils clm_utils) From 0b48097c502c98521b8014171a2d4f3cdaa5dec2 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Mon, 29 Apr 2024 18:59:30 -0600 Subject: [PATCH 0248/1248] Start adding the unit testing for dust emission in cmeps --- Externals.cfg | 2 +- src/CMakeLists.txt | 4 ++ src/drv_test/CMakeLists.txt | 1 + .../shr_dust_emis_test/CMakeLists.txt | 3 ++ .../shr_dust_emis_test/test_shr_dust_emis.pf | 50 +++++++++++++++++++ 5 files changed, 59 insertions(+), 1 deletion(-) create mode 100644 src/drv_test/CMakeLists.txt create mode 100644 src/drv_test/shr_dust_emis_test/CMakeLists.txt create mode 100644 src/drv_test/shr_dust_emis_test/test_shr_dust_emis.pf diff --git a/Externals.cfg b/Externals.cfg index 1aa8991883..70c0bd6124 100644 --- a/Externals.cfg +++ b/Externals.cfg @@ -50,7 +50,7 @@ required = True [cmeps] #tag = cmeps0.14.50 #branch = dust_emis_mod -hash = d79e34f67df825f9265bdaaf3091f8995d5df1a2 +hash = 492faf0014ad9d91c22bb92e2570e558a76093fe protocol = git #repo_url = https://github.com/ESCOMP/CMEPS.git repo_url = https://github.com/ekluzek/CMEPS.git diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 9d2e6041b5..9388e65bc2 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -105,3 +105,7 @@ add_subdirectory(${CLM_ROOT}/src/dyn_subgrid/test clm_dyn_subgrid_test) add_subdirectory(${CLM_ROOT}/src/main/test clm_main_test) add_subdirectory(${CLM_ROOT}/src/init_interp/test clm_init_interp_test) add_subdirectory(${CLM_ROOT}/src/self_tests/test clm_self_tests_test) + +# Add driver unit test directories +add_subdirectory(${CLM_ROOT}/src/drv_test drv_test) + diff --git a/src/drv_test/CMakeLists.txt b/src/drv_test/CMakeLists.txt new file mode 100644 index 0000000000..adf66b8b92 --- /dev/null +++ b/src/drv_test/CMakeLists.txt @@ -0,0 +1 @@ +add_subdirectory(shr_dust_emis_test) diff --git a/src/drv_test/shr_dust_emis_test/CMakeLists.txt b/src/drv_test/shr_dust_emis_test/CMakeLists.txt new file mode 100644 index 0000000000..21fb9c8d47 --- /dev/null +++ b/src/drv_test/shr_dust_emis_test/CMakeLists.txt @@ -0,0 +1,3 @@ +add_pfunit_ctest(dust_emis + TEST_SOURCES "test_shr_dust_emis.pf" + LINK_LIBRARIES clm csm_share) diff --git a/src/drv_test/shr_dust_emis_test/test_shr_dust_emis.pf b/src/drv_test/shr_dust_emis_test/test_shr_dust_emis.pf new file mode 100644 index 0000000000..aa60427eac --- /dev/null +++ b/src/drv_test/shr_dust_emis_test/test_shr_dust_emis.pf @@ -0,0 +1,50 @@ +module test_shr_dust_emis + + ! Tests of shr_dust_emis_mod.F90 from CMEPS nuopc_cap_share + + use funit + use shr_dust_emis_mod, only : check_if_initialized + use unittestUtils, only : endrun_msg + + implicit none + + @TestCase + type, extends(TestCase) :: TestDustEmis + contains + procedure :: setUp + procedure :: tearDown + end type TestDustEmis + +contains + + ! ======================================================================== + ! Helper routines + ! ======================================================================== + + subroutine setUp(this) + class(TestDustEmis), intent(inout) :: this + end subroutine setUp + + subroutine tearDown(this) + class(TestDustEmis), intent(inout) :: this + + end subroutine tearDown + + + + ! ======================================================================== + ! Begin tests + ! ======================================================================== + + @Test + subroutine check_if_initialized_aborts(this) + ! Test that the check_if_initialized check aborts when called initially + class(TestDustEmis), intent(inout) :: this + + call check_if_initialized() + @assertExceptionRaised(endrun_msg('ERROR: dust emission namelist has NOT been read in yet, shr_dust_emis_mod is NOT initialized') ) + + end subroutine check_if_initialized_aborts + + +end module test_shr_dust_emis From d2d2da45ec2662c404424096b03a9b32debd9e01 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Tue, 30 Apr 2024 09:21:16 -0600 Subject: [PATCH 0249/1248] Change call to is_NOT_initialized function, unit test works --- src/drv_test/shr_dust_emis_test/test_shr_dust_emis.pf | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/drv_test/shr_dust_emis_test/test_shr_dust_emis.pf b/src/drv_test/shr_dust_emis_test/test_shr_dust_emis.pf index aa60427eac..a619618e1d 100644 --- a/src/drv_test/shr_dust_emis_test/test_shr_dust_emis.pf +++ b/src/drv_test/shr_dust_emis_test/test_shr_dust_emis.pf @@ -3,7 +3,7 @@ module test_shr_dust_emis ! Tests of shr_dust_emis_mod.F90 from CMEPS nuopc_cap_share use funit - use shr_dust_emis_mod, only : check_if_initialized + use shr_dust_emis_mod, only : is_NOT_initialized use unittestUtils, only : endrun_msg implicit none @@ -40,9 +40,11 @@ contains subroutine check_if_initialized_aborts(this) ! Test that the check_if_initialized check aborts when called initially class(TestDustEmis), intent(inout) :: this + logical :: not_init - call check_if_initialized() + not_init = is_NOT_initialized() @assertExceptionRaised(endrun_msg('ERROR: dust emission namelist has NOT been read in yet, shr_dust_emis_mod is NOT initialized') ) + @assertTrue(not_init) end subroutine check_if_initialized_aborts From 66578f0efd1f575b3adfe49bf1682e9c6fe703cb Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Tue, 30 Apr 2024 10:51:45 -0600 Subject: [PATCH 0250/1248] add a test that is expected to fail --- .../shr_dust_emis_test/test_shr_dust_emis.pf | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/drv_test/shr_dust_emis_test/test_shr_dust_emis.pf b/src/drv_test/shr_dust_emis_test/test_shr_dust_emis.pf index a619618e1d..646b3cfce1 100644 --- a/src/drv_test/shr_dust_emis_test/test_shr_dust_emis.pf +++ b/src/drv_test/shr_dust_emis_test/test_shr_dust_emis.pf @@ -3,8 +3,8 @@ module test_shr_dust_emis ! Tests of shr_dust_emis_mod.F90 from CMEPS nuopc_cap_share use funit - use shr_dust_emis_mod, only : is_NOT_initialized - use unittestUtils, only : endrun_msg + use shr_dust_emis_mod + use unittestUtils , only : endrun_msg implicit none @@ -48,5 +48,16 @@ contains end subroutine check_if_initialized_aborts + @Test + subroutine check_when_initialized_runs(this) + ! Test that the initializiation check runs when it is initialized + class(TestDustEmis), intent(inout) :: this + logical :: not_init + + call dust_emis_set_options( 'Zender_2003', 'lnd') + not_init = is_NOT_initialized() + @assertFalse(not_init) + + end subroutine check_when_initialized_runs end module test_shr_dust_emis From a6927691757bdb91dc4d911461446a4e0746c3aa Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Tue, 30 Apr 2024 11:10:03 -0600 Subject: [PATCH 0251/1248] Update cmeps version so will work --- Externals.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Externals.cfg b/Externals.cfg index 70c0bd6124..3753aac874 100644 --- a/Externals.cfg +++ b/Externals.cfg @@ -50,7 +50,7 @@ required = True [cmeps] #tag = cmeps0.14.50 #branch = dust_emis_mod -hash = 492faf0014ad9d91c22bb92e2570e558a76093fe +hash = ecb6d45aa00a4960564ea963b00754fb4c3b7d2c protocol = git #repo_url = https://github.com/ESCOMP/CMEPS.git repo_url = https://github.com/ekluzek/CMEPS.git From a65752d3d1abfc626631390c6b2378a5813e079f Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Tue, 30 Apr 2024 14:31:23 -0600 Subject: [PATCH 0252/1248] Add more tests that pass --- .../shr_dust_emis_test/test_shr_dust_emis.pf | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/src/drv_test/shr_dust_emis_test/test_shr_dust_emis.pf b/src/drv_test/shr_dust_emis_test/test_shr_dust_emis.pf index 646b3cfce1..efe6a5c2a8 100644 --- a/src/drv_test/shr_dust_emis_test/test_shr_dust_emis.pf +++ b/src/drv_test/shr_dust_emis_test/test_shr_dust_emis.pf @@ -60,4 +60,35 @@ contains end subroutine check_when_initialized_runs + @Test + subroutine check_dust_emis(this) + ! Test that the dust_emis logical functions work as expected + class(TestDustEmis), intent(inout) :: this + logical :: not_init + + call dust_emis_set_options( 'Zender_2003', 'lnd') + @assertTrue( is_dust_emis_zender() ) + @assertFalse( is_dust_emis_leung() ) + call dust_emis_set_options( 'Leung_2023', 'lnd') + @assertFalse( is_dust_emis_zender() ) + @assertTrue( is_dust_emis_leung() ) + + end subroutine check_dust_emis + + + @Test + subroutine check_zender_soil(this) + ! Test that the dust_emis_Zender logical functions work as expected + class(TestDustEmis), intent(inout) :: this + logical :: not_init + + call dust_emis_set_options( 'Zender_2003', 'lnd') + @assertTrue( is_zender_soil_erod_from_land() ) + @assertFalse( is_zender_soil_erod_from_atm() ) + call dust_emis_set_options( 'Zender_2003', 'atm') + @assertFalse( is_zender_soil_erod_from_land() ) + @assertTrue( is_zender_soil_erod_from_atm() ) + + end subroutine check_zender_soil + end module test_shr_dust_emis From dd73ca699a83c80f5d2dc36fb9fa7482b4eec5eb Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 1 May 2024 13:50:29 -0600 Subject: [PATCH 0253/1248] Add new tests and get working again --- .../shr_dust_emis_test/test_shr_dust_emis.pf | 22 ++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/src/drv_test/shr_dust_emis_test/test_shr_dust_emis.pf b/src/drv_test/shr_dust_emis_test/test_shr_dust_emis.pf index efe6a5c2a8..467d00de59 100644 --- a/src/drv_test/shr_dust_emis_test/test_shr_dust_emis.pf +++ b/src/drv_test/shr_dust_emis_test/test_shr_dust_emis.pf @@ -69,7 +69,7 @@ contains call dust_emis_set_options( 'Zender_2003', 'lnd') @assertTrue( is_dust_emis_zender() ) @assertFalse( is_dust_emis_leung() ) - call dust_emis_set_options( 'Leung_2023', 'lnd') + call dust_emis_set_options( 'Leung_2023', 'none') @assertFalse( is_dust_emis_zender() ) @assertTrue( is_dust_emis_leung() ) @@ -90,5 +90,25 @@ contains @assertTrue( is_zender_soil_erod_from_atm() ) end subroutine check_zender_soil + + + @Test + subroutine check_options(this) + ! Test that the check_options subroutine catches errors that should die + class(TestDustEmis), intent(inout) :: this + logical :: not_init + + call dust_emis_set_options( 'zztop', 'zztop') + @assertExceptionRaised(endrun_msg('(check_options_finish_init) ERROR: dust_emis_method namelist item is not valid')) + call dust_emis_set_options( 'Leung_2023', 'lnd') + @assertExceptionRaised(endrun_msg('(check_options_finish_init) ERROR: zender_soil_erod_source should NOT be set, when dust_emis_method=Leung_2023')) + call dust_emis_set_options( 'Leung_2023', 'atm') + @assertExceptionRaised(endrun_msg('(check_options_finish_init) ERROR: zender_soil_erod_source should NOT be set, when dust_emis_method=Leung_2023')) + call dust_emis_set_options( 'Zender_2003', 'none') + @assertExceptionRaised(endrun_msg('(check_options_finish_init) ERROR: zender_soil_erod_source can only be lnd or atm')) + call dust_emis_set_options( 'Zender_2003', 'zztop') + @assertExceptionRaised(endrun_msg('(check_options_finish_init) ERROR: zender_soil_erod_source can only be lnd or atm')) + + end subroutine check_options end module test_shr_dust_emis From ccd976af2ace8896eef72013d80ba3bccd8684af Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 1 May 2024 14:05:25 -0600 Subject: [PATCH 0254/1248] Update cmeps with unit-testing completed --- Externals.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Externals.cfg b/Externals.cfg index 3753aac874..39818b0fdc 100644 --- a/Externals.cfg +++ b/Externals.cfg @@ -50,7 +50,7 @@ required = True [cmeps] #tag = cmeps0.14.50 #branch = dust_emis_mod -hash = ecb6d45aa00a4960564ea963b00754fb4c3b7d2c +hash = 0285eeb59605df44bc3abf38a61e8436361e7e8c protocol = git #repo_url = https://github.com/ESCOMP/CMEPS.git repo_url = https://github.com/ekluzek/CMEPS.git From 65fc5536bd17b81f3b532ac764e15991b61a1e41 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Sat, 4 May 2024 11:08:24 -0600 Subject: [PATCH 0255/1248] Add LND_SETS_DUST_EMIS_DRV_FLDS which will be used to NOT set dust_emis drv_flds_in settings when CAM is going to set them --- cime_config/config_component.xml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/cime_config/config_component.xml b/cime_config/config_component.xml index f7adab268f..c474b7e0c1 100644 --- a/cime_config/config_component.xml +++ b/cime_config/config_component.xml @@ -162,6 +162,20 @@ This is typically set by the compset. + + logical + TRUE,FALSE + TRUE + + + + run_component_cpl + env_run.xml + If CTSM will set the dust settings in drv_flds_in (TRUE), or if ATM (i.e. CAM) will - DO NOT EDIT (set by compset name) + + char clm,nwp From d9c94eb04ebbf31ef4d5441d26eb59d360b2251d Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Sat, 4 May 2024 11:17:34 -0600 Subject: [PATCH 0256/1248] Move dust_emis and soil_erod namelist items to the drv_fld_in namelist file in CMEPS --- bld/CLMBuildNamelist.pm | 13 ++++++++----- bld/namelist_files/namelist_defaults_ctsm.xml | 2 -- bld/namelist_files/namelist_definition_ctsm.xml | 14 -------------- .../namelist_definition_drv_flds.xml | 13 +++++++++++++ bld/unit_testers/build-namelist_test.pl | 14 +++++++++++++- 5 files changed, 34 insertions(+), 22 deletions(-) diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index fb44023cd5..ce2c2a81d2 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -517,6 +517,7 @@ sub read_namelist_defaults { "$cfgdir/namelist_files/namelist_defaults_ctsm.xml", "$cfgdir/namelist_files/namelist_defaults_drv.xml", "$cfgdir/namelist_files/namelist_defaults_fire_emis.xml", + "$cfgdir/namelist_files/namelist_defaults_dust_emis.xml", "$cfgdir/namelist_files/namelist_defaults_drydep.xml" ); # Add the location of the use case defaults files to the options hash @@ -3988,7 +3989,7 @@ sub setup_logic_fire_emis { #------------------------------------------------------------------------------- sub setup_logic_dust_emis { - # Logic to handle the dust emissions + # Logic to handle the dust emissions namelists, both drv_flds_in and lnd_in files my ($opts, $nl_flags, $definition, $defaults, $nl) = @_; # First get the dust emission method @@ -4011,14 +4012,16 @@ sub setup_logic_dust_emis { 'dust_emis_method'=>$dust_emis_method, 'zender_soil_erod_source'=>$zender_source, 'hgrid'=>$nl_flags->{'res'}, 'lnd_tuning_mod'=>$nl_flags->{'lnd_tuning_mode'} ); } - } else { + } elsif ( $zender_source eq "atm" ) { foreach my $option ( @zender_files_in_lnd_opts ) { if ( defined($nl->get_value($option)) ) { - $log->fatal_error("zender_soil_erod_source is NOT lnd, but the file option $option is being set" . - " and should NOT be unless you want it handled here in the LAND model, " . + $log->fatal_error("zender_soil_erod_source is atm, and the file option $option is being set" . + " which should NOT be unless you want it handled here in the LAND model, " . "otherwise the equivalent option is set in CAM" ); } } + } elsif ( $zender_source eq "none" ) { + $log->fatal_error("zender_soil_erod_source is set to none and only atm or lnd should be used when $var is Zender_2002" ); } } else { # Verify that NONE of the Zender options are being set if Zender is NOT being used @@ -4736,7 +4739,7 @@ sub write_output_files { $log->verbose_message("Writing clm namelist to $outfile"); # Drydep, fire-emission or MEGAN namelist for driver - @groups = qw(drydep_inparm megan_emis_nl fire_emis_nl carma_inparm); + @groups = qw(drydep_inparm megan_emis_nl fire_emis_nl carma_inparm dust_emis_inparm); $outfile = "$opts->{'dir'}/drv_flds_in"; $nl->write($outfile, 'groups'=>\@groups, 'note'=>"$note" ); $log->verbose_message("Writing @groups namelists to $outfile"); diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index cc407961ff..b232c865cb 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -1993,8 +1993,6 @@ lnd/clm2/surfdata_esmf/NEON/surfdata_1x1_NEON_TOOL_hist_78pfts_CMIP6_simyr2000_c -Zender_2003 -atm bilinear lnd/clm2/dustemisdata/dst_source2x2tunedcam6-2x2-forCLM_cdf5_c230312.nc diff --git a/bld/namelist_files/namelist_definition_ctsm.xml b/bld/namelist_files/namelist_definition_ctsm.xml index 37c457141c..e730082e90 100644 --- a/bld/namelist_files/namelist_definition_ctsm.xml +++ b/bld/namelist_files/namelist_definition_ctsm.xml @@ -1612,20 +1612,6 @@ Mapping method from Nitrogen deposition input file to the model resolution - -Which dust emission method is going to be used. Either the Zender 2003 scheme or the Leung 2023 -scheme. -(NOTE: The Leung 2023 method is NOT currently available) - - - -Option only applying for the Zender_2003 method for whether the soil erodibility file is handled -here in CTSM, or in the ATM model. -(only used when dust_emis_method is Zender_2003) - - Option only applying for the Zender_2003 method for whether the soil erodibility file is handled diff --git a/bld/namelist_files/namelist_definition_drv_flds.xml b/bld/namelist_files/namelist_definition_drv_flds.xml index 088f5c5fa9..89bab07f4f 100644 --- a/bld/namelist_files/namelist_definition_drv_flds.xml +++ b/bld/namelist_files/namelist_definition_drv_flds.xml @@ -123,4 +123,17 @@ List of fluxes needed by the CARMA model, from CLM to CAM. + + Which dust emission method is going to be used. Either the Zender 2003 scheme or the Leung 2023 scheme. + (NOTE: The Leung 2023 method is NOT currently available) + + + + Option only applying for the Zender_2003 method for whether the soil erodibility file is handled + in the active LAND model or in the ATM model. + (only used when dust_emis_method is Zender_2003) + + diff --git a/bld/unit_testers/build-namelist_test.pl b/bld/unit_testers/build-namelist_test.pl index 7b654337af..114fb0c36c 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 = 2513; +my $ntests = 2515; if ( defined($opts{'compare'}) ) { $ntests += 1545; @@ -1255,6 +1255,18 @@ sub cat_and_create_namelistinfile { GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm5_1", }, + "soil_erod_none_w_Zender" =>{ options=>"--envxml_dir .", + namelst=>"dust_emis_method='Zender_2003', " . + "zender_soil_erod_source='none'", + GLC_TWO_WAY_COUPLING=>"FALSE", + phys=>"clm5_1", + }, + "soil_erod_bad_w_Zender" =>{ options=>"--envxml_dir .", + namelst=>"dust_emis_method='Zender_2003', " . + "zender_soil_erod_source='zztop'", + GLC_TWO_WAY_COUPLING=>"FALSE", + phys=>"clm5_1", + }, ); foreach my $key ( keys(%failtest) ) { print( "$key\n" ); From 0c23d08c2bad4677b70afe22640e2a8bb5f4543a Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Thu, 2 May 2024 14:26:53 -0600 Subject: [PATCH 0257/1248] Update ChangeLog and ChangeSum. --- doc/ChangeLog | 81 +++++++++++++++++++++++++++++++++++++++++++++++++++ doc/ChangeSum | 1 + 2 files changed, 82 insertions(+) diff --git a/doc/ChangeLog b/doc/ChangeLog index e5c2466085..e0a5e45cb6 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,4 +1,85 @@ =============================================================== +Tag name: ctsm5.2.003 +Originator(s): samrabin (Sam Rabin, UCAR/TSS, samrabin@ucar.edu) +Date: Thu May 2 14:06:54 MDT 2024 +One-line Summary: Merge b4b-dev + +Purpose and description of changes +---------------------------------- + +Brings in 4 PRs from b4b-dev to master: +- Regional CTSM Simulations and Capability of Creating Mesh Files (ESCOMP/CTSM#1892; Negin Sobhani and Adrianna Foster) +- Add line about documentation in PR template (ESCOMP/CTSM#2488; Sam Rabin) +- CTSM5.2 2000 fsurdat T42 64x128 file (ESCOMP/CTSM#2495; Sam Levis) +- Move plumber2 scripts to python directory (ESCOMP/CTSM#2505; Teagan King) + + +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_1 + +[ ] clm5_0 + +[ ] ctsm5_0-nwp + +[ ] clm4_5 + + +Bugs fixed +---------- + +List of CTSM issues fixed (include CTSM Issue # and description): +- Resolves ESCOMP/CTSM#1513: Need a process to subset ESMF mesh files from global ones for regional grids +- Resolves ESCOMP/CTSM#1773: High resolution regional simulations +- Resolves ESCOMP/CTSM#2187: Move new PLUMBER2 scripts to python directory to enable python testing +- Resolves ESCOMP/CTSM#2486: Temporarily add back a T42 dataset for CAM + + +Notes of particular relevance for users +--------------------------------------- + +Changes to documentation: +- Adds documentation for making mesh files + + +Notes of particular relevance for developers: +--------------------------------------------- + +Changes to tests or testing: +- Adds testing for mesh-making Python scripts +- Adds testing for plumber2_surf_wrapper + + +Testing summary: +---------------- + + regular tests (aux_clm: https://github.com/ESCOMP/CTSM/wiki/System-Testing-Guide#pre-merge-system-testing): + + derecho ----- OK + izumi ------- OK + + +Other details +------------- + +Pull Requests that document the changes (include PR ids): +- ESCOMP/CTSM#2513: Merge b4b-dev 2024-05-02 +- Constituent PRs: + - ESCOMP/CTSM#1892: Regional CTSM Simulations and Capability of Creating Mesh Files (https://github.com/ESCOMP/CTSM/pull/1892) + - ESCOMP/CTSM#2488: Add line about documentation in PR template (https://github.com/ESCOMP/CTSM/pull/2488) + - ESCOMP/CTSM#2495: CTSM5.2 2000 fsurdat T42 64x128 file (https://github.com/ESCOMP/CTSM/pull/2495) + - ESCOMP/CTSM#2505: Move plumber2 scripts to python directory (https://github.com/ESCOMP/CTSM/pull/2505) + +=============================================================== +=============================================================== Tag name: ctsm5.2.002 Originator(s): glemieux (Gregory Lemieux, LBNL, glemieux@lbl.gov) Date: Fri 26 Apr 2024 11:13:46 AM MDT diff --git a/doc/ChangeSum b/doc/ChangeSum index 40033a7d6f..b48e04889d 100644 --- a/doc/ChangeSum +++ b/doc/ChangeSum @@ -1,5 +1,6 @@ Tag Who Date Summary ============================================================================================================================ + ctsm5.2.003 samrabin 05/02/2024 Merge b4b-dev ctsm5.2.002 glemieux 04/26/2024 FATES default allometry parameter file update ctsm5.2.001 erik 04/22/2024 Merge b4b-dev ctsm5.2.0 many 04/20/2024 New mksurfdata_esmf tool to create new surface datasets that are in place From 747d104c156733f520008819359612c0b8b1dd83 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Tue, 7 May 2024 03:30:20 -0600 Subject: [PATCH 0258/1248] Start adding reference for LND_SETS_DUST_EMIS_DRV_FLDS in unit tester --- 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 114fb0c36c..30110d92f7 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", NEONSITE=>"" ); + my %env_vars = ( DIN_LOC_ROOT=>"MYDINLOCROOT", GLC_TWO_WAY_COUPLING=>"FALSE", LND_SETS_DUST_EMIS_DRV_FLDS=>"TRUE", NEONSITE=>"" ); # Set any settings that came in from function call foreach my $item ( keys(%settings) ) { $env_vars{$item} = $settings{$item}; From c36f3a9e6aa9e58f8ff05d4db7ee7349690841f5 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Tue, 7 May 2024 03:31:04 -0600 Subject: [PATCH 0259/1248] Add dust emis namelist default for drv_flds_in --- .../namelist_defaults_dust_emis.xml | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 bld/namelist_files/namelist_defaults_dust_emis.xml diff --git a/bld/namelist_files/namelist_defaults_dust_emis.xml b/bld/namelist_files/namelist_defaults_dust_emis.xml new file mode 100644 index 0000000000..40bf3d9078 --- /dev/null +++ b/bld/namelist_files/namelist_defaults_dust_emis.xml @@ -0,0 +1,21 @@ + + + + + + + + + +Zender_2003 + +atm + + From 8ab4063d65dff584758d054c05287e49a00d9130 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 15 May 2024 11:14:02 -0600 Subject: [PATCH 0260/1248] Git rebase didn't correct the change files for some reason, so going back to the b4b-dev version of those --- doc/ChangeLog | 81 --------------------------------------------------- doc/ChangeSum | 1 - 2 files changed, 82 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index e0a5e45cb6..e5c2466085 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,85 +1,4 @@ =============================================================== -Tag name: ctsm5.2.003 -Originator(s): samrabin (Sam Rabin, UCAR/TSS, samrabin@ucar.edu) -Date: Thu May 2 14:06:54 MDT 2024 -One-line Summary: Merge b4b-dev - -Purpose and description of changes ----------------------------------- - -Brings in 4 PRs from b4b-dev to master: -- Regional CTSM Simulations and Capability of Creating Mesh Files (ESCOMP/CTSM#1892; Negin Sobhani and Adrianna Foster) -- Add line about documentation in PR template (ESCOMP/CTSM#2488; Sam Rabin) -- CTSM5.2 2000 fsurdat T42 64x128 file (ESCOMP/CTSM#2495; Sam Levis) -- Move plumber2 scripts to python directory (ESCOMP/CTSM#2505; Teagan King) - - -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_1 - -[ ] clm5_0 - -[ ] ctsm5_0-nwp - -[ ] clm4_5 - - -Bugs fixed ----------- - -List of CTSM issues fixed (include CTSM Issue # and description): -- Resolves ESCOMP/CTSM#1513: Need a process to subset ESMF mesh files from global ones for regional grids -- Resolves ESCOMP/CTSM#1773: High resolution regional simulations -- Resolves ESCOMP/CTSM#2187: Move new PLUMBER2 scripts to python directory to enable python testing -- Resolves ESCOMP/CTSM#2486: Temporarily add back a T42 dataset for CAM - - -Notes of particular relevance for users ---------------------------------------- - -Changes to documentation: -- Adds documentation for making mesh files - - -Notes of particular relevance for developers: ---------------------------------------------- - -Changes to tests or testing: -- Adds testing for mesh-making Python scripts -- Adds testing for plumber2_surf_wrapper - - -Testing summary: ----------------- - - regular tests (aux_clm: https://github.com/ESCOMP/CTSM/wiki/System-Testing-Guide#pre-merge-system-testing): - - derecho ----- OK - izumi ------- OK - - -Other details -------------- - -Pull Requests that document the changes (include PR ids): -- ESCOMP/CTSM#2513: Merge b4b-dev 2024-05-02 -- Constituent PRs: - - ESCOMP/CTSM#1892: Regional CTSM Simulations and Capability of Creating Mesh Files (https://github.com/ESCOMP/CTSM/pull/1892) - - ESCOMP/CTSM#2488: Add line about documentation in PR template (https://github.com/ESCOMP/CTSM/pull/2488) - - ESCOMP/CTSM#2495: CTSM5.2 2000 fsurdat T42 64x128 file (https://github.com/ESCOMP/CTSM/pull/2495) - - ESCOMP/CTSM#2505: Move plumber2 scripts to python directory (https://github.com/ESCOMP/CTSM/pull/2505) - -=============================================================== -=============================================================== Tag name: ctsm5.2.002 Originator(s): glemieux (Gregory Lemieux, LBNL, glemieux@lbl.gov) Date: Fri 26 Apr 2024 11:13:46 AM MDT diff --git a/doc/ChangeSum b/doc/ChangeSum index b48e04889d..40033a7d6f 100644 --- a/doc/ChangeSum +++ b/doc/ChangeSum @@ -1,6 +1,5 @@ Tag Who Date Summary ============================================================================================================================ - ctsm5.2.003 samrabin 05/02/2024 Merge b4b-dev ctsm5.2.002 glemieux 04/26/2024 FATES default allometry parameter file update ctsm5.2.001 erik 04/22/2024 Merge b4b-dev ctsm5.2.0 many 04/20/2024 New mksurfdata_esmf tool to create new surface datasets that are in place From 4715afef8db5cade7e3a2835ee6044bd711b21e3 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Wed, 15 May 2024 14:33:34 -0600 Subject: [PATCH 0261/1248] Bring back src/unit_test_stubs/csm_share/CMakeLists.txt for FUNIT test --- src/unit_test_stubs/csm_share/CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 src/unit_test_stubs/csm_share/CMakeLists.txt diff --git a/src/unit_test_stubs/csm_share/CMakeLists.txt b/src/unit_test_stubs/csm_share/CMakeLists.txt new file mode 100644 index 0000000000..33ddbfb342 --- /dev/null +++ b/src/unit_test_stubs/csm_share/CMakeLists.txt @@ -0,0 +1,5 @@ +list(APPEND share_sources + shr_mpi_mod_stub.F90 + ) + +sourcelist_to_parent(share_sources) From f19a080721f5fffa96b580da51a170cbe80d4244 Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Wed, 15 May 2024 17:59:34 -0600 Subject: [PATCH 0262/1248] add more landuse graceful failures If luh + fbg are present fail if flandusepftdat isn't valid. Don't allow fluh_timeseries to be defined if in potential veg mode to avoid confusing users that it is needed. --- bld/CLMBuildNamelist.pm | 71 ++++++++++++++++++++++++----------------- 1 file changed, 42 insertions(+), 29 deletions(-) diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index aafc7739a3..0d8ca732b4 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -4433,21 +4433,9 @@ sub setup_logic_fates { } } # make sure that fates landuse x pft mode has the necessary run mode configurations - # and add the necessary landuse x pft static mapping data default if not defined my $var = "use_fates_lupft"; if ( defined($nl->get_value($var)) ) { if ( &value_is_true($nl->get_value($var)) ) { - $var = "flandusepftdat"; - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, $var, - 'phys'=>$nl_flags->{'phys'}, 'hgrid'=>$nl_flags->{'res'}, nofail=>1 ); - my $fname = remove_leading_and_trailing_quotes( $nl->get_value($var) ); - if ( ! defined($nl->get_value($var)) ) { - $log->fatal_error("$var is required when use_fates_lupft is set" ); - } elsif ( ! -f "$fname" ) { - $log->fatal_error("$fname does NOT point to a valid filename" ); - } - - # make sure that nocomp and fbg mode are enabled as well as use_fates_luh my @list = ( "use_fates_luh", "use_fates_nocomp", "use_fates_fixed_biogeog" ); foreach my $var ( @list ) { if ( ! &value_is_true($nl->get_value($var)) ) { @@ -4457,31 +4445,56 @@ sub setup_logic_fates { } } # check that fates landuse change mode has the necessary luh2 landuse timeseries data - # and add the default if not defined + # and add the default if not defined. Do not add default if use_fates_potentialveg is true. + # If fixed biogeography is on, make sure that flandusepftdat is avilable. my $var = "use_fates_luh"; if ( defined($nl->get_value($var)) ) { if ( &value_is_true($nl->get_value($var)) ) { - $var = "fluh_timeseries"; - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, $var, 'phys'=>$nl_flags->{'phys'}, 'hgrid'=>$nl_flags->{'res'}, 'sim_year_range'=>$nl_flags->{'sim_year_range'}, nofail=>1 ); - my $fname = remove_leading_and_trailing_quotes( $nl->get_value($var) ); - if ( ! defined($nl->get_value($var)) ) { - $log->fatal_error("$var is required when use_fates_luh is set" ); - } elsif ( ! -f "$fname" ) { - $log->fatal_error("$fname does NOT point to a valid filename" ); - } + $var = "use_fates_potentialveg"; + if ( defined($nl->get_value($var)) ) { + if ( ! &value_is_true($nl->get_value($var)) ) { + $var = "fluh_timeseries"; + add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, $var, 'phys'=>$nl_flags->{'phys'}, + 'hgrid'=>$nl_flags->{'res'}, 'sim_year_range'=>$nl_flags->{'sim_year_range'}, nofail=>1 ); + my $fname = remove_leading_and_trailing_quotes( $nl->get_value($var) ); + if ( ! defined($nl->get_value($var)) ) { + $log->fatal_error("$var is required when use_fates_luh is set and use_fates_potentialveg is false" ); + } elsif ( ! -f "$fname" ) { + $log->fatal_error("$var does NOT point to a valid filename" ); + } + } + } + $var = "use_fates_fixed_biogeog"; + if ( defined($nl->get_value($var)) ) { + if ( &value_is_true($nl->get_value($var)) ) { + $var = "flandusepftdat"; + add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, $var, + 'phys'=>$nl_flags->{'phys'}, 'hgrid'=>$nl_flags->{'res'}, nofail=>1 ); + my $fname = remove_leading_and_trailing_quotes( $nl->get_value($var) ); + if ( ! defined($nl->get_value($var)) ) { + $log->fatal_error("$var is required when use_fates_luh and use_fates_fixed_biogeog is set" ); + } elsif ( ! -f "$fname" ) { + $log->fatal_error("$var does NOT point to a valid filename" ); + } + } + } } } # check that fates landuse is on and harvest mode is off when potential veg switch is true my $var = "use_fates_potentialveg"; if ( defined($nl->get_value($var)) ) { - if ( &value_is_true($nl->get_value($var)) ) { - if ( ! &value_is_true($nl->get_value('use_fates_luh')) ) { - $log->fatal_error("use_fates_luh must be true when $var is true" ); - } - if ( $nl->get_value('fates_harvest_mode') > 0) { - $log->fatal_error("fates_harvest_mode must be off (i.e. set to zero) when $var is true" ); - } - } + if ( &value_is_true($nl->get_value($var)) ) { + if ( ! &value_is_true($nl->get_value('use_fates_luh')) ) { + $log->fatal_error("use_fates_luh must be true when $var is true" ); + } + if ( $nl->get_value('fates_harvest_mode') > 0) { + $log->fatal_error("fates_harvest_mode must be off (i.e. set to zero) when $var is true" ); + } + my $var = "fluh_timeseries"; + if ( defined($nl->get_value($var)) ) { + $log->fatal_error("fluh_timeseries can not be defined when use_fates_potentialveg is true" ); + } + } } # Check fates_harvest_mode compatibility my $var = "fates_harvest_mode"; From 39dc01e6f31f72246a5c3c781b5c83ab6e2a2598 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Thu, 16 May 2024 11:39:30 -0600 Subject: [PATCH 0263/1248] Revert "Remove the src/cpl/mct directory" This reverts commit 371f093e02a7820e8beec823c97dd23b94277c05. Jim Edwards posted the following in my PR: "although you can remove cpl7 you cannot yet remove mct. However I don't expect you to remove any externals in this tag, I will remove them in the next tag." --- src/cpl/mct/ExcessIceStreamType.F90 | 144 +++++ src/cpl/mct/FireDataBaseType.F90 | 561 +++++++++++++++++++ src/cpl/mct/SoilMoistureStreamMod.F90 | 418 ++++++++++++++ src/cpl/mct/UrbanTimeVarType.F90 | 314 +++++++++++ src/cpl/mct/ch4FInundatedStreamType.F90 | 389 +++++++++++++ src/cpl/mct/clm_cpl_indices.F90 | 330 +++++++++++ src/cpl/mct/laiStreamMod.F90 | 241 +++++++++ src/cpl/mct/lnd_comp_mct.F90 | 632 ++++++++++++++++++++++ src/cpl/mct/lnd_import_export.F90 | 354 ++++++++++++ src/cpl/mct/lnd_set_decomp_and_domain.F90 | 352 ++++++++++++ src/cpl/mct/ndepStreamMod.F90 | 376 +++++++++++++ 11 files changed, 4111 insertions(+) create mode 100644 src/cpl/mct/ExcessIceStreamType.F90 create mode 100644 src/cpl/mct/FireDataBaseType.F90 create mode 100644 src/cpl/mct/SoilMoistureStreamMod.F90 create mode 100644 src/cpl/mct/UrbanTimeVarType.F90 create mode 100644 src/cpl/mct/ch4FInundatedStreamType.F90 create mode 100644 src/cpl/mct/clm_cpl_indices.F90 create mode 100644 src/cpl/mct/laiStreamMod.F90 create mode 100644 src/cpl/mct/lnd_comp_mct.F90 create mode 100644 src/cpl/mct/lnd_import_export.F90 create mode 100644 src/cpl/mct/lnd_set_decomp_and_domain.F90 create mode 100644 src/cpl/mct/ndepStreamMod.F90 diff --git a/src/cpl/mct/ExcessIceStreamType.F90 b/src/cpl/mct/ExcessIceStreamType.F90 new file mode 100644 index 0000000000..5c5394233c --- /dev/null +++ b/src/cpl/mct/ExcessIceStreamType.F90 @@ -0,0 +1,144 @@ +module ExcessIceStreamType + + !----------------------------------------------------------------------- + ! !DESCRIPTION: + ! Stub for ExcessIceStreams for the MCT driver. So that MCT can be used + ! without excess ice streams. + ! + ! !USES + use shr_kind_mod , only : r8 => shr_kind_r8, CL => shr_kind_CL + use shr_log_mod , only : errMsg => shr_log_errMsg + use spmdMod , only : mpicom, masterproc + use clm_varctl , only : iulog + use abortutils , only : endrun + use decompMod , only : bounds_type + + ! !PUBLIC TYPES: + implicit none + private + + public :: UseExcessIceStreams ! If streams will be used + + type, public :: excessicestream_type + contains + + ! !PUBLIC MEMBER FUNCTIONS: + procedure, public :: Init ! Initialize and read data in + procedure, public :: CalcExcessIce ! Calculate excess ice ammount + + ! !PRIVATE MEMBER FUNCTIONS: + procedure, private :: ReadNML ! Read in namelist + + end type excessicestream_type + ! ! PRIVATE DATA: + + character(len=*), parameter, private :: sourcefile = & + __FILE__ + +!============================================================================== +contains +!============================================================================== + + subroutine Init(this, bounds, NLFilename) + ! + ! + ! arguments + implicit none + class(excessicestream_type) :: this + type(bounds_type), intent(in) :: bounds + character(len=*), intent(in) :: NLFilename ! Namelist filename + + ! + ! local variables + + call this%ReadNML( bounds, NLFileName ) + end subroutine Init + + subroutine CalcExcessIce(this,bounds,exice_bulk_init) + + ! only transfers grid values to columns + implicit none + class(excessicestream_type) :: this + type(bounds_type), intent(in) :: bounds + real(r8) , intent(inout) :: exice_bulk_init(bounds%begc:bounds%endc) + ! + ! !LOCAL VARIABLES: + + end subroutine CalcExcessIce + + logical function UseExcessIceStreams() + ! + ! !DESCRIPTION: + ! Return true if + ! + ! !USES: + ! + ! !ARGUMENTS: + implicit none + ! + ! !LOCAL VARIABLES: + UseExcessIceStreams = .false. +end function UseExcessIceStreams + +subroutine ReadNML(this, bounds, NLFilename) + ! + ! Read the namelist data stream information. + ! + ! Uses: + use shr_nl_mod , only : shr_nl_find_group_name + use shr_log_mod , only : errMsg => shr_log_errMsg + use shr_mpi_mod , only : shr_mpi_bcast + ! + ! arguments + implicit none + class(excessicestream_type) :: this + type(bounds_type), intent(in) :: bounds + character(len=*), intent(in) :: NLFilename ! Namelist filename + ! + ! local variables + integer :: nu_nml ! unit for namelist file + integer :: nml_error ! namelist i/o error flag + logical :: use_excess_ice_streams = .false. ! logical to turn on use of excess ice streams + character(len=CL) :: stream_fldFileName_exice = ' ' + character(len=CL) :: stream_mapalgo_exice = 'none' + character(len=*), parameter :: namelist_name = 'exice_streams' ! MUST agree with name in namelist and read + character(len=*), parameter :: subName = "('exice_streams::ReadNML')" + !----------------------------------------------------------------------- + + namelist /exice_streams/ & ! MUST agree with namelist_name above + stream_mapalgo_exice, stream_fldFileName_exice, use_excess_ice_streams + !----------------------------------------------------------------------- + ! Default values for namelist + + ! Read excess ice namelist + if (masterproc) then + open( newunit=nu_nml, file=trim(NLFilename), status='old', iostat=nml_error ) + call shr_nl_find_group_name(nu_nml, namelist_name, status=nml_error) + if (nml_error == 0) then + read(nu_nml, nml=exice_streams,iostat=nml_error) ! MUST agree with namelist_name above + if (nml_error /= 0) then + call endrun(msg=' ERROR reading '//namelist_name//' namelist'//errMsg(sourcefile, __LINE__)) + end if + else + call endrun(msg=' ERROR finding '//namelist_name//' namelist'//errMsg(sourcefile, __LINE__)) + end if + close(nu_nml) + endif + + call shr_mpi_bcast(use_excess_ice_streams , mpicom) + + if (masterproc) then + if ( use_excess_ice_streams ) then + call endrun(msg=' ERROR excess ice streams can NOT be on for the MCT driver'//errMsg(sourcefile, __LINE__)) + end if + if ( trim(stream_fldFileName_exice) /= '' ) then + call endrun(msg=' ERROR stream_fldFileName_exice can NOT be set for the MCT driver'//errMsg(sourcefile, __LINE__)) + end if + if ( trim(stream_mapalgo_exice) /= 'none' ) then + call endrun(msg=' ERROR stream_mapalgo_exice can only be none for the MCT driver'//errMsg(sourcefile, __LINE__)) + end if + endif + +end subroutine ReadNML + +end module ExcessIceStreamType diff --git a/src/cpl/mct/FireDataBaseType.F90 b/src/cpl/mct/FireDataBaseType.F90 new file mode 100644 index 0000000000..0ee635b2fa --- /dev/null +++ b/src/cpl/mct/FireDataBaseType.F90 @@ -0,0 +1,561 @@ +module FireDataBaseType + +#include "shr_assert.h" + + !----------------------------------------------------------------------- + ! !DESCRIPTION: + ! module for handling of fire data + ! + ! !USES: + use shr_kind_mod , only : r8 => shr_kind_r8, CL => shr_kind_CL + use shr_strdata_mod , only : shr_strdata_type, shr_strdata_create, shr_strdata_print + use shr_strdata_mod , only : shr_strdata_advance + use shr_log_mod , only : errMsg => shr_log_errMsg + use clm_varctl , only : iulog, inst_name + use spmdMod , only : masterproc, mpicom, comp_id + use fileutils , only : getavu, relavu + use domainMod , only : ldomain + use abortutils , only : endrun + use decompMod , only : bounds_type + use FireMethodType , only : fire_method_type + use lnd_set_decomp_and_domain, only : gsmap_global + use mct_mod + ! + implicit none + private + ! + ! !PUBLIC TYPES: + public :: fire_base_type + + ! + type, abstract, extends(fire_method_type) :: fire_base_type + private + ! !PRIVATE MEMBER DATA: + + real(r8), public, pointer :: forc_lnfm(:) ! Lightning frequency + real(r8), public, pointer :: forc_hdm(:) ! Human population density + + real(r8), public, pointer :: gdp_lf_col(:) ! col global real gdp data (k US$/capita) + real(r8), public, pointer :: peatf_lf_col(:) ! col global peatland fraction data (0-1) + integer , public, pointer :: abm_lf_col(:) ! col global peak month of crop fire emissions + + type(shr_strdata_type) :: sdat_hdm ! Human population density input data stream + type(shr_strdata_type) :: sdat_lnfm ! Lightning input data stream + + contains + ! + ! !PUBLIC MEMBER FUNCTIONS: + procedure, public :: FireInit => BaseFireInit ! Initialization of Fire + procedure, public :: BaseFireInit ! Initialization of Fire + procedure(FireReadNML_interface), public, deferred :: FireReadNML ! Read in namelist for Fire + procedure, public :: FireInterp ! Interpolate fire data + procedure(need_lightning_and_popdens_interface), public, deferred :: & + need_lightning_and_popdens ! Returns true if need lightning & popdens + ! + ! !PRIVATE MEMBER FUNCTIONS: + procedure, private :: hdm_init ! position datasets for dynamic human population density + procedure, private :: hdm_interp ! interpolates between two years of human pop. density file data + procedure, private :: lnfm_init ! position datasets for Lightning + procedure, private :: lnfm_interp ! interpolates between two years of Lightning file data + procedure, private :: surfdataread ! read fire related data from surface data set + end type fire_base_type + !----------------------------------------------------------------------- + + abstract interface + !----------------------------------------------------------------------- + function need_lightning_and_popdens_interface(this) result(need_lightning_and_popdens) + ! + ! !DESCRIPTION: + ! Returns true if need lightning and popdens, false otherwise + ! + ! USES + import :: fire_base_type + ! + ! !ARGUMENTS: + class(fire_base_type), intent(in) :: this + logical :: need_lightning_and_popdens ! function result + !----------------------------------------------------------------------- + end function need_lightning_and_popdens_interface + end interface + + character(len=*), parameter, private :: sourcefile = & + __FILE__ + +contains + + !----------------------------------------------------------------------- + subroutine FireReadNML_interface( this, NLFilename ) + ! + ! !DESCRIPTION: + ! Read the namelist for Fire + ! + ! !USES: + ! + ! !ARGUMENTS: + class(fire_base_type) :: this + character(len=*), intent(in) :: NLFilename ! Namelist filename + end subroutine FireReadNML_interface + + !----------------------------------------------------------------------- + subroutine BaseFireInit( this, bounds, NLFilename ) + ! + ! !DESCRIPTION: + ! Initialize CN Fire module + ! !USES: + use shr_infnan_mod , only : nan => shr_infnan_nan, assignment(=) + ! + ! !ARGUMENTS: + class(fire_base_type) :: this + type(bounds_type), intent(in) :: bounds + character(len=*), intent(in) :: NLFilename + !----------------------------------------------------------------------- + + if ( this%need_lightning_and_popdens() ) then + ! Allocate lightning forcing data + allocate( this%forc_lnfm(bounds%begg:bounds%endg) ) + this%forc_lnfm(bounds%begg:) = nan + ! Allocate pop dens forcing data + allocate( this%forc_hdm(bounds%begg:bounds%endg) ) + this%forc_hdm(bounds%begg:) = nan + + ! Allocate real gdp data + allocate(this%gdp_lf_col(bounds%begc:bounds%endc)) + ! Allocate peatland fraction data + allocate(this%peatf_lf_col(bounds%begc:bounds%endc)) + ! Allocates peak month of crop fire emissions + allocate(this%abm_lf_col(bounds%begc:bounds%endc)) + + + call this%hdm_init(bounds, NLFilename) + call this%hdm_interp(bounds) + call this%lnfm_init(bounds, NLFilename) + call this%lnfm_interp(bounds) + call this%surfdataread(bounds) + end if + + end subroutine BaseFireInit + + !----------------------------------------------------------------------- + subroutine FireInterp(this,bounds) + ! + ! !DESCRIPTION: + ! Interpolate CN Fire datasets + ! + ! !ARGUMENTS: + class(fire_base_type) :: this + type(bounds_type), intent(in) :: bounds + !----------------------------------------------------------------------- + + if ( this%need_lightning_and_popdens() ) then + call this%hdm_interp(bounds) + call this%lnfm_interp(bounds) + end if + + end subroutine FireInterp + + !----------------------------------------------------------------------- + subroutine hdm_init( this, bounds, NLFilename ) + ! + ! !DESCRIPTION: + ! Initialize data stream information for population density. + ! + ! !USES: + use clm_time_manager , only : get_calendar + use ncdio_pio , only : pio_subsystem + use shr_pio_mod , only : shr_pio_getiotype + use clm_nlUtilsMod , only : find_nlgroup_name + use ndepStreamMod , only : clm_domain_mct + use histFileMod , only : hist_addfld1d + ! + ! !ARGUMENTS: + implicit none + class(fire_base_type) :: this + type(bounds_type), intent(in) :: bounds + character(len=*), intent(in) :: NLFilename ! Namelist filename + ! + ! !LOCAL VARIABLES: + integer :: stream_year_first_popdens ! first year in pop. dens. stream to use + integer :: stream_year_last_popdens ! last year in pop. dens. stream to use + integer :: model_year_align_popdens ! align stream_year_first_hdm with + integer :: nu_nml ! unit for namelist file + integer :: nml_error ! namelist i/o error flag + type(mct_ggrid) :: dom_clm ! domain information + character(len=CL) :: stream_fldFileName_popdens ! population density streams filename + character(len=CL) :: popdensmapalgo = 'bilinear' ! mapping alogrithm for population density + character(len=CL) :: popdens_tintalgo = 'nearest'! time interpolation alogrithm for population density + character(len=CL) :: stream_meshfile_popdens ! not used + character(*), parameter :: subName = "('hdmdyn_init')" + character(*), parameter :: F00 = "('(hdmdyn_init) ',4a)" + !----------------------------------------------------------------------- + + namelist /popd_streams/ & + stream_year_first_popdens, & + stream_year_last_popdens, & + model_year_align_popdens, & + popdensmapalgo, & + stream_fldFileName_popdens, & + stream_meshfile_popdens , & + popdens_tintalgo + + ! Default values for namelist + stream_year_first_popdens = 1 ! first year in stream to use + stream_year_last_popdens = 1 ! last year in stream to use + model_year_align_popdens = 1 ! align stream_year_first_popdens with this model year + stream_fldFileName_popdens = ' ' + + ! Read popd_streams namelist + if (masterproc) then + nu_nml = getavu() + open( nu_nml, file=trim(NLFilename), status='old', iostat=nml_error ) + call find_nlgroup_name(nu_nml, 'popd_streams', status=nml_error) + if (nml_error == 0) then + read(nu_nml, nml=popd_streams,iostat=nml_error) + if (nml_error /= 0) then + call endrun(msg='ERROR reading popd_streams namelist'//errMsg(sourcefile, __LINE__)) + end if + end if + close(nu_nml) + call relavu( nu_nml ) + endif + + call shr_mpi_bcast(stream_year_first_popdens, mpicom) + call shr_mpi_bcast(stream_year_last_popdens, mpicom) + call shr_mpi_bcast(model_year_align_popdens, mpicom) + call shr_mpi_bcast(stream_fldFileName_popdens, mpicom) + call shr_mpi_bcast(popdens_tintalgo, mpicom) + + if (masterproc) then + write(iulog,*) ' ' + write(iulog,*) 'popdens_streams settings:' + write(iulog,*) ' stream_year_first_popdens = ',stream_year_first_popdens + write(iulog,*) ' stream_year_last_popdens = ',stream_year_last_popdens + write(iulog,*) ' model_year_align_popdens = ',model_year_align_popdens + write(iulog,*) ' stream_fldFileName_popdens = ',stream_fldFileName_popdens + write(iulog,*) ' popdens_tintalgo = ',popdens_tintalgo + write(iulog,*) ' ' + endif + + call clm_domain_mct (bounds, dom_clm) + + call shr_strdata_create(this%sdat_hdm,name="clmhdm", & + pio_subsystem=pio_subsystem, & + pio_iotype=shr_pio_getiotype(inst_name), & + mpicom=mpicom, compid=comp_id, & + gsmap=gsmap_global, ggrid=dom_clm, & + nxg=ldomain%ni, nyg=ldomain%nj, & + yearFirst=stream_year_first_popdens, & + yearLast=stream_year_last_popdens, & + yearAlign=model_year_align_popdens, & + offset=0, & + domFilePath='', & + domFileName=trim(stream_fldFileName_popdens), & + domTvarName='time', & + domXvarName='lon' , & + domYvarName='lat' , & + domAreaName='area', & + domMaskName='mask', & + filePath='', & + filename=(/trim(stream_fldFileName_popdens)/) , & + fldListFile='hdm', & + fldListModel='hdm', & + fillalgo='none', & + mapalgo=popdensmapalgo, & + calendar=get_calendar(), & + tintalgo=popdens_tintalgo, & + taxmode='extend' ) + + if (masterproc) then + call shr_strdata_print(this%sdat_hdm,'population density data') + endif + + ! Add history fields + call hist_addfld1d (fname='HDM', units='counts/km^2', & + avgflag='A', long_name='human population density', & + ptr_lnd=this%forc_hdm, default='inactive') + + end subroutine hdm_init + + !----------------------------------------------------------------------- + subroutine hdm_interp( this, bounds) + ! + ! !DESCRIPTION: + ! Interpolate data stream information for population density. + ! + ! !USES: + use clm_time_manager, only : get_curr_date + ! + ! !ARGUMENTS: + class(fire_base_type) :: this + type(bounds_type), intent(in) :: bounds + ! + ! !LOCAL VARIABLES: + integer :: g, ig + 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) + !----------------------------------------------------------------------- + + call get_curr_date(year, mon, day, sec) + mcdate = year*10000 + mon*100 + day + + call shr_strdata_advance(this%sdat_hdm, mcdate, sec, mpicom, 'hdmdyn') + + ig = 0 + do g = bounds%begg,bounds%endg + ig = ig+1 + this%forc_hdm(g) = this%sdat_hdm%avs(1)%rAttr(1,ig) + end do + + end subroutine hdm_interp + + !----------------------------------------------------------------------- + subroutine lnfm_init( this, bounds, NLFilename ) + ! + ! !DESCRIPTION: + ! + ! Initialize data stream information for Lightning. + ! + ! !USES: + use clm_time_manager , only : get_calendar + use ncdio_pio , only : pio_subsystem + use shr_pio_mod , only : shr_pio_getiotype + use clm_nlUtilsMod , only : find_nlgroup_name + use ndepStreamMod , only : clm_domain_mct + use histFileMod , only : hist_addfld1d + ! + ! !ARGUMENTS: + implicit none + class(fire_base_type) :: this + type(bounds_type), intent(in) :: bounds + character(len=*), intent(in) :: NLFilename + ! + ! !LOCAL VARIABLES: + integer :: stream_year_first_lightng ! first year in Lightning stream to use + integer :: stream_year_last_lightng ! last year in Lightning stream to use + integer :: model_year_align_lightng ! align stream_year_first_lnfm with + integer :: nu_nml ! unit for namelist file + integer :: nml_error ! namelist i/o error flag + type(mct_ggrid) :: dom_clm ! domain information + character(len=CL) :: stream_fldFileName_lightng ! lightning stream filename to read + character(len=CL) :: lightng_tintalgo = 'linear'! time interpolation alogrithm + character(len=CL) :: lightngmapalgo = 'bilinear'! Mapping alogrithm + character(*), parameter :: subName = "('lnfmdyn_init')" + character(*), parameter :: F00 = "('(lnfmdyn_init) ',4a)" + !----------------------------------------------------------------------- + + namelist /light_streams/ & + stream_year_first_lightng, & + stream_year_last_lightng, & + model_year_align_lightng, & + lightngmapalgo, & + stream_fldFileName_lightng, & + lightng_tintalgo + + ! Default values for namelist + stream_year_first_lightng = 1 ! first year in stream to use + stream_year_last_lightng = 1 ! last year in stream to use + model_year_align_lightng = 1 ! align stream_year_first_lnfm with this model year + stream_fldFileName_lightng = ' ' + + ! Read light_streams namelist + if (masterproc) then + nu_nml = getavu() + open( nu_nml, file=trim(NLFilename), status='old', iostat=nml_error ) + call find_nlgroup_name(nu_nml, 'light_streams', status=nml_error) + if (nml_error == 0) then + read(nu_nml, nml=light_streams,iostat=nml_error) + if (nml_error /= 0) then + call endrun(msg='ERROR reading light_streams namelist'//errMsg(sourcefile, __LINE__)) + end if + end if + close(nu_nml) + call relavu( nu_nml ) + endif + + call shr_mpi_bcast(stream_year_first_lightng, mpicom) + call shr_mpi_bcast(stream_year_last_lightng, mpicom) + call shr_mpi_bcast(model_year_align_lightng, mpicom) + call shr_mpi_bcast(stream_fldFileName_lightng, mpicom) + call shr_mpi_bcast(lightng_tintalgo, mpicom) + + if (masterproc) then + write(iulog,*) ' ' + write(iulog,*) 'light_stream settings:' + write(iulog,*) ' stream_year_first_lightng = ',stream_year_first_lightng + write(iulog,*) ' stream_year_last_lightng = ',stream_year_last_lightng + write(iulog,*) ' model_year_align_lightng = ',model_year_align_lightng + write(iulog,*) ' stream_fldFileName_lightng = ',stream_fldFileName_lightng + write(iulog,*) ' lightng_tintalgo = ',lightng_tintalgo + write(iulog,*) ' ' + endif + + call clm_domain_mct (bounds, dom_clm) + + call shr_strdata_create(this%sdat_lnfm,name="clmlnfm", & + pio_subsystem=pio_subsystem, & + pio_iotype=shr_pio_getiotype(inst_name), & + mpicom=mpicom, compid=comp_id, & + gsmap=gsmap_global, ggrid=dom_clm, & + nxg=ldomain%ni, nyg=ldomain%nj, & + yearFirst=stream_year_first_lightng, & + yearLast=stream_year_last_lightng, & + yearAlign=model_year_align_lightng, & + offset=0, & + domFilePath='', & + domFileName=trim(stream_fldFileName_lightng), & + domTvarName='time', & + domXvarName='lon' , & + domYvarName='lat' , & + domAreaName='area', & + domMaskName='mask', & + filePath='', & + filename=(/trim(stream_fldFileName_lightng)/), & + fldListFile='lnfm', & + fldListModel='lnfm', & + fillalgo='none', & + tintalgo=lightng_tintalgo, & + mapalgo=lightngmapalgo, & + calendar=get_calendar(), & + taxmode='cycle' ) + + if (masterproc) then + call shr_strdata_print(this%sdat_lnfm,'Lightning data') + endif + + ! Add history fields + call hist_addfld1d (fname='LNFM', units='counts/km^2/hr', & + avgflag='A', long_name='Lightning frequency', & + ptr_lnd=this%forc_lnfm, default='inactive') + + end subroutine lnfm_init + + !----------------------------------------------------------------------- + subroutine lnfm_interp(this, bounds ) + ! + ! !DESCRIPTION: + ! Interpolate data stream information for Lightning. + ! + ! !USES: + use clm_time_manager, only : get_curr_date + ! + ! !ARGUMENTS: + class(fire_base_type) :: this + type(bounds_type), intent(in) :: bounds + ! + ! !LOCAL VARIABLES: + integer :: g, ig + 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) + !----------------------------------------------------------------------- + + call get_curr_date(year, mon, day, sec) + mcdate = year*10000 + mon*100 + day + + call shr_strdata_advance(this%sdat_lnfm, mcdate, sec, mpicom, 'lnfmdyn') + + ig = 0 + do g = bounds%begg,bounds%endg + ig = ig+1 + this%forc_lnfm(g) = this%sdat_lnfm%avs(1)%rAttr(1,ig) + end do + + end subroutine lnfm_interp + + !----------------------------------------------------------------------- + subroutine surfdataread(this, bounds) + ! + ! !DESCRIPTION: + ! Read surface data set to populate relevant fire-related variables + ! + ! !USES: + use spmdMod , only : masterproc + use clm_varctl , only : nsrest, nsrStartup, fsurdat + use clm_varcon , only : grlnd + use ColumnType , only : col + use fileutils , only : getfil + use ncdio_pio + ! + ! !ARGUMENTS: + class(fire_base_type) :: this + type(bounds_type), intent(in) :: bounds + ! + ! !LOCAL VARIABLES: + integer :: g,c ! indices + type(file_desc_t) :: ncid ! netcdf id + logical :: readvar ! true => variable is on initial dataset + character(len=256) :: locfn ! local filename + real(r8), pointer :: gdp(:) ! global gdp data (needs to be a pointer for use in ncdio) + real(r8), pointer :: peatf(:) ! global peatf data (needs to be a pointer for use in ncdio) + integer, pointer :: abm(:) ! global abm data (needs to be a pointer for use in ncdio) + !----------------------------------------------------------------------- + + ! -------------------------------------------------------------------- + ! Open surface dataset + ! -------------------------------------------------------------------- + + call getfil (fsurdat, locfn, 0) + call ncd_pio_openfile (ncid, locfn, 0) + + ! -------------------------------------------------------------------- + ! Read in GDP data + ! -------------------------------------------------------------------- + + allocate(gdp(bounds%begg:bounds%endg)) + call ncd_io(ncid=ncid, varname='gdp', flag='read', data=gdp, dim1name=grlnd, readvar=readvar) + if (.not. readvar) then + call endrun(msg=' ERROR: gdp NOT on surfdata file'//errMsg(sourcefile, __LINE__)) + end if + do c = bounds%begc, bounds%endc + g = col%gridcell(c) + this%gdp_lf_col(c) = gdp(g) + end do + deallocate(gdp) + + ! -------------------------------------------------------------------- + ! Read in peatf data + ! -------------------------------------------------------------------- + + allocate(peatf(bounds%begg:bounds%endg)) + call ncd_io(ncid=ncid, varname='peatf', flag='read', data=peatf, dim1name=grlnd, readvar=readvar) + if (.not. readvar) then + call endrun(msg=' ERROR: peatf NOT on surfdata file'//errMsg(sourcefile, __LINE__)) + end if + do c = bounds%begc, bounds%endc + g = col%gridcell(c) + this%peatf_lf_col(c) = peatf(g) + end do + deallocate(peatf) + + ! -------------------------------------------------------------------- + ! Read in ABM data + ! -------------------------------------------------------------------- + + allocate(abm(bounds%begg:bounds%endg)) + call ncd_io(ncid=ncid, varname='abm', flag='read', data=abm, dim1name=grlnd, readvar=readvar) + if (.not. readvar) then + call endrun(msg=' ERROR: abm NOT on surfdata file'//errMsg(sourcefile, __LINE__)) + end if + do c = bounds%begc, bounds%endc + g = col%gridcell(c) + this%abm_lf_col(c) = abm(g) + end do + deallocate(abm) + + ! Close file + + call ncd_pio_closefile(ncid) + + if (masterproc) then + write(iulog,*) 'Successfully read fmax, soil color, sand and clay boundary data' + write(iulog,*) + endif + + end subroutine surfdataread + + +end module FireDataBaseType diff --git a/src/cpl/mct/SoilMoistureStreamMod.F90 b/src/cpl/mct/SoilMoistureStreamMod.F90 new file mode 100644 index 0000000000..8b366d6c8e --- /dev/null +++ b/src/cpl/mct/SoilMoistureStreamMod.F90 @@ -0,0 +1,418 @@ +module SoilMoistureStreamMod + + ! ********************************************************************** + ! --------------------------- IMPORTANT NOTE --------------------------- + ! + ! In cases using the NUOPC driver/mediator, we use a different version of this module, + ! based on CDEPS, which resides in src/cpl/nuopc/. Changes to the science here should + ! also be made in the similar file in src/cpl/nuopc. Once we start using CDEPS by + ! default, we can remove this version and move the CDEPS-based version into its place. + ! ********************************************************************** + +#include "shr_assert.h" + + !----------------------------------------------------------------------- + ! !DESCRIPTION: + ! Read in soil moisture from data stream + ! + ! !USES: + use shr_strdata_mod , only : shr_strdata_type, shr_strdata_create + use shr_strdata_mod , only : shr_strdata_print, shr_strdata_advance + use shr_kind_mod , only : r8 => shr_kind_r8 + use shr_kind_mod , only : CL => shr_kind_CL, CXX => shr_kind_CXX + use shr_log_mod , only : errMsg => shr_log_errMsg + use decompMod , only : bounds_type, subgrid_level_column + use abortutils , only : endrun + use clm_varctl , only : iulog, use_soil_moisture_streams, inst_name + use clm_varcon , only : grlnd + use controlMod , only : NLFilename + use domainMod , only : ldomain + use LandunitType , only : lun + use ColumnType , only : col + use SoilStateType , only : soilstate_type + use WaterStateBulkType , only : waterstatebulk_type + use perf_mod , only : t_startf, t_stopf + use spmdMod , only : masterproc, mpicom, comp_id + use lnd_set_decomp_and_domain , only : gsMap_lnd2Dsoi_gdc2glo + use mct_mod + use ncdio_pio + ! + ! !PUBLIC TYPES: + implicit none + private + ! + ! !PUBLIC MEMBER FUNCTIONS: + public :: PrescribedSoilMoistureInit ! position datasets for soil moisture + public :: PrescribedSoilMoistureAdvance ! Advance the soil moisture stream (outside of Open-MP loops) + public :: PrescribedSoilMoistureInterp ! interpolates between two periods of soil moisture data + + ! !PRIVATE MEMBER DATA: + type(shr_strdata_type) :: sdat_soilm ! soil moisture input data stream + integer :: ism ! Soil moisture steram index + integer, allocatable :: g_to_ig(:) ! Array matching gridcell index to data index + logical :: soilm_ignore_data_if_missing ! If should ignore overridding a point with soil moisture data + ! from the streams file, if the streams file shows that point + ! as missing (namelist item) + ! + ! !PRIVATE TYPES: + + character(len=*), parameter, private :: sourcefile = & + __FILE__ + !----------------------------------------------------------------------- + +contains + + !----------------------------------------------------------------------- + ! + ! soil_moisture_init + ! + !----------------------------------------------------------------------- + subroutine PrescribedSoilMoistureInit(bounds) + ! + ! Initialize data stream information for soil moisture. + ! + ! + ! !USES: + use clm_time_manager , only : get_calendar + use ncdio_pio , only : pio_subsystem + use shr_pio_mod , only : shr_pio_getiotype + use clm_nlUtilsMod , only : find_nlgroup_name + use ndepStreamMod , only : clm_domain_mct + use shr_stream_mod , only : shr_stream_file_null + use shr_string_mod , only : shr_string_listCreateField + use clm_varpar , only : nlevsoi + ! + ! !ARGUMENTS: + implicit none + type(bounds_type), intent(in) :: bounds ! bounds + ! + ! !LOCAL VARIABLES: + integer :: i ! index + integer :: stream_year_first_soilm ! first year in Ustar stream to use + integer :: stream_year_last_soilm ! last year in Ustar stream to use + integer :: model_year_align_soilm ! align stream_year_first_soilm with + integer :: nu_nml ! unit for namelist file + integer :: nml_error ! namelist i/o error flag + integer :: soilm_offset ! Offset in time for dataset (sec) + type(mct_ggrid) :: dom_clm ! domain information + character(len=CL) :: stream_fldfilename_soilm ! ustar stream filename to read + character(len=CL) :: soilm_tintalgo = 'linear' ! Time interpolation alogrithm + + character(*), parameter :: subName = "('PrescribedSoilMoistureInit')" + character(*), parameter :: F00 = "('(PrescribedSoilMoistureInit) ',4a)" + character(*), parameter :: soilmString = "H2OSOI" ! base string for field string + character(CXX) :: fldList ! field string + !----------------------------------------------------------------------- + ! + ! deal with namelist variables here in init + ! + namelist /soil_moisture_streams/ & + stream_year_first_soilm, & + stream_year_last_soilm, & + model_year_align_soilm, & + soilm_tintalgo, & + soilm_offset, & + soilm_ignore_data_if_missing, & + stream_fldfilename_soilm + + ! Default values for namelist + stream_year_first_soilm = 1 ! first year in stream to use + stream_year_last_soilm = 1 ! last year in stream to use + model_year_align_soilm = 1 ! align stream_year_first_soilm with this model year + stream_fldfilename_soilm = shr_stream_file_null + soilm_offset = 0 + soilm_ignore_data_if_missing = .false. + + ! Read soilm_streams namelist + if (masterproc) then + open( newunit=nu_nml, file=trim(NLFilename), status='old', iostat=nml_error ) + call find_nlgroup_name(nu_nml, 'soil_moisture_streams', status=nml_error) + if (nml_error == 0) then + read(nu_nml, nml=soil_moisture_streams,iostat=nml_error) + if (nml_error /= 0) then + call endrun(subname // ':: ERROR reading soil_moisture_streams namelist') + end if + else + call endrun(subname // ':: ERROR finding soilm_streams namelist') + end if + close(nu_nml) + endif + + call shr_mpi_bcast(stream_year_first_soilm, mpicom) + call shr_mpi_bcast(stream_year_last_soilm, mpicom) + call shr_mpi_bcast(model_year_align_soilm, mpicom) + call shr_mpi_bcast(stream_fldfilename_soilm, mpicom) + call shr_mpi_bcast(soilm_tintalgo, mpicom) + call shr_mpi_bcast(soilm_offset, mpicom) + call shr_mpi_bcast(soilm_ignore_data_if_missing, mpicom) + + if (masterproc) then + + write(iulog,*) ' ' + write(iulog,*) 'soil_moisture_stream settings:' + write(iulog,*) ' stream_year_first_soilm = ',stream_year_first_soilm + write(iulog,*) ' stream_year_last_soilm = ',stream_year_last_soilm + write(iulog,*) ' model_year_align_soilm = ',model_year_align_soilm + write(iulog,*) ' stream_fldfilename_soilm = ',trim(stream_fldfilename_soilm) + write(iulog,*) ' soilm_tintalgo = ',trim(soilm_tintalgo) + write(iulog,*) ' soilm_offset = ',soilm_offset + if ( soilm_ignore_data_if_missing )then + write(iulog,*) ' Do NOT override a point with streams data if the streams data is missing' + else + write(iulog,*) ' Abort, if you find a model point where the input streams data is set to missing value' + end if + + endif + + call clm_domain_mct (bounds, dom_clm, nlevels=nlevsoi) + + ! create the field list for these fields...use in shr_strdata_create + fldList = trim(soilmString) + if (masterproc) write(iulog,*) 'fieldlist: ', trim(fldList) + + call shr_strdata_create(sdat_soilm,name="soil_moisture", & + pio_subsystem=pio_subsystem, & + pio_iotype=shr_pio_getiotype(inst_name), & + mpicom=mpicom, compid=comp_id, & + gsmap=gsMap_lnd2Dsoi_gdc2glo, ggrid=dom_clm, & + nxg=ldomain%ni, nyg=ldomain%nj, & + nzg=nlevsoi, & + yearFirst=stream_year_first_soilm, & + yearLast=stream_year_last_soilm, & + yearAlign=model_year_align_soilm, & + offset=soilm_offset, & + domFilePath='', & + domFileName=trim(stream_fldFileName_soilm), & + domTvarName='time', & + domXvarName='lon' , & + domYvarName='lat' , & + domZvarName='levsoi' , & + domAreaName='area', & + domMaskName='mask', & + filePath='', & + filename=(/stream_fldFileName_soilm/), & + fldListFile=fldList, & + fldListModel=fldList, & + fillalgo='none', & + mapalgo='none', & + tintalgo=soilm_tintalgo, & + calendar=get_calendar(), & + dtlimit = 15._r8, & + taxmode='cycle' ) + + if (masterproc) then + call shr_strdata_print(sdat_soilm,'soil moisture data') + endif + + end subroutine PrescribedSoilMoistureInit + + + !----------------------------------------------------------------------- + ! + ! PrescribedSoilMoistureAdvance + ! + !----------------------------------------------------------------------- + subroutine PrescribedSoilMoistureAdvance( bounds ) + ! + ! Advanace the prescribed soil moisture stream + ! + ! !USES: + use clm_time_manager, only : get_curr_date + ! + ! !ARGUMENTS: + type(bounds_type) , intent(in) :: bounds + ! + ! !LOCAL VARIABLES: + character(len=CL) :: stream_var_name + integer :: g, ig + integer :: ier ! error code + 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) + + call get_curr_date(year, mon, day, sec) + mcdate = year*10000 + mon*100 + day + + stream_var_name = 'H2OSOI' + + ! Determine variable index + ism = mct_aVect_indexRA(sdat_soilm%avs(1),trim(stream_var_name)) + + call shr_strdata_advance(sdat_soilm, mcdate, sec, mpicom, trim(stream_var_name)) + + ! Map gridcell to AV index + ier = 0 + if ( .not. allocated(g_to_ig) )then + allocate (g_to_ig(bounds%begg:bounds%endg), stat=ier) + if (ier /= 0) then + write(iulog,*) 'Prescribed soil moisture allocation error' + call endrun(msg=errMsg(sourcefile, __LINE__)) + end if + + ig = 0 + do g = bounds%begg,bounds%endg + ig = ig+1 + g_to_ig(g) = ig + end do + end if + + end subroutine PrescribedSoilMoistureAdvance + + !----------------------------------------------------------------------- + ! + ! PrescribedSoilMoistureInterp + ! + !----------------------------------------------------------------------- + subroutine PrescribedSoilMoistureInterp(bounds, soilstate_inst, & + waterstatebulk_inst) + ! + ! Assign data stream information for prescribed soil moisture. + ! + ! !USES: + use clm_time_manager, only : get_curr_date + use clm_varpar , only : nlevsoi + use clm_varcon , only : denh2o, denice, watmin, spval + use landunit_varcon , only : istsoil, istcrop + ! + ! !ARGUMENTS: + implicit none + type(bounds_type) , intent(in) :: bounds + type(soilstate_type) , intent(in) :: soilstate_inst + type(waterstatebulk_type) , intent(inout) :: waterstatebulk_inst + ! + ! !LOCAL VARIABLES: + integer :: c, g, j, ig, n + real(r8) :: soilm_liq_frac ! liquid fraction of soil moisture + real(r8) :: soilm_ice_frac ! ice fraction of soil moisture + real(r8) :: moisture_increment ! soil moisture adjustment increment + real(r8) :: h2osoi_vol_initial ! initial vwc value + character(*), parameter :: subName = "('PrescribedSoilMoistureInterp')" + + !----------------------------------------------------------------------- + + SHR_ASSERT_FL( (lbound(sdat_soilm%avs(1)%rAttr,1) == ism ), sourcefile, __LINE__) + SHR_ASSERT_FL( (ubound(sdat_soilm%avs(1)%rAttr,1) == ism ), sourcefile, __LINE__) + SHR_ASSERT_FL( (lbound(g_to_ig,1) <= bounds%begg ), sourcefile, __LINE__) + SHR_ASSERT_FL( (ubound(g_to_ig,1) >= bounds%endg ), sourcefile, __LINE__) + SHR_ASSERT_FL( (lbound(sdat_soilm%avs(1)%rAttr,2) <= g_to_ig(bounds%begg) ), sourcefile, __LINE__) + SHR_ASSERT_FL( (ubound(sdat_soilm%avs(1)%rAttr,2) >= g_to_ig(bounds%endg)+(nlevsoi-1)*size(g_to_ig) ), sourcefile, __LINE__) + associate( & + dz => col%dz , & ! Input: [real(r8) (:,:) ] layer depth (m) + watsat => soilstate_inst%watsat_col , & ! Input: [real(r8) (:,:) ] volumetric soil water at saturation (porosity) + h2osoi_liq => waterstatebulk_inst%h2osoi_liq_col , & ! Input/Output: [real(r8) (:,:) ] liquid water (kg/m2) + h2osoi_ice => waterstatebulk_inst%h2osoi_ice_col , & ! Input/Output: [real(r8) (:,:) ] ice water (kg/m2) + h2osoi_vol => waterstatebulk_inst%h2osoi_vol_col , & ! Output: volumetric soil water (m3/m3) + h2osoi_vol_prs => waterstatebulk_inst%h2osoi_vol_prs_grc & ! Output: prescribed volumetric soil water (m3/m3) + ) + SHR_ASSERT_FL( (lbound(h2osoi_vol,1) <= bounds%begc ), sourcefile, __LINE__) + SHR_ASSERT_FL( (ubound(h2osoi_vol,1) >= bounds%endc ), sourcefile, __LINE__) + SHR_ASSERT_FL( (lbound(h2osoi_vol,2) == 1 ), sourcefile, __LINE__) + SHR_ASSERT_FL( (ubound(h2osoi_vol,2) >= nlevsoi ), sourcefile, __LINE__) + SHR_ASSERT_FL( (lbound(dz,1) <= bounds%begc ), sourcefile, __LINE__) + SHR_ASSERT_FL( (ubound(dz,1) >= bounds%endc ), sourcefile, __LINE__) + SHR_ASSERT_FL( (lbound(dz,2) <= 1 ), sourcefile, __LINE__) + SHR_ASSERT_FL( (ubound(dz,2) >= nlevsoi ), sourcefile, __LINE__) + SHR_ASSERT_FL( (lbound(watsat,1) <= bounds%begc ), sourcefile, __LINE__) + SHR_ASSERT_FL( (ubound(watsat,1) >= bounds%endc ), sourcefile, __LINE__) + SHR_ASSERT_FL( (lbound(watsat,2) <= 1 ), sourcefile, __LINE__) + SHR_ASSERT_FL( (ubound(watsat,2) >= nlevsoi ), sourcefile, __LINE__) + SHR_ASSERT_FL( (lbound(h2osoi_liq,1) <= bounds%begc ), sourcefile, __LINE__) + SHR_ASSERT_FL( (ubound(h2osoi_liq,1) >= bounds%endc ), sourcefile, __LINE__) + SHR_ASSERT_FL( (lbound(h2osoi_liq,2) <= 1 ), sourcefile, __LINE__) + SHR_ASSERT_FL( (ubound(h2osoi_liq,2) >= nlevsoi ), sourcefile, __LINE__) + SHR_ASSERT_FL( (lbound(h2osoi_ice,1) <= bounds%begc ), sourcefile, __LINE__) + SHR_ASSERT_FL( (ubound(h2osoi_ice,1) >= bounds%endc ), sourcefile, __LINE__) + SHR_ASSERT_FL( (lbound(h2osoi_ice,2) <= 1 ), sourcefile, __LINE__) + SHR_ASSERT_FL( (ubound(h2osoi_ice,2) >= nlevsoi ), sourcefile, __LINE__) + SHR_ASSERT_FL( (lbound(h2osoi_vol_prs,1) <= bounds%begg ), sourcefile, __LINE__) + SHR_ASSERT_FL( (ubound(h2osoi_vol_prs,1) >= bounds%endg ), sourcefile, __LINE__) + SHR_ASSERT_FL( (lbound(h2osoi_vol_prs,2) == 1 ), sourcefile, __LINE__) + SHR_ASSERT_FL( (ubound(h2osoi_vol_prs,2) >= nlevsoi ), sourcefile, __LINE__) + ! + ! Set the prescribed soil moisture read from the file everywhere + ! + do g = bounds%begg, bounds%endg + ig = g_to_ig(g) + do j = 1, nlevsoi + + !n = ig + (j-1)*size(g_to_ig) + n = ig + (j-1)*size(g_to_ig) + + h2osoi_vol_prs(g,j) = sdat_soilm%avs(1)%rAttr(ism,n) + + ! If soil moiture is being interpolated in time and the result is + ! large that probably means one of the two data points is missing (set to spval) + if ( h2osoi_vol_prs(g,j) > 10.0_r8 .and. (h2osoi_vol_prs(g,j) /= spval) )then + h2osoi_vol_prs(g,j) = spval + end if + + end do + end do + + do c = bounds%begc, bounds%endc + ! + ! Set variable for each gridcell/column combination + ! + g = col%gridcell(c) + ig = g_to_ig(g) + + ! EBK Jan/2020, also check weights on gridcell (See https://github.com/ESCOMP/CTSM/issues/847) + if ( (lun%itype(col%landunit(c)) == istsoil) .or. (lun%itype(col%landunit(c)) == istcrop) .and. & + (col%wtgcell(c) /= 0._r8) ) then + ! this is a 2d field (gridcell/nlevsoi) ! + do j = 1, nlevsoi + + n = ig + (j-1)*size(g_to_ig) + + ! if soil water is zero, liq/ice fractions cannot be calculated + if((h2osoi_liq(c, j) + h2osoi_ice(c, j)) > 0._r8) then + + ! save original soil moisture value + h2osoi_vol_initial = h2osoi_vol(c,j) + + ! Check if the vegetated land mask from the dataset on the + ! file is different + if ( (h2osoi_vol_prs(g,j) == spval) .and. (h2osoi_vol_initial /= spval) )then + if ( soilm_ignore_data_if_missing )then + cycle + else + write(iulog,*) 'Input soil moisture dataset is not vegetated as expected: gridcell=', & + g, ' active = ', col%active(c) + call endrun(subgrid_index=c, subgrid_level=subgrid_level_column, & + msg = subname // & + ' ERROR:: The input soil moisture stream is NOT vegetated for one of the land points' ) + end if + end if + + ! update volumetric soil moisture from data prescribed from the file + h2osoi_vol(c,j) = h2osoi_vol_prs(g,j) + + + ! calculate liq/ice mass fractions + soilm_liq_frac = h2osoi_liq(c, j) /(h2osoi_liq(c, j) + h2osoi_ice(c, j)) + soilm_ice_frac = h2osoi_ice(c, j) /(h2osoi_liq(c, j) + h2osoi_ice(c, j)) + + ! calculate moisture increment + moisture_increment = h2osoi_vol(c,j) - h2osoi_vol_initial + ! add limitation check + moisture_increment = min((watsat(c,j) - h2osoi_vol_initial),max(-(h2osoi_vol_initial-watmin),moisture_increment)) + + ! update liq/ice water mass due to (volumetric) moisture increment + h2osoi_liq(c,j) = h2osoi_liq(c,j) + (soilm_liq_frac * moisture_increment * dz(c, j) * denh2o) + h2osoi_ice(c,j) = h2osoi_ice(c,j) + (soilm_ice_frac * moisture_increment * dz(c, j) * denice) + + else + call endrun(subgrid_index=c, subgrid_level=subgrid_level_column, & + msg = subname // ':: ERROR h2osoil liquid plus ice is zero') + endif + enddo + endif + end do + + end associate + + end subroutine PrescribedSoilMoistureInterp + +end module SoilMoistureStreamMod diff --git a/src/cpl/mct/UrbanTimeVarType.F90 b/src/cpl/mct/UrbanTimeVarType.F90 new file mode 100644 index 0000000000..805ac47fbf --- /dev/null +++ b/src/cpl/mct/UrbanTimeVarType.F90 @@ -0,0 +1,314 @@ +module UrbanTimeVarType + + !------------------------------------------------------------------------------ + ! !DESCRIPTION: + ! Urban Time Varying Data + ! + ! !USES: + use shr_kind_mod , only : r8 => shr_kind_r8, CL => shr_kind_CL + use shr_log_mod , only : errMsg => shr_log_errMsg + use abortutils , only : endrun + use decompMod , only : bounds_type, subgrid_level_landunit + use clm_varctl , only : iulog, inst_name + use landunit_varcon , only : isturb_MIN, isturb_MAX + use clm_varcon , only : spval + use LandunitType , only : lun + use GridcellType , only : grc + use mct_mod + use shr_strdata_mod , only : shr_strdata_type + ! + implicit none + save + private + ! + ! + + ! !PUBLIC TYPE + type, public :: urbantv_type + + real(r8), public, pointer :: t_building_max(:) ! lun maximum internal building air temperature (K) + type(shr_strdata_type) :: sdat_urbantv ! urban time varying input data stream + contains + + ! !PUBLIC MEMBER FUNCTIONS: + procedure, public :: Init ! Allocate and initialize urbantv + procedure, public :: urbantv_init ! Initialize urban time varying stream + procedure, public :: urbantv_interp ! Interpolate urban time varying stream + + end type urbantv_type + + !----------------------------------------------------------------------- + character(15), private :: stream_var_name(isturb_MIN:isturb_MAX) + + character(len=*), parameter, private :: sourcefile = & + __FILE__ + +contains + + !----------------------------------------------------------------------- + subroutine Init(this, bounds, NLFilename) + ! + ! Allocate module variables and data structures + ! + ! !USES: + use shr_infnan_mod , only : nan => shr_infnan_nan, assignment(=) + use histFileMod , only : hist_addfld1d + ! + ! !ARGUMENTS: + class(urbantv_type) :: this + type(bounds_type) , intent(in) :: bounds + character(len=*) , intent(in) :: NLFilename ! Namelist filename + ! + ! !LOCAL VARIABLES: + integer :: begl, endl + !--------------------------------------------------------------------- + + begl = bounds%begl; endl = bounds%endl + + ! Allocate urbantv data structure + + allocate(this%t_building_max (begl:endl)) ; this%t_building_max (:) = nan + + call this%urbantv_init(bounds, NLFilename) + call this%urbantv_interp(bounds) + + ! Add history fields + call hist_addfld1d (fname='TBUILD_MAX', units='K', & + avgflag='A', long_name='prescribed maximum interior building temperature', & + ptr_lunit=this%t_building_max, default='inactive', set_nourb=spval, & + l2g_scale_type='unity') + + + end subroutine Init + + !----------------------------------------------------------------------- + + !----------------------------------------------------------------------- + subroutine urbantv_init(this, bounds, NLFilename) + ! + ! !DESCRIPTION: + ! Initialize data stream information for urban time varying data + ! + ! !USES: + use clm_time_manager , only : get_calendar + use ncdio_pio , only : pio_subsystem + use shr_pio_mod , only : shr_pio_getiotype + use clm_nlUtilsMod , only : find_nlgroup_name + use ndepStreamMod , only : clm_domain_mct + use spmdMod , only : masterproc, mpicom, comp_id + use fileutils , only : getavu, relavu + use shr_mpi_mod , only : shr_mpi_bcast + use shr_string_mod , only : shr_string_listAppend + use shr_strdata_mod , only : shr_strdata_create, shr_strdata_print + use domainMod , only : ldomain + use shr_infnan_mod , only : nan => shr_infnan_nan, assignment(=) + use landunit_varcon , only : isturb_TBD, isturb_HD, isturb_MD + use lnd_set_decomp_and_domain , only : gsmap_global + ! + ! !ARGUMENTS: + implicit none + class(urbantv_type) :: this + type(bounds_type), intent(in) :: bounds + character(len=*), intent(in) :: NLFilename ! Namelist filename + ! + ! !LOCAL VARIABLES: + integer :: begl, endl ! landunits + integer :: ifield ! field index + integer :: stream_year_first_urbantv ! first year in urban tv stream to use + integer :: stream_year_last_urbantv ! last year in urban tv stream to use + integer :: model_year_align_urbantv ! align stream_year_first_urbantv + ! with this model year + integer :: nu_nml ! unit for namelist file + integer :: nml_error ! namelist i/o error flag + type(mct_ggrid) :: dom_clm ! domain information + character(len=CL) :: stream_fldFileName_urbantv ! urban tv streams filename + character(len=CL) :: urbantvmapalgo = 'nn' ! mapping alogrithm for urban ac + character(len=CL) :: urbantv_tintalgo = 'linear' ! time interpolation alogrithm + character(len=CL) :: fldList ! field string + character(*), parameter :: urbantvString = "tbuildmax_" ! base string for field string + character(*), parameter :: subName = "('urbantv_init')" + character(*), parameter :: F00 = "('(urbantv_init) ',4a)" + !----------------------------------------------------------------------- + namelist /urbantv_streams/ & + stream_year_first_urbantv, & + stream_year_last_urbantv, & + model_year_align_urbantv, & + urbantvmapalgo, & + stream_fldFileName_urbantv, & + urbantv_tintalgo + !----------------------------------------------------------------------- + + begl = bounds%begl; endl = bounds%endl + + ! Default values for namelist + stream_year_first_urbantv = 1 ! first year in stream to use + stream_year_last_urbantv = 1 ! last year in stream to use + model_year_align_urbantv = 1 ! align stream_year_first_urbantv with this model year + stream_fldFileName_urbantv = ' ' + + ! Read urbantv_streams namelist + if (masterproc) then + nu_nml = getavu() + open( nu_nml, file=trim(NLFilename), status='old', iostat=nml_error ) + call find_nlgroup_name(nu_nml, 'urbantv_streams', status=nml_error) + if (nml_error == 0) then + read(nu_nml, nml=urbantv_streams,iostat=nml_error) + if (nml_error /= 0) then + call endrun(msg='ERROR reading urbantv_streams namelist'//errMsg(sourcefile, __LINE__)) + end if + end if + close(nu_nml) + call relavu( nu_nml ) + endif + + call shr_mpi_bcast(stream_year_first_urbantv, mpicom) + call shr_mpi_bcast(stream_year_last_urbantv, mpicom) + call shr_mpi_bcast(model_year_align_urbantv, mpicom) + call shr_mpi_bcast(stream_fldFileName_urbantv, mpicom) + call shr_mpi_bcast(urbantv_tintalgo, mpicom) + + if (masterproc) then + write(iulog,*) ' ' + write(iulog,*) 'urbantv_streams settings:' + write(iulog,*) ' stream_year_first_urbantv = ',stream_year_first_urbantv + write(iulog,*) ' stream_year_last_urbantv = ',stream_year_last_urbantv + write(iulog,*) ' model_year_align_urbantv = ',model_year_align_urbantv + write(iulog,*) ' stream_fldFileName_urbantv = ',stream_fldFileName_urbantv + write(iulog,*) ' urbantv_tintalgo = ',urbantv_tintalgo + write(iulog,*) ' ' + endif + + call clm_domain_mct (bounds, dom_clm) + + ! create the field list for these urbantv fields...use in shr_strdata_create + stream_var_name(:) = "NOT_SET" + stream_var_name(isturb_TBD) = urbantvString//"TBD" + stream_var_name(isturb_HD) = urbantvString//"HD" + stream_var_name(isturb_MD) = urbantvString//"MD" + fldList = "" + do ifield = isturb_MIN, isturb_MAX + call shr_string_listAppend( fldList, stream_var_name(ifield) ) + end do + + call shr_strdata_create(this%sdat_urbantv,name="clmurbantv", & + pio_subsystem=pio_subsystem, & + pio_iotype=shr_pio_getiotype(inst_name), & + mpicom=mpicom, compid=comp_id, & + gsmap=gsmap_global, ggrid=dom_clm, & + nxg=ldomain%ni, nyg=ldomain%nj, & + yearFirst=stream_year_first_urbantv, & + yearLast=stream_year_last_urbantv, & + yearAlign=model_year_align_urbantv, & + offset=0, & + domFilePath='', & + domFileName=trim(stream_fldFileName_urbantv), & + domTvarName='time', & + domXvarName='lon' , & + domYvarName='lat' , & + domAreaName='area', & + domMaskName='LANDMASK', & + filePath='', & + filename=(/trim(stream_fldFileName_urbantv)/) , & + fldListFile=fldList, & + fldListModel=fldList, & + fillalgo='none', & + mapalgo=urbantvmapalgo, & + calendar=get_calendar(), & + tintalgo=urbantv_tintalgo, & + taxmode='extend' ) + + if (masterproc) then + call shr_strdata_print(this%sdat_urbantv,'urban time varying data') + endif + + + end subroutine urbantv_init + + !----------------------------------------------------------------------- + subroutine urbantv_interp(this, bounds) + ! + ! !DESCRIPTION: + ! Interpolate data stream information for urban time varying data. + ! + ! !USES: + use clm_time_manager, only : get_curr_date + use spmdMod , only : mpicom + use shr_strdata_mod , only : shr_strdata_advance + use clm_instur , only : urban_valid + ! + ! !ARGUMENTS: + class(urbantv_type) :: this + type(bounds_type), intent(in) :: bounds + ! + ! !LOCAL VARIABLES: + logical :: found + integer :: l, glun, ig, g, ip + 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 :: lindx ! landunit index + integer :: gindx ! gridcell index + !----------------------------------------------------------------------- + + call get_curr_date(year, mon, day, sec) + mcdate = year*10000 + mon*100 + day + + call shr_strdata_advance(this%sdat_urbantv, mcdate, sec, mpicom, 'urbantvdyn') + + do l = bounds%begl,bounds%endl + if (lun%urbpoi(l)) then + glun = lun%gridcell(l) + ip = mct_aVect_indexRA(this%sdat_urbantv%avs(1),trim(stream_var_name(lun%itype(l)))) + ! + ! Determine vector index corresponding to glun + ! + ig = 0 + do g = bounds%begg,bounds%endg + ig = ig+1 + if (g == glun) exit + end do + + this%t_building_max(l) = this%sdat_urbantv%avs(1)%rAttr(ip,ig) + else + this%t_building_max(l) = spval + end if + end do + + found = .false. + do l = bounds%begl,bounds%endl + if (lun%urbpoi(l)) then + glun = lun%gridcell(l) + ! + ! Determine vector index corresponding to glun + ! + ig = 0 + do g = bounds%begg,bounds%endg + ig = ig+1 + if (g == glun) exit + end do + + if ( .not. urban_valid(g) .or. (this%t_building_max(l) <= 0._r8)) then + found = .true. + gindx = g + lindx = l + exit + end if + end if + end do + if ( found ) then + write(iulog,*)'ERROR: no valid urban data for g= ',gindx + write(iulog,*)'landunit type: ',lun%itype(lindx) + write(iulog,*)'urban_valid: ',urban_valid(gindx) + write(iulog,*)'t_building_max: ',this%t_building_max(lindx) + call endrun(subgrid_index=lindx, subgrid_level=subgrid_level_landunit, & + msg=errmsg(sourcefile, __LINE__)) + end if + + + end subroutine urbantv_interp + + !----------------------------------------------------------------------- + +end module UrbanTimeVarType diff --git a/src/cpl/mct/ch4FInundatedStreamType.F90 b/src/cpl/mct/ch4FInundatedStreamType.F90 new file mode 100644 index 0000000000..3c26f4d109 --- /dev/null +++ b/src/cpl/mct/ch4FInundatedStreamType.F90 @@ -0,0 +1,389 @@ +module ch4FInundatedStreamType + +#include "shr_assert.h" + + !----------------------------------------------------------------------- + ! !DESCRIPTION: + ! Contains methods for reading in finundated streams file for methane code. + ! + ! !USES + use shr_kind_mod , only: r8 => shr_kind_r8, CL => shr_kind_cl + use spmdMod , only: mpicom, masterproc + use clm_varctl , only: iulog, inst_name + use abortutils , only: endrun + use decompMod , only: bounds_type + use ch4varcon , only: finundation_mtd + + ! !PUBLIC TYPES: + implicit none + private + save + + type, public :: ch4finundatedstream_type + real(r8), pointer, private :: zwt0_gdc (:) ! col coefficient for determining finundated (m) + real(r8), pointer, private :: f0_gdc (:) ! col maximum inundated fraction for a gridcell (for methane code) + real(r8), pointer, private :: p3_gdc (:) ! col coefficient for determining finundated (m) + real(r8), pointer, private :: fws_slope_gdc (:) ! col slope in fws = slope * tws + intercept (A coefficient) + real(r8), pointer, private :: fws_intercept_gdc (:) ! col slope in fws = slope * tws + intercept (B coefficient) + contains + + ! !PUBLIC MEMBER FUNCTIONS: + procedure, public :: Init ! Initialize and read data in + procedure, public :: CalcFinundated ! Calculate finundated based on input streams + procedure, public :: UseStreams ! If streams will be used + + ! !PRIVATE MEMBER FUNCTIONS: + procedure, private :: InitAllocate ! Allocate data + + end type ch4finundatedstream_type + + + ! ! PRIVATE DATA: + + type, private :: streamcontrol_type + character(len=CL) :: stream_fldFileName_ch4finundated ! Filename + character(len=CL) :: ch4finundatedmapalgo ! map algo + character(len=CL) :: fldList ! List of fields to read + contains + procedure, private :: ReadNML ! Read in namelist + end type streamcontrol_type + + type(streamcontrol_type), private :: control ! Stream control data + + character(len=*), parameter, private :: sourcefile = & + __FILE__ + !============================================================================== + +contains + + !============================================================================== + + subroutine Init(this, bounds, NLFilename) + ! + ! Initialize the ch4 finundated stream object + ! + ! Uses: + use clm_time_manager , only : get_calendar, get_curr_date + use ncdio_pio , only : pio_subsystem + use shr_pio_mod , only : shr_pio_getiotype + use shr_nl_mod , only : shr_nl_find_group_name + use shr_mpi_mod , only : shr_mpi_bcast + use ndepStreamMod , only : clm_domain_mct + use domainMod , only : ldomain + use decompMod , only : bounds_type + use mct_mod , only : mct_ggrid, mct_avect_indexra + use shr_strdata_mod , only : shr_strdata_type, shr_strdata_create + use shr_strdata_mod , only : shr_strdata_print, shr_strdata_advance + use spmdMod , only : comp_id, iam + use ch4varcon , only : finundation_mtd_h2osfc + use ch4varcon , only : finundation_mtd_ZWT_inversion, finundation_mtd_TWS_inversion + use lnd_set_decomp_and_domain , only : gsmap_global + ! + ! arguments + implicit none + class(ch4finundatedstream_type) :: this + type(bounds_type), intent(in) :: bounds + character(len=*), intent(in) :: NLFilename ! Namelist filename + ! + ! local variables + integer :: ig, g ! Indices + type(mct_ggrid) :: dom_clm ! domain information + type(shr_strdata_type) :: sdat ! input data stream + integer :: index_ZWT0 = 0 ! Index of ZWT0 field + integer :: index_F0 = 0 ! Index of F0 field + integer :: index_P3 = 0 ! Index of P3 field + integer :: index_FWS_TWS_A = 0 ! Index of FWS_TWS_A field + integer :: index_FWS_TWS_B = 0 ! Index of FWS_TWS_B field + 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) + character(len=*), parameter :: stream_name = 'ch4finundated' + character(*), parameter :: subName = "('ch4finundatedstream::Init')" + !----------------------------------------------------------------------- + if ( finundation_mtd /= finundation_mtd_h2osfc )then + call this%InitAllocate( bounds ) + call control%ReadNML( bounds, NLFileName ) + + if ( this%useStreams() )then + call clm_domain_mct (bounds, dom_clm) + + call shr_strdata_create(sdat,name=stream_name, & + pio_subsystem=pio_subsystem, & + pio_iotype=shr_pio_getiotype(inst_name), & + mpicom=mpicom, compid=comp_id, & + gsmap=gsmap_global, ggrid=dom_clm, & + nxg=ldomain%ni, nyg=ldomain%nj, & + yearFirst=1996, & + yearLast=1996, & + yearAlign=1, & + offset=0, & + domFilePath='', & + domFileName=trim(control%stream_fldFileName_ch4finundated), & + domTvarName='time', & + domXvarName='LONGXY' , & + domYvarName='LATIXY' , & + domAreaName='AREA', & + domMaskName='LANDMASK', & + filePath='', & + filename=(/trim(control%stream_fldFileName_ch4finundated)/), & + fldListFile=control%fldList, & + fldListModel=control%fldList, & + fillalgo='none', & + mapalgo=control%ch4finundatedmapalgo, & + calendar=get_calendar(), & + taxmode='extend' ) + + if (masterproc) then + call shr_strdata_print(sdat,'CLM '//stream_name//' data') + endif + + if( finundation_mtd == finundation_mtd_ZWT_inversion )then + index_ZWT0 = mct_avect_indexra(sdat%avs(1),'ZWT0') + index_F0 = mct_avect_indexra(sdat%avs(1),'F0' ) + index_P3 = mct_avect_indexra(sdat%avs(1),'P3' ) + else if( finundation_mtd == finundation_mtd_TWS_inversion )then + index_FWS_TWS_A = mct_avect_indexra(sdat%avs(1),'FWS_TWS_A') + index_FWS_TWS_B = mct_avect_indexra(sdat%avs(1),'FWS_TWS_B') + end if + + + ! Explicitly set current date to a hardcoded constant value. Otherwise + ! using the real date can cause roundoff differences that are + ! detrected as issues with exact restart. EBK M05/20/2017 + !call get_curr_date(year, mon, day, sec) + year = 1996 + mon = 12 + day = 31 + sec = 0 + mcdate = year*10000 + mon*100 + day + + call shr_strdata_advance(sdat, mcdate, sec, mpicom, 'ch4finundated') + + ! Get the data + ig = 0 + do g = bounds%begg,bounds%endg + ig = ig+1 + if ( index_ZWT0 > 0 )then + this%zwt0_gdc(g) = sdat%avs(1)%rAttr(index_ZWT0,ig) + end if + if ( index_F0 > 0 )then + this%f0_gdc(g) = sdat%avs(1)%rAttr(index_F0,ig) + end if + if ( index_P3 > 0 )then + this%p3_gdc(g) = sdat%avs(1)%rAttr(index_P3,ig) + end if + if ( index_FWS_TWS_A > 0 )then + this%fws_slope_gdc(g) = sdat%avs(1)%rAttr(index_FWS_TWS_A,ig) + end if + if ( index_FWS_TWS_B > 0 )then + this%fws_intercept_gdc(g) = sdat%avs(1)%rAttr(index_FWS_TWS_B,ig) + end if + end do + end if + end if + + end subroutine Init + + !----------------------------------------------------------------------- + logical function UseStreams(this) + ! + ! !DESCRIPTION: + ! Return true if + ! + ! !USES: + ! + ! !ARGUMENTS: + implicit none + class(ch4finundatedstream_type) :: this + ! + ! !LOCAL VARIABLES: + if ( trim(control%stream_fldFileName_ch4finundated) == '' )then + UseStreams = .false. + else + UseStreams = .true. + end if + end function UseStreams + + !----------------------------------------------------------------------- + subroutine InitAllocate(this, bounds) + ! + ! !DESCRIPTION: + ! Allocate module variables and data structures + ! + ! !USES: + use shr_infnan_mod, only: nan => shr_infnan_nan, assignment(=) + use ch4varcon , only: finundation_mtd_ZWT_inversion, finundation_mtd_TWS_inversion + ! + ! !ARGUMENTS: + implicit none + class(ch4finundatedstream_type) :: this + type(bounds_type), intent(in) :: bounds + ! + ! !LOCAL VARIABLES: + integer :: begc, endc + integer :: begg, endg + !--------------------------------------------------------------------- + + begc = bounds%begc; endc = bounds%endc + begg = bounds%begg; endg = bounds%endg + + if( finundation_mtd == finundation_mtd_ZWT_inversion )then + allocate(this%zwt0_gdc (begg:endg)) ; this%zwt0_gdc (:) = nan + allocate(this%f0_gdc (begg:endg)) ; this%f0_gdc (:) = nan + allocate(this%p3_gdc (begg:endg)) ; this%p3_gdc (:) = nan + else if( finundation_mtd == finundation_mtd_TWS_inversion )then + allocate(this%fws_slope_gdc (begg:endg)) ; this%fws_slope_gdc (:) = nan + allocate(this%fws_intercept_gdc(begg:endg)) ; this%fws_intercept_gdc(:) = nan + end if + + end subroutine InitAllocate + + !----------------------------------------------------------------------- + subroutine CalcFinundated(this, bounds, num_soilc, filter_soilc, soilhydrology_inst, & + waterdiagnosticbulk_inst, qflx_surf_lag_col, finundated ) + ! + ! !DESCRIPTION: + ! + ! Calculate finundated according to the appropriate methodology + ! + ! !USES: + use ColumnType , only : col + use ch4varcon , only : finundation_mtd_h2osfc, finundation_mtd_ZWT_inversion + use ch4varcon , only : finundation_mtd_TWS_inversion + use clm_varpar , only : nlevsoi + use SoilHydrologyType, only : soilhydrology_type + use WaterDiagnosticBulkType , only : waterdiagnosticbulk_type + ! + ! !ARGUMENTS: + implicit none + class(ch4finundatedstream_type) :: this + type(bounds_type) , intent(in) :: bounds + integer , intent(in) :: num_soilc ! number of column soil points in column filter + integer , intent(in) :: filter_soilc(:) ! column filter for soil points + type(soilhydrology_type) , intent(in) :: soilhydrology_inst + type(waterdiagnosticbulk_type) , intent(in) :: waterdiagnosticbulk_inst + real(r8) , intent(in) :: qflx_surf_lag_col(bounds%begc:) !time-lagged surface runoff (mm H2O /s) + real(r8) , intent(inout) :: finundated(bounds%begc:) ! fractional inundated area in soil column (excluding dedicated wetland columns) + ! + ! !LOCAL VARIABLES: + integer :: g, c, fc ! Indices + real(r8) :: zwt_actual ! Total water storage (ZWT) to use either perched or total depending on conditions + + SHR_ASSERT_ALL_FL((ubound(qflx_surf_lag_col) == (/bounds%endc/)), sourcefile, __LINE__) + SHR_ASSERT_ALL_FL((ubound(finundated) == (/bounds%endc/)), sourcefile, __LINE__) + + associate( & + z => col%z , & ! Input: [real(r8) (:,:) ] layer depth (m) (-nlevsno+1:nlevsoi) + zwt => soilhydrology_inst%zwt_col , & ! Input: [real(r8) (:) ] water table depth (m) + zwt_perched => soilhydrology_inst%zwt_perched_col , & ! Input: [real(r8) (:) ] perched water table depth (m) + tws => waterdiagnosticbulk_inst%tws_grc , & ! Input: [real(r8) (:) ] total water storage (kg m-2) + frac_h2osfc => waterdiagnosticbulk_inst%frac_h2osfc_col & ! Input: [real(r8) (:) ] fraction of ground covered by surface water (0 to 1) + ) + + ! Calculate finundated + do fc = 1, num_soilc + c = filter_soilc(fc) + g = col%gridcell(c) + select case( finundation_mtd ) + case ( finundation_mtd_h2osfc ) + finundated(c) = frac_h2osfc(c) + case ( finundation_mtd_ZWT_inversion ) + if (this%zwt0_gdc(g) > 0._r8) then + if (zwt_perched(c) < z(c,nlevsoi)-1.e-5_r8 .and. zwt_perched(c) < zwt(c)) then + zwt_actual = zwt_perched(c) + else + zwt_actual = zwt(c) + end if + finundated(c) = this%f0_gdc(g) * exp(-zwt_actual/this%zwt0_gdc(g)) + this%p3_gdc(g)*qflx_surf_lag_col(c) + else + finundated(c) = this%p3_gdc(g)*qflx_surf_lag_col(c) + end if + case ( finundation_mtd_TWS_inversion ) + finundated(c) = this%fws_slope_gdc(g) * tws(g) + this%fws_intercept_gdc(g) + end select + finundated(c) = min( 1.0_r8, max( 0.0_r8, finundated(c) ) ) + end do + end associate + + end subroutine CalcFinundated + !============================================================================== + + subroutine ReadNML(this, bounds, NLFilename) + ! + ! Read the namelist data stream information. + ! + ! Uses: + use clm_time_manager , only : get_calendar + use ncdio_pio , only : pio_subsystem + use shr_pio_mod , only : shr_pio_getiotype + use shr_nl_mod , only : shr_nl_find_group_name + use shr_log_mod , only : errMsg => shr_log_errMsg + use shr_mpi_mod , only : shr_mpi_bcast + use fileutils , only : getavu, relavu + use ch4varcon , only : finundation_mtd_ZWT_inversion, finundation_mtd_TWS_inversion + ! + ! arguments + implicit none + class(streamcontrol_type) :: this + type(bounds_type), intent(in) :: bounds + character(len=*), intent(in) :: NLFilename ! Namelist filename + ! + ! local variables + integer :: nu_nml ! unit for namelist file + integer :: nml_error ! namelist i/o error flag + character(len=CL) :: stream_fldFileName_ch4finundated = ' ' + character(len=CL) :: ch4finundatedmapalgo = 'bilinear' + character(len=*), parameter :: namelist_name = 'ch4finundated' ! MUST agree with name in namelist and read + character(len=*), parameter :: shr_strdata_unset = 'NOT_SET' + character(len=*), parameter :: subName = "('ch4finundated::ReadNML')" + character(len=*), parameter :: F00 = "('(ch4finundated_readnml) ',4a)" + !----------------------------------------------------------------------- + + namelist /ch4finundated/ & ! MUST agree with namelist_name above + ch4finundatedmapalgo, stream_fldFileName_ch4finundated + + ! Default values for namelist + + ! Read ch4finundated namelist + if (masterproc) then + nu_nml = getavu() + open( nu_nml, file=trim(NLFilename), status='old', iostat=nml_error ) + call shr_nl_find_group_name(nu_nml, namelist_name, status=nml_error) + if (nml_error == 0) then + read(nu_nml, nml=ch4finundated,iostat=nml_error) ! MUST agree with namelist_name above + if (nml_error /= 0) then + call endrun(msg=' ERROR reading '//namelist_name//' namelist'//errMsg(sourcefile, __LINE__)) + end if + else + call endrun(msg=' ERROR finding '//namelist_name//' namelist'//errMsg(sourcefile, __LINE__)) + end if + close(nu_nml) + call relavu( nu_nml ) + endif + + call shr_mpi_bcast(stream_fldFileName_ch4finundated, mpicom) + call shr_mpi_bcast(ch4finundatedmapalgo , mpicom) + + if (masterproc) then + write(iulog,*) ' ' + write(iulog,*) namelist_name, ' stream settings:' + write(iulog,*) ' stream_fldFileName_ch4finundated = ',stream_fldFileName_ch4finundated + write(iulog,*) ' ch4finundatedmapalgo = ',ch4finundatedmapalgo + write(iulog,*) ' ' + endif + this%stream_fldFileName_ch4finundated = stream_fldFileName_ch4finundated + this%ch4finundatedmapalgo = ch4finundatedmapalgo + if ( finundation_mtd == finundation_mtd_ZWT_inversion )then + this%fldList = "ZWT0:F0:P3" + else if ( finundation_mtd == finundation_mtd_TWS_inversion )then + this%fldList = "FWS_TWS_A:FWS_TWS_B" + else + call endrun(msg=' ERROR do NOT know what list of variables to read for this finundation_mtd type'// & + errMsg(sourcefile, __LINE__)) + end if + + end subroutine ReadNML + +end module ch4FInundatedStreamType diff --git a/src/cpl/mct/clm_cpl_indices.F90 b/src/cpl/mct/clm_cpl_indices.F90 new file mode 100644 index 0000000000..09ed89e92d --- /dev/null +++ b/src/cpl/mct/clm_cpl_indices.F90 @@ -0,0 +1,330 @@ +module clm_cpl_indices + !----------------------------------------------------------------------- + ! !DESCRIPTION: + ! Module containing the indices for the fields passed between CLM and + ! the driver. Includes the River Transport Model fields (RTM) and the + ! fields needed by the land-ice component (sno). + ! + ! !USES: + + use shr_sys_mod, only : shr_sys_abort + implicit none + + SAVE + private ! By default make data private + ! + ! !PUBLIC MEMBER FUNCTIONS: + public :: clm_cpl_indices_set ! Set the coupler indices + ! + ! !PUBLIC DATA MEMBERS: + ! + integer , public :: glc_nec ! number of elevation classes for glacier_mec landunits + ! (from coupler) - must equal maxpatch_glc from namelist + + ! lnd -> drv (required) + + integer, public ::index_l2x_Flrl_rofsur ! lnd->rtm input liquid surface fluxes + integer, public ::index_l2x_Flrl_rofgwl ! lnd->rtm input liquid gwl fluxes + integer, public ::index_l2x_Flrl_rofsub ! lnd->rtm input liquid subsurface fluxes + integer, public ::index_l2x_Flrl_rofi ! lnd->rtm input frozen fluxes + integer, public ::index_l2x_Flrl_irrig ! irrigation withdrawal + + integer, public ::index_l2x_Sl_t ! temperature + integer, public ::index_l2x_Sl_tref ! 2m reference temperature + integer, public ::index_l2x_Sl_qref ! 2m reference specific humidity + integer, public ::index_l2x_Sl_avsdr ! albedo: direct , visible + integer, public ::index_l2x_Sl_anidr ! albedo: direct , near-ir + integer, public ::index_l2x_Sl_avsdf ! albedo: diffuse, visible + integer, public ::index_l2x_Sl_anidf ! albedo: diffuse, near-ir + integer, public ::index_l2x_Sl_snowh ! snow height + integer, public ::index_l2x_Sl_u10 ! 10m wind + integer, public ::index_l2x_Sl_ddvel ! dry deposition velocities (optional) + integer, public ::index_l2x_Sl_fv ! friction velocity + integer, public ::index_l2x_Sl_ram1 ! aerodynamical resistance + integer, public ::index_l2x_Sl_soilw ! volumetric soil water + integer, public ::index_l2x_Fall_taux ! wind stress, zonal + integer, public ::index_l2x_Fall_tauy ! wind stress, meridional + integer, public ::index_l2x_Fall_lat ! latent heat flux + integer, public ::index_l2x_Fall_sen ! sensible heat flux + integer, public ::index_l2x_Fall_lwup ! upward longwave heat flux + integer, public ::index_l2x_Fall_evap ! evaporation water flux + integer, public ::index_l2x_Fall_swnet ! heat flux shortwave net + integer, public ::index_l2x_Fall_fco2_lnd ! co2 flux **For testing set to 0 + integer, public ::index_l2x_Fall_flxdst1 ! dust flux size bin 1 + integer, public ::index_l2x_Fall_flxdst2 ! dust flux size bin 2 + integer, public ::index_l2x_Fall_flxdst3 ! dust flux size bin 3 + integer, public ::index_l2x_Fall_flxdst4 ! dust flux size bin 4 + integer, public ::index_l2x_Fall_flxvoc ! MEGAN fluxes + integer, public ::index_l2x_Fall_flxfire ! Fire fluxes + integer, public ::index_l2x_Sl_ztopfire ! Top of fire emissions (m) + + ! In the following, index 0 is bare land, other indices are glc elevation classes + integer, allocatable, public ::index_l2x_Sl_tsrf(:) ! glc MEC temperature + integer, allocatable, public ::index_l2x_Sl_topo(:) ! glc MEC topo height + integer, allocatable, public ::index_l2x_Flgl_qice(:) ! glc MEC ice flux + + integer, public ::index_x2l_Sa_methane + integer, public ::index_l2x_Fall_methane + + integer, public :: nflds_l2x = 0 + + ! drv -> lnd (required) + + integer, public ::index_x2l_Sa_z ! bottom atm level height + integer, public ::index_x2l_Sa_topo ! atm surface height (m) + integer, public ::index_x2l_Sa_u ! bottom atm level zon wind + integer, public ::index_x2l_Sa_v ! bottom atm level mer wind + integer, public ::index_x2l_Sa_ptem ! bottom atm level pot temp + integer, public ::index_x2l_Sa_shum ! bottom atm level spec hum + integer, public ::index_x2l_Sa_pbot ! bottom atm level pressure + integer, public ::index_x2l_Sa_tbot ! bottom atm level temp + integer, public ::index_x2l_Faxa_lwdn ! downward lw heat flux + integer, public ::index_x2l_Faxa_rainc ! prec: liquid "convective" + integer, public ::index_x2l_Faxa_rainl ! prec: liquid "large scale" + integer, public ::index_x2l_Faxa_snowc ! prec: frozen "convective" + integer, public ::index_x2l_Faxa_snowl ! prec: frozen "large scale" + integer, public ::index_x2l_Faxa_swndr ! sw: nir direct downward + integer, public ::index_x2l_Faxa_swvdr ! sw: vis direct downward + integer, public ::index_x2l_Faxa_swndf ! sw: nir diffuse downward + integer, public ::index_x2l_Faxa_swvdf ! sw: vis diffuse downward + integer, public ::index_x2l_Sa_co2prog ! bottom atm level prognostic co2 + integer, public ::index_x2l_Sa_co2diag ! bottom atm level diagnostic co2 + integer, public ::index_x2l_Faxa_bcphidry ! flux: Black Carbon hydrophilic dry deposition + integer, public ::index_x2l_Faxa_bcphodry ! flux: Black Carbon hydrophobic dry deposition + integer, public ::index_x2l_Faxa_bcphiwet ! flux: Black Carbon hydrophilic wet deposition + integer, public ::index_x2l_Faxa_ocphidry ! flux: Organic Carbon hydrophilic dry deposition + integer, public ::index_x2l_Faxa_ocphodry ! flux: Organic Carbon hydrophobic dry deposition + integer, public ::index_x2l_Faxa_ocphiwet ! flux: Organic Carbon hydrophilic dry deposition + integer, public ::index_x2l_Faxa_dstwet1 ! flux: Size 1 dust -- wet deposition + integer, public ::index_x2l_Faxa_dstwet2 ! flux: Size 2 dust -- wet deposition + integer, public ::index_x2l_Faxa_dstwet3 ! flux: Size 3 dust -- wet deposition + integer, public ::index_x2l_Faxa_dstwet4 ! flux: Size 4 dust -- wet deposition + integer, public ::index_x2l_Faxa_dstdry1 ! flux: Size 1 dust -- dry deposition + integer, public ::index_x2l_Faxa_dstdry2 ! flux: Size 2 dust -- dry deposition + integer, public ::index_x2l_Faxa_dstdry3 ! flux: Size 3 dust -- dry deposition + integer, public ::index_x2l_Faxa_dstdry4 ! flux: Size 4 dust -- dry deposition + + integer, public ::index_x2l_Faxa_nhx ! flux nhx from atm + integer, public ::index_x2l_Faxa_noy ! flux noy from atm + + integer, public ::index_x2l_Flrr_flood ! rtm->lnd rof flood flux + integer, public ::index_x2l_Flrr_volr ! rtm->lnd rof volr total volume + integer, public ::index_x2l_Flrr_volrmch ! rtm->lnd rof volr main channel volume + + ! In the following, index 0 is bare land, other indices are glc elevation classes + integer, allocatable, public ::index_x2l_Sg_ice_covered(:) ! Fraction of glacier from glc model + integer, allocatable, public ::index_x2l_Sg_topo(:) ! Topo height from glc model + integer, allocatable, public ::index_x2l_Flgg_hflx(:) ! Heat flux from glc model + + integer, public ::index_x2l_Sg_icemask + integer, public ::index_x2l_Sg_icemask_coupled_fluxes + + integer, public :: nflds_x2l = 0 + + !----------------------------------------------------------------------- + +contains + + !----------------------------------------------------------------------- + subroutine clm_cpl_indices_set( ) + ! + ! !DESCRIPTION: + ! Set the coupler indices needed by the land model coupler + ! interface. + ! + ! !USES: + use seq_flds_mod , only: seq_flds_x2l_fields, seq_flds_l2x_fields + use mct_mod , only: mct_aVect, mct_aVect_init, mct_avect_indexra + use mct_mod , only: mct_aVect_clean, mct_avect_nRattr + use shr_drydep_mod , only: drydep_fields_token, n_drydep + use shr_megan_mod , only: shr_megan_fields_token, shr_megan_mechcomps_n + use shr_fire_emis_mod,only: shr_fire_emis_fields_token, shr_fire_emis_ztop_token, shr_fire_emis_mechcomps_n + use clm_varctl , only: ndep_from_cpl + use glc_elevclass_mod, only: glc_get_num_elevation_classes, glc_elevclass_as_string + ! + ! !ARGUMENTS: + implicit none + ! + ! !REVISION HISTORY: + ! Author: Mariana Vertenstein + ! 01/2011, Erik Kluzek: Added protex headers + ! + ! !LOCAL VARIABLES: + type(mct_aVect) :: l2x ! temporary, land to coupler + type(mct_aVect) :: x2l ! temporary, coupler to land + integer :: num + character(len=:), allocatable :: nec_str ! string version of glc elev. class number + character(len=64) :: name + character(len=32) :: subname = 'clm_cpl_indices_set' ! subroutine name + !----------------------------------------------------------------------- + + ! Determine attribute vector indices + + ! create temporary attribute vectors + call mct_aVect_init(x2l, rList=seq_flds_x2l_fields, lsize=1) + nflds_x2l = mct_avect_nRattr(x2l) + + call mct_aVect_init(l2x, rList=seq_flds_l2x_fields, lsize=1) + nflds_l2x = mct_avect_nRattr(l2x) + + !------------------------------------------------------------- + ! clm -> drv + !------------------------------------------------------------- + + index_l2x_Flrl_rofsur = mct_avect_indexra(l2x,'Flrl_rofsur') + index_l2x_Flrl_rofgwl = mct_avect_indexra(l2x,'Flrl_rofgwl') + index_l2x_Flrl_rofsub = mct_avect_indexra(l2x,'Flrl_rofsub') + index_l2x_Flrl_rofi = mct_avect_indexra(l2x,'Flrl_rofi') + index_l2x_Flrl_irrig = mct_avect_indexra(l2x,'Flrl_irrig') + + index_l2x_Sl_t = mct_avect_indexra(l2x,'Sl_t') + index_l2x_Sl_snowh = mct_avect_indexra(l2x,'Sl_snowh') + index_l2x_Sl_avsdr = mct_avect_indexra(l2x,'Sl_avsdr') + index_l2x_Sl_anidr = mct_avect_indexra(l2x,'Sl_anidr') + index_l2x_Sl_avsdf = mct_avect_indexra(l2x,'Sl_avsdf') + index_l2x_Sl_anidf = mct_avect_indexra(l2x,'Sl_anidf') + index_l2x_Sl_tref = mct_avect_indexra(l2x,'Sl_tref') + index_l2x_Sl_qref = mct_avect_indexra(l2x,'Sl_qref') + index_l2x_Sl_u10 = mct_avect_indexra(l2x,'Sl_u10') + index_l2x_Sl_ram1 = mct_avect_indexra(l2x,'Sl_ram1') + index_l2x_Sl_fv = mct_avect_indexra(l2x,'Sl_fv') + index_l2x_Sl_soilw = mct_avect_indexra(l2x,'Sl_soilw',perrwith='quiet') + + if ( n_drydep>0 )then + index_l2x_Sl_ddvel = mct_avect_indexra(l2x, trim(drydep_fields_token)) + else + index_l2x_Sl_ddvel = 0 + end if + + index_l2x_Fall_taux = mct_avect_indexra(l2x,'Fall_taux') + index_l2x_Fall_tauy = mct_avect_indexra(l2x,'Fall_tauy') + index_l2x_Fall_lat = mct_avect_indexra(l2x,'Fall_lat') + index_l2x_Fall_sen = mct_avect_indexra(l2x,'Fall_sen') + index_l2x_Fall_lwup = mct_avect_indexra(l2x,'Fall_lwup') + index_l2x_Fall_evap = mct_avect_indexra(l2x,'Fall_evap') + index_l2x_Fall_swnet = mct_avect_indexra(l2x,'Fall_swnet') + index_l2x_Fall_flxdst1 = mct_avect_indexra(l2x,'Fall_flxdst1') + index_l2x_Fall_flxdst2 = mct_avect_indexra(l2x,'Fall_flxdst2') + index_l2x_Fall_flxdst3 = mct_avect_indexra(l2x,'Fall_flxdst3') + index_l2x_Fall_flxdst4 = mct_avect_indexra(l2x,'Fall_flxdst4') + + index_l2x_Fall_fco2_lnd = mct_avect_indexra(l2x,'Fall_fco2_lnd',perrwith='quiet') + + index_l2x_Fall_methane = mct_avect_indexra(l2x,'Fall_methane',perrWith='quiet') + + ! MEGAN fluxes + if (shr_megan_mechcomps_n>0) then + index_l2x_Fall_flxvoc = mct_avect_indexra(l2x,trim(shr_megan_fields_token)) + else + index_l2x_Fall_flxvoc = 0 + endif + + ! Fire fluxes + if (shr_fire_emis_mechcomps_n>0) then + index_l2x_Fall_flxfire = mct_avect_indexra(l2x,trim(shr_fire_emis_fields_token)) + index_l2x_Sl_ztopfire = mct_avect_indexra(l2x,trim(shr_fire_emis_ztop_token)) + else + index_l2x_Fall_flxfire = 0 + index_l2x_Sl_ztopfire = 0 + endif + + !------------------------------------------------------------- + ! drv -> clm + !------------------------------------------------------------- + + index_x2l_Sa_z = mct_avect_indexra(x2l,'Sa_z') + index_x2l_Sa_topo = mct_avect_indexra(x2l,'Sa_topo') + index_x2l_Sa_u = mct_avect_indexra(x2l,'Sa_u') + index_x2l_Sa_v = mct_avect_indexra(x2l,'Sa_v') + index_x2l_Sa_ptem = mct_avect_indexra(x2l,'Sa_ptem') + index_x2l_Sa_pbot = mct_avect_indexra(x2l,'Sa_pbot') + index_x2l_Sa_tbot = mct_avect_indexra(x2l,'Sa_tbot') + index_x2l_Sa_shum = mct_avect_indexra(x2l,'Sa_shum') + index_x2l_Sa_co2prog = mct_avect_indexra(x2l,'Sa_co2prog',perrwith='quiet') + index_x2l_Sa_co2diag = mct_avect_indexra(x2l,'Sa_co2diag',perrwith='quiet') + + index_x2l_Sa_methane = mct_avect_indexra(x2l,'Sa_methane',perrWith='quiet') + + index_x2l_Flrr_volr = mct_avect_indexra(x2l,'Flrr_volr') + index_x2l_Flrr_volrmch = mct_avect_indexra(x2l,'Flrr_volrmch') + + index_x2l_Faxa_lwdn = mct_avect_indexra(x2l,'Faxa_lwdn') + index_x2l_Faxa_rainc = mct_avect_indexra(x2l,'Faxa_rainc') + index_x2l_Faxa_rainl = mct_avect_indexra(x2l,'Faxa_rainl') + index_x2l_Faxa_snowc = mct_avect_indexra(x2l,'Faxa_snowc') + index_x2l_Faxa_snowl = mct_avect_indexra(x2l,'Faxa_snowl') + index_x2l_Faxa_swndr = mct_avect_indexra(x2l,'Faxa_swndr') + index_x2l_Faxa_swvdr = mct_avect_indexra(x2l,'Faxa_swvdr') + index_x2l_Faxa_swndf = mct_avect_indexra(x2l,'Faxa_swndf') + index_x2l_Faxa_swvdf = mct_avect_indexra(x2l,'Faxa_swvdf') + index_x2l_Faxa_bcphidry = mct_avect_indexra(x2l,'Faxa_bcphidry') + index_x2l_Faxa_bcphodry = mct_avect_indexra(x2l,'Faxa_bcphodry') + index_x2l_Faxa_bcphiwet = mct_avect_indexra(x2l,'Faxa_bcphiwet') + index_x2l_Faxa_ocphidry = mct_avect_indexra(x2l,'Faxa_ocphidry') + index_x2l_Faxa_ocphodry = mct_avect_indexra(x2l,'Faxa_ocphodry') + index_x2l_Faxa_ocphiwet = mct_avect_indexra(x2l,'Faxa_ocphiwet') + index_x2l_Faxa_dstdry1 = mct_avect_indexra(x2l,'Faxa_dstdry1') + index_x2l_Faxa_dstdry2 = mct_avect_indexra(x2l,'Faxa_dstdry2') + index_x2l_Faxa_dstdry3 = mct_avect_indexra(x2l,'Faxa_dstdry3') + index_x2l_Faxa_dstdry4 = mct_avect_indexra(x2l,'Faxa_dstdry4') + index_x2l_Faxa_dstwet1 = mct_avect_indexra(x2l,'Faxa_dstwet1') + index_x2l_Faxa_dstwet2 = mct_avect_indexra(x2l,'Faxa_dstwet2') + index_x2l_Faxa_dstwet3 = mct_avect_indexra(x2l,'Faxa_dstwet3') + index_x2l_Faxa_dstwet4 = mct_avect_indexra(x2l,'Faxa_dstwet4') + + index_x2l_Faxa_nhx = mct_avect_indexra(x2l,'Faxa_nhx', perrWith='quiet') + index_x2l_Faxa_noy = mct_avect_indexra(x2l,'Faxa_noy', perrWith='quiet') + + if (index_x2l_Faxa_nhx > 0 .and. index_x2l_Faxa_noy > 0) then + ndep_from_cpl = .true. + end if + + index_x2l_Flrr_flood = mct_avect_indexra(x2l,'Flrr_flood') + + !------------------------------------------------------------- + ! glc coupling + !------------------------------------------------------------- + + index_x2l_Sg_icemask = mct_avect_indexra(x2l,'Sg_icemask') + index_x2l_Sg_icemask_coupled_fluxes = mct_avect_indexra(x2l,'Sg_icemask_coupled_fluxes') + + glc_nec = glc_get_num_elevation_classes() + if (glc_nec < 1) then + call shr_sys_abort('ERROR: In CLM4.5 and later, glc_nec must be at least 1.') + end if + + ! Create coupling fields for all glc elevation classes (1:glc_nec) plus bare land + ! (index 0). + allocate(index_l2x_Sl_tsrf(0:glc_nec)) + allocate(index_l2x_Sl_topo(0:glc_nec)) + allocate(index_l2x_Flgl_qice(0:glc_nec)) + allocate(index_x2l_Sg_ice_covered(0:glc_nec)) + allocate(index_x2l_Sg_topo(0:glc_nec)) + allocate(index_x2l_Flgg_hflx(0:glc_nec)) + + do num = 0,glc_nec + nec_str = glc_elevclass_as_string(num) + + name = 'Sg_ice_covered' // nec_str + index_x2l_Sg_ice_covered(num) = mct_avect_indexra(x2l,trim(name)) + name = 'Sg_topo' // nec_str + index_x2l_Sg_topo(num) = mct_avect_indexra(x2l,trim(name)) + name = 'Flgg_hflx' // nec_str + index_x2l_Flgg_hflx(num) = mct_avect_indexra(x2l,trim(name)) + + name = 'Sl_tsrf' // nec_str + index_l2x_Sl_tsrf(num) = mct_avect_indexra(l2x,trim(name)) + name = 'Sl_topo' // nec_str + index_l2x_Sl_topo(num) = mct_avect_indexra(l2x,trim(name)) + name = 'Flgl_qice' // nec_str + index_l2x_Flgl_qice(num) = mct_avect_indexra(l2x,trim(name)) + end do + + call mct_aVect_clean(x2l) + call mct_aVect_clean(l2x) + + end subroutine clm_cpl_indices_set + +!======================================================================= + +end module clm_cpl_indices diff --git a/src/cpl/mct/laiStreamMod.F90 b/src/cpl/mct/laiStreamMod.F90 new file mode 100644 index 0000000000..47d25287b7 --- /dev/null +++ b/src/cpl/mct/laiStreamMod.F90 @@ -0,0 +1,241 @@ +module laiStreamMod + +#include "shr_assert.h" + + !----------------------------------------------------------------------- + ! !DESCRIPTION: + ! Read LAI from stream + ! + ! !USES: + use shr_strdata_mod , only : shr_strdata_type, shr_strdata_create + use shr_strdata_mod , only : shr_strdata_print, shr_strdata_advance + use shr_kind_mod , only : r8=>shr_kind_r8, CL=>shr_kind_CL, CS=>shr_kind_CS, CXX=>shr_kind_CXX + use shr_log_mod , only : errMsg => shr_log_errMsg + use decompMod , only : bounds_type + use abortutils , only : endrun + use clm_varctl , only : iulog, inst_name + use perf_mod , only : t_startf, t_stopf + use spmdMod , only : masterproc, mpicom, comp_id + use ncdio_pio + use mct_mod + ! + ! !PUBLIC TYPES: + implicit none + private + + ! !PUBLIC MEMBER FUNCTIONS: + public :: lai_init ! position datasets for LAI + public :: lai_advance ! Advance the LAI streams (outside of a Open-MP threading loop) + public :: lai_interp ! interpolates between two years of LAI data (when LAI streams + + ! !PRIVATE MEMBER DATA: + integer, allocatable :: g_to_ig(:) ! Array matching gridcell index to data index + type(shr_strdata_type) :: sdat_lai ! LAI input data stream + + character(len=*), parameter :: sourcefile = & + __FILE__ + +!============================================================================== +contains +!============================================================================== + + subroutine lai_init(bounds) + ! + ! Initialize data stream information for LAI. + ! + ! !USES: + use clm_time_manager , only : get_calendar + use ncdio_pio , only : pio_subsystem + use shr_pio_mod , only : shr_pio_getiotype + use shr_stream_mod , only : shr_stream_file_null + use shr_string_mod , only : shr_string_listCreateField + use clm_nlUtilsMod , only : find_nlgroup_name + use ndepStreamMod , only : clm_domain_mct + use histFileMod , only : hist_addfld1d + use domainMod , only : ldomain + use controlMod , only : NLFilename + use lnd_set_decomp_and_domain , only : gsmap_global + ! + ! !ARGUMENTS: + implicit none + type(bounds_type), intent(in) :: bounds ! bounds + ! + ! !LOCAL VARIABLES: + integer :: stream_year_first_lai ! first year in Lai stream to use + integer :: stream_year_last_lai ! last year in Lai stream to use + integer :: model_year_align_lai ! align stream_year_first_lai with + integer :: nu_nml ! unit for namelist file + integer :: nml_error ! namelist i/o error flag + type(mct_ggrid) :: dom_clm ! domain information + character(len=CL) :: stream_fldFileName_lai ! lai stream filename to read + character(len=CL) :: lai_mapalgo = 'bilinear' ! Mapping alogrithm + character(len=CL) :: lai_tintalgo = 'linear' ! Time interpolation alogrithm + character(len=CXX) :: fldList ! field string + character(*), parameter :: laiString = "LAI" ! base string for field string + integer , parameter :: numLaiFields = 16 ! number of fields to build field string + character(*), parameter :: subName = "('laidyn_init')" + !----------------------------------------------------------------------- + ! + ! deal with namelist variables here in init + ! + namelist /lai_streams/ & + stream_year_first_lai, & + stream_year_last_lai, & + model_year_align_lai, & + lai_mapalgo, & + stream_fldFileName_lai, & + lai_tintalgo + + ! Default values for namelist + stream_year_first_lai = 1 ! first year in stream to use + stream_year_last_lai = 1 ! last year in stream to use + model_year_align_lai = 1 ! align stream_year_first_lai with this model year + stream_fldFileName_lai = shr_stream_file_null + + ! Read lai_streams namelist + if (masterproc) then + open( newunit=nu_nml, file=trim(NLFilename), status='old', iostat=nml_error ) + call find_nlgroup_name(nu_nml, 'lai_streams', status=nml_error) + if (nml_error == 0) then + read(nu_nml, nml=lai_streams,iostat=nml_error) + if (nml_error /= 0) then + call endrun(subname // ':: ERROR reading lai_streams namelist') + end if + else + call endrun(subname // ':: ERROR finding lai_streams namelist') + end if + close(nu_nml) + endif + call shr_mpi_bcast(stream_year_first_lai , mpicom) + call shr_mpi_bcast(stream_year_last_lai , mpicom) + call shr_mpi_bcast(model_year_align_lai , mpicom) + call shr_mpi_bcast(stream_fldFileName_lai , mpicom) + call shr_mpi_bcast(lai_tintalgo , mpicom) + + if (masterproc) then + write(iulog,*) ' ' + write(iulog,*) 'lai_stream settings:' + write(iulog,*) ' stream_year_first_lai = ',stream_year_first_lai + write(iulog,*) ' stream_year_last_lai = ',stream_year_last_lai + write(iulog,*) ' model_year_align_lai = ',model_year_align_lai + write(iulog,*) ' stream_fldFileName_lai = ',trim(stream_fldFileName_lai) + write(iulog,*) ' lai_tintalgo = ',trim(lai_tintalgo) + endif + + call clm_domain_mct (bounds, dom_clm) + + ! create the field list for these lai fields...use in shr_strdata_create + fldList = shr_string_listCreateField( numLaiFields, laiString ) + + call shr_strdata_create(sdat_lai,name="laidyn", & + pio_subsystem=pio_subsystem, & + pio_iotype=shr_pio_getiotype(inst_name), & + mpicom=mpicom, compid=comp_id, & + gsmap=gsmap_global, ggrid=dom_clm, & + nxg=ldomain%ni, nyg=ldomain%nj, & + yearFirst=stream_year_first_lai, & + yearLast=stream_year_last_lai, & + yearAlign=model_year_align_lai, & + offset=0, & + domFilePath='', & + domFileName=trim(stream_fldFileName_lai), & + domTvarName='time', & + domXvarName='lon' , & + domYvarName='lat' , & + domAreaName='area', & + domMaskName='mask', & + filePath='', & + filename=(/stream_fldFileName_lai/), & + fldListFile=fldList, & + fldListModel=fldList, & + fillalgo='none', & + mapalgo=lai_mapalgo, & + tintalgo=lai_tintalgo, & + calendar=get_calendar(), & + taxmode='cycle' ) + + if (masterproc) then + call shr_strdata_print(sdat_lai,'LAI data') + endif + + end subroutine lai_init + + !============================================================================== + subroutine lai_advance( bounds ) + ! + ! Advance LAI streams + ! + ! !USES: + use clm_time_manager, only : get_curr_date + ! + ! !ARGUMENTS: + implicit none + type(bounds_type) , intent(in) :: bounds + ! + ! !LOCAL VARIABLES: + integer :: g, ig ! Indices + 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) + !----------------------------------------------------------------------- + + call get_curr_date(year, mon, day, sec) + mcdate = year*10000 + mon*100 + day + + call shr_strdata_advance(sdat_lai, mcdate, sec, mpicom, 'laidyn') + if ( .not. allocated(g_to_ig) )then + allocate (g_to_ig(bounds%begg:bounds%endg) ) + ig = 0 + do g = bounds%begg,bounds%endg + ig = ig+1 + g_to_ig(g) = ig + end do + end if + + end subroutine lai_advance + + !============================================================================== + subroutine lai_interp(bounds, canopystate_inst) + ! + ! Interpolate data stream information for Lai. + ! + ! !USES: + use pftconMod , only : noveg + use CanopyStateType , only : canopystate_type + use PatchType , only : patch + ! + ! !ARGUMENTS: + implicit none + type(bounds_type) , intent(in) :: bounds + type(canopystate_type) , intent(inout) :: canopystate_inst + ! + ! !LOCAL VARIABLES: + integer :: ivt, p, ip, ig + character(len=CL) :: stream_var_name + !----------------------------------------------------------------------- + SHR_ASSERT_FL( (lbound(g_to_ig,1) <= bounds%begg ), sourcefile, __LINE__) + SHR_ASSERT_FL( (ubound(g_to_ig,1) >= bounds%endg ), sourcefile, __LINE__) + SHR_ASSERT_FL( (lbound(sdat_lai%avs(1)%rAttr,2) <= g_to_ig(bounds%begg) ), sourcefile, __LINE__) + SHR_ASSERT_FL( (ubound(sdat_lai%avs(1)%rAttr,2) >= g_to_ig(bounds%endg) ), sourcefile, __LINE__) + + do p = bounds%begp, bounds%endp + ivt = patch%itype(p) + ! Set lai for each gridcell/patch combination + if (ivt /= noveg) then + ! vegetated pft + write(stream_var_name,"(i6)") ivt + stream_var_name = 'LAI_'//trim(adjustl(stream_var_name)) + ip = mct_aVect_indexRA(sdat_lai%avs(1),trim(stream_var_name)) + ig = g_to_ig(patch%gridcell(p)) + canopystate_inst%tlai_patch(p) = sdat_lai%avs(1)%rAttr(ip,ig) + else + ! non-vegetated pft + canopystate_inst%tlai_patch(p) = 0._r8 + endif + end do + + end subroutine lai_interp + +end module LaiStreamMod diff --git a/src/cpl/mct/lnd_comp_mct.F90 b/src/cpl/mct/lnd_comp_mct.F90 new file mode 100644 index 0000000000..e50602a378 --- /dev/null +++ b/src/cpl/mct/lnd_comp_mct.F90 @@ -0,0 +1,632 @@ +module lnd_comp_mct + + !--------------------------------------------------------------------------- + ! !DESCRIPTION: + ! Interface of the active land model component of CESM the CLM (Community Land Model) + ! with the main CESM driver. This is a thin interface taking CESM driver information + ! in MCT (Model Coupling Toolkit) format and converting it to use by CLM. + ! + ! !uses: + use shr_kind_mod , only : r8 => shr_kind_r8 + use shr_sys_mod , only : shr_sys_flush + use shr_log_mod , only : errMsg => shr_log_errMsg + use mct_mod , only : mct_avect, mct_gsmap, mct_gGrid + use decompmod , only : bounds_type + use lnd_import_export, only : lnd_import, lnd_export + ! + ! !public member functions: + implicit none + private ! by default make data private + ! + ! !public member functions: + public :: lnd_init_mct ! clm initialization + public :: lnd_run_mct ! clm run phase + public :: lnd_final_mct ! clm finalization/cleanup + ! + ! !private member functions: + private :: lnd_domain_mct ! set the land model domain information + private :: lnd_handle_resume ! handle pause/resume signals from the coupler + + character(len=*), parameter, private :: sourcefile = & + __FILE__ + +!==================================================================================== +contains +!==================================================================================== + + subroutine lnd_init_mct( EClock, cdata_l, x2l_l, l2x_l, NLFilename ) + ! + ! !DESCRIPTION: + ! Initialize land surface model and obtain relevant atmospheric model arrays + ! back from (i.e. albedos, surface temperature and snow cover over land). + ! + ! !USES: + use shr_kind_mod , only : shr_kind_cl + use abortutils , only : endrun + use clm_time_manager , only : get_nstep, set_timemgr_init + use clm_initializeMod, only : initialize1, initialize2 + use clm_instMod , only : water_inst, lnd2atm_inst, lnd2glc_inst + use clm_varctl , only : finidat, single_column, clm_varctl_set, iulog + use clm_varctl , only : inst_index, inst_suffix, inst_name + use clm_varorb , only : eccen, obliqr, lambm0, mvelpp + use controlMod , only : control_setNL + use decompMod , only : get_proc_bounds + use domainMod , only : ldomain + use shr_file_mod , only : shr_file_setLogUnit, shr_file_setLogLevel + use shr_file_mod , only : shr_file_getLogUnit, shr_file_getLogLevel + use shr_file_mod , only : shr_file_getUnit, shr_file_setIO + use seq_cdata_mod , only : seq_cdata, seq_cdata_setptrs + use seq_timemgr_mod , only : seq_timemgr_EClockGetData + use seq_infodata_mod , only : seq_infodata_type, seq_infodata_GetData, seq_infodata_PutData, & + seq_infodata_start_type_start, seq_infodata_start_type_cont, & + seq_infodata_start_type_brnch + use seq_comm_mct , only : seq_comm_suffix, seq_comm_inst, seq_comm_name + use seq_flds_mod , only : seq_flds_x2l_fields, seq_flds_l2x_fields + use spmdMod , only : masterproc, spmd_init + use clm_varctl , only : nsrStartup, nsrContinue, nsrBranch + use clm_cpl_indices , only : clm_cpl_indices_set + use mct_mod , only : mct_aVect_init, mct_aVect_zero, mct_gsMap, mct_gsMap_init + use decompMod , only : gindex_global + use lnd_set_decomp_and_domain, only : lnd_set_decomp_and_domain_from_surfrd, gsmap_global + use ESMF + ! + ! !ARGUMENTS: + type(ESMF_Clock), intent(inout) :: EClock ! Input synchronization clock + type(seq_cdata), intent(inout) :: cdata_l ! Input land-model driver data + type(mct_aVect), intent(inout) :: x2l_l, l2x_l ! land model import and export states + character(len=*), optional, intent(in) :: NLFilename ! Namelist filename to read + ! + ! !LOCAL VARIABLES: + integer :: LNDID ! Land identifyer + integer :: mpicom_lnd ! MPI communicator + type(mct_gsMap), pointer :: GSMap_lnd ! Land model MCT GS map + type(mct_gGrid), pointer :: dom_l ! Land model domain + type(seq_infodata_type), pointer :: infodata ! CESM driver level info data + integer :: lsize ! size of attribute vector + integer :: gsize ! global size + integer :: g,i,j ! indices + integer :: dtime_sync ! coupling time-step from the input synchronization clock + logical :: exists ! true if file exists + logical :: atm_aero ! Flag if aerosol data sent from atm model + real(r8) :: scmlat ! single-column latitude + real(r8) :: scmlon ! single-column longitude + character(len=SHR_KIND_CL) :: caseid ! case identifier name + character(len=SHR_KIND_CL) :: ctitle ! case description title + character(len=SHR_KIND_CL) :: starttype ! start-type (startup, continue, branch, hybrid) + character(len=SHR_KIND_CL) :: calendar ! calendar type name + character(len=SHR_KIND_CL) :: hostname ! hostname of machine running on + character(len=SHR_KIND_CL) :: version ! Model version + character(len=SHR_KIND_CL) :: username ! user running the model + integer :: nsrest ! clm restart type + integer :: ref_ymd ! reference date (YYYYMMDD) + integer :: ref_tod ! reference time of day (sec) + integer :: start_ymd ! start date (YYYYMMDD) + integer :: start_tod ! start time of day (sec) + logical :: brnch_retain_casename ! flag if should retain the case name on a branch start type + integer :: lbnum ! input to memory diagnostic + integer :: shrlogunit,shrloglev ! old values for log unit and log level + type(bounds_type) :: bounds ! bounds + logical :: noland + integer :: ni,nj + real(r8) , parameter :: rundef = -9999999._r8 + character(len=32), parameter :: sub = 'lnd_init_mct' + character(len=*), parameter :: format = "('("//trim(sub)//") :',A)" + !----------------------------------------------------------------------- + + ! Set cdata data + call seq_cdata_setptrs(cdata_l, ID=LNDID, mpicom=mpicom_lnd, & + gsMap=GSMap_lnd, dom=dom_l, infodata=infodata) + + ! Determine attriute vector indices + call clm_cpl_indices_set() + + ! Initialize clm MPI communicator + call spmd_init( mpicom_lnd, LNDID ) + +#if (defined _MEMTRACE) + if(masterproc) then + lbnum=1 + call memmon_dump_fort('memmon.out','lnd_init_mct:start::',lbnum) + endif +#endif + + inst_name = seq_comm_name(LNDID) + inst_index = seq_comm_inst(LNDID) + inst_suffix = seq_comm_suffix(LNDID) + ! Initialize io log unit + + call shr_file_getLogUnit (shrlogunit) + if (masterproc) then + inquire(file='lnd_modelio.nml'//trim(inst_suffix),exist=exists) + if (exists) then + iulog = shr_file_getUnit() + call shr_file_setIO('lnd_modelio.nml'//trim(inst_suffix),iulog) + end if + write(iulog,format) "CLM land model initialization" + else + iulog = shrlogunit + end if + + call shr_file_getLogLevel(shrloglev) + call shr_file_setLogUnit (iulog) + + ! Use infodata to set orbital values + call seq_infodata_GetData( infodata, orb_eccen=eccen, orb_mvelpp=mvelpp, & + orb_lambm0=lambm0, orb_obliqr=obliqr ) + + ! Consistency check on namelist filename + call control_setNL("lnd_in"//trim(inst_suffix)) + + ! Initialize clm + ! initialize1 reads namelists + ! decomp and domain are set in lnd_set_decomp_and_domain_from_surfrd + ! initialize2 performs the rest of initialization + call seq_timemgr_EClockGetData(EClock, & + start_ymd=start_ymd, & + start_tod=start_tod, ref_ymd=ref_ymd, & + ref_tod=ref_tod, & + calendar=calendar, & + dtime=dtime_sync) + if (masterproc) then + write(iulog,*)'dtime = ',dtime_sync + end if + call seq_infodata_GetData(infodata, case_name=caseid, & + case_desc=ctitle, single_column=single_column, & + scmlat=scmlat, scmlon=scmlon, & + brnch_retain_casename=brnch_retain_casename, & + start_type=starttype, model_version=version, & + hostname=hostname, username=username ) + + ! Single Column + if ( single_column .and. (scmlat == rundef .or. scmlon == rundef ) ) then + call endrun(msg=' ERROR:: single column mode on -- but scmlat and scmlon are NOT set'//& + errMsg(sourcefile, __LINE__)) + end if + + ! Note that we assume that CTSM's internal dtime matches the coupling time step. + ! i.e., we currently do NOT allow sub-cycling within a coupling time step. + call set_timemgr_init( calendar_in=calendar, start_ymd_in=start_ymd, start_tod_in=start_tod, & + ref_ymd_in=ref_ymd, ref_tod_in=ref_tod, dtime_in=dtime_sync) + + if ( trim(starttype) == trim(seq_infodata_start_type_start)) then + nsrest = nsrStartup + else if (trim(starttype) == trim(seq_infodata_start_type_cont) ) then + nsrest = nsrContinue + else if (trim(starttype) == trim(seq_infodata_start_type_brnch)) then + nsrest = nsrBranch + else + call endrun( sub//' ERROR: unknown starttype' ) + end if + + ! set default values for run control variables + call clm_varctl_set(caseid_in=caseid, ctitle_in=ctitle, & + brnch_retain_casename_in=brnch_retain_casename, & + single_column_in=single_column, scmlat_in=scmlat, & + scmlon_in=scmlon, nsrest_in=nsrest, version_in=version, & + hostname_in=hostname, username_in=username) + + ! Read namelists + call initialize1(dtime=dtime_sync) + + ! Initialize decomposition and domain (ldomain) type + call lnd_set_decomp_and_domain_from_surfrd(noland, ni, nj) + + ! If no land then exit out of initialization + if ( noland ) then + + call seq_infodata_PutData( infodata, lnd_present =.false.) + call seq_infodata_PutData( infodata, lnd_prognostic=.false.) + + else + + ! Determine if aerosol and dust deposition come from atmosphere component + call seq_infodata_GetData(infodata, atm_aero=atm_aero ) + if ( .not. atm_aero )then + call endrun( sub//' ERROR: atmosphere model MUST send aerosols to CLM' ) + end if + + ! Initialize clm gsMap, clm domain and clm attribute vectors + call get_proc_bounds( bounds ) + lsize = bounds%endg - bounds%begg + 1 + gsize = ldomain%ni * ldomain%nj + call mct_gsMap_init( gsMap_lnd, gindex_global, mpicom_lnd, LNDID, lsize, gsize ) + gsmap_global => gsmap_lnd ! module variable in lnd_set_decomp_and_domain + call lnd_domain_mct( bounds, lsize, gsMap_lnd, dom_l ) + call mct_aVect_init(x2l_l, rList=seq_flds_x2l_fields, lsize=lsize) + call mct_aVect_zero(x2l_l) + call mct_aVect_init(l2x_l, rList=seq_flds_l2x_fields, lsize=lsize) + call mct_aVect_zero(l2x_l) + + ! Finish initializing clm + call initialize2(ni,nj) + + ! Create land export state + call lnd_export(bounds, water_inst%waterlnd2atmbulk_inst, lnd2atm_inst, lnd2glc_inst, l2x_l%rattr) + + ! Fill in infodata settings + call seq_infodata_PutData(infodata, lnd_prognostic=.true.) + call seq_infodata_PutData(infodata, lnd_nx=ldomain%ni, lnd_ny=ldomain%nj) + call lnd_handle_resume( cdata_l ) + + ! Reset shr logging to original values + call shr_file_setLogUnit (shrlogunit) + call shr_file_setLogLevel(shrloglev) + +#if (defined _MEMTRACE) + if(masterproc) then + write(iulog,*) TRIM(Sub) // ':end::' + lbnum=1 + call memmon_dump_fort('memmon.out','lnd_int_mct:end::',lbnum) + call memmon_reset_addr() + endif +#endif + end if + + end subroutine lnd_init_mct + + !==================================================================================== + subroutine lnd_run_mct(EClock, cdata_l, x2l_l, l2x_l) + ! + ! !DESCRIPTION: + ! Run clm model + ! + ! !USES: + use shr_kind_mod , only : r8 => shr_kind_r8 + use clm_instMod , only : water_inst, lnd2atm_inst, atm2lnd_inst, lnd2glc_inst, glc2lnd_inst + use clm_driver , only : clm_drv + use clm_time_manager, only : get_curr_date, get_nstep, get_curr_calday, get_step_size + use clm_time_manager, only : advance_timestep, update_rad_dtime + use decompMod , only : get_proc_bounds + use abortutils , only : endrun + use clm_varctl , only : iulog + use clm_varorb , only : eccen, obliqr, lambm0, mvelpp + use shr_file_mod , only : shr_file_setLogUnit, shr_file_setLogLevel + use shr_file_mod , only : shr_file_getLogUnit, shr_file_getLogLevel + use seq_cdata_mod , only : seq_cdata, seq_cdata_setptrs + use seq_timemgr_mod , only : seq_timemgr_EClockGetData, seq_timemgr_StopAlarmIsOn + use seq_timemgr_mod , only : seq_timemgr_RestartAlarmIsOn, seq_timemgr_EClockDateInSync + use seq_infodata_mod, only : seq_infodata_type, seq_infodata_GetData + use spmdMod , only : masterproc, mpicom + use perf_mod , only : t_startf, t_stopf, t_barrierf + use shr_orb_mod , only : shr_orb_decl + use ESMF + ! + ! !ARGUMENTS: + type(ESMF_Clock) , intent(inout) :: EClock ! Input synchronization clock from driver + type(seq_cdata) , intent(inout) :: cdata_l ! Input driver data for land model + type(mct_aVect) , intent(inout) :: x2l_l ! Import state to land model + type(mct_aVect) , intent(inout) :: l2x_l ! Export state from land model + ! + ! !LOCAL VARIABLES: + integer :: ymd_sync ! Sync date (YYYYMMDD) + integer :: yr_sync ! Sync current year + integer :: mon_sync ! Sync current month + integer :: day_sync ! Sync current day + integer :: tod_sync ! Sync current time of day (sec) + integer :: ymd ! CLM current date (YYYYMMDD) + integer :: yr ! CLM current year + integer :: mon ! CLM current month + integer :: day ! CLM current day + integer :: tod ! CLM current time of day (sec) + integer :: dtime ! time step increment (sec) + integer :: nstep ! time step index + logical :: rstwr_sync ! .true. ==> write restart file before returning + logical :: rstwr ! .true. ==> write restart file before returning + logical :: nlend_sync ! Flag signaling last time-step + logical :: nlend ! .true. ==> last time-step + logical :: dosend ! true => send data back to driver + logical :: doalb ! .true. ==> do albedo calculation on this time step + logical :: rof_prognostic ! .true. => running with a prognostic ROF model + logical :: glc_present ! .true. => running with a non-stub GLC model + real(r8) :: nextsw_cday ! calday from clock of next radiation computation + real(r8) :: caldayp1 ! clm calday plus dtime offset + integer :: shrlogunit,shrloglev ! old values for share log unit and log level + integer :: lbnum ! input to memory diagnostic + integer :: g,i,lsize ! counters + real(r8) :: calday ! calendar day for nstep + real(r8) :: declin ! solar declination angle in radians for nstep + real(r8) :: declinp1 ! solar declination angle in radians for nstep+1 + real(r8) :: eccf ! earth orbit eccentricity factor + real(r8) :: recip ! reciprical + logical,save :: first_call = .true. ! first call work + type(seq_infodata_type),pointer :: infodata ! CESM information from the driver + type(mct_gGrid), pointer :: dom_l ! Land model domain data + type(bounds_type) :: bounds ! bounds + character(len=32) :: rdate ! date char string for restart file names + character(len=32), parameter :: sub = "lnd_run_mct" + !--------------------------------------------------------------------------- + + ! Determine processor bounds + + call get_proc_bounds(bounds) + +#if (defined _MEMTRACE) + if(masterproc) then + lbnum=1 + call memmon_dump_fort('memmon.out','lnd_run_mct:start::',lbnum) + endif +#endif + + ! Reset shr logging to my log file + call shr_file_getLogUnit (shrlogunit) + call shr_file_getLogLevel(shrloglev) + call shr_file_setLogUnit (iulog) + + ! Determine time of next atmospheric shortwave calculation + call seq_cdata_setptrs(cdata_l, infodata=infodata, dom=dom_l) + call seq_timemgr_EClockGetData(EClock, & + curr_ymd=ymd, curr_tod=tod_sync, & + curr_yr=yr_sync, curr_mon=mon_sync, curr_day=day_sync) + call seq_infodata_GetData(infodata, nextsw_cday=nextsw_cday ) + + dtime = get_step_size() + + ! Handle pause/resume signals from coupler + call lnd_handle_resume( cdata_l ) + + write(rdate,'(i4.4,"-",i2.2,"-",i2.2,"-",i5.5)') yr_sync,mon_sync,day_sync,tod_sync + nlend_sync = seq_timemgr_StopAlarmIsOn( EClock ) + rstwr_sync = seq_timemgr_RestartAlarmIsOn( EClock ) + + ! Determine if we're running with a prognostic ROF model, and if we're running with a + ! non-stub GLC model. These won't change throughout the run, but we can't count on + ! their being set in initialization, so need to get them in the run method. + + call seq_infodata_GetData( infodata, & + rof_prognostic=rof_prognostic, & + glc_present=glc_present) + + ! Map MCT to land data type + ! Perform downscaling if appropriate + + + ! Map to clm (only when state and/or fluxes need to be updated) + + call t_startf ('lc_lnd_import') + call lnd_import( bounds, & + x2l = x2l_l%rattr, & + glc_present = glc_present, & + atm2lnd_inst = atm2lnd_inst, & + glc2lnd_inst = glc2lnd_inst, & + wateratm2lndbulk_inst = water_inst%wateratm2lndbulk_inst) + call t_stopf ('lc_lnd_import') + + ! Use infodata to set orbital values if updated mid-run + + call seq_infodata_GetData( infodata, orb_eccen=eccen, orb_mvelpp=mvelpp, & + orb_lambm0=lambm0, orb_obliqr=obliqr ) + + ! Loop over time steps in coupling interval + + dosend = .false. + do while(.not. dosend) + + ! Determine if dosend + ! When time is not updated at the beginning of the loop - then return only if + ! are in sync with clock before time is updated + ! + ! NOTE(wjs, 2020-03-09) I think the do while (.not. dosend) loop only is important + ! for the first time step (when we run 2 steps). After that, we now assume that we + ! run one time step per coupling interval (based on setting the model's dtime from + ! the driver). (According to Mariana Vertenstein, sub-cycling (running multiple + ! land model time steps per coupling interval) used to be supported, but hasn't + ! been fully supported for a long time.) We may want to rework this logic to make + ! this more explicit, or - ideally - get rid of this extra time step at the start + ! of the run, at which point I think we could do away with this looping entirely. + + call get_curr_date( yr, mon, day, tod ) + ymd = yr*10000 + mon*100 + day + tod = tod + dosend = (seq_timemgr_EClockDateInSync( EClock, ymd, tod)) + + ! Determine doalb based on nextsw_cday sent from atm model + + nstep = get_nstep() + caldayp1 = get_curr_calday(offset=dtime, reuse_day_365_for_day_366=.true.) + if (nstep == 0) then + doalb = .false. + else if (nstep == 1) then + doalb = (abs(nextsw_cday- caldayp1) < 1.e-10_r8) + else + doalb = (nextsw_cday >= -0.5_r8) + end if + call update_rad_dtime(doalb) + + ! Determine if time to write restart and stop + + rstwr = .false. + if (rstwr_sync .and. dosend) rstwr = .true. + nlend = .false. + if (nlend_sync .and. dosend) nlend = .true. + + ! Run clm + + call t_barrierf('sync_clm_run1', mpicom) + call t_startf ('clm_run') + call t_startf ('shr_orb_decl') + calday = get_curr_calday(reuse_day_365_for_day_366=.true.) + call shr_orb_decl( calday , eccen, mvelpp, lambm0, obliqr, declin , eccf ) + call shr_orb_decl( nextsw_cday, eccen, mvelpp, lambm0, obliqr, declinp1, eccf ) + call t_stopf ('shr_orb_decl') + call clm_drv(doalb, nextsw_cday, declinp1, declin, rstwr, nlend, rdate, rof_prognostic) + call t_stopf ('clm_run') + + ! Create l2x_l export state - add river runoff input to l2x_l if appropriate + + call t_startf ('lc_lnd_export') + call lnd_export(bounds, water_inst%waterlnd2atmbulk_inst, lnd2atm_inst, lnd2glc_inst, l2x_l%rattr) + call t_stopf ('lc_lnd_export') + + ! Advance clm time step + + call t_startf ('lc_clm2_adv_timestep') + call advance_timestep() + call t_stopf ('lc_clm2_adv_timestep') + + end do + + ! Check that internal clock is in sync with master clock + + call get_curr_date( yr, mon, day, tod, offset=-dtime ) + ymd = yr*10000 + mon*100 + day + tod = tod + if ( .not. seq_timemgr_EClockDateInSync( EClock, ymd, tod ) )then + call seq_timemgr_EclockGetData( EClock, curr_ymd=ymd_sync, curr_tod=tod_sync ) + write(iulog,*)' clm ymd=',ymd ,' clm tod= ',tod + write(iulog,*)'sync ymd=',ymd_sync,' sync tod= ',tod_sync + call endrun( sub//":: CLM clock not in sync with Master Sync clock" ) + end if + + ! Reset shr logging to my original values + + call shr_file_setLogUnit (shrlogunit) + call shr_file_setLogLevel(shrloglev) + +#if (defined _MEMTRACE) + if(masterproc) then + lbnum=1 + call memmon_dump_fort('memmon.out','lnd_run_mct:end::',lbnum) + call memmon_reset_addr() + endif +#endif + + first_call = .false. + + end subroutine lnd_run_mct + + !==================================================================================== + subroutine lnd_final_mct( EClock, cdata_l, x2l_l, l2x_l) + ! + ! !DESCRIPTION: + ! Finalize land surface model + + use seq_cdata_mod ,only : seq_cdata, seq_cdata_setptrs + use seq_timemgr_mod ,only : seq_timemgr_EClockGetData, seq_timemgr_StopAlarmIsOn + use seq_timemgr_mod ,only : seq_timemgr_RestartAlarmIsOn, seq_timemgr_EClockDateInSync + use esmf + ! + ! !ARGUMENTS: + type(ESMF_Clock) , intent(inout) :: EClock ! Input synchronization clock from driver + type(seq_cdata) , intent(inout) :: cdata_l ! Input driver data for land model + type(mct_aVect) , intent(inout) :: x2l_l ! Import state to land model + type(mct_aVect) , intent(inout) :: l2x_l ! Export state from land model + !--------------------------------------------------------------------------- + + ! fill this in + end subroutine lnd_final_mct + + !==================================================================================== + subroutine lnd_domain_mct( bounds, lsize, gsMap_l, dom_l ) + ! + ! !DESCRIPTION: + ! Send the land model domain information to the coupler + ! + ! !USES: + use clm_varcon , only: re + use domainMod , only: ldomain + use spmdMod , only: iam + use mct_mod , only: mct_gGrid_importIAttr + use mct_mod , only: mct_gGrid_importRAttr, mct_gGrid_init, mct_gsMap_orderedPoints + use seq_flds_mod, only: seq_flds_dom_coord, seq_flds_dom_other + ! + ! !ARGUMENTS: + type(bounds_type), intent(in) :: bounds ! bounds + integer , intent(in) :: lsize ! land model domain data size + type(mct_gsMap), intent(inout) :: gsMap_l ! Output land model MCT GS map + type(mct_ggrid), intent(out) :: dom_l ! Output domain information for land model + ! + ! Local Variables + integer :: g,i,j ! index + real(r8), pointer :: data(:) ! temporary + integer , pointer :: idata(:) ! temporary + !--------------------------------------------------------------------------- + ! + ! Initialize mct domain type + ! lat/lon in degrees, area in radians^2, mask is 1 (land), 0 (non-land) + ! Note that in addition land carries around landfrac for the purposes of domain checking + ! + call mct_gGrid_init( GGrid=dom_l, CoordChars=trim(seq_flds_dom_coord), & + OtherChars=trim(seq_flds_dom_other), lsize=lsize ) + ! + ! Allocate memory + ! + allocate(data(lsize)) + ! + ! Determine global gridpoint number attribute, GlobGridNum, which is set automatically by MCT + ! + call mct_gsMap_orderedPoints(gsMap_l, iam, idata) + call mct_gGrid_importIAttr(dom_l,'GlobGridNum',idata,lsize) + ! + ! Determine domain (numbering scheme is: West to East and South to North to South pole) + ! Initialize attribute vector with special value + ! + data(:) = -9999.0_R8 + call mct_gGrid_importRAttr(dom_l,"lat" ,data,lsize) + call mct_gGrid_importRAttr(dom_l,"lon" ,data,lsize) + call mct_gGrid_importRAttr(dom_l,"area" ,data,lsize) + call mct_gGrid_importRAttr(dom_l,"aream",data,lsize) + data(:) = 0.0_R8 + call mct_gGrid_importRAttr(dom_l,"mask" ,data,lsize) + ! + ! Fill in correct values for domain components + ! Note aream will be filled in in the atm-lnd mapper + ! + do g = bounds%begg,bounds%endg + i = 1 + (g - bounds%begg) + data(i) = ldomain%lonc(g) + end do + call mct_gGrid_importRattr(dom_l,"lon",data,lsize) + + do g = bounds%begg,bounds%endg + i = 1 + (g - bounds%begg) + data(i) = ldomain%latc(g) + end do + call mct_gGrid_importRattr(dom_l,"lat",data,lsize) + + do g = bounds%begg,bounds%endg + i = 1 + (g - bounds%begg) + data(i) = ldomain%area(g)/(re*re) + end do + call mct_gGrid_importRattr(dom_l,"area",data,lsize) + + do g = bounds%begg,bounds%endg + i = 1 + (g - bounds%begg) + data(i) = real(ldomain%mask(g), r8) + end do + call mct_gGrid_importRattr(dom_l,"mask",data,lsize) + + do g = bounds%begg,bounds%endg + i = 1 + (g - bounds%begg) + data(i) = real(ldomain%frac(g), r8) + end do + call mct_gGrid_importRattr(dom_l,"frac",data,lsize) + + deallocate(data) + deallocate(idata) + + end subroutine lnd_domain_mct + + !==================================================================================== + subroutine lnd_handle_resume( cdata_l ) + ! + ! !DESCRIPTION: + ! Handle resume signals for Data Assimilation (DA) + ! + ! !USES: + use clm_time_manager , only : update_DA_nstep + use seq_cdata_mod , only : seq_cdata, seq_cdata_setptrs + implicit none + ! !ARGUMENTS: + type(seq_cdata), intent(inout) :: cdata_l ! Input land-model driver data + ! !LOCAL VARIABLES: + logical :: resume_from_data_assim ! flag if we are resuming after data assimulation was done + !--------------------------------------------------------------------------- + + ! Check to see if restart was modified and we are resuming from data + ! assimilation + call seq_cdata_setptrs(cdata_l, post_assimilation=resume_from_data_assim) + if ( resume_from_data_assim ) call update_DA_nstep() + + end subroutine lnd_handle_resume + +end module lnd_comp_mct diff --git a/src/cpl/mct/lnd_import_export.F90 b/src/cpl/mct/lnd_import_export.F90 new file mode 100644 index 0000000000..537abd49d9 --- /dev/null +++ b/src/cpl/mct/lnd_import_export.F90 @@ -0,0 +1,354 @@ +module lnd_import_export + + use shr_kind_mod , only: r8 => shr_kind_r8, cl=>shr_kind_cl + use abortutils , only: endrun + use decompmod , only: bounds_type, subgrid_level_gridcell + use lnd2atmType , only: lnd2atm_type + use lnd2glcMod , only: lnd2glc_type + use atm2lndType , only: atm2lnd_type + use glc2lndMod , only: glc2lnd_type + use Waterlnd2atmBulkType , only: waterlnd2atmbulk_type + use Wateratm2lndBulkType , only: wateratm2lndbulk_type + use clm_cpl_indices + use GridcellType , only : grc + ! + implicit none + !=============================================================================== + +contains + + !=============================================================================== + subroutine lnd_import( bounds, x2l, glc_present, atm2lnd_inst, glc2lnd_inst, wateratm2lndbulk_inst) + + !--------------------------------------------------------------------------- + ! !DESCRIPTION: + ! Convert the input data from the coupler to the land model + ! + ! !USES: + use seq_flds_mod , only: seq_flds_x2l_fields + use clm_varctl , only: co2_type, co2_ppmv, iulog, use_c13 + use clm_varctl , only: ndep_from_cpl + use clm_varcon , only: c13ratio + use domainMod , only: ldomain + use lnd_import_export_utils, only : derive_quantities, check_for_errors, check_for_nans + ! + ! !ARGUMENTS: + type(bounds_type) , intent(in) :: bounds ! bounds + real(r8) , intent(in) :: x2l(:,:) ! driver import state to land model + logical , intent(in) :: glc_present ! .true. => running with a non-stub GLC model + type(atm2lnd_type) , intent(inout) :: atm2lnd_inst ! clm internal input data type + type(glc2lnd_type) , intent(inout) :: glc2lnd_inst ! clm internal input data type + type(wateratm2lndbulk_type), intent(inout) :: wateratm2lndbulk_inst ! clm internal input data type + ! + ! !LOCAL VARIABLES: + integer :: begg, endg ! bounds + integer :: g,i,k,nstep,ier ! indices, number of steps, and error code + real(r8) :: qsat_kg_kg ! saturation specific humidity (kg/kg) + real(r8) :: forc_pbot ! atmospheric pressure (Pa) + real(r8) :: forc_rainc(bounds%begg:bounds%endg) ! rainxy Atm flux mm/s + real(r8) :: forc_rainl(bounds%begg:bounds%endg) ! rainxy Atm flux mm/s + real(r8) :: forc_snowc(bounds%begg:bounds%endg) ! snowfxy Atm flux mm/s + real(r8) :: forc_snowl(bounds%begg:bounds%endg) ! snowfxl Atm flux mm/s + real(r8) :: co2_ppmv_diag ! temporary + real(r8) :: co2_ppmv_prog ! temporary + real(r8) :: co2_ppmv_val ! temporary + integer :: co2_type_idx ! integer flag for co2_type options + character(len=32) :: fname ! name of field that is NaN + character(len=32), parameter :: sub = 'lnd_import' + + !--------------------------------------------------------------------------- + + ! Set bounds + begg = bounds%begg; endg = bounds%endg + + co2_type_idx = 0 + if (co2_type == 'prognostic') then + co2_type_idx = 1 + else if (co2_type == 'diagnostic') then + co2_type_idx = 2 + end if + if (co2_type == 'prognostic' .and. index_x2l_Sa_co2prog == 0) then + call endrun( sub//' ERROR: must have nonzero index_x2l_Sa_co2prog for co2_type equal to prognostic' ) + else if (co2_type == 'diagnostic' .and. index_x2l_Sa_co2diag == 0) then + call endrun( sub//' ERROR: must have nonzero index_x2l_Sa_co2diag for co2_type equal to diagnostic' ) + end if + + ! Note that the precipitation fluxes received from the coupler + ! are in units of kg/s/m^2. To convert these precipitation rates + ! in units of mm/sec, one must divide by 1000 kg/m^3 and multiply + ! by 1000 mm/m resulting in an overall factor of unity. + ! Below the units are therefore given in mm/s. + + do g = begg,endg + i = 1 + (g - begg) + + ! Determine flooding input, sign convention is positive downward and + ! hierarchy is atm/glc/lnd/rof/ice/ocn. so water sent from rof to land is negative, + ! change the sign to indicate addition of water to system. + + wateratm2lndbulk_inst%forc_flood_grc(g) = -x2l(index_x2l_Flrr_flood,i) + + wateratm2lndbulk_inst%volr_grc(g) = x2l(index_x2l_Flrr_volr,i) * (ldomain%area(g) * 1.e6_r8) + wateratm2lndbulk_inst%volrmch_grc(g)= x2l(index_x2l_Flrr_volrmch,i) * (ldomain%area(g) * 1.e6_r8) + + ! Determine required receive fields + + atm2lnd_inst%forc_hgt_grc(g) = x2l(index_x2l_Sa_z,i) ! zgcmxy Atm state m + atm2lnd_inst%forc_topo_grc(g) = x2l(index_x2l_Sa_topo,i) ! Atm surface height (m) + atm2lnd_inst%forc_u_grc(g) = x2l(index_x2l_Sa_u,i) ! forc_uxy Atm state m/s + atm2lnd_inst%forc_v_grc(g) = x2l(index_x2l_Sa_v,i) ! forc_vxy Atm state m/s + atm2lnd_inst%forc_solad_not_downscaled_grc(g,2) = x2l(index_x2l_Faxa_swndr,i) ! forc_sollxy Atm flux W/m^2 + atm2lnd_inst%forc_solad_not_downscaled_grc(g,1) = x2l(index_x2l_Faxa_swvdr,i) ! forc_solsxy Atm flux W/m^2 + atm2lnd_inst%forc_solai_grc(g,2) = x2l(index_x2l_Faxa_swndf,i) ! forc_solldxy Atm flux W/m^2 + atm2lnd_inst%forc_solai_grc(g,1) = x2l(index_x2l_Faxa_swvdf,i) ! forc_solsdxy Atm flux W/m^2 + + atm2lnd_inst%forc_th_not_downscaled_grc(g) = x2l(index_x2l_Sa_ptem,i) ! forc_thxy Atm state K + wateratm2lndbulk_inst%forc_q_not_downscaled_grc(g) = x2l(index_x2l_Sa_shum,i) ! forc_qxy Atm state kg/kg + atm2lnd_inst%forc_pbot_not_downscaled_grc(g) = x2l(index_x2l_Sa_pbot,i) ! ptcmxy Atm state Pa + atm2lnd_inst%forc_t_not_downscaled_grc(g) = x2l(index_x2l_Sa_tbot,i) ! forc_txy Atm state K + atm2lnd_inst%forc_lwrad_not_downscaled_grc(g) = x2l(index_x2l_Faxa_lwdn,i) ! flwdsxy Atm flux W/m^2 + + forc_rainc(g) = x2l(index_x2l_Faxa_rainc,i) ! mm/s + forc_rainl(g) = x2l(index_x2l_Faxa_rainl,i) ! mm/s + forc_snowc(g) = x2l(index_x2l_Faxa_snowc,i) ! mm/s + forc_snowl(g) = x2l(index_x2l_Faxa_snowl,i) ! mm/s + + ! atmosphere coupling, for prognostic/prescribed aerosols + atm2lnd_inst%forc_aer_grc(g,1) = x2l(index_x2l_Faxa_bcphidry,i) + atm2lnd_inst%forc_aer_grc(g,2) = x2l(index_x2l_Faxa_bcphodry,i) + atm2lnd_inst%forc_aer_grc(g,3) = x2l(index_x2l_Faxa_bcphiwet,i) + atm2lnd_inst%forc_aer_grc(g,4) = x2l(index_x2l_Faxa_ocphidry,i) + atm2lnd_inst%forc_aer_grc(g,5) = x2l(index_x2l_Faxa_ocphodry,i) + atm2lnd_inst%forc_aer_grc(g,6) = x2l(index_x2l_Faxa_ocphiwet,i) + atm2lnd_inst%forc_aer_grc(g,7) = x2l(index_x2l_Faxa_dstwet1,i) + atm2lnd_inst%forc_aer_grc(g,8) = x2l(index_x2l_Faxa_dstdry1,i) + atm2lnd_inst%forc_aer_grc(g,9) = x2l(index_x2l_Faxa_dstwet2,i) + atm2lnd_inst%forc_aer_grc(g,10) = x2l(index_x2l_Faxa_dstdry2,i) + atm2lnd_inst%forc_aer_grc(g,11) = x2l(index_x2l_Faxa_dstwet3,i) + atm2lnd_inst%forc_aer_grc(g,12) = x2l(index_x2l_Faxa_dstdry3,i) + atm2lnd_inst%forc_aer_grc(g,13) = x2l(index_x2l_Faxa_dstwet4,i) + atm2lnd_inst%forc_aer_grc(g,14) = x2l(index_x2l_Faxa_dstdry4,i) + + if (index_x2l_Sa_methane /= 0) then + atm2lnd_inst%forc_pch4_grc(g) = x2l(index_x2l_Sa_methane,i) + endif + + !-------------------------- + ! Check for nans from coupler + !-------------------------- + + call check_for_nans(x2l(:,i), fname, begg, "x2l") + + end do + + !-------------------------- + ! Derived quantities for required fields + ! and corresponding error checks + !-------------------------- + + call derive_quantities(bounds, atm2lnd_inst, wateratm2lndbulk_inst, & + forc_rainc, forc_rainl, forc_snowc, forc_snowl) + + call check_for_errors(bounds, atm2lnd_inst, wateratm2lndbulk_inst) + + ! Determine derived quantities for optional fields + ! Note that the following does unit conversions from ppmv to partial pressures (Pa) + ! Note that forc_pbot is in Pa + + do g = begg,endg + i = 1 + (g - begg) + + forc_pbot = atm2lnd_inst%forc_pbot_not_downscaled_grc(g) + + ! Determine optional receive fields + if (index_x2l_Sa_co2prog /= 0) then + co2_ppmv_prog = x2l(index_x2l_Sa_co2prog,i) ! co2 atm state prognostic + else + co2_ppmv_prog = co2_ppmv + end if + if (index_x2l_Sa_co2diag /= 0) then + co2_ppmv_diag = x2l(index_x2l_Sa_co2diag,i) ! co2 atm state diagnostic + else + co2_ppmv_diag = co2_ppmv + end if + + if (co2_type_idx == 1) then + co2_ppmv_val = co2_ppmv_prog + else if (co2_type_idx == 2) then + co2_ppmv_val = co2_ppmv_diag + else + co2_ppmv_val = co2_ppmv + end if + if ( (co2_ppmv_val < 10.0_r8) .or. (co2_ppmv_val > 15000.0_r8) )then + call endrun(subgrid_index=g, subgrid_level=subgrid_level_gridcell, & + msg = sub//' ERROR: CO2 is outside of an expected range' ) + end if + atm2lnd_inst%forc_pco2_grc(g) = co2_ppmv_val * 1.e-6_r8 * forc_pbot + if (use_c13) then + atm2lnd_inst%forc_pc13o2_grc(g) = co2_ppmv_val * c13ratio * 1.e-6_r8 * forc_pbot + end if + + if (ndep_from_cpl) then + ! The coupler is sending ndep in units if kgN/m2/s - and clm uses units of gN/m2/sec - so the + ! following conversion needs to happen + atm2lnd_inst%forc_ndep_grc(g) = (x2l(index_x2l_Faxa_nhx, i) + x2l(index_x2l_faxa_noy, i))*1000._r8 + end if + + end do + + call glc2lnd_inst%set_glc2lnd_fields_mct( & + bounds = bounds, & + glc_present = glc_present, & + ! NOTE(wjs, 2017-12-13) the x2l argument doesn't have the typical bounds + ! subsetting (bounds%begg:bounds%endg). This mirrors the lack of these bounds in + ! the call to lnd_import from lnd_run_mct. This is okay as long as this code is + ! outside a clump loop. + x2l = x2l, & + index_x2l_Sg_ice_covered = index_x2l_Sg_ice_covered, & + index_x2l_Sg_topo = index_x2l_Sg_topo, & + index_x2l_Flgg_hflx = index_x2l_Flgg_hflx, & + index_x2l_Sg_icemask = index_x2l_Sg_icemask, & + index_x2l_Sg_icemask_coupled_fluxes = index_x2l_Sg_icemask_coupled_fluxes) + + end subroutine lnd_import + + !=============================================================================== + + subroutine lnd_export( bounds, waterlnd2atmbulk_inst, lnd2atm_inst, lnd2glc_inst, l2x) + + !--------------------------------------------------------------------------- + ! !DESCRIPTION: + ! Convert the data to be sent from the clm model to the coupler + ! + ! !USES: + use shr_kind_mod , only : r8 => shr_kind_r8 + use seq_flds_mod , only : seq_flds_l2x_fields + use clm_varctl , only : iulog + use shr_drydep_mod , only : n_drydep + use shr_megan_mod , only : shr_megan_mechcomps_n + use shr_fire_emis_mod , only : shr_fire_emis_mechcomps_n + use lnd_import_export_utils, only : check_for_nans + ! + ! !ARGUMENTS: + implicit none + type(bounds_type) , intent(in) :: bounds ! bounds + type(lnd2atm_type), intent(inout) :: lnd2atm_inst ! clm land to atmosphere exchange data type + type(lnd2glc_type), intent(inout) :: lnd2glc_inst ! clm land to atmosphere exchange data type + type(waterlnd2atmbulk_type), intent(in) :: waterlnd2atmbulk_inst + real(r8) , intent(out) :: l2x(:,:)! land to coupler export state on land grid + ! + ! !LOCAL VARIABLES: + integer :: begg, endg ! bounds + integer :: g,i,k ! indices + integer :: ier ! error status + integer :: nstep ! time step index + integer :: dtime ! time step + integer :: num ! counter + character(len=32) :: fname ! name of field that is NaN + character(len=32), parameter :: sub = 'lnd_export' + !--------------------------------------------------------------------------- + + ! Set bounds + begg = bounds%begg; endg = bounds%endg + + ! cesm sign convention is that fluxes are positive downward + + l2x(:,:) = 0.0_r8 + + do g = begg,endg + i = 1 + (g-begg) + l2x(index_l2x_Sl_t,i) = lnd2atm_inst%t_rad_grc(g) + l2x(index_l2x_Sl_snowh,i) = waterlnd2atmbulk_inst%h2osno_grc(g) + l2x(index_l2x_Sl_avsdr,i) = lnd2atm_inst%albd_grc(g,1) + l2x(index_l2x_Sl_anidr,i) = lnd2atm_inst%albd_grc(g,2) + l2x(index_l2x_Sl_avsdf,i) = lnd2atm_inst%albi_grc(g,1) + l2x(index_l2x_Sl_anidf,i) = lnd2atm_inst%albi_grc(g,2) + l2x(index_l2x_Sl_tref,i) = lnd2atm_inst%t_ref2m_grc(g) + l2x(index_l2x_Sl_qref,i) = waterlnd2atmbulk_inst%q_ref2m_grc(g) + l2x(index_l2x_Sl_u10,i) = lnd2atm_inst%u_ref10m_grc(g) + l2x(index_l2x_Fall_taux,i) = -lnd2atm_inst%taux_grc(g) + l2x(index_l2x_Fall_tauy,i) = -lnd2atm_inst%tauy_grc(g) + l2x(index_l2x_Fall_lat,i) = -lnd2atm_inst%eflx_lh_tot_grc(g) + l2x(index_l2x_Fall_sen,i) = -lnd2atm_inst%eflx_sh_tot_grc(g) + l2x(index_l2x_Fall_lwup,i) = -lnd2atm_inst%eflx_lwrad_out_grc(g) + l2x(index_l2x_Fall_evap,i) = -waterlnd2atmbulk_inst%qflx_evap_tot_grc(g) + l2x(index_l2x_Fall_swnet,i) = lnd2atm_inst%fsa_grc(g) + if (index_l2x_Fall_fco2_lnd /= 0) then + l2x(index_l2x_Fall_fco2_lnd,i) = -lnd2atm_inst%net_carbon_exchange_grc(g) + end if + + ! Additional fields for DUST, PROGSSLT, dry-deposition and VOC + ! These are now standard fields, but the check on the index makes sure the driver handles them + if (index_l2x_Sl_ram1 /= 0 ) l2x(index_l2x_Sl_ram1,i) = lnd2atm_inst%ram1_grc(g) + if (index_l2x_Sl_fv /= 0 ) l2x(index_l2x_Sl_fv,i) = lnd2atm_inst%fv_grc(g) + if (index_l2x_Sl_soilw /= 0 ) l2x(index_l2x_Sl_soilw,i) = waterlnd2atmbulk_inst%h2osoi_vol_grc(g,1) + if (index_l2x_Fall_flxdst1 /= 0 ) l2x(index_l2x_Fall_flxdst1,i)= -lnd2atm_inst%flxdst_grc(g,1) + if (index_l2x_Fall_flxdst2 /= 0 ) l2x(index_l2x_Fall_flxdst2,i)= -lnd2atm_inst%flxdst_grc(g,2) + if (index_l2x_Fall_flxdst3 /= 0 ) l2x(index_l2x_Fall_flxdst3,i)= -lnd2atm_inst%flxdst_grc(g,3) + if (index_l2x_Fall_flxdst4 /= 0 ) l2x(index_l2x_Fall_flxdst4,i)= -lnd2atm_inst%flxdst_grc(g,4) + + + ! for dry dep velocities + if (index_l2x_Sl_ddvel /= 0 ) then + l2x(index_l2x_Sl_ddvel:index_l2x_Sl_ddvel+n_drydep-1,i) = & + lnd2atm_inst%ddvel_grc(g,:n_drydep) + end if + + ! for MEGAN VOC emis fluxes + if (index_l2x_Fall_flxvoc /= 0 ) then + l2x(index_l2x_Fall_flxvoc:index_l2x_Fall_flxvoc+shr_megan_mechcomps_n-1,i) = & + -lnd2atm_inst%flxvoc_grc(g,:shr_megan_mechcomps_n) + end if + + + ! for fire emis fluxes + if (index_l2x_Fall_flxfire /= 0 ) then + l2x(index_l2x_Fall_flxfire:index_l2x_Fall_flxfire+shr_fire_emis_mechcomps_n-1,i) = & + -lnd2atm_inst%fireflx_grc(g,:shr_fire_emis_mechcomps_n) + l2x(index_l2x_Sl_ztopfire,i) = lnd2atm_inst%fireztop_grc(g) + end if + + if (index_l2x_Fall_methane /= 0) then + l2x(index_l2x_Fall_methane,i) = -lnd2atm_inst%ch4_surf_flux_tot_grc(g) + endif + + ! sign convention is positive downward with + ! hierarchy of atm/glc/lnd/rof/ice/ocn. + ! I.e. water sent from land to rof is positive + + l2x(index_l2x_Flrl_rofsur,i) = waterlnd2atmbulk_inst%qflx_rofliq_qsur_grc(g) + + ! subsurface runoff is the sum of qflx_drain and qflx_perched_drain + l2x(index_l2x_Flrl_rofsub,i) = waterlnd2atmbulk_inst%qflx_rofliq_qsub_grc(g) & + + waterlnd2atmbulk_inst%qflx_rofliq_drain_perched_grc(g) + + ! qgwl sent individually to coupler + l2x(index_l2x_Flrl_rofgwl,i) = waterlnd2atmbulk_inst%qflx_rofliq_qgwl_grc(g) + + ! ice sent individually to coupler + l2x(index_l2x_Flrl_rofi,i) = waterlnd2atmbulk_inst%qflx_rofice_grc(g) + + ! irrigation flux to be removed from main channel storage (negative) + l2x(index_l2x_Flrl_irrig,i) = - waterlnd2atmbulk_inst%qirrig_grc(g) + + ! glc coupling + ! We could avoid setting these fields if glc_present is .false., if that would + ! help with performance. (The downside would be that we wouldn't have these fields + ! available for diagnostic purposes or to force a later T compset with dlnd.) + do num = 0,glc_nec + l2x(index_l2x_Sl_tsrf(num),i) = lnd2glc_inst%tsrf_grc(g,num) + l2x(index_l2x_Sl_topo(num),i) = lnd2glc_inst%topo_grc(g,num) + l2x(index_l2x_Flgl_qice(num),i) = lnd2glc_inst%qice_grc(g,num) + end do + + !-------------------------- + ! Check for nans to coupler + !-------------------------- + + call check_for_nans(l2x(:,i), fname, begg, "l2x") + + end do + + end subroutine lnd_export + +end module lnd_import_export diff --git a/src/cpl/mct/lnd_set_decomp_and_domain.F90 b/src/cpl/mct/lnd_set_decomp_and_domain.F90 new file mode 100644 index 0000000000..0a37554313 --- /dev/null +++ b/src/cpl/mct/lnd_set_decomp_and_domain.F90 @@ -0,0 +1,352 @@ +module lnd_set_decomp_and_domain + + use shr_kind_mod , only : r8 => shr_kind_r8 + use spmdMod , only : masterproc + use clm_varctl , only : iulog + use mct_mod , only : mct_gsMap + + implicit none + private ! except + + ! public member routines + public :: lnd_set_decomp_and_domain_from_surfrd + + ! private member routines + private :: surfrd_get_globmask ! Reads global land mask (needed for setting domain decomp) + private :: surfrd_get_grid ! Read grid/ladnfrac data into domain (after domain decomp) + + ! translation between local and global indices at gridcell level + type(mct_gsmap), pointer, public :: gsmap_global + + ! translation between local and global indices at gridcell level for multiple levels + ! needed for 3d soil moisture stream + type(mct_gsmap), target , public :: gsMap_lnd2Dsoi_gdc2glo + + character(len=*), parameter, private :: sourcefile = & + __FILE__ + +!=============================================================================== +contains +!=============================================================================== + + subroutine lnd_set_decomp_and_domain_from_surfrd(noland, ni, nj) + + ! Initialize ldomain data types + + use clm_varpar , only: nlevsoi + use clm_varctl , only: fatmlndfrc, use_soil_moisture_streams + use decompInitMod , only: decompInit_lnd + use decompMod , only: bounds_type, get_proc_bounds + use domainMod , only: ldomain, domain_check + + ! input/output variables + logical, intent(out) :: noland + integer, intent(out) :: ni, nj ! global grid sizes + + ! local variables + integer ,pointer :: amask(:) ! global land mask + integer :: begg, endg ! processor bounds + type(bounds_type) :: bounds ! bounds + character(len=32) :: subname = 'lnd_set_decomp_and_domain_from_surfrd' + !----------------------------------------------------------------------- + + ! Read in global land grid and land mask (amask)- needed to set decomposition + ! global memory for amask is allocate in surfrd_get_glomask - must be deallocated below + if (masterproc) then + write(iulog,*) 'Attempting to read global land mask from ',trim(fatmlndfrc) + endif + + ! Get global mask, ni and nj + call surfrd_get_globmask(filename=fatmlndfrc, mask=amask, ni=ni, nj=nj) + + ! Exit early if no valid land points + if ( all(amask == 0) )then + if (masterproc) write(iulog,*) trim(subname)//': no valid land points do NOT run clm' + noland = .true. + return + else + noland = .false. + end if + + ! Determine ctsm gridcell decomposition and processor bounds for gridcells + call decompInit_lnd(ni, nj, amask) + deallocate(amask) + if (use_soil_moisture_streams) call decompInit_lnd3D(ni, nj, nlevsoi) + + ! Initialize bounds for just gridcells + ! Remaining bounds (landunits, columns, patches) will be determined + ! after the call to decompInit_glcp - so get_proc_bounds is called + ! twice and the gridcell information is just filled in twice + call get_proc_bounds(bounds) + + ! Get grid cell bounds values + begg = bounds%begg + endg = bounds%endg + + ! Initialize ldomain data type + if (masterproc) then + write(iulog,*) 'Attempting to read ldomain from ',trim(fatmlndfrc) + endif + call surfrd_get_grid(begg, endg, ldomain, fatmlndfrc) + if (masterproc) then + call domain_check(ldomain) + endif + ldomain%mask = 1 !!! TODO - is this needed? + + end subroutine lnd_set_decomp_and_domain_from_surfrd + + !----------------------------------------------------------------------- + subroutine surfrd_get_globmask(filename, mask, ni, nj) + + ! Read the surface dataset grid related information + ! This is used to set the domain decomposition - so global data is read here + + use fileutils , only : getfil + use ncdio_pio , only : ncd_io, ncd_pio_openfile, ncd_pio_closefile, ncd_inqfdims, file_desc_t + use abortutils , only : endrun + use shr_log_mod, only : errMsg => shr_log_errMsg + + ! input/output variables + character(len=*), intent(in) :: filename ! grid filename + integer , pointer :: mask(:) ! grid mask + integer , intent(out) :: ni, nj ! global grid sizes + + ! local variables + logical :: isgrid2d + integer :: dimid,varid ! netCDF id's + integer :: ns ! size of grid on file + integer :: n,i,j ! index + integer :: ier ! error status + type(file_desc_t) :: ncid ! netcdf id + character(len=256) :: locfn ! local file name + logical :: readvar ! read variable in or not + integer , allocatable :: idata2d(:,:) + character(len=32) :: subname = 'surfrd_get_globmask' ! subroutine name + !----------------------------------------------------------------------- + + if (filename == ' ') then + mask(:) = 1 + else + ! Check if file exists + if (masterproc) then + if (filename == ' ') then + write(iulog,*) trim(subname),' ERROR: filename must be specified ' + call endrun(msg=errMsg(sourcefile, __LINE__)) + endif + end if + + ! Open file + call getfil( filename, locfn, 0 ) + call ncd_pio_openfile (ncid, trim(locfn), 0) + + ! Determine dimensions and if grid file is 2d or 1d + call ncd_inqfdims(ncid, isgrid2d, ni, nj, ns) + if (masterproc) then + write(iulog,*)'lat/lon grid flag (isgrid2d) is ',isgrid2d + end if + allocate(mask(ns)) + mask(:) = 1 + if (isgrid2d) then + ! Grid is 2d + allocate(idata2d(ni,nj)) + idata2d(:,:) = 1 + call ncd_io(ncid=ncid, varname='LANDMASK', data=idata2d, flag='read', readvar=readvar) + if (.not. readvar) then + call ncd_io(ncid=ncid, varname='mask', data=idata2d, flag='read', readvar=readvar) + end if + if (readvar) then + do j = 1,nj + do i = 1,ni + n = (j-1)*ni + i + mask(n) = idata2d(i,j) + enddo + enddo + end if + deallocate(idata2d) + else + ! Grid is not 2d + call ncd_io(ncid=ncid, varname='LANDMASK', data=mask, flag='read', readvar=readvar) + if (.not. readvar) then + call ncd_io(ncid=ncid, varname='mask', data=mask, flag='read', readvar=readvar) + end if + end if + if (.not. readvar) call endrun( msg=' ERROR: landmask not on fatmlndfrc file'//errMsg(sourcefile, __LINE__)) + + ! Close file + call ncd_pio_closefile(ncid) + end if + + end subroutine surfrd_get_globmask + + !----------------------------------------------------------------------- + subroutine surfrd_get_grid(begg, endg, ldomain, filename) + + ! Read the surface dataset grid related information: + ! This is called after the domain decomposition has been created + ! - real latitude of grid cell (degrees) + ! - real longitude of grid cell (degrees) + + use clm_varcon , only : spval, re, grlnd + use domainMod , only : domain_type, lon1d, lat1d, domain_init + use fileutils , only : getfil + use abortutils , only : endrun + use shr_log_mod , only : errMsg => shr_log_errMsg + use ncdio_pio , only : file_desc_t, ncd_pio_openfile, ncd_pio_closefile + use ncdio_pio , only : ncd_io, check_var, ncd_inqfdims, check_dim_size + use pio + + ! input/output variables + integer , intent(in) :: begg, endg + type(domain_type) , intent(inout) :: ldomain ! domain to init + character(len=*) , intent(in) :: filename ! grid filename + + ! local variables + type(file_desc_t) :: ncid ! netcdf id + integer :: beg ! local beg index + integer :: end ! local end index + integer :: ni,nj,ns ! size of grid on file + logical :: readvar ! true => variable is on input file + logical :: isgrid2d ! true => file is 2d lat/lon + logical :: istype_domain ! true => input file is of type domain + real(r8), allocatable :: rdata2d(:,:) ! temporary + character(len=16) :: vname ! temporary + character(len=256) :: locfn ! local file name + integer :: n ! indices + character(len=32) :: subname = 'surfrd_get_grid' ! subroutine name + !----------------------------------------------------------------------- + + if (masterproc) then + if (filename == ' ') then + write(iulog,*) trim(subname),' ERROR: filename must be specified ' + call endrun(msg=errMsg(sourcefile, __LINE__)) + endif + end if + + call getfil( filename, locfn, 0 ) + call ncd_pio_openfile (ncid, trim(locfn), 0) + + ! Determine dimensions + call ncd_inqfdims(ncid, isgrid2d, ni, nj, ns) + + ! Determine isgrid2d flag for domain + call domain_init(ldomain, isgrid2d=isgrid2d, ni=ni, nj=nj, nbeg=begg, nend=endg) + + ! Determine type of file - old style grid file or new style domain file + call check_var(ncid=ncid, varname='xc', readvar=readvar) + if (readvar)then + istype_domain = .true. + else + istype_domain = .false. + end if + + ! Read in area, lon, lat + if (istype_domain) then + call ncd_io(ncid=ncid, varname= 'area', flag='read', data=ldomain%area, & + dim1name=grlnd, readvar=readvar) + ! convert from radians**2 to km**2 + ldomain%area = ldomain%area * (re**2) + if (.not. readvar) call endrun( msg=' ERROR: area NOT on file'//errMsg(sourcefile, __LINE__)) + call ncd_io(ncid=ncid, varname= 'xc', flag='read', data=ldomain%lonc, & + dim1name=grlnd, readvar=readvar) + if (.not. readvar) call endrun( msg=' ERROR: xc NOT on file'//errMsg(sourcefile, __LINE__)) + call ncd_io(ncid=ncid, varname= 'yc', flag='read', data=ldomain%latc, & + dim1name=grlnd, readvar=readvar) + if (.not. readvar) call endrun( msg=' ERROR: yc NOT on file'//errMsg(sourcefile, __LINE__)) + else + call endrun( msg=" ERROR: can no longer read non domain files" ) + end if + + if (isgrid2d) then + allocate(rdata2d(ni,nj), lon1d(ni), lat1d(nj)) + if (istype_domain) vname = 'xc' + call ncd_io(ncid=ncid, varname=trim(vname), data=rdata2d, flag='read', readvar=readvar) + lon1d(:) = rdata2d(:,1) + if (istype_domain) vname = 'yc' + call ncd_io(ncid=ncid, varname=trim(vname), data=rdata2d, flag='read', readvar=readvar) + lat1d(:) = rdata2d(1,:) + deallocate(rdata2d) + end if + + ! Check lat limited to -90,90 + if (minval(ldomain%latc) < -90.0_r8 .or. & + maxval(ldomain%latc) > 90.0_r8) then + write(iulog,*) trim(subname),' WARNING: lat/lon min/max is ', & + minval(ldomain%latc),maxval(ldomain%latc) + endif + if ( any(ldomain%lonc < 0.0_r8) )then + call endrun( msg=' ERROR: lonc is negative (see https://github.com/ESCOMP/ctsm/issues/507)' & + //errMsg(sourcefile, __LINE__)) + endif + call ncd_io(ncid=ncid, varname='mask', flag='read', data=ldomain%mask, & + dim1name=grlnd, readvar=readvar) + if (.not. readvar) then + call endrun( msg=' ERROR: LANDMASK NOT on fracdata file'//errMsg(sourcefile, __LINE__)) + end if + call ncd_io(ncid=ncid, varname='frac', flag='read', data=ldomain%frac, & + dim1name=grlnd, readvar=readvar) + if (.not. readvar) then + call endrun( msg=' ERROR: LANDFRAC NOT on fracdata file'//errMsg(sourcefile, __LINE__)) + end if + + call ncd_pio_closefile(ncid) + + end subroutine surfrd_get_grid + + !------------------------------------------------------------------------------ + subroutine decompInit_lnd3D(lni,lnj,lnk) + ! + ! !DESCRIPTION: + ! Create a 3D decomposition gsmap for the global 2D grid with soil levels + ! as the 3rd dimesnion. + ! + ! !USES: + use decompMod, only : gindex_global, bounds_type, get_proc_bounds + use spmdMod , only : comp_id, mpicom + use mct_mod , only : mct_gsmap_init + ! + ! !ARGUMENTS: + integer , intent(in) :: lni,lnj,lnk ! domain global size + ! + ! !LOCAL VARIABLES: + integer :: m,n,k ! indices + integer :: begg,endg,lsize,gsize ! used for gsmap init + integer :: begg3d,endg3d + integer, pointer :: gindex(:) ! global index for gsmap init + type(bounds_type) :: bounds + !------------------------------------------------------------------------------ + + ! Initialize gsmap_lnd2dsoi_gdc2glo + call get_proc_bounds(bounds) + begg = bounds%begg; endg=bounds%endg + + begg3d = (begg-1)*lnk + 1 + endg3d = endg*lnk + lsize = (endg3d - begg3d + 1 ) + allocate(gindex(begg3d:endg3d)) + do k = 1, lnk + do n = begg,endg + m = (begg-1)*lnk + (k-1)*(endg-begg+1) + (n-begg+1) + gindex(m) = gindex_global(n-begg+1) + (k-1)*(lni*lnj) + enddo + enddo + gsize = lni * lnj * lnk + call mct_gsMap_init(gsMap_lnd2Dsoi_gdc2glo, gindex, mpicom, comp_id, lsize, gsize) + + ! Diagnostic output + + if (masterproc) then + write(iulog,*)' 3D GSMap' + write(iulog,*)' longitude points = ',lni + write(iulog,*)' latitude points = ',lnj + write(iulog,*)' soil levels = ',lnk + write(iulog,*)' gsize = ',gsize + write(iulog,*)' lsize = ',lsize + write(iulog,*)' bounds(gindex) = ',size(gindex) + write(iulog,*) + end if + + deallocate(gindex) + + end subroutine decompInit_lnd3D + +end module lnd_set_decomp_and_domain diff --git a/src/cpl/mct/ndepStreamMod.F90 b/src/cpl/mct/ndepStreamMod.F90 new file mode 100644 index 0000000000..d26ff7c95e --- /dev/null +++ b/src/cpl/mct/ndepStreamMod.F90 @@ -0,0 +1,376 @@ +module ndepStreamMod + + !----------------------------------------------------------------------- + ! !DESCRIPTION: + ! Contains methods for reading in nitrogen deposition data file + ! Also includes functions for dynamic ndep file handling and + ! interpolation. + ! + ! !USES + use shr_kind_mod, only: r8 => shr_kind_r8, CL => shr_kind_cl + use shr_strdata_mod, only: shr_strdata_type, shr_strdata_create + use shr_strdata_mod, only: shr_strdata_print, shr_strdata_advance + use mct_mod , only: mct_ggrid + use spmdMod , only: mpicom, masterproc, comp_id, iam + use clm_varctl , only: iulog, inst_name + use abortutils , only: endrun + use decompMod , only: bounds_type + use domainMod , only: ldomain + + ! !PUBLIC TYPES: + implicit none + private + + ! !PUBLIC MEMBER FUNCTIONS: + public :: ndep_init ! position datasets for dynamic ndep + public :: ndep_interp ! interpolates between two years of ndep file data + public :: clm_domain_mct ! Sets up MCT domain for this resolution + + ! !PRIVATE MEMBER FUNCTIONS: + private :: check_units ! Check the units and make sure they can be used + + ! ! PRIVATE TYPES + type(shr_strdata_type) :: sdat ! input data stream + integer :: stream_year_first_ndep ! first year in stream to use + integer :: stream_year_last_ndep ! last year in stream to use + integer :: model_year_align_ndep ! align stream_year_firstndep with + logical :: divide_by_secs_per_yr = .true. ! divide by the number of seconds per year + + character(len=*), parameter, private :: sourcefile = & + __FILE__ + !============================================================================== + +contains + + !============================================================================== + + subroutine ndep_init(bounds, NLFilename) + ! + ! Initialize data stream information. + ! + ! Uses: + use shr_kind_mod , only : CS => shr_kind_cs + use clm_time_manager , only : get_calendar + use ncdio_pio , only : pio_subsystem + use shr_pio_mod , only : shr_pio_getiotype + use shr_nl_mod , only : shr_nl_find_group_name + use shr_log_mod , only : errMsg => shr_log_errMsg + use shr_mpi_mod , only : shr_mpi_bcast + use lnd_set_decomp_and_domain , only : gsMap_lnd2Dsoi_gdc2glo, gsmap_global + ! + ! arguments + implicit none + type(bounds_type), intent(in) :: bounds + character(len=*), intent(in) :: NLFilename ! Namelist filename + ! + ! local variables + integer :: nu_nml ! unit for namelist file + integer :: nml_error ! namelist i/o error flag + type(mct_ggrid) :: dom_clm ! domain information + character(len=CL) :: stream_fldFileName_ndep + character(len=CL) :: ndepmapalgo = 'bilinear' + character(len=CL) :: ndep_tintalgo = 'linear' + character(len=CS) :: ndep_taxmode = 'extend' + character(len=CL) :: ndep_varlist = 'NDEP_year' + character(*), parameter :: shr_strdata_unset = 'NOT_SET' + character(*), parameter :: subName = "('ndepdyn_init')" + character(*), parameter :: F00 = "('(ndepdyn_init) ',4a)" + !----------------------------------------------------------------------- + + namelist /ndepdyn_nml/ & + stream_year_first_ndep, & + stream_year_last_ndep, & + model_year_align_ndep, & + ndepmapalgo, ndep_taxmode, & + ndep_varlist, & + stream_fldFileName_ndep, & + ndep_tintalgo + + ! Default values for namelist + stream_year_first_ndep = 1 ! first year in stream to use + stream_year_last_ndep = 1 ! last year in stream to use + model_year_align_ndep = 1 ! align stream_year_first_ndep with this model year + stream_fldFileName_ndep = ' ' + + ! Read ndepdyn_nml namelist + if (masterproc) then + open( newunit=nu_nml, file=trim(NLFilename), status='old', iostat=nml_error ) + call shr_nl_find_group_name(nu_nml, 'ndepdyn_nml', status=nml_error) + if (nml_error == 0) then + read(nu_nml, nml=ndepdyn_nml,iostat=nml_error) + if (nml_error /= 0) then + call endrun(msg=' ERROR reading ndepdyn_nml namelist'//errMsg(sourcefile, __LINE__)) + end if + else + call endrun(msg=' ERROR finding ndepdyn_nml namelist'//errMsg(sourcefile, __LINE__)) + end if + close(nu_nml) + endif + + call shr_mpi_bcast(stream_year_first_ndep , mpicom) + call shr_mpi_bcast(stream_year_last_ndep , mpicom) + call shr_mpi_bcast(model_year_align_ndep , mpicom) + call shr_mpi_bcast(stream_fldFileName_ndep, mpicom) + call shr_mpi_bcast(ndep_varlist , mpicom) + call shr_mpi_bcast(ndep_taxmode , mpicom) + call shr_mpi_bcast(ndep_tintalgo , mpicom) + + if (masterproc) then + write(iulog,*) ' ' + write(iulog,*) 'ndepdyn stream settings:' + write(iulog,*) ' stream_year_first_ndep = ',stream_year_first_ndep + write(iulog,*) ' stream_year_last_ndep = ',stream_year_last_ndep + write(iulog,*) ' model_year_align_ndep = ',model_year_align_ndep + write(iulog,*) ' stream_fldFileName_ndep = ',stream_fldFileName_ndep + write(iulog,*) ' ndep_varList = ',ndep_varList + write(iulog,*) ' ndep_taxmode = ',ndep_taxmode + write(iulog,*) ' ndep_tintalgo = ',ndep_tintalgo + write(iulog,*) ' ' + endif + ! Read in units + call check_units( stream_fldFileName_ndep, ndep_varList ) + + ! Set domain and create streams + call clm_domain_mct (bounds, dom_clm) + + call shr_strdata_create(sdat,name="clmndep", & + pio_subsystem=pio_subsystem, & + pio_iotype=shr_pio_getiotype(inst_name), & + mpicom=mpicom, compid=comp_id, & + gsmap=gsmap_global, ggrid=dom_clm, & + nxg=ldomain%ni, nyg=ldomain%nj, & + yearFirst=stream_year_first_ndep, & + yearLast=stream_year_last_ndep, & + yearAlign=model_year_align_ndep, & + offset=0, & + domFilePath='', & + domFileName=trim(stream_fldFileName_ndep), & + domTvarName='time', & + domXvarName='lon' , & + domYvarName='lat' , & + domAreaName='area', & + domMaskName='mask', & + filePath='', & + filename=(/trim(stream_fldFileName_ndep)/),& + fldListFile=ndep_varlist, & + fldListModel=ndep_varlist, & + fillalgo='none', & + mapalgo=ndepmapalgo, & + tintalgo=ndep_tintalgo, & + calendar=get_calendar(), & + taxmode=ndep_taxmode ) + + + if (masterproc) then + call shr_strdata_print(sdat,'CLMNDEP data') + endif + + end subroutine ndep_init + !================================================================ + + subroutine check_units( stream_fldFileName_ndep, ndep_varList ) + !------------------------------------------------------------------- + ! Check that units are correct on the file and if need any conversion + use ncdio_pio , only : ncd_pio_openfile, ncd_inqvid, ncd_getatt, ncd_pio_closefile, ncd_nowrite + use ncdio_pio , only : file_desc_t, var_desc_t + use shr_kind_mod , only : CS => shr_kind_cs + use shr_log_mod , only : errMsg => shr_log_errMsg + use shr_string_mod, only : shr_string_listGetName + implicit none + + !----------------------------------------------------------------------- + ! + ! Arguments + character(len=*), intent(IN) :: stream_fldFileName_ndep ! ndep filename + character(len=*), intent(IN) :: ndep_varList ! ndep variable list to examine + ! + ! Local variables + type(file_desc_t) :: ncid ! NetCDF filehandle for ndep file + type(var_desc_t) :: vardesc ! variable descriptor + integer :: varid ! variable index + logical :: readvar ! If variable was read + character(len=CS) :: ndepunits! ndep units + character(len=CS) :: fname ! ndep field name + !----------------------------------------------------------------------- + call ncd_pio_openfile( ncid, trim(stream_fldFileName_ndep), ncd_nowrite ) + call shr_string_listGetName( ndep_varList, 1, fname ) + call ncd_inqvid( ncid, fname, varid, vardesc, readvar=readvar ) + if ( readvar ) then + call ncd_getatt( ncid, varid, "units", ndepunits ) + else + call endrun(msg=' ERROR finding variable: '//trim(fname)//" in file: "// & + trim(stream_fldFileName_ndep)//errMsg(sourcefile, __LINE__)) + end if + call ncd_pio_closefile( ncid ) + + ! Now check to make sure they are correct + if ( trim(ndepunits) == "g(N)/m2/s" )then + divide_by_secs_per_yr = .false. + else if ( trim(ndepunits) == "g(N)/m2/yr" )then + divide_by_secs_per_yr = .true. + else + call endrun(msg=' ERROR in units for nitrogen deposition equal to: '//trim(ndepunits)//" not units expected"// & + errMsg(sourcefile, __LINE__)) + end if + + end subroutine check_units + + !================================================================ + subroutine ndep_interp(bounds, atm2lnd_inst) + + !----------------------------------------------------------------------- + use clm_time_manager, only : get_curr_date, get_curr_days_per_year + use clm_varcon , only : secspday + use atm2lndType , only : atm2lnd_type + ! + ! Arguments + type(bounds_type) , intent(in) :: bounds + type(atm2lnd_type), intent(inout) :: atm2lnd_inst + ! + ! Local variables + integer :: g, ig + 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 :: dayspyr ! days per year + !----------------------------------------------------------------------- + + call get_curr_date(year, mon, day, sec) + mcdate = year*10000 + mon*100 + day + + call shr_strdata_advance(sdat, mcdate, sec, mpicom, 'ndepdyn') + + if ( divide_by_secs_per_yr )then + ig = 0 + dayspyr = get_curr_days_per_year( ) + do g = bounds%begg,bounds%endg + ig = ig+1 + atm2lnd_inst%forc_ndep_grc(g) = sdat%avs(1)%rAttr(1,ig) / (secspday * dayspyr) + end do + else + ig = 0 + do g = bounds%begg,bounds%endg + ig = ig+1 + atm2lnd_inst%forc_ndep_grc(g) = sdat%avs(1)%rAttr(1,ig) + end do + end if + + end subroutine ndep_interp + + !============================================================================== + subroutine clm_domain_mct(bounds, dom_clm, nlevels) + + !------------------------------------------------------------------- + ! Set domain data type for internal clm grid + use clm_varcon , only : re + use domainMod , only : ldomain + use mct_mod , only : mct_ggrid, mct_gsMap_lsize, mct_gGrid_init + use mct_mod , only : mct_gsMap_orderedPoints, mct_gGrid_importIAttr + use mct_mod , only : mct_gGrid_importRAttr, mct_gsMap + use lnd_set_decomp_and_domain , only : gsMap_lnd2Dsoi_gdc2glo, gsmap_global + implicit none + ! + ! arguments + type(bounds_type), intent(in) :: bounds + type(mct_ggrid), intent(out) :: dom_clm ! Output domain information for land model + integer, intent(in), optional :: nlevels ! Number of levels if this is a 3D field + ! + ! local variables + integer :: g,i,j,k ! index + integer :: lsize ! land model domain data size + real(r8), pointer :: data(:) ! temporary + integer , pointer :: idata(:) ! temporary + integer :: nlevs ! Number of vertical levels + type(mct_gsMap), pointer :: gsmap => null() ! MCT GS map + !------------------------------------------------------------------- + ! SEt number of levels, and get the GS map for either the 2D or 3D grid + nlevs = 1 + if ( present(nlevels) ) nlevs = nlevels + if ( nlevs == 1 ) then + gsmap => gsmap_global + else + gsmap => gsMap_lnd2Dsoi_gdc2glo + end if + ! + ! Initialize mct domain type + ! lat/lon in degrees, area in radians^2, mask is 1 (land), 0 (non-land) + ! Note that in addition land carries around landfrac for the purposes of domain checking + ! + lsize = mct_gsMap_lsize(gsmap, mpicom) + call mct_gGrid_init( GGrid=dom_clm, & + CoordChars='lat:lon:hgt', OtherChars='area:aream:mask:frac', lsize=lsize ) + ! + ! Allocate memory + ! + allocate(data(lsize)) + ! + ! Determine global gridpoint number attribute, GlobGridNum, which is set automatically by MCT + ! + call mct_gsMap_orderedPoints(gsmap, iam, idata) + gsmap => null() + call mct_gGrid_importIAttr(dom_clm,'GlobGridNum',idata,lsize) + ! + ! Determine domain (numbering scheme is: West to East and South to North to South pole) + ! Initialize attribute vector with special value + ! + data(:) = -9999.0_R8 + call mct_gGrid_importRAttr(dom_clm,"lat" ,data,lsize) + call mct_gGrid_importRAttr(dom_clm,"lon" ,data,lsize) + call mct_gGrid_importRAttr(dom_clm,"area" ,data,lsize) + call mct_gGrid_importRAttr(dom_clm,"aream",data,lsize) + data(:) = 0.0_R8 + call mct_gGrid_importRAttr(dom_clm,"mask" ,data,lsize) + ! + ! Determine bounds + ! + ! Fill in correct values for domain components + ! Note aream will be filled in in the atm-lnd mapper + ! + do k = 1, nlevs + do g = bounds%begg,bounds%endg + i = 1 + (g - bounds%begg) + data(i) = ldomain%lonc(g) + end do + end do + call mct_gGrid_importRattr(dom_clm,"lon",data,lsize) + + do k = 1, nlevs + do g = bounds%begg,bounds%endg + i = 1 + (g - bounds%begg) + data(i) = ldomain%latc(g) + end do + end do + call mct_gGrid_importRattr(dom_clm,"lat",data,lsize) + + do k = 1, nlevs + do g = bounds%begg,bounds%endg + i = 1 + (g - bounds%begg) + data(i) = ldomain%area(g)/(re*re) + end do + end do + call mct_gGrid_importRattr(dom_clm,"area",data,lsize) + + do k = 1, nlevs + do g = bounds%begg,bounds%endg + i = 1 + (g - bounds%begg) + data(i) = real(ldomain%mask(g), r8) + end do + end do + call mct_gGrid_importRattr(dom_clm,"mask",data,lsize) + + do k = 1, nlevs + do g = bounds%begg,bounds%endg + i = 1 + (g - bounds%begg) + data(i) = real(ldomain%frac(g), r8) + end do + end do + call mct_gGrid_importRattr(dom_clm,"frac",data,lsize) + + deallocate(data) + deallocate(idata) + + end subroutine clm_domain_mct + +end module ndepStreamMod From 7c295b84189ae3e2e62d369cc8e65fbac80406b5 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Thu, 16 May 2024 14:47:23 -0600 Subject: [PATCH 0264/1248] Remove test/tools/test_driver.sh, unrelated to this PR, good to clean up --- test/tools/test_driver.sh | 721 -------------------------------------- 1 file changed, 721 deletions(-) delete mode 100755 test/tools/test_driver.sh diff --git a/test/tools/test_driver.sh b/test/tools/test_driver.sh deleted file mode 100755 index 307d1accf8..0000000000 --- a/test/tools/test_driver.sh +++ /dev/null @@ -1,721 +0,0 @@ -#!/bin/sh -# -# test_driver.sh: driver script for the offline testing of CLM of tools -# -# interactive usage on all machines: -# -# env ./test_driver.sh -i -# -# valid arguments: -# -i interactive usage -# -d debug usage -- display tests that will run -- but do NOT actually execute them -# -f force batch submission (avoids user prompt) -# -h displays this help message -# -# -# **pass environment variables by preceding above commands -# with 'env var1=setting var2=setting ' -# **more details in the CLM testing user's guide, accessible -# from the CLM developers web page - - -#will attach timestamp onto end of script name to prevent overwriting -cur_time=`date '+%H:%M:%S'` - -hostname=`hostname` -echo $hostname -case $hostname in - - ##Derecho - derecho* | dec*) - submit_script="test_driver_derecho${cur_time}.sh" - -##vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv writing to batch script vvvvvvvvvvvvvvvvvvv -cat > ./${submit_script} << EOF -#!/bin/sh -# - -interactive="YES" -input_file="tests_pretag_derecho_nompi" -c_threads=128 - -export INITMODULES="/glade/u/apps/derecho/23.06/spack/opt/spack/lmod/8.7.20/gcc/7.5.0/pdxb/lmod/lmod/init/sh" -. \$INITMODULES - -module --force purge -module load ncarenv -module load craype -module load intel -module load mkl -module load ncarcompilers -module load netcdf -module load nco -module load ncl - -#omp threads -if [ -z "\$CLM_THREADS" ]; then #threads NOT set on command line - export CLM_THREADS=\$c_threads -fi - -# Stop on first failed test -if [ -z "\$CLM_SOFF" ]; then #CLM_SOFF NOT set - export CLM_SOFF=FALSE -fi - -export CESM_MACH="derecho" -export CESM_COMP="intel" - -export NETCDF_DIR=\$NETCDF -export INC_NETCDF=\$NETCDF/include -export LIB_NETCDF=\$NETCDF/lib -export MAKE_CMD="gmake -j " -export CFG_STRING="" -export TOOLS_MAKE_STRING="USER_FC=ifort USER_LINKER=ifort USER_CPPDEFS=-DLINUX" -export MACH_WORKSPACE=\$SCRATCH -export CPRNC_EXE="$CESMDATAROOT/cprnc/cprnc" -dataroot="$CESMDATAROOT/inputdata" -export TOOLSLIBS="" -export REGRID_PROC=1 -export TOOLS_CONF_STRING="--mpilib mpi-serial" - - -echo_arg="" - -EOF -#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ writing to batch script ^^^^^^^^^^^^^^^^^^^ - ;; - - ##cheyenne - cheyenne* | r*i*n*) - submit_script="test_driver_cheyenne${cur_time}.sh" - -#vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv writing to batch script vvvvvvvvvvvvvvvvvvv -at > ./${submit_script} << EOF -!/bin/sh - - -interactive="YES" -input_file="tests_pretag_cheyenne_nompi" -c_threads=36 - - -export INITMODULES="/glade/u/apps/ch/opt/lmod/8.1.7/lmod/lmod/init/sh" -. \$INITMODULES - -module purge -module load ncarenv -module load intel -module load mkl -module load ncarcompilers -module load netcdf - -module load nco -module load ncl - -module load conda - - -##omp threads -if [ -z "\$CLM_THREADS" ]; then #threads NOT set on command line - export CLM_THREADS=\$c_threads -fi - -# Stop on first failed test -if [ -z "\$CLM_SOFF" ]; then #CLM_SOFF NOT set - export CLM_SOFF=FALSE -fi - -export CESM_MACH="cheyenne" -export CESM_COMP="intel" - -export NETCDF_DIR=\$NETCDF -export INC_NETCDF=\$NETCDF/include -export LIB_NETCDF=\$NETCDF/lib -export MAKE_CMD="gmake -j " -export CFG_STRING="" -export TOOLS_MAKE_STRING="USER_FC=ifort USER_LINKER=ifort USER_CPPDEFS=-DLINUX" -export MACH_WORKSPACE="/glade/scratch" -export CPRNC_EXE="$CESMDATAROOT/tools/cime/tools/cprnc/cprnc.cheyenne" -dataroot="$CESMDATAROOT" -export TOOLSLIBS="" -export REGRID_PROC=1 -export TOOLS_CONF_STRING="--mpilib mpi-serial" - - -echo_arg="" - -EOF -##^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ writing to batch script ^^^^^^^^^^^^^^^^^^^ - ;; - - ## DAV cluster - casper* | pronghorn*) - submit_script="test_driver_dav${cur_time}.sh" - -##vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv writing to batch script vvvvvvvvvvvvvvvvvvv -cat > ./${submit_script} << EOF -#!/bin/sh -# - -interactive="YES" -input_file="tests_posttag_dav_mpi" -c_threads=36 - - -export INITMODULES="/glade/u/apps/ch/opt/lmod/8.1.7/lmod/lmod/init/sh" -. \$INITMODULES - -module purge -module load ncarenv -module load intel -module load mkl -module load ncarcompilers -module load netcdf -module load openmpi - -module load nco -module load conda -module load ncl - - -##omp threads -if [ -z "\$CLM_THREADS" ]; then #threads NOT set on command line - export CLM_THREADS=\$c_threads -fi - -# Stop on first failed test -if [ -z "\$CLM_SOFF" ]; then #CLM_SOFF NOT set - export CLM_SOFF=FALSE -fi - -export CESM_MACH="cheyenne" -export CESM_COMP="intel" - -export NETCDF_DIR=\$NETCDF -export INC_NETCDF=\$NETCDF/include -export LIB_NETCDF=\$NETCDF/lib -export MAKE_CMD="gmake -j " -export CFG_STRING="" -export TOOLS_MAKE_STRING="USER_FC=ifort USER_LINKER=ifort USER_CPPDEFS=-DLINUX" -export MACH_WORKSPACE="/glade/scratch" -export CPRNC_EXE="$CESMDATAROOT/tools/cime/tools/cprnc/cprnc.cheyenne" -dataroot="$CESMDATAROOT" -export TOOLSLIBS="" -export TOOLS_CONF_STRING="--mpilib mpich" - - -echo_arg="" - -EOF -##^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ writing to batch script ^^^^^^^^^^^^^^^^^^^ - ;; - - ## hobart - hobart* | h*.cgd.ucar.edu) - submit_script="test_driver_hobart_${cur_time}.sh" - export PATH=/cluster/torque/bin:${PATH} - -##vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv writing to batch script vvvvvvvvvvvvvvvvvvv -cat > ./${submit_script} << EOF -#!/bin/sh -# - -# Name of the queue (CHANGE THIS if needed) -#PBS -q long -# Number of nodes (CHANGE THIS if needed) -#PBS -l nodes=1:ppn=24 -# output file base name -#PBS -N test_dr -# Put standard error and standard out in same file -#PBS -j oe -# Export all Environment variables -#PBS -V -# End of options - -if [ -n "\$PBS_JOBID" ]; then #batch job - export JOBID=\`echo \${PBS_JOBID} | cut -f1 -d'.'\` - initdir=\${PBS_O_WORKDIR} -fi - -if [ "\$PBS_ENVIRONMENT" = "PBS_BATCH" ]; then - interactive="NO" - input_file="tests_posttag_hobart" -else - interactive="YES" - input_file="tests_posttag_hobart_nompi" -fi - -##omp threads -if [ -z "\$CLM_THREADS" ]; then #threads NOT set on command line - export CLM_THREADS=2 -fi -export CLM_RESTART_THREADS=1 - -##mpi tasks -export CLM_TASKS=24 -export CLM_RESTART_TASKS=20 - -export P4_GLOBMEMSIZE=500000000 - - -export CESM_MACH="hobart" - -ulimit -s unlimited -ulimit -c unlimited - -export CESM_COMP="intel" -export TOOLS_MAKE_STRING="USER_FC=ifort USER_CC=icc " -export TOOLS_CONF_STRING=" -mpilib mpi-serial" -export CFG_STRING="" -export INITMODULES="/usr/share/Modules/init/sh" - -. \$INITMODULES -module purge -module load compiler/intel -module load tool/nco -module load tool/netcdf -module load lang/python - -export NETCDF_DIR=\$NETCDF_PATH -export INC_NETCDF=\${NETCDF_PATH}/include -export LIB_NETCDF=\${NETCDF_PATH}/lib -export MAKE_CMD="gmake -j 5" ##using hyper-threading on hobart -export MACH_WORKSPACE="/scratch/cluster" -export CPRNC_EXE=/fs/cgd/csm/tools/cprnc/cprnc -export DATM_QIAN_DATA_DIR="/project/tss/atm_forcing.datm7.Qian.T62.c080727" -dataroot="/fs/cgd/csm" -export TOOLSSLIBS="" -echo_arg="-e" - -EOF -##^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ writing to batch script ^^^^^^^^^^^^^^^^^^^ - ;; - - ## izumi - izumi* | i*.unified.ucar.edu) - submit_script="test_driver_izumi_${cur_time}.sh" - export PATH=/cluster/torque/bin:${PATH} - -##vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv writing to batch script vvvvvvvvvvvvvvvvvvv -cat > ./${submit_script} << EOF -#!/bin/sh -# - -# Name of the queue (CHANGE THIS if needed) -#PBS -q long -# Number of nodes (CHANGE THIS if needed) -#PBS -l nodes=1:ppn=24 -# output file base name -#PBS -N test_dr -# Put standard error and standard out in same file -#PBS -j oe -# Export all Environment variables -#PBS -V -# End of options - -if [ -n "\$PBS_JOBID" ]; then #batch job - export JOBID=\`echo \${PBS_JOBID} | cut -f1 -d'.'\` - initdir=\${PBS_O_WORKDIR} -fi - -if [ "\$PBS_ENVIRONMENT" = "PBS_BATCH" ]; then - interactive="NO" - input_file="tests_posttag_izumi" -else - interactive="YES" - input_file="tests_posttag_izumi_nompi" -fi - -##omp threads -if [ -z "\$CLM_THREADS" ]; then #threads NOT set on command line - export CLM_THREADS=2 -fi -export CLM_RESTART_THREADS=1 - -##mpi tasks -export CLM_TASKS=24 -export CLM_RESTART_TASKS=20 - -export P4_GLOBMEMSIZE=500000000 - - -export CESM_MACH="izumi" - -ulimit -s unlimited -ulimit -c unlimited - -export CESM_COMP="intel" -export TOOLS_MAKE_STRING="USER_FC=ifort USER_CC=icc " -export TOOLS_CONF_STRING=" -mpilib mpi-serial" -export CFG_STRING="" -export INITMODULES="/usr/share/Modules/init/sh" - -. \$INITMODULES -module purge -module load compiler/intel -module load tool/nco -module load tool/netcdf -module load lang/python - -export NETCDF_DIR=\$NETCDF_PATH -export INC_NETCDF=\${NETCDF_PATH}/include -export LIB_NETCDF=\${NETCDF_PATH}/lib -export MAKE_CMD="gmake -j 5" ##using hyper-threading on izumi -export MACH_WORKSPACE="/scratch/cluster" -export CPRNC_EXE=/fs/cgd/csm/tools/cprnc/cprnc.izumi -export DATM_QIAN_DATA_DIR="/project/tss/atm_forcing.datm7.Qian.T62.c080727" -dataroot="/fs/cgd/csm" -export TOOLSSLIBS="" -echo_arg="-e" - -EOF -##^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ writing to batch script ^^^^^^^^^^^^^^^^^^^ - ;; - - * ) - echo "Only setup to work on: derecho, cheyenne, hobart and izumi" - exit - - -esac - -##vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv writing to batch script vvvvvvvvvvvvvvvvvvv -cat >> ./${submit_script} << EOF - -export CPRNC_OPT="" -if [ -n "\${CLM_JOBID}" ]; then - export JOBID=\${CLM_JOBID} -fi -##check if interactive job - -if [ "\$interactive" = "YES" ]; then - - if [ -z "\${JOBID}" ]; then - export JOBID=\$\$ - fi - echo "test_driver.sh: interactive run - setting JOBID to \$JOBID" - if [ \$0 = "test_driver.sh" ]; then - initdir="." - else - initdir=\${0%/*} - fi -else - echo "ERROR: you *always* need to use the interactive option (-i)" - echo " currently doesn't work without it" - exit 3 -fi - -##establish script dir and clm_root -if [ -f \${initdir}/test_driver.sh ]; then - export CLM_SCRIPTDIR=\`cd \${initdir}; pwd \` - export CLM_ROOT=\`cd \${CLM_SCRIPTDIR}/../..; pwd \` - export CTSM_ROOT=\${CLM_ROOT} - if [ -d \${CLM_ROOT}/cime ]; then - export CIME_ROOT=\${CLM_ROOT}/cime - else - export CIME_ROOT=\${CLM_ROOT}/../../cime - fi - if [ ! -d \${CIME_ROOT} ]; then - echo "ERROR: trouble finding the CIME_ROOT directory: \$CIME_ROOT" - exit 3 - fi -else - if [ -n "\${CLM_ROOT}" ] && [ -f \${CLM_ROOT}/test/tools/test_driver.sh ]; then - export CLM_SCRIPTDIR=\`cd \${CLM_ROOT}/test/tools; pwd \` - else - echo "ERROR: unable to determine script directory " - echo " if initiating batch job from directory other than the one containing test_driver.sh, " - echo " you must set the environment variable CLM_ROOT to the full path of directory containing " - echo " . " - exit 3 - fi -fi - -# Setup conda environment -conda activate ctsm_pylib -if [ \$? -ne 0 ]; then - echo "ERROR: Trouble activating the ctsm_pylib conda environment, be sure it's setup with \$CLM_ROOT/py_env_create, then rerun" - exit 4 -fi - -##output files -clm_log=\${initdir}/td.\${JOBID}.log -if [ -f \$clm_log ]; then - rm \$clm_log -fi -clm_status=\${initdir}/td.\${JOBID}.status -if [ -f \$clm_status ]; then - rm \$clm_status -fi - -##setup test work directory -if [ -z "\$CLM_TESTDIR" ]; then - export CLM_TESTDIR=\${MACH_WORKSPACE}/\$LOGNAME/clmTests/test-driver.\${JOBID} - if [ -d \$CLM_TESTDIR ] && [ \$CLM_RETAIN_FILES != "TRUE" ]; then - rm -r \$CLM_TESTDIR - fi -fi -if [ ! -d \$CLM_TESTDIR ]; then - mkdir -p \$CLM_TESTDIR - if [ \$? -ne 0 ]; then - echo "ERROR: unable to create work directory \$CLM_TESTDIR" - exit 4 - fi -fi - -## PIO build directory -export PIO_LIBDIR=\$CLM_TESTDIR/pio - -##set our own environment vars -export CSMDATA=\${dataroot}/inputdata -export DIN_LOC_ROOT=\${CSMDATA} -export MPI_TYPE_MAX=100000 - -##process other env vars possibly coming in -if [ -z "\$CLM_RETAIN_FILES" ]; then - export CLM_RETAIN_FILES=FALSE -fi -if [ -n "\${CLM_INPUT_TESTS}" ]; then - input_file=\$CLM_INPUT_TESTS -else - input_file=\${CLM_SCRIPTDIR}/\${input_file} -fi -if [ ! -f \${input_file} ]; then - echo "ERROR: unable to locate input file \${input_file}" - exit 5 -fi - -if [ \$interactive = "YES" ]; then - echo "reading tests from \${input_file}" -else - echo "reading tests from \${input_file}" >> \${clm_log} -fi - -num_tests=\`wc -w < \${input_file}\` -echo "STATUS OF CLM TESTING UNDER JOB \${JOBID}; scheduled to run \$num_tests tests from:" >> \${clm_status} -echo "\$input_file" >> \${clm_status} -echo "" >> \${clm_status} -echo " on machine: $hostname" >> \${clm_status} -if [ -n "${BL_ROOT}" ]; then - echo "tests of baseline will use source code from:" >> \${clm_status} - echo "\$BL_ROOT" >> \${clm_status} -fi -if [ \$interactive = "NO" ]; then - echo "see \${clm_log} for more detailed output" >> \${clm_status} -fi -echo "" >> \${clm_status} - -test_list="" -while read input_line; do - test_list="\${test_list}\${input_line} " -done < \${input_file} - - -##initialize flags, counter -skipped_tests="NO" -pending_tests="NO" -count=0 - -##loop through the tests of input file -for test_id in \${test_list}; do - count=\`expr \$count + 1\` - while [ \${#count} -lt 3 ]; do - count="0\${count}" - done - - master_line=\`grep \$test_id \${CLM_SCRIPTDIR}/input_tests_master\` - status_out="" - for arg in \${master_line}; do - status_out="\${status_out}\${arg} " - done - - if [ -z "\$status_out" ]; then - echo "No test matches \$test_id in \${CLM_SCRIPTDIR}/input_tests_master" - exit 3 - fi - - test_cmd=\${status_out#* } - - status_out="\${count} \${status_out}" - - if [ \$interactive = "YES" ]; then - echo "" - echo "***********************************************************************************" - echo "\${status_out}" - echo "***********************************************************************************" - else - echo "" >> \${clm_log} - echo "***********************************************************************************"\ - >> \${clm_log} - echo "\$status_out" >> \${clm_log} - echo "***********************************************************************************"\ - >> \${clm_log} - fi - - if [ \${#status_out} -gt 94 ]; then - status_out=\`echo "\${status_out}" | cut -c1-100\` - fi - while [ \${#status_out} -lt 97 ]; do - status_out="\${status_out}." - done - - echo \$echo_arg "\$status_out\c" >> \${clm_status} - - if [ \$interactive = "YES" ]; then - \${CLM_SCRIPTDIR}/\${test_cmd} - rc=\$? - else - \${CLM_SCRIPTDIR}/\${test_cmd} >> \${clm_log} 2>&1 - rc=\$? - fi - if [ \$rc -eq 0 ]; then - echo "PASS" >> \${clm_status} - elif [ \$rc -eq 255 ]; then - echo "SKIPPED*" >> \${clm_status} - skipped_tests="YES" - elif [ \$rc -eq 254 ]; then - echo "PENDING**" >> \${clm_status} - pending_tests="YES" - else - echo " rc=\$rc FAIL" >> \${clm_status} - if [ "\$CLM_SOFF" = "TRUE" ]; then - echo "stopping on first failure" >> \${clm_status} - echo "stopping on first failure" >> \${clm_log} - exit 6 - fi - fi -done - -echo "end of input" >> \${clm_status} -if [ \$interactive = "YES" ]; then - echo "end of input" -else - echo "end of input" >> \${clm_log} -fi - -if [ \$skipped_tests = "YES" ]; then - echo "* please verify that any skipped tests are not required of your clm commit" >> \${clm_status} -fi -if [ \$pending_tests = "YES" ]; then - echo "** tests that are pending must be checked manually for a successful completion" >> \${clm_status} - if [ \$interactive = "NO" ]; then - echo " see the test's output in \${clm_log} " >> \${clm_status} - echo " for the location of test results" >> \${clm_status} - fi -fi - -if [ "\$interactive" = "YES" ]; then - passInt="test_driver.sh-i" -else - passInt="test_driver.sh" -fi - -../../bld/unit_testers/xFail/wrapClmTests.pl -statusFile "\${clm_status}" -numberOfTests "\${num_tests}" -callingScript "\${passInt}" - -exit 0 - -EOF -##^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ writing to batch script ^^^^^^^^^^^^^^^^^^^ - - -chmod a+x $submit_script -if [ ! -z "$CLM_RETAIN_FILES" ]; then - export CLM_RETAIN_FILES="FALSE" -fi -arg1=${1##*-} -case $arg1 in - [iI]* ) - debug="NO" - interactive="YES" - compile_only="NO" - export debug - export interactive - export compile_only - ./${submit_script} - exit 0 - ;; - - [cC]* ) - debug="NO" - interactive="YES" - compile_only="YES" - export debug - export CLM_RETAIN_FILES="TRUE" - export interactive - export compile_only - export CLM_RETAIN_FILES="TRUE" - ./${submit_script} - exit 0 - ;; - - [dD]* ) - debug="YES" - interactive="YES" - compile_only="NO" - export debug - export interactive - export compile_only - ./${submit_script} - exit 0 - ;; - - [fF]* ) - debug="NO" - interactive="NO" - compile_only="NO" - export debug - export interactive - export compile_only - ;; - - "" ) - echo "" - echo "**********************" - echo "$submit_script has been created and will be submitted to the batch queue..." - echo "(ret) to continue, (a) to abort" - read ans - case $ans in - [aA]* ) - echo "aborting...type ./test_driver.sh -h for help message" - exit 0 - ;; - esac - debug="NO" - interactive="NO" - compile_only="NO" - export debug - export interactive - export compile_only - ;; - - * ) - echo "" - echo "**********************" - echo "usage on derecho, cheyenne, hobart, and izumi: " - echo "./test_driver.sh -i" - echo "" - echo "valid arguments: " - echo "-i interactive usage" - echo "-c compile-only usage (run configure and compile do not run clm)" - echo "-d debug-only usage (run configure and build-namelist do NOT compile or run clm)" - echo "-f force batch submission (avoids user prompt)" - echo "-h displays this help message" - echo "" - echo "**pass environment variables by preceding above commands " - echo " with 'env var1=setting var2=setting '" - echo "" - echo "**********************" - exit 0 - ;; -esac - -echo "submitting..." -case $hostname in - #default - * ) - echo "no submission capability on this machine use the interactive option: -i" - exit 0 - ;; - -esac -exit 0 From 7c5c632f02b54f2285bdfb3902834d78715077f7 Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Thu, 16 May 2024 15:03:31 -0600 Subject: [PATCH 0265/1248] fix namelist definition --- bld/namelist_files/namelist_definition_ctsm.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bld/namelist_files/namelist_definition_ctsm.xml b/bld/namelist_files/namelist_definition_ctsm.xml index 03b1e9e64d..58e0aca3a6 100644 --- a/bld/namelist_files/namelist_definition_ctsm.xml +++ b/bld/namelist_files/namelist_definition_ctsm.xml @@ -734,8 +734,8 @@ Toggle to turn on no competition mode (only relevant if FATES is being used). Toggle to turn on FATES satellite phenology mode (only relevant if FATES is being used). - + Set FATES harvesting mode by setting fates_harvest_mode to a valid string option. Allowed values are: no_harvest: no fates harvesting of any kind From 5e9bc2e9a40987ff5477d0b3cdc742c3fbcf5f23 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Thu, 16 May 2024 15:04:39 -0600 Subject: [PATCH 0266/1248] Update finidat that previously failing test now picks up by default --- 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 c62df7d77b..90e397d544 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -1097,7 +1097,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). ic_ymd="20110101" sim_year="2000" do_transient_pfts=".false." ic_tod="0" glc_nec="10" use_crop=".true." irrigate=".true." lnd_tuning_mode="clm6_0_GSWP3v1" ->lnd/clm2/initdata_esmf/ctsm5.2/clmi.I2000Clm50BgcCrop.2011-01-01.1.9x2.5_gx1v7_gl4_simyr2000_c240223.nc +>lnd/clm2/initdata_esmf/ctsm5.2/clmi.I2000Clm52BgcCrop.2000-01-01.1.9x2.5_gx1v7_gl4_simyr2000_c240515.nc From 0266a70e98142750e6c34494740a8dd3e600a93c Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Thu, 16 May 2024 15:22:10 -0600 Subject: [PATCH 0267/1248] update landuse parameters from ints to chars --- src/dyn_subgrid/dynFATESLandUseChangeMod.F90 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/dyn_subgrid/dynFATESLandUseChangeMod.F90 b/src/dyn_subgrid/dynFATESLandUseChangeMod.F90 index d9bd0352ca..f330ee2b78 100644 --- a/src/dyn_subgrid/dynFATESLandUseChangeMod.F90 +++ b/src/dyn_subgrid/dynFATESLandUseChangeMod.F90 @@ -35,11 +35,11 @@ module dynFATESLandUseChangeMod integer, public, parameter :: num_landuse_harvest_vars = 5 ! Define the fates landuse namelist mode switch values - integer, public, parameter :: fates_harvest_no_logging = 0 - integer, public, parameter :: fates_harvest_logging_only = 1 - integer, public, parameter :: fates_harvest_clmlanduse = 2 - integer, public, parameter :: fates_harvest_luh_area = 3 - integer, public, parameter :: fates_harvest_luh_mass = 4 + character(len=13), public, parameter :: fates_harvest_no_logging = 'no_harvest' + character(len=13), public, parameter :: fates_harvest_logging_only = 'event_code' + character(len=13), public, parameter :: fates_harvest_clmlanduse = 'surfdata_file' + character(len=13), public, parameter :: fates_harvest_luh_area = 'luhdata_area' + character(len=13), public, parameter :: fates_harvest_luh_mass = 'luhdata_mass' ! Define landuse harvest unit integer representation integer, public, parameter :: landuse_harvest_area_units = 1 From b706c5a717652f24ca30e7dd43285b9e527b0f16 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Thu, 16 May 2024 16:22:11 -0600 Subject: [PATCH 0268/1248] Have build-namelist not do the dust emission namelist settings, when the XML variable is set for CAM to do it, and add a test for this --- bld/CLMBuildNamelist.pm | 120 +++++++++-------- bld/unit_testers/build-namelist_test.pl | 169 ++---------------------- 2 files changed, 80 insertions(+), 209 deletions(-) diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index ce2c2a81d2..98fdd861a0 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -97,7 +97,7 @@ OPTIONS CENTURY or MIMICS decomposition This toggles on the namelist variables: use_fates. use_lch4 and use_nitrif_denitrif are optional - + (Only for CLM4.5/CLM5.0) -[no-]chk_res Also check [do NOT check] to make sure the resolution and land-mask is valid. @@ -1012,7 +1012,7 @@ sub setup_cmdl_fire_light_res { if ( ! &value_is_true($nl_flags->{'neon'}) ) { if ( defined($opts->{'clm_usr_name'}) ) { $log->warning("The NEON lightning dataset does NOT cover the entire globe, make sure it covers the region for your grid"); - } else { + } else { $log->fatal_error("The NEON lightning dataset can NOT be used for global grids or regions or points outside of its area as it does NOT cover the entire globe."); } } @@ -1702,7 +1702,7 @@ sub process_namelist_inline_logic { ###################################### # namelist options for dust emissions ###################################### - setup_logic_dust_emis($opts, $nl_flags, $definition, $defaults, $nl); + setup_logic_dust_emis($opts, $nl_flags, $definition, $defaults, $nl, $envxml_ref); ################################# # namelist group: megan_emis_nl # @@ -2273,7 +2273,7 @@ sub setup_logic_crop_inparm { } add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, "initial_seed_at_planting", 'use_crop'=>$nl->get_value('use_crop') ); - + my $crop_residue_removal_frac = $nl->get_value('crop_residue_removal_frac'); add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'crop_residue_removal_frac' ); if ( $crop_residue_removal_frac < 0.0 or $crop_residue_removal_frac > 1.0 ) { @@ -2614,8 +2614,8 @@ SIMYR: foreach my $sim_yr ( @sim_years ) { if ( defined($use_init_interp_default) ) { $log->fatal_error($err_msg." but can't find one without $useinitvar being set to true, change it to true in your user_nl_clm file in your case"); } else { - my $set = "Relevent settings: use_cndv = ". $nl_flags->{'use_cndv'} . " phys = " . - $physv->as_string() . " hgrid = " . $nl_flags->{'res'} . " sim_year = " . + my $set = "Relevent settings: use_cndv = ". $nl_flags->{'use_cndv'} . " phys = " . + $physv->as_string() . " hgrid = " . $nl_flags->{'res'} . " sim_year = " . $settings{'sim_year'} . " lnd_tuning_mode = " . $nl_flags->{'lnd_tuning_mode'} . "use_fates = " . $nl_flags->{'use_fates'}; $log->fatal_error($err_msg." but the default setting of $useinitvar is false, so set both $var to a startup file and $useinitvar==TRUE, or developers should modify the namelist_defaults file".$set); @@ -3158,7 +3158,6 @@ sub setup_logic_supplemental_nitrogen { add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'suplnitro', 'use_fates'=>$nl_flags->{'use_fates'}); } - # # Error checking for suplnitro # @@ -3683,10 +3682,10 @@ sub setup_logic_nitrogen_deposition { 'use_cn'=>$nl_flags->{'use_cn'}, 'hgrid'=>$nl_flags->{'res'}, 'clm_accelerated_spinup'=>$nl_flags->{'clm_accelerated_spinup'} ); add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'ndep_taxmode', 'phys'=>$nl_flags->{'phys'}, - 'use_cn'=>$nl_flags->{'use_cn'}, + 'use_cn'=>$nl_flags->{'use_cn'}, 'lnd_tuning_mode'=>$nl_flags->{'lnd_tuning_mode'} ); add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'ndep_varlist', 'phys'=>$nl_flags->{'phys'}, - 'use_cn'=>$nl_flags->{'use_cn'}, + 'use_cn'=>$nl_flags->{'use_cn'}, 'lnd_tuning_mode'=>$nl_flags->{'lnd_tuning_mode'} ); add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_year_first_ndep', 'phys'=>$nl_flags->{'phys'}, 'use_cn'=>$nl_flags->{'use_cn'}, 'sim_year'=>$nl_flags->{'sim_year'}, @@ -3990,51 +3989,64 @@ sub setup_logic_fire_emis { sub setup_logic_dust_emis { # Logic to handle the dust emissions namelists, both drv_flds_in and lnd_in files - my ($opts, $nl_flags, $definition, $defaults, $nl) = @_; + my ($opts, $nl_flags, $definition, $defaults, $nl, $envxml_ref) = @_; - # First get the dust emission method - my $var = "dust_emis_method"; - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, $var ); - - my $dust_emis_method = remove_leading_and_trailing_quotes( $nl->get_value($var) ); - - my @zender_files_in_lnd_opts = ( "stream_fldfilename_zendersoilerod", "stream_meshfile_zendersoilerod", - "zendersoilerod_mapalgo" ); - if ( $dust_emis_method eq "Zender_2003" ) { - # get the zender_soil_erod_source - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, - "zender_soil_erod_source", 'dust_emis_method'=>$dust_emis_method ); - - my $zender_source = remove_leading_and_trailing_quotes( $nl->get_value('zender_soil_erod_source') ); - if ( $zender_source eq "lnd" ) { - foreach my $option ( @zender_files_in_lnd_opts ) { - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, $option, - 'dust_emis_method'=>$dust_emis_method, 'zender_soil_erod_source'=>$zender_source, - 'hgrid'=>$nl_flags->{'res'}, 'lnd_tuning_mod'=>$nl_flags->{'lnd_tuning_mode'} ); - } - } elsif ( $zender_source eq "atm" ) { - foreach my $option ( @zender_files_in_lnd_opts ) { - if ( defined($nl->get_value($option)) ) { - $log->fatal_error("zender_soil_erod_source is atm, and the file option $option is being set" . - " which should NOT be unless you want it handled here in the LAND model, " . - "otherwise the equivalent option is set in CAM" ); - } - } - } elsif ( $zender_source eq "none" ) { - $log->fatal_error("zender_soil_erod_source is set to none and only atm or lnd should be used when $var is Zender_2002" ); - } + # Only set dust emission settings -- if not connected to CAM + my $lnd_sets_dust = logical_to_fortran($envxml_ref->{'LND_SETS_DUST_EMIS_DRV_FLDS'}); + if ( &value_is_true( $lnd_sets_dust)) { + + # First get the dust emission method + my $var = "dust_emis_method"; + add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, $var ); + my $dust_emis_method = remove_leading_and_trailing_quotes( $nl->get_value($var) ); + + my @zender_files_in_lnd_opts = ( "stream_fldfilename_zendersoilerod", "stream_meshfile_zendersoilerod", + "zendersoilerod_mapalgo" ); + if ( $dust_emis_method eq "Zender_2003" ) { + # get the zender_soil_erod_source + add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, + "zender_soil_erod_source", 'dust_emis_method'=>$dust_emis_method ); + + my $zender_source = remove_leading_and_trailing_quotes( $nl->get_value('zender_soil_erod_source') ); + if ( $zender_source eq "lnd" ) { + foreach my $option ( @zender_files_in_lnd_opts ) { + add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, $option, + 'dust_emis_method'=>$dust_emis_method, 'zender_soil_erod_source'=>$zender_source, + 'hgrid'=>$nl_flags->{'res'}, 'lnd_tuning_mod'=>$nl_flags->{'lnd_tuning_mode'} ); + } + } elsif ( $zender_source eq "atm" ) { + foreach my $option ( @zender_files_in_lnd_opts ) { + if ( defined($nl->get_value($option)) ) { + $log->fatal_error("zender_soil_erod_source is atm, and the file option $option is being set" . + " which should NOT be unless you want it handled here in the LAND model, " . + "otherwise the equivalent option is set in CAM" ); + } + } + } elsif ( $zender_source eq "none" ) { + $log->fatal_error("zender_soil_erod_source is set to none and only atm or lnd should be used when $var is Zender_2002" ); + } + } else { + # Verify that NONE of the Zender options are being set if Zender is NOT being used + push @zender_files_in_lnd_opts, "zender_soil_erod_source"; + foreach my $option ( @zender_files_in_lnd_opts ) { + if ( defined($nl->get_value($option)) ) { + $log->fatal_error("dust_emis_method is NOT set to Zender_2003, but one of it's options " . + "$option is being set, need to change one or the other" ); + } + } + if ( $dust_emis_method eq "Leung_2023" ) { + $log->warning("dust_emis_method is Leung_2023 and that option has NOT been brought into CTSM yet"); + } + } + # Otherwise make sure dust settings are NOT being set in CLM } else { - # Verify that NONE of the Zender options are being set if Zender is NOT being used - push @zender_files_in_lnd_opts, "zender_soil_erod_source"; - foreach my $option ( @zender_files_in_lnd_opts ) { - if ( defined($nl->get_value($option)) ) { - $log->fatal_error("dust_emis_method is NOT set to Zender_2003, but one of it's options " . - "$option is being set, need to change one or the other" ); - } - } - if ( $dust_emis_method eq "Leung_2023" ) { - $log->warning("dust_emis_method is Leung_2023 and that option has NOT been brought into CTSM yet"); - } + my @vars = ( "dust_emis_method", "zender_soil_erod_source" ); + foreach my $option ( @vars ) { + if ( defined($nl->get_value($option)) ) { + $log->fatal_error("Dust emission variable is being set in CTSM, which should NOT be done when" . + " connected to CAM as CAM should set them"); + } + } } } @@ -4528,8 +4540,8 @@ sub setup_logic_fates { my $suplnitro = $nl->get_value('suplnitro'); my $parteh_mode = $nl->get_value('fates_parteh_mode'); if ( ($parteh_mode == 1) && ($suplnitro !~ /ALL/) && not &value_is_true( $nl_flags->{'use_fates_sp'}) ) { - $log->fatal_error("supplemental Nitrogen (suplnitro) is NOT set to ALL, FATES is on, " . - "but and FATES-SP is not active, but fates_parteh_mode is 1, so Nitrogen is not active" . + $log->fatal_error("supplemental Nitrogen (suplnitro) is NOT set to ALL, FATES is on, " . + "but and FATES-SP is not active, but fates_parteh_mode is 1, so Nitrogen is not active" . "Change suplnitro back to ALL"); } # diff --git a/bld/unit_testers/build-namelist_test.pl b/bld/unit_testers/build-namelist_test.pl index 30110d92f7..d017997c6a 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 = 2515; +my $ntests = 2516; if ( defined($opts{'compare'}) ) { $ntests += 1545; @@ -500,447 +500,358 @@ sub cat_and_create_namelistinfile { my %failtest = ( "coldstart but with IC file"=>{ options=>"-clm_start_type cold -envxml_dir .", namelst=>"finidat='$finidat'", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm5_0", }, "clm_demand on finidat" =>{ options=>"-clm_demand finidat -envxml_dir .", namelst=>"", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm5_0", }, "blank IC file, not cold" =>{ options=>"-clm_start_type startup -envxml_dir .", namelst=>"finidat=' '", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm5_0", }, "startup without interp" =>{ options=>"-clm_start_type startup -envxml_dir . -bgc sp -sim_year 1850", namelst=>"use_init_interp=.false., start_ymd=19200901", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm5_0", }, "use_crop without -crop" =>{ options=>" -envxml_dir .", namelst=>"use_crop=.true.", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm4_5", }, "soilm_stream off w file" =>{ options=>"-res 0.9x1.25 -envxml_dir .", namelst=>"use_soil_moisture_streams = .false.,stream_fldfilename_soilm='file_provided_when_off'", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm5_0", }, "exice_stream off w file" =>{ options=>"-res 0.9x1.25 -envxml_dir .", namelst=>"use_excess_ice=.true., use_excess_ice_streams = .false.,stream_fldfilename_exice='file_provided_when_off'", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm5_0", }, "exice_stream off w mesh" =>{ options=>"-res 0.9x1.25 -envxml_dir .", namelst=>"use_excess_ice=.true., use_excess_ice_streams = .false.,stream_meshfile_exice='file_provided_when_off'", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm5_0", }, "exice off, but stream on" =>{ options=>"-res 0.9x1.25 -envxml_dir .", namelst=>"use_excess_ice=.false., use_excess_ice_streams = .true.,stream_fldfilename_exice='file_provided', stream_meshfile_exice='file_provided'", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm5_0", }, "exice stream off, but setmap"=>{ options=>"-res 0.9x1.25 -envxml_dir .", namelst=>"use_excess_ice=.true., use_excess_ice_streams = .false.,stream_mapalgo_exice='bilinear'", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm5_0", }, "exice stream on, but mct" =>{ options=>"--res 0.9x1.25 --envxml_dir . --driver mct --lnd_frac $DOMFILE ", namelst=>"use_excess_ice=.true., use_excess_ice_streams=.true.", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm5_0", }, "clm50CNDVwtransient" =>{ options=>" -envxml_dir . -use_case 20thC_transient -dynamic_vegetation -res 10x15 -ignore_warnings", namelst=>"", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm5_0", }, "decomp_without_cn" =>{ options=>" -envxml_dir . -bgc sp", namelst=>"soil_decomp_method='CENTURYKoven2013'", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm5_0", }, "bgc_with_no_decomp" =>{ options=>" -envxml_dir . -bgc bgc", namelst=>"soil_decomp_method='None'", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm5_0", }, "reseed without CN" =>{ options=>" -envxml_dir . -bgc sp", namelst=>"reseed_dead_plants=.true.", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm5_0", }, "onset_threh w SP" =>{ options=>" -envxml_dir . -bgc sp", namelst=>"onset_thresh_depends_on_veg=.true.", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm6_0", }, "dribble_crphrv w/o CN" =>{ options=>" -envxml_dir . -bgc sp", namelst=>"dribble_crophrv_xsmrpool_2atm=.true.", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm5_0", }, "dribble_crphrv w/o crop" =>{ options=>" -envxml_dir . -bgc bgc -no-crop", namelst=>"dribble_crophrv_xsmrpool_2atm=.true.", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm5_0", }, "CNDV with flanduse_timeseries - clm4_5"=>{ options=>"-bgc bgc -dynamic_vegetation -envxml_dir . -ignore_warnings", namelst=>"flanduse_timeseries='my_flanduse_timeseries_file.nc'", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm4_5", }, "use_cndv=T without bldnml op"=>{ options=>"-bgc bgc -envxml_dir . -ignore_warnings", namelst=>"use_cndv=.true.", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm4_5", }, "use_cndv=F with dyn_veg op"=>{ options=>"-bgc bgc -dynamic_vegetation -envxml_dir . -ignore_warnings", namelst=>"use_cndv=.false.", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm4_5", }, "crop with use_crop false" =>{ options=>"-crop -bgc bgc -envxml_dir .", namelst=>"use_crop=.false.", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm4_5", }, "crop without CN" =>{ options=>"-crop -bgc sp -envxml_dir .", namelst=>"", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm4_5", }, "toosmall soil w trans" =>{ options=>"-envxml_dir .", namelst=>"toosmall_soil=10, dyn_transient_pfts=T", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm5_0", }, "toosmall lake w trans" =>{ options=>"-envxml_dir .", namelst=>"toosmall_lake=10, dyn_transient_pfts=T", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm5_0", }, "toosmall crop w trans" =>{ options=>"-bgc bgc -crop -envxml_dir .", namelst=>"toosmall_crop=10, dyn_transient_pfts=T", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm5_0", }, "toosmall wetl w trans" =>{ options=>"-bgc bgc -envxml_dir .", namelst=>"toosmall_wetland=10, dyn_transient_pfts=T", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm5_0", }, "toosmall glc w trans" =>{ options=>"-bgc sp -envxml_dir .", namelst=>"toosmall_glacier=10, dyn_transient_pfts=T", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm5_0", }, "toosmall urban w trans" =>{ options=>"-bgc sp -envxml_dir .", namelst=>"toosmall_urban=10, dyn_transient_pfts=T", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm5_0", }, "collapse_urban w trans" =>{ options=>"-bgc sp -envxml_dir .", namelst=>"collapse_urban=T, dyn_transient_crops=T", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm5_0", }, "n_dom_landunits w trans" =>{ options=>"-bgc sp -envxml_dir .", namelst=>"n_dom_landunits=2, dyn_transient_crops=T", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm5_0", }, "n_dom_pfts w trans" =>{ options=>"-bgc sp -envxml_dir .", namelst=>"n_dom_pfts=2, dyn_transient_crops=T", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm5_0", }, "baset_map without crop" =>{ options=>"-bgc bgc -envxml_dir . -no-crop", namelst=>"baset_mapping='constant'", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm5_0", }, "mapvary var w/o varymap" =>{ options=>"-crop -bgc bgc -envxml_dir . -crop", namelst=>"baset_mapping='constant', baset_latvary_slope=1.0, baset_latvary_intercept=10.0", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm5_0", }, "grainproductWOcrop" =>{ options=>"-bgc bgc -no-crop -envxml_dir .", namelst=>"use_grainproduct=.true.", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm4_5", }, "interp without finidat" =>{ options=>"-bgc sp -envxml_dir .", namelst=>"use_init_interp=.true. finidat=' '", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm5_0", }, "sp and c13" =>{ options=>"-bgc sp -envxml_dir .", namelst=>"use_c13=.true.", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm4_5", }, "sp and c14" =>{ options=>"-bgc sp -envxml_dir .", namelst=>"use_c14=.true.", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm4_5", }, "bombspike no c14" =>{ options=>"-bgc bgc -envxml_dir .", namelst=>"use_c14=.false. use_c14_bombspike=.true.", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm5_0", }, "use c13 timeseries no cn" =>{ options=>"-bgc sp -envxml_dir .", namelst=>"use_c13_timeseries=.true.", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm4_5", }, "use c13 timeseries no c13"=>{ options=>"-bgc bgc -envxml_dir .", namelst=>"use_c13=.false. use_c13_timeseries=.true.", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm4_5", }, "bombspike no cn" =>{ options=>"-bgc sp -envxml_dir .", namelst=>"use_c14_bombspike=.true.", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm5_0", }, "lightres no cn" =>{ options=>"-bgc sp -envxml_dir . -light_res 360x720", namelst=>"", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm5_0", }, "NEONlightresButGlobal" =>{ options=>"--res 4x5 --bgc bgc --envxml_dir . --light_res 106x740", namelst=>"", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm6_0", }, "spno-fire" =>{ options=>"-bgc sp -envxml_dir . -use_case 2000_control", namelst=>"fire_method='nofire'", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm5_0", }, "lightres no fire" =>{ options=>"-bgc bgc -envxml_dir . -light_res 360x720", namelst=>"fire_method='nofire'", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm5_0", }, "lightres none bgc" =>{ options=>"-bgc bgc -envxml_dir . -light_res none", namelst=>"", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm5_0", }, "lightresnotnone-nofire" =>{ options=>"-bgc bgc -envxml_dir . -light_res 94x192", namelst=>"fire_method='nofire'", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm5_0", }, "lightresnonenofirelightfil"=>{ options=>"-bgc bgc -envxml_dir . -light_res none", namelst=>"fire_method='nofire',stream_fldfilename_lightng='build-namelist_test.pl'", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm5_0", }, "lightrescontradictlightfil"=>{ options=>"-bgc bgc -envxml_dir . -light_res 360x720", namelst=>"stream_fldfilename_lightng='build-namelist_test.pl'", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm5_0", }, "finundated and not methane"=>{ options=>"-bgc bgc -envxml_dir .", namelst=>"use_lch4=.false.,finundation_method='h2osfc'", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm5_0", }, "use_cn=true bgc=sp" =>{ options=>"-bgc sp -envxml_dir .", namelst=>"use_cn=.true.", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm4_5", }, "freeliv wo fun" =>{ options=>"-bgc bgc -envxml_dir .", namelst=>"freelivfix_intercept=9.", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm4_5", }, "use_cn=false bgc=bgc" =>{ options=>"-bgc bgc -envxml_dir .", namelst=>"use_cn=.false.", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm4_5", }, "lower=aqu-45 with/o Zeng" =>{ options=>"-envxml_dir .", namelst=>"lower_boundary_condition=4,soilwater_movement_method=1,use_bedrock=.false.", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm5_0", }, "Zeng w lower=flux" =>{ options=>"-envxml_dir .", namelst=>"lower_boundary_condition=1,soilwater_movement_method=0,use_bedrock=.false.", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm4_5", }, "Zeng w lower=zeroflux" =>{ options=>"-envxml_dir .", namelst=>"lower_boundary_condition=2,soilwater_movement_method=0", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm4_5", }, "Zeng w lower=table" =>{ options=>"-envxml_dir .", namelst=>"lower_boundary_condition=3,soilwater_movement_method=0,use_bedrock=.false.", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm4_5", }, "use_vic=F with -vic op" =>{ options=>"-vichydro -envxml_dir .", namelst=>"use_vichydro=.false.", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm4_5", }, "-vic with l_bnd=flux" =>{ options=>"-vichydro -envxml_dir .", namelst=>"lower_boundary_condition=1", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm4_5", }, "-vic with l_bnd=zeroflux" =>{ options=>"-vichydro -envxml_dir .", namelst=>"lower_boundary_condition=2", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm4_5", }, "bedrock with l_bnc=flux" =>{ options=>"-envxml_dir .", namelst=>"use_bedrock=.true., lower_boundary_condition=1", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm5_0", }, "bedrock with l_bnc=tabl" =>{ options=>"-envxml_dir .", namelst=>"use_bedrock=.true., lower_boundary_condition=3", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm5_0", }, "bedrock with l_bnc=aqui" =>{ options=>"-envxml_dir .", namelst=>"use_bedrock=.true., lower_boundary_condition=4", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm5_0", }, "zengdeck with l_bnc=flux" =>{ options=>"-envxml_dir .", namelst=>"soilwater_movement_method=0, lower_boundary_condition=1", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm4_5", }, "zengdeck with l_bnc=z-flux"=>{ options=>"-envxml_dir .", namelst=>"soilwater_movement_method=0, lower_boundary_condition=2", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm4_5", }, "zengdeck with l_bnc=tabl" =>{ options=>"-envxml_dir .", namelst=>"soilwater_movement_method=0, lower_boundary_condition=3", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm4_5", }, "l_bnd=tabl with h2osfcfl=0"=>{ options=>"-envxml_dir .", namelst=>"h2osfcflag=0, lower_boundary_condition=3", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm4_5", }, "l_bnd=flux with h2osfcfl=0"=>{ options=>"-envxml_dir .", namelst=>"h2osfcflag=0, lower_boundary_condition=1", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm4_5", }, "l_bnd=zflux with h2osfcfl=0"=>{ options=>"-envxml_dir .", namelst=>"h2osfcflag=0, lower_boundary_condition=2", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm4_5", }, "h2osfcfl=0 with clm5.0" =>{ options=>"-envxml_dir .", namelst=>"h2osfcflag=0", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm5_0", }, "45bad lnd_tuning_mode value" =>{ options=>"-lnd_tuning_mode clm5_0_GSWP3 -envxml_dir .", namelst=>"", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm4_5", }, "50bad lnd_tuning_mode value" =>{ options=>"-lnd_tuning_mode clm4_5_CRUNCEP -envxml_dir .", namelst=>"", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm5_0", }, "bgc_spinup without cn" =>{ options=>"-clm_accelerated_spinup on -bgc sp -envxml_dir .", namelst=>"spinup_state=1", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm4_5", }, "spinup=1 without bldnml op"=>{ options=>"-clm_accelerated_spinup off -bgc bgc -envxml_dir .", namelst=>"spinup_state=1",, - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm5_0", }, "bgc_spinup without cn" =>{ options=>"-clm_accelerated_spinup on -bgc sp -envxml_dir .", namelst=>"spinup_state=1", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm4_5", }, "baseflow w aquifer" =>{ options=>"-bgc sp -envxml_dir .", namelst=>"baseflow_scalar=1.0, lower_boundary_condition=4,use_bedrock=.false.", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm5_0", }, "baseflow w table" =>{ options=>"-bgc sp -envxml_dir .", namelst=>"baseflow_scalar=1.0, lower_boundary_condition=3,use_bedrock=.false.", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm5_0", }, "br_root and bgc=sp" =>{ options=>"-bgc sp -envxml_dir .", namelst=>"br_root=1.0", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm5_0", }, "both co2_type and on nml" =>{ options=>"-co2_type constant -envxml_dir .", namelst=>"co2_type='prognostic'", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm5_0", }, "both lnd_frac and on nml" =>{ options=>"-driver mct -lnd_frac $DOMFILE -envxml_dir .", namelst=>"fatmlndfrc='frac.nc'", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm5_0", }, "lnd_frac set to UNSET" =>{ options=>"-driver mct -lnd_frac UNSET -envxml_dir .", namelst=>"", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm6_0", }, "lnd_frac set but nuopc" =>{ options=>"-driver nuopc -lnd_frac $DOMFILE -envxml_dir .", namelst=>"", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm6_0", }, "lnd_frac not set but lilac"=>{ options=>"-driver nuopc -lilac -envxml_dir . -lnd_frac UNSET", namelst=>"fsurdat='surfdata.nc'", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm6_0", }, "fatmlndfrc set but nuopc" =>{ options=>"-driver nuopc -envxml_dir .", namelst=>"fatmlndfrc='frac.nc'", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm6_0", }, "force_send but not nuopc" =>{ options=>"-driver mct -lnd_frac $DOMFILE -envxml_dir .", namelst=>"force_send_to_atm = .false.", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm6_0", }, "branch but NO nrevsn" =>{ options=>"-clm_start_type branch -envxml_dir .", namelst=>"", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm5_0", }, "glc_nec inconsistent" =>{ options=>"-envxml_dir .", namelst=>"maxpatch_glc=5", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm5_0", }, "NoGLCMec" =>{ options=>"-envxml_dir . -glc_nec 0", namelst=>"", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm4_5", }, "UpdateGlcContradict" =>{ options=>"-envxml_dir .", @@ -950,321 +861,263 @@ sub cat_and_create_namelistinfile { }, "useFATESContradict" =>{ options=>"-bgc fates -envxml_dir . -no-megan", namelst=>"use_fates=.false.", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm4_5", }, "useFATESContradict2" =>{ options=>"-envxml_dir . -no-megan", namelst=>"use_fates=.true.", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm4_5", }, "useFATESWCN" =>{ options=>"-bgc fates -envxml_dir . -no-megan", namelst=>"use_cn=.true.", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm5_0", }, "useFATESWcrop" =>{ options=>"-bgc fates -envxml_dir . -no-megan -crop", namelst=>"", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm6_0", }, "useFATESWcreatecrop" =>{ options=>"-bgc fates -envxml_dir . -no-megan", namelst=>"create_crop_landunit=.true.", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm5_0", }, "useFATESWn_dom_pft" =>{ options=>"-bgc fates -envxml_dir . -no-megan", namelst=>"n_dom_pfts = 1", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm5_0", }, "useFATESWbMH" =>{ options=>"-bgc fates -envxml_dir . -no-megan", namelst=>"use_biomass_heat_storage=.true.", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm6_0", }, "FireNoneButFATESfireon" =>{ options=>"-bgc fates -envxml_dir . -no-megan -light_res none", namelst=>"fates_spitfire_mode=4", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm6_0", }, "FATESwspitfireOffLigtOn" =>{ options=>"-bgc fates -envxml_dir . -no-megan -light_res 360x720", namelst=>"fates_spitfire_mode=0", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm6_0", }, "useFATESWluna" =>{ options=>"--bgc fates --envxml_dir . --no-megan", namelst=>"use_luna=TRUE", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm6_0", }, "useFATESWfun" =>{ options=>"--bgc fates --envxml_dir . --no-megan", namelst=>"use_fun=TRUE", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm6_0", }, "useFATESWOsuplnitro" =>{ options=>"--bgc fates --envxml_dir . --no-megan", namelst=>"suplnitro='NONE'", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm6_0", }, "FireNoneButBGCfireon" =>{ options=>"-bgc bgc -envxml_dir . -light_res none", namelst=>"fire_method='li2021gswpfrc'", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm6_0", }, "createcropFalse" =>{ options=>"-bgc bgc -envxml_dir . -no-megan", namelst=>"create_crop_landunit=.false.", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm5_0", }, "usespitfireButNOTFATES" =>{ options=>"-envxml_dir . -no-megan", namelst=>"fates_spitfire_mode=1", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm4_5", }, "usespitfireusefatessp" =>{ options=>"-envxml_dir . --bgc fates", namelst=>"fates_spitfire_mode=1,use_fates_sp=.true.", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm5_0", }, "usefatesspusefateshydro" =>{ options=>"-envxml_dir . --bgc fates", namelst=>"use_fates_sp=.true.,use_fates_planthydro=.true.", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm5_0", }, "useloggingButNOTFATES" =>{ options=>"-envxml_dir . -no-megan", namelst=>"use_fates_logging=.true.", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm4_5", }, "useinventorybutnotfile" =>{ options=>"-bgc fates -envxml_dir . -no-megan", namelst=>"use_fates_inventory_init=.true.", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm4_5", }, "inventoryfileDNE" =>{ options=>"-bgc fates -envxml_dir . -no-megan", namelst=>"use_fates_inventory_init=.true., fates_inventory_ctrl_filename='zztop'", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm4_5", }, "useinventorybutnotfile" =>{ options=>"--res 0.9x1.25 --bgc fates --envxml_dir . --no-megan", namelst=>"use_fates_luh=.true.", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm4_5", }, "inventoryfileDNE" =>{ options=>"-bgc fates -envxml_dir . -no-megan", namelst=>"use_fates_luh=.true., fluh_timeseries='zztop'", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm4_5", }, "useMEGANwithFATES" =>{ options=>"-bgc fates -envxml_dir . -megan", namelst=>"", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm4_5", }, "useFIREEMISwithFATES" =>{ options=>"-bgc fates -envxml_dir . -fire_emis --no-megan", namelst=>"", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm4_5", }, "useDRYDEPwithFATES" =>{ options=>"--bgc fates --envxml_dir . --no-megan --drydep", namelst=>"", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm4_5", }, "useFATESSPWONOCOMP" =>{ options=>"-bgc fates -envxml_dir . -no-megan", namelst=>"use_fates_sp=T,use_fates_nocomp=F", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm5_0", }, "useFATESTRANSWdynPFT" =>{ options=>"-bgc fates -envxml_dir . -use_case 20thC_transient -no-megan", namelst=>"do_transient_pfts=T", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm5_0", }, "useHYDSTwithFATES" =>{ options=>"-bgc fates -envxml_dir . -no-megan", namelst=>"use_hydrstress=.true.", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm5_0", }, "useHYDSTwithdynroot" =>{ options=>"-bgc bgc -envxml_dir . -megan", namelst=>"use_hydrstress=.true., use_dynroot=.true.", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm5_0", }, "specWOfireemis" =>{ options=>"-envxml_dir . -no-fire_emis", namelst=>"fire_emis_specifier='bc_a1 = BC'", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm5_0", }, "elevWOfireemis" =>{ options=>"-envxml_dir . -no-fire_emis", namelst=>"fire_emis_elevated=.false.", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm5_0", }, "noanthro_w_crop" =>{ options=>"-envxml_dir . -res 0.9x1.25 -bgc bgc -crop -use_case 1850_noanthro_control", namelst=>"", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm5_0", }, "noanthro_w_irrig" =>{ options=>"-envxml_dir . -res 0.9x1.25 -bgc bgc -use_case 1850_noanthro_control", namelst=>"irrigate=T", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm5_0", }, "spdotransconflict" =>{ options=>"-envxml_dir . -bgc sp -use_case 20thC_transient", namelst=>"do_transient_pfts=T,do_transient_crops=.false.", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm5_0", }, "dogrossandsp" =>{ options=>"--envxml_dir . --bgc sp --use_case 20thC_transient", namelst=>"do_grossunrep=.true.", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm5_0", }, "dogrossandfates" =>{ options=>"--envxml_dir . --bgc fates --use_case 20thC_transient --no-megan", namelst=>"do_grossunrep=.true.", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm5_0", }, "dogrossandnottrans" =>{ options=>"--envxml_dir . --bgc bgc --use_case 2000_control", namelst=>"do_grossunrep=.true.", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm5_0", }, "nocropwfert" =>{ options=>"-envxml_dir . -bgc sp -no-crop", namelst=>"use_fertilizer=T", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm5_0", }, "lmr1WOcn" =>{ options=>"-envxml_dir . -bgc sp", namelst=>"leafresp_method=1", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm5_0", }, "lmr2WOcn" =>{ options=>"-envxml_dir . -bgc sp", namelst=>"leafresp_method=2", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm5_0", }, "lmr0Wcn" =>{ options=>"-envxml_dir . -bgc bgc", namelst=>"leafresp_method=0", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm5_0", }, "nofireButSetcli_scale" =>{ options=>"-envxml_dir . -bgc bgc", namelst=>"fire_method='nofire', cli_scale=5.", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm5_0", }, "nocnButSetrh_low" =>{ options=>"-envxml_dir . -bgc sp", namelst=>"rh_low=5.", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm5_0", }, "funWOcn" =>{ options=>"-envxml_dir . -bgc sp", namelst=>"use_fun=.true.", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm5_0", }, "flexCNWOcn" =>{ options=>"-envxml_dir . -bgc sp", namelst=>"use_flexibleCN=.true.", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm5_0", }, "flexCNFUNwcarbonresp" =>{ options=>"-envxml_dir . -bgc bgc", namelst=>"use_flexibleCN=.true.,use_FUN=.true.,carbon_resp_opt=1", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm5_0", }, "funWOnitrif" =>{ options=>"-envxml_dir .", namelst=>"use_fun=.true., use_nitrif_denitrif=.false.", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm5_0", }, "SPModeWNitrifNMethane" =>{ options=>"-envxml_dir . -bgc sp", namelst=>"use_lch4=.true., use_nitrif_denitrif=.true.", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm5_0", }, "knitrmaxWOnitrif" =>{ options=>"-envxml_dir . -bgc bgc", namelst=>"use_nitrif_denitrif=.false., k_nitr_max=1.0", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm5_0", }, "respcoefWOnitrif" =>{ options=>"-envxml_dir . -bgc bgc", namelst=>"use_nitrif_denitrif=.false., denitrif_respiration_coefficient=1.0", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm5_0", }, "respexpWOnitrif" =>{ options=>"-envxml_dir . -bgc bgc", namelst=>"use_nitrif_denitrif=.false., denitrif_respiration_exponent=1.0", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm5_0", }, "lunaWSPandlnctrue" =>{ options=>"-envxml_dir . -bgc sp", namelst=>"use_luna=.true., lnc_opt=.true.", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm5_0", }, "NOlunabutsetJmaxb1" =>{ options=>"-envxml_dir . -bgc sp", namelst=>"use_luna=.false., jmaxb1=1.0", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm5_0", }, "envxml_not_dir" =>{ options=>"-envxml_dir myuser_nl_clm", namelst=>"", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm5_0", }, "envxml_emptydir" =>{ options=>"-envxml_dir xFail", namelst=>"", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm5_0", }, "fates_non_sp_laistreams" =>{ options=>"--envxml_dir . --bgc fates", namelst=>"use_lai_streams=.true., use_fates_sp=.false.", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm5_0", }, "bgc_non_sp_laistreams" =>{ options=>"--envxml_dir . -bgc bgc", namelst=>"use_lai_streams=.true.", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm5_0", }, "bgc_laistreams_input" =>{ options=>"--envxml_dir . --bgc bgc", namelst=>"stream_year_first_lai=1999", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm5_0", }, "crop_laistreams_input" =>{ options=>"--envxml_dir . --bgc sp --crop", namelst=>"use_lai_streams=.true.", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm5_0", }, "soil_erod_wo_Zender" =>{ options=>"--envxml_dir . --ignore_warnings", namelst=>"dust_emis_method='Leung_2023', " . "stream_meshfile_zendersoilerod = '/dev/null'", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm5_1", }, "soil_erod_wo_lnd_source" =>{ options=>"--envxml_dir .", namelst=>"dust_emis_method='Zender_2003', " . "stream_fldfilename_zendersoilerod = '/dev/null', zender_soil_erod_source='atm'", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm5_1", }, "soil_erod_none_w_Zender" =>{ options=>"--envxml_dir .", namelst=>"dust_emis_method='Zender_2003', " . "zender_soil_erod_source='none'", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm5_1", }, "soil_erod_bad_w_Zender" =>{ options=>"--envxml_dir .", namelst=>"dust_emis_method='Zender_2003', " . "zender_soil_erod_source='zztop'", - GLC_TWO_WAY_COUPLING=>"FALSE", + phys=>"clm5_1", + }, + "Set_Dust_When_CAM_Sets" =>{ options=>"--envxml_dir .", + namelst=>"dust_emis_method='Zender_2003'", + LND_SETS_DUST_EMIS_DRV_FLDS=>"FALSE", phys=>"clm5_1", }, ); @@ -1273,7 +1126,13 @@ sub cat_and_create_namelistinfile { &make_config_cache($failtest{$key}{"phys"}); my $options = $failtest{$key}{"options"}; my $namelist = $failtest{$key}{"namelst"}; - &make_env_run( GLC_TWO_WAY_COUPLING=>$failtest{$key}{"GLC_TWO_WAY_COUPLING"} ); + my %settings; + foreach my $xmlvar ( "GLC_TWO_WAY_COUPLING", "LND_SETS_DUST_EMIS_DRV_FLDS") { + if ( defined($failtest{$key}{$xmlvar}) ) { + $settings{$xmlvar} = $failtest{$key}{$xmlvar}; + } + } + &make_env_run( %settings ); eval{ system( "$bldnml $options -namelist \"&clmexp $namelist /\" > $tempfile 2>&1 " ); }; isnt( $?, 0, $key ); system( "cat $tempfile" ); @@ -1515,7 +1374,7 @@ sub cat_and_create_namelistinfile { # cases; I'm not sure if it's actually important to test this with all # of the different use cases. my @glc_res = ( "0.9x1.25", "1.9x2.5" ); -my @use_cases = ( +my @use_cases = ( "1850-2100_SSP2-4.5_transient", "1850_control", "2000_control", From 0a08723cfe7365a7fb639513232bbeb1c12716c9 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Thu, 16 May 2024 16:38:06 -0600 Subject: [PATCH 0269/1248] Fix for issue #2546 --- cime_config/config_component.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cime_config/config_component.xml b/cime_config/config_component.xml index be6916ae0c..d69bdbc302 100644 --- a/cime_config/config_component.xml +++ b/cime_config/config_component.xml @@ -78,7 +78,7 @@ UNSET - clm5_0_cam6.0,clm5_0_cam7.0,clm5.0_cam5.0,clm5.0_cam4.0,clm5_0_GSWP3v1,clm5_0_CRUv7,clm5_0_QIAN,clm5_0_1PT,clm5_0_NLDAS2,clm5_0_ERA5,clm4_5_CRUv7,clm4_5_GSWP3v1,clm4_5_QIAN,clm4_5_cam6.0,clm4_5_cam7.0,clm4_5_cam5.0,clm4_5_cam4.0,clm4_5_1PT,clm4_5_NLDAS2,clm4_5_ERA5,clm5_1_CRUv7,clm5_1_GSWP3v1,clm5_1_cam6.0,clm5_1_QIAN,clm5_1_1PT,clm5_1_NLDAS2,clm5_1_ERA5,clm6_0_CRUv7,clm6_0_GSWP3v1,clm6_0_cam6.0,clm6_0_cam7.0,clm6_0_cam5.0,clm6_0_cam4.0,clm6_0_QIAN,clm6_0_1PT,clm6_0_NLDAS2,clm6_0_ERA5 + clm5_0_cam6.0,clm5_0_cam7.0,clm5_0_cam5.0,clm5_0_cam4.0,clm5_0_GSWP3v1,clm5_0_CRUv7,clm5_0_QIAN,clm5_0_1PT,clm5_0_NLDAS2,clm5_0_ERA5,clm4_5_CRUv7,clm4_5_GSWP3v1,clm4_5_QIAN,clm4_5_cam6.0,clm4_5_cam7.0,clm4_5_cam5.0,clm4_5_cam4.0,clm4_5_1PT,clm4_5_NLDAS2,clm4_5_ERA5,clm5_1_CRUv7,clm5_1_GSWP3v1,clm5_1_cam6.0,clm5_1_QIAN,clm5_1_1PT,clm5_1_NLDAS2,clm5_1_ERA5,clm6_0_CRUv7,clm6_0_GSWP3v1,clm6_0_cam6.0,clm6_0_cam7.0,clm6_0_cam5.0,clm6_0_cam4.0,clm6_0_QIAN,clm6_0_1PT,clm6_0_NLDAS2,clm6_0_ERA5 From 438d85a58b120a1329db4c47520ff473a40bcc5b Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Fri, 17 May 2024 09:27:55 -0600 Subject: [PATCH 0270/1248] Added a missing bracket --- bld/CLMBuildNamelist.pm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index ad378ffc6d..3658f681af 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -785,7 +785,7 @@ sub setup_cmdl_fates_mode { "use_fates_cohort_age_tracking","use_fates_inventory_init","use_fates_fixed_biogeog", "use_fates_nocomp","use_fates_sp","fates_inventory_ctrl_filename","fates_harvest_mode", "fates_parteh_mode","use_fates_tree_damage","fates_seeddisp_cadence","use_fates_luh","fluh_timeseries", - "flandusepftdat","use_fates_potentialveg","use_fates_lupft","fates_history_dimlevel"); + "flandusepftdat","use_fates_potentialveg","use_fates_lupft","fates_history_dimlevel" ); # dis-allow fates specific namelist items with non-fates runs foreach my $var ( @list ) { @@ -4517,7 +4517,7 @@ sub setup_logic_fates { add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'fates_paramfile', 'phys'=>$nl_flags->{'phys'}); my @list = ( "fates_spitfire_mode", "use_fates_planthydro", "use_fates_ed_st3", "use_fates_ed_prescribed_phys", "use_fates_inventory_init","fates_seeddisp_cadence","fates_history_dimlevel", - "fates_harvest_mode","fates_parteh_mode", "use_fates_cohort_age_tracking","use_fates_tree_damage"); + "fates_harvest_mode","fates_parteh_mode", "use_fates_cohort_age_tracking","use_fates_tree_damage" ); foreach my $var ( @list ) { add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, $var, 'use_fates'=>$nl_flags->{'use_fates'}, @@ -4564,12 +4564,12 @@ sub setup_logic_fates { # fates landuse can't be on with FATES SP mode is active if ( &value_is_true($nl->get_value('use_fates_luh')) ) { - $log->fatal_error('use_fates_luh can NOT be true when use_fates_sp is true'); + $log->fatal_error('use_fates_luh can NOT be true when use_fates_sp is true'); + } # hydro isn't currently supported to work when FATES SP mode is active if (&value_is_true( $nl->get_value('use_fates_planthydro') )) { $log->fatal_error('fates sp mode is currently not supported to work with fates hydro'); - } } } From 21f38b4701491c98281f2accdcb6d878c3d1fa67 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Fri, 17 May 2024 11:43:26 -0600 Subject: [PATCH 0271/1248] Add an empty unit tester for DUSTMod --- .../test/DustEmis_test/CMakeLists.txt | 6 ++ .../test/DustEmis_test/test_DustEmis.pf | 34 +++++++ .../share_esmf/ZenderSoilErodStreamType.F90 | 88 +++++++++++++++++++ 3 files changed, 128 insertions(+) create mode 100644 src/biogeochem/test/DustEmis_test/CMakeLists.txt create mode 100644 src/biogeochem/test/DustEmis_test/test_DustEmis.pf create mode 100644 src/unit_test_stubs/share_esmf/ZenderSoilErodStreamType.F90 diff --git a/src/biogeochem/test/DustEmis_test/CMakeLists.txt b/src/biogeochem/test/DustEmis_test/CMakeLists.txt new file mode 100644 index 0000000000..a618489386 --- /dev/null +++ b/src/biogeochem/test/DustEmis_test/CMakeLists.txt @@ -0,0 +1,6 @@ +set (pfunit_sources + test_DustEmis.pf) + +add_pfunit_ctest(DustEmis + TEST_SOURCES "${pfunit_sources}" + LINK_LIBRARIES clm csm_share esmf_wrf_timemgr) diff --git a/src/biogeochem/test/DustEmis_test/test_DustEmis.pf b/src/biogeochem/test/DustEmis_test/test_DustEmis.pf new file mode 100644 index 0000000000..e0e668ea67 --- /dev/null +++ b/src/biogeochem/test/DustEmis_test/test_DustEmis.pf @@ -0,0 +1,34 @@ +module test_DustEmis + + ! Tests of DustEmis + + use funit + use DUSTMod + use shr_kind_mod , only : r8 => shr_kind_r8 + + implicit none + + @TestCase + type, extends(TestCase) :: TestDustEmis + contains + procedure :: setUp + procedure :: tearDown + end type TestDustEmis + +contains + + subroutine setUp(this) + class(TestDustEmis), intent(inout) :: this + end subroutine setUp + + subroutine tearDown(this) + class(TestDustEmis), intent(inout) :: this + end subroutine tearDown + + @Test + subroutine check_dust_emis(this) + class(TestDustEmis), intent(inout) :: this + + end subroutine check_dust_emis + +end module test_DustEmis \ No newline at end of file diff --git a/src/unit_test_stubs/share_esmf/ZenderSoilErodStreamType.F90 b/src/unit_test_stubs/share_esmf/ZenderSoilErodStreamType.F90 new file mode 100644 index 0000000000..570fcec05f --- /dev/null +++ b/src/unit_test_stubs/share_esmf/ZenderSoilErodStreamType.F90 @@ -0,0 +1,88 @@ +module ZenderSoilErodStreamType + + !----------------------------------------------------------------------- + ! !DESCRIPTION: + ! UNIT-TEST STUB for ZenderSoilErodStreamType + ! + ! !USES + use shr_kind_mod , only : r8 => shr_kind_r8, CL => shr_kind_cl + use shr_log_mod , only : errMsg => shr_log_errMsg + use abortutils , only : endrun + use decompMod , only : bounds_type + + ! !PUBLIC TYPES: + implicit none + private + + type, public :: soil_erod_stream_type + contains + + ! !PUBLIC MEMBER FUNCTIONS: + procedure, public :: Init ! Initialize and read data in + procedure, public :: CalcDustSource ! Calculate dust source spatial filter (basically truncating stream data value smaller than 0.1 following CAM's practice) based on input streams + procedure, public :: UseStreams ! If streams will be used + + end type soil_erod_stream_type + + character(len=*), parameter, private :: sourcefile = & + __FILE__ + +!============================================================================== +contains +!============================================================================== + + subroutine Init(this, bounds, NLFilename) + ! + ! Initialize the Zender soil eroditability stream object + ! + ! Uses: + ! + ! arguments + implicit none + class(soil_erod_stream_type) :: this + type(bounds_type), intent(in) :: bounds + character(len=*), intent(in) :: NLFilename ! Namelist filename + ! + ! local variables + !----------------------------------------------------------------------- + + end subroutine Init + + !============================================================================== + logical function UseStreams(this) + ! + ! !DESCRIPTION: + ! Return true if the Zender method is being used and the soil erodability + ! file is being used with it + ! + ! !USES: + ! + ! !ARGUMENTS: + implicit none + class(soil_erod_stream_type) :: this + ! + ! !LOCAL VARIABLES: + UseStreams = .false. + end function UseStreams + + !============================================================================== + subroutine CalcDustSource(this, bounds, soil_erod) + ! + ! !DESCRIPTION: + ! Calculate the soil eroditability for the Zender dust method. + ! + ! !USES: + !USES + ! + ! !ARGUMENTS: + implicit none + class(soil_erod_stream_type) :: this + type(bounds_type) , intent(in) :: bounds + real(r8) , intent(inout) :: soil_erod(bounds%begc:) ! [fraction] rock drag partition factor (roughness effect) + ! + ! !LOCAL VARIABLES: + !--------------------------------------------------------------------- + + end subroutine CalcDustSource + +end module ZenderSoilErodStreamType From 7d8213bc814be0b9274feea0c4d0472b8f96bf07 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Fri, 17 May 2024 11:43:37 -0600 Subject: [PATCH 0272/1248] Add an empty unit tester for DUSTMod --- src/biogeochem/CMakeLists.txt | 1 + src/biogeochem/test/CMakeLists.txt | 1 + src/biogeophys/CMakeLists.txt | 1 + src/unit_test_stubs/share_esmf/CMakeLists.txt | 1 + 4 files changed, 4 insertions(+) diff --git a/src/biogeochem/CMakeLists.txt b/src/biogeochem/CMakeLists.txt index e31bbc80f8..0f46dc665d 100644 --- a/src/biogeochem/CMakeLists.txt +++ b/src/biogeochem/CMakeLists.txt @@ -6,6 +6,7 @@ list(APPEND clm_sources CNPhenologyMod.F90 CNSpeciesMod.F90 CNDVType.F90 + DUSTMod.F90 CropReprPoolsMod.F90 CropType.F90 CNVegStateType.F90 diff --git a/src/biogeochem/test/CMakeLists.txt b/src/biogeochem/test/CMakeLists.txt index 81fe9bbaf0..e22a720523 100644 --- a/src/biogeochem/test/CMakeLists.txt +++ b/src/biogeochem/test/CMakeLists.txt @@ -2,3 +2,4 @@ add_subdirectory(Species_test) add_subdirectory(CNVegComputeSeed_test) add_subdirectory(CNPhenology_test) add_subdirectory(Latbaset_test) +add_subdirectory(DustEmis_test) diff --git a/src/biogeophys/CMakeLists.txt b/src/biogeophys/CMakeLists.txt index 2ffc346670..86edcca9f9 100644 --- a/src/biogeophys/CMakeLists.txt +++ b/src/biogeophys/CMakeLists.txt @@ -7,6 +7,7 @@ list(APPEND clm_sources BalanceCheckMod.F90 CanopyStateType.F90 EnergyFluxType.F90 + FrictionVelocityMod.F90 GlacierSurfaceMassBalanceMod.F90 HillslopeHydrologyUtilsMod.F90 HumanIndexMod.F90 diff --git a/src/unit_test_stubs/share_esmf/CMakeLists.txt b/src/unit_test_stubs/share_esmf/CMakeLists.txt index 5eb2d42415..5ffce0ba94 100644 --- a/src/unit_test_stubs/share_esmf/CMakeLists.txt +++ b/src/unit_test_stubs/share_esmf/CMakeLists.txt @@ -1,5 +1,6 @@ list(APPEND clm_sources ExcessIceStreamType.F90 + ZenderSoilErodStreamType.F90 ) sourcelist_to_parent(clm_sources) From 3254949e133f5fd42411a896690b256529ea150c Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Fri, 17 May 2024 13:09:31 -0600 Subject: [PATCH 0273/1248] Add objects needed and a failing unit test that just runs the two main subroutines, needs to add initialization of the input objects --- .../test/DustEmis_test/test_DustEmis.pf | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/src/biogeochem/test/DustEmis_test/test_DustEmis.pf b/src/biogeochem/test/DustEmis_test/test_DustEmis.pf index e0e668ea67..ff4b69ab72 100644 --- a/src/biogeochem/test/DustEmis_test/test_DustEmis.pf +++ b/src/biogeochem/test/DustEmis_test/test_DustEmis.pf @@ -3,13 +3,31 @@ module test_DustEmis ! Tests of DustEmis use funit + use unittestSubgridMod + use unittestSimpleSubgridSetupsMod, only : setup_single_veg_patch use DUSTMod use shr_kind_mod , only : r8 => shr_kind_r8 + use unittestFilterBuilderMod, only : filter_from_range + use atm2lndType, only : atm2lnd_type + use SoilStateType, only : soilstate_type + use CanopyStateType, only : canopystate_type + use WaterStateBulkType, only : waterstatebulk_type + use WaterDiagnosticBulkType, only : waterdiagnosticbulk_type + use FrictionVelocityMod, only : frictionvel_type implicit none @TestCase type, extends(TestCase) :: TestDustEmis + type(dust_type) :: dust_emis + integer, allocatable :: filter_nolakep(:) ! non-lake filter (patches) + integer :: num_nolakep ! number of patches in non-lake filter + type(atm2lnd_type) :: atm2lnd_inst + type(soilstate_type) :: soilstate_inst + type(canopystate_type) :: canopystate_inst + type(WaterStateBulk_Type) :: waterstatebulk_inst + type(waterdiagnosticbulk_type) :: waterdiagnosticbulk_inst + type(frictionvel_type) :: frictionvel_inst contains procedure :: setUp procedure :: tearDown @@ -19,16 +37,30 @@ contains subroutine setUp(this) class(TestDustEmis), intent(inout) :: this + + character(len=5) :: NLFilename = 'none' + + call setup_single_veg_patch( pft_type=0 ) + call this%dust_emis%Init( bounds, NLFilename ) + call filter_from_range(start=bounds%begp, end=bounds%endp, numf=this%num_nolakep, filter=this%filter_nolakep) end subroutine setUp subroutine tearDown(this) class(TestDustEmis), intent(inout) :: this + + call unittest_subgrid_teardown() + deallocate( this%filter_nolakep ) end subroutine tearDown @Test subroutine check_dust_emis(this) class(TestDustEmis), intent(inout) :: this + call DustEmission(bounds, this%num_nolakep, this%filter_nolakep, this%atm2lnd_inst, & + this%soilstate_inst, this%canopystate_inst, this%waterstatebulk_inst, & + this%waterdiagnosticbulk_inst, this%frictionvel_inst, this%dust_emis) + call DustDryDep(bounds, this%atm2lnd_inst, this%frictionvel_inst, this%dust_emis) + end subroutine check_dust_emis end module test_DustEmis \ No newline at end of file From e4544510e23abf8a9a68e8dd143840742eb8b2fc Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Fri, 17 May 2024 13:55:46 -0600 Subject: [PATCH 0274/1248] Add izumi nag debug tests to ExpectedTestFails as per ESCOMP/CMEPS#460 --- cime_config/testdefs/ExpectedTestFails.xml | 85 ++++++++++++++++++++++ 1 file changed, 85 insertions(+) diff --git a/cime_config/testdefs/ExpectedTestFails.xml b/cime_config/testdefs/ExpectedTestFails.xml index f600444547..09a425ed9e 100644 --- a/cime_config/testdefs/ExpectedTestFails.xml +++ b/cime_config/testdefs/ExpectedTestFails.xml @@ -44,6 +44,91 @@ + + + FAIL + https://github.com/ESCOMP/CMEPS/pull/460 + + + + + FAIL + https://github.com/ESCOMP/CMEPS/pull/460 + + + + + FAIL + https://github.com/ESCOMP/CMEPS/pull/460 + + + + + FAIL + https://github.com/ESCOMP/CMEPS/pull/460 + + + + + FAIL + https://github.com/ESCOMP/CMEPS/pull/460 + + + + + FAIL + https://github.com/ESCOMP/CMEPS/pull/460 + + + + + FAIL + https://github.com/ESCOMP/CMEPS/pull/460 + + + + + FAIL + https://github.com/ESCOMP/CMEPS/pull/460 + + + + + FAIL + https://github.com/ESCOMP/CMEPS/pull/460 + + + + + FAIL + https://github.com/ESCOMP/CMEPS/pull/460 + + + + + FAIL + https://github.com/ESCOMP/CMEPS/pull/460 + + + + + FAIL + https://github.com/ESCOMP/CMEPS/pull/460 + + + + + FAIL + https://github.com/ESCOMP/CMEPS/pull/460 + + + + + FAIL + https://github.com/ESCOMP/CMEPS/pull/460 + + + FAIL From e6f62c431b05460f62c6549e464797df7a7ebf58 Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Fri, 17 May 2024 15:56:00 -0600 Subject: [PATCH 0275/1248] fix reading of fates_harvest_modes during namelist build checks --- bld/CLMBuildNamelist.pm | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index 01f7918d62..c1ec60fb33 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -4487,8 +4487,9 @@ sub setup_logic_fates { if ( ! &value_is_true($nl->get_value('use_fates_luh')) ) { $log->fatal_error("use_fates_luh must be true when $var is true" ); } - if ( $nl->get_value('fates_harvest_mode') ne 'no_harvest') { - $log->fatal_error("fates_harvest_mode must be off (i.e. set to zero) when $var is true" ); + my $var = remove_leading_and_trailing_quotes($nl->get_value('fates_harvest_mode')); + if ( $var ne 'no_harvest') { + $log->fatal_error("fates_harvest_mode set to $var. It must set to no_harvest when use_potential_veg is true." ); } my $var = "fluh_timeseries"; if ( defined($nl->get_value($var)) ) { @@ -4500,10 +4501,22 @@ sub setup_logic_fates { my $var = "fates_harvest_mode"; if ( defined($nl->get_value($var)) ) { # using fates_harvest mode with raw luh2 harvest data - if ( $nl->get_value($var) eq 'luhdata_area' || $nl->get_value($var) eq 'luhdata_mass' ) { + my $mode = remove_leading_and_trailing_quotes($nl->get_value($var)); + if ( $mode eq 'luhdata_area' || $mode eq 'luhdata_mass' ) { # Make sure that use_fates_luh is true when using raw fates luh2 harvest data if ( ! &value_is_true($nl->get_value('use_fates_luh')) ) { - $log->fatal_error("use_fates_luh is required to be true when $var is greater than 2" ); + $log->fatal_error("use_fates_luh is required to be true when $var is luhdata_mass or luhdata_area" ); + } + } elsif ( $mode eq 'surfdata_file' ) { + # Check to make sure that the user set the flanduse_timeseries file + # Since the flanduse_timeseries logic checking is upstream of the fates logic, + # don't try and add the default here + my $var = "flanduse_timeseries"; + my $fname = remove_leading_and_trailing_quotes( $nl->get_value($var) ); + if ( ! defined($nl->get_value($var)) ) { + $log->fatal_error("$var is required when fates_harvest_mode is surfdata_file" ); + } elsif ( ! -f "$fname" ) { + $log->fatal_error("$var does NOT point to a valid filename" ); } } } From 093f0666b9b1d78701240a2036e1efca8e073133 Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Fri, 17 May 2024 16:18:20 -0600 Subject: [PATCH 0276/1248] minor comment update --- bld/CLMBuildNamelist.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index c1ec60fb33..e563bdffa8 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -4510,7 +4510,8 @@ sub setup_logic_fates { } elsif ( $mode eq 'surfdata_file' ) { # Check to make sure that the user set the flanduse_timeseries file # Since the flanduse_timeseries logic checking is upstream of the fates logic, - # don't try and add the default here + # don't add the default here. The onus is on the user to match the correct timeseries + # data to the correct surface dataset resolution my $var = "flanduse_timeseries"; my $fname = remove_leading_and_trailing_quotes( $nl->get_value($var) ); if ( ! defined($nl->get_value($var)) ) { From 9397431486d17cfdda6267c6eca77d2f65a888ae Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Fri, 17 May 2024 16:46:18 -0600 Subject: [PATCH 0277/1248] First draft ChangeLog/ChangeSum --- doc/ChangeLog | 106 ++++++++++++++++++++++++++++++++++++++++++++++++++ doc/ChangeSum | 1 + 2 files changed, 107 insertions(+) diff --git a/doc/ChangeLog b/doc/ChangeLog index de37d4934c..e4af944b8f 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,4 +1,110 @@ =============================================================== +Tag name: ctsm5.2.006 +Originator(s): slevis (Samuel Levis) +Date: Fri May 17 16:17:54 MDT 2024 +One-line Summary: Update externals to cesm2_3_beta17 + +Purpose and description of changes +---------------------------------- + +#2493 update externals to beta17 +#2294 remove references to mct but do not remove /src/mct + +Changes unrelated to the tag's title: +#2546 fix error in cam4/cam5 test +Remove /test/tools/test_driver.sh + +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_1 + +[ ] clm5_0 + +[ ] ctsm5_0-nwp + +[ ] clm4_5 + + +Bugs fixed +---------- +List of CTSM issues fixed (include CTSM Issue # and description) [one per line]: +Fixes #2493 update externals to beta17 +Fixes #2546 fix error in cam4/cam5 test (unrelated) + +Notes of particular relevance for users +--------------------------------------- +Changes to documentation: Remove references to mct and cpl7 + +Substantial timing or memory changes: Not considered + +Notes of particular relevance for developers: +--------------------------------------------- +Changes to tests or testing: +I added a long list of izumi nag debug tests to ExpectedFailures as per +https://github.com/ESCOMP/CMEPS/pull/460 + +Testing summary: +---------------- + [PASS means all tests PASS; OK means tests PASS other than expected fails.] + + build-namelist tests (if CLMBuildNamelist.pm has changed): + + derecho - + + python testing (if python code has changed; see instructions in python/README.md; document testing done): + + (any machine) - + + regular tests (aux_clm: https://github.com/ESCOMP/CTSM/wiki/System-Testing-Guide#pre-merge-system-testing): + + derecho ----- + izumi ------- IN PROGRESS + + any other testing (give details below): + + ctsm_sci + derecho ---- + +If the tag used for baseline comparisons was NOT the previous tag, note that here: + + +Answer changes +-------------- + +Changes answers relative to baseline: + + [ If a tag changes answers relative to baseline comparison the + following should be filled in (otherwise remove this section). + And always remove these three lines and parts that don't apply. ] + + Summarize any changes to answers, i.e., + - what code configurations: + - what platforms/compilers: + - nature of change (roundoff; larger than roundoff/same climate; new climate): + + If bitwise differences were observed, how did you show they were no worse + than roundoff? Roundoff differences means one or more lines of code change results + only by roundoff level (because order of operation changes for example). Roundoff + changes to state fields usually grow to greater than roundoff as the simulation progresses. + +Other details +------------- +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): +cism, ccs_config, cime, cmeps, cdeps + +Pull Requests that document the changes (include PR ids): + https://github.com/ESCOMP/ctsm/pull/2539 + +=============================================================== +=============================================================== Tag name: ctsm5.2.005 Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326) Date: Mon 13 May 2024 04:46:10 PM MDT diff --git a/doc/ChangeSum b/doc/ChangeSum index 0edccb3a18..c73cb19309 100644 --- a/doc/ChangeSum +++ b/doc/ChangeSum @@ -1,5 +1,6 @@ Tag Who Date Summary ============================================================================================================================ + ctsm5.2.006 slevis 05/17/2024 Update externals to cesm2_3_beta17 ctsm5.2.005 erik 05/13/2024 Fix clm6_0 defaults and CESM testing issues, add tests to detect these problems ctsm5.2.004 multiple 05/09/2024 CTSM5.2 1979 fsurdat and 1979-2026 landuse ne0np4 files + two fixes ctsm5.2.003 samrabin 05/02/2024 Merge b4b-dev From 6b460a21afc98134f330a37f9a6cda837f364aee Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Fri, 17 May 2024 18:40:30 -0600 Subject: [PATCH 0278/1248] Update ntests in build-namelist_test.pl --- bld/unit_testers/build-namelist_test.pl | 2 +- doc/ChangeLog | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bld/unit_testers/build-namelist_test.pl b/bld/unit_testers/build-namelist_test.pl index aa579cf908..53c71ae0e9 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 = 3313; +my $ntests = 3254; if ( defined($opts{'compare'}) ) { $ntests += 2001; diff --git a/doc/ChangeLog b/doc/ChangeLog index e4af944b8f..5644ed295d 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -11,7 +11,7 @@ Purpose and description of changes #2294 remove references to mct but do not remove /src/mct Changes unrelated to the tag's title: -#2546 fix error in cam4/cam5 test +#2546 fix error in cam4/cam5 test (ekluzek) Remove /test/tools/test_driver.sh Significant changes to scientifically-supported configurations From 5244813b54835ba58582afcc17b5b02d80ad442e Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Sat, 18 May 2024 16:25:32 -0600 Subject: [PATCH 0279/1248] Initialize input fields needed for unit-testing of dust emissions and get the unit tester to PASS! --- .../test/DustEmis_test/test_DustEmis.pf | 205 +++++++++++++++++- src/biogeophys/CanopyStateType.F90 | 17 ++ src/biogeophys/FrictionVelocityMod.F90 | 18 ++ src/main/clm_instMod.F90 | 10 +- 4 files changed, 235 insertions(+), 15 deletions(-) diff --git a/src/biogeochem/test/DustEmis_test/test_DustEmis.pf b/src/biogeochem/test/DustEmis_test/test_DustEmis.pf index ff4b69ab72..b7ea76df9c 100644 --- a/src/biogeochem/test/DustEmis_test/test_DustEmis.pf +++ b/src/biogeochem/test/DustEmis_test/test_DustEmis.pf @@ -5,15 +5,20 @@ module test_DustEmis use funit use unittestSubgridMod use unittestSimpleSubgridSetupsMod, only : setup_single_veg_patch + use clm_varpar, only : nlevsoi, nlevgrnd, nlevsno, clm_varpar_init + use clm_varctl, only : soil_layerstruct_predefined, create_crop_landunit, use_crop, create_crop_landunit + use clm_varcon, only : clm_varcon_init, clm_varcon_clean + use SnowHydrologyMod, only : InitSnowLayers, SnowHydrologySetControlForTesting use DUSTMod use shr_kind_mod , only : r8 => shr_kind_r8 use unittestFilterBuilderMod, only : filter_from_range - use atm2lndType, only : atm2lnd_type + use atm2lndType, only : atm2lnd_type, atm2lnd_params_type use SoilStateType, only : soilstate_type use CanopyStateType, only : canopystate_type - use WaterStateBulkType, only : waterstatebulk_type - use WaterDiagnosticBulkType, only : waterdiagnosticbulk_type + use TemperatureType, only : temperature_type + use WaterType, only : water_type use FrictionVelocityMod, only : frictionvel_type + use unittestWaterTypeFactory, only : unittest_water_type_factory_type implicit none @@ -25,42 +30,222 @@ module test_DustEmis type(atm2lnd_type) :: atm2lnd_inst type(soilstate_type) :: soilstate_inst type(canopystate_type) :: canopystate_inst - type(WaterStateBulk_Type) :: waterstatebulk_inst - type(waterdiagnosticbulk_type) :: waterdiagnosticbulk_inst + type(temperature_type) :: temperature_inst + type(unittest_water_type_factory_type) :: water_factory + type(water_type) :: water_inst type(frictionvel_type) :: frictionvel_inst contains procedure :: setUp procedure :: tearDown + procedure :: setupEnvironment + procedure :: create_atm2lnd + procedure :: create_fv end type TestDustEmis contains + !----------------------------------------------------------------------- + subroutine setUp(this) + use ColumnType, only : col class(TestDustEmis), intent(inout) :: this character(len=5) :: NLFilename = 'none' + real(r8), allocatable :: snow_depth_col(:) + real(r8), allocatable :: urb_em(:) + integer :: begl, endl, begc, endc + integer :: c + type(atm2lnd_params_type) :: atm2lnd_params + + soil_layerstruct_predefined = '20SL_8.5m' + create_crop_landunit = .true. + use_crop = .false. + call clm_varpar_init( actual_maxsoil_patches=17, surf_numpft=15, surf_numcft=2, actual_nlevurb=5 ) + call clm_varcon_init( is_simple_buildtemp=.true.) + call this%water_factory%init() + call this%water_factory%setup_before_subgrid( & + my_nlevsoi = nlevsoi, & + nlevgrnd_additional = nlevgrnd - nlevsoi, & + my_nlevsno = 3) + call setup_single_veg_patch( pft_type=0 ) + begl = bounds%begl + endl = bounds%endl + begc = bounds%begc + endc = bounds%endc + allocate( urb_em(begl:endl) ) - call setup_single_veg_patch( pft_type=0 ) - call this%dust_emis%Init( bounds, NLFilename ) - call filter_from_range(start=bounds%begp, end=bounds%endp, numf=this%num_nolakep, filter=this%filter_nolakep) + call this%dust_emis%Init( bounds, NLFilename ) + call filter_from_range(start=bounds%begp, end=bounds%endp, numf=this%num_nolakep, filter=this%filter_nolakep) + atm2lnd_params = atm2lnd_params_type( repartition_rain_snow = .false., & + glcmec_downscale_longwave = .false., & + lapse_rate = 0.01_r8 & ! arbitrary (this is unused for these tests) + ) + allocate (snow_depth_col(begc:endc)) + snow_depth_col(begc:endc) = 0.0_r8 + call SnowHydrologySetControlForTesting() + call InitSnowLayers(bounds, snow_depth_col(bounds%begc:bounds%endc)) + call this%water_factory%setup_after_subgrid(snl = 3) + call this%soilstate_inst%Init(bounds) + do c = begc, endc + this%soilstate_inst%watsat_col(c,:) = 0.05_r8 * (c - bounds%begc + 1) + end do + call this%setupEnvironment( ) + call this%water_factory%create_water_type(this%water_inst, watsat_col=this%soilstate_inst%watsat_col) + call this%atm2lnd_inst%InitForTesting(bounds, atm2lnd_params) + call this%canopystate_inst%SetNMLForTesting() + call this%canopystate_inst%Init(bounds) + call this%frictionvel_inst%InitForTesting(bounds) + urb_em(begl:endl) = 0.99_r8 + call this%temperature_inst%Init(bounds, & + em_roof_lun=urb_em(begl:endl), & + em_wall_lun=urb_em(begl:endl), & + em_improad_lun=urb_em(begl:endl), & + em_perroad_lun=urb_em(begl:endl), & + is_simple_buildtemp=.true., is_prog_buildtemp=.false.) + deallocate (snow_depth_col ) + deallocate( urb_em ) end subroutine setUp + !----------------------------------------------------------------------- + subroutine tearDown(this) class(TestDustEmis), intent(inout) :: this + call this%water_factory%teardown(this%water_inst) call unittest_subgrid_teardown() + call this%atm2lnd_inst%Clean() + call clm_varcon_clean() deallocate( this%filter_nolakep ) end subroutine tearDown + !----------------------------------------------------------------------- + + subroutine setupEnvironment(this) + ! + ! !DESCRIPTION: + ! Sets up the external environment used by Dust emissions - i.e., things accessed via + ! 'use' statements. + ! + ! Assumes nlevgrnd and nlevsoi have been set, and that all necessary subgrid setup has + ! been completed. + ! + use ColumnType, only : col + use GridcellType, only : grc + class(TestDustEmis), intent(in) :: this + ! + integer :: c,j + real(r8), parameter :: clay = 10.0_r8 + + !----------------------------------------------------------------------- + col%dz(:,1:nlevgrnd) = 1.0_r8 + do j = 1, nlevgrnd + do c = bounds%begc, bounds%endc + col%z(c,j) = sum(col%dz(c,1:j-1)) + 0.5_r8*col%dz(c,j) + end do + end do + + do c = bounds%begc, bounds%endc + ! Setting nbedrock to nlevsoi means that none of the layers from 1:nlevsoi are + ! considered bedrock + col%nbedrock(c) = nlevsoi + + this%soilstate_inst%gwc_thr_col(c) = 0.17_r8 + 0.14_r8 * clay * 0.01_r8 + this%soilstate_inst%mss_frc_cly_vld_col(c) = 0.17_r8 + end do + + + ! Use longitude along Greenich so don't have to calculate offsets for longitudes (that's calculated in clm_time_manager) + grc%londeg(:) = 0.0_r8 + + grc%area(:) = 10.0_r8 + + end subroutine setupEnvironment + + !----------------------------------------------------------------------- + + subroutine create_atm2lnd(this, forc_t, forc_pbot, forc_rho ) + ! Initializes some fields needed for dust emissions in this%atm2lnd_inst, and sets + ! forcing fields based on inputs. Excluded inputs are given a default value + class(TestDustEmis), intent(inout) :: this + real(r8), intent(in), optional :: forc_t(:) + real(r8), intent(in), optional :: forc_pbot(:) + real(r8), intent(in), optional :: forc_rho(:) + + real(r8), parameter :: forc_t_default = 301._r8 + real(r8), parameter :: forc_pbot_default = 100000._r8 + real(r8), parameter :: forc_rho_default = 1.1_r8 + ! ------------------------------------------------------------------------ + + if (present(forc_t)) then + this%atm2lnd_inst%forc_t_downscaled_col(bounds%begc:bounds%endc) = forc_t(:) + else + this%atm2lnd_inst%forc_t_downscaled_col(bounds%begc:bounds%endc) = forc_t_default + end if + + if (present(forc_pbot)) then + this%atm2lnd_inst%forc_pbot_downscaled_col(bounds%begc:bounds%endc) = forc_pbot(:) + else + this%atm2lnd_inst%forc_pbot_downscaled_col(bounds%begc:bounds%endc) = forc_pbot_default + end if + + if (present(forc_rho)) then + this%atm2lnd_inst%forc_rho_downscaled_col(bounds%begc:bounds%endc) = forc_rho(:) + else + this%atm2lnd_inst%forc_rho_downscaled_col(bounds%begc:bounds%endc) = forc_rho_default + end if + + end subroutine create_atm2lnd + + !----------------------------------------------------------------------- + + subroutine create_fv(this, fv, u10, ram1) + ! Initializes some fields needed for dust emissions in this%frictionvel_inst, and sets + ! fields based on inputs. Excluded inputs are given a default value + class(TestDustEmis), intent(inout) :: this + real(r8), intent(in), optional :: fv(:) + real(r8), intent(in), optional :: u10(:) + real(r8), intent(in), optional :: ram1(:) + + real(r8), parameter :: fv_default = 0.2_r8 + real(r8), parameter :: u10_default = 4._r8 + real(r8), parameter :: ram1_default = 200._r8 + ! ------------------------------------------------------------------------ + + if (present(fv)) then + this%frictionvel_inst%fv_patch(bounds%begp:bounds%endp) = fv(:) + else + this%frictionvel_inst%fv_patch(bounds%begp:bounds%endp) = fv_default + end if + + if (present(u10)) then + this%frictionvel_inst%u10_patch(bounds%begp:bounds%endp) = u10(:) + else + this%frictionvel_inst%u10_patch(bounds%begp:bounds%endp) = u10_default + end if + + if (present(ram1)) then + this%frictionvel_inst%ram1_patch(bounds%begp:bounds%endp) = ram1(:) + else + this%frictionvel_inst%ram1_patch(bounds%begp:bounds%endp) = ram1_default + end if + + end subroutine create_fv + + !----------------------------------------------------------------------- + @Test subroutine check_dust_emis(this) class(TestDustEmis), intent(inout) :: this + call this%create_atm2lnd() + call this%create_fv() call DustEmission(bounds, this%num_nolakep, this%filter_nolakep, this%atm2lnd_inst, & - this%soilstate_inst, this%canopystate_inst, this%waterstatebulk_inst, & - this%waterdiagnosticbulk_inst, this%frictionvel_inst, this%dust_emis) + this%soilstate_inst, this%canopystate_inst, this%water_inst%waterstatebulk_inst, & + this%water_inst%waterdiagnosticbulk_inst, this%frictionvel_inst, this%dust_emis) call DustDryDep(bounds, this%atm2lnd_inst, this%frictionvel_inst, this%dust_emis) + !----------------------------------------------------------------------- + end subroutine check_dust_emis end module test_DustEmis \ No newline at end of file diff --git a/src/biogeophys/CanopyStateType.F90 b/src/biogeophys/CanopyStateType.F90 index 313f7a83f3..4bfc08fc80 100644 --- a/src/biogeophys/CanopyStateType.F90 +++ b/src/biogeophys/CanopyStateType.F90 @@ -72,6 +72,8 @@ module CanopyStateType procedure, public :: UpdateAccVars procedure, public :: Restart + procedure, public :: SetNMLForTesting ! Set namelist for unit-testing + end type CanopyState_type character(len=*), parameter, private :: sourcefile = & @@ -442,6 +444,21 @@ subroutine ReadNML( this, NLFilename ) end subroutine ReadNML + !----------------------------------------------------------------------- + + subroutine SetNMLForTesting( this ) + ! + ! Set canopy parameter namelist control settings for unit-testing + ! + class(canopystate_type) :: this + ! LOCAL VARIABLES: + !----------------------------------------------------------------------- + + + this%leaf_mr_vcm = 0.015_r8 + + end subroutine SetNMLForTesting + !----------------------------------------------------------------------- subroutine UpdateAccVars (this, bounds) ! diff --git a/src/biogeophys/FrictionVelocityMod.F90 b/src/biogeophys/FrictionVelocityMod.F90 index 7cea2a22f9..042415f545 100644 --- a/src/biogeophys/FrictionVelocityMod.F90 +++ b/src/biogeophys/FrictionVelocityMod.F90 @@ -89,6 +89,8 @@ module FrictionVelocityMod procedure, public :: FrictionVelocity ! Calculate friction velocity procedure, public :: MoninObukIni ! Initialization of the Monin-Obukhov length + procedure, public :: InitForTesting ! version of Init meant for unit testing + ! Private procedures procedure, private :: InitAllocate procedure, private :: InitHistory @@ -122,6 +124,22 @@ subroutine Init(this, bounds, NLFilename, params_ncid) end subroutine Init + !------------------------------------------------------------------------ + subroutine InitForTesting(this, bounds) + ! Initialization for unit testing, hardcodes namelist and parameter file settings + class(frictionvel_type) :: this + type(bounds_type), intent(in) :: bounds + + call this%InitAllocate(bounds) + call this%InitHistory(bounds) + call this%InitCold(bounds) + this%zetamaxstable = 0.5_r8 + this%zsno = 0.00085_r8 + this%zlnd = 0.000775_r8 + this%zglc = 0.00230000005_r8 + + end subroutine InitForTesting + !------------------------------------------------------------------------ subroutine InitAllocate(this, bounds) ! diff --git a/src/main/clm_instMod.F90 b/src/main/clm_instMod.F90 index b9d74c418a..a24e05b27c 100644 --- a/src/main/clm_instMod.F90 +++ b/src/main/clm_instMod.F90 @@ -296,11 +296,11 @@ subroutine clm_instInit(bounds) ! Initialization of public data types call temperature_inst%Init(bounds, & - urbanparams_inst%em_roof(begl:endl), & - urbanparams_inst%em_wall(begl:endl), & - urbanparams_inst%em_improad(begl:endl), & - urbanparams_inst%em_perroad(begl:endl), & - IsSimpleBuildTemp(), IsProgBuildTemp() ) + em_roof_lun=urbanparams_inst%em_roof(begl:endl), & + em_wall_lun=urbanparams_inst%em_wall(begl:endl), & + em_improad_lun=urbanparams_inst%em_improad(begl:endl), & + em_perroad_lun=urbanparams_inst%em_perroad(begl:endl), & + is_simple_buildtemp=IsSimpleBuildTemp(), is_prog_buildtemp=IsProgBuildTemp() ) call active_layer_inst%Init(bounds) From 9bf2ad13acdca56437392b0e80e715320c3a7eb5 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Sat, 18 May 2024 22:17:39 -0600 Subject: [PATCH 0280/1248] Put DustEmission and DustDryDep as methods inside of the dust_type --- src/biogeochem/DUSTMod.F90 | 39 +++++++++---------- .../test/DustEmis_test/test_DustEmis.pf | 10 ++--- 2 files changed, 23 insertions(+), 26 deletions(-) diff --git a/src/biogeochem/DUSTMod.F90 b/src/biogeochem/DUSTMod.F90 index ffa2bfe6f0..e0e4e469a1 100644 --- a/src/biogeochem/DUSTMod.F90 +++ b/src/biogeochem/DUSTMod.F90 @@ -37,11 +37,6 @@ module DUSTMod implicit none private ! - ! !PUBLIC MEMBER FUNCTIONS: - ! - public DustEmission ! Dust mobilization - public DustDryDep ! Turbulent dry deposition for dust - ! ! !PUBLIC DATA: ! real(r8) , allocatable :: ovr_src_snk_mss(:,:) @@ -61,16 +56,18 @@ module DUSTMod real(r8), pointer, private :: vlc_trb_2_patch (:) ! turbulent deposition velocity 2(m/s) real(r8), pointer, private :: vlc_trb_3_patch (:) ! turbulent deposition velocity 3(m/s) real(r8), pointer, private :: vlc_trb_4_patch (:) ! turbulent deposition velocity 4(m/s) - type(soil_erod_stream_type), private :: soil_erod_stream ! Zender soil erodibility stream data + type(soil_erod_stream_type), private :: soil_erod_stream ! Zender soil erodibility stream data real(r8), pointer, private :: mbl_bsn_fct_col (:) ! [dimensionless] basin factor, or soil erodibility, time-constant contains procedure , public :: Init + procedure , public :: DustEmission ! Dust mobilization + procedure , public :: DustDryDep ! Turbulent dry deposition for dust procedure , private :: InitAllocate procedure , private :: InitHistory procedure , private :: InitCold - procedure , private :: InitDustVars ! Initialize variables used in subroutine Dust + procedure , private :: InitDustVars ! Initialize variables used in DustEmission method end type dust_type !------------------------------------------------------------------------ @@ -213,10 +210,10 @@ subroutine InitCold(this, bounds) end subroutine InitCold !------------------------------------------------------------------------ - subroutine DustEmission (bounds, & + subroutine DustEmission (this, bounds, & num_nolakep, filter_nolakep, & atm2lnd_inst, soilstate_inst, canopystate_inst, waterstatebulk_inst, waterdiagnosticbulk_inst, & - frictionvel_inst, dust_inst) + frictionvel_inst) ! ! !DESCRIPTION: ! Dust mobilization. This code simulates dust mobilization due to wind @@ -230,6 +227,7 @@ subroutine DustEmission (bounds, & use subgridaveMod, only : p2g ! ! !ARGUMENTS: + class (dust_type) :: this type(bounds_type) , intent(in) :: bounds integer , intent(in) :: num_nolakep ! number of column non-lake points in patch filter integer , intent(in) :: filter_nolakep(num_nolakep) ! patch filter for non-lake points @@ -239,7 +237,6 @@ subroutine DustEmission (bounds, & type(waterstatebulk_type) , intent(in) :: waterstatebulk_inst type(waterdiagnosticbulk_type) , intent(in) :: waterdiagnosticbulk_inst type(frictionvel_type) , intent(in) :: frictionvel_inst - type(dust_type) , intent(inout) :: dust_inst ! ! !LOCAL VARIABLES @@ -291,9 +288,9 @@ subroutine DustEmission (bounds, & fv => frictionvel_inst%fv_patch , & ! Input: [real(r8) (:) ] friction velocity (m/s) (for dust model) u10 => frictionvel_inst%u10_patch , & ! Input: [real(r8) (:) ] 10-m wind (m/s) (created for dust model) - mbl_bsn_fct => dust_inst%mbl_bsn_fct_col , & ! Input: [real(r8) (:) ] basin factor - flx_mss_vrt_dst => dust_inst%flx_mss_vrt_dst_patch , & ! Output: [real(r8) (:,:) ] surface dust emission (kg/m**2/s) - flx_mss_vrt_dst_tot => dust_inst%flx_mss_vrt_dst_tot_patch & ! Output: [real(r8) (:) ] total dust flux back to atmosphere (pft) + mbl_bsn_fct => this%mbl_bsn_fct_col , & ! Input: [real(r8) (:) ] basin factor + flx_mss_vrt_dst => this%flx_mss_vrt_dst_patch , & ! Output: [real(r8) (:,:) ] surface dust emission (kg/m**2/s) + flx_mss_vrt_dst_tot => this%flx_mss_vrt_dst_tot_patch & ! Output: [real(r8) (:) ] total dust flux back to atmosphere (pft) ) ttlai(bounds%begp : bounds%endp) = 0._r8 @@ -498,8 +495,8 @@ subroutine DustEmission (bounds, & end subroutine DustEmission !------------------------------------------------------------------------ - subroutine DustDryDep (bounds, & - atm2lnd_inst, frictionvel_inst, dust_inst) + subroutine DustDryDep (this, bounds, & + atm2lnd_inst, frictionvel_inst) ! ! !DESCRIPTION: ! @@ -520,10 +517,10 @@ subroutine DustDryDep (bounds, & use shr_const_mod, only : SHR_CONST_PI, SHR_CONST_RDAIR, SHR_CONST_BOLTZ ! ! !ARGUMENTS: + class (dust_type) :: this type(bounds_type) , intent(in) :: bounds type(atm2lnd_type) , intent(in) :: atm2lnd_inst type(frictionvel_type) , intent(in) :: frictionvel_inst - type(dust_type) , intent(inout) :: dust_inst ! ! !LOCAL VARIABLES integer :: p,c,g,m,n ! indices @@ -550,11 +547,11 @@ subroutine DustDryDep (bounds, & ram1 => frictionvel_inst%ram1_patch , & ! Input: [real(r8) (:) ] aerodynamical resistance (s/m) fv => frictionvel_inst%fv_patch , & ! Input: [real(r8) (:) ] friction velocity (m/s) - vlc_trb => dust_inst%vlc_trb_patch , & ! Output: [real(r8) (:,:) ] Turbulent deposn velocity (m/s) - vlc_trb_1 => dust_inst%vlc_trb_1_patch , & ! Output: [real(r8) (:) ] Turbulent deposition velocity 1 - vlc_trb_2 => dust_inst%vlc_trb_2_patch , & ! Output: [real(r8) (:) ] Turbulent deposition velocity 2 - vlc_trb_3 => dust_inst%vlc_trb_3_patch , & ! Output: [real(r8) (:) ] Turbulent deposition velocity 3 - vlc_trb_4 => dust_inst%vlc_trb_4_patch & ! Output: [real(r8) (:) ] Turbulent deposition velocity 4 + vlc_trb => this%vlc_trb_patch , & ! Output: [real(r8) (:,:) ] Turbulent deposn velocity (m/s) + vlc_trb_1 => this%vlc_trb_1_patch , & ! Output: [real(r8) (:) ] Turbulent deposition velocity 1 + vlc_trb_2 => this%vlc_trb_2_patch , & ! Output: [real(r8) (:) ] Turbulent deposition velocity 2 + vlc_trb_3 => this%vlc_trb_3_patch , & ! Output: [real(r8) (:) ] Turbulent deposition velocity 3 + vlc_trb_4 => this%vlc_trb_4_patch & ! Output: [real(r8) (:) ] Turbulent deposition velocity 4 ) do p = bounds%begp,bounds%endp diff --git a/src/biogeochem/test/DustEmis_test/test_DustEmis.pf b/src/biogeochem/test/DustEmis_test/test_DustEmis.pf index b7ea76df9c..9be97453b0 100644 --- a/src/biogeochem/test/DustEmis_test/test_DustEmis.pf +++ b/src/biogeochem/test/DustEmis_test/test_DustEmis.pf @@ -239,13 +239,13 @@ contains call this%create_atm2lnd() call this%create_fv() - call DustEmission(bounds, this%num_nolakep, this%filter_nolakep, this%atm2lnd_inst, & + call this%dust_emis%DustEmission(bounds, this%num_nolakep, this%filter_nolakep, this%atm2lnd_inst, & this%soilstate_inst, this%canopystate_inst, this%water_inst%waterstatebulk_inst, & - this%water_inst%waterdiagnosticbulk_inst, this%frictionvel_inst, this%dust_emis) - call DustDryDep(bounds, this%atm2lnd_inst, this%frictionvel_inst, this%dust_emis) - - !----------------------------------------------------------------------- + this%water_inst%waterdiagnosticbulk_inst, this%frictionvel_inst) + call this%dust_emis%DustDryDep(bounds, this%atm2lnd_inst, this%frictionvel_inst) end subroutine check_dust_emis + !----------------------------------------------------------------------- + end module test_DustEmis \ No newline at end of file From 7072f7aa8e1e44a5af15b5c82c4634268b5dc50b Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Mon, 20 May 2024 11:29:08 -0600 Subject: [PATCH 0281/1248] Resolve the mizuRoute issue --- Externals.cfg | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Externals.cfg b/Externals.cfg index a8a77a40f1..cb2622dedf 100644 --- a/Externals.cfg +++ b/Externals.cfg @@ -27,10 +27,10 @@ tag = mosart1_0_49 required = True [mizuRoute] -local_path = components/mizuRoute +tag = cesm-coupling.n02_v2.1.2 protocol = git +local_path = components/mizuroute repo_url = https://github.com/ESCOMP/mizuRoute -hash = 81c720c required = True [ccs_config] From ff4d35f2607bb637e37baaca0109d4d189efe0fd Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Tue, 21 May 2024 10:30:14 -0600 Subject: [PATCH 0282/1248] Remove set_glc2lnd_fields_mct (not tested, yet) --- src/main/glc2lndMod.F90 | 56 ----------------------------------------- 1 file changed, 56 deletions(-) diff --git a/src/main/glc2lndMod.F90 b/src/main/glc2lndMod.F90 index ecd6818210..2d0dbb5791 100644 --- a/src/main/glc2lndMod.F90 +++ b/src/main/glc2lndMod.F90 @@ -78,7 +78,6 @@ module glc2lndMod ! - set_glc2lnd_fields ! - update_glc2lnd_fracs ! - update_glc2lnd_topo - procedure, public :: set_glc2lnd_fields_mct ! set coupling fields sent from glc to lnd procedure, public :: set_glc2lnd_fields_nuopc ! set coupling fields sent from glc to lnd procedure, public :: update_glc2lnd_fracs ! update subgrid fractions based on input from GLC procedure, public :: update_glc2lnd_topo ! update topographic heights @@ -242,61 +241,6 @@ subroutine Clean(this) end subroutine Clean - !----------------------------------------------------------------------- - subroutine set_glc2lnd_fields_mct(this, bounds, glc_present, x2l, & - index_x2l_Sg_ice_covered, index_x2l_Sg_topo, index_x2l_Flgg_hflx, & - index_x2l_Sg_icemask, index_x2l_Sg_icemask_coupled_fluxes) - ! - ! !DESCRIPTION: - ! Set coupling fields sent from glc to lnd - ! - ! If glc_present is true, then the given fields are all assumed to be valid; if - ! glc_present is false, then these fields are ignored. - ! - ! !ARGUMENTS: - class(glc2lnd_type), intent(inout) :: this - type(bounds_type) , intent(in) :: bounds - logical , intent(in) :: glc_present ! true if running with a non-stub glc model - real(r8) , intent(in) :: x2l(:, bounds%begg: ) ! driver import state to land model [field, gridcell] - integer , intent(in) :: index_x2l_Sg_ice_covered( 0: ) ! indices of ice-covered field in x2l, for each elevation class - integer , intent(in) :: index_x2l_Sg_topo( 0: ) ! indices of topo field in x2l, for each elevation class - integer , intent(in) :: index_x2l_Flgg_hflx( 0: ) ! indices of heat flux field in x2l, for each elevation class - integer , intent(in) :: index_x2l_Sg_icemask ! index of icemask field in x2l - integer , intent(in) :: index_x2l_Sg_icemask_coupled_fluxes ! index of icemask_coupled_fluxes field in x2l - ! - ! !LOCAL VARIABLES: - integer :: g - integer :: ice_class - - character(len=*), parameter :: subname = 'set_glc2lnd_fields_mct' - !----------------------------------------------------------------------- - - SHR_ASSERT_FL((ubound(x2l, 2) == bounds%endg), sourcefile, __LINE__) - SHR_ASSERT_ALL_FL((ubound(index_x2l_Sg_ice_covered) == (/maxpatch_glc/)), sourcefile, __LINE__) - SHR_ASSERT_ALL_FL((ubound(index_x2l_Sg_topo) == (/maxpatch_glc/)), sourcefile, __LINE__) - SHR_ASSERT_ALL_FL((ubound(index_x2l_Flgg_hflx) == (/maxpatch_glc/)), sourcefile, __LINE__) - - if (glc_present) then - do g = bounds%begg, bounds%endg - do ice_class = 0, maxpatch_glc - this%frac_grc(g,ice_class) = x2l(index_x2l_Sg_ice_covered(ice_class),g) - this%topo_grc(g,ice_class) = x2l(index_x2l_Sg_topo(ice_class),g) - this%hflx_grc(g,ice_class) = x2l(index_x2l_Flgg_hflx(ice_class),g) - end do - this%icemask_grc(g) = x2l(index_x2l_Sg_icemask,g) - this%icemask_coupled_fluxes_grc(g) = x2l(index_x2l_Sg_icemask_coupled_fluxes,g) - end do - - call this%set_glc2lnd_fields_wrapup(bounds) - else - if (glc_do_dynglacier) then - call endrun(' ERROR: With glc_present false (e.g., a stub glc model), glc_do_dynglacier must be false '// & - errMsg(sourcefile, __LINE__)) - end if - end if - - end subroutine set_glc2lnd_fields_mct - !----------------------------------------------------------------------- subroutine set_glc2lnd_fields_nuopc(this, bounds, glc_present, & frac_grc, topo_grc, hflx_grc, icemask_grc, icemask_coupled_fluxes_grc) From 4d62578a920eae09f482776576a30e9750e1e8e1 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Tue, 21 May 2024 10:47:56 -0600 Subject: [PATCH 0283/1248] Remove /src/cpl/mct again; I was right the first time --- src/cpl/mct/ExcessIceStreamType.F90 | 144 ----- src/cpl/mct/FireDataBaseType.F90 | 561 ------------------- src/cpl/mct/SoilMoistureStreamMod.F90 | 418 -------------- src/cpl/mct/UrbanTimeVarType.F90 | 314 ----------- src/cpl/mct/ch4FInundatedStreamType.F90 | 389 ------------- src/cpl/mct/clm_cpl_indices.F90 | 330 ----------- src/cpl/mct/laiStreamMod.F90 | 241 --------- src/cpl/mct/lnd_comp_mct.F90 | 632 ---------------------- src/cpl/mct/lnd_import_export.F90 | 354 ------------ src/cpl/mct/lnd_set_decomp_and_domain.F90 | 352 ------------ src/cpl/mct/ndepStreamMod.F90 | 376 ------------- 11 files changed, 4111 deletions(-) delete mode 100644 src/cpl/mct/ExcessIceStreamType.F90 delete mode 100644 src/cpl/mct/FireDataBaseType.F90 delete mode 100644 src/cpl/mct/SoilMoistureStreamMod.F90 delete mode 100644 src/cpl/mct/UrbanTimeVarType.F90 delete mode 100644 src/cpl/mct/ch4FInundatedStreamType.F90 delete mode 100644 src/cpl/mct/clm_cpl_indices.F90 delete mode 100644 src/cpl/mct/laiStreamMod.F90 delete mode 100644 src/cpl/mct/lnd_comp_mct.F90 delete mode 100644 src/cpl/mct/lnd_import_export.F90 delete mode 100644 src/cpl/mct/lnd_set_decomp_and_domain.F90 delete mode 100644 src/cpl/mct/ndepStreamMod.F90 diff --git a/src/cpl/mct/ExcessIceStreamType.F90 b/src/cpl/mct/ExcessIceStreamType.F90 deleted file mode 100644 index 5c5394233c..0000000000 --- a/src/cpl/mct/ExcessIceStreamType.F90 +++ /dev/null @@ -1,144 +0,0 @@ -module ExcessIceStreamType - - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! Stub for ExcessIceStreams for the MCT driver. So that MCT can be used - ! without excess ice streams. - ! - ! !USES - use shr_kind_mod , only : r8 => shr_kind_r8, CL => shr_kind_CL - use shr_log_mod , only : errMsg => shr_log_errMsg - use spmdMod , only : mpicom, masterproc - use clm_varctl , only : iulog - use abortutils , only : endrun - use decompMod , only : bounds_type - - ! !PUBLIC TYPES: - implicit none - private - - public :: UseExcessIceStreams ! If streams will be used - - type, public :: excessicestream_type - contains - - ! !PUBLIC MEMBER FUNCTIONS: - procedure, public :: Init ! Initialize and read data in - procedure, public :: CalcExcessIce ! Calculate excess ice ammount - - ! !PRIVATE MEMBER FUNCTIONS: - procedure, private :: ReadNML ! Read in namelist - - end type excessicestream_type - ! ! PRIVATE DATA: - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - -!============================================================================== -contains -!============================================================================== - - subroutine Init(this, bounds, NLFilename) - ! - ! - ! arguments - implicit none - class(excessicestream_type) :: this - type(bounds_type), intent(in) :: bounds - character(len=*), intent(in) :: NLFilename ! Namelist filename - - ! - ! local variables - - call this%ReadNML( bounds, NLFileName ) - end subroutine Init - - subroutine CalcExcessIce(this,bounds,exice_bulk_init) - - ! only transfers grid values to columns - implicit none - class(excessicestream_type) :: this - type(bounds_type), intent(in) :: bounds - real(r8) , intent(inout) :: exice_bulk_init(bounds%begc:bounds%endc) - ! - ! !LOCAL VARIABLES: - - end subroutine CalcExcessIce - - logical function UseExcessIceStreams() - ! - ! !DESCRIPTION: - ! Return true if - ! - ! !USES: - ! - ! !ARGUMENTS: - implicit none - ! - ! !LOCAL VARIABLES: - UseExcessIceStreams = .false. -end function UseExcessIceStreams - -subroutine ReadNML(this, bounds, NLFilename) - ! - ! Read the namelist data stream information. - ! - ! Uses: - use shr_nl_mod , only : shr_nl_find_group_name - use shr_log_mod , only : errMsg => shr_log_errMsg - use shr_mpi_mod , only : shr_mpi_bcast - ! - ! arguments - implicit none - class(excessicestream_type) :: this - type(bounds_type), intent(in) :: bounds - character(len=*), intent(in) :: NLFilename ! Namelist filename - ! - ! local variables - integer :: nu_nml ! unit for namelist file - integer :: nml_error ! namelist i/o error flag - logical :: use_excess_ice_streams = .false. ! logical to turn on use of excess ice streams - character(len=CL) :: stream_fldFileName_exice = ' ' - character(len=CL) :: stream_mapalgo_exice = 'none' - character(len=*), parameter :: namelist_name = 'exice_streams' ! MUST agree with name in namelist and read - character(len=*), parameter :: subName = "('exice_streams::ReadNML')" - !----------------------------------------------------------------------- - - namelist /exice_streams/ & ! MUST agree with namelist_name above - stream_mapalgo_exice, stream_fldFileName_exice, use_excess_ice_streams - !----------------------------------------------------------------------- - ! Default values for namelist - - ! Read excess ice namelist - if (masterproc) then - open( newunit=nu_nml, file=trim(NLFilename), status='old', iostat=nml_error ) - call shr_nl_find_group_name(nu_nml, namelist_name, status=nml_error) - if (nml_error == 0) then - read(nu_nml, nml=exice_streams,iostat=nml_error) ! MUST agree with namelist_name above - if (nml_error /= 0) then - call endrun(msg=' ERROR reading '//namelist_name//' namelist'//errMsg(sourcefile, __LINE__)) - end if - else - call endrun(msg=' ERROR finding '//namelist_name//' namelist'//errMsg(sourcefile, __LINE__)) - end if - close(nu_nml) - endif - - call shr_mpi_bcast(use_excess_ice_streams , mpicom) - - if (masterproc) then - if ( use_excess_ice_streams ) then - call endrun(msg=' ERROR excess ice streams can NOT be on for the MCT driver'//errMsg(sourcefile, __LINE__)) - end if - if ( trim(stream_fldFileName_exice) /= '' ) then - call endrun(msg=' ERROR stream_fldFileName_exice can NOT be set for the MCT driver'//errMsg(sourcefile, __LINE__)) - end if - if ( trim(stream_mapalgo_exice) /= 'none' ) then - call endrun(msg=' ERROR stream_mapalgo_exice can only be none for the MCT driver'//errMsg(sourcefile, __LINE__)) - end if - endif - -end subroutine ReadNML - -end module ExcessIceStreamType diff --git a/src/cpl/mct/FireDataBaseType.F90 b/src/cpl/mct/FireDataBaseType.F90 deleted file mode 100644 index 0ee635b2fa..0000000000 --- a/src/cpl/mct/FireDataBaseType.F90 +++ /dev/null @@ -1,561 +0,0 @@ -module FireDataBaseType - -#include "shr_assert.h" - - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! module for handling of fire data - ! - ! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8, CL => shr_kind_CL - use shr_strdata_mod , only : shr_strdata_type, shr_strdata_create, shr_strdata_print - use shr_strdata_mod , only : shr_strdata_advance - use shr_log_mod , only : errMsg => shr_log_errMsg - use clm_varctl , only : iulog, inst_name - use spmdMod , only : masterproc, mpicom, comp_id - use fileutils , only : getavu, relavu - use domainMod , only : ldomain - use abortutils , only : endrun - use decompMod , only : bounds_type - use FireMethodType , only : fire_method_type - use lnd_set_decomp_and_domain, only : gsmap_global - use mct_mod - ! - implicit none - private - ! - ! !PUBLIC TYPES: - public :: fire_base_type - - ! - type, abstract, extends(fire_method_type) :: fire_base_type - private - ! !PRIVATE MEMBER DATA: - - real(r8), public, pointer :: forc_lnfm(:) ! Lightning frequency - real(r8), public, pointer :: forc_hdm(:) ! Human population density - - real(r8), public, pointer :: gdp_lf_col(:) ! col global real gdp data (k US$/capita) - real(r8), public, pointer :: peatf_lf_col(:) ! col global peatland fraction data (0-1) - integer , public, pointer :: abm_lf_col(:) ! col global peak month of crop fire emissions - - type(shr_strdata_type) :: sdat_hdm ! Human population density input data stream - type(shr_strdata_type) :: sdat_lnfm ! Lightning input data stream - - contains - ! - ! !PUBLIC MEMBER FUNCTIONS: - procedure, public :: FireInit => BaseFireInit ! Initialization of Fire - procedure, public :: BaseFireInit ! Initialization of Fire - procedure(FireReadNML_interface), public, deferred :: FireReadNML ! Read in namelist for Fire - procedure, public :: FireInterp ! Interpolate fire data - procedure(need_lightning_and_popdens_interface), public, deferred :: & - need_lightning_and_popdens ! Returns true if need lightning & popdens - ! - ! !PRIVATE MEMBER FUNCTIONS: - procedure, private :: hdm_init ! position datasets for dynamic human population density - procedure, private :: hdm_interp ! interpolates between two years of human pop. density file data - procedure, private :: lnfm_init ! position datasets for Lightning - procedure, private :: lnfm_interp ! interpolates between two years of Lightning file data - procedure, private :: surfdataread ! read fire related data from surface data set - end type fire_base_type - !----------------------------------------------------------------------- - - abstract interface - !----------------------------------------------------------------------- - function need_lightning_and_popdens_interface(this) result(need_lightning_and_popdens) - ! - ! !DESCRIPTION: - ! Returns true if need lightning and popdens, false otherwise - ! - ! USES - import :: fire_base_type - ! - ! !ARGUMENTS: - class(fire_base_type), intent(in) :: this - logical :: need_lightning_and_popdens ! function result - !----------------------------------------------------------------------- - end function need_lightning_and_popdens_interface - end interface - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - -contains - - !----------------------------------------------------------------------- - subroutine FireReadNML_interface( this, NLFilename ) - ! - ! !DESCRIPTION: - ! Read the namelist for Fire - ! - ! !USES: - ! - ! !ARGUMENTS: - class(fire_base_type) :: this - character(len=*), intent(in) :: NLFilename ! Namelist filename - end subroutine FireReadNML_interface - - !----------------------------------------------------------------------- - subroutine BaseFireInit( this, bounds, NLFilename ) - ! - ! !DESCRIPTION: - ! Initialize CN Fire module - ! !USES: - use shr_infnan_mod , only : nan => shr_infnan_nan, assignment(=) - ! - ! !ARGUMENTS: - class(fire_base_type) :: this - type(bounds_type), intent(in) :: bounds - character(len=*), intent(in) :: NLFilename - !----------------------------------------------------------------------- - - if ( this%need_lightning_and_popdens() ) then - ! Allocate lightning forcing data - allocate( this%forc_lnfm(bounds%begg:bounds%endg) ) - this%forc_lnfm(bounds%begg:) = nan - ! Allocate pop dens forcing data - allocate( this%forc_hdm(bounds%begg:bounds%endg) ) - this%forc_hdm(bounds%begg:) = nan - - ! Allocate real gdp data - allocate(this%gdp_lf_col(bounds%begc:bounds%endc)) - ! Allocate peatland fraction data - allocate(this%peatf_lf_col(bounds%begc:bounds%endc)) - ! Allocates peak month of crop fire emissions - allocate(this%abm_lf_col(bounds%begc:bounds%endc)) - - - call this%hdm_init(bounds, NLFilename) - call this%hdm_interp(bounds) - call this%lnfm_init(bounds, NLFilename) - call this%lnfm_interp(bounds) - call this%surfdataread(bounds) - end if - - end subroutine BaseFireInit - - !----------------------------------------------------------------------- - subroutine FireInterp(this,bounds) - ! - ! !DESCRIPTION: - ! Interpolate CN Fire datasets - ! - ! !ARGUMENTS: - class(fire_base_type) :: this - type(bounds_type), intent(in) :: bounds - !----------------------------------------------------------------------- - - if ( this%need_lightning_and_popdens() ) then - call this%hdm_interp(bounds) - call this%lnfm_interp(bounds) - end if - - end subroutine FireInterp - - !----------------------------------------------------------------------- - subroutine hdm_init( this, bounds, NLFilename ) - ! - ! !DESCRIPTION: - ! Initialize data stream information for population density. - ! - ! !USES: - use clm_time_manager , only : get_calendar - use ncdio_pio , only : pio_subsystem - use shr_pio_mod , only : shr_pio_getiotype - use clm_nlUtilsMod , only : find_nlgroup_name - use ndepStreamMod , only : clm_domain_mct - use histFileMod , only : hist_addfld1d - ! - ! !ARGUMENTS: - implicit none - class(fire_base_type) :: this - type(bounds_type), intent(in) :: bounds - character(len=*), intent(in) :: NLFilename ! Namelist filename - ! - ! !LOCAL VARIABLES: - integer :: stream_year_first_popdens ! first year in pop. dens. stream to use - integer :: stream_year_last_popdens ! last year in pop. dens. stream to use - integer :: model_year_align_popdens ! align stream_year_first_hdm with - integer :: nu_nml ! unit for namelist file - integer :: nml_error ! namelist i/o error flag - type(mct_ggrid) :: dom_clm ! domain information - character(len=CL) :: stream_fldFileName_popdens ! population density streams filename - character(len=CL) :: popdensmapalgo = 'bilinear' ! mapping alogrithm for population density - character(len=CL) :: popdens_tintalgo = 'nearest'! time interpolation alogrithm for population density - character(len=CL) :: stream_meshfile_popdens ! not used - character(*), parameter :: subName = "('hdmdyn_init')" - character(*), parameter :: F00 = "('(hdmdyn_init) ',4a)" - !----------------------------------------------------------------------- - - namelist /popd_streams/ & - stream_year_first_popdens, & - stream_year_last_popdens, & - model_year_align_popdens, & - popdensmapalgo, & - stream_fldFileName_popdens, & - stream_meshfile_popdens , & - popdens_tintalgo - - ! Default values for namelist - stream_year_first_popdens = 1 ! first year in stream to use - stream_year_last_popdens = 1 ! last year in stream to use - model_year_align_popdens = 1 ! align stream_year_first_popdens with this model year - stream_fldFileName_popdens = ' ' - - ! Read popd_streams namelist - if (masterproc) then - nu_nml = getavu() - open( nu_nml, file=trim(NLFilename), status='old', iostat=nml_error ) - call find_nlgroup_name(nu_nml, 'popd_streams', status=nml_error) - if (nml_error == 0) then - read(nu_nml, nml=popd_streams,iostat=nml_error) - if (nml_error /= 0) then - call endrun(msg='ERROR reading popd_streams namelist'//errMsg(sourcefile, __LINE__)) - end if - end if - close(nu_nml) - call relavu( nu_nml ) - endif - - call shr_mpi_bcast(stream_year_first_popdens, mpicom) - call shr_mpi_bcast(stream_year_last_popdens, mpicom) - call shr_mpi_bcast(model_year_align_popdens, mpicom) - call shr_mpi_bcast(stream_fldFileName_popdens, mpicom) - call shr_mpi_bcast(popdens_tintalgo, mpicom) - - if (masterproc) then - write(iulog,*) ' ' - write(iulog,*) 'popdens_streams settings:' - write(iulog,*) ' stream_year_first_popdens = ',stream_year_first_popdens - write(iulog,*) ' stream_year_last_popdens = ',stream_year_last_popdens - write(iulog,*) ' model_year_align_popdens = ',model_year_align_popdens - write(iulog,*) ' stream_fldFileName_popdens = ',stream_fldFileName_popdens - write(iulog,*) ' popdens_tintalgo = ',popdens_tintalgo - write(iulog,*) ' ' - endif - - call clm_domain_mct (bounds, dom_clm) - - call shr_strdata_create(this%sdat_hdm,name="clmhdm", & - pio_subsystem=pio_subsystem, & - pio_iotype=shr_pio_getiotype(inst_name), & - mpicom=mpicom, compid=comp_id, & - gsmap=gsmap_global, ggrid=dom_clm, & - nxg=ldomain%ni, nyg=ldomain%nj, & - yearFirst=stream_year_first_popdens, & - yearLast=stream_year_last_popdens, & - yearAlign=model_year_align_popdens, & - offset=0, & - domFilePath='', & - domFileName=trim(stream_fldFileName_popdens), & - domTvarName='time', & - domXvarName='lon' , & - domYvarName='lat' , & - domAreaName='area', & - domMaskName='mask', & - filePath='', & - filename=(/trim(stream_fldFileName_popdens)/) , & - fldListFile='hdm', & - fldListModel='hdm', & - fillalgo='none', & - mapalgo=popdensmapalgo, & - calendar=get_calendar(), & - tintalgo=popdens_tintalgo, & - taxmode='extend' ) - - if (masterproc) then - call shr_strdata_print(this%sdat_hdm,'population density data') - endif - - ! Add history fields - call hist_addfld1d (fname='HDM', units='counts/km^2', & - avgflag='A', long_name='human population density', & - ptr_lnd=this%forc_hdm, default='inactive') - - end subroutine hdm_init - - !----------------------------------------------------------------------- - subroutine hdm_interp( this, bounds) - ! - ! !DESCRIPTION: - ! Interpolate data stream information for population density. - ! - ! !USES: - use clm_time_manager, only : get_curr_date - ! - ! !ARGUMENTS: - class(fire_base_type) :: this - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - integer :: g, ig - 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) - !----------------------------------------------------------------------- - - call get_curr_date(year, mon, day, sec) - mcdate = year*10000 + mon*100 + day - - call shr_strdata_advance(this%sdat_hdm, mcdate, sec, mpicom, 'hdmdyn') - - ig = 0 - do g = bounds%begg,bounds%endg - ig = ig+1 - this%forc_hdm(g) = this%sdat_hdm%avs(1)%rAttr(1,ig) - end do - - end subroutine hdm_interp - - !----------------------------------------------------------------------- - subroutine lnfm_init( this, bounds, NLFilename ) - ! - ! !DESCRIPTION: - ! - ! Initialize data stream information for Lightning. - ! - ! !USES: - use clm_time_manager , only : get_calendar - use ncdio_pio , only : pio_subsystem - use shr_pio_mod , only : shr_pio_getiotype - use clm_nlUtilsMod , only : find_nlgroup_name - use ndepStreamMod , only : clm_domain_mct - use histFileMod , only : hist_addfld1d - ! - ! !ARGUMENTS: - implicit none - class(fire_base_type) :: this - type(bounds_type), intent(in) :: bounds - character(len=*), intent(in) :: NLFilename - ! - ! !LOCAL VARIABLES: - integer :: stream_year_first_lightng ! first year in Lightning stream to use - integer :: stream_year_last_lightng ! last year in Lightning stream to use - integer :: model_year_align_lightng ! align stream_year_first_lnfm with - integer :: nu_nml ! unit for namelist file - integer :: nml_error ! namelist i/o error flag - type(mct_ggrid) :: dom_clm ! domain information - character(len=CL) :: stream_fldFileName_lightng ! lightning stream filename to read - character(len=CL) :: lightng_tintalgo = 'linear'! time interpolation alogrithm - character(len=CL) :: lightngmapalgo = 'bilinear'! Mapping alogrithm - character(*), parameter :: subName = "('lnfmdyn_init')" - character(*), parameter :: F00 = "('(lnfmdyn_init) ',4a)" - !----------------------------------------------------------------------- - - namelist /light_streams/ & - stream_year_first_lightng, & - stream_year_last_lightng, & - model_year_align_lightng, & - lightngmapalgo, & - stream_fldFileName_lightng, & - lightng_tintalgo - - ! Default values for namelist - stream_year_first_lightng = 1 ! first year in stream to use - stream_year_last_lightng = 1 ! last year in stream to use - model_year_align_lightng = 1 ! align stream_year_first_lnfm with this model year - stream_fldFileName_lightng = ' ' - - ! Read light_streams namelist - if (masterproc) then - nu_nml = getavu() - open( nu_nml, file=trim(NLFilename), status='old', iostat=nml_error ) - call find_nlgroup_name(nu_nml, 'light_streams', status=nml_error) - if (nml_error == 0) then - read(nu_nml, nml=light_streams,iostat=nml_error) - if (nml_error /= 0) then - call endrun(msg='ERROR reading light_streams namelist'//errMsg(sourcefile, __LINE__)) - end if - end if - close(nu_nml) - call relavu( nu_nml ) - endif - - call shr_mpi_bcast(stream_year_first_lightng, mpicom) - call shr_mpi_bcast(stream_year_last_lightng, mpicom) - call shr_mpi_bcast(model_year_align_lightng, mpicom) - call shr_mpi_bcast(stream_fldFileName_lightng, mpicom) - call shr_mpi_bcast(lightng_tintalgo, mpicom) - - if (masterproc) then - write(iulog,*) ' ' - write(iulog,*) 'light_stream settings:' - write(iulog,*) ' stream_year_first_lightng = ',stream_year_first_lightng - write(iulog,*) ' stream_year_last_lightng = ',stream_year_last_lightng - write(iulog,*) ' model_year_align_lightng = ',model_year_align_lightng - write(iulog,*) ' stream_fldFileName_lightng = ',stream_fldFileName_lightng - write(iulog,*) ' lightng_tintalgo = ',lightng_tintalgo - write(iulog,*) ' ' - endif - - call clm_domain_mct (bounds, dom_clm) - - call shr_strdata_create(this%sdat_lnfm,name="clmlnfm", & - pio_subsystem=pio_subsystem, & - pio_iotype=shr_pio_getiotype(inst_name), & - mpicom=mpicom, compid=comp_id, & - gsmap=gsmap_global, ggrid=dom_clm, & - nxg=ldomain%ni, nyg=ldomain%nj, & - yearFirst=stream_year_first_lightng, & - yearLast=stream_year_last_lightng, & - yearAlign=model_year_align_lightng, & - offset=0, & - domFilePath='', & - domFileName=trim(stream_fldFileName_lightng), & - domTvarName='time', & - domXvarName='lon' , & - domYvarName='lat' , & - domAreaName='area', & - domMaskName='mask', & - filePath='', & - filename=(/trim(stream_fldFileName_lightng)/), & - fldListFile='lnfm', & - fldListModel='lnfm', & - fillalgo='none', & - tintalgo=lightng_tintalgo, & - mapalgo=lightngmapalgo, & - calendar=get_calendar(), & - taxmode='cycle' ) - - if (masterproc) then - call shr_strdata_print(this%sdat_lnfm,'Lightning data') - endif - - ! Add history fields - call hist_addfld1d (fname='LNFM', units='counts/km^2/hr', & - avgflag='A', long_name='Lightning frequency', & - ptr_lnd=this%forc_lnfm, default='inactive') - - end subroutine lnfm_init - - !----------------------------------------------------------------------- - subroutine lnfm_interp(this, bounds ) - ! - ! !DESCRIPTION: - ! Interpolate data stream information for Lightning. - ! - ! !USES: - use clm_time_manager, only : get_curr_date - ! - ! !ARGUMENTS: - class(fire_base_type) :: this - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - integer :: g, ig - 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) - !----------------------------------------------------------------------- - - call get_curr_date(year, mon, day, sec) - mcdate = year*10000 + mon*100 + day - - call shr_strdata_advance(this%sdat_lnfm, mcdate, sec, mpicom, 'lnfmdyn') - - ig = 0 - do g = bounds%begg,bounds%endg - ig = ig+1 - this%forc_lnfm(g) = this%sdat_lnfm%avs(1)%rAttr(1,ig) - end do - - end subroutine lnfm_interp - - !----------------------------------------------------------------------- - subroutine surfdataread(this, bounds) - ! - ! !DESCRIPTION: - ! Read surface data set to populate relevant fire-related variables - ! - ! !USES: - use spmdMod , only : masterproc - use clm_varctl , only : nsrest, nsrStartup, fsurdat - use clm_varcon , only : grlnd - use ColumnType , only : col - use fileutils , only : getfil - use ncdio_pio - ! - ! !ARGUMENTS: - class(fire_base_type) :: this - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - integer :: g,c ! indices - type(file_desc_t) :: ncid ! netcdf id - logical :: readvar ! true => variable is on initial dataset - character(len=256) :: locfn ! local filename - real(r8), pointer :: gdp(:) ! global gdp data (needs to be a pointer for use in ncdio) - real(r8), pointer :: peatf(:) ! global peatf data (needs to be a pointer for use in ncdio) - integer, pointer :: abm(:) ! global abm data (needs to be a pointer for use in ncdio) - !----------------------------------------------------------------------- - - ! -------------------------------------------------------------------- - ! Open surface dataset - ! -------------------------------------------------------------------- - - call getfil (fsurdat, locfn, 0) - call ncd_pio_openfile (ncid, locfn, 0) - - ! -------------------------------------------------------------------- - ! Read in GDP data - ! -------------------------------------------------------------------- - - allocate(gdp(bounds%begg:bounds%endg)) - call ncd_io(ncid=ncid, varname='gdp', flag='read', data=gdp, dim1name=grlnd, readvar=readvar) - if (.not. readvar) then - call endrun(msg=' ERROR: gdp NOT on surfdata file'//errMsg(sourcefile, __LINE__)) - end if - do c = bounds%begc, bounds%endc - g = col%gridcell(c) - this%gdp_lf_col(c) = gdp(g) - end do - deallocate(gdp) - - ! -------------------------------------------------------------------- - ! Read in peatf data - ! -------------------------------------------------------------------- - - allocate(peatf(bounds%begg:bounds%endg)) - call ncd_io(ncid=ncid, varname='peatf', flag='read', data=peatf, dim1name=grlnd, readvar=readvar) - if (.not. readvar) then - call endrun(msg=' ERROR: peatf NOT on surfdata file'//errMsg(sourcefile, __LINE__)) - end if - do c = bounds%begc, bounds%endc - g = col%gridcell(c) - this%peatf_lf_col(c) = peatf(g) - end do - deallocate(peatf) - - ! -------------------------------------------------------------------- - ! Read in ABM data - ! -------------------------------------------------------------------- - - allocate(abm(bounds%begg:bounds%endg)) - call ncd_io(ncid=ncid, varname='abm', flag='read', data=abm, dim1name=grlnd, readvar=readvar) - if (.not. readvar) then - call endrun(msg=' ERROR: abm NOT on surfdata file'//errMsg(sourcefile, __LINE__)) - end if - do c = bounds%begc, bounds%endc - g = col%gridcell(c) - this%abm_lf_col(c) = abm(g) - end do - deallocate(abm) - - ! Close file - - call ncd_pio_closefile(ncid) - - if (masterproc) then - write(iulog,*) 'Successfully read fmax, soil color, sand and clay boundary data' - write(iulog,*) - endif - - end subroutine surfdataread - - -end module FireDataBaseType diff --git a/src/cpl/mct/SoilMoistureStreamMod.F90 b/src/cpl/mct/SoilMoistureStreamMod.F90 deleted file mode 100644 index 8b366d6c8e..0000000000 --- a/src/cpl/mct/SoilMoistureStreamMod.F90 +++ /dev/null @@ -1,418 +0,0 @@ -module SoilMoistureStreamMod - - ! ********************************************************************** - ! --------------------------- IMPORTANT NOTE --------------------------- - ! - ! In cases using the NUOPC driver/mediator, we use a different version of this module, - ! based on CDEPS, which resides in src/cpl/nuopc/. Changes to the science here should - ! also be made in the similar file in src/cpl/nuopc. Once we start using CDEPS by - ! default, we can remove this version and move the CDEPS-based version into its place. - ! ********************************************************************** - -#include "shr_assert.h" - - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! Read in soil moisture from data stream - ! - ! !USES: - use shr_strdata_mod , only : shr_strdata_type, shr_strdata_create - use shr_strdata_mod , only : shr_strdata_print, shr_strdata_advance - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_kind_mod , only : CL => shr_kind_CL, CXX => shr_kind_CXX - use shr_log_mod , only : errMsg => shr_log_errMsg - use decompMod , only : bounds_type, subgrid_level_column - use abortutils , only : endrun - use clm_varctl , only : iulog, use_soil_moisture_streams, inst_name - use clm_varcon , only : grlnd - use controlMod , only : NLFilename - use domainMod , only : ldomain - use LandunitType , only : lun - use ColumnType , only : col - use SoilStateType , only : soilstate_type - use WaterStateBulkType , only : waterstatebulk_type - use perf_mod , only : t_startf, t_stopf - use spmdMod , only : masterproc, mpicom, comp_id - use lnd_set_decomp_and_domain , only : gsMap_lnd2Dsoi_gdc2glo - use mct_mod - use ncdio_pio - ! - ! !PUBLIC TYPES: - implicit none - private - ! - ! !PUBLIC MEMBER FUNCTIONS: - public :: PrescribedSoilMoistureInit ! position datasets for soil moisture - public :: PrescribedSoilMoistureAdvance ! Advance the soil moisture stream (outside of Open-MP loops) - public :: PrescribedSoilMoistureInterp ! interpolates between two periods of soil moisture data - - ! !PRIVATE MEMBER DATA: - type(shr_strdata_type) :: sdat_soilm ! soil moisture input data stream - integer :: ism ! Soil moisture steram index - integer, allocatable :: g_to_ig(:) ! Array matching gridcell index to data index - logical :: soilm_ignore_data_if_missing ! If should ignore overridding a point with soil moisture data - ! from the streams file, if the streams file shows that point - ! as missing (namelist item) - ! - ! !PRIVATE TYPES: - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - !----------------------------------------------------------------------- - -contains - - !----------------------------------------------------------------------- - ! - ! soil_moisture_init - ! - !----------------------------------------------------------------------- - subroutine PrescribedSoilMoistureInit(bounds) - ! - ! Initialize data stream information for soil moisture. - ! - ! - ! !USES: - use clm_time_manager , only : get_calendar - use ncdio_pio , only : pio_subsystem - use shr_pio_mod , only : shr_pio_getiotype - use clm_nlUtilsMod , only : find_nlgroup_name - use ndepStreamMod , only : clm_domain_mct - use shr_stream_mod , only : shr_stream_file_null - use shr_string_mod , only : shr_string_listCreateField - use clm_varpar , only : nlevsoi - ! - ! !ARGUMENTS: - implicit none - type(bounds_type), intent(in) :: bounds ! bounds - ! - ! !LOCAL VARIABLES: - integer :: i ! index - integer :: stream_year_first_soilm ! first year in Ustar stream to use - integer :: stream_year_last_soilm ! last year in Ustar stream to use - integer :: model_year_align_soilm ! align stream_year_first_soilm with - integer :: nu_nml ! unit for namelist file - integer :: nml_error ! namelist i/o error flag - integer :: soilm_offset ! Offset in time for dataset (sec) - type(mct_ggrid) :: dom_clm ! domain information - character(len=CL) :: stream_fldfilename_soilm ! ustar stream filename to read - character(len=CL) :: soilm_tintalgo = 'linear' ! Time interpolation alogrithm - - character(*), parameter :: subName = "('PrescribedSoilMoistureInit')" - character(*), parameter :: F00 = "('(PrescribedSoilMoistureInit) ',4a)" - character(*), parameter :: soilmString = "H2OSOI" ! base string for field string - character(CXX) :: fldList ! field string - !----------------------------------------------------------------------- - ! - ! deal with namelist variables here in init - ! - namelist /soil_moisture_streams/ & - stream_year_first_soilm, & - stream_year_last_soilm, & - model_year_align_soilm, & - soilm_tintalgo, & - soilm_offset, & - soilm_ignore_data_if_missing, & - stream_fldfilename_soilm - - ! Default values for namelist - stream_year_first_soilm = 1 ! first year in stream to use - stream_year_last_soilm = 1 ! last year in stream to use - model_year_align_soilm = 1 ! align stream_year_first_soilm with this model year - stream_fldfilename_soilm = shr_stream_file_null - soilm_offset = 0 - soilm_ignore_data_if_missing = .false. - - ! Read soilm_streams namelist - if (masterproc) then - open( newunit=nu_nml, file=trim(NLFilename), status='old', iostat=nml_error ) - call find_nlgroup_name(nu_nml, 'soil_moisture_streams', status=nml_error) - if (nml_error == 0) then - read(nu_nml, nml=soil_moisture_streams,iostat=nml_error) - if (nml_error /= 0) then - call endrun(subname // ':: ERROR reading soil_moisture_streams namelist') - end if - else - call endrun(subname // ':: ERROR finding soilm_streams namelist') - end if - close(nu_nml) - endif - - call shr_mpi_bcast(stream_year_first_soilm, mpicom) - call shr_mpi_bcast(stream_year_last_soilm, mpicom) - call shr_mpi_bcast(model_year_align_soilm, mpicom) - call shr_mpi_bcast(stream_fldfilename_soilm, mpicom) - call shr_mpi_bcast(soilm_tintalgo, mpicom) - call shr_mpi_bcast(soilm_offset, mpicom) - call shr_mpi_bcast(soilm_ignore_data_if_missing, mpicom) - - if (masterproc) then - - write(iulog,*) ' ' - write(iulog,*) 'soil_moisture_stream settings:' - write(iulog,*) ' stream_year_first_soilm = ',stream_year_first_soilm - write(iulog,*) ' stream_year_last_soilm = ',stream_year_last_soilm - write(iulog,*) ' model_year_align_soilm = ',model_year_align_soilm - write(iulog,*) ' stream_fldfilename_soilm = ',trim(stream_fldfilename_soilm) - write(iulog,*) ' soilm_tintalgo = ',trim(soilm_tintalgo) - write(iulog,*) ' soilm_offset = ',soilm_offset - if ( soilm_ignore_data_if_missing )then - write(iulog,*) ' Do NOT override a point with streams data if the streams data is missing' - else - write(iulog,*) ' Abort, if you find a model point where the input streams data is set to missing value' - end if - - endif - - call clm_domain_mct (bounds, dom_clm, nlevels=nlevsoi) - - ! create the field list for these fields...use in shr_strdata_create - fldList = trim(soilmString) - if (masterproc) write(iulog,*) 'fieldlist: ', trim(fldList) - - call shr_strdata_create(sdat_soilm,name="soil_moisture", & - pio_subsystem=pio_subsystem, & - pio_iotype=shr_pio_getiotype(inst_name), & - mpicom=mpicom, compid=comp_id, & - gsmap=gsMap_lnd2Dsoi_gdc2glo, ggrid=dom_clm, & - nxg=ldomain%ni, nyg=ldomain%nj, & - nzg=nlevsoi, & - yearFirst=stream_year_first_soilm, & - yearLast=stream_year_last_soilm, & - yearAlign=model_year_align_soilm, & - offset=soilm_offset, & - domFilePath='', & - domFileName=trim(stream_fldFileName_soilm), & - domTvarName='time', & - domXvarName='lon' , & - domYvarName='lat' , & - domZvarName='levsoi' , & - domAreaName='area', & - domMaskName='mask', & - filePath='', & - filename=(/stream_fldFileName_soilm/), & - fldListFile=fldList, & - fldListModel=fldList, & - fillalgo='none', & - mapalgo='none', & - tintalgo=soilm_tintalgo, & - calendar=get_calendar(), & - dtlimit = 15._r8, & - taxmode='cycle' ) - - if (masterproc) then - call shr_strdata_print(sdat_soilm,'soil moisture data') - endif - - end subroutine PrescribedSoilMoistureInit - - - !----------------------------------------------------------------------- - ! - ! PrescribedSoilMoistureAdvance - ! - !----------------------------------------------------------------------- - subroutine PrescribedSoilMoistureAdvance( bounds ) - ! - ! Advanace the prescribed soil moisture stream - ! - ! !USES: - use clm_time_manager, only : get_curr_date - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - character(len=CL) :: stream_var_name - integer :: g, ig - integer :: ier ! error code - 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) - - call get_curr_date(year, mon, day, sec) - mcdate = year*10000 + mon*100 + day - - stream_var_name = 'H2OSOI' - - ! Determine variable index - ism = mct_aVect_indexRA(sdat_soilm%avs(1),trim(stream_var_name)) - - call shr_strdata_advance(sdat_soilm, mcdate, sec, mpicom, trim(stream_var_name)) - - ! Map gridcell to AV index - ier = 0 - if ( .not. allocated(g_to_ig) )then - allocate (g_to_ig(bounds%begg:bounds%endg), stat=ier) - if (ier /= 0) then - write(iulog,*) 'Prescribed soil moisture allocation error' - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if - - ig = 0 - do g = bounds%begg,bounds%endg - ig = ig+1 - g_to_ig(g) = ig - end do - end if - - end subroutine PrescribedSoilMoistureAdvance - - !----------------------------------------------------------------------- - ! - ! PrescribedSoilMoistureInterp - ! - !----------------------------------------------------------------------- - subroutine PrescribedSoilMoistureInterp(bounds, soilstate_inst, & - waterstatebulk_inst) - ! - ! Assign data stream information for prescribed soil moisture. - ! - ! !USES: - use clm_time_manager, only : get_curr_date - use clm_varpar , only : nlevsoi - use clm_varcon , only : denh2o, denice, watmin, spval - use landunit_varcon , only : istsoil, istcrop - ! - ! !ARGUMENTS: - implicit none - type(bounds_type) , intent(in) :: bounds - type(soilstate_type) , intent(in) :: soilstate_inst - type(waterstatebulk_type) , intent(inout) :: waterstatebulk_inst - ! - ! !LOCAL VARIABLES: - integer :: c, g, j, ig, n - real(r8) :: soilm_liq_frac ! liquid fraction of soil moisture - real(r8) :: soilm_ice_frac ! ice fraction of soil moisture - real(r8) :: moisture_increment ! soil moisture adjustment increment - real(r8) :: h2osoi_vol_initial ! initial vwc value - character(*), parameter :: subName = "('PrescribedSoilMoistureInterp')" - - !----------------------------------------------------------------------- - - SHR_ASSERT_FL( (lbound(sdat_soilm%avs(1)%rAttr,1) == ism ), sourcefile, __LINE__) - SHR_ASSERT_FL( (ubound(sdat_soilm%avs(1)%rAttr,1) == ism ), sourcefile, __LINE__) - SHR_ASSERT_FL( (lbound(g_to_ig,1) <= bounds%begg ), sourcefile, __LINE__) - SHR_ASSERT_FL( (ubound(g_to_ig,1) >= bounds%endg ), sourcefile, __LINE__) - SHR_ASSERT_FL( (lbound(sdat_soilm%avs(1)%rAttr,2) <= g_to_ig(bounds%begg) ), sourcefile, __LINE__) - SHR_ASSERT_FL( (ubound(sdat_soilm%avs(1)%rAttr,2) >= g_to_ig(bounds%endg)+(nlevsoi-1)*size(g_to_ig) ), sourcefile, __LINE__) - associate( & - dz => col%dz , & ! Input: [real(r8) (:,:) ] layer depth (m) - watsat => soilstate_inst%watsat_col , & ! Input: [real(r8) (:,:) ] volumetric soil water at saturation (porosity) - h2osoi_liq => waterstatebulk_inst%h2osoi_liq_col , & ! Input/Output: [real(r8) (:,:) ] liquid water (kg/m2) - h2osoi_ice => waterstatebulk_inst%h2osoi_ice_col , & ! Input/Output: [real(r8) (:,:) ] ice water (kg/m2) - h2osoi_vol => waterstatebulk_inst%h2osoi_vol_col , & ! Output: volumetric soil water (m3/m3) - h2osoi_vol_prs => waterstatebulk_inst%h2osoi_vol_prs_grc & ! Output: prescribed volumetric soil water (m3/m3) - ) - SHR_ASSERT_FL( (lbound(h2osoi_vol,1) <= bounds%begc ), sourcefile, __LINE__) - SHR_ASSERT_FL( (ubound(h2osoi_vol,1) >= bounds%endc ), sourcefile, __LINE__) - SHR_ASSERT_FL( (lbound(h2osoi_vol,2) == 1 ), sourcefile, __LINE__) - SHR_ASSERT_FL( (ubound(h2osoi_vol,2) >= nlevsoi ), sourcefile, __LINE__) - SHR_ASSERT_FL( (lbound(dz,1) <= bounds%begc ), sourcefile, __LINE__) - SHR_ASSERT_FL( (ubound(dz,1) >= bounds%endc ), sourcefile, __LINE__) - SHR_ASSERT_FL( (lbound(dz,2) <= 1 ), sourcefile, __LINE__) - SHR_ASSERT_FL( (ubound(dz,2) >= nlevsoi ), sourcefile, __LINE__) - SHR_ASSERT_FL( (lbound(watsat,1) <= bounds%begc ), sourcefile, __LINE__) - SHR_ASSERT_FL( (ubound(watsat,1) >= bounds%endc ), sourcefile, __LINE__) - SHR_ASSERT_FL( (lbound(watsat,2) <= 1 ), sourcefile, __LINE__) - SHR_ASSERT_FL( (ubound(watsat,2) >= nlevsoi ), sourcefile, __LINE__) - SHR_ASSERT_FL( (lbound(h2osoi_liq,1) <= bounds%begc ), sourcefile, __LINE__) - SHR_ASSERT_FL( (ubound(h2osoi_liq,1) >= bounds%endc ), sourcefile, __LINE__) - SHR_ASSERT_FL( (lbound(h2osoi_liq,2) <= 1 ), sourcefile, __LINE__) - SHR_ASSERT_FL( (ubound(h2osoi_liq,2) >= nlevsoi ), sourcefile, __LINE__) - SHR_ASSERT_FL( (lbound(h2osoi_ice,1) <= bounds%begc ), sourcefile, __LINE__) - SHR_ASSERT_FL( (ubound(h2osoi_ice,1) >= bounds%endc ), sourcefile, __LINE__) - SHR_ASSERT_FL( (lbound(h2osoi_ice,2) <= 1 ), sourcefile, __LINE__) - SHR_ASSERT_FL( (ubound(h2osoi_ice,2) >= nlevsoi ), sourcefile, __LINE__) - SHR_ASSERT_FL( (lbound(h2osoi_vol_prs,1) <= bounds%begg ), sourcefile, __LINE__) - SHR_ASSERT_FL( (ubound(h2osoi_vol_prs,1) >= bounds%endg ), sourcefile, __LINE__) - SHR_ASSERT_FL( (lbound(h2osoi_vol_prs,2) == 1 ), sourcefile, __LINE__) - SHR_ASSERT_FL( (ubound(h2osoi_vol_prs,2) >= nlevsoi ), sourcefile, __LINE__) - ! - ! Set the prescribed soil moisture read from the file everywhere - ! - do g = bounds%begg, bounds%endg - ig = g_to_ig(g) - do j = 1, nlevsoi - - !n = ig + (j-1)*size(g_to_ig) - n = ig + (j-1)*size(g_to_ig) - - h2osoi_vol_prs(g,j) = sdat_soilm%avs(1)%rAttr(ism,n) - - ! If soil moiture is being interpolated in time and the result is - ! large that probably means one of the two data points is missing (set to spval) - if ( h2osoi_vol_prs(g,j) > 10.0_r8 .and. (h2osoi_vol_prs(g,j) /= spval) )then - h2osoi_vol_prs(g,j) = spval - end if - - end do - end do - - do c = bounds%begc, bounds%endc - ! - ! Set variable for each gridcell/column combination - ! - g = col%gridcell(c) - ig = g_to_ig(g) - - ! EBK Jan/2020, also check weights on gridcell (See https://github.com/ESCOMP/CTSM/issues/847) - if ( (lun%itype(col%landunit(c)) == istsoil) .or. (lun%itype(col%landunit(c)) == istcrop) .and. & - (col%wtgcell(c) /= 0._r8) ) then - ! this is a 2d field (gridcell/nlevsoi) ! - do j = 1, nlevsoi - - n = ig + (j-1)*size(g_to_ig) - - ! if soil water is zero, liq/ice fractions cannot be calculated - if((h2osoi_liq(c, j) + h2osoi_ice(c, j)) > 0._r8) then - - ! save original soil moisture value - h2osoi_vol_initial = h2osoi_vol(c,j) - - ! Check if the vegetated land mask from the dataset on the - ! file is different - if ( (h2osoi_vol_prs(g,j) == spval) .and. (h2osoi_vol_initial /= spval) )then - if ( soilm_ignore_data_if_missing )then - cycle - else - write(iulog,*) 'Input soil moisture dataset is not vegetated as expected: gridcell=', & - g, ' active = ', col%active(c) - call endrun(subgrid_index=c, subgrid_level=subgrid_level_column, & - msg = subname // & - ' ERROR:: The input soil moisture stream is NOT vegetated for one of the land points' ) - end if - end if - - ! update volumetric soil moisture from data prescribed from the file - h2osoi_vol(c,j) = h2osoi_vol_prs(g,j) - - - ! calculate liq/ice mass fractions - soilm_liq_frac = h2osoi_liq(c, j) /(h2osoi_liq(c, j) + h2osoi_ice(c, j)) - soilm_ice_frac = h2osoi_ice(c, j) /(h2osoi_liq(c, j) + h2osoi_ice(c, j)) - - ! calculate moisture increment - moisture_increment = h2osoi_vol(c,j) - h2osoi_vol_initial - ! add limitation check - moisture_increment = min((watsat(c,j) - h2osoi_vol_initial),max(-(h2osoi_vol_initial-watmin),moisture_increment)) - - ! update liq/ice water mass due to (volumetric) moisture increment - h2osoi_liq(c,j) = h2osoi_liq(c,j) + (soilm_liq_frac * moisture_increment * dz(c, j) * denh2o) - h2osoi_ice(c,j) = h2osoi_ice(c,j) + (soilm_ice_frac * moisture_increment * dz(c, j) * denice) - - else - call endrun(subgrid_index=c, subgrid_level=subgrid_level_column, & - msg = subname // ':: ERROR h2osoil liquid plus ice is zero') - endif - enddo - endif - end do - - end associate - - end subroutine PrescribedSoilMoistureInterp - -end module SoilMoistureStreamMod diff --git a/src/cpl/mct/UrbanTimeVarType.F90 b/src/cpl/mct/UrbanTimeVarType.F90 deleted file mode 100644 index 805ac47fbf..0000000000 --- a/src/cpl/mct/UrbanTimeVarType.F90 +++ /dev/null @@ -1,314 +0,0 @@ -module UrbanTimeVarType - - !------------------------------------------------------------------------------ - ! !DESCRIPTION: - ! Urban Time Varying Data - ! - ! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8, CL => shr_kind_CL - use shr_log_mod , only : errMsg => shr_log_errMsg - use abortutils , only : endrun - use decompMod , only : bounds_type, subgrid_level_landunit - use clm_varctl , only : iulog, inst_name - use landunit_varcon , only : isturb_MIN, isturb_MAX - use clm_varcon , only : spval - use LandunitType , only : lun - use GridcellType , only : grc - use mct_mod - use shr_strdata_mod , only : shr_strdata_type - ! - implicit none - save - private - ! - ! - - ! !PUBLIC TYPE - type, public :: urbantv_type - - real(r8), public, pointer :: t_building_max(:) ! lun maximum internal building air temperature (K) - type(shr_strdata_type) :: sdat_urbantv ! urban time varying input data stream - contains - - ! !PUBLIC MEMBER FUNCTIONS: - procedure, public :: Init ! Allocate and initialize urbantv - procedure, public :: urbantv_init ! Initialize urban time varying stream - procedure, public :: urbantv_interp ! Interpolate urban time varying stream - - end type urbantv_type - - !----------------------------------------------------------------------- - character(15), private :: stream_var_name(isturb_MIN:isturb_MAX) - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - -contains - - !----------------------------------------------------------------------- - subroutine Init(this, bounds, NLFilename) - ! - ! Allocate module variables and data structures - ! - ! !USES: - use shr_infnan_mod , only : nan => shr_infnan_nan, assignment(=) - use histFileMod , only : hist_addfld1d - ! - ! !ARGUMENTS: - class(urbantv_type) :: this - type(bounds_type) , intent(in) :: bounds - character(len=*) , intent(in) :: NLFilename ! Namelist filename - ! - ! !LOCAL VARIABLES: - integer :: begl, endl - !--------------------------------------------------------------------- - - begl = bounds%begl; endl = bounds%endl - - ! Allocate urbantv data structure - - allocate(this%t_building_max (begl:endl)) ; this%t_building_max (:) = nan - - call this%urbantv_init(bounds, NLFilename) - call this%urbantv_interp(bounds) - - ! Add history fields - call hist_addfld1d (fname='TBUILD_MAX', units='K', & - avgflag='A', long_name='prescribed maximum interior building temperature', & - ptr_lunit=this%t_building_max, default='inactive', set_nourb=spval, & - l2g_scale_type='unity') - - - end subroutine Init - - !----------------------------------------------------------------------- - - !----------------------------------------------------------------------- - subroutine urbantv_init(this, bounds, NLFilename) - ! - ! !DESCRIPTION: - ! Initialize data stream information for urban time varying data - ! - ! !USES: - use clm_time_manager , only : get_calendar - use ncdio_pio , only : pio_subsystem - use shr_pio_mod , only : shr_pio_getiotype - use clm_nlUtilsMod , only : find_nlgroup_name - use ndepStreamMod , only : clm_domain_mct - use spmdMod , only : masterproc, mpicom, comp_id - use fileutils , only : getavu, relavu - use shr_mpi_mod , only : shr_mpi_bcast - use shr_string_mod , only : shr_string_listAppend - use shr_strdata_mod , only : shr_strdata_create, shr_strdata_print - use domainMod , only : ldomain - use shr_infnan_mod , only : nan => shr_infnan_nan, assignment(=) - use landunit_varcon , only : isturb_TBD, isturb_HD, isturb_MD - use lnd_set_decomp_and_domain , only : gsmap_global - ! - ! !ARGUMENTS: - implicit none - class(urbantv_type) :: this - type(bounds_type), intent(in) :: bounds - character(len=*), intent(in) :: NLFilename ! Namelist filename - ! - ! !LOCAL VARIABLES: - integer :: begl, endl ! landunits - integer :: ifield ! field index - integer :: stream_year_first_urbantv ! first year in urban tv stream to use - integer :: stream_year_last_urbantv ! last year in urban tv stream to use - integer :: model_year_align_urbantv ! align stream_year_first_urbantv - ! with this model year - integer :: nu_nml ! unit for namelist file - integer :: nml_error ! namelist i/o error flag - type(mct_ggrid) :: dom_clm ! domain information - character(len=CL) :: stream_fldFileName_urbantv ! urban tv streams filename - character(len=CL) :: urbantvmapalgo = 'nn' ! mapping alogrithm for urban ac - character(len=CL) :: urbantv_tintalgo = 'linear' ! time interpolation alogrithm - character(len=CL) :: fldList ! field string - character(*), parameter :: urbantvString = "tbuildmax_" ! base string for field string - character(*), parameter :: subName = "('urbantv_init')" - character(*), parameter :: F00 = "('(urbantv_init) ',4a)" - !----------------------------------------------------------------------- - namelist /urbantv_streams/ & - stream_year_first_urbantv, & - stream_year_last_urbantv, & - model_year_align_urbantv, & - urbantvmapalgo, & - stream_fldFileName_urbantv, & - urbantv_tintalgo - !----------------------------------------------------------------------- - - begl = bounds%begl; endl = bounds%endl - - ! Default values for namelist - stream_year_first_urbantv = 1 ! first year in stream to use - stream_year_last_urbantv = 1 ! last year in stream to use - model_year_align_urbantv = 1 ! align stream_year_first_urbantv with this model year - stream_fldFileName_urbantv = ' ' - - ! Read urbantv_streams namelist - if (masterproc) then - nu_nml = getavu() - open( nu_nml, file=trim(NLFilename), status='old', iostat=nml_error ) - call find_nlgroup_name(nu_nml, 'urbantv_streams', status=nml_error) - if (nml_error == 0) then - read(nu_nml, nml=urbantv_streams,iostat=nml_error) - if (nml_error /= 0) then - call endrun(msg='ERROR reading urbantv_streams namelist'//errMsg(sourcefile, __LINE__)) - end if - end if - close(nu_nml) - call relavu( nu_nml ) - endif - - call shr_mpi_bcast(stream_year_first_urbantv, mpicom) - call shr_mpi_bcast(stream_year_last_urbantv, mpicom) - call shr_mpi_bcast(model_year_align_urbantv, mpicom) - call shr_mpi_bcast(stream_fldFileName_urbantv, mpicom) - call shr_mpi_bcast(urbantv_tintalgo, mpicom) - - if (masterproc) then - write(iulog,*) ' ' - write(iulog,*) 'urbantv_streams settings:' - write(iulog,*) ' stream_year_first_urbantv = ',stream_year_first_urbantv - write(iulog,*) ' stream_year_last_urbantv = ',stream_year_last_urbantv - write(iulog,*) ' model_year_align_urbantv = ',model_year_align_urbantv - write(iulog,*) ' stream_fldFileName_urbantv = ',stream_fldFileName_urbantv - write(iulog,*) ' urbantv_tintalgo = ',urbantv_tintalgo - write(iulog,*) ' ' - endif - - call clm_domain_mct (bounds, dom_clm) - - ! create the field list for these urbantv fields...use in shr_strdata_create - stream_var_name(:) = "NOT_SET" - stream_var_name(isturb_TBD) = urbantvString//"TBD" - stream_var_name(isturb_HD) = urbantvString//"HD" - stream_var_name(isturb_MD) = urbantvString//"MD" - fldList = "" - do ifield = isturb_MIN, isturb_MAX - call shr_string_listAppend( fldList, stream_var_name(ifield) ) - end do - - call shr_strdata_create(this%sdat_urbantv,name="clmurbantv", & - pio_subsystem=pio_subsystem, & - pio_iotype=shr_pio_getiotype(inst_name), & - mpicom=mpicom, compid=comp_id, & - gsmap=gsmap_global, ggrid=dom_clm, & - nxg=ldomain%ni, nyg=ldomain%nj, & - yearFirst=stream_year_first_urbantv, & - yearLast=stream_year_last_urbantv, & - yearAlign=model_year_align_urbantv, & - offset=0, & - domFilePath='', & - domFileName=trim(stream_fldFileName_urbantv), & - domTvarName='time', & - domXvarName='lon' , & - domYvarName='lat' , & - domAreaName='area', & - domMaskName='LANDMASK', & - filePath='', & - filename=(/trim(stream_fldFileName_urbantv)/) , & - fldListFile=fldList, & - fldListModel=fldList, & - fillalgo='none', & - mapalgo=urbantvmapalgo, & - calendar=get_calendar(), & - tintalgo=urbantv_tintalgo, & - taxmode='extend' ) - - if (masterproc) then - call shr_strdata_print(this%sdat_urbantv,'urban time varying data') - endif - - - end subroutine urbantv_init - - !----------------------------------------------------------------------- - subroutine urbantv_interp(this, bounds) - ! - ! !DESCRIPTION: - ! Interpolate data stream information for urban time varying data. - ! - ! !USES: - use clm_time_manager, only : get_curr_date - use spmdMod , only : mpicom - use shr_strdata_mod , only : shr_strdata_advance - use clm_instur , only : urban_valid - ! - ! !ARGUMENTS: - class(urbantv_type) :: this - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - logical :: found - integer :: l, glun, ig, g, ip - 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 :: lindx ! landunit index - integer :: gindx ! gridcell index - !----------------------------------------------------------------------- - - call get_curr_date(year, mon, day, sec) - mcdate = year*10000 + mon*100 + day - - call shr_strdata_advance(this%sdat_urbantv, mcdate, sec, mpicom, 'urbantvdyn') - - do l = bounds%begl,bounds%endl - if (lun%urbpoi(l)) then - glun = lun%gridcell(l) - ip = mct_aVect_indexRA(this%sdat_urbantv%avs(1),trim(stream_var_name(lun%itype(l)))) - ! - ! Determine vector index corresponding to glun - ! - ig = 0 - do g = bounds%begg,bounds%endg - ig = ig+1 - if (g == glun) exit - end do - - this%t_building_max(l) = this%sdat_urbantv%avs(1)%rAttr(ip,ig) - else - this%t_building_max(l) = spval - end if - end do - - found = .false. - do l = bounds%begl,bounds%endl - if (lun%urbpoi(l)) then - glun = lun%gridcell(l) - ! - ! Determine vector index corresponding to glun - ! - ig = 0 - do g = bounds%begg,bounds%endg - ig = ig+1 - if (g == glun) exit - end do - - if ( .not. urban_valid(g) .or. (this%t_building_max(l) <= 0._r8)) then - found = .true. - gindx = g - lindx = l - exit - end if - end if - end do - if ( found ) then - write(iulog,*)'ERROR: no valid urban data for g= ',gindx - write(iulog,*)'landunit type: ',lun%itype(lindx) - write(iulog,*)'urban_valid: ',urban_valid(gindx) - write(iulog,*)'t_building_max: ',this%t_building_max(lindx) - call endrun(subgrid_index=lindx, subgrid_level=subgrid_level_landunit, & - msg=errmsg(sourcefile, __LINE__)) - end if - - - end subroutine urbantv_interp - - !----------------------------------------------------------------------- - -end module UrbanTimeVarType diff --git a/src/cpl/mct/ch4FInundatedStreamType.F90 b/src/cpl/mct/ch4FInundatedStreamType.F90 deleted file mode 100644 index 3c26f4d109..0000000000 --- a/src/cpl/mct/ch4FInundatedStreamType.F90 +++ /dev/null @@ -1,389 +0,0 @@ -module ch4FInundatedStreamType - -#include "shr_assert.h" - - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! Contains methods for reading in finundated streams file for methane code. - ! - ! !USES - use shr_kind_mod , only: r8 => shr_kind_r8, CL => shr_kind_cl - use spmdMod , only: mpicom, masterproc - use clm_varctl , only: iulog, inst_name - use abortutils , only: endrun - use decompMod , only: bounds_type - use ch4varcon , only: finundation_mtd - - ! !PUBLIC TYPES: - implicit none - private - save - - type, public :: ch4finundatedstream_type - real(r8), pointer, private :: zwt0_gdc (:) ! col coefficient for determining finundated (m) - real(r8), pointer, private :: f0_gdc (:) ! col maximum inundated fraction for a gridcell (for methane code) - real(r8), pointer, private :: p3_gdc (:) ! col coefficient for determining finundated (m) - real(r8), pointer, private :: fws_slope_gdc (:) ! col slope in fws = slope * tws + intercept (A coefficient) - real(r8), pointer, private :: fws_intercept_gdc (:) ! col slope in fws = slope * tws + intercept (B coefficient) - contains - - ! !PUBLIC MEMBER FUNCTIONS: - procedure, public :: Init ! Initialize and read data in - procedure, public :: CalcFinundated ! Calculate finundated based on input streams - procedure, public :: UseStreams ! If streams will be used - - ! !PRIVATE MEMBER FUNCTIONS: - procedure, private :: InitAllocate ! Allocate data - - end type ch4finundatedstream_type - - - ! ! PRIVATE DATA: - - type, private :: streamcontrol_type - character(len=CL) :: stream_fldFileName_ch4finundated ! Filename - character(len=CL) :: ch4finundatedmapalgo ! map algo - character(len=CL) :: fldList ! List of fields to read - contains - procedure, private :: ReadNML ! Read in namelist - end type streamcontrol_type - - type(streamcontrol_type), private :: control ! Stream control data - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - !============================================================================== - -contains - - !============================================================================== - - subroutine Init(this, bounds, NLFilename) - ! - ! Initialize the ch4 finundated stream object - ! - ! Uses: - use clm_time_manager , only : get_calendar, get_curr_date - use ncdio_pio , only : pio_subsystem - use shr_pio_mod , only : shr_pio_getiotype - use shr_nl_mod , only : shr_nl_find_group_name - use shr_mpi_mod , only : shr_mpi_bcast - use ndepStreamMod , only : clm_domain_mct - use domainMod , only : ldomain - use decompMod , only : bounds_type - use mct_mod , only : mct_ggrid, mct_avect_indexra - use shr_strdata_mod , only : shr_strdata_type, shr_strdata_create - use shr_strdata_mod , only : shr_strdata_print, shr_strdata_advance - use spmdMod , only : comp_id, iam - use ch4varcon , only : finundation_mtd_h2osfc - use ch4varcon , only : finundation_mtd_ZWT_inversion, finundation_mtd_TWS_inversion - use lnd_set_decomp_and_domain , only : gsmap_global - ! - ! arguments - implicit none - class(ch4finundatedstream_type) :: this - type(bounds_type), intent(in) :: bounds - character(len=*), intent(in) :: NLFilename ! Namelist filename - ! - ! local variables - integer :: ig, g ! Indices - type(mct_ggrid) :: dom_clm ! domain information - type(shr_strdata_type) :: sdat ! input data stream - integer :: index_ZWT0 = 0 ! Index of ZWT0 field - integer :: index_F0 = 0 ! Index of F0 field - integer :: index_P3 = 0 ! Index of P3 field - integer :: index_FWS_TWS_A = 0 ! Index of FWS_TWS_A field - integer :: index_FWS_TWS_B = 0 ! Index of FWS_TWS_B field - 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) - character(len=*), parameter :: stream_name = 'ch4finundated' - character(*), parameter :: subName = "('ch4finundatedstream::Init')" - !----------------------------------------------------------------------- - if ( finundation_mtd /= finundation_mtd_h2osfc )then - call this%InitAllocate( bounds ) - call control%ReadNML( bounds, NLFileName ) - - if ( this%useStreams() )then - call clm_domain_mct (bounds, dom_clm) - - call shr_strdata_create(sdat,name=stream_name, & - pio_subsystem=pio_subsystem, & - pio_iotype=shr_pio_getiotype(inst_name), & - mpicom=mpicom, compid=comp_id, & - gsmap=gsmap_global, ggrid=dom_clm, & - nxg=ldomain%ni, nyg=ldomain%nj, & - yearFirst=1996, & - yearLast=1996, & - yearAlign=1, & - offset=0, & - domFilePath='', & - domFileName=trim(control%stream_fldFileName_ch4finundated), & - domTvarName='time', & - domXvarName='LONGXY' , & - domYvarName='LATIXY' , & - domAreaName='AREA', & - domMaskName='LANDMASK', & - filePath='', & - filename=(/trim(control%stream_fldFileName_ch4finundated)/), & - fldListFile=control%fldList, & - fldListModel=control%fldList, & - fillalgo='none', & - mapalgo=control%ch4finundatedmapalgo, & - calendar=get_calendar(), & - taxmode='extend' ) - - if (masterproc) then - call shr_strdata_print(sdat,'CLM '//stream_name//' data') - endif - - if( finundation_mtd == finundation_mtd_ZWT_inversion )then - index_ZWT0 = mct_avect_indexra(sdat%avs(1),'ZWT0') - index_F0 = mct_avect_indexra(sdat%avs(1),'F0' ) - index_P3 = mct_avect_indexra(sdat%avs(1),'P3' ) - else if( finundation_mtd == finundation_mtd_TWS_inversion )then - index_FWS_TWS_A = mct_avect_indexra(sdat%avs(1),'FWS_TWS_A') - index_FWS_TWS_B = mct_avect_indexra(sdat%avs(1),'FWS_TWS_B') - end if - - - ! Explicitly set current date to a hardcoded constant value. Otherwise - ! using the real date can cause roundoff differences that are - ! detrected as issues with exact restart. EBK M05/20/2017 - !call get_curr_date(year, mon, day, sec) - year = 1996 - mon = 12 - day = 31 - sec = 0 - mcdate = year*10000 + mon*100 + day - - call shr_strdata_advance(sdat, mcdate, sec, mpicom, 'ch4finundated') - - ! Get the data - ig = 0 - do g = bounds%begg,bounds%endg - ig = ig+1 - if ( index_ZWT0 > 0 )then - this%zwt0_gdc(g) = sdat%avs(1)%rAttr(index_ZWT0,ig) - end if - if ( index_F0 > 0 )then - this%f0_gdc(g) = sdat%avs(1)%rAttr(index_F0,ig) - end if - if ( index_P3 > 0 )then - this%p3_gdc(g) = sdat%avs(1)%rAttr(index_P3,ig) - end if - if ( index_FWS_TWS_A > 0 )then - this%fws_slope_gdc(g) = sdat%avs(1)%rAttr(index_FWS_TWS_A,ig) - end if - if ( index_FWS_TWS_B > 0 )then - this%fws_intercept_gdc(g) = sdat%avs(1)%rAttr(index_FWS_TWS_B,ig) - end if - end do - end if - end if - - end subroutine Init - - !----------------------------------------------------------------------- - logical function UseStreams(this) - ! - ! !DESCRIPTION: - ! Return true if - ! - ! !USES: - ! - ! !ARGUMENTS: - implicit none - class(ch4finundatedstream_type) :: this - ! - ! !LOCAL VARIABLES: - if ( trim(control%stream_fldFileName_ch4finundated) == '' )then - UseStreams = .false. - else - UseStreams = .true. - end if - end function UseStreams - - !----------------------------------------------------------------------- - subroutine InitAllocate(this, bounds) - ! - ! !DESCRIPTION: - ! Allocate module variables and data structures - ! - ! !USES: - use shr_infnan_mod, only: nan => shr_infnan_nan, assignment(=) - use ch4varcon , only: finundation_mtd_ZWT_inversion, finundation_mtd_TWS_inversion - ! - ! !ARGUMENTS: - implicit none - class(ch4finundatedstream_type) :: this - type(bounds_type), intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - integer :: begc, endc - integer :: begg, endg - !--------------------------------------------------------------------- - - begc = bounds%begc; endc = bounds%endc - begg = bounds%begg; endg = bounds%endg - - if( finundation_mtd == finundation_mtd_ZWT_inversion )then - allocate(this%zwt0_gdc (begg:endg)) ; this%zwt0_gdc (:) = nan - allocate(this%f0_gdc (begg:endg)) ; this%f0_gdc (:) = nan - allocate(this%p3_gdc (begg:endg)) ; this%p3_gdc (:) = nan - else if( finundation_mtd == finundation_mtd_TWS_inversion )then - allocate(this%fws_slope_gdc (begg:endg)) ; this%fws_slope_gdc (:) = nan - allocate(this%fws_intercept_gdc(begg:endg)) ; this%fws_intercept_gdc(:) = nan - end if - - end subroutine InitAllocate - - !----------------------------------------------------------------------- - subroutine CalcFinundated(this, bounds, num_soilc, filter_soilc, soilhydrology_inst, & - waterdiagnosticbulk_inst, qflx_surf_lag_col, finundated ) - ! - ! !DESCRIPTION: - ! - ! Calculate finundated according to the appropriate methodology - ! - ! !USES: - use ColumnType , only : col - use ch4varcon , only : finundation_mtd_h2osfc, finundation_mtd_ZWT_inversion - use ch4varcon , only : finundation_mtd_TWS_inversion - use clm_varpar , only : nlevsoi - use SoilHydrologyType, only : soilhydrology_type - use WaterDiagnosticBulkType , only : waterdiagnosticbulk_type - ! - ! !ARGUMENTS: - implicit none - class(ch4finundatedstream_type) :: this - type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_soilc ! number of column soil points in column filter - integer , intent(in) :: filter_soilc(:) ! column filter for soil points - type(soilhydrology_type) , intent(in) :: soilhydrology_inst - type(waterdiagnosticbulk_type) , intent(in) :: waterdiagnosticbulk_inst - real(r8) , intent(in) :: qflx_surf_lag_col(bounds%begc:) !time-lagged surface runoff (mm H2O /s) - real(r8) , intent(inout) :: finundated(bounds%begc:) ! fractional inundated area in soil column (excluding dedicated wetland columns) - ! - ! !LOCAL VARIABLES: - integer :: g, c, fc ! Indices - real(r8) :: zwt_actual ! Total water storage (ZWT) to use either perched or total depending on conditions - - SHR_ASSERT_ALL_FL((ubound(qflx_surf_lag_col) == (/bounds%endc/)), sourcefile, __LINE__) - SHR_ASSERT_ALL_FL((ubound(finundated) == (/bounds%endc/)), sourcefile, __LINE__) - - associate( & - z => col%z , & ! Input: [real(r8) (:,:) ] layer depth (m) (-nlevsno+1:nlevsoi) - zwt => soilhydrology_inst%zwt_col , & ! Input: [real(r8) (:) ] water table depth (m) - zwt_perched => soilhydrology_inst%zwt_perched_col , & ! Input: [real(r8) (:) ] perched water table depth (m) - tws => waterdiagnosticbulk_inst%tws_grc , & ! Input: [real(r8) (:) ] total water storage (kg m-2) - frac_h2osfc => waterdiagnosticbulk_inst%frac_h2osfc_col & ! Input: [real(r8) (:) ] fraction of ground covered by surface water (0 to 1) - ) - - ! Calculate finundated - do fc = 1, num_soilc - c = filter_soilc(fc) - g = col%gridcell(c) - select case( finundation_mtd ) - case ( finundation_mtd_h2osfc ) - finundated(c) = frac_h2osfc(c) - case ( finundation_mtd_ZWT_inversion ) - if (this%zwt0_gdc(g) > 0._r8) then - if (zwt_perched(c) < z(c,nlevsoi)-1.e-5_r8 .and. zwt_perched(c) < zwt(c)) then - zwt_actual = zwt_perched(c) - else - zwt_actual = zwt(c) - end if - finundated(c) = this%f0_gdc(g) * exp(-zwt_actual/this%zwt0_gdc(g)) + this%p3_gdc(g)*qflx_surf_lag_col(c) - else - finundated(c) = this%p3_gdc(g)*qflx_surf_lag_col(c) - end if - case ( finundation_mtd_TWS_inversion ) - finundated(c) = this%fws_slope_gdc(g) * tws(g) + this%fws_intercept_gdc(g) - end select - finundated(c) = min( 1.0_r8, max( 0.0_r8, finundated(c) ) ) - end do - end associate - - end subroutine CalcFinundated - !============================================================================== - - subroutine ReadNML(this, bounds, NLFilename) - ! - ! Read the namelist data stream information. - ! - ! Uses: - use clm_time_manager , only : get_calendar - use ncdio_pio , only : pio_subsystem - use shr_pio_mod , only : shr_pio_getiotype - use shr_nl_mod , only : shr_nl_find_group_name - use shr_log_mod , only : errMsg => shr_log_errMsg - use shr_mpi_mod , only : shr_mpi_bcast - use fileutils , only : getavu, relavu - use ch4varcon , only : finundation_mtd_ZWT_inversion, finundation_mtd_TWS_inversion - ! - ! arguments - implicit none - class(streamcontrol_type) :: this - type(bounds_type), intent(in) :: bounds - character(len=*), intent(in) :: NLFilename ! Namelist filename - ! - ! local variables - integer :: nu_nml ! unit for namelist file - integer :: nml_error ! namelist i/o error flag - character(len=CL) :: stream_fldFileName_ch4finundated = ' ' - character(len=CL) :: ch4finundatedmapalgo = 'bilinear' - character(len=*), parameter :: namelist_name = 'ch4finundated' ! MUST agree with name in namelist and read - character(len=*), parameter :: shr_strdata_unset = 'NOT_SET' - character(len=*), parameter :: subName = "('ch4finundated::ReadNML')" - character(len=*), parameter :: F00 = "('(ch4finundated_readnml) ',4a)" - !----------------------------------------------------------------------- - - namelist /ch4finundated/ & ! MUST agree with namelist_name above - ch4finundatedmapalgo, stream_fldFileName_ch4finundated - - ! Default values for namelist - - ! Read ch4finundated namelist - if (masterproc) then - nu_nml = getavu() - open( nu_nml, file=trim(NLFilename), status='old', iostat=nml_error ) - call shr_nl_find_group_name(nu_nml, namelist_name, status=nml_error) - if (nml_error == 0) then - read(nu_nml, nml=ch4finundated,iostat=nml_error) ! MUST agree with namelist_name above - if (nml_error /= 0) then - call endrun(msg=' ERROR reading '//namelist_name//' namelist'//errMsg(sourcefile, __LINE__)) - end if - else - call endrun(msg=' ERROR finding '//namelist_name//' namelist'//errMsg(sourcefile, __LINE__)) - end if - close(nu_nml) - call relavu( nu_nml ) - endif - - call shr_mpi_bcast(stream_fldFileName_ch4finundated, mpicom) - call shr_mpi_bcast(ch4finundatedmapalgo , mpicom) - - if (masterproc) then - write(iulog,*) ' ' - write(iulog,*) namelist_name, ' stream settings:' - write(iulog,*) ' stream_fldFileName_ch4finundated = ',stream_fldFileName_ch4finundated - write(iulog,*) ' ch4finundatedmapalgo = ',ch4finundatedmapalgo - write(iulog,*) ' ' - endif - this%stream_fldFileName_ch4finundated = stream_fldFileName_ch4finundated - this%ch4finundatedmapalgo = ch4finundatedmapalgo - if ( finundation_mtd == finundation_mtd_ZWT_inversion )then - this%fldList = "ZWT0:F0:P3" - else if ( finundation_mtd == finundation_mtd_TWS_inversion )then - this%fldList = "FWS_TWS_A:FWS_TWS_B" - else - call endrun(msg=' ERROR do NOT know what list of variables to read for this finundation_mtd type'// & - errMsg(sourcefile, __LINE__)) - end if - - end subroutine ReadNML - -end module ch4FInundatedStreamType diff --git a/src/cpl/mct/clm_cpl_indices.F90 b/src/cpl/mct/clm_cpl_indices.F90 deleted file mode 100644 index 09ed89e92d..0000000000 --- a/src/cpl/mct/clm_cpl_indices.F90 +++ /dev/null @@ -1,330 +0,0 @@ -module clm_cpl_indices - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! Module containing the indices for the fields passed between CLM and - ! the driver. Includes the River Transport Model fields (RTM) and the - ! fields needed by the land-ice component (sno). - ! - ! !USES: - - use shr_sys_mod, only : shr_sys_abort - implicit none - - SAVE - private ! By default make data private - ! - ! !PUBLIC MEMBER FUNCTIONS: - public :: clm_cpl_indices_set ! Set the coupler indices - ! - ! !PUBLIC DATA MEMBERS: - ! - integer , public :: glc_nec ! number of elevation classes for glacier_mec landunits - ! (from coupler) - must equal maxpatch_glc from namelist - - ! lnd -> drv (required) - - integer, public ::index_l2x_Flrl_rofsur ! lnd->rtm input liquid surface fluxes - integer, public ::index_l2x_Flrl_rofgwl ! lnd->rtm input liquid gwl fluxes - integer, public ::index_l2x_Flrl_rofsub ! lnd->rtm input liquid subsurface fluxes - integer, public ::index_l2x_Flrl_rofi ! lnd->rtm input frozen fluxes - integer, public ::index_l2x_Flrl_irrig ! irrigation withdrawal - - integer, public ::index_l2x_Sl_t ! temperature - integer, public ::index_l2x_Sl_tref ! 2m reference temperature - integer, public ::index_l2x_Sl_qref ! 2m reference specific humidity - integer, public ::index_l2x_Sl_avsdr ! albedo: direct , visible - integer, public ::index_l2x_Sl_anidr ! albedo: direct , near-ir - integer, public ::index_l2x_Sl_avsdf ! albedo: diffuse, visible - integer, public ::index_l2x_Sl_anidf ! albedo: diffuse, near-ir - integer, public ::index_l2x_Sl_snowh ! snow height - integer, public ::index_l2x_Sl_u10 ! 10m wind - integer, public ::index_l2x_Sl_ddvel ! dry deposition velocities (optional) - integer, public ::index_l2x_Sl_fv ! friction velocity - integer, public ::index_l2x_Sl_ram1 ! aerodynamical resistance - integer, public ::index_l2x_Sl_soilw ! volumetric soil water - integer, public ::index_l2x_Fall_taux ! wind stress, zonal - integer, public ::index_l2x_Fall_tauy ! wind stress, meridional - integer, public ::index_l2x_Fall_lat ! latent heat flux - integer, public ::index_l2x_Fall_sen ! sensible heat flux - integer, public ::index_l2x_Fall_lwup ! upward longwave heat flux - integer, public ::index_l2x_Fall_evap ! evaporation water flux - integer, public ::index_l2x_Fall_swnet ! heat flux shortwave net - integer, public ::index_l2x_Fall_fco2_lnd ! co2 flux **For testing set to 0 - integer, public ::index_l2x_Fall_flxdst1 ! dust flux size bin 1 - integer, public ::index_l2x_Fall_flxdst2 ! dust flux size bin 2 - integer, public ::index_l2x_Fall_flxdst3 ! dust flux size bin 3 - integer, public ::index_l2x_Fall_flxdst4 ! dust flux size bin 4 - integer, public ::index_l2x_Fall_flxvoc ! MEGAN fluxes - integer, public ::index_l2x_Fall_flxfire ! Fire fluxes - integer, public ::index_l2x_Sl_ztopfire ! Top of fire emissions (m) - - ! In the following, index 0 is bare land, other indices are glc elevation classes - integer, allocatable, public ::index_l2x_Sl_tsrf(:) ! glc MEC temperature - integer, allocatable, public ::index_l2x_Sl_topo(:) ! glc MEC topo height - integer, allocatable, public ::index_l2x_Flgl_qice(:) ! glc MEC ice flux - - integer, public ::index_x2l_Sa_methane - integer, public ::index_l2x_Fall_methane - - integer, public :: nflds_l2x = 0 - - ! drv -> lnd (required) - - integer, public ::index_x2l_Sa_z ! bottom atm level height - integer, public ::index_x2l_Sa_topo ! atm surface height (m) - integer, public ::index_x2l_Sa_u ! bottom atm level zon wind - integer, public ::index_x2l_Sa_v ! bottom atm level mer wind - integer, public ::index_x2l_Sa_ptem ! bottom atm level pot temp - integer, public ::index_x2l_Sa_shum ! bottom atm level spec hum - integer, public ::index_x2l_Sa_pbot ! bottom atm level pressure - integer, public ::index_x2l_Sa_tbot ! bottom atm level temp - integer, public ::index_x2l_Faxa_lwdn ! downward lw heat flux - integer, public ::index_x2l_Faxa_rainc ! prec: liquid "convective" - integer, public ::index_x2l_Faxa_rainl ! prec: liquid "large scale" - integer, public ::index_x2l_Faxa_snowc ! prec: frozen "convective" - integer, public ::index_x2l_Faxa_snowl ! prec: frozen "large scale" - integer, public ::index_x2l_Faxa_swndr ! sw: nir direct downward - integer, public ::index_x2l_Faxa_swvdr ! sw: vis direct downward - integer, public ::index_x2l_Faxa_swndf ! sw: nir diffuse downward - integer, public ::index_x2l_Faxa_swvdf ! sw: vis diffuse downward - integer, public ::index_x2l_Sa_co2prog ! bottom atm level prognostic co2 - integer, public ::index_x2l_Sa_co2diag ! bottom atm level diagnostic co2 - integer, public ::index_x2l_Faxa_bcphidry ! flux: Black Carbon hydrophilic dry deposition - integer, public ::index_x2l_Faxa_bcphodry ! flux: Black Carbon hydrophobic dry deposition - integer, public ::index_x2l_Faxa_bcphiwet ! flux: Black Carbon hydrophilic wet deposition - integer, public ::index_x2l_Faxa_ocphidry ! flux: Organic Carbon hydrophilic dry deposition - integer, public ::index_x2l_Faxa_ocphodry ! flux: Organic Carbon hydrophobic dry deposition - integer, public ::index_x2l_Faxa_ocphiwet ! flux: Organic Carbon hydrophilic dry deposition - integer, public ::index_x2l_Faxa_dstwet1 ! flux: Size 1 dust -- wet deposition - integer, public ::index_x2l_Faxa_dstwet2 ! flux: Size 2 dust -- wet deposition - integer, public ::index_x2l_Faxa_dstwet3 ! flux: Size 3 dust -- wet deposition - integer, public ::index_x2l_Faxa_dstwet4 ! flux: Size 4 dust -- wet deposition - integer, public ::index_x2l_Faxa_dstdry1 ! flux: Size 1 dust -- dry deposition - integer, public ::index_x2l_Faxa_dstdry2 ! flux: Size 2 dust -- dry deposition - integer, public ::index_x2l_Faxa_dstdry3 ! flux: Size 3 dust -- dry deposition - integer, public ::index_x2l_Faxa_dstdry4 ! flux: Size 4 dust -- dry deposition - - integer, public ::index_x2l_Faxa_nhx ! flux nhx from atm - integer, public ::index_x2l_Faxa_noy ! flux noy from atm - - integer, public ::index_x2l_Flrr_flood ! rtm->lnd rof flood flux - integer, public ::index_x2l_Flrr_volr ! rtm->lnd rof volr total volume - integer, public ::index_x2l_Flrr_volrmch ! rtm->lnd rof volr main channel volume - - ! In the following, index 0 is bare land, other indices are glc elevation classes - integer, allocatable, public ::index_x2l_Sg_ice_covered(:) ! Fraction of glacier from glc model - integer, allocatable, public ::index_x2l_Sg_topo(:) ! Topo height from glc model - integer, allocatable, public ::index_x2l_Flgg_hflx(:) ! Heat flux from glc model - - integer, public ::index_x2l_Sg_icemask - integer, public ::index_x2l_Sg_icemask_coupled_fluxes - - integer, public :: nflds_x2l = 0 - - !----------------------------------------------------------------------- - -contains - - !----------------------------------------------------------------------- - subroutine clm_cpl_indices_set( ) - ! - ! !DESCRIPTION: - ! Set the coupler indices needed by the land model coupler - ! interface. - ! - ! !USES: - use seq_flds_mod , only: seq_flds_x2l_fields, seq_flds_l2x_fields - use mct_mod , only: mct_aVect, mct_aVect_init, mct_avect_indexra - use mct_mod , only: mct_aVect_clean, mct_avect_nRattr - use shr_drydep_mod , only: drydep_fields_token, n_drydep - use shr_megan_mod , only: shr_megan_fields_token, shr_megan_mechcomps_n - use shr_fire_emis_mod,only: shr_fire_emis_fields_token, shr_fire_emis_ztop_token, shr_fire_emis_mechcomps_n - use clm_varctl , only: ndep_from_cpl - use glc_elevclass_mod, only: glc_get_num_elevation_classes, glc_elevclass_as_string - ! - ! !ARGUMENTS: - implicit none - ! - ! !REVISION HISTORY: - ! Author: Mariana Vertenstein - ! 01/2011, Erik Kluzek: Added protex headers - ! - ! !LOCAL VARIABLES: - type(mct_aVect) :: l2x ! temporary, land to coupler - type(mct_aVect) :: x2l ! temporary, coupler to land - integer :: num - character(len=:), allocatable :: nec_str ! string version of glc elev. class number - character(len=64) :: name - character(len=32) :: subname = 'clm_cpl_indices_set' ! subroutine name - !----------------------------------------------------------------------- - - ! Determine attribute vector indices - - ! create temporary attribute vectors - call mct_aVect_init(x2l, rList=seq_flds_x2l_fields, lsize=1) - nflds_x2l = mct_avect_nRattr(x2l) - - call mct_aVect_init(l2x, rList=seq_flds_l2x_fields, lsize=1) - nflds_l2x = mct_avect_nRattr(l2x) - - !------------------------------------------------------------- - ! clm -> drv - !------------------------------------------------------------- - - index_l2x_Flrl_rofsur = mct_avect_indexra(l2x,'Flrl_rofsur') - index_l2x_Flrl_rofgwl = mct_avect_indexra(l2x,'Flrl_rofgwl') - index_l2x_Flrl_rofsub = mct_avect_indexra(l2x,'Flrl_rofsub') - index_l2x_Flrl_rofi = mct_avect_indexra(l2x,'Flrl_rofi') - index_l2x_Flrl_irrig = mct_avect_indexra(l2x,'Flrl_irrig') - - index_l2x_Sl_t = mct_avect_indexra(l2x,'Sl_t') - index_l2x_Sl_snowh = mct_avect_indexra(l2x,'Sl_snowh') - index_l2x_Sl_avsdr = mct_avect_indexra(l2x,'Sl_avsdr') - index_l2x_Sl_anidr = mct_avect_indexra(l2x,'Sl_anidr') - index_l2x_Sl_avsdf = mct_avect_indexra(l2x,'Sl_avsdf') - index_l2x_Sl_anidf = mct_avect_indexra(l2x,'Sl_anidf') - index_l2x_Sl_tref = mct_avect_indexra(l2x,'Sl_tref') - index_l2x_Sl_qref = mct_avect_indexra(l2x,'Sl_qref') - index_l2x_Sl_u10 = mct_avect_indexra(l2x,'Sl_u10') - index_l2x_Sl_ram1 = mct_avect_indexra(l2x,'Sl_ram1') - index_l2x_Sl_fv = mct_avect_indexra(l2x,'Sl_fv') - index_l2x_Sl_soilw = mct_avect_indexra(l2x,'Sl_soilw',perrwith='quiet') - - if ( n_drydep>0 )then - index_l2x_Sl_ddvel = mct_avect_indexra(l2x, trim(drydep_fields_token)) - else - index_l2x_Sl_ddvel = 0 - end if - - index_l2x_Fall_taux = mct_avect_indexra(l2x,'Fall_taux') - index_l2x_Fall_tauy = mct_avect_indexra(l2x,'Fall_tauy') - index_l2x_Fall_lat = mct_avect_indexra(l2x,'Fall_lat') - index_l2x_Fall_sen = mct_avect_indexra(l2x,'Fall_sen') - index_l2x_Fall_lwup = mct_avect_indexra(l2x,'Fall_lwup') - index_l2x_Fall_evap = mct_avect_indexra(l2x,'Fall_evap') - index_l2x_Fall_swnet = mct_avect_indexra(l2x,'Fall_swnet') - index_l2x_Fall_flxdst1 = mct_avect_indexra(l2x,'Fall_flxdst1') - index_l2x_Fall_flxdst2 = mct_avect_indexra(l2x,'Fall_flxdst2') - index_l2x_Fall_flxdst3 = mct_avect_indexra(l2x,'Fall_flxdst3') - index_l2x_Fall_flxdst4 = mct_avect_indexra(l2x,'Fall_flxdst4') - - index_l2x_Fall_fco2_lnd = mct_avect_indexra(l2x,'Fall_fco2_lnd',perrwith='quiet') - - index_l2x_Fall_methane = mct_avect_indexra(l2x,'Fall_methane',perrWith='quiet') - - ! MEGAN fluxes - if (shr_megan_mechcomps_n>0) then - index_l2x_Fall_flxvoc = mct_avect_indexra(l2x,trim(shr_megan_fields_token)) - else - index_l2x_Fall_flxvoc = 0 - endif - - ! Fire fluxes - if (shr_fire_emis_mechcomps_n>0) then - index_l2x_Fall_flxfire = mct_avect_indexra(l2x,trim(shr_fire_emis_fields_token)) - index_l2x_Sl_ztopfire = mct_avect_indexra(l2x,trim(shr_fire_emis_ztop_token)) - else - index_l2x_Fall_flxfire = 0 - index_l2x_Sl_ztopfire = 0 - endif - - !------------------------------------------------------------- - ! drv -> clm - !------------------------------------------------------------- - - index_x2l_Sa_z = mct_avect_indexra(x2l,'Sa_z') - index_x2l_Sa_topo = mct_avect_indexra(x2l,'Sa_topo') - index_x2l_Sa_u = mct_avect_indexra(x2l,'Sa_u') - index_x2l_Sa_v = mct_avect_indexra(x2l,'Sa_v') - index_x2l_Sa_ptem = mct_avect_indexra(x2l,'Sa_ptem') - index_x2l_Sa_pbot = mct_avect_indexra(x2l,'Sa_pbot') - index_x2l_Sa_tbot = mct_avect_indexra(x2l,'Sa_tbot') - index_x2l_Sa_shum = mct_avect_indexra(x2l,'Sa_shum') - index_x2l_Sa_co2prog = mct_avect_indexra(x2l,'Sa_co2prog',perrwith='quiet') - index_x2l_Sa_co2diag = mct_avect_indexra(x2l,'Sa_co2diag',perrwith='quiet') - - index_x2l_Sa_methane = mct_avect_indexra(x2l,'Sa_methane',perrWith='quiet') - - index_x2l_Flrr_volr = mct_avect_indexra(x2l,'Flrr_volr') - index_x2l_Flrr_volrmch = mct_avect_indexra(x2l,'Flrr_volrmch') - - index_x2l_Faxa_lwdn = mct_avect_indexra(x2l,'Faxa_lwdn') - index_x2l_Faxa_rainc = mct_avect_indexra(x2l,'Faxa_rainc') - index_x2l_Faxa_rainl = mct_avect_indexra(x2l,'Faxa_rainl') - index_x2l_Faxa_snowc = mct_avect_indexra(x2l,'Faxa_snowc') - index_x2l_Faxa_snowl = mct_avect_indexra(x2l,'Faxa_snowl') - index_x2l_Faxa_swndr = mct_avect_indexra(x2l,'Faxa_swndr') - index_x2l_Faxa_swvdr = mct_avect_indexra(x2l,'Faxa_swvdr') - index_x2l_Faxa_swndf = mct_avect_indexra(x2l,'Faxa_swndf') - index_x2l_Faxa_swvdf = mct_avect_indexra(x2l,'Faxa_swvdf') - index_x2l_Faxa_bcphidry = mct_avect_indexra(x2l,'Faxa_bcphidry') - index_x2l_Faxa_bcphodry = mct_avect_indexra(x2l,'Faxa_bcphodry') - index_x2l_Faxa_bcphiwet = mct_avect_indexra(x2l,'Faxa_bcphiwet') - index_x2l_Faxa_ocphidry = mct_avect_indexra(x2l,'Faxa_ocphidry') - index_x2l_Faxa_ocphodry = mct_avect_indexra(x2l,'Faxa_ocphodry') - index_x2l_Faxa_ocphiwet = mct_avect_indexra(x2l,'Faxa_ocphiwet') - index_x2l_Faxa_dstdry1 = mct_avect_indexra(x2l,'Faxa_dstdry1') - index_x2l_Faxa_dstdry2 = mct_avect_indexra(x2l,'Faxa_dstdry2') - index_x2l_Faxa_dstdry3 = mct_avect_indexra(x2l,'Faxa_dstdry3') - index_x2l_Faxa_dstdry4 = mct_avect_indexra(x2l,'Faxa_dstdry4') - index_x2l_Faxa_dstwet1 = mct_avect_indexra(x2l,'Faxa_dstwet1') - index_x2l_Faxa_dstwet2 = mct_avect_indexra(x2l,'Faxa_dstwet2') - index_x2l_Faxa_dstwet3 = mct_avect_indexra(x2l,'Faxa_dstwet3') - index_x2l_Faxa_dstwet4 = mct_avect_indexra(x2l,'Faxa_dstwet4') - - index_x2l_Faxa_nhx = mct_avect_indexra(x2l,'Faxa_nhx', perrWith='quiet') - index_x2l_Faxa_noy = mct_avect_indexra(x2l,'Faxa_noy', perrWith='quiet') - - if (index_x2l_Faxa_nhx > 0 .and. index_x2l_Faxa_noy > 0) then - ndep_from_cpl = .true. - end if - - index_x2l_Flrr_flood = mct_avect_indexra(x2l,'Flrr_flood') - - !------------------------------------------------------------- - ! glc coupling - !------------------------------------------------------------- - - index_x2l_Sg_icemask = mct_avect_indexra(x2l,'Sg_icemask') - index_x2l_Sg_icemask_coupled_fluxes = mct_avect_indexra(x2l,'Sg_icemask_coupled_fluxes') - - glc_nec = glc_get_num_elevation_classes() - if (glc_nec < 1) then - call shr_sys_abort('ERROR: In CLM4.5 and later, glc_nec must be at least 1.') - end if - - ! Create coupling fields for all glc elevation classes (1:glc_nec) plus bare land - ! (index 0). - allocate(index_l2x_Sl_tsrf(0:glc_nec)) - allocate(index_l2x_Sl_topo(0:glc_nec)) - allocate(index_l2x_Flgl_qice(0:glc_nec)) - allocate(index_x2l_Sg_ice_covered(0:glc_nec)) - allocate(index_x2l_Sg_topo(0:glc_nec)) - allocate(index_x2l_Flgg_hflx(0:glc_nec)) - - do num = 0,glc_nec - nec_str = glc_elevclass_as_string(num) - - name = 'Sg_ice_covered' // nec_str - index_x2l_Sg_ice_covered(num) = mct_avect_indexra(x2l,trim(name)) - name = 'Sg_topo' // nec_str - index_x2l_Sg_topo(num) = mct_avect_indexra(x2l,trim(name)) - name = 'Flgg_hflx' // nec_str - index_x2l_Flgg_hflx(num) = mct_avect_indexra(x2l,trim(name)) - - name = 'Sl_tsrf' // nec_str - index_l2x_Sl_tsrf(num) = mct_avect_indexra(l2x,trim(name)) - name = 'Sl_topo' // nec_str - index_l2x_Sl_topo(num) = mct_avect_indexra(l2x,trim(name)) - name = 'Flgl_qice' // nec_str - index_l2x_Flgl_qice(num) = mct_avect_indexra(l2x,trim(name)) - end do - - call mct_aVect_clean(x2l) - call mct_aVect_clean(l2x) - - end subroutine clm_cpl_indices_set - -!======================================================================= - -end module clm_cpl_indices diff --git a/src/cpl/mct/laiStreamMod.F90 b/src/cpl/mct/laiStreamMod.F90 deleted file mode 100644 index 47d25287b7..0000000000 --- a/src/cpl/mct/laiStreamMod.F90 +++ /dev/null @@ -1,241 +0,0 @@ -module laiStreamMod - -#include "shr_assert.h" - - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! Read LAI from stream - ! - ! !USES: - use shr_strdata_mod , only : shr_strdata_type, shr_strdata_create - use shr_strdata_mod , only : shr_strdata_print, shr_strdata_advance - use shr_kind_mod , only : r8=>shr_kind_r8, CL=>shr_kind_CL, CS=>shr_kind_CS, CXX=>shr_kind_CXX - use shr_log_mod , only : errMsg => shr_log_errMsg - use decompMod , only : bounds_type - use abortutils , only : endrun - use clm_varctl , only : iulog, inst_name - use perf_mod , only : t_startf, t_stopf - use spmdMod , only : masterproc, mpicom, comp_id - use ncdio_pio - use mct_mod - ! - ! !PUBLIC TYPES: - implicit none - private - - ! !PUBLIC MEMBER FUNCTIONS: - public :: lai_init ! position datasets for LAI - public :: lai_advance ! Advance the LAI streams (outside of a Open-MP threading loop) - public :: lai_interp ! interpolates between two years of LAI data (when LAI streams - - ! !PRIVATE MEMBER DATA: - integer, allocatable :: g_to_ig(:) ! Array matching gridcell index to data index - type(shr_strdata_type) :: sdat_lai ! LAI input data stream - - character(len=*), parameter :: sourcefile = & - __FILE__ - -!============================================================================== -contains -!============================================================================== - - subroutine lai_init(bounds) - ! - ! Initialize data stream information for LAI. - ! - ! !USES: - use clm_time_manager , only : get_calendar - use ncdio_pio , only : pio_subsystem - use shr_pio_mod , only : shr_pio_getiotype - use shr_stream_mod , only : shr_stream_file_null - use shr_string_mod , only : shr_string_listCreateField - use clm_nlUtilsMod , only : find_nlgroup_name - use ndepStreamMod , only : clm_domain_mct - use histFileMod , only : hist_addfld1d - use domainMod , only : ldomain - use controlMod , only : NLFilename - use lnd_set_decomp_and_domain , only : gsmap_global - ! - ! !ARGUMENTS: - implicit none - type(bounds_type), intent(in) :: bounds ! bounds - ! - ! !LOCAL VARIABLES: - integer :: stream_year_first_lai ! first year in Lai stream to use - integer :: stream_year_last_lai ! last year in Lai stream to use - integer :: model_year_align_lai ! align stream_year_first_lai with - integer :: nu_nml ! unit for namelist file - integer :: nml_error ! namelist i/o error flag - type(mct_ggrid) :: dom_clm ! domain information - character(len=CL) :: stream_fldFileName_lai ! lai stream filename to read - character(len=CL) :: lai_mapalgo = 'bilinear' ! Mapping alogrithm - character(len=CL) :: lai_tintalgo = 'linear' ! Time interpolation alogrithm - character(len=CXX) :: fldList ! field string - character(*), parameter :: laiString = "LAI" ! base string for field string - integer , parameter :: numLaiFields = 16 ! number of fields to build field string - character(*), parameter :: subName = "('laidyn_init')" - !----------------------------------------------------------------------- - ! - ! deal with namelist variables here in init - ! - namelist /lai_streams/ & - stream_year_first_lai, & - stream_year_last_lai, & - model_year_align_lai, & - lai_mapalgo, & - stream_fldFileName_lai, & - lai_tintalgo - - ! Default values for namelist - stream_year_first_lai = 1 ! first year in stream to use - stream_year_last_lai = 1 ! last year in stream to use - model_year_align_lai = 1 ! align stream_year_first_lai with this model year - stream_fldFileName_lai = shr_stream_file_null - - ! Read lai_streams namelist - if (masterproc) then - open( newunit=nu_nml, file=trim(NLFilename), status='old', iostat=nml_error ) - call find_nlgroup_name(nu_nml, 'lai_streams', status=nml_error) - if (nml_error == 0) then - read(nu_nml, nml=lai_streams,iostat=nml_error) - if (nml_error /= 0) then - call endrun(subname // ':: ERROR reading lai_streams namelist') - end if - else - call endrun(subname // ':: ERROR finding lai_streams namelist') - end if - close(nu_nml) - endif - call shr_mpi_bcast(stream_year_first_lai , mpicom) - call shr_mpi_bcast(stream_year_last_lai , mpicom) - call shr_mpi_bcast(model_year_align_lai , mpicom) - call shr_mpi_bcast(stream_fldFileName_lai , mpicom) - call shr_mpi_bcast(lai_tintalgo , mpicom) - - if (masterproc) then - write(iulog,*) ' ' - write(iulog,*) 'lai_stream settings:' - write(iulog,*) ' stream_year_first_lai = ',stream_year_first_lai - write(iulog,*) ' stream_year_last_lai = ',stream_year_last_lai - write(iulog,*) ' model_year_align_lai = ',model_year_align_lai - write(iulog,*) ' stream_fldFileName_lai = ',trim(stream_fldFileName_lai) - write(iulog,*) ' lai_tintalgo = ',trim(lai_tintalgo) - endif - - call clm_domain_mct (bounds, dom_clm) - - ! create the field list for these lai fields...use in shr_strdata_create - fldList = shr_string_listCreateField( numLaiFields, laiString ) - - call shr_strdata_create(sdat_lai,name="laidyn", & - pio_subsystem=pio_subsystem, & - pio_iotype=shr_pio_getiotype(inst_name), & - mpicom=mpicom, compid=comp_id, & - gsmap=gsmap_global, ggrid=dom_clm, & - nxg=ldomain%ni, nyg=ldomain%nj, & - yearFirst=stream_year_first_lai, & - yearLast=stream_year_last_lai, & - yearAlign=model_year_align_lai, & - offset=0, & - domFilePath='', & - domFileName=trim(stream_fldFileName_lai), & - domTvarName='time', & - domXvarName='lon' , & - domYvarName='lat' , & - domAreaName='area', & - domMaskName='mask', & - filePath='', & - filename=(/stream_fldFileName_lai/), & - fldListFile=fldList, & - fldListModel=fldList, & - fillalgo='none', & - mapalgo=lai_mapalgo, & - tintalgo=lai_tintalgo, & - calendar=get_calendar(), & - taxmode='cycle' ) - - if (masterproc) then - call shr_strdata_print(sdat_lai,'LAI data') - endif - - end subroutine lai_init - - !============================================================================== - subroutine lai_advance( bounds ) - ! - ! Advance LAI streams - ! - ! !USES: - use clm_time_manager, only : get_curr_date - ! - ! !ARGUMENTS: - implicit none - type(bounds_type) , intent(in) :: bounds - ! - ! !LOCAL VARIABLES: - integer :: g, ig ! Indices - 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) - !----------------------------------------------------------------------- - - call get_curr_date(year, mon, day, sec) - mcdate = year*10000 + mon*100 + day - - call shr_strdata_advance(sdat_lai, mcdate, sec, mpicom, 'laidyn') - if ( .not. allocated(g_to_ig) )then - allocate (g_to_ig(bounds%begg:bounds%endg) ) - ig = 0 - do g = bounds%begg,bounds%endg - ig = ig+1 - g_to_ig(g) = ig - end do - end if - - end subroutine lai_advance - - !============================================================================== - subroutine lai_interp(bounds, canopystate_inst) - ! - ! Interpolate data stream information for Lai. - ! - ! !USES: - use pftconMod , only : noveg - use CanopyStateType , only : canopystate_type - use PatchType , only : patch - ! - ! !ARGUMENTS: - implicit none - type(bounds_type) , intent(in) :: bounds - type(canopystate_type) , intent(inout) :: canopystate_inst - ! - ! !LOCAL VARIABLES: - integer :: ivt, p, ip, ig - character(len=CL) :: stream_var_name - !----------------------------------------------------------------------- - SHR_ASSERT_FL( (lbound(g_to_ig,1) <= bounds%begg ), sourcefile, __LINE__) - SHR_ASSERT_FL( (ubound(g_to_ig,1) >= bounds%endg ), sourcefile, __LINE__) - SHR_ASSERT_FL( (lbound(sdat_lai%avs(1)%rAttr,2) <= g_to_ig(bounds%begg) ), sourcefile, __LINE__) - SHR_ASSERT_FL( (ubound(sdat_lai%avs(1)%rAttr,2) >= g_to_ig(bounds%endg) ), sourcefile, __LINE__) - - do p = bounds%begp, bounds%endp - ivt = patch%itype(p) - ! Set lai for each gridcell/patch combination - if (ivt /= noveg) then - ! vegetated pft - write(stream_var_name,"(i6)") ivt - stream_var_name = 'LAI_'//trim(adjustl(stream_var_name)) - ip = mct_aVect_indexRA(sdat_lai%avs(1),trim(stream_var_name)) - ig = g_to_ig(patch%gridcell(p)) - canopystate_inst%tlai_patch(p) = sdat_lai%avs(1)%rAttr(ip,ig) - else - ! non-vegetated pft - canopystate_inst%tlai_patch(p) = 0._r8 - endif - end do - - end subroutine lai_interp - -end module LaiStreamMod diff --git a/src/cpl/mct/lnd_comp_mct.F90 b/src/cpl/mct/lnd_comp_mct.F90 deleted file mode 100644 index e50602a378..0000000000 --- a/src/cpl/mct/lnd_comp_mct.F90 +++ /dev/null @@ -1,632 +0,0 @@ -module lnd_comp_mct - - !--------------------------------------------------------------------------- - ! !DESCRIPTION: - ! Interface of the active land model component of CESM the CLM (Community Land Model) - ! with the main CESM driver. This is a thin interface taking CESM driver information - ! in MCT (Model Coupling Toolkit) format and converting it to use by CLM. - ! - ! !uses: - use shr_kind_mod , only : r8 => shr_kind_r8 - use shr_sys_mod , only : shr_sys_flush - use shr_log_mod , only : errMsg => shr_log_errMsg - use mct_mod , only : mct_avect, mct_gsmap, mct_gGrid - use decompmod , only : bounds_type - use lnd_import_export, only : lnd_import, lnd_export - ! - ! !public member functions: - implicit none - private ! by default make data private - ! - ! !public member functions: - public :: lnd_init_mct ! clm initialization - public :: lnd_run_mct ! clm run phase - public :: lnd_final_mct ! clm finalization/cleanup - ! - ! !private member functions: - private :: lnd_domain_mct ! set the land model domain information - private :: lnd_handle_resume ! handle pause/resume signals from the coupler - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - -!==================================================================================== -contains -!==================================================================================== - - subroutine lnd_init_mct( EClock, cdata_l, x2l_l, l2x_l, NLFilename ) - ! - ! !DESCRIPTION: - ! Initialize land surface model and obtain relevant atmospheric model arrays - ! back from (i.e. albedos, surface temperature and snow cover over land). - ! - ! !USES: - use shr_kind_mod , only : shr_kind_cl - use abortutils , only : endrun - use clm_time_manager , only : get_nstep, set_timemgr_init - use clm_initializeMod, only : initialize1, initialize2 - use clm_instMod , only : water_inst, lnd2atm_inst, lnd2glc_inst - use clm_varctl , only : finidat, single_column, clm_varctl_set, iulog - use clm_varctl , only : inst_index, inst_suffix, inst_name - use clm_varorb , only : eccen, obliqr, lambm0, mvelpp - use controlMod , only : control_setNL - use decompMod , only : get_proc_bounds - use domainMod , only : ldomain - use shr_file_mod , only : shr_file_setLogUnit, shr_file_setLogLevel - use shr_file_mod , only : shr_file_getLogUnit, shr_file_getLogLevel - use shr_file_mod , only : shr_file_getUnit, shr_file_setIO - use seq_cdata_mod , only : seq_cdata, seq_cdata_setptrs - use seq_timemgr_mod , only : seq_timemgr_EClockGetData - use seq_infodata_mod , only : seq_infodata_type, seq_infodata_GetData, seq_infodata_PutData, & - seq_infodata_start_type_start, seq_infodata_start_type_cont, & - seq_infodata_start_type_brnch - use seq_comm_mct , only : seq_comm_suffix, seq_comm_inst, seq_comm_name - use seq_flds_mod , only : seq_flds_x2l_fields, seq_flds_l2x_fields - use spmdMod , only : masterproc, spmd_init - use clm_varctl , only : nsrStartup, nsrContinue, nsrBranch - use clm_cpl_indices , only : clm_cpl_indices_set - use mct_mod , only : mct_aVect_init, mct_aVect_zero, mct_gsMap, mct_gsMap_init - use decompMod , only : gindex_global - use lnd_set_decomp_and_domain, only : lnd_set_decomp_and_domain_from_surfrd, gsmap_global - use ESMF - ! - ! !ARGUMENTS: - type(ESMF_Clock), intent(inout) :: EClock ! Input synchronization clock - type(seq_cdata), intent(inout) :: cdata_l ! Input land-model driver data - type(mct_aVect), intent(inout) :: x2l_l, l2x_l ! land model import and export states - character(len=*), optional, intent(in) :: NLFilename ! Namelist filename to read - ! - ! !LOCAL VARIABLES: - integer :: LNDID ! Land identifyer - integer :: mpicom_lnd ! MPI communicator - type(mct_gsMap), pointer :: GSMap_lnd ! Land model MCT GS map - type(mct_gGrid), pointer :: dom_l ! Land model domain - type(seq_infodata_type), pointer :: infodata ! CESM driver level info data - integer :: lsize ! size of attribute vector - integer :: gsize ! global size - integer :: g,i,j ! indices - integer :: dtime_sync ! coupling time-step from the input synchronization clock - logical :: exists ! true if file exists - logical :: atm_aero ! Flag if aerosol data sent from atm model - real(r8) :: scmlat ! single-column latitude - real(r8) :: scmlon ! single-column longitude - character(len=SHR_KIND_CL) :: caseid ! case identifier name - character(len=SHR_KIND_CL) :: ctitle ! case description title - character(len=SHR_KIND_CL) :: starttype ! start-type (startup, continue, branch, hybrid) - character(len=SHR_KIND_CL) :: calendar ! calendar type name - character(len=SHR_KIND_CL) :: hostname ! hostname of machine running on - character(len=SHR_KIND_CL) :: version ! Model version - character(len=SHR_KIND_CL) :: username ! user running the model - integer :: nsrest ! clm restart type - integer :: ref_ymd ! reference date (YYYYMMDD) - integer :: ref_tod ! reference time of day (sec) - integer :: start_ymd ! start date (YYYYMMDD) - integer :: start_tod ! start time of day (sec) - logical :: brnch_retain_casename ! flag if should retain the case name on a branch start type - integer :: lbnum ! input to memory diagnostic - integer :: shrlogunit,shrloglev ! old values for log unit and log level - type(bounds_type) :: bounds ! bounds - logical :: noland - integer :: ni,nj - real(r8) , parameter :: rundef = -9999999._r8 - character(len=32), parameter :: sub = 'lnd_init_mct' - character(len=*), parameter :: format = "('("//trim(sub)//") :',A)" - !----------------------------------------------------------------------- - - ! Set cdata data - call seq_cdata_setptrs(cdata_l, ID=LNDID, mpicom=mpicom_lnd, & - gsMap=GSMap_lnd, dom=dom_l, infodata=infodata) - - ! Determine attriute vector indices - call clm_cpl_indices_set() - - ! Initialize clm MPI communicator - call spmd_init( mpicom_lnd, LNDID ) - -#if (defined _MEMTRACE) - if(masterproc) then - lbnum=1 - call memmon_dump_fort('memmon.out','lnd_init_mct:start::',lbnum) - endif -#endif - - inst_name = seq_comm_name(LNDID) - inst_index = seq_comm_inst(LNDID) - inst_suffix = seq_comm_suffix(LNDID) - ! Initialize io log unit - - call shr_file_getLogUnit (shrlogunit) - if (masterproc) then - inquire(file='lnd_modelio.nml'//trim(inst_suffix),exist=exists) - if (exists) then - iulog = shr_file_getUnit() - call shr_file_setIO('lnd_modelio.nml'//trim(inst_suffix),iulog) - end if - write(iulog,format) "CLM land model initialization" - else - iulog = shrlogunit - end if - - call shr_file_getLogLevel(shrloglev) - call shr_file_setLogUnit (iulog) - - ! Use infodata to set orbital values - call seq_infodata_GetData( infodata, orb_eccen=eccen, orb_mvelpp=mvelpp, & - orb_lambm0=lambm0, orb_obliqr=obliqr ) - - ! Consistency check on namelist filename - call control_setNL("lnd_in"//trim(inst_suffix)) - - ! Initialize clm - ! initialize1 reads namelists - ! decomp and domain are set in lnd_set_decomp_and_domain_from_surfrd - ! initialize2 performs the rest of initialization - call seq_timemgr_EClockGetData(EClock, & - start_ymd=start_ymd, & - start_tod=start_tod, ref_ymd=ref_ymd, & - ref_tod=ref_tod, & - calendar=calendar, & - dtime=dtime_sync) - if (masterproc) then - write(iulog,*)'dtime = ',dtime_sync - end if - call seq_infodata_GetData(infodata, case_name=caseid, & - case_desc=ctitle, single_column=single_column, & - scmlat=scmlat, scmlon=scmlon, & - brnch_retain_casename=brnch_retain_casename, & - start_type=starttype, model_version=version, & - hostname=hostname, username=username ) - - ! Single Column - if ( single_column .and. (scmlat == rundef .or. scmlon == rundef ) ) then - call endrun(msg=' ERROR:: single column mode on -- but scmlat and scmlon are NOT set'//& - errMsg(sourcefile, __LINE__)) - end if - - ! Note that we assume that CTSM's internal dtime matches the coupling time step. - ! i.e., we currently do NOT allow sub-cycling within a coupling time step. - call set_timemgr_init( calendar_in=calendar, start_ymd_in=start_ymd, start_tod_in=start_tod, & - ref_ymd_in=ref_ymd, ref_tod_in=ref_tod, dtime_in=dtime_sync) - - if ( trim(starttype) == trim(seq_infodata_start_type_start)) then - nsrest = nsrStartup - else if (trim(starttype) == trim(seq_infodata_start_type_cont) ) then - nsrest = nsrContinue - else if (trim(starttype) == trim(seq_infodata_start_type_brnch)) then - nsrest = nsrBranch - else - call endrun( sub//' ERROR: unknown starttype' ) - end if - - ! set default values for run control variables - call clm_varctl_set(caseid_in=caseid, ctitle_in=ctitle, & - brnch_retain_casename_in=brnch_retain_casename, & - single_column_in=single_column, scmlat_in=scmlat, & - scmlon_in=scmlon, nsrest_in=nsrest, version_in=version, & - hostname_in=hostname, username_in=username) - - ! Read namelists - call initialize1(dtime=dtime_sync) - - ! Initialize decomposition and domain (ldomain) type - call lnd_set_decomp_and_domain_from_surfrd(noland, ni, nj) - - ! If no land then exit out of initialization - if ( noland ) then - - call seq_infodata_PutData( infodata, lnd_present =.false.) - call seq_infodata_PutData( infodata, lnd_prognostic=.false.) - - else - - ! Determine if aerosol and dust deposition come from atmosphere component - call seq_infodata_GetData(infodata, atm_aero=atm_aero ) - if ( .not. atm_aero )then - call endrun( sub//' ERROR: atmosphere model MUST send aerosols to CLM' ) - end if - - ! Initialize clm gsMap, clm domain and clm attribute vectors - call get_proc_bounds( bounds ) - lsize = bounds%endg - bounds%begg + 1 - gsize = ldomain%ni * ldomain%nj - call mct_gsMap_init( gsMap_lnd, gindex_global, mpicom_lnd, LNDID, lsize, gsize ) - gsmap_global => gsmap_lnd ! module variable in lnd_set_decomp_and_domain - call lnd_domain_mct( bounds, lsize, gsMap_lnd, dom_l ) - call mct_aVect_init(x2l_l, rList=seq_flds_x2l_fields, lsize=lsize) - call mct_aVect_zero(x2l_l) - call mct_aVect_init(l2x_l, rList=seq_flds_l2x_fields, lsize=lsize) - call mct_aVect_zero(l2x_l) - - ! Finish initializing clm - call initialize2(ni,nj) - - ! Create land export state - call lnd_export(bounds, water_inst%waterlnd2atmbulk_inst, lnd2atm_inst, lnd2glc_inst, l2x_l%rattr) - - ! Fill in infodata settings - call seq_infodata_PutData(infodata, lnd_prognostic=.true.) - call seq_infodata_PutData(infodata, lnd_nx=ldomain%ni, lnd_ny=ldomain%nj) - call lnd_handle_resume( cdata_l ) - - ! Reset shr logging to original values - call shr_file_setLogUnit (shrlogunit) - call shr_file_setLogLevel(shrloglev) - -#if (defined _MEMTRACE) - if(masterproc) then - write(iulog,*) TRIM(Sub) // ':end::' - lbnum=1 - call memmon_dump_fort('memmon.out','lnd_int_mct:end::',lbnum) - call memmon_reset_addr() - endif -#endif - end if - - end subroutine lnd_init_mct - - !==================================================================================== - subroutine lnd_run_mct(EClock, cdata_l, x2l_l, l2x_l) - ! - ! !DESCRIPTION: - ! Run clm model - ! - ! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use clm_instMod , only : water_inst, lnd2atm_inst, atm2lnd_inst, lnd2glc_inst, glc2lnd_inst - use clm_driver , only : clm_drv - use clm_time_manager, only : get_curr_date, get_nstep, get_curr_calday, get_step_size - use clm_time_manager, only : advance_timestep, update_rad_dtime - use decompMod , only : get_proc_bounds - use abortutils , only : endrun - use clm_varctl , only : iulog - use clm_varorb , only : eccen, obliqr, lambm0, mvelpp - use shr_file_mod , only : shr_file_setLogUnit, shr_file_setLogLevel - use shr_file_mod , only : shr_file_getLogUnit, shr_file_getLogLevel - use seq_cdata_mod , only : seq_cdata, seq_cdata_setptrs - use seq_timemgr_mod , only : seq_timemgr_EClockGetData, seq_timemgr_StopAlarmIsOn - use seq_timemgr_mod , only : seq_timemgr_RestartAlarmIsOn, seq_timemgr_EClockDateInSync - use seq_infodata_mod, only : seq_infodata_type, seq_infodata_GetData - use spmdMod , only : masterproc, mpicom - use perf_mod , only : t_startf, t_stopf, t_barrierf - use shr_orb_mod , only : shr_orb_decl - use ESMF - ! - ! !ARGUMENTS: - type(ESMF_Clock) , intent(inout) :: EClock ! Input synchronization clock from driver - type(seq_cdata) , intent(inout) :: cdata_l ! Input driver data for land model - type(mct_aVect) , intent(inout) :: x2l_l ! Import state to land model - type(mct_aVect) , intent(inout) :: l2x_l ! Export state from land model - ! - ! !LOCAL VARIABLES: - integer :: ymd_sync ! Sync date (YYYYMMDD) - integer :: yr_sync ! Sync current year - integer :: mon_sync ! Sync current month - integer :: day_sync ! Sync current day - integer :: tod_sync ! Sync current time of day (sec) - integer :: ymd ! CLM current date (YYYYMMDD) - integer :: yr ! CLM current year - integer :: mon ! CLM current month - integer :: day ! CLM current day - integer :: tod ! CLM current time of day (sec) - integer :: dtime ! time step increment (sec) - integer :: nstep ! time step index - logical :: rstwr_sync ! .true. ==> write restart file before returning - logical :: rstwr ! .true. ==> write restart file before returning - logical :: nlend_sync ! Flag signaling last time-step - logical :: nlend ! .true. ==> last time-step - logical :: dosend ! true => send data back to driver - logical :: doalb ! .true. ==> do albedo calculation on this time step - logical :: rof_prognostic ! .true. => running with a prognostic ROF model - logical :: glc_present ! .true. => running with a non-stub GLC model - real(r8) :: nextsw_cday ! calday from clock of next radiation computation - real(r8) :: caldayp1 ! clm calday plus dtime offset - integer :: shrlogunit,shrloglev ! old values for share log unit and log level - integer :: lbnum ! input to memory diagnostic - integer :: g,i,lsize ! counters - real(r8) :: calday ! calendar day for nstep - real(r8) :: declin ! solar declination angle in radians for nstep - real(r8) :: declinp1 ! solar declination angle in radians for nstep+1 - real(r8) :: eccf ! earth orbit eccentricity factor - real(r8) :: recip ! reciprical - logical,save :: first_call = .true. ! first call work - type(seq_infodata_type),pointer :: infodata ! CESM information from the driver - type(mct_gGrid), pointer :: dom_l ! Land model domain data - type(bounds_type) :: bounds ! bounds - character(len=32) :: rdate ! date char string for restart file names - character(len=32), parameter :: sub = "lnd_run_mct" - !--------------------------------------------------------------------------- - - ! Determine processor bounds - - call get_proc_bounds(bounds) - -#if (defined _MEMTRACE) - if(masterproc) then - lbnum=1 - call memmon_dump_fort('memmon.out','lnd_run_mct:start::',lbnum) - endif -#endif - - ! Reset shr logging to my log file - call shr_file_getLogUnit (shrlogunit) - call shr_file_getLogLevel(shrloglev) - call shr_file_setLogUnit (iulog) - - ! Determine time of next atmospheric shortwave calculation - call seq_cdata_setptrs(cdata_l, infodata=infodata, dom=dom_l) - call seq_timemgr_EClockGetData(EClock, & - curr_ymd=ymd, curr_tod=tod_sync, & - curr_yr=yr_sync, curr_mon=mon_sync, curr_day=day_sync) - call seq_infodata_GetData(infodata, nextsw_cday=nextsw_cday ) - - dtime = get_step_size() - - ! Handle pause/resume signals from coupler - call lnd_handle_resume( cdata_l ) - - write(rdate,'(i4.4,"-",i2.2,"-",i2.2,"-",i5.5)') yr_sync,mon_sync,day_sync,tod_sync - nlend_sync = seq_timemgr_StopAlarmIsOn( EClock ) - rstwr_sync = seq_timemgr_RestartAlarmIsOn( EClock ) - - ! Determine if we're running with a prognostic ROF model, and if we're running with a - ! non-stub GLC model. These won't change throughout the run, but we can't count on - ! their being set in initialization, so need to get them in the run method. - - call seq_infodata_GetData( infodata, & - rof_prognostic=rof_prognostic, & - glc_present=glc_present) - - ! Map MCT to land data type - ! Perform downscaling if appropriate - - - ! Map to clm (only when state and/or fluxes need to be updated) - - call t_startf ('lc_lnd_import') - call lnd_import( bounds, & - x2l = x2l_l%rattr, & - glc_present = glc_present, & - atm2lnd_inst = atm2lnd_inst, & - glc2lnd_inst = glc2lnd_inst, & - wateratm2lndbulk_inst = water_inst%wateratm2lndbulk_inst) - call t_stopf ('lc_lnd_import') - - ! Use infodata to set orbital values if updated mid-run - - call seq_infodata_GetData( infodata, orb_eccen=eccen, orb_mvelpp=mvelpp, & - orb_lambm0=lambm0, orb_obliqr=obliqr ) - - ! Loop over time steps in coupling interval - - dosend = .false. - do while(.not. dosend) - - ! Determine if dosend - ! When time is not updated at the beginning of the loop - then return only if - ! are in sync with clock before time is updated - ! - ! NOTE(wjs, 2020-03-09) I think the do while (.not. dosend) loop only is important - ! for the first time step (when we run 2 steps). After that, we now assume that we - ! run one time step per coupling interval (based on setting the model's dtime from - ! the driver). (According to Mariana Vertenstein, sub-cycling (running multiple - ! land model time steps per coupling interval) used to be supported, but hasn't - ! been fully supported for a long time.) We may want to rework this logic to make - ! this more explicit, or - ideally - get rid of this extra time step at the start - ! of the run, at which point I think we could do away with this looping entirely. - - call get_curr_date( yr, mon, day, tod ) - ymd = yr*10000 + mon*100 + day - tod = tod - dosend = (seq_timemgr_EClockDateInSync( EClock, ymd, tod)) - - ! Determine doalb based on nextsw_cday sent from atm model - - nstep = get_nstep() - caldayp1 = get_curr_calday(offset=dtime, reuse_day_365_for_day_366=.true.) - if (nstep == 0) then - doalb = .false. - else if (nstep == 1) then - doalb = (abs(nextsw_cday- caldayp1) < 1.e-10_r8) - else - doalb = (nextsw_cday >= -0.5_r8) - end if - call update_rad_dtime(doalb) - - ! Determine if time to write restart and stop - - rstwr = .false. - if (rstwr_sync .and. dosend) rstwr = .true. - nlend = .false. - if (nlend_sync .and. dosend) nlend = .true. - - ! Run clm - - call t_barrierf('sync_clm_run1', mpicom) - call t_startf ('clm_run') - call t_startf ('shr_orb_decl') - calday = get_curr_calday(reuse_day_365_for_day_366=.true.) - call shr_orb_decl( calday , eccen, mvelpp, lambm0, obliqr, declin , eccf ) - call shr_orb_decl( nextsw_cday, eccen, mvelpp, lambm0, obliqr, declinp1, eccf ) - call t_stopf ('shr_orb_decl') - call clm_drv(doalb, nextsw_cday, declinp1, declin, rstwr, nlend, rdate, rof_prognostic) - call t_stopf ('clm_run') - - ! Create l2x_l export state - add river runoff input to l2x_l if appropriate - - call t_startf ('lc_lnd_export') - call lnd_export(bounds, water_inst%waterlnd2atmbulk_inst, lnd2atm_inst, lnd2glc_inst, l2x_l%rattr) - call t_stopf ('lc_lnd_export') - - ! Advance clm time step - - call t_startf ('lc_clm2_adv_timestep') - call advance_timestep() - call t_stopf ('lc_clm2_adv_timestep') - - end do - - ! Check that internal clock is in sync with master clock - - call get_curr_date( yr, mon, day, tod, offset=-dtime ) - ymd = yr*10000 + mon*100 + day - tod = tod - if ( .not. seq_timemgr_EClockDateInSync( EClock, ymd, tod ) )then - call seq_timemgr_EclockGetData( EClock, curr_ymd=ymd_sync, curr_tod=tod_sync ) - write(iulog,*)' clm ymd=',ymd ,' clm tod= ',tod - write(iulog,*)'sync ymd=',ymd_sync,' sync tod= ',tod_sync - call endrun( sub//":: CLM clock not in sync with Master Sync clock" ) - end if - - ! Reset shr logging to my original values - - call shr_file_setLogUnit (shrlogunit) - call shr_file_setLogLevel(shrloglev) - -#if (defined _MEMTRACE) - if(masterproc) then - lbnum=1 - call memmon_dump_fort('memmon.out','lnd_run_mct:end::',lbnum) - call memmon_reset_addr() - endif -#endif - - first_call = .false. - - end subroutine lnd_run_mct - - !==================================================================================== - subroutine lnd_final_mct( EClock, cdata_l, x2l_l, l2x_l) - ! - ! !DESCRIPTION: - ! Finalize land surface model - - use seq_cdata_mod ,only : seq_cdata, seq_cdata_setptrs - use seq_timemgr_mod ,only : seq_timemgr_EClockGetData, seq_timemgr_StopAlarmIsOn - use seq_timemgr_mod ,only : seq_timemgr_RestartAlarmIsOn, seq_timemgr_EClockDateInSync - use esmf - ! - ! !ARGUMENTS: - type(ESMF_Clock) , intent(inout) :: EClock ! Input synchronization clock from driver - type(seq_cdata) , intent(inout) :: cdata_l ! Input driver data for land model - type(mct_aVect) , intent(inout) :: x2l_l ! Import state to land model - type(mct_aVect) , intent(inout) :: l2x_l ! Export state from land model - !--------------------------------------------------------------------------- - - ! fill this in - end subroutine lnd_final_mct - - !==================================================================================== - subroutine lnd_domain_mct( bounds, lsize, gsMap_l, dom_l ) - ! - ! !DESCRIPTION: - ! Send the land model domain information to the coupler - ! - ! !USES: - use clm_varcon , only: re - use domainMod , only: ldomain - use spmdMod , only: iam - use mct_mod , only: mct_gGrid_importIAttr - use mct_mod , only: mct_gGrid_importRAttr, mct_gGrid_init, mct_gsMap_orderedPoints - use seq_flds_mod, only: seq_flds_dom_coord, seq_flds_dom_other - ! - ! !ARGUMENTS: - type(bounds_type), intent(in) :: bounds ! bounds - integer , intent(in) :: lsize ! land model domain data size - type(mct_gsMap), intent(inout) :: gsMap_l ! Output land model MCT GS map - type(mct_ggrid), intent(out) :: dom_l ! Output domain information for land model - ! - ! Local Variables - integer :: g,i,j ! index - real(r8), pointer :: data(:) ! temporary - integer , pointer :: idata(:) ! temporary - !--------------------------------------------------------------------------- - ! - ! Initialize mct domain type - ! lat/lon in degrees, area in radians^2, mask is 1 (land), 0 (non-land) - ! Note that in addition land carries around landfrac for the purposes of domain checking - ! - call mct_gGrid_init( GGrid=dom_l, CoordChars=trim(seq_flds_dom_coord), & - OtherChars=trim(seq_flds_dom_other), lsize=lsize ) - ! - ! Allocate memory - ! - allocate(data(lsize)) - ! - ! Determine global gridpoint number attribute, GlobGridNum, which is set automatically by MCT - ! - call mct_gsMap_orderedPoints(gsMap_l, iam, idata) - call mct_gGrid_importIAttr(dom_l,'GlobGridNum',idata,lsize) - ! - ! Determine domain (numbering scheme is: West to East and South to North to South pole) - ! Initialize attribute vector with special value - ! - data(:) = -9999.0_R8 - call mct_gGrid_importRAttr(dom_l,"lat" ,data,lsize) - call mct_gGrid_importRAttr(dom_l,"lon" ,data,lsize) - call mct_gGrid_importRAttr(dom_l,"area" ,data,lsize) - call mct_gGrid_importRAttr(dom_l,"aream",data,lsize) - data(:) = 0.0_R8 - call mct_gGrid_importRAttr(dom_l,"mask" ,data,lsize) - ! - ! Fill in correct values for domain components - ! Note aream will be filled in in the atm-lnd mapper - ! - do g = bounds%begg,bounds%endg - i = 1 + (g - bounds%begg) - data(i) = ldomain%lonc(g) - end do - call mct_gGrid_importRattr(dom_l,"lon",data,lsize) - - do g = bounds%begg,bounds%endg - i = 1 + (g - bounds%begg) - data(i) = ldomain%latc(g) - end do - call mct_gGrid_importRattr(dom_l,"lat",data,lsize) - - do g = bounds%begg,bounds%endg - i = 1 + (g - bounds%begg) - data(i) = ldomain%area(g)/(re*re) - end do - call mct_gGrid_importRattr(dom_l,"area",data,lsize) - - do g = bounds%begg,bounds%endg - i = 1 + (g - bounds%begg) - data(i) = real(ldomain%mask(g), r8) - end do - call mct_gGrid_importRattr(dom_l,"mask",data,lsize) - - do g = bounds%begg,bounds%endg - i = 1 + (g - bounds%begg) - data(i) = real(ldomain%frac(g), r8) - end do - call mct_gGrid_importRattr(dom_l,"frac",data,lsize) - - deallocate(data) - deallocate(idata) - - end subroutine lnd_domain_mct - - !==================================================================================== - subroutine lnd_handle_resume( cdata_l ) - ! - ! !DESCRIPTION: - ! Handle resume signals for Data Assimilation (DA) - ! - ! !USES: - use clm_time_manager , only : update_DA_nstep - use seq_cdata_mod , only : seq_cdata, seq_cdata_setptrs - implicit none - ! !ARGUMENTS: - type(seq_cdata), intent(inout) :: cdata_l ! Input land-model driver data - ! !LOCAL VARIABLES: - logical :: resume_from_data_assim ! flag if we are resuming after data assimulation was done - !--------------------------------------------------------------------------- - - ! Check to see if restart was modified and we are resuming from data - ! assimilation - call seq_cdata_setptrs(cdata_l, post_assimilation=resume_from_data_assim) - if ( resume_from_data_assim ) call update_DA_nstep() - - end subroutine lnd_handle_resume - -end module lnd_comp_mct diff --git a/src/cpl/mct/lnd_import_export.F90 b/src/cpl/mct/lnd_import_export.F90 deleted file mode 100644 index 537abd49d9..0000000000 --- a/src/cpl/mct/lnd_import_export.F90 +++ /dev/null @@ -1,354 +0,0 @@ -module lnd_import_export - - use shr_kind_mod , only: r8 => shr_kind_r8, cl=>shr_kind_cl - use abortutils , only: endrun - use decompmod , only: bounds_type, subgrid_level_gridcell - use lnd2atmType , only: lnd2atm_type - use lnd2glcMod , only: lnd2glc_type - use atm2lndType , only: atm2lnd_type - use glc2lndMod , only: glc2lnd_type - use Waterlnd2atmBulkType , only: waterlnd2atmbulk_type - use Wateratm2lndBulkType , only: wateratm2lndbulk_type - use clm_cpl_indices - use GridcellType , only : grc - ! - implicit none - !=============================================================================== - -contains - - !=============================================================================== - subroutine lnd_import( bounds, x2l, glc_present, atm2lnd_inst, glc2lnd_inst, wateratm2lndbulk_inst) - - !--------------------------------------------------------------------------- - ! !DESCRIPTION: - ! Convert the input data from the coupler to the land model - ! - ! !USES: - use seq_flds_mod , only: seq_flds_x2l_fields - use clm_varctl , only: co2_type, co2_ppmv, iulog, use_c13 - use clm_varctl , only: ndep_from_cpl - use clm_varcon , only: c13ratio - use domainMod , only: ldomain - use lnd_import_export_utils, only : derive_quantities, check_for_errors, check_for_nans - ! - ! !ARGUMENTS: - type(bounds_type) , intent(in) :: bounds ! bounds - real(r8) , intent(in) :: x2l(:,:) ! driver import state to land model - logical , intent(in) :: glc_present ! .true. => running with a non-stub GLC model - type(atm2lnd_type) , intent(inout) :: atm2lnd_inst ! clm internal input data type - type(glc2lnd_type) , intent(inout) :: glc2lnd_inst ! clm internal input data type - type(wateratm2lndbulk_type), intent(inout) :: wateratm2lndbulk_inst ! clm internal input data type - ! - ! !LOCAL VARIABLES: - integer :: begg, endg ! bounds - integer :: g,i,k,nstep,ier ! indices, number of steps, and error code - real(r8) :: qsat_kg_kg ! saturation specific humidity (kg/kg) - real(r8) :: forc_pbot ! atmospheric pressure (Pa) - real(r8) :: forc_rainc(bounds%begg:bounds%endg) ! rainxy Atm flux mm/s - real(r8) :: forc_rainl(bounds%begg:bounds%endg) ! rainxy Atm flux mm/s - real(r8) :: forc_snowc(bounds%begg:bounds%endg) ! snowfxy Atm flux mm/s - real(r8) :: forc_snowl(bounds%begg:bounds%endg) ! snowfxl Atm flux mm/s - real(r8) :: co2_ppmv_diag ! temporary - real(r8) :: co2_ppmv_prog ! temporary - real(r8) :: co2_ppmv_val ! temporary - integer :: co2_type_idx ! integer flag for co2_type options - character(len=32) :: fname ! name of field that is NaN - character(len=32), parameter :: sub = 'lnd_import' - - !--------------------------------------------------------------------------- - - ! Set bounds - begg = bounds%begg; endg = bounds%endg - - co2_type_idx = 0 - if (co2_type == 'prognostic') then - co2_type_idx = 1 - else if (co2_type == 'diagnostic') then - co2_type_idx = 2 - end if - if (co2_type == 'prognostic' .and. index_x2l_Sa_co2prog == 0) then - call endrun( sub//' ERROR: must have nonzero index_x2l_Sa_co2prog for co2_type equal to prognostic' ) - else if (co2_type == 'diagnostic' .and. index_x2l_Sa_co2diag == 0) then - call endrun( sub//' ERROR: must have nonzero index_x2l_Sa_co2diag for co2_type equal to diagnostic' ) - end if - - ! Note that the precipitation fluxes received from the coupler - ! are in units of kg/s/m^2. To convert these precipitation rates - ! in units of mm/sec, one must divide by 1000 kg/m^3 and multiply - ! by 1000 mm/m resulting in an overall factor of unity. - ! Below the units are therefore given in mm/s. - - do g = begg,endg - i = 1 + (g - begg) - - ! Determine flooding input, sign convention is positive downward and - ! hierarchy is atm/glc/lnd/rof/ice/ocn. so water sent from rof to land is negative, - ! change the sign to indicate addition of water to system. - - wateratm2lndbulk_inst%forc_flood_grc(g) = -x2l(index_x2l_Flrr_flood,i) - - wateratm2lndbulk_inst%volr_grc(g) = x2l(index_x2l_Flrr_volr,i) * (ldomain%area(g) * 1.e6_r8) - wateratm2lndbulk_inst%volrmch_grc(g)= x2l(index_x2l_Flrr_volrmch,i) * (ldomain%area(g) * 1.e6_r8) - - ! Determine required receive fields - - atm2lnd_inst%forc_hgt_grc(g) = x2l(index_x2l_Sa_z,i) ! zgcmxy Atm state m - atm2lnd_inst%forc_topo_grc(g) = x2l(index_x2l_Sa_topo,i) ! Atm surface height (m) - atm2lnd_inst%forc_u_grc(g) = x2l(index_x2l_Sa_u,i) ! forc_uxy Atm state m/s - atm2lnd_inst%forc_v_grc(g) = x2l(index_x2l_Sa_v,i) ! forc_vxy Atm state m/s - atm2lnd_inst%forc_solad_not_downscaled_grc(g,2) = x2l(index_x2l_Faxa_swndr,i) ! forc_sollxy Atm flux W/m^2 - atm2lnd_inst%forc_solad_not_downscaled_grc(g,1) = x2l(index_x2l_Faxa_swvdr,i) ! forc_solsxy Atm flux W/m^2 - atm2lnd_inst%forc_solai_grc(g,2) = x2l(index_x2l_Faxa_swndf,i) ! forc_solldxy Atm flux W/m^2 - atm2lnd_inst%forc_solai_grc(g,1) = x2l(index_x2l_Faxa_swvdf,i) ! forc_solsdxy Atm flux W/m^2 - - atm2lnd_inst%forc_th_not_downscaled_grc(g) = x2l(index_x2l_Sa_ptem,i) ! forc_thxy Atm state K - wateratm2lndbulk_inst%forc_q_not_downscaled_grc(g) = x2l(index_x2l_Sa_shum,i) ! forc_qxy Atm state kg/kg - atm2lnd_inst%forc_pbot_not_downscaled_grc(g) = x2l(index_x2l_Sa_pbot,i) ! ptcmxy Atm state Pa - atm2lnd_inst%forc_t_not_downscaled_grc(g) = x2l(index_x2l_Sa_tbot,i) ! forc_txy Atm state K - atm2lnd_inst%forc_lwrad_not_downscaled_grc(g) = x2l(index_x2l_Faxa_lwdn,i) ! flwdsxy Atm flux W/m^2 - - forc_rainc(g) = x2l(index_x2l_Faxa_rainc,i) ! mm/s - forc_rainl(g) = x2l(index_x2l_Faxa_rainl,i) ! mm/s - forc_snowc(g) = x2l(index_x2l_Faxa_snowc,i) ! mm/s - forc_snowl(g) = x2l(index_x2l_Faxa_snowl,i) ! mm/s - - ! atmosphere coupling, for prognostic/prescribed aerosols - atm2lnd_inst%forc_aer_grc(g,1) = x2l(index_x2l_Faxa_bcphidry,i) - atm2lnd_inst%forc_aer_grc(g,2) = x2l(index_x2l_Faxa_bcphodry,i) - atm2lnd_inst%forc_aer_grc(g,3) = x2l(index_x2l_Faxa_bcphiwet,i) - atm2lnd_inst%forc_aer_grc(g,4) = x2l(index_x2l_Faxa_ocphidry,i) - atm2lnd_inst%forc_aer_grc(g,5) = x2l(index_x2l_Faxa_ocphodry,i) - atm2lnd_inst%forc_aer_grc(g,6) = x2l(index_x2l_Faxa_ocphiwet,i) - atm2lnd_inst%forc_aer_grc(g,7) = x2l(index_x2l_Faxa_dstwet1,i) - atm2lnd_inst%forc_aer_grc(g,8) = x2l(index_x2l_Faxa_dstdry1,i) - atm2lnd_inst%forc_aer_grc(g,9) = x2l(index_x2l_Faxa_dstwet2,i) - atm2lnd_inst%forc_aer_grc(g,10) = x2l(index_x2l_Faxa_dstdry2,i) - atm2lnd_inst%forc_aer_grc(g,11) = x2l(index_x2l_Faxa_dstwet3,i) - atm2lnd_inst%forc_aer_grc(g,12) = x2l(index_x2l_Faxa_dstdry3,i) - atm2lnd_inst%forc_aer_grc(g,13) = x2l(index_x2l_Faxa_dstwet4,i) - atm2lnd_inst%forc_aer_grc(g,14) = x2l(index_x2l_Faxa_dstdry4,i) - - if (index_x2l_Sa_methane /= 0) then - atm2lnd_inst%forc_pch4_grc(g) = x2l(index_x2l_Sa_methane,i) - endif - - !-------------------------- - ! Check for nans from coupler - !-------------------------- - - call check_for_nans(x2l(:,i), fname, begg, "x2l") - - end do - - !-------------------------- - ! Derived quantities for required fields - ! and corresponding error checks - !-------------------------- - - call derive_quantities(bounds, atm2lnd_inst, wateratm2lndbulk_inst, & - forc_rainc, forc_rainl, forc_snowc, forc_snowl) - - call check_for_errors(bounds, atm2lnd_inst, wateratm2lndbulk_inst) - - ! Determine derived quantities for optional fields - ! Note that the following does unit conversions from ppmv to partial pressures (Pa) - ! Note that forc_pbot is in Pa - - do g = begg,endg - i = 1 + (g - begg) - - forc_pbot = atm2lnd_inst%forc_pbot_not_downscaled_grc(g) - - ! Determine optional receive fields - if (index_x2l_Sa_co2prog /= 0) then - co2_ppmv_prog = x2l(index_x2l_Sa_co2prog,i) ! co2 atm state prognostic - else - co2_ppmv_prog = co2_ppmv - end if - if (index_x2l_Sa_co2diag /= 0) then - co2_ppmv_diag = x2l(index_x2l_Sa_co2diag,i) ! co2 atm state diagnostic - else - co2_ppmv_diag = co2_ppmv - end if - - if (co2_type_idx == 1) then - co2_ppmv_val = co2_ppmv_prog - else if (co2_type_idx == 2) then - co2_ppmv_val = co2_ppmv_diag - else - co2_ppmv_val = co2_ppmv - end if - if ( (co2_ppmv_val < 10.0_r8) .or. (co2_ppmv_val > 15000.0_r8) )then - call endrun(subgrid_index=g, subgrid_level=subgrid_level_gridcell, & - msg = sub//' ERROR: CO2 is outside of an expected range' ) - end if - atm2lnd_inst%forc_pco2_grc(g) = co2_ppmv_val * 1.e-6_r8 * forc_pbot - if (use_c13) then - atm2lnd_inst%forc_pc13o2_grc(g) = co2_ppmv_val * c13ratio * 1.e-6_r8 * forc_pbot - end if - - if (ndep_from_cpl) then - ! The coupler is sending ndep in units if kgN/m2/s - and clm uses units of gN/m2/sec - so the - ! following conversion needs to happen - atm2lnd_inst%forc_ndep_grc(g) = (x2l(index_x2l_Faxa_nhx, i) + x2l(index_x2l_faxa_noy, i))*1000._r8 - end if - - end do - - call glc2lnd_inst%set_glc2lnd_fields_mct( & - bounds = bounds, & - glc_present = glc_present, & - ! NOTE(wjs, 2017-12-13) the x2l argument doesn't have the typical bounds - ! subsetting (bounds%begg:bounds%endg). This mirrors the lack of these bounds in - ! the call to lnd_import from lnd_run_mct. This is okay as long as this code is - ! outside a clump loop. - x2l = x2l, & - index_x2l_Sg_ice_covered = index_x2l_Sg_ice_covered, & - index_x2l_Sg_topo = index_x2l_Sg_topo, & - index_x2l_Flgg_hflx = index_x2l_Flgg_hflx, & - index_x2l_Sg_icemask = index_x2l_Sg_icemask, & - index_x2l_Sg_icemask_coupled_fluxes = index_x2l_Sg_icemask_coupled_fluxes) - - end subroutine lnd_import - - !=============================================================================== - - subroutine lnd_export( bounds, waterlnd2atmbulk_inst, lnd2atm_inst, lnd2glc_inst, l2x) - - !--------------------------------------------------------------------------- - ! !DESCRIPTION: - ! Convert the data to be sent from the clm model to the coupler - ! - ! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use seq_flds_mod , only : seq_flds_l2x_fields - use clm_varctl , only : iulog - use shr_drydep_mod , only : n_drydep - use shr_megan_mod , only : shr_megan_mechcomps_n - use shr_fire_emis_mod , only : shr_fire_emis_mechcomps_n - use lnd_import_export_utils, only : check_for_nans - ! - ! !ARGUMENTS: - implicit none - type(bounds_type) , intent(in) :: bounds ! bounds - type(lnd2atm_type), intent(inout) :: lnd2atm_inst ! clm land to atmosphere exchange data type - type(lnd2glc_type), intent(inout) :: lnd2glc_inst ! clm land to atmosphere exchange data type - type(waterlnd2atmbulk_type), intent(in) :: waterlnd2atmbulk_inst - real(r8) , intent(out) :: l2x(:,:)! land to coupler export state on land grid - ! - ! !LOCAL VARIABLES: - integer :: begg, endg ! bounds - integer :: g,i,k ! indices - integer :: ier ! error status - integer :: nstep ! time step index - integer :: dtime ! time step - integer :: num ! counter - character(len=32) :: fname ! name of field that is NaN - character(len=32), parameter :: sub = 'lnd_export' - !--------------------------------------------------------------------------- - - ! Set bounds - begg = bounds%begg; endg = bounds%endg - - ! cesm sign convention is that fluxes are positive downward - - l2x(:,:) = 0.0_r8 - - do g = begg,endg - i = 1 + (g-begg) - l2x(index_l2x_Sl_t,i) = lnd2atm_inst%t_rad_grc(g) - l2x(index_l2x_Sl_snowh,i) = waterlnd2atmbulk_inst%h2osno_grc(g) - l2x(index_l2x_Sl_avsdr,i) = lnd2atm_inst%albd_grc(g,1) - l2x(index_l2x_Sl_anidr,i) = lnd2atm_inst%albd_grc(g,2) - l2x(index_l2x_Sl_avsdf,i) = lnd2atm_inst%albi_grc(g,1) - l2x(index_l2x_Sl_anidf,i) = lnd2atm_inst%albi_grc(g,2) - l2x(index_l2x_Sl_tref,i) = lnd2atm_inst%t_ref2m_grc(g) - l2x(index_l2x_Sl_qref,i) = waterlnd2atmbulk_inst%q_ref2m_grc(g) - l2x(index_l2x_Sl_u10,i) = lnd2atm_inst%u_ref10m_grc(g) - l2x(index_l2x_Fall_taux,i) = -lnd2atm_inst%taux_grc(g) - l2x(index_l2x_Fall_tauy,i) = -lnd2atm_inst%tauy_grc(g) - l2x(index_l2x_Fall_lat,i) = -lnd2atm_inst%eflx_lh_tot_grc(g) - l2x(index_l2x_Fall_sen,i) = -lnd2atm_inst%eflx_sh_tot_grc(g) - l2x(index_l2x_Fall_lwup,i) = -lnd2atm_inst%eflx_lwrad_out_grc(g) - l2x(index_l2x_Fall_evap,i) = -waterlnd2atmbulk_inst%qflx_evap_tot_grc(g) - l2x(index_l2x_Fall_swnet,i) = lnd2atm_inst%fsa_grc(g) - if (index_l2x_Fall_fco2_lnd /= 0) then - l2x(index_l2x_Fall_fco2_lnd,i) = -lnd2atm_inst%net_carbon_exchange_grc(g) - end if - - ! Additional fields for DUST, PROGSSLT, dry-deposition and VOC - ! These are now standard fields, but the check on the index makes sure the driver handles them - if (index_l2x_Sl_ram1 /= 0 ) l2x(index_l2x_Sl_ram1,i) = lnd2atm_inst%ram1_grc(g) - if (index_l2x_Sl_fv /= 0 ) l2x(index_l2x_Sl_fv,i) = lnd2atm_inst%fv_grc(g) - if (index_l2x_Sl_soilw /= 0 ) l2x(index_l2x_Sl_soilw,i) = waterlnd2atmbulk_inst%h2osoi_vol_grc(g,1) - if (index_l2x_Fall_flxdst1 /= 0 ) l2x(index_l2x_Fall_flxdst1,i)= -lnd2atm_inst%flxdst_grc(g,1) - if (index_l2x_Fall_flxdst2 /= 0 ) l2x(index_l2x_Fall_flxdst2,i)= -lnd2atm_inst%flxdst_grc(g,2) - if (index_l2x_Fall_flxdst3 /= 0 ) l2x(index_l2x_Fall_flxdst3,i)= -lnd2atm_inst%flxdst_grc(g,3) - if (index_l2x_Fall_flxdst4 /= 0 ) l2x(index_l2x_Fall_flxdst4,i)= -lnd2atm_inst%flxdst_grc(g,4) - - - ! for dry dep velocities - if (index_l2x_Sl_ddvel /= 0 ) then - l2x(index_l2x_Sl_ddvel:index_l2x_Sl_ddvel+n_drydep-1,i) = & - lnd2atm_inst%ddvel_grc(g,:n_drydep) - end if - - ! for MEGAN VOC emis fluxes - if (index_l2x_Fall_flxvoc /= 0 ) then - l2x(index_l2x_Fall_flxvoc:index_l2x_Fall_flxvoc+shr_megan_mechcomps_n-1,i) = & - -lnd2atm_inst%flxvoc_grc(g,:shr_megan_mechcomps_n) - end if - - - ! for fire emis fluxes - if (index_l2x_Fall_flxfire /= 0 ) then - l2x(index_l2x_Fall_flxfire:index_l2x_Fall_flxfire+shr_fire_emis_mechcomps_n-1,i) = & - -lnd2atm_inst%fireflx_grc(g,:shr_fire_emis_mechcomps_n) - l2x(index_l2x_Sl_ztopfire,i) = lnd2atm_inst%fireztop_grc(g) - end if - - if (index_l2x_Fall_methane /= 0) then - l2x(index_l2x_Fall_methane,i) = -lnd2atm_inst%ch4_surf_flux_tot_grc(g) - endif - - ! sign convention is positive downward with - ! hierarchy of atm/glc/lnd/rof/ice/ocn. - ! I.e. water sent from land to rof is positive - - l2x(index_l2x_Flrl_rofsur,i) = waterlnd2atmbulk_inst%qflx_rofliq_qsur_grc(g) - - ! subsurface runoff is the sum of qflx_drain and qflx_perched_drain - l2x(index_l2x_Flrl_rofsub,i) = waterlnd2atmbulk_inst%qflx_rofliq_qsub_grc(g) & - + waterlnd2atmbulk_inst%qflx_rofliq_drain_perched_grc(g) - - ! qgwl sent individually to coupler - l2x(index_l2x_Flrl_rofgwl,i) = waterlnd2atmbulk_inst%qflx_rofliq_qgwl_grc(g) - - ! ice sent individually to coupler - l2x(index_l2x_Flrl_rofi,i) = waterlnd2atmbulk_inst%qflx_rofice_grc(g) - - ! irrigation flux to be removed from main channel storage (negative) - l2x(index_l2x_Flrl_irrig,i) = - waterlnd2atmbulk_inst%qirrig_grc(g) - - ! glc coupling - ! We could avoid setting these fields if glc_present is .false., if that would - ! help with performance. (The downside would be that we wouldn't have these fields - ! available for diagnostic purposes or to force a later T compset with dlnd.) - do num = 0,glc_nec - l2x(index_l2x_Sl_tsrf(num),i) = lnd2glc_inst%tsrf_grc(g,num) - l2x(index_l2x_Sl_topo(num),i) = lnd2glc_inst%topo_grc(g,num) - l2x(index_l2x_Flgl_qice(num),i) = lnd2glc_inst%qice_grc(g,num) - end do - - !-------------------------- - ! Check for nans to coupler - !-------------------------- - - call check_for_nans(l2x(:,i), fname, begg, "l2x") - - end do - - end subroutine lnd_export - -end module lnd_import_export diff --git a/src/cpl/mct/lnd_set_decomp_and_domain.F90 b/src/cpl/mct/lnd_set_decomp_and_domain.F90 deleted file mode 100644 index 0a37554313..0000000000 --- a/src/cpl/mct/lnd_set_decomp_and_domain.F90 +++ /dev/null @@ -1,352 +0,0 @@ -module lnd_set_decomp_and_domain - - use shr_kind_mod , only : r8 => shr_kind_r8 - use spmdMod , only : masterproc - use clm_varctl , only : iulog - use mct_mod , only : mct_gsMap - - implicit none - private ! except - - ! public member routines - public :: lnd_set_decomp_and_domain_from_surfrd - - ! private member routines - private :: surfrd_get_globmask ! Reads global land mask (needed for setting domain decomp) - private :: surfrd_get_grid ! Read grid/ladnfrac data into domain (after domain decomp) - - ! translation between local and global indices at gridcell level - type(mct_gsmap), pointer, public :: gsmap_global - - ! translation between local and global indices at gridcell level for multiple levels - ! needed for 3d soil moisture stream - type(mct_gsmap), target , public :: gsMap_lnd2Dsoi_gdc2glo - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - -!=============================================================================== -contains -!=============================================================================== - - subroutine lnd_set_decomp_and_domain_from_surfrd(noland, ni, nj) - - ! Initialize ldomain data types - - use clm_varpar , only: nlevsoi - use clm_varctl , only: fatmlndfrc, use_soil_moisture_streams - use decompInitMod , only: decompInit_lnd - use decompMod , only: bounds_type, get_proc_bounds - use domainMod , only: ldomain, domain_check - - ! input/output variables - logical, intent(out) :: noland - integer, intent(out) :: ni, nj ! global grid sizes - - ! local variables - integer ,pointer :: amask(:) ! global land mask - integer :: begg, endg ! processor bounds - type(bounds_type) :: bounds ! bounds - character(len=32) :: subname = 'lnd_set_decomp_and_domain_from_surfrd' - !----------------------------------------------------------------------- - - ! Read in global land grid and land mask (amask)- needed to set decomposition - ! global memory for amask is allocate in surfrd_get_glomask - must be deallocated below - if (masterproc) then - write(iulog,*) 'Attempting to read global land mask from ',trim(fatmlndfrc) - endif - - ! Get global mask, ni and nj - call surfrd_get_globmask(filename=fatmlndfrc, mask=amask, ni=ni, nj=nj) - - ! Exit early if no valid land points - if ( all(amask == 0) )then - if (masterproc) write(iulog,*) trim(subname)//': no valid land points do NOT run clm' - noland = .true. - return - else - noland = .false. - end if - - ! Determine ctsm gridcell decomposition and processor bounds for gridcells - call decompInit_lnd(ni, nj, amask) - deallocate(amask) - if (use_soil_moisture_streams) call decompInit_lnd3D(ni, nj, nlevsoi) - - ! Initialize bounds for just gridcells - ! Remaining bounds (landunits, columns, patches) will be determined - ! after the call to decompInit_glcp - so get_proc_bounds is called - ! twice and the gridcell information is just filled in twice - call get_proc_bounds(bounds) - - ! Get grid cell bounds values - begg = bounds%begg - endg = bounds%endg - - ! Initialize ldomain data type - if (masterproc) then - write(iulog,*) 'Attempting to read ldomain from ',trim(fatmlndfrc) - endif - call surfrd_get_grid(begg, endg, ldomain, fatmlndfrc) - if (masterproc) then - call domain_check(ldomain) - endif - ldomain%mask = 1 !!! TODO - is this needed? - - end subroutine lnd_set_decomp_and_domain_from_surfrd - - !----------------------------------------------------------------------- - subroutine surfrd_get_globmask(filename, mask, ni, nj) - - ! Read the surface dataset grid related information - ! This is used to set the domain decomposition - so global data is read here - - use fileutils , only : getfil - use ncdio_pio , only : ncd_io, ncd_pio_openfile, ncd_pio_closefile, ncd_inqfdims, file_desc_t - use abortutils , only : endrun - use shr_log_mod, only : errMsg => shr_log_errMsg - - ! input/output variables - character(len=*), intent(in) :: filename ! grid filename - integer , pointer :: mask(:) ! grid mask - integer , intent(out) :: ni, nj ! global grid sizes - - ! local variables - logical :: isgrid2d - integer :: dimid,varid ! netCDF id's - integer :: ns ! size of grid on file - integer :: n,i,j ! index - integer :: ier ! error status - type(file_desc_t) :: ncid ! netcdf id - character(len=256) :: locfn ! local file name - logical :: readvar ! read variable in or not - integer , allocatable :: idata2d(:,:) - character(len=32) :: subname = 'surfrd_get_globmask' ! subroutine name - !----------------------------------------------------------------------- - - if (filename == ' ') then - mask(:) = 1 - else - ! Check if file exists - if (masterproc) then - if (filename == ' ') then - write(iulog,*) trim(subname),' ERROR: filename must be specified ' - call endrun(msg=errMsg(sourcefile, __LINE__)) - endif - end if - - ! Open file - call getfil( filename, locfn, 0 ) - call ncd_pio_openfile (ncid, trim(locfn), 0) - - ! Determine dimensions and if grid file is 2d or 1d - call ncd_inqfdims(ncid, isgrid2d, ni, nj, ns) - if (masterproc) then - write(iulog,*)'lat/lon grid flag (isgrid2d) is ',isgrid2d - end if - allocate(mask(ns)) - mask(:) = 1 - if (isgrid2d) then - ! Grid is 2d - allocate(idata2d(ni,nj)) - idata2d(:,:) = 1 - call ncd_io(ncid=ncid, varname='LANDMASK', data=idata2d, flag='read', readvar=readvar) - if (.not. readvar) then - call ncd_io(ncid=ncid, varname='mask', data=idata2d, flag='read', readvar=readvar) - end if - if (readvar) then - do j = 1,nj - do i = 1,ni - n = (j-1)*ni + i - mask(n) = idata2d(i,j) - enddo - enddo - end if - deallocate(idata2d) - else - ! Grid is not 2d - call ncd_io(ncid=ncid, varname='LANDMASK', data=mask, flag='read', readvar=readvar) - if (.not. readvar) then - call ncd_io(ncid=ncid, varname='mask', data=mask, flag='read', readvar=readvar) - end if - end if - if (.not. readvar) call endrun( msg=' ERROR: landmask not on fatmlndfrc file'//errMsg(sourcefile, __LINE__)) - - ! Close file - call ncd_pio_closefile(ncid) - end if - - end subroutine surfrd_get_globmask - - !----------------------------------------------------------------------- - subroutine surfrd_get_grid(begg, endg, ldomain, filename) - - ! Read the surface dataset grid related information: - ! This is called after the domain decomposition has been created - ! - real latitude of grid cell (degrees) - ! - real longitude of grid cell (degrees) - - use clm_varcon , only : spval, re, grlnd - use domainMod , only : domain_type, lon1d, lat1d, domain_init - use fileutils , only : getfil - use abortutils , only : endrun - use shr_log_mod , only : errMsg => shr_log_errMsg - use ncdio_pio , only : file_desc_t, ncd_pio_openfile, ncd_pio_closefile - use ncdio_pio , only : ncd_io, check_var, ncd_inqfdims, check_dim_size - use pio - - ! input/output variables - integer , intent(in) :: begg, endg - type(domain_type) , intent(inout) :: ldomain ! domain to init - character(len=*) , intent(in) :: filename ! grid filename - - ! local variables - type(file_desc_t) :: ncid ! netcdf id - integer :: beg ! local beg index - integer :: end ! local end index - integer :: ni,nj,ns ! size of grid on file - logical :: readvar ! true => variable is on input file - logical :: isgrid2d ! true => file is 2d lat/lon - logical :: istype_domain ! true => input file is of type domain - real(r8), allocatable :: rdata2d(:,:) ! temporary - character(len=16) :: vname ! temporary - character(len=256) :: locfn ! local file name - integer :: n ! indices - character(len=32) :: subname = 'surfrd_get_grid' ! subroutine name - !----------------------------------------------------------------------- - - if (masterproc) then - if (filename == ' ') then - write(iulog,*) trim(subname),' ERROR: filename must be specified ' - call endrun(msg=errMsg(sourcefile, __LINE__)) - endif - end if - - call getfil( filename, locfn, 0 ) - call ncd_pio_openfile (ncid, trim(locfn), 0) - - ! Determine dimensions - call ncd_inqfdims(ncid, isgrid2d, ni, nj, ns) - - ! Determine isgrid2d flag for domain - call domain_init(ldomain, isgrid2d=isgrid2d, ni=ni, nj=nj, nbeg=begg, nend=endg) - - ! Determine type of file - old style grid file or new style domain file - call check_var(ncid=ncid, varname='xc', readvar=readvar) - if (readvar)then - istype_domain = .true. - else - istype_domain = .false. - end if - - ! Read in area, lon, lat - if (istype_domain) then - call ncd_io(ncid=ncid, varname= 'area', flag='read', data=ldomain%area, & - dim1name=grlnd, readvar=readvar) - ! convert from radians**2 to km**2 - ldomain%area = ldomain%area * (re**2) - if (.not. readvar) call endrun( msg=' ERROR: area NOT on file'//errMsg(sourcefile, __LINE__)) - call ncd_io(ncid=ncid, varname= 'xc', flag='read', data=ldomain%lonc, & - dim1name=grlnd, readvar=readvar) - if (.not. readvar) call endrun( msg=' ERROR: xc NOT on file'//errMsg(sourcefile, __LINE__)) - call ncd_io(ncid=ncid, varname= 'yc', flag='read', data=ldomain%latc, & - dim1name=grlnd, readvar=readvar) - if (.not. readvar) call endrun( msg=' ERROR: yc NOT on file'//errMsg(sourcefile, __LINE__)) - else - call endrun( msg=" ERROR: can no longer read non domain files" ) - end if - - if (isgrid2d) then - allocate(rdata2d(ni,nj), lon1d(ni), lat1d(nj)) - if (istype_domain) vname = 'xc' - call ncd_io(ncid=ncid, varname=trim(vname), data=rdata2d, flag='read', readvar=readvar) - lon1d(:) = rdata2d(:,1) - if (istype_domain) vname = 'yc' - call ncd_io(ncid=ncid, varname=trim(vname), data=rdata2d, flag='read', readvar=readvar) - lat1d(:) = rdata2d(1,:) - deallocate(rdata2d) - end if - - ! Check lat limited to -90,90 - if (minval(ldomain%latc) < -90.0_r8 .or. & - maxval(ldomain%latc) > 90.0_r8) then - write(iulog,*) trim(subname),' WARNING: lat/lon min/max is ', & - minval(ldomain%latc),maxval(ldomain%latc) - endif - if ( any(ldomain%lonc < 0.0_r8) )then - call endrun( msg=' ERROR: lonc is negative (see https://github.com/ESCOMP/ctsm/issues/507)' & - //errMsg(sourcefile, __LINE__)) - endif - call ncd_io(ncid=ncid, varname='mask', flag='read', data=ldomain%mask, & - dim1name=grlnd, readvar=readvar) - if (.not. readvar) then - call endrun( msg=' ERROR: LANDMASK NOT on fracdata file'//errMsg(sourcefile, __LINE__)) - end if - call ncd_io(ncid=ncid, varname='frac', flag='read', data=ldomain%frac, & - dim1name=grlnd, readvar=readvar) - if (.not. readvar) then - call endrun( msg=' ERROR: LANDFRAC NOT on fracdata file'//errMsg(sourcefile, __LINE__)) - end if - - call ncd_pio_closefile(ncid) - - end subroutine surfrd_get_grid - - !------------------------------------------------------------------------------ - subroutine decompInit_lnd3D(lni,lnj,lnk) - ! - ! !DESCRIPTION: - ! Create a 3D decomposition gsmap for the global 2D grid with soil levels - ! as the 3rd dimesnion. - ! - ! !USES: - use decompMod, only : gindex_global, bounds_type, get_proc_bounds - use spmdMod , only : comp_id, mpicom - use mct_mod , only : mct_gsmap_init - ! - ! !ARGUMENTS: - integer , intent(in) :: lni,lnj,lnk ! domain global size - ! - ! !LOCAL VARIABLES: - integer :: m,n,k ! indices - integer :: begg,endg,lsize,gsize ! used for gsmap init - integer :: begg3d,endg3d - integer, pointer :: gindex(:) ! global index for gsmap init - type(bounds_type) :: bounds - !------------------------------------------------------------------------------ - - ! Initialize gsmap_lnd2dsoi_gdc2glo - call get_proc_bounds(bounds) - begg = bounds%begg; endg=bounds%endg - - begg3d = (begg-1)*lnk + 1 - endg3d = endg*lnk - lsize = (endg3d - begg3d + 1 ) - allocate(gindex(begg3d:endg3d)) - do k = 1, lnk - do n = begg,endg - m = (begg-1)*lnk + (k-1)*(endg-begg+1) + (n-begg+1) - gindex(m) = gindex_global(n-begg+1) + (k-1)*(lni*lnj) - enddo - enddo - gsize = lni * lnj * lnk - call mct_gsMap_init(gsMap_lnd2Dsoi_gdc2glo, gindex, mpicom, comp_id, lsize, gsize) - - ! Diagnostic output - - if (masterproc) then - write(iulog,*)' 3D GSMap' - write(iulog,*)' longitude points = ',lni - write(iulog,*)' latitude points = ',lnj - write(iulog,*)' soil levels = ',lnk - write(iulog,*)' gsize = ',gsize - write(iulog,*)' lsize = ',lsize - write(iulog,*)' bounds(gindex) = ',size(gindex) - write(iulog,*) - end if - - deallocate(gindex) - - end subroutine decompInit_lnd3D - -end module lnd_set_decomp_and_domain diff --git a/src/cpl/mct/ndepStreamMod.F90 b/src/cpl/mct/ndepStreamMod.F90 deleted file mode 100644 index d26ff7c95e..0000000000 --- a/src/cpl/mct/ndepStreamMod.F90 +++ /dev/null @@ -1,376 +0,0 @@ -module ndepStreamMod - - !----------------------------------------------------------------------- - ! !DESCRIPTION: - ! Contains methods for reading in nitrogen deposition data file - ! Also includes functions for dynamic ndep file handling and - ! interpolation. - ! - ! !USES - use shr_kind_mod, only: r8 => shr_kind_r8, CL => shr_kind_cl - use shr_strdata_mod, only: shr_strdata_type, shr_strdata_create - use shr_strdata_mod, only: shr_strdata_print, shr_strdata_advance - use mct_mod , only: mct_ggrid - use spmdMod , only: mpicom, masterproc, comp_id, iam - use clm_varctl , only: iulog, inst_name - use abortutils , only: endrun - use decompMod , only: bounds_type - use domainMod , only: ldomain - - ! !PUBLIC TYPES: - implicit none - private - - ! !PUBLIC MEMBER FUNCTIONS: - public :: ndep_init ! position datasets for dynamic ndep - public :: ndep_interp ! interpolates between two years of ndep file data - public :: clm_domain_mct ! Sets up MCT domain for this resolution - - ! !PRIVATE MEMBER FUNCTIONS: - private :: check_units ! Check the units and make sure they can be used - - ! ! PRIVATE TYPES - type(shr_strdata_type) :: sdat ! input data stream - integer :: stream_year_first_ndep ! first year in stream to use - integer :: stream_year_last_ndep ! last year in stream to use - integer :: model_year_align_ndep ! align stream_year_firstndep with - logical :: divide_by_secs_per_yr = .true. ! divide by the number of seconds per year - - character(len=*), parameter, private :: sourcefile = & - __FILE__ - !============================================================================== - -contains - - !============================================================================== - - subroutine ndep_init(bounds, NLFilename) - ! - ! Initialize data stream information. - ! - ! Uses: - use shr_kind_mod , only : CS => shr_kind_cs - use clm_time_manager , only : get_calendar - use ncdio_pio , only : pio_subsystem - use shr_pio_mod , only : shr_pio_getiotype - use shr_nl_mod , only : shr_nl_find_group_name - use shr_log_mod , only : errMsg => shr_log_errMsg - use shr_mpi_mod , only : shr_mpi_bcast - use lnd_set_decomp_and_domain , only : gsMap_lnd2Dsoi_gdc2glo, gsmap_global - ! - ! arguments - implicit none - type(bounds_type), intent(in) :: bounds - character(len=*), intent(in) :: NLFilename ! Namelist filename - ! - ! local variables - integer :: nu_nml ! unit for namelist file - integer :: nml_error ! namelist i/o error flag - type(mct_ggrid) :: dom_clm ! domain information - character(len=CL) :: stream_fldFileName_ndep - character(len=CL) :: ndepmapalgo = 'bilinear' - character(len=CL) :: ndep_tintalgo = 'linear' - character(len=CS) :: ndep_taxmode = 'extend' - character(len=CL) :: ndep_varlist = 'NDEP_year' - character(*), parameter :: shr_strdata_unset = 'NOT_SET' - character(*), parameter :: subName = "('ndepdyn_init')" - character(*), parameter :: F00 = "('(ndepdyn_init) ',4a)" - !----------------------------------------------------------------------- - - namelist /ndepdyn_nml/ & - stream_year_first_ndep, & - stream_year_last_ndep, & - model_year_align_ndep, & - ndepmapalgo, ndep_taxmode, & - ndep_varlist, & - stream_fldFileName_ndep, & - ndep_tintalgo - - ! Default values for namelist - stream_year_first_ndep = 1 ! first year in stream to use - stream_year_last_ndep = 1 ! last year in stream to use - model_year_align_ndep = 1 ! align stream_year_first_ndep with this model year - stream_fldFileName_ndep = ' ' - - ! Read ndepdyn_nml namelist - if (masterproc) then - open( newunit=nu_nml, file=trim(NLFilename), status='old', iostat=nml_error ) - call shr_nl_find_group_name(nu_nml, 'ndepdyn_nml', status=nml_error) - if (nml_error == 0) then - read(nu_nml, nml=ndepdyn_nml,iostat=nml_error) - if (nml_error /= 0) then - call endrun(msg=' ERROR reading ndepdyn_nml namelist'//errMsg(sourcefile, __LINE__)) - end if - else - call endrun(msg=' ERROR finding ndepdyn_nml namelist'//errMsg(sourcefile, __LINE__)) - end if - close(nu_nml) - endif - - call shr_mpi_bcast(stream_year_first_ndep , mpicom) - call shr_mpi_bcast(stream_year_last_ndep , mpicom) - call shr_mpi_bcast(model_year_align_ndep , mpicom) - call shr_mpi_bcast(stream_fldFileName_ndep, mpicom) - call shr_mpi_bcast(ndep_varlist , mpicom) - call shr_mpi_bcast(ndep_taxmode , mpicom) - call shr_mpi_bcast(ndep_tintalgo , mpicom) - - if (masterproc) then - write(iulog,*) ' ' - write(iulog,*) 'ndepdyn stream settings:' - write(iulog,*) ' stream_year_first_ndep = ',stream_year_first_ndep - write(iulog,*) ' stream_year_last_ndep = ',stream_year_last_ndep - write(iulog,*) ' model_year_align_ndep = ',model_year_align_ndep - write(iulog,*) ' stream_fldFileName_ndep = ',stream_fldFileName_ndep - write(iulog,*) ' ndep_varList = ',ndep_varList - write(iulog,*) ' ndep_taxmode = ',ndep_taxmode - write(iulog,*) ' ndep_tintalgo = ',ndep_tintalgo - write(iulog,*) ' ' - endif - ! Read in units - call check_units( stream_fldFileName_ndep, ndep_varList ) - - ! Set domain and create streams - call clm_domain_mct (bounds, dom_clm) - - call shr_strdata_create(sdat,name="clmndep", & - pio_subsystem=pio_subsystem, & - pio_iotype=shr_pio_getiotype(inst_name), & - mpicom=mpicom, compid=comp_id, & - gsmap=gsmap_global, ggrid=dom_clm, & - nxg=ldomain%ni, nyg=ldomain%nj, & - yearFirst=stream_year_first_ndep, & - yearLast=stream_year_last_ndep, & - yearAlign=model_year_align_ndep, & - offset=0, & - domFilePath='', & - domFileName=trim(stream_fldFileName_ndep), & - domTvarName='time', & - domXvarName='lon' , & - domYvarName='lat' , & - domAreaName='area', & - domMaskName='mask', & - filePath='', & - filename=(/trim(stream_fldFileName_ndep)/),& - fldListFile=ndep_varlist, & - fldListModel=ndep_varlist, & - fillalgo='none', & - mapalgo=ndepmapalgo, & - tintalgo=ndep_tintalgo, & - calendar=get_calendar(), & - taxmode=ndep_taxmode ) - - - if (masterproc) then - call shr_strdata_print(sdat,'CLMNDEP data') - endif - - end subroutine ndep_init - !================================================================ - - subroutine check_units( stream_fldFileName_ndep, ndep_varList ) - !------------------------------------------------------------------- - ! Check that units are correct on the file and if need any conversion - use ncdio_pio , only : ncd_pio_openfile, ncd_inqvid, ncd_getatt, ncd_pio_closefile, ncd_nowrite - use ncdio_pio , only : file_desc_t, var_desc_t - use shr_kind_mod , only : CS => shr_kind_cs - use shr_log_mod , only : errMsg => shr_log_errMsg - use shr_string_mod, only : shr_string_listGetName - implicit none - - !----------------------------------------------------------------------- - ! - ! Arguments - character(len=*), intent(IN) :: stream_fldFileName_ndep ! ndep filename - character(len=*), intent(IN) :: ndep_varList ! ndep variable list to examine - ! - ! Local variables - type(file_desc_t) :: ncid ! NetCDF filehandle for ndep file - type(var_desc_t) :: vardesc ! variable descriptor - integer :: varid ! variable index - logical :: readvar ! If variable was read - character(len=CS) :: ndepunits! ndep units - character(len=CS) :: fname ! ndep field name - !----------------------------------------------------------------------- - call ncd_pio_openfile( ncid, trim(stream_fldFileName_ndep), ncd_nowrite ) - call shr_string_listGetName( ndep_varList, 1, fname ) - call ncd_inqvid( ncid, fname, varid, vardesc, readvar=readvar ) - if ( readvar ) then - call ncd_getatt( ncid, varid, "units", ndepunits ) - else - call endrun(msg=' ERROR finding variable: '//trim(fname)//" in file: "// & - trim(stream_fldFileName_ndep)//errMsg(sourcefile, __LINE__)) - end if - call ncd_pio_closefile( ncid ) - - ! Now check to make sure they are correct - if ( trim(ndepunits) == "g(N)/m2/s" )then - divide_by_secs_per_yr = .false. - else if ( trim(ndepunits) == "g(N)/m2/yr" )then - divide_by_secs_per_yr = .true. - else - call endrun(msg=' ERROR in units for nitrogen deposition equal to: '//trim(ndepunits)//" not units expected"// & - errMsg(sourcefile, __LINE__)) - end if - - end subroutine check_units - - !================================================================ - subroutine ndep_interp(bounds, atm2lnd_inst) - - !----------------------------------------------------------------------- - use clm_time_manager, only : get_curr_date, get_curr_days_per_year - use clm_varcon , only : secspday - use atm2lndType , only : atm2lnd_type - ! - ! Arguments - type(bounds_type) , intent(in) :: bounds - type(atm2lnd_type), intent(inout) :: atm2lnd_inst - ! - ! Local variables - integer :: g, ig - 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 :: dayspyr ! days per year - !----------------------------------------------------------------------- - - call get_curr_date(year, mon, day, sec) - mcdate = year*10000 + mon*100 + day - - call shr_strdata_advance(sdat, mcdate, sec, mpicom, 'ndepdyn') - - if ( divide_by_secs_per_yr )then - ig = 0 - dayspyr = get_curr_days_per_year( ) - do g = bounds%begg,bounds%endg - ig = ig+1 - atm2lnd_inst%forc_ndep_grc(g) = sdat%avs(1)%rAttr(1,ig) / (secspday * dayspyr) - end do - else - ig = 0 - do g = bounds%begg,bounds%endg - ig = ig+1 - atm2lnd_inst%forc_ndep_grc(g) = sdat%avs(1)%rAttr(1,ig) - end do - end if - - end subroutine ndep_interp - - !============================================================================== - subroutine clm_domain_mct(bounds, dom_clm, nlevels) - - !------------------------------------------------------------------- - ! Set domain data type for internal clm grid - use clm_varcon , only : re - use domainMod , only : ldomain - use mct_mod , only : mct_ggrid, mct_gsMap_lsize, mct_gGrid_init - use mct_mod , only : mct_gsMap_orderedPoints, mct_gGrid_importIAttr - use mct_mod , only : mct_gGrid_importRAttr, mct_gsMap - use lnd_set_decomp_and_domain , only : gsMap_lnd2Dsoi_gdc2glo, gsmap_global - implicit none - ! - ! arguments - type(bounds_type), intent(in) :: bounds - type(mct_ggrid), intent(out) :: dom_clm ! Output domain information for land model - integer, intent(in), optional :: nlevels ! Number of levels if this is a 3D field - ! - ! local variables - integer :: g,i,j,k ! index - integer :: lsize ! land model domain data size - real(r8), pointer :: data(:) ! temporary - integer , pointer :: idata(:) ! temporary - integer :: nlevs ! Number of vertical levels - type(mct_gsMap), pointer :: gsmap => null() ! MCT GS map - !------------------------------------------------------------------- - ! SEt number of levels, and get the GS map for either the 2D or 3D grid - nlevs = 1 - if ( present(nlevels) ) nlevs = nlevels - if ( nlevs == 1 ) then - gsmap => gsmap_global - else - gsmap => gsMap_lnd2Dsoi_gdc2glo - end if - ! - ! Initialize mct domain type - ! lat/lon in degrees, area in radians^2, mask is 1 (land), 0 (non-land) - ! Note that in addition land carries around landfrac for the purposes of domain checking - ! - lsize = mct_gsMap_lsize(gsmap, mpicom) - call mct_gGrid_init( GGrid=dom_clm, & - CoordChars='lat:lon:hgt', OtherChars='area:aream:mask:frac', lsize=lsize ) - ! - ! Allocate memory - ! - allocate(data(lsize)) - ! - ! Determine global gridpoint number attribute, GlobGridNum, which is set automatically by MCT - ! - call mct_gsMap_orderedPoints(gsmap, iam, idata) - gsmap => null() - call mct_gGrid_importIAttr(dom_clm,'GlobGridNum',idata,lsize) - ! - ! Determine domain (numbering scheme is: West to East and South to North to South pole) - ! Initialize attribute vector with special value - ! - data(:) = -9999.0_R8 - call mct_gGrid_importRAttr(dom_clm,"lat" ,data,lsize) - call mct_gGrid_importRAttr(dom_clm,"lon" ,data,lsize) - call mct_gGrid_importRAttr(dom_clm,"area" ,data,lsize) - call mct_gGrid_importRAttr(dom_clm,"aream",data,lsize) - data(:) = 0.0_R8 - call mct_gGrid_importRAttr(dom_clm,"mask" ,data,lsize) - ! - ! Determine bounds - ! - ! Fill in correct values for domain components - ! Note aream will be filled in in the atm-lnd mapper - ! - do k = 1, nlevs - do g = bounds%begg,bounds%endg - i = 1 + (g - bounds%begg) - data(i) = ldomain%lonc(g) - end do - end do - call mct_gGrid_importRattr(dom_clm,"lon",data,lsize) - - do k = 1, nlevs - do g = bounds%begg,bounds%endg - i = 1 + (g - bounds%begg) - data(i) = ldomain%latc(g) - end do - end do - call mct_gGrid_importRattr(dom_clm,"lat",data,lsize) - - do k = 1, nlevs - do g = bounds%begg,bounds%endg - i = 1 + (g - bounds%begg) - data(i) = ldomain%area(g)/(re*re) - end do - end do - call mct_gGrid_importRattr(dom_clm,"area",data,lsize) - - do k = 1, nlevs - do g = bounds%begg,bounds%endg - i = 1 + (g - bounds%begg) - data(i) = real(ldomain%mask(g), r8) - end do - end do - call mct_gGrid_importRattr(dom_clm,"mask",data,lsize) - - do k = 1, nlevs - do g = bounds%begg,bounds%endg - i = 1 + (g - bounds%begg) - data(i) = real(ldomain%frac(g), r8) - end do - end do - call mct_gGrid_importRattr(dom_clm,"frac",data,lsize) - - deallocate(data) - deallocate(idata) - - end subroutine clm_domain_mct - -end module ndepStreamMod From 4cbc00d42ba54b07fd1992e7d574b94c29ae939b Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Tue, 21 May 2024 10:48:35 -0600 Subject: [PATCH 0284/1248] Remove another mct comment --- src/cpl/nuopc/lnd_import_export.F90 | 1 - 1 file changed, 1 deletion(-) diff --git a/src/cpl/nuopc/lnd_import_export.F90 b/src/cpl/nuopc/lnd_import_export.F90 index 11cc807640..b9966f81e9 100644 --- a/src/cpl/nuopc/lnd_import_export.F90 +++ b/src/cpl/nuopc/lnd_import_export.F90 @@ -248,7 +248,6 @@ subroutine advertise_fields(gcomp, flds_scalar_name, glc_present, cism_evolve, r if (shr_megan_mechcomps_n .ne. megan_nflds) call shr_sys_abort('ERROR: megan field count mismatch') ! CARMA volumetric soil water from land - ! TODO: is the following correct - the CARMA field exchange is very confusing in mct call shr_carma_readnl('drv_flds_in', carma_fields) ! export to atm From 854ff9d438aa24edb644459f31c89494ed4ee983 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Tue, 21 May 2024 10:50:43 -0600 Subject: [PATCH 0285/1248] Remove cime_config/testdefs/testmods_dirs/clm/nuopc_cap_bfb directory --- .../testdefs/testmods_dirs/clm/nuopc_cap_bfb/README | 10 ---------- .../testmods_dirs/clm/nuopc_cap_bfb/include_user_mods | 1 - .../testmods_dirs/clm/nuopc_cap_bfb/user_nl_cpl | 4 ---- 3 files changed, 15 deletions(-) delete mode 100644 cime_config/testdefs/testmods_dirs/clm/nuopc_cap_bfb/README delete mode 100644 cime_config/testdefs/testmods_dirs/clm/nuopc_cap_bfb/include_user_mods delete mode 100644 cime_config/testdefs/testmods_dirs/clm/nuopc_cap_bfb/user_nl_cpl diff --git a/cime_config/testdefs/testmods_dirs/clm/nuopc_cap_bfb/README b/cime_config/testdefs/testmods_dirs/clm/nuopc_cap_bfb/README deleted file mode 100644 index aefd8adee7..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/nuopc_cap_bfb/README +++ /dev/null @@ -1,10 +0,0 @@ -This testmod directory currently isn't used in any tests, but is useful -for the following reason: - -According to Mariana Vertenstein: At least at one point, you could get -bit-for-bit answers when comparing the mct and nuopc versions of CTSM in -an I compset with SROF and SGLC, if using the changes in this testmod in -both the mct and nuopc runs. - -So we are keeping this around in case someone wants to reproduce that -comparison. diff --git a/cime_config/testdefs/testmods_dirs/clm/nuopc_cap_bfb/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/nuopc_cap_bfb/include_user_mods deleted file mode 100644 index fe0e18cf88..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/nuopc_cap_bfb/include_user_mods +++ /dev/null @@ -1 +0,0 @@ -../default diff --git a/cime_config/testdefs/testmods_dirs/clm/nuopc_cap_bfb/user_nl_cpl b/cime_config/testdefs/testmods_dirs/clm/nuopc_cap_bfb/user_nl_cpl deleted file mode 100644 index 6bfefec90b..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/nuopc_cap_bfb/user_nl_cpl +++ /dev/null @@ -1,4 +0,0 @@ -orb_eccen = 0. -orb_mvelp = 0. -orb_obliq = 0. -orb_mode = "fixed_parameters" From 6b6ea52f5271866c525cef19c480c2c7bbc35031 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Tue, 21 May 2024 10:55:30 -0600 Subject: [PATCH 0286/1248] Remove mention of mct in README.NUOPC_driver.md --- README.NUOPC_driver.md | 6 ------ 1 file changed, 6 deletions(-) diff --git a/README.NUOPC_driver.md b/README.NUOPC_driver.md index 9eb5d5b2cb..6caf63a9bd 100644 --- a/README.NUOPC_driver.md +++ b/README.NUOPC_driver.md @@ -40,9 +40,3 @@ ESMF_PROFILING_LEVEL --- Verbosity level for ESMF profiling nuopc.runseq is a text file that determines how the driver operates. You can change the operation by having an updated copy in your case directory. - -## What if I want to use the MCT driver? - -The MCT driver is now removed. For more notes see: - -https://docs.google.com/presentation/d/1yjiKSEV53JDAJbYxhpY2T9GTxlWFzQAn From 40367c56210797ae6fe27991be8cb82f9708894d Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Tue, 21 May 2024 10:56:28 -0600 Subject: [PATCH 0287/1248] Remove an expected failure the mentions mct in 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 dc850d51ab..a29e55cc9e 100644 --- a/cime_config/testdefs/ExpectedTestFails.xml +++ b/cime_config/testdefs/ExpectedTestFails.xml @@ -143,13 +143,6 @@ - - - FAIL - #1887 - - - FAIL From e99eaeaba4a502277e4b2f99096b0e130cff46d8 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Tue, 21 May 2024 11:00:11 -0600 Subject: [PATCH 0288/1248] Add back mct to Externals.cfg --- Externals.cfg | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Externals.cfg b/Externals.cfg index cb2622dedf..8ef524bf24 100644 --- a/Externals.cfg +++ b/Externals.cfg @@ -69,6 +69,13 @@ repo_url = https://github.com/ESCOMP/CESM_share local_path = share required = True +[mct] +tag = MCT_2.11.0 +protocol = git +repo_url = https://github.com/MCSclimate/MCT +local_path = libraries/mct +required = True + [parallelio] tag = pio2_6_2 protocol = git From fed6805e85ca0c2ccb6eada9946f4c4f634f5e54 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Tue, 21 May 2024 11:05:10 -0600 Subject: [PATCH 0289/1248] Remove /test subdirectory --- test/tools/CLM_compare.sh | 39 ----- test/tools/Makefile | 12 -- test/tools/README | 73 ---------- test/tools/README.testnames | 69 --------- test/tools/TBLCFGtools.sh | 120 ---------------- test/tools/TBLscript_tools.sh | 122 ---------------- test/tools/TBLtools.sh | 119 --------------- test/tools/TCBCFGtools.sh | 135 ------------------ test/tools/TCBtools.sh | 121 ---------------- test/tools/TSMCFGtools.sh | 113 --------------- test/tools/TSMscript_tools.sh | 98 ------------- test/tools/TSMtools.sh | 117 --------------- test/tools/config_files/CFGtools__ds | 0 test/tools/config_files/README | 9 -- test/tools/config_files/tools__do | 1 - test/tools/config_files/tools__ds | 1 - test/tools/config_files/tools__o | 1 - test/tools/config_files/tools__s | 1 - test/tools/gen_test_table.sh | 80 ----------- test/tools/get_cprnc_diffs.sh | 56 -------- test/tools/input_tests_master | 32 ----- test/tools/nl_files/mesh_maker_fv09 | 1 - test/tools/nl_files/mkmapdata_if10 | 1 - test/tools/nl_files/mkmapdata_ne30np4 | 1 - .../nl_files/mkprocdata_ne30_to_f19_I2000 | 1 - test/tools/nl_files/modify_data_YELL | 1 - test/tools/nl_files/run_neon_OSBS | 1 - test/tools/nl_files/run_neon_YELL_PRISM | 1 - test/tools/nl_files/subset_data_KONA | 1 - test/tools/nl_files/subset_data_US-UMB | 1 - test/tools/nl_files/subset_data_YELL | 1 - .../nl_files/subset_data_f09_1x1pt_townshipSD | 1 - .../subset_data_f09_37x288pt_PanBoreal | 1 - .../subset_data_f09_4x9pt_AlaskaTananaValley | 1 - .../subset_data_f09_58x45pt_SouthAmerica | 1 - .../subset_data_f09_90x288pt_1850PanTropics | 1 - test/tools/show_var_diffs.sh | 79 ---------- test/tools/tests_posttag_hobart_nompi | 1 - test/tools/tests_posttag_nompi_regression | 1 - test/tools/tests_pretag_cheyenne_nompi | 3 - test/tools/tests_pretag_derecho_nompi | 9 -- test/tools/tests_pretag_nompi_neon | 8 -- 42 files changed, 1435 deletions(-) delete mode 100755 test/tools/CLM_compare.sh delete mode 100644 test/tools/Makefile delete mode 100644 test/tools/README delete mode 100644 test/tools/README.testnames delete mode 100755 test/tools/TBLCFGtools.sh delete mode 100755 test/tools/TBLscript_tools.sh delete mode 100755 test/tools/TBLtools.sh delete mode 100755 test/tools/TCBCFGtools.sh delete mode 100755 test/tools/TCBtools.sh delete mode 100755 test/tools/TSMCFGtools.sh delete mode 100755 test/tools/TSMscript_tools.sh delete mode 100755 test/tools/TSMtools.sh delete mode 100644 test/tools/config_files/CFGtools__ds delete mode 100644 test/tools/config_files/README delete mode 100644 test/tools/config_files/tools__do delete mode 100644 test/tools/config_files/tools__ds delete mode 100644 test/tools/config_files/tools__o delete mode 100644 test/tools/config_files/tools__s delete mode 100755 test/tools/gen_test_table.sh delete mode 100755 test/tools/get_cprnc_diffs.sh delete mode 100644 test/tools/input_tests_master delete mode 100644 test/tools/nl_files/mesh_maker_fv09 delete mode 100644 test/tools/nl_files/mkmapdata_if10 delete mode 100644 test/tools/nl_files/mkmapdata_ne30np4 delete mode 100644 test/tools/nl_files/mkprocdata_ne30_to_f19_I2000 delete mode 100644 test/tools/nl_files/modify_data_YELL delete mode 100644 test/tools/nl_files/run_neon_OSBS delete mode 100644 test/tools/nl_files/run_neon_YELL_PRISM delete mode 100644 test/tools/nl_files/subset_data_KONA delete mode 100644 test/tools/nl_files/subset_data_US-UMB delete mode 100644 test/tools/nl_files/subset_data_YELL delete mode 100644 test/tools/nl_files/subset_data_f09_1x1pt_townshipSD delete mode 100644 test/tools/nl_files/subset_data_f09_37x288pt_PanBoreal delete mode 100644 test/tools/nl_files/subset_data_f09_4x9pt_AlaskaTananaValley delete mode 100644 test/tools/nl_files/subset_data_f09_58x45pt_SouthAmerica delete mode 100644 test/tools/nl_files/subset_data_f09_90x288pt_1850PanTropics delete mode 100755 test/tools/show_var_diffs.sh delete mode 100644 test/tools/tests_posttag_hobart_nompi delete mode 100644 test/tools/tests_posttag_nompi_regression delete mode 100644 test/tools/tests_pretag_cheyenne_nompi delete mode 100644 test/tools/tests_pretag_derecho_nompi delete mode 100644 test/tools/tests_pretag_nompi_neon diff --git a/test/tools/CLM_compare.sh b/test/tools/CLM_compare.sh deleted file mode 100755 index 38f547c3ab..0000000000 --- a/test/tools/CLM_compare.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/sh -# - -if [ $# -ne 2 ]; then - echo "CLM_compare.sh: incorrect number of input arguments" - exit 1 -fi - -echo "CLM_compare.sh: comparing $1 " -echo " with $2" - -##note syntax here as stderr and stdout from cprnc command go -##to separate places! -${CPRNC_EXE} ${CPRNC_OPT} $1 $2 2>&1 > cprnc.out -rc=$? -if [ $rc -ne 0 ]; then - echo "CLM_compare.sh: error doing comparison, cprnc error= $rc" - exit 2 -fi - -result_old=`perl -e 'while (my $ll = <>) \ - { if ($ll =~ /(\d+)[^0-9]+compared[^0-9]+(\d+)/) \ - { print "PASS" if $1>0 && $2==0 }}' cprnc.out` -if grep -c "the two files seem to be IDENTICAL" cprnc.out > /dev/null; then - result=PASS -elif grep -c "the two files seem to be DIFFERENT" cprnc.out > /dev/null; then - result=FAIL -else - result=$result_old -fi - -if [ "$result" = "PASS" ]; then - echo "CLM_compare.sh: files are b4b" -else - echo "CLM_compare.sh: files are NOT b4b" - exit 3 -fi - -exit 0 diff --git a/test/tools/Makefile b/test/tools/Makefile deleted file mode 100644 index b5031abdba..0000000000 --- a/test/tools/Makefile +++ /dev/null @@ -1,12 +0,0 @@ -# -# Makefile to build clm testing documentation -# - -# Get list of tests_ files -SOURCES = $(wildcard tests_*) - -all: test_table.html - -test_table.html: $(SOURCES) - gen_test_table.sh - diff --git a/test/tools/README b/test/tools/README deleted file mode 100644 index c545f625b8..0000000000 --- a/test/tools/README +++ /dev/null @@ -1,73 +0,0 @@ -$CTSMROOT/clm/test/tools/README 06/08/2018 - -Scripts for testing the CLM support tools with many different -configurations and run-time options. - -I. MAIN SCRIPTS: - -test_driver.sh - Test the CLM offline tools - -To use... - -./test_driver.sh -i - -on Derecho - -qcmd -l walltime=08:00:00 -- ./test_driver.sh -i >& run.out & - -And to for example to compare to another baseline code (in this case ctsm5.1.dev066, which would need to be cloned at the given -path) ... - -qcmd -l walltime=08:00:00 -- env BL_ROOT=/glade/scratch/erik/ctsm5.1.dev066 ./test_driver.sh -i >& run.out & - -on izumi - -nohup ./test_driver.sh -i >& run.out & - -release tests - -qcmd -l walltime=10:00:00 -- env CLM_INPUT_TESTS=`pwd`/tests_posttag_nompi_regression \ -./test_driver.sh -i >& run_regress.out & - -To run neon-specific tests, please use login nodes: -env CLM_INPUT_TESTS=`pwd`/tests_pretag_nompi_neon ./test_driver.sh -i > & run_neon.out & - - -Intended for use on NCAR machines Derecho, Casper (DAV) and izumi. - -II. RUNNING test_driver.sh TOOLS TESTING: - -Basic use: - -./test_driver.sh -i -./test_driver.sh -h # to get help on options - -Important environment variables (just used by test_driver.sh) - -BL_ROOT ---------------- Root directory of CLM baseline code to compare to - (if not set BL test will not be performed) -BL_TESTDIR ------------- Root directory of where to put baseline tests -CLM_INPUT_TESTS -------- Filename of file with list of tests to perform -CLM_TESTDIR ------------ Root directory of where to put most tests -CLM_RETAIN_FILES ------- If set to TRUE -- don't cleanup files after testing -CLM_FC ----------------- Use given compiler -CLM_JOBID -------------- Job identification number to use (rather than process ID) -CLM_THREADS ------------ Number of open-MP threads to use - (by default this is set differently by machine) -CLM_SOFF --------------- If set to TRUE -- stop on first failed test (default FALSE) - -Important files for test_driver tools testing: - -test_driver.sh ------- Main test script for tools -nl_files ------------- Directory with various namelists to test -config_files --------- Directory with various configurations to test -input_tests_master --- Master list of tests -tests_pretag_* ------- Tests for specific machines to do by default before a tag is done -tests_posttag_* ------ Tests for specific machines to do for more extensive testing - after a tag is done -CLM_compare.sh ------- Compares output history files between two cases -T*.sh ---------------- Basic test script to do a specific type of test -gen_test_table.sh ---- Creates HTML table of tests -Makefile ------------- Will build the HTML table of tests - -../../tools/README.testing - Information on how the testing works for the CLM tools diff --git a/test/tools/README.testnames b/test/tools/README.testnames deleted file mode 100644 index 74dbe8e5f3..0000000000 --- a/test/tools/README.testnames +++ /dev/null @@ -1,69 +0,0 @@ -Tests for test_driver are for the CLM tools only. - -Test naming conventions for the test_driver.sh script: - -Test names are: - -xxnmi - -Where: xx is the two-letter test type - sm=smoke, br=branch, er=exact restart, bl=base-line comparision, - cb=configure-build, rp=reproducibility, op=OpenMP threading for tools - -n is the configuration type: - -1 -- unused -2 -- unused -3 -- unused -4 -- unused -5 -- unused -6 -- unused -7 -- unused -8 -- unused -9 -- mesh_maker -0 -- run_neon -a -- modify_data -b -- subset_data -c -- mkprocdata_map -d -- mkmapgrids -e -- unused -f -- unused -g -- unused -h -- unused -i -- tools scripts - -m is the resolution - -0 -- 0.9x1.25 -1 -- 48x96 -5 -- 10x15 -6 -- 5x5_amazon -7 -- 1x1 brazil -8 -- US-UMB -9 -- 4x5 -a -- NEON YELL -b -- NEON KONA -c -- NEON OSBS -d -- SouthAmerica -e -- 1850PanTropics -f -- PanBoreal -g -- AlaskaTananaValley -h -- single point from the 0.9x1.25 grid (Township SD) -y -- 1.9x2.5 with transient 1850-2100 for rcp=2.6 and glacier-MEC on -T -- 1x1_numaIA -Z -- 10x15 with crop on -@ -- ne120np4 -# -- ne30np4 - -i is the specific test (usually this implies...) - -1 -- Serial script -2 -- Serial -3 -- OpenMP only -4 -- serial, DEBUG -7 -- OpenMP only second test, DEBUG -8 -- OpenMP only third test, DEBUG -9 -- Serial Script -0 -- Serial Script - - diff --git a/test/tools/TBLCFGtools.sh b/test/tools/TBLCFGtools.sh deleted file mode 100755 index 6276c885e2..0000000000 --- a/test/tools/TBLCFGtools.sh +++ /dev/null @@ -1,120 +0,0 @@ -#!/bin/sh -# - -if [ $# -ne 3 ]; then - echo "TBLCFGtools.sh: incorrect number of input arguments" - exit 1 -fi - -if [ -z "$BL_ROOT" ] && [ -z "$BL_TESTDIR" ]; then - echo "TBL.sh: no environment variables set for baseline test - will skip" - exit 255 -fi - -tool=$(basename $1) -test_name=TBLCFGtools.$tool.$2.$3 - -if [ -f ${CLM_TESTDIR}/${test_name}/TestStatus ]; then - if grep -c PASS ${CLM_TESTDIR}/${test_name}/TestStatus > /dev/null; then - echo "TBLCFGtools.sh: smoke test has already passed; results are in " - echo " ${CLM_TESTDIR}/${test_name}" - exit 0 - elif grep -c GEN ${CLM_TESTDIR}/${test_name}/TestStatus > /dev/null; then - echo "TBLCFGtools.sh: test already generated" - else - read fail_msg < ${CLM_TESTDIR}/${test_name}/TestStatus - prev_jobid=${fail_msg#*job} - - if [ $JOBID = $prev_jobid ]; then - echo "TBLCFGtools.sh: smoke test has already failed for this job - will not reattempt; " - echo " results are in: ${CLM_TESTDIR}/${test_name}" - exit 2 - else - echo "TBLCFGtools.sh: this smoke test failed under job ${prev_jobid} - moving those results to " - echo " ${CLM_TESTDIR}/${test_name}_FAIL.job$prev_jobid and trying again" - cp -rp ${CLM_TESTDIR}/${test_name} ${CLM_TESTDIR}/${test_name}_FAIL.job$prev_jobid - fi - fi -fi - -rundir=${CLM_TESTDIR}/${test_name} -if [ -d ${rundir} ]; then - rm -r ${rundir} -fi -mkdir -p ${rundir} -if [ $? -ne 0 ]; then - echo "TBLCFGtools.sh: error, unable to create work subdirectory" - exit 3 -fi -cd ${rundir} - -echo "TBLCFGtools.sh: calling TSMCFGtools.sh to run $tool executable" -${CLM_SCRIPTDIR}/TSMCFGtools.sh $1 $2 $3 -rc=$? -if [ $rc -ne 0 ]; then - echo "TBLCFGtools.sh: error from TSMCFGtools.sh= $rc" - echo "FAIL.job${JOBID}" > TestStatus - exit 4 -fi - -if [ -n "${BL_ROOT}" ]; then - if [ -z "$BL_TESTDIR" ]; then - BL_TESTDIR=${CLM_TESTDIR}.bl - fi - echo "TBLCFGtools.sh: generating baseline data from root $BL_ROOT - results in $BL_TESTDIR" - - echo "TBLCFGtools.sh: calling ****baseline**** TSMCFGtools.sh for smoke test" - bl_dir=`/bin/ls -1d ${BL_ROOT}/test/tools` - env CLM_TESTDIR=${BL_TESTDIR} \ - CLM_ROOT=${BL_ROOT} \ - CLM_SCRIPTDIR=$bl_dir \ - $bl_dir/TSMCFGtools.sh $1 $2 $3 - rc=$? - if [ $rc -ne 0 ]; then - echo "TBLCFGtools.sh: error from *baseline* TSMCFGtools.sh= $rc" - echo "FAIL.job${JOBID}" > TestStatus - exit 5 - fi -fi - -echo "TBLCFGtools.sh: starting b4b comparisons " -files_to_compare=`cd ${CLM_TESTDIR}/TSMCFGtools.$tool.$2.$3; ls *.nc` -if [ -z "${files_to_compare}" ] && [ "$debug" != "YES" ]; then - echo "TBLCFGtools.sh: error locating files to compare" - echo "FAIL.job${JOBID}" > TestStatus - exit 6 -fi - -all_comparisons_good="TRUE" -for compare_file in ${files_to_compare}; do - - env CPRNC_OPT="-m" \ - ${CLM_SCRIPTDIR}/CLM_compare.sh \ - ${BL_TESTDIR}/TSMCFGtools.$tool.$2.$3/${compare_file} \ - ${CLM_TESTDIR}/TSMCFGtools.$tool.$2.$3/${compare_file} - rc=$? - mv cprnc.out cprnc.${compare_file}.out - if [ $rc -eq 0 ]; then - echo "TBLCFGtools.sh: comparison successful; output in ${rundir}/cprnc.${compare_file}.out" - else - echo "TBLCFGtools.sh: error from CLM_compare.sh= $rc; see ${rundir}/cprnc.${compare_file}.out for details -" - all_comparisons_good="FALSE" - fi -done - -if [ ${all_comparisons_good} = "TRUE" ]; then - echo "TBLCFGtools.sh: baseline test passed" - echo "PASS" > TestStatus - if [ $CLM_RETAIN_FILES != "TRUE" ]; then - echo "TBLCFGtools.sh: removing some unneeded files to save disc space" - rm *.nc - rm *.r* - fi -else - echo "TBLCFGtools.sh: at least one file comparison did not pass" - echo "FAIL.job${JOBID}" > TestStatus - exit 7 -fi - -exit 0 diff --git a/test/tools/TBLscript_tools.sh b/test/tools/TBLscript_tools.sh deleted file mode 100755 index d05492c687..0000000000 --- a/test/tools/TBLscript_tools.sh +++ /dev/null @@ -1,122 +0,0 @@ -#!/bin/sh -# - -if [ $# -ne 3 ]; then - echo "TBLscript_tools.sh: incorrect number of input arguments" - exit 1 -fi - -if [ -z "$BL_ROOT" ] && [ -z "$BL_TESTDIR" ]; then - echo "TBLscript_tools.sh: no environment variables set for baseline test - will skip" - exit 255 -fi - -test_name=TBLscript_tools.$1.$2.$3 - -if [ -f ${CLM_TESTDIR}/${test_name}/TestStatus ]; then - if grep -c PASS ${CLM_TESTDIR}/${test_name}/TestStatus > /dev/null; then - echo "TBLscript_tools.sh: smoke test has already passed; results are in " - echo " ${CLM_TESTDIR}/${test_name}" - exit 0 - elif grep -c GEN ${CLM_TESTDIR}/${test_name}/TestStatus > /dev/null; then - echo "TBLscript_tools.sh: test already generated" - else - read fail_msg < ${CLM_TESTDIR}/${test_name}/TestStatus - prev_jobid=${fail_msg#*job} - - if [ $JOBID = $prev_jobid ]; then - echo "TBLscript_tools.sh: smoke test has already failed for this job - will not reattempt; " - echo " results are in: ${CLM_TESTDIR}/${test_name}" - exit 2 - else - echo "TBLscript_tools.sh: this smoke test failed under job ${prev_jobid} - moving those results to " - echo " ${CLM_TESTDIR}/${test_name}_FAIL.job$prev_jobid and trying again" - cp -rp ${CLM_TESTDIR}/${test_name} ${CLM_TESTDIR}/${test_name}_FAIL.job$prev_jobid - fi - fi -fi - -rundir=${CLM_TESTDIR}/${test_name} -if [ -d ${rundir} ]; then - rm -r ${rundir} -fi -mkdir -p ${rundir} -if [ $? -ne 0 ]; then - echo "TBLscript_tools.sh: error, unable to create work subdirectory" - exit 3 -fi -cd ${rundir} - -echo "TBLscript_tools.sh: calling TSMscript_tools.sh to run $1 executable" -${CLM_SCRIPTDIR}/TSMscript_tools.sh $1 $2 $3 -rc=$? -if [ $rc -ne 0 ]; then - echo "TBLscript_tools.sh: error from TSMtools.sh= $rc" - echo "FAIL.job${JOBID}" > TestStatus - exit 4 -fi - -if [ -n "${BL_ROOT}" ]; then - if [ -z "$BL_TESTDIR" ]; then - BL_TESTDIR=${CLM_TESTDIR}.bl - fi - echo "TBLscript_tools.sh: generating baseline data from root $BL_ROOT - results in $BL_TESTDIR" - - echo "TBLscript_tools.sh: calling ****baseline**** TSMtools.sh for smoke test" - bl_dir=`/bin/ls -1d ${BL_ROOT}/test/tools` - env CLM_TESTDIR=${BL_TESTDIR} \ - CLM_SCRIPTDIR=$bl_dir \ - CLM_ROOT=$BL_ROOT \ - CTSM_ROOT=$BL_ROOT \ - CIME_ROOT=$BL_ROOT/cime \ - $bl_dir/TSMscript_tools.sh $1 $2 $3 - rc=$? - if [ $rc -ne 0 ]; then - echo "TBLscript_tools.sh: error from *baseline* TSMscript_tools.sh= $rc" - echo "FAIL.job${JOBID}" > TestStatus - exit 5 - fi -fi - -echo "TBLscript_tools.sh: starting b4b comparisons " -files_to_compare=`cd ${CLM_TESTDIR}/TSMscript_tools.$1.$2.$3; ls *.nc` -if [ -z "${files_to_compare}" ] && [ "$debug" != "YES" ]; then - echo "TBLscript_tools.sh: error locating files to compare" - echo "FAIL.job${JOBID}" > TestStatus - exit 6 -fi - -all_comparisons_good="TRUE" -for compare_file in ${files_to_compare}; do - - env CPRNC_OPT="-m" \ - ${CLM_SCRIPTDIR}/CLM_compare.sh \ - ${BL_TESTDIR}/TSMscript_tools.$1.$2.$3/${compare_file} \ - ${CLM_TESTDIR}/TSMscript_tools.$1.$2.$3/${compare_file} - rc=$? - mv cprnc.out cprnc.${compare_file}.out - if [ $rc -eq 0 ]; then - echo "TBLscript_tools.sh: comparison successful; output in ${rundir}/cprnc.${compare_file}.out" - else - echo "TBLscript_tools.sh: error from CLM_compare.sh= $rc; see ${rundir}/cprnc.${compare_file}.out for details" - all_comparisons_good="FALSE" - fi -done - -if [ ${all_comparisons_good} = "TRUE" ]; then - echo "TBLscript_tools.sh: baseline test passed" - echo "PASS" > TestStatus - if [ $CLM_RETAIN_FILES != "TRUE" ]; then - echo "TBLscript_tools.sh: removing some unneeded files to save disc space" - rm *.nc - rm *.r* - fi -else - echo "TBLscript_tools.sh: at least one file comparison did not pass" - echo "FAIL.job${JOBID}" > TestStatus - exit 7 -fi - - - -exit 0 diff --git a/test/tools/TBLtools.sh b/test/tools/TBLtools.sh deleted file mode 100755 index 555ea7d1be..0000000000 --- a/test/tools/TBLtools.sh +++ /dev/null @@ -1,119 +0,0 @@ -#!/bin/sh -# - -if [ $# -ne 3 ]; then - echo "TBLtools.sh: incorrect number of input arguments" - exit 1 -fi - -if [ -z "$BL_ROOT" ] && [ -z "$BL_TESTDIR" ]; then - echo "TBL.sh: no environment variables set for baseline test - will skip" - exit 255 -fi - -test_name=TBLtools.$1.$2.$3 - -if [ -f ${CLM_TESTDIR}/${test_name}/TestStatus ]; then - if grep -c PASS ${CLM_TESTDIR}/${test_name}/TestStatus > /dev/null; then - echo "TBLtools.sh: smoke test has already passed; results are in " - echo " ${CLM_TESTDIR}/${test_name}" - exit 0 - elif grep -c GEN ${CLM_TESTDIR}/${test_name}/TestStatus > /dev/null; then - echo "TBLtools.sh: test already generated" - else - read fail_msg < ${CLM_TESTDIR}/${test_name}/TestStatus - prev_jobid=${fail_msg#*job} - - if [ $JOBID = $prev_jobid ]; then - echo "TBLtools.sh: smoke test has already failed for this job - will not reattempt; " - echo " results are in: ${CLM_TESTDIR}/${test_name}" - exit 2 - else - echo "TBLtools.sh: this smoke test failed under job ${prev_jobid} - moving those results to " - echo " ${CLM_TESTDIR}/${test_name}_FAIL.job$prev_jobid and trying again" - cp -rp ${CLM_TESTDIR}/${test_name} ${CLM_TESTDIR}/${test_name}_FAIL.job$prev_jobid - fi - fi -fi - -rundir=${CLM_TESTDIR}/${test_name} -if [ -d ${rundir} ]; then - rm -r ${rundir} -fi -mkdir -p ${rundir} -if [ $? -ne 0 ]; then - echo "TBLtools.sh: error, unable to create work subdirectory" - exit 3 -fi -cd ${rundir} - -echo "TBLtools.sh: calling TSMtools.sh to run $1 executable" -${CLM_SCRIPTDIR}/TSMtools.sh $1 $2 $3 -rc=$? -if [ $rc -ne 0 ]; then - echo "TBLtools.sh: error from TSMtools.sh= $rc" - echo "FAIL.job${JOBID}" > TestStatus - exit 4 -fi - -if [ -n "${BL_ROOT}" ]; then - if [ -z "$BL_TESTDIR" ]; then - BL_TESTDIR=${CLM_TESTDIR}.bl - fi - echo "TBLtools.sh: generating baseline data from root $BL_ROOT - results in $BL_TESTDIR" - - echo "TBLtools.sh: calling ****baseline**** TSMtools.sh for smoke test" - bl_dir=`/bin/ls -1d ${BL_ROOT}/test/tools` - env CLM_TESTDIR=${BL_TESTDIR} \ - CLM_ROOT=${BL_ROOT} \ - CLM_SCRIPTDIR=$bl_dir \ - $bl_dir/TSMtools.sh $1 $2 $3 - rc=$? - if [ $rc -ne 0 ]; then - echo "TBLtools.sh: error from *baseline* TSMtools.sh= $rc" - echo "FAIL.job${JOBID}" > TestStatus - exit 5 - fi -fi - -echo "TBLtools.sh: starting b4b comparisons " -files_to_compare=`cd ${CLM_TESTDIR}/TSMtools.$1.$2.$3; ls *.nc` -if [ -z "${files_to_compare}" ] && [ "$debug" != "YES" ]; then - echo "TBLtools.sh: error locating files to compare" - echo "FAIL.job${JOBID}" > TestStatus - exit 6 -fi - -all_comparisons_good="TRUE" -for compare_file in ${files_to_compare}; do - - env CPRNC_OPT="-m" \ - ${CLM_SCRIPTDIR}/CLM_compare.sh \ - ${BL_TESTDIR}/TSMtools.$1.$2.$3/${compare_file} \ - ${CLM_TESTDIR}/TSMtools.$1.$2.$3/${compare_file} - rc=$? - mv cprnc.out cprnc.${compare_file}.out - if [ $rc -eq 0 ]; then - echo "TBLtools.sh: comparison successful; output in ${rundir}/cprnc.${compare_file}.out" - else - echo "TBLtools.sh: error from CLM_compare.sh= $rc; see ${rundir}/cprnc.${compare_file}.out for details -" - all_comparisons_good="FALSE" - fi -done - -if [ ${all_comparisons_good} = "TRUE" ]; then - echo "TBLtools.sh: baseline test passed" - echo "PASS" > TestStatus - if [ $CLM_RETAIN_FILES != "TRUE" ]; then - echo "TBLtools.sh: removing some unneeded files to save disc space" - rm *.nc - rm *.r* - fi -else - echo "TBLtools.sh: at least one file comparison did not pass" - echo "FAIL.job${JOBID}" > TestStatus - exit 7 -fi - -exit 0 diff --git a/test/tools/TCBCFGtools.sh b/test/tools/TCBCFGtools.sh deleted file mode 100755 index 5c0b015123..0000000000 --- a/test/tools/TCBCFGtools.sh +++ /dev/null @@ -1,135 +0,0 @@ -#!/bin/sh -# - -if [ $# -ne 2 ]; then - echo "TCBCFGtools.sh: incorrect number of input arguments" - exit 1 -fi - -tool=$(basename $1) -test_name=TCBCFGtools.$tool.$2 - -if [ -f ${CLM_TESTDIR}/${test_name}/TestStatus ]; then - if grep -c PASS ${CLM_TESTDIR}/${test_name}/TestStatus > /dev/null; then - echo "TCBCFGtools.sh: build test has already passed; results are in " - echo " ${CLM_TESTDIR}/${test_name}" - exit 0 - elif grep -c GEN ${CLM_TESTDIR}/${test_name}/TestStatus > /dev/null; then - echo "TCBCFGtools.sh: test already generated" - else - read fail_msg < ${CLM_TESTDIR}/${test_name}/TestStatus - prev_jobid=${fail_msg#*job} - - if [ $JOBID = $prev_jobid ]; then - echo "TCBCFGtools.sh: build test has already failed for this job - will not reattempt; " - echo " results are in: ${CLM_TESTDIR}/${test_name}" - exit 2 - else - echo "TCBCFGtools.sh: this build test failed under job ${prev_jobid} - moving those results to " - echo " ${CLM_TESTDIR}/${test_name}_FAIL.job$prev_jobid and trying again" - cp -rp ${CLM_TESTDIR}/${test_name} ${CLM_TESTDIR}/${test_name}_FAIL.job$prev_jobid - fi - fi -fi - -cfgdir=`ls -1d ${CLM_ROOT}/tools/${1}` -if [ $? -ne 0 ];then - cfgdir=`ls -1d ${CIME_ROOT}/tools/mapping/${1}*` - echo "use: $cfgdir" -fi -blddir=${CLM_TESTDIR}/${test_name}/src -if [ -d ${blddir} ]; then - rm -r ${blddir} -fi -mkdir -p ${blddir} -if [ $? -ne 0 ]; then - echo "TCBCFGtools.sh: error, unable to create work subdirectory" - exit 3 -fi -cd ${blddir} - -echo "TCBCFGtools.sh: building $tool executable; output in ${blddir}/test.log" -# -# Copy build files over -# -cp $cfgdir/src/Makefile . -cp $cfgdir/src/Filepath . -# -# Add cfgdir path to beginning of each path in Filepath -# -touch Filepath -while read filepath_arg; do - echo "${cfgdir}/src/${filepath_arg}" >> Filepath -done < ${cfgdir}/src/Filepath - -# -# Figure out configuration -# -if [ ! -f ${CLM_SCRIPTDIR}/config_files/$tool ]; then - echo "TCB.sh: configure options file ${CLM_SCRIPTDIR}/config_files/$tool not found" - echo "FAIL.job${JOBID}" > TestStatus - exit 4 -fi - -##construct string of args to configure -config_string=" " -while read config_arg; do - config_string="${config_string}${config_arg} " -done < ${CLM_SCRIPTDIR}/config_files/$tool - -if [ "$TOOLSLIBS" != "" ]; then - export SLIBS=$TOOLSLIBS -fi -echo "env CIMEROOT=$CLM_ROOT/cime COMPILER=$CESM_COMP $config_string $CLM_ROOT/cime/tools/configure --macros-format Makefile --machine $CESM_MACH $TOOLS_CONF_STRING" -env CIMEROOT=$CLM_ROOT/cime COMPILER=$CESM_COMP $config_string $CLM_ROOT/cime/tools/configure --macros-format Makefile --machine $CESM_MACH $TOOLS_CONF_STRING >> test.log 2>&1 -rc=$? -if [ $rc -ne 0 ]; then - echo "TCBCFGtools.sh: configure failed, error from configure= $rc" - echo "TCBCFGtools.sh: see ${blddir}/test.log for details" - echo "FAIL.job${JOBID}" > TestStatus - exit 5 -fi - -. $INITMODULES -. ./.env_mach_specific.sh - -attempt=1 -still_compiling="TRUE" -while [ $still_compiling = "TRUE" ]; do - - echo "TCBCFGtools.sh: call to make:" - echo " ${MAKE_CMD} USER_CPPDEFS=-DLINUX" - if [ "$debug" != "YES" ]; then - ${MAKE_CMD} USER_CPPDEFS=-DLINUX >> test.log 2>&1 - status="PASS" - rc=$? - else - status="GEN" - rc=0 - fi - if [ $rc -eq 0 ]; then - echo "TCBCFGtools.sh: make was successful" - echo "TCBCFGtools.sh: configure and build test passed" - echo "$status" > TestStatus - if [ $CLM_RETAIN_FILES != "TRUE" ]; then - echo "TCBCFGtools.sh: removing some unneeded files to save disc space" - rm *.o - rm *.mod - fi - still_compiling="FALSE" - elif [ $attempt -lt 10 ] && \ - grep -c "LICENSE MANAGER PROBLEM" test.log > /dev/null; then - attempt=`expr $attempt + 1` - echo "TCBCFGtools.sh: encountered License Manager Problem; launching attempt #$attempt" - else - echo "TCBCFGtools.sh: clm build failed, error from make= $rc" - echo "TCBCFGtools.sh: see ${blddir}/test.log for details" - echo "FAIL.job${JOBID}" > TestStatus - exit 6 - fi -done -if [ "$TOOLSLIBS" != "" ]; then - export -n SLIBS -fi - -exit 0 diff --git a/test/tools/TCBtools.sh b/test/tools/TCBtools.sh deleted file mode 100755 index 205b2e9da0..0000000000 --- a/test/tools/TCBtools.sh +++ /dev/null @@ -1,121 +0,0 @@ -#!/bin/sh -# - -if [ $# -ne 2 ]; then - echo "TCBtools.sh: incorrect number of input arguments" - exit 1 -fi - -test_name=TCBtools.$1.$2 - -if [ -f ${CLM_TESTDIR}/${test_name}/TestStatus ]; then - if grep -c PASS ${CLM_TESTDIR}/${test_name}/TestStatus > /dev/null; then - echo "TCBtools.sh: build test has already passed; results are in " - echo " ${CLM_TESTDIR}/${test_name}" - exit 0 - elif grep -c GEN ${CLM_TESTDIR}/${test_name}/TestStatus > /dev/null; then - echo "TCBtools.sh: test already generated" - else - read fail_msg < ${CLM_TESTDIR}/${test_name}/TestStatus - prev_jobid=${fail_msg#*job} - - if [ $JOBID = $prev_jobid ]; then - echo "TCBtools.sh: build test has already failed for this job - will not reattempt; " - echo " results are in: ${CLM_TESTDIR}/${test_name}" - exit 2 - else - echo "TCBtools.sh: this build test failed under job ${prev_jobid} - moving those results to " - echo " ${CLM_TESTDIR}/${test_name}_FAIL.job$prev_jobid and trying again" - cp -rp ${CLM_TESTDIR}/${test_name} ${CLM_TESTDIR}/${test_name}_FAIL.job$prev_jobid - fi - fi -fi - -cfgdir=`ls -1d ${CLM_ROOT}/tools/$1` -blddir=${CLM_TESTDIR}/${test_name}/src -if [ -d ${blddir} ]; then - rm -r ${blddir} -fi -mkdir -p ${blddir} -if [ $? -ne 0 ]; then - echo "TCBtools.sh: error, unable to create work subdirectory" - exit 3 -fi -cd ${blddir} - -echo "TCBtools.sh: building $1 executable; output in ${blddir}/test.log" -# -# Copy build files over -# -cp $cfgdir/src/Makefile . -cp $cfgdir/src/Srcfiles . -cp $cfgdir/src/Mkdepends . -cp $cfgdir/src/Makefile.common . -# -# Add cfgdir path to beginning of each path in Filepath -# -touch Filepath -while read filepath_arg; do - echo "${cfgdir}/src/${filepath_arg}" >> Filepath -done < ${cfgdir}/src/Filepath - -# -# Figure out configuration -# -if [ ! -f ${CLM_SCRIPTDIR}/config_files/$2 ]; then - echo "TCB.sh: configure options file ${CLM_SCRIPTDIR}/config_files/$2 not found" - echo "FAIL.job${JOBID}" > TestStatus - exit 4 -fi - -##construct string of args to configure -config_string="$TOOLS_MAKE_STRING TOOLROOT=$cfgdir " -while read config_arg; do - config_string="${config_string}${config_arg} " -done < ${CLM_SCRIPTDIR}/config_files/$2 - -attempt=1 -still_compiling="TRUE" -if [ "$TOOLSLIBS" != "" ]; then - export SLIBS=$TOOLSLIBS -fi -while [ $still_compiling = "TRUE" ]; do - - ln -s Macros.make Macros - - echo "TCBtools.sh: call to make:" - echo " ${MAKE_CMD} ${config_string} " - if [ "$debug" != "YES" ]; then - ${MAKE_CMD} ${config_string} >> test.log 2>&1 - status="PASS" - rc=$(( $rc + $? )) - else - status="GEN" - rc=0 - fi - if [ $rc -eq 0 ]; then - echo "TCBtools.sh: make was successful" - echo "TCBtools.sh: configure and build test passed" - echo "$status" > TestStatus - if [ $CLM_RETAIN_FILES != "TRUE" ]; then - echo "TCBtools.sh: removing some unneeded files to save disc space" - rm *.o - rm *.mod - fi - still_compiling="FALSE" - elif [ $attempt -lt 10 ] && \ - grep -c "LICENSE MANAGER PROBLEM" test.log > /dev/null; then - attempt=`expr $attempt + 1` - echo "TCBtools.sh: encountered License Manager Problem; launching attempt #$attempt" - else - echo "TCBtools.sh: clm build failed, error from make= $rc" - echo "TCBtools.sh: see ${CLM_TESTDIR}/${test_name}/test.log for details" - echo "FAIL.job${JOBID}" > TestStatus - exit 6 - fi -done -if [ "$TOOLSLIBS" != "" ]; then - export -n SLIBS -fi - -exit 0 diff --git a/test/tools/TSMCFGtools.sh b/test/tools/TSMCFGtools.sh deleted file mode 100755 index b667a4c6ec..0000000000 --- a/test/tools/TSMCFGtools.sh +++ /dev/null @@ -1,113 +0,0 @@ -#!/bin/sh -# - -if [ $# -ne 3 ]; then - echo "TSMCFGtools.sh: incorrect number of input arguments" - exit 1 -fi - -tool=$(basename $1) -test_name=TSMCFGtools.$tool.$2.$3 - - -if [ -z "$CLM_RERUN" ]; then - CLM_RERUN="no" -fi - -if [ "$CLM_RERUN" != "yes" ] && [ -f ${CLM_TESTDIR}/${test_name}/TestStatus ]; then - if grep -c PASS ${CLM_TESTDIR}/${test_name}/TestStatus > /dev/null; then - echo "TSMCFGtools.sh: smoke test has already passed; results are in " - echo " ${CLM_TESTDIR}/${test_name}" - exit 0 - elif grep -c GEN ${CLM_TESTDIR}/${test_name}/TestStatus > /dev/null; then - echo "TSMCFGtools.sh: test already generated" - else - read fail_msg < ${CLM_TESTDIR}/${test_name}/TestStatus - prev_jobid=${fail_msg#*job} - - if [ $JOBID = $prev_jobid ]; then - echo "TSMCFGtools.sh: smoke test has already failed for this job - will not reattempt; " - echo " results are in: ${CLM_TESTDIR}/${test_name}" - exit 2 - else - echo "TSMCFGtools.sh: this smoke test failed under job ${prev_jobid} - moving those results to " - echo " ${CLM_TESTDIR}/${test_name}_FAIL.job$prev_jobid and trying again" - cp -rp ${CLM_TESTDIR}/${test_name} ${CLM_TESTDIR}/${test_name}_FAIL.job$prev_jobid - fi - fi -fi - -cfgdir=`ls -1d ${CLM_ROOT}/tools/${1}*` -rundir=${CLM_TESTDIR}/${test_name} -if [ -d ${rundir} ]; then - rm -r ${rundir} -fi -mkdir -p ${rundir} -if [ $? -ne 0 ]; then - echo "TSMCFGtools.sh: error, unable to create work subdirectory" - exit 3 -fi -cd ${rundir} - -echo "TSMCFGtools.sh: calling TCBCFGtools.sh to prepare $tool executable" -${CLM_SCRIPTDIR}/TCBCFGtools.sh $1 $2 -rc=$? -if [ $rc -ne 0 ]; then - echo "TSMCFGtools.sh: error from TCBtools.sh= $rc" - echo "FAIL.job${JOBID}" > TestStatus - exit 4 -fi - -echo "TSMCFGtools.sh: running $tool output in ${rundir}/test.log" - -if [ "$2" = "CFGtools__o" ] || [ "$2" = "CFGtools__do" ]; then - toolrun="env OMP_NUM_THREADS=${CLM_THREADS} ${CLM_TESTDIR}/TCBCFGtools.$tool.$2/${tool}*" -else - toolrun="${CLM_TESTDIR}/TCBCFGtools.$tool.$2/${tool}*" -fi - -runfile="${CLM_SCRIPTDIR}/nl_files/$tool.$3" -if [ ! -f "${runfile}" ]; then - echo "TSMCFGtools.sh: error ${runfile} input run file not found" - echo "FAIL.job${JOBID}" > TestStatus - exit 5 -fi - -echo "Run file type = ${3#*.}" -if [ ${3#*.} == "runoptions" ]; then - runopts=`cat ${runfile} | sed -e "s|CSMDATA|$CSMDATA|g"` - echo "$toolrun $runopts" - cp $cfgdir/*.nc . - if [ "$debug" != "YES" ] && [ "$compile_only" != "YES" ]; then - $toolrun $runopts >> test.log 2>&1 - rc=$? - status="PASS" - else - echo "Successfully created file" > test.log - status="GEN" - rc=0 - fi -else - echo "$toolrun < ${runfile}" - if [ "$debug" != "YES" ] && [ "$compile_only" != "YES" ]; then - $toolrun < ${runfile} >> test.log 2>&1 - rc=$? - status="PASS" - else - echo "Successfully created file" > test.log - status="GEN" - rc=0 - fi -fi - -if [ $rc -eq 0 ] && grep -ci "Successfully created " test.log > /dev/null; then - echo "TSMCFGtools.sh: smoke test passed" - echo "$status" > TestStatus -else - echo "TSMCFGtools.sh: error running $tool, error= $rc" - echo "TSMCFGtools.sh: see ${CLM_TESTDIR}/${test_name}/test.log for details" - echo "FAIL.job${JOBID}" > TestStatus - exit 6 -fi - -exit 0 diff --git a/test/tools/TSMscript_tools.sh b/test/tools/TSMscript_tools.sh deleted file mode 100755 index 943fec97f2..0000000000 --- a/test/tools/TSMscript_tools.sh +++ /dev/null @@ -1,98 +0,0 @@ -#!/bin/sh -# - -if [ $# -ne 3 ]; then - echo "TSMscript_tools.sh: incorrect number of input arguments" - exit 1 -fi - -test_name=TSMscript_tools.$1.$2.$3 - -if [ -f ${CLM_TESTDIR}/${test_name}/TestStatus ]; then - if grep -c PASS ${CLM_TESTDIR}/${test_name}/TestStatus > /dev/null; then - echo "TSMscript_tools.sh: smoke test has already passed; results are in " - echo " ${CLM_TESTDIR}/${test_name}" - exit 0 - elif grep -c GEN ${CLM_TESTDIR}/${test_name}/TestStatus > /dev/null; then - echo "TSMscript_tools.sh: test already generated" - else - read fail_msg < ${CLM_TESTDIR}/${test_name}/TestStatus - prev_jobid=${fail_msg#*job} - - if [ $JOBID = $prev_jobid ]; then - echo "TSMscript_tools.sh: smoke test has already failed for this job - will not reattempt; " - echo " results are in: ${CLM_TESTDIR}/${test_name}" - exit 2 - else - echo "TSMscript_tools.sh: this smoke test failed under job ${prev_jobid} - moving those results to " - echo " ${CLM_TESTDIR}/${test_name}_FAIL.job$prev_jobid and trying again" - cp -rp ${CLM_TESTDIR}/${test_name} ${CLM_TESTDIR}/${test_name}_FAIL.job$prev_jobid - fi - fi -fi - -cfgdir=`ls -1d ${CLM_ROOT}/tools/$1` -rundir=${CLM_TESTDIR}/${test_name} -if [ -d ${rundir} ]; then - rm -r ${rundir} -fi -mkdir -p ${rundir} -if [ $? -ne 0 ]; then - echo "TSMscript_tools.sh: error, unable to create work subdirectory" - exit 3 -fi -cd ${rundir} - -optfile=${3%^*} -cfgfile=${3#*^} - -if [ "$optfile" != "$3" ]; then - echo "TSMscript_tools.sh: calling TCBtools.sh to prepare $1 executable" - ${CLM_SCRIPTDIR}/TCBtools.sh $1 $cfgfile - rc=$? - if [ $rc -ne 0 ]; then - echo "TSMscript_tools.sh: error from TCBtools.sh= $rc" - echo "FAIL.job${JOBID}" > TestStatus - exit 4 - fi - tcbtools=${CLM_TESTDIR}/TCBtools.$1.$cfgfile -else - tcbtools="$rundir" -fi - -scopts=`cat ${CLM_SCRIPTDIR}/nl_files/$optfile | sed -e "s|CSMDATA|$CSMDATA|g" | sed -e "s|EXEDIR|$tcbtools|g" | sed -e "s|CFGDIR|$cfgdir|g"` -scopts=`echo $scopts | sed -e "s|CTSM_ROOT|$CTSM_ROOT|g" | sed -e "s|CIME_ROOT|$CIME_ROOT|g"` - -echo "TSMscript_tools.sh: running ${cfgdir}/$2 with $scopts; output in ${rundir}/test.log" - -if [ ! -f "${cfgdir}/$2" ]; then - echo "TSMscript_tools.sh: error ${cfgdir}/$2 input script not found" - echo "FAIL.job${JOBID}" > TestStatus - exit 5 -fi - -if [ "$debug" != "YES" ] && [ "$compile_only" != "YES" ]; then - ${cfgdir}/$2 $scopts >> test.log 2>&1 - rc=$? - status="PASS" -else - echo "success" > test.log - status="GEN" - rc=0 -fi - -if [ $rc -eq 0 ] && grep -ci "Successfully " test.log > /dev/null; then - echo "TSMscript_tools.sh: smoke test passed" - echo "$status" > TestStatus - # Copy files from subdirectories up... - # (use hard links rather than symbolic links because 'ln -s' does funny - # things when there are no matching files) - ln */*.nc */*/*.nc . -else - echo "TSMscript_tools.sh: error running $2, error= $rc" - echo "TSMscript_tools.sh: see ${CLM_TESTDIR}/${test_name}/test.log for details" - echo "FAIL.job${JOBID}" > TestStatus - exit 6 -fi - -exit 0 diff --git a/test/tools/TSMtools.sh b/test/tools/TSMtools.sh deleted file mode 100755 index 33a2316973..0000000000 --- a/test/tools/TSMtools.sh +++ /dev/null @@ -1,117 +0,0 @@ -#!/bin/sh -# - -if [ $# -ne 3 ]; then - echo "TSMtools.sh: incorrect number of input arguments" - exit 1 -fi - -test_name=TSMtools.$1.$2.$3 - -if [ -z "$CLM_RERUN" ]; then - CLM_RERUN="no" -fi - -if [ "$CLM_RERUN" != "yes" ] && [ -f ${CLM_TESTDIR}/${test_name}/TestStatus ]; then - if grep -c PASS ${CLM_TESTDIR}/${test_name}/TestStatus > /dev/null; then - echo "TSMtools.sh: smoke test has already passed; results are in " - echo " ${CLM_TESTDIR}/${test_name}" - exit 0 - elif grep -c GEN ${CLM_TESTDIR}/${test_name}/TestStatus > /dev/null; then - echo "TSMtools.sh: test already generated" - else - read fail_msg < ${CLM_TESTDIR}/${test_name}/TestStatus - prev_jobid=${fail_msg#*job} - - if [ $JOBID = $prev_jobid ]; then - echo "TSMtools.sh: smoke test has already failed for this job - will not reattempt; " - echo " results are in: ${CLM_TESTDIR}/${test_name}" - exit 2 - else - echo "TSMtools.sh: this smoke test failed under job ${prev_jobid} - moving those results to " - echo " ${CLM_TESTDIR}/${test_name}_FAIL.job$prev_jobid and trying again" - cp -rp ${CLM_TESTDIR}/${test_name} ${CLM_TESTDIR}/${test_name}_FAIL.job$prev_jobid - fi - fi -fi - -cfgdir=`ls -1d ${CLM_ROOT}/tools/$1` -rundir=${CLM_TESTDIR}/${test_name} -if [ -d ${rundir} ]; then - rm -r ${rundir} -fi -mkdir -p ${rundir} -if [ $? -ne 0 ]; then - echo "TSMtools.sh: error, unable to create work subdirectory" - exit 3 -fi -cd ${rundir} - -echo "Copy any text files over" -cp $cfgdir/*.txt $rundir - -echo "TSMtools.sh: calling TCBtools.sh to prepare $1 executable" -${CLM_SCRIPTDIR}/TCBtools.sh $1 $2 -rc=$? -if [ $rc -ne 0 ]; then - echo "TSMtools.sh: error from TCBtools.sh= $rc" - echo "FAIL.job${JOBID}" > TestStatus - exit 4 -fi - -echo "TSMtools.sh: running $1; output in ${rundir}/test.log" - -if [ "$3" = "tools__o" ] || [ "$3" = "tools__do" ]; then - toolrun="env OMP_NUM_THREADS=${CLM_THREADS} ${CLM_TESTDIR}/TCBtools.$1.$2/$1" -else - toolrun="${CLM_TESTDIR}/TCBtools.$1.$2/$1" -fi - -runfile="${cfgdir}/$1.$3" - -if [ ! -f "${runfile}" ]; then - runfile="${CLM_SCRIPTDIR}/nl_files/$1.$3" - if [ ! -f "${runfile}" ]; then - echo "TSMtools.sh: error ${runfile} input run file not found" - echo "FAIL.job${JOBID}" > TestStatus - exit 5 - fi -fi - -echo "Run file type = ${3#*.}" -if [ ${3#*.} == "runoptions" ]; then - echo "$toolrun "`cat ${runfile}` - cp $cfgdir/*.nc . - if [ "$debug" != "YES" ] && [ "$compile_only" != "YES" ]; then - $toolrun `cat ${runfile}` >> test.log 2>&1 - rc=$? - status="PASS" - else - echo "Successfully created file" > test.log - status="GEN" - rc=0 - fi -else - echo "$toolrun < ${runfile}" - if [ "$debug" != "YES" ] && [ "$compile_only" != "YES" ]; then - $toolrun < ${runfile} >> test.log 2>&1 - rc=$? - status="PASS" - else - echo "Successfully created file" > test.log - status="GEN" - rc=0 - fi -fi - -if [ $rc -eq 0 ] && grep -ci "Successfully created " test.log > /dev/null; then - echo "TSMtools.sh: smoke test passed" - echo "$status" > TestStatus -else - echo "TSMtools.sh: error running $1, error= $rc" - echo "TSMtools.sh: see ${CLM_TESTDIR}/${test_name}/test.log for details" - echo "FAIL.job${JOBID}" > TestStatus - exit 6 -fi - -exit 0 diff --git a/test/tools/config_files/CFGtools__ds b/test/tools/config_files/CFGtools__ds deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/test/tools/config_files/README b/test/tools/config_files/README deleted file mode 100644 index bdfe5e0dd0..0000000000 --- a/test/tools/config_files/README +++ /dev/null @@ -1,9 +0,0 @@ -_do => debug on, omp only on -_ds => debug on, serial mode (neither mpi nor omp) - -_o => debug off, omp only on -_s => debug off, serial mode (neither mpi nor omp) - -tools__ds => options for tools, debug on, serial mode -tools__do => options for tools, debug on, omp only on -tools__o => options for tools, debug off, omp only on diff --git a/test/tools/config_files/tools__do b/test/tools/config_files/tools__do deleted file mode 100644 index 7f061ed65d..0000000000 --- a/test/tools/config_files/tools__do +++ /dev/null @@ -1 +0,0 @@ -SMP=TRUE OPT=FALSE diff --git a/test/tools/config_files/tools__ds b/test/tools/config_files/tools__ds deleted file mode 100644 index cf2d414b28..0000000000 --- a/test/tools/config_files/tools__ds +++ /dev/null @@ -1 +0,0 @@ -OPT=FALSE diff --git a/test/tools/config_files/tools__o b/test/tools/config_files/tools__o deleted file mode 100644 index 8821e0bc5a..0000000000 --- a/test/tools/config_files/tools__o +++ /dev/null @@ -1 +0,0 @@ -SMP=TRUE OPT=TRUE diff --git a/test/tools/config_files/tools__s b/test/tools/config_files/tools__s deleted file mode 100644 index 507973f8be..0000000000 --- a/test/tools/config_files/tools__s +++ /dev/null @@ -1 +0,0 @@ -OPT=TRUE diff --git a/test/tools/gen_test_table.sh b/test/tools/gen_test_table.sh deleted file mode 100755 index 0791ad0447..0000000000 --- a/test/tools/gen_test_table.sh +++ /dev/null @@ -1,80 +0,0 @@ -#!/bin/sh -# - -# this script, when executed in the directory containing the test-driver -# scripts (~/test/system) will loop through the default test -# lists for pre and post tag testing of clm and create an html file -# (test_table.html) with the specifics of each test detailed - -outfile="./test_table.html" - -echo '' > $outfile -echo '' >> $outfile -echo '' >> $outfile -echo '' >> $outfile -echo 'CLM Testing Information Page' >> $outfile -echo '' >> $outfile -echo '' >> $outfile - -######################################################################################### -for input_file in `ls tests_*` ; do - echo '' >> $outfile - echo "" >> $outfile - echo "" >> $outfile - echo "" >> $outfile - echo "" >> $outfile - echo "" >> $outfile - echo "" >> $outfile - echo "" >> $outfile - echo "" >> $outfile - echo "" >> $outfile - - test_list="" - while read input_line; do - test_list="${test_list}${input_line} " - done < ./${input_file} - - count=0 - ##loop through the tests of input file - for test_id in ${test_list}; do - echo "" >> $outfile - count=`expr $count + 1` - while [ ${#count} -lt 3 ]; do - count="0${count}" - done - echo "" >> $outfile - - master_line=`grep $test_id ./input_tests_master` - dir="" - for arg in ${master_line}; do - arg1=${arg%^*} - arg2=${arg#*^} - if [ -d ../../tools/$arg ]; then - dir=$arg - elif [ -f ./nl_files/$arg ]; then - echo "" >> $outfile - elif [ -f ./config_files/$arg ]; then - echo "" >> $outfile - elif [ -f ./nl_files/$arg1 ] && [ -f ./nl_files/$arg2 ]; then - echo "" >> $outfile - elif [ -f ./nl_files/$arg1 ] && [ -f ./config_files/$arg2 ]; then - echo "" >> $outfile - elif [ -f ../../tools/$dir/$dir.$arg ]; then - echo "" >> $outfile - else - echo "" >> $outfile - fi - done - echo '' >> $outfile - done - echo '
$input_file
test# testid test script arg1 arg2 arg3
$count $arg $arg $arg1^" \ - "$arg2$arg1^" \ - "$arg2$arg $arg
' >> $outfile - echo '
' >> $outfile
-    echo ' ' >> $outfile
-    echo '
' >> $outfile -done -echo '' >> $outfile -echo '' >> $outfile - -exit 0 diff --git a/test/tools/get_cprnc_diffs.sh b/test/tools/get_cprnc_diffs.sh deleted file mode 100755 index 360220cb71..0000000000 --- a/test/tools/get_cprnc_diffs.sh +++ /dev/null @@ -1,56 +0,0 @@ -#!/bin/bash - -# This script extracts lines from the output of cprnc that tell us -# which variables differ between two files -# -# Usage: get_cprnc_diffs filename - -# ---------------------------------------------------------------------- -# SET PARAMETERS HERE -# ---------------------------------------------------------------------- - -# maximum number of differences to extract from the cprnc output -maxdiffs=200 - -# ---------------------------------------------------------------------- -# LOCAL FUNCTIONS DEFINED HERE -# ---------------------------------------------------------------------- - -# This function gets differences for one prefix (e.g., "RMS") -# Usage: get_diffs prefix -# (also uses $infile and $maxdiffs from the parent script) -function get_diffs { - prefix=$1 - outfile=${infile}.${prefix}.$$ - grep "$prefix" $infile > $outfile - numlines=`wc -l $outfile | awk '{print $1}'` - if [ $numlines -gt $maxdiffs ]; then - echo "WARNING: Too many instances of $prefix - only printing last $maxdiffs" - tail -$maxdiffs $outfile - else - cat $outfile - fi - rm $outfile -} - -# ---------------------------------------------------------------------- -# BEGIN MAIN SCRIPT -# ---------------------------------------------------------------------- - -# ---------------------------------------------------------------------- -# Handle command-line arguments -# ---------------------------------------------------------------------- - -if [[ $# -ne 1 ]]; then - echo "Usage: get_cprnc_diffs filename" - exit 1 -fi - -infile=$1 - -# ---------------------------------------------------------------------- -# Do the processing -# ---------------------------------------------------------------------- - -get_diffs RMS -get_diffs FILLDIFF diff --git a/test/tools/input_tests_master b/test/tools/input_tests_master deleted file mode 100644 index 7da8c19803..0000000000 --- a/test/tools/input_tests_master +++ /dev/null @@ -1,32 +0,0 @@ - - -smc#4 TSMscript_tools.sh mkprocdata_map mkprocdata_map_wrap mkprocdata_ne30_to_f19_I2000^tools__ds -blc#4 TBLscript_tools.sh mkprocdata_map mkprocdata_map_wrap mkprocdata_ne30_to_f19_I2000^tools__ds - -sm0c1 TSMscript_tools.sh site_and_regional run_neon.py run_neon_OSBS -bl0c1 TBLscript_tools.sh site_and_regional run_neon.py run_neon_OSBS -sm0a1 TSMscript_tools.sh site_and_regional run_neon.py run_neon_YELL_PRISM -bl0a1 TBLscript_tools.sh site_and_regional run_neon.py run_neon_YELL_PRISM - -smba1 TSMscript_tools.sh site_and_regional subset_data subset_data_YELL -blba1 TBLscript_tools.sh site_and_regional subset_data subset_data_YELL -smbb1 TSMscript_tools.sh site_and_regional subset_data subset_data_KONA -blbb1 TBLscript_tools.sh site_and_regional subset_data subset_data_KONA -smb81 TSMscript_tools.sh site_and_regional subset_data subset_data_US-UMB -blb81 TBLscript_tools.sh site_and_regional subset_data subset_data_US-UMB -smbh1 TSMscript_tools.sh site_and_regional subset_data subset_data_f09_1x1pt_townshipSD -blbh1 TBLscript_tools.sh site_and_regional subset_data subset_data_f09_1x1pt_townshipSD -smbd1 TSMscript_tools.sh site_and_regional subset_data subset_data_f09_58x45pt_SouthAmerica -blbd1 TBLscript_tools.sh site_and_regional subset_data subset_data_f09_58x45pt_SouthAmerica -smbe1 TSMscript_tools.sh site_and_regional subset_data subset_data_f09_90x288pt_1850PanTropics -blbe1 TBLscript_tools.sh site_and_regional subset_data subset_data_f09_90x288pt_1850PanTropics -smbf1 TSMscript_tools.sh site_and_regional subset_data subset_data_f09_37x288pt_PanBoreal -blbf1 TBLscript_tools.sh site_and_regional subset_data subset_data_f09_37x288pt_PanBoreal -smbg1 TSMscript_tools.sh site_and_regional subset_data subset_data_f09_4x9pt_AlaskaTananaValley -blbg1 TBLscript_tools.sh site_and_regional subset_data subset_data_f09_4x9pt_AlaskaTananaValley - -sm901 TSMscript_tools.sh site_and_regional mesh_maker mesh_maker_fv09 -bl901 TBLscript_tools.sh site_and_regional mesh_maker mesh_maker_fv09 - -smaa2 TSMscript_tools.sh site_and_regional modify_singlept_site_neon.py modify_data_YELL -blaa2 TBLscript_tools.sh site_and_regional modify_singlept_site_neon.py modify_data_YELL diff --git a/test/tools/nl_files/mesh_maker_fv09 b/test/tools/nl_files/mesh_maker_fv09 deleted file mode 100644 index 7de951fee1..0000000000 --- a/test/tools/nl_files/mesh_maker_fv09 +++ /dev/null @@ -1 +0,0 @@ - --input CSMDATA/atm/datm7/domain.lnd.fv0.9x1.25_gx1v6.090309.nc --lat yc --lon xc --overwrite --mask mask --area area --verbose diff --git a/test/tools/nl_files/mkmapdata_if10 b/test/tools/nl_files/mkmapdata_if10 deleted file mode 100644 index f726ea34e7..0000000000 --- a/test/tools/nl_files/mkmapdata_if10 +++ /dev/null @@ -1 +0,0 @@ --r 10x15 --fast --batch diff --git a/test/tools/nl_files/mkmapdata_ne30np4 b/test/tools/nl_files/mkmapdata_ne30np4 deleted file mode 100644 index ae435ac2bc..0000000000 --- a/test/tools/nl_files/mkmapdata_ne30np4 +++ /dev/null @@ -1 +0,0 @@ --r ne30np4 --fast --batch diff --git a/test/tools/nl_files/mkprocdata_ne30_to_f19_I2000 b/test/tools/nl_files/mkprocdata_ne30_to_f19_I2000 deleted file mode 100644 index af85dcf226..0000000000 --- a/test/tools/nl_files/mkprocdata_ne30_to_f19_I2000 +++ /dev/null @@ -1 +0,0 @@ --i CSMDATA/lnd/clm2/test_mkprocdata_map/clm4054_ne30g16_I2000.clm2.h0.2000-01_c170430.nc -o ne30output_onf19grid.nc -m CSMDATA/lnd/clm2/test_mkprocdata_map/map_ne30np4_nomask_to_fv1.9x2.5_nomask_aave_da_c121107.nc -t CSMDATA/lnd/clm2/test_mkprocdata_map/clm4054_f19g16_I2000.clm2.h0.2000-01_c170430.nc -e EXEDIR diff --git a/test/tools/nl_files/modify_data_YELL b/test/tools/nl_files/modify_data_YELL deleted file mode 100644 index 0d180e8bf6..0000000000 --- a/test/tools/nl_files/modify_data_YELL +++ /dev/null @@ -1 +0,0 @@ ---neon_site YELL --surf_dir CSMDATA/lnd/clm2/surfdata_esmf/NEON --out_dir EXEDIR --inputdata-dir CSMDATA diff --git a/test/tools/nl_files/run_neon_OSBS b/test/tools/nl_files/run_neon_OSBS deleted file mode 100644 index 0c274b13ad..0000000000 --- a/test/tools/nl_files/run_neon_OSBS +++ /dev/null @@ -1 +0,0 @@ ---verbose --run-type ad --setup-only --neon-site OSBS diff --git a/test/tools/nl_files/run_neon_YELL_PRISM b/test/tools/nl_files/run_neon_YELL_PRISM deleted file mode 100644 index f5ebdf9fdf..0000000000 --- a/test/tools/nl_files/run_neon_YELL_PRISM +++ /dev/null @@ -1 +0,0 @@ ---verbose --run-type transient --setup-only --neon-site YELL --prism --neon-version v2 --experiment toolstest diff --git a/test/tools/nl_files/subset_data_KONA b/test/tools/nl_files/subset_data_KONA deleted file mode 100644 index 0df59b1b17..0000000000 --- a/test/tools/nl_files/subset_data_KONA +++ /dev/null @@ -1 +0,0 @@ -point --lon 263.38956 --lat 39.1082 --site KONA --dompft 17 19 23 45 --pctpft 28 12 32 28 --crop --create-surface --outdir EXEDIR/KONA_user-mod_and_data --user-mods-dir EXEDIR/KONA_user-mod_and_data --verbose --inputdata-dir CSMDATA diff --git a/test/tools/nl_files/subset_data_US-UMB b/test/tools/nl_files/subset_data_US-UMB deleted file mode 100644 index 935b0dc99d..0000000000 --- a/test/tools/nl_files/subset_data_US-UMB +++ /dev/null @@ -1 +0,0 @@ -point --lon 275.28626 --lat 45.5598 --site 1x1_US-UMB --dompft 7 --cap-saturation --uniform-snowpack --create-surface --outdir EXEDIR/US-UMB_user-mod_and_data --user-mods-dir EXEDIR/US-UMB_user-mod_and_data --verbose --inputdata-dir CSMDATA diff --git a/test/tools/nl_files/subset_data_YELL b/test/tools/nl_files/subset_data_YELL deleted file mode 100644 index 0d6960e7f5..0000000000 --- a/test/tools/nl_files/subset_data_YELL +++ /dev/null @@ -1 +0,0 @@ -point --lon 250.45804 --lat 44.95597 --site YELL --dompft 1 --crop --uniform-snowpack --cap-saturation --create-surface --outdir EXEDIR/YELL_user-mod_and_data --user-mods-dir EXEDIR/YELL_user-mod_and_data --silent --inputdata-dir CSMDATA diff --git a/test/tools/nl_files/subset_data_f09_1x1pt_townshipSD b/test/tools/nl_files/subset_data_f09_1x1pt_townshipSD deleted file mode 100644 index aa25c07d1e..0000000000 --- a/test/tools/nl_files/subset_data_f09_1x1pt_townshipSD +++ /dev/null @@ -1 +0,0 @@ -point --lon 257.5 --lat 43.822 --site f09_1x1pt_townshipSD --include-nonveg --crop --create-datm --create-user-mods --datm-syr 2000 --datm-eyr 2000 --create-surface --outdir EXEDIR/f09_US_pt_user-mod_and_data --user-mods-dir EXEDIR/f09_US_pt_user-mod_and_data --verbose --inputdata-dir CSMDATA diff --git a/test/tools/nl_files/subset_data_f09_37x288pt_PanBoreal b/test/tools/nl_files/subset_data_f09_37x288pt_PanBoreal deleted file mode 100644 index 448b5052d6..0000000000 --- a/test/tools/nl_files/subset_data_f09_37x288pt_PanBoreal +++ /dev/null @@ -1 +0,0 @@ -region --lat1 55 --lat2 89.1 --lon1 0 --lon2 360 --create-mesh --create-surface --create-domain --create-user-mods --verbose --overwrite --reg f09_37x288pt_PanBoreal --inputdata-dir CSMDATA diff --git a/test/tools/nl_files/subset_data_f09_4x9pt_AlaskaTananaValley b/test/tools/nl_files/subset_data_f09_4x9pt_AlaskaTananaValley deleted file mode 100644 index 9928d78429..0000000000 --- a/test/tools/nl_files/subset_data_f09_4x9pt_AlaskaTananaValley +++ /dev/null @@ -1 +0,0 @@ -region --lat1 62 --lat2 66 --lon1 -152 --lon2 -141 --create-mesh --create-domain --create-surface --create-user-mods --verbose --overwrite --reg f09_4x9pt_AlaskaTananaValley --inputdata-dir CSMDATA diff --git a/test/tools/nl_files/subset_data_f09_58x45pt_SouthAmerica b/test/tools/nl_files/subset_data_f09_58x45pt_SouthAmerica deleted file mode 100644 index 201dd2c76c..0000000000 --- a/test/tools/nl_files/subset_data_f09_58x45pt_SouthAmerica +++ /dev/null @@ -1 +0,0 @@ -region --lat1 -40 --lat2 15 --lon1 275 --lon2 330 --create-mesh --create-surface --create-user-mods --create-domain --create-landuse --verbose --overwrite --reg f09_58x45_SouthAmerica --inputdata-dir CSMDATA diff --git a/test/tools/nl_files/subset_data_f09_90x288pt_1850PanTropics b/test/tools/nl_files/subset_data_f09_90x288pt_1850PanTropics deleted file mode 100644 index 1c9d5eace9..0000000000 --- a/test/tools/nl_files/subset_data_f09_90x288pt_1850PanTropics +++ /dev/null @@ -1 +0,0 @@ -region --lat1 -55 --lat2 30 --lon1 0 --lon2 360 --crop --create-surface --create-domain --create-mesh --overwrite --reg f09_90x288pt_1850PanTropics --inputdata-dir CSMDATA --cfg-file CTSM_ROOT/tools/mksurfdata_map/default_data_1850.cfg --verbose diff --git a/test/tools/show_var_diffs.sh b/test/tools/show_var_diffs.sh deleted file mode 100755 index f462d4ad0c..0000000000 --- a/test/tools/show_var_diffs.sh +++ /dev/null @@ -1,79 +0,0 @@ -#!/bin/bash - -# This script processes a log file that was output by test_driver, -# giving lists of all variables with differences in values (those with -# RMS errors), and all variables with differences in fill patterns. -# -# This assumes that the log file contains output like: -# RMS foo -# RMS bar -# FILLDIFF foo -# FILLDIFF bar -# Some characteristics of these output lines are: -# - they begin with a leading space, followed by RMS or FILLDIFF -# - the variable name is in the second column of the line -# -# Note that (as of 4-5-12) the log file only contains output from the -# last file that didn't match, so this could potentially miss -# something -- especially if there are both h0 and h1 files in the -# comparison. - -# Usage: show_var_diffs logfile - -# ---------------------------------------------------------------------- -# LOCAL FUNCTIONS DEFINED HERE -# ---------------------------------------------------------------------- - -# This function shows the differences for one prefix (e.g., "RMS") -# Usage: show_diffs prefix -# (also uses $logfile from the parent script) -# -# Matches lines that start with the regular expression "^ ${prefix}" -# (note that one leading space is expected before the prefix) -# -# Assumes that the variable name is in the second column of matching lines -function show_diffs { - prefix=$1 - - # first determine if there were warnings relating to this prefix - grep "WARNING: Too many instances of ${prefix}" $logfile > /dev/null - if [ $? -eq 0 ]; then # found a warning - echo "WARNING: Some output was truncated; this may not be a complete list" - fi - - # now make a list of all variables matching this prefix - grep "^ ${prefix}" $logfile > $logfile.tmp.$$ - if [ $? -eq 0 ]; then - awk '{print $2}' $logfile.tmp.$$ | sort | uniq - else - echo "(no differences)" - fi - - rm $logfile.tmp.$$ -} - -# ---------------------------------------------------------------------- -# BEGIN MAIN SCRIPT -# ---------------------------------------------------------------------- - -# ---------------------------------------------------------------------- -# Handle command-line arguments -# ---------------------------------------------------------------------- - -if [[ $# -ne 1 ]]; then - echo "Usage: show_var_diffs logfile" - exit 1 -fi - -logfile=$1 - -# ---------------------------------------------------------------------- -# Do the processing -# ---------------------------------------------------------------------- - -echo "Variables with differences in values:" -show_diffs "RMS" - -echo "" -echo "Variables with differences in fill patterns:" -show_diffs "FILLDIFF" \ No newline at end of file diff --git a/test/tools/tests_posttag_hobart_nompi b/test/tools/tests_posttag_hobart_nompi deleted file mode 100644 index c185428868..0000000000 --- a/test/tools/tests_posttag_hobart_nompi +++ /dev/null @@ -1 +0,0 @@ -smc#4 blc#4 diff --git a/test/tools/tests_posttag_nompi_regression b/test/tools/tests_posttag_nompi_regression deleted file mode 100644 index c185428868..0000000000 --- a/test/tools/tests_posttag_nompi_regression +++ /dev/null @@ -1 +0,0 @@ -smc#4 blc#4 diff --git a/test/tools/tests_pretag_cheyenne_nompi b/test/tools/tests_pretag_cheyenne_nompi deleted file mode 100644 index e92ffaaaad..0000000000 --- a/test/tools/tests_pretag_cheyenne_nompi +++ /dev/null @@ -1,3 +0,0 @@ -smc#4 blc#4 -smba1 blba1 -smbd1 blbd1 diff --git a/test/tools/tests_pretag_derecho_nompi b/test/tools/tests_pretag_derecho_nompi deleted file mode 100644 index 5fdaf335ae..0000000000 --- a/test/tools/tests_pretag_derecho_nompi +++ /dev/null @@ -1,9 +0,0 @@ -smba1 blba1 -smbd1 blbd1 -sm0a1 bl0a1 -sm0c1 bl0c1 -smaa2 blaa2 -smba1 blba1 -smb81 blb81 -smbc1 blbc1 -smbd1 blbd1 diff --git a/test/tools/tests_pretag_nompi_neon b/test/tools/tests_pretag_nompi_neon deleted file mode 100644 index e5fa27e6c4..0000000000 --- a/test/tools/tests_pretag_nompi_neon +++ /dev/null @@ -1,8 +0,0 @@ -sm0a1 bl0a1 -sm0c1 bl0c1 -smaa2 blaa2 -smba1 blba1 -smbb1 blbb1 -smb81 blb81 -smbc1 blbc1 -smbd1 blbd1 From 69dbee8149945c173c66cfa8670adecccf333d16 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Tue, 21 May 2024 11:08:53 -0600 Subject: [PATCH 0290/1248] Remove bld/unit_testers/xFail/wrapClmTests.pl --- bld/unit_testers/xFail/wrapClmTests.pl | 128 ------------------------- 1 file changed, 128 deletions(-) delete mode 100755 bld/unit_testers/xFail/wrapClmTests.pl diff --git a/bld/unit_testers/xFail/wrapClmTests.pl b/bld/unit_testers/xFail/wrapClmTests.pl deleted file mode 100755 index 28238b9d5d..0000000000 --- a/bld/unit_testers/xFail/wrapClmTests.pl +++ /dev/null @@ -1,128 +0,0 @@ -#!/usr/bin/env perl - -#-# ========================================================================================= - -=head1 wrapClmTest.pl - -=head1 Overview - -This is a wrapper script that is called from test_driver.sh for either interactive or batch -tests. It calls the CTOR for the xFail::expectedFail.pm module and also parses the td*.status -file to create a new file with xFails listed. - -It takes the following arguments: - - numberOfTests -> number of tests from test_driver.sh - statusFile -> name of the td..status file - callingScript -> name of script calling this. For test_driver.sh it may be one of: - 1) test_driver.sh-i for interactive tests - 2) test_driver.sh for batch tests - -=head1 Notes - -This script may be run standalone which is useful for testing purposes. - -=cut - -#-# ========================================================================================= - -use strict; -use Getopt::Long; -use English; -use Cwd; -use Scalar::Util qw(looks_like_number); - -my $DEBUG=0; - -sub usage { - die < 0, - numberOfTests => undef, - statusFile => undef, - callingScript => undef, - ); - -GetOptions( - "h|help" => \$opts{'help'}, - "numberOfTests=s" => \$opts{'numberOfTests'}, - "statusFile=s" => \$opts{'statusFile'}, - "callingScript=s" => \$opts{'callingScript'}, -) or usage(); - -# Give usage message. -usage() if $opts{'help'}; - -my $statFoo = undef; -my $nTests = undef; -my $script= undef; - -if (defined($opts{'statusFile'})) { - $statFoo = $opts{'statusFile'}; -} -if (defined($opts{'numberOfTests'})) { - $nTests = $opts{'numberOfTests'}; -} -if (defined($opts{'callingScript'})) { - $script = $opts{'callingScript'}; -} - -my ( $self ) = @_; - -#Figure out where configure directory is and where can use the XML/Lite module from -my $ProgName; -($ProgName = $PROGRAM_NAME) =~ s!(.*)/!!; # name of program -my $ProgDir = $1; # name of directory where program lives - -my $cwd = getcwd(); # current working directory -my $cfgdir; - -if ($ProgDir) { $cfgdir = $ProgDir; } -else { $cfgdir = $cwd; } - -#----------------------------------------------------------------------------------------------- -# Add $cfgdir to the list of paths that Perl searches for modules -#----------------------------------------------------------------------------------------------- -my @dirs = ( $cfgdir, - "$cfgdir/../", - "$cfgdir/../../../../../cime/utils/perl5lib"); -unshift @INC, @dirs; -my $result = eval "require expectedFail"; -if ( ! defined($result) ) { - die <<"EOF"; -** Cannot find perl module \"xFail/expectedFail.pm\" from directories: @dirs ** -EOF -} - -#_# ==================================== -#_# setup work complete. Now parse file -#_# ==================================== - -if ($DEBUG) { - print (" wrapClmTests.pl:: calling script $script \n"); - print (" wrapClmTests.pl:: number of tests $nTests \n"); - print (" wrapClmTests.pl:: processing $statFoo \n"); -} - -#_# compGen not used for CLM batch or interactive tests, but we use "compare" as the default in this case -my $compGen="compare"; -my $xFail = xFail::expectedFail->new($script,$compGen,$nTests); - -$xFail->parseOutputCLM($statFoo); - -exit(0); From 8ef1ff4a3a4c2ca4c44c0d59bd654819b32edd62 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Tue, 21 May 2024 11:19:49 -0600 Subject: [PATCH 0291/1248] Remove obsolete parts of bld/unit_testers/xFail/expectedFail.pm --- bld/unit_testers/xFail/expectedFail.pm | 119 +------------------------ 1 file changed, 2 insertions(+), 117 deletions(-) diff --git a/bld/unit_testers/xFail/expectedFail.pm b/bld/unit_testers/xFail/expectedFail.pm index 9feaa3e38b..067e3a51d8 100755 --- a/bld/unit_testers/xFail/expectedFail.pm +++ b/bld/unit_testers/xFail/expectedFail.pm @@ -5,7 +5,7 @@ Documentation for expectedFail.pm =head1 Overview The module expectedFail.pm supplies the capability of checking if a failed test is expected to fail. -It is called directly from either test_driver.sh (for batch and interactive tests) or build-namelist_test.pl. +It is called directly from build-namelist_test.pl. Future plans involve integrating this module into cesm tests. =head1 Use Case @@ -112,7 +112,7 @@ sub new { =head1 parseOutput -parseOutput parsese the output from the build-namelist_test.pl script. It is similar +parseOutput parses the output from the build-namelist_test.pl script. It is similar to, but not interchangable with parseOutputCLM. The only argument is that of the reference variable that contains the information dumped @@ -223,119 +223,6 @@ sub parseOutput # ############################################################################## -=head1 parseOutputCLM - -parseOutputCLM parsese the output from the test_driver.sh script. It is similar -to, but not interchangable with parseOutput. - -parseOutputCLM takes one arguments: - $statFoo-> the name of the td..status file - -returns: nothing - -=cut - -############################################################################## -# -############################################################################## -sub parseOutputCLM -{ - - my $report; - my $testId; - my @testName={}; - my $testReason; - - my ($self, $statFoo) = @_ ; - - open(FOO, "< $statFoo"); # open for input - open(FOO_OUT, "> $statFoo.xFail"); # open for input - - my(@reportLines); - - while () { - - my($line) = $_; - - my @outArr=split(/ /,$line); - if (looks_like_number(@outArr[0])) { - - $self->{_numericalTestId}++; - - my $num=sprintf("%03d", $self->{_numericalTestId}); - my $totNum=sprintf("%03d", $self->{_totTests}); - - #_# last element has the pass/fail info. - chomp(@outArr[-1]); - my $repPass=substr(@outArr[-1], -4, 4); - - if ($DEBUG) { - print ("xFail::expectedFail::parseOutput @outArr[0] \n"); - print ("xFail::expectedFail::parseOutput @outArr[1] \n"); - print ("xFail::expectedFail::parseOutput @outArr[2] \n"); - print ("xFail::expectedFail::parseOutput @outArr[3] \n"); - print ("xFail::expectedFail::parseOutput @outArr[4] \n"); - print ("xFail::expectedFail::parseOutput @outArr[5] \n"); - print ("xFail::expectedFail::parseOutput @outArr[6] \n"); - print ("xFail::expectedFail::parseOutput @outArr[-1] \n"); - print ("xFail::expectedFail::parseOutput $repPass \n"); - } - - my $size = @outArr-1; - if ($DEBUG) { - print ("size of line $size \n"); - } - my $endOfDesc=$size-1; - - if ($repPass eq "PASS") { - $report=$pass; - $testId=@outArr[1]; - @testName=@outArr[2..$endOfDesc]; - - my ($retVal,$xFailText)=$self->_searchExpectedFail($testId); - - my $testReason=$self->_testNowPassing($testId,$retVal,$xFailText); - - #_# print out the test results - print FOO_OUT ("$num/$totNum <$report> $testReason \n"); - - } else { - $testId=@outArr[1]; - my ($retVal,$xFailText)=$self->_searchExpectedFail($testId); - - if ($DEBUG) { - print ("xFail::expectedFail::parseOutput Id $retVal,$xFailText \n"); - } - - @testName=@outArr[2..$endOfDesc]; - - if ($retVal eq "TRUE"){ - #_# found an expected FAIL (xFAIL) - $report=$xfail; - $testReason= ""; - } else { - #_# print a regular FAIL - $report=$fail; - $testReason=""; - } - - #_# print out the test results - print FOO_OUT ("$num/$totNum <$report> $testReason \n"); - - } - - } else { - print FOO_OUT $line; - } - } - close(FOO); - close(FOO_OUT); -} - -############################################################################## -# -############################################################################## - =head1 _searchExpectedFail searches the list of expected fails for a match with testId. @@ -608,8 +495,6 @@ sub _getTestType my %testTypes = ( "build-namelist_test.pl" => "namelistTest", - "test_driver.sh-i" => "clmInteractive", - "test_driver.sh" => "clmBatch", "clm-cesm.sh" => "cesm" ); From 0c26697a620292a7dcd69f8eefa55a3ee759332f Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Tue, 21 May 2024 11:22:42 -0600 Subject: [PATCH 0292/1248] Remove obsolete parts of expectedClmTestFails.xml: DID I rm ENOUGH? --- bld/unit_testers/xFail/expectedClmTestFails.xml | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/bld/unit_testers/xFail/expectedClmTestFails.xml b/bld/unit_testers/xFail/expectedClmTestFails.xml index c7cbfee488..380e614ea1 100644 --- a/bld/unit_testers/xFail/expectedClmTestFails.xml +++ b/bld/unit_testers/xFail/expectedClmTestFails.xml @@ -20,20 +20,6 @@ - - - - - - - - goldbach not recognized - goldbach not recognized - goldbach not recognized - - - - From 882425a205ded67450455466ded69d034f5d39fa Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Tue, 21 May 2024 11:26:11 -0600 Subject: [PATCH 0293/1248] Remove mention of test_driver_*.sh in .gitignore --- .gitignore | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitignore b/.gitignore index 1da8072fed..163bfeda2d 100644 --- a/.gitignore +++ b/.gitignore @@ -75,7 +75,6 @@ buildnmlc td.*.status td.*.log td.*.status.xFail -test_driver_*.sh # mksurfdata output surfdata_*.log From 9407ce50522c2a624196fd4b892363cf8505b5ee Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Tue, 21 May 2024 11:33:48 -0600 Subject: [PATCH 0294/1248] Remove reference to /test in /doc/.../testing.rst --- doc/source/users_guide/testing/testing.rst | 6 ------ 1 file changed, 6 deletions(-) diff --git a/doc/source/users_guide/testing/testing.rst b/doc/source/users_guide/testing/testing.rst index bad1183fff..69ca1f7263 100644 --- a/doc/source/users_guide/testing/testing.rst +++ b/doc/source/users_guide/testing/testing.rst @@ -13,12 +13,6 @@ CIME Testing scripts We first introduce the test scripts that work for all CESM components. The CIME script **create_test** runs a specific type of test, at a given resolution, for a given compset using a given machine. See `CIME Chapter on Testing `_ for how to use it to run single tests as well as lists of tests. The standard testname for CLM is "aux_clm" for cheyenne with intel and gnu compilers as well as the CGD machine hobart for intel, nag, and pgi compilers. There's also a shorter test list called "clm_short". Also see the `CTSM Wiki on Testing `_. -CTSM Tools Testing -================== - -.. include:: ../../../../test/tools/README - :literal: - CTSM Fortran Unit Tests ======================= From eedbadff362d140cd1f1a34803e525e25fb58236 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Tue, 21 May 2024 12:21:32 -0600 Subject: [PATCH 0295/1248] Check values for a basic run through with default input forcing --- src/biogeochem/DUSTMod.F90 | 54 ++++++++++++++- .../test/DustEmis_test/test_DustEmis.pf | 68 ++++++++++++++++++- 2 files changed, 118 insertions(+), 4 deletions(-) diff --git a/src/biogeochem/DUSTMod.F90 b/src/biogeochem/DUSTMod.F90 index e0e4e469a1..cd60bd859f 100644 --- a/src/biogeochem/DUSTMod.F90 +++ b/src/biogeochem/DUSTMod.F90 @@ -62,12 +62,14 @@ module DUSTMod contains procedure , public :: Init - procedure , public :: DustEmission ! Dust mobilization - procedure , public :: DustDryDep ! Turbulent dry deposition for dust + procedure , public :: DustEmission ! Dust mobilization + procedure , public :: DustDryDep ! Turbulent dry deposition for dust + procedure , public :: WritePatchToLog ! Write information on the given patch to the log file + procedure , public :: GetPatchVars ! Get important variables on a given patch procedure , private :: InitAllocate procedure , private :: InitHistory procedure , private :: InitCold - procedure , private :: InitDustVars ! Initialize variables used in DustEmission method + procedure , private :: InitDustVars ! Initialize variables used in DustEmission method end type dust_type !------------------------------------------------------------------------ @@ -209,6 +211,52 @@ subroutine InitCold(this, bounds) end subroutine InitCold + !----------------------------------------------------------------------- + + subroutine WritePatchToLog(this, p) + ! + ! !DESCRIPTION: + ! Write out information on dust emisisons for this patch to the log file + ! !ARGUMENTS: + class(dust_type), intent(in) :: this + integer , intent(in) :: p ! Patch to display + + write(iulog,*) 'flx_mss_vrt_dst', this%flx_mss_vrt_dst_patch(p,:) + write(iulog,*) 'flx_mss_vrt_dst_tot', this%flx_mss_vrt_dst_tot_patch(p) + write(iulog,*) 'vlc_trb_1', this%vlc_trb_1_patch(p) + write(iulog,*) 'vlc_trb_2', this%vlc_trb_2_patch(p) + write(iulog,*) 'vlc_trb_3', this%vlc_trb_3_patch(p) + write(iulog,*) 'vlc_trb_4', this%vlc_trb_4_patch(p) + write(iulog,*) 'mbl_bsn_fct', this%mbl_bsn_fct_col(p) + end subroutine WritePatchToLog + + !----------------------------------------------------------------------- + + subroutine GetPatchVars(this, p, flx_mss_vrt_dst, flx_mss_vrt_dst_tot, vlc_trb, vlc_trb_1, & + vlc_trb_2, vlc_trb_3, vlc_trb_4) + ! + ! !DESCRIPTION: + ! Get important variables on the given patch + ! !ARGUMENTS: + class(dust_type) , intent(in) :: this + integer , intent(in) :: p ! Patch to get + real(r8), optional, intent(out) :: flx_mss_vrt_dst(ndst) + real(r8), optional, intent(out) :: flx_mss_vrt_dst_tot + real(r8), optional, intent(out) :: vlc_trb(ndst) + real(r8), optional, intent(out) :: vlc_trb_1 + real(r8), optional, intent(out) :: vlc_trb_2 + real(r8), optional, intent(out) :: vlc_trb_3 + real(r8), optional, intent(out) :: vlc_trb_4 + + if ( present(flx_mss_vrt_dst ) ) flx_mss_vrt_dst = this%flx_mss_vrt_dst_patch(p,:) + if ( present(flx_mss_vrt_dst_tot) ) flx_mss_vrt_dst_tot = this%flx_mss_vrt_dst_tot_patch(p) + if ( present(vlc_trb ) ) vlc_trb = this%vlc_trb_patch(p,:) + if ( present(vlc_trb_1) ) vlc_trb_1 = this%vlc_trb_1_patch(p) + if ( present(vlc_trb_2) ) vlc_trb_2 = this%vlc_trb_2_patch(p) + if ( present(vlc_trb_3) ) vlc_trb_3 = this%vlc_trb_3_patch(p) + if ( present(vlc_trb_4) ) vlc_trb_4 = this%vlc_trb_4_patch(p) +end subroutine GetPatchVars + !------------------------------------------------------------------------ subroutine DustEmission (this, bounds, & num_nolakep, filter_nolakep, & diff --git a/src/biogeochem/test/DustEmis_test/test_DustEmis.pf b/src/biogeochem/test/DustEmis_test/test_DustEmis.pf index 9be97453b0..08aa683964 100644 --- a/src/biogeochem/test/DustEmis_test/test_DustEmis.pf +++ b/src/biogeochem/test/DustEmis_test/test_DustEmis.pf @@ -5,7 +5,7 @@ module test_DustEmis use funit use unittestSubgridMod use unittestSimpleSubgridSetupsMod, only : setup_single_veg_patch - use clm_varpar, only : nlevsoi, nlevgrnd, nlevsno, clm_varpar_init + use clm_varpar, only : nlevsoi, nlevgrnd, nlevsno, clm_varpar_init, ndst use clm_varctl, only : soil_layerstruct_predefined, create_crop_landunit, use_crop, create_crop_landunit use clm_varcon, only : clm_varcon_init, clm_varcon_clean use SnowHydrologyMod, only : InitSnowLayers, SnowHydrologySetControlForTesting @@ -19,9 +19,12 @@ module test_DustEmis use WaterType, only : water_type use FrictionVelocityMod, only : frictionvel_type use unittestWaterTypeFactory, only : unittest_water_type_factory_type + use abortutils, only : endrun implicit none + real(r8), parameter :: tol = 1.e-13_r8 + @TestCase type, extends(TestCase) :: TestDustEmis type(dust_type) :: dust_emis @@ -40,6 +43,8 @@ module test_DustEmis procedure :: setupEnvironment procedure :: create_atm2lnd procedure :: create_fv + procedure :: print_patch + procedure :: validate_patch end type TestDustEmis contains @@ -231,11 +236,61 @@ contains end subroutine create_fv + subroutine print_patch(this) + use LandunitType, only : lun + class(TestDustEmis), intent(inout) :: this + integer :: p, c, l + + do l = bounds%begl, bounds%endl + print *, 'landunit type= ', lun%itype(l) + end do + do c = bounds%begc, bounds%endc + print *, 'watsat = ', this%soilstate_inst%watsat_col(c,1) + print *, 'h2osoi_vol = ', this%water_inst%waterstatebulk_inst%h2osoi_vol_col(c,1) + print *, 'frac_sno = ', this%water_inst%waterdiagnosticbulk_inst%frac_sno_col(c) + end do + do p = bounds%begp, bounds%endp + print *, 'tlai = ', this%canopystate_inst%tlai_patch(p) + call this%dust_emis%WritePatchToLog( p ) + end do + call endrun( "exit early") + end subroutine print_patch + + !----------------------------------------------------------------------- + subroutine validate_patch(this, p) + class(TestDustEmis), intent(inout) :: this + integer, intent(in) :: p + + real(r8) :: flx_mss_vrt_dst(ndst) + real(r8) :: flx_mss_vrt_dst_tot + real(r8) :: vlc_trb(ndst) + real(r8) :: vlc_trb_1 + real(r8) :: vlc_trb_2 + real(r8) :: vlc_trb_3 + real(r8) :: vlc_trb_4 + + call this%dust_emis%GetPatchVars( p, flx_mss_vrt_dst=flx_mss_vrt_dst, & + flx_mss_vrt_dst_tot=flx_mss_vrt_dst_tot, vlc_trb=vlc_trb, & + vlc_trb_1=vlc_trb_1, vlc_trb_2=vlc_trb_2, vlc_trb_3=vlc_trb_3, & + vlc_trb_4=vlc_trb_4 ) + @assertEqual( sum(flx_mss_vrt_dst), flx_mss_vrt_dst_tot ) + @assertEqual( vlc_trb(1), vlc_trb_1) + @assertEqual( vlc_trb(2), vlc_trb_2) + @assertEqual( vlc_trb(3), vlc_trb_3) + @assertEqual( vlc_trb(4), vlc_trb_4) + end subroutine validate_patch + !----------------------------------------------------------------------- @Test subroutine check_dust_emis(this) class(TestDustEmis), intent(inout) :: this + integer :: p + real(r8) :: flx_mss_vrt_dst_tot + real(r8) :: vlc_trb_1 + real(r8) :: vlc_trb_2 + real(r8) :: vlc_trb_3 + real(r8) :: vlc_trb_4 call this%create_atm2lnd() call this%create_fv() @@ -243,6 +298,17 @@ contains this%soilstate_inst, this%canopystate_inst, this%water_inst%waterstatebulk_inst, & this%water_inst%waterdiagnosticbulk_inst, this%frictionvel_inst) call this%dust_emis%DustDryDep(bounds, this%atm2lnd_inst, this%frictionvel_inst) + do p = bounds%begp, bounds%endp + call this%validate_patch(p) + call this%dust_emis%GetPatchVars( p, flx_mss_vrt_dst_tot=flx_mss_vrt_dst_tot, & + vlc_trb_1=vlc_trb_1, vlc_trb_2=vlc_trb_2, vlc_trb_3=vlc_trb_3, & + vlc_trb_4=vlc_trb_4) + @assertEqual( 0.0_r8, flx_mss_vrt_dst_tot ) + @assertEqual( 3.319559266672431d-5, vlc_trb_1, tolerance=tol ) + @assertEqual( 1.699714729099379d-5, vlc_trb_2, tolerance=tol ) + @assertEqual( 9.163854318535118d-6, vlc_trb_3, tolerance=tol ) + @assertEqual( 3.614237762488103d-5, vlc_trb_4, tolerance=tol ) + end do end subroutine check_dust_emis From 93c274d7570d8f33002ac0156fc4a977670feef2 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Tue, 21 May 2024 12:30:38 -0600 Subject: [PATCH 0296/1248] Update README by removing mention of /test directory --- README | 1 - 1 file changed, 1 deletion(-) diff --git a/README b/README index 4699fec858..af45a14909 100644 --- a/README +++ b/README @@ -47,7 +47,6 @@ doc --------------- Documentation of CTSM. bld --------------- build-namelist scripts for CTSM. src --------------- CTSM Source code. lilac ------------- Lightweight Infrastructure for Land-Atmosphere Coupling (for coupling to a host atmosphere model) -test -------------- CTSM Testing scripts for CTSM offline tools (deprecated) tools ------------- CTSM Offline tools to prepare input datasets and process output. cime_config ------- Configuration files of cime for compsets and CTSM settings manage_externals -- Script to manage the external source directories (deprecated) From 802b989d5c408a36bccf07b24f2f8a2724e4ca59 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Tue, 21 May 2024 15:11:29 -0600 Subject: [PATCH 0297/1248] Second draft of ChangeLog/ChangeSum --- doc/ChangeLog | 37 ++++++++++++++++++++----------------- doc/ChangeSum | 2 +- 2 files changed, 21 insertions(+), 18 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index 5644ed295d..d68ef323ac 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,18 +1,18 @@ =============================================================== Tag name: ctsm5.2.006 Originator(s): slevis (Samuel Levis) -Date: Fri May 17 16:17:54 MDT 2024 -One-line Summary: Update externals to cesm2_3_beta17 +Date: Tue 21 May 2024 02:59:05 PM MDT +One-line Summary: Update externals to cesm2_3_beta17, remove mct, retire /test/tools Purpose and description of changes ---------------------------------- -#2493 update externals to beta17 -#2294 remove references to mct but do not remove /src/mct + #2493 update externals to beta17 + #2294 remove mct but not in Externals.cfg + #2279 Retire the /test/tools framework for CESM test system custom tests that do the same thing -Changes unrelated to the tag's title: -#2546 fix error in cam4/cam5 test (ekluzek) -Remove /test/tools/test_driver.sh + Changes unrelated to the tag's title: + #2546 fix error in cam4/cam5 test (ekluzek) Significant changes to scientifically-supported configurations -------------------------------------------------------------- @@ -36,20 +36,23 @@ Does this tag change answers significantly for any of the following physics conf Bugs fixed ---------- List of CTSM issues fixed (include CTSM Issue # and description) [one per line]: -Fixes #2493 update externals to beta17 -Fixes #2546 fix error in cam4/cam5 test (unrelated) + Fixes #2493 update externals to beta17 + Fixes #2279 Retire the /test/tools framework for CESM test system custom tests that do the same thing + Fixes #2546 fix error in cam4/cam5 test (unrelated) Notes of particular relevance for users --------------------------------------- -Changes to documentation: Remove references to mct and cpl7 +Changes to documentation: + Remove references to mct and cpl7 -Substantial timing or memory changes: Not considered +Substantial timing or memory changes: + Not considered Notes of particular relevance for developers: --------------------------------------------- Changes to tests or testing: -I added a long list of izumi nag debug tests to ExpectedFailures as per -https://github.com/ESCOMP/CMEPS/pull/460 + I added a long list of izumi nag debug tests to ExpectedFailures as per + https://github.com/ESCOMP/CMEPS/pull/460 Testing summary: ---------------- @@ -57,16 +60,16 @@ Testing summary: build-namelist tests (if CLMBuildNamelist.pm has changed): - derecho - + derecho - PASS python testing (if python code has changed; see instructions in python/README.md; document testing done): - (any machine) - + derecho - PASS regular tests (aux_clm: https://github.com/ESCOMP/CTSM/wiki/System-Testing-Guide#pre-merge-system-testing): derecho ----- - izumi ------- IN PROGRESS + izumi ------- OK any other testing (give details below): @@ -98,7 +101,7 @@ Changes answers relative to baseline: Other details ------------- List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): -cism, ccs_config, cime, cmeps, cdeps + cism, ccs_config, cime, cmeps, cdeps Pull Requests that document the changes (include PR ids): https://github.com/ESCOMP/ctsm/pull/2539 diff --git a/doc/ChangeSum b/doc/ChangeSum index c73cb19309..7f8cdaeead 100644 --- a/doc/ChangeSum +++ b/doc/ChangeSum @@ -1,6 +1,6 @@ Tag Who Date Summary ============================================================================================================================ - ctsm5.2.006 slevis 05/17/2024 Update externals to cesm2_3_beta17 + ctsm5.2.006 slevis 05/21/2024 Update externals to cesm2_3_beta17, remove mct, retire /test/tools ctsm5.2.005 erik 05/13/2024 Fix clm6_0 defaults and CESM testing issues, add tests to detect these problems ctsm5.2.004 multiple 05/09/2024 CTSM5.2 1979 fsurdat and 1979-2026 landuse ne0np4 files + two fixes ctsm5.2.003 samrabin 05/02/2024 Merge b4b-dev From ae5dbeae61ef39be636a0293eac5f26defc2a5c5 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Tue, 21 May 2024 20:04:17 -0600 Subject: [PATCH 0298/1248] Add more clean routines at the end so can do a different test that shows increasing wind has more dust emission --- src/biogeochem/DUSTMod.F90 | 51 ++++++++-- .../test/DustEmis_test/test_DustEmis.pf | 94 +++++++++++++++---- 2 files changed, 121 insertions(+), 24 deletions(-) diff --git a/src/biogeochem/DUSTMod.F90 b/src/biogeochem/DUSTMod.F90 index cd60bd859f..c34f3a6e06 100644 --- a/src/biogeochem/DUSTMod.F90 +++ b/src/biogeochem/DUSTMod.F90 @@ -66,6 +66,8 @@ module DUSTMod procedure , public :: DustDryDep ! Turbulent dry deposition for dust procedure , public :: WritePatchToLog ! Write information on the given patch to the log file procedure , public :: GetPatchVars ! Get important variables on a given patch + procedure , public :: GetConstVars ! Get important constant variables + procedure , public :: Clean ! Deallocate data procedure , private :: InitAllocate procedure , private :: InitHistory procedure , private :: InitCold @@ -94,6 +96,32 @@ subroutine Init(this, bounds, NLFilename) end subroutine Init + + + !------------------------------------------------------------------------ + subroutine Clean(this) + ! + ! !ARGUMENTS: + class (dust_type) :: this + ! + ! !LOCAL VARIABLES: + !------------------------------------------------------------------------ + + deallocate(this%flx_mss_vrt_dst_patch) + deallocate(this%flx_mss_vrt_dst_tot_patch) + deallocate(this%vlc_trb_patch) + deallocate(this%vlc_trb_1_patch) + deallocate(this%vlc_trb_2_patch) + deallocate(this%vlc_trb_3_patch) + deallocate(this%vlc_trb_4_patch) + deallocate(this%mbl_bsn_fct_col) + + deallocate (ovr_src_snk_mss) + deallocate (dmt_vwr) + deallocate (stk_crc) + + end subroutine Clean + !------------------------------------------------------------------------ subroutine InitAllocate(this, bounds) ! @@ -221,19 +249,17 @@ subroutine WritePatchToLog(this, p) class(dust_type), intent(in) :: this integer , intent(in) :: p ! Patch to display - write(iulog,*) 'flx_mss_vrt_dst', this%flx_mss_vrt_dst_patch(p,:) write(iulog,*) 'flx_mss_vrt_dst_tot', this%flx_mss_vrt_dst_tot_patch(p) write(iulog,*) 'vlc_trb_1', this%vlc_trb_1_patch(p) write(iulog,*) 'vlc_trb_2', this%vlc_trb_2_patch(p) write(iulog,*) 'vlc_trb_3', this%vlc_trb_3_patch(p) write(iulog,*) 'vlc_trb_4', this%vlc_trb_4_patch(p) - write(iulog,*) 'mbl_bsn_fct', this%mbl_bsn_fct_col(p) - end subroutine WritePatchToLog + end subroutine WritePatchToLog !----------------------------------------------------------------------- - subroutine GetPatchVars(this, p, flx_mss_vrt_dst, flx_mss_vrt_dst_tot, vlc_trb, vlc_trb_1, & - vlc_trb_2, vlc_trb_3, vlc_trb_4) + subroutine GetPatchVars(this, p, flx_mss_vrt_dst, flx_mss_vrt_dst_tot, vlc_trb, vlc_trb_1, & + vlc_trb_2, vlc_trb_3, vlc_trb_4) ! ! !DESCRIPTION: ! Get important variables on the given patch @@ -255,7 +281,20 @@ subroutine GetPatchVars(this, p, flx_mss_vrt_dst, flx_mss_vrt_dst_tot, vlc_trb, if ( present(vlc_trb_2) ) vlc_trb_2 = this%vlc_trb_2_patch(p) if ( present(vlc_trb_3) ) vlc_trb_3 = this%vlc_trb_3_patch(p) if ( present(vlc_trb_4) ) vlc_trb_4 = this%vlc_trb_4_patch(p) -end subroutine GetPatchVars + end subroutine GetPatchVars + + !----------------------------------------------------------------------- + + subroutine GetConstVars(this, SaltationFactor ) + ! + ! !DESCRIPTION: + ! Get important constant variables + ! !ARGUMENTS: + class(dust_type) , intent(in) :: this + real(r8) , intent(out) :: SaltationFactor + + SaltationFactor = tmp1 + end subroutine GetConstVars !------------------------------------------------------------------------ subroutine DustEmission (this, bounds, & diff --git a/src/biogeochem/test/DustEmis_test/test_DustEmis.pf b/src/biogeochem/test/DustEmis_test/test_DustEmis.pf index 08aa683964..4f8f7093d7 100644 --- a/src/biogeochem/test/DustEmis_test/test_DustEmis.pf +++ b/src/biogeochem/test/DustEmis_test/test_DustEmis.pf @@ -8,7 +8,7 @@ module test_DustEmis use clm_varpar, only : nlevsoi, nlevgrnd, nlevsno, clm_varpar_init, ndst use clm_varctl, only : soil_layerstruct_predefined, create_crop_landunit, use_crop, create_crop_landunit use clm_varcon, only : clm_varcon_init, clm_varcon_clean - use SnowHydrologyMod, only : InitSnowLayers, SnowHydrologySetControlForTesting + use SnowHydrologyMod, only : InitSnowLayers, SnowHydrologySetControlForTesting, SnowHydrologyClean use DUSTMod use shr_kind_mod , only : r8 => shr_kind_r8 use unittestFilterBuilderMod, only : filter_from_range @@ -16,7 +16,7 @@ module test_DustEmis use SoilStateType, only : soilstate_type use CanopyStateType, only : canopystate_type use TemperatureType, only : temperature_type - use WaterType, only : water_type + use WaterType, only : water_type use FrictionVelocityMod, only : frictionvel_type use unittestWaterTypeFactory, only : unittest_water_type_factory_type use abortutils, only : endrun @@ -43,7 +43,7 @@ module test_DustEmis procedure :: setupEnvironment procedure :: create_atm2lnd procedure :: create_fv - procedure :: print_patch + procedure :: print_values procedure :: validate_patch end type TestDustEmis @@ -116,7 +116,9 @@ contains subroutine tearDown(this) class(TestDustEmis), intent(inout) :: this + call this%dust_emis%Clean() call this%water_factory%teardown(this%water_inst) + call SnowHydrologyClean() call unittest_subgrid_teardown() call this%atm2lnd_inst%Clean() call clm_varcon_clean() @@ -163,7 +165,7 @@ contains grc%londeg(:) = 0.0_r8 grc%area(:) = 10.0_r8 - + end subroutine setupEnvironment !----------------------------------------------------------------------- @@ -207,40 +209,43 @@ contains ! Initializes some fields needed for dust emissions in this%frictionvel_inst, and sets ! fields based on inputs. Excluded inputs are given a default value class(TestDustEmis), intent(inout) :: this - real(r8), intent(in), optional :: fv(:) - real(r8), intent(in), optional :: u10(:) - real(r8), intent(in), optional :: ram1(:) + real(r8), intent(in), optional :: fv + real(r8), intent(in), optional :: u10 + real(r8), intent(in), optional :: ram1 - real(r8), parameter :: fv_default = 0.2_r8 + real(r8), parameter :: fv_default = 2.0_r8 real(r8), parameter :: u10_default = 4._r8 real(r8), parameter :: ram1_default = 200._r8 ! ------------------------------------------------------------------------ if (present(fv)) then - this%frictionvel_inst%fv_patch(bounds%begp:bounds%endp) = fv(:) + this%frictionvel_inst%fv_patch(bounds%begp:bounds%endp) = fv else this%frictionvel_inst%fv_patch(bounds%begp:bounds%endp) = fv_default end if if (present(u10)) then - this%frictionvel_inst%u10_patch(bounds%begp:bounds%endp) = u10(:) + this%frictionvel_inst%u10_patch(bounds%begp:bounds%endp) = u10 else this%frictionvel_inst%u10_patch(bounds%begp:bounds%endp) = u10_default end if if (present(ram1)) then - this%frictionvel_inst%ram1_patch(bounds%begp:bounds%endp) = ram1(:) + this%frictionvel_inst%ram1_patch(bounds%begp:bounds%endp) = ram1 else this%frictionvel_inst%ram1_patch(bounds%begp:bounds%endp) = ram1_default end if end subroutine create_fv - subroutine print_patch(this) + subroutine print_values(this) use LandunitType, only : lun + use PatchType, only : patch class(TestDustEmis), intent(inout) :: this + real(r8) :: SaltationFactor integer :: p, c, l + call this%dust_emis%GetConstVars( SaltationFactor ) do l = bounds%begl, bounds%endl print *, 'landunit type= ', lun%itype(l) end do @@ -248,13 +253,22 @@ contains print *, 'watsat = ', this%soilstate_inst%watsat_col(c,1) print *, 'h2osoi_vol = ', this%water_inst%waterstatebulk_inst%h2osoi_vol_col(c,1) print *, 'frac_sno = ', this%water_inst%waterdiagnosticbulk_inst%frac_sno_col(c) + print *, 'mss_frac_clay_vld = ', this%soilstate_inst%mss_frc_cly_vld_col(c) + print *, 'saltation per rho = ', (SaltationFactor / this%atm2lnd_inst%forc_rho_downscaled_col(c)) end do do p = bounds%begp, bounds%endp + print *, 'patch type= ', patch%itype(p) + print *, 'patch weight= ', patch%wtgcell(p) + print *, 'patch active= ', patch%active(p) print *, 'tlai = ', this%canopystate_inst%tlai_patch(p) + print *, 'tsai = ', this%canopystate_inst%tsai_patch(p) + c = patch%column(p) + print *, 'Wind threshold fraction = ', (SaltationFactor / this%atm2lnd_inst%forc_rho_downscaled_col(c)) & + / this%frictionvel_inst%fv_patch(p) call this%dust_emis%WritePatchToLog( p ) end do call endrun( "exit early") - end subroutine print_patch + end subroutine print_values !----------------------------------------------------------------------- subroutine validate_patch(this, p) @@ -284,6 +298,7 @@ contains @Test subroutine check_dust_emis(this) + ! Check dust emissions for default values class(TestDustEmis), intent(inout) :: this integer :: p real(r8) :: flx_mss_vrt_dst_tot @@ -303,15 +318,58 @@ contains call this%dust_emis%GetPatchVars( p, flx_mss_vrt_dst_tot=flx_mss_vrt_dst_tot, & vlc_trb_1=vlc_trb_1, vlc_trb_2=vlc_trb_2, vlc_trb_3=vlc_trb_3, & vlc_trb_4=vlc_trb_4) - @assertEqual( 0.0_r8, flx_mss_vrt_dst_tot ) - @assertEqual( 3.319559266672431d-5, vlc_trb_1, tolerance=tol ) - @assertEqual( 1.699714729099379d-5, vlc_trb_2, tolerance=tol ) - @assertEqual( 9.163854318535118d-6, vlc_trb_3, tolerance=tol ) - @assertEqual( 3.614237762488103d-5, vlc_trb_4, tolerance=tol ) + @assertEqual( flx_mss_vrt_dst_tot, 2.239779135859605d-5, tolerance=tol ) + @assertEqual( vlc_trb_1, 3.407721147709135d-003, tolerance=tol ) + @assertEqual( vlc_trb_2, 4.961153753164878d-003, tolerance=tol ) + @assertEqual( vlc_trb_3, 4.980100969983446d-003, tolerance=tol ) + @assertEqual( vlc_trb_4, 4.977071672163210d-003, tolerance=tol ) end do end subroutine check_dust_emis + @Test + subroutine check_dust_emis_increasing_wind(this) + ! Check dust emissions with increasing wind + class(TestDustEmis), intent(inout) :: this + integer :: p, c + real(r8) :: flx_mss_vrt_dst_tot + real(r8) :: vlc_trb_1 + real(r8) :: vlc_trb_2 + real(r8) :: vlc_trb_3 + real(r8) :: vlc_trb_4 + real(r8) :: fv = 4.0_r8 + real(r8) :: u10 = 10._r8 + real(r8) :: total_dust0, total_dust_higher + + ! Run baseline u10 + call this%create_atm2lnd() + call this%create_fv( u10=u10, fv=fv ) + call this%dust_emis%DustEmission(bounds, this%num_nolakep, this%filter_nolakep, this%atm2lnd_inst, & + this%soilstate_inst, this%canopystate_inst, this%water_inst%waterstatebulk_inst, & + this%water_inst%waterdiagnosticbulk_inst, this%frictionvel_inst) + call this%dust_emis%DustDryDep(bounds, this%atm2lnd_inst, this%frictionvel_inst) + do p = bounds%begp, bounds%endp + call this%validate_patch(p) + call this%dust_emis%GetPatchVars( p, flx_mss_vrt_dst_tot=flx_mss_vrt_dst_tot ) + total_dust0 = flx_mss_vrt_dst_tot + @assertEqual( flx_mss_vrt_dst_tot, 1.971366884000767d-4, tolerance=tol ) + end do + ! Double u10 and show result is higher + call this%create_fv( u10=u10*2.0_r8, fv=fv) + call this%dust_emis%DustEmission(bounds, this%num_nolakep, this%filter_nolakep, this%atm2lnd_inst, & + this%soilstate_inst, this%canopystate_inst, this%water_inst%waterstatebulk_inst, & + this%water_inst%waterdiagnosticbulk_inst, this%frictionvel_inst) + call this%dust_emis%DustDryDep(bounds, this%atm2lnd_inst, this%frictionvel_inst) + do p = bounds%begp, bounds%endp + call this%validate_patch(p) + call this%dust_emis%GetPatchVars( p, flx_mss_vrt_dst_tot=flx_mss_vrt_dst_tot ) + total_dust_higher = flx_mss_vrt_dst_tot + @assertEqual( flx_mss_vrt_dst_tot, 3.288208220877217d-4, tolerance=tol ) + end do + @assertGreaterThan( total_dust_higher, total_dust0 ) + + end subroutine check_dust_emis_increasing_wind + !----------------------------------------------------------------------- end module test_DustEmis \ No newline at end of file From f2500c7c6d05db9810b0c8610a7962a2da40064d Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Tue, 21 May 2024 20:16:06 -0600 Subject: [PATCH 0299/1248] Tighten the tolerance for numbers on the order of e-3 --- src/biogeochem/test/DustEmis_test/test_DustEmis.pf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/biogeochem/test/DustEmis_test/test_DustEmis.pf b/src/biogeochem/test/DustEmis_test/test_DustEmis.pf index 4f8f7093d7..616fd776fc 100644 --- a/src/biogeochem/test/DustEmis_test/test_DustEmis.pf +++ b/src/biogeochem/test/DustEmis_test/test_DustEmis.pf @@ -23,7 +23,7 @@ module test_DustEmis implicit none - real(r8), parameter :: tol = 1.e-13_r8 + real(r8), parameter :: tol = 1.e-18_r8 @TestCase type, extends(TestCase) :: TestDustEmis From 1ba3473c1999073f0ecba7e4cbcf8d0b7d56fae1 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Tue, 21 May 2024 21:14:01 -0600 Subject: [PATCH 0300/1248] Add a check that figures out the value of fv where the wind threshold won't be met and dust will be zero --- .../test/DustEmis_test/test_DustEmis.pf | 37 ++++++++++++++++--- 1 file changed, 31 insertions(+), 6 deletions(-) diff --git a/src/biogeochem/test/DustEmis_test/test_DustEmis.pf b/src/biogeochem/test/DustEmis_test/test_DustEmis.pf index 616fd776fc..c7e7566778 100644 --- a/src/biogeochem/test/DustEmis_test/test_DustEmis.pf +++ b/src/biogeochem/test/DustEmis_test/test_DustEmis.pf @@ -19,7 +19,6 @@ module test_DustEmis use WaterType, only : water_type use FrictionVelocityMod, only : frictionvel_type use unittestWaterTypeFactory, only : unittest_water_type_factory_type - use abortutils, only : endrun implicit none @@ -267,7 +266,6 @@ contains / this%frictionvel_inst%fv_patch(p) call this%dust_emis%WritePatchToLog( p ) end do - call endrun( "exit early") end subroutine print_values !----------------------------------------------------------------------- @@ -327,16 +325,43 @@ contains end subroutine check_dust_emis + !----------------------------------------------------------------------- + + @Test + subroutine dust_zero_for_fixed_ratio(this) + ! Check dust emissions are zero for a no wind + class(TestDustEmis), intent(inout) :: this + integer :: p + real(r8) :: flx_mss_vrt_dst_tot + real(r8) :: fv + real(r8) :: SaltationFactor + + call this%create_atm2lnd() + call this%dust_emis%GetConstVars( SaltationFactor ) + ! Figure out what fv needs to be so that the wind threshold will be u10*(1/(1-eps)) + fv = ( SaltationFactor / sqrt( this%atm2lnd_inst%forc_rho_downscaled_col(bounds%begc)) ) - 1.d-15 + call this%create_fv( fv=fv ) + call this%dust_emis%DustEmission(bounds, this%num_nolakep, this%filter_nolakep, this%atm2lnd_inst, & + this%soilstate_inst, this%canopystate_inst, this%water_inst%waterstatebulk_inst, & + this%water_inst%waterdiagnosticbulk_inst, this%frictionvel_inst) + call this%dust_emis%DustDryDep(bounds, this%atm2lnd_inst, this%frictionvel_inst) + call this%print_values() + do p = bounds%begp, bounds%endp + call this%validate_patch(p) + call this%dust_emis%GetPatchVars( p, flx_mss_vrt_dst_tot=flx_mss_vrt_dst_tot ) + @assertEqual( flx_mss_vrt_dst_tot, 0.0_r8 ) + end do + + end subroutine dust_zero_for_fixed_ratio + + !----------------------------------------------------------------------- + @Test subroutine check_dust_emis_increasing_wind(this) ! Check dust emissions with increasing wind class(TestDustEmis), intent(inout) :: this integer :: p, c real(r8) :: flx_mss_vrt_dst_tot - real(r8) :: vlc_trb_1 - real(r8) :: vlc_trb_2 - real(r8) :: vlc_trb_3 - real(r8) :: vlc_trb_4 real(r8) :: fv = 4.0_r8 real(r8) :: u10 = 10._r8 real(r8) :: total_dust0, total_dust_higher From 3967d77a17e4e6a02362aec42aa3feb187ba6c72 Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Wed, 22 May 2024 10:28:47 -0600 Subject: [PATCH 0301/1248] new fates api 36 paramfile default --- 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 6ef91bb4a0..fdfeba7719 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -481,7 +481,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). -lnd/clm2/paramdata/fates_params_api.35.0.0_12pft_c240326.nc +lnd/clm2/paramdata/fates_params_api.36.0.0_12pft_c240517.nc From 5b30740bd91e421639bb46239f4d921b8e767b54 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Wed, 22 May 2024 13:37:16 -0600 Subject: [PATCH 0302/1248] Pin FATES external to commit a997af5. --- Externals_CLM.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Externals_CLM.cfg b/Externals_CLM.cfg index cfb7beb40f..a8d53e4fdb 100644 --- a/Externals_CLM.cfg +++ b/Externals_CLM.cfg @@ -2,7 +2,7 @@ local_path = src/fates protocol = git repo_url = https://github.com/ckoven/fates -branch = luh2_nocomp_merge +hash = a997af58f38db8ffda259e11f3abcc65478a4903 required = True [externals_description] From 2a7ca01b2177b480e8897fd2921bf00a7ac9c48f Mon Sep 17 00:00:00 2001 From: loaner Date: Wed, 22 May 2024 17:43:48 -0700 Subject: [PATCH 0303/1248] add systemtest for potential vegetation spin up --- cime_config/SystemTests/pvt.py | 120 ++++++++++++++++++++ cime_config/SystemTests/systemtest_utils.py | 20 +++- 2 files changed, 139 insertions(+), 1 deletion(-) create mode 100644 cime_config/SystemTests/pvt.py diff --git a/cime_config/SystemTests/pvt.py b/cime_config/SystemTests/pvt.py new file mode 100644 index 0000000000..e18022220d --- /dev/null +++ b/cime_config/SystemTests/pvt.py @@ -0,0 +1,120 @@ +""" +FATES land use potential vegetation spin up + transient test + +This is a FATES specific test: + +1) conduct a spinup with use_fates_potentialveg on + - write restart file + - use CLM_ACCELERATED_SPINUP? +2) run a transient landuse case with use_fates_lupft + - start from the restart file generated in (1) + +""" +from CIME.XML.standard_module_setup import * +from CIME.SystemTests.system_tests_common import SystemTestsCommon +from systemtest_utils import read_user_nl_clm +import shutil, glob, os + +logger = logging.getLogger(__name__) + +class PVT(SystemTestsCommon): + def __init_(self,case): + SystemTestsCommon.__init__(self,case) + + # Do not allow PVT to be run with certain testmods + # Should this be targeted to a specific testmod for simplicity for now? + # Technically this could be run with the luh fates_harvest_modes + casebaseid = self._case.get_value("CASEBASEID") + casebasid = casebaseid.split("-")[-1] + if casebaseid[0:10] != "FatesLUPFT": + error_message = ( + "Only call PVT with test FatesLUPFT" + ) + logger.error(error_message) + raise RuntimeError(error_message) + + # Only allow to run if resolution is 4x5 for now + # Eventually we could set this up to generate the necessary land use x pft mapping + # on the fly, although this would also require generating the land use timeseries + # regridding on the fly which is a more time consuming endevour currently + lnd_grid = self._case.get_value("LND_GRID") + if lnd_grid != "4x5": + error_message = ( + "PVT can currently only be run with 4x5 resolution" + ) + logger.error(error_message) + raise RuntimeError(error_message) + + def run_phase(self): + # ------------------------------------------------------------------- + # (1) Run FATES spin-up case in potential vegetation mode + # ------------------------------------------------------------------- + orig_case = self._case + orig_casevar = self._case.get_value("CASE") + caseroot = self._case.get_value("CASEROOT") + + # clone the main case to create spinup case + logger.info("PVT log: cloning setup") + clone_path = "{}.potveg".format(caseroot) + if os.path.exists(clone_path): + shutil.rmtree(clone_path) + logger.info("PVT log: cloning") + clone = self._case.create_clone(clone_path, keepexe=True) + logger.info("PVT log: cloning complete") + + # setup the clone case + os.chdir(clone_path) + self._set_active_case(clone) + self._setup_all() + + # Modify the spin up case to use the potential vegetation mode. + # Checks for incompatible cases and necessary mapping files are + # handled in the build case. + # use_fates_lupft should be set to true in the testmod + # save off the harvest mode for reinstating later + found, hmode = self.read_user_nl_clm('fates_harvest_mode') + logger.info("PVT log: modify user_nl_clm file for spin up run") + # TODO: remove fates_harvest_mode if found + self._append_to_user_nl_clm( + [ + "use_fates_potentialveg = .true.", + ] + ) + + stop_n_pveg = 1 + with clone: + # clone.set_value("CLM_ACCELERATED_SPINUP", "on") + clone.set_value("STOP_N", stop_n_pveg) + + # Run the spin up case + # As per SSP test: + # "No history files expected, set suffix=None to avoid compare error" + logger.info("PVT log: starting spin-up run") + dout_sr = clone.get_value("DOUT_S_ROOT") + self._skip_pnl = False + self.run_indv(suffix=None, st_archive=True) + + # ------------------------------------------------------------------- + # (2) Run FATES transient case using restart file from spin-up + # ------------------------------------------------------------------- + os.chdir(caseroot) + self._set_active_case(orig_case) + + # logger.info("PVT log: modify user_nl_clm file for transient run") + # self._append_to_user_nl_clm( + # [ + # "use_fates_potentialveg = .true.", + # ] + # ) + + + self._case.set_value("CLM_ACCELERATED_SPINUP", "off") + self._case.set_value("RUN_TYPE", "hybrid") + self._case.set_value("GET_REFCASE", False) + self._case.set_value("RUN_REFCASE", "{}.potveg".format(orig_casevar)) + self._case.set_value("RUN_REFDATE", "1700-01-01") + self._case.set_value("DOUT_S", False) + self._case.flush() + + # do the restart run (short term archiving is off) + self.run_indv() diff --git a/cime_config/SystemTests/systemtest_utils.py b/cime_config/SystemTests/systemtest_utils.py index c5ac986abd..8447934797 100644 --- a/cime_config/SystemTests/systemtest_utils.py +++ b/cime_config/SystemTests/systemtest_utils.py @@ -2,7 +2,7 @@ Reduce code duplication by putting reused functions here. """ -import os, subprocess +import os, subprocess, re def cmds_to_setup_conda(caseroot): @@ -84,3 +84,21 @@ def run_python_script(caseroot, this_conda_env, command_in, tool_path): except: print(f"ERROR trying to run {tool_name}.") raise + +def read_user_nl_clm(self,namelist_option): + user_nl_clm_path = os.path.join(self._get_caseroot(), "user_nl_clm") + with open(user_nl_clm_path) as f: + user_nl_clm_text = f.read() + reg = fr'{namelist_option}\s*=\s*([^\n]+)' + find_out = re.findall(reg, user_nl_clm_text) + # This could be more robust + if len(find_out) == 0: + return 0, False + elif len(find_out) > 1: + error_message = ( + "ERROR: read_user_nl_clm: namelist option is set more than once" + ) + # logger.error(error_message) + raise RuntimeError(error_message) + else: + return find_out[0], True From fc1400f5154f86a6d3346aebce677fff506400e8 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 22 May 2024 21:31:43 -0600 Subject: [PATCH 0304/1248] Add a check that when fsno is 1 dust emission is zeroed --- .../test/DustEmis_test/test_DustEmis.pf | 76 ++++++++++++------- 1 file changed, 50 insertions(+), 26 deletions(-) diff --git a/src/biogeochem/test/DustEmis_test/test_DustEmis.pf b/src/biogeochem/test/DustEmis_test/test_DustEmis.pf index c7e7566778..b9b00ae4fa 100644 --- a/src/biogeochem/test/DustEmis_test/test_DustEmis.pf +++ b/src/biogeochem/test/DustEmis_test/test_DustEmis.pf @@ -325,34 +325,58 @@ contains end subroutine check_dust_emis - !----------------------------------------------------------------------- + !----------------------------------------------------------------------- + + @Test + subroutine dust_zero_for_fixed_ratio(this) + ! Check dust emissions are zero for a no wind + class(TestDustEmis), intent(inout) :: this + integer :: p + real(r8) :: flx_mss_vrt_dst_tot + real(r8) :: fv + real(r8) :: SaltationFactor + + call this%create_atm2lnd() + call this%dust_emis%GetConstVars( SaltationFactor ) + ! Figure out what fv needs to be so that the wind threshold will be u10*(1/(1-eps)) + fv = ( SaltationFactor / sqrt( this%atm2lnd_inst%forc_rho_downscaled_col(bounds%begc)) ) - 1.d-15 + call this%create_fv( fv=fv ) + call this%dust_emis%DustEmission(bounds, this%num_nolakep, this%filter_nolakep, this%atm2lnd_inst, & + this%soilstate_inst, this%canopystate_inst, this%water_inst%waterstatebulk_inst, & + this%water_inst%waterdiagnosticbulk_inst, this%frictionvel_inst) + call this%dust_emis%DustDryDep(bounds, this%atm2lnd_inst, this%frictionvel_inst) + call this%print_values() + do p = bounds%begp, bounds%endp + call this%validate_patch(p) + call this%dust_emis%GetPatchVars( p, flx_mss_vrt_dst_tot=flx_mss_vrt_dst_tot ) + @assertEqual( flx_mss_vrt_dst_tot, 0.0_r8 ) + end do + + end subroutine dust_zero_for_fixed_ratio - @Test - subroutine dust_zero_for_fixed_ratio(this) - ! Check dust emissions are zero for a no wind - class(TestDustEmis), intent(inout) :: this - integer :: p - real(r8) :: flx_mss_vrt_dst_tot - real(r8) :: fv - real(r8) :: SaltationFactor - - call this%create_atm2lnd() - call this%dust_emis%GetConstVars( SaltationFactor ) - ! Figure out what fv needs to be so that the wind threshold will be u10*(1/(1-eps)) - fv = ( SaltationFactor / sqrt( this%atm2lnd_inst%forc_rho_downscaled_col(bounds%begc)) ) - 1.d-15 - call this%create_fv( fv=fv ) - call this%dust_emis%DustEmission(bounds, this%num_nolakep, this%filter_nolakep, this%atm2lnd_inst, & - this%soilstate_inst, this%canopystate_inst, this%water_inst%waterstatebulk_inst, & - this%water_inst%waterdiagnosticbulk_inst, this%frictionvel_inst) - call this%dust_emis%DustDryDep(bounds, this%atm2lnd_inst, this%frictionvel_inst) - call this%print_values() - do p = bounds%begp, bounds%endp - call this%validate_patch(p) - call this%dust_emis%GetPatchVars( p, flx_mss_vrt_dst_tot=flx_mss_vrt_dst_tot ) - @assertEqual( flx_mss_vrt_dst_tot, 0.0_r8 ) - end do + !----------------------------------------------------------------------- - end subroutine dust_zero_for_fixed_ratio + @Test + subroutine dust_zero_when_fsno_one(this) + ! Check dust emissions are zero for a no wind + class(TestDustEmis), intent(inout) :: this + integer :: p + real(r8) :: flx_mss_vrt_dst_tot + + call this%create_atm2lnd() + this%water_inst%waterdiagnosticbulk_inst%frac_sno_col(:) = 1.0_r8 + call this%create_fv( ) + call this%dust_emis%DustEmission(bounds, this%num_nolakep, this%filter_nolakep, this%atm2lnd_inst, & + this%soilstate_inst, this%canopystate_inst, this%water_inst%waterstatebulk_inst, & + this%water_inst%waterdiagnosticbulk_inst, this%frictionvel_inst) + call this%dust_emis%DustDryDep(bounds, this%atm2lnd_inst, this%frictionvel_inst) + do p = bounds%begp, bounds%endp + call this%validate_patch(p) + call this%dust_emis%GetPatchVars( p, flx_mss_vrt_dst_tot=flx_mss_vrt_dst_tot ) + @assertEqual( flx_mss_vrt_dst_tot, 0.0_r8 ) + end do + + end subroutine dust_zero_when_fsno_one !----------------------------------------------------------------------- From ebdd3267f099fe995c379543a932dfc69b14b969 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 22 May 2024 21:54:28 -0600 Subject: [PATCH 0305/1248] Add a test that tlai set to 0.3 has zero dust emission --- .../test/DustEmis_test/test_DustEmis.pf | 26 ++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/src/biogeochem/test/DustEmis_test/test_DustEmis.pf b/src/biogeochem/test/DustEmis_test/test_DustEmis.pf index b9b00ae4fa..764947836d 100644 --- a/src/biogeochem/test/DustEmis_test/test_DustEmis.pf +++ b/src/biogeochem/test/DustEmis_test/test_DustEmis.pf @@ -358,7 +358,7 @@ contains @Test subroutine dust_zero_when_fsno_one(this) - ! Check dust emissions are zero for a no wind + ! Check dust emissions are zero when snow fraction is identically 1 class(TestDustEmis), intent(inout) :: this integer :: p real(r8) :: flx_mss_vrt_dst_tot @@ -380,6 +380,30 @@ contains !----------------------------------------------------------------------- + @Test + subroutine dust_zero_when_tlai_high(this) + ! Check dust emissions are zero when LAI is high enough + class(TestDustEmis), intent(inout) :: this + integer :: p + real(r8) :: flx_mss_vrt_dst_tot + + call this%create_atm2lnd() + call this%create_fv( ) + this%canopystate_inst%tlai_patch(:) = 0.3_r8 + call this%dust_emis%DustEmission(bounds, this%num_nolakep, this%filter_nolakep, this%atm2lnd_inst, & + this%soilstate_inst, this%canopystate_inst, this%water_inst%waterstatebulk_inst, & + this%water_inst%waterdiagnosticbulk_inst, this%frictionvel_inst) + call this%dust_emis%DustDryDep(bounds, this%atm2lnd_inst, this%frictionvel_inst) + do p = bounds%begp, bounds%endp + call this%validate_patch(p) + call this%dust_emis%GetPatchVars( p, flx_mss_vrt_dst_tot=flx_mss_vrt_dst_tot ) + @assertEqual( flx_mss_vrt_dst_tot, 0.0_r8 ) + end do + + end subroutine dust_zero_when_tlai_high + + !----------------------------------------------------------------------- + @Test subroutine check_dust_emis_increasing_wind(this) ! Check dust emissions with increasing wind From 171c981240b2b2c7f614813401f99795fb8c33dc Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 22 May 2024 22:58:36 -0600 Subject: [PATCH 0306/1248] Add test that dust emissions are zero for all non-veg landunits --- .../test/DustEmis_test/test_DustEmis.pf | 29 ++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/src/biogeochem/test/DustEmis_test/test_DustEmis.pf b/src/biogeochem/test/DustEmis_test/test_DustEmis.pf index 764947836d..a76c724480 100644 --- a/src/biogeochem/test/DustEmis_test/test_DustEmis.pf +++ b/src/biogeochem/test/DustEmis_test/test_DustEmis.pf @@ -371,7 +371,6 @@ contains this%water_inst%waterdiagnosticbulk_inst, this%frictionvel_inst) call this%dust_emis%DustDryDep(bounds, this%atm2lnd_inst, this%frictionvel_inst) do p = bounds%begp, bounds%endp - call this%validate_patch(p) call this%dust_emis%GetPatchVars( p, flx_mss_vrt_dst_tot=flx_mss_vrt_dst_tot ) @assertEqual( flx_mss_vrt_dst_tot, 0.0_r8 ) end do @@ -380,6 +379,34 @@ contains !----------------------------------------------------------------------- + @Test + subroutine dust_zero_non_veg_lu(this) + ! Check dust emissions are zero for non-veg landunits + use landunit_varcon, only: istcrop, max_lunit + use LandunitType, only : lun + class(TestDustEmis), intent(inout) :: this + integer :: p, l + real(r8) :: flx_mss_vrt_dst_tot + + call this%create_atm2lnd() + call this%create_fv( ) + ! Set the lanunit type for + do l = istcrop+1, max_lunit + lun%itype(bounds%begl:bounds%endl) = l + call this%dust_emis%DustEmission(bounds, this%num_nolakep, this%filter_nolakep, this%atm2lnd_inst, & + this%soilstate_inst, this%canopystate_inst, this%water_inst%waterstatebulk_inst, & + this%water_inst%waterdiagnosticbulk_inst, this%frictionvel_inst) + call this%dust_emis%DustDryDep(bounds, this%atm2lnd_inst, this%frictionvel_inst) + do p = bounds%begp, bounds%endp + call this%dust_emis%GetPatchVars( p, flx_mss_vrt_dst_tot=flx_mss_vrt_dst_tot ) + @assertEqual( flx_mss_vrt_dst_tot, 0.0_r8 ) + end do + end do + + end subroutine dust_zero_non_veg_lu + + !----------------------------------------------------------------------- + @Test subroutine dust_zero_when_tlai_high(this) ! Check dust emissions are zero when LAI is high enough From b7cf13f6dcfd6c975de294ef90122bb4e2fc0d3e Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Thu, 23 May 2024 13:47:07 -0700 Subject: [PATCH 0307/1248] add PVT system test to the config_test xml file --- cime_config/config_tests.xml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/cime_config/config_tests.xml b/cime_config/config_tests.xml index c0b6afed9d..8a4388c664 100644 --- a/cime_config/config_tests.xml +++ b/cime_config/config_tests.xml @@ -123,6 +123,18 @@ This defines various CTSM-specific system tests $STOP_N + + FATES potential vegetarion spin-up + land use transient run test + 1 + ndays + startup + 4 + FALSE + FALSE + $STOP_OPTION + $STOP_N + + Generate prescribed maturity requirements, then test with them 1 From 8e35d80baf507185ef0dac47a4adee4bf975d47e Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Thu, 23 May 2024 14:29:02 -0600 Subject: [PATCH 0308/1248] add test mode for use_fates_lupft --- .../testdefs/testmods_dirs/clm/FatesLUPFT/include_user_mods | 1 + cime_config/testdefs/testmods_dirs/clm/FatesLUPFT/user_nl_clm | 1 + 2 files changed, 2 insertions(+) create mode 100644 cime_config/testdefs/testmods_dirs/clm/FatesLUPFT/include_user_mods create mode 100644 cime_config/testdefs/testmods_dirs/clm/FatesLUPFT/user_nl_clm diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesLUPFT/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/FatesLUPFT/include_user_mods new file mode 100644 index 0000000000..4c7aa0f2b4 --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/FatesLUPFT/include_user_mods @@ -0,0 +1 @@ +../Fates diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesLUPFT/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/FatesLUPFT/user_nl_clm new file mode 100644 index 0000000000..10044848a0 --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/FatesLUPFT/user_nl_clm @@ -0,0 +1 @@ +use_fates_lupft = .true. From a14ab0838951426162b7af5bb1a1a977cf6353cf Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Thu, 23 May 2024 14:53:35 -0600 Subject: [PATCH 0309/1248] Update cmeps to cmeps0.14.63 in Externals.cfg --- Externals.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Externals.cfg b/Externals.cfg index 8ef524bf24..70d103a94b 100644 --- a/Externals.cfg +++ b/Externals.cfg @@ -48,7 +48,7 @@ tag = cime6.0.238_httpsbranch01 required = True [cmeps] -tag = cmeps0.14.60 +tag = cmeps0.14.63 protocol = git repo_url = https://github.com/ESCOMP/CMEPS.git local_path = components/cmeps From af5451b7e37d53d1192fb87315d01fb16b527ba1 Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Thu, 23 May 2024 14:39:45 -0700 Subject: [PATCH 0310/1248] remove tabs and correct whitespace --- bld/CLMBuildNamelist.pm | 58 ++++++++++++++++++++--------------------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index acdad5c5cc..b17a245715 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -4520,22 +4520,22 @@ sub setup_logic_fates { "fates_harvest_mode","fates_parteh_mode", "use_fates_cohort_age_tracking","use_fates_tree_damage" ); foreach my $var ( @list ) { - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, $var, 'use_fates'=>$nl_flags->{'use_fates'}, - 'use_fates_sp'=>$nl_flags->{'use_fates_sp'} ); + add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, $var, 'use_fates'=>$nl_flags->{'use_fates'}, + 'use_fates_sp'=>$nl_flags->{'use_fates_sp'} ); } - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'use_fates_potentialveg', 'use_fates'=>$nl_flags->{'use_fates'}); - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'use_fates_lupft', 'use_fates'=>$nl_flags->{'use_fates'}); - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'use_fates_luh', 'use_fates'=>$nl_flags->{'use_fates'}, - 'use_fates_lupft'=>$nl->get_value('use_fates_lupft'), - 'use_fates_potentialveg'=>$nl->get_value('use_fates_potentialveg'), - 'fates_harvest_mode'=>$nl->get_value('fates_harvest_mode') ); - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'use_fates_nocomp', 'use_fates'=>$nl_flags->{'use_fates'}, - 'use_fates_lupft'=>$nl->get_value('use_fates_lupft'), - 'use_fates_sp'=>$nl_flags->{'use_fates_sp'} ); - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'use_fates_fixed_biogeog', 'use_fates'=>$nl_flags->{'use_fates'}, - 'use_fates_lupft'=>$nl->get_value('use_fates_lupft'), - 'use_fates_sp'=>$nl_flags->{'use_fates_sp'} ); + add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'use_fates_potentialveg', 'use_fates'=>$nl_flags->{'use_fates'}); + add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'use_fates_lupft', 'use_fates'=>$nl_flags->{'use_fates'}); + add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'use_fates_luh', 'use_fates'=>$nl_flags->{'use_fates'}, + 'use_fates_lupft'=>$nl->get_value('use_fates_lupft'), + 'use_fates_potentialveg'=>$nl->get_value('use_fates_potentialveg'), + 'fates_harvest_mode'=>$nl->get_value('fates_harvest_mode') ); + add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'use_fates_nocomp', 'use_fates'=>$nl_flags->{'use_fates'}, + 'use_fates_lupft'=>$nl->get_value('use_fates_lupft'), + 'use_fates_sp'=>$nl_flags->{'use_fates_sp'} ); + add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'use_fates_fixed_biogeog', 'use_fates'=>$nl_flags->{'use_fates'}, + 'use_fates_lupft'=>$nl->get_value('use_fates_lupft'), + 'use_fates_sp'=>$nl_flags->{'use_fates_sp'} ); my $suplnitro = $nl->get_value('suplnitro'); my $parteh_mode = $nl->get_value('fates_parteh_mode'); @@ -4564,8 +4564,8 @@ sub setup_logic_fates { # fates landuse can't be on with FATES SP mode is active if ( &value_is_true($nl->get_value('use_fates_luh')) ) { - $log->fatal_error('use_fates_luh can NOT be true when use_fates_sp is true'); - } + $log->fatal_error('use_fates_luh can NOT be true when use_fates_sp is true'); + } # hydro isn't currently supported to work when FATES SP mode is active if (&value_is_true( $nl->get_value('use_fates_planthydro') )) { @@ -4608,7 +4608,7 @@ sub setup_logic_fates { if ( ! &value_is_true($nl->get_value($var)) ) { $var = "fluh_timeseries"; add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, $var, 'phys'=>$nl_flags->{'phys'}, - 'hgrid'=>$nl_flags->{'res'}, 'sim_year_range'=>$nl_flags->{'sim_year_range'}, nofail=>1 ); + 'hgrid'=>$nl_flags->{'res'}, 'sim_year_range'=>$nl_flags->{'sim_year_range'}, nofail=>1 ); my $fname = remove_leading_and_trailing_quotes( $nl->get_value($var) ); if ( ! defined($nl->get_value($var)) ) { $log->fatal_error("$var is required when use_fates_luh is set and use_fates_potentialveg is false" ); @@ -4616,21 +4616,21 @@ sub setup_logic_fates { $log->fatal_error("$var does NOT point to a valid filename" ); } } - } + } $var = "use_fates_fixed_biogeog"; if ( defined($nl->get_value($var)) ) { if ( &value_is_true($nl->get_value($var)) ) { - $var = "flandusepftdat"; - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, $var, - 'phys'=>$nl_flags->{'phys'}, 'hgrid'=>$nl_flags->{'res'}, nofail=>1 ); - my $fname = remove_leading_and_trailing_quotes( $nl->get_value($var) ); - if ( ! defined($nl->get_value($var)) ) { - $log->fatal_error("$var is required when use_fates_luh and use_fates_fixed_biogeog is set" ); - } elsif ( ! -f "$fname" ) { - $log->fatal_error("$var does NOT point to a valid filename" ); - } - } - } + $var = "flandusepftdat"; + add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, $var, + 'phys'=>$nl_flags->{'phys'}, 'hgrid'=>$nl_flags->{'res'}, nofail=>1 ); + my $fname = remove_leading_and_trailing_quotes( $nl->get_value($var) ); + if ( ! defined($nl->get_value($var)) ) { + $log->fatal_error("$var is required when use_fates_luh and use_fates_fixed_biogeog is set" ); + } elsif ( ! -f "$fname" ) { + $log->fatal_error("$var does NOT point to a valid filename" ); + } + } + } } } # check that fates landuse is on and harvest mode is off when potential veg switch is true From 470b279dcc7c2563b719bbbbf67a696cad7f6481 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Thu, 23 May 2024 15:55:13 -0600 Subject: [PATCH 0311/1248] Add a fail test for bad dust mobilization --- src/biogeochem/DUSTMod.F90 | 6 ++++-- .../test/DustEmis_test/test_DustEmis.pf | 21 +++++++++++++++++++ 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/src/biogeochem/DUSTMod.F90 b/src/biogeochem/DUSTMod.F90 index c34f3a6e06..8de7811aa1 100644 --- a/src/biogeochem/DUSTMod.F90 +++ b/src/biogeochem/DUSTMod.F90 @@ -445,8 +445,10 @@ subroutine DustEmission (this, bounds, & do fp = 1,num_nolakep p = filter_nolakep(fp) if (lnd_frc_mbl(p)>1.0_r8 .or. lnd_frc_mbl(p)<0.0_r8) then - write(iulog,*)'Error dstmbl: pft= ',p,' lnd_frc_mbl(p)= ',lnd_frc_mbl(p) - call endrun(subgrid_index=p, subgrid_level=subgrid_level_patch, msg=errMsg(sourcefile, __LINE__)) + write(iulog,*)'Error dstmbl: pft= ',p,' lnd_frc_mbl(p)= ',lnd_frc_mbl(p), & + errMsg(sourcefile, __LINE__) + call endrun("Bad value for dust mobilization fraction") + return end if end do diff --git a/src/biogeochem/test/DustEmis_test/test_DustEmis.pf b/src/biogeochem/test/DustEmis_test/test_DustEmis.pf index a76c724480..a9b72a6e64 100644 --- a/src/biogeochem/test/DustEmis_test/test_DustEmis.pf +++ b/src/biogeochem/test/DustEmis_test/test_DustEmis.pf @@ -407,6 +407,27 @@ contains !----------------------------------------------------------------------- + @Test + subroutine aborts_on_bad_dust_mobility(this) + ! Check dust abort when dust mobility is bad + class(TestDustEmis), intent(inout) :: this + real(r8) :: flx_mss_vrt_dst_tot + character(100) :: expected_msg + + call this%create_atm2lnd() + call this%create_fv( ) + ! Dust should abort with an error on dust mobility when snow fraction greater than 1 + this%water_inst%waterdiagnosticbulk_inst%frac_sno_col(:) = 1.0_r8 + 1.e-15_r8 + call this%dust_emis%DustEmission(bounds, this%num_nolakep, this%filter_nolakep, this%atm2lnd_inst, & + this%soilstate_inst, this%canopystate_inst, this%water_inst%waterstatebulk_inst, & + this%water_inst%waterdiagnosticbulk_inst, this%frictionvel_inst) + expected_msg = "ABORTED: Bad value for dust mobilization fraction" + @assertExceptionRaised(expected_msg) + + end subroutine aborts_on_bad_dust_mobility + + !----------------------------------------------------------------------- + @Test subroutine dust_zero_when_tlai_high(this) ! Check dust emissions are zero when LAI is high enough From 07918b515c63183135ae85cb43919486b7153ded Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Thu, 23 May 2024 16:08:44 -0600 Subject: [PATCH 0312/1248] Replace DUSTMod with DustEmisZender2003 with VS code --- src/biogeochem/CMakeLists.txt | 2 +- src/biogeochem/CNVegStateType.F90 | 2 +- src/biogeochem/{DUSTMod.F90 => DustEmisZender2003.F90} | 4 ++-- src/biogeochem/test/DustEmis_test/test_DustEmis.pf | 2 +- src/main/clm_driver.F90 | 2 +- src/main/clm_instMod.F90 | 2 +- src/main/lnd2atmMod.F90 | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) rename src/biogeochem/{DUSTMod.F90 => DustEmisZender2003.F90} (99%) diff --git a/src/biogeochem/CMakeLists.txt b/src/biogeochem/CMakeLists.txt index 0f46dc665d..0dd06ac09e 100644 --- a/src/biogeochem/CMakeLists.txt +++ b/src/biogeochem/CMakeLists.txt @@ -6,7 +6,7 @@ list(APPEND clm_sources CNPhenologyMod.F90 CNSpeciesMod.F90 CNDVType.F90 - DUSTMod.F90 + DustEmisZender2003.F90 CropReprPoolsMod.F90 CropType.F90 CNVegStateType.F90 diff --git a/src/biogeochem/CNVegStateType.F90 b/src/biogeochem/CNVegStateType.F90 index c286c0344f..98c1a6ce3a 100644 --- a/src/biogeochem/CNVegStateType.F90 +++ b/src/biogeochem/CNVegStateType.F90 @@ -519,7 +519,7 @@ subroutine InitCold(this, bounds) ! -------------------------------------------------------------------- ! Initialize terms needed for dust model - ! TODO - move these terms to DUSTMod module variables + ! TODO - move these terms to DustEmisZender2003 module variables ! -------------------------------------------------------------------- do c = bounds%begc, bounds%endc diff --git a/src/biogeochem/DUSTMod.F90 b/src/biogeochem/DustEmisZender2003.F90 similarity index 99% rename from src/biogeochem/DUSTMod.F90 rename to src/biogeochem/DustEmisZender2003.F90 index 8de7811aa1..22bbbe0742 100644 --- a/src/biogeochem/DUSTMod.F90 +++ b/src/biogeochem/DustEmisZender2003.F90 @@ -1,4 +1,4 @@ -module DUSTMod +module DustEmisZender2003 !----------------------------------------------------------------------- ! !DESCRIPTION: @@ -1033,4 +1033,4 @@ subroutine InitDustVars(this, bounds) end subroutine InitDustVars -end module DUSTMod +end module DustEmisZender2003 diff --git a/src/biogeochem/test/DustEmis_test/test_DustEmis.pf b/src/biogeochem/test/DustEmis_test/test_DustEmis.pf index a9b72a6e64..ded09f7919 100644 --- a/src/biogeochem/test/DustEmis_test/test_DustEmis.pf +++ b/src/biogeochem/test/DustEmis_test/test_DustEmis.pf @@ -9,7 +9,7 @@ module test_DustEmis use clm_varctl, only : soil_layerstruct_predefined, create_crop_landunit, use_crop, create_crop_landunit use clm_varcon, only : clm_varcon_init, clm_varcon_clean use SnowHydrologyMod, only : InitSnowLayers, SnowHydrologySetControlForTesting, SnowHydrologyClean - use DUSTMod + use DustEmisZender2003 use shr_kind_mod , only : r8 => shr_kind_r8 use unittestFilterBuilderMod, only : filter_from_range use atm2lndType, only : atm2lnd_type, atm2lnd_params_type diff --git a/src/main/clm_driver.F90 b/src/main/clm_driver.F90 index 00a98e61b4..f9db72e0ed 100644 --- a/src/main/clm_driver.F90 +++ b/src/main/clm_driver.F90 @@ -62,7 +62,7 @@ module clm_driver use ndepStreamMod , only : ndep_interp use cropcalStreamMod , only : cropcal_advance, cropcal_interp use ch4Mod , only : ch4, ch4_init_gridcell_balance_check, ch4_init_column_balance_check - use DUSTMod , only : DustDryDep, DustEmission + use DustEmisZender2003 , only : DustDryDep, DustEmission use VOCEmissionMod , only : VOCEmission ! use filterMod , only : setFilters diff --git a/src/main/clm_instMod.F90 b/src/main/clm_instMod.F90 index a24e05b27c..f11805a755 100644 --- a/src/main/clm_instMod.F90 +++ b/src/main/clm_instMod.F90 @@ -45,7 +45,7 @@ module clm_instMod use SoilBiogeochemNitrogenStateType , only : soilbiogeochem_nitrogenstate_type use CropType , only : crop_type use DryDepVelocity , only : drydepvel_type - use DUSTMod , only : dust_type + use DustEmisZender2003 , only : dust_type use EnergyFluxType , only : energyflux_type use FrictionVelocityMod , only : frictionvel_type use GlacierSurfaceMassBalanceMod , only : glacier_smb_type diff --git a/src/main/lnd2atmMod.F90 b/src/main/lnd2atmMod.F90 index 1cda0cff91..b91feaabf9 100644 --- a/src/main/lnd2atmMod.F90 +++ b/src/main/lnd2atmMod.F90 @@ -20,7 +20,7 @@ module lnd2atmMod use lnd2atmType , only : lnd2atm_type use atm2lndType , only : atm2lnd_type use ch4Mod , only : ch4_type - use DUSTMod , only : dust_type + use DustEmisZender2003 , only : dust_type use DryDepVelocity , only : drydepvel_type use VocEmissionMod , only : vocemis_type use CNFireEmissionsMod , only : fireemis_type From 00d23e9adb4139847dc5f855ff4ce43bc845b41e Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Thu, 23 May 2024 16:48:55 -0600 Subject: [PATCH 0313/1248] correct add default for fluh and flandusepftdat --- bld/CLMBuildNamelist.pm | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index b17a245715..d952e7fe89 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -4607,8 +4607,8 @@ sub setup_logic_fates { if ( defined($nl->get_value($var)) ) { if ( ! &value_is_true($nl->get_value($var)) ) { $var = "fluh_timeseries"; - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, $var, 'phys'=>$nl_flags->{'phys'}, - 'hgrid'=>$nl_flags->{'res'}, 'sim_year_range'=>$nl_flags->{'sim_year_range'}, nofail=>1 ); + add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, $var, 'use_fates'=>$nl_flags->{'use_fates'}, + 'hgrid'=>$nl_flags->{'res'}, 'sim_year_range'=>$nl_flags->{'sim_year_range'}); my $fname = remove_leading_and_trailing_quotes( $nl->get_value($var) ); if ( ! defined($nl->get_value($var)) ) { $log->fatal_error("$var is required when use_fates_luh is set and use_fates_potentialveg is false" ); @@ -4620,17 +4620,17 @@ sub setup_logic_fates { $var = "use_fates_fixed_biogeog"; if ( defined($nl->get_value($var)) ) { if ( &value_is_true($nl->get_value($var)) ) { - $var = "flandusepftdat"; - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, $var, - 'phys'=>$nl_flags->{'phys'}, 'hgrid'=>$nl_flags->{'res'}, nofail=>1 ); - my $fname = remove_leading_and_trailing_quotes( $nl->get_value($var) ); - if ( ! defined($nl->get_value($var)) ) { - $log->fatal_error("$var is required when use_fates_luh and use_fates_fixed_biogeog is set" ); - } elsif ( ! -f "$fname" ) { - $log->fatal_error("$var does NOT point to a valid filename" ); - } - } - } + $var = "flandusepftdat"; + add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, $var, 'use_fates'=>$nl_flags->{'use_fates'}, + 'phys'=>$nl_flags->{'phys'}, 'hgrid'=>$nl_flags->{'res'}, nofail=>1 ); + my $fname = remove_leading_and_trailing_quotes( $nl->get_value($var) ); + if ( ! defined($nl->get_value($var)) ) { + $log->fatal_error("$var is required when use_fates_luh and use_fates_fixed_biogeog is set" ); + } elsif ( ! -f "$fname" ) { + $log->fatal_error("$var does NOT point to a valid filename" ); + } + } + } } } # check that fates landuse is on and harvest mode is off when potential veg switch is true From 2ac13bcb7aeec5a1772635edfe7c0f99be9c532d Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Thu, 23 May 2024 17:39:57 -0600 Subject: [PATCH 0314/1248] correct typos causing RunTimeError to be missed --- cime_config/SystemTests/pvt.py | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/cime_config/SystemTests/pvt.py b/cime_config/SystemTests/pvt.py index e18022220d..c45c514f39 100644 --- a/cime_config/SystemTests/pvt.py +++ b/cime_config/SystemTests/pvt.py @@ -18,20 +18,17 @@ logger = logging.getLogger(__name__) class PVT(SystemTestsCommon): - def __init_(self,case): + def __init__(self,case): SystemTestsCommon.__init__(self,case) # Do not allow PVT to be run with certain testmods # Should this be targeted to a specific testmod for simplicity for now? # Technically this could be run with the luh fates_harvest_modes + error_message = None casebaseid = self._case.get_value("CASEBASEID") - casebasid = casebaseid.split("-")[-1] + casebaseid = casebaseid.split("-")[-1] if casebaseid[0:10] != "FatesLUPFT": - error_message = ( - "Only call PVT with test FatesLUPFT" - ) - logger.error(error_message) - raise RuntimeError(error_message) + error_message = (f"Only call PVT with testmod FatesLUPFT. {casebaseid} selected.") # Only allow to run if resolution is 4x5 for now # Eventually we could set this up to generate the necessary land use x pft mapping @@ -39,12 +36,11 @@ def __init_(self,case): # regridding on the fly which is a more time consuming endevour currently lnd_grid = self._case.get_value("LND_GRID") if lnd_grid != "4x5": - error_message = ( - "PVT can currently only be run with 4x5 resolution" - ) + error_message = (f"PVT can currently only be run with 4x5 resolution. {lnd_grid} selected.") + + if error_message is not None: logger.error(error_message) raise RuntimeError(error_message) - def run_phase(self): # ------------------------------------------------------------------- # (1) Run FATES spin-up case in potential vegetation mode From f4ff559c831533ab9c901d1f44e5744740a8f302 Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Thu, 23 May 2024 16:45:42 -0700 Subject: [PATCH 0315/1248] remove tabs again --- bld/CLMBuildNamelist.pm | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index d952e7fe89..0fb7ba9692 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -4608,7 +4608,7 @@ sub setup_logic_fates { if ( ! &value_is_true($nl->get_value($var)) ) { $var = "fluh_timeseries"; add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, $var, 'use_fates'=>$nl_flags->{'use_fates'}, - 'hgrid'=>$nl_flags->{'res'}, 'sim_year_range'=>$nl_flags->{'sim_year_range'}); + 'hgrid'=>$nl_flags->{'res'}, 'sim_year_range'=>$nl_flags->{'sim_year_range'}); my $fname = remove_leading_and_trailing_quotes( $nl->get_value($var) ); if ( ! defined($nl->get_value($var)) ) { $log->fatal_error("$var is required when use_fates_luh is set and use_fates_potentialveg is false" ); @@ -4620,17 +4620,17 @@ sub setup_logic_fates { $var = "use_fates_fixed_biogeog"; if ( defined($nl->get_value($var)) ) { if ( &value_is_true($nl->get_value($var)) ) { - $var = "flandusepftdat"; - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, $var, 'use_fates'=>$nl_flags->{'use_fates'}, - 'phys'=>$nl_flags->{'phys'}, 'hgrid'=>$nl_flags->{'res'}, nofail=>1 ); - my $fname = remove_leading_and_trailing_quotes( $nl->get_value($var) ); - if ( ! defined($nl->get_value($var)) ) { - $log->fatal_error("$var is required when use_fates_luh and use_fates_fixed_biogeog is set" ); - } elsif ( ! -f "$fname" ) { - $log->fatal_error("$var does NOT point to a valid filename" ); - } - } - } + $var = "flandusepftdat"; + add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, $var, 'use_fates'=>$nl_flags->{'use_fates'}, + 'phys'=>$nl_flags->{'phys'}, 'hgrid'=>$nl_flags->{'res'}, nofail=>1 ); + my $fname = remove_leading_and_trailing_quotes( $nl->get_value($var) ); + if ( ! defined($nl->get_value($var)) ) { + $log->fatal_error("$var is required when use_fates_luh and use_fates_fixed_biogeog is set" ); + } elsif ( ! -f "$fname" ) { + $log->fatal_error("$var does NOT point to a valid filename" ); + } + } + } } } # check that fates landuse is on and harvest mode is off when potential veg switch is true From 03f89ea926cf5f4cfba56b079ce91e1536a5787f Mon Sep 17 00:00:00 2001 From: "Danny M. Leung" Date: Thu, 23 May 2024 22:44:24 -0600 Subject: [PATCH 0316/1248] dmleung added a minor edit on subtimestep wind fluctuation (23 May 2024) --- src/biogeochem/DUSTMod.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/biogeochem/DUSTMod.F90 b/src/biogeochem/DUSTMod.F90 index 2986ed579b..e1348b8ebf 100644 --- a/src/biogeochem/DUSTMod.F90 +++ b/src/biogeochem/DUSTMod.F90 @@ -742,7 +742,7 @@ subroutine DustEmission (bounds, & if ((12_r8 - 0.5_r8 * stblty(p)) .GE. 0.001_r8) then ! should have used 0 theoretically; used 0.001 here to avoid undefined values u_sd_slt(p) = wnd_frc_slt * (12_r8 - 0.5_r8 * stblty(p))**0.333_r8 else - u_sd_slt(p) = 0.001_r8 ! should have used 0 theoretically; used 0.001 here to avoid undefined values + u_sd_slt(p) = wnd_frc_slt * (0.001_r8)**0.333_r8 ! should have used 0 theoretically; used 0.001 here to avoid undefined values end if ! threshold velocities From dd5671a824854ab270687cf669ee96656cad2fae Mon Sep 17 00:00:00 2001 From: Keith Oleson Date: Fri, 24 May 2024 09:56:34 -0600 Subject: [PATCH 0317/1248] Update streams file name and global attributes --- 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 7f9e3de6b4..4b8b7d3571 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -1871,15 +1871,15 @@ lnd/clm2/surfdata_esmf/NEON/surfdata_1x1_NEON_TOOL_hist_78pfts_CMIP6_simyr2000_c lnd/clm2/urbandata/CTSM52_tbuildmax_OlesonFeddema_2020_0.9x1.25_simyr1849-2106_c200605.nc /glade/work/xinchang/02_Explicit_AC_Adoption/02_data_present_day/CTSM52_urbantv_0.9x1.25_simyr1849-2106_c20230621.nc +>/glade/work/xinchang/02_Explicit_AC_Adoption/02_data_present_day/CTSM52_urbantv_Li_2024_0.9x1.25_simyr1849-2106_c20230621.nc
lnd/clm2/urbandata/CTSM52_tbuildmax_OlesonFeddema_2020_0.9x1.25_simyr1849-2106_c200605.nc /glade/work/xinchang/02_Explicit_AC_Adoption/02_data_present_day/CTSM52_urbantv_0.9x1.25_simyr1849-2106_c20230621.nc +>/glade/work/xinchang/02_Explicit_AC_Adoption/02_data_present_day/CTSM52_urbantv_Li_2024_0.9x1.25_simyr1849-2106_c20230621.nc lnd/clm2/urbandata/CLM50_tbuildmax_Oleson_2016_0.9x1.25_simyr1849-2106_c160923.nc /glade/work/xinchang/02_Explicit_AC_Adoption/02_data_present_day/CTSM52_urbantv_0.9x1.25_simyr1849-2106_c20230621.nc +>/glade/work/xinchang/02_Explicit_AC_Adoption/02_data_present_day/CTSM52_urbantv_Li_2024_0.9x1.25_simyr1849-2106_c20230621.nc lnd/clm2/urbandata/CLM45_tbuildmax_Oleson_2016_0.9x1.25_simyr1849-2106_c160923.nc From 8cc00387d6bb131f90ec08334c8e7b132d4388cf Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Fri, 24 May 2024 11:22:27 -0600 Subject: [PATCH 0318/1248] Add a unit test shell for SoilStateInitTimeConsst --- src/biogeophys/CMakeLists.txt | 1 + src/biogeophys/test/CMakeLists.txt | 1 + .../CMakeLists.txt | 6 ++++ .../test_dust_soil_clay_functions.pf | 29 +++++++++++++++++++ 4 files changed, 37 insertions(+) create mode 100644 src/biogeophys/test/SoilStateInitTimeConst_test/CMakeLists.txt create mode 100644 src/biogeophys/test/SoilStateInitTimeConst_test/test_dust_soil_clay_functions.pf diff --git a/src/biogeophys/CMakeLists.txt b/src/biogeophys/CMakeLists.txt index 86edcca9f9..07b88b07bf 100644 --- a/src/biogeophys/CMakeLists.txt +++ b/src/biogeophys/CMakeLists.txt @@ -25,6 +25,7 @@ list(APPEND clm_sources SoilHydrologyType.F90 SoilStateType.F90 SoilWaterRetentionCurveMod.F90 + SoilStateInitTimeConstMod.F90 SolarAbsorbedType.F90 PhotosynthesisMod.F90 SurfaceAlbedoType.F90 diff --git a/src/biogeophys/test/CMakeLists.txt b/src/biogeophys/test/CMakeLists.txt index 5c15858210..7a0a1e8fbb 100644 --- a/src/biogeophys/test/CMakeLists.txt +++ b/src/biogeophys/test/CMakeLists.txt @@ -5,6 +5,7 @@ add_subdirectory(HillslopeHydrology_test) add_subdirectory(SnowHydrology_test) add_subdirectory(Photosynthesis_test) add_subdirectory(Balance_test) +add_subdirectory(SoilStateInitTimeConst_test) add_subdirectory(TotalWaterAndHeat_test) add_subdirectory(Wateratm2lnd_test) add_subdirectory(WaterTracerContainerType_test) diff --git a/src/biogeophys/test/SoilStateInitTimeConst_test/CMakeLists.txt b/src/biogeophys/test/SoilStateInitTimeConst_test/CMakeLists.txt new file mode 100644 index 0000000000..df58da9875 --- /dev/null +++ b/src/biogeophys/test/SoilStateInitTimeConst_test/CMakeLists.txt @@ -0,0 +1,6 @@ +set (pfunit_sources + test_dust_soil_clay_functions.pf) + +add_pfunit_ctest(SoilStateInit + TEST_SOURCES "${pfunit_sources}" + LINK_LIBRARIES clm csm_share) diff --git a/src/biogeophys/test/SoilStateInitTimeConst_test/test_dust_soil_clay_functions.pf b/src/biogeophys/test/SoilStateInitTimeConst_test/test_dust_soil_clay_functions.pf new file mode 100644 index 0000000000..d3d9fc7e7f --- /dev/null +++ b/src/biogeophys/test/SoilStateInitTimeConst_test/test_dust_soil_clay_functions.pf @@ -0,0 +1,29 @@ +module test_dust_soil_clay_functions + + ! Tests of SoilStateInitTimeConst functions for dust emission in regard to clay content + + use funit + use SoilStateInitTimeConstMod + use shr_kind_mod , only : r8 => shr_kind_r8 + + implicit none + + @TestCase + type, extends(TestCase) :: TestDustEmisSoilFunctions + contains + procedure :: setUp + procedure :: tearDown + end type TestDustEmisSoilFunctions + +contains + + subroutine setUp(this) + class(TestDustEmisSoilFunctions), intent(inout) :: this + end subroutine setUp + + subroutine tearDown(this) + class(TestDustEmisSoilFunctions), intent(inout) :: this + + end subroutine tearDown + +end module test_dust_soil_clay_functions From 679ececd1336838b9bcb6e51f900da94fbe91957 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Fri, 24 May 2024 12:04:33 -0600 Subject: [PATCH 0319/1248] Add functions needed by dust emissions for soil characteristics --- src/biogeophys/SoilStateInitTimeConstMod.F90 | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/biogeophys/SoilStateInitTimeConstMod.F90 b/src/biogeophys/SoilStateInitTimeConstMod.F90 index 9122b56890..46759cb90b 100644 --- a/src/biogeophys/SoilStateInitTimeConstMod.F90 +++ b/src/biogeophys/SoilStateInitTimeConstMod.F90 @@ -715,4 +715,24 @@ subroutine SoilStateInitTimeConst(bounds, soilstate_inst, nlfilename) end subroutine SoilStateInitTimeConst + !------------------------------------------------------------------------------ + + real(r8) function ThresholdSoilMoist( clay ) + ! Calculate the threshold soil moisture needed for dust emission, based on clay content + real(r8), intent(IN) :: clay ! Fraction of lay in the soil (%) + + ThresholdSoilMoist = 0.17_r8 + 0.14_r8 * clay * 0.01_r8 + end function ThresholdSoilMoist + + !------------------------------------------------------------------------------ + + real(r8) function MassFracClay( clay ) + ! Calculate the mass fraction of clay needed for dust emission, based on clay content + real(r8), intent(IN) :: clay ! Fraction of lay in the soil (%) + + MassFracClay = min(clay * 0.01_r8, 0.20_r8) + end function MassFracClay + + !------------------------------------------------------------------------------ + end module SoilStateInitTimeConstMod From 956ea907541cd514f44ea11c693e29bc72e4eca2 Mon Sep 17 00:00:00 2001 From: "Danny M. Leung" Date: Fri, 24 May 2024 13:18:42 -0600 Subject: [PATCH 0320/1248] dmleung added more comments on the impact of soil moisture threshold on dust emission calculation. 24 May 2024 --- src/biogeophys/SoilStateInitTimeConstMod.F90 | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/biogeophys/SoilStateInitTimeConstMod.F90 b/src/biogeophys/SoilStateInitTimeConstMod.F90 index bf2de65a29..3c8945e9d2 100644 --- a/src/biogeophys/SoilStateInitTimeConstMod.F90 +++ b/src/biogeophys/SoilStateInitTimeConstMod.F90 @@ -703,8 +703,12 @@ subroutine SoilStateInitTimeConst(bounds, soilstate_inst, nlfilename) do c = begc,endc g = col%gridcell(c) - !soilstate_inst%gwc_thr_col(c) = 0.01_r8*(0.17_r8*clay3d(g,1) + 0.0014_r8*clay3d(g,1)*clay3d(g,1)) ! Jasper Kok et al. (2014) modified the equation of soil moisture effect for dust emissions using a tuning factor of a = 1. 0.01 is to convert the threshold gravimetric soil moisture from % to fraction. Danny M. Leung et al. (2023) followed K14 and used this equation for the paper's results. However, Danny Leung later (Dec 2023) decided to revert to Zender's choice and use a = 1 / (clay fraction), which overall encourages more dust emissions from seriamid and more marginal dust sources. dmleung added this detailed comment on 19 Feb 2024. - soilstate_inst%gwc_thr_col(c) = 0.17_r8 + 0.14_r8 * clay3d(g,1) * 0.01_r8 ! This was the original equation with a = 1 / (clay fraction) being the tuning factor for soil moisture effect in Zender's dust emission scheme. Danny M. Leung decided (Dec, 2023) that the Leung et al. (2023) dust emission scheme in the CESM will use Zender's tuning of a = 1 / (clay fraction), which overall encourages more dust emissions from seriamid and more marginal dust sources. Another advantage of using this tuning factor instead of a = 1 is that the dust emission threshold is linearly dependent on the clay fraction instead of parabolically dependent on clay fraction as in the above line. This means that dust emission becomes a little less sensitive to clay content (soil texture). 0.17 and 0.14 are fitting coefficients in Fecan et al. (1999), and 0.01 is used to convert surface clay fraction from percentage to fraction. dmleung added this detailed comment on 19 Feb 2024. + ! dmleung++ added 24 May 2024: The below calculates the threshold gravimetric water content for the dust emission calculation in DUSTMod.F90. The equation comes from Eq. 14 of Fecan et al. (1999; https://doi.org/10.1007/s00585-999-0149-7). + !gwc_thr_col = 0.17*clay3d + 0.0014*(clay3d**2), and we only concern the topmost soil layer. + ! Charlie Zender later on added a tuning factor (a) such that the equation becomes gwc_thr_col = a*[0.17*clay3d + 0.0014*(clay3d**2)]. (Zender et al., 2003a; https://doi.org/10.1029/2002JD002775) + ! There are different options: E.g., a = 1 gives the first line below. E.g., Kok et al. (2014a, b) chose to use a = 1. A second choice is proposed by Charlie Zender (2003a): a = 1/clay3d, which gives the second line below. + !soilstate_inst%gwc_thr_col(c) = 0.01_r8*(0.17_r8*clay3d(g,1) + 0.0014_r8*clay3d(g,1)*clay3d(g,1)) ! Jasper Kok et al. (2014) modified the equation of soil moisture effect for dust emissions using a tuning factor of a = 1. 0.01 is to convert the threshold gravimetric soil moisture from % to fraction. Danny M. Leung et al. (2023) followed K14 and used this equation for offline dust emission calculations using MERRA-2 met fields. Later, Leung et al. (2024) changed to a = 2 for CESM2 simulations. However, Danny Leung later (Dec 2023) decided to revert to Zender's choice and use a = 1 / (clay3d), which overall encourages more dust emissions from seriamid and more marginal dust sources. This note should probably be on the CLM tech note since dmleung has made a different decision for CESM than his own paper. dmleung added this detailed comment on 19 Feb 2024; edited 24 May 2024. + soilstate_inst%gwc_thr_col(c) = 0.17_r8 + 0.14_r8 * clay3d(g,1) * 0.01_r8 ! This was the original equation with a = 1 / (%clay) being the tuning factor for soil moisture effect in Zender's dust emission scheme. Danny M. Leung decided (Dec, 2023) that the Leung et al. (2023) dust emission scheme in the CESM will use Zender's tuning of a = 1 / (%clay), which overall encourages more dust emissions from seriamid and more marginal dust sources. Another advantage of using this tuning factor instead of a = 1 is that the dust emission threshold is linearly dependent on the clay fraction instead of parabolically dependent on clay fraction as in the above line. This means that dust emission becomes a little less sensitive to clay content (soil texture). 0.17 and 0.14 are fitting coefficients in Fecan et al. (1999), and 0.01 is used to convert surface clay fraction from percentage to fraction. dmleung added this detailed comment on 19 Feb 2024. soilstate_inst%mss_frc_cly_vld_col(c) = min(clay3d(g,1) * 0.01_r8, 0.20_r8) end do From 56048af762b22a98dab029a3d5b72f7499e7e058 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Fri, 24 May 2024 13:26:42 -0600 Subject: [PATCH 0321/1248] Fill out functions and add unit testing for them, the failure test fails now --- src/biogeophys/SoilStateInitTimeConstMod.F90 | 20 ++++++- .../test_dust_soil_clay_functions.pf | 55 ++++++++++++++++++- 2 files changed, 71 insertions(+), 4 deletions(-) diff --git a/src/biogeophys/SoilStateInitTimeConstMod.F90 b/src/biogeophys/SoilStateInitTimeConstMod.F90 index 46759cb90b..a71a7285aa 100644 --- a/src/biogeophys/SoilStateInitTimeConstMod.F90 +++ b/src/biogeophys/SoilStateInitTimeConstMod.F90 @@ -17,6 +17,11 @@ module SoilStateInitTimeConstMod ! !PUBLIC MEMBER FUNCTIONS: public :: SoilStateInitTimeConst public :: readParams + + ! PRIVATE FUNCTIONS MADE PUBLIC Just for unit-testing: + public :: ThresholdSoilMoist + public :: ThresholdSoilMoistKok2014 + public :: MassFracClay ! ! !PRIVATE MEMBER FUNCTIONS: private :: ReadNL @@ -719,10 +724,19 @@ end subroutine SoilStateInitTimeConst real(r8) function ThresholdSoilMoist( clay ) ! Calculate the threshold soil moisture needed for dust emission, based on clay content - real(r8), intent(IN) :: clay ! Fraction of lay in the soil (%) + real(r8), intent(IN) :: clay ! Fraction of clay in the soil (%) ThresholdSoilMoist = 0.17_r8 + 0.14_r8 * clay * 0.01_r8 - end function ThresholdSoilMoist + end function ThresholdSoilMoist + + !------------------------------------------------------------------------------ + + real(r8) function ThresholdSoilMoistKok2014( clay ) + ! Calculate the threshold soil moisture needed for dust emission, based on clay content + real(r8), intent(IN) :: clay ! Fraction of clay in the soil (%) + + ThresholdSoilMoistKok2014 = 0.01_r8*(0.17_r8*clay + 0.0014_r8*clay*clay) + end function ThresholdSoilMoistKok2014 !------------------------------------------------------------------------------ @@ -731,7 +745,7 @@ real(r8) function MassFracClay( clay ) real(r8), intent(IN) :: clay ! Fraction of lay in the soil (%) MassFracClay = min(clay * 0.01_r8, 0.20_r8) - end function MassFracClay + end function MassFracClay !------------------------------------------------------------------------------ diff --git a/src/biogeophys/test/SoilStateInitTimeConst_test/test_dust_soil_clay_functions.pf b/src/biogeophys/test/SoilStateInitTimeConst_test/test_dust_soil_clay_functions.pf index d3d9fc7e7f..e612195aff 100644 --- a/src/biogeophys/test/SoilStateInitTimeConst_test/test_dust_soil_clay_functions.pf +++ b/src/biogeophys/test/SoilStateInitTimeConst_test/test_dust_soil_clay_functions.pf @@ -15,6 +15,8 @@ module test_dust_soil_clay_functions procedure :: tearDown end type TestDustEmisSoilFunctions + real(r8), parameter :: tol = 1.e-15_r8 + contains subroutine setUp(this) @@ -23,7 +25,58 @@ contains subroutine tearDown(this) class(TestDustEmisSoilFunctions), intent(inout) :: this - end subroutine tearDown + @Test + subroutine TestClayOutOfRangeThreshold(this) + class(TestDustEmisSoilFunctions), intent(inout) :: this + real(r8) :: value + character(len=100) :: expected_msg + + value = ThresholdSoilMoist( -1.e-15_r8 ) + expected_msg = "ABORTED: Percent clay is less than zero" + @assertExceptionRaised(expected_msg) + value = ThresholdSoilMoist( 1._r8 + 1.-15_r8 ) + expected_msg = "ABORTED: Percent clay is greater than 100" + @assertExceptionRaised(expected_msg) + end subroutine TestClayOutOfRangeThreshold + + @Test + subroutine TestThresholdValues(this) + class(TestDustEmisSoilFunctions), intent(inout) :: this + real(r8) :: value + + value = ThresholdSoilMoist( 0.0_r8 ) + @assertEqual( value, 0.17_r8, tolerance=tol ) + value = ThresholdSoilMoist( 100.0_r8 ) + @assertEqual( value, 0.31_r8, tolerance=tol ) + end subroutine TestThresholdValues + + @Test + subroutine TestThresholdKok2014Values(this) + class(TestDustEmisSoilFunctions), intent(inout) :: this + real(r8) :: value + + value = ThresholdSoilMoistKok2014( 0.0_r8 ) + @assertEqual( value, 0.0_r8, tolerance=tol ) + value = ThresholdSoilMoistKok2014( 100.0_r8 ) + @assertEqual( value, 0.31_r8, tolerance=tol ) + value = ThresholdSoilMoistKok2014( 1.0_r8 ) + @assertEqual( value, 0.001714_r8, tolerance=tol ) + end subroutine TestThresholdKok2014Values + + @Test + subroutine TestClayMassFracValues(this) + class(TestDustEmisSoilFunctions), intent(inout) :: this + real(r8) :: value + + value = MassFracClay( 0.0_r8 ) + @assertEqual( value, 0.20_r8, tolerance=tol ) + value = MassFracClay( 20.0_r8 ) + @assertEqual( value, 0.20_r8, tolerance=tol ) + value = MassFracClay( 100.0_r8 ) + @assertEqual( value, 1.0_r8, tolerance=tol ) + + end subroutine TestClayMassFracValues + end module test_dust_soil_clay_functions From fc53412192c7fea8980b99fbc93324a10c17ba44 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Fri, 24 May 2024 13:49:32 -0600 Subject: [PATCH 0322/1248] Fix for the LILACSMOKE test to pass --- cime_config/SystemTests/lilacsmoke.py | 1 + 1 file changed, 1 insertion(+) diff --git a/cime_config/SystemTests/lilacsmoke.py b/cime_config/SystemTests/lilacsmoke.py index 66a94068da..366d5d1176 100644 --- a/cime_config/SystemTests/lilacsmoke.py +++ b/cime_config/SystemTests/lilacsmoke.py @@ -407,6 +407,7 @@ def run_phase(self): # case.get_mpirun_cmd creates a command that runs the executable given by # case.run_exe. So it's important that (elsewhere in this test script) we create a # link pointing from that to the atm_driver.exe executable. + self._case.load_env(reset=True) lid = new_lid() os.environ["OMP_NUM_THREADS"] = str(self._case.thread_count) cmd = self._case.get_mpirun_cmd(allow_unresolved_envvars=False) From de8c0a33315693c9dc66b267bd255e703f9010c0 Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Fri, 24 May 2024 13:53:13 -0600 Subject: [PATCH 0323/1248] update what new utility function returns as output --- cime_config/SystemTests/systemtest_utils.py | 41 ++++++++++++--------- 1 file changed, 23 insertions(+), 18 deletions(-) diff --git a/cime_config/SystemTests/systemtest_utils.py b/cime_config/SystemTests/systemtest_utils.py index 8447934797..9470799a27 100644 --- a/cime_config/SystemTests/systemtest_utils.py +++ b/cime_config/SystemTests/systemtest_utils.py @@ -2,7 +2,7 @@ Reduce code duplication by putting reused functions here. """ -import os, subprocess, re +import os, subprocess, re, glob def cmds_to_setup_conda(caseroot): @@ -84,21 +84,26 @@ def run_python_script(caseroot, this_conda_env, command_in, tool_path): except: print(f"ERROR trying to run {tool_name}.") raise +""" +Read a user_nl file and return the namelist option if found +""" +def find_user_nl_option(caseroot, component, namelist_option): + + # This is a copy of the CIME _get_list_of_user_nl_files + # which could be used if this moved into the CIME project + file_pattern = "user_nl_" + component + "*" + file_list = glob.glob(os.path.join(caseroot, file_pattern)) + + # Check that there is at least one file + if len(file_list) == 0: + raise RuntimeError("No user_nl files found for component " + component) -def read_user_nl_clm(self,namelist_option): - user_nl_clm_path = os.path.join(self._get_caseroot(), "user_nl_clm") - with open(user_nl_clm_path) as f: - user_nl_clm_text = f.read() - reg = fr'{namelist_option}\s*=\s*([^\n]+)' - find_out = re.findall(reg, user_nl_clm_text) - # This could be more robust - if len(find_out) == 0: - return 0, False - elif len(find_out) > 1: - error_message = ( - "ERROR: read_user_nl_clm: namelist option is set more than once" - ) - # logger.error(error_message) - raise RuntimeError(error_message) - else: - return find_out[0], True + # Read through the file list and look for a match and return the whole entry + output = {} + for one_file in file_list: + with open(one_file, "r") as user_nl_file: + user_nl_text = user_nl_file.read() + reg = fr'{namelist_option}.*?(?=,|\n)' + find_out = re.findall(reg, user_nl_text) + output[one_file] = find_out + return output From b7a0adfa71fa088718df13411e5c04aa83b8add7 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Fri, 24 May 2024 13:54:29 -0600 Subject: [PATCH 0324/1248] Rm expected fails associated w https://github.com/ESCOMP/CMEPS/pull/460 --- cime_config/testdefs/ExpectedTestFails.xml | 85 ---------------------- 1 file changed, 85 deletions(-) diff --git a/cime_config/testdefs/ExpectedTestFails.xml b/cime_config/testdefs/ExpectedTestFails.xml index a29e55cc9e..ef6a00993f 100644 --- a/cime_config/testdefs/ExpectedTestFails.xml +++ b/cime_config/testdefs/ExpectedTestFails.xml @@ -44,91 +44,6 @@ - - - FAIL - https://github.com/ESCOMP/CMEPS/pull/460 - - - - - FAIL - https://github.com/ESCOMP/CMEPS/pull/460 - - - - - FAIL - https://github.com/ESCOMP/CMEPS/pull/460 - - - - - FAIL - https://github.com/ESCOMP/CMEPS/pull/460 - - - - - FAIL - https://github.com/ESCOMP/CMEPS/pull/460 - - - - - FAIL - https://github.com/ESCOMP/CMEPS/pull/460 - - - - - FAIL - https://github.com/ESCOMP/CMEPS/pull/460 - - - - - FAIL - https://github.com/ESCOMP/CMEPS/pull/460 - - - - - FAIL - https://github.com/ESCOMP/CMEPS/pull/460 - - - - - FAIL - https://github.com/ESCOMP/CMEPS/pull/460 - - - - - FAIL - https://github.com/ESCOMP/CMEPS/pull/460 - - - - - FAIL - https://github.com/ESCOMP/CMEPS/pull/460 - - - - - FAIL - https://github.com/ESCOMP/CMEPS/pull/460 - - - - - FAIL - https://github.com/ESCOMP/CMEPS/pull/460 - - - FAIL From 80bfb889db04d56d1b01e24c8102999ef3fe7cf7 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Fri, 24 May 2024 13:58:25 -0600 Subject: [PATCH 0325/1248] Get the tests passing --- src/biogeophys/SoilStateInitTimeConstMod.F90 | 7 +++++++ .../test_dust_soil_clay_functions.pf | 9 ++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/biogeophys/SoilStateInitTimeConstMod.F90 b/src/biogeophys/SoilStateInitTimeConstMod.F90 index a71a7285aa..3b71efe103 100644 --- a/src/biogeophys/SoilStateInitTimeConstMod.F90 +++ b/src/biogeophys/SoilStateInitTimeConstMod.F90 @@ -724,8 +724,15 @@ end subroutine SoilStateInitTimeConst real(r8) function ThresholdSoilMoist( clay ) ! Calculate the threshold soil moisture needed for dust emission, based on clay content + use abortUtils , only : endrun + use shr_infnan_mod, only : nan => shr_infnan_nan, assignment(=) real(r8), intent(IN) :: clay ! Fraction of clay in the soil (%) + if ( clay < 0.0_r8 .or. clay > 100.0_r8 )then + ThresholdSoilMoist = nan + call endrun( 'Clay fraction is out of bounds (0 to 100)') + return + end if ThresholdSoilMoist = 0.17_r8 + 0.14_r8 * clay * 0.01_r8 end function ThresholdSoilMoist diff --git a/src/biogeophys/test/SoilStateInitTimeConst_test/test_dust_soil_clay_functions.pf b/src/biogeophys/test/SoilStateInitTimeConst_test/test_dust_soil_clay_functions.pf index e612195aff..f753bf1729 100644 --- a/src/biogeophys/test/SoilStateInitTimeConst_test/test_dust_soil_clay_functions.pf +++ b/src/biogeophys/test/SoilStateInitTimeConst_test/test_dust_soil_clay_functions.pf @@ -34,10 +34,9 @@ contains character(len=100) :: expected_msg value = ThresholdSoilMoist( -1.e-15_r8 ) - expected_msg = "ABORTED: Percent clay is less than zero" + expected_msg = "ABORTED: Clay fraction is out of bounds (0 to 100)" @assertExceptionRaised(expected_msg) value = ThresholdSoilMoist( 1._r8 + 1.-15_r8 ) - expected_msg = "ABORTED: Percent clay is greater than 100" @assertExceptionRaised(expected_msg) end subroutine TestClayOutOfRangeThreshold @@ -71,11 +70,11 @@ contains real(r8) :: value value = MassFracClay( 0.0_r8 ) - @assertEqual( value, 0.20_r8, tolerance=tol ) + @assertEqual( value, 0.0_r8, tolerance=tol ) value = MassFracClay( 20.0_r8 ) @assertEqual( value, 0.20_r8, tolerance=tol ) - value = MassFracClay( 100.0_r8 ) - @assertEqual( value, 1.0_r8, tolerance=tol ) + value = MassFracClay( 25.0_r8 ) + @assertEqual( value, 0.20_r8, tolerance=tol ) end subroutine TestClayMassFracValues From cd04c06c06e1399c262c970180f291d583eaf72b Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Fri, 24 May 2024 14:06:36 -0600 Subject: [PATCH 0326/1248] change dictionary to ordered dict --- cime_config/SystemTests/systemtest_utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cime_config/SystemTests/systemtest_utils.py b/cime_config/SystemTests/systemtest_utils.py index 9470799a27..2591ac4223 100644 --- a/cime_config/SystemTests/systemtest_utils.py +++ b/cime_config/SystemTests/systemtest_utils.py @@ -3,6 +3,7 @@ """ import os, subprocess, re, glob +from collections import OrderedDict def cmds_to_setup_conda(caseroot): @@ -99,7 +100,7 @@ def find_user_nl_option(caseroot, component, namelist_option): raise RuntimeError("No user_nl files found for component " + component) # Read through the file list and look for a match and return the whole entry - output = {} + output = OrderedDict() for one_file in file_list: with open(one_file, "r") as user_nl_file: user_nl_text = user_nl_file.read() From 9fc13521793969bd15596a9194353c9dda168349 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Fri, 24 May 2024 14:28:48 -0600 Subject: [PATCH 0327/1248] Correct a testname in ExpectedTestFails.xml --- cime_config/testdefs/ExpectedTestFails.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cime_config/testdefs/ExpectedTestFails.xml b/cime_config/testdefs/ExpectedTestFails.xml index ef6a00993f..23e481222b 100644 --- a/cime_config/testdefs/ExpectedTestFails.xml +++ b/cime_config/testdefs/ExpectedTestFails.xml @@ -51,7 +51,7 @@ - + FAIL #2542 From bec3291f4bae382f3f89c2c178da7365bc0e4a4f Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Fri, 24 May 2024 14:31:45 -0600 Subject: [PATCH 0328/1248] Get unit tests passing again --- src/biogeochem/test/DustEmis_test/test_DustEmis.pf | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/biogeochem/test/DustEmis_test/test_DustEmis.pf b/src/biogeochem/test/DustEmis_test/test_DustEmis.pf index ded09f7919..ff154f3126 100644 --- a/src/biogeochem/test/DustEmis_test/test_DustEmis.pf +++ b/src/biogeochem/test/DustEmis_test/test_DustEmis.pf @@ -19,6 +19,7 @@ module test_DustEmis use WaterType, only : water_type use FrictionVelocityMod, only : frictionvel_type use unittestWaterTypeFactory, only : unittest_water_type_factory_type + use SoilStateInitTimeConstMod, only : ThresholdSoilMoist, ThresholdSoilMoistKok2014, MassFracClay implicit none @@ -155,8 +156,8 @@ contains ! considered bedrock col%nbedrock(c) = nlevsoi - this%soilstate_inst%gwc_thr_col(c) = 0.17_r8 + 0.14_r8 * clay * 0.01_r8 - this%soilstate_inst%mss_frc_cly_vld_col(c) = 0.17_r8 + this%soilstate_inst%gwc_thr_col(c) = ThresholdSoilMoist( clay ) + this%soilstate_inst%mss_frc_cly_vld_col(c) = MassFracClay( clay ) end do @@ -316,7 +317,7 @@ contains call this%dust_emis%GetPatchVars( p, flx_mss_vrt_dst_tot=flx_mss_vrt_dst_tot, & vlc_trb_1=vlc_trb_1, vlc_trb_2=vlc_trb_2, vlc_trb_3=vlc_trb_3, & vlc_trb_4=vlc_trb_4) - @assertEqual( flx_mss_vrt_dst_tot, 2.239779135859605d-5, tolerance=tol ) + @assertEqual( flx_mss_vrt_dst_tot, 2.583480541056971d-6, tolerance=tol ) @assertEqual( vlc_trb_1, 3.407721147709135d-003, tolerance=tol ) @assertEqual( vlc_trb_2, 4.961153753164878d-003, tolerance=tol ) @assertEqual( vlc_trb_3, 4.980100969983446d-003, tolerance=tol ) @@ -473,7 +474,7 @@ contains call this%validate_patch(p) call this%dust_emis%GetPatchVars( p, flx_mss_vrt_dst_tot=flx_mss_vrt_dst_tot ) total_dust0 = flx_mss_vrt_dst_tot - @assertEqual( flx_mss_vrt_dst_tot, 1.971366884000767d-4, tolerance=tol ) + @assertEqual( flx_mss_vrt_dst_tot, 2.273879554711299d-5, tolerance=tol ) end do ! Double u10 and show result is higher call this%create_fv( u10=u10*2.0_r8, fv=fv) @@ -485,7 +486,7 @@ contains call this%validate_patch(p) call this%dust_emis%GetPatchVars( p, flx_mss_vrt_dst_tot=flx_mss_vrt_dst_tot ) total_dust_higher = flx_mss_vrt_dst_tot - @assertEqual( flx_mss_vrt_dst_tot, 3.288208220877217d-4, tolerance=tol ) + @assertEqual( flx_mss_vrt_dst_tot, 3.792794484764924d-5, tolerance=tol ) end do @assertGreaterThan( total_dust_higher, total_dust0 ) From 1e64bc3bfaeec854c09f24da6c9e9afac1135977 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Fri, 24 May 2024 14:39:58 -0600 Subject: [PATCH 0329/1248] Increase tolerance a bit, as these numbers are small --- .../test_dust_soil_clay_functions.pf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/biogeophys/test/SoilStateInitTimeConst_test/test_dust_soil_clay_functions.pf b/src/biogeophys/test/SoilStateInitTimeConst_test/test_dust_soil_clay_functions.pf index f753bf1729..0e4ac8b3db 100644 --- a/src/biogeophys/test/SoilStateInitTimeConst_test/test_dust_soil_clay_functions.pf +++ b/src/biogeophys/test/SoilStateInitTimeConst_test/test_dust_soil_clay_functions.pf @@ -15,7 +15,7 @@ module test_dust_soil_clay_functions procedure :: tearDown end type TestDustEmisSoilFunctions - real(r8), parameter :: tol = 1.e-15_r8 + real(r8), parameter :: tol = 1.e-16_r8 contains From 150397c14052ebba30703e7e334078c13626a149 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Fri, 24 May 2024 15:29:54 -0600 Subject: [PATCH 0330/1248] Start seperating Dust emis testing into the Base and Zender2003 versions --- .../test/DustEmis_test/CMakeLists.txt | 3 +- .../test/DustEmis_test/test_DustEmisBase.pf | 298 ++++++++++++++++++ ...DustEmis.pf => test_DustEmisZender2003.pf} | 0 3 files changed, 300 insertions(+), 1 deletion(-) create mode 100644 src/biogeochem/test/DustEmis_test/test_DustEmisBase.pf rename src/biogeochem/test/DustEmis_test/{test_DustEmis.pf => test_DustEmisZender2003.pf} (100%) diff --git a/src/biogeochem/test/DustEmis_test/CMakeLists.txt b/src/biogeochem/test/DustEmis_test/CMakeLists.txt index a618489386..49e3c16391 100644 --- a/src/biogeochem/test/DustEmis_test/CMakeLists.txt +++ b/src/biogeochem/test/DustEmis_test/CMakeLists.txt @@ -1,5 +1,6 @@ set (pfunit_sources - test_DustEmis.pf) + test_DustEmisBase.pf + test_DustEmisZender2003.pf) add_pfunit_ctest(DustEmis TEST_SOURCES "${pfunit_sources}" diff --git a/src/biogeochem/test/DustEmis_test/test_DustEmisBase.pf b/src/biogeochem/test/DustEmis_test/test_DustEmisBase.pf new file mode 100644 index 0000000000..b25ad5c44c --- /dev/null +++ b/src/biogeochem/test/DustEmis_test/test_DustEmisBase.pf @@ -0,0 +1,298 @@ +module test_DustEmisBase + + ! Tests of DustEmisBase + + use funit + use unittestSubgridMod + use unittestSimpleSubgridSetupsMod, only : setup_single_veg_patch + use clm_varpar, only : nlevsoi, nlevgrnd, nlevsno, clm_varpar_init, ndst + use clm_varctl, only : soil_layerstruct_predefined, create_crop_landunit, use_crop, create_crop_landunit + use clm_varcon, only : clm_varcon_init, clm_varcon_clean + use SnowHydrologyMod, only : InitSnowLayers, SnowHydrologySetControlForTesting, SnowHydrologyClean + use DustEmisZender2003 + use shr_kind_mod , only : r8 => shr_kind_r8 + use unittestFilterBuilderMod, only : filter_from_range + use atm2lndType, only : atm2lnd_type, atm2lnd_params_type + use SoilStateType, only : soilstate_type + use CanopyStateType, only : canopystate_type + use TemperatureType, only : temperature_type + use WaterType, only : water_type + use FrictionVelocityMod, only : frictionvel_type + use unittestWaterTypeFactory, only : unittest_water_type_factory_type + use SoilStateInitTimeConstMod, only : ThresholdSoilMoist, ThresholdSoilMoistKok2014, MassFracClay + + implicit none + + real(r8), parameter :: tol = 1.e-18_r8 + + @TestCase + type, extends(TestCase) :: TestDustEmisBase + type(dust_type) :: dust_emis + integer, allocatable :: filter_nolakep(:) ! non-lake filter (patches) + integer :: num_nolakep ! number of patches in non-lake filter + type(atm2lnd_type) :: atm2lnd_inst + type(soilstate_type) :: soilstate_inst + type(canopystate_type) :: canopystate_inst + type(temperature_type) :: temperature_inst + type(unittest_water_type_factory_type) :: water_factory + type(water_type) :: water_inst + type(frictionvel_type) :: frictionvel_inst + contains + procedure :: setUp + procedure :: tearDown + procedure :: setupEnvironment + procedure :: create_atm2lnd + procedure :: create_fv + procedure :: print_values + procedure :: validate_patch + end type TestDustEmisBase + +contains + + !----------------------------------------------------------------------- + + subroutine setUp(this) + use ColumnType, only : col + class(TestDustEmisBase), intent(inout) :: this + + character(len=5) :: NLFilename = 'none' + real(r8), allocatable :: snow_depth_col(:) + real(r8), allocatable :: urb_em(:) + integer :: begl, endl, begc, endc + integer :: c + type(atm2lnd_params_type) :: atm2lnd_params + + soil_layerstruct_predefined = '20SL_8.5m' + create_crop_landunit = .true. + use_crop = .false. + call clm_varpar_init( actual_maxsoil_patches=17, surf_numpft=15, surf_numcft=2, actual_nlevurb=5 ) + call clm_varcon_init( is_simple_buildtemp=.true.) + call this%water_factory%init() + call this%water_factory%setup_before_subgrid( & + my_nlevsoi = nlevsoi, & + nlevgrnd_additional = nlevgrnd - nlevsoi, & + my_nlevsno = 3) + call setup_single_veg_patch( pft_type=0 ) + begl = bounds%begl + endl = bounds%endl + begc = bounds%begc + endc = bounds%endc + allocate( urb_em(begl:endl) ) + + call this%dust_emis%Init( bounds, NLFilename ) + call filter_from_range(start=bounds%begp, end=bounds%endp, numf=this%num_nolakep, filter=this%filter_nolakep) + atm2lnd_params = atm2lnd_params_type( repartition_rain_snow = .false., & + glcmec_downscale_longwave = .false., & + lapse_rate = 0.01_r8 & ! arbitrary (this is unused for these tests) + ) + allocate (snow_depth_col(begc:endc)) + snow_depth_col(begc:endc) = 0.0_r8 + call SnowHydrologySetControlForTesting() + call InitSnowLayers(bounds, snow_depth_col(bounds%begc:bounds%endc)) + call this%water_factory%setup_after_subgrid(snl = 3) + call this%soilstate_inst%Init(bounds) + do c = begc, endc + this%soilstate_inst%watsat_col(c,:) = 0.05_r8 * (c - bounds%begc + 1) + end do + call this%setupEnvironment( ) + call this%water_factory%create_water_type(this%water_inst, watsat_col=this%soilstate_inst%watsat_col) + call this%atm2lnd_inst%InitForTesting(bounds, atm2lnd_params) + call this%canopystate_inst%SetNMLForTesting() + call this%canopystate_inst%Init(bounds) + call this%frictionvel_inst%InitForTesting(bounds) + urb_em(begl:endl) = 0.99_r8 + call this%temperature_inst%Init(bounds, & + em_roof_lun=urb_em(begl:endl), & + em_wall_lun=urb_em(begl:endl), & + em_improad_lun=urb_em(begl:endl), & + em_perroad_lun=urb_em(begl:endl), & + is_simple_buildtemp=.true., is_prog_buildtemp=.false.) + deallocate (snow_depth_col ) + deallocate( urb_em ) + end subroutine setUp + + !----------------------------------------------------------------------- + + subroutine tearDown(this) + class(TestDustEmisBase), intent(inout) :: this + + call this%dust_emis%Clean() + call this%water_factory%teardown(this%water_inst) + call SnowHydrologyClean() + call unittest_subgrid_teardown() + call this%atm2lnd_inst%Clean() + call clm_varcon_clean() + deallocate( this%filter_nolakep ) + end subroutine tearDown + + !----------------------------------------------------------------------- + + subroutine setupEnvironment(this) + ! + ! !DESCRIPTION: + ! Sets up the external environment used by Dust emissions - i.e., things accessed via + ! 'use' statements. + ! + ! Assumes nlevgrnd and nlevsoi have been set, and that all necessary subgrid setup has + ! been completed. + ! + use ColumnType, only : col + use GridcellType, only : grc + class(TestDustEmisBase), intent(in) :: this + ! + integer :: c,j + real(r8), parameter :: clay = 10.0_r8 + + !----------------------------------------------------------------------- + col%dz(:,1:nlevgrnd) = 1.0_r8 + do j = 1, nlevgrnd + do c = bounds%begc, bounds%endc + col%z(c,j) = sum(col%dz(c,1:j-1)) + 0.5_r8*col%dz(c,j) + end do + end do + + do c = bounds%begc, bounds%endc + ! Setting nbedrock to nlevsoi means that none of the layers from 1:nlevsoi are + ! considered bedrock + col%nbedrock(c) = nlevsoi + + this%soilstate_inst%gwc_thr_col(c) = ThresholdSoilMoist( clay ) + this%soilstate_inst%mss_frc_cly_vld_col(c) = MassFracClay( clay ) + end do + + + ! Use longitude along Greenich so don't have to calculate offsets for longitudes (that's calculated in clm_time_manager) + grc%londeg(:) = 0.0_r8 + + grc%area(:) = 10.0_r8 + + end subroutine setupEnvironment + + !----------------------------------------------------------------------- + + subroutine create_atm2lnd(this, forc_t, forc_pbot, forc_rho ) + ! Initializes some fields needed for dust emissions in this%atm2lnd_inst, and sets + ! forcing fields based on inputs. Excluded inputs are given a default value + class(TestDustEmisBase), intent(inout) :: this + real(r8), intent(in), optional :: forc_t(:) + real(r8), intent(in), optional :: forc_pbot(:) + real(r8), intent(in), optional :: forc_rho(:) + + real(r8), parameter :: forc_t_default = 301._r8 + real(r8), parameter :: forc_pbot_default = 100000._r8 + real(r8), parameter :: forc_rho_default = 1.1_r8 + ! ------------------------------------------------------------------------ + + if (present(forc_t)) then + this%atm2lnd_inst%forc_t_downscaled_col(bounds%begc:bounds%endc) = forc_t(:) + else + this%atm2lnd_inst%forc_t_downscaled_col(bounds%begc:bounds%endc) = forc_t_default + end if + + if (present(forc_pbot)) then + this%atm2lnd_inst%forc_pbot_downscaled_col(bounds%begc:bounds%endc) = forc_pbot(:) + else + this%atm2lnd_inst%forc_pbot_downscaled_col(bounds%begc:bounds%endc) = forc_pbot_default + end if + + if (present(forc_rho)) then + this%atm2lnd_inst%forc_rho_downscaled_col(bounds%begc:bounds%endc) = forc_rho(:) + else + this%atm2lnd_inst%forc_rho_downscaled_col(bounds%begc:bounds%endc) = forc_rho_default + end if + + end subroutine create_atm2lnd + + !----------------------------------------------------------------------- + + subroutine create_fv(this, fv, u10, ram1) + ! Initializes some fields needed for dust emissions in this%frictionvel_inst, and sets + ! fields based on inputs. Excluded inputs are given a default value + class(TestDustEmisBase), intent(inout) :: this + real(r8), intent(in), optional :: fv + real(r8), intent(in), optional :: u10 + real(r8), intent(in), optional :: ram1 + + real(r8), parameter :: fv_default = 2.0_r8 + real(r8), parameter :: u10_default = 4._r8 + real(r8), parameter :: ram1_default = 200._r8 + ! ------------------------------------------------------------------------ + + if (present(fv)) then + this%frictionvel_inst%fv_patch(bounds%begp:bounds%endp) = fv + else + this%frictionvel_inst%fv_patch(bounds%begp:bounds%endp) = fv_default + end if + + if (present(u10)) then + this%frictionvel_inst%u10_patch(bounds%begp:bounds%endp) = u10 + else + this%frictionvel_inst%u10_patch(bounds%begp:bounds%endp) = u10_default + end if + + if (present(ram1)) then + this%frictionvel_inst%ram1_patch(bounds%begp:bounds%endp) = ram1 + else + this%frictionvel_inst%ram1_patch(bounds%begp:bounds%endp) = ram1_default + end if + + end subroutine create_fv + + subroutine print_values(this) + use LandunitType, only : lun + use PatchType, only : patch + class(TestDustEmisBase), intent(inout) :: this + real(r8) :: SaltationFactor + integer :: p, c, l + + call this%dust_emis%GetConstVars( SaltationFactor ) + do l = bounds%begl, bounds%endl + print *, 'landunit type= ', lun%itype(l) + end do + do c = bounds%begc, bounds%endc + print *, 'watsat = ', this%soilstate_inst%watsat_col(c,1) + print *, 'h2osoi_vol = ', this%water_inst%waterstatebulk_inst%h2osoi_vol_col(c,1) + print *, 'frac_sno = ', this%water_inst%waterdiagnosticbulk_inst%frac_sno_col(c) + print *, 'mss_frac_clay_vld = ', this%soilstate_inst%mss_frc_cly_vld_col(c) + print *, 'saltation per rho = ', (SaltationFactor / this%atm2lnd_inst%forc_rho_downscaled_col(c)) + end do + do p = bounds%begp, bounds%endp + print *, 'patch type= ', patch%itype(p) + print *, 'patch weight= ', patch%wtgcell(p) + print *, 'patch active= ', patch%active(p) + print *, 'tlai = ', this%canopystate_inst%tlai_patch(p) + print *, 'tsai = ', this%canopystate_inst%tsai_patch(p) + c = patch%column(p) + print *, 'Wind threshold fraction = ', (SaltationFactor / this%atm2lnd_inst%forc_rho_downscaled_col(c)) & + / this%frictionvel_inst%fv_patch(p) + call this%dust_emis%WritePatchToLog( p ) + end do + end subroutine print_values + + !----------------------------------------------------------------------- + subroutine validate_patch(this, p) + class(TestDustEmisBase), intent(inout) :: this + integer, intent(in) :: p + + real(r8) :: flx_mss_vrt_dst(ndst) + real(r8) :: flx_mss_vrt_dst_tot + real(r8) :: vlc_trb(ndst) + real(r8) :: vlc_trb_1 + real(r8) :: vlc_trb_2 + real(r8) :: vlc_trb_3 + real(r8) :: vlc_trb_4 + + call this%dust_emis%GetPatchVars( p, flx_mss_vrt_dst=flx_mss_vrt_dst, & + flx_mss_vrt_dst_tot=flx_mss_vrt_dst_tot, vlc_trb=vlc_trb, & + vlc_trb_1=vlc_trb_1, vlc_trb_2=vlc_trb_2, vlc_trb_3=vlc_trb_3, & + vlc_trb_4=vlc_trb_4 ) + @assertEqual( sum(flx_mss_vrt_dst), flx_mss_vrt_dst_tot ) + @assertEqual( vlc_trb(1), vlc_trb_1) + @assertEqual( vlc_trb(2), vlc_trb_2) + @assertEqual( vlc_trb(3), vlc_trb_3) + @assertEqual( vlc_trb(4), vlc_trb_4) + end subroutine validate_patch + + !----------------------------------------------------------------------- + +end module test_DustEmisBase diff --git a/src/biogeochem/test/DustEmis_test/test_DustEmis.pf b/src/biogeochem/test/DustEmis_test/test_DustEmisZender2003.pf similarity index 100% rename from src/biogeochem/test/DustEmis_test/test_DustEmis.pf rename to src/biogeochem/test/DustEmis_test/test_DustEmisZender2003.pf From a189bb18d80be3ec911a26d7db81773fdfe8e9ca Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Fri, 24 May 2024 15:57:26 -0600 Subject: [PATCH 0331/1248] Get the unit tests to work again --- .../DustEmis_test/test_DustEmisZender2003.pf | 38 +++++++++---------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/src/biogeochem/test/DustEmis_test/test_DustEmisZender2003.pf b/src/biogeochem/test/DustEmis_test/test_DustEmisZender2003.pf index ff154f3126..c99f4bd97d 100644 --- a/src/biogeochem/test/DustEmis_test/test_DustEmisZender2003.pf +++ b/src/biogeochem/test/DustEmis_test/test_DustEmisZender2003.pf @@ -1,6 +1,6 @@ -module test_DustEmis +module test_DustEmisZender2003 - ! Tests of DustEmis + ! Tests of DustEmisZender2003 use funit use unittestSubgridMod @@ -26,7 +26,7 @@ module test_DustEmis real(r8), parameter :: tol = 1.e-18_r8 @TestCase - type, extends(TestCase) :: TestDustEmis + type, extends(TestCase) :: TestDustEmisZender2003 type(dust_type) :: dust_emis integer, allocatable :: filter_nolakep(:) ! non-lake filter (patches) integer :: num_nolakep ! number of patches in non-lake filter @@ -45,7 +45,7 @@ module test_DustEmis procedure :: create_fv procedure :: print_values procedure :: validate_patch - end type TestDustEmis + end type TestDustEmisZender2003 contains @@ -53,7 +53,7 @@ contains subroutine setUp(this) use ColumnType, only : col - class(TestDustEmis), intent(inout) :: this + class(TestDustEmisZender2003), intent(inout) :: this character(len=5) :: NLFilename = 'none' real(r8), allocatable :: snow_depth_col(:) @@ -114,7 +114,7 @@ contains !----------------------------------------------------------------------- subroutine tearDown(this) - class(TestDustEmis), intent(inout) :: this + class(TestDustEmisZender2003), intent(inout) :: this call this%dust_emis%Clean() call this%water_factory%teardown(this%water_inst) @@ -138,7 +138,7 @@ contains ! use ColumnType, only : col use GridcellType, only : grc - class(TestDustEmis), intent(in) :: this + class(TestDustEmisZender2003), intent(in) :: this ! integer :: c,j real(r8), parameter :: clay = 10.0_r8 @@ -173,7 +173,7 @@ contains subroutine create_atm2lnd(this, forc_t, forc_pbot, forc_rho ) ! Initializes some fields needed for dust emissions in this%atm2lnd_inst, and sets ! forcing fields based on inputs. Excluded inputs are given a default value - class(TestDustEmis), intent(inout) :: this + class(TestDustEmisZender2003), intent(inout) :: this real(r8), intent(in), optional :: forc_t(:) real(r8), intent(in), optional :: forc_pbot(:) real(r8), intent(in), optional :: forc_rho(:) @@ -208,7 +208,7 @@ contains subroutine create_fv(this, fv, u10, ram1) ! Initializes some fields needed for dust emissions in this%frictionvel_inst, and sets ! fields based on inputs. Excluded inputs are given a default value - class(TestDustEmis), intent(inout) :: this + class(TestDustEmisZender2003), intent(inout) :: this real(r8), intent(in), optional :: fv real(r8), intent(in), optional :: u10 real(r8), intent(in), optional :: ram1 @@ -241,7 +241,7 @@ contains subroutine print_values(this) use LandunitType, only : lun use PatchType, only : patch - class(TestDustEmis), intent(inout) :: this + class(TestDustEmisZender2003), intent(inout) :: this real(r8) :: SaltationFactor integer :: p, c, l @@ -271,7 +271,7 @@ contains !----------------------------------------------------------------------- subroutine validate_patch(this, p) - class(TestDustEmis), intent(inout) :: this + class(TestDustEmisZender2003), intent(inout) :: this integer, intent(in) :: p real(r8) :: flx_mss_vrt_dst(ndst) @@ -298,7 +298,7 @@ contains @Test subroutine check_dust_emis(this) ! Check dust emissions for default values - class(TestDustEmis), intent(inout) :: this + class(TestDustEmisZender2003), intent(inout) :: this integer :: p real(r8) :: flx_mss_vrt_dst_tot real(r8) :: vlc_trb_1 @@ -331,7 +331,7 @@ contains @Test subroutine dust_zero_for_fixed_ratio(this) ! Check dust emissions are zero for a no wind - class(TestDustEmis), intent(inout) :: this + class(TestDustEmisZender2003), intent(inout) :: this integer :: p real(r8) :: flx_mss_vrt_dst_tot real(r8) :: fv @@ -360,7 +360,7 @@ contains @Test subroutine dust_zero_when_fsno_one(this) ! Check dust emissions are zero when snow fraction is identically 1 - class(TestDustEmis), intent(inout) :: this + class(TestDustEmisZender2003), intent(inout) :: this integer :: p real(r8) :: flx_mss_vrt_dst_tot @@ -385,7 +385,7 @@ contains ! Check dust emissions are zero for non-veg landunits use landunit_varcon, only: istcrop, max_lunit use LandunitType, only : lun - class(TestDustEmis), intent(inout) :: this + class(TestDustEmisZender2003), intent(inout) :: this integer :: p, l real(r8) :: flx_mss_vrt_dst_tot @@ -411,7 +411,7 @@ contains @Test subroutine aborts_on_bad_dust_mobility(this) ! Check dust abort when dust mobility is bad - class(TestDustEmis), intent(inout) :: this + class(TestDustEmisZender2003), intent(inout) :: this real(r8) :: flx_mss_vrt_dst_tot character(100) :: expected_msg @@ -432,7 +432,7 @@ contains @Test subroutine dust_zero_when_tlai_high(this) ! Check dust emissions are zero when LAI is high enough - class(TestDustEmis), intent(inout) :: this + class(TestDustEmisZender2003), intent(inout) :: this integer :: p real(r8) :: flx_mss_vrt_dst_tot @@ -456,7 +456,7 @@ contains @Test subroutine check_dust_emis_increasing_wind(this) ! Check dust emissions with increasing wind - class(TestDustEmis), intent(inout) :: this + class(TestDustEmisZender2003), intent(inout) :: this integer :: p, c real(r8) :: flx_mss_vrt_dst_tot real(r8) :: fv = 4.0_r8 @@ -494,4 +494,4 @@ contains !----------------------------------------------------------------------- -end module test_DustEmis \ No newline at end of file +end module test_DustEmisZender2003 \ No newline at end of file From dab63611a6088551ff2959f1c04bcfbc4b61c2db Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Fri, 24 May 2024 16:13:59 -0600 Subject: [PATCH 0332/1248] pvt system init step update --- cime_config/SystemTests/pvt.py | 149 ++++++++++++++++++--------------- 1 file changed, 82 insertions(+), 67 deletions(-) diff --git a/cime_config/SystemTests/pvt.py b/cime_config/SystemTests/pvt.py index c45c514f39..184c5de289 100644 --- a/cime_config/SystemTests/pvt.py +++ b/cime_config/SystemTests/pvt.py @@ -12,7 +12,8 @@ """ from CIME.XML.standard_module_setup import * from CIME.SystemTests.system_tests_common import SystemTestsCommon -from systemtest_utils import read_user_nl_clm +from CIME.SystemTests.test_utils.user_nl_utils import append_to_user_nl_files +from systemtest_utils import find_user_nl_option import shutil, glob, os logger = logging.getLogger(__name__) @@ -41,76 +42,90 @@ def __init__(self,case): if error_message is not None: logger.error(error_message) raise RuntimeError(error_message) - def run_phase(self): - # ------------------------------------------------------------------- - # (1) Run FATES spin-up case in potential vegetation mode - # ------------------------------------------------------------------- - orig_case = self._case - orig_casevar = self._case.get_value("CASE") - caseroot = self._case.get_value("CASEROOT") - - # clone the main case to create spinup case - logger.info("PVT log: cloning setup") - clone_path = "{}.potveg".format(caseroot) - if os.path.exists(clone_path): - shutil.rmtree(clone_path) - logger.info("PVT log: cloning") - clone = self._case.create_clone(clone_path, keepexe=True) - logger.info("PVT log: cloning complete") - # setup the clone case - os.chdir(clone_path) - self._set_active_case(clone) - self._setup_all() + # Look to see if a harvest mode has been set in the namelist and save off for the transient run + # If there are more than one entries in the dict, i.e. multiple user_nl_clm's found, abort. + # If there are multiple enteries the user_nl_clm, use the last one as the dict is ordered + caseroot = self._case.get_value("CASEROOT") + harvest_mode_dict = find_user_nl_option(caseroot, 'clm', 'fates_harvest_mode') + harvest_mode = None + if len(harvest_mode_dict) == 1: + hmod = harvest_mode_dict[next(reversed(harvest_mode_dict))] + if len(hmod) != 0: + harvest_mode = hmod[-1] + elif (len(harvest_mode_dict)) > 1: + raise RuntimeError('Multiple user_nl_clm files found. PVT assumes only a single user_nl_clm case') # Modify the spin up case to use the potential vegetation mode. # Checks for incompatible cases and necessary mapping files are # handled in the build case. # use_fates_lupft should be set to true in the testmod - # save off the harvest mode for reinstating later - found, hmode = self.read_user_nl_clm('fates_harvest_mode') - logger.info("PVT log: modify user_nl_clm file for spin up run") - # TODO: remove fates_harvest_mode if found - self._append_to_user_nl_clm( - [ - "use_fates_potentialveg = .true.", - ] - ) - - stop_n_pveg = 1 - with clone: - # clone.set_value("CLM_ACCELERATED_SPINUP", "on") - clone.set_value("STOP_N", stop_n_pveg) - - # Run the spin up case - # As per SSP test: - # "No history files expected, set suffix=None to avoid compare error" - logger.info("PVT log: starting spin-up run") - dout_sr = clone.get_value("DOUT_S_ROOT") - self._skip_pnl = False - self.run_indv(suffix=None, st_archive=True) + # If the testmod has a fates harvest mode, make sure to append 'no_harvest' + # to the spin up case - # ------------------------------------------------------------------- - # (2) Run FATES transient case using restart file from spin-up - # ------------------------------------------------------------------- - os.chdir(caseroot) - self._set_active_case(orig_case) - - # logger.info("PVT log: modify user_nl_clm file for transient run") - # self._append_to_user_nl_clm( - # [ - # "use_fates_potentialveg = .true.", - # ] - # ) - - - self._case.set_value("CLM_ACCELERATED_SPINUP", "off") - self._case.set_value("RUN_TYPE", "hybrid") - self._case.set_value("GET_REFCASE", False) - self._case.set_value("RUN_REFCASE", "{}.potveg".format(orig_casevar)) - self._case.set_value("RUN_REFDATE", "1700-01-01") - self._case.set_value("DOUT_S", False) - self._case.flush() - - # do the restart run (short term archiving is off) - self.run_indv() + logger.info("PVT log: modify user_nl_clm file for spin up run") + added_content = ["use_fates_potentialveg = .true."] + if harvest_mode is not None: + added_content.append("fates_harvest_mode = 'no_harvest'") + append_to_user_nl_files(caseroot, "clm", added_content) + +# def run_phase(self): +# # ------------------------------------------------------------------- +# # (1) Run FATES spin-up case in potential vegetation mode +# # ------------------------------------------------------------------- +# orig_case = self._case +# orig_casevar = self._case.get_value("CASE") +# caseroot = self._case.get_value("CASEROOT") +# +# # clone the main case to create spinup case +# logger.info("PVT log: cloning setup") +# clone_path = "{}.potveg".format(caseroot) +# if os.path.exists(clone_path): +# shutil.rmtree(clone_path) +# logger.info("PVT log: cloning") +# clone = self._case.create_clone(clone_path, keepexe=True) +# logger.info("PVT log: cloning complete") +# +# # setup the clone case +# os.chdir(clone_path) +# self._set_active_case(clone) +# self._setup_all() +# +# +# stop_n_pveg = 1 +# with clone: +# # clone.set_value("CLM_ACCELERATED_SPINUP", "on") +# clone.set_value("STOP_N", stop_n_pveg) +# +# # Run the spin up case +# # As per SSP test: +# # "No history files expected, set suffix=None to avoid compare error" +# logger.info("PVT log: starting spin-up run") +# dout_sr = clone.get_value("DOUT_S_ROOT") +# self._skip_pnl = False +# self.run_indv(suffix=None, st_archive=True) +# +# # ------------------------------------------------------------------- +# # (2) Run FATES transient case using restart file from spin-up +# # ------------------------------------------------------------------- +# os.chdir(caseroot) +# self._set_active_case(orig_case) +# +# # logger.info("PVT log: modify user_nl_clm file for transient run") +# # self._append_to_user_nl_clm( +# # [ +# # "use_fates_potentialveg = .true.", +# # ] +# # ) +# +# +# self._case.set_value("CLM_ACCELERATED_SPINUP", "off") +# self._case.set_value("RUN_TYPE", "hybrid") +# self._case.set_value("GET_REFCASE", False) +# self._case.set_value("RUN_REFCASE", "{}.potveg".format(orig_casevar)) +# self._case.set_value("RUN_REFDATE", "1700-01-01") +# self._case.set_value("DOUT_S", False) +# self._case.flush() +# +# # do the restart run (short term archiving is off) +# self.run_indv() From 175a3d01082437945f15660f75aca860c626d0a4 Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Fri, 24 May 2024 18:14:18 -0600 Subject: [PATCH 0333/1248] pvt system test setup looks correct --- cime_config/SystemTests/pvt.py | 132 +++++++++++++-------------------- 1 file changed, 53 insertions(+), 79 deletions(-) diff --git a/cime_config/SystemTests/pvt.py b/cime_config/SystemTests/pvt.py index 184c5de289..6b2a958eaa 100644 --- a/cime_config/SystemTests/pvt.py +++ b/cime_config/SystemTests/pvt.py @@ -43,89 +43,63 @@ def __init__(self,case): logger.error(error_message) raise RuntimeError(error_message) - # Look to see if a harvest mode has been set in the namelist and save off for the transient run - # If there are more than one entries in the dict, i.e. multiple user_nl_clm's found, abort. - # If there are multiple enteries the user_nl_clm, use the last one as the dict is ordered + def run_phase(self): + # ------------------------------------------------------------------- + # (1) Run FATES spin-up case in potential vegetation mode + # ------------------------------------------------------------------- + orig_case = self._case + orig_casevar = self._case.get_value("CASE") caseroot = self._case.get_value("CASEROOT") - harvest_mode_dict = find_user_nl_option(caseroot, 'clm', 'fates_harvest_mode') - harvest_mode = None - if len(harvest_mode_dict) == 1: - hmod = harvest_mode_dict[next(reversed(harvest_mode_dict))] - if len(hmod) != 0: - harvest_mode = hmod[-1] - elif (len(harvest_mode_dict)) > 1: - raise RuntimeError('Multiple user_nl_clm files found. PVT assumes only a single user_nl_clm case') + + # clone the main case to create spinup case + logger.info("PVT log: cloning setup") + clone_path = "{}.potveg".format(caseroot) + if os.path.exists(clone_path): + shutil.rmtree(clone_path) + logger.info("PVT log: cloning") + clone = self._case.create_clone(clone_path, keepexe=True) + logger.info("PVT log: cloning complete") + + # setup the clone case + os.chdir(clone_path) + self._set_active_case(clone) + + # set the clone case values + stop_n_pveg = 1 + with clone: + # clone.set_value("CLM_ACCELERATED_SPINUP", "on") + clone.set_value("STOP_N", stop_n_pveg) # Modify the spin up case to use the potential vegetation mode. # Checks for incompatible cases and necessary mapping files are # handled in the build case. - # use_fates_lupft should be set to true in the testmod - # If the testmod has a fates harvest mode, make sure to append 'no_harvest' - # to the spin up case + # Turn off fates_harvest_mode for the spin up. logger.info("PVT log: modify user_nl_clm file for spin up run") - added_content = ["use_fates_potentialveg = .true."] - if harvest_mode is not None: - added_content.append("fates_harvest_mode = 'no_harvest'") - append_to_user_nl_files(caseroot, "clm", added_content) - -# def run_phase(self): -# # ------------------------------------------------------------------- -# # (1) Run FATES spin-up case in potential vegetation mode -# # ------------------------------------------------------------------- -# orig_case = self._case -# orig_casevar = self._case.get_value("CASE") -# caseroot = self._case.get_value("CASEROOT") -# -# # clone the main case to create spinup case -# logger.info("PVT log: cloning setup") -# clone_path = "{}.potveg".format(caseroot) -# if os.path.exists(clone_path): -# shutil.rmtree(clone_path) -# logger.info("PVT log: cloning") -# clone = self._case.create_clone(clone_path, keepexe=True) -# logger.info("PVT log: cloning complete") -# -# # setup the clone case -# os.chdir(clone_path) -# self._set_active_case(clone) -# self._setup_all() -# -# -# stop_n_pveg = 1 -# with clone: -# # clone.set_value("CLM_ACCELERATED_SPINUP", "on") -# clone.set_value("STOP_N", stop_n_pveg) -# -# # Run the spin up case -# # As per SSP test: -# # "No history files expected, set suffix=None to avoid compare error" -# logger.info("PVT log: starting spin-up run") -# dout_sr = clone.get_value("DOUT_S_ROOT") -# self._skip_pnl = False -# self.run_indv(suffix=None, st_archive=True) -# -# # ------------------------------------------------------------------- -# # (2) Run FATES transient case using restart file from spin-up -# # ------------------------------------------------------------------- -# os.chdir(caseroot) -# self._set_active_case(orig_case) -# -# # logger.info("PVT log: modify user_nl_clm file for transient run") -# # self._append_to_user_nl_clm( -# # [ -# # "use_fates_potentialveg = .true.", -# # ] -# # ) -# -# -# self._case.set_value("CLM_ACCELERATED_SPINUP", "off") -# self._case.set_value("RUN_TYPE", "hybrid") -# self._case.set_value("GET_REFCASE", False) -# self._case.set_value("RUN_REFCASE", "{}.potveg".format(orig_casevar)) -# self._case.set_value("RUN_REFDATE", "1700-01-01") -# self._case.set_value("DOUT_S", False) -# self._case.flush() -# -# # do the restart run (short term archiving is off) -# self.run_indv() + added_content = ["use_fates_potentialveg = .true.","fates_harvest_mode = 'no_harvest'"] + append_to_user_nl_files(clone_path, "clm", added_content) + + # Run the spin up case + # As per SSP test: + # "No history files expected, set suffix=None to avoid compare error" + logger.info("PVT log: starting spin-up run") + dout_sr = clone.get_value("DOUT_S_ROOT") + self._skip_pnl = False + self.run_indv(suffix=None, st_archive=True) + + # ------------------------------------------------------------------- + # (2) Run FATES transient case using restart file from spin-up + # ------------------------------------------------------------------- + os.chdir(caseroot) + self._set_active_case(orig_case) + + self._case.set_value("CLM_ACCELERATED_SPINUP", "off") + self._case.set_value("RUN_TYPE", "hybrid") + self._case.set_value("GET_REFCASE", False) + self._case.set_value("RUN_REFCASE", "{}.potveg".format(orig_casevar)) + self._case.set_value("RUN_REFDATE", "1700-01-01") + self._case.set_value("DOUT_S", False) + self._case.flush() + + # do the restart run (short term archiving is off) + self.run_indv() From 10728d91c8dcaeeb0719429ba11cf857fec50f68 Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Fri, 24 May 2024 18:15:04 -0600 Subject: [PATCH 0334/1248] add non-Cold based testmod for spinup + transient --- .../testmods_dirs/clm/FatesLUPFTAreaHarvest/include_user_mods | 1 + .../testdefs/testmods_dirs/clm/FatesLUPFTAreaHarvest/user_nl_clm | 1 + 2 files changed, 2 insertions(+) create mode 100644 cime_config/testdefs/testmods_dirs/clm/FatesLUPFTAreaHarvest/include_user_mods create mode 100644 cime_config/testdefs/testmods_dirs/clm/FatesLUPFTAreaHarvest/user_nl_clm diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesLUPFTAreaHarvest/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/FatesLUPFTAreaHarvest/include_user_mods new file mode 100644 index 0000000000..1ceba4c200 --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/FatesLUPFTAreaHarvest/include_user_mods @@ -0,0 +1 @@ +../FatesLUPFT diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesLUPFTAreaHarvest/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/FatesLUPFTAreaHarvest/user_nl_clm new file mode 100644 index 0000000000..426b41b49e --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/FatesLUPFTAreaHarvest/user_nl_clm @@ -0,0 +1 @@ +fates_harvest_mode = 'luhdata_area' From a7b60fa5539991e0e75fff6c34c1b2f50f3b3e83 Mon Sep 17 00:00:00 2001 From: Jim Edwards Date: Mon, 27 May 2024 17:34:56 -0600 Subject: [PATCH 0335/1248] first remove manage_externals and update docs --- .github/PULL_REQUEST_TEMPLATE.md | 2 +- Externals.cfg | 94 - Externals_CLM.cfg | 9 - README | 6 +- manage_externals/.dir_locals.el | 12 - manage_externals/.github/ISSUE_TEMPLATE.md | 6 - .../.github/PULL_REQUEST_TEMPLATE.md | 17 - .../.github/workflows/bumpversion.yml | 19 - manage_externals/.github/workflows/tests.yml | 30 - manage_externals/.gitignore | 17 - manage_externals/.travis.yml | 18 - manage_externals/LICENSE.txt | 34 - manage_externals/README.md | 231 -- manage_externals/README_FIRST | 54 - manage_externals/checkout_externals | 36 - manage_externals/manic/__init__.py | 9 - manage_externals/manic/checkout.py | 446 ---- .../manic/externals_description.py | 830 -------- manage_externals/manic/externals_status.py | 164 -- manage_externals/manic/global_constants.py | 18 - manage_externals/manic/repository.py | 98 - manage_externals/manic/repository_factory.py | 30 - manage_externals/manic/repository_git.py | 859 -------- manage_externals/manic/repository_svn.py | 291 --- manage_externals/manic/sourcetree.py | 425 ---- manage_externals/manic/utils.py | 330 --- manage_externals/test/.coveragerc | 7 - manage_externals/test/.gitignore | 7 - manage_externals/test/.pylint.rc | 426 ---- manage_externals/test/Makefile | 124 -- manage_externals/test/README.md | 53 - manage_externals/test/doc/.gitignore | 2 - manage_externals/test/doc/Makefile | 20 - manage_externals/test/doc/conf.py | 172 -- manage_externals/test/doc/develop.rst | 202 -- manage_externals/test/doc/index.rst | 22 - manage_externals/test/doc/testing.rst | 123 -- manage_externals/test/repos/README.md | 33 - .../test/repos/container.git/HEAD | 1 - .../test/repos/container.git/config | 6 - .../test/repos/container.git/description | 1 - .../test/repos/container.git/info/exclude | 6 - .../41/1de5d96ee418c1c55f3e96e6e6e7c06bb95801 | Bin 133 -> 0 bytes .../71/5b8f3e4afe1802a178e1d603af404ba45d59de | Bin 136 -> 0 bytes .../b0/f87705e2b9601cb831878f3d51efa78b910d7b | Bin 89 -> 0 bytes .../f9/e08370a737e941de6f6492e3f427c2ef4c1a03 | Bin 81 -> 0 bytes .../repos/container.git/refs/heads/master | 1 - manage_externals/test/repos/error/readme.txt | 3 - .../test/repos/mixed-cont-ext.git/HEAD | 1 - .../test/repos/mixed-cont-ext.git/config | 6 - .../test/repos/mixed-cont-ext.git/description | 1 - .../repos/mixed-cont-ext.git/info/exclude | 6 - .../00/437ac2000d5f06fb8a572a01a5bbdae98b17cb | Bin 172 -> 0 bytes .../01/97458f2dbe5fcd6bc44fa46983be0a30282379 | Bin 171 -> 0 bytes .../06/ea30b03ffa2f8574705f8b9583f7ca7e2dccf7 | Bin 136 -> 0 bytes .../14/368b701616a8c53820b610414a4b9a07540cf6 | 1 - .../15/2b57e1cf23721cd17ff681cb9276e3fb9fc091 | 2 - .../1f/01fa46c17b1f38b37e6259f6e9d041bda3144f | Bin 167 -> 0 bytes .../37/f0e70b609adc90f4c09ee21d82ed1d79c81d69 | Bin 89 -> 0 bytes .../38/9a2b876b8965d3c91a3db8d28a483eaf019d5c | Bin 130 -> 0 bytes .../41/1de5d96ee418c1c55f3e96e6e6e7c06bb95801 | Bin 133 -> 0 bytes .../6e/9f4baa6e94a0af4e094836c2eb55ccedef5fc4 | Bin 129 -> 0 bytes .../6f/c379457ecb4e576a13c7610ae1fa73f845ee6a | 1 - .../93/a159deb9175bfeb2820a0006ddd92d78131332 | Bin 169 -> 0 bytes .../95/80ecc12f16334ce44e42287d5d46f927bb7b75 | 1 - .../a9/288dcd8a719a1f4ed3cba43a2a387ae7cd60fd | Bin 130 -> 0 bytes .../e8/ea32a11d30ee703f6f661ae7c2376f4ab84d38 | Bin 130 -> 0 bytes .../fd/15a5ad5204356229c60a831d2a8120a43ac901 | 2 - .../mixed-cont-ext.git/refs/heads/master | 1 - .../mixed-cont-ext.git/refs/heads/new-feature | 1 - .../test/repos/simple-ext-fork.git/HEAD | 1 - .../test/repos/simple-ext-fork.git/config | 8 - .../repos/simple-ext-fork.git/description | 1 - .../repos/simple-ext-fork.git/info/exclude | 6 - .../00/fd13e76189f9134b0506b4b8ed3172723b467f | Bin 89 -> 0 bytes .../0b/15e8af3d4615b42314216efeae3fff184046a8 | Bin 89 -> 0 bytes .../0b/67df4e7e8e6e1c6e401542738b352d18744677 | Bin 167 -> 0 bytes .../11/a76e3d9a67313dec7ce1230852ab5c86352c5c | 2 - .../16/5506a7408a482f50493434e13fffeb44af893f | Bin 89 -> 0 bytes .../24/4386e788c9bc608613e127a329c742450a60e4 | Bin 164 -> 0 bytes .../32/7e97d86e941047d809dba58f2804740c6c30cf | Bin 89 -> 0 bytes .../36/418b4e5665956a90725c9a1b5a8e551c5f3d48 | Bin 159 -> 0 bytes .../3d/7099c35404ae6c8640ce263b38bef06e98cc26 | 2 - .../3d/ec1fdf8e2f5edba28148c5db2fe8d7a842360b | 2 - .../41/1de5d96ee418c1c55f3e96e6e6e7c06bb95801 | Bin 133 -> 0 bytes .../4d/837135915ed93eed6fff6b439f284ce317296f | Bin 89 -> 0 bytes .../56/175e017ad38bf3d33d74b6bd7c74624b28466a | Bin 89 -> 0 bytes .../5f/1d4786d12e52d7ab28d2f2f1118c1059a9f1ae | Bin 93 -> 0 bytes .../67/136e5ab4d5c1c65d10c8048763b96b0e53c1d6 | Bin 165 -> 0 bytes .../7b/0bd630ac13865735a1dff3437a137d8ab50663 | Bin 119 -> 0 bytes .../88/cf20868e0cc445f5642a480ed034c71e0d7e9f | 2 - .../8d/2b3b35126224c975d23f109aa1e3cbac452989 | 2 - .../9b/75494003deca69527bb64bcaa352e801611dd2 | Bin 138 -> 0 bytes .../a2/2a5da9119328ea6d693f88861457c07e14ac04 | 1 - .../a4/2fe9144f5707bc1e9515ce1b44681f7aba6f95 | 3 - .../b9/3737be3ea6b19f6255983748a0a0f4d622f936 | Bin 89 -> 0 bytes .../c5/32bc8fde96fa63103a52057f0baffcc9f00c6b | 1 - .../c5/b315915742133dbdfbeed0753e481b55c1d364 | 1 - .../f2/68d4e56d067da9bd1d85e55bdc40a8bd2b0bca | 1 - .../repos/simple-ext-fork.git/packed-refs | 5 - .../simple-ext-fork.git/refs/heads/feature2 | 1 - .../refs/tags/abandoned-feature | 1 - .../refs/tags/forked-feature-v1 | 1 - .../test/repos/simple-ext.git/HEAD | 1 - .../test/repos/simple-ext.git/config | 6 - .../test/repos/simple-ext.git/description | 1 - .../test/repos/simple-ext.git/info/exclude | 6 - .../00/fd13e76189f9134b0506b4b8ed3172723b467f | Bin 89 -> 0 bytes .../09/0e1034746b2c865f7b0280813dbf4061a700e8 | Bin 164 -> 0 bytes .../0b/15e8af3d4615b42314216efeae3fff184046a8 | Bin 89 -> 0 bytes .../11/a76e3d9a67313dec7ce1230852ab5c86352c5c | 2 - .../14/2711fdbbcb8034d7cad6bae6801887b12fe61d | Bin 83 -> 0 bytes .../31/dbcd6de441e671a467ef317146539b7ffabb11 | Bin 90 -> 0 bytes .../36/418b4e5665956a90725c9a1b5a8e551c5f3d48 | Bin 159 -> 0 bytes .../41/1de5d96ee418c1c55f3e96e6e6e7c06bb95801 | Bin 133 -> 0 bytes .../60/7ec299c17dd285c029edc41a0109e49d441380 | Bin 168 -> 0 bytes .../60/b1cc1a38d63a4bcaa1e767262bbe23dbf9f5f5 | 2 - .../63/a99393d1baff97ccef967af30380659867b139 | 1 - .../95/3256da5612fcd9263590a353bc18c6f224e74f | 1 - .../9b/75494003deca69527bb64bcaa352e801611dd2 | Bin 138 -> 0 bytes .../a2/2a5da9119328ea6d693f88861457c07e14ac04 | 1 - .../b7/692b6d391899680da7b9b6fd8af4c413f06fe7 | Bin 137 -> 0 bytes .../c5/b315915742133dbdfbeed0753e481b55c1d364 | 1 - .../d1/163870d19c3dee34fada3a76b785cfa2a8424b | Bin 130 -> 0 bytes .../d8/ed2f33179d751937f8fde2e33921e4827babf4 | Bin 60 -> 0 bytes .../df/312890f93ba4d2c694208599b665c4a08afeff | Bin 89 -> 0 bytes .../repos/simple-ext.git/refs/heads/feature2 | 1 - .../repos/simple-ext.git/refs/heads/feature3 | 1 - .../repos/simple-ext.git/refs/heads/master | 1 - .../test/repos/simple-ext.git/refs/tags/tag1 | 1 - .../test/repos/simple-ext.git/refs/tags/tag2 | 1 - .../test/repos/simple-ext.svn/README.txt | 5 - .../test/repos/simple-ext.svn/conf/authz | 32 - .../repos/simple-ext.svn/conf/hooks-env.tmpl | 19 - .../test/repos/simple-ext.svn/conf/passwd | 8 - .../repos/simple-ext.svn/conf/svnserve.conf | 81 - .../test/repos/simple-ext.svn/db/current | 1 - .../test/repos/simple-ext.svn/db/format | 3 - .../test/repos/simple-ext.svn/db/fs-type | 1 - .../test/repos/simple-ext.svn/db/fsfs.conf | 200 -- .../repos/simple-ext.svn/db/min-unpacked-rev | 1 - .../test/repos/simple-ext.svn/db/rep-cache.db | Bin 8192 -> 0 bytes .../simple-ext.svn/db/rep-cache.db-journal | 0 .../test/repos/simple-ext.svn/db/revprops/0/0 | 5 - .../test/repos/simple-ext.svn/db/revprops/0/1 | 13 - .../test/repos/simple-ext.svn/db/revprops/0/2 | 13 - .../test/repos/simple-ext.svn/db/revprops/0/3 | 13 - .../test/repos/simple-ext.svn/db/revs/0/0 | Bin 253 -> 0 bytes .../test/repos/simple-ext.svn/db/revs/0/1 | Bin 725 -> 0 bytes .../test/repos/simple-ext.svn/db/revs/0/2 | Bin 816 -> 0 bytes .../test/repos/simple-ext.svn/db/revs/0/3 | Bin 769 -> 0 bytes .../test/repos/simple-ext.svn/db/txn-current | 1 - .../repos/simple-ext.svn/db/txn-current-lock | 0 .../test/repos/simple-ext.svn/db/uuid | 2 - .../test/repos/simple-ext.svn/db/write-lock | 0 .../test/repos/simple-ext.svn/format | 1 - .../simple-ext.svn/hooks/post-commit.tmpl | 62 - .../repos/simple-ext.svn/hooks/post-lock.tmpl | 64 - .../hooks/post-revprop-change.tmpl | 69 - .../simple-ext.svn/hooks/post-unlock.tmpl | 61 - .../simple-ext.svn/hooks/pre-commit.tmpl | 91 - .../repos/simple-ext.svn/hooks/pre-lock.tmpl | 95 - .../hooks/pre-revprop-change.tmpl | 79 - .../simple-ext.svn/hooks/pre-unlock.tmpl | 87 - .../simple-ext.svn/hooks/start-commit.tmpl | 81 - .../repos/simple-ext.svn/locks/db-logs.lock | 3 - .../test/repos/simple-ext.svn/locks/db.lock | 3 - manage_externals/test/requirements.txt | 5 - manage_externals/test/test_sys_checkout.py | 1871 ----------------- .../test/test_sys_repository_git.py | 238 --- .../test/test_unit_externals_description.py | 478 ----- .../test/test_unit_externals_status.py | 299 --- manage_externals/test/test_unit_repository.py | 208 -- .../test/test_unit_repository_git.py | 811 ------- .../test/test_unit_repository_svn.py | 501 ----- manage_externals/test/test_unit_utils.py | 350 --- 176 files changed, 2 insertions(+), 11238 deletions(-) delete mode 100644 Externals.cfg delete mode 100644 Externals_CLM.cfg delete mode 100644 manage_externals/.dir_locals.el delete mode 100644 manage_externals/.github/ISSUE_TEMPLATE.md delete mode 100644 manage_externals/.github/PULL_REQUEST_TEMPLATE.md delete mode 100644 manage_externals/.github/workflows/bumpversion.yml delete mode 100644 manage_externals/.github/workflows/tests.yml delete mode 100644 manage_externals/.gitignore delete mode 100644 manage_externals/.travis.yml delete mode 100644 manage_externals/LICENSE.txt delete mode 100644 manage_externals/README.md delete mode 100644 manage_externals/README_FIRST delete mode 100755 manage_externals/checkout_externals delete mode 100644 manage_externals/manic/__init__.py delete mode 100755 manage_externals/manic/checkout.py delete mode 100644 manage_externals/manic/externals_description.py delete mode 100644 manage_externals/manic/externals_status.py delete mode 100644 manage_externals/manic/global_constants.py delete mode 100644 manage_externals/manic/repository.py delete mode 100644 manage_externals/manic/repository_factory.py delete mode 100644 manage_externals/manic/repository_git.py delete mode 100644 manage_externals/manic/repository_svn.py delete mode 100644 manage_externals/manic/sourcetree.py delete mode 100644 manage_externals/manic/utils.py delete mode 100644 manage_externals/test/.coveragerc delete mode 100644 manage_externals/test/.gitignore delete mode 100644 manage_externals/test/.pylint.rc delete mode 100644 manage_externals/test/Makefile delete mode 100644 manage_externals/test/README.md delete mode 100644 manage_externals/test/doc/.gitignore delete mode 100644 manage_externals/test/doc/Makefile delete mode 100644 manage_externals/test/doc/conf.py delete mode 100644 manage_externals/test/doc/develop.rst delete mode 100644 manage_externals/test/doc/index.rst delete mode 100644 manage_externals/test/doc/testing.rst delete mode 100644 manage_externals/test/repos/README.md delete mode 100644 manage_externals/test/repos/container.git/HEAD delete mode 100644 manage_externals/test/repos/container.git/config delete mode 100644 manage_externals/test/repos/container.git/description delete mode 100644 manage_externals/test/repos/container.git/info/exclude delete mode 100644 manage_externals/test/repos/container.git/objects/41/1de5d96ee418c1c55f3e96e6e6e7c06bb95801 delete mode 100644 manage_externals/test/repos/container.git/objects/71/5b8f3e4afe1802a178e1d603af404ba45d59de delete mode 100644 manage_externals/test/repos/container.git/objects/b0/f87705e2b9601cb831878f3d51efa78b910d7b delete mode 100644 manage_externals/test/repos/container.git/objects/f9/e08370a737e941de6f6492e3f427c2ef4c1a03 delete mode 100644 manage_externals/test/repos/container.git/refs/heads/master delete mode 100644 manage_externals/test/repos/error/readme.txt delete mode 100644 manage_externals/test/repos/mixed-cont-ext.git/HEAD delete mode 100644 manage_externals/test/repos/mixed-cont-ext.git/config delete mode 100644 manage_externals/test/repos/mixed-cont-ext.git/description delete mode 100644 manage_externals/test/repos/mixed-cont-ext.git/info/exclude delete mode 100644 manage_externals/test/repos/mixed-cont-ext.git/objects/00/437ac2000d5f06fb8a572a01a5bbdae98b17cb delete mode 100644 manage_externals/test/repos/mixed-cont-ext.git/objects/01/97458f2dbe5fcd6bc44fa46983be0a30282379 delete mode 100644 manage_externals/test/repos/mixed-cont-ext.git/objects/06/ea30b03ffa2f8574705f8b9583f7ca7e2dccf7 delete mode 100644 manage_externals/test/repos/mixed-cont-ext.git/objects/14/368b701616a8c53820b610414a4b9a07540cf6 delete mode 100644 manage_externals/test/repos/mixed-cont-ext.git/objects/15/2b57e1cf23721cd17ff681cb9276e3fb9fc091 delete mode 100644 manage_externals/test/repos/mixed-cont-ext.git/objects/1f/01fa46c17b1f38b37e6259f6e9d041bda3144f delete mode 100644 manage_externals/test/repos/mixed-cont-ext.git/objects/37/f0e70b609adc90f4c09ee21d82ed1d79c81d69 delete mode 100644 manage_externals/test/repos/mixed-cont-ext.git/objects/38/9a2b876b8965d3c91a3db8d28a483eaf019d5c delete mode 100644 manage_externals/test/repos/mixed-cont-ext.git/objects/41/1de5d96ee418c1c55f3e96e6e6e7c06bb95801 delete mode 100644 manage_externals/test/repos/mixed-cont-ext.git/objects/6e/9f4baa6e94a0af4e094836c2eb55ccedef5fc4 delete mode 100644 manage_externals/test/repos/mixed-cont-ext.git/objects/6f/c379457ecb4e576a13c7610ae1fa73f845ee6a delete mode 100644 manage_externals/test/repos/mixed-cont-ext.git/objects/93/a159deb9175bfeb2820a0006ddd92d78131332 delete mode 100644 manage_externals/test/repos/mixed-cont-ext.git/objects/95/80ecc12f16334ce44e42287d5d46f927bb7b75 delete mode 100644 manage_externals/test/repos/mixed-cont-ext.git/objects/a9/288dcd8a719a1f4ed3cba43a2a387ae7cd60fd delete mode 100644 manage_externals/test/repos/mixed-cont-ext.git/objects/e8/ea32a11d30ee703f6f661ae7c2376f4ab84d38 delete mode 100644 manage_externals/test/repos/mixed-cont-ext.git/objects/fd/15a5ad5204356229c60a831d2a8120a43ac901 delete mode 100644 manage_externals/test/repos/mixed-cont-ext.git/refs/heads/master delete mode 100644 manage_externals/test/repos/mixed-cont-ext.git/refs/heads/new-feature delete mode 100644 manage_externals/test/repos/simple-ext-fork.git/HEAD delete mode 100644 manage_externals/test/repos/simple-ext-fork.git/config delete mode 100644 manage_externals/test/repos/simple-ext-fork.git/description delete mode 100644 manage_externals/test/repos/simple-ext-fork.git/info/exclude delete mode 100644 manage_externals/test/repos/simple-ext-fork.git/objects/00/fd13e76189f9134b0506b4b8ed3172723b467f delete mode 100644 manage_externals/test/repos/simple-ext-fork.git/objects/0b/15e8af3d4615b42314216efeae3fff184046a8 delete mode 100644 manage_externals/test/repos/simple-ext-fork.git/objects/0b/67df4e7e8e6e1c6e401542738b352d18744677 delete mode 100644 manage_externals/test/repos/simple-ext-fork.git/objects/11/a76e3d9a67313dec7ce1230852ab5c86352c5c delete mode 100644 manage_externals/test/repos/simple-ext-fork.git/objects/16/5506a7408a482f50493434e13fffeb44af893f delete mode 100644 manage_externals/test/repos/simple-ext-fork.git/objects/24/4386e788c9bc608613e127a329c742450a60e4 delete mode 100644 manage_externals/test/repos/simple-ext-fork.git/objects/32/7e97d86e941047d809dba58f2804740c6c30cf delete mode 100644 manage_externals/test/repos/simple-ext-fork.git/objects/36/418b4e5665956a90725c9a1b5a8e551c5f3d48 delete mode 100644 manage_externals/test/repos/simple-ext-fork.git/objects/3d/7099c35404ae6c8640ce263b38bef06e98cc26 delete mode 100644 manage_externals/test/repos/simple-ext-fork.git/objects/3d/ec1fdf8e2f5edba28148c5db2fe8d7a842360b delete mode 100644 manage_externals/test/repos/simple-ext-fork.git/objects/41/1de5d96ee418c1c55f3e96e6e6e7c06bb95801 delete mode 100644 manage_externals/test/repos/simple-ext-fork.git/objects/4d/837135915ed93eed6fff6b439f284ce317296f delete mode 100644 manage_externals/test/repos/simple-ext-fork.git/objects/56/175e017ad38bf3d33d74b6bd7c74624b28466a delete mode 100644 manage_externals/test/repos/simple-ext-fork.git/objects/5f/1d4786d12e52d7ab28d2f2f1118c1059a9f1ae delete mode 100644 manage_externals/test/repos/simple-ext-fork.git/objects/67/136e5ab4d5c1c65d10c8048763b96b0e53c1d6 delete mode 100644 manage_externals/test/repos/simple-ext-fork.git/objects/7b/0bd630ac13865735a1dff3437a137d8ab50663 delete mode 100644 manage_externals/test/repos/simple-ext-fork.git/objects/88/cf20868e0cc445f5642a480ed034c71e0d7e9f delete mode 100644 manage_externals/test/repos/simple-ext-fork.git/objects/8d/2b3b35126224c975d23f109aa1e3cbac452989 delete mode 100644 manage_externals/test/repos/simple-ext-fork.git/objects/9b/75494003deca69527bb64bcaa352e801611dd2 delete mode 100644 manage_externals/test/repos/simple-ext-fork.git/objects/a2/2a5da9119328ea6d693f88861457c07e14ac04 delete mode 100644 manage_externals/test/repos/simple-ext-fork.git/objects/a4/2fe9144f5707bc1e9515ce1b44681f7aba6f95 delete mode 100644 manage_externals/test/repos/simple-ext-fork.git/objects/b9/3737be3ea6b19f6255983748a0a0f4d622f936 delete mode 100644 manage_externals/test/repos/simple-ext-fork.git/objects/c5/32bc8fde96fa63103a52057f0baffcc9f00c6b delete mode 100644 manage_externals/test/repos/simple-ext-fork.git/objects/c5/b315915742133dbdfbeed0753e481b55c1d364 delete mode 100644 manage_externals/test/repos/simple-ext-fork.git/objects/f2/68d4e56d067da9bd1d85e55bdc40a8bd2b0bca delete mode 100644 manage_externals/test/repos/simple-ext-fork.git/packed-refs delete mode 100644 manage_externals/test/repos/simple-ext-fork.git/refs/heads/feature2 delete mode 100644 manage_externals/test/repos/simple-ext-fork.git/refs/tags/abandoned-feature delete mode 100644 manage_externals/test/repos/simple-ext-fork.git/refs/tags/forked-feature-v1 delete mode 100644 manage_externals/test/repos/simple-ext.git/HEAD delete mode 100644 manage_externals/test/repos/simple-ext.git/config delete mode 100644 manage_externals/test/repos/simple-ext.git/description delete mode 100644 manage_externals/test/repos/simple-ext.git/info/exclude delete mode 100644 manage_externals/test/repos/simple-ext.git/objects/00/fd13e76189f9134b0506b4b8ed3172723b467f delete mode 100644 manage_externals/test/repos/simple-ext.git/objects/09/0e1034746b2c865f7b0280813dbf4061a700e8 delete mode 100644 manage_externals/test/repos/simple-ext.git/objects/0b/15e8af3d4615b42314216efeae3fff184046a8 delete mode 100644 manage_externals/test/repos/simple-ext.git/objects/11/a76e3d9a67313dec7ce1230852ab5c86352c5c delete mode 100644 manage_externals/test/repos/simple-ext.git/objects/14/2711fdbbcb8034d7cad6bae6801887b12fe61d delete mode 100644 manage_externals/test/repos/simple-ext.git/objects/31/dbcd6de441e671a467ef317146539b7ffabb11 delete mode 100644 manage_externals/test/repos/simple-ext.git/objects/36/418b4e5665956a90725c9a1b5a8e551c5f3d48 delete mode 100644 manage_externals/test/repos/simple-ext.git/objects/41/1de5d96ee418c1c55f3e96e6e6e7c06bb95801 delete mode 100644 manage_externals/test/repos/simple-ext.git/objects/60/7ec299c17dd285c029edc41a0109e49d441380 delete mode 100644 manage_externals/test/repos/simple-ext.git/objects/60/b1cc1a38d63a4bcaa1e767262bbe23dbf9f5f5 delete mode 100644 manage_externals/test/repos/simple-ext.git/objects/63/a99393d1baff97ccef967af30380659867b139 delete mode 100644 manage_externals/test/repos/simple-ext.git/objects/95/3256da5612fcd9263590a353bc18c6f224e74f delete mode 100644 manage_externals/test/repos/simple-ext.git/objects/9b/75494003deca69527bb64bcaa352e801611dd2 delete mode 100644 manage_externals/test/repos/simple-ext.git/objects/a2/2a5da9119328ea6d693f88861457c07e14ac04 delete mode 100644 manage_externals/test/repos/simple-ext.git/objects/b7/692b6d391899680da7b9b6fd8af4c413f06fe7 delete mode 100644 manage_externals/test/repos/simple-ext.git/objects/c5/b315915742133dbdfbeed0753e481b55c1d364 delete mode 100644 manage_externals/test/repos/simple-ext.git/objects/d1/163870d19c3dee34fada3a76b785cfa2a8424b delete mode 100644 manage_externals/test/repos/simple-ext.git/objects/d8/ed2f33179d751937f8fde2e33921e4827babf4 delete mode 100644 manage_externals/test/repos/simple-ext.git/objects/df/312890f93ba4d2c694208599b665c4a08afeff delete mode 100644 manage_externals/test/repos/simple-ext.git/refs/heads/feature2 delete mode 100644 manage_externals/test/repos/simple-ext.git/refs/heads/feature3 delete mode 100644 manage_externals/test/repos/simple-ext.git/refs/heads/master delete mode 100644 manage_externals/test/repos/simple-ext.git/refs/tags/tag1 delete mode 100644 manage_externals/test/repos/simple-ext.git/refs/tags/tag2 delete mode 100644 manage_externals/test/repos/simple-ext.svn/README.txt delete mode 100644 manage_externals/test/repos/simple-ext.svn/conf/authz delete mode 100644 manage_externals/test/repos/simple-ext.svn/conf/hooks-env.tmpl delete mode 100644 manage_externals/test/repos/simple-ext.svn/conf/passwd delete mode 100644 manage_externals/test/repos/simple-ext.svn/conf/svnserve.conf delete mode 100644 manage_externals/test/repos/simple-ext.svn/db/current delete mode 100644 manage_externals/test/repos/simple-ext.svn/db/format delete mode 100644 manage_externals/test/repos/simple-ext.svn/db/fs-type delete mode 100644 manage_externals/test/repos/simple-ext.svn/db/fsfs.conf delete mode 100644 manage_externals/test/repos/simple-ext.svn/db/min-unpacked-rev delete mode 100644 manage_externals/test/repos/simple-ext.svn/db/rep-cache.db delete mode 100644 manage_externals/test/repos/simple-ext.svn/db/rep-cache.db-journal delete mode 100644 manage_externals/test/repos/simple-ext.svn/db/revprops/0/0 delete mode 100644 manage_externals/test/repos/simple-ext.svn/db/revprops/0/1 delete mode 100644 manage_externals/test/repos/simple-ext.svn/db/revprops/0/2 delete mode 100644 manage_externals/test/repos/simple-ext.svn/db/revprops/0/3 delete mode 100644 manage_externals/test/repos/simple-ext.svn/db/revs/0/0 delete mode 100644 manage_externals/test/repos/simple-ext.svn/db/revs/0/1 delete mode 100644 manage_externals/test/repos/simple-ext.svn/db/revs/0/2 delete mode 100644 manage_externals/test/repos/simple-ext.svn/db/revs/0/3 delete mode 100644 manage_externals/test/repos/simple-ext.svn/db/txn-current delete mode 100644 manage_externals/test/repos/simple-ext.svn/db/txn-current-lock delete mode 100644 manage_externals/test/repos/simple-ext.svn/db/uuid delete mode 100644 manage_externals/test/repos/simple-ext.svn/db/write-lock delete mode 100644 manage_externals/test/repos/simple-ext.svn/format delete mode 100755 manage_externals/test/repos/simple-ext.svn/hooks/post-commit.tmpl delete mode 100755 manage_externals/test/repos/simple-ext.svn/hooks/post-lock.tmpl delete mode 100755 manage_externals/test/repos/simple-ext.svn/hooks/post-revprop-change.tmpl delete mode 100755 manage_externals/test/repos/simple-ext.svn/hooks/post-unlock.tmpl delete mode 100755 manage_externals/test/repos/simple-ext.svn/hooks/pre-commit.tmpl delete mode 100755 manage_externals/test/repos/simple-ext.svn/hooks/pre-lock.tmpl delete mode 100755 manage_externals/test/repos/simple-ext.svn/hooks/pre-revprop-change.tmpl delete mode 100755 manage_externals/test/repos/simple-ext.svn/hooks/pre-unlock.tmpl delete mode 100755 manage_externals/test/repos/simple-ext.svn/hooks/start-commit.tmpl delete mode 100644 manage_externals/test/repos/simple-ext.svn/locks/db-logs.lock delete mode 100644 manage_externals/test/repos/simple-ext.svn/locks/db.lock delete mode 100644 manage_externals/test/requirements.txt delete mode 100755 manage_externals/test/test_sys_checkout.py delete mode 100644 manage_externals/test/test_sys_repository_git.py delete mode 100644 manage_externals/test/test_unit_externals_description.py delete mode 100644 manage_externals/test/test_unit_externals_status.py delete mode 100644 manage_externals/test/test_unit_repository.py delete mode 100644 manage_externals/test/test_unit_repository_git.py delete mode 100755 manage_externals/test/test_unit_repository_svn.py delete mode 100644 manage_externals/test/test_unit_utils.py diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 7c9512c9c3..c4a381383b 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -16,7 +16,7 @@ Testing performed, if any: (List what testing you did to show your changes worked as expected) (This can be manual testing or running of the different test suites) (Documentation on system testing is here: https://github.com/ESCOMP/ctsm/wiki/System-Testing-Guide) -(aux_clm on cheyenne for intel/gnu and izumi for intel/gnu/nag/pgi is the standard for tags on master) +(aux_clm on derecho for intel/gnu and izumi for intel/gnu/nag/nvhpc is the standard for tags on master) **NOTE: Be sure to check your coding style against the standard (https://github.com/ESCOMP/ctsm/wiki/CTSM-coding-guidelines) and review diff --git a/Externals.cfg b/Externals.cfg deleted file mode 100644 index 70d103a94b..0000000000 --- a/Externals.cfg +++ /dev/null @@ -1,94 +0,0 @@ -[clm] -local_path = . -protocol = externals_only -externals = Externals_CLM.cfg -required = True - -[cism] -local_path = components/cism -protocol = git -repo_url = https://github.com/ESCOMP/CISM-wrapper -tag = cismwrap_2_1_100 -externals = Externals_CISM.cfg -required = True - -[rtm] -local_path = components/rtm -protocol = git -repo_url = https://github.com/ESCOMP/RTM -tag = rtm1_0_79 -required = True - -[mosart] -local_path = components/mosart -protocol = git -repo_url = https://github.com/ESCOMP/MOSART -tag = mosart1_0_49 -required = True - -[mizuRoute] -tag = cesm-coupling.n02_v2.1.2 -protocol = git -local_path = components/mizuroute -repo_url = https://github.com/ESCOMP/mizuRoute -required = True - -[ccs_config] -tag = ccs_config_cesm0.0.106 -protocol = git -repo_url = https://github.com/ESMCI/ccs_config_cesm.git -local_path = ccs_config -required = True - -[cime] -local_path = cime -protocol = git -repo_url = https://github.com/ESMCI/cime -tag = cime6.0.238_httpsbranch01 -required = True - -[cmeps] -tag = cmeps0.14.63 -protocol = git -repo_url = https://github.com/ESCOMP/CMEPS.git -local_path = components/cmeps -required = True - -[cdeps] -tag = cdeps1.0.33 -protocol = git -repo_url = https://github.com/ESCOMP/CDEPS.git -local_path = components/cdeps -externals = Externals_CDEPS.cfg -required = True - -[share] -tag = share1.0.18 -protocol = git -repo_url = https://github.com/ESCOMP/CESM_share -local_path = share -required = True - -[mct] -tag = MCT_2.11.0 -protocol = git -repo_url = https://github.com/MCSclimate/MCT -local_path = libraries/mct -required = True - -[parallelio] -tag = pio2_6_2 -protocol = git -repo_url = https://github.com/NCAR/ParallelIO -local_path = libraries/parallelio -required = True - -[doc-builder] -local_path = doc/doc-builder -protocol = git -repo_url = https://github.com/ESMCI/doc-builder -tag = v1.0.8 -required = False - -[externals_description] -schema_version = 1.0.0 diff --git a/Externals_CLM.cfg b/Externals_CLM.cfg deleted file mode 100644 index 866b9ac5b2..0000000000 --- a/Externals_CLM.cfg +++ /dev/null @@ -1,9 +0,0 @@ -[fates] -local_path = src/fates -protocol = git -repo_url = https://github.com/NGEET/fates -tag = sci.1.73.0_api.35.0.0 -required = True - -[externals_description] -schema_version = 1.0.0 diff --git a/README b/README index af45a14909..0f1a38edf3 100644 --- a/README +++ b/README @@ -49,7 +49,7 @@ src --------------- CTSM Source code. lilac ------------- Lightweight Infrastructure for Land-Atmosphere Coupling (for coupling to a host atmosphere model) tools ------------- CTSM Offline tools to prepare input datasets and process output. cime_config ------- Configuration files of cime for compsets and CTSM settings -manage_externals -- Script to manage the external source directories (deprecated) +bin/git-fleximod -- Script to manage the external source directories py_env_create ----- Script to setup the python environment for CTSM python tools using conda python ------------ Python modules used in tools and testing and automated checking of ALL CTSM python scirpts @@ -73,7 +73,6 @@ Top level documentation ($CTSMROOT): 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_EXTERNALS.rst ----- Information on how to work with manage_externals for CTSM (deprecated) 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 @@ -97,9 +96,6 @@ bld/namelist_files/namelist_defaults_ctsm.xml ----- Default values Important files in main directories (under $CTSMROOT): ============================================================================================= -Externals.cfg --------------- File for management of the main high level external (deprecated) -Externals_CLM.cfg ----------- File for management of the CTSM specific externals (i.e. FATES) - run_sys_tests --------------- Python script to send the standard CTSM testing off (submits the create_test test suite for several different compilers on the machines we do standard CTSM testing on). diff --git a/manage_externals/.dir_locals.el b/manage_externals/.dir_locals.el deleted file mode 100644 index a370490e92..0000000000 --- a/manage_externals/.dir_locals.el +++ /dev/null @@ -1,12 +0,0 @@ -; -*- mode: Lisp -*- - -((python-mode - . ( - ;; fill the paragraph to 80 columns when using M-q - (fill-column . 80) - - ;; Use 4 spaces to indent in Python - (python-indent-offset . 4) - (indent-tabs-mode . nil) - ))) - diff --git a/manage_externals/.github/ISSUE_TEMPLATE.md b/manage_externals/.github/ISSUE_TEMPLATE.md deleted file mode 100644 index 8ecb2ae64b..0000000000 --- a/manage_externals/.github/ISSUE_TEMPLATE.md +++ /dev/null @@ -1,6 +0,0 @@ -### Summary of Issue: -### Expected behavior and actual behavior: -### Steps to reproduce the problem (should include model description file(s) or link to publi c repository): -### What is the changeset ID of the code, and the machine you are using: -### have you modified the code? If so, it must be committed and available for testing: -### Screen output or log file showing the error message and context: diff --git a/manage_externals/.github/PULL_REQUEST_TEMPLATE.md b/manage_externals/.github/PULL_REQUEST_TEMPLATE.md deleted file mode 100644 index b68b1fb5e2..0000000000 --- a/manage_externals/.github/PULL_REQUEST_TEMPLATE.md +++ /dev/null @@ -1,17 +0,0 @@ -[ 50 character, one line summary ] - -[ Description of the changes in this commit. It should be enough - information for someone not following this development to understand. - Lines should be wrapped at about 72 characters. ] - -User interface changes?: [ No/Yes ] -[ If yes, describe what changed, and steps taken to ensure backward compatibilty ] - -Fixes: [Github issue #s] And brief description of each issue. - -Testing: - test removed: - unit tests: - system tests: - manual testing: - diff --git a/manage_externals/.github/workflows/bumpversion.yml b/manage_externals/.github/workflows/bumpversion.yml deleted file mode 100644 index f4dc9b7ca5..0000000000 --- a/manage_externals/.github/workflows/bumpversion.yml +++ /dev/null @@ -1,19 +0,0 @@ -name: Bump version -on: - push: - branches: - - main -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Bump version and push tag - id: tag_version - uses: mathieudutour/github-tag-action@v5.5 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - create_annotated_tag: true - default_bump: patch - dry_run: false - tag_prefix: manic- diff --git a/manage_externals/.github/workflows/tests.yml b/manage_externals/.github/workflows/tests.yml deleted file mode 100644 index dd75b91b49..0000000000 --- a/manage_externals/.github/workflows/tests.yml +++ /dev/null @@ -1,30 +0,0 @@ -# This is a workflow to compile the cmeps source without cime -name: Test Manic - -# Controls when the action will run. Triggers the workflow on push or pull request -# events but only for the master branch -on: - push: - branches: [ main ] - pull_request: - branches: [ main ] - -# A workflow run is made up of one or more jobs that can run sequentially or in parallel -jobs: - test-manic: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Test Manic - run: | - pushd test - git config --global user.email "devnull@example.com" - git config --global user.name "GITHUB tester" - git config --global protocol.file.allow always - make utest - make stest - popd - - - name: Setup tmate session - if: ${{ failure() }} - uses: mxschmitt/action-tmate@v3 diff --git a/manage_externals/.gitignore b/manage_externals/.gitignore deleted file mode 100644 index a71ac0cd75..0000000000 --- a/manage_externals/.gitignore +++ /dev/null @@ -1,17 +0,0 @@ -# directories that are checked out by the tool -cime/ -cime_config/ -components/ - -# generated local files -*.log - -# editor files -*~ -*.bak - -# generated python files -*.pyc - -# test tmp file -test/tmp diff --git a/manage_externals/.travis.yml b/manage_externals/.travis.yml deleted file mode 100644 index d9b24c584d..0000000000 --- a/manage_externals/.travis.yml +++ /dev/null @@ -1,18 +0,0 @@ -language: python -os: linux -python: - - "3.4" - - "3.5" - - "3.6" - - "3.7" - - "3.8" -install: - - pip install -r test/requirements.txt -before_script: - - git --version -script: - - cd test; make test - - cd test; make lint -after_success: - - cd test; make coverage - - cd test; coveralls diff --git a/manage_externals/LICENSE.txt b/manage_externals/LICENSE.txt deleted file mode 100644 index 665ee03fbc..0000000000 --- a/manage_externals/LICENSE.txt +++ /dev/null @@ -1,34 +0,0 @@ -Copyright (c) 2017-2018, University Corporation for Atmospheric Research (UCAR) -All rights reserved. - -Developed by: - University Corporation for Atmospheric Research - National Center for Atmospheric Research - https://www2.cesm.ucar.edu/working-groups/sewg - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the "Software"), -to deal with the Software without restriction, including without limitation -the rights to use, copy, modify, merge, publish, distribute, sublicense, -and/or sell copies of the Software, and to permit persons to whom -the Software is furnished to do so, subject to the following conditions: - - - Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimers. - - Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimers in the documentation - and/or other materials provided with the distribution. - - Neither the names of [Name of Development Group, UCAR], - nor the names of its contributors may be used to endorse or promote - products derived from this Software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. diff --git a/manage_externals/README.md b/manage_externals/README.md deleted file mode 100644 index 9475301b5d..0000000000 --- a/manage_externals/README.md +++ /dev/null @@ -1,231 +0,0 @@ --- AUTOMATICALLY GENERATED FILE. DO NOT EDIT -- - -[![Build Status](https://travis-ci.org/ESMCI/manage_externals.svg?branch=master)](https://travis-ci.org/ESMCI/manage_externals)[![Coverage Status](https://coveralls.io/repos/github/ESMCI/manage_externals/badge.svg?branch=master)](https://coveralls.io/github/ESMCI/manage_externals?branch=master) -``` -usage: checkout_externals [-h] [-e [EXTERNALS]] [-o] [-S] [-v] [--backtrace] - [-d] [--no-logging] - -checkout_externals manages checking out groups of externals from revision -control based on a externals description file. By default only the -required externals are checkout out. - -Operations performed by manage_externals utilities are explicit and -data driven. checkout_externals will always make the working copy *exactly* -match what is in the externals file when modifying the working copy of -a repository. - -If checkout_externals isn't doing what you expected, double check the contents -of the externals description file. - -Running checkout_externals without the '--status' option will always attempt to -synchronize the working copy to exactly match the externals description. - -optional arguments: - -h, --help show this help message and exit - -e [EXTERNALS], --externals [EXTERNALS] - The externals description filename. Default: - Externals.cfg. - -o, --optional By default only the required externals are checked - out. This flag will also checkout the optional - externals. - -S, --status Output status of the repositories managed by - checkout_externals. By default only summary - information is provided. Use verbose output to see - details. - -v, --verbose Output additional information to the screen and log - file. This flag can be used up to two times, - increasing the verbosity level each time. - --backtrace DEVELOPER: show exception backtraces as extra - debugging output - -d, --debug DEVELOPER: output additional debugging information to - the screen and log file. - --no-logging DEVELOPER: disable logging. - -``` -NOTE: checkout_externals *MUST* be run from the root of the source tree it -is managing. For example, if you cloned a repository with: - - $ git clone git@github.com/{SOME_ORG}/some-project some-project-dev - -Then the root of the source tree is /path/to/some-project-dev. If you -obtained a sub-project via a checkout of another project: - - $ git clone git@github.com/{SOME_ORG}/some-project some-project-dev - -and you need to checkout the sub-project externals, then the root of the -source tree is /path/to/some-project-dev. Do *NOT* run checkout_externals -from within /path/to/some-project-dev/sub-project - -The root of the source tree will be referred to as `${SRC_ROOT}` below. - -# Supported workflows - - * Checkout all required components from the default externals - description file: - - $ cd ${SRC_ROOT} - $ ./manage_externals/checkout_externals - - * To update all required components to the current values in the - externals description file, re-run checkout_externals: - - $ cd ${SRC_ROOT} - $ ./manage_externals/checkout_externals - - If there are *any* modifications to *any* working copy according - to the git or svn 'status' command, checkout_externals - will not update any external repositories. Modifications - include: modified files, added files, removed files, or missing - files. - - To avoid this safety check, edit the externals description file - and comment out the modified external block. - - * Checkout all required components from a user specified externals - description file: - - $ cd ${SRC_ROOT} - $ ./manage_externals/checkout_externals --externals my-externals.cfg - - * Status summary of the repositories managed by checkout_externals: - - $ cd ${SRC_ROOT} - $ ./manage_externals/checkout_externals --status - - ./cime - s ./components/cism - ./components/mosart - e-o ./components/rtm - M ./src/fates - e-o ./tools/PTCLM - - where: - * column one indicates the status of the repository in relation - to the externals description file. - * column two indicates whether the working copy has modified files. - * column three shows how the repository is managed, optional or required - - Column one will be one of these values: - * s : out-of-sync : repository is checked out at a different commit - compared with the externals description - * e : empty : directory does not exist - checkout_externals has not been run - * ? : unknown : directory exists but .git or .svn directories are missing - - Column two will be one of these values: - * M : Modified : modified, added, deleted or missing files - * : blank / space : clean - * - : dash : no meaningful state, for empty repositories - - Column three will be one of these values: - * o : optional : optionally repository - * : blank / space : required repository - - * Detailed git or svn status of the repositories managed by checkout_externals: - - $ cd ${SRC_ROOT} - $ ./manage_externals/checkout_externals --status --verbose - -# Externals description file - - The externals description contains a list of the external - repositories that are used and their version control locations. The - file format is the standard ini/cfg configuration file format. Each - external is defined by a section containing the component name in - square brackets: - - * name (string) : component name, e.g. [cime], [cism], etc. - - Each section has the following keyword-value pairs: - - * required (boolean) : whether the component is a required checkout, - 'true' or 'false'. - - * local_path (string) : component path *relative* to where - checkout_externals is called. - - * protoctol (string) : version control protocol that is used to - manage the component. Valid values are 'git', 'svn', - 'externals_only'. - - Switching an external between different protocols is not - supported, e.g. from svn to git. To switch protocols, you need to - manually move the old working copy to a new location. - - Note: 'externals_only' will only process the external's own - external description file without trying to manage a repository - for the component. This is used for retreiving externals for - standalone components like cam and clm. If the source root of the - externals_only component is the same as the main source root, then - the local path must be set to '.', the unix current working - directory, e. g. 'local_path = .' - - * repo_url (string) : URL for the repository location, examples: - * https://svn-ccsm-models.cgd.ucar.edu/glc - * git@github.com:esmci/cime.git - * /path/to/local/repository - * . - - NOTE: To operate on only the local clone and and ignore remote - repositories, set the url to '.' (the unix current path), - i.e. 'repo_url = .' . This can be used to checkout a local branch - instead of the upstream branch. - - If a repo url is determined to be a local path (not a network url) - then user expansion, e.g. ~/, and environment variable expansion, - e.g. $HOME or $REPO_ROOT, will be performed. - - Relative paths are difficult to get correct, especially for mixed - use repos. It is advised that local paths expand to absolute paths. - If relative paths are used, they should be relative to one level - above local_path. If local path is 'src/foo', the the relative url - should be relative to 'src'. - - * tag (string) : tag to checkout - - * hash (string) : the git hash to checkout. Only applies to git - repositories. - - * branch (string) : branch to checkout from the specified - repository. Specifying a branch on a remote repository means that - checkout_externals will checkout the version of the branch in the remote, - not the the version in the local repository (if it exists). - - Note: one and only one of tag, branch hash must be supplied. - - * externals (string) : used to make manage_externals aware of - sub-externals required by an external. This is a relative path to - the external's root directory. For example, the main externals - description has an external checkout out at 'src/useful_library'. - useful_library requires additional externals to be complete. - Those additional externals are managed from the source root by the - externals description file pointed 'useful_library/sub-xternals.cfg', - Then the main 'externals' field in the top level repo should point to - 'sub-externals.cfg'. - Note that by default, `checkout_externals` will clone an external's - submodules. As a special case, the entry, `externals = None`, will - prevent this behavior. For more control over which externals are - checked out, create an externals file (and see the `from_submodule` - configuration entry below). - - * from_submodule (True / False) : used to pull the repo_url, local_path, - and hash properties for this external from the .gitmodules file in - this repository. Note that the section name (the entry in square - brackets) must match the name in the .gitmodules file. - If from_submodule is True, the protocol must be git and no repo_url, - local_path, hash, branch, or tag entries are allowed. - Default: False - - * sparse (string) : used to control a sparse checkout. This optional - entry should point to a filename (path relative to local_path) that - contains instructions on which repository paths to include (or - exclude) from the working tree. - See the "SPARSE CHECKOUT" section of https://git-scm.com/docs/git-read-tree - Default: sparse checkout is disabled - - * Lines begining with '#' or ';' are comments and will be ignored. - -# Obtaining this tool, reporting issues, etc. - - The master repository for manage_externals is - https://github.com/ESMCI/manage_externals. Any issues with this tool - should be reported there. diff --git a/manage_externals/README_FIRST b/manage_externals/README_FIRST deleted file mode 100644 index c8a47d7806..0000000000 --- a/manage_externals/README_FIRST +++ /dev/null @@ -1,54 +0,0 @@ -CESM is comprised of a number of different components that are -developed and managed independently. Each component may have -additional 'external' dependancies and optional parts that are also -developed and managed independently. - -The checkout_externals.py tool manages retreiving and updating the -components and their externals so you have a complete set of source -files for the model. - -checkout_externals.py relies on a model description file that -describes what components are needed, where to find them and where to -put them in the source tree. The default file is called "CESM.xml" -regardless of whether you are checking out CESM or a standalone -component. - -checkout_externals requires access to git and svn repositories that -require authentication. checkout_externals may pass through -authentication requests, but it will not cache them for you. For the -best and most robust user experience, you should have svn and git -working without password authentication. See: - - https://help.github.com/articles/connecting-to-github-with-ssh/ - - ?svn ref? - -NOTE: checkout_externals.py *MUST* be run from the root of the source -tree it is managing. For example, if you cloned CLM with: - - $ git clone git@github.com/ncar/clm clm-dev - -Then the root of the source tree is /path/to/cesm-dev. If you obtained -CLM via an svn checkout of CESM and you need to checkout the CLM -externals, then the root of the source tree for CLM is: - - /path/to/cesm-dev/components/clm - -The root of the source tree will be referred to as ${SRC_ROOT} below. - -To get started quickly, checkout all required components from the -default model description file: - - $ cd ${SRC_ROOT} - $ ./checkout_cesm/checkout_externals.py - -For additional information about using checkout model, please see: - - ${SRC_ROOT}/checkout_cesm/README - -or run: - - $ cd ${SRC_ROOT} - $ ./checkout_cesm/checkout_externals.py --help - - diff --git a/manage_externals/checkout_externals b/manage_externals/checkout_externals deleted file mode 100755 index 48bce24010..0000000000 --- a/manage_externals/checkout_externals +++ /dev/null @@ -1,36 +0,0 @@ -#!/usr/bin/env python3 - -"""Main driver wrapper around the manic/checkout utility. - -Tool to assemble external respositories represented in an externals -description file. - -""" -from __future__ import absolute_import -from __future__ import unicode_literals -from __future__ import print_function - -import sys -import traceback - -import manic - -if sys.hexversion < 0x02070000: - print(70 * '*') - print('ERROR: {0} requires python >= 2.7.x. '.format(sys.argv[0])) - print('It appears that you are running python {0}'.format( - '.'.join(str(x) for x in sys.version_info[0:3]))) - print(70 * '*') - sys.exit(1) - - -if __name__ == '__main__': - ARGS = manic.checkout.commandline_arguments() - try: - RET_STATUS, _ = manic.checkout.main(ARGS) - sys.exit(RET_STATUS) - except Exception as error: # pylint: disable=broad-except - manic.printlog(str(error)) - if ARGS.backtrace: - traceback.print_exc() - sys.exit(1) diff --git a/manage_externals/manic/__init__.py b/manage_externals/manic/__init__.py deleted file mode 100644 index 11badedd3b..0000000000 --- a/manage_externals/manic/__init__.py +++ /dev/null @@ -1,9 +0,0 @@ -"""Public API for the manage_externals library -""" - -from manic import checkout -from manic.utils import printlog - -__all__ = [ - 'checkout', 'printlog', -] diff --git a/manage_externals/manic/checkout.py b/manage_externals/manic/checkout.py deleted file mode 100755 index 3f5537adce..0000000000 --- a/manage_externals/manic/checkout.py +++ /dev/null @@ -1,446 +0,0 @@ -#!/usr/bin/env python3 - -""" -Tool to assemble repositories represented in a model-description file. - -If loaded as a module (e.g., in a component's buildcpp), it can be used -to check the validity of existing subdirectories and load missing sources. -""" -from __future__ import absolute_import -from __future__ import unicode_literals -from __future__ import print_function - -import argparse -import logging -import os -import os.path -import sys - -from manic.externals_description import create_externals_description -from manic.externals_description import read_externals_description_file -from manic.externals_status import check_safe_to_update_repos -from manic.sourcetree import SourceTree -from manic.utils import printlog, fatal_error -from manic.global_constants import VERSION_SEPERATOR, LOG_FILE_NAME - -if sys.hexversion < 0x02070000: - print(70 * '*') - print('ERROR: {0} requires python >= 2.7.x. '.format(sys.argv[0])) - print('It appears that you are running python {0}'.format( - VERSION_SEPERATOR.join(str(x) for x in sys.version_info[0:3]))) - print(70 * '*') - sys.exit(1) - - -# --------------------------------------------------------------------- -# -# User input -# -# --------------------------------------------------------------------- -def commandline_arguments(args=None): - """Process the command line arguments - - Params: args - optional args. Should only be used during systems - testing. - - Returns: processed command line arguments - """ - description = ''' - -%(prog)s manages checking out groups of externals from revision -control based on an externals description file. By default only the -required externals are checkout out. - -Running %(prog)s without the '--status' option will always attempt to -synchronize the working copy to exactly match the externals description. -''' - - epilog = ''' -``` -NOTE: %(prog)s *MUST* be run from the root of the source tree it -is managing. For example, if you cloned a repository with: - - $ git clone git@github.com/{SOME_ORG}/some-project some-project-dev - -Then the root of the source tree is /path/to/some-project-dev. If you -obtained a sub-project via a checkout of another project: - - $ git clone git@github.com/{SOME_ORG}/some-project some-project-dev - -and you need to checkout the sub-project externals, then the root of the -source tree remains /path/to/some-project-dev. Do *NOT* run %(prog)s -from within /path/to/some-project-dev/sub-project - -The root of the source tree will be referred to as `${SRC_ROOT}` below. - - -# Supported workflows - - * Checkout all required components from the default externals - description file: - - $ cd ${SRC_ROOT} - $ ./manage_externals/%(prog)s - - * To update all required components to the current values in the - externals description file, re-run %(prog)s: - - $ cd ${SRC_ROOT} - $ ./manage_externals/%(prog)s - - If there are *any* modifications to *any* working copy according - to the git or svn 'status' command, %(prog)s - will not update any external repositories. Modifications - include: modified files, added files, removed files, or missing - files. - - To avoid this safety check, edit the externals description file - and comment out the modified external block. - - * Checkout all required components from a user specified externals - description file: - - $ cd ${SRC_ROOT} - $ ./manage_externals/%(prog)s --externals my-externals.cfg - - * Status summary of the repositories managed by %(prog)s: - - $ cd ${SRC_ROOT} - $ ./manage_externals/%(prog)s --status - - ./cime - s ./components/cism - ./components/mosart - e-o ./components/rtm - M ./src/fates - e-o ./tools/PTCLM - - - where: - * column one indicates the status of the repository in relation - to the externals description file. - * column two indicates whether the working copy has modified files. - * column three shows how the repository is managed, optional or required - - Column one will be one of these values: - * s : out-of-sync : repository is checked out at a different commit - compared with the externals description - * e : empty : directory does not exist - %(prog)s has not been run - * ? : unknown : directory exists but .git or .svn directories are missing - - Column two will be one of these values: - * M : Modified : modified, added, deleted or missing files - * : blank / space : clean - * - : dash : no meaningful state, for empty repositories - - Column three will be one of these values: - * o : optional : optionally repository - * : blank / space : required repository - - * Detailed git or svn status of the repositories managed by %(prog)s: - - $ cd ${SRC_ROOT} - $ ./manage_externals/%(prog)s --status --verbose - -# Externals description file - - The externals description contains a list of the external - repositories that are used and their version control locations. The - file format is the standard ini/cfg configuration file format. Each - external is defined by a section containing the component name in - square brackets: - - * name (string) : component name, e.g. [cime], [cism], etc. - - Each section has the following keyword-value pairs: - - * required (boolean) : whether the component is a required checkout, - 'true' or 'false'. - - * local_path (string) : component path *relative* to where - %(prog)s is called. - - * protoctol (string) : version control protocol that is used to - manage the component. Valid values are 'git', 'svn', - 'externals_only'. - - Switching an external between different protocols is not - supported, e.g. from svn to git. To switch protocols, you need to - manually move the old working copy to a new location. - - Note: 'externals_only' will only process the external's own - external description file without trying to manage a repository - for the component. This is used for retrieving externals for - standalone components like cam and ctsm which also serve as - sub-components within a larger project. If the source root of the - externals_only component is the same as the main source root, then - the local path must be set to '.', the unix current working - directory, e. g. 'local_path = .' - - * repo_url (string) : URL for the repository location, examples: - * https://svn-ccsm-models.cgd.ucar.edu/glc - * git@github.com:esmci/cime.git - * /path/to/local/repository - * . - - NOTE: To operate on only the local clone and and ignore remote - repositories, set the url to '.' (the unix current path), - i.e. 'repo_url = .' . This can be used to checkout a local branch - instead of the upstream branch. - - If a repo url is determined to be a local path (not a network url) - then user expansion, e.g. ~/, and environment variable expansion, - e.g. $HOME or $REPO_ROOT, will be performed. - - Relative paths are difficult to get correct, especially for mixed - use repos. It is advised that local paths expand to absolute paths. - If relative paths are used, they should be relative to one level - above local_path. If local path is 'src/foo', the the relative url - should be relative to 'src'. - - * tag (string) : tag to checkout - - * hash (string) : the git hash to checkout. Only applies to git - repositories. - - * branch (string) : branch to checkout from the specified - repository. Specifying a branch on a remote repository means that - %(prog)s will checkout the version of the branch in the remote, - not the the version in the local repository (if it exists). - - Note: one and only one of tag, branch hash must be supplied. - - * externals (string) : used to make manage_externals aware of - sub-externals required by an external. This is a relative path to - the external's root directory. For example, if LIBX is often used - as a sub-external, it might have an externals file (for its - externals) called Externals_LIBX.cfg. To use libx as a standalone - checkout, it would have another file, Externals.cfg with the - following entry: - - [ libx ] - local_path = . - protocol = externals_only - externals = Externals_LIBX.cfg - required = True - - Now, %(prog)s will process Externals.cfg and also process - Externals_LIBX.cfg as if it was a sub-external. - - Note that by default, checkout_externals will clone an external's - submodules. As a special case, the entry, "externals = None", will - prevent this behavior. For more control over which externals are - checked out, create an externals file (and see the from_submodule - configuration entry below). - - * from_submodule (True / False) : used to pull the repo_url, local_path, - and hash properties for this external from the .gitmodules file in - this repository. Note that the section name (the entry in square - brackets) must match the name in the .gitmodules file. - If from_submodule is True, the protocol must be git and no repo_url, - local_path, hash, branch, or tag entries are allowed. - Default: False - - * sparse (string) : used to control a sparse checkout. This optional - entry should point to a filename (path relative to local_path) that - contains instructions on which repository paths to include (or - exclude) from the working tree. - See the "SPARSE CHECKOUT" section of https://git-scm.com/docs/git-read-tree - Default: sparse checkout is disabled - - * Lines beginning with '#' or ';' are comments and will be ignored. - -# Obtaining this tool, reporting issues, etc. - - The master repository for manage_externals is - https://github.com/ESMCI/manage_externals. Any issues with this tool - should be reported there. - -# Troubleshooting - -Operations performed by manage_externals utilities are explicit and -data driven. %(prog)s will always attempt to make the working copy -*exactly* match what is in the externals file when modifying the -working copy of a repository. - -If %(prog)s is not doing what you expected, double check the contents -of the externals description file or examine the output of -./manage_externals/%(prog)s --status - -''' - - parser = argparse.ArgumentParser( - description=description, epilog=epilog, - formatter_class=argparse.RawDescriptionHelpFormatter) - - # - # user options - # - parser.add_argument("components", nargs="*", - help="Specific component(s) to checkout. By default, " - "all required externals are checked out.") - - parser.add_argument('-e', '--externals', nargs='?', - default='Externals.cfg', - help='The externals description filename. ' - 'Default: %(default)s.') - - parser.add_argument('-x', '--exclude', nargs='*', - help='Component(s) listed in the externals file which should be ignored.') - - parser.add_argument('-o', '--optional', action='store_true', default=False, - help='By default only the required externals ' - 'are checked out. This flag will also checkout the ' - 'optional externals.') - - parser.add_argument('-S', '--status', action='store_true', default=False, - help='Output the status of the repositories managed by ' - '%(prog)s. By default only summary information ' - 'is provided. Use the verbose option to see details.') - - parser.add_argument('-v', '--verbose', action='count', default=0, - help='Output additional information to ' - 'the screen and log file. This flag can be ' - 'used up to two times, increasing the ' - 'verbosity level each time.') - - parser.add_argument('--svn-ignore-ancestry', action='store_true', default=False, - help='By default, subversion will abort if a component is ' - 'already checked out and there is no common ancestry with ' - 'the new URL. This flag passes the "--ignore-ancestry" flag ' - 'to the svn switch call. (This is not recommended unless ' - 'you are sure about what you are doing.)') - - # - # developer options - # - parser.add_argument('--backtrace', action='store_true', - help='DEVELOPER: show exception backtraces as extra ' - 'debugging output') - - parser.add_argument('-d', '--debug', action='store_true', default=False, - help='DEVELOPER: output additional debugging ' - 'information to the screen and log file.') - - logging_group = parser.add_mutually_exclusive_group() - - logging_group.add_argument('--logging', dest='do_logging', - action='store_true', - help='DEVELOPER: enable logging.') - logging_group.add_argument('--no-logging', dest='do_logging', - action='store_false', default=False, - help='DEVELOPER: disable logging ' - '(this is the default)') - - if args: - options = parser.parse_args(args) - else: - options = parser.parse_args() - return options - -def _dirty_local_repo_msg(program_name, config_file): - return """The external repositories labeled with 'M' above are not in a clean state. -The following are four options for how to proceed: -(1) Go into each external that is not in a clean state and issue either a 'git status' or - an 'svn status' command (depending on whether the external is managed by git or - svn). Either revert or commit your changes so that all externals are in a clean - state. (To revert changes in git, follow the instructions given when you run 'git - status'.) (Note, though, that it is okay to have untracked files in your working - directory.) Then rerun {program_name}. -(2) Alternatively, you do not have to rely on {program_name}. Instead, you can manually - update out-of-sync externals (labeled with 's' above) as described in the - configuration file {config_file}. (For example, run 'git fetch' and 'git checkout' - commands to checkout the appropriate tags for each external, as given in - {config_file}.) -(3) You can also use {program_name} to manage most, but not all externals: You can specify - one or more externals to ignore using the '-x' or '--exclude' argument to - {program_name}. Excluding externals labeled with 'M' will allow {program_name} to - update the other, non-excluded externals. -(4) As a last resort, if you are confident that there is no work that needs to be saved - from a given external, you can remove that external (via "rm -rf [directory]") and - then rerun the {program_name} tool. This option is mainly useful as a workaround for - issues with this tool (such as https://github.com/ESMCI/manage_externals/issues/157). -The external repositories labeled with '?' above are not under version -control using the expected protocol. If you are sure you want to switch -protocols, and you don't have any work you need to save from this -directory, then run "rm -rf [directory]" before rerunning the -{program_name} tool. -""".format(program_name=program_name, config_file=config_file) -# --------------------------------------------------------------------- -# -# main -# -# --------------------------------------------------------------------- -def main(args): - """ - Function to call when module is called from the command line. - Parse externals file and load required repositories or all repositories if - the --all option is passed. - - Returns a tuple (overall_status, tree_status). overall_status is 0 - on success, non-zero on failure. tree_status is a dict mapping local path - to ExternalStatus -- if no checkout is happening. If checkout is happening, tree_status - is None. - """ - if args.do_logging: - logging.basicConfig(filename=LOG_FILE_NAME, - format='%(levelname)s : %(asctime)s : %(message)s', - datefmt='%Y-%m-%d %H:%M:%S', - level=logging.DEBUG) - - program_name = os.path.basename(sys.argv[0]) - logging.info('Beginning of %s', program_name) - - load_all = False - if args.optional: - load_all = True - - root_dir = os.path.abspath(os.getcwd()) - model_data = read_externals_description_file(root_dir, args.externals) - ext_description = create_externals_description( - model_data, components=args.components, exclude=args.exclude) - - for comp in args.components: - if comp not in ext_description.keys(): - # Note we can't print out the list of found externals because - # they were filtered in create_externals_description above. - fatal_error( - "No component {} found in {}".format( - comp, args.externals)) - - source_tree = SourceTree(root_dir, ext_description, svn_ignore_ancestry=args.svn_ignore_ancestry) - if args.components: - components_str = 'specified components' - else: - components_str = 'required & optional components' - printlog('Checking local status of ' + components_str + ': ', end='') - tree_status = source_tree.status(print_progress=True) - printlog('') - - if args.status: - # user requested status-only - for comp in sorted(tree_status): - tree_status[comp].log_status_message(args.verbose) - else: - # checkout / update the external repositories. - safe_to_update = check_safe_to_update_repos(tree_status) - if not safe_to_update: - # print status - for comp in sorted(tree_status): - tree_status[comp].log_status_message(args.verbose) - # exit gracefully - printlog('-' * 70) - printlog(_dirty_local_repo_msg(program_name, args.externals)) - printlog('-' * 70) - else: - if not args.components: - source_tree.checkout(args.verbose, load_all) - for comp in args.components: - source_tree.checkout(args.verbose, load_all, load_comp=comp) - printlog('') - # New tree status is unknown, don't return anything. - tree_status = None - - logging.info('%s completed without exceptions.', program_name) - # NOTE(bja, 2017-11) tree status is used by the systems tests - return 0, tree_status diff --git a/manage_externals/manic/externals_description.py b/manage_externals/manic/externals_description.py deleted file mode 100644 index 546e7fdcb4..0000000000 --- a/manage_externals/manic/externals_description.py +++ /dev/null @@ -1,830 +0,0 @@ -#!/usr/bin/env python3 - -"""Model description - -Model description is the representation of the various externals -included in the model. It processes in input data structure, and -converts it into a standard interface that is used by the rest of the -system. - -To maintain backward compatibility, externals description files should -follow semantic versioning rules, http://semver.org/ - - - -""" -from __future__ import absolute_import -from __future__ import unicode_literals -from __future__ import print_function - -import logging -import os -import os.path -import re - -# ConfigParser in python2 was renamed to configparser in python3. -# In python2, ConfigParser returns byte strings, str, instead of unicode. -# We need unicode to be compatible with xml and json parser and python3. -try: - # python2 - from ConfigParser import SafeConfigParser as config_parser - from ConfigParser import MissingSectionHeaderError - from ConfigParser import NoSectionError, NoOptionError - - USE_PYTHON2 = True - - def config_string_cleaner(text): - """convert strings into unicode - """ - return text.decode('utf-8') -except ImportError: - # python3 - from configparser import ConfigParser as config_parser - from configparser import MissingSectionHeaderError - from configparser import NoSectionError, NoOptionError - - USE_PYTHON2 = False - - def config_string_cleaner(text): - """Python3 already uses unicode strings, so just return the string - without modification. - - """ - return text - -from .utils import printlog, fatal_error, str_to_bool, expand_local_url -from .utils import execute_subprocess -from .global_constants import EMPTY_STR, PPRINTER, VERSION_SEPERATOR - -# -# Globals -# -DESCRIPTION_SECTION = 'externals_description' -VERSION_ITEM = 'schema_version' - - -def read_externals_description_file(root_dir, file_name): - """Read a file containing an externals description and - create its internal representation. - - """ - root_dir = os.path.abspath(root_dir) - msg = 'In directory : {0}'.format(root_dir) - logging.info(msg) - printlog('Processing externals description file : {0} ({1})'.format(file_name, - root_dir)) - - file_path = os.path.join(root_dir, file_name) - if not os.path.exists(file_name): - if file_name.lower() == "none": - msg = ('INTERNAL ERROR: Attempt to read externals file ' - 'from {0} when not configured'.format(file_path)) - else: - msg = ('ERROR: Model description file, "{0}", does not ' - 'exist at path:\n {1}\nDid you run from the root of ' - 'the source tree?'.format(file_name, file_path)) - - fatal_error(msg) - - externals_description = None - if file_name == ExternalsDescription.GIT_SUBMODULES_FILENAME: - externals_description = _read_gitmodules_file(root_dir, file_name) - else: - try: - config = config_parser() - config.read(file_path) - externals_description = config - except MissingSectionHeaderError: - # not a cfg file - pass - - if externals_description is None: - msg = 'Unknown file format!' - fatal_error(msg) - - return externals_description - -class LstripReader(object): - "LstripReader formats .gitmodules files to be acceptable for configparser" - def __init__(self, filename): - with open(filename, 'r') as infile: - lines = infile.readlines() - self._lines = list() - self._num_lines = len(lines) - self._index = 0 - for line in lines: - self._lines.append(line.lstrip()) - - def readlines(self): - """Return all the lines from this object's file""" - return self._lines - - def readline(self, size=-1): - """Format and return the next line or raise StopIteration""" - try: - line = self.next() - except StopIteration: - line = '' - - if (size > 0) and (len(line) < size): - return line[0:size] - - return line - - def __iter__(self): - """Begin an iteration""" - self._index = 0 - return self - - def next(self): - """Return the next line or raise StopIteration""" - if self._index >= self._num_lines: - raise StopIteration - - self._index = self._index + 1 - return self._lines[self._index - 1] - - def __next__(self): - return self.next() - -def git_submodule_status(repo_dir): - """Run the git submodule status command to obtain submodule hashes. - """ - # This function is here instead of GitRepository to avoid a dependency loop - cmd = 'git -C {repo_dir} submodule status'.format( - repo_dir=repo_dir).split() - git_output = execute_subprocess(cmd, output_to_caller=True) - submodules = {} - submods = git_output.split('\n') - for submod in submods: - if submod: - status = submod[0] - items = submod[1:].split(' ') - if len(items) > 2: - tag = items[2] - else: - tag = None - - submodules[items[1]] = {'hash':items[0], 'status':status, 'tag':tag} - - return submodules - -def parse_submodules_desc_section(section_items, file_path): - """Find the path and url for this submodule description""" - path = None - url = None - for item in section_items: - name = item[0].strip().lower() - if name == 'path': - path = item[1].strip() - elif name == 'url': - url = item[1].strip() - elif name == 'branch': - # We do not care about branch since we have a hash - silently ignore - pass - else: - msg = 'WARNING: Ignoring unknown {} property, in {}' - msg = msg.format(item[0], file_path) # fool pylint - logging.warning(msg) - - return path, url - -def _read_gitmodules_file(root_dir, file_name): - # pylint: disable=deprecated-method - # Disabling this check because the method is only used for python2 - # pylint: disable=too-many-locals - # pylint: disable=too-many-branches - # pylint: disable=too-many-statements - """Read a .gitmodules file and convert it to be compatible with an - externals description. - """ - root_dir = os.path.abspath(root_dir) - msg = 'In directory : {0}'.format(root_dir) - logging.info(msg) - - file_path = os.path.join(root_dir, file_name) - if not os.path.exists(file_name): - msg = ('ERROR: submodules description file, "{0}", does not ' - 'exist in dir:\n {1}'.format(file_name, root_dir)) - fatal_error(msg) - - submodules_description = None - externals_description = None - try: - config = config_parser() - if USE_PYTHON2: - config.readfp(LstripReader(file_path), filename=file_name) - else: - config.read_file(LstripReader(file_path), source=file_name) - - submodules_description = config - except MissingSectionHeaderError: - # not a cfg file - pass - - if submodules_description is None: - msg = 'Unknown file format!' - fatal_error(msg) - else: - # Convert the submodules description to an externals description - externals_description = config_parser() - # We need to grab all the commit hashes for this repo - submods = git_submodule_status(root_dir) - for section in submodules_description.sections(): - if section[0:9] == 'submodule': - sec_name = section[9:].strip(' "') - externals_description.add_section(sec_name) - section_items = submodules_description.items(section) - path, url = parse_submodules_desc_section(section_items, - file_path) - - if path is None: - msg = 'Submodule {} missing path'.format(sec_name) - fatal_error(msg) - - if url is None: - msg = 'Submodule {} missing url'.format(sec_name) - fatal_error(msg) - - externals_description.set(sec_name, - ExternalsDescription.PATH, path) - externals_description.set(sec_name, - ExternalsDescription.PROTOCOL, 'git') - externals_description.set(sec_name, - ExternalsDescription.REPO_URL, url) - externals_description.set(sec_name, - ExternalsDescription.REQUIRED, 'True') - if sec_name in submods: - submod_name = sec_name - else: - # The section name does not have to match the path - submod_name = path - - if submod_name in submods: - git_hash = submods[submod_name]['hash'] - externals_description.set(sec_name, - ExternalsDescription.HASH, - git_hash) - else: - emsg = "submodule status has no section, '{}'" - emsg += "\nCheck section names in externals config file" - fatal_error(emsg.format(submod_name)) - - # Required items - externals_description.add_section(DESCRIPTION_SECTION) - externals_description.set(DESCRIPTION_SECTION, VERSION_ITEM, '1.0.0') - - return externals_description - -def create_externals_description( - model_data, model_format='cfg', components=None, exclude=None, parent_repo=None): - """Create the a externals description object from the provided data - - components: list of component names to include, None to include all. If a - name isn't found, it is silently omitted from the return value. - exclude: list of component names to skip. - """ - externals_description = None - if model_format == 'dict': - externals_description = ExternalsDescriptionDict( - model_data, components=components, exclude=exclude) - elif model_format == 'cfg': - major, _, _ = get_cfg_schema_version(model_data) - if major == 1: - externals_description = ExternalsDescriptionConfigV1( - model_data, components=components, exclude=exclude, parent_repo=parent_repo) - else: - msg = ('Externals description file has unsupported schema ' - 'version "{0}".'.format(major)) - fatal_error(msg) - else: - msg = 'Unknown model data format "{0}"'.format(model_format) - fatal_error(msg) - return externals_description - - -def get_cfg_schema_version(model_cfg): - """Extract the major, minor, patch version of the config file schema - - Params: - model_cfg - config parser object containing the externas description data - - Returns: - major = integer major version - minor = integer minor version - patch = integer patch version - """ - semver_str = '' - try: - semver_str = model_cfg.get(DESCRIPTION_SECTION, VERSION_ITEM) - except (NoSectionError, NoOptionError): - msg = ('externals description file must have the required ' - 'section: "{0}" and item "{1}"'.format(DESCRIPTION_SECTION, - VERSION_ITEM)) - fatal_error(msg) - - # NOTE(bja, 2017-11) Assume we don't care about the - # build/pre-release metadata for now! - version_list = re.split(r'[-+]', semver_str) - version_str = version_list[0] - version = version_str.split(VERSION_SEPERATOR) - try: - major = int(version[0].strip()) - minor = int(version[1].strip()) - patch = int(version[2].strip()) - except ValueError: - msg = ('Config file schema version must have integer digits for ' - 'major, minor and patch versions. ' - 'Received "{0}"'.format(version_str)) - fatal_error(msg) - return major, minor, patch - - -class ExternalsDescription(dict): - """Base externals description class that is independent of the user input - format. Different input formats can all be converted to this - representation to provide a consistent represtentation for the - rest of the objects in the system. - - NOTE(bja, 2018-03): do NOT define _schema_major etc at the class - level in the base class. The nested/recursive nature of externals - means different schema versions may be present in a single run! - - All inheriting classes must overwrite: - self._schema_major and self._input_major - self._schema_minor and self._input_minor - self._schema_patch and self._input_patch - - where _schema_x is the supported schema, _input_x is the user - input value. - - """ - # keywords defining the interface into the externals description data; these - # are brought together by the schema below. - EXTERNALS = 'externals' # path to externals file. - BRANCH = 'branch' - SUBMODULE = 'from_submodule' - HASH = 'hash' - NAME = 'name' - PATH = 'local_path' - PROTOCOL = 'protocol' - REPO = 'repo' - REPO_URL = 'repo_url' - REQUIRED = 'required' - TAG = 'tag' - SPARSE = 'sparse' - - PROTOCOL_EXTERNALS_ONLY = 'externals_only' - PROTOCOL_GIT = 'git' - PROTOCOL_SVN = 'svn' - GIT_SUBMODULES_FILENAME = '.gitmodules' - KNOWN_PRROTOCOLS = [PROTOCOL_GIT, PROTOCOL_SVN, PROTOCOL_EXTERNALS_ONLY] - - # v1 xml keywords - _V1_TREE_PATH = 'TREE_PATH' - _V1_ROOT = 'ROOT' - _V1_TAG = 'TAG' - _V1_BRANCH = 'BRANCH' - _V1_REQ_SOURCE = 'REQ_SOURCE' - - # Dictionary keys are component names. The corresponding values are laid out - # according to this schema. - _source_schema = {REQUIRED: True, - PATH: 'string', - EXTERNALS: 'string', - SUBMODULE : True, - REPO: {PROTOCOL: 'string', - REPO_URL: 'string', - TAG: 'string', - BRANCH: 'string', - HASH: 'string', - SPARSE: 'string', - } - } - - def __init__(self, parent_repo=None): - """Convert the xml into a standardized dict that can be used to - construct the source objects - - """ - dict.__init__(self) - - self._schema_major = None - self._schema_minor = None - self._schema_patch = None - self._input_major = None - self._input_minor = None - self._input_patch = None - self._parent_repo = parent_repo - - def _verify_schema_version(self): - """Use semantic versioning rules to verify we can process this schema. - - """ - known = '{0}.{1}.{2}'.format(self._schema_major, - self._schema_minor, - self._schema_patch) - received = '{0}.{1}.{2}'.format(self._input_major, - self._input_minor, - self._input_patch) - - if self._input_major != self._schema_major: - # should never get here, the factory should handle this correctly! - msg = ('DEV_ERROR: version "{0}" parser received ' - 'version "{1}" input.'.format(known, received)) - fatal_error(msg) - - if self._input_minor > self._schema_minor: - msg = ('Incompatible schema version:\n' - ' User supplied schema version "{0}" is too new."\n' - ' Can only process version "{1}" files and ' - 'older.'.format(received, known)) - fatal_error(msg) - - if self._input_patch > self._schema_patch: - # NOTE(bja, 2018-03) ignoring for now... Not clear what - # conditions the test is needed. - pass - - def _check_user_input(self): - """Run a series of checks to attempt to validate the user input and - detect errors as soon as possible. - - NOTE(bja, 2018-03) These checks are called *after* the file is - read. That means the schema check can not occur here. - - Note: the order is important. check_optional will create - optional with null data. run check_data first to ensure - required data was provided correctly by the user. - - """ - self._check_data() - self._check_optional() - self._validate() - - def _check_data(self): - # pylint: disable=too-many-branches,too-many-statements - """Check user supplied data is valid where possible. - """ - for ext_name in self.keys(): - if (self[ext_name][self.REPO][self.PROTOCOL] - not in self.KNOWN_PRROTOCOLS): - msg = 'Unknown repository protocol "{0}" in "{1}".'.format( - self[ext_name][self.REPO][self.PROTOCOL], ext_name) - fatal_error(msg) - - if (self[ext_name][self.REPO][self.PROTOCOL] == - self.PROTOCOL_SVN): - if self.HASH in self[ext_name][self.REPO]: - msg = ('In repo description for "{0}". svn repositories ' - 'may not include the "hash" keyword.'.format( - ext_name)) - fatal_error(msg) - - if ((self[ext_name][self.REPO][self.PROTOCOL] != self.PROTOCOL_GIT) - and (self.SUBMODULE in self[ext_name])): - msg = ('self.SUBMODULE is only supported with {0} protocol, ' - '"{1}" is defined as an {2} repository') - fatal_error(msg.format(self.PROTOCOL_GIT, ext_name, - self[ext_name][self.REPO][self.PROTOCOL])) - - if (self[ext_name][self.REPO][self.PROTOCOL] != - self.PROTOCOL_EXTERNALS_ONLY): - ref_count = 0 - found_refs = '' - if self.TAG in self[ext_name][self.REPO]: - ref_count += 1 - found_refs = '"{0} = {1}", {2}'.format( - self.TAG, self[ext_name][self.REPO][self.TAG], - found_refs) - if self.BRANCH in self[ext_name][self.REPO]: - ref_count += 1 - found_refs = '"{0} = {1}", {2}'.format( - self.BRANCH, self[ext_name][self.REPO][self.BRANCH], - found_refs) - if self.HASH in self[ext_name][self.REPO]: - ref_count += 1 - found_refs = '"{0} = {1}", {2}'.format( - self.HASH, self[ext_name][self.REPO][self.HASH], - found_refs) - if (self.SUBMODULE in self[ext_name] and - self[ext_name][self.SUBMODULE]): - ref_count += 1 - found_refs = '"{0} = {1}", {2}'.format( - self.SUBMODULE, - self[ext_name][self.SUBMODULE], found_refs) - - if ref_count > 1: - msg = 'Model description is over specified! ' - if self.SUBMODULE in self[ext_name]: - msg += ('from_submodule is not compatible with ' - '"tag", "branch", or "hash" ') - else: - msg += (' Only one of "tag", "branch", or "hash" ' - 'may be specified ') - - msg += 'for repo description of "{0}".'.format(ext_name) - msg = '{0}\nFound: {1}'.format(msg, found_refs) - fatal_error(msg) - elif ref_count < 1: - msg = ('Model description is under specified! One of ' - '"tag", "branch", or "hash" must be specified for ' - 'repo description of "{0}"'.format(ext_name)) - fatal_error(msg) - - if (self.REPO_URL not in self[ext_name][self.REPO] and - (self.SUBMODULE not in self[ext_name] or - not self[ext_name][self.SUBMODULE])): - msg = ('Model description is under specified! Must have ' - '"repo_url" in repo ' - 'description for "{0}"'.format(ext_name)) - fatal_error(msg) - - if (self.SUBMODULE in self[ext_name] and - self[ext_name][self.SUBMODULE]): - if self.REPO_URL in self[ext_name][self.REPO]: - msg = ('Model description is over specified! ' - 'from_submodule keyword is not compatible ' - 'with {0} keyword for'.format(self.REPO_URL)) - msg = '{0} repo description of "{1}"'.format(msg, - ext_name) - fatal_error(msg) - - if self.PATH in self[ext_name]: - msg = ('Model description is over specified! ' - 'from_submodule keyword is not compatible with ' - '{0} keyword for'.format(self.PATH)) - msg = '{0} repo description of "{1}"'.format(msg, - ext_name) - fatal_error(msg) - - if self.REPO_URL in self[ext_name][self.REPO]: - url = expand_local_url( - self[ext_name][self.REPO][self.REPO_URL], ext_name) - self[ext_name][self.REPO][self.REPO_URL] = url - - def _check_optional(self): - # pylint: disable=too-many-branches - """Some fields like externals, repo:tag repo:branch are - (conditionally) optional. We don't want the user to be - required to enter them in every externals description file, but - still want to validate the input. Check conditions and add - default values if appropriate. - - """ - submod_desc = None # Only load submodules info once - for field in self: - # truely optional - if self.EXTERNALS not in self[field]: - self[field][self.EXTERNALS] = EMPTY_STR - - # git and svn repos must tags and branches for validation purposes. - if self.TAG not in self[field][self.REPO]: - self[field][self.REPO][self.TAG] = EMPTY_STR - if self.BRANCH not in self[field][self.REPO]: - self[field][self.REPO][self.BRANCH] = EMPTY_STR - if self.HASH not in self[field][self.REPO]: - self[field][self.REPO][self.HASH] = EMPTY_STR - if self.REPO_URL not in self[field][self.REPO]: - self[field][self.REPO][self.REPO_URL] = EMPTY_STR - if self.SPARSE not in self[field][self.REPO]: - self[field][self.REPO][self.SPARSE] = EMPTY_STR - - # from_submodule has a complex relationship with other fields - if self.SUBMODULE in self[field]: - # User wants to use submodule information, is it available? - if self._parent_repo is None: - # No parent == no submodule information - PPRINTER.pprint(self[field]) - msg = 'No parent submodule for "{0}"'.format(field) - fatal_error(msg) - elif self._parent_repo.protocol() != self.PROTOCOL_GIT: - PPRINTER.pprint(self[field]) - msg = 'Parent protocol, "{0}", does not support submodules' - fatal_error(msg.format(self._parent_repo.protocol())) - else: - args = self._repo_config_from_submodule(field, submod_desc) - repo_url, repo_path, ref_hash, submod_desc = args - - if repo_url is None: - msg = ('Cannot checkout "{0}" as a submodule, ' - 'repo not found in {1} file') - fatal_error(msg.format(field, - self.GIT_SUBMODULES_FILENAME)) - # Fill in submodule fields - self[field][self.REPO][self.REPO_URL] = repo_url - self[field][self.REPO][self.HASH] = ref_hash - self[field][self.PATH] = repo_path - - if self[field][self.SUBMODULE]: - # We should get everything from the parent submodule - # configuration. - pass - # No else (from _submodule = False is the default) - else: - # Add the default value (not using submodule information) - self[field][self.SUBMODULE] = False - - def _repo_config_from_submodule(self, field, submod_desc): - """Find the external config information for a repository from - its submodule configuration information. - """ - if submod_desc is None: - repo_path = os.getcwd() # Is this always correct? - submod_file = self._parent_repo.submodules_file(repo_path=repo_path) - if submod_file is None: - msg = ('Cannot checkout "{0}" from submodule information\n' - ' Parent repo, "{1}" does not have submodules') - fatal_error(msg.format(field, self._parent_repo.name())) - - printlog( - 'Processing submodules description file : {0} ({1})'.format( - submod_file, repo_path)) - submod_model_data= _read_gitmodules_file(repo_path, submod_file) - submod_desc = create_externals_description(submod_model_data) - - # Can we find our external? - repo_url = None - repo_path = None - ref_hash = None - for ext_field in submod_desc: - if field == ext_field: - ext = submod_desc[ext_field] - repo_url = ext[self.REPO][self.REPO_URL] - repo_path = ext[self.PATH] - ref_hash = ext[self.REPO][self.HASH] - break - - return repo_url, repo_path, ref_hash, submod_desc - - def _validate(self): - """Validate that the parsed externals description contains all necessary - fields. - - """ - def print_compare_difference(data_a, data_b, loc_a, loc_b): - """Look through the data structures and print the differences. - - """ - for item in data_a: - if item in data_b: - if not isinstance(data_b[item], type(data_a[item])): - printlog(" {item}: {loc} = {val} ({val_type})".format( - item=item, loc=loc_a, val=data_a[item], - val_type=type(data_a[item]))) - printlog(" {item} {loc} = {val} ({val_type})".format( - item=' ' * len(item), loc=loc_b, val=data_b[item], - val_type=type(data_b[item]))) - else: - printlog(" {item}: {loc} = {val} ({val_type})".format( - item=item, loc=loc_a, val=data_a[item], - val_type=type(data_a[item]))) - printlog(" {item} {loc} missing".format( - item=' ' * len(item), loc=loc_b)) - - def validate_data_struct(schema, data): - """Compare a data structure against a schema and validate all required - fields are present. - - """ - is_valid = False - in_ref = True - valid = True - if isinstance(schema, dict) and isinstance(data, dict): - # Both are dicts, recursively verify that all fields - # in schema are present in the data. - for key in schema: - in_ref = in_ref and (key in data) - if in_ref: - valid = valid and ( - validate_data_struct(schema[key], data[key])) - - is_valid = in_ref and valid - else: - # non-recursive structure. verify data and schema have - # the same type. - is_valid = isinstance(data, type(schema)) - - if not is_valid: - printlog(" Unmatched schema and input:") - if isinstance(schema, dict): - print_compare_difference(schema, data, 'schema', 'input') - print_compare_difference(data, schema, 'input', 'schema') - else: - printlog(" schema = {0} ({1})".format( - schema, type(schema))) - printlog(" input = {0} ({1})".format(data, type(data))) - - return is_valid - - for field in self: - valid = validate_data_struct(self._source_schema, self[field]) - if not valid: - PPRINTER.pprint(self._source_schema) - PPRINTER.pprint(self[field]) - msg = 'ERROR: source for "{0}" did not validate'.format(field) - fatal_error(msg) - - -class ExternalsDescriptionDict(ExternalsDescription): - """Create a externals description object from a dictionary using the API - representations. Primarily used to simplify creating model - description files for unit testing. - - """ - - def __init__(self, model_data, components=None, exclude=None): - """Parse a native dictionary into a externals description. - """ - ExternalsDescription.__init__(self) - self._schema_major = 1 - self._schema_minor = 0 - self._schema_patch = 0 - self._input_major = 1 - self._input_minor = 0 - self._input_patch = 0 - self._verify_schema_version() - if components: - for key in list(model_data.keys()): - if key not in components: - del model_data[key] - - if exclude: - for key in list(model_data.keys()): - if key in exclude: - del model_data[key] - - self.update(model_data) - self._check_user_input() - - -class ExternalsDescriptionConfigV1(ExternalsDescription): - """Create a externals description object from a config_parser object, - schema version 1. - - """ - - def __init__(self, model_data, components=None, exclude=None, parent_repo=None): - """Convert the config data into a standardized dict that can be used to - construct the source objects - - components: list of component names to include, None to include all. - exclude: list of component names to skip. - """ - ExternalsDescription.__init__(self, parent_repo=parent_repo) - self._schema_major = 1 - self._schema_minor = 1 - self._schema_patch = 0 - self._input_major, self._input_minor, self._input_patch = \ - get_cfg_schema_version(model_data) - self._verify_schema_version() - self._remove_metadata(model_data) - self._parse_cfg(model_data, components=components, exclude=exclude) - self._check_user_input() - - @staticmethod - def _remove_metadata(model_data): - """Remove the metadata section from the model configuration file so - that it is simpler to look through the file and construct the - externals description. - - """ - model_data.remove_section(DESCRIPTION_SECTION) - - def _parse_cfg(self, cfg_data, components=None, exclude=None): - """Parse a config_parser object into a externals description. - - components: list of component names to include, None to include all. - exclude: list of component names to skip. - """ - def list_to_dict(input_list, convert_to_lower_case=True): - """Convert a list of key-value pairs into a dictionary. - """ - output_dict = {} - for item in input_list: - key = config_string_cleaner(item[0].strip()) - value = config_string_cleaner(item[1].strip()) - if convert_to_lower_case: - key = key.lower() - output_dict[key] = value - return output_dict - - for section in cfg_data.sections(): - name = config_string_cleaner(section.lower().strip()) - if (components and name not in components) or (exclude and name in exclude): - continue - self[name] = {} - self[name].update(list_to_dict(cfg_data.items(section))) - self[name][self.REPO] = {} - loop_keys = self[name].copy().keys() - for item in loop_keys: - if item in self._source_schema: - if isinstance(self._source_schema[item], bool): - self[name][item] = str_to_bool(self[name][item]) - elif item in self._source_schema[self.REPO]: - self[name][self.REPO][item] = self[name][item] - del self[name][item] - else: - msg = ('Invalid input: "{sect}" contains unknown ' - 'item "{item}".'.format(sect=name, item=item)) - fatal_error(msg) diff --git a/manage_externals/manic/externals_status.py b/manage_externals/manic/externals_status.py deleted file mode 100644 index 6bc29e9732..0000000000 --- a/manage_externals/manic/externals_status.py +++ /dev/null @@ -1,164 +0,0 @@ -"""ExternalStatus - -Class to store status and state information about repositories and -create a string representation. - -""" -from __future__ import absolute_import -from __future__ import unicode_literals -from __future__ import print_function - -from .global_constants import EMPTY_STR -from .utils import printlog, indent_string -from .global_constants import VERBOSITY_VERBOSE, VERBOSITY_DUMP - - -class ExternalStatus(object): - """Class to represent the status of a given source repository or tree. - - Individual repositories determine their own status in the - Repository objects. This object is just resposible for storing the - information and passing it up to a higher level for reporting or - global decisions. - - There are two states of concern: - - * If the repository is in-sync with the externals description file. - - * If the repostiory working copy is clean and there are no pending - transactions (e.g. add, remove, rename, untracked files). - - """ - # sync_state and clean_state can be one of the following: - DEFAULT = '-' # not set yet (sync_state). clean_state can be this if sync_state is EMPTY. - UNKNOWN = '?' - EMPTY = 'e' - MODEL_MODIFIED = 's' # repo version != externals (sync_state only) - DIRTY = 'M' # repo is dirty (clean_state only) - STATUS_OK = ' ' # repo is clean (clean_state) or matches externals version (sync_state) - STATUS_ERROR = '!' - - # source_type can be one of the following: - OPTIONAL = 'o' - STANDALONE = 's' - MANAGED = ' ' - - def __init__(self): - self.sync_state = self.DEFAULT - self.clean_state = self.DEFAULT - self.source_type = self.DEFAULT - self.path = EMPTY_STR - self.current_version = EMPTY_STR - self.expected_version = EMPTY_STR - self.status_output = EMPTY_STR - - def log_status_message(self, verbosity): - """Write status message to the screen and log file - """ - printlog(self._default_status_message()) - if verbosity >= VERBOSITY_VERBOSE: - printlog(self._verbose_status_message()) - if verbosity >= VERBOSITY_DUMP: - printlog(self._dump_status_message()) - - def __repr__(self): - return self._default_status_message() - - def _default_status_message(self): - """Return the default terse status message string - """ - return '{sync}{clean}{src_type} {path}'.format( - sync=self.sync_state, clean=self.clean_state, - src_type=self.source_type, path=self.path) - - def _verbose_status_message(self): - """Return the verbose status message string - """ - clean_str = self.DEFAULT - if self.clean_state == self.STATUS_OK: - clean_str = 'clean sandbox' - elif self.clean_state == self.DIRTY: - clean_str = 'modified sandbox' - - sync_str = 'on {0}'.format(self.current_version) - if self.sync_state != self.STATUS_OK: - sync_str = '{current} --> {expected}'.format( - current=self.current_version, expected=self.expected_version) - return ' {clean}, {sync}'.format(clean=clean_str, sync=sync_str) - - def _dump_status_message(self): - """Return the dump status message string - """ - return indent_string(self.status_output, 12) - - def safe_to_update(self): - """Report if it is safe to update a repository. Safe is defined as: - - * If a repository is empty, it is safe to update. - - * If a repository exists and has a clean working copy state - with no pending transactions. - - """ - safe_to_update = False - repo_exists = self.exists() - if not repo_exists: - safe_to_update = True - else: - # If the repo exists, it must be in ok or modified - # sync_state. Any other sync_state at this point - # represents a logic error that should have been handled - # before now! - sync_safe = ((self.sync_state == ExternalStatus.STATUS_OK) or - (self.sync_state == ExternalStatus.MODEL_MODIFIED)) - if sync_safe: - # The clean_state must be STATUS_OK to update. Otherwise we - # are dirty or there was a missed error previously. - if self.clean_state == ExternalStatus.STATUS_OK: - safe_to_update = True - return safe_to_update - - def exists(self): - """Determine if the repo exists. This is indicated by: - - * sync_state is not EMPTY - - * if the sync_state is empty, then the valid states for - clean_state are default, empty or unknown. Anything else - and there was probably an internal logic error. - - NOTE(bja, 2017-10) For the moment we are considering a - sync_state of default or unknown to require user intervention, - but we may want to relax this convention. This is probably a - result of a network error or internal logic error but more - testing is needed. - - """ - is_empty = (self.sync_state == ExternalStatus.EMPTY) - clean_valid = ((self.clean_state == ExternalStatus.DEFAULT) or - (self.clean_state == ExternalStatus.EMPTY) or - (self.clean_state == ExternalStatus.UNKNOWN)) - - if is_empty and clean_valid: - exists = False - else: - exists = True - return exists - - -def check_safe_to_update_repos(tree_status): - """Check if *ALL* repositories are in a safe state to update. We don't - want to do a partial update of the repositories then die, leaving - the model in an inconsistent state. - - Note: if there is an update to do, the repositories will by - definiation be out of synce with the externals description, so we - can't use that as criteria for updating. - - """ - safe_to_update = True - for comp in tree_status: - stat = tree_status[comp] - safe_to_update &= stat.safe_to_update() - - return safe_to_update diff --git a/manage_externals/manic/global_constants.py b/manage_externals/manic/global_constants.py deleted file mode 100644 index 0e91cffc90..0000000000 --- a/manage_externals/manic/global_constants.py +++ /dev/null @@ -1,18 +0,0 @@ -"""Globals shared across modules -""" - -from __future__ import absolute_import -from __future__ import unicode_literals -from __future__ import print_function - -import pprint - -EMPTY_STR = '' -LOCAL_PATH_INDICATOR = '.' -VERSION_SEPERATOR = '.' -LOG_FILE_NAME = 'manage_externals.log' -PPRINTER = pprint.PrettyPrinter(indent=4) - -VERBOSITY_DEFAULT = 0 -VERBOSITY_VERBOSE = 1 -VERBOSITY_DUMP = 2 diff --git a/manage_externals/manic/repository.py b/manage_externals/manic/repository.py deleted file mode 100644 index ea4230fb7b..0000000000 --- a/manage_externals/manic/repository.py +++ /dev/null @@ -1,98 +0,0 @@ -"""Base class representation of a repository -""" - -from .externals_description import ExternalsDescription -from .utils import fatal_error -from .global_constants import EMPTY_STR - - -class Repository(object): - """ - Class to represent and operate on a repository description. - """ - - def __init__(self, component_name, repo): - """ - Parse repo externals description - """ - self._name = component_name - self._protocol = repo[ExternalsDescription.PROTOCOL] - self._tag = repo[ExternalsDescription.TAG] - self._branch = repo[ExternalsDescription.BRANCH] - self._hash = repo[ExternalsDescription.HASH] - self._url = repo[ExternalsDescription.REPO_URL] - self._sparse = repo[ExternalsDescription.SPARSE] - - if self._url is EMPTY_STR: - fatal_error('repo must have a URL') - - if ((self._tag is EMPTY_STR) and (self._branch is EMPTY_STR) and - (self._hash is EMPTY_STR)): - fatal_error('{0} repo must have a branch, tag or hash element') - - ref_count = 0 - if self._tag is not EMPTY_STR: - ref_count += 1 - if self._branch is not EMPTY_STR: - ref_count += 1 - if self._hash is not EMPTY_STR: - ref_count += 1 - if ref_count != 1: - fatal_error('repo {0} must have exactly one of ' - 'tag, branch or hash.'.format(self._name)) - - def checkout(self, base_dir_path, repo_dir_name, verbosity, recursive): # pylint: disable=unused-argument - """ - If the repo destination directory exists, ensure it is correct (from - correct URL, correct branch or tag), and possibly update the source. - If the repo destination directory does not exist, checkout the correce - branch or tag. - NB: is include as an argument for compatibility with - git functionality (repository_git.py) - """ - msg = ('DEV_ERROR: checkout method must be implemented in all ' - 'repository classes! {0}'.format(self.__class__.__name__)) - fatal_error(msg) - - def status(self, stat, repo_dir_path): # pylint: disable=unused-argument - """Report the status of the repo - - """ - msg = ('DEV_ERROR: status method must be implemented in all ' - 'repository classes! {0}'.format(self.__class__.__name__)) - fatal_error(msg) - - def submodules_file(self, repo_path=None): - # pylint: disable=no-self-use,unused-argument - """Stub for use by non-git VC systems""" - return None - - def url(self): - """Public access of repo url. - """ - return self._url - - def tag(self): - """Public access of repo tag - """ - return self._tag - - def branch(self): - """Public access of repo branch. - """ - return self._branch - - def hash(self): - """Public access of repo hash. - """ - return self._hash - - def name(self): - """Public access of repo name. - """ - return self._name - - def protocol(self): - """Public access of repo protocol. - """ - return self._protocol diff --git a/manage_externals/manic/repository_factory.py b/manage_externals/manic/repository_factory.py deleted file mode 100644 index 18c73ffc4b..0000000000 --- a/manage_externals/manic/repository_factory.py +++ /dev/null @@ -1,30 +0,0 @@ -"""Factory for creating and initializing the appropriate repository class -""" - -from __future__ import absolute_import -from __future__ import unicode_literals -from __future__ import print_function - -from .repository_git import GitRepository -from .repository_svn import SvnRepository -from .externals_description import ExternalsDescription -from .utils import fatal_error - - -def create_repository(component_name, repo_info, svn_ignore_ancestry=False): - """Determine what type of repository we have, i.e. git or svn, and - create the appropriate object. - - Can return None (e.g. if protocol is 'externals_only'). - """ - protocol = repo_info[ExternalsDescription.PROTOCOL].lower() - if protocol == 'git': - repo = GitRepository(component_name, repo_info) - elif protocol == 'svn': - repo = SvnRepository(component_name, repo_info, ignore_ancestry=svn_ignore_ancestry) - elif protocol == 'externals_only': - repo = None - else: - msg = 'Unknown repo protocol "{0}"'.format(protocol) - fatal_error(msg) - return repo diff --git a/manage_externals/manic/repository_git.py b/manage_externals/manic/repository_git.py deleted file mode 100644 index aab1a468a8..0000000000 --- a/manage_externals/manic/repository_git.py +++ /dev/null @@ -1,859 +0,0 @@ -"""Class for interacting with git repositories -""" - -from __future__ import absolute_import -from __future__ import unicode_literals -from __future__ import print_function - -import copy -import os -import sys - -from .global_constants import EMPTY_STR, LOCAL_PATH_INDICATOR -from .global_constants import VERBOSITY_VERBOSE -from .repository import Repository -from .externals_status import ExternalStatus -from .externals_description import ExternalsDescription, git_submodule_status -from .utils import expand_local_url, split_remote_url, is_remote_url -from .utils import fatal_error, printlog -from .utils import execute_subprocess - - -class GitRepository(Repository): - """Class to represent and operate on a repository description. - - For testing purpose, all system calls to git should: - - * be isolated in separate functions with no application logic - * of the form: - - cmd = 'git -C {dirname} ...'.format(dirname=dirname).split() - - value = execute_subprocess(cmd, output_to_caller={T|F}, - status_to_caller={T|F}) - - return value - * be static methods (not rely on self) - * name as _git_subcommand_args(user_args) - - This convention allows easy unit testing of the repository logic - by mocking the specific calls to return predefined results. - - """ - - def __init__(self, component_name, repo): - """ - repo: ExternalsDescription. - """ - Repository.__init__(self, component_name, repo) - self._gitmodules = None - self._submods = None - - # ---------------------------------------------------------------- - # - # Public API, defined by Repository - # - # ---------------------------------------------------------------- - def checkout(self, base_dir_path, repo_dir_name, verbosity, recursive): - """ - If the repo destination directory exists, ensure it is correct (from - correct URL, correct branch or tag), and possibly update the source. - If the repo destination directory does not exist, checkout the correct - branch or tag. - """ - repo_dir_path = os.path.join(base_dir_path, repo_dir_name) - repo_dir_exists = os.path.exists(repo_dir_path) - if (repo_dir_exists and not os.listdir( - repo_dir_path)) or not repo_dir_exists: - self._clone_repo(base_dir_path, repo_dir_name, verbosity) - self._checkout_ref(repo_dir_path, verbosity, recursive) - gmpath = os.path.join(repo_dir_path, - ExternalsDescription.GIT_SUBMODULES_FILENAME) - if os.path.exists(gmpath): - self._gitmodules = gmpath - self._submods = git_submodule_status(repo_dir_path) - else: - self._gitmodules = None - self._submods = None - - def status(self, stat, repo_dir_path): - """ - If the repo destination directory exists, ensure it is correct (from - correct URL, correct branch or tag), and possibly update the source. - If the repo destination directory does not exist, checkout the correct - branch or tag. - """ - self._check_sync(stat, repo_dir_path) - if os.path.exists(repo_dir_path): - self._status_summary(stat, repo_dir_path) - - def submodules_file(self, repo_path=None): - if repo_path is not None: - gmpath = os.path.join(repo_path, - ExternalsDescription.GIT_SUBMODULES_FILENAME) - if os.path.exists(gmpath): - self._gitmodules = gmpath - self._submods = git_submodule_status(repo_path) - - return self._gitmodules - - # ---------------------------------------------------------------- - # - # Internal work functions - # - # ---------------------------------------------------------------- - def _clone_repo(self, base_dir_path, repo_dir_name, verbosity): - """Clones repo_dir_name into base_dir_path. - """ - self._git_clone(self._url, os.path.join(base_dir_path, repo_dir_name), - verbosity=verbosity) - - def _current_ref(self, dirname): - """Determine the *name* associated with HEAD at dirname. - - If we're on a tag, then returns the tag name; otherwise, returns - the current hash. Returns an empty string if no reference can be - determined (e.g., if we're not actually in a git repository). - - If we're on a branch, then the branch name is also included in - the returned string (in addition to the tag / hash). - """ - ref_found = False - - # If we're exactly at a tag, use that as the current ref - tag_found, tag_name = self._git_current_tag(dirname) - if tag_found: - current_ref = tag_name - ref_found = True - - if not ref_found: - # Otherwise, use current hash as the current ref - hash_found, hash_name = self._git_current_hash(dirname) - if hash_found: - current_ref = hash_name - ref_found = True - - if ref_found: - # If we're on a branch, include branch name in current ref - branch_found, branch_name = self._git_current_branch(dirname) - if branch_found: - current_ref = "{} (branch {})".format(current_ref, branch_name) - else: - # If we still can't find a ref, return empty string. This - # can happen if we're not actually in a git repo - current_ref = '' - - return current_ref - - def _check_sync(self, stat, repo_dir_path): - """Determine whether a git repository is in-sync with the model - description. - - Because repos can have multiple remotes, the only criteria is - whether the branch or tag is the same. - - """ - if not os.path.exists(repo_dir_path): - # NOTE(bja, 2017-10) condition should have been determined - # by _Source() object and should never be here! - stat.sync_state = ExternalStatus.STATUS_ERROR - else: - git_dir = os.path.join(repo_dir_path, '.git') - if not os.path.exists(git_dir): - # NOTE(bja, 2017-10) directory exists, but no git repo - # info.... Can't test with subprocess git command - # because git will move up directory tree until it - # finds the parent repo git dir! - stat.sync_state = ExternalStatus.UNKNOWN - else: - self._check_sync_logic(stat, repo_dir_path) - - def _check_sync_logic(self, stat, repo_dir_path): - """Compare the underlying hashes of the currently checkout ref and the - expected ref. - - Output: sets the sync_state as well as the current and - expected ref in the input status object. - - """ - def compare_refs(current_ref, expected_ref): - """Compare the current and expected ref. - - """ - if current_ref == expected_ref: - status = ExternalStatus.STATUS_OK - else: - status = ExternalStatus.MODEL_MODIFIED - return status - - # get the full hash of the current commit - _, current_ref = self._git_current_hash(repo_dir_path) - - if self._branch: - if self._url == LOCAL_PATH_INDICATOR: - expected_ref = self._branch - else: - remote_name = self._remote_name_for_url(self._url, - repo_dir_path) - if not remote_name: - # git doesn't know about this remote. by definition - # this is a modified state. - expected_ref = "unknown_remote/{0}".format(self._branch) - else: - expected_ref = "{0}/{1}".format(remote_name, self._branch) - elif self._hash: - expected_ref = self._hash - elif self._tag: - expected_ref = self._tag - else: - msg = 'In repo "{0}": none of branch, hash or tag are set'.format( - self._name) - fatal_error(msg) - - # record the *names* of the current and expected branches - stat.current_version = self._current_ref(repo_dir_path) - stat.expected_version = copy.deepcopy(expected_ref) - - if current_ref == EMPTY_STR: - stat.sync_state = ExternalStatus.UNKNOWN - else: - # get the underlying hash of the expected ref - revparse_status, expected_ref_hash = self._git_revparse_commit( - expected_ref, repo_dir_path) - if revparse_status: - # We failed to get the hash associated with - # expected_ref. Maybe we should assign this to some special - # status, but for now we're just calling this out-of-sync to - # remain consistent with how this worked before. - stat.sync_state = ExternalStatus.MODEL_MODIFIED - else: - # compare the underlying hashes - stat.sync_state = compare_refs(current_ref, expected_ref_hash) - - @classmethod - def _remote_name_for_url(cls, remote_url, dirname): - """Return the remote name matching remote_url (or None) - - """ - git_output = cls._git_remote_verbose(dirname) - git_output = git_output.splitlines() - for line in git_output: - data = line.strip() - if not data: - continue - data = data.split() - name = data[0].strip() - url = data[1].strip() - if remote_url == url: - return name - return None - - def _create_remote_name(self): - """The url specified in the externals description file was not known - to git. We need to add it, which means adding a unique and - safe name.... - - The assigned name needs to be safe for git to use, e.g. can't - look like a path 'foo/bar' and work with both remote and local paths. - - Remote paths include but are not limited to: git, ssh, https, - github, gitlab, bitbucket, custom server, etc. - - Local paths can be relative or absolute. They may contain - shell variables, e.g. ${REPO_ROOT}/repo_name, or username - expansion, i.e. ~/ or ~someuser/. - - Relative paths must be at least one layer of redirection, i.e. - container/../ext_repo, but may be many layers deep, e.g. - container/../../../../../ext_repo - - NOTE(bja, 2017-11) - - The base name below may not be unique, for example if the - user has local paths like: - - /path/to/my/repos/nice_repo - /path/to/other/repos/nice_repo - - But the current implementation should cover most common - use cases for remotes and still provide usable names. - - """ - url = copy.deepcopy(self._url) - if is_remote_url(url): - url = split_remote_url(url) - else: - url = expand_local_url(url, self._name) - url = url.split('/') - repo_name = url[-1] - base_name = url[-2] - # repo name should nominally already be something that git can - # deal with. We need to remove other possibly troublesome - # punctuation, e.g. /, $, from the base name. - unsafe_characters = '!@#$%^&*()[]{}\\/,;~' - for unsafe in unsafe_characters: - base_name = base_name.replace(unsafe, '') - remote_name = "{0}_{1}".format(base_name, repo_name) - return remote_name - - def _checkout_ref(self, repo_dir, verbosity, submodules): - """Checkout the user supplied reference - if is True, recursively initialize and update - the repo's submodules - """ - # import pdb; pdb.set_trace() - if self._url.strip() == LOCAL_PATH_INDICATOR: - self._checkout_local_ref(verbosity, submodules, repo_dir) - else: - self._checkout_external_ref(verbosity, submodules, repo_dir) - - if self._sparse: - self._sparse_checkout(repo_dir, verbosity) - - - def _checkout_local_ref(self, verbosity, submodules, dirname): - """Checkout the reference considering the local repo only. Do not - fetch any additional remotes or specify the remote when - checkout out the ref. - if is True, recursively initialize and update - the repo's submodules - """ - if self._tag: - ref = self._tag - elif self._branch: - ref = self._branch - else: - ref = self._hash - - self._check_for_valid_ref(ref, remote_name=None, - dirname=dirname) - self._git_checkout_ref(ref, verbosity, submodules, dirname) - - def _checkout_external_ref(self, verbosity, submodules, dirname): - """Checkout the reference from a remote repository into dirname. - if is True, recursively initialize and update - the repo's submodules. - Note that this results in a 'detached HEAD' state if checking out - a branch, because we check out the remote branch rather than the - local. See https://github.com/ESMCI/manage_externals/issues/34 for - more discussion. - """ - if self._tag: - ref = self._tag - elif self._branch: - ref = self._branch - else: - ref = self._hash - - remote_name = self._remote_name_for_url(self._url, dirname) - if not remote_name: - remote_name = self._create_remote_name() - self._git_remote_add(remote_name, self._url, dirname) - self._git_fetch(remote_name, dirname) - - # NOTE(bja, 2018-03) we need to send separate ref and remote - # name to check_for_vaild_ref, but the combined name to - # checkout_ref! - self._check_for_valid_ref(ref, remote_name, dirname) - - if self._branch: - # Prepend remote name to branch. This means we avoid various - # special cases if the local branch is not tracking the remote or - # cannot be trivially fast-forwarded to match; but, it also - # means we end up in a 'detached HEAD' state. - ref = '{0}/{1}'.format(remote_name, ref) - self._git_checkout_ref(ref, verbosity, submodules, dirname) - - def _sparse_checkout(self, repo_dir, verbosity): - """Use git read-tree to thin the working tree.""" - cmd = ['cp', os.path.join(repo_dir, self._sparse), - os.path.join(repo_dir, - '.git/info/sparse-checkout')] - if verbosity >= VERBOSITY_VERBOSE: - printlog(' {0}'.format(' '.join(cmd))) - execute_subprocess(cmd) - self._git_sparse_checkout(verbosity, repo_dir) - - def _check_for_valid_ref(self, ref, remote_name, dirname): - """Try some basic sanity checks on the user supplied reference so we - can provide a more useful error message than calledprocess - error... - - remote_name can be NOne - """ - is_tag = self._ref_is_tag(ref, dirname) - is_branch = self._ref_is_branch(ref, remote_name, dirname) - is_hash = self._ref_is_hash(ref, dirname) - is_valid = is_tag or is_branch or is_hash - if not is_valid: - msg = ('In repo "{0}": reference "{1}" does not appear to be a ' - 'valid tag, branch or hash! Please verify the reference ' - 'name (e.g. spelling), is available from: {2} '.format( - self._name, ref, self._url)) - fatal_error(msg) - - if is_tag: - is_unique_tag, msg = self._is_unique_tag(ref, remote_name, - dirname) - if not is_unique_tag: - msg = ('In repo "{0}": tag "{1}" {2}'.format( - self._name, self._tag, msg)) - fatal_error(msg) - - return is_valid - - def _is_unique_tag(self, ref, remote_name, dirname): - """Verify that a reference is a valid tag and is unique (not a branch) - - Tags may be tag names, or SHA id's. It is also possible that a - branch and tag have the some name. - - Note: values returned by git_showref_* and git_revparse are - shell return codes, which are zero for success, non-zero for - error! - - """ - is_tag = self._ref_is_tag(ref, dirname) - is_branch = self._ref_is_branch(ref, remote_name, dirname) - is_hash = self._ref_is_hash(ref, dirname) - - msg = '' - is_unique_tag = False - if is_tag and not is_branch: - # unique tag - msg = 'is ok' - is_unique_tag = True - elif is_tag and is_branch: - msg = ('is both a branch and a tag. git may checkout the branch ' - 'instead of the tag depending on your version of git.') - is_unique_tag = False - elif not is_tag and is_branch: - msg = ('is a branch, and not a tag. If you intended to checkout ' - 'a branch, please change the externals description to be ' - 'a branch. If you intended to checkout a tag, it does not ' - 'exist. Please check the name.') - is_unique_tag = False - else: # not is_tag and not is_branch: - if is_hash: - # probably a sha1 or HEAD, etc, we call it a tag - msg = 'is ok' - is_unique_tag = True - else: - # undetermined state. - msg = ('does not appear to be a valid tag, branch or hash! ' - 'Please check the name and repository.') - is_unique_tag = False - - return is_unique_tag, msg - - def _ref_is_tag(self, ref, dirname): - """Verify that a reference is a valid tag according to git. - - Note: values returned by git_showref_* and git_revparse are - shell return codes, which are zero for success, non-zero for - error! - """ - is_tag = False - value = self._git_showref_tag(ref, dirname) - if value == 0: - is_tag = True - return is_tag - - def _ref_is_branch(self, ref, remote_name, dirname): - """Verify if a ref is any kind of branch (local, tracked remote, - untracked remote). - - remote_name can be None. - """ - local_branch = False - remote_branch = False - if remote_name: - remote_branch = self._ref_is_remote_branch(ref, remote_name, - dirname) - local_branch = self._ref_is_local_branch(ref, dirname) - - is_branch = False - if local_branch or remote_branch: - is_branch = True - return is_branch - - def _ref_is_local_branch(self, ref, dirname): - """Verify that a reference is a valid branch according to git. - - show-ref branch returns local branches that have been - previously checked out. It will not necessarily pick up - untracked remote branches. - - Note: values returned by git_showref_* and git_revparse are - shell return codes, which are zero for success, non-zero for - error! - - """ - is_branch = False - value = self._git_showref_branch(ref, dirname) - if value == 0: - is_branch = True - return is_branch - - def _ref_is_remote_branch(self, ref, remote_name, dirname): - """Verify that a reference is a valid branch according to git. - - show-ref branch returns local branches that have been - previously checked out. It will not necessarily pick up - untracked remote branches. - - Note: values returned by git_showref_* and git_revparse are - shell return codes, which are zero for success, non-zero for - error! - - """ - is_branch = False - value = self._git_lsremote_branch(ref, remote_name, dirname) - if value == 0: - is_branch = True - return is_branch - - def _ref_is_commit(self, ref, dirname): - """Verify that a reference is a valid commit according to git. - - This could be a tag, branch, sha1 id, HEAD and potentially others... - - Note: values returned by git_showref_* and git_revparse are - shell return codes, which are zero for success, non-zero for - error! - """ - is_commit = False - value, _ = self._git_revparse_commit(ref, dirname) - if value == 0: - is_commit = True - return is_commit - - def _ref_is_hash(self, ref, dirname): - """Verify that a reference is a valid hash according to git. - - Git doesn't seem to provide an exact way to determine if user - supplied reference is an actual hash. So we verify that the - ref is a valid commit and return the underlying commit - hash. Then check that the commit hash begins with the user - supplied string. - - Note: values returned by git_showref_* and git_revparse are - shell return codes, which are zero for success, non-zero for - error! - - """ - is_hash = False - status, git_output = self._git_revparse_commit(ref, dirname) - if status == 0: - if git_output.strip().startswith(ref): - is_hash = True - return is_hash - - def _status_summary(self, stat, repo_dir_path): - """Determine the clean/dirty status of a git repository - - """ - git_output = self._git_status_porcelain_v1z(repo_dir_path) - is_dirty = self._status_v1z_is_dirty(git_output) - if is_dirty: - stat.clean_state = ExternalStatus.DIRTY - else: - stat.clean_state = ExternalStatus.STATUS_OK - - # Now save the verbose status output incase the user wants to - # see it. - stat.status_output = self._git_status_verbose(repo_dir_path) - - @staticmethod - def _status_v1z_is_dirty(git_output): - """Parse the git status output from --porcelain=v1 -z and determine if - the repo status is clean or dirty. Dirty means: - - * modified files - * missing files - * added files - * removed - * renamed - * unmerged - - Whether untracked files are considered depends on how the status - command was run (i.e., whether it was run with the '-u' option). - - NOTE: Based on the above definition, the porcelain status - should be an empty string to be considered 'clean'. Of course - this assumes we only get an empty string from an status - command on a clean checkout, and not some error - condition... Could alse use 'git diff --quiet'. - - """ - is_dirty = False - if git_output: - is_dirty = True - return is_dirty - - # ---------------------------------------------------------------- - # - # system call to git for information gathering - # - # ---------------------------------------------------------------- - @staticmethod - def _git_current_hash(dirname): - """Return the full hash of the currently checked-out version. - - Returns a tuple, (hash_found, hash), where hash_found is a - logical specifying whether a hash was found for HEAD (False - could mean we're not in a git repository at all). (If hash_found - is False, then hash is ''.) - """ - status, git_output = GitRepository._git_revparse_commit("HEAD", - dirname) - hash_found = not status - if not hash_found: - git_output = '' - return hash_found, git_output - - @staticmethod - def _git_current_remote_branch(dirname): - """Determines the name of the current remote branch, if any. - - if dir is None, uses the cwd. - - Returns a tuple, (branch_found, branch_name), where branch_found - is a bool specifying whether a branch name was found for - HEAD. (If branch_found is False, then branch_name is ''). - branch_name is in the format '$remote/$branch', e.g. 'origin/foo'. - """ - branch_found = False - branch_name = '' - - cmd = 'git -C {dirname} log -n 1 --pretty=%d HEAD'.format( - dirname=dirname).split() - status, git_output = execute_subprocess(cmd, - output_to_caller=True, - status_to_caller=True) - branch_found = 'HEAD,' in git_output - if branch_found: - # git_output is of the form " (HEAD, origin/blah)" - branch_name = git_output.split(',')[1].strip()[:-1] - return branch_found, branch_name - - @staticmethod - def _git_current_branch(dirname): - """Determines the name of the current local branch. - - Returns a tuple, (branch_found, branch_name), where branch_found - is a bool specifying whether a branch name was found for - HEAD. (If branch_found is False, then branch_name is ''.) - Note that currently we check out the remote branch rather than - the local, so this command does not return the just-checked-out - branch. See _git_current_remote_branch. - """ - cmd = 'git -C {dirname} symbolic-ref --short -q HEAD'.format( - dirname=dirname).split() - status, git_output = execute_subprocess(cmd, - output_to_caller=True, - status_to_caller=True) - branch_found = not status - if branch_found: - git_output = git_output.strip() - else: - git_output = '' - return branch_found, git_output - - @staticmethod - def _git_current_tag(dirname): - """Determines the name tag corresponding to HEAD (if any). - - if dirname is None, uses the cwd. - - Returns a tuple, (tag_found, tag_name), where tag_found is a - bool specifying whether we found a tag name corresponding to - HEAD. (If tag_found is False, then tag_name is ''.) - """ - cmd = 'git -C {dirname} describe --exact-match --tags HEAD'.format( - dirname=dirname).split() - status, git_output = execute_subprocess(cmd, - output_to_caller=True, - status_to_caller=True) - tag_found = not status - if tag_found: - git_output = git_output.strip() - else: - git_output = '' - return tag_found, git_output - - @staticmethod - def _git_showref_tag(ref, dirname): - """Run git show-ref check if the user supplied ref is a tag. - - could also use git rev-parse --quiet --verify tagname^{tag} - """ - cmd = ('git -C {dirname} show-ref --quiet --verify refs/tags/{ref}' - .format(dirname=dirname, ref=ref).split()) - status = execute_subprocess(cmd, status_to_caller=True) - return status - - @staticmethod - def _git_showref_branch(ref, dirname): - """Run git show-ref check if the user supplied ref is a local or - tracked remote branch. - - """ - cmd = ('git -C {dirname} show-ref --quiet --verify refs/heads/{ref}' - .format(dirname=dirname, ref=ref).split()) - status = execute_subprocess(cmd, status_to_caller=True) - return status - - @staticmethod - def _git_lsremote_branch(ref, remote_name, dirname): - """Run git ls-remote to check if the user supplied ref is a remote - branch that is not being tracked - - """ - cmd = ('git -C {dirname} ls-remote --exit-code --heads ' - '{remote_name} {ref}').format( - dirname=dirname, remote_name=remote_name, ref=ref).split() - status, output = execute_subprocess(cmd, status_to_caller=True, output_to_caller=True) - if not status and not f"refs/heads/{ref}" in output: - # In this case the ref is contained in the branch name but is not the complete branch name - return -1 - return status - - @staticmethod - def _git_revparse_commit(ref, dirname): - """Run git rev-parse to detect if a reference is a SHA, HEAD or other - valid commit. - - """ - cmd = ('git -C {dirname} rev-parse --quiet --verify {ref}^{commit}' - .format(dirname=dirname, ref=ref, commit='{commit}').split()) - status, git_output = execute_subprocess(cmd, status_to_caller=True, - output_to_caller=True) - git_output = git_output.strip() - return status, git_output - - @staticmethod - def _git_status_porcelain_v1z(dirname): - """Run git status to obtain repository information. - - This is run with '--untracked=no' to ignore untracked files. - - The machine-portable format that is guaranteed not to change - between git versions or *user configuration*. - - """ - cmd = ('git -C {dirname} status --untracked-files=no --porcelain -z' - .format(dirname=dirname)).split() - git_output = execute_subprocess(cmd, output_to_caller=True) - return git_output - - @staticmethod - def _git_status_verbose(dirname): - """Run the git status command to obtain repository information. - """ - cmd = 'git -C {dirname} status'.format(dirname=dirname).split() - git_output = execute_subprocess(cmd, output_to_caller=True) - return git_output - - @staticmethod - def _git_remote_verbose(dirname): - """Run the git remote command to obtain repository information. - - Returned string is of the form: - myfork git@github.com:johnpaulalex/manage_externals_jp.git (fetch) - myfork git@github.com:johnpaulalex/manage_externals_jp.git (push) - """ - cmd = 'git -C {dirname} remote --verbose'.format( - dirname=dirname).split() - return execute_subprocess(cmd, output_to_caller=True) - - @staticmethod - def has_submodules(repo_dir_path): - """Return True iff the repository at has a - '.gitmodules' file - """ - fname = os.path.join(repo_dir_path, - ExternalsDescription.GIT_SUBMODULES_FILENAME) - - return os.path.exists(fname) - - # ---------------------------------------------------------------- - # - # system call to git for sideffects modifying the working tree - # - # ---------------------------------------------------------------- - @staticmethod - def _git_clone(url, repo_dir_name, verbosity): - """Clones url into repo_dir_name. - """ - cmd = 'git clone --quiet {url} {repo_dir_name}'.format( - url=url, repo_dir_name=repo_dir_name).split() - if verbosity >= VERBOSITY_VERBOSE: - printlog(' {0}'.format(' '.join(cmd))) - execute_subprocess(cmd) - - @staticmethod - def _git_remote_add(name, url, dirname): - """Run the git remote command for the side effect of adding a remote - """ - cmd = 'git -C {dirname} remote add {name} {url}'.format( - dirname=dirname, name=name, url=url).split() - execute_subprocess(cmd) - - @staticmethod - def _git_fetch(remote_name, dirname): - """Run the git fetch command for the side effect of updating the repo - """ - cmd = 'git -C {dirname} fetch --quiet --tags {remote_name}'.format( - dirname=dirname, remote_name=remote_name).split() - execute_subprocess(cmd) - - @staticmethod - def _git_checkout_ref(ref, verbosity, submodules, dirname): - """Run the git checkout command for the side effect of updating the repo - - Param: ref is a reference to a local or remote object in the - form 'origin/my_feature', or 'tag1'. - - """ - cmd = 'git -C {dirname} checkout --quiet {ref}'.format( - dirname=dirname, ref=ref).split() - if verbosity >= VERBOSITY_VERBOSE: - printlog(' {0}'.format(' '.join(cmd))) - execute_subprocess(cmd) - if submodules: - GitRepository._git_update_submodules(verbosity, dirname) - - @staticmethod - def _git_sparse_checkout(verbosity, dirname): - """Configure repo via read-tree.""" - cmd = 'git -C {dirname} config core.sparsecheckout true'.format( - dirname=dirname).split() - if verbosity >= VERBOSITY_VERBOSE: - printlog(' {0}'.format(' '.join(cmd))) - execute_subprocess(cmd) - cmd = 'git -C {dirname} read-tree -mu HEAD'.format( - dirname=dirname).split() - if verbosity >= VERBOSITY_VERBOSE: - printlog(' {0}'.format(' '.join(cmd))) - execute_subprocess(cmd) - - @staticmethod - def _git_update_submodules(verbosity, dirname): - """Run git submodule update for the side effect of updating this - repo's submodules. - """ - # due to https://vielmetti.typepad.com/logbook/2022/10/git-security-fixes-lead-to-fatal-transport-file-not-allowed-error-in-ci-systems-cve-2022-39253.html - # submodules from file doesn't work without overriding the protocol, this is done - # for testing submodule support but should not be done in practice - file_protocol = "" - if 'unittest' in sys.modules.keys(): - file_protocol = "-c protocol.file.allow=always" - - # First, verify that we have a .gitmodules file - if os.path.exists( - os.path.join(dirname, - ExternalsDescription.GIT_SUBMODULES_FILENAME)): - cmd = ('git {file_protocol} -C {dirname} submodule update --init --recursive' - .format(file_protocol=file_protocol, dirname=dirname)).split() - if verbosity >= VERBOSITY_VERBOSE: - printlog(' {0}'.format(' '.join(cmd))) - - execute_subprocess(cmd) diff --git a/manage_externals/manic/repository_svn.py b/manage_externals/manic/repository_svn.py deleted file mode 100644 index 32a71184b4..0000000000 --- a/manage_externals/manic/repository_svn.py +++ /dev/null @@ -1,291 +0,0 @@ -"""Class for interacting with svn repositories -""" - -from __future__ import absolute_import -from __future__ import unicode_literals -from __future__ import print_function - -import os -import re -import xml.etree.ElementTree as ET - -from .global_constants import EMPTY_STR, VERBOSITY_VERBOSE -from .repository import Repository -from .externals_status import ExternalStatus -from .utils import fatal_error, indent_string, printlog -from .utils import execute_subprocess - - -class SvnRepository(Repository): - """ - Class to represent and operate on a repository description. - - For testing purpose, all system calls to svn should: - - * be isolated in separate functions with no application logic - * of the form: - - cmd = ['svn', ...] - - value = execute_subprocess(cmd, output_to_caller={T|F}, - status_to_caller={T|F}) - - return value - * be static methods (not rely on self) - * name as _svn_subcommand_args(user_args) - - This convention allows easy unit testing of the repository logic - by mocking the specific calls to return predefined results. - - """ - RE_URLLINE = re.compile(r'^URL:') - - def __init__(self, component_name, repo, ignore_ancestry=False): - """ - Parse repo (a XML element). - """ - Repository.__init__(self, component_name, repo) - if 'github.com' in self._url: - msg = "SVN access to github.com is no longer supported" - fatal_error(msg) - self._ignore_ancestry = ignore_ancestry - if self._url.endswith('/'): - # there is already a '/' separator in the URL; no need to add another - url_sep = '' - else: - url_sep = '/' - if self._branch: - self._url = self._url + url_sep + self._branch - elif self._tag: - self._url = self._url + url_sep + self._tag - else: - msg = "DEV_ERROR in svn repository. Shouldn't be here!" - fatal_error(msg) - - # ---------------------------------------------------------------- - # - # Public API, defined by Repository - # - # ---------------------------------------------------------------- - def checkout(self, base_dir_path, repo_dir_name, verbosity, recursive): # pylint: disable=unused-argument - """Checkout or update the working copy - - If the repo destination directory exists, switch the sandbox to - match the externals description. - - If the repo destination directory does not exist, checkout the - correct branch or tag. - NB: is include as an argument for compatibility with - git functionality (repository_git.py) - - """ - repo_dir_path = os.path.join(base_dir_path, repo_dir_name) - if os.path.exists(repo_dir_path): - cwd = os.getcwd() - os.chdir(repo_dir_path) - self._svn_switch(self._url, self._ignore_ancestry, verbosity) - # svn switch can lead to a conflict state, but it gives a - # return code of 0. So now we need to make sure that we're - # in a clean (non-conflict) state. - self._abort_if_dirty(repo_dir_path, - "Expected clean state following switch") - os.chdir(cwd) - else: - self._svn_checkout(self._url, repo_dir_path, verbosity) - - def status(self, stat, repo_dir_path): - """ - Check and report the status of the repository - """ - self._check_sync(stat, repo_dir_path) - if os.path.exists(repo_dir_path): - self._status_summary(stat, repo_dir_path) - - # ---------------------------------------------------------------- - # - # Internal work functions - # - # ---------------------------------------------------------------- - def _check_sync(self, stat, repo_dir_path): - """Check to see if repository directory exists and is at the expected - url. Return: status object - - """ - if not os.path.exists(repo_dir_path): - # NOTE(bja, 2017-10) this state should have been handled by - # the source object and we never get here! - stat.sync_state = ExternalStatus.STATUS_ERROR - else: - svn_output = self._svn_info(repo_dir_path) - if not svn_output: - # directory exists, but info returned nothing. .svn - # directory removed or incomplete checkout? - stat.sync_state = ExternalStatus.UNKNOWN - else: - stat.sync_state, stat.current_version = \ - self._check_url(svn_output, self._url) - stat.expected_version = '/'.join(self._url.split('/')[3:]) - - def _abort_if_dirty(self, repo_dir_path, message): - """Check if the repo is in a dirty state; if so, abort with a - helpful message. - - """ - - stat = ExternalStatus() - self._status_summary(stat, repo_dir_path) - if stat.clean_state != ExternalStatus.STATUS_OK: - status = self._svn_status_verbose(repo_dir_path) - status = indent_string(status, 4) - errmsg = """In directory - {cwd} - -svn status now shows: -{status} - -ERROR: {message} - -One possible cause of this problem is that there may have been untracked -files in your working directory that had the same name as tracked files -in the new revision. - -To recover: Clean up the above directory (resolving conflicts, etc.), -then rerun checkout_externals. -""".format(cwd=repo_dir_path, message=message, status=status) - - fatal_error(errmsg) - - @staticmethod - def _check_url(svn_output, expected_url): - """Determine the svn url from svn info output and return whether it - matches the expected value. - - """ - url = None - for line in svn_output.splitlines(): - if SvnRepository.RE_URLLINE.match(line): - url = line.split(': ')[1].strip() - break - if not url: - status = ExternalStatus.UNKNOWN - elif url == expected_url: - status = ExternalStatus.STATUS_OK - else: - status = ExternalStatus.MODEL_MODIFIED - - if url: - current_version = '/'.join(url.split('/')[3:]) - else: - current_version = EMPTY_STR - - return status, current_version - - def _status_summary(self, stat, repo_dir_path): - """Report whether the svn repository is in-sync with the model - description and whether the sandbox is clean or dirty. - - """ - svn_output = self._svn_status_xml(repo_dir_path) - is_dirty = self.xml_status_is_dirty(svn_output) - if is_dirty: - stat.clean_state = ExternalStatus.DIRTY - else: - stat.clean_state = ExternalStatus.STATUS_OK - - # Now save the verbose status output incase the user wants to - # see it. - stat.status_output = self._svn_status_verbose(repo_dir_path) - - @staticmethod - def xml_status_is_dirty(svn_output): - """Parse svn status xml output and determine if the working copy is - clean or dirty. Dirty is defined as: - - * modified files - * added files - * deleted files - * missing files - - Unversioned files do not affect the clean/dirty status. - - 'external' is also an acceptable state - - """ - # pylint: disable=invalid-name - SVN_EXTERNAL = 'external' - SVN_UNVERSIONED = 'unversioned' - # pylint: enable=invalid-name - - is_dirty = False - try: - xml_status = ET.fromstring(svn_output) - except BaseException: - fatal_error( - "SVN returned invalid XML message {}".format(svn_output)) - xml_target = xml_status.find('./target') - entries = xml_target.findall('./entry') - for entry in entries: - status = entry.find('./wc-status') - item = status.get('item') - if item == SVN_EXTERNAL: - continue - if item == SVN_UNVERSIONED: - continue - is_dirty = True - break - return is_dirty - - # ---------------------------------------------------------------- - # - # system call to svn for information gathering - # - # ---------------------------------------------------------------- - @staticmethod - def _svn_info(repo_dir_path): - """Return results of svn info command - """ - cmd = ['svn', 'info', repo_dir_path] - output = execute_subprocess(cmd, output_to_caller=True) - return output - - @staticmethod - def _svn_status_verbose(repo_dir_path): - """capture the full svn status output - """ - cmd = ['svn', 'status', repo_dir_path] - svn_output = execute_subprocess(cmd, output_to_caller=True) - return svn_output - - @staticmethod - def _svn_status_xml(repo_dir_path): - """ - Get status of the subversion sandbox in repo_dir - """ - cmd = ['svn', 'status', '--xml', repo_dir_path] - svn_output = execute_subprocess(cmd, output_to_caller=True) - return svn_output - - # ---------------------------------------------------------------- - # - # system call to svn for sideffects modifying the working tree - # - # ---------------------------------------------------------------- - @staticmethod - def _svn_checkout(url, repo_dir_path, verbosity): - """ - Checkout a subversion repository (repo_url) to checkout_dir. - """ - cmd = ['svn', 'checkout', '--quiet', url, repo_dir_path] - if verbosity >= VERBOSITY_VERBOSE: - printlog(' {0}'.format(' '.join(cmd))) - execute_subprocess(cmd) - - @staticmethod - def _svn_switch(url, ignore_ancestry, verbosity): - """ - Switch branches for in an svn sandbox - """ - cmd = ['svn', 'switch', '--quiet'] - if ignore_ancestry: - cmd.append('--ignore-ancestry') - cmd.append(url) - if verbosity >= VERBOSITY_VERBOSE: - printlog(' {0}'.format(' '.join(cmd))) - execute_subprocess(cmd) diff --git a/manage_externals/manic/sourcetree.py b/manage_externals/manic/sourcetree.py deleted file mode 100644 index cf2a5b7569..0000000000 --- a/manage_externals/manic/sourcetree.py +++ /dev/null @@ -1,425 +0,0 @@ -""" -Classes to represent an externals config file (SourceTree) and the components -within it (_External). -""" - -import errno -import logging -import os - -from .externals_description import ExternalsDescription -from .externals_description import read_externals_description_file -from .externals_description import create_externals_description -from .repository_factory import create_repository -from .repository_git import GitRepository -from .externals_status import ExternalStatus -from .utils import fatal_error, printlog -from .global_constants import EMPTY_STR, LOCAL_PATH_INDICATOR -from .global_constants import VERBOSITY_VERBOSE - -class _External(object): - """ - A single component hosted in an external repository (and any children). - - The component may or may not be checked-out upon construction. - """ - # pylint: disable=R0902 - - def __init__(self, root_dir, name, local_path, required, subexternals_path, - repo, svn_ignore_ancestry, subexternal_sourcetree): - """Create a single external component (checked out or not). - - Input: - root_dir : string - the (checked-out) parent repo's root dir. - local_path : string - this external's (checked-out) subdir relative - to root_dir, e.g. "components/mom" - repo: Repository - the repo object for this external. Can be None (e.g. if this external just refers to another external file). - - name : string - name of this external (as named by the parent - reference). May or may not correspond to something in the path. - - ext_description : dict - source ExternalsDescription object - - svn_ignore_ancestry : bool - use --ignore-externals with svn switch - - subexternals_path: string - path to sub-externals config file, if any. Relative to local_path, or special value 'none'. - subexternal_sourcetree: SourceTree - corresponding to subexternals_path, if subexternals_path exists (it might not, if it is not checked out yet). - """ - self._name = name - self._required = required - - self._stat = None # Populated in status() - - self._local_path = local_path - # _repo_dir_path : full repository directory, e.g. - # "/components/mom" - repo_dir = os.path.join(root_dir, local_path) - self._repo_dir_path = os.path.abspath(repo_dir) - # _base_dir_path : base directory *containing* the repository, e.g. - # "/components" - self._base_dir_path = os.path.dirname(self._repo_dir_path) - # _repo_dir_name : base_dir_path + repo_dir_name = repo_dir_path - # e.g., "mom" - self._repo_dir_name = os.path.basename(self._repo_dir_path) - self._repo = repo - - # Does this component have subcomponents aka an externals config? - self._subexternals_path = subexternals_path - self._subexternal_sourcetree = subexternal_sourcetree - - - def get_name(self): - """ - Return the external object's name - """ - return self._name - - def get_local_path(self): - """ - Return the external object's path - """ - return self._local_path - - def get_repo_dir_path(self): - return self._repo_dir_path - - def get_subexternals_path(self): - return self._subexternals_path - - def get_repo(self): - return self._repo - - def status(self, force=False, print_progress=False): - """ - Returns status of this component and all subcomponents. - - Returns a dict mapping our local path (not component name!) to an - ExternalStatus dict. Any subcomponents will have their own top-level - path keys. Note the return value includes entries for this and all - subcomponents regardless of whether they are locally installed or not. - - Side-effect: If self._stat is empty or force is True, calculates _stat. - """ - calc_stat = force or not self._stat - - if calc_stat: - self._stat = ExternalStatus() - self._stat.path = self.get_local_path() - if not self._required: - self._stat.source_type = ExternalStatus.OPTIONAL - elif self._local_path == LOCAL_PATH_INDICATOR: - # LOCAL_PATH_INDICATOR, '.' paths, are standalone - # component directories that are not managed by - # checkout_subexternals. - self._stat.source_type = ExternalStatus.STANDALONE - else: - # managed by checkout_subexternals - self._stat.source_type = ExternalStatus.MANAGED - - subcomponent_stats = {} - if not os.path.exists(self._repo_dir_path): - if calc_stat: - # No local repository. - self._stat.sync_state = ExternalStatus.EMPTY - msg = ('status check: repository directory for "{0}" does not ' - 'exist.'.format(self._name)) - logging.info(msg) - self._stat.current_version = 'not checked out' - # NOTE(bja, 2018-01) directory doesn't exist, so we cannot - # use repo to determine the expected version. We just take - # a best-guess based on the assumption that only tag or - # branch should be set, but not both. - if not self._repo: - self._stat.expected_version = 'unknown' - else: - self._stat.expected_version = self._repo.tag() + self._repo.branch() - else: - # Merge local repository state (e.g. clean/dirty) into self._stat. - if calc_stat and self._repo: - self._repo.status(self._stat, self._repo_dir_path) - - # Status of subcomponents, if any. - if self._subexternals_path and self._subexternal_sourcetree: - cwd = os.getcwd() - # SourceTree.status() expects to be called from the correct - # root directory. - os.chdir(self._repo_dir_path) - subcomponent_stats = self._subexternal_sourcetree.status(self._local_path, force=force, print_progress=print_progress) - os.chdir(cwd) - - # Merge our status + subcomponent statuses into one return dict keyed - # by component path. - all_stats = {} - # don't add the root component because we don't manage it - # and can't provide useful info about it. - if self._local_path != LOCAL_PATH_INDICATOR: - # store the stats under the local_path, not comp name so - # it will be sorted correctly - all_stats[self._stat.path] = self._stat - - if subcomponent_stats: - all_stats.update(subcomponent_stats) - - return all_stats - - def checkout(self, verbosity): - """ - If the repo destination directory exists, ensure it is correct (from - correct URL, correct branch or tag), and possibly updateit. - If the repo destination directory does not exist, checkout the correct - branch or tag. - Does not check out sub-externals, see SourceTree.checkout(). - """ - # Make sure we are in correct location - if not os.path.exists(self._repo_dir_path): - # repository directory doesn't exist. Need to check it - # out, and for that we need the base_dir_path to exist - try: - os.makedirs(self._base_dir_path) - except OSError as error: - if error.errno != errno.EEXIST: - msg = 'Could not create directory "{0}"'.format( - self._base_dir_path) - fatal_error(msg) - - if not self._stat: - self.status() - assert self._stat - - if self._stat.source_type != ExternalStatus.STANDALONE: - if verbosity >= VERBOSITY_VERBOSE: - # NOTE(bja, 2018-01) probably do not want to pass - # verbosity in this case, because if (verbosity == - # VERBOSITY_DUMP), then the previous status output would - # also be dumped, adding noise to the output. - self._stat.log_status_message(VERBOSITY_VERBOSE) - - if self._repo: - if self._stat.sync_state == ExternalStatus.STATUS_OK: - # If we're already in sync, avoid showing verbose output - # from the checkout command, unless the verbosity level - # is 2 or more. - checkout_verbosity = verbosity - 1 - else: - checkout_verbosity = verbosity - - self._repo.checkout(self._base_dir_path, self._repo_dir_name, - checkout_verbosity, self.clone_recursive()) - - def replace_subexternal_sourcetree(self, sourcetree): - self._subexternal_sourcetree = sourcetree - - def clone_recursive(self): - 'Return True iff any .gitmodules files should be processed' - # Try recursive .gitmodules unless there is an externals entry - recursive = not self._subexternals_path - - return recursive - - -class SourceTree(object): - """ - SourceTree represents a group of managed externals. - - Those externals may not be checked out locally yet, they might only - have Repository objects pointing to their respective repositories. - """ - - @classmethod - def from_externals_file(cls, parent_repo_dir_path, parent_repo, - externals_path): - """Creates a SourceTree representing the given externals file. - - Looks up a git submodules file as an optional backup if there is no - externals file specified. - - Returns None if there is no externals file (i.e. it's None or 'none'), - or if the externals file hasn't been checked out yet. - - parent_repo_dir_path: parent repo root dir - parent_repo: parent repo. - externals_path: path to externals file, relative to parent_repo_dir_path. - """ - if not os.path.exists(parent_repo_dir_path): - # NOTE(bja, 2017-10) repository has not been checked out - # yet, can't process the externals file. Assume we are - # checking status before code is checkoud out and this - # will be handled correctly later. - return None - - if externals_path.lower() == 'none': - # With explicit 'none', do not look for git submodules file. - return None - - cwd = os.getcwd() - os.chdir(parent_repo_dir_path) - - if not externals_path: - if GitRepository.has_submodules(parent_repo_dir_path): - externals_path = ExternalsDescription.GIT_SUBMODULES_FILENAME - else: - return None - - if not os.path.exists(externals_path): - # NOTE(bja, 2017-10) this check is redundant with the one - # in read_externals_description_file! - msg = ('Externals description file "{0}" ' - 'does not exist! In directory: {1}'.format( - externals_path, parent_repo_dir_path)) - fatal_error(msg) - - externals_root = parent_repo_dir_path - # model_data is a dict-like object which mirrors the file format. - model_data = read_externals_description_file(externals_root, - externals_path) - # ext_description is another dict-like object (see ExternalsDescription) - ext_description = create_externals_description(model_data, - parent_repo=parent_repo) - externals_sourcetree = SourceTree(externals_root, ext_description) - os.chdir(cwd) - return externals_sourcetree - - def __init__(self, root_dir, ext_description, svn_ignore_ancestry=False): - """ - Build a SourceTree object from an ExternalDescription. - - root_dir: the (checked-out) parent repo root dir. - """ - self._root_dir = os.path.abspath(root_dir) - self._all_components = {} # component_name -> _External - self._required_compnames = [] - for comp, desc in ext_description.items(): - local_path = desc[ExternalsDescription.PATH] - required = desc[ExternalsDescription.REQUIRED] - repo_info = desc[ExternalsDescription.REPO] - subexternals_path = desc[ExternalsDescription.EXTERNALS] - - repo = create_repository(comp, - repo_info, - svn_ignore_ancestry=svn_ignore_ancestry) - - sourcetree = None - # Treat a .gitmodules file as a backup externals config - if not subexternals_path: - parent_repo_dir_path = os.path.abspath(os.path.join(root_dir, - local_path)) - if GitRepository.has_submodules(parent_repo_dir_path): - subexternals_path = ExternalsDescription.GIT_SUBMODULES_FILENAME - - # Might return None (if the subexternal isn't checked out yet, or subexternal is None or 'none') - subexternal_sourcetree = SourceTree.from_externals_file( - os.path.join(self._root_dir, local_path), - repo, - subexternals_path) - src = _External(self._root_dir, comp, local_path, required, - subexternals_path, repo, svn_ignore_ancestry, - subexternal_sourcetree) - - self._all_components[comp] = src - if required: - self._required_compnames.append(comp) - - def status(self, relative_path_base=LOCAL_PATH_INDICATOR, - force=False, print_progress=False): - """Return a dictionary of local path->ExternalStatus. - - Notes about the returned dictionary: - * It is keyed by local path (e.g. 'components/mom'), not by - component name (e.g. 'mom'). - * It contains top-level keys for all traversed components, whether - discovered by recursion or top-level. - * It contains entries for all components regardless of whether they - are locally installed or not, or required or optional. -x """ - load_comps = self._all_components.keys() - - summary = {} # Holds merged statuses from all components. - for comp in load_comps: - if print_progress: - printlog('{0}, '.format(comp), end='') - stat = self._all_components[comp].status(force=force, - print_progress=print_progress) - - # Returned status dictionary is keyed by local path; prepend - # relative_path_base if not already there. - stat_final = {} - for name in stat.keys(): - if stat[name].path.startswith(relative_path_base): - stat_final[name] = stat[name] - else: - modified_path = os.path.join(relative_path_base, - stat[name].path) - stat_final[modified_path] = stat[name] - stat_final[modified_path].path = modified_path - summary.update(stat_final) - - return summary - - def _find_installed_optional_components(self): - """Returns a list of installed optional component names, if any.""" - installed_comps = [] - for comp_name, ext in self._all_components.items(): - if comp_name in self._required_compnames: - continue - # Note that in practice we expect this status to be cached. - path_to_stat = ext.status() - - # If any part of this component exists locally, consider it - # installed and therefore eligible for updating. - if any(s.sync_state != ExternalStatus.EMPTY - for s in path_to_stat.values()): - installed_comps.append(comp_name) - return installed_comps - - def checkout(self, verbosity, load_all, load_comp=None): - """ - Checkout or update indicated components into the configured subdirs. - - If load_all is True, checkout all externals (required + optional), recursively. - If load_all is False and load_comp is set, checkout load_comp (and any required subexternals, plus any optional subexternals that are already checked out, recursively) - If load_all is False and load_comp is None, checkout all required externals, plus any optionals that are already checked out, recursively. - """ - if load_all: - tmp_comps = self._all_components.keys() - elif load_comp is not None: - tmp_comps = [load_comp] - else: - local_optional_compnames = self._find_installed_optional_components() - tmp_comps = self._required_compnames + local_optional_compnames - if local_optional_compnames: - printlog('Found locally installed optional components: ' + - ', '.join(local_optional_compnames)) - bad_compnames = set(local_optional_compnames) - set(self._all_components.keys()) - if bad_compnames: - printlog('Internal error: found locally installed components that are not in the global list of all components: ' + ','.join(bad_compnames)) - - if verbosity >= VERBOSITY_VERBOSE: - printlog('Checking out externals: ') - else: - printlog('Checking out externals: ', end='') - - # Sort by path so that if paths are nested the - # parent repo is checked out first. - load_comps = sorted(tmp_comps, key=lambda comp: self._all_components[comp].get_local_path()) - - # checkout. - for comp_name in load_comps: - if verbosity < VERBOSITY_VERBOSE: - printlog('{0}, '.format(comp_name), end='') - else: - # verbose output handled by the _External object, just - # output a newline - printlog(EMPTY_STR) - c = self._all_components[comp_name] - # Does not recurse. - c.checkout(verbosity) - # Recursively check out subexternals, if any. Returns None - # if there's no subexternals path. - component_subexternal_sourcetree = SourceTree.from_externals_file( - c.get_repo_dir_path(), - c.get_repo(), - c.get_subexternals_path()) - c.replace_subexternal_sourcetree(component_subexternal_sourcetree) - if component_subexternal_sourcetree: - component_subexternal_sourcetree.checkout(verbosity, load_all) - printlog('') diff --git a/manage_externals/manic/utils.py b/manage_externals/manic/utils.py deleted file mode 100644 index 9c63ffe65e..0000000000 --- a/manage_externals/manic/utils.py +++ /dev/null @@ -1,330 +0,0 @@ -#!/usr/bin/env python3 -""" -Common public utilities for manic package - -""" - -from __future__ import absolute_import -from __future__ import unicode_literals -from __future__ import print_function - -import logging -import os -import subprocess -import sys -from threading import Timer - -from .global_constants import LOCAL_PATH_INDICATOR - -# --------------------------------------------------------------------- -# -# screen and logging output and functions to massage text for output -# -# --------------------------------------------------------------------- - - -def log_process_output(output): - """Log each line of process output at debug level so it can be - filtered if necessary. By default, output is a single string, and - logging.debug(output) will only put log info heading on the first - line. This makes it hard to filter with grep. - - """ - output = output.split('\n') - for line in output: - logging.debug(line) - - -def printlog(msg, **kwargs): - """Wrapper script around print to ensure that everything printed to - the screen also gets logged. - - """ - logging.info(msg) - if kwargs: - print(msg, **kwargs) - else: - print(msg) - sys.stdout.flush() - - -def last_n_lines(the_string, n_lines, truncation_message=None): - """Returns the last n lines of the given string - - Args: - the_string: str - n_lines: int - truncation_message: str, optional - - Returns a string containing the last n lines of the_string - - If truncation_message is provided, the returned string begins with - the given message if and only if the string is greater than n lines - to begin with. - """ - - lines = the_string.splitlines(True) - if len(lines) <= n_lines: - return_val = the_string - else: - lines_subset = lines[-n_lines:] - str_truncated = ''.join(lines_subset) - if truncation_message: - str_truncated = truncation_message + '\n' + str_truncated - return_val = str_truncated - - return return_val - - -def indent_string(the_string, indent_level): - """Indents the given string by a given number of spaces - - Args: - the_string: str - indent_level: int - - Returns a new string that is the same as the_string, except that - each line is indented by 'indent_level' spaces. - - In python3, this can be done with textwrap.indent. - """ - - lines = the_string.splitlines(True) - padding = ' ' * indent_level - lines_indented = [padding + line for line in lines] - return ''.join(lines_indented) - -# --------------------------------------------------------------------- -# -# error handling -# -# --------------------------------------------------------------------- - - -def fatal_error(message): - """ - Error output function - """ - logging.error(message) - raise RuntimeError("{0}ERROR: {1}".format(os.linesep, message)) - - -# --------------------------------------------------------------------- -# -# Data conversion / manipulation -# -# --------------------------------------------------------------------- -def str_to_bool(bool_str): - """Convert a sting representation of as boolean into a true boolean. - - Conversion should be case insensitive. - """ - value = None - str_lower = bool_str.lower() - if str_lower in ('true', 't'): - value = True - elif str_lower in ('false', 'f'): - value = False - if value is None: - msg = ('ERROR: invalid boolean string value "{0}". ' - 'Must be "true" or "false"'.format(bool_str)) - fatal_error(msg) - return value - - -REMOTE_PREFIXES = ['http://', 'https://', 'ssh://', 'git@'] - - -def is_remote_url(url): - """check if the user provided a local file path instead of a - remote. If so, it must be expanded to an absolute - path. - - """ - remote_url = False - for prefix in REMOTE_PREFIXES: - if url.startswith(prefix): - remote_url = True - return remote_url - - -def split_remote_url(url): - """check if the user provided a local file path or a - remote. If remote, try to strip off protocol info. - - """ - remote_url = is_remote_url(url) - if not remote_url: - return url - - for prefix in REMOTE_PREFIXES: - url = url.replace(prefix, '') - - if '@' in url: - url = url.split('@')[1] - - if ':' in url: - url = url.split(':')[1] - - return url - - -def expand_local_url(url, field): - """check if the user provided a local file path instead of a - remote. If so, it must be expanded to an absolute - path. - - Note: local paths of LOCAL_PATH_INDICATOR have special meaning and - represent local copy only, don't work with the remotes. - - """ - remote_url = is_remote_url(url) - if not remote_url: - if url.strip() == LOCAL_PATH_INDICATOR: - pass - else: - url = os.path.expandvars(url) - url = os.path.expanduser(url) - if not os.path.isabs(url): - msg = ('WARNING: Externals description for "{0}" contains a ' - 'url that is not remote and does not expand to an ' - 'absolute path. Version control operations may ' - 'fail.\n\nurl={1}'.format(field, url)) - printlog(msg) - else: - url = os.path.normpath(url) - return url - - -# --------------------------------------------------------------------- -# -# subprocess -# -# --------------------------------------------------------------------- - -# Give the user a helpful message if we detect that a command seems to -# be hanging. -_HANGING_SEC = 300 - - -def _hanging_msg(working_directory, command): - print(""" - -Command '{command}' -from directory {working_directory} -has taken {hanging_sec} seconds. It may be hanging. - -The command will continue to run, but you may want to abort -manage_externals with ^C and investigate. A possible cause of hangs is -when svn or git require authentication to access a private -repository. On some systems, svn and git requests for authentication -information will not be displayed to the user. In this case, the program -will appear to hang. Ensure you can run svn and git manually and access -all repositories without entering your authentication information. - -""".format(command=command, - working_directory=working_directory, - hanging_sec=_HANGING_SEC)) - - -def execute_subprocess(commands, status_to_caller=False, - output_to_caller=False): - """Wrapper around subprocess.check_output to handle common - exceptions. - - check_output runs a command with arguments and waits - for it to complete. - - check_output raises an exception on a nonzero return code. if - status_to_caller is true, execute_subprocess returns the subprocess - return code, otherwise execute_subprocess treats non-zero return - status as an error and raises an exception. - - """ - cwd = os.getcwd() - msg = 'In directory: {0}\nexecute_subprocess running command:'.format(cwd) - logging.info(msg) - commands_str = ' '.join(commands) - logging.info(commands_str) - return_to_caller = status_to_caller or output_to_caller - status = -1 - output = '' - hanging_timer = Timer(_HANGING_SEC, _hanging_msg, - kwargs={"working_directory": cwd, - "command": commands_str}) - hanging_timer.start() - try: - output = subprocess.check_output(commands, stderr=subprocess.STDOUT, - universal_newlines=True) - log_process_output(output) - status = 0 - except OSError as error: - msg = failed_command_msg( - 'Command execution failed. Does the executable exist?', - commands) - logging.error(error) - fatal_error(msg) - except ValueError as error: - msg = failed_command_msg( - 'DEV_ERROR: Invalid arguments trying to run subprocess', - commands) - logging.error(error) - fatal_error(msg) - except subprocess.CalledProcessError as error: - # Only report the error if we are NOT returning to the - # caller. If we are returning to the caller, then it may be a - # simple status check. If returning, it is the callers - # responsibility determine if an error occurred and handle it - # appropriately. - if not return_to_caller: - msg_context = ('Process did not run successfully; ' - 'returned status {0}'.format(error.returncode)) - msg = failed_command_msg(msg_context, commands, - output=error.output) - logging.error(error) - logging.error(msg) - log_process_output(error.output) - fatal_error(msg) - status = error.returncode - finally: - hanging_timer.cancel() - - if status_to_caller and output_to_caller: - ret_value = (status, output) - elif status_to_caller: - ret_value = status - elif output_to_caller: - ret_value = output - else: - ret_value = None - - return ret_value - - -def failed_command_msg(msg_context, command, output=None): - """Template for consistent error messages from subprocess calls. - - If 'output' is given, it should provide the output from the failed - command - """ - - if output: - output_truncated = last_n_lines(output, 20, - truncation_message='[... Output truncated for brevity ...]') - errmsg = ('Failed with output:\n' + - indent_string(output_truncated, 4) + - '\nERROR: ') - else: - errmsg = '' - - command_str = ' '.join(command) - errmsg += """In directory - {cwd} -{context}: - {command} -""".format(cwd=os.getcwd(), context=msg_context, command=command_str) - - if output: - errmsg += 'See above for output from failed command.\n' - - return errmsg diff --git a/manage_externals/test/.coveragerc b/manage_externals/test/.coveragerc deleted file mode 100644 index 8b681888b8..0000000000 --- a/manage_externals/test/.coveragerc +++ /dev/null @@ -1,7 +0,0 @@ -[run] -branch = True -omit = test_unit_*.py - test_sys_*.py - /usr/* - .local/* - */site-packages/* \ No newline at end of file diff --git a/manage_externals/test/.gitignore b/manage_externals/test/.gitignore deleted file mode 100644 index dd5795998f..0000000000 --- a/manage_externals/test/.gitignore +++ /dev/null @@ -1,7 +0,0 @@ -# virtual environments -env_python* - -# python code coverage tool output -.coverage -htmlcov - diff --git a/manage_externals/test/.pylint.rc b/manage_externals/test/.pylint.rc deleted file mode 100644 index 64abd03e42..0000000000 --- a/manage_externals/test/.pylint.rc +++ /dev/null @@ -1,426 +0,0 @@ -[MASTER] - -# A comma-separated list of package or module names from where C extensions may -# be loaded. Extensions are loading into the active Python interpreter and may -# run arbitrary code -extension-pkg-whitelist= - -# Add files or directories to the blacklist. They should be base names, not -# paths. -ignore=.git,.svn,env2 - -# Add files or directories matching the regex patterns to the blacklist. The -# regex matches against base names, not paths. -ignore-patterns= - -# Python code to execute, usually for sys.path manipulation such as -# pygtk.require(). -#init-hook= - -# Use multiple processes to speed up Pylint. -jobs=1 - -# List of plugins (as comma separated values of python modules names) to load, -# usually to register additional checkers. -load-plugins= - -# Pickle collected data for later comparisons. -persistent=yes - -# Specify a configuration file. -#rcfile= - -# Allow loading of arbitrary C extensions. Extensions are imported into the -# active Python interpreter and may run arbitrary code. -unsafe-load-any-extension=no - - -[MESSAGES CONTROL] - -# Only show warnings with the listed confidence levels. Leave empty to show -# all. Valid levels: HIGH, INFERENCE, INFERENCE_FAILURE, UNDEFINED -confidence= - -# Disable the message, report, category or checker with the given id(s). You -# can either give multiple identifiers separated by comma (,) or put this -# option multiple times (only on the command line, not in the configuration -# file where it should appear only once).You can also use "--disable=all" to -# disable everything first and then reenable specific checks. For example, if -# you want to run only the similarities checker, you can use "--disable=all -# --enable=similarities". If you want to run only the classes checker, but have -# no Warning level messages displayed, use"--disable=all --enable=classes -# --disable=W" -disable=bad-continuation,useless-object-inheritance - - -# Enable the message, report, category or checker with the given id(s). You can -# either give multiple identifier separated by comma (,) or put this option -# multiple time (only on the command line, not in the configuration file where -# it should appear only once). See also the "--disable" option for examples. -enable= - - -[REPORTS] - -# Python expression which should return a note less than 10 (10 is the highest -# note). You have access to the variables errors warning, statement which -# respectively contain the number of errors / warnings messages and the total -# number of statements analyzed. This is used by the global evaluation report -# (RP0004). -evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10) - -# Template used to display messages. This is a python new-style format string -# used to format the message information. See doc for all details -msg-template={msg_id}:{line:3d},{column:2d}: {msg} ({symbol}) - -# Set the output format. Available formats are text, parseable, colorized, json -# and msvs (visual studio).You can also give a reporter class, eg -# mypackage.mymodule.MyReporterClass. -output-format=text - -# Tells whether to display a full report or only the messages -#reports=yes - -# Activate the evaluation score. -score=yes - - -[REFACTORING] - -# Maximum number of nested blocks for function / method body -max-nested-blocks=5 - - -[BASIC] - -# Naming hint for argument names -argument-name-hint=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$ - -# Regular expression matching correct argument names -argument-rgx=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$ - -# Naming hint for attribute names -attr-name-hint=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$ - -# Regular expression matching correct attribute names -attr-rgx=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$ - -# Bad variable names which should always be refused, separated by a comma -bad-names=foo,bar,baz,toto,tutu,tata - -# Naming hint for class attribute names -class-attribute-name-hint=([A-Za-z_][A-Za-z0-9_]{2,30}|(__.*__))$ - -# Regular expression matching correct class attribute names -class-attribute-rgx=([A-Za-z_][A-Za-z0-9_]{2,30}|(__.*__))$ - -# Naming hint for class names -class-name-hint=[A-Z_][a-zA-Z0-9]+$ - -# Regular expression matching correct class names -class-rgx=[A-Z_][a-zA-Z0-9]+$ - -# Naming hint for constant names -const-name-hint=(([A-Z_][A-Z0-9_]*)|(__.*__))$ - -# Regular expression matching correct constant names -const-rgx=(([A-Z_][A-Z0-9_]*)|(__.*__))$ - -# Minimum line length for functions/classes that require docstrings, shorter -# ones are exempt. -docstring-min-length=-1 - -# Naming hint for function names -function-name-hint=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$ - -# Regular expression matching correct function names -function-rgx=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$ - -# Good variable names which should always be accepted, separated by a comma -good-names=i,j,k,ex,Run,_ - -# Include a hint for the correct naming format with invalid-name -include-naming-hint=no - -# Naming hint for inline iteration names -inlinevar-name-hint=[A-Za-z_][A-Za-z0-9_]*$ - -# Regular expression matching correct inline iteration names -inlinevar-rgx=[A-Za-z_][A-Za-z0-9_]*$ - -# Naming hint for method names -method-name-hint=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$ - -# Regular expression matching correct method names -method-rgx=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$ - -# Naming hint for module names -module-name-hint=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$ - -# Regular expression matching correct module names -module-rgx=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$ - -# Colon-delimited sets of names that determine each other's naming style when -# the name regexes allow several styles. -name-group= - -# Regular expression which should only match function or class names that do -# not require a docstring. -no-docstring-rgx=^_ - -# List of decorators that produce properties, such as abc.abstractproperty. Add -# to this list to register other decorators that produce valid properties. -property-classes=abc.abstractproperty - -# Naming hint for variable names -variable-name-hint=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$ - -# Regular expression matching correct variable names -variable-rgx=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$ - - -[FORMAT] - -# Expected format of line ending, e.g. empty (any line ending), LF or CRLF. -expected-line-ending-format= - -# Regexp for a line that is allowed to be longer than the limit. -ignore-long-lines=^\s*(# )??$ - -# Number of spaces of indent required inside a hanging or continued line. -indent-after-paren=4 - -# String used as indentation unit. This is usually " " (4 spaces) or "\t" (1 -# tab). -indent-string=' ' - -# Maximum number of characters on a single line. -max-line-length=100 - -# Maximum number of lines in a module -max-module-lines=1000 - -# List of optional constructs for which whitespace checking is disabled. `dict- -# separator` is used to allow tabulation in dicts, etc.: {1 : 1,\n222: 2}. -# `trailing-comma` allows a space between comma and closing bracket: (a, ). -# `empty-line` allows space-only lines. -no-space-check=trailing-comma,dict-separator - -# Allow the body of a class to be on the same line as the declaration if body -# contains single statement. -single-line-class-stmt=no - -# Allow the body of an if to be on the same line as the test if there is no -# else. -single-line-if-stmt=no - - -[LOGGING] - -# Logging modules to check that the string format arguments are in logging -# function parameter format -logging-modules=logging - - -[MISCELLANEOUS] - -# List of note tags to take in consideration, separated by a comma. -notes=FIXME,XXX,TODO - - -[SIMILARITIES] - -# Ignore comments when computing similarities. -ignore-comments=yes - -# Ignore docstrings when computing similarities. -ignore-docstrings=yes - -# Ignore imports when computing similarities. -ignore-imports=no - -# Minimum lines number of a similarity. -min-similarity-lines=4 - - -[SPELLING] - -# Spelling dictionary name. Available dictionaries: none. To make it working -# install python-enchant package. -spelling-dict= - -# List of comma separated words that should not be checked. -spelling-ignore-words= - -# A path to a file that contains private dictionary; one word per line. -spelling-private-dict-file= - -# Tells whether to store unknown words to indicated private dictionary in -# --spelling-private-dict-file option instead of raising a message. -spelling-store-unknown-words=no - - -[TYPECHECK] - -# List of decorators that produce context managers, such as -# contextlib.contextmanager. Add to this list to register other decorators that -# produce valid context managers. -contextmanager-decorators=contextlib.contextmanager - -# List of members which are set dynamically and missed by pylint inference -# system, and so shouldn't trigger E1101 when accessed. Python regular -# expressions are accepted. -generated-members= - -# Tells whether missing members accessed in mixin class should be ignored. A -# mixin class is detected if its name ends with "mixin" (case insensitive). -ignore-mixin-members=yes - -# This flag controls whether pylint should warn about no-member and similar -# checks whenever an opaque object is returned when inferring. The inference -# can return multiple potential results while evaluating a Python object, but -# some branches might not be evaluated, which results in partial inference. In -# that case, it might be useful to still emit no-member and other checks for -# the rest of the inferred objects. -ignore-on-opaque-inference=yes - -# List of class names for which member attributes should not be checked (useful -# for classes with dynamically set attributes). This supports the use of -# qualified names. -ignored-classes=optparse.Values,thread._local,_thread._local - -# List of module names for which member attributes should not be checked -# (useful for modules/projects where namespaces are manipulated during runtime -# and thus existing member attributes cannot be deduced by static analysis. It -# supports qualified module names, as well as Unix pattern matching. -ignored-modules= - -# Show a hint with possible names when a member name was not found. The aspect -# of finding the hint is based on edit distance. -missing-member-hint=yes - -# The minimum edit distance a name should have in order to be considered a -# similar match for a missing member name. -missing-member-hint-distance=1 - -# The total number of similar names that should be taken in consideration when -# showing a hint for a missing member. -missing-member-max-choices=1 - - -[VARIABLES] - -# List of additional names supposed to be defined in builtins. Remember that -# you should avoid to define new builtins when possible. -additional-builtins= - -# Tells whether unused global variables should be treated as a violation. -allow-global-unused-variables=yes - -# List of strings which can identify a callback function by name. A callback -# name must start or end with one of those strings. -callbacks=cb_,_cb - -# A regular expression matching the name of dummy variables (i.e. expectedly -# not used). -dummy-variables-rgx=_+$|(_[a-zA-Z0-9_]*[a-zA-Z0-9]+?$)|dummy|^ignored_|^unused_ - -# Argument names that match this expression will be ignored. Default to name -# with leading underscore -ignored-argument-names=_.*|^ignored_|^unused_ - -# Tells whether we should check for unused import in __init__ files. -init-import=no - -# List of qualified module names which can have objects that can redefine -# builtins. -redefining-builtins-modules=six.moves,future.builtins - - -[CLASSES] - -# List of method names used to declare (i.e. assign) instance attributes. -defining-attr-methods=__init__,__new__,setUp - -# List of member names, which should be excluded from the protected access -# warning. -exclude-protected=_asdict,_fields,_replace,_source,_make - -# List of valid names for the first argument in a class method. -valid-classmethod-first-arg=cls - -# List of valid names for the first argument in a metaclass class method. -valid-metaclass-classmethod-first-arg=mcs - - -[DESIGN] - -# Maximum number of arguments for function / method -max-args=5 - -# Maximum number of attributes for a class (see R0902). -max-attributes=7 - -# Maximum number of boolean expressions in a if statement -max-bool-expr=5 - -# Maximum number of branch for function / method body -max-branches=12 - -# Maximum number of locals for function / method body -max-locals=15 - -# Maximum number of parents for a class (see R0901). -max-parents=7 - -# Maximum number of public methods for a class (see R0904). -max-public-methods=20 - -# Maximum number of return / yield for function / method body -max-returns=6 - -# Maximum number of statements in function / method body -max-statements=50 - -# Minimum number of public methods for a class (see R0903). -min-public-methods=2 - - -[IMPORTS] - -# Allow wildcard imports from modules that define __all__. -allow-wildcard-with-all=no - -# Analyse import fallback blocks. This can be used to support both Python 2 and -# 3 compatible code, which means that the block might have code that exists -# only in one or another interpreter, leading to false positives when analysed. -analyse-fallback-blocks=no - -# Deprecated modules which should not be used, separated by a comma -deprecated-modules=regsub,TERMIOS,Bastion,rexec - -# Create a graph of external dependencies in the given file (report RP0402 must -# not be disabled) -ext-import-graph= - -# Create a graph of every (i.e. internal and external) dependencies in the -# given file (report RP0402 must not be disabled) -import-graph= - -# Create a graph of internal dependencies in the given file (report RP0402 must -# not be disabled) -int-import-graph= - -# Force import order to recognize a module as part of the standard -# compatibility libraries. -known-standard-library= - -# Force import order to recognize a module as part of a third party library. -known-third-party=enchant - - -[EXCEPTIONS] - -# Exceptions that will emit a warning when being caught. Defaults to -# "Exception" -overgeneral-exceptions=Exception diff --git a/manage_externals/test/Makefile b/manage_externals/test/Makefile deleted file mode 100644 index 293e360757..0000000000 --- a/manage_externals/test/Makefile +++ /dev/null @@ -1,124 +0,0 @@ -python = not-set -verbose = not-set -debug = not-set - -ifneq ($(python), not-set) -PYTHON=$(python) -else -PYTHON=python -endif - -# we need the python path to point one level up to access the package -# and executables -PYPATH=PYTHONPATH=..: - -# common args for running tests -TEST_ARGS=-m unittest discover - -ifeq ($(debug), not-set) - ifeq ($(verbose), not-set) - # summary only output - TEST_ARGS+=--buffer - else - # show individual test summary - TEST_ARGS+=--buffer --verbose - endif -else - # show detailed test output - TEST_ARGS+=--verbose -endif - - -# auto reformat the code -AUTOPEP8=autopep8 -AUTOPEP8_ARGS=--aggressive --in-place - -# run lint -PYLINT=pylint -PYLINT_ARGS=-j 2 --rcfile=.pylint.rc - -# code coverage -COVERAGE=coverage -COVERAGE_ARGS=--rcfile=.coveragerc - -# source files -SRC = \ - ../checkout_externals \ - ../manic/*.py - -CHECKOUT_EXE = ../checkout_externals - -TEST_DIR = . - -README = ../README.md - -# -# testing -# -.PHONY : utest -utest : FORCE - $(PYPATH) $(PYTHON) $(TEST_ARGS) --pattern 'test_unit_*.py' - -.PHONY : stest -stest : FORCE - $(PYPATH) $(PYTHON) $(TEST_ARGS) --pattern 'test_sys_*.py' - -.PHONY : test -test : utest stest - -# -# documentation -# -.PHONY : readme -readme : $(CHECKOUT_EXE) - printf "%s\n\n" "-- AUTOMATICALLY GENERATED FILE. DO NOT EDIT --" > $(README) - printf "%s" '[![Build Status](https://travis-ci.org/ESMCI/manage_externals.svg?branch=master)](https://travis-ci.org/ESMCI/manage_externals)' >> $(README) - printf "%s" '[![Coverage Status](https://coveralls.io/repos/github/ESMCI/manage_externals/badge.svg?branch=master)](https://coveralls.io/github/ESMCI/manage_externals?branch=master)' >> $(README) - printf "\n%s\n" '```' >> $(README) - $(CHECKOUT_EXE) --help >> $(README) - -# -# coding standards -# -.PHONY : style -style : FORCE - $(AUTOPEP8) $(AUTOPEP8_ARGS) --recursive $(SRC) $(TEST_DIR)/test_*.py - -.PHONY : lint -lint : FORCE - $(PYLINT) $(PYLINT_ARGS) $(SRC) $(TEST_DIR)/test_*.py - -.PHONY : stylint -stylint : style lint - -.PHONY : coverage -# Need to use a single coverage run with a single pattern rather than -# using two separate commands with separate patterns for test_unit_*.py -# and test_sys_*.py: The latter clobbers some results from the first -# run, even if we use the --append flag to 'coverage run'. -coverage : FORCE - $(PYPATH) $(COVERAGE) erase - $(PYPATH) $(COVERAGE) run $(COVERAGE_ARGS) $(TEST_ARGS) --pattern 'test_*.py' - $(PYPATH) $(COVERAGE) html - -# -# virtual environment creation -# -.PHONY : env -env : FORCE - $(PYPATH) virtualenv --python $(PYTHON) $@_$(PYTHON) - . $@_$(PYTHON)/bin/activate; pip install -r requirements.txt - -# -# utilites -# -.PHONY : clean -clean : FORCE - -rm -rf *~ *.pyc tmp fake htmlcov - -.PHONY : clobber -clobber : clean - -rm -rf env_* - -FORCE : - diff --git a/manage_externals/test/README.md b/manage_externals/test/README.md deleted file mode 100644 index 1e8f2eaa77..0000000000 --- a/manage_externals/test/README.md +++ /dev/null @@ -1,53 +0,0 @@ -# Testing for checkout_externals - -## Unit tests - -```SH - cd checkout_externals/test - make utest -``` - -## System tests - -```SH - cd checkout_externals/test - make stest -``` - -Example to run a single test: -```SH - cd checkout_externals - python -m unittest test.test_sys_checkout.TestSysCheckout.test_container_simple_required -``` - -## Static analysis - -checkout_externals is difficult to test thoroughly because it relies -on git and svn, and svn requires a live network connection and -repository. Static analysis will help catch bugs in code paths that -are not being executed, but it requires conforming to community -standards and best practices. autopep8 and pylint should be run -regularly for automatic code formatting and linting. - -```SH - cd checkout_externals/test - make lint -``` - -The canonical formatting for the code is whatever autopep8 -generates. All issues identified by pylint should be addressed. - - -## Code coverage - -All changes to the code should include maintaining existing tests and -writing new tests for new or changed functionality. To ensure test -coverage, run the code coverage tool: - -```SH - cd checkout_externals/test - make coverage - open -a Firefox.app htmlcov/index.html -``` - - diff --git a/manage_externals/test/doc/.gitignore b/manage_externals/test/doc/.gitignore deleted file mode 100644 index d4e11e5ea0..0000000000 --- a/manage_externals/test/doc/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -_build - diff --git a/manage_externals/test/doc/Makefile b/manage_externals/test/doc/Makefile deleted file mode 100644 index 18f4d5bf99..0000000000 --- a/manage_externals/test/doc/Makefile +++ /dev/null @@ -1,20 +0,0 @@ -# Minimal makefile for Sphinx documentation -# - -# You can set these variables from the command line. -SPHINXOPTS = -SPHINXBUILD = sphinx-build -SPHINXPROJ = ManageExternals -SOURCEDIR = . -BUILDDIR = _build - -# Put it first so that "make" without argument is like "make help". -help: - @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) - -.PHONY: help Makefile - -# Catch-all target: route all unknown targets to Sphinx using the new -# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). -%: Makefile - @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) \ No newline at end of file diff --git a/manage_externals/test/doc/conf.py b/manage_externals/test/doc/conf.py deleted file mode 100644 index 469c0b0dc5..0000000000 --- a/manage_externals/test/doc/conf.py +++ /dev/null @@ -1,172 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Manage Externals documentation build configuration file, created by -# sphinx-quickstart on Wed Nov 29 10:53:25 2017. -# -# This file is execfile()d with the current directory set to its -# containing dir. -# -# Note that not all possible configuration values are present in this -# autogenerated file. -# -# All configuration values have a default; values that are commented out -# serve to show the default. - -# If extensions (or modules to document with autodoc) are in another directory, -# add these directories to sys.path here. If the directory is relative to the -# documentation root, use os.path.abspath to make it absolute, like shown here. -# -# import os -# import sys -# sys.path.insert(0, os.path.abspath('.')) - - -# -- General configuration ------------------------------------------------ - -# If your documentation needs a minimal Sphinx version, state it here. -# -# needs_sphinx = '1.0' - -# Add any Sphinx extension module names here, as strings. They can be -# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom -# ones. -extensions = ['sphinx.ext.autodoc', - 'sphinx.ext.todo', - 'sphinx.ext.coverage', - 'sphinx.ext.viewcode', - 'sphinx.ext.githubpages'] - -# Add any paths that contain templates here, relative to this directory. -templates_path = ['_templates'] - -# The suffix(es) of source filenames. -# You can specify multiple suffix as a list of string: -# -# source_suffix = ['.rst', '.md'] -source_suffix = '.rst' - -# The master toctree document. -master_doc = 'index' - -# General information about the project. -project = u'Manage Externals' -copyright = u'2017, CSEG at NCAR' -author = u'CSEG at NCAR' - -# The version info for the project you're documenting, acts as replacement for -# |version| and |release|, also used in various other places throughout the -# built documents. -# -# The short X.Y version. -version = u'1.0.0' -# The full version, including alpha/beta/rc tags. -release = u'1.0.0' - -# The language for content autogenerated by Sphinx. Refer to documentation -# for a list of supported languages. -# -# This is also used if you do content translation via gettext catalogs. -# Usually you set "language" from the command line for these cases. -language = None - -# List of patterns, relative to source directory, that match files and -# directories to ignore when looking for source files. -# This patterns also effect to html_static_path and html_extra_path -exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] - -# The name of the Pygments (syntax highlighting) style to use. -pygments_style = 'sphinx' - -# If true, `todo` and `todoList` produce output, else they produce nothing. -todo_include_todos = True - - -# -- Options for HTML output ---------------------------------------------- - -# The theme to use for HTML and HTML Help pages. See the documentation for -# a list of builtin themes. -# -html_theme = 'alabaster' - -# Theme options are theme-specific and customize the look and feel of a theme -# further. For a list of options available for each theme, see the -# documentation. -# -# html_theme_options = {} - -# Add any paths that contain custom static files (such as style sheets) here, -# relative to this directory. They are copied after the builtin static files, -# so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ['_static'] - -# Custom sidebar templates, must be a dictionary that maps document names -# to template names. -# -# This is required for the alabaster theme -# refs: http://alabaster.readthedocs.io/en/latest/installation.html#sidebars -html_sidebars = { - '**': [ - 'relations.html', # needs 'show_related': True theme option to display - 'searchbox.html', - ] -} - - -# -- Options for HTMLHelp output ------------------------------------------ - -# Output file base name for HTML help builder. -htmlhelp_basename = 'ManageExternalsdoc' - - -# -- Options for LaTeX output --------------------------------------------- - -latex_elements = { - # The paper size ('letterpaper' or 'a4paper'). - # - # 'papersize': 'letterpaper', - - # The font size ('10pt', '11pt' or '12pt'). - # - # 'pointsize': '10pt', - - # Additional stuff for the LaTeX preamble. - # - # 'preamble': '', - - # Latex figure (float) alignment - # - # 'figure_align': 'htbp', -} - -# Grouping the document tree into LaTeX files. List of tuples -# (source start file, target name, title, -# author, documentclass [howto, manual, or own class]). -latex_documents = [ - (master_doc, 'ManageExternals.tex', u'Manage Externals Documentation', - u'CSEG at NCAR', 'manual'), -] - - -# -- Options for manual page output --------------------------------------- - -# One entry per manual page. List of tuples -# (source start file, name, description, authors, manual section). -man_pages = [ - (master_doc, 'manageexternals', u'Manage Externals Documentation', - [author], 1) -] - - -# -- Options for Texinfo output ------------------------------------------- - -# Grouping the document tree into Texinfo files. List of tuples -# (source start file, target name, title, author, -# dir menu entry, description, category) -texinfo_documents = [ - (master_doc, 'ManageExternals', u'Manage Externals Documentation', - author, 'ManageExternals', 'One line description of project.', - 'Miscellaneous'), -] - - - diff --git a/manage_externals/test/doc/develop.rst b/manage_externals/test/doc/develop.rst deleted file mode 100644 index b817b7b093..0000000000 --- a/manage_externals/test/doc/develop.rst +++ /dev/null @@ -1,202 +0,0 @@ -Developer Guidelines -==================== - -The manage externals utilities are a light weight replacement for svn -externals that will work with git repositories pulling in a mixture of -git and svn dependencies. - -Given an externals description and a working copy: - -* *checkout_externals* attempts to make the working copy agree with the - externals description - -* *generate_externals* attempts to make the externals description agree - with the working copy. - -For these operations utilities should: - -* operate consistently across git and svn - -* operate simply with minimal user complexity - -* robustly across a wide range of repository states - -* provide explicit error messages when a problem occurs - -* leave the working copy in a valid state - -The utilities in manage externals are **NOT** generic wrappers around -revision control operations or a replacement for common tasks. Users -are expected to: - -* create branches prior to starting development - -* add remotes and push changes - -* create tags - -* delete branches - -These types of tasks are often highly workflow dependent, e.g. branch -naming conventions may vary between repositories, have the potential -to destroy user data, introduce significant code complexit and 'edge -cases' that are extremely difficult to detect and test, and often -require subtle decision making, especially if a problem occurs. - -Users who want to automate these types are encouraged to create their -own tools. The externals description files are explicitly versioned -and the internal APIs are intended to be stable for these purposes. - -Core Design Principles ------------------------ - -1. Users can, and are actively encouraged to, modify the externals - directories using revision control outside of manage_externals - tools. You can't make any assumptions about the state of the - working copy. Examples: adding a remote, creating a branch, - switching to a branch, deleting the directory entirely. - -2. Give that the user can do anything, the manage externals library - can not preserve state between calls. The only information it can - rely on is what it expectes based on the content of the externals - description file, and what the actual state of the directory tree - is. - -3. Do *not* do anything that will possibly destroy user data! - - a. Do not remove files from the file system. We are operating on - user supplied input. If you don't call 'rm', you can't - accidentally remove the user's data. Thinking of calling - ``shutil.rmtree(user_input)``? What if the user accidentally - specified user_input such that it resolves to their home - directory.... Yeah. Don't go there. - - b. Rely on git and svn to do their job as much as possible. Don't - duplicate functionality. Examples: - - i. We require the working copies to be 'clean' as reported by - ``git status`` and ``svn status``. What if there are misc - editor files floating around that prevent an update? Use the - git and svn ignore functionality so they are not - reported. Don't try to remove them from manage_externals or - determine if they are 'safe' to ignore. - - ii. Do not use '--force'. Ever. This is a sign you are doing - something dangerous, it may not be what the user - wants. Remember, they are encouraged to modify their repo. - -4. There are often multiple ways to obtain a particular piece of - information from git. Scraping screen output is brittle and - generally not considered a stable API across different versions of - git. Given a choice between: - - a. a lower level git 'plumbing' command that processes a - specific request and returns a sucess/failure status. - - b. high level git command that produces a bunch of output - that must be processed. - - We always prefer the former. It almost always involves - writing and maintaining less code and is more likely to be - stable. - -5. Backward compatibility is critical. We have *nested* - repositories. They are trivially easy to change versions. They may - have very different versions of the top level manage_externals. The - ability to read and work with old model description files is - critical to avoid problems for users. We also have automated tools - (testdb) that must generate and read external description - files. Backward compatibility will make staging changes vastly - simpler. - -Model Users ------------ - -Consider the needs of the following model userswhen developing manage_externals: - -* Users who will checkout the code once, and never change versions. - -* Users who will checkout the code once, then work for several years, - never updating. before trying to update or request integration. - -* Users develope code but do not use revision control beyond the - initial checkout. If they have modified or untracked files in the - repo, they may be irreplacable. Don't destroy user data. - -* Intermediate users who are working with multiple repos or branches - on a regular basis. They may only use manage_externals weekly or - monthly. Keep the user interface and documentation simple and - explicit. The more command line options they have to remember or - look up, the more frustrated they git. - -* Software engineers who use the tools multiple times a day. It should - get out of their way. - -User Interface --------------- - -Basic operation for the most standard use cases should be kept as -simple as possible. Many users will only rarely run the manage -utilities. Even advanced users don't like reading a lot of help -documentation or struggling to remember commands and piece together -what they need to run. Having many command line options, even if not -needed, is exteremly frustrating and overwhelming for most users. A few -simple, explicitly named commands are better than a single command -with many options. - -How will users get help if something goes wrong? This is a custom, -one-off solution. Searching the internet for manage_externals, will -only return the user doc for this project at best. There isn't likely -to be a stackoverflow question or blog post where someone else already -answered a user's question. And very few people outside this community -will be able to provide help if something goes wrong. The sooner we -kick users out of these utilities and into standard version control -tools, the better off they are going to be if they run into a problem. - -Repositories ------------- - -There are three basic types of repositories that must be considered: - -* container repositories - repositories that are always top level - repositories, and have a group of externals that must be managed. - -* simple repositories - repositories that are externals to another - repository, and do not have any of their own externals that will be - managed. - -* mixed use repositories - repositories that can act as a top level - container repository or as an external to a top level - container. They may also have their own sub-externals that are - required. They may have different externals needs depening on - whether they are top level or not. - -Repositories must be able to checkout and switch to both branches and -tags. - -Development -=========== - -The functionality to manage externals is broken into a library of core -functionality and applications built with the library. - -The core library is called 'manic', pseduo-homophone of (man)age -(ex)ternals that is: short, pronounceable and spell-checkable. It is -also no more or less meaningful to an unfamiliar user than a random -jumble of letters forming an acronym. - -The core architecture of manic is: - -* externals description - an abstract description on an external, - including of how to obtain it, where to obtain it, where it goes in - the working tree. - -* externals - the software object representing an external. - -* source trees - collection of externals - -* repository wrappers - object oriented wrappers around repository - operations. So the higher level management of the soure tree and - external does not have to be concerned with how a particular - external is obtained and managed. - diff --git a/manage_externals/test/doc/index.rst b/manage_externals/test/doc/index.rst deleted file mode 100644 index 9ab287ad8c..0000000000 --- a/manage_externals/test/doc/index.rst +++ /dev/null @@ -1,22 +0,0 @@ -.. Manage Externals documentation master file, created by - sphinx-quickstart on Wed Nov 29 10:53:25 2017. - You can adapt this file completely to your liking, but it should at least - contain the root `toctree` directive. - -Welcome to Manage Externals's documentation! -============================================ - -.. toctree:: - :maxdepth: 2 - :caption: Contents: - - - develop.rst - testing.rst - -Indices and tables -================== - -* :ref:`genindex` -* :ref:`modindex` -* :ref:`search` diff --git a/manage_externals/test/doc/testing.rst b/manage_externals/test/doc/testing.rst deleted file mode 100644 index 623f0e431c..0000000000 --- a/manage_externals/test/doc/testing.rst +++ /dev/null @@ -1,123 +0,0 @@ -Testing -======= - -The manage_externals package has an automated test suite. All pull -requests are expected to pass 100% of the automated tests, as well as -be pep8 and lint 'clean' and maintain approximately constant (at a -minimum) level of code coverage. - -Quick Start ------------ - -Do nothing approach -~~~~~~~~~~~~~~~~~~~ - -When you create a pull request on GitHub, Travis-CI continuous -integration testing will run the test suite in both python2 and -python3. Test results, lint results, and code coverage results are -available online. - -Do something approach -~~~~~~~~~~~~~~~~~~~~~ - -In the test directory, run: - -.. code-block:: shell - - make env - make lint - make test - make coverage - - -Automated Testing ------------------ - -The manage_externals manic library and executables are developed to be -python2 and python3 compatible using only the standard library. The -test suites meet the same requirements. But additional tools are -required to provide lint and code coverage metrics and generate -documentation. The requirements are maintained in the requirements.txt -file, and can be automatically installed into an isolated environment -via Makefile. - -Bootstrap requirements: - -* python2 - version 2.7.x or later - -* python3 - version 3.6 tested other versions may work - -* pip and virtualenv for python2 and python3 - -Note: all make rules can be of the form ``make python=pythonX rule`` -or ``make rule`` depending if you want to use the default system -python or specify a specific version. - -The Makefile in the test directory has the following rules: - -* ``make python=pythonX env`` - create a python virtual environment - for python2 or python3 and install all required packages. These - packages are required to run lint or coverage. - -* ``make style`` - runs autopep8 - -* ``make lint`` - runs autopep8 and pylint - -* ``make test`` - run the full test suite - -* ``make utest`` - run jus the unit tests - -* ``make stest`` - run jus the system integration tests - -* ``make coverage`` - run the full test suite through the code - coverage tool and generate an html report. - -* ``make readme`` - automatically generate the README files. - -* ``make clean`` - remove editor and pyc files - -* ``make clobber`` - remove all generated test files, including - virtual environments, coverage reports, and temporary test - repository directories. - -Unit Tests ----------- - -Unit tests are probably not 'true unit tests' for the pedantic, but -are pragmatic unit tests. They cover small practicle code blocks: -functions, class methods, and groups of functions and class methods. - -System Integration Tests ------------------------- - -NOTE(bja, 2017-11) The systems integration tests currently do not include svn repositories. - -The manage_externals package is extremely tedious and error prone to test manually. - -Combinations that must be tested to ensure basic functionality are: - -* container repository pulling in simple externals - -* container repository pulling in mixed externals with sub-externals. - -* mixed repository acting as a container, pulling in simple externals and sub-externals - -Automatic system tests are handled the same way manual testing is done: - -* clone a test repository - -* create an externals description file for the test - -* run the executable with the desired args - -* check the results - -* potentially modify the repo (checkout a different branch) - -* rerun and test - -* etc - -The automated system stores small test repositories in the main repo -by adding them as bare repositories. These repos are cloned via a -subprocess call to git and manipulated during the tests. diff --git a/manage_externals/test/repos/README.md b/manage_externals/test/repos/README.md deleted file mode 100644 index 026b684ea3..0000000000 --- a/manage_externals/test/repos/README.md +++ /dev/null @@ -1,33 +0,0 @@ -Git and svn repositories for testing git and svn-related behavior. For usage and terminology notes, see test/test_sys_checkout.py. - -For git repos: To list files and view file contents at HEAD: -``` -cd -git ls-tree --full-tree -r --name-only HEAD -git cat-file -p HEAD: -``` - -File contents at a glance: -``` -container.git/ - readme.txt - -simple-ext.git/ - (has branches: feature2, feature3) - (has tags: tag1, tag2) - readme.txt - simple_subdir/subdir_file.txt - -simple-ext-fork.git/ - (has tags: abandoned-feature, forked-feature-v1, tag1) - (has branch: feature2) - readme.txt - -mixed-cont-ext.git/ - (has branch: new-feature) - readme.txt - sub-externals.cfg ('simp_branch' section refers to 'feature2' branch in simple-ext.git/ repo) - -error/ - (no git repo here, just a readme.txt in the clear) -``` diff --git a/manage_externals/test/repos/container.git/HEAD b/manage_externals/test/repos/container.git/HEAD deleted file mode 100644 index cb089cd89a..0000000000 --- a/manage_externals/test/repos/container.git/HEAD +++ /dev/null @@ -1 +0,0 @@ -ref: refs/heads/master diff --git a/manage_externals/test/repos/container.git/config b/manage_externals/test/repos/container.git/config deleted file mode 100644 index e6da231579..0000000000 --- a/manage_externals/test/repos/container.git/config +++ /dev/null @@ -1,6 +0,0 @@ -[core] - repositoryformatversion = 0 - filemode = true - bare = true - ignorecase = true - precomposeunicode = true diff --git a/manage_externals/test/repos/container.git/description b/manage_externals/test/repos/container.git/description deleted file mode 100644 index 498b267a8c..0000000000 --- a/manage_externals/test/repos/container.git/description +++ /dev/null @@ -1 +0,0 @@ -Unnamed repository; edit this file 'description' to name the repository. diff --git a/manage_externals/test/repos/container.git/info/exclude b/manage_externals/test/repos/container.git/info/exclude deleted file mode 100644 index a5196d1be8..0000000000 --- a/manage_externals/test/repos/container.git/info/exclude +++ /dev/null @@ -1,6 +0,0 @@ -# git ls-files --others --exclude-from=.git/info/exclude -# Lines that start with '#' are comments. -# For a project mostly in C, the following would be a good set of -# exclude patterns (uncomment them if you want to use them): -# *.[oa] -# *~ diff --git a/manage_externals/test/repos/container.git/objects/41/1de5d96ee418c1c55f3e96e6e6e7c06bb95801 b/manage_externals/test/repos/container.git/objects/41/1de5d96ee418c1c55f3e96e6e6e7c06bb95801 deleted file mode 100644 index f65234e17f32800b1be0aa9908cc706458b14605..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 133 zcmV;00DAv;0acB$4#OY}L_6~pma=t7)Fr=DfpLNr2P1F?mVSF_r3_t8x_fuJAR6GY zuD1yyS3=Xu)WDKA@Ra});Xx7fWf1zv2~1TS@=422pQw4`eHcB9X3EwU=O)-GQ}s5s nqUZ%S7HaN3i|$`ck;m7Sz6S{Y_}`UoN%K{iOGozsJ+C?sZtFeC diff --git a/manage_externals/test/repos/container.git/objects/71/5b8f3e4afe1802a178e1d603af404ba45d59de b/manage_externals/test/repos/container.git/objects/71/5b8f3e4afe1802a178e1d603af404ba45d59de deleted file mode 100644 index 9759965b1ba440f1899216c1c82c0780fb65f46e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 136 zcmV;30C)d*0hNtQ3c@fDKwak)a{8g?ULFizQ5yOj!O$#BY{3QX>9e{j4e8<)

AV=y!@Ff%bx&`ZxO$xP47FG^)_lzn~QNUpn5)Pnq=ii~6DWK2pp8O#dS+Wke_L diff --git a/manage_externals/test/repos/container.git/objects/f9/e08370a737e941de6f6492e3f427c2ef4c1a03 b/manage_externals/test/repos/container.git/objects/f9/e08370a737e941de6f6492e3f427c2ef4c1a03 deleted file mode 100644 index 460fd7781917e095c826e8bc77ad53d943f199aa..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 81 zcmV-X0IvUd0R_Ry4S+BV1VG+Yu@&$_q5vvMU;#^(9XS?9_smrFie(;Fw=7}|1e56wgzpa&}fBkqfO*k&i_)dY`l?1hv=p}Fj<2Ge{uRcq{saZ z%j{g@HZ3wNvQv&lo|o_6gr*rieLQOSK`~u|R`NhFUI)68@B`BlpbA~$UTB9Ga*~zx a%Jelj*-|I)LF@ttC5adD0subgY(|R<&Qf{+ diff --git a/manage_externals/test/repos/mixed-cont-ext.git/objects/01/97458f2dbe5fcd6bc44fa46983be0a30282379 b/manage_externals/test/repos/mixed-cont-ext.git/objects/01/97458f2dbe5fcd6bc44fa46983be0a30282379 deleted file mode 100644 index 032f4b1ca6bf0d25f1f9f419b1e7ab2aae1ef6c8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 171 zcmV;c095~Y0Zomu4uUWgMV;SQFt~~^I5;?f2d%r6C&MNz$f6Pi}^^zp3SC&knSt>TGbz78}9=ZOL8&?Fv(cG!`VtgKgN ZY{1E$27wP^7dQxMoWuzLd;nlTMfbC)Q$zp& diff --git a/manage_externals/test/repos/mixed-cont-ext.git/objects/06/ea30b03ffa2f8574705f8b9583f7ca7e2dccf7 b/manage_externals/test/repos/mixed-cont-ext.git/objects/06/ea30b03ffa2f8574705f8b9583f7ca7e2dccf7 deleted file mode 100644 index 13d15a96a5071e98f0ba0cfbbdb2992c03990151..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 136 zcmV;30C)d*0hNtG4#FT106p`H{eaDGEd>%|)SJ(su+=pM4B|mwZ+(Kd$t05rB_(M< zmNu<2!_Lge2B#67kHO(Q1a!#� -MP�t��M�0v&�>���Kci����8V; \ No newline at end of file diff --git a/manage_externals/test/repos/mixed-cont-ext.git/objects/1f/01fa46c17b1f38b37e6259f6e9d041bda3144f b/manage_externals/test/repos/mixed-cont-ext.git/objects/1f/01fa46c17b1f38b37e6259f6e9d041bda3144f deleted file mode 100644 index 7bacde68db5f1201015d4532aba9551660b05399..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 167 zcmV;Y09gNc0hNxy4Z<)C0C{H$F90%4+_Vxxz$T7kLnR0(O(n*sumP`oo$loMcuWmC z-)~w~gsCf*eiQX=*_sZfntbAHl&dTZ&5gE zmqjc(UfS(h;i3i3C0B(5e{oub>rV4>ggxy?ABf1q79*mQ-&@oFEO*Ws<|S?Qy{d)p VGuU)ju(jTFZd1AL+y`g^OR&}EOOOBn diff --git a/manage_externals/test/repos/mixed-cont-ext.git/objects/37/f0e70b609adc90f4c09ee21d82ed1d79c81d69 b/manage_externals/test/repos/mixed-cont-ext.git/objects/37/f0e70b609adc90f4c09ee21d82ed1d79c81d69 deleted file mode 100644 index 8c6b04837ae4456cc5dc53ea7572610e6635d0d8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 89 zcmV-f0H*(V0V^p=O;s>AV=y!@Ff%bx&`ZxO$xP47FG^)_lzn`tC9-|*xG$A9N diff --git a/manage_externals/test/repos/mixed-cont-ext.git/objects/38/9a2b876b8965d3c91a3db8d28a483eaf019d5c b/manage_externals/test/repos/mixed-cont-ext.git/objects/38/9a2b876b8965d3c91a3db8d28a483eaf019d5c deleted file mode 100644 index 1a35b74d479fdfb4bf24bcf199663fbb52036eee..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 130 zcmV-|0Db>>0V^p=O;s>7GGs6`FfcPQQP4}zEXhpI%P&f0aFl&|Gw+GS!K3kZ)1Ezh zejs~i1S3>cQEFmJZmM2MMG3=S(WPsHSWJ^Nk8w52YBee>u{sG;Ra}~+n_5wlT9lWV kQ>>Sqmd-GFVdTA?;?e&$HE}Vp-My(>AuMbJ03PHp2Cniq;{X5v diff --git a/manage_externals/test/repos/mixed-cont-ext.git/objects/41/1de5d96ee418c1c55f3e96e6e6e7c06bb95801 b/manage_externals/test/repos/mixed-cont-ext.git/objects/41/1de5d96ee418c1c55f3e96e6e6e7c06bb95801 deleted file mode 100644 index f65234e17f32800b1be0aa9908cc706458b14605..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 133 zcmV;00DAv;0acB$4#OY}L_6~pma=t7)Fr=DfpLNr2P1F?mVSF_r3_t8x_fuJAR6GY zuD1yyS3=Xu)WDKA@Ra});Xx7fWf1zv2~1TS@=422pQw4`eHcB9X3EwU=O)-GQ}s5s nqUZ%S7HaN3i|$`ck;m7Sz6S{Y_}`UoN%K{iOGozsJ+C?sZtFeC diff --git a/manage_externals/test/repos/mixed-cont-ext.git/objects/6e/9f4baa6e94a0af4e094836c2eb55ccedef5fc4 b/manage_externals/test/repos/mixed-cont-ext.git/objects/6e/9f4baa6e94a0af4e094836c2eb55ccedef5fc4 deleted file mode 100644 index 6b2146cae4080fe2369401ecf5009fd9612c363c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 129 zcmV-{0Dk{?0V^p=O;s>7GGs6`FfcPQQP4}zEXhpI%P&f0aFl&|Gw+GS!K3kZ)1Ezh zejs~i1S3>cQEFmJZmM2MMG3=S(WPsHSWJ^Nk8w52YBee>u{sG;Ra}~+n_5wlT9lWV jQ>>Sqmd+qz)?FYbw&JLT!Zra%FYj6GAw1sz`R^`7StK`- diff --git a/manage_externals/test/repos/mixed-cont-ext.git/objects/6f/c379457ecb4e576a13c7610ae1fa73f845ee6a b/manage_externals/test/repos/mixed-cont-ext.git/objects/6f/c379457ecb4e576a13c7610ae1fa73f845ee6a deleted file mode 100644 index 852a051139..0000000000 --- a/manage_externals/test/repos/mixed-cont-ext.git/objects/6f/c379457ecb4e576a13c7610ae1fa73f845ee6a +++ /dev/null @@ -1 +0,0 @@ -x��AN�09�s��ʎ;�~2���J�^M�,�'�8���ԝھ_��yyR3؍lmv�ƕPB���FC��>�y���*�bla���-n^]D��,�x�fv��2p׭ }��G�z�x�����Nvq~Z����c��� ��y��+Q�T���t;]�C:�A��g���A�( XA�G���*=i\�_��^' \ No newline at end of file diff --git a/manage_externals/test/repos/mixed-cont-ext.git/objects/93/a159deb9175bfeb2820a0006ddd92d78131332 b/manage_externals/test/repos/mixed-cont-ext.git/objects/93/a159deb9175bfeb2820a0006ddd92d78131332 deleted file mode 100644 index 682d799898667fc1b506c6daece665c1af824fc1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 169 zcmV;a09OBa0X2=i4uUWgg`MwHFu01a>EM8d!9g*|M#xPmH`1igdRvT%@!c&N$Mf@@ z(`wU3>1MmAof<6C(>I`v6dJAYeYA@l%k@73%f=gNbntJ=1Cup4@hq3GQ+7Tcu*$C$ z?z1w-GQSj97De^`@|sp*JpN(#NilT+t9T-4S&VZ28ie!20Ci{*k3u`_$Vpb#D>F9W XWKV;@2eAt}0BM}W2>^TmrSn6;Se#N% diff --git a/manage_externals/test/repos/mixed-cont-ext.git/objects/95/80ecc12f16334ce44e42287d5d46f927bb7b75 b/manage_externals/test/repos/mixed-cont-ext.git/objects/95/80ecc12f16334ce44e42287d5d46f927bb7b75 deleted file mode 100644 index 33c9f6cdf1..0000000000 --- a/manage_externals/test/repos/mixed-cont-ext.git/objects/95/80ecc12f16334ce44e42287d5d46f927bb7b75 +++ /dev/null @@ -1 +0,0 @@ -x��KN�0Y��c�ȟLlK7鴟5#{��O��z��ғ�mW%ӓv�8�����&�eF����ٱ��$/����Uɞ�z�R��J���%ZY� |YS���C/��'*}��A��7�C����ۑ��ϋ1�^L0f��7����c� �b�/���Jo5�-Ů;����҅�A�H:XA�D�Z:�ڇ��8M��^� \ No newline at end of file diff --git a/manage_externals/test/repos/mixed-cont-ext.git/objects/a9/288dcd8a719a1f4ed3cba43a2a387ae7cd60fd b/manage_externals/test/repos/mixed-cont-ext.git/objects/a9/288dcd8a719a1f4ed3cba43a2a387ae7cd60fd deleted file mode 100644 index 73e7cbfbc8e106cee027f798dcb163ec6c5d21e6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 130 zcmV-|0Db>>0V^p=O;s>7GGs6`FfcPQQP4}zEXhpI%P&f0aFl&|Gw+GS!K3kZ)1Ezh zejs~i1S3>cQEFmJZmM2MMG3=S(WPsHSWJ^Nk8w52YBee>u{sG;Ra}~+n_5wlT9lWV kQ>>Sqmd?O9-L+qLU;NqZBmPS=oA+@UXed_#01>J$$h2KJZU6uP diff --git a/manage_externals/test/repos/mixed-cont-ext.git/objects/e8/ea32a11d30ee703f6f661ae7c2376f4ab84d38 b/manage_externals/test/repos/mixed-cont-ext.git/objects/e8/ea32a11d30ee703f6f661ae7c2376f4ab84d38 deleted file mode 100644 index 189ed85bb3c8b8642ae353d29a759f67040b5786..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 130 zcmV-|0Db>>0V^p=O;s>7GGs6`FfcPQQP4}zEXhpI%P&f0aFl&|Gw+GS!K3kZ)1Ezh zejs~i1S3>cQEFmJZmM2MMG3=S(WPsHSWJ^Nk8w52YBee>u{sG;Ra}~+n_5wlT9lWV kQ>>Sqmd?Q7Ty=.p��A -!��� �w4ݵ��Q����=�ä��Z9�0���k� ��G)* \ No newline at end of file diff --git a/manage_externals/test/repos/mixed-cont-ext.git/refs/heads/master b/manage_externals/test/repos/mixed-cont-ext.git/refs/heads/master deleted file mode 100644 index 1e0eef1ea3..0000000000 --- a/manage_externals/test/repos/mixed-cont-ext.git/refs/heads/master +++ /dev/null @@ -1 +0,0 @@ -6fc379457ecb4e576a13c7610ae1fa73f845ee6a diff --git a/manage_externals/test/repos/mixed-cont-ext.git/refs/heads/new-feature b/manage_externals/test/repos/mixed-cont-ext.git/refs/heads/new-feature deleted file mode 100644 index 607e80d1bc..0000000000 --- a/manage_externals/test/repos/mixed-cont-ext.git/refs/heads/new-feature +++ /dev/null @@ -1 +0,0 @@ -9580ecc12f16334ce44e42287d5d46f927bb7b75 diff --git a/manage_externals/test/repos/simple-ext-fork.git/HEAD b/manage_externals/test/repos/simple-ext-fork.git/HEAD deleted file mode 100644 index cb089cd89a..0000000000 --- a/manage_externals/test/repos/simple-ext-fork.git/HEAD +++ /dev/null @@ -1 +0,0 @@ -ref: refs/heads/master diff --git a/manage_externals/test/repos/simple-ext-fork.git/config b/manage_externals/test/repos/simple-ext-fork.git/config deleted file mode 100644 index 04eba17870..0000000000 --- a/manage_externals/test/repos/simple-ext-fork.git/config +++ /dev/null @@ -1,8 +0,0 @@ -[core] - repositoryformatversion = 0 - filemode = true - bare = true - ignorecase = true - precomposeunicode = true -[remote "origin"] - url = /Users/andreb/projects/ncar/git-conversion/checkout-model-dev/cesm-demo-externals/manage_externals/test/repos/simple-ext.git diff --git a/manage_externals/test/repos/simple-ext-fork.git/description b/manage_externals/test/repos/simple-ext-fork.git/description deleted file mode 100644 index 498b267a8c..0000000000 --- a/manage_externals/test/repos/simple-ext-fork.git/description +++ /dev/null @@ -1 +0,0 @@ -Unnamed repository; edit this file 'description' to name the repository. diff --git a/manage_externals/test/repos/simple-ext-fork.git/info/exclude b/manage_externals/test/repos/simple-ext-fork.git/info/exclude deleted file mode 100644 index a5196d1be8..0000000000 --- a/manage_externals/test/repos/simple-ext-fork.git/info/exclude +++ /dev/null @@ -1,6 +0,0 @@ -# git ls-files --others --exclude-from=.git/info/exclude -# Lines that start with '#' are comments. -# For a project mostly in C, the following would be a good set of -# exclude patterns (uncomment them if you want to use them): -# *.[oa] -# *~ diff --git a/manage_externals/test/repos/simple-ext-fork.git/objects/00/fd13e76189f9134b0506b4b8ed3172723b467f b/manage_externals/test/repos/simple-ext-fork.git/objects/00/fd13e76189f9134b0506b4b8ed3172723b467f deleted file mode 100644 index ae28c037e5e8773bab7a7f9b6b050a01c3c8402a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 89 zcmV-f0H*(V0V^p=O;s>AV=y!@Ff%bx&`ZxO$xP47FG^)_lznAV=y!@Ff%bx&`ZxO$xP47FG^)_lzn&Ekz!U-;cU~)E`&5u^pl|A>?=DrCt|Zp*KGhtORPb%uc6q&p;{~x`YAHy z#2GbEv6YQH#`fOIuH1gSE*yL=Ojyh~{nIdqe*nnpf*T V&^Fln@|2-4tBgli^9u#mM`!{nPaFUM diff --git a/manage_externals/test/repos/simple-ext-fork.git/objects/11/a76e3d9a67313dec7ce1230852ab5c86352c5c b/manage_externals/test/repos/simple-ext-fork.git/objects/11/a76e3d9a67313dec7ce1230852ab5c86352c5c deleted file mode 100644 index 564e7bba63..0000000000 --- a/manage_externals/test/repos/simple-ext-fork.git/objects/11/a76e3d9a67313dec7ce1230852ab5c86352c5c +++ /dev/null @@ -1,2 +0,0 @@ -x%�K -�0@]�se&�DԛL�!����l��).���u.@�_��J�0���lM��~v:��mL��i���Y*/���@�p�� W �J�&���)�*� \ No newline at end of file diff --git a/manage_externals/test/repos/simple-ext-fork.git/objects/16/5506a7408a482f50493434e13fffeb44af893f b/manage_externals/test/repos/simple-ext-fork.git/objects/16/5506a7408a482f50493434e13fffeb44af893f deleted file mode 100644 index 0d738af68b021dcd9918c8f2047aa4fff55bf6e4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 89 zcmV-f0H*(V0V^p=O;s>AV=y!@Ff%bx&`ZxO$xP47FG^)_lznO)_H(Z zem6QZm^^8RnmiI`ubHzgrPye+FKRN0H9F;O5%17>8Q`NMJ?ehWT|!t)2i0Np3Z=u$N9svC-|`;J-!jY5fUp SfzGuJhQeX2oy8Y4sYkDN{z{Sn diff --git a/manage_externals/test/repos/simple-ext-fork.git/objects/32/7e97d86e941047d809dba58f2804740c6c30cf b/manage_externals/test/repos/simple-ext-fork.git/objects/32/7e97d86e941047d809dba58f2804740c6c30cf deleted file mode 100644 index 0999f0d4b9b4297e5677a96f3c9677bf408ee8d9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 89 zcmV-f0H*(V0V^p=O;s>AV=y!@Ff%bx&`ZxO$xP47FG^)_lzniemt(y-3DP$mtIvOOf diff --git a/manage_externals/test/repos/simple-ext-fork.git/objects/36/418b4e5665956a90725c9a1b5a8e551c5f3d48 b/manage_externals/test/repos/simple-ext-fork.git/objects/36/418b4e5665956a90725c9a1b5a8e551c5f3d48 deleted file mode 100644 index 9da8434f65ef3bfdb57cb8117e312a56663a31a2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 159 zcmV;Q0AT-k0hNwh3c@fD0R7G>_5#Z8=Ft>H)JyoiX*NFFNQn2h9>Kq1U|^;?&-V_@ zcGH_GU?Q(kip?&NPmV1)rl3VdZ7GGKLl-2Pw=`WkjA`(0bci�`�}0�M�؇B��s0/��}��:: \ No newline at end of file diff --git a/manage_externals/test/repos/simple-ext-fork.git/objects/3d/ec1fdf8e2f5edba28148c5db2fe8d7a842360b b/manage_externals/test/repos/simple-ext-fork.git/objects/3d/ec1fdf8e2f5edba28148c5db2fe8d7a842360b deleted file mode 100644 index 9a31c7ef2e..0000000000 --- a/manage_externals/test/repos/simple-ext-fork.git/objects/3d/ec1fdf8e2f5edba28148c5db2fe8d7a842360b +++ /dev/null @@ -1,2 +0,0 @@ -x��Kn�0 ��)x��,�I�Eџ��A��#t7o���۶vp.�zS������&o���d�8�xL�d@�̋��C�6f�% -�pt$�m&�Jd����h�ݗ���Vx�����p�7^/�o7�d�K1�GDs�#�뿏�{o?Z 7���,\g��AV=y!@Ff%bx&`ZxO$xP47FG^)_lznAV=y!@Ff%bx&`ZxO$xP47FG^)_lznvGy0&Z${j?E8>6rD10GHRYE2d diff --git a/manage_externals/test/repos/simple-ext-fork.git/objects/5f/1d4786d12e52d7ab28d2f2f1118c1059a9f1ae b/manage_externals/test/repos/simple-ext-fork.git/objects/5f/1d4786d12e52d7ab28d2f2f1118c1059a9f1ae deleted file mode 100644 index 25488b7bfe52fd0d530e20393b752815d9aaf16f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 93 zcmV-j0HXhR0S(JB4ue1p1i;kyiv0l8%LNPZurX=iP=VtPL2T>`g? zkh3=;83|{%kTn0{lH8#Nev_`XVPmImRbRpwOIgehnBL{IWwXg diff --git a/manage_externals/test/repos/simple-ext-fork.git/objects/67/136e5ab4d5c1c65d10c8048763b96b0e53c1d6 b/manage_externals/test/repos/simple-ext-fork.git/objects/67/136e5ab4d5c1c65d10c8048763b96b0e53c1d6 deleted file mode 100644 index d3dfe31113715fe07ea6833f0c2a25e868ac20b2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 165 zcmV;W09yZe0hNwR4#F@DL|Nw)z5pm6r*$QSfIWwB8k=t$6s6+&lq0Ykjo#?ZSf=UT zz+~D012)4Gj)~xM%ugTv-b1AFi TQ|c4S3@Y4~D&BknM3zUWvn5b3 diff --git a/manage_externals/test/repos/simple-ext-fork.git/objects/7b/0bd630ac13865735a1dff3437a137d8ab50663 b/manage_externals/test/repos/simple-ext-fork.git/objects/7b/0bd630ac13865735a1dff3437a137d8ab50663 deleted file mode 100644 index 0a2ec0494bc1600144cb54b61a6d7b43c7f3e806..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 119 zcmV--0Eqv10X50d4FVw$MNz-0;#IJTYiz*^YyjkKAhHY@MpwI+#E{&tb3>7U^YwDN zr`$2}=y`92Fm{8oNzW$w#gQ$c3ivT<^#zfQHTwF����rPk�S�kJ�^� \ No newline at end of file diff --git a/manage_externals/test/repos/simple-ext-fork.git/objects/a4/2fe9144f5707bc1e9515ce1b44681f7aba6f95 b/manage_externals/test/repos/simple-ext-fork.git/objects/a4/2fe9144f5707bc1e9515ce1b44681f7aba6f95 deleted file mode 100644 index d8ba654548..0000000000 --- a/manage_externals/test/repos/simple-ext-fork.git/objects/a4/2fe9144f5707bc1e9515ce1b44681f7aba6f95 +++ /dev/null @@ -1,3 +0,0 @@ -xU�[ -�0�a����@%Is+��;��c/�D�q�V����>� �w�WJ ژ>8�!�!&'�S=)���C�F+�I2��O�Ts^X�n`�2�Bcw'��w���� -\��NqݛF�)��8��3(���2:���0x-<׍!6,i �9 \ No newline at end of file diff --git a/manage_externals/test/repos/simple-ext-fork.git/objects/b9/3737be3ea6b19f6255983748a0a0f4d622f936 b/manage_externals/test/repos/simple-ext-fork.git/objects/b9/3737be3ea6b19f6255983748a0a0f4d622f936 deleted file mode 100644 index 9b40a0afa00b93a318cd503d3b29db1162978b03..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 89 zcmV-f0H*(V0V^p=O;s>AV=y!@Ff%bx&`ZxO$xP47FG^)_lznD�}�D>�N�v��{�Z�M�I��?j���p�s8�g��ӽ�qڥZ��qo j��f��J�{]�յ�����Om/�3�$���Q_@�H� \ No newline at end of file diff --git a/manage_externals/test/repos/simple-ext-fork.git/packed-refs b/manage_externals/test/repos/simple-ext-fork.git/packed-refs deleted file mode 100644 index b8f9e86308..0000000000 --- a/manage_externals/test/repos/simple-ext-fork.git/packed-refs +++ /dev/null @@ -1,5 +0,0 @@ -# pack-refs with: peeled fully-peeled sorted -36418b4e5665956a90725c9a1b5a8e551c5f3d48 refs/heads/feature2 -9b75494003deca69527bb64bcaa352e801611dd2 refs/heads/master -11a76e3d9a67313dec7ce1230852ab5c86352c5c refs/tags/tag1 -^9b75494003deca69527bb64bcaa352e801611dd2 diff --git a/manage_externals/test/repos/simple-ext-fork.git/refs/heads/feature2 b/manage_externals/test/repos/simple-ext-fork.git/refs/heads/feature2 deleted file mode 100644 index d223b0362d..0000000000 --- a/manage_externals/test/repos/simple-ext-fork.git/refs/heads/feature2 +++ /dev/null @@ -1 +0,0 @@ -f268d4e56d067da9bd1d85e55bdc40a8bd2b0bca diff --git a/manage_externals/test/repos/simple-ext-fork.git/refs/tags/abandoned-feature b/manage_externals/test/repos/simple-ext-fork.git/refs/tags/abandoned-feature deleted file mode 100644 index 8a18bf08e9..0000000000 --- a/manage_externals/test/repos/simple-ext-fork.git/refs/tags/abandoned-feature +++ /dev/null @@ -1 +0,0 @@ -a42fe9144f5707bc1e9515ce1b44681f7aba6f95 diff --git a/manage_externals/test/repos/simple-ext-fork.git/refs/tags/forked-feature-v1 b/manage_externals/test/repos/simple-ext-fork.git/refs/tags/forked-feature-v1 deleted file mode 100644 index 2764b552d5..0000000000 --- a/manage_externals/test/repos/simple-ext-fork.git/refs/tags/forked-feature-v1 +++ /dev/null @@ -1 +0,0 @@ -8d2b3b35126224c975d23f109aa1e3cbac452989 diff --git a/manage_externals/test/repos/simple-ext.git/HEAD b/manage_externals/test/repos/simple-ext.git/HEAD deleted file mode 100644 index cb089cd89a..0000000000 --- a/manage_externals/test/repos/simple-ext.git/HEAD +++ /dev/null @@ -1 +0,0 @@ -ref: refs/heads/master diff --git a/manage_externals/test/repos/simple-ext.git/config b/manage_externals/test/repos/simple-ext.git/config deleted file mode 100644 index e6da231579..0000000000 --- a/manage_externals/test/repos/simple-ext.git/config +++ /dev/null @@ -1,6 +0,0 @@ -[core] - repositoryformatversion = 0 - filemode = true - bare = true - ignorecase = true - precomposeunicode = true diff --git a/manage_externals/test/repos/simple-ext.git/description b/manage_externals/test/repos/simple-ext.git/description deleted file mode 100644 index 498b267a8c..0000000000 --- a/manage_externals/test/repos/simple-ext.git/description +++ /dev/null @@ -1 +0,0 @@ -Unnamed repository; edit this file 'description' to name the repository. diff --git a/manage_externals/test/repos/simple-ext.git/info/exclude b/manage_externals/test/repos/simple-ext.git/info/exclude deleted file mode 100644 index a5196d1be8..0000000000 --- a/manage_externals/test/repos/simple-ext.git/info/exclude +++ /dev/null @@ -1,6 +0,0 @@ -# git ls-files --others --exclude-from=.git/info/exclude -# Lines that start with '#' are comments. -# For a project mostly in C, the following would be a good set of -# exclude patterns (uncomment them if you want to use them): -# *.[oa] -# *~ diff --git a/manage_externals/test/repos/simple-ext.git/objects/00/fd13e76189f9134b0506b4b8ed3172723b467f b/manage_externals/test/repos/simple-ext.git/objects/00/fd13e76189f9134b0506b4b8ed3172723b467f deleted file mode 100644 index ae28c037e5e8773bab7a7f9b6b050a01c3c8402a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 89 zcmV-f0H*(V0V^p=O;s>AV=y!@Ff%bx&`ZxO$xP47FG^)_lznbW_*ltIGSP}@rN;eRaRvTe4jec)&9#mV ztc{ztsDi^RDN|POQ7IsM3R)Zn^fb6Ap%fNDG*4c1YCyeUO2}@P$+4Hjj2b9dvLb3- zmJ-WQ2E*@mn-@6i1g9x43VXTpcO0*k$48gudH@`(^)|-1gKbZJZ&teIHT_#Om*271 ST(#ZC=?eOIX=gtC)=0=UK}@j# diff --git a/manage_externals/test/repos/simple-ext.git/objects/0b/15e8af3d4615b42314216efeae3fff184046a8 b/manage_externals/test/repos/simple-ext.git/objects/0b/15e8af3d4615b42314216efeae3fff184046a8 deleted file mode 100644 index 32d6896e3cb813edde3e4f0d0ca2d21963c2f1b0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 89 zcmV-f0H*(V0V^p=O;s>AV=y!@Ff%bx&`ZxO$xP47FG^)_lzn�Y*/���@�p�� W �J�&���)�*� \ No newline at end of file diff --git a/manage_externals/test/repos/simple-ext.git/objects/14/2711fdbbcb8034d7cad6bae6801887b12fe61d b/manage_externals/test/repos/simple-ext.git/objects/14/2711fdbbcb8034d7cad6bae6801887b12fe61d deleted file mode 100644 index acaf7889b47c54ee0dea121c73d505ca14ad369b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 83 zcmV-Z0IdIb0ZYosPg1ZjWC+Q~ELKR%%t=)!&d4v#Nl{3x$Sf{V$jnnnRLILO%1z8s pNX|%2&dx6_QAh$}pz8eG%#xDS6o{JQg2bZYRJa;FE&z4gA7ySEC>H<# diff --git a/manage_externals/test/repos/simple-ext.git/objects/31/dbcd6de441e671a467ef317146539b7ffabb11 b/manage_externals/test/repos/simple-ext.git/objects/31/dbcd6de441e671a467ef317146539b7ffabb11 deleted file mode 100644 index 0f0db6797fe19372f1d2122ebe8aa5361df07c61..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 90 zcmV-g0HyzU0V^p=O;s>AV=y!@Ff%bx&`ZxO$xP47FG^)_lzn_5#Z8=Ft>H)JyoiX*NFFNQn2h9>Kq1U|^;?&-V_@ zcGH_GU?Q(kip?&NPmV1)rl3VdZ7GGKLl-2Pw=`WkjA`(0bciMsIi;$9n_k z!>-M$Ac)DAYy~^^qUu9WLY{J}xkT>CQ3)XSx����rPk�S�kJ�^� \ No newline at end of file diff --git a/manage_externals/test/repos/simple-ext.git/objects/b7/692b6d391899680da7b9b6fd8af4c413f06fe7 b/manage_externals/test/repos/simple-ext.git/objects/b7/692b6d391899680da7b9b6fd8af4c413f06fe7 deleted file mode 100644 index 1b3b2724425492336f2816dc6ba4d818474f3c78..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 137 zcmV;40CxX)0Tql%4#F@D06FIs{s71hZqrBz@d!Q;98>0V^p=O;s>7G-EI{FfcPQQP4}zEXhpI%P&f0aFl&|Gw+GS!K3kZ)1Ezh zejs~i1S3>cQEFmJZmM2MMG3KlvCEtNF?@%PbVOT{Nm)vLb%0Bl_``r7C@umAu6 diff --git a/manage_externals/test/repos/simple-ext.git/objects/d8/ed2f33179d751937f8fde2e33921e4827babf4 b/manage_externals/test/repos/simple-ext.git/objects/d8/ed2f33179d751937f8fde2e33921e4827babf4 deleted file mode 100644 index f08ae820c9c89927f9898c5646134f7c519a6b04..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 60 zcmV-C0K@-y0V^p=O;s>4W-v4`Ff%bxC@xJ($t;Rb%gjmDE2$`95K$NWyZdy5$@Np$ Sc0Fs5Xy2&+OcnsW_!K#a0~pW% diff --git a/manage_externals/test/repos/simple-ext.git/objects/df/312890f93ba4d2c694208599b665c4a08afeff b/manage_externals/test/repos/simple-ext.git/objects/df/312890f93ba4d2c694208599b665c4a08afeff deleted file mode 100644 index 4018ea5914ee89b76d88fc282b6c98d80e4aaccd..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 89 zcmV-f0H*(V0V^p=O;s>AV=y!@Ff%bx&`ZxO$xP47FG^)_lznQTy(n&njm5*>#d|ehiI!uT zo%TC>#d3w1Jtzo300Izz00bZa0SG_<0uX?}pA`5U@~wkvm49vLDta+zt1RRiHZQ=L;CU@@4?#yhXLbg~~mc>fT`3nX?Ls&t(q_@;kd&|6q zPmnj!N-"j%`;)7F<&!^&p5-&NVNc`P`LVZ4M1vhI123LfW679Jk&yS}h4J?+gU zS3MZfY8^$e`Aiw@d{Ry%1dI`+SBZs%>uw7^VT{$-o>k4Xyk=x|K`9*$$d+#CX^Zv$ zf4Az(2{}^ad;78;-W-sx-=Fn>9+LNu&)3o0-}x~i0yI}C8O(!53mF)Lc9yx|g^G|c ej~cmPzoZI_YZ6{Gdr_88^Nk1hnf(AO7WJ=&dj!fDn0uL2;xcFgCGi};7P%MLA>_hL1!bWwMgk<=JI{-``-8Sx~2ler?X@>qvZhS z>jPT>)6KB%uk~`LVLed!QU%IMrh0nGt~zC~p7r~M2xW}B&Vh{`_(=}ATKsQ!Fzyy7 zc4uq7<>SMvwZ?-a) z)0B>oW87dZf4*6*J;dJdmgjkw&ZC`k2j2VA6K~^ji#5jLtJ2Wv5xP@BFE&4IU%WYq zems5i{p{Q%din14uL~NZ-LD^~H)6E)d2he;%)5-9fBCR^<=fA>YX}J*yI_JaqN6CX rO2(X~(lQ>UT$426lExq+3DoM8C~b*QiI&DOO{6l~rdCtJNj(1>+FjA$ diff --git a/manage_externals/test/repos/simple-ext.svn/db/revs/0/2 b/manage_externals/test/repos/simple-ext.svn/db/revs/0/2 deleted file mode 100644 index 99a14cf4b7f76ee26eba753930dd53704627e1f5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 816 zcmZvZJ!lj`6vt;bpA3nm2sW<~jBwfc+L_sFOu`))jUhw{0gGh577vfyac(dHi+~?R zh?R}CT|}_e+9r*qV5N;MStC{G3)m;lNk zCm~lv(?C<68Ar-%YL%o`uYzC#rkyZdVR9kD9Q-!%}%S;O#unUwLYMU_)@exaSbTJeGis^rnsBF zpQ$A6r{xuTL@SSJeWQcholp+qxI~k*M^FFKr;u_G6ohjsvpQAEc$GQHnKxDmExDoA zqy#EZIZ5|4d3k=%Gb>dAc}$Wl&XYP%bKGo< zTmjWejYqZH7n7Q%0^8yGT2lbUjl12Rz=7w$2rz4bdULXUmfC*4ic;URV zT5%(!r#bby^on`qSY{66?ef&aVF)RMbPpw2dC8>a+6zOarB*P`g_V_4QdROm3)2?cKX5He8X8kD zRTa09dUI>+4($Ie?{8&&x)?7E=6hH1%;vc$isp`@N5_6ekGpR>52FX2McUt&KhAE3 z8yY={3bg&={dRN#qtCB?emH(VI)R>Tecg&qWAyFm%XhPPH2SpjWe4}>(DxsApLgH< zK6?@&t~A)(Gf_HKN~e|J&g9-2E__xI=82{tXa=RNLR*{|XCxC^W?VX{y(YOLf>dnb E4; /dev/null || exit 1 - -# Check that the author of this commit has the rights to perform -# the commit on the files and directories being modified. -commit-access-control.pl "$REPOS" "$TXN" commit-access-control.cfg || exit 1 - -# All checks passed, so allow the commit. -exit 0 diff --git a/manage_externals/test/repos/simple-ext.svn/hooks/pre-lock.tmpl b/manage_externals/test/repos/simple-ext.svn/hooks/pre-lock.tmpl deleted file mode 100755 index 148582a689..0000000000 --- a/manage_externals/test/repos/simple-ext.svn/hooks/pre-lock.tmpl +++ /dev/null @@ -1,95 +0,0 @@ -#!/bin/sh - -# PRE-LOCK HOOK -# -# The pre-lock hook is invoked before an exclusive lock is -# created. Subversion runs this hook by invoking a program -# (script, executable, binary, etc.) named 'pre-lock' (for which -# this file is a template), with the following ordered arguments: -# -# [1] REPOS-PATH (the path to this repository) -# [2] PATH (the path in the repository about to be locked) -# [3] USER (the user creating the lock) -# [4] COMMENT (the comment of the lock) -# [5] STEAL-LOCK (1 if the user is trying to steal the lock, else 0) -# -# If the hook program outputs anything on stdout, the output string will -# be used as the lock token for this lock operation. If you choose to use -# this feature, you must guarantee the tokens generated are unique across -# the repository each time. -# -# If the hook program exits with success, the lock is created; but -# if it exits with failure (non-zero), the lock action is aborted -# and STDERR is returned to the client. -# -# The default working directory for the invocation is undefined, so -# the program should set one explicitly if it cares. -# -# On a Unix system, the normal procedure is to have 'pre-lock' -# invoke other programs to do the real work, though it may do the -# work itself too. -# -# Note that 'pre-lock' must be executable by the user(s) who will -# invoke it (typically the user httpd runs as), and that user must -# have filesystem-level permission to access the repository. -# -# On a Windows system, you should name the hook program -# 'pre-lock.bat' or 'pre-lock.exe', -# but the basic idea is the same. -# -# The hook program runs in an empty environment, unless the server is -# explicitly configured otherwise. For example, a common problem is for -# the PATH environment variable to not be set to its usual value, so -# that subprograms fail to launch unless invoked via absolute path. -# If you're having unexpected problems with a hook program, the -# culprit may be unusual (or missing) environment variables. -# -# CAUTION: -# For security reasons, you MUST always properly quote arguments when -# you use them, as those arguments could contain whitespace or other -# problematic characters. Additionally, you should delimit the list -# of options with "--" before passing the arguments, so malicious -# clients cannot bootleg unexpected options to the commands your -# script aims to execute. -# For similar reasons, you should also add a trailing @ to URLs which -# are passed to SVN commands accepting URLs with peg revisions. -# -# Here is an example hook script, for a Unix /bin/sh interpreter. -# For more examples and pre-written hooks, see those in -# the Subversion repository at -# http://svn.apache.org/repos/asf/subversion/trunk/tools/hook-scripts/ and -# http://svn.apache.org/repos/asf/subversion/trunk/contrib/hook-scripts/ - - -REPOS="$1" -PATH="$2" -USER="$3" -COMMENT="$4" -STEAL="$5" - -# If a lock exists and is owned by a different person, don't allow it -# to be stolen (e.g., with 'svn lock --force ...'). - -# (Maybe this script could send email to the lock owner?) -SVNLOOK=/opt/homebrew/Cellar/subversion/1.14.2_1/bin/svnlook -GREP=/bin/grep -SED=/bin/sed - -LOCK_OWNER=`$SVNLOOK lock "$REPOS" "$PATH" | \ - $GREP '^Owner: ' | $SED 's/Owner: //'` - -# If we get no result from svnlook, there's no lock, allow the lock to -# happen: -if [ "$LOCK_OWNER" = "" ]; then - exit 0 -fi - -# If the person locking matches the lock's owner, allow the lock to -# happen: -if [ "$LOCK_OWNER" = "$USER" ]; then - exit 0 -fi - -# Otherwise, we've got an owner mismatch, so return failure: -echo "Error: $PATH already locked by ${LOCK_OWNER}." 1>&2 -exit 1 diff --git a/manage_externals/test/repos/simple-ext.svn/hooks/pre-revprop-change.tmpl b/manage_externals/test/repos/simple-ext.svn/hooks/pre-revprop-change.tmpl deleted file mode 100755 index 8b065d7c79..0000000000 --- a/manage_externals/test/repos/simple-ext.svn/hooks/pre-revprop-change.tmpl +++ /dev/null @@ -1,79 +0,0 @@ -#!/bin/sh - -# PRE-REVPROP-CHANGE HOOK -# -# The pre-revprop-change hook is invoked before a revision property -# is added, modified or deleted. Subversion runs this hook by invoking -# a program (script, executable, binary, etc.) named 'pre-revprop-change' -# (for which this file is a template), with the following ordered -# arguments: -# -# [1] REPOS-PATH (the path to this repository) -# [2] REV (the revision being tweaked) -# [3] USER (the username of the person tweaking the property) -# [4] PROPNAME (the property being set on the revision) -# [5] ACTION (the property is being 'A'dded, 'M'odified, or 'D'eleted) -# -# [STDIN] PROPVAL ** the new property value is passed via STDIN. -# -# If the hook program exits with success, the propchange happens; but -# if it exits with failure (non-zero), the propchange doesn't happen. -# The hook program can use the 'svnlook' utility to examine the -# existing value of the revision property. -# -# WARNING: unlike other hooks, this hook MUST exist for revision -# properties to be changed. If the hook does not exist, Subversion -# will behave as if the hook were present, but failed. The reason -# for this is that revision properties are UNVERSIONED, meaning that -# a successful propchange is destructive; the old value is gone -# forever. We recommend the hook back up the old value somewhere. -# -# The default working directory for the invocation is undefined, so -# the program should set one explicitly if it cares. -# -# On a Unix system, the normal procedure is to have 'pre-revprop-change' -# invoke other programs to do the real work, though it may do the -# work itself too. -# -# Note that 'pre-revprop-change' must be executable by the user(s) who will -# invoke it (typically the user httpd runs as), and that user must -# have filesystem-level permission to access the repository. -# -# On a Windows system, you should name the hook program -# 'pre-revprop-change.bat' or 'pre-revprop-change.exe', -# but the basic idea is the same. -# -# The hook program runs in an empty environment, unless the server is -# explicitly configured otherwise. For example, a common problem is for -# the PATH environment variable to not be set to its usual value, so -# that subprograms fail to launch unless invoked via absolute path. -# If you're having unexpected problems with a hook program, the -# culprit may be unusual (or missing) environment variables. -# -# CAUTION: -# For security reasons, you MUST always properly quote arguments when -# you use them, as those arguments could contain whitespace or other -# problematic characters. Additionally, you should delimit the list -# of options with "--" before passing the arguments, so malicious -# clients cannot bootleg unexpected options to the commands your -# script aims to execute. -# For similar reasons, you should also add a trailing @ to URLs which -# are passed to SVN commands accepting URLs with peg revisions. -# -# Here is an example hook script, for a Unix /bin/sh interpreter. -# For more examples and pre-written hooks, see those in -# the Subversion repository at -# http://svn.apache.org/repos/asf/subversion/trunk/tools/hook-scripts/ and -# http://svn.apache.org/repos/asf/subversion/trunk/contrib/hook-scripts/ - - -REPOS="$1" -REV="$2" -USER="$3" -PROPNAME="$4" -ACTION="$5" - -if [ "$ACTION" = "M" -a "$PROPNAME" = "svn:log" ]; then exit 0; fi - -echo "Changing revision properties other than svn:log is prohibited" >&2 -exit 1 diff --git a/manage_externals/test/repos/simple-ext.svn/hooks/pre-unlock.tmpl b/manage_externals/test/repos/simple-ext.svn/hooks/pre-unlock.tmpl deleted file mode 100755 index 9ba99d071b..0000000000 --- a/manage_externals/test/repos/simple-ext.svn/hooks/pre-unlock.tmpl +++ /dev/null @@ -1,87 +0,0 @@ -#!/bin/sh - -# PRE-UNLOCK HOOK -# -# The pre-unlock hook is invoked before an exclusive lock is -# destroyed. Subversion runs this hook by invoking a program -# (script, executable, binary, etc.) named 'pre-unlock' (for which -# this file is a template), with the following ordered arguments: -# -# [1] REPOS-PATH (the path to this repository) -# [2] PATH (the path in the repository about to be unlocked) -# [3] USER (the user destroying the lock) -# [4] TOKEN (the lock token to be destroyed) -# [5] BREAK-UNLOCK (1 if the user is breaking the lock, else 0) -# -# If the hook program exits with success, the lock is destroyed; but -# if it exits with failure (non-zero), the unlock action is aborted -# and STDERR is returned to the client. -# -# The default working directory for the invocation is undefined, so -# the program should set one explicitly if it cares. -# -# On a Unix system, the normal procedure is to have 'pre-unlock' -# invoke other programs to do the real work, though it may do the -# work itself too. -# -# Note that 'pre-unlock' must be executable by the user(s) who will -# invoke it (typically the user httpd runs as), and that user must -# have filesystem-level permission to access the repository. -# -# On a Windows system, you should name the hook program -# 'pre-unlock.bat' or 'pre-unlock.exe', -# but the basic idea is the same. -# -# The hook program runs in an empty environment, unless the server is -# explicitly configured otherwise. For example, a common problem is for -# the PATH environment variable to not be set to its usual value, so -# that subprograms fail to launch unless invoked via absolute path. -# If you're having unexpected problems with a hook program, the -# culprit may be unusual (or missing) environment variables. -# -# CAUTION: -# For security reasons, you MUST always properly quote arguments when -# you use them, as those arguments could contain whitespace or other -# problematic characters. Additionally, you should delimit the list -# of options with "--" before passing the arguments, so malicious -# clients cannot bootleg unexpected options to the commands your -# script aims to execute. -# For similar reasons, you should also add a trailing @ to URLs which -# are passed to SVN commands accepting URLs with peg revisions. -# -# Here is an example hook script, for a Unix /bin/sh interpreter. -# For more examples and pre-written hooks, see those in -# the Subversion repository at -# http://svn.apache.org/repos/asf/subversion/trunk/tools/hook-scripts/ and -# http://svn.apache.org/repos/asf/subversion/trunk/contrib/hook-scripts/ - - -REPOS="$1" -PATH="$2" -USER="$3" -TOKEN="$4" -BREAK="$5" - -# If a lock is owned by a different person, don't allow it be broken. -# (Maybe this script could send email to the lock owner?) - -SVNLOOK=/opt/homebrew/Cellar/subversion/1.14.2_1/bin/svnlook -GREP=/bin/grep -SED=/bin/sed - -LOCK_OWNER=`$SVNLOOK lock "$REPOS" "$PATH" | \ - $GREP '^Owner: ' | $SED 's/Owner: //'` - -# If we get no result from svnlook, there's no lock, return success: -if [ "$LOCK_OWNER" = "" ]; then - exit 0 -fi - -# If the person unlocking matches the lock's owner, return success: -if [ "$LOCK_OWNER" = "$USER" ]; then - exit 0 -fi - -# Otherwise, we've got an owner mismatch, so return failure: -echo "Error: $PATH locked by ${LOCK_OWNER}." 1>&2 -exit 1 diff --git a/manage_externals/test/repos/simple-ext.svn/hooks/start-commit.tmpl b/manage_externals/test/repos/simple-ext.svn/hooks/start-commit.tmpl deleted file mode 100755 index 1395e8315a..0000000000 --- a/manage_externals/test/repos/simple-ext.svn/hooks/start-commit.tmpl +++ /dev/null @@ -1,81 +0,0 @@ -#!/bin/sh - -# START-COMMIT HOOK -# -# The start-commit hook is invoked immediately after a Subversion txn is -# created and populated with initial revprops in the process of doing a -# commit. Subversion runs this hook by invoking a program (script, -# executable, binary, etc.) named 'start-commit' (for which this file -# is a template) with the following ordered arguments: -# -# [1] REPOS-PATH (the path to this repository) -# [2] USER (the authenticated user attempting to commit) -# [3] CAPABILITIES (a colon-separated list of capabilities reported -# by the client; see note below) -# [4] TXN-NAME (the name of the commit txn just created) -# -# Note: The CAPABILITIES parameter is new in Subversion 1.5, and 1.5 -# clients will typically report at least the "mergeinfo" capability. -# If there are other capabilities, then the list is colon-separated, -# e.g.: "mergeinfo:some-other-capability" (the order is undefined). -# -# The list is self-reported by the client. Therefore, you should not -# make security assumptions based on the capabilities list, nor should -# you assume that clients reliably report every capability they have. -# -# Note: The TXN-NAME parameter is new in Subversion 1.8. Prior to version -# 1.8, the start-commit hook was invoked before the commit txn was even -# created, so the ability to inspect the commit txn and its metadata from -# within the start-commit hook was not possible. -# -# If the hook program exits with success, the commit continues; but -# if it exits with failure (non-zero), the commit is stopped before -# a Subversion txn is created, and STDERR is returned to the client. -# -# The default working directory for the invocation is undefined, so -# the program should set one explicitly if it cares. -# -# On a Unix system, the normal procedure is to have 'start-commit' -# invoke other programs to do the real work, though it may do the -# work itself too. -# -# Note that 'start-commit' must be executable by the user(s) who will -# invoke it (typically the user httpd runs as), and that user must -# have filesystem-level permission to access the repository. -# -# On a Windows system, you should name the hook program -# 'start-commit.bat' or 'start-commit.exe', -# but the basic idea is the same. -# -# The hook program runs in an empty environment, unless the server is -# explicitly configured otherwise. For example, a common problem is for -# the PATH environment variable to not be set to its usual value, so -# that subprograms fail to launch unless invoked via absolute path. -# If you're having unexpected problems with a hook program, the -# culprit may be unusual (or missing) environment variables. -# -# CAUTION: -# For security reasons, you MUST always properly quote arguments when -# you use them, as those arguments could contain whitespace or other -# problematic characters. Additionally, you should delimit the list -# of options with "--" before passing the arguments, so malicious -# clients cannot bootleg unexpected options to the commands your -# script aims to execute. -# For similar reasons, you should also add a trailing @ to URLs which -# are passed to SVN commands accepting URLs with peg revisions. -# -# Here is an example hook script, for a Unix /bin/sh interpreter. -# For more examples and pre-written hooks, see those in -# the Subversion repository at -# http://svn.apache.org/repos/asf/subversion/trunk/tools/hook-scripts/ and -# http://svn.apache.org/repos/asf/subversion/trunk/contrib/hook-scripts/ - - -REPOS="$1" -USER="$2" - -commit-allower.pl --repository "$REPOS" --user "$USER" || exit 1 -special-auth-check.py --user "$USER" --auth-level 3 || exit 1 - -# All checks passed, so allow the commit. -exit 0 diff --git a/manage_externals/test/repos/simple-ext.svn/locks/db-logs.lock b/manage_externals/test/repos/simple-ext.svn/locks/db-logs.lock deleted file mode 100644 index 20dd6369be..0000000000 --- a/manage_externals/test/repos/simple-ext.svn/locks/db-logs.lock +++ /dev/null @@ -1,3 +0,0 @@ -This file is not used by Subversion 1.3.x or later. -However, its existence is required for compatibility with -Subversion 1.2.x or earlier. diff --git a/manage_externals/test/repos/simple-ext.svn/locks/db.lock b/manage_externals/test/repos/simple-ext.svn/locks/db.lock deleted file mode 100644 index 20dd6369be..0000000000 --- a/manage_externals/test/repos/simple-ext.svn/locks/db.lock +++ /dev/null @@ -1,3 +0,0 @@ -This file is not used by Subversion 1.3.x or later. -However, its existence is required for compatibility with -Subversion 1.2.x or earlier. diff --git a/manage_externals/test/requirements.txt b/manage_externals/test/requirements.txt deleted file mode 100644 index d66f6f1e67..0000000000 --- a/manage_externals/test/requirements.txt +++ /dev/null @@ -1,5 +0,0 @@ -pylint>=1.7.0 -autopep8>=1.3.0 -coverage>=4.4.0 -coveralls>=1.2.0 -sphinx>=1.6.0 diff --git a/manage_externals/test/test_sys_checkout.py b/manage_externals/test/test_sys_checkout.py deleted file mode 100755 index 664160dc99..0000000000 --- a/manage_externals/test/test_sys_checkout.py +++ /dev/null @@ -1,1871 +0,0 @@ -#!/usr/bin/env python3 - -"""Unit test driver for checkout_externals - -Terminology: - * 'container': a repo that has externals - * 'simple': a repo that has no externals, but is referenced as an external by another repo. - * 'mixed': a repo that both has externals and is referenced as an external by another repo. - - * 'clean': the local repo matches the version in the externals and has no local modifications. - * 'empty': the external isn't checked out at all. - -Note: this script assume the path to the manic and -checkout_externals module is already in the python path. This is -usually handled by the makefile. If you call it directly, you may need -to adjust your path. - -NOTE(bja, 2017-11) If a test fails, we want to keep the repo for that -test. But the tests will keep running, so we need a unique name. Also, -tearDown is always called after each test. I haven't figured out how -to determine if an assertion failed and whether it is safe to clean up -the test repos. - -So the solution is: - -* assign a unique id to each test repo. - -* never cleanup during the run. - -* Erase any existing repos at the begining of the module in -setUpModule. -""" - -# NOTE(bja, 2017-11) pylint complains that the module is too big, but -# I'm still working on how to break up the tests and still have the -# temporary directory be preserved.... -# pylint: disable=too-many-lines - - -from __future__ import absolute_import -from __future__ import unicode_literals -from __future__ import print_function - -import logging -import os -import os.path -import shutil -import unittest - -from manic.externals_description import ExternalsDescription -from manic.externals_description import DESCRIPTION_SECTION, VERSION_ITEM -from manic.externals_description import git_submodule_status -from manic.externals_status import ExternalStatus -from manic.repository_git import GitRepository -from manic.utils import printlog, execute_subprocess -from manic.global_constants import LOCAL_PATH_INDICATOR, VERBOSITY_DEFAULT -from manic.global_constants import LOG_FILE_NAME -from manic import checkout - -# ConfigParser was renamed in python2 to configparser. In python2, -# ConfigParser returns byte strings, str, instead of unicode. We need -# unicode to be compatible with xml and json parser and python3. -try: - # python2 - from ConfigParser import SafeConfigParser as config_parser -except ImportError: - # python3 - from configparser import ConfigParser as config_parser - -# --------------------------------------------------------------------- -# -# Global constants -# -# --------------------------------------------------------------------- - - -# Module-wide root directory for all the per-test subdirs we'll create on -# the fly (which are placed under wherever $CWD is when the test runs). -# Set by setupModule(). -module_tmp_root_dir = None -TMP_REPO_DIR_NAME = 'tmp' # subdir under $CWD - -# subdir under test/ that holds all of our checked-in repositories (which we -# will clone for these tests). -BARE_REPO_ROOT_NAME = 'repos' - -# Environment var referenced by checked-in externals file in mixed-cont-ext.git, -# which should be pointed to the fully-resolved BARE_REPO_ROOT_NAME directory. -# We explicitly clear this after every test, via tearDown(). -MIXED_CONT_EXT_ROOT_ENV_VAR = 'MANIC_TEST_BARE_REPO_ROOT' - -# Subdirs under bare repo root, each holding a repository. For more info -# on the contents of these repositories, see test/repos/README.md. In these -# tests the 'parent' repos are cloned as a starting point, whereas the 'child' -# repos are checked out when the tests run checkout_externals. -CONTAINER_REPO = 'container.git' # Parent repo -SIMPLE_REPO = 'simple-ext.git' # Child repo -SIMPLE_FORK_REPO = 'simple-ext-fork.git' # Child repo -MIXED_REPO = 'mixed-cont-ext.git' # Both parent and child -SVN_TEST_REPO = 'simple-ext.svn' # Subversion repository - -# Standard (arbitrary) external names for test configs -TAG_SECTION = 'simp_tag' -BRANCH_SECTION = 'simp_branch' -HASH_SECTION = 'simp_hash' - -# All the configs we construct check out their externals into these local paths. -EXTERNALS_PATH = 'externals' -SUB_EXTERNALS_PATH = 'src' # For mixed test repos, - -# For testing behavior with '.' instead of an explicit paths. -SIMPLE_LOCAL_ONLY_NAME = '.' - -# Externals files. -CFG_NAME = 'externals.cfg' # We construct this on a per-test basis. -CFG_SUB_NAME = 'sub-externals.cfg' # Already exists in mixed-cont-ext repo. - -# Arbitrary text file in all the test repos. -README_NAME = 'readme.txt' - -# Branch that exists in both the simple and simple-fork repos. -REMOTE_BRANCH_FEATURE2 = 'feature2' - -# Disable too-many-public-methods error -# pylint: disable=R0904 - -def setUpModule(): # pylint: disable=C0103 - """Setup for all tests in this module. It is called once per module! - """ - logging.basicConfig(filename=LOG_FILE_NAME, - format='%(levelname)s : %(asctime)s : %(message)s', - datefmt='%Y-%m-%d %H:%M:%S', - level=logging.DEBUG) - repo_root = os.path.join(os.getcwd(), TMP_REPO_DIR_NAME) - repo_root = os.path.abspath(repo_root) - # delete if it exists from previous runs - try: - shutil.rmtree(repo_root) - except BaseException: - pass - # create clean dir for this run - os.mkdir(repo_root) - - # Make available to all tests in this file. - global module_tmp_root_dir - assert module_tmp_root_dir == None, module_tmp_root_dir - module_tmp_root_dir = repo_root - - -class RepoUtils(object): - """Convenience methods for interacting with git repos.""" - @staticmethod - def create_branch(repo_base_dir, external_name, branch, with_commit=False): - """Create branch and optionally (with_commit) add a single commit. - """ - # pylint: disable=R0913 - cwd = os.getcwd() - repo_root = os.path.join(repo_base_dir, EXTERNALS_PATH, external_name) - os.chdir(repo_root) - cmd = ['git', 'checkout', '-b', branch, ] - execute_subprocess(cmd) - if with_commit: - msg = 'start work on {0}'.format(branch) - with open(README_NAME, 'a') as handle: - handle.write(msg) - cmd = ['git', 'add', README_NAME, ] - execute_subprocess(cmd) - cmd = ['git', 'commit', '-m', msg, ] - execute_subprocess(cmd) - os.chdir(cwd) - - @staticmethod - def create_commit(repo_base_dir, external_name): - """Make a commit to the given external. - - This is used to test sync state changes from local commits on - detached heads and tracking branches. - """ - cwd = os.getcwd() - repo_root = os.path.join(repo_base_dir, EXTERNALS_PATH, external_name) - os.chdir(repo_root) - - msg = 'work on great new feature!' - with open(README_NAME, 'a') as handle: - handle.write(msg) - cmd = ['git', 'add', README_NAME, ] - execute_subprocess(cmd) - cmd = ['git', 'commit', '-m', msg, ] - execute_subprocess(cmd) - os.chdir(cwd) - - @staticmethod - def clone_test_repo(bare_root, test_id, parent_repo_name, dest_dir_in): - """Clone repo at / into dest_dir_in or local per-test-subdir. - - Returns output dir. - """ - parent_repo_dir = os.path.join(bare_root, parent_repo_name) - if dest_dir_in is None: - # create unique subdir for this test - test_dir_name = test_id - print("Test repository name: {0}".format(test_dir_name)) - dest_dir = os.path.join(module_tmp_root_dir, test_dir_name) - else: - dest_dir = dest_dir_in - - # pylint: disable=W0212 - GitRepository._git_clone(parent_repo_dir, dest_dir, VERBOSITY_DEFAULT) - return dest_dir - - @staticmethod - def add_file_to_repo(under_test_dir, filename, tracked): - """Add a file to the repository so we can put it into a dirty state - - """ - cwd = os.getcwd() - os.chdir(under_test_dir) - with open(filename, 'w') as tmp: - tmp.write('Hello, world!') - - if tracked: - # NOTE(bja, 2018-01) brittle hack to obtain repo dir and - # file name - path_data = filename.split('/') - repo_dir = os.path.join(path_data[0], path_data[1]) - os.chdir(repo_dir) - tracked_file = path_data[2] - cmd = ['git', 'add', tracked_file] - execute_subprocess(cmd) - - os.chdir(cwd) - -class GenerateExternalsDescriptionCfgV1(object): - """Building blocks to create ExternalsDescriptionCfgV1 files. - - Basic usage: create_config() multiple create_*(), then write_config(). - Optionally after that: write_with_*(). - """ - - def __init__(self, bare_root): - self._schema_version = '1.1.0' - self._config = None - - # directory where we have test repositories (which we will clone for - # tests) - self._bare_root = bare_root - - def write_config(self, dest_dir, filename=CFG_NAME): - """Write self._config to disk - - """ - dest_path = os.path.join(dest_dir, filename) - with open(dest_path, 'w') as configfile: - self._config.write(configfile) - - def create_config(self): - """Create an config object and add the required metadata section - - """ - self._config = config_parser() - self.create_metadata() - - def create_metadata(self): - """Create the metadata section of the config file - """ - self._config.add_section(DESCRIPTION_SECTION) - - self._config.set(DESCRIPTION_SECTION, VERSION_ITEM, - self._schema_version) - - def url_for_repo_path(self, repo_path, repo_path_abs=None): - if repo_path_abs is not None: - return repo_path_abs - else: - return os.path.join(self._bare_root, repo_path) - - def create_section(self, repo_path, name, tag='', branch='', - ref_hash='', required=True, path=EXTERNALS_PATH, - sub_externals='', repo_path_abs=None, from_submodule=False, - sparse='', nested=False): - # pylint: disable=too-many-branches - """Create a config ExternalsDescription section with the given name. - - Autofills some items and handles some optional items. - - repo_path_abs overrides repo_path (which is relative to the bare repo) - path is a subdir under repo_path to check out to. - """ - # pylint: disable=R0913 - self._config.add_section(name) - if not from_submodule: - if nested: - self._config.set(name, ExternalsDescription.PATH, path) - else: - self._config.set(name, ExternalsDescription.PATH, - os.path.join(path, name)) - - self._config.set(name, ExternalsDescription.PROTOCOL, - ExternalsDescription.PROTOCOL_GIT) - - # from_submodules is incompatible with some other options, turn them off - if (from_submodule and - ((repo_path_abs is not None) or tag or ref_hash or branch)): - printlog('create_section: "from_submodule" is incompatible with ' - '"repo_url", "tag", "hash", and "branch" options;\n' - 'Ignoring those options for {}'.format(name)) - repo_url = None - tag = '' - ref_hash = '' - branch = '' - - repo_url = self.url_for_repo_path(repo_path, repo_path_abs) - - if not from_submodule: - self._config.set(name, ExternalsDescription.REPO_URL, repo_url) - - self._config.set(name, ExternalsDescription.REQUIRED, str(required)) - - if tag: - self._config.set(name, ExternalsDescription.TAG, tag) - - if branch: - self._config.set(name, ExternalsDescription.BRANCH, branch) - - if ref_hash: - self._config.set(name, ExternalsDescription.HASH, ref_hash) - - if sub_externals: - self._config.set(name, ExternalsDescription.EXTERNALS, - sub_externals) - - if sparse: - self._config.set(name, ExternalsDescription.SPARSE, sparse) - - if from_submodule: - self._config.set(name, ExternalsDescription.SUBMODULE, "True") - - def create_section_reference_to_subexternal(self, name): - """Just a reference to another externals file. - - """ - # pylint: disable=R0913 - self._config.add_section(name) - self._config.set(name, ExternalsDescription.PATH, LOCAL_PATH_INDICATOR) - - self._config.set(name, ExternalsDescription.PROTOCOL, - ExternalsDescription.PROTOCOL_EXTERNALS_ONLY) - - self._config.set(name, ExternalsDescription.REPO_URL, - LOCAL_PATH_INDICATOR) - - self._config.set(name, ExternalsDescription.REQUIRED, str(True)) - - self._config.set(name, ExternalsDescription.EXTERNALS, CFG_SUB_NAME) - - def create_svn_external(self, name, url, tag='', branch=''): - """Create a config section for an svn repository. - - """ - self._config.add_section(name) - self._config.set(name, ExternalsDescription.PATH, - os.path.join(EXTERNALS_PATH, name)) - - self._config.set(name, ExternalsDescription.PROTOCOL, - ExternalsDescription.PROTOCOL_SVN) - - self._config.set(name, ExternalsDescription.REPO_URL, url) - - self._config.set(name, ExternalsDescription.REQUIRED, str(True)) - - if tag: - self._config.set(name, ExternalsDescription.TAG, tag) - - if branch: - self._config.set(name, ExternalsDescription.BRANCH, branch) - - def write_with_git_branch(self, dest_dir, name, branch, new_remote_repo_path=None): - """Update fields in our config and write it to disk. - - name is the key of the ExternalsDescription in self._config to update. - """ - # pylint: disable=R0913 - self._config.set(name, ExternalsDescription.BRANCH, branch) - - if new_remote_repo_path: - if new_remote_repo_path == SIMPLE_LOCAL_ONLY_NAME: - repo_url = SIMPLE_LOCAL_ONLY_NAME - else: - repo_url = os.path.join(self._bare_root, new_remote_repo_path) - self._config.set(name, ExternalsDescription.REPO_URL, repo_url) - - try: - # remove the tag if it existed - self._config.remove_option(name, ExternalsDescription.TAG) - except BaseException: - pass - - self.write_config(dest_dir) - - def write_with_svn_branch(self, dest_dir, name, branch): - """Update a repository branch, and potentially the remote. - """ - # pylint: disable=R0913 - self._config.set(name, ExternalsDescription.BRANCH, branch) - - try: - # remove the tag if it existed - self._config.remove_option(name, ExternalsDescription.TAG) - except BaseException: - pass - - self.write_config(dest_dir) - - def write_with_tag_and_remote_repo(self, dest_dir, name, tag, new_remote_repo_path, - remove_branch=True): - """Update a repository tag and the remote. - - NOTE(bja, 2017-11) remove_branch=False should result in an - overspecified external with both a branch and tag. This is - used for error condition testing. - - """ - # pylint: disable=R0913 - self._config.set(name, ExternalsDescription.TAG, tag) - - if new_remote_repo_path: - repo_url = os.path.join(self._bare_root, new_remote_repo_path) - self._config.set(name, ExternalsDescription.REPO_URL, repo_url) - - try: - # remove the branch if it existed - if remove_branch: - self._config.remove_option(name, ExternalsDescription.BRANCH) - except BaseException: - pass - - self.write_config(dest_dir) - - def write_without_branch_tag(self, dest_dir, name): - """Update a repository protocol, and potentially the remote - """ - # pylint: disable=R0913 - try: - # remove the branch if it existed - self._config.remove_option(name, ExternalsDescription.BRANCH) - except BaseException: - pass - - try: - # remove the tag if it existed - self._config.remove_option(name, ExternalsDescription.TAG) - except BaseException: - pass - - self.write_config(dest_dir) - - def write_without_repo_url(self, dest_dir, name): - """Update a repository protocol, and potentially the remote - """ - # pylint: disable=R0913 - try: - # remove the repo url if it existed - self._config.remove_option(name, ExternalsDescription.REPO_URL) - except BaseException: - pass - - self.write_config(dest_dir) - - def write_with_protocol(self, dest_dir, name, protocol, repo_path=None): - """Update a repository protocol, and potentially the remote - """ - # pylint: disable=R0913 - self._config.set(name, ExternalsDescription.PROTOCOL, protocol) - - if repo_path: - repo_url = os.path.join(self._bare_root, repo_path) - self._config.set(name, ExternalsDescription.REPO_URL, repo_url) - - self.write_config(dest_dir) - - -def _execute_checkout_in_dir(dirname, args, debug_env=''): - """Execute the checkout command in the appropriate repo dir with the - specified additional args. - - args should be a list of strings. - debug_env shuld be a string of the form 'FOO=bar' or the empty string. - - Note that we are calling the command line processing and main - routines and not using a subprocess call so that we get code - coverage results! Note this means that environment variables are passed - to checkout_externals via os.environ; debug_env is just used to aid - manual reproducibility of a given call. - - Returns (overall_status, tree_status) - where overall_status is 0 for success, nonzero otherwise. - and tree_status is set if --status was passed in, None otherwise. - - Note this command executes the checkout command, it doesn't - necessarily do any checking out (e.g. if --status is passed in). - """ - cwd = os.getcwd() - - # Construct a command line for reproducibility; this command is not - # actually executed in the test. - os.chdir(dirname) - cmdline = ['--externals', CFG_NAME, ] - cmdline += args - manual_cmd = ('Running equivalent of:\n' - 'pushd {dirname}; ' - '{debug_env} /path/to/checkout_externals {args}'.format( - dirname=dirname, debug_env=debug_env, - args=' '.join(cmdline))) - printlog(manual_cmd) - options = checkout.commandline_arguments(cmdline) - overall_status, tree_status = checkout.main(options) - os.chdir(cwd) - return overall_status, tree_status - -class BaseTestSysCheckout(unittest.TestCase): - """Base class of reusable systems level test setup for - checkout_externals - - """ - # NOTE(bja, 2017-11) pylint complains about long method names, but - # it is hard to differentiate tests without making them more - # cryptic. - # pylint: disable=invalid-name - - # Command-line args for checkout_externals, used in execute_checkout_in_dir() - status_args = ['--status'] - checkout_args = [] - optional_args = ['--optional'] - verbose_args = ['--status', '--verbose'] - - def setUp(self): - """Setup for all individual checkout_externals tests - """ - # directory we want to return to after the test system and - # checkout_externals are done cd'ing all over the place. - self._return_dir = os.getcwd() - - self._test_id = self.id().split('.')[-1] - - # find root - if os.path.exists(os.path.join(os.getcwd(), 'checkout_externals')): - root_dir = os.path.abspath(os.getcwd()) - else: - # maybe we are in a subdir, search up - root_dir = os.path.abspath(os.path.join(os.getcwd(), os.pardir)) - while os.path.basename(root_dir): - if os.path.exists(os.path.join(root_dir, 'checkout_externals')): - break - root_dir = os.path.dirname(root_dir) - - if not os.path.exists(os.path.join(root_dir, 'checkout_externals')): - raise RuntimeError('Cannot find checkout_externals') - - # path to the executable - self._checkout = os.path.join(root_dir, 'checkout_externals') - - # directory where we have test repositories (which we will clone for - # tests) - self._bare_root = os.path.abspath( - os.path.join(root_dir, 'test', BARE_REPO_ROOT_NAME)) - - # set the input file generator - self._generator = GenerateExternalsDescriptionCfgV1(self._bare_root) - # set the input file generator for secondary externals - self._sub_generator = GenerateExternalsDescriptionCfgV1(self._bare_root) - - def tearDown(self): - """Tear down for individual tests - """ - # return to our common starting point - os.chdir(self._return_dir) - - # (in case this was set) Don't pollute environment of other tests. - os.environ.pop(MIXED_CONT_EXT_ROOT_ENV_VAR, - None) # Don't care if key wasn't set. - - def clone_test_repo(self, parent_repo_name, dest_dir_in=None): - """Clones repo under self._bare_root""" - return RepoUtils.clone_test_repo(self._bare_root, self._test_id, - parent_repo_name, dest_dir_in) - - def execute_checkout_in_dir(self, dirname, args, debug_env=''): - overall_status, tree_status = _execute_checkout_in_dir(dirname, args, - debug_env=debug_env) - self.assertEqual(overall_status, 0) - return tree_status - - def execute_checkout_with_status(self, dirname, args, debug_env=''): - """Calls checkout a second time to get status if needed.""" - tree_status = self.execute_checkout_in_dir( - dirname, args, debug_env=debug_env) - if tree_status is None: - tree_status = self.execute_checkout_in_dir(dirname, - self.status_args, - debug_env=debug_env) - self.assertNotEqual(tree_status, None) - return tree_status - - def _check_sync_clean(self, ext_status, expected_sync_state, - expected_clean_state): - self.assertEqual(ext_status.sync_state, expected_sync_state) - self.assertEqual(ext_status.clean_state, expected_clean_state) - - @staticmethod - def _external_path(section_name, base_path=EXTERNALS_PATH): - return './{0}/{1}'.format(base_path, section_name) - - def _check_file_exists(self, repo_dir, pathname): - "Check that exists in " - self.assertTrue(os.path.exists(os.path.join(repo_dir, pathname))) - - def _check_file_absent(self, repo_dir, pathname): - "Check that does not exist in " - self.assertFalse(os.path.exists(os.path.join(repo_dir, pathname))) - - -class TestSysCheckout(BaseTestSysCheckout): - """Run systems level tests of checkout_externals - """ - # NOTE(bja, 2017-11) pylint complains about long method names, but - # it is hard to differentiate tests without making them more - # cryptic. - # pylint: disable=invalid-name - - # ---------------------------------------------------------------- - # - # Run systems tests - # - # ---------------------------------------------------------------- - def test_required_bytag(self): - """Check out a required external pointing to a git tag.""" - cloned_repo_dir = self.clone_test_repo(CONTAINER_REPO) - self._generator.create_config() - self._generator.create_section(SIMPLE_REPO, TAG_SECTION, - tag='tag1') - self._generator.write_config(cloned_repo_dir) - - # externals start out 'empty' aka not checked out. - tree = self.execute_checkout_in_dir(cloned_repo_dir, - self.status_args) - local_path_rel = self._external_path(TAG_SECTION) - self._check_sync_clean(tree[local_path_rel], - ExternalStatus.EMPTY, - ExternalStatus.DEFAULT) - local_path_abs = os.path.join(cloned_repo_dir, local_path_rel) - self.assertFalse(os.path.exists(local_path_abs)) - - # after checkout, the external is 'clean' aka at the correct version. - tree = self.execute_checkout_with_status(cloned_repo_dir, - self.checkout_args) - self._check_sync_clean(tree[local_path_rel], - ExternalStatus.STATUS_OK, - ExternalStatus.STATUS_OK) - - # Actually checked out the desired repo. - self.assertEqual('origin', GitRepository._remote_name_for_url( - # Which url to look up - self._generator.url_for_repo_path(SIMPLE_REPO), - # Which directory has the local checked-out repo. - dirname=local_path_abs)) - - # Actually checked out the desired tag. - (tag_found, tag_name) = GitRepository._git_current_tag(local_path_abs) - self.assertEqual(tag_name, 'tag1') - - # Check existence of some simp_tag files - tag_path = os.path.join('externals', TAG_SECTION) - self._check_file_exists(cloned_repo_dir, - os.path.join(tag_path, README_NAME)) - # Subrepo should not exist (not referenced by configs). - self._check_file_absent(cloned_repo_dir, os.path.join(tag_path, - 'simple_subdir', - 'subdir_file.txt')) - - def test_required_bybranch(self): - """Check out a required external pointing to a git branch.""" - cloned_repo_dir = self.clone_test_repo(CONTAINER_REPO) - self._generator.create_config() - self._generator.create_section(SIMPLE_REPO, BRANCH_SECTION, - branch=REMOTE_BRANCH_FEATURE2) - self._generator.write_config(cloned_repo_dir) - - # externals start out 'empty' aka not checked out. - tree = self.execute_checkout_in_dir(cloned_repo_dir, - self.status_args) - local_path_rel = self._external_path(BRANCH_SECTION) - self._check_sync_clean(tree[local_path_rel], - ExternalStatus.EMPTY, - ExternalStatus.DEFAULT) - local_path_abs = os.path.join(cloned_repo_dir, local_path_rel) - self.assertFalse(os.path.exists(local_path_abs)) - - # after checkout, the external is 'clean' aka at the correct version. - tree = self.execute_checkout_with_status(cloned_repo_dir, - self.checkout_args) - self._check_sync_clean(tree[local_path_rel], - ExternalStatus.STATUS_OK, - ExternalStatus.STATUS_OK) - self.assertTrue(os.path.exists(local_path_abs)) - - # Actually checked out the desired repo. - self.assertEqual('origin', GitRepository._remote_name_for_url( - # Which url to look up - self._generator.url_for_repo_path(SIMPLE_REPO), - # Which directory has the local checked-out repo. - dirname=local_path_abs)) - - # Actually checked out the desired branch. - (branch_found, branch_name) = GitRepository._git_current_remote_branch( - local_path_abs) - self.assertEquals(branch_name, 'origin/' + REMOTE_BRANCH_FEATURE2) - - def test_required_byhash(self): - """Check out a required external pointing to a git hash.""" - cloned_repo_dir = self.clone_test_repo(CONTAINER_REPO) - self._generator.create_config() - self._generator.create_section(SIMPLE_REPO, HASH_SECTION, - ref_hash='60b1cc1a38d63') - self._generator.write_config(cloned_repo_dir) - - # externals start out 'empty' aka not checked out. - tree = self.execute_checkout_in_dir(cloned_repo_dir, - self.status_args) - local_path_rel = self._external_path(HASH_SECTION) - self._check_sync_clean(tree[local_path_rel], - ExternalStatus.EMPTY, - ExternalStatus.DEFAULT) - local_path_abs = os.path.join(cloned_repo_dir, local_path_rel) - self.assertFalse(os.path.exists(local_path_abs)) - - # after checkout, the externals are 'clean' aka at their correct version. - tree = self.execute_checkout_with_status(cloned_repo_dir, - self.checkout_args) - self._check_sync_clean(tree[local_path_rel], - ExternalStatus.STATUS_OK, - ExternalStatus.STATUS_OK) - - # Actually checked out the desired repo. - self.assertEqual('origin', GitRepository._remote_name_for_url( - # Which url to look up - self._generator.url_for_repo_path(SIMPLE_REPO), - # Which directory has the local checked-out repo. - dirname=local_path_abs)) - - # Actually checked out the desired hash. - (hash_found, hash_name) = GitRepository._git_current_hash( - local_path_abs) - self.assertTrue(hash_name.startswith('60b1cc1a38d63'), - msg=hash_name) - - def test_container_nested_required(self): - """Verify that a container with nested subrepos generates the correct initial status. - Tests over all possible permutations - """ - # Output subdirs for each of the externals, to test that one external can be - # checked out in a subdir of another. - NESTED_SUBDIR = ['./fred', './fred/wilma', './fred/wilma/barney'] - - # Assert that each type of external (e.g. tag vs branch) can be at any parent level - # (e.g. child/parent/grandparent). - orders = [[0, 1, 2], [1, 2, 0], [2, 0, 1], - [0, 2, 1], [2, 1, 0], [1, 0, 2]] - for n, order in enumerate(orders): - dest_dir = os.path.join(module_tmp_root_dir, self._test_id, - "test"+str(n)) - cloned_repo_dir = self.clone_test_repo(CONTAINER_REPO, - dest_dir_in=dest_dir) - self._generator.create_config() - # We happen to check out each section via a different reference (tag/branch/hash) but - # those don't really matter, we just need to check out three repos into a nested set of - # directories. - self._generator.create_section( - SIMPLE_REPO, TAG_SECTION, nested=True, - tag='tag1', path=NESTED_SUBDIR[order[0]]) - self._generator.create_section( - SIMPLE_REPO, BRANCH_SECTION, nested=True, - branch=REMOTE_BRANCH_FEATURE2, path=NESTED_SUBDIR[order[1]]) - self._generator.create_section( - SIMPLE_REPO, HASH_SECTION, nested=True, - ref_hash='60b1cc1a38d63', path=NESTED_SUBDIR[order[2]]) - self._generator.write_config(cloned_repo_dir) - - # all externals start out 'empty' aka not checked out. - tree = self.execute_checkout_in_dir(cloned_repo_dir, - self.status_args) - self._check_sync_clean(tree[NESTED_SUBDIR[order[0]]], - ExternalStatus.EMPTY, - ExternalStatus.DEFAULT) - self._check_sync_clean(tree[NESTED_SUBDIR[order[1]]], - ExternalStatus.EMPTY, - ExternalStatus.DEFAULT) - self._check_sync_clean(tree[NESTED_SUBDIR[order[2]]], - ExternalStatus.EMPTY, - ExternalStatus.DEFAULT) - - # after checkout, all the repos are 'clean'. - tree = self.execute_checkout_with_status(cloned_repo_dir, - self.checkout_args) - self._check_sync_clean(tree[NESTED_SUBDIR[order[0]]], - ExternalStatus.STATUS_OK, - ExternalStatus.STATUS_OK) - self._check_sync_clean(tree[NESTED_SUBDIR[order[1]]], - ExternalStatus.STATUS_OK, - ExternalStatus.STATUS_OK) - self._check_sync_clean(tree[NESTED_SUBDIR[order[2]]], - ExternalStatus.STATUS_OK, - ExternalStatus.STATUS_OK) - - def test_container_simple_optional(self): - """Verify that container with an optional simple subrepos generates - the correct initial status. - - """ - # create repo and externals config. - cloned_repo_dir = self.clone_test_repo(CONTAINER_REPO) - self._generator.create_config() - self._generator.create_section(SIMPLE_REPO, 'simp_req', - tag='tag1') - - self._generator.create_section(SIMPLE_REPO, 'simp_opt', - tag='tag1', required=False) - - self._generator.write_config(cloned_repo_dir) - - # all externals start out 'empty' aka not checked out. - tree = self.execute_checkout_in_dir(cloned_repo_dir, - self.status_args) - req_status = tree[self._external_path('simp_req')] - self._check_sync_clean(req_status, - ExternalStatus.EMPTY, - ExternalStatus.DEFAULT) - self.assertEqual(req_status.source_type, ExternalStatus.MANAGED) - - opt_status = tree[self._external_path('simp_opt')] - self._check_sync_clean(opt_status, - ExternalStatus.EMPTY, - ExternalStatus.DEFAULT) - self.assertEqual(opt_status.source_type, ExternalStatus.OPTIONAL) - - # after checkout, required external is clean, optional is still empty. - tree = self.execute_checkout_with_status(cloned_repo_dir, - self.checkout_args) - req_status = tree[self._external_path('simp_req')] - self._check_sync_clean(req_status, - ExternalStatus.STATUS_OK, - ExternalStatus.STATUS_OK) - self.assertEqual(req_status.source_type, ExternalStatus.MANAGED) - - opt_status = tree[self._external_path('simp_opt')] - self._check_sync_clean(opt_status, - ExternalStatus.EMPTY, - ExternalStatus.DEFAULT) - self.assertEqual(opt_status.source_type, ExternalStatus.OPTIONAL) - - # after checking out optionals, the optional external is also clean. - tree = self.execute_checkout_with_status(cloned_repo_dir, - self.optional_args) - req_status = tree[self._external_path('simp_req')] - self._check_sync_clean(req_status, - ExternalStatus.STATUS_OK, - ExternalStatus.STATUS_OK) - self.assertEqual(req_status.source_type, ExternalStatus.MANAGED) - - opt_status = tree[self._external_path('simp_opt')] - self._check_sync_clean(opt_status, - ExternalStatus.STATUS_OK, - ExternalStatus.STATUS_OK) - self.assertEqual(opt_status.source_type, ExternalStatus.OPTIONAL) - - def test_container_simple_verbose(self): - """Verify that verbose status matches non-verbose. - """ - cloned_repo_dir = self.clone_test_repo(CONTAINER_REPO) - self._generator.create_config() - self._generator.create_section(SIMPLE_REPO, TAG_SECTION, - tag='tag1') - self._generator.write_config(cloned_repo_dir) - - # after checkout, all externals should be 'clean'. - tree = self.execute_checkout_with_status(cloned_repo_dir, - self.checkout_args) - self._check_sync_clean(tree[self._external_path(TAG_SECTION)], - ExternalStatus.STATUS_OK, - ExternalStatus.STATUS_OK) - - # 'Verbose' status should tell the same story. - tree = self.execute_checkout_in_dir(cloned_repo_dir, - self.verbose_args) - self._check_sync_clean(tree[self._external_path(TAG_SECTION)], - ExternalStatus.STATUS_OK, - ExternalStatus.STATUS_OK) - - def test_container_simple_dirty(self): - """Verify that a container with a new tracked file is marked dirty. - """ - cloned_repo_dir = self.clone_test_repo(CONTAINER_REPO) - self._generator.create_config() - self._generator.create_section(SIMPLE_REPO, TAG_SECTION, - tag='tag1') - self._generator.write_config(cloned_repo_dir) - - # checkout, should start out clean. - tree = self.execute_checkout_with_status(cloned_repo_dir, self.checkout_args) - self._check_sync_clean(tree[self._external_path(TAG_SECTION)], - ExternalStatus.STATUS_OK, - ExternalStatus.STATUS_OK) - - # add a tracked file to the simp_tag external, should be dirty. - RepoUtils.add_file_to_repo(cloned_repo_dir, - 'externals/{0}/tmp.txt'.format(TAG_SECTION), - tracked=True) - tree = self.execute_checkout_in_dir(cloned_repo_dir, self.status_args) - self._check_sync_clean(tree[self._external_path(TAG_SECTION)], - ExternalStatus.STATUS_OK, - ExternalStatus.DIRTY) - - # Re-checkout; simp_tag should still be dirty. - tree = self.execute_checkout_with_status(cloned_repo_dir, - self.checkout_args) - self._check_sync_clean(tree[self._external_path(TAG_SECTION)], - ExternalStatus.STATUS_OK, - ExternalStatus.DIRTY) - - def test_container_simple_untracked(self): - """Verify that a container with simple subrepos and a untracked files - is not considered 'dirty' and will attempt an update. - - """ - cloned_repo_dir = self.clone_test_repo(CONTAINER_REPO) - self._generator.create_config() - self._generator.create_section(SIMPLE_REPO, TAG_SECTION, - tag='tag1') - self._generator.write_config(cloned_repo_dir) - - # checkout, should start out clean. - tree = self.execute_checkout_with_status(cloned_repo_dir, - self.checkout_args) - self._check_sync_clean(tree[self._external_path(TAG_SECTION)], - ExternalStatus.STATUS_OK, - ExternalStatus.STATUS_OK) - - # add an untracked file to the simp_tag external, should stay clean. - RepoUtils.add_file_to_repo(cloned_repo_dir, - 'externals/{0}/tmp.txt'.format(TAG_SECTION), - tracked=False) - tree = self.execute_checkout_in_dir(cloned_repo_dir, self.status_args) - self._check_sync_clean(tree[self._external_path(TAG_SECTION)], - ExternalStatus.STATUS_OK, - ExternalStatus.STATUS_OK) - - # After checkout, the external should still be 'clean'. - tree = self.execute_checkout_with_status(cloned_repo_dir, - self.checkout_args) - self._check_sync_clean(tree[self._external_path(TAG_SECTION)], - ExternalStatus.STATUS_OK, - ExternalStatus.STATUS_OK) - - def test_container_simple_detached_sync(self): - """Verify that a container with simple subrepos generates the correct - out of sync status when making commits from a detached head - state. - - For more info about 'detached head' state: https://www.cloudbees.com/blog/git-detached-head - """ - cloned_repo_dir = self.clone_test_repo(CONTAINER_REPO) - self._generator.create_config() - self._generator.create_section(SIMPLE_REPO, TAG_SECTION, - tag='tag1') - - self._generator.create_section(SIMPLE_REPO, BRANCH_SECTION, - branch=REMOTE_BRANCH_FEATURE2) - - self._generator.create_section(SIMPLE_REPO, 'simp_hash', - ref_hash='60b1cc1a38d63') - - self._generator.write_config(cloned_repo_dir) - - # externals start out 'empty' aka not checked out. - tree = self.execute_checkout_in_dir(cloned_repo_dir, self.status_args) - self._check_sync_clean(tree[self._external_path(TAG_SECTION)], - ExternalStatus.EMPTY, - ExternalStatus.DEFAULT) - self._check_sync_clean(tree[self._external_path(BRANCH_SECTION)], - ExternalStatus.EMPTY, - ExternalStatus.DEFAULT) - self._check_sync_clean(tree[self._external_path(HASH_SECTION)], - ExternalStatus.EMPTY, - ExternalStatus.DEFAULT) - - # checkout - self.execute_checkout_in_dir(cloned_repo_dir, self.checkout_args) - - # Commit on top of the tag and hash (creating the detached head state in those two - # externals' repos) - # The branch commit does not create the detached head state, but here for completeness. - RepoUtils.create_commit(cloned_repo_dir, TAG_SECTION) - RepoUtils.create_commit(cloned_repo_dir, HASH_SECTION) - RepoUtils.create_commit(cloned_repo_dir, BRANCH_SECTION) - - # sync status of all three should be 'modified' (uncommitted changes) - # clean status is 'ok' (matches externals version) - tree = self.execute_checkout_in_dir(cloned_repo_dir, self.status_args) - self._check_sync_clean(tree[self._external_path(TAG_SECTION)], - ExternalStatus.MODEL_MODIFIED, - ExternalStatus.STATUS_OK) - self._check_sync_clean(tree[self._external_path(BRANCH_SECTION)], - ExternalStatus.MODEL_MODIFIED, - ExternalStatus.STATUS_OK) - self._check_sync_clean(tree[self._external_path(HASH_SECTION)], - ExternalStatus.MODEL_MODIFIED, - ExternalStatus.STATUS_OK) - - # after checkout, all externals should be totally clean (no uncommitted changes, - # and matches externals version). - tree = self.execute_checkout_with_status(cloned_repo_dir, self.checkout_args) - self._check_sync_clean(tree[self._external_path(TAG_SECTION)], - ExternalStatus.STATUS_OK, - ExternalStatus.STATUS_OK) - self._check_sync_clean(tree[self._external_path(BRANCH_SECTION)], - ExternalStatus.STATUS_OK, - ExternalStatus.STATUS_OK) - self._check_sync_clean(tree[self._external_path(HASH_SECTION)], - ExternalStatus.STATUS_OK, - ExternalStatus.STATUS_OK) - - def test_container_remote_branch(self): - """Verify that a container with remote branch change works - - """ - cloned_repo_dir = self.clone_test_repo(CONTAINER_REPO) - self._generator.create_config() - self._generator.create_section(SIMPLE_REPO, BRANCH_SECTION, - branch=REMOTE_BRANCH_FEATURE2) - self._generator.write_config(cloned_repo_dir) - - # initial checkout - self.execute_checkout_in_dir(cloned_repo_dir, self.checkout_args) - - # update the branch external to point to a different remote with the same branch, - # then simp_branch should be out of sync - self._generator.write_with_git_branch(cloned_repo_dir, - name=BRANCH_SECTION, - branch=REMOTE_BRANCH_FEATURE2, - new_remote_repo_path=SIMPLE_FORK_REPO) - tree = self.execute_checkout_in_dir(cloned_repo_dir, self.status_args) - self._check_sync_clean(tree[self._external_path(BRANCH_SECTION)], - ExternalStatus.MODEL_MODIFIED, - ExternalStatus.STATUS_OK) - - # checkout new externals, now simp_branch should be clean. - tree = self.execute_checkout_with_status(cloned_repo_dir, self.checkout_args) - self._check_sync_clean(tree[self._external_path(BRANCH_SECTION)], - ExternalStatus.STATUS_OK, - ExternalStatus.STATUS_OK) - - def test_container_remote_tag_same_branch(self): - """Verify that a container with remote tag change works. The new tag - should not be in the original repo, only the new remote - fork. The new tag is automatically fetched because it is on - the branch. - - """ - cloned_repo_dir = self.clone_test_repo(CONTAINER_REPO) - self._generator.create_config() - self._generator.create_section(SIMPLE_REPO, BRANCH_SECTION, - branch=REMOTE_BRANCH_FEATURE2) - self._generator.write_config(cloned_repo_dir) - - # initial checkout - self.execute_checkout_in_dir(cloned_repo_dir, self.checkout_args) - - # update the config file to point to a different remote with - # the new tag replacing the old branch. Tag MUST NOT be in the original - # repo! status of simp_branch should then be out of sync - self._generator.write_with_tag_and_remote_repo(cloned_repo_dir, BRANCH_SECTION, - tag='forked-feature-v1', - new_remote_repo_path=SIMPLE_FORK_REPO) - tree = self.execute_checkout_in_dir(cloned_repo_dir, - self.status_args) - self._check_sync_clean(tree[self._external_path(BRANCH_SECTION)], - ExternalStatus.MODEL_MODIFIED, - ExternalStatus.STATUS_OK) - - # checkout new externals, then should be synced. - tree = self.execute_checkout_with_status(cloned_repo_dir, - self.checkout_args) - self._check_sync_clean(tree[self._external_path(BRANCH_SECTION)], - ExternalStatus.STATUS_OK, - ExternalStatus.STATUS_OK) - - def test_container_remote_tag_fetch_all(self): - """Verify that a container with remote tag change works. The new tag - should not be in the original repo, only the new remote - fork. It should also not be on a branch that will be fetched, - and therefore not fetched by default with 'git fetch'. It will - only be retrieved by 'git fetch --tags' - """ - cloned_repo_dir = self.clone_test_repo(CONTAINER_REPO) - self._generator.create_config() - self._generator.create_section(SIMPLE_REPO, BRANCH_SECTION, - branch=REMOTE_BRANCH_FEATURE2) - self._generator.write_config(cloned_repo_dir) - - # initial checkout - self.execute_checkout_in_dir(cloned_repo_dir, self.checkout_args) - - # update the config file to point to a different remote with - # the new tag instead of the old branch. Tag MUST NOT be in the original - # repo! status of simp_branch should then be out of sync. - self._generator.write_with_tag_and_remote_repo(cloned_repo_dir, BRANCH_SECTION, - tag='abandoned-feature', - new_remote_repo_path=SIMPLE_FORK_REPO) - tree = self.execute_checkout_in_dir(cloned_repo_dir, self.status_args) - self._check_sync_clean(tree[self._external_path(BRANCH_SECTION)], - ExternalStatus.MODEL_MODIFIED, - ExternalStatus.STATUS_OK) - - # checkout new externals, should be clean again. - tree = self.execute_checkout_with_status(cloned_repo_dir, - self.checkout_args) - self._check_sync_clean(tree[self._external_path(BRANCH_SECTION)], - ExternalStatus.STATUS_OK, - ExternalStatus.STATUS_OK) - - def test_container_preserve_dot(self): - """Verify that after inital checkout, modifying an external git repo - url to '.' and the current branch will leave it unchanged. - - """ - cloned_repo_dir = self.clone_test_repo(CONTAINER_REPO) - self._generator.create_config() - self._generator.create_section(SIMPLE_REPO, BRANCH_SECTION, - branch=REMOTE_BRANCH_FEATURE2) - self._generator.write_config(cloned_repo_dir) - - # initial checkout - self.execute_checkout_in_dir(cloned_repo_dir, self.checkout_args) - - # update the config file to point to a different remote with - # the same branch. - self._generator.write_with_git_branch(cloned_repo_dir, name=BRANCH_SECTION, - branch=REMOTE_BRANCH_FEATURE2, - new_remote_repo_path=SIMPLE_FORK_REPO) - # after checkout, should be clean again. - tree = self.execute_checkout_with_status(cloned_repo_dir, self.checkout_args) - self._check_sync_clean(tree[self._external_path(BRANCH_SECTION)], - ExternalStatus.STATUS_OK, - ExternalStatus.STATUS_OK) - - # update branch to point to a new branch that only exists in - # the local fork - RepoUtils.create_branch(cloned_repo_dir, external_name=BRANCH_SECTION, - branch='private-feature', with_commit=True) - self._generator.write_with_git_branch(cloned_repo_dir, name=BRANCH_SECTION, - branch='private-feature', - new_remote_repo_path=SIMPLE_LOCAL_ONLY_NAME) - # after checkout, should be clean again. - tree = self.execute_checkout_with_status(cloned_repo_dir, self.checkout_args) - self._check_sync_clean(tree[self._external_path(BRANCH_SECTION)], - ExternalStatus.STATUS_OK, - ExternalStatus.STATUS_OK) - - def test_container_mixed_subrepo(self): - """Verify container with mixed subrepo. - - The mixed subrepo has a sub-externals file with different - sub-externals on different branches. - - """ - cloned_repo_dir = self.clone_test_repo(CONTAINER_REPO) - - self._generator.create_config() - self._generator.create_section(MIXED_REPO, 'mixed_req', - branch='master', sub_externals=CFG_SUB_NAME) - self._generator.write_config(cloned_repo_dir) - - # The subrepo has a repo_url that uses this environment variable. - # It'll be cleared in tearDown(). - os.environ[MIXED_CONT_EXT_ROOT_ENV_VAR] = self._bare_root - debug_env = MIXED_CONT_EXT_ROOT_ENV_VAR + '=' + self._bare_root - - # inital checkout: all requireds are clean, and optional is empty. - tree = self.execute_checkout_with_status(cloned_repo_dir, - self.checkout_args, - debug_env=debug_env) - mixed_req_path = self._external_path('mixed_req') - self._check_sync_clean(tree[mixed_req_path], - ExternalStatus.STATUS_OK, - ExternalStatus.STATUS_OK) - sub_ext_base_path = "{0}/{1}/{2}".format(EXTERNALS_PATH, 'mixed_req', SUB_EXTERNALS_PATH) - # The already-checked-in subexternals file has a 'simp_branch' section - self._check_sync_clean(tree[self._external_path('simp_branch', base_path=sub_ext_base_path)], - ExternalStatus.STATUS_OK, - ExternalStatus.STATUS_OK) - - # update the mixed-use external to point to different branch - # status should become out of sync for mixed_req, but sub-externals - # are still in sync - self._generator.write_with_git_branch(cloned_repo_dir, name='mixed_req', - branch='new-feature', - new_remote_repo_path=MIXED_REPO) - tree = self.execute_checkout_in_dir(cloned_repo_dir, self.status_args, - debug_env=debug_env) - self._check_sync_clean(tree[mixed_req_path], - ExternalStatus.MODEL_MODIFIED, - ExternalStatus.STATUS_OK) - self._check_sync_clean(tree[self._external_path('simp_branch', base_path=sub_ext_base_path)], - ExternalStatus.STATUS_OK, - ExternalStatus.STATUS_OK) - - # run the checkout. Now the mixed use external and its sub-externals should be clean. - tree = self.execute_checkout_with_status(cloned_repo_dir, self.checkout_args, - debug_env=debug_env) - self._check_sync_clean(tree[mixed_req_path], - ExternalStatus.STATUS_OK, - ExternalStatus.STATUS_OK) - self._check_sync_clean(tree[self._external_path('simp_branch', base_path=sub_ext_base_path)], - ExternalStatus.STATUS_OK, - ExternalStatus.STATUS_OK) - - def test_container_component(self): - """Verify that optional component checkout works - """ - cloned_repo_dir = self.clone_test_repo(CONTAINER_REPO) - - # create the top level externals file - self._generator.create_config() - # Optional external, by tag. - self._generator.create_section(SIMPLE_REPO, 'simp_opt', - tag='tag1', required=False) - - # Required external, by branch. - self._generator.create_section(SIMPLE_REPO, BRANCH_SECTION, - branch=REMOTE_BRANCH_FEATURE2) - - # Required external, by hash. - self._generator.create_section(SIMPLE_REPO, HASH_SECTION, - ref_hash='60b1cc1a38d63') - self._generator.write_config(cloned_repo_dir) - - # inital checkout, first try a nonexistent component argument noref - checkout_args = ['simp_opt', 'noref'] - checkout_args.extend(self.checkout_args) - - with self.assertRaises(RuntimeError): - self.execute_checkout_in_dir(cloned_repo_dir, checkout_args) - - # Now explicitly check out one optional component.. - # Explicitly listed component (opt) should be present, the other two not. - checkout_args = ['simp_opt'] - checkout_args.extend(self.checkout_args) - tree = self.execute_checkout_with_status(cloned_repo_dir, - checkout_args) - self._check_sync_clean(tree[self._external_path('simp_opt')], - ExternalStatus.STATUS_OK, - ExternalStatus.STATUS_OK) - self._check_sync_clean(tree[self._external_path(BRANCH_SECTION)], - ExternalStatus.EMPTY, - ExternalStatus.DEFAULT) - self._check_sync_clean(tree[self._external_path(HASH_SECTION)], - ExternalStatus.EMPTY, - ExternalStatus.DEFAULT) - - # Check out a second component, this one required. - # Explicitly listed component (branch) should be present, the still-unlisted one (tag) not. - checkout_args.append(BRANCH_SECTION) - tree = self.execute_checkout_with_status(cloned_repo_dir, - checkout_args) - self._check_sync_clean(tree[self._external_path('simp_opt')], - ExternalStatus.STATUS_OK, - ExternalStatus.STATUS_OK) - self._check_sync_clean(tree[self._external_path(BRANCH_SECTION)], - ExternalStatus.STATUS_OK, - ExternalStatus.STATUS_OK) - self._check_sync_clean(tree[self._external_path(HASH_SECTION)], - ExternalStatus.EMPTY, - ExternalStatus.DEFAULT) - - - def test_container_exclude_component(self): - """Verify that exclude component checkout works - """ - cloned_repo_dir = self.clone_test_repo(CONTAINER_REPO) - self._generator.create_config() - self._generator.create_section(SIMPLE_REPO, TAG_SECTION, - tag='tag1') - - self._generator.create_section(SIMPLE_REPO, BRANCH_SECTION, - branch=REMOTE_BRANCH_FEATURE2) - - self._generator.create_section(SIMPLE_REPO, 'simp_hash', - ref_hash='60b1cc1a38d63') - - self._generator.write_config(cloned_repo_dir) - - # inital checkout should result in all externals being clean except excluded TAG_SECTION. - checkout_args = ['--exclude', TAG_SECTION] - checkout_args.extend(self.checkout_args) - tree = self.execute_checkout_with_status(cloned_repo_dir, checkout_args) - self._check_sync_clean(tree[self._external_path(TAG_SECTION)], - ExternalStatus.EMPTY, - ExternalStatus.DEFAULT) - self._check_sync_clean(tree[self._external_path(BRANCH_SECTION)], - ExternalStatus.STATUS_OK, - ExternalStatus.STATUS_OK) - self._check_sync_clean(tree[self._external_path(HASH_SECTION)], - ExternalStatus.STATUS_OK, - ExternalStatus.STATUS_OK) - - def test_subexternal(self): - """Verify that an externals file can be brought in as a reference. - - """ - cloned_repo_dir = self.clone_test_repo(MIXED_REPO) - - self._generator.create_config() - self._generator.create_section_reference_to_subexternal('mixed_base') - self._generator.write_config(cloned_repo_dir) - - # The subrepo has a repo_url that uses this environment variable. - # It'll be cleared in tearDown(). - os.environ[MIXED_CONT_EXT_ROOT_ENV_VAR] = self._bare_root - debug_env = MIXED_CONT_EXT_ROOT_ENV_VAR + '=' + self._bare_root - - # After checkout, confirm required's are clean and the referenced - # subexternal's contents are also clean. - tree = self.execute_checkout_with_status(cloned_repo_dir, - self.checkout_args, - debug_env=debug_env) - - self._check_sync_clean( - tree[self._external_path(BRANCH_SECTION, base_path=SUB_EXTERNALS_PATH)], - ExternalStatus.STATUS_OK, - ExternalStatus.STATUS_OK) - - def test_container_sparse(self): - """Verify that 'full' container with simple subrepo - can run a sparse checkout and generate the correct initial status. - - """ - cloned_repo_dir = self.clone_test_repo(CONTAINER_REPO) - - # Create a file to list filenames to checkout. - sparse_filename = 'sparse_checkout' - with open(os.path.join(cloned_repo_dir, sparse_filename), 'w') as sfile: - sfile.write(README_NAME) - - self._generator.create_config() - self._generator.create_section(SIMPLE_REPO, TAG_SECTION, - tag='tag2') - - # Same tag as above, but with a sparse file too. - sparse_relpath = '../../' + sparse_filename - self._generator.create_section(SIMPLE_REPO, 'simp_sparse', - tag='tag2', sparse=sparse_relpath) - - self._generator.write_config(cloned_repo_dir) - - # inital checkout, confirm required's are clean. - tree = self.execute_checkout_with_status(cloned_repo_dir, - self.checkout_args) - self._check_sync_clean(tree[self._external_path(TAG_SECTION)], - ExternalStatus.STATUS_OK, - ExternalStatus.STATUS_OK) - self._check_sync_clean(tree[self._external_path('simp_sparse')], - ExternalStatus.STATUS_OK, - ExternalStatus.STATUS_OK) - - # Check existence of some files - full set in TAG_SECTION, and sparse set - # in 'simp_sparse'. - subrepo_path = os.path.join('externals', TAG_SECTION) - self._check_file_exists(cloned_repo_dir, - os.path.join(subrepo_path, README_NAME)) - self._check_file_exists(cloned_repo_dir, os.path.join(subrepo_path, - 'simple_subdir', - 'subdir_file.txt')) - subrepo_path = os.path.join('externals', 'simp_sparse') - self._check_file_exists(cloned_repo_dir, - os.path.join(subrepo_path, README_NAME)) - self._check_file_absent(cloned_repo_dir, os.path.join(subrepo_path, - 'simple_subdir', - 'subdir_file.txt')) - -class TestSysCheckoutSVN(BaseTestSysCheckout): - """Run systems level tests of checkout_externals accessing svn repositories - - SVN tests - these tests use the svn repository interface. - """ - - @staticmethod - def _svn_branch_name(): - return './{0}/svn_branch'.format(EXTERNALS_PATH) - - @staticmethod - def _svn_tag_name(): - return './{0}/svn_tag'.format(EXTERNALS_PATH) - - def _svn_test_repo_url(self): - return 'file://' + os.path.join(self._bare_root, SVN_TEST_REPO) - - def _check_tag_branch_svn_tag_clean(self, tree): - self._check_sync_clean(tree[self._external_path(TAG_SECTION)], - ExternalStatus.STATUS_OK, - ExternalStatus.STATUS_OK) - self._check_sync_clean(tree[self._svn_branch_name()], - ExternalStatus.STATUS_OK, - ExternalStatus.STATUS_OK) - self._check_sync_clean(tree[self._svn_tag_name()], - ExternalStatus.STATUS_OK, - ExternalStatus.STATUS_OK) - - def _have_svn_access(self): - """Check if we have svn access so we can enable tests that use svn. - - """ - have_svn = False - cmd = ['svn', 'ls', self._svn_test_repo_url(), ] - try: - execute_subprocess(cmd) - have_svn = True - except BaseException: - pass - return have_svn - - def _skip_if_no_svn_access(self): - """Function decorator to disable svn tests when svn isn't available - """ - have_svn = self._have_svn_access() - if not have_svn: - raise unittest.SkipTest("No svn access") - - def test_container_simple_svn(self): - """Verify that a container repo can pull in an svn branch and svn tag. - - """ - self._skip_if_no_svn_access() - # create repo - cloned_repo_dir = self.clone_test_repo(CONTAINER_REPO) - - self._generator.create_config() - # Git repo. - self._generator.create_section(SIMPLE_REPO, TAG_SECTION, tag='tag1') - - # Svn repos. - self._generator.create_svn_external('svn_branch', self._svn_test_repo_url(), branch='trunk') - self._generator.create_svn_external('svn_tag', self._svn_test_repo_url(), tag='tags/cesm2.0.beta07') - - self._generator.write_config(cloned_repo_dir) - - # checkout, make sure all sections are clean. - tree = self.execute_checkout_with_status(cloned_repo_dir, - self.checkout_args) - self._check_tag_branch_svn_tag_clean(tree) - - # update description file to make the tag into a branch and - # trigger a switch - self._generator.write_with_svn_branch(cloned_repo_dir, 'svn_tag', - 'trunk') - - # checkout, again the results should be clean. - tree = self.execute_checkout_with_status(cloned_repo_dir, - self.checkout_args) - self._check_tag_branch_svn_tag_clean(tree) - - # add an untracked file to the repo - tracked = False - RepoUtils.add_file_to_repo(cloned_repo_dir, - 'externals/svn_branch/tmp.txt', tracked) - - # run a no-op checkout. - self.execute_checkout_in_dir(cloned_repo_dir, self.checkout_args) - - # update description file to make the branch into a tag and - # trigger a modified sync status - self._generator.write_with_svn_branch(cloned_repo_dir, 'svn_tag', - 'tags/cesm2.0.beta07') - - self.execute_checkout_in_dir(cloned_repo_dir,self.checkout_args) - - # verify status is still clean and unmodified, last - # checkout modified the working dir state. - tree = self.execute_checkout_in_dir(cloned_repo_dir, - self.verbose_args) - self._check_tag_branch_svn_tag_clean(tree) - -class TestSubrepoCheckout(BaseTestSysCheckout): - # Need to store information at setUp time for checking - # pylint: disable=too-many-instance-attributes - """Run tests to ensure proper handling of repos with submodules. - - By default, submodules in git repositories are checked out. A git - repository checked out as a submodule is treated as if it was - listed in an external with the same properties as in the source - .gitmodules file. - """ - - def setUp(self): - """Setup for all submodule checkout tests - Create a repo with two submodule repositories. - """ - - # Run the basic setup - super().setUp() - # create test repo - # We need to do this here (rather than have a static repo) because - # git submodules do not allow for variables in .gitmodules files - self._test_repo_name = 'test_repo_with_submodules' - self._bare_branch_name = 'subrepo_branch' - self._config_branch_name = 'subrepo_config_branch' - self._container_extern_name = 'externals_container.cfg' - self._my_test_dir = os.path.join(module_tmp_root_dir, self._test_id) - self._repo_dir = os.path.join(self._my_test_dir, self._test_repo_name) - self._checkout_dir = 'repo_with_submodules' - check_dir = self.clone_test_repo(CONTAINER_REPO, - dest_dir_in=self._repo_dir) - self.assertTrue(self._repo_dir == check_dir) - # Add the submodules - cwd = os.getcwd() - fork_repo_dir = os.path.join(self._bare_root, SIMPLE_FORK_REPO) - simple_repo_dir = os.path.join(self._bare_root, SIMPLE_REPO) - self._simple_ext_fork_name = os.path.splitext(SIMPLE_FORK_REPO)[0] - self._simple_ext_name = os.path.join('sourc', - os.path.splitext(SIMPLE_REPO)[0]) - os.chdir(self._repo_dir) - # Add a branch with a subrepo - cmd = ['git', 'branch', self._bare_branch_name, 'master'] - execute_subprocess(cmd) - cmd = ['git', 'checkout', self._bare_branch_name] - execute_subprocess(cmd) - cmd = ['git', '-c', 'protocol.file.allow=always','submodule', 'add', fork_repo_dir] - execute_subprocess(cmd) - cmd = ['git', 'commit', '-am', "'Added simple-ext-fork as a submodule'"] - execute_subprocess(cmd) - # Save the fork repo hash for comparison - os.chdir(self._simple_ext_fork_name) - self._fork_hash_check = self.get_git_hash() - os.chdir(self._repo_dir) - # Now, create a branch to test from_sbmodule - cmd = ['git', 'branch', - self._config_branch_name, self._bare_branch_name] - execute_subprocess(cmd) - cmd = ['git', 'checkout', self._config_branch_name] - execute_subprocess(cmd) - cmd = ['git', '-c', 'protocol.file.allow=always', 'submodule', 'add', '--name', SIMPLE_REPO, - simple_repo_dir, self._simple_ext_name] - execute_subprocess(cmd) - # Checkout feature2 - os.chdir(self._simple_ext_name) - cmd = ['git', 'branch', 'feature2', 'origin/feature2'] - execute_subprocess(cmd) - cmd = ['git', 'checkout', 'feature2'] - execute_subprocess(cmd) - # Save the fork repo hash for comparison - self._simple_hash_check = self.get_git_hash() - os.chdir(self._repo_dir) - self.write_externals_config(filename=self._container_extern_name, - dest_dir=self._repo_dir, from_submodule=True) - cmd = ['git', 'add', self._container_extern_name] - execute_subprocess(cmd) - cmd = ['git', 'commit', '-am', "'Added simple-ext as a submodule'"] - execute_subprocess(cmd) - # Reset to master - cmd = ['git', 'checkout', 'master'] - execute_subprocess(cmd) - os.chdir(cwd) - - @staticmethod - def get_git_hash(revision="HEAD"): - """Return the hash for """ - cmd = ['git', 'rev-parse', revision] - git_out = execute_subprocess(cmd, output_to_caller=True) - return git_out.strip() - - def write_externals_config(self, name='', dest_dir=None, - filename=CFG_NAME, - branch_name=None, sub_externals=None, - from_submodule=False): - # pylint: disable=too-many-arguments - """Create a container externals file with only simple externals. - - """ - self._generator.create_config() - - if dest_dir is None: - dest_dir = self._my_test_dir - - if from_submodule: - self._generator.create_section(SIMPLE_FORK_REPO, - self._simple_ext_fork_name, - from_submodule=True) - self._generator.create_section(SIMPLE_REPO, - self._simple_ext_name, - branch='feature3', path='', - from_submodule=False) - else: - if branch_name is None: - branch_name = 'master' - - self._generator.create_section(self._test_repo_name, - self._checkout_dir, - branch=branch_name, - path=name, sub_externals=sub_externals, - repo_path_abs=self._repo_dir) - - self._generator.write_config(dest_dir, filename=filename) - - def idempotence_check(self, checkout_dir): - """Verify that calling checkout_externals and - checkout_externals --status does not cause errors""" - cwd = os.getcwd() - os.chdir(checkout_dir) - self.execute_checkout_in_dir(self._my_test_dir, - self.checkout_args) - self.execute_checkout_in_dir(self._my_test_dir, - self.status_args) - os.chdir(cwd) - - def test_submodule_checkout_bare(self): - """Verify that a git repo with submodule is properly checked out - This test if for where there is no 'externals' keyword in the - parent repo. - Correct behavior is that the submodule is checked out using - normal git submodule behavior. - """ - simple_ext_fork_tag = "(tag1)" - simple_ext_fork_status = " " - self.write_externals_config(branch_name=self._bare_branch_name) - self.execute_checkout_in_dir(self._my_test_dir, - self.checkout_args) - cwd = os.getcwd() - checkout_dir = os.path.join(self._my_test_dir, self._checkout_dir) - fork_file = os.path.join(checkout_dir, - self._simple_ext_fork_name, "readme.txt") - self.assertTrue(os.path.exists(fork_file)) - - submods = git_submodule_status(checkout_dir) - print('checking status of', checkout_dir, ':', submods) - self.assertEqual(len(submods.keys()), 1) - self.assertTrue(self._simple_ext_fork_name in submods) - submod = submods[self._simple_ext_fork_name] - self.assertTrue('hash' in submod) - self.assertEqual(submod['hash'], self._fork_hash_check) - self.assertTrue('status' in submod) - self.assertEqual(submod['status'], simple_ext_fork_status) - self.assertTrue('tag' in submod) - self.assertEqual(submod['tag'], simple_ext_fork_tag) - self.idempotence_check(checkout_dir) - - def test_submodule_checkout_none(self): - """Verify that a git repo with submodule is properly checked out - This test is for when 'externals=None' is in parent repo's - externals cfg file. - Correct behavior is the submodle is not checked out. - """ - self.write_externals_config(branch_name=self._bare_branch_name, - sub_externals="none") - self.execute_checkout_in_dir(self._my_test_dir, - self.checkout_args) - cwd = os.getcwd() - checkout_dir = os.path.join(self._my_test_dir, self._checkout_dir) - fork_file = os.path.join(checkout_dir, - self._simple_ext_fork_name, "readme.txt") - self.assertFalse(os.path.exists(fork_file)) - os.chdir(cwd) - self.idempotence_check(checkout_dir) - - def test_submodule_checkout_config(self): # pylint: disable=too-many-locals - """Verify that a git repo with submodule is properly checked out - This test if for when the 'from_submodule' keyword is used in the - parent repo. - Correct behavior is that the submodule is checked out using - normal git submodule behavior. - """ - tag_check = None # Not checked out as submodule - status_check = "-" # Not checked out as submodule - self.write_externals_config(branch_name=self._config_branch_name, - sub_externals=self._container_extern_name) - self.execute_checkout_in_dir(self._my_test_dir, - self.checkout_args) - cwd = os.getcwd() - checkout_dir = os.path.join(self._my_test_dir, self._checkout_dir) - fork_file = os.path.join(checkout_dir, - self._simple_ext_fork_name, "readme.txt") - self.assertTrue(os.path.exists(fork_file)) - os.chdir(checkout_dir) - # Check submodule status - submods = git_submodule_status(checkout_dir) - self.assertEqual(len(submods.keys()), 2) - self.assertTrue(self._simple_ext_fork_name in submods) - submod = submods[self._simple_ext_fork_name] - self.assertTrue('hash' in submod) - self.assertEqual(submod['hash'], self._fork_hash_check) - self.assertTrue('status' in submod) - self.assertEqual(submod['status'], status_check) - self.assertTrue('tag' in submod) - self.assertEqual(submod['tag'], tag_check) - self.assertTrue(self._simple_ext_name in submods) - submod = submods[self._simple_ext_name] - self.assertTrue('hash' in submod) - self.assertEqual(submod['hash'], self._simple_hash_check) - self.assertTrue('status' in submod) - self.assertEqual(submod['status'], status_check) - self.assertTrue('tag' in submod) - self.assertEqual(submod['tag'], tag_check) - # Check fork repo status - os.chdir(self._simple_ext_fork_name) - self.assertEqual(self.get_git_hash(), self._fork_hash_check) - os.chdir(checkout_dir) - os.chdir(self._simple_ext_name) - hash_check = self.get_git_hash('origin/feature3') - self.assertEqual(self.get_git_hash(), hash_check) - os.chdir(cwd) - self.idempotence_check(checkout_dir) - -class TestSysCheckoutErrors(BaseTestSysCheckout): - """Run systems level tests of error conditions in checkout_externals - - Error conditions - these tests are designed to trigger specific - error conditions and ensure that they are being handled as - runtime errors (and hopefully usefull error messages) instead of - the default internal message that won't mean anything to the - user, e.g. key error, called process error, etc. - - These are not 'expected failures'. They are pass when a - RuntimeError is raised, fail if any other error is raised (or no - error is raised). - - """ - - # NOTE(bja, 2017-11) pylint complains about long method names, but - # it is hard to differentiate tests without making them more - # cryptic. - # pylint: disable=invalid-name - - def test_error_unknown_protocol(self): - """Verify that a runtime error is raised when the user specified repo - protocol is not known. - - """ - # create repo - cloned_repo_dir = self.clone_test_repo(CONTAINER_REPO) - self._generator.create_config() - self._generator.create_section(SIMPLE_REPO, BRANCH_SECTION, - branch=REMOTE_BRANCH_FEATURE2) - self._generator.write_config(cloned_repo_dir) - - # update the config file to point to a different remote with - # the tag instead of branch. Tag MUST NOT be in the original - # repo! - self._generator.write_with_protocol(cloned_repo_dir, BRANCH_SECTION, - 'this-protocol-does-not-exist') - - with self.assertRaises(RuntimeError): - self.execute_checkout_in_dir(cloned_repo_dir, self.checkout_args) - - def test_error_switch_protocol(self): - """Verify that a runtime error is raised when the user switches - protocols, git to svn. - - TODO(bja, 2017-11) This correctly results in an error, but it - isn't a helpful error message. - - """ - # create repo - cloned_repo_dir = self.clone_test_repo(CONTAINER_REPO) - self._generator.create_config() - self._generator.create_section(SIMPLE_REPO, BRANCH_SECTION, - branch=REMOTE_BRANCH_FEATURE2) - self._generator.write_config(cloned_repo_dir) - - # update the config file to point to a different remote with - # the tag instead of branch. Tag MUST NOT be in the original - # repo! - self._generator.write_with_protocol(cloned_repo_dir, BRANCH_SECTION, 'svn') - with self.assertRaises(RuntimeError): - self.execute_checkout_in_dir(cloned_repo_dir, self.checkout_args) - - def test_error_unknown_tag(self): - """Verify that a runtime error is raised when the user specified tag - does not exist. - - """ - # create repo - cloned_repo_dir = self.clone_test_repo(CONTAINER_REPO) - self._generator.create_config() - self._generator.create_section(SIMPLE_REPO, BRANCH_SECTION, - branch=REMOTE_BRANCH_FEATURE2) - self._generator.write_config(cloned_repo_dir) - - # update the config file to point to a different remote with - # the tag instead of branch. Tag MUST NOT be in the original - # repo! - self._generator.write_with_tag_and_remote_repo(cloned_repo_dir, BRANCH_SECTION, - tag='this-tag-does-not-exist', - new_remote_repo_path=SIMPLE_REPO) - - with self.assertRaises(RuntimeError): - self.execute_checkout_in_dir(cloned_repo_dir, self.checkout_args) - - def test_error_overspecify_tag_branch(self): - """Verify that a runtime error is raised when the user specified both - tag and a branch - - """ - # create repo - cloned_repo_dir = self.clone_test_repo(CONTAINER_REPO) - self._generator.create_config() - self._generator.create_section(SIMPLE_REPO, BRANCH_SECTION, - branch=REMOTE_BRANCH_FEATURE2) - self._generator.write_config(cloned_repo_dir) - - # update the config file to point to a different remote with - # the tag instead of branch. Tag MUST NOT be in the original - # repo! - self._generator.write_with_tag_and_remote_repo(cloned_repo_dir, BRANCH_SECTION, - tag='this-tag-does-not-exist', - new_remote_repo_path=SIMPLE_REPO, - remove_branch=False) - - with self.assertRaises(RuntimeError): - self.execute_checkout_in_dir(cloned_repo_dir, self.checkout_args) - - def test_error_underspecify_tag_branch(self): - """Verify that a runtime error is raised when the user specified - neither a tag or a branch - - """ - # create repo - cloned_repo_dir = self.clone_test_repo(CONTAINER_REPO) - self._generator.create_config() - self._generator.create_section(SIMPLE_REPO, BRANCH_SECTION, - branch=REMOTE_BRANCH_FEATURE2) - self._generator.write_config(cloned_repo_dir) - - # update the config file to point to a different remote with - # the tag instead of branch. Tag MUST NOT be in the original - # repo! - self._generator.write_without_branch_tag(cloned_repo_dir, BRANCH_SECTION) - - with self.assertRaises(RuntimeError): - self.execute_checkout_in_dir(cloned_repo_dir, self.checkout_args) - - def test_error_missing_url(self): - """Verify that a runtime error is raised when the user specified - neither a tag or a branch - - """ - # create repo - cloned_repo_dir = self.clone_test_repo(CONTAINER_REPO) - self._generator.create_config() - self._generator.create_section(SIMPLE_REPO, BRANCH_SECTION, - branch=REMOTE_BRANCH_FEATURE2) - self._generator.write_config(cloned_repo_dir) - - # update the config file to point to a different remote with - # the tag instead of branch. Tag MUST NOT be in the original - # repo! - self._generator.write_without_repo_url(cloned_repo_dir, - BRANCH_SECTION) - - with self.assertRaises(RuntimeError): - self.execute_checkout_in_dir(cloned_repo_dir, self.checkout_args) - - -if __name__ == '__main__': - unittest.main() diff --git a/manage_externals/test/test_sys_repository_git.py b/manage_externals/test/test_sys_repository_git.py deleted file mode 100644 index 7e5fb5020d..0000000000 --- a/manage_externals/test/test_sys_repository_git.py +++ /dev/null @@ -1,238 +0,0 @@ -#!/usr/bin/env python3 - -"""Tests of some of the functionality in repository_git.py that actually -interacts with git repositories. - -We're calling these "system" tests because we expect them to be a lot -slower than most of the unit tests. - -""" - -from __future__ import absolute_import -from __future__ import unicode_literals -from __future__ import print_function - -import os -import shutil -import tempfile -import unittest - -from manic.repository_git import GitRepository -from manic.externals_description import ExternalsDescription -from manic.externals_description import ExternalsDescriptionDict -from manic.utils import execute_subprocess - -# NOTE(wjs, 2018-04-09) I find a mix of camel case and underscores to be -# more readable for unit test names, so I'm disabling pylint's naming -# convention check -# pylint: disable=C0103 - -# Allow access to protected members -# pylint: disable=W0212 - - -class GitTestCase(unittest.TestCase): - """Adds some git-specific unit test functionality on top of TestCase""" - - def assertIsHash(self, maybe_hash): - """Assert that the string given by maybe_hash really does look - like a git hash. - """ - - # Ensure it is non-empty - self.assertTrue(maybe_hash, msg="maybe_hash is empty") - - # Ensure it has a single string - self.assertEqual(1, len(maybe_hash.split()), - msg="maybe_hash has multiple strings: {}".format(maybe_hash)) - - # Ensure that the only characters in the string are ones allowed - # in hashes - allowed_chars_set = set('0123456789abcdef') - self.assertTrue(set(maybe_hash) <= allowed_chars_set, - msg="maybe_hash has non-hash characters: {}".format(maybe_hash)) - - -class TestGitTestCase(GitTestCase): - """Tests GitTestCase""" - - def test_assertIsHash_true(self): - """Ensure that assertIsHash passes for something that looks - like a hash""" - self.assertIsHash('abc123') - - def test_assertIsHash_empty(self): - """Ensure that assertIsHash raises an AssertionError for an - empty string""" - with self.assertRaises(AssertionError): - self.assertIsHash('') - - def test_assertIsHash_multipleStrings(self): - """Ensure that assertIsHash raises an AssertionError when - given multiple strings""" - with self.assertRaises(AssertionError): - self.assertIsHash('abc123 def456') - - def test_assertIsHash_badChar(self): - """Ensure that assertIsHash raises an AssertionError when given a - string that has a character that doesn't belong in a hash - """ - with self.assertRaises(AssertionError): - self.assertIsHash('abc123g') - - -class TestGitRepositoryGitCommands(GitTestCase): - """Test some git commands in RepositoryGit - - It's silly that we need to create a repository in order to test - these git commands. Much or all of the git functionality that is - currently in repository_git.py should eventually be moved to a - separate module that is solely responsible for wrapping git - commands; that would allow us to test it independently of this - repository class. - """ - - # ======================================================================== - # Test helper functions - # ======================================================================== - - def setUp(self): - # directory we want to return to after the test system and - # checkout_externals are done cd'ing all over the place. - self._return_dir = os.getcwd() - - self._tmpdir = tempfile.mkdtemp() - os.chdir(self._tmpdir) - - self._name = 'component' - rdata = {ExternalsDescription.PROTOCOL: 'git', - ExternalsDescription.REPO_URL: - '/path/to/local/repo', - ExternalsDescription.TAG: - 'tag1', - } - - data = {self._name: - { - ExternalsDescription.REQUIRED: False, - ExternalsDescription.PATH: 'junk', - ExternalsDescription.EXTERNALS: '', - ExternalsDescription.REPO: rdata, - }, - } - model = ExternalsDescriptionDict(data) - repo = model[self._name][ExternalsDescription.REPO] - self._repo = GitRepository('test', repo) - - def tearDown(self): - # return to our common starting point - os.chdir(self._return_dir) - - shutil.rmtree(self._tmpdir, ignore_errors=True) - - @staticmethod - def make_cwd_git_repo(): - """Turn the current directory into an empty git repository""" - execute_subprocess(['git', 'init']) - - @staticmethod - def add_cwd_git_commit(): - """Add a git commit in the current directory""" - with open('README', 'a') as myfile: - myfile.write('more info') - execute_subprocess(['git', 'add', 'README']) - execute_subprocess(['git', 'commit', '-m', 'my commit message']) - - @staticmethod - def checkout_cwd_git_branch(branchname): - """Checkout a new branch in the current directory""" - execute_subprocess(['git', 'checkout', '-b', branchname]) - - @staticmethod - def make_cwd_git_tag(tagname): - """Make a lightweight tag at the current commit""" - execute_subprocess(['git', 'tag', '-m', 'making a tag', tagname]) - - @staticmethod - def checkout_cwd_ref(refname): - """Checkout the given refname in the current directory""" - execute_subprocess(['git', 'checkout', refname]) - - # ======================================================================== - # Begin actual tests - # ======================================================================== - - def test_currentHash_returnsHash(self): - """Ensure that the _git_current_hash function returns a hash""" - self.make_cwd_git_repo() - self.add_cwd_git_commit() - hash_found, myhash = self._repo._git_current_hash(os.getcwd()) - self.assertTrue(hash_found) - self.assertIsHash(myhash) - - def test_currentHash_outsideGitRepo(self): - """Ensure that the _git_current_hash function returns False when - outside a git repository""" - hash_found, myhash = self._repo._git_current_hash(os.getcwd()) - self.assertFalse(hash_found) - self.assertEqual('', myhash) - - def test_currentBranch_onBranch(self): - """Ensure that the _git_current_branch function returns the name - of the branch""" - self.make_cwd_git_repo() - self.add_cwd_git_commit() - self.checkout_cwd_git_branch('foo') - branch_found, mybranch = self._repo._git_current_branch(os.getcwd()) - self.assertTrue(branch_found) - self.assertEqual('foo', mybranch) - - def test_currentBranch_notOnBranch(self): - """Ensure that the _git_current_branch function returns False - when not on a branch""" - self.make_cwd_git_repo() - self.add_cwd_git_commit() - self.make_cwd_git_tag('mytag') - self.checkout_cwd_ref('mytag') - branch_found, mybranch = self._repo._git_current_branch(os.getcwd()) - self.assertFalse(branch_found) - self.assertEqual('', mybranch) - - def test_currentBranch_outsideGitRepo(self): - """Ensure that the _git_current_branch function returns False - when outside a git repository""" - branch_found, mybranch = self._repo._git_current_branch(os.getcwd()) - self.assertFalse(branch_found) - self.assertEqual('', mybranch) - - def test_currentTag_onTag(self): - """Ensure that the _git_current_tag function returns the name of - the tag""" - self.make_cwd_git_repo() - self.add_cwd_git_commit() - self.make_cwd_git_tag('some_tag') - tag_found, mytag = self._repo._git_current_tag(os.getcwd()) - self.assertTrue(tag_found) - self.assertEqual('some_tag', mytag) - - def test_currentTag_notOnTag(self): - """Ensure tha the _git_current_tag function returns False when - not on a tag""" - self.make_cwd_git_repo() - self.add_cwd_git_commit() - self.make_cwd_git_tag('some_tag') - self.add_cwd_git_commit() - tag_found, mytag = self._repo._git_current_tag(os.getcwd()) - self.assertFalse(tag_found) - self.assertEqual('', mytag) - - def test_currentTag_outsideGitRepo(self): - """Ensure that the _git_current_tag function returns False when - outside a git repository""" - tag_found, mytag = self._repo._git_current_tag(os.getcwd()) - self.assertFalse(tag_found) - self.assertEqual('', mytag) - - -if __name__ == '__main__': - unittest.main() diff --git a/manage_externals/test/test_unit_externals_description.py b/manage_externals/test/test_unit_externals_description.py deleted file mode 100644 index 30e5288499..0000000000 --- a/manage_externals/test/test_unit_externals_description.py +++ /dev/null @@ -1,478 +0,0 @@ -#!/usr/bin/env python3 - -"""Unit test driver for checkout_externals - -Note: this script assume the path to the checkout_externals.py module is -already in the python path. - -""" - -from __future__ import absolute_import -from __future__ import unicode_literals -from __future__ import print_function - -import os -import os.path -import shutil -import unittest - -try: - # python2 - from ConfigParser import SafeConfigParser as config_parser - - def config_string_cleaner(text): - """convert strings into unicode - """ - return text.decode('utf-8') -except ImportError: - # python3 - from configparser import ConfigParser as config_parser - - def config_string_cleaner(text): - """Python3 already uses unicode strings, so just return the string - without modification. - - """ - return text - -from manic.externals_description import DESCRIPTION_SECTION, VERSION_ITEM -from manic.externals_description import ExternalsDescription -from manic.externals_description import ExternalsDescriptionDict -from manic.externals_description import ExternalsDescriptionConfigV1 -from manic.externals_description import get_cfg_schema_version -from manic.externals_description import read_externals_description_file -from manic.externals_description import create_externals_description - -from manic.global_constants import EMPTY_STR - - -class TestCfgSchemaVersion(unittest.TestCase): - """Test that schema identification for the externals description - returns the correct results. - - """ - - def setUp(self): - """Reusable config object - """ - self._config = config_parser() - self._config.add_section('section1') - self._config.set('section1', 'keword', 'value') - - self._config.add_section(DESCRIPTION_SECTION) - - def test_schema_version_valid(self): - """Test that schema identification returns the correct version for a - valid tag. - - """ - version_str = '2.1.3' - self._config.set(DESCRIPTION_SECTION, VERSION_ITEM, version_str) - major, minor, patch = get_cfg_schema_version(self._config) - expected_major = 2 - expected_minor = 1 - expected_patch = 3 - self.assertEqual(expected_major, major) - self.assertEqual(expected_minor, minor) - self.assertEqual(expected_patch, patch) - - def test_schema_section_missing(self): - """Test that an error is returned if the schema section is missing - from the input file. - - """ - self._config.remove_section(DESCRIPTION_SECTION) - with self.assertRaises(RuntimeError): - get_cfg_schema_version(self._config) - - def test_schema_version_missing(self): - """Test that a externals description file without a version raises a - runtime error. - - """ - # Note: the default setup method shouldn't include a version - # keyword, but remove it just to be future proof.... - self._config.remove_option(DESCRIPTION_SECTION, VERSION_ITEM) - with self.assertRaises(RuntimeError): - get_cfg_schema_version(self._config) - - def test_schema_version_not_int(self): - """Test that a externals description file a version that doesn't - decompose to integer major, minor and patch versions raises - runtime error. - - """ - self._config.set(DESCRIPTION_SECTION, VERSION_ITEM, 'unknown') - with self.assertRaises(RuntimeError): - get_cfg_schema_version(self._config) - - -class TestModelDescritionConfigV1(unittest.TestCase): - """Test that parsing config/ini fileproduces a correct dictionary - for the externals description. - - """ - # pylint: disable=R0902 - - def setUp(self): - """Boiler plate construction of string containing xml for multiple components. - """ - self._comp1_name = 'comp1' - self._comp1_path = 'path/to/comp1' - self._comp1_protocol = 'svn' - self._comp1_url = 'https://svn.somewhere.com/path/of/comp1' - self._comp1_tag = 'a_nice_tag_v1' - self._comp1_is_required = 'True' - self._comp1_externals = '' - - self._comp2_name = 'comp2' - self._comp2_path = 'path/to/comp2' - self._comp2_protocol = 'git' - self._comp2_url = '/local/clone/of/comp2' - self._comp2_branch = 'a_very_nice_branch' - self._comp2_is_required = 'False' - self._comp2_externals = 'path/to/comp2.cfg' - - def _setup_comp1(self, config): - """Boiler plate construction of xml string for componet 1 - """ - config.add_section(self._comp1_name) - config.set(self._comp1_name, 'local_path', self._comp1_path) - config.set(self._comp1_name, 'protocol', self._comp1_protocol) - config.set(self._comp1_name, 'repo_url', self._comp1_url) - config.set(self._comp1_name, 'tag', self._comp1_tag) - config.set(self._comp1_name, 'required', self._comp1_is_required) - - def _setup_comp2(self, config): - """Boiler plate construction of xml string for componet 2 - """ - config.add_section(self._comp2_name) - config.set(self._comp2_name, 'local_path', self._comp2_path) - config.set(self._comp2_name, 'protocol', self._comp2_protocol) - config.set(self._comp2_name, 'repo_url', self._comp2_url) - config.set(self._comp2_name, 'branch', self._comp2_branch) - config.set(self._comp2_name, 'required', self._comp2_is_required) - config.set(self._comp2_name, 'externals', self._comp2_externals) - - @staticmethod - def _setup_externals_description(config): - """Add the required exernals description section - """ - - config.add_section(DESCRIPTION_SECTION) - config.set(DESCRIPTION_SECTION, VERSION_ITEM, '1.0.1') - - def _check_comp1(self, model): - """Test that component one was constructed correctly. - """ - self.assertTrue(self._comp1_name in model) - comp1 = model[self._comp1_name] - self.assertEqual(comp1[ExternalsDescription.PATH], self._comp1_path) - self.assertTrue(comp1[ExternalsDescription.REQUIRED]) - repo = comp1[ExternalsDescription.REPO] - self.assertEqual(repo[ExternalsDescription.PROTOCOL], - self._comp1_protocol) - self.assertEqual(repo[ExternalsDescription.REPO_URL], self._comp1_url) - self.assertEqual(repo[ExternalsDescription.TAG], self._comp1_tag) - self.assertEqual(EMPTY_STR, comp1[ExternalsDescription.EXTERNALS]) - - def _check_comp2(self, model): - """Test that component two was constucted correctly. - """ - self.assertTrue(self._comp2_name in model) - comp2 = model[self._comp2_name] - self.assertEqual(comp2[ExternalsDescription.PATH], self._comp2_path) - self.assertFalse(comp2[ExternalsDescription.REQUIRED]) - repo = comp2[ExternalsDescription.REPO] - self.assertEqual(repo[ExternalsDescription.PROTOCOL], - self._comp2_protocol) - self.assertEqual(repo[ExternalsDescription.REPO_URL], self._comp2_url) - self.assertEqual(repo[ExternalsDescription.BRANCH], self._comp2_branch) - self.assertEqual(self._comp2_externals, - comp2[ExternalsDescription.EXTERNALS]) - - def test_one_tag_required(self): - """Test that a component source with a tag is correctly parsed. - """ - config = config_parser() - self._setup_comp1(config) - self._setup_externals_description(config) - model = ExternalsDescriptionConfigV1(config) - print(model) - self._check_comp1(model) - - def test_one_branch_externals(self): - """Test that a component source with a branch is correctly parsed. - """ - config = config_parser() - self._setup_comp2(config) - self._setup_externals_description(config) - model = ExternalsDescriptionConfigV1(config) - print(model) - self._check_comp2(model) - - def test_two_sources(self): - """Test that multiple component sources are correctly parsed. - """ - config = config_parser() - self._setup_comp1(config) - self._setup_comp2(config) - self._setup_externals_description(config) - model = ExternalsDescriptionConfigV1(config) - print(model) - self._check_comp1(model) - self._check_comp2(model) - - def test_cfg_v1_reject_unknown_item(self): - """Test that a v1 description object will reject unknown items - """ - config = config_parser() - self._setup_comp1(config) - self._setup_externals_description(config) - config.set(self._comp1_name, 'junk', 'foobar') - with self.assertRaises(RuntimeError): - ExternalsDescriptionConfigV1(config) - - def test_cfg_v1_reject_v2(self): - """Test that a v1 description object won't try to parse a v2 file. - """ - config = config_parser() - self._setup_comp1(config) - self._setup_externals_description(config) - config.set(DESCRIPTION_SECTION, VERSION_ITEM, '2.0.1') - with self.assertRaises(RuntimeError): - ExternalsDescriptionConfigV1(config) - - def test_cfg_v1_reject_v1_too_new(self): - """Test that a v1 description object won't try to parse a v2 file. - """ - config = config_parser() - self._setup_comp1(config) - self._setup_externals_description(config) - config.set(DESCRIPTION_SECTION, VERSION_ITEM, '1.100.0') - with self.assertRaises(RuntimeError): - ExternalsDescriptionConfigV1(config) - - -class TestReadExternalsDescription(unittest.TestCase): - """Test the application logic of read_externals_description_file - """ - TMP_FAKE_DIR = 'fake' - - def setUp(self): - """Setup directory for tests - """ - if not os.path.exists(self.TMP_FAKE_DIR): - os.makedirs(self.TMP_FAKE_DIR) - - def tearDown(self): - """Cleanup tmp stuff on the file system - """ - if os.path.exists(self.TMP_FAKE_DIR): - shutil.rmtree(self.TMP_FAKE_DIR) - - def test_no_file_error(self): - """Test that a runtime error is raised when the file does not exist - - """ - root_dir = os.getcwd() - filename = 'this-file-should-not-exist' - with self.assertRaises(RuntimeError): - read_externals_description_file(root_dir, filename) - - def test_no_dir_error(self): - """Test that a runtime error is raised when the file does not exist - - """ - root_dir = '/path/to/some/repo' - filename = 'externals.cfg' - with self.assertRaises(RuntimeError): - read_externals_description_file(root_dir, filename) - - def test_no_invalid_error(self): - """Test that a runtime error is raised when the file format is invalid - - """ - root_dir = os.getcwd() - filename = 'externals.cfg' - file_path = os.path.join(root_dir, filename) - file_path = os.path.abspath(file_path) - contents = """ - -invalid file format -""" - with open(file_path, 'w') as fhandle: - fhandle.write(contents) - with self.assertRaises(RuntimeError): - read_externals_description_file(root_dir, filename) - os.remove(file_path) - - -class TestCreateExternalsDescription(unittest.TestCase): - """Test the application logic of creat_externals_description - """ - - def setUp(self): - """Create config object used as basis for all tests - """ - self._config = config_parser() - self._gmconfig = config_parser() - self.setup_config() - - def setup_config(self): - """Boiler plate construction of xml string for componet 1 - """ - # Create a standard externals config with a single external - name = 'test' - self._config.add_section(name) - self._config.set(name, ExternalsDescription.PATH, 'externals') - self._config.set(name, ExternalsDescription.PROTOCOL, 'git') - self._config.set(name, ExternalsDescription.REPO_URL, '/path/to/repo') - self._config.set(name, ExternalsDescription.TAG, 'test_tag') - self._config.set(name, ExternalsDescription.REQUIRED, 'True') - - self._config.add_section(DESCRIPTION_SECTION) - self._config.set(DESCRIPTION_SECTION, VERSION_ITEM, '1.0.0') - - # Create a .gitmodules test - name = 'submodule "gitmodules_test"' - self._gmconfig.add_section(name) - self._gmconfig.set(name, "path", 'externals/test') - self._gmconfig.set(name, "url", '/path/to/repo') - # NOTE(goldy, 2019-03) Should test other possible keywords such as - # fetchRecurseSubmodules, ignore, and shallow - - @staticmethod - def setup_dict_config(): - """Create the full container dictionary with simple and mixed use - externals - - """ - rdatat = {ExternalsDescription.PROTOCOL: 'git', - ExternalsDescription.REPO_URL: 'simple-ext.git', - ExternalsDescription.TAG: 'tag1'} - rdatab = {ExternalsDescription.PROTOCOL: 'git', - ExternalsDescription.REPO_URL: 'simple-ext.git', - ExternalsDescription.BRANCH: 'feature2'} - rdatam = {ExternalsDescription.PROTOCOL: 'git', - ExternalsDescription.REPO_URL: 'mixed-cont-ext.git', - ExternalsDescription.BRANCH: 'master'} - desc = {'simp_tag': {ExternalsDescription.REQUIRED: True, - ExternalsDescription.PATH: 'simp_tag', - ExternalsDescription.EXTERNALS: EMPTY_STR, - ExternalsDescription.REPO: rdatat}, - 'simp_branch' : {ExternalsDescription.REQUIRED: True, - ExternalsDescription.PATH: 'simp_branch', - ExternalsDescription.EXTERNALS: EMPTY_STR, - ExternalsDescription.REPO: rdatab}, - 'simp_opt': {ExternalsDescription.REQUIRED: False, - ExternalsDescription.PATH: 'simp_opt', - ExternalsDescription.EXTERNALS: EMPTY_STR, - ExternalsDescription.REPO: rdatat}, - 'mixed_req': {ExternalsDescription.REQUIRED: True, - ExternalsDescription.PATH: 'mixed_req', - ExternalsDescription.EXTERNALS: 'sub-ext.cfg', - ExternalsDescription.REPO: rdatam}} - - return desc - - def test_cfg_v1_ok(self): - """Test that a correct cfg v1 object is created by create_externals_description - - """ - self._config.set(DESCRIPTION_SECTION, VERSION_ITEM, '1.0.3') - ext = create_externals_description(self._config, model_format='cfg') - self.assertIsInstance(ext, ExternalsDescriptionConfigV1) - - def test_cfg_v1_unknown_version(self): - """Test that a config file with unknown schema version is rejected by - create_externals_description. - - """ - self._config.set(DESCRIPTION_SECTION, VERSION_ITEM, '100.0.3') - with self.assertRaises(RuntimeError): - create_externals_description(self._config, model_format='cfg') - - def test_dict(self): - """Test that a correct cfg v1 object is created by create_externals_description - - """ - rdata = {ExternalsDescription.PROTOCOL: 'git', - ExternalsDescription.REPO_URL: '/path/to/repo', - ExternalsDescription.TAG: 'tagv1', - } - - desc = { - 'test': { - ExternalsDescription.REQUIRED: False, - ExternalsDescription.PATH: '../fake', - ExternalsDescription.EXTERNALS: EMPTY_STR, - ExternalsDescription.REPO: rdata, }, - } - - ext = create_externals_description(desc, model_format='dict') - self.assertIsInstance(ext, ExternalsDescriptionDict) - - def test_cfg_component_dict(self): - """Verify that create_externals_description works with a dictionary - """ - # create the top level externals file - desc = self.setup_dict_config() - # Check external with all repos - external = create_externals_description(desc, model_format='dict') - self.assertIsInstance(external, ExternalsDescriptionDict) - self.assertTrue('simp_tag' in external) - self.assertTrue('simp_branch' in external) - self.assertTrue('simp_opt' in external) - self.assertTrue('mixed_req' in external) - - def test_cfg_exclude_component_dict(self): - """Verify that exclude component checkout works with a dictionary - """ - # create the top level externals file - desc = self.setup_dict_config() - # Test an excluded repo - external = create_externals_description(desc, model_format='dict', - exclude=['simp_tag', - 'simp_opt']) - self.assertIsInstance(external, ExternalsDescriptionDict) - self.assertFalse('simp_tag' in external) - self.assertTrue('simp_branch' in external) - self.assertFalse('simp_opt' in external) - self.assertTrue('mixed_req' in external) - - def test_cfg_opt_component_dict(self): - """Verify that exclude component checkout works with a dictionary - """ - # create the top level externals file - desc = self.setup_dict_config() - # Test an excluded repo - external = create_externals_description(desc, model_format='dict', - components=['simp_tag', - 'simp_opt']) - self.assertIsInstance(external, ExternalsDescriptionDict) - self.assertTrue('simp_tag' in external) - self.assertFalse('simp_branch' in external) - self.assertTrue('simp_opt' in external) - self.assertFalse('mixed_req' in external) - - def test_cfg_unknown_version(self): - """Test that a runtime error is raised when an unknown file version is - received - - """ - self._config.set(DESCRIPTION_SECTION, VERSION_ITEM, '123.456.789') - with self.assertRaises(RuntimeError): - create_externals_description(self._config, model_format='cfg') - - def test_cfg_unknown_format(self): - """Test that a runtime error is raised when an unknown format string is - received - - """ - with self.assertRaises(RuntimeError): - create_externals_description(self._config, model_format='unknown') - - -if __name__ == '__main__': - unittest.main() diff --git a/manage_externals/test/test_unit_externals_status.py b/manage_externals/test/test_unit_externals_status.py deleted file mode 100644 index f019514e9e..0000000000 --- a/manage_externals/test/test_unit_externals_status.py +++ /dev/null @@ -1,299 +0,0 @@ -#!/usr/bin/env python3 - -"""Unit test driver for the manic external status reporting module. - -Note: this script assumes the path to the manic package is already in -the python path. - -""" - -from __future__ import absolute_import -from __future__ import unicode_literals -from __future__ import print_function - -import unittest - -from manic.externals_status import ExternalStatus - - -class TestStatusObject(unittest.TestCase): - """Verify that the Status object behaives as expected. - """ - - def test_exists_empty_all(self): - """If the repository sync-state is empty (doesn't exist), and there is no - clean state, then it is considered not to exist. - - """ - stat = ExternalStatus() - stat.sync_state = ExternalStatus.EMPTY - stat.clean_state = ExternalStatus.DEFAULT - exists = stat.exists() - self.assertFalse(exists) - - stat.clean_state = ExternalStatus.EMPTY - exists = stat.exists() - self.assertFalse(exists) - - stat.clean_state = ExternalStatus.UNKNOWN - exists = stat.exists() - self.assertFalse(exists) - - # this state represtens an internal logic error in how the - # repo status was determined. - stat.clean_state = ExternalStatus.STATUS_OK - exists = stat.exists() - self.assertTrue(exists) - - # this state represtens an internal logic error in how the - # repo status was determined. - stat.clean_state = ExternalStatus.DIRTY - exists = stat.exists() - self.assertTrue(exists) - - def test_exists_default_all(self): - """If the repository sync-state is default, then it is considered to exist - regardless of clean state. - - """ - stat = ExternalStatus() - stat.sync_state = ExternalStatus.DEFAULT - stat.clean_state = ExternalStatus.DEFAULT - exists = stat.exists() - self.assertTrue(exists) - - stat.clean_state = ExternalStatus.EMPTY - exists = stat.exists() - self.assertTrue(exists) - - stat.clean_state = ExternalStatus.UNKNOWN - exists = stat.exists() - self.assertTrue(exists) - - stat.clean_state = ExternalStatus.STATUS_OK - exists = stat.exists() - self.assertTrue(exists) - - stat.clean_state = ExternalStatus.DIRTY - exists = stat.exists() - self.assertTrue(exists) - - def test_exists_unknown_all(self): - """If the repository sync-state is unknown, then it is considered to exist - regardless of clean state. - - """ - stat = ExternalStatus() - stat.sync_state = ExternalStatus.UNKNOWN - stat.clean_state = ExternalStatus.DEFAULT - exists = stat.exists() - self.assertTrue(exists) - - stat.clean_state = ExternalStatus.EMPTY - exists = stat.exists() - self.assertTrue(exists) - - stat.clean_state = ExternalStatus.UNKNOWN - exists = stat.exists() - self.assertTrue(exists) - - stat.clean_state = ExternalStatus.STATUS_OK - exists = stat.exists() - self.assertTrue(exists) - - stat.clean_state = ExternalStatus.DIRTY - exists = stat.exists() - self.assertTrue(exists) - - def test_exists_modified_all(self): - """If the repository sync-state is modified, then it is considered to exist - regardless of clean state. - - """ - stat = ExternalStatus() - stat.sync_state = ExternalStatus.MODEL_MODIFIED - stat.clean_state = ExternalStatus.DEFAULT - exists = stat.exists() - self.assertTrue(exists) - - stat.clean_state = ExternalStatus.EMPTY - exists = stat.exists() - self.assertTrue(exists) - - stat.clean_state = ExternalStatus.UNKNOWN - exists = stat.exists() - self.assertTrue(exists) - - stat.clean_state = ExternalStatus.STATUS_OK - exists = stat.exists() - self.assertTrue(exists) - - stat.clean_state = ExternalStatus.DIRTY - exists = stat.exists() - self.assertTrue(exists) - - def test_exists_ok_all(self): - """If the repository sync-state is ok, then it is considered to exist - regardless of clean state. - - """ - stat = ExternalStatus() - stat.sync_state = ExternalStatus.STATUS_OK - stat.clean_state = ExternalStatus.DEFAULT - exists = stat.exists() - self.assertTrue(exists) - - stat.clean_state = ExternalStatus.EMPTY - exists = stat.exists() - self.assertTrue(exists) - - stat.clean_state = ExternalStatus.UNKNOWN - exists = stat.exists() - self.assertTrue(exists) - - stat.clean_state = ExternalStatus.STATUS_OK - exists = stat.exists() - self.assertTrue(exists) - - stat.clean_state = ExternalStatus.DIRTY - exists = stat.exists() - self.assertTrue(exists) - - def test_update_ok_all(self): - """If the repository in-sync is ok, then it is safe to - update only if clean state is ok - - """ - stat = ExternalStatus() - stat.sync_state = ExternalStatus.STATUS_OK - stat.clean_state = ExternalStatus.DEFAULT - safe_to_update = stat.safe_to_update() - self.assertFalse(safe_to_update) - - stat.clean_state = ExternalStatus.EMPTY - safe_to_update = stat.safe_to_update() - self.assertFalse(safe_to_update) - - stat.clean_state = ExternalStatus.UNKNOWN - safe_to_update = stat.safe_to_update() - self.assertFalse(safe_to_update) - - stat.clean_state = ExternalStatus.STATUS_OK - safe_to_update = stat.safe_to_update() - self.assertTrue(safe_to_update) - - stat.clean_state = ExternalStatus.DIRTY - safe_to_update = stat.safe_to_update() - self.assertFalse(safe_to_update) - - def test_update_modified_all(self): - """If the repository in-sync is modified, then it is safe to - update only if clean state is ok - - """ - stat = ExternalStatus() - stat.sync_state = ExternalStatus.MODEL_MODIFIED - stat.clean_state = ExternalStatus.DEFAULT - safe_to_update = stat.safe_to_update() - self.assertFalse(safe_to_update) - - stat.clean_state = ExternalStatus.EMPTY - safe_to_update = stat.safe_to_update() - self.assertFalse(safe_to_update) - - stat.clean_state = ExternalStatus.UNKNOWN - safe_to_update = stat.safe_to_update() - self.assertFalse(safe_to_update) - - stat.clean_state = ExternalStatus.STATUS_OK - safe_to_update = stat.safe_to_update() - self.assertTrue(safe_to_update) - - stat.clean_state = ExternalStatus.DIRTY - safe_to_update = stat.safe_to_update() - self.assertFalse(safe_to_update) - - def test_update_unknown_all(self): - """If the repository in-sync is unknown, then it is not safe to - update, regardless of the clean state. - - """ - stat = ExternalStatus() - stat.sync_state = ExternalStatus.UNKNOWN - stat.clean_state = ExternalStatus.DEFAULT - safe_to_update = stat.safe_to_update() - self.assertFalse(safe_to_update) - - stat.clean_state = ExternalStatus.EMPTY - safe_to_update = stat.safe_to_update() - self.assertFalse(safe_to_update) - - stat.clean_state = ExternalStatus.UNKNOWN - safe_to_update = stat.safe_to_update() - self.assertFalse(safe_to_update) - - stat.clean_state = ExternalStatus.STATUS_OK - safe_to_update = stat.safe_to_update() - self.assertFalse(safe_to_update) - - stat.clean_state = ExternalStatus.DIRTY - safe_to_update = stat.safe_to_update() - self.assertFalse(safe_to_update) - - def test_update_default_all(self): - """If the repository in-sync is default, then it is not safe to - update, regardless of the clean state. - - """ - stat = ExternalStatus() - stat.sync_state = ExternalStatus.UNKNOWN - stat.clean_state = ExternalStatus.DEFAULT - safe_to_update = stat.safe_to_update() - self.assertFalse(safe_to_update) - - stat.clean_state = ExternalStatus.EMPTY - safe_to_update = stat.safe_to_update() - self.assertFalse(safe_to_update) - - stat.clean_state = ExternalStatus.UNKNOWN - safe_to_update = stat.safe_to_update() - self.assertFalse(safe_to_update) - - stat.clean_state = ExternalStatus.STATUS_OK - safe_to_update = stat.safe_to_update() - self.assertFalse(safe_to_update) - - stat.clean_state = ExternalStatus.DIRTY - safe_to_update = stat.safe_to_update() - self.assertFalse(safe_to_update) - - def test_update_empty_all(self): - """If the repository in-sync is empty, then it is not safe to - update, regardless of the clean state. - - """ - stat = ExternalStatus() - stat.sync_state = ExternalStatus.UNKNOWN - stat.clean_state = ExternalStatus.DEFAULT - safe_to_update = stat.safe_to_update() - self.assertFalse(safe_to_update) - - stat.clean_state = ExternalStatus.EMPTY - safe_to_update = stat.safe_to_update() - self.assertFalse(safe_to_update) - - stat.clean_state = ExternalStatus.UNKNOWN - safe_to_update = stat.safe_to_update() - self.assertFalse(safe_to_update) - - stat.clean_state = ExternalStatus.STATUS_OK - safe_to_update = stat.safe_to_update() - self.assertFalse(safe_to_update) - - stat.clean_state = ExternalStatus.DIRTY - safe_to_update = stat.safe_to_update() - self.assertFalse(safe_to_update) - - -if __name__ == '__main__': - unittest.main() diff --git a/manage_externals/test/test_unit_repository.py b/manage_externals/test/test_unit_repository.py deleted file mode 100644 index 1b93861834..0000000000 --- a/manage_externals/test/test_unit_repository.py +++ /dev/null @@ -1,208 +0,0 @@ -#!/usr/bin/env python3 - -"""Unit test driver for checkout_externals - -Note: this script assume the path to the checkout_externals.py module is -already in the python path. - -""" - -from __future__ import absolute_import -from __future__ import unicode_literals -from __future__ import print_function - -import unittest - -from manic.repository_factory import create_repository -from manic.repository_git import GitRepository -from manic.repository_svn import SvnRepository -from manic.repository import Repository -from manic.externals_description import ExternalsDescription -from manic.global_constants import EMPTY_STR - - -class TestCreateRepositoryDict(unittest.TestCase): - """Test the create_repository functionality to ensure it returns the - propper type of repository and errors for unknown repository - types. - - """ - - def setUp(self): - """Common data needed for all tests in this class - """ - self._name = 'test_name' - self._repo = {ExternalsDescription.PROTOCOL: None, - ExternalsDescription.REPO_URL: 'junk_root', - ExternalsDescription.TAG: 'junk_tag', - ExternalsDescription.BRANCH: EMPTY_STR, - ExternalsDescription.HASH: EMPTY_STR, - ExternalsDescription.SPARSE: EMPTY_STR, } - - def test_create_repo_git(self): - """Verify that several possible names for the 'git' protocol - create git repository objects. - - """ - protocols = ['git', 'GIT', 'Git', ] - for protocol in protocols: - self._repo[ExternalsDescription.PROTOCOL] = protocol - repo = create_repository(self._name, self._repo) - self.assertIsInstance(repo, GitRepository) - - def test_create_repo_svn(self): - """Verify that several possible names for the 'svn' protocol - create svn repository objects. - """ - protocols = ['svn', 'SVN', 'Svn', ] - for protocol in protocols: - self._repo[ExternalsDescription.PROTOCOL] = protocol - repo = create_repository(self._name, self._repo) - self.assertIsInstance(repo, SvnRepository) - - def test_create_repo_externals_only(self): - """Verify that an externals only repo returns None. - """ - protocols = ['externals_only', ] - for protocol in protocols: - self._repo[ExternalsDescription.PROTOCOL] = protocol - repo = create_repository(self._name, self._repo) - self.assertEqual(None, repo) - - def test_create_repo_unsupported(self): - """Verify that an unsupported protocol generates a runtime error. - """ - protocols = ['not_a_supported_protocol', ] - for protocol in protocols: - self._repo[ExternalsDescription.PROTOCOL] = protocol - with self.assertRaises(RuntimeError): - create_repository(self._name, self._repo) - - -class TestRepository(unittest.TestCase): - """Test the externals description processing used to create the Repository - base class shared by protocol specific repository classes. - - """ - - def test_tag(self): - """Test creation of a repository object with a tag - """ - name = 'test_repo' - protocol = 'test_protocol' - url = 'test_url' - tag = 'test_tag' - repo_info = {ExternalsDescription.PROTOCOL: protocol, - ExternalsDescription.REPO_URL: url, - ExternalsDescription.TAG: tag, - ExternalsDescription.BRANCH: EMPTY_STR, - ExternalsDescription.HASH: EMPTY_STR, - ExternalsDescription.SPARSE: EMPTY_STR, } - repo = Repository(name, repo_info) - print(repo.__dict__) - self.assertEqual(repo.tag(), tag) - self.assertEqual(repo.url(), url) - - def test_branch(self): - """Test creation of a repository object with a branch - """ - name = 'test_repo' - protocol = 'test_protocol' - url = 'test_url' - branch = 'test_branch' - repo_info = {ExternalsDescription.PROTOCOL: protocol, - ExternalsDescription.REPO_URL: url, - ExternalsDescription.BRANCH: branch, - ExternalsDescription.TAG: EMPTY_STR, - ExternalsDescription.HASH: EMPTY_STR, - ExternalsDescription.SPARSE: EMPTY_STR, } - repo = Repository(name, repo_info) - print(repo.__dict__) - self.assertEqual(repo.branch(), branch) - self.assertEqual(repo.url(), url) - - def test_hash(self): - """Test creation of a repository object with a hash - """ - name = 'test_repo' - protocol = 'test_protocol' - url = 'test_url' - ref = 'deadc0de' - sparse = EMPTY_STR - repo_info = {ExternalsDescription.PROTOCOL: protocol, - ExternalsDescription.REPO_URL: url, - ExternalsDescription.BRANCH: EMPTY_STR, - ExternalsDescription.TAG: EMPTY_STR, - ExternalsDescription.HASH: ref, - ExternalsDescription.SPARSE: sparse, } - repo = Repository(name, repo_info) - print(repo.__dict__) - self.assertEqual(repo.hash(), ref) - self.assertEqual(repo.url(), url) - - def test_tag_branch(self): - """Test creation of a repository object with a tag and branch raises a - runtimer error. - - """ - name = 'test_repo' - protocol = 'test_protocol' - url = 'test_url' - branch = 'test_branch' - tag = 'test_tag' - ref = EMPTY_STR - sparse = EMPTY_STR - repo_info = {ExternalsDescription.PROTOCOL: protocol, - ExternalsDescription.REPO_URL: url, - ExternalsDescription.BRANCH: branch, - ExternalsDescription.TAG: tag, - ExternalsDescription.HASH: ref, - ExternalsDescription.SPARSE: sparse, } - with self.assertRaises(RuntimeError): - Repository(name, repo_info) - - def test_tag_branch_hash(self): - """Test creation of a repository object with a tag, branch and hash raises a - runtimer error. - - """ - name = 'test_repo' - protocol = 'test_protocol' - url = 'test_url' - branch = 'test_branch' - tag = 'test_tag' - ref = 'deadc0de' - sparse = EMPTY_STR - repo_info = {ExternalsDescription.PROTOCOL: protocol, - ExternalsDescription.REPO_URL: url, - ExternalsDescription.BRANCH: branch, - ExternalsDescription.TAG: tag, - ExternalsDescription.HASH: ref, - ExternalsDescription.SPARSE: sparse, } - with self.assertRaises(RuntimeError): - Repository(name, repo_info) - - def test_no_tag_no_branch(self): - """Test creation of a repository object without a tag or branch raises a - runtimer error. - - """ - name = 'test_repo' - protocol = 'test_protocol' - url = 'test_url' - branch = EMPTY_STR - tag = EMPTY_STR - ref = EMPTY_STR - sparse = EMPTY_STR - repo_info = {ExternalsDescription.PROTOCOL: protocol, - ExternalsDescription.REPO_URL: url, - ExternalsDescription.BRANCH: branch, - ExternalsDescription.TAG: tag, - ExternalsDescription.HASH: ref, - ExternalsDescription.SPARSE: sparse, } - with self.assertRaises(RuntimeError): - Repository(name, repo_info) - - -if __name__ == '__main__': - unittest.main() diff --git a/manage_externals/test/test_unit_repository_git.py b/manage_externals/test/test_unit_repository_git.py deleted file mode 100644 index 1c01098acf..0000000000 --- a/manage_externals/test/test_unit_repository_git.py +++ /dev/null @@ -1,811 +0,0 @@ -#!/usr/bin/env python3 - -"""Unit test driver for checkout_externals - -Note: this script assume the path to the checkout_externals.py module is -already in the python path. - -""" -# pylint: disable=too-many-lines,protected-access - -from __future__ import absolute_import -from __future__ import unicode_literals -from __future__ import print_function - -import os -import shutil -import unittest - -from manic.repository_git import GitRepository -from manic.externals_status import ExternalStatus -from manic.externals_description import ExternalsDescription -from manic.externals_description import ExternalsDescriptionDict -from manic.global_constants import EMPTY_STR - -# NOTE(bja, 2017-11) order is important here. origin should be a -# subset of other to trap errors on processing remotes! -GIT_REMOTE_OUTPUT_ORIGIN_UPSTREAM = ''' -upstream /path/to/other/repo (fetch) -upstream /path/to/other/repo (push) -other /path/to/local/repo2 (fetch) -other /path/to/local/repo2 (push) -origin /path/to/local/repo (fetch) -origin /path/to/local/repo (push) -''' - - -class TestGitRepositoryCurrentRef(unittest.TestCase): - """test the current_ref command on a git repository - """ - - def setUp(self): - self._name = 'component' - rdata = {ExternalsDescription.PROTOCOL: 'git', - ExternalsDescription.REPO_URL: - '/path/to/local/repo', - ExternalsDescription.TAG: - 'tag1', - } - - data = {self._name: - { - ExternalsDescription.REQUIRED: False, - ExternalsDescription.PATH: 'junk', - ExternalsDescription.EXTERNALS: EMPTY_STR, - ExternalsDescription.REPO: rdata, - }, - } - - model = ExternalsDescriptionDict(data) - repo = model[self._name][ExternalsDescription.REPO] - self._repo = GitRepository('test', repo) - - # - # mock methods replacing git system calls - # - @staticmethod - def _git_current_branch(branch_found, branch_name): - """Return a function that takes the place of - repo._git_current_branch, which returns the given output.""" - def my_git_current_branch(dirname): - """mock function that can take the place of repo._git_current_branch""" - return branch_found, branch_name - return my_git_current_branch - - @staticmethod - def _git_current_tag(tag_found, tag_name): - """Return a function that takes the place of - repo._git_current_tag, which returns the given output.""" - def my_git_current_tag(dirname): - """mock function that can take the place of repo._git_current_tag""" - return tag_found, tag_name - return my_git_current_tag - - @staticmethod - def _git_current_hash(hash_found, hash_name): - """Return a function that takes the place of - repo._git_current_hash, which returns the given output.""" - def my_git_current_hash(dirname): - """mock function that can take the place of repo._git_current_hash""" - return hash_found, hash_name - return my_git_current_hash - - # ------------------------------------------------------------------------ - # Begin tests - # ------------------------------------------------------------------------ - - def test_ref_branch(self): - """Test that we correctly identify we are on a branch - """ - self._repo._git_current_branch = self._git_current_branch( - True, 'feature3') - self._repo._git_current_tag = self._git_current_tag(True, 'foo_tag') - self._repo._git_current_hash = self._git_current_hash(True, 'abc123') - expected = 'foo_tag (branch feature3)' - result = self._repo._current_ref(os.getcwd()) - self.assertEqual(result, expected) - - def test_ref_detached_tag(self): - """Test that we correctly identify that the ref is detached at a tag - """ - self._repo._git_current_branch = self._git_current_branch(False, '') - self._repo._git_current_tag = self._git_current_tag(True, 'foo_tag') - self._repo._git_current_hash = self._git_current_hash(True, 'abc123') - expected = 'foo_tag' - result = self._repo._current_ref(os.getcwd()) - self.assertEqual(result, expected) - - def test_ref_detached_hash(self): - """Test that we can identify ref is detached at a hash - - """ - self._repo._git_current_branch = self._git_current_branch(False, '') - self._repo._git_current_tag = self._git_current_tag(False, '') - self._repo._git_current_hash = self._git_current_hash(True, 'abc123') - expected = 'abc123' - result = self._repo._current_ref(os.getcwd()) - self.assertEqual(result, expected) - - def test_ref_none(self): - """Test that we correctly identify that we're not in a git repo. - """ - self._repo._git_current_branch = self._git_current_branch(False, '') - self._repo._git_current_tag = self._git_current_tag(False, '') - self._repo._git_current_hash = self._git_current_hash(False, '') - result = self._repo._current_ref(os.getcwd()) - self.assertEqual(result, EMPTY_STR) - - -class TestGitRepositoryCheckSync(unittest.TestCase): - """Test whether the GitRepository _check_sync_logic functionality is - correct. - - Note: there are a lot of combinations of state: - - - external description - tag, branch - - - working copy - - doesn't exist (not checked out) - - exists, no git info - incorrect protocol, e.g. svn, or tarball? - - exists, git info - - as expected: - - different from expected: - - detached tag, - - detached hash, - - detached branch (compare remote and branch), - - tracking branch (compare remote and branch), - - same remote - - different remote - - untracked branch - - Test list: - - doesn't exist - - exists no git info - - - num_external * (working copy expected + num_working copy different) - - total tests = 16 - - """ - - # NOTE(bja, 2017-11) pylint complains about long method names, but - # it is hard to differentiate tests without making them more - # cryptic. Also complains about too many public methods, but it - # doesn't really make sense to break this up. - # pylint: disable=invalid-name,too-many-public-methods - - TMP_FAKE_DIR = 'fake' - TMP_FAKE_GIT_DIR = os.path.join(TMP_FAKE_DIR, '.git') - - def setUp(self): - """Setup reusable git repository object - """ - self._name = 'component' - rdata = {ExternalsDescription.PROTOCOL: 'git', - ExternalsDescription.REPO_URL: - '/path/to/local/repo', - ExternalsDescription.TAG: 'tag1', - } - - data = {self._name: - { - ExternalsDescription.REQUIRED: False, - ExternalsDescription.PATH: self.TMP_FAKE_DIR, - ExternalsDescription.EXTERNALS: EMPTY_STR, - ExternalsDescription.REPO: rdata, - }, - } - - model = ExternalsDescriptionDict(data) - repo = model[self._name][ExternalsDescription.REPO] - self._repo = GitRepository('test', repo) - # The unit tests here don't care about the result of - # _current_ref, but we replace it here so that we don't need to - # worry about calling a possibly slow and possibly - # error-producing command (since _current_ref calls various git - # functions): - self._repo._current_ref = self._current_ref_empty - self._create_tmp_git_dir() - - # We have to override this class method rather than the self._repo - # instance method because it is called via - # GitRepository._remote_name_for_url, which is itself a @classmethod - # calls cls._git_remote_verbose(). - self._orignal_git_remote_verbose = GitRepository._git_remote_verbose - GitRepository._git_remote_verbose = self._git_remote_origin_upstream - def tearDown(self): - """Cleanup tmp stuff on the file system - """ - self._remove_tmp_git_dir() - - GitRepository._git_remote_verbose = self._orignal_git_remote_verbose - - def _create_tmp_git_dir(self): - """Create a temporary fake git directory for testing purposes. - """ - if not os.path.exists(self.TMP_FAKE_GIT_DIR): - os.makedirs(self.TMP_FAKE_GIT_DIR) - - def _remove_tmp_git_dir(self): - """Remove the temporary fake git directory - """ - if os.path.exists(self.TMP_FAKE_DIR): - shutil.rmtree(self.TMP_FAKE_DIR) - - # - # mock methods replacing git system calls - # - @staticmethod - def _current_ref_empty(dirname): - """Return an empty string. - - Drop-in for GitRepository._current_ref - """ - return EMPTY_STR - - @staticmethod - def _git_remote_origin_upstream(dirname): - """Return an info string that is a checkout hash. - - Drop-in for GitRepository._git_remote_verbose. - """ - return GIT_REMOTE_OUTPUT_ORIGIN_UPSTREAM - - @staticmethod - def _git_current_hash(myhash): - """Return a function that takes the place of repo._git_current_hash, - which returns the given hash - """ - def my_git_current_hash(dirname): - """mock function that can take the place of repo._git_current_hash""" - return 0, myhash - return my_git_current_hash - - def _git_revparse_commit(self, expected_ref, mystatus, myhash): - """Return a function that takes the place of - repo._git_revparse_commit, which returns a tuple: - (mystatus, myhash). - - Expects the passed-in ref to equal expected_ref - - status = 0 implies success, non-zero implies failure - """ - def my_git_revparse_commit(ref, dirname): - """mock function that can take the place of repo._git_revparse_commit""" - self.assertEqual(expected_ref, ref) - return mystatus, myhash - return my_git_revparse_commit - - # ---------------------------------------------------------------- - # - # Tests where working copy doesn't exist or is invalid - # - # ---------------------------------------------------------------- - def test_sync_dir_not_exist(self): - """Test that a directory that doesn't exist returns an error status - - Note: the Repository classes should be prevented from ever - working on an empty directory by the _Source object. - - """ - stat = ExternalStatus() - self._repo._check_sync(stat, 'invalid_directory_name') - self.assertEqual(stat.sync_state, ExternalStatus.STATUS_ERROR) - # check_dir should only modify the sync_state, not clean_state - self.assertEqual(stat.clean_state, ExternalStatus.DEFAULT) - - def test_sync_dir_exist_no_git_info(self): - """Test that a non-existent git repo returns an unknown status - """ - stat = ExternalStatus() - self._repo._tag = 'tag1' - self._repo._git_current_hash = self._git_current_hash('') - self._repo._git_revparse_commit = self._git_revparse_commit( - 'tag1', 1, '') - self._repo._check_sync(stat, self.TMP_FAKE_DIR) - self.assertEqual(stat.sync_state, ExternalStatus.UNKNOWN) - # check_sync should only modify the sync_state, not clean_state - self.assertEqual(stat.clean_state, ExternalStatus.DEFAULT) - - # ------------------------------------------------------------------------ - # - # Tests where version in configuration file is not a valid reference - # - # ------------------------------------------------------------------------ - - def test_sync_invalid_reference(self): - """Test that an invalid reference returns out-of-sync - """ - stat = ExternalStatus() - self._repo._tag = 'tag1' - self._repo._git_current_hash = self._git_current_hash('abc123') - self._repo._git_revparse_commit = self._git_revparse_commit( - 'tag1', 1, '') - self._repo._check_sync_logic(stat, self.TMP_FAKE_DIR) - self.assertEqual(stat.sync_state, ExternalStatus.MODEL_MODIFIED) - # check_sync should only modify the sync_state, not clean_state - self.assertEqual(stat.clean_state, ExternalStatus.DEFAULT) - - # ---------------------------------------------------------------- - # - # Tests where external description specifies a tag - # - # ---------------------------------------------------------------- - def test_sync_tag_on_same_hash(self): - """Test expect tag on same hash --> status ok - - """ - stat = ExternalStatus() - self._repo._tag = 'tag1' - self._repo._git_current_hash = self._git_current_hash('abc123') - self._repo._git_revparse_commit = self._git_revparse_commit( - 'tag1', 0, 'abc123') - self._repo._check_sync_logic(stat, self.TMP_FAKE_DIR) - self.assertEqual(stat.sync_state, ExternalStatus.STATUS_OK) - # check_sync should only modify the sync_state, not clean_state - self.assertEqual(stat.clean_state, ExternalStatus.DEFAULT) - - def test_sync_tag_on_different_hash(self): - """Test expect tag on a different hash --> status modified - - """ - stat = ExternalStatus() - self._repo._tag = 'tag1' - self._repo._git_current_hash = self._git_current_hash('def456') - self._repo._git_revparse_commit = self._git_revparse_commit( - 'tag1', 0, 'abc123') - self._repo._check_sync_logic(stat, self.TMP_FAKE_DIR) - self.assertEqual(stat.sync_state, ExternalStatus.MODEL_MODIFIED) - # check_sync should only modify the sync_state, not clean_state - self.assertEqual(stat.clean_state, ExternalStatus.DEFAULT) - - # ---------------------------------------------------------------- - # - # Tests where external description specifies a hash - # - # ---------------------------------------------------------------- - def test_sync_hash_on_same_hash(self): - """Test expect hash on same hash --> status ok - - """ - stat = ExternalStatus() - self._repo._tag = '' - self._repo._hash = 'abc' - self._repo._git_current_hash = self._git_current_hash('abc123') - self._repo._git_revparse_commit = self._git_revparse_commit( - 'abc', 0, 'abc123') - self._repo._check_sync_logic(stat, self.TMP_FAKE_DIR) - self.assertEqual(stat.sync_state, ExternalStatus.STATUS_OK) - # check_sync should only modify the sync_state, not clean_state - self.assertEqual(stat.clean_state, ExternalStatus.DEFAULT) - - def test_sync_hash_on_different_hash(self): - """Test expect hash on a different hash --> status modified - - """ - stat = ExternalStatus() - self._repo._tag = '' - self._repo._hash = 'abc' - self._repo._git_current_hash = self._git_current_hash('def456') - self._repo._git_revparse_commit = self._git_revparse_commit( - 'abc', 0, 'abc123') - self._repo._check_sync_logic(stat, self.TMP_FAKE_DIR) - self.assertEqual(stat.sync_state, ExternalStatus.MODEL_MODIFIED) - # check_sync should only modify the sync_state, not clean_state - self.assertEqual(stat.clean_state, ExternalStatus.DEFAULT) - - # ---------------------------------------------------------------- - # - # Tests where external description specifies a branch - # - # ---------------------------------------------------------------- - def test_sync_branch_on_same_hash(self): - """Test expect branch on same hash --> status ok - - """ - stat = ExternalStatus() - self._repo._branch = 'feature-2' - self._repo._tag = '' - self._repo._git_current_hash = self._git_current_hash('abc123') - self._repo._git_revparse_commit = ( - self._git_revparse_commit('origin/feature-2', 0, 'abc123')) - self._repo._check_sync_logic(stat, self.TMP_FAKE_DIR) - self.assertEqual(stat.sync_state, ExternalStatus.STATUS_OK) - # check_sync should only modify the sync_state, not clean_state - self.assertEqual(stat.clean_state, ExternalStatus.DEFAULT) - - def test_sync_branch_on_diff_hash(self): - """Test expect branch on diff hash --> status modified - - """ - stat = ExternalStatus() - self._repo._branch = 'feature-2' - self._repo._tag = '' - self._repo._git_current_hash = self._git_current_hash('abc123') - self._repo._git_revparse_commit = ( - self._git_revparse_commit('origin/feature-2', 0, 'def456')) - self._repo._check_sync_logic(stat, self.TMP_FAKE_DIR) - self.assertEqual(stat.sync_state, ExternalStatus.MODEL_MODIFIED) - # check_sync should only modify the sync_state, not clean_state - self.assertEqual(stat.clean_state, ExternalStatus.DEFAULT) - - def test_sync_branch_diff_remote(self): - """Test _remote_name_for_url with a different remote - - """ - stat = ExternalStatus() - self._repo._branch = 'feature-2' - self._repo._tag = '' - self._repo._url = '/path/to/other/repo' - self._repo._git_current_hash = self._git_current_hash('abc123') - self._repo._git_revparse_commit = ( - self._git_revparse_commit('upstream/feature-2', 0, 'def456')) - self._repo._check_sync_logic(stat, self.TMP_FAKE_DIR) - # The test passes if _git_revparse_commit is called with the - # expected argument - - def test_sync_branch_diff_remote2(self): - """Test _remote_name_for_url with a different remote - - """ - stat = ExternalStatus() - self._repo._branch = 'feature-2' - self._repo._tag = '' - self._repo._url = '/path/to/local/repo2' - self._repo._git_current_hash = self._git_current_hash('abc123') - self._repo._git_revparse_commit = ( - self._git_revparse_commit('other/feature-2', 0, 'def789')) - self._repo._check_sync_logic(stat, self.TMP_FAKE_DIR) - # The test passes if _git_revparse_commit is called with the - # expected argument - - def test_sync_branch_on_unknown_remote(self): - """Test expect branch, but remote is unknown --> status modified - - """ - stat = ExternalStatus() - self._repo._branch = 'feature-2' - self._repo._tag = '' - self._repo._url = '/path/to/unknown/repo' - self._repo._git_current_hash = self._git_current_hash('abc123') - self._repo._git_revparse_commit = ( - self._git_revparse_commit('unknown_remote/feature-2', 1, '')) - self._repo._check_sync_logic(stat, self.TMP_FAKE_DIR) - self.assertEqual(stat.sync_state, ExternalStatus.MODEL_MODIFIED) - # check_sync should only modify the sync_state, not clean_state - self.assertEqual(stat.clean_state, ExternalStatus.DEFAULT) - - def test_sync_branch_on_untracked_local(self): - """Test expect branch, on untracked branch in local repo --> status ok - - Setting the externals description to '.' indicates that the - user only wants to consider the current local repo state - without fetching from remotes. This is required to preserve - the current branch of a repository during an update. - - """ - stat = ExternalStatus() - self._repo._branch = 'feature3' - self._repo._tag = '' - self._repo._url = '.' - self._repo._git_current_hash = self._git_current_hash('abc123') - self._repo._git_revparse_commit = ( - self._git_revparse_commit('feature3', 0, 'abc123')) - self._repo._check_sync_logic(stat, self.TMP_FAKE_DIR) - self.assertEqual(stat.sync_state, ExternalStatus.STATUS_OK) - # check_sync should only modify the sync_state, not clean_state - self.assertEqual(stat.clean_state, ExternalStatus.DEFAULT) - - -class TestGitStatusPorcelain(unittest.TestCase): - """Test parsing of output from git status --porcelain=v1 -z - """ - # pylint: disable=C0103 - GIT_STATUS_PORCELAIN_V1_ALL = ( - r' D INSTALL\0MM Makefile\0M README.md\0R cmakelists.txt\0' - r'CMakeLists.txt\0D commit-message-template.txt\0A stuff.txt\0' - r'?? junk.txt') - - GIT_STATUS_PORCELAIN_CLEAN = r'' - - def test_porcelain_status_dirty(self): - """Verify that git status output is considered dirty when there are - listed files. - - """ - git_output = self.GIT_STATUS_PORCELAIN_V1_ALL - is_dirty = GitRepository._status_v1z_is_dirty(git_output) - self.assertTrue(is_dirty) - - def test_porcelain_status_clean(self): - """Verify that git status output is considered clean when there are no - listed files. - - """ - git_output = self.GIT_STATUS_PORCELAIN_CLEAN - is_dirty = GitRepository._status_v1z_is_dirty(git_output) - self.assertFalse(is_dirty) - - -class TestGitCreateRemoteName(unittest.TestCase): - """Test the create_remote_name method on the GitRepository class - """ - - def setUp(self): - """Common infrastructure for testing _create_remote_name - """ - self._rdata = {ExternalsDescription.PROTOCOL: 'git', - ExternalsDescription.REPO_URL: - 'empty', - ExternalsDescription.TAG: - 'very_useful_tag', - ExternalsDescription.BRANCH: EMPTY_STR, - ExternalsDescription.HASH: EMPTY_STR, - ExternalsDescription.SPARSE: EMPTY_STR, } - self._repo = GitRepository('test', self._rdata) - - def test_remote_git_proto(self): - """Test remote with git protocol - """ - self._repo._url = 'git@git.github.com:very_nice_org/useful_repo' - remote_name = self._repo._create_remote_name() - self.assertEqual(remote_name, 'very_nice_org_useful_repo') - - def test_remote_https_proto(self): - """Test remote with git protocol - """ - self._repo._url = 'https://www.github.com/very_nice_org/useful_repo' - remote_name = self._repo._create_remote_name() - self.assertEqual(remote_name, 'very_nice_org_useful_repo') - - def test_remote_local_abs(self): - """Test remote with git protocol - """ - self._repo._url = '/path/to/local/repositories/useful_repo' - remote_name = self._repo._create_remote_name() - self.assertEqual(remote_name, 'repositories_useful_repo') - - def test_remote_local_rel(self): - """Test remote with git protocol - """ - os.environ['TEST_VAR'] = '/my/path/to/repos' - self._repo._url = '${TEST_VAR}/../../useful_repo' - remote_name = self._repo._create_remote_name() - self.assertEqual(remote_name, 'path_useful_repo') - del os.environ['TEST_VAR'] - - -class TestVerifyTag(unittest.TestCase): - """Test logic verifying that a tag exists and is unique - - """ - - def setUp(self): - """Setup reusable git repository object - """ - self._name = 'component' - rdata = {ExternalsDescription.PROTOCOL: 'git', - ExternalsDescription.REPO_URL: - '/path/to/local/repo', - ExternalsDescription.TAG: 'tag1', - } - - data = {self._name: - { - ExternalsDescription.REQUIRED: False, - ExternalsDescription.PATH: 'tmp', - ExternalsDescription.EXTERNALS: EMPTY_STR, - ExternalsDescription.REPO: rdata, - }, - } - - model = ExternalsDescriptionDict(data) - repo = model[self._name][ExternalsDescription.REPO] - self._repo = GitRepository('test', repo) - - @staticmethod - def _shell_true(*args, **kwargs): - return 0 - - @staticmethod - def _shell_false(*args, **kwargs): - return 1 - - @staticmethod - def _mock_revparse_commit(ref, dirname): - _ = ref - return (TestValidRef._shell_true, '97ebc0e0deadc0de') - - @staticmethod - def _mock_revparse_commit_false(ref, dirname): - _ = ref - return (TestValidRef._shell_false, '97ebc0e0deadc0de') - - def test_tag_not_tag_branch_commit(self): - """Verify a non-tag returns false - """ - self._repo._git_showref_tag = self._shell_false - self._repo._git_showref_branch = self._shell_false - self._repo._git_lsremote_branch = self._shell_false - self._repo._git_revparse_commit = self._mock_revparse_commit_false - self._repo._tag = 'something' - remote_name = 'origin' - received, _ = self._repo._is_unique_tag(self._repo._tag, remote_name, - os.getcwd()) - self.assertFalse(received) - - def test_tag_not_tag(self): - """Verify a non-tag, untracked remote returns false - """ - self._repo._git_showref_tag = self._shell_false - self._repo._git_showref_branch = self._shell_true - self._repo._git_lsremote_branch = self._shell_true - self._repo._git_revparse_commit = self._mock_revparse_commit_false - self._repo._tag = 'tag1' - remote_name = 'origin' - received, _ = self._repo._is_unique_tag(self._repo._tag, remote_name, - os.getcwd()) - self.assertFalse(received) - - def test_tag_indeterminant(self): - """Verify an indeterminant tag/branch returns false - """ - self._repo._git_showref_tag = self._shell_true - self._repo._git_showref_branch = self._shell_true - self._repo._git_lsremote_branch = self._shell_true - self._repo._git_revparse_commit = self._mock_revparse_commit - self._repo._tag = 'something' - remote_name = 'origin' - received, _ = self._repo._is_unique_tag(self._repo._tag, remote_name, - os.getcwd()) - self.assertFalse(received) - - def test_tag_is_unique(self): - """Verify a unique tag match returns true - """ - self._repo._git_showref_tag = self._shell_true - self._repo._git_showref_branch = self._shell_false - self._repo._git_lsremote_branch = self._shell_false - self._repo._git_revparse_commit = self._mock_revparse_commit - self._repo._tag = 'tag1' - remote_name = 'origin' - received, _ = self._repo._is_unique_tag(self._repo._tag, remote_name, - os.getcwd()) - self.assertTrue(received) - - def test_tag_is_not_hash(self): - """Verify a commit hash is not classified as a tag - """ - self._repo._git_showref_tag = self._shell_false - self._repo._git_showref_branch = self._shell_false - self._repo._git_lsremote_branch = self._shell_false - self._repo._git_revparse_commit = self._mock_revparse_commit - self._repo._tag = '97ebc0e0' - remote_name = 'origin' - received, _ = self._repo._is_unique_tag(self._repo._tag, remote_name, - os.getcwd()) - self.assertFalse(received) - - def test_hash_is_commit(self): - """Verify a commit hash is not classified as a tag - """ - self._repo._git_showref_tag = self._shell_false - self._repo._git_showref_branch = self._shell_false - self._repo._git_lsremote_branch = self._shell_false - self._repo._git_revparse_commit = self._mock_revparse_commit - self._repo._tag = '97ebc0e0' - remote_name = 'origin' - received, _ = self._repo._is_unique_tag(self._repo._tag, remote_name, - os.getcwd()) - self.assertFalse(received) - - -class TestValidRef(unittest.TestCase): - """Test logic verifying that a reference is a valid tag, branch or sha1 - - """ - - def setUp(self): - """Setup reusable git repository object - """ - self._name = 'component' - rdata = {ExternalsDescription.PROTOCOL: 'git', - ExternalsDescription.REPO_URL: - '/path/to/local/repo', - ExternalsDescription.TAG: 'tag1', - } - - data = {self._name: - { - ExternalsDescription.REQUIRED: False, - ExternalsDescription.PATH: 'tmp', - ExternalsDescription.EXTERNALS: EMPTY_STR, - ExternalsDescription.REPO: rdata, - }, - } - - model = ExternalsDescriptionDict(data) - repo = model[self._name][ExternalsDescription.REPO] - self._repo = GitRepository('test', repo) - - @staticmethod - def _shell_true(url, remote=None): - _ = url - _ = remote - return 0 - - @staticmethod - def _shell_false(url, remote=None): - _ = url - _ = remote - return 1 - - @staticmethod - def _mock_revparse_commit_false(ref, dirname): - _ = ref - return (TestValidRef._shell_false, '') - - @staticmethod - def _mock_revparse_commit_true(ref, dirname): - _ = ref - _ = dirname - return (TestValidRef._shell_true, '') - - def test_valid_ref_is_invalid(self): - """Verify an invalid reference raises an exception - """ - self._repo._git_showref_tag = self._shell_false - self._repo._git_showref_branch = self._shell_false - self._repo._git_lsremote_branch = self._shell_false - self._repo._git_revparse_commit = self._mock_revparse_commit_false - self._repo._tag = 'invalid_ref' - with self.assertRaises(RuntimeError): - self._repo._check_for_valid_ref(self._repo._tag, - remote_name=None, - dirname=os.getcwd()) - - def test_valid_tag(self): - """Verify a valid tag return true - """ - self._repo._git_showref_tag = self._shell_true - self._repo._git_showref_branch = self._shell_false - self._repo._git_lsremote_branch = self._shell_false - self._repo._git_revparse_commit = self._mock_revparse_commit_true - self._repo._tag = 'tag1' - received = self._repo._check_for_valid_ref(self._repo._tag, - remote_name=None, - dirname=os.getcwd()) - self.assertTrue(received) - - def test_valid_branch(self): - """Verify a valid tag return true - """ - self._repo._git_showref_tag = self._shell_false - self._repo._git_showref_branch = self._shell_true - self._repo._git_lsremote_branch = self._shell_false - self._repo._git_revparse_commit = self._mock_revparse_commit_true - self._repo._tag = 'tag1' - received = self._repo._check_for_valid_ref(self._repo._tag, - remote_name=None, - dirname=os.getcwd()) - self.assertTrue(received) - - def test_valid_hash(self): - """Verify a valid hash return true - """ - def _mock_revparse_commit_true(ref, dirname): - _ = ref - return (0, '56cc0b539426eb26810af9e') - - self._repo._git_showref_tag = self._shell_false - self._repo._git_showref_branch = self._shell_false - self._repo._git_lsremote_branch = self._shell_false - self._repo._git_revparse_commit = _mock_revparse_commit_true - self._repo._hash = '56cc0b5394' - received = self._repo._check_for_valid_ref(self._repo._hash, - remote_name=None, - dirname=os.getcwd()) - self.assertTrue(received) - - -if __name__ == '__main__': - unittest.main() diff --git a/manage_externals/test/test_unit_repository_svn.py b/manage_externals/test/test_unit_repository_svn.py deleted file mode 100755 index d9309df7f6..0000000000 --- a/manage_externals/test/test_unit_repository_svn.py +++ /dev/null @@ -1,501 +0,0 @@ -#!/usr/bin/env python3 - -"""Unit test driver for checkout_externals - -Note: this script assume the path to the checkout_externals.py module is -already in the python path. - -""" - -from __future__ import absolute_import -from __future__ import unicode_literals -from __future__ import print_function - -import unittest - -from manic.repository_svn import SvnRepository -from manic.externals_status import ExternalStatus -from manic.externals_description import ExternalsDescription -from manic.externals_description import ExternalsDescriptionDict -from manic.global_constants import EMPTY_STR - -# pylint: disable=W0212 - -SVN_INFO_MOSART = """Path: components/mosart -Working Copy Root Path: /Users/andreb/projects/ncar/git-conversion/clm-dev-experimental/components/mosart -URL: https://svn-ccsm-models.cgd.ucar.edu/mosart/trunk_tags/mosart1_0_26 -Relative URL: ^/mosart/trunk_tags/mosart1_0_26 -Repository Root: https://svn-ccsm-models.cgd.ucar.edu -Repository UUID: fe37f545-8307-0410-aea5-b40df96820b5 -Revision: 86711 -Node Kind: directory -Schedule: normal -Last Changed Author: erik -Last Changed Rev: 86031 -Last Changed Date: 2017-07-07 12:28:10 -0600 (Fri, 07 Jul 2017) -""" -SVN_INFO_CISM = """ -Path: components/cism -Working Copy Root Path: /Users/andreb/projects/ncar/git-conversion/clm-dev-experimental/components/cism -URL: https://svn-ccsm-models.cgd.ucar.edu/glc/trunk_tags/cism2_1_37 -Relative URL: ^/glc/trunk_tags/cism2_1_37 -Repository Root: https://svn-ccsm-models.cgd.ucar.edu -Repository UUID: fe37f545-8307-0410-aea5-b40df96820b5 -Revision: 86711 -Node Kind: directory -Schedule: normal -Last Changed Author: sacks -Last Changed Rev: 85704 -Last Changed Date: 2017-06-15 05:59:28 -0600 (Thu, 15 Jun 2017) -""" - - -class TestSvnRepositoryCheckURL(unittest.TestCase): - """Verify that the svn_check_url function is working as expected. - """ - - def setUp(self): - """Setup reusable svn repository object - """ - self._name = 'component' - rdata = {ExternalsDescription.PROTOCOL: 'svn', - ExternalsDescription.REPO_URL: - 'https://svn-ccsm-models.cgd.ucar.edu', - ExternalsDescription.TAG: - 'mosart/trunk_tags/mosart1_0_26', - } - - data = {self._name: - { - ExternalsDescription.REQUIRED: False, - ExternalsDescription.PATH: 'junk', - ExternalsDescription.EXTERNALS: '', - ExternalsDescription.REPO: rdata, - }, - } - - model = ExternalsDescriptionDict(data) - repo = model[self._name][ExternalsDescription.REPO] - self._repo = SvnRepository('test', repo) - - def test_check_url_same(self): - """Test that we correctly identify that the correct URL. - """ - svn_output = SVN_INFO_MOSART - expected_url = self._repo.url() - result, current_version = \ - self._repo._check_url(svn_output, expected_url) - self.assertEqual(result, ExternalStatus.STATUS_OK) - self.assertEqual(current_version, 'mosart/trunk_tags/mosart1_0_26') - - def test_check_url_different(self): - """Test that we correctly reject an incorrect URL. - """ - svn_output = SVN_INFO_CISM - expected_url = self._repo.url() - result, current_version = \ - self._repo._check_url(svn_output, expected_url) - self.assertEqual(result, ExternalStatus.MODEL_MODIFIED) - self.assertEqual(current_version, 'glc/trunk_tags/cism2_1_37') - - def test_check_url_none(self): - """Test that we can handle an empty string for output, e.g. not an svn - repo. - - """ - svn_output = EMPTY_STR - expected_url = self._repo.url() - result, current_version = \ - self._repo._check_url(svn_output, expected_url) - self.assertEqual(result, ExternalStatus.UNKNOWN) - self.assertEqual(current_version, '') - - -class TestSvnRepositoryCheckSync(unittest.TestCase): - """Test whether the SvnRepository svn_check_sync functionality is - correct. - - """ - - def setUp(self): - """Setup reusable svn repository object - """ - self._name = "component" - rdata = {ExternalsDescription.PROTOCOL: 'svn', - ExternalsDescription.REPO_URL: - 'https://svn-ccsm-models.cgd.ucar.edu/', - ExternalsDescription.TAG: - 'mosart/trunk_tags/mosart1_0_26', - } - - data = {self._name: - { - ExternalsDescription.REQUIRED: False, - ExternalsDescription.PATH: 'junk', - ExternalsDescription.EXTERNALS: EMPTY_STR, - ExternalsDescription.REPO: rdata, - }, - } - - model = ExternalsDescriptionDict(data) - repo = model[self._name][ExternalsDescription.REPO] - self._repo = SvnRepository('test', repo) - - @staticmethod - def _svn_info_empty(*_): - """Return an empty info string. Simulates svn info failing. - """ - return '' - - @staticmethod - def _svn_info_synced(*_): - """Return an info sting that is synced with the setUp data - """ - return SVN_INFO_MOSART - - @staticmethod - def _svn_info_modified(*_): - """Return and info string that is modified from the setUp data - """ - return SVN_INFO_CISM - - def test_repo_dir_not_exist(self): - """Test that a directory that doesn't exist returns an error status - - Note: the Repository classes should be prevented from ever - working on an empty directory by the _Source object. - - """ - stat = ExternalStatus() - self._repo._check_sync(stat, 'junk') - self.assertEqual(stat.sync_state, ExternalStatus.STATUS_ERROR) - # check_dir should only modify the sync_state, not clean_state - self.assertEqual(stat.clean_state, ExternalStatus.DEFAULT) - - def test_repo_dir_exist_no_svn_info(self): - """Test that an empty info string returns an unknown status - """ - stat = ExternalStatus() - # Now we over-ride the _svn_info method on the repo to return - # a known value without requiring access to svn. - self._repo._svn_info = self._svn_info_empty - self._repo._check_sync(stat, '.') - self.assertEqual(stat.sync_state, ExternalStatus.UNKNOWN) - # check_dir should only modify the sync_state, not clean_state - self.assertEqual(stat.clean_state, ExternalStatus.DEFAULT) - - def test_repo_dir_synced(self): - """Test that a valid info string that is synced to the repo in the - externals description returns an ok status. - - """ - stat = ExternalStatus() - # Now we over-ride the _svn_info method on the repo to return - # a known value without requiring access to svn. - self._repo._svn_info = self._svn_info_synced - self._repo._check_sync(stat, '.') - self.assertEqual(stat.sync_state, ExternalStatus.STATUS_OK) - # check_dir should only modify the sync_state, not clean_state - self.assertEqual(stat.clean_state, ExternalStatus.DEFAULT) - - def test_repo_dir_modified(self): - """Test that a valid svn info string that is out of sync with the - externals description returns a modified status. - - """ - stat = ExternalStatus() - # Now we over-ride the _svn_info method on the repo to return - # a known value without requiring access to svn. - self._repo._svn_info = self._svn_info_modified - self._repo._check_sync(stat, '.') - self.assertEqual(stat.sync_state, ExternalStatus.MODEL_MODIFIED) - # check_dir should only modify the sync_state, not clean_state - self.assertEqual(stat.clean_state, ExternalStatus.DEFAULT) - - -class TestSVNStatusXML(unittest.TestCase): - """Test parsing of svn status xml output - """ - SVN_STATUS_XML_DIRTY_ALL = ''' - - - - - -sacks -2017-06-15T11:59:00.355419Z - - - - - - -sacks -2013-02-07T16:17:56.412878Z - - - - - - -sacks -2017-05-01T16:48:27.893741Z - - - - - - - - - - - - - - - - -''' - - SVN_STATUS_XML_DIRTY_MISSING = ''' - - - - - -sacks -2017-06-15T11:59:00.355419Z - - - - - - - - -''' - - SVN_STATUS_XML_DIRTY_MODIFIED = ''' - - - - - -sacks -2013-02-07T16:17:56.412878Z - - - - - - - - -''' - - SVN_STATUS_XML_DIRTY_DELETED = ''' - - - - - -sacks -2017-05-01T16:48:27.893741Z - - - - - - - - -''' - - SVN_STATUS_XML_DIRTY_UNVERSION = ''' - - - - - - - - - - - -''' - - SVN_STATUS_XML_DIRTY_ADDED = ''' - - - - - - - - - - - -''' - - SVN_STATUS_XML_CLEAN = ''' - - - - - - - - - - - -''' - - def test_xml_status_dirty_missing(self): - """Verify that svn status output is consindered dirty when there is a - missing file. - - """ - svn_output = self.SVN_STATUS_XML_DIRTY_MISSING - is_dirty = SvnRepository.xml_status_is_dirty( - svn_output) - self.assertTrue(is_dirty) - - def test_xml_status_dirty_modified(self): - """Verify that svn status output is consindered dirty when there is a - modified file. - """ - svn_output = self.SVN_STATUS_XML_DIRTY_MODIFIED - is_dirty = SvnRepository.xml_status_is_dirty( - svn_output) - self.assertTrue(is_dirty) - - def test_xml_status_dirty_deleted(self): - """Verify that svn status output is consindered dirty when there is a - deleted file. - """ - svn_output = self.SVN_STATUS_XML_DIRTY_DELETED - is_dirty = SvnRepository.xml_status_is_dirty( - svn_output) - self.assertTrue(is_dirty) - - def test_xml_status_dirty_unversion(self): - """Verify that svn status output ignores unversioned files when making - the clean/dirty decision. - - """ - svn_output = self.SVN_STATUS_XML_DIRTY_UNVERSION - is_dirty = SvnRepository.xml_status_is_dirty( - svn_output) - self.assertFalse(is_dirty) - - def test_xml_status_dirty_added(self): - """Verify that svn status output is consindered dirty when there is a - added file. - """ - svn_output = self.SVN_STATUS_XML_DIRTY_ADDED - is_dirty = SvnRepository.xml_status_is_dirty( - svn_output) - self.assertTrue(is_dirty) - - def test_xml_status_dirty_all(self): - """Verify that svn status output is consindered dirty when there are - multiple dirty files.. - - """ - svn_output = self.SVN_STATUS_XML_DIRTY_ALL - is_dirty = SvnRepository.xml_status_is_dirty( - svn_output) - self.assertTrue(is_dirty) - - def test_xml_status_dirty_clean(self): - """Verify that svn status output is consindered clean when there are - no 'dirty' files. This means accepting untracked and externals. - - """ - svn_output = self.SVN_STATUS_XML_CLEAN - is_dirty = SvnRepository.xml_status_is_dirty( - svn_output) - self.assertFalse(is_dirty) - - -if __name__ == '__main__': - unittest.main() diff --git a/manage_externals/test/test_unit_utils.py b/manage_externals/test/test_unit_utils.py deleted file mode 100644 index 80e1636649..0000000000 --- a/manage_externals/test/test_unit_utils.py +++ /dev/null @@ -1,350 +0,0 @@ -#!/usr/bin/env python3 - -"""Unit test driver for checkout_externals - -Note: this script assume the path to the checkout_externals.py module is -already in the python path. - -""" - -from __future__ import absolute_import -from __future__ import unicode_literals -from __future__ import print_function - -import os -import unittest - -from manic.utils import last_n_lines, indent_string -from manic.utils import str_to_bool, execute_subprocess -from manic.utils import is_remote_url, split_remote_url, expand_local_url - - -class TestExecuteSubprocess(unittest.TestCase): - """Test the application logic of execute_subprocess wrapper - """ - - def test_exesub_return_stat_err(self): - """Test that execute_subprocess returns a status code when caller - requests and the executed subprocess fails. - - """ - cmd = ['false'] - status = execute_subprocess(cmd, status_to_caller=True) - self.assertEqual(status, 1) - - def test_exesub_return_stat_ok(self): - """Test that execute_subprocess returns a status code when caller - requests and the executed subprocess succeeds. - - """ - cmd = ['true'] - status = execute_subprocess(cmd, status_to_caller=True) - self.assertEqual(status, 0) - - def test_exesub_except_stat_err(self): - """Test that execute_subprocess raises an exception on error when - caller doesn't request return code - - """ - cmd = ['false'] - with self.assertRaises(RuntimeError): - execute_subprocess(cmd, status_to_caller=False) - - -class TestLastNLines(unittest.TestCase): - """Test the last_n_lines function. - - """ - - def test_last_n_lines_short(self): - """With a message with <= n lines, result of last_n_lines should - just be the original message. - - """ - mystr = """three -line -string -""" - - mystr_truncated = last_n_lines( - mystr, 3, truncation_message='[truncated]') - self.assertEqual(mystr, mystr_truncated) - - def test_last_n_lines_long(self): - """With a message with > n lines, result of last_n_lines should - be a truncated string. - - """ - mystr = """a -big -five -line -string -""" - expected = """[truncated] -five -line -string -""" - - mystr_truncated = last_n_lines( - mystr, 3, truncation_message='[truncated]') - self.assertEqual(expected, mystr_truncated) - - -class TestIndentStr(unittest.TestCase): - """Test the indent_string function. - - """ - - def test_indent_string_singleline(self): - """Test the indent_string function with a single-line string - - """ - mystr = 'foo' - result = indent_string(mystr, 4) - expected = ' foo' - self.assertEqual(expected, result) - - def test_indent_string_multiline(self): - """Test the indent_string function with a multi-line string - - """ - mystr = """hello -hi -goodbye -""" - result = indent_string(mystr, 2) - expected = """ hello - hi - goodbye -""" - self.assertEqual(expected, result) - - -class TestStrToBool(unittest.TestCase): - """Test the string to boolean conversion routine. - - """ - - def test_case_insensitive_true(self): - """Verify that case insensitive variants of 'true' returns the True - boolean. - - """ - values = ['true', 'TRUE', 'True', 'tRuE', 't', 'T', ] - for value in values: - received = str_to_bool(value) - self.assertTrue(received) - - def test_case_insensitive_false(self): - """Verify that case insensitive variants of 'false' returns the False - boolean. - - """ - values = ['false', 'FALSE', 'False', 'fAlSe', 'f', 'F', ] - for value in values: - received = str_to_bool(value) - self.assertFalse(received) - - def test_invalid_str_error(self): - """Verify that a non-true/false string generates a runtime error. - """ - values = ['not_true_or_false', 'A', '1', '0', - 'false_is_not_true', 'true_is_not_false'] - for value in values: - with self.assertRaises(RuntimeError): - str_to_bool(value) - - -class TestIsRemoteURL(unittest.TestCase): - """Crude url checking to determine if a url is local or remote. - - """ - - def test_url_remote_git(self): - """verify that a remote git url is identified. - """ - url = 'git@somewhere' - is_remote = is_remote_url(url) - self.assertTrue(is_remote) - - def test_url_remote_ssh(self): - """verify that a remote ssh url is identified. - """ - url = 'ssh://user@somewhere' - is_remote = is_remote_url(url) - self.assertTrue(is_remote) - - def test_url_remote_http(self): - """verify that a remote http url is identified. - """ - url = 'http://somewhere' - is_remote = is_remote_url(url) - self.assertTrue(is_remote) - - def test_url_remote_https(self): - """verify that a remote https url is identified. - """ - url = 'https://somewhere' - is_remote = is_remote_url(url) - self.assertTrue(is_remote) - - def test_url_local_user(self): - """verify that a local path with '~/path/to/repo' gets rejected - - """ - url = '~/path/to/repo' - is_remote = is_remote_url(url) - self.assertFalse(is_remote) - - def test_url_local_var_curly(self): - """verify that a local path with env var '${HOME}' gets rejected - """ - url = '${HOME}/path/to/repo' - is_remote = is_remote_url(url) - self.assertFalse(is_remote) - - def test_url_local_var(self): - """verify that a local path with an env var '$HOME' gets rejected - """ - url = '$HOME/path/to/repo' - is_remote = is_remote_url(url) - self.assertFalse(is_remote) - - def test_url_local_abs(self): - """verify that a local abs path gets rejected - """ - url = '/path/to/repo' - is_remote = is_remote_url(url) - self.assertFalse(is_remote) - - def test_url_local_rel(self): - """verify that a local relative path gets rejected - """ - url = '../../path/to/repo' - is_remote = is_remote_url(url) - self.assertFalse(is_remote) - - -class TestSplitRemoteURL(unittest.TestCase): - """Crude url checking to determine if a url is local or remote. - - """ - - def test_url_remote_git(self): - """verify that a remote git url is identified. - """ - url = 'git@somewhere.com:org/repo' - received = split_remote_url(url) - self.assertEqual(received, "org/repo") - - def test_url_remote_ssh(self): - """verify that a remote ssh url is identified. - """ - url = 'ssh://user@somewhere.com/path/to/repo' - received = split_remote_url(url) - self.assertEqual(received, 'somewhere.com/path/to/repo') - - def test_url_remote_http(self): - """verify that a remote http url is identified. - """ - url = 'http://somewhere.org/path/to/repo' - received = split_remote_url(url) - self.assertEqual(received, 'somewhere.org/path/to/repo') - - def test_url_remote_https(self): - """verify that a remote http url is identified. - """ - url = 'http://somewhere.gov/path/to/repo' - received = split_remote_url(url) - self.assertEqual(received, 'somewhere.gov/path/to/repo') - - def test_url_local_url_unchanged(self): - """verify that a local path is unchanged - - """ - url = '/path/to/repo' - received = split_remote_url(url) - self.assertEqual(received, url) - - -class TestExpandLocalURL(unittest.TestCase): - """Crude url checking to determine if a url is local or remote. - - Remote should be unmodified. - - Local, should perform user and variable expansion. - - """ - - def test_url_local_user1(self): - """verify that a local path with '~/path/to/repo' gets expanded to an - absolute path. - - NOTE(bja, 2017-11) we can't test for something like: - '~user/path/to/repo' because the user has to be in the local - machine password directory and we don't know a user name that - is valid on every system....? - - """ - field = 'test' - url = '~/path/to/repo' - received = expand_local_url(url, field) - print(received) - self.assertTrue(os.path.isabs(received)) - - def test_url_local_expand_curly(self): - """verify that a local path with '${HOME}' gets expanded to an absolute path. - """ - field = 'test' - url = '${HOME}/path/to/repo' - received = expand_local_url(url, field) - self.assertTrue(os.path.isabs(received)) - - def test_url_local_expand_var(self): - """verify that a local path with '$HOME' gets expanded to an absolute path. - """ - field = 'test' - url = '$HOME/path/to/repo' - received = expand_local_url(url, field) - self.assertTrue(os.path.isabs(received)) - - def test_url_local_env_missing(self): - """verify that a local path with env var that is missing gets left as-is - - """ - field = 'test' - url = '$TMP_VAR/path/to/repo' - received = expand_local_url(url, field) - print(received) - self.assertEqual(received, url) - - def test_url_local_expand_env(self): - """verify that a local path with another env var gets expanded to an - absolute path. - - """ - field = 'test' - os.environ['TMP_VAR'] = '/some/absolute' - url = '$TMP_VAR/path/to/repo' - received = expand_local_url(url, field) - del os.environ['TMP_VAR'] - print(received) - self.assertTrue(os.path.isabs(received)) - self.assertEqual(received, '/some/absolute/path/to/repo') - - def test_url_local_normalize_rel(self): - """verify that a local path with another env var gets expanded to an - absolute path. - - """ - field = 'test' - url = '/this/is/a/long/../path/to/a/repo' - received = expand_local_url(url, field) - print(received) - self.assertEqual(received, '/this/is/a/path/to/a/repo') - - -if __name__ == '__main__': - unittest.main() From 0f7d429f0071995504ef41a91215724c957e2fb6 Mon Sep 17 00:00:00 2001 From: Jim Edwards Date: Mon, 27 May 2024 17:40:56 -0600 Subject: [PATCH 0336/1248] add submodules --- .gitignore | 11 ----------- .gitmodules | 39 +++++++++++++++++++++++++++++++++++++++ ccs_config | 1 + cime | 1 + components/cdeps | 1 + components/cism | 1 + components/cmeps | 1 + components/mizuRoute | 1 + components/mosart | 1 + components/rtm | 1 + doc/doc-builder | 1 + libraries/mct | 1 + libraries/parallelio | 1 + share | 1 + src/fates | 1 + 15 files changed, 52 insertions(+), 11 deletions(-) create mode 100644 .gitmodules create mode 160000 ccs_config create mode 160000 cime create mode 160000 components/cdeps create mode 160000 components/cism create mode 160000 components/cmeps create mode 160000 components/mizuRoute create mode 160000 components/mosart create mode 160000 components/rtm create mode 160000 doc/doc-builder create mode 160000 libraries/mct create mode 160000 libraries/parallelio create mode 160000 share create mode 160000 src/fates diff --git a/.gitignore b/.gitignore index 163bfeda2d..a083a7853f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,14 +1,3 @@ -# directories checked out by manage_externals, and other files created -# by manage_externals -manage_externals.log -ccs_config -/src/fates/ -/cime/ -/components/ -/libraries/ -/share/ -/doc/doc-builder/ - # ignore svn directories **/.svn/** .svn/ diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000000..329ed2e748 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,39 @@ +[submodule "fates"] + path = src/fates + url = https://github.com/NGEET/fates +[submodule "cism"] + path = components/cism + url = https://github.com/ESCOMP/CISM-wrapper +[submodule "mosart"] + path = components/mosart + url = https://github.com/ESCOMP/MOSART +[submodule "rtm"] + path = components/rtm + url = https://github.com/ESCOMP/RTM +[submodule "mizuRoute"] + path = components/mizuRoute + url = https://github.com/ESCOMP/mizuRoute +[submodule "ccs_config"] + path = ccs_config + url = https://github.com/ESMCI/ccs_config_cesm.git +[submodule "cime"] + path = cime + url = https://github.com/ESMCI/cime +[submodule "cmeps"] + path = components/cmeps + url = https://github.com/ESCOMP/CMEPS.git +[submodule "cdeps"] + path = components/cdeps + url = https://github.com/ESCOMP/CDEPS.git +[submodule "share"] + path = share + url = https://github.com/ESCOMP/CESM_share +[submodule "mct"] + path = libraries/mct + url = https://github.com/MCSclimate/MCT +[submodule "parallelio"] + path = libraries/parallelio + url = https://github.com/NCAR/ParallelIO +[submodule "doc-builder"] + path = doc/doc-builder + url = https://github.com/ESMCI/doc-builder diff --git a/ccs_config b/ccs_config new file mode 160000 index 0000000000..f90e10502c --- /dev/null +++ b/ccs_config @@ -0,0 +1 @@ +Subproject commit f90e10502c7246c2b45e373b7dd5e0da6cba0828 diff --git a/cime b/cime new file mode 160000 index 0000000000..422ddaa770 --- /dev/null +++ b/cime @@ -0,0 +1 @@ +Subproject commit 422ddaa770a3cea6e83a60c9700ebce77acaceed diff --git a/components/cdeps b/components/cdeps new file mode 160000 index 0000000000..7a522c828c --- /dev/null +++ b/components/cdeps @@ -0,0 +1 @@ +Subproject commit 7a522c828c32dc35777992653f281ec525509c4a diff --git a/components/cism b/components/cism new file mode 160000 index 0000000000..c05dd5c4fc --- /dev/null +++ b/components/cism @@ -0,0 +1 @@ +Subproject commit c05dd5c4fc85327e76523aaea9cfe1e388748928 diff --git a/components/cmeps b/components/cmeps new file mode 160000 index 0000000000..6384ff4e4a --- /dev/null +++ b/components/cmeps @@ -0,0 +1 @@ +Subproject commit 6384ff4e4a6bc82a678f9419a43ffbd5d53ac209 diff --git a/components/mizuRoute b/components/mizuRoute new file mode 160000 index 0000000000..0a62ee6185 --- /dev/null +++ b/components/mizuRoute @@ -0,0 +1 @@ +Subproject commit 0a62ee6185bdc9b99cd88ed5f15ea850602c43a2 diff --git a/components/mosart b/components/mosart new file mode 160000 index 0000000000..1c22a8c547 --- /dev/null +++ b/components/mosart @@ -0,0 +1 @@ +Subproject commit 1c22a8c5478b714cf5b7c54b3e5cf7bad09fd9b2 diff --git a/components/rtm b/components/rtm new file mode 160000 index 0000000000..88503adbc2 --- /dev/null +++ b/components/rtm @@ -0,0 +1 @@ +Subproject commit 88503adbc275fb2ccbb6b598e460deaeb140e515 diff --git a/doc/doc-builder b/doc/doc-builder new file mode 160000 index 0000000000..ab9bc93dd0 --- /dev/null +++ b/doc/doc-builder @@ -0,0 +1 @@ +Subproject commit ab9bc93dd09d0173f8097c7a18c7d061c1cd3b79 diff --git a/libraries/mct b/libraries/mct new file mode 160000 index 0000000000..e36024c5dd --- /dev/null +++ b/libraries/mct @@ -0,0 +1 @@ +Subproject commit e36024c5ddf482625ae6bd9474eff7d8f393f87c diff --git a/libraries/parallelio b/libraries/parallelio new file mode 160000 index 0000000000..6539ef05ae --- /dev/null +++ b/libraries/parallelio @@ -0,0 +1 @@ +Subproject commit 6539ef05ae7584ec570a56fdab9f7dfb336c2b80 diff --git a/share b/share new file mode 160000 index 0000000000..4b9dc4871a --- /dev/null +++ b/share @@ -0,0 +1 @@ +Subproject commit 4b9dc4871a259f00f35bb47708d876cb7dcdf75c diff --git a/src/fates b/src/fates new file mode 160000 index 0000000000..f0185f7c70 --- /dev/null +++ b/src/fates @@ -0,0 +1 @@ +Subproject commit f0185f7c7033fa69c80d1ddb07cbcbf1f8be1adc From aa544736634b4e095b691c2d5168dbd3c8de9cef Mon Sep 17 00:00:00 2001 From: Jim Edwards Date: Mon, 27 May 2024 17:43:00 -0600 Subject: [PATCH 0337/1248] update submodules --- .gitmodules | 105 ++- .../git-fleximod/.github/workflows/pre-commit | 13 + .../.github/workflows/pytest.yaml | 77 ++ .lib/git-fleximod/.pre-commit-config.yaml | 18 + .lib/git-fleximod/License | 20 + .lib/git-fleximod/README.md | 110 +++ .lib/git-fleximod/doc/Makefile | 20 + .lib/git-fleximod/doc/conf.py | 26 + .lib/git-fleximod/doc/index.rst | 24 + .lib/git-fleximod/doc/make.bat | 35 + .lib/git-fleximod/escomp_install | 25 + .lib/git-fleximod/git_fleximod/__init__.py | 0 .lib/git-fleximod/git_fleximod/cli.py | 119 +++ .../git-fleximod/git_fleximod/git_fleximod.py | 601 +++++++++++++++ .../git-fleximod/git_fleximod/gitinterface.py | 79 ++ .lib/git-fleximod/git_fleximod/gitmodules.py | 97 +++ .../git-fleximod/git_fleximod/lstripreader.py | 43 ++ .lib/git-fleximod/git_fleximod/metoflexi.py | 236 ++++++ .lib/git-fleximod/git_fleximod/utils.py | 365 +++++++++ .lib/git-fleximod/poetry.lock | 693 ++++++++++++++++++ .lib/git-fleximod/pyproject.toml | 41 ++ .lib/git-fleximod/tbump.toml | 43 ++ .lib/git-fleximod/tests/__init__.py | 3 + .lib/git-fleximod/tests/conftest.py | 138 ++++ .lib/git-fleximod/tests/test_a_import.py | 8 + .lib/git-fleximod/tests/test_b_update.py | 26 + .lib/git-fleximod/tests/test_c_required.py | 30 + .lib/git-fleximod/tests/test_d_complex.py | 67 ++ bin/git-fleximod | 8 + ccs_config | 2 +- components/cdeps | 2 +- components/mizuRoute | 2 +- components/mosart | 2 +- libraries/mct | 2 +- libraries/parallelio | 2 +- src/fates | 2 +- 36 files changed, 3050 insertions(+), 34 deletions(-) create mode 100644 .lib/git-fleximod/.github/workflows/pre-commit create mode 100644 .lib/git-fleximod/.github/workflows/pytest.yaml create mode 100644 .lib/git-fleximod/.pre-commit-config.yaml create mode 100644 .lib/git-fleximod/License create mode 100644 .lib/git-fleximod/README.md create mode 100644 .lib/git-fleximod/doc/Makefile create mode 100644 .lib/git-fleximod/doc/conf.py create mode 100644 .lib/git-fleximod/doc/index.rst create mode 100644 .lib/git-fleximod/doc/make.bat create mode 100644 .lib/git-fleximod/escomp_install create mode 100644 .lib/git-fleximod/git_fleximod/__init__.py create mode 100644 .lib/git-fleximod/git_fleximod/cli.py create mode 100755 .lib/git-fleximod/git_fleximod/git_fleximod.py create mode 100644 .lib/git-fleximod/git_fleximod/gitinterface.py create mode 100644 .lib/git-fleximod/git_fleximod/gitmodules.py create mode 100644 .lib/git-fleximod/git_fleximod/lstripreader.py create mode 100755 .lib/git-fleximod/git_fleximod/metoflexi.py create mode 100644 .lib/git-fleximod/git_fleximod/utils.py create mode 100644 .lib/git-fleximod/poetry.lock create mode 100644 .lib/git-fleximod/pyproject.toml create mode 100644 .lib/git-fleximod/tbump.toml create mode 100644 .lib/git-fleximod/tests/__init__.py create mode 100644 .lib/git-fleximod/tests/conftest.py create mode 100644 .lib/git-fleximod/tests/test_a_import.py create mode 100644 .lib/git-fleximod/tests/test_b_update.py create mode 100644 .lib/git-fleximod/tests/test_c_required.py create mode 100644 .lib/git-fleximod/tests/test_d_complex.py create mode 100755 bin/git-fleximod diff --git a/.gitmodules b/.gitmodules index 329ed2e748..699ad22969 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,39 +1,90 @@ [submodule "fates"] - path = src/fates - url = https://github.com/NGEET/fates +path = src/fates +url = https://github.com/NGEET/fates +fxtag = sci.1.73.0_api.35.0.0 +fxrequired = AlwaysRequired +fxDONOTUSEurl = https://github.com/NCAR/fates-release + [submodule "cism"] - path = components/cism - url = https://github.com/ESCOMP/CISM-wrapper -[submodule "mosart"] - path = components/mosart - url = https://github.com/ESCOMP/MOSART +path = components/cism +url = https://github.com/ESCOMP/CISM-wrapper +fxtag = cismwrap_2_2_001 +fxrequired = ToplevelRequired +fxDONOTUSEurl = https://github.com/ESCOMP/CISM-wrapper + [submodule "rtm"] - path = components/rtm - url = https://github.com/ESCOMP/RTM +path = components/rtm +url = https://github.com/ESCOMP/RTM +fxtag = rtm1_0_79 +fxrequired = ToplevelRequired +fxDONOTUSEurl = https://github.com/ESCOMP/RTM + +[submodule "mosart"] +path = components/mosart +url = https://github.com/ESCOMP/MOSART +fxtag = mosart1_0_49 +fxrequired = ToplevelRequired +fxDONOTUSEurl = https://github.com/ESCOMP/MOSART + [submodule "mizuRoute"] - path = components/mizuRoute - url = https://github.com/ESCOMP/mizuRoute +path = components/mizuRoute +url = https://github.com/ESCOMP/mizuRoute +fxtag = cesm-coupling.n02_v2.1.2 +fxrequired = ToplevelRequired +fxDONOTUSEurl = https://github.com/ESCOMP/mizuRoute + [submodule "ccs_config"] - path = ccs_config - url = https://github.com/ESMCI/ccs_config_cesm.git +path = ccs_config +url = https://github.com/ESMCI/ccs_config_cesm.git +fxtag = ccs_config_cesm0.0.106 +fxrequired = ToplevelRequired +fxDONOTUSEurl = https://github.com/ESMCI/ccs_config_cesm.git + [submodule "cime"] - path = cime - url = https://github.com/ESMCI/cime +path = cime +url = https://github.com/ESMCI/cime +fxtag = cime6.0.246 +fxrequired = ToplevelRequired +fxDONOTUSEurl = https://github.com/ESMCI/cime + [submodule "cmeps"] - path = components/cmeps - url = https://github.com/ESCOMP/CMEPS.git +path = components/cmeps +url = https://github.com/ESCOMP/CMEPS.git +fxtag = cmeps0.14.63 +fxrequired = ToplevelRequired +fxDONOTUSEurl = https://github.com/ESCOMP/CMEPS.git + [submodule "cdeps"] - path = components/cdeps - url = https://github.com/ESCOMP/CDEPS.git +path = components/cdeps +url = https://github.com/ESCOMP/CDEPS.git +fxtag = cdeps1.0.34 +fxrequired = ToplevelRequired +fxDONOTUSEurl = https://github.com/ESCOMP/CDEPS.git + [submodule "share"] - path = share - url = https://github.com/ESCOMP/CESM_share +path = share +url = https://github.com/ESCOMP/CESM_share +fxtag = share1.0.19 +fxrequired = ToplevelRequired +fxDONOTUSEurl = https://github.com/ESCOMP/CESM_share + [submodule "mct"] - path = libraries/mct - url = https://github.com/MCSclimate/MCT +path = libraries/mct +url = https://github.com/MCSclimate/MCT +fxtag = MCT_2.11.0 +fxrequired = ToplevelRequired +fxDONOTUSEurl = https://github.com/MCSclimate/MCT + [submodule "parallelio"] - path = libraries/parallelio - url = https://github.com/NCAR/ParallelIO +path = libraries/parallelio +url = https://github.com/NCAR/ParallelIO +fxtag = pio2_6_2 +fxrequired = ToplevelRequired +fxDONOTUSEurl = https://github.com/NCAR/ParallelIO + [submodule "doc-builder"] - path = doc/doc-builder - url = https://github.com/ESMCI/doc-builder +path = doc/doc-builder +url = https://github.com/ESMCI/doc-builder +fxtag = v1.0.8 +fxrequired = ToplevelOptional +fxDONOTUSEurl = https://github.com/ESMCI/doc-builder diff --git a/.lib/git-fleximod/.github/workflows/pre-commit b/.lib/git-fleximod/.github/workflows/pre-commit new file mode 100644 index 0000000000..1a6ad0082a --- /dev/null +++ b/.lib/git-fleximod/.github/workflows/pre-commit @@ -0,0 +1,13 @@ +name: pre-commit +on: + pull_request: + push: + branches: [main] + +jobs: + pre-commit: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v3 + - uses: pre-commit/action@v3.0.0 diff --git a/.lib/git-fleximod/.github/workflows/pytest.yaml b/.lib/git-fleximod/.github/workflows/pytest.yaml new file mode 100644 index 0000000000..0868dd9a33 --- /dev/null +++ b/.lib/git-fleximod/.github/workflows/pytest.yaml @@ -0,0 +1,77 @@ +# Run this job on pushes to `main`, and for pull requests. If you don't specify +# `branches: [main], then this actions runs _twice_ on pull requests, which is +# annoying. + +on: + push: + branches: [main] + pull_request: + branches: [main] + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + # If you wanted to use multiple Python versions, you'd have specify a matrix in the job and + # reference the matrixe python version here. + - uses: actions/setup-python@v5 + with: + python-version: '3.9' + + # Cache the installation of Poetry itself, e.g. the next step. This prevents the workflow + # from installing Poetry every time, which can be slow. Note the use of the Poetry version + # number in the cache key, and the "-0" suffix: this allows you to invalidate the cache + # manually if/when you want to upgrade Poetry, or if something goes wrong. This could be + # mildly cleaner by using an environment variable, but I don't really care. + - name: cache poetry install + uses: actions/cache@v4 + with: + path: ~/.local + key: poetry-1.7.1 + + # Install Poetry. You could do this manually, or there are several actions that do this. + # `snok/install-poetry` seems to be minimal yet complete, and really just calls out to + # Poetry's default install script, which feels correct. I pin the Poetry version here + # because Poetry does occasionally change APIs between versions and I don't want my + # actions to break if it does. + # + # The key configuration value here is `virtualenvs-in-project: true`: this creates the + # venv as a `.venv` in your testing directory, which allows the next step to easily + # cache it. + - uses: snok/install-poetry@v1 + with: + version: 1.7.1 + virtualenvs-create: true + virtualenvs-in-project: true + + # Cache your dependencies (i.e. all the stuff in your `pyproject.toml`). Note the cache + # key: if you're using multiple Python versions, or multiple OSes, you'd need to include + # them in the cache key. I'm not, so it can be simple and just depend on the poetry.lock. + - name: cache deps + id: cache-deps + uses: actions/cache@v4 + with: + path: .venv + key: pydeps-${{ hashFiles('**/poetry.lock') }} + + # Install dependencies. `--no-root` means "install all dependencies but not the project + # itself", which is what you want to avoid caching _your_ code. The `if` statement + # ensures this only runs on a cache miss. + - run: poetry install --no-interaction --no-root + if: steps.cache-deps.outputs.cache-hit != 'true' + + # Now install _your_ project. This isn't necessary for many types of projects -- particularly + # things like Django apps don't need this. But it's a good idea since it fully-exercises the + # pyproject.toml and makes that if you add things like console-scripts at some point that + # they'll be installed and working. + - run: poetry install --no-interaction + + # And finally run tests. I'm using pytest and all my pytest config is in my `pyproject.toml` + # so this line is super-simple. But it could be as complex as you need. + - run: | + git config --global user.name "${GITHUB_ACTOR}" + git config --global user.email "${GITHUB_ACTOR_ID}+${GITHUB_ACTOR}@users.noreply.github.com" + poetry run pytest + diff --git a/.lib/git-fleximod/.pre-commit-config.yaml b/.lib/git-fleximod/.pre-commit-config.yaml new file mode 100644 index 0000000000..2f6089da72 --- /dev/null +++ b/.lib/git-fleximod/.pre-commit-config.yaml @@ -0,0 +1,18 @@ +exclude: ^utils/.*$ + +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.0.1 + hooks: + - id: end-of-file-fixer + - id: trailing-whitespace + - repo: https://github.com/psf/black + rev: 22.3.0 + hooks: + - id: black + - repo: https://github.com/PyCQA/pylint + rev: v2.11.1 + hooks: + - id: pylint + args: + - --disable=I,C,R,logging-not-lazy,wildcard-import,unused-wildcard-import,fixme,broad-except,bare-except,eval-used,exec-used,global-statement,logging-format-interpolation,no-name-in-module,arguments-renamed,unspecified-encoding,protected-access,import-error,no-member diff --git a/.lib/git-fleximod/License b/.lib/git-fleximod/License new file mode 100644 index 0000000000..2c6fe768c2 --- /dev/null +++ b/.lib/git-fleximod/License @@ -0,0 +1,20 @@ +Copyright 2024 National Center for Atmospheric Sciences (NCAR) + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +“Software”), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/.lib/git-fleximod/README.md b/.lib/git-fleximod/README.md new file mode 100644 index 0000000000..d1ef632f28 --- /dev/null +++ b/.lib/git-fleximod/README.md @@ -0,0 +1,110 @@ +# git-fleximod + +Flexible, Enhanced Submodule Management for Git + +## Overview + +Git-fleximod is a Python-based tool that extends Git's submodule and sparse checkout capabilities, offering additional features for managing submodules in a more flexible and efficient way. + +## Installation + +#TODO Install using pip: +# pip install git-fleximod + If you choose to locate git-fleximod in your path you can access it via command: git fleximod + +## Usage + + Basic Usage: + git fleximod [options] + Available Commands: + status: Display the status of submodules. + update: Update submodules to the tag indicated in .gitmodules variable fxtag. + test: Make sure that fxtags and submodule hashes are consistant, + make sure that official urls (as defined by fxDONOTUSEurl) are set + make sure that fxtags are defined for all submodules + Additional Options: + See git fleximod --help for more details. + +## Supported .gitmodules Variables + + fxtag: Specify a specific tag or branch to checkout for a submodule. + fxrequired: Mark a submodule's checkout behavior, with allowed values: + - ToplevelRequired: Top-level and required (checked out only when this is the Toplevel module). + - ToplevelOptional: Top-level and optional (checked out with --optional flag if this is the Toplevel module). + - AlwaysRequired: Always required (always checked out). + - AlwaysOptional: Always optional (checked out with --optional flag). + fxsparse: Enable sparse checkout for a submodule, pointing to a file containing sparse checkout paths. + fxDONOTUSEurl: This is the url used in the test subcommand to assure that protected branches do not point to forks + **NOTE** the fxDONOTUSEurl variable is only used to identify the official project repository and should not be + changed by users. Use the url variable to change to a fork if desired. + +## Sparse Checkouts + + To enable sparse checkout for a submodule, set the fxsparse variable + in the .gitmodules file to the path of a file containing the desired + sparse checkout paths. Git-fleximod will automatically configure + sparse checkout based on this file when applicable commands are run. + See [git-sparse-checkout](https://git-scm.com/docs/git-sparse-checkout#_internalsfull_pattern_set) + for details on the format of this file. + +## Tests + + The git fleximod test action is designed to be used by, for example, github workflows + to assure that protected branches are consistant with respect to submodule hashes and fleximod fxtags + +## Examples + +Here are some common usage examples: + +Update all submodules, including optional ones: +```bash + git fleximod update --optional +``` + +Updating a specific submodule to the fxtag indicated in .gitmodules: + +```bash + git fleximod update submodule-name +``` +Example .gitmodules entry: +```ini, toml + [submodule "cosp2"] + path = src/physics/cosp2/src + url = https://github.com/CFMIP/COSPv2.0 + fxsparse = ../.cosp_sparse_checkout + fxrequired = AlwaysRequired + fxtag = v2.1.4cesm +``` +Explanation: + +This entry indicates that the submodule named cosp2 at tag v2.1.4cesm +should be checked out into the directory src/physics/cosp2/src +relative to the .gitmodules directory. It should be checked out from +the URL https://github.com/CFMIP/COSPv2.0 and use sparse checkout as +described in the file ../.cosp_sparse_checkout relative to the path +directory. It should be checked out anytime this .gitmodules entry is +read. + +Additional example: +```ini, toml + [submodule "cime"] + path = cime + url = https://github.com/jedwards4b/cime + fxrequired = ToplevelRequired + fxtag = cime6.0.198_rme01 +``` + +Explanation: + +This entry indicates that the submodule cime should be checked out +into a directory named cime at tag cime6.0.198_rme01 from the URL +https://github.com/jedwards4b/cime. This should only be done if +the .gitmodules file is at the top level of the repository clone. + +## Contributing + +We welcome contributions! Please see the CONTRIBUTING.md file for guidelines. + +## License + +Git-fleximod is released under the MIT License. diff --git a/.lib/git-fleximod/doc/Makefile b/.lib/git-fleximod/doc/Makefile new file mode 100644 index 0000000000..d4bb2cbb9e --- /dev/null +++ b/.lib/git-fleximod/doc/Makefile @@ -0,0 +1,20 @@ +# Minimal makefile for Sphinx documentation +# + +# You can set these variables from the command line, and also +# from the environment for the first two. +SPHINXOPTS ?= +SPHINXBUILD ?= sphinx-build +SOURCEDIR = . +BUILDDIR = _build + +# Put it first so that "make" without argument is like "make help". +help: + @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) + +.PHONY: help Makefile + +# Catch-all target: route all unknown targets to Sphinx using the new +# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). +%: Makefile + @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) diff --git a/.lib/git-fleximod/doc/conf.py b/.lib/git-fleximod/doc/conf.py new file mode 100644 index 0000000000..423099eec9 --- /dev/null +++ b/.lib/git-fleximod/doc/conf.py @@ -0,0 +1,26 @@ +# Configuration file for the Sphinx documentation builder. +# +# For the full list of built-in configuration values, see the documentation: +# https://www.sphinx-doc.org/en/master/usage/configuration.html + +# -- Project information ----------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information + +project = "git-fleximod" +author = "Jim Edwards " +release = "0.4.0" + +# -- General configuration --------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration + +extensions = ["sphinx_argparse_cli"] + +templates_path = ["_templates"] +exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"] + + +# -- Options for HTML output ------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output + +html_theme = "alabaster" +html_static_path = ["_static"] diff --git a/.lib/git-fleximod/doc/index.rst b/.lib/git-fleximod/doc/index.rst new file mode 100644 index 0000000000..0f9c1a7f7e --- /dev/null +++ b/.lib/git-fleximod/doc/index.rst @@ -0,0 +1,24 @@ +.. git-fleximod documentation master file, created by + sphinx-quickstart on Sat Feb 3 12:02:22 2024. + You can adapt this file completely to your liking, but it should at least + contain the root `toctree` directive. + +Welcome to git-fleximod's documentation! +======================================== + +.. toctree:: + :maxdepth: 2 + :caption: Contents: +.. module:: sphinxcontrib.autoprogram +.. sphinx_argparse_cli:: + :module: git_fleximod.cli + :func: get_parser + :prog: git-fleximod + + +Indices and tables +================== + +* :ref:`genindex` +* :ref:`modindex` +* :ref:`search` diff --git a/.lib/git-fleximod/doc/make.bat b/.lib/git-fleximod/doc/make.bat new file mode 100644 index 0000000000..32bb24529f --- /dev/null +++ b/.lib/git-fleximod/doc/make.bat @@ -0,0 +1,35 @@ +@ECHO OFF + +pushd %~dp0 + +REM Command file for Sphinx documentation + +if "%SPHINXBUILD%" == "" ( + set SPHINXBUILD=sphinx-build +) +set SOURCEDIR=. +set BUILDDIR=_build + +%SPHINXBUILD% >NUL 2>NUL +if errorlevel 9009 ( + echo. + echo.The 'sphinx-build' command was not found. Make sure you have Sphinx + echo.installed, then set the SPHINXBUILD environment variable to point + echo.to the full path of the 'sphinx-build' executable. Alternatively you + echo.may add the Sphinx directory to PATH. + echo. + echo.If you don't have Sphinx installed, grab it from + echo.https://www.sphinx-doc.org/ + exit /b 1 +) + +if "%1" == "" goto help + +%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% +goto end + +:help +%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% + +:end +popd diff --git a/.lib/git-fleximod/escomp_install b/.lib/git-fleximod/escomp_install new file mode 100644 index 0000000000..ae782e72a4 --- /dev/null +++ b/.lib/git-fleximod/escomp_install @@ -0,0 +1,25 @@ +#!/usr/bin/env python +# updates git-fleximod in an ESCOMP model +# this script should be run from the model root directory, it expects +# git-fleximod to already be installed with the script in bin +# and the classes in lib/python/site-packages +import sys +import shutil +import os + +from glob import iglob + +fleximod_root = sys.argv[1] +fleximod_path = os.path.join(fleximod_root,"src","git-fleximod") +if os.path.isfile(fleximod_path): + with open(fleximod_path,"r") as f: + fleximod = f.readlines() + with open(os.path.join(".","bin","git-fleximod"),"w") as f: + for line in fleximod: + f.write(line) + if "import argparse" in line: + f.write('\nsys.path.append(os.path.join(os.path.dirname(__file__),"..","lib","python","site-packages"))\n\n') + + for file in iglob(os.path.join(fleximod_root, "src", "fleximod", "*.py")): + shutil.copy(file, + os.path.join("lib","python","site-packages","fleximod",os.path.basename(file))) diff --git a/.lib/git-fleximod/git_fleximod/__init__.py b/.lib/git-fleximod/git_fleximod/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/.lib/git-fleximod/git_fleximod/cli.py b/.lib/git-fleximod/git_fleximod/cli.py new file mode 100644 index 0000000000..1fb959dad0 --- /dev/null +++ b/.lib/git-fleximod/git_fleximod/cli.py @@ -0,0 +1,119 @@ +from pathlib import Path +import argparse + +__version__ = "0.7.4" + +def find_root_dir(filename=".git"): + d = Path.cwd() + root = Path(d.root) + while d != root: + attempt = d / filename + if attempt.is_dir(): + return attempt + d = d.parent + return None + + +def get_parser(): + description = """ + %(prog)s manages checking out groups of gitsubmodules with addtional support for Earth System Models + """ + parser = argparse.ArgumentParser( + description=description, formatter_class=argparse.RawDescriptionHelpFormatter + ) + + # + # user options + # + choices = ["update", "status", "test"] + parser.add_argument( + "action", + choices=choices, + default="update", + help=f"Subcommand of git-fleximod, choices are {choices[:-1]}", + ) + + parser.add_argument( + "components", + nargs="*", + help="Specific component(s) to checkout. By default, " + "all required submodules are checked out.", + ) + + parser.add_argument( + "-C", + "--path", + default=find_root_dir(), + help="Toplevel repository directory. Defaults to top git directory relative to current.", + ) + + parser.add_argument( + "-g", + "--gitmodules", + nargs="?", + default=".gitmodules", + help="The submodule description filename. " "Default: %(default)s.", + ) + + parser.add_argument( + "-x", + "--exclude", + nargs="*", + help="Component(s) listed in the gitmodules file which should be ignored.", + ) + parser.add_argument( + "-f", + "--force", + action="store_true", + default=False, + help="Override cautions and update or checkout over locally modified repository.", + ) + + parser.add_argument( + "-o", + "--optional", + action="store_true", + default=False, + help="By default only the required submodules " + "are checked out. This flag will also checkout the " + "optional submodules relative to the toplevel directory.", + ) + + parser.add_argument( + "-v", + "--verbose", + action="count", + default=0, + help="Output additional information to " + "the screen and log file. This flag can be " + "used up to two times, increasing the " + "verbosity level each time.", + ) + + parser.add_argument( + "-V", + "--version", + action="version", + version=f"%(prog)s {__version__}", + help="Print version and exit.", + ) + + # + # developer options + # + parser.add_argument( + "--backtrace", + action="store_true", + help="DEVELOPER: show exception backtraces as extra " "debugging output", + ) + + parser.add_argument( + "-d", + "--debug", + action="store_true", + default=False, + help="DEVELOPER: output additional debugging " + "information to the screen and log file.", + ) + + return parser diff --git a/.lib/git-fleximod/git_fleximod/git_fleximod.py b/.lib/git-fleximod/git_fleximod/git_fleximod.py new file mode 100755 index 0000000000..103cc82a50 --- /dev/null +++ b/.lib/git-fleximod/git_fleximod/git_fleximod.py @@ -0,0 +1,601 @@ +#!/usr/bin/env python +import sys + +MIN_PYTHON = (3, 7) +if sys.version_info < MIN_PYTHON: + sys.exit("Python %s.%s or later is required." % MIN_PYTHON) + +import os +import shutil +import logging +import textwrap +from git_fleximod import utils +from git_fleximod import cli +from git_fleximod.gitinterface import GitInterface +from git_fleximod.gitmodules import GitModules +from configparser import NoOptionError + +# logger variable is global +logger = None + + +def fxrequired_allowed_values(): + return ["ToplevelRequired", "ToplevelOptional", "AlwaysRequired", "AlwaysOptional"] + + +def commandline_arguments(args=None): + parser = cli.get_parser() + + if args: + options = parser.parse_args(args) + else: + options = parser.parse_args() + + # explicitly listing a component overrides the optional flag + if options.optional or options.components: + fxrequired = [ + "ToplevelRequired", + "ToplevelOptional", + "AlwaysRequired", + "AlwaysOptional", + ] + else: + fxrequired = ["ToplevelRequired", "AlwaysRequired"] + + action = options.action + if not action: + action = "update" + handlers = [logging.StreamHandler()] + + if options.debug: + try: + open("fleximod.log", "w") + except PermissionError: + sys.exit("ABORT: Could not write file fleximod.log") + level = logging.DEBUG + handlers.append(logging.FileHandler("fleximod.log")) + elif options.verbose: + level = logging.INFO + else: + level = logging.WARNING + # Configure the root logger + logging.basicConfig( + level=level, format="%(name)s - %(levelname)s - %(message)s", handlers=handlers + ) + + if hasattr(options, "version"): + exit() + + return ( + options.path, + options.gitmodules, + fxrequired, + options.components, + options.exclude, + options.force, + action, + ) + + +def submodule_sparse_checkout(root_dir, name, url, path, sparsefile, tag="master"): + """ + This function performs a sparse checkout of a git submodule. It does so by first creating the .git/info/sparse-checkout fileq + in the submodule and then checking out the desired tag. If the submodule is already checked out, it will not be checked out again. + Creating the sparse-checkout file first prevents the entire submodule from being checked out and then removed. This is important + because the submodule may have a large number of files and checking out the entire submodule and then removing it would be time + and disk space consuming. + + Parameters: + root_dir (str): The root directory for the git operation. + name (str): The name of the submodule. + url (str): The URL of the submodule. + path (str): The path to the submodule. + sparsefile (str): The sparse file for the submodule. + tag (str, optional): The tag to checkout. Defaults to "master". + + Returns: + None + """ + logger.info("Called sparse_checkout for {}".format(name)) + rgit = GitInterface(root_dir, logger) + superroot = rgit.git_operation("rev-parse", "--show-superproject-working-tree") + if superroot: + gitroot = superroot.strip() + else: + gitroot = root_dir.strip() + assert os.path.isdir(os.path.join(gitroot, ".git")) + # first create the module directory + if not os.path.isdir(os.path.join(root_dir, path)): + os.makedirs(os.path.join(root_dir, path)) + + # initialize a new git repo and set the sparse checkout flag + sprep_repo = os.path.join(root_dir, path) + sprepo_git = GitInterface(sprep_repo, logger) + if os.path.exists(os.path.join(sprep_repo, ".git")): + try: + logger.info("Submodule {} found".format(name)) + chk = sprepo_git.config_get_value("core", "sparseCheckout") + if chk == "true": + logger.info("Sparse submodule {} already checked out".format(name)) + return + except NoOptionError: + logger.debug("Sparse submodule {} not present".format(name)) + except Exception as e: + utils.fatal_error("Unexpected error {} occured.".format(e)) + + sprepo_git.config_set_value("core", "sparseCheckout", "true") + + # set the repository remote + + logger.info("Setting remote origin in {}/{}".format(root_dir, path)) + status = sprepo_git.git_operation("remote", "-v") + if url not in status: + sprepo_git.git_operation("remote", "add", "origin", url) + + topgit = os.path.join(gitroot, ".git") + + if gitroot != root_dir and os.path.isfile(os.path.join(root_dir, ".git")): + with open(os.path.join(root_dir, ".git")) as f: + gitpath = os.path.relpath( + os.path.join(root_dir, f.read().split()[1]), + start=os.path.join(root_dir, path), + ) + topgit = os.path.join(gitpath, "modules") + else: + topgit = os.path.relpath( + os.path.join(root_dir, ".git", "modules"), + start=os.path.join(root_dir, path), + ) + + with utils.pushd(sprep_repo): + if not os.path.isdir(topgit): + os.makedirs(topgit) + topgit += os.sep + name + + if os.path.isdir(os.path.join(root_dir, path, ".git")): + with utils.pushd(sprep_repo): + shutil.move(".git", topgit) + with open(".git", "w") as f: + f.write("gitdir: " + os.path.relpath(topgit)) + # assert(os.path.isdir(os.path.relpath(topgit, start=sprep_repo))) + gitsparse = os.path.abspath(os.path.join(topgit, "info", "sparse-checkout")) + if os.path.isfile(gitsparse): + logger.warning( + "submodule {} is already initialized {}".format(name, topgit) + ) + return + + with utils.pushd(sprep_repo): + shutil.copy(sparsefile, gitsparse) + + # Finally checkout the repo + sprepo_git.git_operation("fetch", "origin", "--tags") + sprepo_git.git_operation("checkout", tag) + + print(f"Successfully checked out {name:>20} at {tag}") + rgit.config_set_value(f'submodule "{name}"', "active", "true") + rgit.config_set_value(f'submodule "{name}"', "url", url) + + +def single_submodule_checkout( + root, name, path, url=None, tag=None, force=False, optional=False +): + """ + This function checks out a single git submodule. + + Parameters: + root (str): The root directory for the git operation. + name (str): The name of the submodule. + path (str): The path to the submodule. + url (str, optional): The URL of the submodule. Defaults to None. + tag (str, optional): The tag to checkout. Defaults to None. + force (bool, optional): If set to True, forces the checkout operation. Defaults to False. + optional (bool, optional): If set to True, the submodule is considered optional. Defaults to False. + + Returns: + None + """ + # function implementation... + git = GitInterface(root, logger) + repodir = os.path.join(root, path) + logger.info("Checkout {} into {}/{}".format(name, root, path)) + # if url is provided update to the new url + tmpurl = None + repo_exists = False + if os.path.exists(os.path.join(repodir, ".git")): + logger.info("Submodule {} already checked out".format(name)) + repo_exists = True + # Look for a .gitmodules file in the newly checkedout repo + if not repo_exists and url: + # ssh urls cause problems for those who dont have git accounts with ssh keys defined + # but cime has one since e3sm prefers ssh to https, because the .gitmodules file was + # opened with a GitModules object we don't need to worry about restoring the file here + # it will be done by the GitModules class + if url.startswith("git@"): + tmpurl = url + url = url.replace("git@github.com:", "https://github.com/") + git.git_operation("clone", url, path) + smgit = GitInterface(repodir, logger) + if not tag: + tag = smgit.git_operation("describe", "--tags", "--always").rstrip() + smgit.git_operation("checkout", tag) + # Now need to move the .git dir to the submodule location + rootdotgit = os.path.join(root, ".git") + if os.path.isfile(rootdotgit): + with open(rootdotgit) as f: + line = f.readline() + if line.startswith("gitdir: "): + rootdotgit = line[8:].rstrip() + + newpath = os.path.abspath(os.path.join(root, rootdotgit, "modules", name)) + if os.path.exists(newpath): + shutil.rmtree(os.path.join(repodir, ".git")) + else: + shutil.move(os.path.join(repodir, ".git"), newpath) + + with open(os.path.join(repodir, ".git"), "w") as f: + f.write("gitdir: " + os.path.relpath(newpath, start=repodir)) + + if not os.path.exists(repodir): + parent = os.path.dirname(repodir) + if not os.path.isdir(parent): + os.makedirs(parent) + git.git_operation("submodule", "add", "--name", name, "--", url, path) + + if not repo_exists or not tmpurl: + git.git_operation("submodule", "update", "--init", "--", path) + + if os.path.exists(os.path.join(repodir, ".gitmodules")): + # recursively handle this checkout + print(f"Recursively checking out submodules of {name}") + gitmodules = GitModules(logger, confpath=repodir) + requiredlist = ["AlwaysRequired"] + if optional: + requiredlist.append("AlwaysOptional") + submodules_checkout(gitmodules, repodir, requiredlist, force=force) + if not os.path.exists(os.path.join(repodir, ".git")): + utils.fatal_error( + f"Failed to checkout {name} {repo_exists} {tmpurl} {repodir} {path}" + ) + + if tmpurl: + print(git.git_operation("restore", ".gitmodules")) + + return + + +def submodules_status(gitmodules, root_dir, toplevel=False): + testfails = 0 + localmods = 0 + needsupdate = 0 + for name in gitmodules.sections(): + path = gitmodules.get(name, "path") + tag = gitmodules.get(name, "fxtag") + required = gitmodules.get(name, "fxrequired") + level = required and "Toplevel" in required + if not path: + utils.fatal_error("No path found in .gitmodules for {}".format(name)) + newpath = os.path.join(root_dir, path) + logger.debug("newpath is {}".format(newpath)) + if not os.path.exists(os.path.join(newpath, ".git")): + rootgit = GitInterface(root_dir, logger) + # submodule commands use path, not name + url = gitmodules.get(name, "url") + url = url.replace("git@github.com:", "https://github.com/") + tags = rootgit.git_operation("ls-remote", "--tags", url) + atag = None + needsupdate += 1 + if not toplevel and level: + continue + for htag in tags.split("\n"): + if tag and tag in htag: + atag = (htag.split()[1])[10:] + break + if tag and tag == atag: + print(f"e {name:>20} not checked out, aligned at tag {tag}") + elif tag: + ahash = rootgit.git_operation( + "submodule", "status", "{}".format(path) + ).rstrip() + ahash = ahash[1 : len(tag) + 1] + if tag == ahash: + print(f"e {name:>20} not checked out, aligned at hash {ahash}") + else: + print( + f"e {name:>20} not checked out, out of sync at tag {atag}, expected tag is {tag}" + ) + testfails += 1 + else: + print(f"e {name:>20} has no fxtag defined in .gitmodules") + testfails += 1 + else: + with utils.pushd(newpath): + git = GitInterface(newpath, logger) + atag = git.git_operation("describe", "--tags", "--always").rstrip() + ahash = git.git_operation("status").partition("\n")[0].split()[-1] + if tag and atag == tag: + print(f" {name:>20} at tag {tag}") + elif tag and ahash[: len(tag)] == tag: + print(f" {name:>20} at hash {ahash}") + elif atag == ahash: + print(f" {name:>20} at hash {ahash}") + elif tag: + print( + f"s {name:>20} {atag} {ahash} is out of sync with .gitmodules {tag}" + ) + testfails += 1 + needsupdate += 1 + else: + print( + f"e {name:>20} has no fxtag defined in .gitmodules, module at {atag}" + ) + testfails += 1 + + status = git.git_operation("status", "--ignore-submodules") + if "nothing to commit" not in status: + localmods = localmods + 1 + print("M" + textwrap.indent(status, " ")) + + return testfails, localmods, needsupdate + + +def submodules_update(gitmodules, root_dir, requiredlist, force): + _, localmods, needsupdate = submodules_status(gitmodules, root_dir) + + if localmods and not force: + local_mods_output() + return + if needsupdate == 0: + return + + for name in gitmodules.sections(): + fxtag = gitmodules.get(name, "fxtag") + path = gitmodules.get(name, "path") + url = gitmodules.get(name, "url") + logger.info( + "name={} path={} url={} fxtag={} requiredlist={}".format( + name, os.path.join(root_dir, path), url, fxtag, requiredlist + ) + ) + # if not os.path.exists(os.path.join(root_dir,path, ".git")): + fxrequired = gitmodules.get(name, "fxrequired") + assert fxrequired in fxrequired_allowed_values() + rgit = GitInterface(root_dir, logger) + superroot = rgit.git_operation("rev-parse", "--show-superproject-working-tree") + + fxsparse = gitmodules.get(name, "fxsparse") + + if ( + fxrequired + and (superroot and "Toplevel" in fxrequired) + or fxrequired not in requiredlist + ): + if "ToplevelOptional" == fxrequired: + print("Skipping optional component {}".format(name)) + continue + if fxsparse: + logger.debug( + "Callng submodule_sparse_checkout({}, {}, {}, {}, {}, {}".format( + root_dir, name, url, path, fxsparse, fxtag + ) + ) + submodule_sparse_checkout(root_dir, name, url, path, fxsparse, tag=fxtag) + else: + logger.info( + "Calling submodule_checkout({},{},{},{})".format( + root_dir, name, path, url + ) + ) + + single_submodule_checkout( + root_dir, + name, + path, + url=url, + tag=fxtag, + force=force, + optional=("AlwaysOptional" in requiredlist), + ) + + if os.path.exists(os.path.join(path, ".git")): + submoddir = os.path.join(root_dir, path) + with utils.pushd(submoddir): + git = GitInterface(submoddir, logger) + # first make sure the url is correct + upstream = git.git_operation("ls-remote", "--get-url").rstrip() + newremote = "origin" + if upstream != url: + # TODO - this needs to be a unique name + remotes = git.git_operation("remote", "-v") + if url in remotes: + for line in remotes: + if url in line and "fetch" in line: + newremote = line.split()[0] + break + else: + i = 0 + while newremote in remotes: + i = i + 1 + newremote = f"newremote.{i:02d}" + git.git_operation("remote", "add", newremote, url) + + tags = git.git_operation("tag", "-l") + if fxtag and fxtag not in tags: + git.git_operation("fetch", newremote, "--tags") + atag = git.git_operation("describe", "--tags", "--always").rstrip() + if fxtag and fxtag != atag: + try: + git.git_operation("checkout", fxtag) + print(f"{name:>20} updated to {fxtag}") + except Exception as error: + print(error) + elif not fxtag: + print(f"No fxtag found for submodule {name:>20}") + else: + print(f"{name:>20} up to date.") + + +def local_mods_output(): + text = """\ + The submodules labeled with 'M' above are not in a clean state. + The following are options for how to proceed: + (1) Go into each submodule which is not in a clean state and issue a 'git status' + Either revert or commit your changes so that the submodule is in a clean state. + (2) use the --force option to git-fleximod + (3) you can name the particular submodules to update using the git-fleximod command line + (4) As a last resort you can remove the submodule (via 'rm -fr [directory]') + then rerun git-fleximod update. +""" + print(text) + + +# checkout is done by update if required so this function may be depricated +def submodules_checkout(gitmodules, root_dir, requiredlist, force=False): + """ + This function checks out all git submodules based on the provided parameters. + + Parameters: + gitmodules (ConfigParser): The gitmodules configuration. + root_dir (str): The root directory for the git operation. + requiredlist (list): The list of required modules. + force (bool, optional): If set to True, forces the checkout operation. Defaults to False. + + Returns: + None + """ + # function implementation... + print("") + _, localmods, needsupdate = submodules_status(gitmodules, root_dir) + if localmods and not force: + local_mods_output() + return + if not needsupdate: + return + for name in gitmodules.sections(): + fxrequired = gitmodules.get(name, "fxrequired") + fxsparse = gitmodules.get(name, "fxsparse") + fxtag = gitmodules.get(name, "fxtag") + path = gitmodules.get(name, "path") + url = gitmodules.get(name, "url") + if fxrequired and fxrequired not in requiredlist: + if "Optional" in fxrequired: + print("Skipping optional component {}".format(name)) + continue + + if fxsparse: + logger.debug( + "Callng submodule_sparse_checkout({}, {}, {}, {}, {}, {}".format( + root_dir, name, url, path, fxsparse, fxtag + ) + ) + submodule_sparse_checkout(root_dir, name, url, path, fxsparse, tag=fxtag) + else: + logger.debug( + "Calling submodule_checkout({},{},{})".format(root_dir, name, path) + ) + single_submodule_checkout( + root_dir, + name, + path, + url=url, + tag=fxtag, + force=force, + optional="AlwaysOptional" in requiredlist, + ) + + +def submodules_test(gitmodules, root_dir): + """ + This function tests the git submodules based on the provided parameters. + + It first checks that fxtags are present and in sync with submodule hashes. + Then it ensures that urls are consistent with fxurls (not forks and not ssh) + and that sparse checkout files exist. + + Parameters: + gitmodules (ConfigParser): The gitmodules configuration. + root_dir (str): The root directory for the git operation. + + Returns: + int: The number of test failures. + """ + # First check that fxtags are present and in sync with submodule hashes + testfails, localmods, needsupdate = submodules_status(gitmodules, root_dir) + print("") + # Then make sure that urls are consistant with fxurls (not forks and not ssh) + # and that sparse checkout files exist + for name in gitmodules.sections(): + url = gitmodules.get(name, "url") + fxurl = gitmodules.get(name, "fxDONOTMODIFYurl") + fxsparse = gitmodules.get(name, "fxsparse") + path = gitmodules.get(name, "path") + fxurl = fxurl[:-4] if fxurl.endswith(".git") else fxurl + url = url[:-4] if url.endswith(".git") else url + if not fxurl or url.lower() != fxurl.lower(): + print(f"{name:>20} url {url} not in sync with required {fxurl}") + testfails += 1 + if fxsparse and not os.path.isfile(os.path.join(root_dir, path, fxsparse)): + print(f"{name:>20} sparse checkout file {fxsparse} not found") + testfails += 1 + return testfails + localmods + needsupdate + + +def main(): + ( + root_dir, + file_name, + fxrequired, + includelist, + excludelist, + force, + action, + ) = commandline_arguments() + # Get a logger for the package + global logger + logger = logging.getLogger(__name__) + + logger.info("action is {}".format(action)) + + if not os.path.isfile(os.path.join(root_dir, file_name)): + file_path = utils.find_upwards(root_dir, file_name) + + if file_path is None: + utils.fatal_error( + "No {} found in {} or any of it's parents".format(file_name, root_dir) + ) + + root_dir = os.path.dirname(file_path) + logger.info( + "root_dir is {} includelist={} excludelist={}".format( + root_dir, includelist, excludelist + ) + ) + gitmodules = GitModules( + logger, + confpath=root_dir, + conffile=file_name, + includelist=includelist, + excludelist=excludelist, + ) + if not gitmodules.sections(): + sys.exit("No submodule components found") + retval = 0 + if action == "update": + submodules_update(gitmodules, root_dir, fxrequired, force) + elif action == "status": + tfails, lmods, updates = submodules_status(gitmodules, root_dir, toplevel=True) + if tfails + lmods + updates > 0: + print( + f" testfails = {tfails}, local mods = {lmods}, needs updates {updates}\n" + ) + if lmods > 0: + local_mods_output() + elif action == "test": + retval = submodules_test(gitmodules, root_dir) + else: + utils.fatal_error(f"unrecognized action request {action}") + return retval + + +if __name__ == "__main__": + sys.exit(main()) diff --git a/.lib/git-fleximod/git_fleximod/gitinterface.py b/.lib/git-fleximod/git_fleximod/gitinterface.py new file mode 100644 index 0000000000..93ae38ecde --- /dev/null +++ b/.lib/git-fleximod/git_fleximod/gitinterface.py @@ -0,0 +1,79 @@ +import os +import sys +from . import utils +from pathlib import Path + +class GitInterface: + def __init__(self, repo_path, logger): + logger.debug("Initialize GitInterface for {}".format(repo_path)) + if isinstance(repo_path, str): + self.repo_path = Path(repo_path).resolve() + elif isinstance(repo_path, Path): + self.repo_path = repo_path.resolve() + else: + raise TypeError("repo_path must be a str or Path object") + self.logger = logger + try: + import git + + self._use_module = True + try: + self.repo = git.Repo(str(self.repo_path)) # Initialize GitPython repo + except git.exc.InvalidGitRepositoryError: + self.git = git + self._init_git_repo() + msg = "Using GitPython interface to git" + except ImportError: + self._use_module = False + if not (self.repo_path / ".git").exists(): + self._init_git_repo() + msg = "Using shell interface to git" + self.logger.info(msg) + + def _git_command(self, operation, *args): + self.logger.info(operation) + if self._use_module and operation != "submodule": + try: + return getattr(self.repo.git, operation)(*args) + except Exception as e: + sys.exit(e) + else: + return ["git", "-C", str(self.repo_path), operation] + list(args) + + def _init_git_repo(self): + if self._use_module: + self.repo = self.git.Repo.init(str(self.repo_path)) + else: + command = ("git", "-C", str(self.repo_path), "init") + utils.execute_subprocess(command) + + # pylint: disable=unused-argument + def git_operation(self, operation, *args, **kwargs): + command = self._git_command(operation, *args) + self.logger.info(command) + if isinstance(command, list): + try: + return utils.execute_subprocess(command, output_to_caller=True) + except Exception as e: + sys.exit(e) + else: + return command + + def config_get_value(self, section, name): + if self._use_module: + config = self.repo.config_reader() + return config.get_value(section, name) + else: + cmd = ("git", "-C", str(self.repo_path), "config", "--get", f"{section}.{name}") + output = utils.execute_subprocess(cmd, output_to_caller=True) + return output.strip() + + def config_set_value(self, section, name, value): + if self._use_module: + with self.repo.config_writer() as writer: + writer.set_value(section, name, value) + writer.release() # Ensure changes are saved + else: + cmd = ("git", "-C", str(self.repo_path), "config", f"{section}.{name}", value) + self.logger.info(cmd) + utils.execute_subprocess(cmd, output_to_caller=True) diff --git a/.lib/git-fleximod/git_fleximod/gitmodules.py b/.lib/git-fleximod/git_fleximod/gitmodules.py new file mode 100644 index 0000000000..68c82d066f --- /dev/null +++ b/.lib/git-fleximod/git_fleximod/gitmodules.py @@ -0,0 +1,97 @@ +import shutil +from pathlib import Path +from configparser import RawConfigParser, ConfigParser +from .lstripreader import LstripReader + + +class GitModules(RawConfigParser): + def __init__( + self, + logger, + confpath=Path.cwd(), + conffile=".gitmodules", + includelist=None, + excludelist=None, + ): + """ + confpath: Path to the directory containing the .gitmodules file (defaults to the current working directory). + conffile: Name of the configuration file (defaults to .gitmodules). + includelist: Optional list of submodules to include. + excludelist: Optional list of submodules to exclude. + """ + self.logger = logger + self.logger.debug( + "Creating a GitModules object {} {} {} {}".format( + confpath, conffile, includelist, excludelist + ) + ) + super().__init__() + self.conf_file = (Path(confpath) / Path(conffile)) + if self.conf_file.exists(): + self.read_file(LstripReader(str(self.conf_file)), source=conffile) + self.includelist = includelist + self.excludelist = excludelist + self.isdirty = False + + def reload(self): + self.clear() + if self.conf_file.exists(): + self.read_file(LstripReader(str(self.conf_file)), source=self.conf_file) + + + def set(self, name, option, value): + """ + Sets a configuration value for a specific submodule: + Ensures the appropriate section exists for the submodule. + Calls the parent class's set method to store the value. + """ + self.isdirty = True + self.logger.debug("set called {} {} {}".format(name, option, value)) + section = f'submodule "{name}"' + if not self.has_section(section): + self.add_section(section) + super().set(section, option, str(value)) + + # pylint: disable=redefined-builtin, arguments-differ + def get(self, name, option, raw=False, vars=None, fallback=None): + """ + Retrieves a configuration value for a specific submodule: + Uses the parent class's get method to access the value. + Handles potential errors if the section or option doesn't exist. + """ + self.logger.debug("get called {} {}".format(name, option)) + section = f'submodule "{name}"' + try: + return ConfigParser.get( + self, section, option, raw=raw, vars=vars, fallback=fallback + ) + except ConfigParser.NoOptionError: + return None + + def save(self): + if self.isdirty: + self.logger.info("Writing {}".format(self.conf_file)) + with open(self.conf_file, "w") as fd: + self.write(fd) + self.isdirty = False + + def __del__(self): + self.save() + + def sections(self): + """Strip the submodule part out of section and just use the name""" + self.logger.debug("calling GitModules sections iterator") + names = [] + for section in ConfigParser.sections(self): + name = section[11:-1] + if self.includelist and name not in self.includelist: + continue + if self.excludelist and name in self.excludelist: + continue + names.append(name) + return names + + def items(self, name, raw=False, vars=None): + self.logger.debug("calling GitModules items for {}".format(name)) + section = f'submodule "{name}"' + return ConfigParser.items(section, raw=raw, vars=vars) diff --git a/.lib/git-fleximod/git_fleximod/lstripreader.py b/.lib/git-fleximod/git_fleximod/lstripreader.py new file mode 100644 index 0000000000..01d5580ee8 --- /dev/null +++ b/.lib/git-fleximod/git_fleximod/lstripreader.py @@ -0,0 +1,43 @@ +class LstripReader(object): + "LstripReader formats .gitmodules files to be acceptable for configparser" + + def __init__(self, filename): + with open(filename, "r") as infile: + lines = infile.readlines() + self._lines = list() + self._num_lines = len(lines) + self._index = 0 + for line in lines: + self._lines.append(line.lstrip()) + + def readlines(self): + """Return all the lines from this object's file""" + return self._lines + + def readline(self, size=-1): + """Format and return the next line or raise StopIteration""" + try: + line = self.next() + except StopIteration: + line = "" + + if (size > 0) and (len(line) < size): + return line[0:size] + + return line + + def __iter__(self): + """Begin an iteration""" + self._index = 0 + return self + + def next(self): + """Return the next line or raise StopIteration""" + if self._index >= self._num_lines: + raise StopIteration + + self._index = self._index + 1 + return self._lines[self._index - 1] + + def __next__(self): + return self.next() diff --git a/.lib/git-fleximod/git_fleximod/metoflexi.py b/.lib/git-fleximod/git_fleximod/metoflexi.py new file mode 100755 index 0000000000..cc347db2dd --- /dev/null +++ b/.lib/git-fleximod/git_fleximod/metoflexi.py @@ -0,0 +1,236 @@ +#!/usr/bin/env python +from configparser import ConfigParser +import sys +import shutil +from pathlib import Path +import argparse +import logging +from git_fleximod.gitinterface import GitInterface +from git_fleximod.gitmodules import GitModules +from git_fleximod import utils + +logger = None + +def find_root_dir(filename=".git"): + d = Path.cwd() + root = Path(d.root) + while d != root: + attempt = d / filename + if attempt.is_dir(): + return d + d = d.parent + return None + + +def get_parser(): + description = """ + %(prog)s manages checking out groups of gitsubmodules with addtional support for Earth System Models + """ + parser = argparse.ArgumentParser( + description=description, formatter_class=argparse.RawDescriptionHelpFormatter + ) + + parser.add_argument('-e', '--externals', nargs='?', + default='Externals.cfg', + help='The externals description filename. ' + 'Default: %(default)s.') + + parser.add_argument( + "-C", + "--path", + default=find_root_dir(), + help="Toplevel repository directory. Defaults to top git directory relative to current.", + ) + + parser.add_argument( + "-g", + "--gitmodules", + nargs="?", + default=".gitmodules", + help="The submodule description filename. " "Default: %(default)s.", + ) + parser.add_argument( + "-v", + "--verbose", + action="count", + default=0, + help="Output additional information to " + "the screen and log file. This flag can be " + "used up to two times, increasing the " + "verbosity level each time.", + ) + parser.add_argument( + "-d", + "--debug", + action="store_true", + default=False, + help="DEVELOPER: output additional debugging " + "information to the screen and log file.", + ) + + return parser + +def commandline_arguments(args=None): + parser = get_parser() + + options = parser.parse_args(args) + handlers = [logging.StreamHandler()] + + if options.debug: + try: + open("fleximod.log", "w") + except PermissionError: + sys.exit("ABORT: Could not write file fleximod.log") + level = logging.DEBUG + handlers.append(logging.FileHandler("fleximod.log")) + elif options.verbose: + level = logging.INFO + else: + level = logging.WARNING + # Configure the root logger + logging.basicConfig( + level=level, format="%(name)s - %(levelname)s - %(message)s", handlers=handlers + ) + + return( + options.path, + options.gitmodules, + options.externals + ) + +class ExternalRepoTranslator: + """ + Translates external repositories configured in an INI-style externals file. + """ + + def __init__(self, rootpath, gitmodules, externals): + self.rootpath = rootpath + if gitmodules: + self.gitmodules = GitModules(logger, confpath=rootpath) + self.externals = (rootpath / Path(externals)).resolve() + print(f"Translating {self.externals}") + self.git = GitInterface(rootpath, logger) + +# def __del__(self): +# if (self.rootpath / "save.gitignore"): + + + def translate_single_repo(self, section, tag, url, path, efile, hash_, sparse, protocol): + """ + Translates a single repository based on configuration details. + + Args: + rootpath (str): Root path of the main repository. + gitmodules (str): Path to the .gitmodules file. + tag (str): The tag to use for the external repository. + url (str): The URL of the external repository. + path (str): The relative path within the main repository for the external repository. + efile (str): The external file or file containing submodules. + hash_ (str): The commit hash to checkout (if applicable). + sparse (str): Boolean indicating whether to use sparse checkout (if applicable). + protocol (str): The protocol to use (e.g., 'git', 'http'). + """ + assert protocol != "svn", "SVN protocol is not currently supported" + print(f"Translating repository {section}") + if efile: + file_path = Path(path) / Path(efile) + newroot = (self.rootpath / file_path).parent.resolve() + if not newroot.exists(): + newroot.mkdir(parents=True) + logger.info("Newroot is {}".format(newroot)) + newt = ExternalRepoTranslator(newroot, ".gitmodules", efile) + newt.translate_repo() + if protocol == "externals_only": + if tag: + self.gitmodules.set(section, "fxtag", tag) + if hash_: + self.gitmodules.set(section, "fxtag", hash_) + + self.gitmodules.set(section, "fxDONOTUSEurl", url) + if sparse: + self.gitmodules.set(section, "fxsparse", sparse) + self.gitmodules.set(section, "fxrequired", "ToplevelRequired") + else: + newpath = (self.rootpath / Path(path)) + if newpath.exists(): + shutil.rmtree(newpath) + logger.info("Creating directory {}".format(newpath)) + newpath.mkdir(parents=True) + if tag: + logger.info("cloning {}".format(section)) + try: + self.git.git_operation("clone", "-b", tag, "--depth", "1", url, path) + except: + self.git.git_operation("clone", url, path) + with utils.pushd(newpath): + ngit = GitInterface(newpath, logger) + ngit.git_operation("checkout", tag) + if hash_: + self.git.git_operation("clone", url, path) + git = GitInterface(newpath, logger) + git.git_operation("fetch", "origin") + git.git_operation("checkout", hash_) + if sparse: + print("setting as sparse submodule {}".format(section)) + sparsefile = (newpath / Path(sparse)) + newfile = (newpath / ".git" / "info" / "sparse-checkout") + print(f"sparsefile {sparsefile} newfile {newfile}") + shutil.copy(sparsefile, newfile) + + logger.info("adding submodule {}".format(section)) + self.gitmodules.save() + self.git.git_operation("submodule", "add", "-f", "--name", section, url, path) + self.git.git_operation("submodule","absorbgitdirs") + self.gitmodules.reload() + if tag: + self.gitmodules.set(section, "fxtag", tag) + if hash_: + self.gitmodules.set(section, "fxtag", hash_) + + self.gitmodules.set(section, "fxDONOTUSEurl", url) + if sparse: + self.gitmodules.set(section, "fxsparse", sparse) + self.gitmodules.set(section, "fxrequired", "ToplevelRequired") + + + def translate_repo(self): + """ + Translates external repositories defined within an external file. + + Args: + rootpath (str): Root path of the main repository. + gitmodules (str): Path to the .gitmodules file. + external_file (str): The path to the external file containing repository definitions. + """ + econfig = ConfigParser() + econfig.read((self.rootpath / Path(self.externals))) + + for section in econfig.sections(): + if section == "externals_description": + logger.info("skipping section {}".format(section)) + return + logger.info("Translating section {}".format(section)) + tag = econfig.get(section, "tag", raw=False, fallback=None) + url = econfig.get(section, "repo_url", raw=False, fallback=None) + path = econfig.get(section, "local_path", raw=False, fallback=None) + efile = econfig.get(section, "externals", raw=False, fallback=None) + hash_ = econfig.get(section, "hash", raw=False, fallback=None) + sparse = econfig.get(section, "sparse", raw=False, fallback=None) + protocol = econfig.get(section, "protocol", raw=False, fallback=None) + + self.translate_single_repo(section, tag, url, path, efile, hash_, sparse, protocol) + + + +def _main(): + rootpath, gitmodules, externals = commandline_arguments() + global logger + logger = logging.getLogger(__name__) + with utils.pushd(rootpath): + t = ExternalRepoTranslator(Path(rootpath), gitmodules, externals) + logger.info("Translating {}".format(rootpath)) + t.translate_repo() + + +if __name__ == "__main__": + sys.exit(_main()) diff --git a/.lib/git-fleximod/git_fleximod/utils.py b/.lib/git-fleximod/git_fleximod/utils.py new file mode 100644 index 0000000000..7cc1de38cc --- /dev/null +++ b/.lib/git-fleximod/git_fleximod/utils.py @@ -0,0 +1,365 @@ +#!/usr/bin/env python3 +""" +Common public utilities for manic package + +""" + +import logging +import os +import subprocess +import sys +from threading import Timer +from pathlib import Path + +LOCAL_PATH_INDICATOR = "." +# --------------------------------------------------------------------- +# +# functions to massage text for output and other useful utilities +# +# --------------------------------------------------------------------- +from contextlib import contextmanager + + +@contextmanager +def pushd(new_dir): + """context for chdir. usage: with pushd(new_dir)""" + previous_dir = os.getcwd() + os.chdir(new_dir) + try: + yield + finally: + os.chdir(previous_dir) + + +def log_process_output(output): + """Log each line of process output at debug level so it can be + filtered if necessary. By default, output is a single string, and + logging.debug(output) will only put log info heading on the first + line. This makes it hard to filter with grep. + + """ + output = output.split("\n") + for line in output: + logging.debug(line) + + +def printlog(msg, **kwargs): + """Wrapper script around print to ensure that everything printed to + the screen also gets logged. + + """ + logging.info(msg) + if kwargs: + print(msg, **kwargs) + else: + print(msg) + sys.stdout.flush() + + +def find_upwards(root_dir, filename): + """Find a file in root dir or any of it's parents""" + d = Path(root_dir) + root = Path(d.root) + while d != root: + attempt = d / filename + if attempt.exists(): + return attempt + d = d.parent + return None + + +def last_n_lines(the_string, n_lines, truncation_message=None): + """Returns the last n lines of the given string + + Args: + the_string: str + n_lines: int + truncation_message: str, optional + + Returns a string containing the last n lines of the_string + + If truncation_message is provided, the returned string begins with + the given message if and only if the string is greater than n lines + to begin with. + """ + + lines = the_string.splitlines(True) + if len(lines) <= n_lines: + return_val = the_string + else: + lines_subset = lines[-n_lines:] + str_truncated = "".join(lines_subset) + if truncation_message: + str_truncated = truncation_message + "\n" + str_truncated + return_val = str_truncated + + return return_val + + +def indent_string(the_string, indent_level): + """Indents the given string by a given number of spaces + + Args: + the_string: str + indent_level: int + + Returns a new string that is the same as the_string, except that + each line is indented by 'indent_level' spaces. + + In python3, this can be done with textwrap.indent. + """ + + lines = the_string.splitlines(True) + padding = " " * indent_level + lines_indented = [padding + line for line in lines] + return "".join(lines_indented) + + +# --------------------------------------------------------------------- +# +# error handling +# +# --------------------------------------------------------------------- + + +def fatal_error(message): + """ + Error output function + """ + logging.error(message) + raise RuntimeError("{0}ERROR: {1}".format(os.linesep, message)) + + +# --------------------------------------------------------------------- +# +# Data conversion / manipulation +# +# --------------------------------------------------------------------- +def str_to_bool(bool_str): + """Convert a sting representation of as boolean into a true boolean. + + Conversion should be case insensitive. + """ + value = None + str_lower = bool_str.lower() + if str_lower in ("true", "t"): + value = True + elif str_lower in ("false", "f"): + value = False + if value is None: + msg = ( + 'ERROR: invalid boolean string value "{0}". ' + 'Must be "true" or "false"'.format(bool_str) + ) + fatal_error(msg) + return value + + +REMOTE_PREFIXES = ["http://", "https://", "ssh://", "git@"] + + +def is_remote_url(url): + """check if the user provided a local file path instead of a + remote. If so, it must be expanded to an absolute + path. + + """ + remote_url = False + for prefix in REMOTE_PREFIXES: + if url.startswith(prefix): + remote_url = True + return remote_url + + +def split_remote_url(url): + """check if the user provided a local file path or a + remote. If remote, try to strip off protocol info. + + """ + remote_url = is_remote_url(url) + if not remote_url: + return url + + for prefix in REMOTE_PREFIXES: + url = url.replace(prefix, "") + + if "@" in url: + url = url.split("@")[1] + + if ":" in url: + url = url.split(":")[1] + + return url + + +def expand_local_url(url, field): + """check if the user provided a local file path instead of a + remote. If so, it must be expanded to an absolute + path. + + Note: local paths of LOCAL_PATH_INDICATOR have special meaning and + represent local copy only, don't work with the remotes. + + """ + remote_url = is_remote_url(url) + if not remote_url: + if url.strip() == LOCAL_PATH_INDICATOR: + pass + else: + url = os.path.expandvars(url) + url = os.path.expanduser(url) + if not os.path.isabs(url): + msg = ( + 'WARNING: Externals description for "{0}" contains a ' + "url that is not remote and does not expand to an " + "absolute path. Version control operations may " + "fail.\n\nurl={1}".format(field, url) + ) + printlog(msg) + else: + url = os.path.normpath(url) + return url + + +# --------------------------------------------------------------------- +# +# subprocess +# +# --------------------------------------------------------------------- + +# Give the user a helpful message if we detect that a command seems to +# be hanging. +_HANGING_SEC = 300 + + +def _hanging_msg(working_directory, command): + print( + """ + +Command '{command}' +from directory {working_directory} +has taken {hanging_sec} seconds. It may be hanging. + +The command will continue to run, but you may want to abort +manage_externals with ^C and investigate. A possible cause of hangs is +when svn or git require authentication to access a private +repository. On some systems, svn and git requests for authentication +information will not be displayed to the user. In this case, the program +will appear to hang. Ensure you can run svn and git manually and access +all repositories without entering your authentication information. + +""".format( + command=command, + working_directory=working_directory, + hanging_sec=_HANGING_SEC, + ) + ) + + +def execute_subprocess(commands, status_to_caller=False, output_to_caller=False): + """Wrapper around subprocess.check_output to handle common + exceptions. + + check_output runs a command with arguments and waits + for it to complete. + + check_output raises an exception on a nonzero return code. if + status_to_caller is true, execute_subprocess returns the subprocess + return code, otherwise execute_subprocess treats non-zero return + status as an error and raises an exception. + + """ + cwd = os.getcwd() + msg = "In directory: {0}\nexecute_subprocess running command:".format(cwd) + logging.info(msg) + commands_str = " ".join(str(element) for element in commands) + logging.info(commands_str) + return_to_caller = status_to_caller or output_to_caller + status = -1 + output = "" + hanging_timer = Timer( + _HANGING_SEC, + _hanging_msg, + kwargs={"working_directory": cwd, "command": commands_str}, + ) + hanging_timer.start() + try: + output = subprocess.check_output( + commands, stderr=subprocess.STDOUT, universal_newlines=True + ) + log_process_output(output) + status = 0 + except OSError as error: + msg = failed_command_msg( + "Command execution failed. Does the executable exist?", commands + ) + logging.error(error) + fatal_error(msg) + except ValueError as error: + msg = failed_command_msg( + "DEV_ERROR: Invalid arguments trying to run subprocess", commands + ) + logging.error(error) + fatal_error(msg) + except subprocess.CalledProcessError as error: + # Only report the error if we are NOT returning to the + # caller. If we are returning to the caller, then it may be a + # simple status check. If returning, it is the callers + # responsibility determine if an error occurred and handle it + # appropriately. + if not return_to_caller: + msg_context = ( + "Process did not run successfully; " + "returned status {0}".format(error.returncode) + ) + msg = failed_command_msg(msg_context, commands, output=error.output) + logging.error(error) + logging.error(msg) + log_process_output(error.output) + fatal_error(msg) + status = error.returncode + finally: + hanging_timer.cancel() + + if status_to_caller and output_to_caller: + ret_value = (status, output) + elif status_to_caller: + ret_value = status + elif output_to_caller: + ret_value = output + else: + ret_value = None + + return ret_value + + +def failed_command_msg(msg_context, command, output=None): + """Template for consistent error messages from subprocess calls. + + If 'output' is given, it should provide the output from the failed + command + """ + + if output: + output_truncated = last_n_lines( + output, 20, truncation_message="[... Output truncated for brevity ...]" + ) + errmsg = ( + "Failed with output:\n" + indent_string(output_truncated, 4) + "\nERROR: " + ) + else: + errmsg = "" + + command_str = " ".join(command) + errmsg += """In directory + {cwd} +{context}: + {command} +""".format( + cwd=os.getcwd(), context=msg_context, command=command_str + ) + + if output: + errmsg += "See above for output from failed command.\n" + + return errmsg diff --git a/.lib/git-fleximod/poetry.lock b/.lib/git-fleximod/poetry.lock new file mode 100644 index 0000000000..b59ed3942c --- /dev/null +++ b/.lib/git-fleximod/poetry.lock @@ -0,0 +1,693 @@ +# This file is automatically @generated by Poetry 1.7.1 and should not be changed by hand. + +[[package]] +name = "alabaster" +version = "0.7.13" +description = "A configurable sidebar-enabled Sphinx theme" +optional = false +python-versions = ">=3.6" +files = [ + {file = "alabaster-0.7.13-py3-none-any.whl", hash = "sha256:1ee19aca801bbabb5ba3f5f258e4422dfa86f82f3e9cefb0859b283cdd7f62a3"}, + {file = "alabaster-0.7.13.tar.gz", hash = "sha256:a27a4a084d5e690e16e01e03ad2b2e552c61a65469419b907243193de1a84ae2"}, +] + +[[package]] +name = "babel" +version = "2.14.0" +description = "Internationalization utilities" +optional = false +python-versions = ">=3.7" +files = [ + {file = "Babel-2.14.0-py3-none-any.whl", hash = "sha256:efb1a25b7118e67ce3a259bed20545c29cb68be8ad2c784c83689981b7a57287"}, + {file = "Babel-2.14.0.tar.gz", hash = "sha256:6919867db036398ba21eb5c7a0f6b28ab8cbc3ae7a73a44ebe34ae74a4e7d363"}, +] + +[package.dependencies] +pytz = {version = ">=2015.7", markers = "python_version < \"3.9\""} + +[package.extras] +dev = ["freezegun (>=1.0,<2.0)", "pytest (>=6.0)", "pytest-cov"] + +[[package]] +name = "certifi" +version = "2024.2.2" +description = "Python package for providing Mozilla's CA Bundle." +optional = false +python-versions = ">=3.6" +files = [ + {file = "certifi-2024.2.2-py3-none-any.whl", hash = "sha256:dc383c07b76109f368f6106eee2b593b04a011ea4d55f652c6ca24a754d1cdd1"}, + {file = "certifi-2024.2.2.tar.gz", hash = "sha256:0569859f95fc761b18b45ef421b1290a0f65f147e92a1e5eb3e635f9a5e4e66f"}, +] + +[[package]] +name = "charset-normalizer" +version = "3.3.2" +description = "The Real First Universal Charset Detector. Open, modern and actively maintained alternative to Chardet." +optional = false +python-versions = ">=3.7.0" +files = [ + {file = "charset-normalizer-3.3.2.tar.gz", hash = "sha256:f30c3cb33b24454a82faecaf01b19c18562b1e89558fb6c56de4d9118a032fd5"}, + {file = "charset_normalizer-3.3.2-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:25baf083bf6f6b341f4121c2f3c548875ee6f5339300e08be3f2b2ba1721cdd3"}, + {file = "charset_normalizer-3.3.2-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:06435b539f889b1f6f4ac1758871aae42dc3a8c0e24ac9e60c2384973ad73027"}, + {file = "charset_normalizer-3.3.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:9063e24fdb1e498ab71cb7419e24622516c4a04476b17a2dab57e8baa30d6e03"}, + {file = "charset_normalizer-3.3.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6897af51655e3691ff853668779c7bad41579facacf5fd7253b0133308cf000d"}, + {file = "charset_normalizer-3.3.2-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:1d3193f4a680c64b4b6a9115943538edb896edc190f0b222e73761716519268e"}, + {file = "charset_normalizer-3.3.2-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:cd70574b12bb8a4d2aaa0094515df2463cb429d8536cfb6c7ce983246983e5a6"}, + {file = "charset_normalizer-3.3.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8465322196c8b4d7ab6d1e049e4c5cb460d0394da4a27d23cc242fbf0034b6b5"}, + {file = "charset_normalizer-3.3.2-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:a9a8e9031d613fd2009c182b69c7b2c1ef8239a0efb1df3f7c8da66d5dd3d537"}, + {file = "charset_normalizer-3.3.2-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:beb58fe5cdb101e3a055192ac291b7a21e3b7ef4f67fa1d74e331a7f2124341c"}, + {file = "charset_normalizer-3.3.2-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:e06ed3eb3218bc64786f7db41917d4e686cc4856944f53d5bdf83a6884432e12"}, + {file = "charset_normalizer-3.3.2-cp310-cp310-musllinux_1_1_ppc64le.whl", hash = "sha256:2e81c7b9c8979ce92ed306c249d46894776a909505d8f5a4ba55b14206e3222f"}, + {file = "charset_normalizer-3.3.2-cp310-cp310-musllinux_1_1_s390x.whl", hash = "sha256:572c3763a264ba47b3cf708a44ce965d98555f618ca42c926a9c1616d8f34269"}, + {file = "charset_normalizer-3.3.2-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:fd1abc0d89e30cc4e02e4064dc67fcc51bd941eb395c502aac3ec19fab46b519"}, + {file = "charset_normalizer-3.3.2-cp310-cp310-win32.whl", hash = "sha256:3d47fa203a7bd9c5b6cee4736ee84ca03b8ef23193c0d1ca99b5089f72645c73"}, + {file = "charset_normalizer-3.3.2-cp310-cp310-win_amd64.whl", hash = "sha256:10955842570876604d404661fbccbc9c7e684caf432c09c715ec38fbae45ae09"}, + {file = "charset_normalizer-3.3.2-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:802fe99cca7457642125a8a88a084cef28ff0cf9407060f7b93dca5aa25480db"}, + {file = "charset_normalizer-3.3.2-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:573f6eac48f4769d667c4442081b1794f52919e7edada77495aaed9236d13a96"}, + {file = "charset_normalizer-3.3.2-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:549a3a73da901d5bc3ce8d24e0600d1fa85524c10287f6004fbab87672bf3e1e"}, + {file = "charset_normalizer-3.3.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f27273b60488abe721a075bcca6d7f3964f9f6f067c8c4c605743023d7d3944f"}, + {file = "charset_normalizer-3.3.2-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:1ceae2f17a9c33cb48e3263960dc5fc8005351ee19db217e9b1bb15d28c02574"}, + {file = "charset_normalizer-3.3.2-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:65f6f63034100ead094b8744b3b97965785388f308a64cf8d7c34f2f2e5be0c4"}, + {file = "charset_normalizer-3.3.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:753f10e867343b4511128c6ed8c82f7bec3bd026875576dfd88483c5c73b2fd8"}, + {file = "charset_normalizer-3.3.2-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:4a78b2b446bd7c934f5dcedc588903fb2f5eec172f3d29e52a9096a43722adfc"}, + {file = "charset_normalizer-3.3.2-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:e537484df0d8f426ce2afb2d0f8e1c3d0b114b83f8850e5f2fbea0e797bd82ae"}, + {file = "charset_normalizer-3.3.2-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:eb6904c354526e758fda7167b33005998fb68c46fbc10e013ca97f21ca5c8887"}, + {file = "charset_normalizer-3.3.2-cp311-cp311-musllinux_1_1_ppc64le.whl", hash = "sha256:deb6be0ac38ece9ba87dea880e438f25ca3eddfac8b002a2ec3d9183a454e8ae"}, + {file = "charset_normalizer-3.3.2-cp311-cp311-musllinux_1_1_s390x.whl", hash = "sha256:4ab2fe47fae9e0f9dee8c04187ce5d09f48eabe611be8259444906793ab7cbce"}, + {file = "charset_normalizer-3.3.2-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:80402cd6ee291dcb72644d6eac93785fe2c8b9cb30893c1af5b8fdd753b9d40f"}, + {file = "charset_normalizer-3.3.2-cp311-cp311-win32.whl", hash = "sha256:7cd13a2e3ddeed6913a65e66e94b51d80a041145a026c27e6bb76c31a853c6ab"}, + {file = "charset_normalizer-3.3.2-cp311-cp311-win_amd64.whl", hash = "sha256:663946639d296df6a2bb2aa51b60a2454ca1cb29835324c640dafb5ff2131a77"}, + {file = "charset_normalizer-3.3.2-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:0b2b64d2bb6d3fb9112bafa732def486049e63de9618b5843bcdd081d8144cd8"}, + {file = "charset_normalizer-3.3.2-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:ddbb2551d7e0102e7252db79ba445cdab71b26640817ab1e3e3648dad515003b"}, + {file = "charset_normalizer-3.3.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:55086ee1064215781fff39a1af09518bc9255b50d6333f2e4c74ca09fac6a8f6"}, + {file = "charset_normalizer-3.3.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8f4a014bc36d3c57402e2977dada34f9c12300af536839dc38c0beab8878f38a"}, + {file = "charset_normalizer-3.3.2-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:a10af20b82360ab00827f916a6058451b723b4e65030c5a18577c8b2de5b3389"}, + {file = "charset_normalizer-3.3.2-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:8d756e44e94489e49571086ef83b2bb8ce311e730092d2c34ca8f7d925cb20aa"}, + {file = "charset_normalizer-3.3.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:90d558489962fd4918143277a773316e56c72da56ec7aa3dc3dbbe20fdfed15b"}, + {file = "charset_normalizer-3.3.2-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:6ac7ffc7ad6d040517be39eb591cac5ff87416c2537df6ba3cba3bae290c0fed"}, + {file = "charset_normalizer-3.3.2-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:7ed9e526742851e8d5cc9e6cf41427dfc6068d4f5a3bb03659444b4cabf6bc26"}, + {file = "charset_normalizer-3.3.2-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:8bdb58ff7ba23002a4c5808d608e4e6c687175724f54a5dade5fa8c67b604e4d"}, + {file = "charset_normalizer-3.3.2-cp312-cp312-musllinux_1_1_ppc64le.whl", hash = "sha256:6b3251890fff30ee142c44144871185dbe13b11bab478a88887a639655be1068"}, + {file = "charset_normalizer-3.3.2-cp312-cp312-musllinux_1_1_s390x.whl", hash = "sha256:b4a23f61ce87adf89be746c8a8974fe1c823c891d8f86eb218bb957c924bb143"}, + {file = "charset_normalizer-3.3.2-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:efcb3f6676480691518c177e3b465bcddf57cea040302f9f4e6e191af91174d4"}, + {file = "charset_normalizer-3.3.2-cp312-cp312-win32.whl", hash = "sha256:d965bba47ddeec8cd560687584e88cf699fd28f192ceb452d1d7ee807c5597b7"}, + {file = "charset_normalizer-3.3.2-cp312-cp312-win_amd64.whl", hash = "sha256:96b02a3dc4381e5494fad39be677abcb5e6634bf7b4fa83a6dd3112607547001"}, + {file = "charset_normalizer-3.3.2-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:95f2a5796329323b8f0512e09dbb7a1860c46a39da62ecb2324f116fa8fdc85c"}, + {file = "charset_normalizer-3.3.2-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c002b4ffc0be611f0d9da932eb0f704fe2602a9a949d1f738e4c34c75b0863d5"}, + {file = "charset_normalizer-3.3.2-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:a981a536974bbc7a512cf44ed14938cf01030a99e9b3a06dd59578882f06f985"}, + {file = "charset_normalizer-3.3.2-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:3287761bc4ee9e33561a7e058c72ac0938c4f57fe49a09eae428fd88aafe7bb6"}, + {file = "charset_normalizer-3.3.2-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:42cb296636fcc8b0644486d15c12376cb9fa75443e00fb25de0b8602e64c1714"}, + {file = "charset_normalizer-3.3.2-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:0a55554a2fa0d408816b3b5cedf0045f4b8e1a6065aec45849de2d6f3f8e9786"}, + {file = "charset_normalizer-3.3.2-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:c083af607d2515612056a31f0a8d9e0fcb5876b7bfc0abad3ecd275bc4ebc2d5"}, + {file = "charset_normalizer-3.3.2-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:87d1351268731db79e0f8e745d92493ee2841c974128ef629dc518b937d9194c"}, + {file = "charset_normalizer-3.3.2-cp37-cp37m-musllinux_1_1_ppc64le.whl", hash = "sha256:bd8f7df7d12c2db9fab40bdd87a7c09b1530128315d047a086fa3ae3435cb3a8"}, + {file = "charset_normalizer-3.3.2-cp37-cp37m-musllinux_1_1_s390x.whl", hash = "sha256:c180f51afb394e165eafe4ac2936a14bee3eb10debc9d9e4db8958fe36afe711"}, + {file = "charset_normalizer-3.3.2-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:8c622a5fe39a48f78944a87d4fb8a53ee07344641b0562c540d840748571b811"}, + {file = "charset_normalizer-3.3.2-cp37-cp37m-win32.whl", hash = "sha256:db364eca23f876da6f9e16c9da0df51aa4f104a972735574842618b8c6d999d4"}, + {file = "charset_normalizer-3.3.2-cp37-cp37m-win_amd64.whl", hash = "sha256:86216b5cee4b06df986d214f664305142d9c76df9b6512be2738aa72a2048f99"}, + {file = "charset_normalizer-3.3.2-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:6463effa3186ea09411d50efc7d85360b38d5f09b870c48e4600f63af490e56a"}, + {file = "charset_normalizer-3.3.2-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:6c4caeef8fa63d06bd437cd4bdcf3ffefe6738fb1b25951440d80dc7df8c03ac"}, + {file = "charset_normalizer-3.3.2-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:37e55c8e51c236f95b033f6fb391d7d7970ba5fe7ff453dad675e88cf303377a"}, + {file = "charset_normalizer-3.3.2-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:fb69256e180cb6c8a894fee62b3afebae785babc1ee98b81cdf68bbca1987f33"}, + {file = "charset_normalizer-3.3.2-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ae5f4161f18c61806f411a13b0310bea87f987c7d2ecdbdaad0e94eb2e404238"}, + {file = "charset_normalizer-3.3.2-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:b2b0a0c0517616b6869869f8c581d4eb2dd83a4d79e0ebcb7d373ef9956aeb0a"}, + {file = "charset_normalizer-3.3.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:45485e01ff4d3630ec0d9617310448a8702f70e9c01906b0d0118bdf9d124cf2"}, + {file = "charset_normalizer-3.3.2-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:eb00ed941194665c332bf8e078baf037d6c35d7c4f3102ea2d4f16ca94a26dc8"}, + {file = "charset_normalizer-3.3.2-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:2127566c664442652f024c837091890cb1942c30937add288223dc895793f898"}, + {file = "charset_normalizer-3.3.2-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:a50aebfa173e157099939b17f18600f72f84eed3049e743b68ad15bd69b6bf99"}, + {file = "charset_normalizer-3.3.2-cp38-cp38-musllinux_1_1_ppc64le.whl", hash = "sha256:4d0d1650369165a14e14e1e47b372cfcb31d6ab44e6e33cb2d4e57265290044d"}, + {file = "charset_normalizer-3.3.2-cp38-cp38-musllinux_1_1_s390x.whl", hash = "sha256:923c0c831b7cfcb071580d3f46c4baf50f174be571576556269530f4bbd79d04"}, + {file = "charset_normalizer-3.3.2-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:06a81e93cd441c56a9b65d8e1d043daeb97a3d0856d177d5c90ba85acb3db087"}, + {file = "charset_normalizer-3.3.2-cp38-cp38-win32.whl", hash = "sha256:6ef1d82a3af9d3eecdba2321dc1b3c238245d890843e040e41e470ffa64c3e25"}, + {file = "charset_normalizer-3.3.2-cp38-cp38-win_amd64.whl", hash = "sha256:eb8821e09e916165e160797a6c17edda0679379a4be5c716c260e836e122f54b"}, + {file = "charset_normalizer-3.3.2-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:c235ebd9baae02f1b77bcea61bce332cb4331dc3617d254df3323aa01ab47bd4"}, + {file = "charset_normalizer-3.3.2-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:5b4c145409bef602a690e7cfad0a15a55c13320ff7a3ad7ca59c13bb8ba4d45d"}, + {file = "charset_normalizer-3.3.2-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:68d1f8a9e9e37c1223b656399be5d6b448dea850bed7d0f87a8311f1ff3dabb0"}, + {file = "charset_normalizer-3.3.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:22afcb9f253dac0696b5a4be4a1c0f8762f8239e21b99680099abd9b2b1b2269"}, + {file = "charset_normalizer-3.3.2-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:e27ad930a842b4c5eb8ac0016b0a54f5aebbe679340c26101df33424142c143c"}, + {file = "charset_normalizer-3.3.2-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:1f79682fbe303db92bc2b1136016a38a42e835d932bab5b3b1bfcfbf0640e519"}, + {file = "charset_normalizer-3.3.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b261ccdec7821281dade748d088bb6e9b69e6d15b30652b74cbbac25e280b796"}, + {file = "charset_normalizer-3.3.2-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:122c7fa62b130ed55f8f285bfd56d5f4b4a5b503609d181f9ad85e55c89f4185"}, + {file = "charset_normalizer-3.3.2-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:d0eccceffcb53201b5bfebb52600a5fb483a20b61da9dbc885f8b103cbe7598c"}, + {file = "charset_normalizer-3.3.2-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:9f96df6923e21816da7e0ad3fd47dd8f94b2a5ce594e00677c0013018b813458"}, + {file = "charset_normalizer-3.3.2-cp39-cp39-musllinux_1_1_ppc64le.whl", hash = "sha256:7f04c839ed0b6b98b1a7501a002144b76c18fb1c1850c8b98d458ac269e26ed2"}, + {file = "charset_normalizer-3.3.2-cp39-cp39-musllinux_1_1_s390x.whl", hash = "sha256:34d1c8da1e78d2e001f363791c98a272bb734000fcef47a491c1e3b0505657a8"}, + {file = "charset_normalizer-3.3.2-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:ff8fa367d09b717b2a17a052544193ad76cd49979c805768879cb63d9ca50561"}, + {file = "charset_normalizer-3.3.2-cp39-cp39-win32.whl", hash = "sha256:aed38f6e4fb3f5d6bf81bfa990a07806be9d83cf7bacef998ab1a9bd660a581f"}, + {file = "charset_normalizer-3.3.2-cp39-cp39-win_amd64.whl", hash = "sha256:b01b88d45a6fcb69667cd6d2f7a9aeb4bf53760d7fc536bf679ec94fe9f3ff3d"}, + {file = "charset_normalizer-3.3.2-py3-none-any.whl", hash = "sha256:3e4d1f6587322d2788836a99c69062fbb091331ec940e02d12d179c1d53e25fc"}, +] + +[[package]] +name = "colorama" +version = "0.4.6" +description = "Cross-platform colored terminal text." +optional = false +python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7" +files = [ + {file = "colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6"}, + {file = "colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44"}, +] + +[[package]] +name = "docutils" +version = "0.19" +description = "Docutils -- Python Documentation Utilities" +optional = false +python-versions = ">=3.7" +files = [ + {file = "docutils-0.19-py3-none-any.whl", hash = "sha256:5e1de4d849fee02c63b040a4a3fd567f4ab104defd8a5511fbbc24a8a017efbc"}, + {file = "docutils-0.19.tar.gz", hash = "sha256:33995a6753c30b7f577febfc2c50411fec6aac7f7ffeb7c4cfe5991072dcf9e6"}, +] + +[[package]] +name = "exceptiongroup" +version = "1.2.0" +description = "Backport of PEP 654 (exception groups)" +optional = false +python-versions = ">=3.7" +files = [ + {file = "exceptiongroup-1.2.0-py3-none-any.whl", hash = "sha256:4bfd3996ac73b41e9b9628b04e079f193850720ea5945fc96a08633c66912f14"}, + {file = "exceptiongroup-1.2.0.tar.gz", hash = "sha256:91f5c769735f051a4290d52edd0858999b57e5876e9f85937691bd4c9fa3ed68"}, +] + +[package.extras] +test = ["pytest (>=6)"] + +[[package]] +name = "fsspec" +version = "2023.12.2" +description = "File-system specification" +optional = false +python-versions = ">=3.8" +files = [ + {file = "fsspec-2023.12.2-py3-none-any.whl", hash = "sha256:d800d87f72189a745fa3d6b033b9dc4a34ad069f60ca60b943a63599f5501960"}, + {file = "fsspec-2023.12.2.tar.gz", hash = "sha256:8548d39e8810b59c38014934f6b31e57f40c1b20f911f4cc2b85389c7e9bf0cb"}, +] + +[package.extras] +abfs = ["adlfs"] +adl = ["adlfs"] +arrow = ["pyarrow (>=1)"] +dask = ["dask", "distributed"] +devel = ["pytest", "pytest-cov"] +dropbox = ["dropbox", "dropboxdrivefs", "requests"] +full = ["adlfs", "aiohttp (!=4.0.0a0,!=4.0.0a1)", "dask", "distributed", "dropbox", "dropboxdrivefs", "fusepy", "gcsfs", "libarchive-c", "ocifs", "panel", "paramiko", "pyarrow (>=1)", "pygit2", "requests", "s3fs", "smbprotocol", "tqdm"] +fuse = ["fusepy"] +gcs = ["gcsfs"] +git = ["pygit2"] +github = ["requests"] +gs = ["gcsfs"] +gui = ["panel"] +hdfs = ["pyarrow (>=1)"] +http = ["aiohttp (!=4.0.0a0,!=4.0.0a1)", "requests"] +libarchive = ["libarchive-c"] +oci = ["ocifs"] +s3 = ["s3fs"] +sftp = ["paramiko"] +smb = ["smbprotocol"] +ssh = ["paramiko"] +tqdm = ["tqdm"] + +[[package]] +name = "gitdb" +version = "4.0.11" +description = "Git Object Database" +optional = false +python-versions = ">=3.7" +files = [ + {file = "gitdb-4.0.11-py3-none-any.whl", hash = "sha256:81a3407ddd2ee8df444cbacea00e2d038e40150acfa3001696fe0dcf1d3adfa4"}, + {file = "gitdb-4.0.11.tar.gz", hash = "sha256:bf5421126136d6d0af55bc1e7c1af1c397a34f5b7bd79e776cd3e89785c2b04b"}, +] + +[package.dependencies] +smmap = ">=3.0.1,<6" + +[[package]] +name = "gitpython" +version = "3.1.41" +description = "GitPython is a Python library used to interact with Git repositories" +optional = false +python-versions = ">=3.7" +files = [ + {file = "GitPython-3.1.41-py3-none-any.whl", hash = "sha256:c36b6634d069b3f719610175020a9aed919421c87552185b085e04fbbdb10b7c"}, + {file = "GitPython-3.1.41.tar.gz", hash = "sha256:ed66e624884f76df22c8e16066d567aaa5a37d5b5fa19db2c6df6f7156db9048"}, +] + +[package.dependencies] +gitdb = ">=4.0.1,<5" + +[package.extras] +test = ["black", "coverage[toml]", "ddt (>=1.1.1,!=1.4.3)", "mock", "mypy", "pre-commit", "pytest (>=7.3.1)", "pytest-cov", "pytest-instafail", "pytest-mock", "pytest-sugar", "sumtypes"] + +[[package]] +name = "idna" +version = "3.6" +description = "Internationalized Domain Names in Applications (IDNA)" +optional = false +python-versions = ">=3.5" +files = [ + {file = "idna-3.6-py3-none-any.whl", hash = "sha256:c05567e9c24a6b9faaa835c4821bad0590fbb9d5779e7caa6e1cc4978e7eb24f"}, + {file = "idna-3.6.tar.gz", hash = "sha256:9ecdbbd083b06798ae1e86adcbfe8ab1479cf864e4ee30fe4e46a003d12491ca"}, +] + +[[package]] +name = "imagesize" +version = "1.4.1" +description = "Getting image size from png/jpeg/jpeg2000/gif file" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" +files = [ + {file = "imagesize-1.4.1-py2.py3-none-any.whl", hash = "sha256:0d8d18d08f840c19d0ee7ca1fd82490fdc3729b7ac93f49870406ddde8ef8d8b"}, + {file = "imagesize-1.4.1.tar.gz", hash = "sha256:69150444affb9cb0d5cc5a92b3676f0b2fb7cd9ae39e947a5e11a36b4497cd4a"}, +] + +[[package]] +name = "importlib-metadata" +version = "7.0.1" +description = "Read metadata from Python packages" +optional = false +python-versions = ">=3.8" +files = [ + {file = "importlib_metadata-7.0.1-py3-none-any.whl", hash = "sha256:4805911c3a4ec7c3966410053e9ec6a1fecd629117df5adee56dfc9432a1081e"}, + {file = "importlib_metadata-7.0.1.tar.gz", hash = "sha256:f238736bb06590ae52ac1fab06a3a9ef1d8dce2b7a35b5ab329371d6c8f5d2cc"}, +] + +[package.dependencies] +zipp = ">=0.5" + +[package.extras] +docs = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "rst.linker (>=1.9)", "sphinx (<7.2.5)", "sphinx (>=3.5)", "sphinx-lint"] +perf = ["ipython"] +testing = ["flufl.flake8", "importlib-resources (>=1.3)", "packaging", "pyfakefs", "pytest (>=6)", "pytest-black (>=0.3.7)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)", "pytest-mypy (>=0.9.1)", "pytest-perf (>=0.9.2)", "pytest-ruff"] + +[[package]] +name = "iniconfig" +version = "2.0.0" +description = "brain-dead simple config-ini parsing" +optional = false +python-versions = ">=3.7" +files = [ + {file = "iniconfig-2.0.0-py3-none-any.whl", hash = "sha256:b6a85871a79d2e3b22d2d1b94ac2824226a63c6b741c88f7ae975f18b6778374"}, + {file = "iniconfig-2.0.0.tar.gz", hash = "sha256:2d91e135bf72d31a410b17c16da610a82cb55f6b0477d1a902134b24a455b8b3"}, +] + +[[package]] +name = "jinja2" +version = "3.1.3" +description = "A very fast and expressive template engine." +optional = false +python-versions = ">=3.7" +files = [ + {file = "Jinja2-3.1.3-py3-none-any.whl", hash = "sha256:7d6d50dd97d52cbc355597bd845fabfbac3f551e1f99619e39a35ce8c370b5fa"}, + {file = "Jinja2-3.1.3.tar.gz", hash = "sha256:ac8bd6544d4bb2c9792bf3a159e80bba8fda7f07e81bc3aed565432d5925ba90"}, +] + +[package.dependencies] +MarkupSafe = ">=2.0" + +[package.extras] +i18n = ["Babel (>=2.7)"] + +[[package]] +name = "markupsafe" +version = "2.1.5" +description = "Safely add untrusted strings to HTML/XML markup." +optional = false +python-versions = ">=3.7" +files = [ + {file = "MarkupSafe-2.1.5-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:a17a92de5231666cfbe003f0e4b9b3a7ae3afb1ec2845aadc2bacc93ff85febc"}, + {file = "MarkupSafe-2.1.5-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:72b6be590cc35924b02c78ef34b467da4ba07e4e0f0454a2c5907f473fc50ce5"}, + {file = "MarkupSafe-2.1.5-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e61659ba32cf2cf1481e575d0462554625196a1f2fc06a1c777d3f48e8865d46"}, + {file = "MarkupSafe-2.1.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2174c595a0d73a3080ca3257b40096db99799265e1c27cc5a610743acd86d62f"}, + {file = "MarkupSafe-2.1.5-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ae2ad8ae6ebee9d2d94b17fb62763125f3f374c25618198f40cbb8b525411900"}, + {file = "MarkupSafe-2.1.5-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:075202fa5b72c86ad32dc7d0b56024ebdbcf2048c0ba09f1cde31bfdd57bcfff"}, + {file = "MarkupSafe-2.1.5-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:598e3276b64aff0e7b3451b72e94fa3c238d452e7ddcd893c3ab324717456bad"}, + {file = "MarkupSafe-2.1.5-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:fce659a462a1be54d2ffcacea5e3ba2d74daa74f30f5f143fe0c58636e355fdd"}, + {file = "MarkupSafe-2.1.5-cp310-cp310-win32.whl", hash = "sha256:d9fad5155d72433c921b782e58892377c44bd6252b5af2f67f16b194987338a4"}, + {file = "MarkupSafe-2.1.5-cp310-cp310-win_amd64.whl", hash = "sha256:bf50cd79a75d181c9181df03572cdce0fbb75cc353bc350712073108cba98de5"}, + {file = "MarkupSafe-2.1.5-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:629ddd2ca402ae6dbedfceeba9c46d5f7b2a61d9749597d4307f943ef198fc1f"}, + {file = "MarkupSafe-2.1.5-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:5b7b716f97b52c5a14bffdf688f971b2d5ef4029127f1ad7a513973cfd818df2"}, + {file = "MarkupSafe-2.1.5-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6ec585f69cec0aa07d945b20805be741395e28ac1627333b1c5b0105962ffced"}, + {file = "MarkupSafe-2.1.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b91c037585eba9095565a3556f611e3cbfaa42ca1e865f7b8015fe5c7336d5a5"}, + {file = "MarkupSafe-2.1.5-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:7502934a33b54030eaf1194c21c692a534196063db72176b0c4028e140f8f32c"}, + {file = "MarkupSafe-2.1.5-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:0e397ac966fdf721b2c528cf028494e86172b4feba51d65f81ffd65c63798f3f"}, + {file = "MarkupSafe-2.1.5-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:c061bb86a71b42465156a3ee7bd58c8c2ceacdbeb95d05a99893e08b8467359a"}, + {file = "MarkupSafe-2.1.5-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:3a57fdd7ce31c7ff06cdfbf31dafa96cc533c21e443d57f5b1ecc6cdc668ec7f"}, + {file = "MarkupSafe-2.1.5-cp311-cp311-win32.whl", hash = "sha256:397081c1a0bfb5124355710fe79478cdbeb39626492b15d399526ae53422b906"}, + {file = "MarkupSafe-2.1.5-cp311-cp311-win_amd64.whl", hash = "sha256:2b7c57a4dfc4f16f7142221afe5ba4e093e09e728ca65c51f5620c9aaeb9a617"}, + {file = "MarkupSafe-2.1.5-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:8dec4936e9c3100156f8a2dc89c4b88d5c435175ff03413b443469c7c8c5f4d1"}, + {file = "MarkupSafe-2.1.5-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:3c6b973f22eb18a789b1460b4b91bf04ae3f0c4234a0a6aa6b0a92f6f7b951d4"}, + {file = "MarkupSafe-2.1.5-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ac07bad82163452a6884fe8fa0963fb98c2346ba78d779ec06bd7a6262132aee"}, + {file = "MarkupSafe-2.1.5-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f5dfb42c4604dddc8e4305050aa6deb084540643ed5804d7455b5df8fe16f5e5"}, + {file = "MarkupSafe-2.1.5-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ea3d8a3d18833cf4304cd2fc9cbb1efe188ca9b5efef2bdac7adc20594a0e46b"}, + {file = "MarkupSafe-2.1.5-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:d050b3361367a06d752db6ead6e7edeb0009be66bc3bae0ee9d97fb326badc2a"}, + {file = "MarkupSafe-2.1.5-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:bec0a414d016ac1a18862a519e54b2fd0fc8bbfd6890376898a6c0891dd82e9f"}, + {file = "MarkupSafe-2.1.5-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:58c98fee265677f63a4385256a6d7683ab1832f3ddd1e66fe948d5880c21a169"}, + {file = "MarkupSafe-2.1.5-cp312-cp312-win32.whl", hash = "sha256:8590b4ae07a35970728874632fed7bd57b26b0102df2d2b233b6d9d82f6c62ad"}, + {file = "MarkupSafe-2.1.5-cp312-cp312-win_amd64.whl", hash = "sha256:823b65d8706e32ad2df51ed89496147a42a2a6e01c13cfb6ffb8b1e92bc910bb"}, + {file = "MarkupSafe-2.1.5-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:c8b29db45f8fe46ad280a7294f5c3ec36dbac9491f2d1c17345be8e69cc5928f"}, + {file = "MarkupSafe-2.1.5-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ec6a563cff360b50eed26f13adc43e61bc0c04d94b8be985e6fb24b81f6dcfdf"}, + {file = "MarkupSafe-2.1.5-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a549b9c31bec33820e885335b451286e2969a2d9e24879f83fe904a5ce59d70a"}, + {file = "MarkupSafe-2.1.5-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:4f11aa001c540f62c6166c7726f71f7573b52c68c31f014c25cc7901deea0b52"}, + {file = "MarkupSafe-2.1.5-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:7b2e5a267c855eea6b4283940daa6e88a285f5f2a67f2220203786dfa59b37e9"}, + {file = "MarkupSafe-2.1.5-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:2d2d793e36e230fd32babe143b04cec8a8b3eb8a3122d2aceb4a371e6b09b8df"}, + {file = "MarkupSafe-2.1.5-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:ce409136744f6521e39fd8e2a24c53fa18ad67aa5bc7c2cf83645cce5b5c4e50"}, + {file = "MarkupSafe-2.1.5-cp37-cp37m-win32.whl", hash = "sha256:4096e9de5c6fdf43fb4f04c26fb114f61ef0bf2e5604b6ee3019d51b69e8c371"}, + {file = "MarkupSafe-2.1.5-cp37-cp37m-win_amd64.whl", hash = "sha256:4275d846e41ecefa46e2015117a9f491e57a71ddd59bbead77e904dc02b1bed2"}, + {file = "MarkupSafe-2.1.5-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:656f7526c69fac7f600bd1f400991cc282b417d17539a1b228617081106feb4a"}, + {file = "MarkupSafe-2.1.5-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:97cafb1f3cbcd3fd2b6fbfb99ae11cdb14deea0736fc2b0952ee177f2b813a46"}, + {file = "MarkupSafe-2.1.5-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1f3fbcb7ef1f16e48246f704ab79d79da8a46891e2da03f8783a5b6fa41a9532"}, + {file = "MarkupSafe-2.1.5-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:fa9db3f79de01457b03d4f01b34cf91bc0048eb2c3846ff26f66687c2f6d16ab"}, + {file = "MarkupSafe-2.1.5-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ffee1f21e5ef0d712f9033568f8344d5da8cc2869dbd08d87c84656e6a2d2f68"}, + {file = "MarkupSafe-2.1.5-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:5dedb4db619ba5a2787a94d877bc8ffc0566f92a01c0ef214865e54ecc9ee5e0"}, + {file = "MarkupSafe-2.1.5-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:30b600cf0a7ac9234b2638fbc0fb6158ba5bdcdf46aeb631ead21248b9affbc4"}, + {file = "MarkupSafe-2.1.5-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:8dd717634f5a044f860435c1d8c16a270ddf0ef8588d4887037c5028b859b0c3"}, + {file = "MarkupSafe-2.1.5-cp38-cp38-win32.whl", hash = "sha256:daa4ee5a243f0f20d528d939d06670a298dd39b1ad5f8a72a4275124a7819eff"}, + {file = "MarkupSafe-2.1.5-cp38-cp38-win_amd64.whl", hash = "sha256:619bc166c4f2de5caa5a633b8b7326fbe98e0ccbfacabd87268a2b15ff73a029"}, + {file = "MarkupSafe-2.1.5-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:7a68b554d356a91cce1236aa7682dc01df0edba8d043fd1ce607c49dd3c1edcf"}, + {file = "MarkupSafe-2.1.5-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:db0b55e0f3cc0be60c1f19efdde9a637c32740486004f20d1cff53c3c0ece4d2"}, + {file = "MarkupSafe-2.1.5-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3e53af139f8579a6d5f7b76549125f0d94d7e630761a2111bc431fd820e163b8"}, + {file = "MarkupSafe-2.1.5-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:17b950fccb810b3293638215058e432159d2b71005c74371d784862b7e4683f3"}, + {file = "MarkupSafe-2.1.5-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:4c31f53cdae6ecfa91a77820e8b151dba54ab528ba65dfd235c80b086d68a465"}, + {file = "MarkupSafe-2.1.5-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:bff1b4290a66b490a2f4719358c0cdcd9bafb6b8f061e45c7a2460866bf50c2e"}, + {file = "MarkupSafe-2.1.5-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:bc1667f8b83f48511b94671e0e441401371dfd0f0a795c7daa4a3cd1dde55bea"}, + {file = "MarkupSafe-2.1.5-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:5049256f536511ee3f7e1b3f87d1d1209d327e818e6ae1365e8653d7e3abb6a6"}, + {file = "MarkupSafe-2.1.5-cp39-cp39-win32.whl", hash = "sha256:00e046b6dd71aa03a41079792f8473dc494d564611a8f89bbbd7cb93295ebdcf"}, + {file = "MarkupSafe-2.1.5-cp39-cp39-win_amd64.whl", hash = "sha256:fa173ec60341d6bb97a89f5ea19c85c5643c1e7dedebc22f5181eb73573142c5"}, + {file = "MarkupSafe-2.1.5.tar.gz", hash = "sha256:d283d37a890ba4c1ae73ffadf8046435c76e7bc2247bbb63c00bd1a709c6544b"}, +] + +[[package]] +name = "packaging" +version = "23.2" +description = "Core utilities for Python packages" +optional = false +python-versions = ">=3.7" +files = [ + {file = "packaging-23.2-py3-none-any.whl", hash = "sha256:8c491190033a9af7e1d931d0b5dacc2ef47509b34dd0de67ed209b5203fc88c7"}, + {file = "packaging-23.2.tar.gz", hash = "sha256:048fb0e9405036518eaaf48a55953c750c11e1a1b68e0dd1a9d62ed0c092cfc5"}, +] + +[[package]] +name = "pluggy" +version = "1.4.0" +description = "plugin and hook calling mechanisms for python" +optional = false +python-versions = ">=3.8" +files = [ + {file = "pluggy-1.4.0-py3-none-any.whl", hash = "sha256:7db9f7b503d67d1c5b95f59773ebb58a8c1c288129a88665838012cfb07b8981"}, + {file = "pluggy-1.4.0.tar.gz", hash = "sha256:8c85c2876142a764e5b7548e7d9a0e0ddb46f5185161049a79b7e974454223be"}, +] + +[package.extras] +dev = ["pre-commit", "tox"] +testing = ["pytest", "pytest-benchmark"] + +[[package]] +name = "pyfakefs" +version = "5.3.5" +description = "pyfakefs implements a fake file system that mocks the Python file system modules." +optional = false +python-versions = ">=3.7" +files = [ + {file = "pyfakefs-5.3.5-py3-none-any.whl", hash = "sha256:751015c1de94e1390128c82b48cdedc3f088bbdbe4bc713c79d02a27f0f61e69"}, + {file = "pyfakefs-5.3.5.tar.gz", hash = "sha256:7cdc500b35a214cb7a614e1940543acc6650e69a94ac76e30f33c9373bd9cf90"}, +] + +[[package]] +name = "pygments" +version = "2.17.2" +description = "Pygments is a syntax highlighting package written in Python." +optional = false +python-versions = ">=3.7" +files = [ + {file = "pygments-2.17.2-py3-none-any.whl", hash = "sha256:b27c2826c47d0f3219f29554824c30c5e8945175d888647acd804ddd04af846c"}, + {file = "pygments-2.17.2.tar.gz", hash = "sha256:da46cec9fd2de5be3a8a784f434e4c4ab670b4ff54d605c4c2717e9d49c4c367"}, +] + +[package.extras] +plugins = ["importlib-metadata"] +windows-terminal = ["colorama (>=0.4.6)"] + +[[package]] +name = "pytest" +version = "8.0.0" +description = "pytest: simple powerful testing with Python" +optional = false +python-versions = ">=3.8" +files = [ + {file = "pytest-8.0.0-py3-none-any.whl", hash = "sha256:50fb9cbe836c3f20f0dfa99c565201fb75dc54c8d76373cd1bde06b06657bdb6"}, + {file = "pytest-8.0.0.tar.gz", hash = "sha256:249b1b0864530ba251b7438274c4d251c58d868edaaec8762893ad4a0d71c36c"}, +] + +[package.dependencies] +colorama = {version = "*", markers = "sys_platform == \"win32\""} +exceptiongroup = {version = ">=1.0.0rc8", markers = "python_version < \"3.11\""} +iniconfig = "*" +packaging = "*" +pluggy = ">=1.3.0,<2.0" +tomli = {version = ">=1.0.0", markers = "python_version < \"3.11\""} + +[package.extras] +testing = ["argcomplete", "attrs (>=19.2.0)", "hypothesis (>=3.56)", "mock", "nose", "pygments (>=2.7.2)", "requests", "setuptools", "xmlschema"] + +[[package]] +name = "pytz" +version = "2024.1" +description = "World timezone definitions, modern and historical" +optional = false +python-versions = "*" +files = [ + {file = "pytz-2024.1-py2.py3-none-any.whl", hash = "sha256:328171f4e3623139da4983451950b28e95ac706e13f3f2630a879749e7a8b319"}, + {file = "pytz-2024.1.tar.gz", hash = "sha256:2a29735ea9c18baf14b448846bde5a48030ed267578472d8955cd0e7443a9812"}, +] + +[[package]] +name = "requests" +version = "2.31.0" +description = "Python HTTP for Humans." +optional = false +python-versions = ">=3.7" +files = [ + {file = "requests-2.31.0-py3-none-any.whl", hash = "sha256:58cd2187c01e70e6e26505bca751777aa9f2ee0b7f4300988b709f44e013003f"}, + {file = "requests-2.31.0.tar.gz", hash = "sha256:942c5a758f98d790eaed1a29cb6eefc7ffb0d1cf7af05c3d2791656dbd6ad1e1"}, +] + +[package.dependencies] +certifi = ">=2017.4.17" +charset-normalizer = ">=2,<4" +idna = ">=2.5,<4" +urllib3 = ">=1.21.1,<3" + +[package.extras] +socks = ["PySocks (>=1.5.6,!=1.5.7)"] +use-chardet-on-py3 = ["chardet (>=3.0.2,<6)"] + +[[package]] +name = "smmap" +version = "5.0.1" +description = "A pure Python implementation of a sliding window memory map manager" +optional = false +python-versions = ">=3.7" +files = [ + {file = "smmap-5.0.1-py3-none-any.whl", hash = "sha256:e6d8668fa5f93e706934a62d7b4db19c8d9eb8cf2adbb75ef1b675aa332b69da"}, + {file = "smmap-5.0.1.tar.gz", hash = "sha256:dceeb6c0028fdb6734471eb07c0cd2aae706ccaecab45965ee83f11c8d3b1f62"}, +] + +[[package]] +name = "snowballstemmer" +version = "2.2.0" +description = "This package provides 29 stemmers for 28 languages generated from Snowball algorithms." +optional = false +python-versions = "*" +files = [ + {file = "snowballstemmer-2.2.0-py2.py3-none-any.whl", hash = "sha256:c8e1716e83cc398ae16824e5572ae04e0d9fc2c6b985fb0f900f5f0c96ecba1a"}, + {file = "snowballstemmer-2.2.0.tar.gz", hash = "sha256:09b16deb8547d3412ad7b590689584cd0fe25ec8db3be37788be3810cbf19cb1"}, +] + +[[package]] +name = "sphinx" +version = "5.3.0" +description = "Python documentation generator" +optional = false +python-versions = ">=3.6" +files = [ + {file = "Sphinx-5.3.0.tar.gz", hash = "sha256:51026de0a9ff9fc13c05d74913ad66047e104f56a129ff73e174eb5c3ee794b5"}, + {file = "sphinx-5.3.0-py3-none-any.whl", hash = "sha256:060ca5c9f7ba57a08a1219e547b269fadf125ae25b06b9fa7f66768efb652d6d"}, +] + +[package.dependencies] +alabaster = ">=0.7,<0.8" +babel = ">=2.9" +colorama = {version = ">=0.4.5", markers = "sys_platform == \"win32\""} +docutils = ">=0.14,<0.20" +imagesize = ">=1.3" +importlib-metadata = {version = ">=4.8", markers = "python_version < \"3.10\""} +Jinja2 = ">=3.0" +packaging = ">=21.0" +Pygments = ">=2.12" +requests = ">=2.5.0" +snowballstemmer = ">=2.0" +sphinxcontrib-applehelp = "*" +sphinxcontrib-devhelp = "*" +sphinxcontrib-htmlhelp = ">=2.0.0" +sphinxcontrib-jsmath = "*" +sphinxcontrib-qthelp = "*" +sphinxcontrib-serializinghtml = ">=1.1.5" + +[package.extras] +docs = ["sphinxcontrib-websupport"] +lint = ["docutils-stubs", "flake8 (>=3.5.0)", "flake8-bugbear", "flake8-comprehensions", "flake8-simplify", "isort", "mypy (>=0.981)", "sphinx-lint", "types-requests", "types-typed-ast"] +test = ["cython", "html5lib", "pytest (>=4.6)", "typed_ast"] + +[[package]] +name = "sphinxcontrib-applehelp" +version = "1.0.4" +description = "sphinxcontrib-applehelp is a Sphinx extension which outputs Apple help books" +optional = false +python-versions = ">=3.8" +files = [ + {file = "sphinxcontrib-applehelp-1.0.4.tar.gz", hash = "sha256:828f867945bbe39817c210a1abfd1bc4895c8b73fcaade56d45357a348a07d7e"}, + {file = "sphinxcontrib_applehelp-1.0.4-py3-none-any.whl", hash = "sha256:29d341f67fb0f6f586b23ad80e072c8e6ad0b48417db2bde114a4c9746feb228"}, +] + +[package.extras] +lint = ["docutils-stubs", "flake8", "mypy"] +test = ["pytest"] + +[[package]] +name = "sphinxcontrib-devhelp" +version = "1.0.2" +description = "sphinxcontrib-devhelp is a sphinx extension which outputs Devhelp document." +optional = false +python-versions = ">=3.5" +files = [ + {file = "sphinxcontrib-devhelp-1.0.2.tar.gz", hash = "sha256:ff7f1afa7b9642e7060379360a67e9c41e8f3121f2ce9164266f61b9f4b338e4"}, + {file = "sphinxcontrib_devhelp-1.0.2-py2.py3-none-any.whl", hash = "sha256:8165223f9a335cc1af7ffe1ed31d2871f325254c0423bc0c4c7cd1c1e4734a2e"}, +] + +[package.extras] +lint = ["docutils-stubs", "flake8", "mypy"] +test = ["pytest"] + +[[package]] +name = "sphinxcontrib-htmlhelp" +version = "2.0.1" +description = "sphinxcontrib-htmlhelp is a sphinx extension which renders HTML help files" +optional = false +python-versions = ">=3.8" +files = [ + {file = "sphinxcontrib-htmlhelp-2.0.1.tar.gz", hash = "sha256:0cbdd302815330058422b98a113195c9249825d681e18f11e8b1f78a2f11efff"}, + {file = "sphinxcontrib_htmlhelp-2.0.1-py3-none-any.whl", hash = "sha256:c38cb46dccf316c79de6e5515e1770414b797162b23cd3d06e67020e1d2a6903"}, +] + +[package.extras] +lint = ["docutils-stubs", "flake8", "mypy"] +test = ["html5lib", "pytest"] + +[[package]] +name = "sphinxcontrib-jsmath" +version = "1.0.1" +description = "A sphinx extension which renders display math in HTML via JavaScript" +optional = false +python-versions = ">=3.5" +files = [ + {file = "sphinxcontrib-jsmath-1.0.1.tar.gz", hash = "sha256:a9925e4a4587247ed2191a22df5f6970656cb8ca2bd6284309578f2153e0c4b8"}, + {file = "sphinxcontrib_jsmath-1.0.1-py2.py3-none-any.whl", hash = "sha256:2ec2eaebfb78f3f2078e73666b1415417a116cc848b72e5172e596c871103178"}, +] + +[package.extras] +test = ["flake8", "mypy", "pytest"] + +[[package]] +name = "sphinxcontrib-qthelp" +version = "1.0.3" +description = "sphinxcontrib-qthelp is a sphinx extension which outputs QtHelp document." +optional = false +python-versions = ">=3.5" +files = [ + {file = "sphinxcontrib-qthelp-1.0.3.tar.gz", hash = "sha256:4c33767ee058b70dba89a6fc5c1892c0d57a54be67ddd3e7875a18d14cba5a72"}, + {file = "sphinxcontrib_qthelp-1.0.3-py2.py3-none-any.whl", hash = "sha256:bd9fc24bcb748a8d51fd4ecaade681350aa63009a347a8c14e637895444dfab6"}, +] + +[package.extras] +lint = ["docutils-stubs", "flake8", "mypy"] +test = ["pytest"] + +[[package]] +name = "sphinxcontrib-serializinghtml" +version = "1.1.5" +description = "sphinxcontrib-serializinghtml is a sphinx extension which outputs \"serialized\" HTML files (json and pickle)." +optional = false +python-versions = ">=3.5" +files = [ + {file = "sphinxcontrib-serializinghtml-1.1.5.tar.gz", hash = "sha256:aa5f6de5dfdf809ef505c4895e51ef5c9eac17d0f287933eb49ec495280b6952"}, + {file = "sphinxcontrib_serializinghtml-1.1.5-py2.py3-none-any.whl", hash = "sha256:352a9a00ae864471d3a7ead8d7d79f5fc0b57e8b3f95e9867eb9eb28999b92fd"}, +] + +[package.extras] +lint = ["docutils-stubs", "flake8", "mypy"] +test = ["pytest"] + +[[package]] +name = "tomli" +version = "2.0.1" +description = "A lil' TOML parser" +optional = false +python-versions = ">=3.7" +files = [ + {file = "tomli-2.0.1-py3-none-any.whl", hash = "sha256:939de3e7a6161af0c887ef91b7d41a53e7c5a1ca976325f429cb46ea9bc30ecc"}, + {file = "tomli-2.0.1.tar.gz", hash = "sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f"}, +] + +[[package]] +name = "urllib3" +version = "2.2.0" +description = "HTTP library with thread-safe connection pooling, file post, and more." +optional = false +python-versions = ">=3.8" +files = [ + {file = "urllib3-2.2.0-py3-none-any.whl", hash = "sha256:ce3711610ddce217e6d113a2732fafad960a03fd0318c91faa79481e35c11224"}, + {file = "urllib3-2.2.0.tar.gz", hash = "sha256:051d961ad0c62a94e50ecf1af379c3aba230c66c710493493560c0c223c49f20"}, +] + +[package.extras] +brotli = ["brotli (>=1.0.9)", "brotlicffi (>=0.8.0)"] +h2 = ["h2 (>=4,<5)"] +socks = ["pysocks (>=1.5.6,!=1.5.7,<2.0)"] +zstd = ["zstandard (>=0.18.0)"] + +[[package]] +name = "wheel" +version = "0.42.0" +description = "A built-package format for Python" +optional = false +python-versions = ">=3.7" +files = [ + {file = "wheel-0.42.0-py3-none-any.whl", hash = "sha256:177f9c9b0d45c47873b619f5b650346d632cdc35fb5e4d25058e09c9e581433d"}, + {file = "wheel-0.42.0.tar.gz", hash = "sha256:c45be39f7882c9d34243236f2d63cbd58039e360f85d0913425fbd7ceea617a8"}, +] + +[package.extras] +test = ["pytest (>=6.0.0)", "setuptools (>=65)"] + +[[package]] +name = "zipp" +version = "3.17.0" +description = "Backport of pathlib-compatible object wrapper for zip files" +optional = false +python-versions = ">=3.8" +files = [ + {file = "zipp-3.17.0-py3-none-any.whl", hash = "sha256:0e923e726174922dce09c53c59ad483ff7bbb8e572e00c7f7c46b88556409f31"}, + {file = "zipp-3.17.0.tar.gz", hash = "sha256:84e64a1c28cf7e91ed2078bb8cc8c259cb19b76942096c8d7b84947690cabaf0"}, +] + +[package.extras] +docs = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "rst.linker (>=1.9)", "sphinx (<7.2.5)", "sphinx (>=3.5)", "sphinx-lint"] +testing = ["big-O", "jaraco.functools", "jaraco.itertools", "more-itertools", "pytest (>=6)", "pytest-black (>=0.3.7)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)", "pytest-ignore-flaky", "pytest-mypy (>=0.9.1)", "pytest-ruff"] + +[metadata] +lock-version = "2.0" +python-versions = "^3.8" +content-hash = "25ee2ae1d74abedde3a6637a60d4a3095ea5cf9731960875741bbc2ba84a475d" diff --git a/.lib/git-fleximod/pyproject.toml b/.lib/git-fleximod/pyproject.toml new file mode 100644 index 0000000000..2484552e4f --- /dev/null +++ b/.lib/git-fleximod/pyproject.toml @@ -0,0 +1,41 @@ +[tool.poetry] +name = "git-fleximod" +version = "0.7.4" +description = "Extended support for git-submodule and git-sparse-checkout" +authors = ["Jim Edwards "] +maintainers = ["Jim Edwards "] +license = "MIT" +readme = "README.md" +homepage = "https://github.com/jedwards4b/git-fleximod" +keywords = ["git", "submodule", "sparse-checkout"] +packages = [ +{ include = "git_fleximod"}, +{ include = "doc"}, +] + +[tool.poetry.scripts] +git-fleximod = "git_fleximod.git_fleximod:main" +me2flexi = "git_fleximod.metoflexi:_main" +fsspec = "fsspec.fuse:main" + +[tool.poetry.dependencies] +python = "^3.8" +GitPython = "^3.1.0" +sphinx = "^5.0.0" +fsspec = "^2023.12.2" +wheel = "^0.42.0" +pytest = "^8.0.0" +pyfakefs = "^5.3.5" + +[tool.poetry.urls] +"Bug Tracker" = "https://github.com/jedwards4b/git-fleximod/issues" + +[tool.pytest.ini_options] +markers = [ + "skip_after_first: only run on first iteration" +] + +[build-system] +requires = ["poetry-core"] +build-backend = "poetry.core.masonry.api" + diff --git a/.lib/git-fleximod/tbump.toml b/.lib/git-fleximod/tbump.toml new file mode 100644 index 0000000000..d4b8eaee11 --- /dev/null +++ b/.lib/git-fleximod/tbump.toml @@ -0,0 +1,43 @@ +# Uncomment this if your project is hosted on GitHub: +github_url = "https://github.com/jedwards4b/git-fleximod/" + +[version] +current = "0.7.4" + +# Example of a semver regexp. +# Make sure this matches current_version before +# using tbump +regex = ''' + (?P\d+) + \. + (?P\d+) + \. + (?P\d+) + ''' + +[git] +message_template = "Bump to {new_version}" +tag_template = "v{new_version}" + +# For each file to patch, add a [[file]] config +# section containing the path of the file, relative to the +# tbump.toml location. +[[file]] +src = "git_fleximod/cli.py" + +[[file]] +src = "pyproject.toml" + +# You can specify a list of commands to +# run after the files have been patched +# and before the git commit is made + +# [[before_commit]] +# name = "check changelog" +# cmd = "grep -q {new_version} Changelog.rst" + +# Or run some commands after the git tag and the branch +# have been pushed: +# [[after_push]] +# name = "publish" +# cmd = "./publish.sh" diff --git a/.lib/git-fleximod/tests/__init__.py b/.lib/git-fleximod/tests/__init__.py new file mode 100644 index 0000000000..4d4c66c78e --- /dev/null +++ b/.lib/git-fleximod/tests/__init__.py @@ -0,0 +1,3 @@ +import sys, os + +sys.path.append(os.path.join(os.path.dirname(__file__), os.path.pardir, "src")) diff --git a/.lib/git-fleximod/tests/conftest.py b/.lib/git-fleximod/tests/conftest.py new file mode 100644 index 0000000000..942a0efb97 --- /dev/null +++ b/.lib/git-fleximod/tests/conftest.py @@ -0,0 +1,138 @@ +import pytest +from git_fleximod.gitinterface import GitInterface +import os +import subprocess +import logging +from pathlib import Path + +@pytest.fixture(scope='session') +def logger(): + logging.basicConfig( + level=logging.INFO, format="%(name)s - %(levelname)s - %(message)s", handlers=[logging.StreamHandler()] + ) + logger = logging.getLogger(__name__) + return logger + +all_repos=[ + {"subrepo_path": "modules/test", + "submodule_name": "test_submodule", + "status1" : "test_submodule MPIserial_2.5.0-3-gd82ce7c is out of sync with .gitmodules MPIserial_2.4.0", + "status2" : "test_submodule at tag MPIserial_2.4.0", + "status3" : "test_submodule at tag MPIserial_2.4.0", + "status4" : "test_submodule at tag MPIserial_2.4.0", + "gitmodules_content" : """ + [submodule "test_submodule"] + path = modules/test + url = https://github.com/ESMCI/mpi-serial.git + fxtag = MPIserial_2.4.0 + fxDONOTUSEurl = https://github.com/ESMCI/mpi-serial.git + fxrequired = ToplevelRequired +"""}, + {"subrepo_path": "modules/test_optional", + "submodule_name": "test_optional", + "status1" : "test_optional MPIserial_2.5.0-3-gd82ce7c is out of sync with .gitmodules MPIserial_2.4.0", + "status2" : "test_optional at tag MPIserial_2.4.0", + "status3" : "test_optional not checked out, aligned at tag MPIserial_2.4.0", + "status4" : "test_optional at tag MPIserial_2.4.0", + "gitmodules_content": """ + [submodule "test_optional"] + path = modules/test_optional + url = https://github.com/ESMCI/mpi-serial.git + fxtag = MPIserial_2.4.0 + fxDONOTUSEurl = https://github.com/ESMCI/mpi-serial.git + fxrequired = ToplevelOptional +"""}, + {"subrepo_path": "modules/test_alwaysoptional", + "submodule_name": "test_alwaysoptional", + "status1" : "test_alwaysoptional MPIserial_2.3.0 is out of sync with .gitmodules e5cf35c", + "status2" : "test_alwaysoptional at hash e5cf35c", + "status3" : "test_alwaysoptional not checked out, out of sync at tag MPIserial_2.3.0", + "status4" : "test_alwaysoptional at hash e5cf35c", + "gitmodules_content": """ + [submodule "test_alwaysoptional"] + path = modules/test_alwaysoptional + url = https://github.com/ESMCI/mpi-serial.git + fxtag = e5cf35c + fxDONOTUSEurl = https://github.com/ESMCI/mpi-serial.git + fxrequired = AlwaysOptional +"""}, + {"subrepo_path": "modules/test_sparse", + "submodule_name": "test_sparse", + "status1" : "test_sparse at tag MPIserial_2.5.0", + "status2" : "test_sparse at tag MPIserial_2.5.0", + "status3" : "test_sparse at tag MPIserial_2.5.0", + "status4" : "test_sparse at tag MPIserial_2.5.0", + "gitmodules_content": """ + [submodule "test_sparse"] + path = modules/test_sparse + url = https://github.com/ESMCI/mpi-serial.git + fxtag = MPIserial_2.5.0 + fxDONOTUSEurl = https://github.com/ESMCI/mpi-serial.git + fxrequired = AlwaysRequired + fxsparse = ../.sparse_file_list +"""}, +] +@pytest.fixture(params=all_repos) + +def shared_repos(request): + return request.param + +@pytest.fixture +def get_all_repos(): + return all_repos + +def write_sparse_checkout_file(fp): + sparse_content = """m4 +""" + fp.write_text(sparse_content) + +@pytest.fixture +def test_repo(shared_repos, tmp_path, logger): + subrepo_path = shared_repos["subrepo_path"] + submodule_name = shared_repos["submodule_name"] + test_dir = tmp_path / "testrepo" + test_dir.mkdir() + str_path = str(test_dir) + gitp = GitInterface(str_path, logger) + assert test_dir.joinpath(".git").is_dir() + (test_dir / "modules").mkdir() + if "sparse" in submodule_name: + (test_dir / subrepo_path).mkdir() + # Add the sparse checkout file + write_sparse_checkout_file(test_dir / "modules" / ".sparse_file_list") + gitp.git_operation("add","modules/.sparse_file_list") + else: + gitp = GitInterface(str(test_dir), logger) + gitp.git_operation("submodule", "add", "--depth","1","--name", submodule_name, "https://github.com/ESMCI/mpi-serial.git", subrepo_path) + assert test_dir.joinpath(".gitmodules").is_file() + gitp.git_operation("add",subrepo_path) + gitp.git_operation("commit","-a","-m","\"add submod\"") + test_dir2 = tmp_path / "testrepo2" + gitp.git_operation("clone",test_dir,test_dir2) + return test_dir2 + + +@pytest.fixture +def complex_repo(tmp_path, logger): + test_dir = tmp_path / "testcomplex" + test_dir.mkdir() + str_path = str(test_dir) + gitp = GitInterface(str_path, logger) + gitp.git_operation("remote", "add", "origin", "https://github.com/jedwards4b/fleximod-test2") + gitp.git_operation("fetch", "origin", "main") + gitp.git_operation("checkout", "main") + return test_dir + +@pytest.fixture +def git_fleximod(): + def _run_fleximod(path, args, input=None): + cmd = ["git", "fleximod"] + args.split() + result = subprocess.run(cmd, cwd=path, input=input, + stdout=subprocess.PIPE, stderr=subprocess.PIPE, + text=True) + if result.returncode: + print(result.stdout) + print(result.stderr) + return result + return _run_fleximod + diff --git a/.lib/git-fleximod/tests/test_a_import.py b/.lib/git-fleximod/tests/test_a_import.py new file mode 100644 index 0000000000..d5ca878de5 --- /dev/null +++ b/.lib/git-fleximod/tests/test_a_import.py @@ -0,0 +1,8 @@ +# pylint: disable=unused-import +from git_fleximod import cli +from git_fleximod import utils +from git_fleximod.gitinterface import GitInterface +from git_fleximod.gitmodules import GitModules + +def test_import(): + print("here") diff --git a/.lib/git-fleximod/tests/test_b_update.py b/.lib/git-fleximod/tests/test_b_update.py new file mode 100644 index 0000000000..159f1cfae0 --- /dev/null +++ b/.lib/git-fleximod/tests/test_b_update.py @@ -0,0 +1,26 @@ +import pytest +from pathlib import Path + +def test_basic_checkout(git_fleximod, test_repo, shared_repos): + # Prepare a simple .gitmodules + gm = shared_repos['gitmodules_content'] + file_path = (test_repo / ".gitmodules") + repo_name = shared_repos["submodule_name"] + repo_path = shared_repos["subrepo_path"] + + file_path.write_text(gm) + + # Run the command + result = git_fleximod(test_repo, f"update {repo_name}") + + # Assertions + assert result.returncode == 0 + assert Path(test_repo / repo_path).exists() # Did the submodule directory get created? + if "sparse" in repo_name: + assert Path(test_repo / f"{repo_path}/m4").exists() # Did the submodule sparse directory get created? + assert not Path(test_repo / f"{repo_path}/README").exists() # Did only the submodule sparse directory get created? + + status = git_fleximod(test_repo, f"status {repo_name}") + + assert shared_repos["status2"] in status.stdout + diff --git a/.lib/git-fleximod/tests/test_c_required.py b/.lib/git-fleximod/tests/test_c_required.py new file mode 100644 index 0000000000..89ab8d294d --- /dev/null +++ b/.lib/git-fleximod/tests/test_c_required.py @@ -0,0 +1,30 @@ +import pytest +from pathlib import Path + +def test_required(git_fleximod, test_repo, shared_repos): + file_path = (test_repo / ".gitmodules") + gm = shared_repos["gitmodules_content"] + repo_name = shared_repos["submodule_name"] + if file_path.exists(): + with file_path.open("r") as f: + gitmodules_content = f.read() + # add the entry if it does not exist + if repo_name not in gitmodules_content: + file_path.write_text(gitmodules_content+gm) + # or if it is incomplete + elif gm not in gitmodules_content: + file_path.write_text(gm) + else: + file_path.write_text(gm) + result = git_fleximod(test_repo, "update") + assert result.returncode == 0 + status = git_fleximod(test_repo, f"status {repo_name}") + assert shared_repos["status3"] in status.stdout + status = git_fleximod(test_repo, f"update --optional") + assert result.returncode == 0 + status = git_fleximod(test_repo, f"status {repo_name}") + assert shared_repos["status4"] in status.stdout + status = git_fleximod(test_repo, f"update {repo_name}") + assert result.returncode == 0 + status = git_fleximod(test_repo, f"status {repo_name}") + assert shared_repos["status4"] in status.stdout diff --git a/.lib/git-fleximod/tests/test_d_complex.py b/.lib/git-fleximod/tests/test_d_complex.py new file mode 100644 index 0000000000..fdce516274 --- /dev/null +++ b/.lib/git-fleximod/tests/test_d_complex.py @@ -0,0 +1,67 @@ +import pytest +from pathlib import Path +from git_fleximod.gitinterface import GitInterface + +def test_complex_checkout(git_fleximod, complex_repo, logger): + status = git_fleximod(complex_repo, "status") + assert("ToplevelOptional not checked out, aligned at tag v5.3.2" in status.stdout) + assert("ToplevelRequired not checked out, aligned at tag MPIserial_2.5.0" in status.stdout) + assert("AlwaysRequired not checked out, aligned at tag MPIserial_2.4.0" in status.stdout) + assert("Complex not checked out, aligned at tag testtag01" in status.stdout) + assert("AlwaysOptional not checked out, aligned at tag MPIserial_2.3.0" in status.stdout) + + # This should checkout and update test_submodule and complex_sub + result = git_fleximod(complex_repo, "update") + assert result.returncode == 0 + + status = git_fleximod(complex_repo, "status") + assert("ToplevelOptional not checked out, aligned at tag v5.3.2" in status.stdout) + assert("ToplevelRequired at tag MPIserial_2.5.0" in status.stdout) + assert("AlwaysRequired at tag MPIserial_2.4.0" in status.stdout) + assert("Complex at tag testtag01" in status.stdout) + + # now check the complex_sub + root = (complex_repo / "modules" / "complex") + assert(not (root / "libraries" / "gptl" / ".git").exists()) + assert(not (root / "libraries" / "mpi-serial" / ".git").exists()) + assert((root / "modules" / "mpi-serial" / ".git").exists()) + assert(not (root / "modules" / "mpi-serial2" / ".git").exists()) + assert((root / "modules" / "mpi-sparse" / ".git").exists()) + assert((root / "modules" / "mpi-sparse" / "m4").exists()) + assert(not (root / "modules" / "mpi-sparse" / "README").exists()) + + # update a single optional submodule + + result = git_fleximod(complex_repo, "update ToplevelOptional") + assert result.returncode == 0 + + status = git_fleximod(complex_repo, "status") + assert("ToplevelOptional at tag v5.3.2" in status.stdout) + assert("ToplevelRequired at tag MPIserial_2.5.0" in status.stdout) + assert("AlwaysRequired at tag MPIserial_2.4.0" in status.stdout) + assert("Complex at tag testtag01" in status.stdout) + assert("AlwaysOptional not checked out, aligned at tag MPIserial_2.3.0" in status.stdout) + + + # Finally update optional + result = git_fleximod(complex_repo, "update --optional") + assert result.returncode == 0 + + status = git_fleximod(complex_repo, "status") + assert("ToplevelOptional at tag v5.3.2" in status.stdout) + assert("ToplevelRequired at tag MPIserial_2.5.0" in status.stdout) + assert("AlwaysRequired at tag MPIserial_2.4.0" in status.stdout) + assert("Complex at tag testtag01" in status.stdout) + assert("AlwaysOptional at tag MPIserial_2.3.0" in status.stdout) + + # now check the complex_sub + root = (complex_repo / "modules" / "complex" ) + assert(not (root / "libraries" / "gptl" / ".git").exists()) + assert(not (root / "libraries" / "mpi-serial" / ".git").exists()) + assert((root / "modules" / "mpi-serial" / ".git").exists()) + assert((root / "modules" / "mpi-serial2" / ".git").exists()) + assert((root / "modules" / "mpi-sparse" / ".git").exists()) + assert((root / "modules" / "mpi-sparse" / "m4").exists()) + assert(not (root / "modules" / "mpi-sparse" / "README").exists()) + + diff --git a/bin/git-fleximod b/bin/git-fleximod new file mode 100755 index 0000000000..f69ede1c22 --- /dev/null +++ b/bin/git-fleximod @@ -0,0 +1,8 @@ +#!/usr/bin/env python3 +import sys +import os +sys.path.insert(0,os.path.abspath(os.path.join(os.path.dirname(__file__),"..",".lib","git-fleximod"))) +from git_fleximod.git_fleximod import main + +if __name__ == '__main__': + sys.exit(main()) diff --git a/ccs_config b/ccs_config index f90e10502c..2ff978f92a 160000 --- a/ccs_config +++ b/ccs_config @@ -1 +1 @@ -Subproject commit f90e10502c7246c2b45e373b7dd5e0da6cba0828 +Subproject commit 2ff978f92a5ac9a6ab243e5c14d06a7e2d2f5799 diff --git a/components/cdeps b/components/cdeps index 7a522c828c..7476950699 160000 --- a/components/cdeps +++ b/components/cdeps @@ -1 +1 @@ -Subproject commit 7a522c828c32dc35777992653f281ec525509c4a +Subproject commit 7476950699909813d1938a34bd8d71bf5bfbf1e9 diff --git a/components/mizuRoute b/components/mizuRoute index 0a62ee6185..81c720c7ee 160000 --- a/components/mizuRoute +++ b/components/mizuRoute @@ -1 +1 @@ -Subproject commit 0a62ee6185bdc9b99cd88ed5f15ea850602c43a2 +Subproject commit 81c720c7ee51f9c69f2934f696078c42f4493565 diff --git a/components/mosart b/components/mosart index 1c22a8c547..8c682b1b7f 160000 --- a/components/mosart +++ b/components/mosart @@ -1 +1 @@ -Subproject commit 1c22a8c5478b714cf5b7c54b3e5cf7bad09fd9b2 +Subproject commit 8c682b1b7f15d146816de302e0d359da3e957056 diff --git a/libraries/mct b/libraries/mct index e36024c5dd..82b0071e69 160000 --- a/libraries/mct +++ b/libraries/mct @@ -1 +1 @@ -Subproject commit e36024c5ddf482625ae6bd9474eff7d8f393f87c +Subproject commit 82b0071e69d14330b75d23b0bc68543ebea9aadc diff --git a/libraries/parallelio b/libraries/parallelio index 6539ef05ae..f52ade0756 160000 --- a/libraries/parallelio +++ b/libraries/parallelio @@ -1 +1 @@ -Subproject commit 6539ef05ae7584ec570a56fdab9f7dfb336c2b80 +Subproject commit f52ade075619b32fa141993b5665b0fe099befc2 diff --git a/src/fates b/src/fates index f0185f7c70..adfa664806 160000 --- a/src/fates +++ b/src/fates @@ -1 +1 @@ -Subproject commit f0185f7c7033fa69c80d1ddb07cbcbf1f8be1adc +Subproject commit adfa6648063408d443f5cae671bd37f713d3e3e8 From 798d43c0fe673557b98dd7fd1eb614b205641db0 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Tue, 28 May 2024 08:39:13 -0600 Subject: [PATCH 0338/1248] Add comment in lilacsmoke.py as per code review --- cime_config/SystemTests/lilacsmoke.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cime_config/SystemTests/lilacsmoke.py b/cime_config/SystemTests/lilacsmoke.py index 366d5d1176..1287301ba2 100644 --- a/cime_config/SystemTests/lilacsmoke.py +++ b/cime_config/SystemTests/lilacsmoke.py @@ -407,6 +407,10 @@ def run_phase(self): # case.get_mpirun_cmd creates a command that runs the executable given by # case.run_exe. So it's important that (elsewhere in this test script) we create a # link pointing from that to the atm_driver.exe executable. + # + # 2024/5/28 slevis: We added the load_env here to replace the + # behavior of the PBS -V directive that was removed from + # /ccs_config/machines/config_batch.xml self._case.load_env(reset=True) lid = new_lid() os.environ["OMP_NUM_THREADS"] = str(self._case.thread_count) From aaeae950ca98d3292e3a02eb95862e69e7783c40 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Tue, 28 May 2024 08:54:58 -0600 Subject: [PATCH 0339/1248] Updated ChangeLog and ChangeSum --- doc/ChangeLog | 26 +++----------------------- doc/ChangeSum | 2 +- 2 files changed, 4 insertions(+), 24 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index d68ef323ac..e15c554f8f 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,7 +1,7 @@ =============================================================== Tag name: ctsm5.2.006 Originator(s): slevis (Samuel Levis) -Date: Tue 21 May 2024 02:59:05 PM MDT +Date: Tue 28 May 2024 08:45:50 AM MDT One-line Summary: Update externals to cesm2_3_beta17, remove mct, retire /test/tools Purpose and description of changes @@ -48,12 +48,6 @@ Changes to documentation: Substantial timing or memory changes: Not considered -Notes of particular relevance for developers: ---------------------------------------------- -Changes to tests or testing: - I added a long list of izumi nag debug tests to ExpectedFailures as per - https://github.com/ESCOMP/CMEPS/pull/460 - Testing summary: ---------------- [PASS means all tests PASS; OK means tests PASS other than expected fails.] @@ -68,7 +62,7 @@ Testing summary: regular tests (aux_clm: https://github.com/ESCOMP/CTSM/wiki/System-Testing-Guide#pre-merge-system-testing): - derecho ----- + derecho ----- OK izumi ------- OK any other testing (give details below): @@ -82,21 +76,7 @@ If the tag used for baseline comparisons was NOT the previous tag, note that her Answer changes -------------- -Changes answers relative to baseline: - - [ If a tag changes answers relative to baseline comparison the - following should be filled in (otherwise remove this section). - And always remove these three lines and parts that don't apply. ] - - Summarize any changes to answers, i.e., - - what code configurations: - - what platforms/compilers: - - nature of change (roundoff; larger than roundoff/same climate; new climate): - - If bitwise differences were observed, how did you show they were no worse - than roundoff? Roundoff differences means one or more lines of code change results - only by roundoff level (because order of operation changes for example). Roundoff - changes to state fields usually grow to greater than roundoff as the simulation progresses. +Changes answers relative to baseline: NO Other details ------------- diff --git a/doc/ChangeSum b/doc/ChangeSum index 7f8cdaeead..77bc8a426d 100644 --- a/doc/ChangeSum +++ b/doc/ChangeSum @@ -1,6 +1,6 @@ Tag Who Date Summary ============================================================================================================================ - ctsm5.2.006 slevis 05/21/2024 Update externals to cesm2_3_beta17, remove mct, retire /test/tools + ctsm5.2.006 slevis 05/28/2024 Update externals to cesm2_3_beta17, remove mct, retire /test/tools ctsm5.2.005 erik 05/13/2024 Fix clm6_0 defaults and CESM testing issues, add tests to detect these problems ctsm5.2.004 multiple 05/09/2024 CTSM5.2 1979 fsurdat and 1979-2026 landuse ne0np4 files + two fixes ctsm5.2.003 samrabin 05/02/2024 Merge b4b-dev From 62d8ad004e896037f04a626ac7c4fceee9ecf6b0 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Tue, 28 May 2024 09:03:35 -0600 Subject: [PATCH 0340/1248] Update share in Externals.cfg --- Externals.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Externals.cfg b/Externals.cfg index 70d103a94b..dac119c47c 100644 --- a/Externals.cfg +++ b/Externals.cfg @@ -63,7 +63,7 @@ externals = Externals_CDEPS.cfg required = True [share] -tag = share1.0.18 +tag = share1.0.19 protocol = git repo_url = https://github.com/ESCOMP/CESM_share local_path = share From 51d9f095ebe73eb5e1af0731cc85e36988b2b9b7 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Thu, 18 Jan 2024 13:42:59 -0700 Subject: [PATCH 0341/1248] Break up a long line. --- src/main/clm_driver.F90 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/clm_driver.F90 b/src/main/clm_driver.F90 index 00a98e61b4..c4fa1b53f4 100644 --- a/src/main/clm_driver.F90 +++ b/src/main/clm_driver.F90 @@ -1078,7 +1078,8 @@ subroutine clm_drv(doalb, nextsw_cday, declinp1, declin, rstwr, nlend, rdate, ro ! ============================================================================ ! Update crop calendars ! ============================================================================ - call cropcal_interp(bounds_clump, filter_inactive_and_active(nc)%num_pcropp, filter_inactive_and_active(nc)%pcropp, crop_inst) + call cropcal_interp(bounds_clump, filter_inactive_and_active(nc)%num_pcropp, & + filter_inactive_and_active(nc)%pcropp, crop_inst) end if ! ============================================================================ From c763d664f23d15cc44d7afbb807359eea6cde30e Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Thu, 18 Jan 2024 13:45:32 -0700 Subject: [PATCH 0342/1248] use_cropcal_rx_cultivar_gdds not needed in CropPhenology(). --- src/biogeochem/CNPhenologyMod.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/biogeochem/CNPhenologyMod.F90 b/src/biogeochem/CNPhenologyMod.F90 index fffb19bc46..bf91532e5a 100644 --- a/src/biogeochem/CNPhenologyMod.F90 +++ b/src/biogeochem/CNPhenologyMod.F90 @@ -1808,7 +1808,7 @@ subroutine CropPhenology(num_pcropp, filter_pcropp , & use clm_varctl , only : use_fertilizer use clm_varctl , only : use_c13, use_c14 use clm_varcon , only : c13ratio, c14ratio - use clm_varctl , only : use_cropcal_rx_swindows, use_cropcal_rx_cultivar_gdds, use_cropcal_streams + use clm_varctl , only : use_cropcal_rx_swindows, use_cropcal_streams ! ! !ARGUMENTS: integer , intent(in) :: num_pcropp ! number of prog crop patches in filter From 846f1cc0485e6f69682159d9c3a54b0cd6c8d941 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Thu, 18 Jan 2024 13:54:13 -0700 Subject: [PATCH 0343/1248] PlantCrop(): Be strict about PFT identification. --- src/biogeochem/CNPhenologyMod.F90 | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/biogeochem/CNPhenologyMod.F90 b/src/biogeochem/CNPhenologyMod.F90 index bf91532e5a..09515042b8 100644 --- a/src/biogeochem/CNPhenologyMod.F90 +++ b/src/biogeochem/CNPhenologyMod.F90 @@ -2679,8 +2679,7 @@ subroutine PlantCrop(p, leafcn_in, jday, kyr, do_plant_normal, & if (ivt(p) == ntmp_soybean .or. ivt(p) == nirrig_tmp_soybean .or. & ivt(p) == ntrp_soybean .or. ivt(p) == nirrig_trp_soybean) then gddmaturity(p) = min(gdd1020(p), hybgdd(ivt(p))) - end if - if (ivt(p) == ntmp_corn .or. ivt(p) == nirrig_tmp_corn .or. & + else if (ivt(p) == ntmp_corn .or. ivt(p) == nirrig_tmp_corn .or. & ivt(p) == ntrp_corn .or. ivt(p) == nirrig_trp_corn .or. & ivt(p) == nsugarcane .or. ivt(p) == nirrig_sugarcane .or. & ivt(p) == nmiscanthus .or. ivt(p) == nirrig_miscanthus .or. & @@ -2689,11 +2688,13 @@ subroutine PlantCrop(p, leafcn_in, jday, kyr, do_plant_normal, & if (do_plant_normal) then gddmaturity(p) = max(950._r8, min(gddmaturity(p)+150._r8, 1850._r8)) end if - end if - if (ivt(p) == nswheat .or. ivt(p) == nirrig_swheat .or. & + else if (ivt(p) == nswheat .or. ivt(p) == nirrig_swheat .or. & ivt(p) == ncotton .or. ivt(p) == nirrig_cotton .or. & ivt(p) == nrice .or. ivt(p) == nirrig_rice) then gddmaturity(p) = min(gdd020(p), hybgdd(ivt(p))) + else + write(iulog, *) 'ERROR: PlantCrop(): unrecognized ivt ',ivt(p) + call endrun(msg="Stopping") end if endif From 5b056b744e64ac59aae5cbc44c99a1b3d9815f59 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Thu, 18 Jan 2024 14:07:42 -0700 Subject: [PATCH 0344/1248] PlantCrop: Get gdd20 before setting gddmaturity. --- src/biogeochem/CNPhenologyMod.F90 | 36 ++++++++++++++++++++++++------- 1 file changed, 28 insertions(+), 8 deletions(-) diff --git a/src/biogeochem/CNPhenologyMod.F90 b/src/biogeochem/CNPhenologyMod.F90 index 09515042b8..efc581cffc 100644 --- a/src/biogeochem/CNPhenologyMod.F90 +++ b/src/biogeochem/CNPhenologyMod.F90 @@ -2590,6 +2590,7 @@ subroutine PlantCrop(p, leafcn_in, jday, kyr, do_plant_normal, & ! LOCAL VARAIBLES: integer s ! growing season index integer k ! grain pool index + real(r8) gdd20 ! GDD*20 value for this crop type real(r8) gdd_target ! cultivar GDD target this growing season real(r8) this_sowing_reason ! number representing sowing reason(s) logical did_rx_gdds ! did this patch use a prescribed harvest requirement? @@ -2668,6 +2669,26 @@ subroutine PlantCrop(p, leafcn_in, jday, kyr, do_plant_normal, & endif endif + ! which GDD*20 variable does this crop use? + if (ivt(p) == ntmp_soybean .or. ivt(p) == nirrig_tmp_soybean .or. & + ivt(p) == ntrp_soybean .or. ivt(p) == nirrig_trp_soybean) then + gdd20 = gdd1020(p) + else if (ivt(p) == ntmp_corn .or. ivt(p) == nirrig_tmp_corn .or. & + ivt(p) == ntrp_corn .or. ivt(p) == nirrig_trp_corn .or. & + ivt(p) == nsugarcane .or. ivt(p) == nirrig_sugarcane .or. & + ivt(p) == nmiscanthus .or. ivt(p) == nirrig_miscanthus .or. & + ivt(p) == nswitchgrass .or. ivt(p) == nirrig_switchgrass) then + gdd20 = gdd820(p) + else if (ivt(p) == nswheat .or. ivt(p) == nirrig_swheat .or. & + ivt(p) == nwwheat .or. ivt(p) == nirrig_wwheat .or. & + ivt(p) == ncotton .or. ivt(p) == nirrig_cotton .or. & + ivt(p) == nrice .or. ivt(p) == nirrig_rice) then + gdd20 = gdd020(p) + else + write(iulog, *) 'ERROR: PlantCrop(): unrecognized ivt for gdd20: ',ivt(p) + call endrun(msg="Stopping") + end if + ! set GDD target did_rx_gdds = .false. if (use_cropcal_rx_cultivar_gdds .and. crop_inst%rx_cultivar_gdds_thisyr_patch(p,sowing_count(p)) .ge. 0._r8) then @@ -2677,23 +2698,22 @@ subroutine PlantCrop(p, leafcn_in, jday, kyr, do_plant_normal, & gddmaturity(p) = hybgdd(ivt(p)) else if (ivt(p) == ntmp_soybean .or. ivt(p) == nirrig_tmp_soybean .or. & - ivt(p) == ntrp_soybean .or. ivt(p) == nirrig_trp_soybean) then - gddmaturity(p) = min(gdd1020(p), hybgdd(ivt(p))) + ivt(p) == ntrp_soybean .or. ivt(p) == nirrig_trp_soybean .or. & + ivt(p) == nswheat .or. ivt(p) == nirrig_swheat .or. & + ivt(p) == ncotton .or. ivt(p) == nirrig_cotton .or. & + ivt(p) == nrice .or. ivt(p) == nirrig_rice) then + gddmaturity(p) = min(gdd20, hybgdd(ivt(p))) else if (ivt(p) == ntmp_corn .or. ivt(p) == nirrig_tmp_corn .or. & ivt(p) == ntrp_corn .or. ivt(p) == nirrig_trp_corn .or. & ivt(p) == nsugarcane .or. ivt(p) == nirrig_sugarcane .or. & ivt(p) == nmiscanthus .or. ivt(p) == nirrig_miscanthus .or. & ivt(p) == nswitchgrass .or. ivt(p) == nirrig_switchgrass) then - gddmaturity(p) = max(950._r8, min(gdd820(p)*0.85_r8, hybgdd(ivt(p)))) + gddmaturity(p) = max(950._r8, min(gdd20*0.85_r8, hybgdd(ivt(p)))) if (do_plant_normal) then gddmaturity(p) = max(950._r8, min(gddmaturity(p)+150._r8, 1850._r8)) end if - else if (ivt(p) == nswheat .or. ivt(p) == nirrig_swheat .or. & - ivt(p) == ncotton .or. ivt(p) == nirrig_cotton .or. & - ivt(p) == nrice .or. ivt(p) == nirrig_rice) then - gddmaturity(p) = min(gdd020(p), hybgdd(ivt(p))) else - write(iulog, *) 'ERROR: PlantCrop(): unrecognized ivt ',ivt(p) + write(iulog, *) 'ERROR: PlantCrop(): unrecognized ivt for GDD target: ',ivt(p) call endrun(msg="Stopping") end if From 08906bb13054f32bb48e9a412beefd02bff9a3e2 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Thu, 18 Jan 2024 14:25:50 -0700 Subject: [PATCH 0345/1248] Correct a comment. --- src/cpl/share_esmf/cropcalStreamMod.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cpl/share_esmf/cropcalStreamMod.F90 b/src/cpl/share_esmf/cropcalStreamMod.F90 index 0ea63f2c6d..23f00a1759 100644 --- a/src/cpl/share_esmf/cropcalStreamMod.F90 +++ b/src/cpl/share_esmf/cropcalStreamMod.F90 @@ -35,7 +35,7 @@ module cropcalStreamMod integer, allocatable :: g_to_ig(:) ! Array matching gridcell index to data index type(shr_strdata_type) :: sdat_cropcal_swindow_start ! sowing window start input data stream type(shr_strdata_type) :: sdat_cropcal_swindow_end ! sowing window end input data stream - type(shr_strdata_type) :: sdat_cropcal_cultivar_gdds ! sdate input data stream + type(shr_strdata_type) :: sdat_cropcal_cultivar_gdds ! maturity requirement input data stream character(len=CS), allocatable :: stream_varnames_sdate(:) ! used for both start and end dates character(len=CS), allocatable :: stream_varnames_cultivar_gdds(:) integer :: ncft ! Number of crop functional types (excl. generic crops) From 6ef52cdc8a980d62a596e21d9e7e57878145a5bb Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Thu, 18 Jan 2024 14:26:11 -0700 Subject: [PATCH 0346/1248] Remove a troubleshooting write to iulog. --- src/cpl/share_esmf/cropcalStreamMod.F90 | 1 - 1 file changed, 1 deletion(-) diff --git a/src/cpl/share_esmf/cropcalStreamMod.F90 b/src/cpl/share_esmf/cropcalStreamMod.F90 index 23f00a1759..75c3820e7e 100644 --- a/src/cpl/share_esmf/cropcalStreamMod.F90 +++ b/src/cpl/share_esmf/cropcalStreamMod.F90 @@ -490,7 +490,6 @@ subroutine cropcal_interp(bounds, num_pcropp, filter_pcropp, crop_inst) call ESMF_Finalize(endflag=ESMF_END_ABORT) endif end do - write(iulog,*) 'cropcal_interp(): Reading cultivar_gdds file DONE' end if ! use_cropcal_rx_cultivar_gdds deallocate(dataptr2d_cultivar_gdds) From 98f68e784fe4ab30fd559be0126cb847675b74fc Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Thu, 18 Jan 2024 14:43:16 -0700 Subject: [PATCH 0347/1248] Optionally adjust rx maturity reqt based on recent climate. --- bld/CLMBuildNamelist.pm | 7 ++ .../namelist_definition_ctsm.xml | 5 + src/biogeochem/CNPhenologyMod.F90 | 6 +- src/biogeochem/CropType.F90 | 2 + src/cpl/share_esmf/cropcalStreamMod.F90 | 113 +++++++++++++++++- src/main/clm_driver.F90 | 2 +- src/main/clm_initializeMod.F90 | 2 +- src/main/clm_varctl.F90 | 1 + 8 files changed, 133 insertions(+), 5 deletions(-) diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index fb44023cd5..54752b6dbc 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -4198,10 +4198,14 @@ sub setup_logic_cropcal_streams { my $swindow_start_file = $nl->get_value('stream_fldFileName_swindow_start') ; my $swindow_end_file = $nl->get_value('stream_fldFileName_swindow_end') ; my $gdd_file = $nl->get_value('stream_fldFileName_cultivar_gdds') ; + my $gdd20_baseline_file = $nl->get_value('stream_fldFileName_gdd20_baseline') ; my $mesh_file = $nl->get_value('stream_meshfile_cropcal') ; if ( ($swindow_start_file eq '' and $swindow_start_file ne '') or ($swindow_start_file ne '' and $swindow_start_file eq '') ) { $log->fatal_error("When specifying sowing window dates, you must provide both swindow_start_file and swindow_end_file. To specify exact sowing dates, use the same file." ); } + if ( $gdd_file eq '' and $gdd20_baseline_file ne '' ) { + $log->fatal_error("If not providing stream_fldFileName_cultivar_gdds, don't provide stream_fldFileName_gdd20_baseline"); + } if ( $generate_crop_gdds eq '.true.' ) { if ( $use_mxmat eq '.true.' ) { $log->fatal_error("If generate_crop_gdds is true, you must also set use_mxmat to false" ); @@ -4215,6 +4219,9 @@ sub setup_logic_cropcal_streams { if ( $gdd_file ne '' ) { $log->fatal_error("If generate_crop_gdds is true, do not specify stream_fldFileName_cultivar_gdds") } + if ( $gdd20_baseline_file ne '' ) { + $log->fatal_error("If generate_crop_gdds is true, do not specify stream_fldFileName_gdd20_baseline") + } } if ( $mesh_file eq '' and ( $swindow_start_file ne '' or $gdd_file ne '' ) ) { $log->fatal_error("If prescribing crop sowing dates and/or maturity requirements, you must specify stream_meshfile_cropcal") diff --git a/bld/namelist_files/namelist_definition_ctsm.xml b/bld/namelist_files/namelist_definition_ctsm.xml index 37c457141c..c88e987756 100644 --- a/bld/namelist_files/namelist_definition_ctsm.xml +++ b/bld/namelist_files/namelist_definition_ctsm.xml @@ -1808,6 +1808,11 @@ Filename of input stream data for date (day of year) of end of sowing window. Ce Filename of input stream data for cultivar growing degree-day targets + +Filename of input stream data for baseline GDD20 values + + Filename of input stream data for crop calendar inputs diff --git a/src/biogeochem/CNPhenologyMod.F90 b/src/biogeochem/CNPhenologyMod.F90 index efc581cffc..f1f2d5fcc0 100644 --- a/src/biogeochem/CNPhenologyMod.F90 +++ b/src/biogeochem/CNPhenologyMod.F90 @@ -2559,7 +2559,7 @@ subroutine PlantCrop(p, leafcn_in, jday, kyr, do_plant_normal, & ! !USES: use clm_varctl , only : use_c13, use_c14 - use clm_varctl , only : use_cropcal_rx_cultivar_gdds, use_cropcal_streams + use clm_varctl , only : use_cropcal_rx_cultivar_gdds, use_cropcal_streams, adapt_cropcal_rx_cultivar_gdds use clm_varcon , only : c13ratio, c14ratio use clm_varpar , only : mxsowings use pftconMod , only : ntmp_corn, nswheat, nwwheat, ntmp_soybean @@ -2694,6 +2694,10 @@ subroutine PlantCrop(p, leafcn_in, jday, kyr, do_plant_normal, & if (use_cropcal_rx_cultivar_gdds .and. crop_inst%rx_cultivar_gdds_thisyr_patch(p,sowing_count(p)) .ge. 0._r8) then gddmaturity(p) = crop_inst%rx_cultivar_gdds_thisyr_patch(p,sowing_count(p)) did_rx_gdds = .true. + if (adapt_cropcal_rx_cultivar_gdds) then + gddmaturity(p) = gddmaturity(p) * gdd20 / crop_inst%gdd20_baseline_patch(p) + !TODO SSR: Set maximum gddmaturity + end if else if (ivt(p) == nwwheat .or. ivt(p) == nirrig_wwheat) then gddmaturity(p) = hybgdd(ivt(p)) else diff --git a/src/biogeochem/CropType.F90 b/src/biogeochem/CropType.F90 index 760aa21b76..a7bccf1a73 100644 --- a/src/biogeochem/CropType.F90 +++ b/src/biogeochem/CropType.F90 @@ -52,6 +52,7 @@ module CropType integer , pointer :: rx_swindow_starts_thisyr_patch(:,:) ! all prescribed sowing window start dates for this patch this year (day of year) [patch, mxsowings] integer , pointer :: rx_swindow_ends_thisyr_patch (:,:) ! all prescribed sowing window end dates for this patch this year (day of year) [patch, mxsowings] real(r8), pointer :: rx_cultivar_gdds_thisyr_patch (:,:) ! all cultivar GDD targets for this patch this year (ddays) [patch, mxsowings] + real(r8), pointer :: gdd20_baseline_patch (:) ! GDD20 baseline for this patch (ddays) [patch] real(r8), pointer :: sdates_thisyr_patch (:,:) ! all actual sowing dates for this patch this year (day of year) [patch, mxsowings] real(r8), pointer :: swindow_starts_thisyr_patch(:,:) ! all sowing window start dates for this patch this year (day of year) [patch, mxsowings] real(r8), pointer :: swindow_ends_thisyr_patch (:,:) ! all sowing window end dates for this patch this year (day of year) [patch, mxsowings] @@ -235,6 +236,7 @@ subroutine InitAllocate(this, bounds) allocate(this%rx_swindow_starts_thisyr_patch(begp:endp,1:mxsowings)); this%rx_swindow_starts_thisyr_patch(:,:) = -1 allocate(this%rx_swindow_ends_thisyr_patch(begp:endp,1:mxsowings)) ; this%rx_swindow_ends_thisyr_patch (:,:) = -1 allocate(this%rx_cultivar_gdds_thisyr_patch(begp:endp,1:mxsowings)) ; this%rx_cultivar_gdds_thisyr_patch(:,:) = spval + allocate(this%gdd20_baseline_patch(begp:endp)) ; this%gdd20_baseline_patch(:) = spval allocate(this%sdates_thisyr_patch(begp:endp,1:mxsowings)) ; this%sdates_thisyr_patch(:,:) = spval allocate(this%swindow_starts_thisyr_patch(begp:endp,1:mxsowings)) ; this%swindow_starts_thisyr_patch(:,:) = spval allocate(this%swindow_ends_thisyr_patch (begp:endp,1:mxsowings)) ; this%swindow_ends_thisyr_patch (:,:) = spval diff --git a/src/cpl/share_esmf/cropcalStreamMod.F90 b/src/cpl/share_esmf/cropcalStreamMod.F90 index 75c3820e7e..83f7fc0eb0 100644 --- a/src/cpl/share_esmf/cropcalStreamMod.F90 +++ b/src/cpl/share_esmf/cropcalStreamMod.F90 @@ -15,6 +15,7 @@ module cropcalStreamMod use abortutils , only : endrun use clm_varctl , only : iulog use clm_varctl , only : use_cropcal_rx_swindows, use_cropcal_rx_cultivar_gdds, use_cropcal_streams + use clm_varctl , only : adapt_cropcal_rx_cultivar_gdds use clm_varpar , only : mxpft use clm_varpar , only : mxsowings use perf_mod , only : t_startf, t_stopf @@ -36,13 +37,16 @@ module cropcalStreamMod type(shr_strdata_type) :: sdat_cropcal_swindow_start ! sowing window start input data stream type(shr_strdata_type) :: sdat_cropcal_swindow_end ! sowing window end input data stream type(shr_strdata_type) :: sdat_cropcal_cultivar_gdds ! maturity requirement input data stream + type(shr_strdata_type) :: sdat_cropcal_gdd20_baseline ! GDD20 baseline input data stream character(len=CS), allocatable :: stream_varnames_sdate(:) ! used for both start and end dates character(len=CS), allocatable :: stream_varnames_cultivar_gdds(:) + character(len=CS), allocatable :: stream_varnames_gdd20_baseline(:) integer :: ncft ! Number of crop functional types (excl. generic crops) logical :: allow_invalid_swindow_inputs ! Fall back on paramfile sowing windows in cases of invalid values in stream_fldFileName_swindow_start and _end? character(len=CL) :: stream_fldFileName_swindow_start ! sowing window start stream filename to read character(len=CL) :: stream_fldFileName_swindow_end ! sowing window end stream filename to read character(len=CL) :: stream_fldFileName_cultivar_gdds ! cultivar growing degree-days stream filename to read + character(len=CL) :: stream_fldFileName_gdd20_baseline ! GDD20 baseline stream filename to read character(len=*), parameter :: sourcefile = & __FILE__ @@ -90,6 +94,7 @@ subroutine cropcal_init(bounds) stream_fldFileName_swindow_start, & stream_fldFileName_swindow_end, & stream_fldFileName_cultivar_gdds, & + stream_fldFileName_gdd20_baseline, & stream_meshfile_cropcal ! Default values for namelist @@ -101,14 +106,17 @@ subroutine cropcal_init(bounds) stream_fldFileName_swindow_start = '' stream_fldFileName_swindow_end = '' stream_fldFileName_cultivar_gdds = '' + stream_fldFileName_gdd20_baseline = '' ! Will need modification to work with mxsowings > 1 ncft = mxpft - npcropmin + 1 ! Ignores generic crops allocate(stream_varnames_sdate(ncft)) allocate(stream_varnames_cultivar_gdds(ncft)) + allocate(stream_varnames_gdd20_baseline(ncft)) do n = 1,ncft ivt = npcropmin + n - 1 write(stream_varnames_sdate(n),'(a,i0)') "sdate1_",ivt write(stream_varnames_cultivar_gdds(n),'(a,i0)') "gdd1_",ivt + write(stream_varnames_gdd20_baseline(n),'(a,i0)') "gdd20bl_",ivt end do ! Read cropcal_streams namelist @@ -132,6 +140,7 @@ subroutine cropcal_init(bounds) call shr_mpi_bcast(stream_fldFileName_swindow_start, mpicom) call shr_mpi_bcast(stream_fldFileName_swindow_end , mpicom) call shr_mpi_bcast(stream_fldFileName_cultivar_gdds, mpicom) + call shr_mpi_bcast(stream_fldFileName_gdd20_baseline, mpicom) call shr_mpi_bcast(stream_meshfile_cropcal , mpicom) if (masterproc) then @@ -144,10 +153,12 @@ subroutine cropcal_init(bounds) write(iulog,'(a,a)' ) ' stream_fldFileName_swindow_start = ',trim(stream_fldFileName_swindow_start) write(iulog,'(a,a)' ) ' stream_fldFileName_swindow_end = ',trim(stream_fldFileName_swindow_end) write(iulog,'(a,a)' ) ' stream_fldFileName_cultivar_gdds = ',trim(stream_fldFileName_cultivar_gdds) + write(iulog,'(a,a)' ) ' stream_fldFileName_gdd20_baseline = ',trim(stream_fldFileName_gdd20_baseline) write(iulog,'(a,a)' ) ' stream_meshfile_cropcal = ',trim(stream_meshfile_cropcal) do n = 1,ncft write(iulog,'(a,a)' ) ' stream_varnames_sdate = ',trim(stream_varnames_sdate(n)) write(iulog,'(a,a)' ) ' stream_varnames_cultivar_gdds = ',trim(stream_varnames_cultivar_gdds(n)) + write(iulog,'(a,a)' ) ' stream_varnames_gdd20_baseline = ',trim(stream_varnames_gdd20_baseline(n)) end do write(iulog,*) endif @@ -155,6 +166,7 @@ subroutine cropcal_init(bounds) ! CLMBuildNamelist checks that both start and end files are provided if either is use_cropcal_rx_swindows = stream_fldFileName_swindow_start /= '' use_cropcal_rx_cultivar_gdds = stream_fldFileName_cultivar_gdds /= '' + adapt_cropcal_rx_cultivar_gdds = stream_fldFileName_gdd20_baseline /= '' use_cropcal_streams = use_cropcal_rx_swindows .or. use_cropcal_rx_cultivar_gdds if (use_cropcal_rx_swindows) then @@ -242,6 +254,36 @@ subroutine cropcal_init(bounds) end if end if + ! Initialize the cdeps data type sdat_cropcal_gdd20_baseline + ! NOTE: stream_dtlimit 1.5 didn't work for some reason + !TODO SSR: Do not allow time axis length > 1 + if (adapt_cropcal_rx_cultivar_gdds) then + call shr_strdata_init_from_inline(sdat_cropcal_gdd20_baseline, & + my_task = iam, & + logunit = iulog, & + compname = 'LND', & + model_clock = model_clock, & + model_mesh = mesh, & + stream_meshfile = trim(stream_meshfile_cropcal), & + stream_lev_dimname = 'null', & + stream_mapalgo = 'bilinear', & + stream_filenames = (/trim(stream_fldFileName_gdd20_baseline)/), & + stream_fldlistFile = stream_varnames_gdd20_baseline, & + stream_fldListModel = stream_varnames_gdd20_baseline, & + stream_yearFirst = 2000, & + stream_yearLast = 2000, & + stream_yearAlign = 2000, & + stream_offset = cropcal_offset, & + stream_taxmode = 'extend', & + stream_dtlimit = 1.0e30_r8, & + stream_tintalgo = cropcal_tintalgo, & + stream_name = 'GDD20 baseline data', & + rc = rc) + if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) then + call ESMF_Finalize(endflag=ESMF_END_ABORT) + end if + end if + end subroutine cropcal_init !================================================================ @@ -285,6 +327,8 @@ subroutine cropcal_advance( bounds ) end if end if + ! GDD20 baseline values do not have an associated time axis and thus will not be advanced here + if ( .not. allocated(g_to_ig) )then allocate (g_to_ig(bounds%begg:bounds%endg) ) ig = 0 @@ -298,7 +342,7 @@ end subroutine cropcal_advance !================================================================ - subroutine cropcal_interp(bounds, num_pcropp, filter_pcropp, crop_inst) + subroutine cropcal_interp(bounds, num_pcropp, filter_pcropp, init, crop_inst) ! ! Interpolate data stream information for crop calendars. ! @@ -314,6 +358,7 @@ subroutine cropcal_interp(bounds, num_pcropp, filter_pcropp, crop_inst) type(bounds_type) , intent(in) :: bounds integer , intent(in) :: num_pcropp ! number of prog. crop patches in filter integer , intent(in) :: filter_pcropp(:) ! filter for prognostic crop patches + logical , intent(in) :: init ! is this being called as initialization? type(crop_type) , intent(inout) :: crop_inst ! ! !LOCAL VARIABLES: @@ -327,9 +372,11 @@ subroutine cropcal_interp(bounds, num_pcropp, filter_pcropp, crop_inst) real(r8), pointer :: dataptr1d_swindow_start(:) real(r8), pointer :: dataptr1d_swindow_end (:) real(r8), pointer :: dataptr1d_cultivar_gdds(:) + real(r8), pointer :: dataptr1d_gdd20_baseline(:) real(r8), pointer :: dataptr2d_swindow_start(:,:) real(r8), pointer :: dataptr2d_swindow_end (:,:) real(r8), pointer :: dataptr2d_cultivar_gdds(:,:) + real(r8), pointer :: dataptr2d_gdd20_baseline(:,:) !----------------------------------------------------------------------- associate( & @@ -345,7 +392,7 @@ subroutine cropcal_interp(bounds, num_pcropp, filter_pcropp, crop_inst) lsize = bounds%endg - bounds%begg + 1 begp = bounds%begp - endp= bounds%endp + endp = bounds%endp dayspyr = get_curr_days_per_year() @@ -494,6 +541,68 @@ subroutine cropcal_interp(bounds, num_pcropp, filter_pcropp, crop_inst) deallocate(dataptr2d_cultivar_gdds) + allocate(dataptr2d_gdd20_baseline(lsize, ncft)) + if (adapt_cropcal_rx_cultivar_gdds .and. init) then + ! Read GDD20 baselines from input files + ! Starting with npcropmin will skip generic crops + do n = 1, ncft + call dshr_fldbun_getFldPtr(sdat_cropcal_gdd20_baseline%pstrm(1)%fldbun_model, trim(stream_varnames_gdd20_baseline(n)), & + fldptr1=dataptr1d_gdd20_baseline, rc=rc) + if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) then + call ESMF_Finalize(endflag=ESMF_END_ABORT) + end if + + ! Note that the size of dataptr1d includes ocean points so it will be around 3x larger than lsize + ! So an explicit loop is required here + do g = 1,lsize + + ! Ensure valid values + if (dataptr1d_gdd20_baseline(g) < 0 .or. dataptr1d_gdd20_baseline(g) > 1000000._r8) then + write(iulog, *) 'ERROR: invalid read-in gdd20_baseline value: ',dataptr1d_gdd20_baseline(g) + call ESMF_Finalize(endflag=ESMF_END_ABORT) + else if (dataptr1d_gdd20_baseline(g) == 0) then + write(iulog, *) 'ERROR: read-in gdd20_baseline value 0 will cause inf' + call ESMF_Finalize(endflag=ESMF_END_ABORT) + end if + + dataptr2d_gdd20_baseline(g,n) = dataptr1d_gdd20_baseline(g) + end do + end do + + ! Set gdd20_baseline_patch for each gridcell/patch combination + do fp = 1, num_pcropp + p = filter_pcropp(fp) + + ivt = patch%itype(p) + ! Will skip generic crops + if (ivt >= npcropmin) then + n = ivt - npcropmin + 1 + + if (n > ncft) then + write(iulog,'(a,i0,a,i0,a)') 'n (',n,') > ncft (',ncft,')' + call ESMF_Finalize(endflag=ESMF_END_ABORT) + end if + + ! vegetated pft + ig = g_to_ig(patch%gridcell(p)) + + if (ig > lsize) then + write(iulog,'(a,i0,a,i0,a)') 'ig (',ig,') > lsize (',lsize,')' + call ESMF_Finalize(endflag=ESMF_END_ABORT) + end if + + crop_inst%gdd20_baseline_patch(p) = dataptr2d_gdd20_baseline(ig,n) + + else + write(iulog,'(a,i0)') 'cropcal_interp(), rx_gdd20_baseline: Crop patch has ivt ',ivt + call ESMF_Finalize(endflag=ESMF_END_ABORT) + endif + end do + end if ! adapt_cropcal_rx_cultivar_gdds + + deallocate(dataptr2d_gdd20_baseline) + + end associate end subroutine cropcal_interp diff --git a/src/main/clm_driver.F90 b/src/main/clm_driver.F90 index c4fa1b53f4..2a3cef4b8b 100644 --- a/src/main/clm_driver.F90 +++ b/src/main/clm_driver.F90 @@ -1079,7 +1079,7 @@ subroutine clm_drv(doalb, nextsw_cday, declinp1, declin, rstwr, nlend, rdate, ro ! Update crop calendars ! ============================================================================ call cropcal_interp(bounds_clump, filter_inactive_and_active(nc)%num_pcropp, & - filter_inactive_and_active(nc)%pcropp, crop_inst) + filter_inactive_and_active(nc)%pcropp, .false., crop_inst) end if ! ============================================================================ diff --git a/src/main/clm_initializeMod.F90 b/src/main/clm_initializeMod.F90 index 9bf0cc59a2..e8f70bdef8 100644 --- a/src/main/clm_initializeMod.F90 +++ b/src/main/clm_initializeMod.F90 @@ -667,7 +667,7 @@ subroutine initialize2(ni,nj) do nc = 1,nclumps call get_clump_bounds(nc, bounds_clump) call cropcal_interp(bounds_clump, filter_inactive_and_active(nc)%num_pcropp, & - filter_inactive_and_active(nc)%pcropp, crop_inst) + filter_inactive_and_active(nc)%pcropp, .true., crop_inst) end do !$OMP END PARALLEL DO end if diff --git a/src/main/clm_varctl.F90 b/src/main/clm_varctl.F90 index 7d0b2b55ad..fe67380fd2 100644 --- a/src/main/clm_varctl.F90 +++ b/src/main/clm_varctl.F90 @@ -391,6 +391,7 @@ module clm_varctl logical, public :: use_cropcal_streams = .false. logical, public :: use_cropcal_rx_swindows = .false. logical, public :: use_cropcal_rx_cultivar_gdds = .false. + logical, public :: adapt_cropcal_rx_cultivar_gdds = .false. !---------------------------------------------------------- ! biomass heat storage switch From b73bcfdd104d8d591afb41ef6d6c18398cf8ef69 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Thu, 23 May 2024 15:09:16 -0600 Subject: [PATCH 0348/1248] =?UTF-8?q?Don't=20adapt=20rx=20cultivar=20gdd?= =?UTF-8?q?=20reqts=20if=20baseline=20gdd20=20is=20=E2=89=A40.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/biogeochem/CNPhenologyMod.F90 | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/biogeochem/CNPhenologyMod.F90 b/src/biogeochem/CNPhenologyMod.F90 index f1f2d5fcc0..cfeee0b867 100644 --- a/src/biogeochem/CNPhenologyMod.F90 +++ b/src/biogeochem/CNPhenologyMod.F90 @@ -143,6 +143,9 @@ module CNPhenologyMod logical, public :: generate_crop_gdds = .false. ! If true, harvest the day before next sowing logical, public :: use_mxmat = .true. ! If true, ignore crop maximum growing season length + ! For use with adapt_cropcal_rx_cultivar_gdds .true. + real(r8), parameter :: min_gdd20_baseline = 0._r8 ! If gdd20_baseline_patch is ≤ this, do not consider baseline. + ! Constants for seasonal decidious leaf onset and offset logical, private :: onset_thresh_depends_on_veg = .false. ! If onset threshold depends on vegetation type integer, public, parameter :: critical_daylight_constant = 1 @@ -2694,9 +2697,9 @@ subroutine PlantCrop(p, leafcn_in, jday, kyr, do_plant_normal, & if (use_cropcal_rx_cultivar_gdds .and. crop_inst%rx_cultivar_gdds_thisyr_patch(p,sowing_count(p)) .ge. 0._r8) then gddmaturity(p) = crop_inst%rx_cultivar_gdds_thisyr_patch(p,sowing_count(p)) did_rx_gdds = .true. - if (adapt_cropcal_rx_cultivar_gdds) then + if (adapt_cropcal_rx_cultivar_gdds .and. crop_inst%gdd20_baseline_patch(p) > min_gdd20_baseline) then gddmaturity(p) = gddmaturity(p) * gdd20 / crop_inst%gdd20_baseline_patch(p) - !TODO SSR: Set maximum gddmaturity + !TODO SSR: Set maximum and minimum gddmaturity end if else if (ivt(p) == nwwheat .or. ivt(p) == nirrig_wwheat) then gddmaturity(p) = hybgdd(ivt(p)) From 20f32c1d70d709a96416c70a1d143d142b52fecf Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Fri, 24 May 2024 12:45:18 -0600 Subject: [PATCH 0349/1248] Ignore 'invalid' values in stream_fldFileName_gdd20_baseline on read. They're being handled in PlantCrop() instead. (cherry picked from commit 045b3d72c54319769e50500b2bd445215e07446d) --- src/cpl/share_esmf/cropcalStreamMod.F90 | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/src/cpl/share_esmf/cropcalStreamMod.F90 b/src/cpl/share_esmf/cropcalStreamMod.F90 index 83f7fc0eb0..f60ab51000 100644 --- a/src/cpl/share_esmf/cropcalStreamMod.F90 +++ b/src/cpl/share_esmf/cropcalStreamMod.F90 @@ -555,16 +555,6 @@ subroutine cropcal_interp(bounds, num_pcropp, filter_pcropp, init, crop_inst) ! Note that the size of dataptr1d includes ocean points so it will be around 3x larger than lsize ! So an explicit loop is required here do g = 1,lsize - - ! Ensure valid values - if (dataptr1d_gdd20_baseline(g) < 0 .or. dataptr1d_gdd20_baseline(g) > 1000000._r8) then - write(iulog, *) 'ERROR: invalid read-in gdd20_baseline value: ',dataptr1d_gdd20_baseline(g) - call ESMF_Finalize(endflag=ESMF_END_ABORT) - else if (dataptr1d_gdd20_baseline(g) == 0) then - write(iulog, *) 'ERROR: read-in gdd20_baseline value 0 will cause inf' - call ESMF_Finalize(endflag=ESMF_END_ABORT) - end if - dataptr2d_gdd20_baseline(g,n) = dataptr1d_gdd20_baseline(g) end do end do From a7cd0573ddfdef805f97c1f9aba3083492515ca3 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Fri, 24 May 2024 14:05:36 -0600 Subject: [PATCH 0350/1248] Add generate_gdd20_baseline tool. (cherry picked from commit 3ae50b7402fb1e3580f11ba09883e9ddaa563fda) --- .../crop_calendars/generate_gdd20_baseline.py | 243 ++++++++++++++++++ tools/crop_calendars/generate_gdd20_baseline | 19 ++ 2 files changed, 262 insertions(+) create mode 100644 python/ctsm/crop_calendars/generate_gdd20_baseline.py create mode 100755 tools/crop_calendars/generate_gdd20_baseline diff --git a/python/ctsm/crop_calendars/generate_gdd20_baseline.py b/python/ctsm/crop_calendars/generate_gdd20_baseline.py new file mode 100644 index 0000000000..d5cbd779e0 --- /dev/null +++ b/python/ctsm/crop_calendars/generate_gdd20_baseline.py @@ -0,0 +1,243 @@ +""" +Generate stream_fldFileName_gdd20_baseline file from CTSM outputs +""" + +import sys +import argparse +import os +import datetime as dt +import numpy as np +import xarray as xr +import cftime + +# -- add python/ctsm to path (needed if we want to run generate_gdd20_baseline stand-alone) +_CTSM_PYTHON = os.path.join(os.path.dirname(os.path.realpath(__file__)), os.pardir, os.pardir) +sys.path.insert(1, _CTSM_PYTHON) + +# pylint: disable=wrong-import-position +from ctsm.crop_calendars.import_ds import import_ds +import ctsm.crop_calendars.cropcal_utils as utils + +VAR_LIST_IN = ["GDD0", "GDD8", "GDD10"] +VAR_LIST_IN = [x + "20" for x in VAR_LIST_IN] # TODO: Delete this once using the right variables +MISSING_FILL = -1 # Something negative to ensure that gddmaturity never changes (see PlantCrop) +STREAM_YEAR = 2000 # The year specified for stream_yearFirst and stream_yearLast in the call of + # shr_strdata_init_from_inline() for sdat_cropcal_gdd20_baseline + + +def _parse_args(): + """ + Set up and parse input arguments + """ + parser = argparse.ArgumentParser( + description=( + "Given a list of CTSM history files, generate stream_fldFileName_gdd20_baseline input" + + "file from the GDD0, GDD8, and GDD10 variables." + ) + ) + + # Required + parser.add_argument( + "-i", + "--input-files", + help="Space-separated string of CTSM history files", + type=str, + required=True, + ) + parser.add_argument( + "-o", + "--output-file", + help="Path to which output file should be saved", + type=str, + required=True, + ) + parser.add_argument( + "-a", + "--author", + help=( + "String to be saved in author attribute of output files." + + "E.g., 'Author Name (authorname@ucar.edu)'" + ), + type=str, + required=True, + ) + + # Optional + parser.add_argument( + "--overwrite", + help="Overwrite existing output file, if any", + action="store_true", + ) + + # Get arguments + args = parser.parse_args(sys.argv[1:]) + + # Check arguments + if os.path.exists(args.output_file) and not args.overwrite: + raise FileExistsError("Output file exists but --overwrite is not specified") + + return args + + +def _get_cft_list(crop_list): + """ + Given a list of strings, return a list of CFT names that contain any of those strings. + Will include both irrigated and rainfed! + + Args: + crop_list (list): List of crops to look for. + E.g.: ["corn", "cotton"] + + Returns: + cft_str_list: List of CFTs containing any of the crop names in crop_list. + E.g.: ["tropical_corn", "irrigated_tropical_corn", + "temperate_corn", "irrigated_temperate_corn", + "cotton", "irrigated_cotton"] + """ + + mgdcrop_list = utils.define_mgdcrop_list() + cft_str_list = [] + for crop_str in crop_list: + cft_str_list += [x for x in mgdcrop_list if crop_str in x] + return cft_str_list + + +def _get_gddn_for_cft(cft_str): + """ + Given a CFT name, return the GDDN variable it uses. + + Args: + cft_str (str): E.g., "irrigated_temperate_corn" + + Returns: + str or None: Name of variable to use (e.g., "GDD8"). If crop isn't yet handled, return None. + """ + + gddn = None + + gdd0_list_str = ["wheat", "cotton", "rice"] + if cft_str in _get_cft_list(gdd0_list_str): + gddn = "GDD0" + + gdd8_list_str = ["corn", "sugarcane", "miscanthus", "switchgrass"] + if cft_str in _get_cft_list(gdd8_list_str): + gddn = "GDD8" + + gdd10_list_str = ["soybean"] + if cft_str in _get_cft_list(gdd10_list_str): + gddn = "GDD10" + + # TODO: Delete this once using the right variables + if gddn is not None: + gddn += "20" + + return gddn + + +def _get_output_varname(cft_str): + cft_int = utils.vegtype_str2int(cft_str)[0] + return f"gdd20bl_{cft_int}" + + +def _add_time_axis(da_in): + """ + Adds a size-1 time axis to a DataArray. Needed because CDEPS streams code requires a time axis, + even if the data in question is not supposed to vary over time. + + Args: + da_in (DataArray): xarray DataArray which needs a time axis added + + Returns: + DataArray: da_in with a new 1-step time axis + """ + this_date = np.array(cftime.DatetimeNoLeap(STREAM_YEAR, 1, 1, 0, 0, 0, 0, has_year_zero=True)) + this_date = np.expand_dims(this_date, axis=0) + da_time = xr.DataArray( + data=this_date, + dims={"time": this_date}, + ) + da_out = da_in.expand_dims(time=da_time) + return da_out + + +def generate_gdd20_baseline(input_files, output_file, author): + """ + Generate stream_fldFileName_gdd20_baseline file from CTSM outputs + """ + + # Get input file list + input_files = input_files.split(sep=" ") + # Get unique values and sort + input_files = list(set(input_files)) + input_files.sort() + + # Import history files and ensure they have lat/lon dims + ds_in = import_ds(input_files, VAR_LIST_IN) + if not all(x in ds_in.dims for x in ["lat", "lon"]): + raise RuntimeError("Input files must have lat and lon dimensions") + + # If needed, find mean over time + if "time" in ds_in.dims: + ds_in = ds_in.mean(dim="time", skipna=True) + + # Set up a dummy DataArray to use for crops without an assigned GDDN variable + dummy_da = xr.DataArray( + data=MISSING_FILL * np.ones_like(ds_in[VAR_LIST_IN[0]].values), + dims=ds_in[VAR_LIST_IN[0]].dims, + coords=ds_in[VAR_LIST_IN[0]].coords, + ) + dummy_da = _add_time_axis(dummy_da) + + # Process all crops + ds_out = xr.Dataset( + data_vars=None, + attrs={ + "author": author, + "created": dt.datetime.now().astimezone().isoformat(), + }, + ) + for cft_str in utils.define_mgdcrop_list(): + cft_int = utils.vegtype_str2int(cft_str)[0] + print(f"{cft_str} ({cft_int})") + + # Which GDDN history variable does this crop use? E.g., GDD0, GDD10 + gddn = _get_gddn_for_cft(cft_str) + + # Fill any missing values with MISSING_FILL. This will mean that gddmaturity in these cells + # never changes. + if gddn is None: + # Crop not handled yet? Fill it entirely with missing value + this_da = dummy_da + long_name = "Dummy GDD20" + print(" dummy GDD20") + else: + this_da = ds_in[gddn].fillna(MISSING_FILL) + this_da = _add_time_axis(this_da) + long_name = gddn + print(f" {gddn}") + + # Add attributes + this_da.attrs["long_name"] = long_name + f" baseline for {cft_str}" + this_da.attrs["units"] = "°C days" + + # Copy that to ds_out + var_out = _get_output_varname(cft_str) + print(f" Output variable {var_out}") + ds_out[var_out] = this_da + + # Save + ds_out.to_netcdf(output_file) + + print("Done!") + + +def main(): + """ + main() function for calling generate_gdd20_baseline.py from command line. + """ + args = _parse_args() + generate_gdd20_baseline( + args.input_files, + args.output_file, + args.author, + ) diff --git a/tools/crop_calendars/generate_gdd20_baseline b/tools/crop_calendars/generate_gdd20_baseline new file mode 100755 index 0000000000..a0238c8d0f --- /dev/null +++ b/tools/crop_calendars/generate_gdd20_baseline @@ -0,0 +1,19 @@ +#!/usr/bin/env python3 +""" +For description and instructions, please see README. +""" + +import os +import sys + +_CTSM_PYTHON = os.path.join(os.path.dirname(os.path.realpath(__file__)), + os.pardir, + os.pardir, + 'python') +sys.path.insert(1, _CTSM_PYTHON) + +from ctsm.crop_calendars.generate_gdd20_baseline import main + +if __name__ == "__main__": + main() + From fd5f177131d63d39e79a13918390bdfb642d781e Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Tue, 28 May 2024 11:27:09 -0600 Subject: [PATCH 0351/1248] Format generate_gdd20_baseline.py with black. --- python/ctsm/crop_calendars/generate_gdd20_baseline.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/ctsm/crop_calendars/generate_gdd20_baseline.py b/python/ctsm/crop_calendars/generate_gdd20_baseline.py index d5cbd779e0..d28bfda0e7 100644 --- a/python/ctsm/crop_calendars/generate_gdd20_baseline.py +++ b/python/ctsm/crop_calendars/generate_gdd20_baseline.py @@ -22,7 +22,7 @@ VAR_LIST_IN = [x + "20" for x in VAR_LIST_IN] # TODO: Delete this once using the right variables MISSING_FILL = -1 # Something negative to ensure that gddmaturity never changes (see PlantCrop) STREAM_YEAR = 2000 # The year specified for stream_yearFirst and stream_yearLast in the call of - # shr_strdata_init_from_inline() for sdat_cropcal_gdd20_baseline +# shr_strdata_init_from_inline() for sdat_cropcal_gdd20_baseline def _parse_args(): From 5eafae73aeeaec3950123a955d9c781d3840e157 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Tue, 28 May 2024 11:28:14 -0600 Subject: [PATCH 0352/1248] Add previous commit to .git-blame-ignore-revs. --- .git-blame-ignore-revs | 1 + 1 file changed, 1 insertion(+) diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs index e769d3187c..2620839223 100644 --- a/.git-blame-ignore-revs +++ b/.git-blame-ignore-revs @@ -26,6 +26,7 @@ d866510188d26d51bcd6d37239283db690af7e82 0dcd0a3c1abcaffe5529f8d79a6bc34734b195c7 e096358c832ab292ddfd22dd5878826c7c788968 475831f0fb0e31e97f630eac4e078c886558b61c +fd5f177131d63d39e79a13918390bdfb642d781e # Ran SystemTests and python/ctsm through black python formatter 5364ad66eaceb55dde2d3d598fe4ce37ac83a93c 8056ae649c1b37f5e10aaaac79005d6e3a8b2380 From 348c39422bec5a28f99572bba353196d574491b5 Mon Sep 17 00:00:00 2001 From: "Danny M. Leung" Date: Tue, 28 May 2024 13:18:19 -0600 Subject: [PATCH 0353/1248] dmleung 28 May 2024: a small edit of DUSTMod.F90 to deal with the situation of dpfct_rock(p) = NaN, which likely causes the run to die when turning on debug mode --- src/biogeochem/DUSTMod.F90 | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/biogeochem/DUSTMod.F90 b/src/biogeochem/DUSTMod.F90 index e1348b8ebf..ffe74e6861 100644 --- a/src/biogeochem/DUSTMod.F90 +++ b/src/biogeochem/DUSTMod.F90 @@ -673,7 +673,14 @@ subroutine DustEmission (bounds, & ! calculation of the hybrid/total drag partition effect considering both rock and vegetation drag partitioning using LUH2 bare and veg fractions within a grid if (lun%itype(l) == istsoil .or. lun%itype(l) == istcrop) then if (patch%itype(p) == noveg) then ! if bare, uses rock drag partition factor - frc_thr_rgh_fct = dpfct_rock(p) + if (dpfct_rock(p) /= dpfct_rock(p)) then ! dmleung added 24 May 2024: dpfct_rock(p) could be NaN; CLM could run when DEBUG=FALSE in env_build.xml but dies when DEBUG=TRUE (usually when checking if wnd_frc_slt > wnd_frc_thr_slt_it and if numer/denom < 30._r8 below) + !write(iulog,*) 'dpfct_rock(p) == NaN; dpfct_rock(p) = ', dpfct_rock(p) + frc_thr_rgh_fct = 0.001_r8 ! Set drag partition effect to be a very small value (or zero) such that there is no emission whenever dpfct_rock(p) = NaN; dmleung 24 May 2024 + else + !write(iulog,*) 'dpfct_rock(p) = ', dpfct_rock(p) + frc_thr_rgh_fct = dpfct_rock(p) + end if + !frc_thr_rgh_fct = dpfct_rock(p) ! This should be the original code when dpfct_rock(p) has values everywhere else ! if vegetation, uses vegetation drag partition factor frc_thr_rgh_fct = ssr(p) end if @@ -681,7 +688,7 @@ subroutine DustEmission (bounds, & frc_thr_rgh_fct = 1.0_r8 end if - wnd_frc_slt = fv(p) * frc_thr_rgh_fct ! wnd_frc_slt will be used in the dust emission equation + wnd_frc_slt = fv(p) * frc_thr_rgh_fct ! wnd_frc_slt is the drag-parition-modified wind speed and will be used in the dust emission equation below frc_thr_rghn_fct(p) = frc_thr_rgh_fct ! save and output hybrid drag partition factor @@ -756,7 +763,7 @@ subroutine DustEmission (bounds, & numer = (u_fld_thr(p)**2.0_r8 - u_impct_thr(p)**2.0_r8 - 2.0_r8 * u_mean_slt(p) * (u_fld_thr(p) - u_impct_thr(p))) denom = (2.0_r8 * u_sd_slt(p)**2.0_r8) ! Truncate to zero if the expression inside exp is becoming too large - if ( numer/denom < 30._r8 )then + if ( numer/denom < 30._r8 .and. denom/=0.0_r8)then ! set numer/denom to be < 30 given exp(30) below is already very large; also set denom to be non-zero (and denom should be autonamtically non-negative given the standard deviation u_sd_slt of the subtimestep wind fluctuation is non-negative) thr_crs_rate(p) = (exp((u_fld_thr(p)**2.0_r8 - u_impct_thr(p)**2.0_r8 - 2.0_r8 * u_mean_slt(p) * (u_fld_thr(p) - u_impct_thr(p))) / (2.0_r8 * u_sd_slt(p)**2.0_r8)) + 1.0_r8)**(-1.0_r8) else thr_crs_rate(p) = 0.0_r8 From 26c1222668be7b2be11936d666be76916be1b751 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Tue, 28 May 2024 15:18:22 -0600 Subject: [PATCH 0354/1248] Update ChangeLog with latest info about tests --- doc/ChangeLog | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index e15c554f8f..b2f14a2c01 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,7 +1,7 @@ =============================================================== Tag name: ctsm5.2.006 Originator(s): slevis (Samuel Levis) -Date: Tue 28 May 2024 08:45:50 AM MDT +Date: Tue 28 May 2024 03:14:18 PM MDT One-line Summary: Update externals to cesm2_3_beta17, remove mct, retire /test/tools Purpose and description of changes @@ -68,15 +68,15 @@ Testing summary: any other testing (give details below): ctsm_sci - derecho ---- - -If the tag used for baseline comparisons was NOT the previous tag, note that here: + derecho ---- OK Answer changes -------------- Changes answers relative to baseline: NO + Except two derecho_nvhpc tests due to an update to the nvhpc compiler + as documented in the Pull Request listed a few lines down. Other details ------------- From f8eb462ca90c5d0d3edb122d0abeb0ce703ccb46 Mon Sep 17 00:00:00 2001 From: "Danny M. Leung" Date: Tue, 28 May 2024 17:36:41 -0600 Subject: [PATCH 0355/1248] dmleung added comments on the positive denom required for dust emission intermittency in DUSTMod.F90. 28 May 2024 --- src/biogeochem/DUSTMod.F90 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/biogeochem/DUSTMod.F90 b/src/biogeochem/DUSTMod.F90 index ffe74e6861..b23a26b429 100644 --- a/src/biogeochem/DUSTMod.F90 +++ b/src/biogeochem/DUSTMod.F90 @@ -761,9 +761,9 @@ subroutine DustEmission (bounds, & ! threshold crossing rate numer = (u_fld_thr(p)**2.0_r8 - u_impct_thr(p)**2.0_r8 - 2.0_r8 * u_mean_slt(p) * (u_fld_thr(p) - u_impct_thr(p))) - denom = (2.0_r8 * u_sd_slt(p)**2.0_r8) + denom = (2.0_r8 * u_sd_slt(p)**2.0_r8) ! note that u_sd_slt should be always positive ! Truncate to zero if the expression inside exp is becoming too large - if ( numer/denom < 30._r8 .and. denom/=0.0_r8)then ! set numer/denom to be < 30 given exp(30) below is already very large; also set denom to be non-zero (and denom should be autonamtically non-negative given the standard deviation u_sd_slt of the subtimestep wind fluctuation is non-negative) + if ( numer/denom < 30._r8 ) then ! set numer/denom to be < 30 given exp(30) below is already very large; also denom itself should be non-zero and non-negative given the standard deviation (u_sd_slt) of the subtimestep wind fluctuation is non-negative. dmleung 28 May 2024 thr_crs_rate(p) = (exp((u_fld_thr(p)**2.0_r8 - u_impct_thr(p)**2.0_r8 - 2.0_r8 * u_mean_slt(p) * (u_fld_thr(p) - u_impct_thr(p))) / (2.0_r8 * u_sd_slt(p)**2.0_r8)) + 1.0_r8)**(-1.0_r8) else thr_crs_rate(p) = 0.0_r8 From 38d6888fd04cef4f2d507df99e9c4d1a3a16c4ac Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Wed, 29 May 2024 07:50:21 -0600 Subject: [PATCH 0356/1248] Add testmods RxCropCals, RxCropCalsAdapt. --- .../testmods_dirs/clm/RxCropCals/include_user_mods | 1 + .../testdefs/testmods_dirs/clm/RxCropCals/user_nl_clm | 8 ++++++++ .../testmods_dirs/clm/RxCropCalsAdapt/include_user_mods | 1 + .../testmods_dirs/clm/RxCropCalsAdapt/user_nl_clm | 3 +++ 4 files changed, 13 insertions(+) create mode 100644 cime_config/testdefs/testmods_dirs/clm/RxCropCals/include_user_mods create mode 100644 cime_config/testdefs/testmods_dirs/clm/RxCropCals/user_nl_clm create mode 100644 cime_config/testdefs/testmods_dirs/clm/RxCropCalsAdapt/include_user_mods create mode 100644 cime_config/testdefs/testmods_dirs/clm/RxCropCalsAdapt/user_nl_clm diff --git a/cime_config/testdefs/testmods_dirs/clm/RxCropCals/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/RxCropCals/include_user_mods new file mode 100644 index 0000000000..23ea3745e6 --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/RxCropCals/include_user_mods @@ -0,0 +1 @@ +../crop diff --git a/cime_config/testdefs/testmods_dirs/clm/RxCropCals/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/RxCropCals/user_nl_clm new file mode 100644 index 0000000000..9cbfea97f0 --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/RxCropCals/user_nl_clm @@ -0,0 +1,8 @@ + +! Sowing windows +stream_fldFileName_swindow_start = '$DIN_LOC_ROOT/lnd/clm2/cropdata/calendars/processed/swindow_starts_ggcmi_crop_calendar_phase3_v1.01.2000-2000.20231005_145103.nc' +stream_fldFileName_swindow_end = '$DIN_LOC_ROOT/lnd/clm2/cropdata/calendars/processed/swindow_ends_ggcmi_crop_calendar_phase3_v1.01.2000-2000.20231005_145103.nc' +stream_fldFileName_cultivar_gdds = '$DIN_LOC_ROOT/lnd/clm2/cropdata/calendars/processed/gdds_20230829_161011.nc' +stream_year_first_cropcal = 2000 +stream_year_last_cropcal = 2000 +stream_meshfile_cropcal = '$DIN_LOC_ROOT/share/meshes/360x720_120830_ESMFmesh_c20210507_cdf5.nc' diff --git a/cime_config/testdefs/testmods_dirs/clm/RxCropCalsAdapt/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/RxCropCalsAdapt/include_user_mods new file mode 100644 index 0000000000..88c9694365 --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/RxCropCalsAdapt/include_user_mods @@ -0,0 +1 @@ +../RxCropCals diff --git a/cime_config/testdefs/testmods_dirs/clm/RxCropCalsAdapt/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/RxCropCalsAdapt/user_nl_clm new file mode 100644 index 0000000000..1bba9d2a89 --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/RxCropCalsAdapt/user_nl_clm @@ -0,0 +1,3 @@ + +! Eventually replace this with half-degree version in the proper place +stream_fldFileName_gdd20_baseline = '/glade/u/home/samrabin/ctsm_scale-mat-reqs/tools/crop_calendars/test.nc' From 5b40c489fcaa2650b02a3386b93e08e4b09e44b5 Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Wed, 29 May 2024 10:16:50 -0600 Subject: [PATCH 0357/1248] removed unnecessary zeroing calls for fates history, they are called internally now --- src/utils/clmfates_interfaceMod.F90 | 89 ++++++++++++++++++----------- 1 file changed, 56 insertions(+), 33 deletions(-) diff --git a/src/utils/clmfates_interfaceMod.F90 b/src/utils/clmfates_interfaceMod.F90 index fcd5cb5230..98845f8e62 100644 --- a/src/utils/clmfates_interfaceMod.F90 +++ b/src/utils/clmfates_interfaceMod.F90 @@ -135,6 +135,9 @@ module CLMFatesInterfaceMod use FatesInterfaceMod , only : DetermineGridCellNeighbors use FatesIOVariableKindMod, only : group_dyna_simple, group_dyna_complx + use FatesIOVariableKindMod, only : group_hifr_simple, group_hifr_complx + use FatesIOVariableKindMod, only : group_nflx_simple, group_nflx_complx + use FatesIOVariableKindMod, only : group_hydr_simple, group_hydr_complx use FatesHistoryInterfaceMod, only : fates_hist use FatesRestartInterfaceMod, only : fates_restart_interface_type @@ -1192,14 +1195,6 @@ subroutine dynamics_driv(this, nc, bounds_clump, & call this%WrapUpdateFatesSeedInOut(bounds_clump) end if - ! --------------------------------------------------------------------------------- - ! Flush arrays to values defined by %flushval (see registry entry in - ! subroutine define_history_vars() - ! --------------------------------------------------------------------------------- - call fates_hist%flush_hvars(nc,upfreq_in=group_dyna_simple) - - call fates_hist%flush_hvars(nc,upfreq_in=group_dyna_complx) - ! --------------------------------------------------------------------------------- ! Part II: Call the FATES model now that input boundary conditions have been ! provided. @@ -1970,23 +1965,38 @@ subroutine restart( this, bounds_proc, ncid, flag, waterdiagnosticbulk_inst, & this%fates(nc)%sites, & this%fates(nc)%bc_out) + ! ------------------------------------------------------------------------ - ! Update history IO fields that depend on ecosystem dynamics + ! Flush FATES history variables. + ! The flushing process sets all columns outside of FATES perview to + ! the ignore value. This only needs to be done once, because FATES will + ! not overwright values outside the columns that it is in charge of. ! ------------------------------------------------------------------------ - if(fates_history_dimlevel(2)>0) then + + ! tbd: fates_hist%flush_all_hvars(nc) + + if_dim1: if(fates_history_dimlevel(1)>0) then + call fates_hist%flush_hvars(nc,upfreq_in=group_hifr_simple) + if (use_fates_planthydro) then + call fates_hist%flush_hvars(nc,upfreq_in=group_hydr_simple) + end if + if(fates_history_dimlevel(1)>1) then + call fates_hist%flush_hvars(nc,upfreq_in=group_hifr_complx) + if (use_fates_planthydro) then + call fates_hist%flush_hvars(nc,upfreq_in=group_hydr_complx) + end if + end if + end if if_dim1 + + if_dim2: if(fates_history_dimlevel(2)>0) then call fates_hist%flush_hvars(nc,upfreq_in=group_dyna_simple) - do s = 1,this%fates(nc)%nsites - call fates_hist%zero_site_hvars(this%fates(nc)%sites(s), & - upfreq_in=group_dyna_simple) - end do + call fates_hist%flush_hvars(nc,upfreq_in=group_nflx_simple) if(fates_history_dimlevel(2)>1) then call fates_hist%flush_hvars(nc,upfreq_in=group_dyna_complx) - do s = 1,this%fates(nc)%nsites - call fates_hist%zero_site_hvars(this%fates(nc)%sites(s), & - upfreq_in=group_dyna_complx) - end do + call fates_hist%flush_hvars(nc,upfreq_in=group_nflx_complx) end if - end if + end if if_dim2 + call fates_hist%update_history_dyn( nc, & this%fates(nc)%nsites, & this%fates(nc)%sites, & @@ -2164,22 +2174,38 @@ subroutine init_coldstart(this, waterstatebulk_inst, waterdiagnosticbulk_inst, & soilbiogeochem_carbonflux_inst, .false.) ! ------------------------------------------------------------------------ - ! Update history IO fields that depend on ecosystem dynamics + ! Flush and zero FATES history variables. + ! The flushing process sets all columns outside of FATES perview to + ! the ignore value. This only needs to be done once, because FATES will + ! not overwright values outside the columns that it is in charge of. + ! We also start off by setting all values on FATES columns to zero. ! ------------------------------------------------------------------------ - if(fates_history_dimlevel(2)>0) then + + ! tbd: fates_hist%flush_all_hvars(nc) + + if_dim1: if(fates_history_dimlevel(1)>0) then + call fates_hist%flush_hvars(nc,upfreq_in=group_hifr_simple) + if (use_fates_planthydro) then + call fates_hist%flush_hvars(nc,upfreq_in=group_hydr_simple) + end if + if(fates_history_dimlevel(1)>1) then + call fates_hist%flush_hvars(nc,upfreq_in=group_hifr_complx) + if (use_fates_planthydro) then + call fates_hist%flush_hvars(nc,upfreq_in=group_hydr_complx) + end if + end if + end if if_dim1 + + if_dim2: if(fates_history_dimlevel(2)>0) then call fates_hist%flush_hvars(nc,upfreq_in=group_dyna_simple) - do s = 1,this%fates(nc)%nsites - call fates_hist%zero_site_hvars(this%fates(nc)%sites(s), & - upfreq_in=group_dyna_simple) - end do + call fates_hist%flush_hvars(nc,upfreq_in=group_nflx_simple) if(fates_history_dimlevel(2)>1) then call fates_hist%flush_hvars(nc,upfreq_in=group_dyna_complx) - do s = 1,this%fates(nc)%nsites - call fates_hist%zero_site_hvars(this%fates(nc)%sites(s), & - upfreq_in=group_dyna_complx) - end do + call fates_hist%flush_hvars(nc,upfreq_in=group_nflx_complx) end if - end if + end if if_dim2 + + call fates_hist%update_history_dyn( nc, & this%fates(nc)%nsites, & this%fates(nc)%sites, & @@ -3570,9 +3596,6 @@ subroutine wrap_hydraulics_drive(this, bounds_clump, nc, & this%fates(nc)%bc_out(s)%plant_stored_h2o_si end do - - ! Update History Buffers that need to be updated after hydraulics calls - call fates_hist%update_history_hydraulics(nc, & this%fates(nc)%nsites, & this%fates(nc)%sites, & From 51079bfb92ca2d75a71cfee5679bbce40314eaae Mon Sep 17 00:00:00 2001 From: Jim Edwards Date: Wed, 29 May 2024 10:17:10 -0600 Subject: [PATCH 0358/1248] update run_sys_tests.py for fleximod --- python/ctsm/run_sys_tests.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/python/ctsm/run_sys_tests.py b/python/ctsm/run_sys_tests.py index de93081504..ecea2342a7 100644 --- a/python/ctsm/run_sys_tests.py +++ b/python/ctsm/run_sys_tests.py @@ -576,12 +576,12 @@ def _record_git_status(testroot, retry, dry_run): if git_status.count("\n") == 1: # Only line in git status is the branch info output += "(clean sandbox)\n" - manic = os.path.join("manage_externals", "checkout_externals") - manage_externals_status = subprocess.check_output( - [manic, "--status", "--verbose"], cwd=ctsm_root, universal_newlines=True + fleximod = os.path.join("bin", "git-fleximod") + fleximod_status = subprocess.check_output( + [fleximod, "status"], cwd=ctsm_root, universal_newlines=True ) - output += 72 * "-" + "\n" + "manage_externals status:" + "\n" - output += manage_externals_status + output += 72 * "-" + "\n" + "git-fleximod status:" + "\n" + output += fleximod_status output += 72 * "-" + "\n" print(output) From 0537a6a32d586e62c237b6e2a6d645b7895bf76a Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Wed, 29 May 2024 11:23:15 -0600 Subject: [PATCH 0359/1248] add potential veg check to avoid accessing timeseries file --- src/dyn_subgrid/dynFATESLandUseChangeMod.F90 | 88 ++++++++++---------- src/dyn_subgrid/dynSubgridDriverMod.F90 | 4 +- 2 files changed, 48 insertions(+), 44 deletions(-) diff --git a/src/dyn_subgrid/dynFATESLandUseChangeMod.F90 b/src/dyn_subgrid/dynFATESLandUseChangeMod.F90 index f330ee2b78..d7c1063494 100644 --- a/src/dyn_subgrid/dynFATESLandUseChangeMod.F90 +++ b/src/dyn_subgrid/dynFATESLandUseChangeMod.F90 @@ -107,6 +107,7 @@ subroutine dynFatesLandUseInit(bounds, landuse_filename) ! !USES: use clm_varctl , only : use_cn, use_fates_luh, fates_harvest_mode + use clm_varctl , only : use_fates_potentialveg use dynVarTimeUninterpMod , only : dyn_var_time_uninterp_type use dynTimeInfoMod , only : YEAR_POSITION_START_OF_TIMESTEP use dynTimeInfoMod , only : YEAR_POSITION_END_OF_TIMESTEP @@ -148,55 +149,58 @@ subroutine dynFatesLandUseInit(bounds, landuse_filename) landuse_transitions = 0._r8 landuse_harvest = 0._r8 - if (use_fates_luh) then + ! Avoid initializing the landuse timeseries file if in fates potential vegetation mode + if (.not. use_fates_potentialveg) then + if (use_fates_luh) then - ! Generate the dyn_file_type object. - ! Start calls get_prev_date, whereas end calls get_curr_date - dynFatesLandUse_file = dyn_file_type(landuse_filename, YEAR_POSITION_END_OF_TIMESTEP) + ! Generate the dyn_file_type object. + ! Start calls get_prev_date, whereas end calls get_curr_date + dynFatesLandUse_file = dyn_file_type(landuse_filename, YEAR_POSITION_END_OF_TIMESTEP) - ! Get initial land use data from the fates luh2 timeseries dataset - num_points = (bounds%endg - bounds%begg + 1) - landuse_shape(1) = num_points ! Does this need an explicit array shape to be passed to the constructor? - do varnum = 1, num_landuse_transition_vars - landuse_transition_vars(varnum) = dyn_var_time_uninterp_type( & - dyn_file=dynFatesLandUse_file, varname=landuse_transition_varnames(varnum), & - dim1name=grlnd, conversion_factor=1.0_r8, & - do_check_sums_equal_1=.false., data_shape=landuse_shape) - end do - do varnum = 1, num_landuse_state_vars - landuse_state_vars(varnum) = dyn_var_time_uninterp_type( & - dyn_file=dynFatesLandUse_file, varname=landuse_state_varnames(varnum), & - dim1name=grlnd, conversion_factor=1.0_r8, & - do_check_sums_equal_1=.false., data_shape=landuse_shape) - end do - - ! Get the harvest rate data from the fates luh2 timeseries dataset if enabled - if (trim(fates_harvest_mode) .eq. fates_harvest_luh_area .or. & - trim(fates_harvest_mode) .eq. fates_harvest_luh_mass) then - - ! change the harvest varnames being used depending on the mode selected - if (trim(fates_harvest_mode) .eq. fates_harvest_luh_area ) then - landuse_harvest_varnames => landuse_harvest_area_varnames - landuse_harvest_units = landuse_harvest_area_units - elseif (trim(fates_harvest_mode) .eq. fates_harvest_luh_mass ) then - landuse_harvest_varnames => landuse_harvest_mass_varnames - landuse_harvest_units = landuse_harvest_mass_units - else - call endrun(msg=' undefined fates harvest mode selected'//errMsg(__FILE__, __LINE__)) - end if - - do varnum = 1, num_landuse_harvest_vars - landuse_harvest_vars(varnum) = dyn_var_time_uninterp_type( & - dyn_file=dynFatesLandUse_file, varname=landuse_harvest_varnames(varnum), & + ! Get initial land use data from the fates luh2 timeseries dataset + num_points = (bounds%endg - bounds%begg + 1) + landuse_shape(1) = num_points ! Does this need an explicit array shape to be passed to the constructor? + do varnum = 1, num_landuse_transition_vars + landuse_transition_vars(varnum) = dyn_var_time_uninterp_type( & + dyn_file=dynFatesLandUse_file, varname=landuse_transition_varnames(varnum), & + dim1name=grlnd, conversion_factor=1.0_r8, & + do_check_sums_equal_1=.false., data_shape=landuse_shape) + end do + do varnum = 1, num_landuse_state_vars + landuse_state_vars(varnum) = dyn_var_time_uninterp_type( & + dyn_file=dynFatesLandUse_file, varname=landuse_state_varnames(varnum), & dim1name=grlnd, conversion_factor=1.0_r8, & do_check_sums_equal_1=.false., data_shape=landuse_shape) end do + + ! Get the harvest rate data from the fates luh2 timeseries dataset if enabled + if (trim(fates_harvest_mode) .eq. fates_harvest_luh_area .or. & + trim(fates_harvest_mode) .eq. fates_harvest_luh_mass) then + + ! change the harvest varnames being used depending on the mode selected + if (trim(fates_harvest_mode) .eq. fates_harvest_luh_area ) then + landuse_harvest_varnames => landuse_harvest_area_varnames + landuse_harvest_units = landuse_harvest_area_units + elseif (trim(fates_harvest_mode) .eq. fates_harvest_luh_mass ) then + landuse_harvest_varnames => landuse_harvest_mass_varnames + landuse_harvest_units = landuse_harvest_mass_units + else + call endrun(msg=' undefined fates harvest mode selected'//errMsg(__FILE__, __LINE__)) + end if + + do varnum = 1, num_landuse_harvest_vars + landuse_harvest_vars(varnum) = dyn_var_time_uninterp_type( & + dyn_file=dynFatesLandUse_file, varname=landuse_harvest_varnames(varnum), & + dim1name=grlnd, conversion_factor=1.0_r8, & + do_check_sums_equal_1=.false., data_shape=landuse_shape) + end do + end if end if - end if - ! Since fates needs state data during initialization, make sure to call - ! the interpolation routine at the start - call dynFatesLandUseInterp(bounds,init_state=.true.) + ! Since fates needs state data during initialization, make sure to call + ! the interpolation routine at the start + call dynFatesLandUseInterp(bounds,init_state=.true.) + end if end subroutine dynFatesLandUseInit diff --git a/src/dyn_subgrid/dynSubgridDriverMod.F90 b/src/dyn_subgrid/dynSubgridDriverMod.F90 index faef029b40..ea1210521d 100644 --- a/src/dyn_subgrid/dynSubgridDriverMod.F90 +++ b/src/dyn_subgrid/dynSubgridDriverMod.F90 @@ -206,7 +206,7 @@ subroutine dynSubgrid_driver(bounds_proc, ! OUTSIDE any loops over clumps in the driver. ! ! !USES: - use clm_varctl , only : use_cn, use_fates, use_fates_luh + use clm_varctl , only : use_cn, use_fates, use_fates_luh, use_fates_potentialveg use dynInitColumnsMod , only : initialize_new_columns use dynConsBiogeophysMod , only : dyn_hwcontent_init, dyn_hwcontent_final use dynEDMod , only : dyn_ED @@ -295,7 +295,7 @@ subroutine dynSubgrid_driver(bounds_proc, call dynurban_interp(bounds_proc) end if - if (use_fates_luh) then + if (use_fates_luh .and. .not. use_fates_potentialveg) then call dynFatesLandUseInterp(bounds_proc) end if From 317f77d7b692a58644e679d48c8f4ec026c8a697 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Wed, 29 May 2024 11:30:54 -0600 Subject: [PATCH 0360/1248] Add cropcals_rx namelist boolean. --- bld/namelist_files/namelist_defaults_ctsm.xml | 15 +++++++++++---- bld/namelist_files/namelist_definition_ctsm.xml | 9 +++++++-- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index 655e97c47c..08f67a2712 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -1686,10 +1686,17 @@ lnd/clm2/surfdata_esmf/NEON/surfdata_1x1_NEON_TOOL_hist_78pfts_CMIP6_simyr2000_c nn nn - -1850 -2100 -1850 + +.false. +2000 +2000 +2000 + + +lnd/clm2/cropdata/calendars/processed/swindow_starts_ggcmi_crop_calendar_phase3_v1.01.2000-2000.20231005_145103.nc +lnd/clm2/cropdata/calendars/processed/swindow_ends_ggcmi_crop_calendar_phase3_v1.01.2000-2000.20231005_145103.nc +lnd/clm2/cropdata/calendars/processed/gdds_20230829_161011.nc +share/meshes/360x720_120830_ESMFmesh_c20210507_cdf5.nc diff --git a/bld/namelist_files/namelist_definition_ctsm.xml b/bld/namelist_files/namelist_definition_ctsm.xml index c88e987756..366b7498e8 100644 --- a/bld/namelist_files/namelist_definition_ctsm.xml +++ b/bld/namelist_files/namelist_definition_ctsm.xml @@ -1773,14 +1773,19 @@ Mapping method from LAI input file to the model resolution + +Flag to enable prescribed crop calendars (sowing window dates and maturity requirement) + + -First year to loop over for crop calendar data +First year to loop over for crop calendar data (not including gdd20_baseline file) -Last year to loop over for crop calendar data +Last year to loop over for crop calendar data (not including gdd20_baseline file) Date: Wed, 29 May 2024 11:38:29 -0600 Subject: [PATCH 0361/1248] CLMBuildNamelist: Fix logic and message for check of sowing window start/end files. --- bld/CLMBuildNamelist.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index 54752b6dbc..9753549db1 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -4200,8 +4200,8 @@ sub setup_logic_cropcal_streams { my $gdd_file = $nl->get_value('stream_fldFileName_cultivar_gdds') ; my $gdd20_baseline_file = $nl->get_value('stream_fldFileName_gdd20_baseline') ; my $mesh_file = $nl->get_value('stream_meshfile_cropcal') ; - if ( ($swindow_start_file eq '' and $swindow_start_file ne '') or ($swindow_start_file ne '' and $swindow_start_file eq '') ) { - $log->fatal_error("When specifying sowing window dates, you must provide both swindow_start_file and swindow_end_file. To specify exact sowing dates, use the same file." ); + if ( ($swindow_start_file eq '' and $swindow_end_file ne '') or ($swindow_start_file ne '' and $swindow_end_file eq '') ) { + $log->fatal_error("When specifying sowing window dates, you must provide both stream_fldFileName_swindow_start and stream_fldFileName_swindow_end. To specify exact sowing dates, use the same file." ); } if ( $gdd_file eq '' and $gdd20_baseline_file ne '' ) { $log->fatal_error("If not providing stream_fldFileName_cultivar_gdds, don't provide stream_fldFileName_gdd20_baseline"); From b19573466744c3426de70a1edbb9a3725821de67 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Wed, 29 May 2024 11:42:11 -0600 Subject: [PATCH 0362/1248] CLMBuildNamelist: Use &string_is_undef_or_empty() instead of comparing to ''. --- bld/CLMBuildNamelist.pm | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index 9753549db1..833a254f1a 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -4200,30 +4200,30 @@ sub setup_logic_cropcal_streams { my $gdd_file = $nl->get_value('stream_fldFileName_cultivar_gdds') ; my $gdd20_baseline_file = $nl->get_value('stream_fldFileName_gdd20_baseline') ; my $mesh_file = $nl->get_value('stream_meshfile_cropcal') ; - if ( ($swindow_start_file eq '' and $swindow_end_file ne '') or ($swindow_start_file ne '' and $swindow_end_file eq '') ) { + if ( (&string_is_undef_or_empty($swindow_start_file) and !&string_is_undef_or_empty($swindow_end_file)) or (!&string_is_undef_or_empty($swindow_start_file) and &string_is_undef_or_empty($swindow_end_file)) ) { $log->fatal_error("When specifying sowing window dates, you must provide both stream_fldFileName_swindow_start and stream_fldFileName_swindow_end. To specify exact sowing dates, use the same file." ); } - if ( $gdd_file eq '' and $gdd20_baseline_file ne '' ) { + if ( &string_is_undef_or_empty($gdd_file) and ! &string_is_undef_or_empty($gdd20_baseline_file) ) { $log->fatal_error("If not providing stream_fldFileName_cultivar_gdds, don't provide stream_fldFileName_gdd20_baseline"); } if ( $generate_crop_gdds eq '.true.' ) { if ( $use_mxmat eq '.true.' ) { $log->fatal_error("If generate_crop_gdds is true, you must also set use_mxmat to false" ); } - if ( $swindow_start_file eq '' or $swindow_end_file eq '' ) { + if ( &string_is_undef_or_empty($swindow_start_file) or &string_is_undef_or_empty($swindow_end_file) ) { $log->fatal_error("If generate_crop_gdds is true, you must specify stream_fldFileName_swindow_start and stream_fldFileName_swindow_end") } if ( $swindow_start_file ne $swindow_end_file ) { $log->fatal_error("If generate_crop_gdds is true, you must specify exact sowing dates by setting stream_fldFileName_swindow_start and stream_fldFileName_swindow_end to the same file") } - if ( $gdd_file ne '' ) { + if ( ! &string_is_undef_or_empty($gdd_file) ) { $log->fatal_error("If generate_crop_gdds is true, do not specify stream_fldFileName_cultivar_gdds") } - if ( $gdd20_baseline_file ne '' ) { + if ( ! &string_is_undef_or_empty($gdd20_baseline_file) ) { $log->fatal_error("If generate_crop_gdds is true, do not specify stream_fldFileName_gdd20_baseline") } } - if ( $mesh_file eq '' and ( $swindow_start_file ne '' or $gdd_file ne '' ) ) { + if ( &string_is_undef_or_empty($mesh_file) and ( ! &string_is_undef_or_empty($swindow_start_file) or ! &string_is_undef_or_empty($gdd_file) ) ) { $log->fatal_error("If prescribing crop sowing dates and/or maturity requirements, you must specify stream_meshfile_cropcal") } } From 4b18a5bb159e1a98a5905ec939dffb5981e55185 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Wed, 29 May 2024 11:48:50 -0600 Subject: [PATCH 0363/1248] CLMBuildNamelist: Use &value_is_true() instead of comparing to '.true.' --- bld/CLMBuildNamelist.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index 833a254f1a..d35649bef4 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -4206,8 +4206,8 @@ sub setup_logic_cropcal_streams { if ( &string_is_undef_or_empty($gdd_file) and ! &string_is_undef_or_empty($gdd20_baseline_file) ) { $log->fatal_error("If not providing stream_fldFileName_cultivar_gdds, don't provide stream_fldFileName_gdd20_baseline"); } - if ( $generate_crop_gdds eq '.true.' ) { - if ( $use_mxmat eq '.true.' ) { + if ( &value_is_true($generate_crop_gdds) ) { + if ( &value_is_true($use_mxmat) ) { $log->fatal_error("If generate_crop_gdds is true, you must also set use_mxmat to false" ); } if ( &string_is_undef_or_empty($swindow_start_file) or &string_is_undef_or_empty($swindow_end_file) ) { From e76fbbc134ab5c4c6186f35732d11b46879a5a13 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Wed, 29 May 2024 12:02:17 -0600 Subject: [PATCH 0364/1248] CLMBuildNamelist: Update setup_logic_cropcal_streams() with cropcals_rx. --- bld/CLMBuildNamelist.pm | 77 ++++++++++++++++++++++++++++------------- 1 file changed, 53 insertions(+), 24 deletions(-) diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index d35649bef4..aff46be3f0 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -4172,41 +4172,73 @@ sub setup_logic_lai_streams { sub setup_logic_cropcal_streams { my ($opts, $nl_flags, $definition, $defaults, $nl) = @_; - # Set first and last stream years - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_year_first_cropcal', - 'sim_year'=>$nl_flags->{'sim_year'}, - 'sim_year_range'=>$nl_flags->{'sim_year_range'}); - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_year_last_cropcal', - 'sim_year'=>$nl_flags->{'sim_year'}, - 'sim_year_range'=>$nl_flags->{'sim_year_range'}); - - # Set align year, if first and last years are different - if ( $nl->get_value('stream_year_first_cropcal') != - $nl->get_value('stream_year_last_cropcal') ) { - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, - 'model_year_align_cropcal', 'sim_year'=>$nl_flags->{'sim_year'}, - 'sim_year_range'=>$nl_flags->{'sim_year_range'}); - } - # Set up other crop calendar parameters + add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'cropcals_rx'); add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'generate_crop_gdds'); add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'use_mxmat'); - # Option checks - my $generate_crop_gdds = $nl->get_value('generate_crop_gdds') ; - my $use_mxmat = $nl->get_value('use_mxmat') ; + # Add defaults if using prescribed crop calendars + my $cropcals_rx = $nl->get_value('cropcals_rx') ; + if ( &value_is_true($cropcals_rx) ) { + 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_meshfile_cropcal'); + } + + # Add defaults if using any potentially time-varying crop calendar input files my $swindow_start_file = $nl->get_value('stream_fldFileName_swindow_start') ; my $swindow_end_file = $nl->get_value('stream_fldFileName_swindow_end') ; my $gdd_file = $nl->get_value('stream_fldFileName_cultivar_gdds') ; my $gdd20_baseline_file = $nl->get_value('stream_fldFileName_gdd20_baseline') ; my $mesh_file = $nl->get_value('stream_meshfile_cropcal') ; - if ( (&string_is_undef_or_empty($swindow_start_file) and !&string_is_undef_or_empty($swindow_end_file)) or (!&string_is_undef_or_empty($swindow_start_file) and &string_is_undef_or_empty($swindow_end_file)) ) { - $log->fatal_error("When specifying sowing window dates, you must provide both stream_fldFileName_swindow_start and stream_fldFileName_swindow_end. To specify exact sowing dates, use the same file." ); + if ( !&string_is_undef_or_empty($swindow_start_file) or !&string_is_undef_or_empty($swindow_end_file) or !&string_is_undef_or_empty($gdd_file) or !&string_is_undef_or_empty($gdd20_baseline_file) or !&string_is_undef_or_empty($mesh_file)) { + + # User gave an input file without specifying cropcals_rx = .true. + # Changing this means nothing to the code, but helps namelist make more sense + if ( ! &value_is_true($cropcals_rx) ){ + $log->fatal_error("If providing any crop calendar input file(s), cropcals_rx must be true" ); + } + + # User provided an input file but set mesh file to empty + if ( &string_is_undef_or_empty($mesh_file) ) { + $log->fatal_error("If providing any crop calendar input file(s), you must provide stream_meshfile_cropcal" ); + } + + # Set first and last stream years + add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_year_first_cropcal', + 'sim_year'=>$nl_flags->{'sim_year'}, + 'sim_year_range'=>$nl_flags->{'sim_year_range'}); + add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_year_last_cropcal', + 'sim_year'=>$nl_flags->{'sim_year'}, + 'sim_year_range'=>$nl_flags->{'sim_year_range'}); + + # Set align year, if first and last years are different + if ( $nl->get_value('stream_year_first_cropcal') != + $nl->get_value('stream_year_last_cropcal') ) { + add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, + 'model_year_align_cropcal', 'sim_year'=>$nl_flags->{'sim_year'}, + 'sim_year_range'=>$nl_flags->{'sim_year_range'}); + } } + + # If running with prescribed crop calendars, certain files must be provided + my $generate_crop_gdds = $nl->get_value('generate_crop_gdds') ; + if ( &value_is_true($cropcals_rx) ) { + if ( &string_is_undef_or_empty($swindow_start_file) or &string_is_undef_or_empty($swindow_end_file) ) { + $log->fatal_error("If cropcals_rx is true, sowing window start and end files must be provided. To specify exact sowing dates, use the same file." ); + } + if ( &string_is_undef_or_empty($gdd_file) and (! &value_is_true($generate_crop_gdds)) ){ + $log->fatal_error("If cropcals_rx is true and generate_crop_gdds is false, maturity requirement file stream_fldFileName_cultivar_gdds must be provided" ); + } + } + + # Option checks if ( &string_is_undef_or_empty($gdd_file) and ! &string_is_undef_or_empty($gdd20_baseline_file) ) { $log->fatal_error("If not providing stream_fldFileName_cultivar_gdds, don't provide stream_fldFileName_gdd20_baseline"); } if ( &value_is_true($generate_crop_gdds) ) { + my $use_mxmat = $nl->get_value('use_mxmat') ; if ( &value_is_true($use_mxmat) ) { $log->fatal_error("If generate_crop_gdds is true, you must also set use_mxmat to false" ); } @@ -4223,9 +4255,6 @@ sub setup_logic_cropcal_streams { $log->fatal_error("If generate_crop_gdds is true, do not specify stream_fldFileName_gdd20_baseline") } } - if ( &string_is_undef_or_empty($mesh_file) and ( ! &string_is_undef_or_empty($swindow_start_file) or ! &string_is_undef_or_empty($gdd_file) ) ) { - $log->fatal_error("If prescribing crop sowing dates and/or maturity requirements, you must specify stream_meshfile_cropcal") - } } #------------------------------------------------------------------------------- From dbbd7954a9b5e9a38d0afe45648b19dd5597c4fe Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Wed, 29 May 2024 12:17:31 -0600 Subject: [PATCH 0365/1248] change fluh_timeseries to use an file with wider time range --- 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 fe34e9f4b8..37aff979f9 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -1557,7 +1557,7 @@ lnd/clm2/surfdata_esmf/NEON/surfdata_1x1_NEON_TOOL_hist_78pfts_CMIP6_simyr2000_c lnd/clm2/surfdata_map/fates-sci.1.68.3_api.31.0.0_tools.1.0.1/LUH2_states_transitions_management.timeseries_4x5_hist_simyr1850-2015_c231101.nc + >lnd/clm2/surfdata_map/fates-sci.1.68.3_api.31.0.0_tools.1.0.1/LUH2_states_transitions_management.timeseries_4x5_hist_simyr1650-2015_c240216.nc .false. From 2848873409be7eddecb0f62326116afaf9a2e319 Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Wed, 29 May 2024 12:18:24 -0600 Subject: [PATCH 0366/1248] fix pvt system test --- cime_config/SystemTests/pvt.py | 34 +++++++++++++++++++++++++++++++--- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/cime_config/SystemTests/pvt.py b/cime_config/SystemTests/pvt.py index 6b2a958eaa..05da935a0e 100644 --- a/cime_config/SystemTests/pvt.py +++ b/cime_config/SystemTests/pvt.py @@ -51,6 +51,11 @@ def run_phase(self): orig_casevar = self._case.get_value("CASE") caseroot = self._case.get_value("CASEROOT") + # Set the run start date based on the desired starting reference case year + refcase_year = 1700 + stop_n_pveg = 5 + startyear_pveg = refcase_year - stop_n_pveg + # clone the main case to create spinup case logger.info("PVT log: cloning setup") clone_path = "{}.potveg".format(caseroot) @@ -65,10 +70,11 @@ def run_phase(self): self._set_active_case(clone) # set the clone case values - stop_n_pveg = 1 with clone: - # clone.set_value("CLM_ACCELERATED_SPINUP", "on") + clone.set_value("CLM_ACCELERATED_SPINUP", "off") clone.set_value("STOP_N", stop_n_pveg) + clone.set_value("STOP_OPTION", "nyears") + clone.set_value("RUN_STARTDATE", "{}-01-01".format(startyear_pveg)) # Modify the spin up case to use the potential vegetation mode. # Checks for incompatible cases and necessary mapping files are @@ -93,11 +99,33 @@ def run_phase(self): os.chdir(caseroot) self._set_active_case(orig_case) + # Copy restart files from spin up to the transient case run directory + # obtain rpointer files and necessary restart files from short term archiving directory + rundir = self._case.get_value("RUNDIR") + + refdate = str(refcase_year) + '-01-01-00000' + rest_path = os.path.join(dout_sr, "rest", "{}".format(refdate)) + + for item in glob.glob("{}/*{}*".format(rest_path, refdate)): + link_name = os.path.join(rundir, os.path.basename(item)) + if os.path.islink(link_name) and os.readlink(link_name) == item: + # Link is already set up correctly: do nothing + # (os.symlink raises an exception if you try to replace an + # existing file) + pass + else: + os.symlink(item, link_name) + + for item in glob.glob("{}/*rpointer*".format(rest_path)): + shutil.copy(item, rundir) + + # Update run case settings self._case.set_value("CLM_ACCELERATED_SPINUP", "off") self._case.set_value("RUN_TYPE", "hybrid") self._case.set_value("GET_REFCASE", False) self._case.set_value("RUN_REFCASE", "{}.potveg".format(orig_casevar)) - self._case.set_value("RUN_REFDATE", "1700-01-01") + self._case.set_value("RUN_REFDATE", "{}-01-01".format(refcase_year)) + self._case.set_value("RUN_STARTDATE", "{}-01-01".format(refcase_year)) self._case.set_value("DOUT_S", False) self._case.flush() From 6b550b1aa536fed46d197580614226e16691d1f8 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Wed, 29 May 2024 14:03:29 -0600 Subject: [PATCH 0367/1248] Replace checkout_externals with git-fleximod in documentation --- .gitignore | 6 ++-- README | 4 +-- README_EXTERNALS.rst | 32 +++++++++---------- bld/CLMBuildNamelist.pm | 2 +- doc/README.CHECKLIST.master_tags | 6 ++-- doc/build_docs | 2 +- doc/design/python_script_user_interface.rst | 2 +- .../obtaining-and-building-ctsm.rst | 6 ++-- doc/source/lilac/specific-atm-models/wrf.rst | 2 +- python/ctsm/site_and_regional/run_neon.py | 2 +- tools/mksurfdata_esmf/README.md | 2 +- 11 files changed, 33 insertions(+), 33 deletions(-) diff --git a/.gitignore b/.gitignore index 1da8072fed..6c8111525a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,6 @@ -# directories checked out by manage_externals, and other files created -# by manage_externals -manage_externals.log +# directories checked out by git-fleximod, and other files created +# by git-fleximod +git-fleximod.log ccs_config /src/fates/ /cime/ diff --git a/README b/README index 18cc2b1458..97daae2d5a 100644 --- a/README +++ b/README @@ -50,7 +50,7 @@ lilac ------------- Lightweight Infrastructure for Land-Atmosphere Coupling (for test -------------- CTSM Testing scripts for CTSM offline tools (deprecated) tools ------------- CTSM Offline tools to prepare input datasets and process output. cime_config ------- Configuration files of cime for compsets and CTSM settings -manage_externals -- Script to manage the external source directories (deprecated) +git-fleximod ------ Script to manage the external source directories py_env_create ----- Script to setup the python environment for CTSM python tools using conda python ------------ Python modules used in tools and testing and automated checking of ALL CTSM python scirpts @@ -75,7 +75,7 @@ Top level documentation ($CTSMROOT): 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_EXTERNALS.rst ----- Information on how to work with manage_externals for CTSM (deprecated) +README_EXTERNALS.rst ----- Information on how to work with git-fleximod for CTSM 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/README_EXTERNALS.rst b/README_EXTERNALS.rst index ed7a068991..22c56ee6f6 100644 --- a/README_EXTERNALS.rst +++ b/README_EXTERNALS.rst @@ -18,11 +18,11 @@ To obtain the CTSM code you need to do the following: This will create a directory ``my_ctsm_sandbox/`` in your current working directory. -#. Run the script **manage_externals/checkout_externals**. :: +#. Run **./bin/git-fleximod update**. :: - ./manage_externals/checkout_externals + ./bin/git-fleximod update - The **checkout_externals** script is a package manager that will + **git-fleximod** is a package manager that will populate the ctsm directory with the relevant versions of each of the components along with the CIME infrastructure code. @@ -30,21 +30,21 @@ At this point you have a working version of CTSM. To see full details of how to set up a case, compile and run, see the CIME documentation at http://esmci.github.io/cime/ . -More details on checkout_externals ----------------------------------- +More details on git-fleximod +---------------------------- The file **Externals.cfg** in your top-level CTSM directory tells -**checkout_externals** which tag/branch of each component should be +**git-fleximod** which tag/branch of each component should be brought in to generate your sandbox. **Externals_CLM.cfg** is used similarly to point to the correct version of FATES (and possibly other CTSM-specific externals in the future); the below instructions referring to **Externals.cfg** also apply to modifying **Externals_CLM.cfg**. -NOTE: checkout_externals will always attempt +NOTE: git-fleximod will always attempt to make the working copy exactly match the externals description. If you manually modify an external without updating Externals.cfg, e.g. switch -to a different tag, then rerunning checkout_externals will switch you +to a different tag, then rerunning git-fleximod will switch you back to the external described in Externals.cfg. See below documentation `Customizing your CTSM sandbox`_ for more details. -**You need to rerun checkout_externals whenever Externals.cfg has +**You need to rerun git-fleximod whenever Externals.cfg has changed** (unless you have already manually updated the relevant external(s) to have the correct branch/tag checked out). Common times when this is needed are: @@ -54,17 +54,17 @@ when this is needed are: * After merging some other CTSM branch/tag into your currently checked-out branch -**checkout_externals** must be run from the root of the source +**git-fleximod** must be run from the root of the source tree. For example, if you cloned CTSM with:: git clone https://github.com/escomp/ctsm.git my_ctsm_sandbox -then you must run **checkout_externals** from +then you must run **git-fleximod** from ``/path/to/my_ctsm_sandbox``. -To see more details of **checkout_externals**, issue :: +To see more details of **git-fleximod**, issue :: - ./manage_externals/checkout_externals --help + ./bin/git-fleximod --help Customizing your CTSM sandbox ============================= @@ -80,7 +80,7 @@ checked out ctsm1.0.0 but really wanted to have ctsm1.1.0; you would simply do the following:: git checkout ctsm1.1.0 - ./manage_externals/checkout_externals + ./bin/git-fleximod update You should **not** use this method if you have made any source code changes, or if you have any ongoing CTSM cases that were created from @@ -107,11 +107,11 @@ Each entry specifies either a tag, a hash or a branch. To point to a new tag: #. Checkout the new component(s):: - ./manage_externals/checkout_externals + ./bin/git-fleximod update To point to a hash, the process is the same, except also change ``tag = ...`` to ``hash = ...``. -To point to a branch, use ``branch = ...``. Pointing to a branch means that, each time you run ``manage_externals/checkout_externals`` you will get the current latest version of that branch. This can be convenient for in-progress development work, but should not be used when you need a stable version for scientific simulations. There are a number of gotchas with this workflow, so in general you should default to pointing to fixed hashes. (For CTSM master, we require a fixed hash or, usually, a tag.) +To point to a branch, use ``branch = ...``. Pointing to a branch means that, each time you run ``./bin/git-fleximod update`` you will get the current latest version of that branch. This can be convenient for in-progress development work, but should not be used when you need a stable version for scientific simulations. There are a number of gotchas with this workflow, so in general you should default to pointing to fixed hashes. (For CTSM master, we require a fixed hash or, usually, a tag.) Keep in mind that changing individual components from a tag may result in an invalid model (won't compile, won't run, not scientifically diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index fb44023cd5..1371ea5c06 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -366,7 +366,7 @@ sub check_for_perl_utils { } else { die <<"EOF"; ** Cannot find the root of the cime directory enter it using the -cimeroot option - Did you run the checkout_externals scripts? + Did you run ./bin/git-fleximod update? EOF } } diff --git a/doc/README.CHECKLIST.master_tags b/doc/README.CHECKLIST.master_tags index ed7794130b..0da52acaaa 100644 --- a/doc/README.CHECKLIST.master_tags +++ b/doc/README.CHECKLIST.master_tags @@ -14,9 +14,9 @@ https://github.com/ESCOMP/ctsm/wiki/CTSM-development-workflow 2a -- run 'git pull' to pull in the latest version from GitHub 2b -- run 'git status' and/or 'git diff' to make sure you don't have any uncommitted local changes - 2c -- run './manage_externals/checkout_externals -S' to make sure all externals are - updated and don't have any uncommitted changes. (If any are marked with 's' in - the first column, run ./manage_externals/checkout_externals to update them.) + 2c -- run './bin/git-fleximod status' to make sure all externals are + updated and don't have any uncommitted changes. If any are marked with 's' in + the first column, run './bin/git-fleximod update'. (3) Do all testing on your fork/feature-branch diff --git a/doc/build_docs b/doc/build_docs index a8e8099b60..45c7099ec5 100755 --- a/doc/build_docs +++ b/doc/build_docs @@ -6,5 +6,5 @@ if [ -f doc-builder/build_docs ]; then echo "Running: ./doc-builder/build_docs $@" ./doc-builder/build_docs "$@" else - echo "Obtain doc-builder by running ./manage_externals/checkout_externals -o from the top-level" + echo "Obtain doc-builder by running './bin/git-fleximod update --optional' from the top-level" fi diff --git a/doc/design/python_script_user_interface.rst b/doc/design/python_script_user_interface.rst index 87c1b3e8fc..d639117810 100644 --- a/doc/design/python_script_user_interface.rst +++ b/doc/design/python_script_user_interface.rst @@ -66,7 +66,7 @@ For logical flags, use a flag without an argument -- ``--feature`` for the case We try to follow the guide at the top of `Python's logging howto `_. In particular, print statements should be used for "console output for ordinary usage of a command line script or program"; ``logger.info`` or ``logger.debug`` should be used to "report events that occur during normal operation of a program (e.g. for status monitoring or fault investigation)", etc. -The distinction between when to use print and when to use logging can admittedly be a bit subjective, as it comes down to the question of whether the given output is part of the fundamental operation of the script – i.e., part of what the script is designed to do is to give this output. For example, ``run_sys_tests`` prints a variety of information when it starts, particularly concerning the git and manage_externals status of the current repository. The rationale for using ``print`` statements for this is that we designed ``run_sys_tests`` to replace some of the repetitive items that we did whenever running the system tests. One of these items was running ``git status`` and ``./manage_externals/checkout_externals -S -v`` to check that the repository is in a clean state. Thus, in this case, our view is that the output from these commands is part of the fundamental purpose of ``run_sys_tests``: it is something we always want to see, and we feel that it is important for anyone running the system tests to review, and thus ``print`` statements are appropriate here. +The distinction between when to use print and when to use logging can admittedly be a bit subjective, as it comes down to the question of whether the given output is part of the fundamental operation of the script – i.e., part of what the script is designed to do is to give this output. For example, ``run_sys_tests`` prints a variety of information when it starts, particularly concerning the git and git-fleximod status of the current repository. The rationale for using ``print`` statements for this is that we designed ``run_sys_tests`` to replace some of the repetitive items that we did whenever running the system tests. One of these items was running ``git status`` and ``./bin/git-fleximod status --verbose`` to check that the repository is in a clean state. Thus, in this case, our view is that the output from these commands is part of the fundamental purpose of ``run_sys_tests``: it is something we always want to see, and we feel that it is important for anyone running the system tests to review, and thus ``print`` statements are appropriate here. In general, ``print`` statements should be used sparingly, just for output that is important for the user to see. That said, users of CTSM scripts often expect more output than you would see from a typical Unix tool (where the philosophy is that there should be no output if everything worked correctly). Some examples of things that users of CTSM scripts typically want to see are: diff --git a/doc/source/lilac/obtaining-building-and-running/obtaining-and-building-ctsm.rst b/doc/source/lilac/obtaining-building-and-running/obtaining-and-building-ctsm.rst index c0e510c017..ef24e695b9 100644 --- a/doc/source/lilac/obtaining-building-and-running/obtaining-and-building-ctsm.rst +++ b/doc/source/lilac/obtaining-building-and-running/obtaining-and-building-ctsm.rst @@ -26,7 +26,7 @@ Obtain CTSM by running:: git clone https://github.com/ESCOMP/CTSM.git cd CTSM - ./manage_externals/checkout_externals + ./bin/git-fleximod update Then build CTSM and its dependencies. On a machine that has been ported to CIME, the command will look like this (example given for NCAR's ``cheyenne`` machine):: @@ -101,11 +101,11 @@ above`) can be obtained with:: git clone https://github.com/ESCOMP/CTSM.git cd CTSM - ./manage_externals/checkout_externals + ./bin/git-fleximod update By default, this will put you on the ``master`` branch of CTSM, which is the main development branch. You can checkout a different branch or tag using ``git checkout``; -**be sure to rerun** ``./manage_externals/checkout_externals`` **after doing so.** +**be sure to rerun** ``./bin/git-fleximod update`` **after doing so.** For more details, see https://github.com/ESCOMP/CTSM/wiki/Quick-start-to-CTSM-development-with-git diff --git a/doc/source/lilac/specific-atm-models/wrf.rst b/doc/source/lilac/specific-atm-models/wrf.rst index 5d104778ec..ad85fee777 100644 --- a/doc/source/lilac/specific-atm-models/wrf.rst +++ b/doc/source/lilac/specific-atm-models/wrf.rst @@ -44,7 +44,7 @@ Clone the CTSM repository:: git clone https://github.com/ESCOMP/CTSM.git cd CTSM - ./manage_externals/checkout_externals + ./bin/git-fleximod update .. _build-CTSM-and-dependencies: diff --git a/python/ctsm/site_and_regional/run_neon.py b/python/ctsm/site_and_regional/run_neon.py index 4b0df2722d..3acbf435b1 100755 --- a/python/ctsm/site_and_regional/run_neon.py +++ b/python/ctsm/site_and_regional/run_neon.py @@ -41,7 +41,7 @@ # - [ ] Case dependency and the ability to check case status # - [ ] If Case dependency works we don't need finidat given explicilty for post-ad and transient. -# - [ ] checkout_externals instead of using env varaiable +# - [ ] "./bin/git-fleximod update" instead of using env variable # - [ ] wget the fields available and run for those available # - [ ] Matrix spin-up if (SASU) Eric merged it in diff --git a/tools/mksurfdata_esmf/README.md b/tools/mksurfdata_esmf/README.md index 11cb69c681..3d19c88ff0 100644 --- a/tools/mksurfdata_esmf/README.md +++ b/tools/mksurfdata_esmf/README.md @@ -93,7 +93,7 @@ https://github.com/ESCOMP/CTSM/issues/2341 ``` shell # Assuming pwd is the tools/mksurfdata_esmf directory - ./manage_externals/checkout_externals # Assuming at the top level of the CTSM/CESM checkout + ./bin/git-fleximod update # Assuming at the top level of the CTSM/CESM checkout ``` This will bring in CIME and ccs_config which are required for building. From 0f729d8edcec2fa97db471bb766cc8964b01ed81 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Wed, 29 May 2024 14:16:45 -0600 Subject: [PATCH 0368/1248] Bugfix: cropcalStreamMod now handles cropcals_rx. --- src/cpl/share_esmf/cropcalStreamMod.F90 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/cpl/share_esmf/cropcalStreamMod.F90 b/src/cpl/share_esmf/cropcalStreamMod.F90 index f60ab51000..101ad9f2a4 100644 --- a/src/cpl/share_esmf/cropcalStreamMod.F90 +++ b/src/cpl/share_esmf/cropcalStreamMod.F90 @@ -47,6 +47,7 @@ module cropcalStreamMod character(len=CL) :: stream_fldFileName_swindow_end ! sowing window end stream filename to read character(len=CL) :: stream_fldFileName_cultivar_gdds ! cultivar growing degree-days stream filename to read character(len=CL) :: stream_fldFileName_gdd20_baseline ! GDD20 baseline stream filename to read + logical :: cropcals_rx ! Used only for setting input files in namelist; does nothing in code, but needs to be here so namelist read doesn't crash character(len=*), parameter :: sourcefile = & __FILE__ @@ -95,7 +96,8 @@ subroutine cropcal_init(bounds) stream_fldFileName_swindow_end, & stream_fldFileName_cultivar_gdds, & stream_fldFileName_gdd20_baseline, & - stream_meshfile_cropcal + stream_meshfile_cropcal, & + cropcals_rx ! Default values for namelist stream_year_first_cropcal = 1 ! first year in stream to use From 74411ea31189969410205a3edba96c14670a38f4 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Wed, 29 May 2024 14:17:05 -0600 Subject: [PATCH 0369/1248] Update RxCropCals testmod to use cropcals_rx true. --- .../testdefs/testmods_dirs/clm/RxCropCals/user_nl_clm | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/cime_config/testdefs/testmods_dirs/clm/RxCropCals/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/RxCropCals/user_nl_clm index 9cbfea97f0..8a0b4a91be 100644 --- a/cime_config/testdefs/testmods_dirs/clm/RxCropCals/user_nl_clm +++ b/cime_config/testdefs/testmods_dirs/clm/RxCropCals/user_nl_clm @@ -1,8 +1,2 @@ -! Sowing windows -stream_fldFileName_swindow_start = '$DIN_LOC_ROOT/lnd/clm2/cropdata/calendars/processed/swindow_starts_ggcmi_crop_calendar_phase3_v1.01.2000-2000.20231005_145103.nc' -stream_fldFileName_swindow_end = '$DIN_LOC_ROOT/lnd/clm2/cropdata/calendars/processed/swindow_ends_ggcmi_crop_calendar_phase3_v1.01.2000-2000.20231005_145103.nc' -stream_fldFileName_cultivar_gdds = '$DIN_LOC_ROOT/lnd/clm2/cropdata/calendars/processed/gdds_20230829_161011.nc' -stream_year_first_cropcal = 2000 -stream_year_last_cropcal = 2000 -stream_meshfile_cropcal = '$DIN_LOC_ROOT/share/meshes/360x720_120830_ESMFmesh_c20210507_cdf5.nc' +cropcals_rx = .true. From 612962280d766d86497ae5747c10d8af33623121 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Wed, 29 May 2024 14:32:40 -0600 Subject: [PATCH 0370/1248] Restore .gitignore as it was --- .gitignore | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 6c8111525a..1da8072fed 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,6 @@ -# directories checked out by git-fleximod, and other files created -# by git-fleximod -git-fleximod.log +# directories checked out by manage_externals, and other files created +# by manage_externals +manage_externals.log ccs_config /src/fates/ /cime/ From 5a577cdf701d028393bacc12bfde1749c9a9a2d8 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Wed, 29 May 2024 14:34:26 -0600 Subject: [PATCH 0371/1248] Delete README_EXTERNALS.rst to be like #2559 --- README_EXTERNALS.rst | 132 ------------------------------------------- 1 file changed, 132 deletions(-) delete mode 100644 README_EXTERNALS.rst diff --git a/README_EXTERNALS.rst b/README_EXTERNALS.rst deleted file mode 100644 index 22c56ee6f6..0000000000 --- a/README_EXTERNALS.rst +++ /dev/null @@ -1,132 +0,0 @@ -Obtaining the full model code and associated scripting infrastructure -===================================================================== - -[!CAUTION] -This is deprecated and will be replaced with git submodules. See -https://github.com/ESCOMP/CTSM/pull/2443 - - -CTSM is released via GitHub. You will need some familiarity with git in order -to modify the code and commit these changes. However, to simply checkout and run the -code, no git knowledge is required other than what is documented in the following steps. - -To obtain the CTSM code you need to do the following: - -#. Clone the repository. :: - - git clone https://github.com/escomp/ctsm.git my_ctsm_sandbox - - This will create a directory ``my_ctsm_sandbox/`` in your current working directory. - -#. Run **./bin/git-fleximod update**. :: - - ./bin/git-fleximod update - - **git-fleximod** is a package manager that will - populate the ctsm directory with the relevant versions of each of the - components along with the CIME infrastructure code. - -At this point you have a working version of CTSM. - -To see full details of how to set up a case, compile and run, see the CIME documentation at http://esmci.github.io/cime/ . - -More details on git-fleximod ----------------------------- - -The file **Externals.cfg** in your top-level CTSM directory tells -**git-fleximod** which tag/branch of each component should be -brought in to generate your sandbox. **Externals_CLM.cfg** is used similarly to point to the correct version of FATES (and possibly other CTSM-specific externals in the future); the below instructions referring to **Externals.cfg** also apply to modifying **Externals_CLM.cfg**. - -NOTE: git-fleximod will always attempt -to make the working copy exactly match the externals description. If -you manually modify an external without updating Externals.cfg, e.g. switch -to a different tag, then rerunning git-fleximod will switch you -back to the external described in Externals.cfg. See below -documentation `Customizing your CTSM sandbox`_ for more details. - -**You need to rerun git-fleximod whenever Externals.cfg has -changed** (unless you have already manually updated the relevant -external(s) to have the correct branch/tag checked out). Common times -when this is needed are: - -* After checking out a new CTSM branch/tag - -* After merging some other CTSM branch/tag into your currently - checked-out branch - -**git-fleximod** must be run from the root of the source -tree. For example, if you cloned CTSM with:: - - git clone https://github.com/escomp/ctsm.git my_ctsm_sandbox - -then you must run **git-fleximod** from -``/path/to/my_ctsm_sandbox``. - -To see more details of **git-fleximod**, issue :: - - ./bin/git-fleximod --help - -Customizing your CTSM sandbox -============================= - -There are several use cases to consider when you want to customize or modify your CTSM sandbox. - -Switching to a different CTSM branch or tag -------------------------------------------- - -If you have already checked out a branch or tag and **HAVE NOT MADE ANY -MODIFICATIONS** it is simple to change your sandbox. Say that you -checked out ctsm1.0.0 but really wanted to have ctsm1.1.0; -you would simply do the following:: - - git checkout ctsm1.1.0 - ./bin/git-fleximod update - -You should **not** use this method if you have made any source code -changes, or if you have any ongoing CTSM cases that were created from -this sandbox. In these cases, it is often easiest to do a second **git -clone**. - -Pointing to a different version of a component ----------------------------------------------- - -Each entry in **Externals.cfg** has the following form (we use CIME as an -example below):: - - [cime] - local_path = cime - protocol = git - repo_url = https://github.com/CESM-Development/cime - tag = cime5.4.0-alpha.20 - required = True - -Each entry specifies either a tag, a hash or a branch. To point to a new tag: - -#. Modify the relevant entry/entries in **Externals.cfg** (e.g., changing - ``cime5.4.0-alpha.20`` to ``cime5.4.0-alpha.21`` above) - -#. Checkout the new component(s):: - - ./bin/git-fleximod update - -To point to a hash, the process is the same, except also change ``tag = ...`` to ``hash = ...``. - -To point to a branch, use ``branch = ...``. Pointing to a branch means that, each time you run ``./bin/git-fleximod update`` you will get the current latest version of that branch. This can be convenient for in-progress development work, but should not be used when you need a stable version for scientific simulations. There are a number of gotchas with this workflow, so in general you should default to pointing to fixed hashes. (For CTSM master, we require a fixed hash or, usually, a tag.) - -Keep in mind that changing individual components from a tag may result -in an invalid model (won't compile, won't run, not scientifically -meaningful) and is unsupported. - -Committing your change to Externals.cfg -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -After making this change, it's a good idea to commit the change in your -local CTSM git repository. First create a branch in your local -repository, then commit it. (Unlike with subversion, branches are stored -locally unless you explicitly push them up to GitHub. Feel free to -create whatever local branches you'd like.) For example:: - - git checkout -b my_ctsm_branch - git add Externals.cfg - git commit -m "Update CIME to cime5.4.0-alpha.20" - From 61c97a13ebf81bb28f4bbac7aa1072c9f544c85b Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Wed, 29 May 2024 15:27:22 -0600 Subject: [PATCH 0372/1248] Add dummy ./manage_externals/checkout_externals with ERROR message --- manage_externals/checkout_externals | 3 +++ 1 file changed, 3 insertions(+) create mode 100755 manage_externals/checkout_externals diff --git a/manage_externals/checkout_externals b/manage_externals/checkout_externals new file mode 100755 index 0000000000..5f848f5da9 --- /dev/null +++ b/manage_externals/checkout_externals @@ -0,0 +1,3 @@ +echo "ERROR: Instead of ./manage_externals/checkout_externals" +echo "please type './bin/git-fleximod update'" +echo "For additional information, please type './bin/git-fleximod --help'" From 9d1f88d15ac942cb7176b30bc48163ab6e5031fc Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Wed, 29 May 2024 15:30:41 -0600 Subject: [PATCH 0373/1248] Add RxCropCals and RxCropCalsAdapt tests to new suite crop_calendars. --- cime_config/testdefs/testlist_clm.xml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index 9cfba6f5b3..bf763c4775 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -3719,5 +3719,23 @@ + + + + + + + + + + + + + + + + + + From 7e5257a94efa920f7b608a97b041fef63b1d9aa7 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Wed, 29 May 2024 16:12:06 -0600 Subject: [PATCH 0374/1248] Add cropcals_rx_adapt option. --- bld/CLMBuildNamelist.pm | 50 +++++++++++++++---- bld/namelist_files/namelist_defaults_ctsm.xml | 6 +++ .../namelist_definition_ctsm.xml | 5 ++ .../clm/RxCropCalsAdapt/user_nl_clm | 4 +- src/cpl/share_esmf/cropcalStreamMod.F90 | 4 +- 5 files changed, 55 insertions(+), 14 deletions(-) diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index aff46be3f0..fc80379201 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -4174,19 +4174,29 @@ sub setup_logic_cropcal_streams { # Set up other crop calendar parameters add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'cropcals_rx'); + add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'cropcals_rx_adapt'); add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'generate_crop_gdds'); add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'use_mxmat'); - # Add defaults if using prescribed crop calendars + # These can't both be true my $cropcals_rx = $nl->get_value('cropcals_rx') ; - if ( &value_is_true($cropcals_rx) ) { + my $cropcals_rx_adapt = $nl->get_value('cropcals_rx_adapt') ; + if (&value_is_true($cropcals_rx) and &value_is_true($cropcals_rx_adapt)) { + $log->fatal_error("cropcals_rx and cropcals_rx_adapt may not both be true" ); + } + + # Add defaults if using prescribed crop calendars + 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_meshfile_cropcal'); + if ( &value_is_true($cropcals_rx_adapt) ) { + add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_fldFileName_gdd20_baseline'); + } } - # Add defaults if using any potentially time-varying crop calendar input files + # Add defaults if using any crop calendar input files my $swindow_start_file = $nl->get_value('stream_fldFileName_swindow_start') ; my $swindow_end_file = $nl->get_value('stream_fldFileName_swindow_end') ; my $gdd_file = $nl->get_value('stream_fldFileName_cultivar_gdds') ; @@ -4194,10 +4204,20 @@ sub setup_logic_cropcal_streams { my $mesh_file = $nl->get_value('stream_meshfile_cropcal') ; if ( !&string_is_undef_or_empty($swindow_start_file) or !&string_is_undef_or_empty($swindow_end_file) or !&string_is_undef_or_empty($gdd_file) or !&string_is_undef_or_empty($gdd20_baseline_file) or !&string_is_undef_or_empty($mesh_file)) { - # User gave an input file without specifying cropcals_rx = .true. - # Changing this means nothing to the code, but helps namelist make more sense - if ( ! &value_is_true($cropcals_rx) ){ - $log->fatal_error("If providing any crop calendar input file(s), cropcals_rx must be true" ); + # User gave an input file without specifying cropcals_rx or cropcals_rx_adapt = .true. + # Requiring this means nothing to the code, but helps namelist make more sense + if ( !&value_is_true($cropcals_rx) and !&value_is_true($cropcals_rx_adapt) ){ + $log->fatal_error("If providing any crop calendar input file(s), cropcals_rx or cropcals_rx_adapt must be true" ); + } + + # User set cropcals_rx_adapt to true but set stream_fldFileName_gdd20_baseline to empty + if ( &value_is_true($cropcals_rx_adapt) and &string_is_undef_or_empty($gdd20_baseline_file) ) { + $log->fatal_error("If cropcals_rx_adapt is true, stream_fldFileName_gdd20_baseline must be provided" ); + } + + # cropcals_rx_adapt is false but user provided stream_fldFileName_gdd20_baseline + if ( !&value_is_true($cropcals_rx_adapt) and !&string_is_undef_or_empty($gdd20_baseline_file) ) { + $log->fatal_error("If stream_fldFileName_gdd20_baseline provided, cropcals_rx_adapt must be true" ); } # User provided an input file but set mesh file to empty @@ -4213,9 +4233,17 @@ sub setup_logic_cropcal_streams { 'sim_year'=>$nl_flags->{'sim_year'}, 'sim_year_range'=>$nl_flags->{'sim_year_range'}); - # Set align year, if first and last years are different + # Check/set things if first and last years are different if ( $nl->get_value('stream_year_first_cropcal') != $nl->get_value('stream_year_last_cropcal') ) { + + # Do not allow maturity requirements to change over time if stream_fldFileName_gdd20_baseline is provided. That would be nonsensical. + # Note that this restricts sowing windows from changing over time as well, because there are not separate stream_year settings for that. + if ( !&string_is_undef_or_empty($gdd20_baseline_file) ) { + $log->fatal_error("If cropcals_rx_adapt is true (i.e., stream_fldFileName_gdd20_baseline is provided), no crop calendar input is allowed to vary over time (i.e., stream_year_first_cropcal and stream_year_last_cropcal must be the same)." ); + } + + # Set align year add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'model_year_align_cropcal', 'sim_year'=>$nl_flags->{'sim_year'}, 'sim_year_range'=>$nl_flags->{'sim_year_range'}); @@ -4224,12 +4252,12 @@ sub setup_logic_cropcal_streams { # If running with prescribed crop calendars, certain files must be provided my $generate_crop_gdds = $nl->get_value('generate_crop_gdds') ; - if ( &value_is_true($cropcals_rx) ) { + if ( &value_is_true($cropcals_rx) or &value_is_true($cropcals_rx_adapt) ) { if ( &string_is_undef_or_empty($swindow_start_file) or &string_is_undef_or_empty($swindow_end_file) ) { - $log->fatal_error("If cropcals_rx is true, sowing window start and end files must be provided. To specify exact sowing dates, use the same file." ); + $log->fatal_error("If cropcals_rx or cropcals_rx_adapt is true, sowing window start and end files must be provided. To specify exact sowing dates, use the same file." ); } if ( &string_is_undef_or_empty($gdd_file) and (! &value_is_true($generate_crop_gdds)) ){ - $log->fatal_error("If cropcals_rx is true and generate_crop_gdds is false, maturity requirement file stream_fldFileName_cultivar_gdds must be provided" ); + $log->fatal_error("If cropcals_rx or cropcals_rx_adapt is true and generate_crop_gdds is false, maturity requirement file stream_fldFileName_cultivar_gdds must be provided" ); } } diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index 08f67a2712..85f37a22fd 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -1688,6 +1688,7 @@ lnd/clm2/surfdata_esmf/NEON/surfdata_1x1_NEON_TOOL_hist_78pfts_CMIP6_simyr2000_c .false. +.false. 2000 2000 2000 @@ -1697,6 +1698,11 @@ lnd/clm2/surfdata_esmf/NEON/surfdata_1x1_NEON_TOOL_hist_78pfts_CMIP6_simyr2000_c lnd/clm2/cropdata/calendars/processed/swindow_ends_ggcmi_crop_calendar_phase3_v1.01.2000-2000.20231005_145103.nc lnd/clm2/cropdata/calendars/processed/gdds_20230829_161011.nc share/meshes/360x720_120830_ESMFmesh_c20210507_cdf5.nc +lnd/clm2/cropdata/calendars/processed/swindow_starts_ggcmi_crop_calendar_phase3_v1.01.2000-2000.20231005_145103.nc +lnd/clm2/cropdata/calendars/processed/swindow_ends_ggcmi_crop_calendar_phase3_v1.01.2000-2000.20231005_145103.nc +lnd/clm2/cropdata/calendars/processed/gdds_20230829_161011.nc +lnd/clm2/testdata/gdd20baseline.tmp_dontupload.nc +share/meshes/360x720_120830_ESMFmesh_c20210507_cdf5.nc diff --git a/bld/namelist_files/namelist_definition_ctsm.xml b/bld/namelist_files/namelist_definition_ctsm.xml index 366b7498e8..f37ada6847 100644 --- a/bld/namelist_files/namelist_definition_ctsm.xml +++ b/bld/namelist_files/namelist_definition_ctsm.xml @@ -1778,6 +1778,11 @@ Mapping method from LAI input file to the model resolution Flag to enable prescribed crop calendars (sowing window dates and maturity requirement) + +Flag to enable prescribed crop calendars (sowing window dates and maturity requirement), with maturity requirement adaptive based on recent climate + + First year to loop over for crop calendar data (not including gdd20_baseline file) diff --git a/cime_config/testdefs/testmods_dirs/clm/RxCropCalsAdapt/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/RxCropCalsAdapt/user_nl_clm index 1bba9d2a89..709c7221e0 100644 --- a/cime_config/testdefs/testmods_dirs/clm/RxCropCalsAdapt/user_nl_clm +++ b/cime_config/testdefs/testmods_dirs/clm/RxCropCalsAdapt/user_nl_clm @@ -1,3 +1,3 @@ -! Eventually replace this with half-degree version in the proper place -stream_fldFileName_gdd20_baseline = '/glade/u/home/samrabin/ctsm_scale-mat-reqs/tools/crop_calendars/test.nc' +cropcals_rx = .false. +cropcals_rx_adapt = .true. diff --git a/src/cpl/share_esmf/cropcalStreamMod.F90 b/src/cpl/share_esmf/cropcalStreamMod.F90 index 101ad9f2a4..3333b6cfdc 100644 --- a/src/cpl/share_esmf/cropcalStreamMod.F90 +++ b/src/cpl/share_esmf/cropcalStreamMod.F90 @@ -48,6 +48,7 @@ module cropcalStreamMod character(len=CL) :: stream_fldFileName_cultivar_gdds ! cultivar growing degree-days stream filename to read character(len=CL) :: stream_fldFileName_gdd20_baseline ! GDD20 baseline stream filename to read logical :: cropcals_rx ! Used only for setting input files in namelist; does nothing in code, but needs to be here so namelist read doesn't crash + logical :: cropcals_rx_adapt ! Used only for setting input files in namelist; does nothing in code, but needs to be here so namelist read doesn't crash character(len=*), parameter :: sourcefile = & __FILE__ @@ -97,7 +98,8 @@ subroutine cropcal_init(bounds) stream_fldFileName_cultivar_gdds, & stream_fldFileName_gdd20_baseline, & stream_meshfile_cropcal, & - cropcals_rx + cropcals_rx, & + cropcals_rx_adapt ! Default values for namelist stream_year_first_cropcal = 1 ! first year in stream to use From 709c3da94d1816b42268bf98a4b3d947bdc29a9d Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Wed, 29 May 2024 16:30:06 -0600 Subject: [PATCH 0375/1248] remove unnecessary import call --- cime_config/SystemTests/pvt.py | 2 -- cime_config/SystemTests/systemtest_utils.py | 5 ++--- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/cime_config/SystemTests/pvt.py b/cime_config/SystemTests/pvt.py index 05da935a0e..feef6cb04c 100644 --- a/cime_config/SystemTests/pvt.py +++ b/cime_config/SystemTests/pvt.py @@ -8,12 +8,10 @@ - use CLM_ACCELERATED_SPINUP? 2) run a transient landuse case with use_fates_lupft - start from the restart file generated in (1) - """ from CIME.XML.standard_module_setup import * from CIME.SystemTests.system_tests_common import SystemTestsCommon from CIME.SystemTests.test_utils.user_nl_utils import append_to_user_nl_files -from systemtest_utils import find_user_nl_option import shutil, glob, os logger = logging.getLogger(__name__) diff --git a/cime_config/SystemTests/systemtest_utils.py b/cime_config/SystemTests/systemtest_utils.py index 2591ac4223..c39f5171ba 100644 --- a/cime_config/SystemTests/systemtest_utils.py +++ b/cime_config/SystemTests/systemtest_utils.py @@ -85,9 +85,8 @@ def run_python_script(caseroot, this_conda_env, command_in, tool_path): except: print(f"ERROR trying to run {tool_name}.") raise -""" -Read a user_nl file and return the namelist option if found -""" + +# Read a user_nl file and return the namelist option if found def find_user_nl_option(caseroot, component, namelist_option): # This is a copy of the CIME _get_list_of_user_nl_files From 1ed3f1967ed4564e2809841ca8a99b09a479299f Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Wed, 29 May 2024 16:46:46 -0600 Subject: [PATCH 0376/1248] Replace cheyenne with derecho in a .rst file --- .../obtaining-and-building-ctsm.rst | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/doc/source/lilac/obtaining-building-and-running/obtaining-and-building-ctsm.rst b/doc/source/lilac/obtaining-building-and-running/obtaining-and-building-ctsm.rst index ef24e695b9..907f63f211 100644 --- a/doc/source/lilac/obtaining-building-and-running/obtaining-and-building-ctsm.rst +++ b/doc/source/lilac/obtaining-building-and-running/obtaining-and-building-ctsm.rst @@ -29,9 +29,9 @@ Obtain CTSM by running:: ./bin/git-fleximod update Then build CTSM and its dependencies. On a machine that has been ported to CIME, the -command will look like this (example given for NCAR's ``cheyenne`` machine):: +command will look like this (example given for NCAR's ``derecho`` machine):: - ./lilac/build_ctsm /glade/scratch/$USER/ctsm_build_dir --machine cheyenne --compiler intel + ./lilac/build_ctsm /glade/scratch/$USER/ctsm_build_dir --machine derecho --compiler intel and then, before building the atmosphere model:: @@ -145,13 +145,13 @@ the `CIME documentation`_. Building on a CIME-supported machine ------------------------------------ -If you are using a machine that has been ported to CIME_ (for example, NCAR's ``cheyenne`` +If you are using a machine that has been ported to CIME_ (for example, NCAR's ``derecho`` machine), then you do not need to specify much information to ``build_ctsm``. In addition, in this case, CIME will load the appropriate modules and set the appropriate environment variables at build time, so you do not need to do anything to set up your environment ahead of time. **Building CTSM with LILAC requires ESMF. ESMF is currently an optional CIME dependency, so many CIME-ported machines do not provide information on an ESMF -installation. NCAR's cheyenne machine DOES provide ESMF, but for other machines, you may +installation. NCAR's derecho machine DOES provide ESMF, but for other machines, you may need to add this to your CIME port.** To build CTSM and its dependencies in this case, run:: @@ -231,7 +231,7 @@ Example usage for a Mac (a simple case) is:: ./lilac/build_ctsm ~/ctsm_build_dir --os Darwin --compiler gnu --netcdf-path /usr/local --esmf-mkfile-path /Users/sacks/ESMF/esmf8.0.0/lib/libO/Darwin.gfortranclang.64.mpich3.default/esmf.mk --max-mpitasks-per-node 4 --no-pnetcdf -Example usage for NCAR's ``cheyenne`` machine (a more complex case) is:: +Example usage for NCAR's ``derecho`` machine (a more complex case) is:: module purge module load ncarenv/1.3 python/3.7.9 cmake intel/19.1.1 esmf_libs mkl From 4f9db007afa9b3e1705c7bad78c2cc71714d9cd6 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Thu, 30 May 2024 11:51:36 -0600 Subject: [PATCH 0377/1248] Add "bin/" before git-fleximod in README documentation --- README | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README b/README index 97daae2d5a..07d9c7b13d 100644 --- a/README +++ b/README @@ -50,7 +50,7 @@ lilac ------------- Lightweight Infrastructure for Land-Atmosphere Coupling (for test -------------- CTSM Testing scripts for CTSM offline tools (deprecated) tools ------------- CTSM Offline tools to prepare input datasets and process output. cime_config ------- Configuration files of cime for compsets and CTSM settings -git-fleximod ------ Script to manage the external source directories +bin/git-fleximod -- Script to manage the external source directories py_env_create ----- Script to setup the python environment for CTSM python tools using conda python ------------ Python modules used in tools and testing and automated checking of ALL CTSM python scirpts From 8ac86a1f21704e952b5dbb753f51cb4ddcfd47f4 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Thu, 30 May 2024 12:10:04 -0600 Subject: [PATCH 0378/1248] Replacing README_EXTERNALS.rst with README_GITFLEXIMOD.rst --- README_GITFLEXIMOD.rst | 127 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 127 insertions(+) create mode 100644 README_GITFLEXIMOD.rst diff --git a/README_GITFLEXIMOD.rst b/README_GITFLEXIMOD.rst new file mode 100644 index 0000000000..f91ef30fae --- /dev/null +++ b/README_GITFLEXIMOD.rst @@ -0,0 +1,127 @@ +Obtaining the full model code and associated scripting infrastructure +===================================================================== + +CTSM is released via GitHub. You will need some familiarity with git in order +to modify the code and commit these changes. However, to simply checkout and run the +code, no git knowledge is required other than what is documented in the following steps. + +To obtain the CTSM code you need to do the following: + +#. Clone the repository. :: + + git clone https://github.com/escomp/ctsm.git my_ctsm_sandbox + + This will create a directory ``my_ctsm_sandbox/`` in your current working directory. + +#. Run **./bin/git-fleximod update**. :: + + ./bin/git-fleximod update + + **git-fleximod** is a package manager that will + populate the ctsm directory with the relevant versions of each of the + components along with the CIME infrastructure code. + +At this point you have a working version of CTSM. + +To see full details of how to set up a case, compile and run, see the CIME documentation at http://esmci.github.io/cime/ . + +More details on git-fleximod +---------------------------- + +The file **Externals.cfg** in your top-level CTSM directory tells +**git-fleximod** which tag/branch of each component should be +brought in to generate your sandbox. **Externals_CLM.cfg** is used similarly to point to the correct version of FATES (and possibly other CTSM-specific externals in the future); the below instructions referring to **Externals.cfg** also apply to modifying **Externals_CLM.cfg**. + +NOTE: git-fleximod will always attempt +to make the working copy exactly match the externals description. If +you manually modify an external without updating Externals.cfg, e.g. switch +to a different tag, then rerunning git-fleximod will switch you +back to the external described in Externals.cfg. See below +documentation `Customizing your CTSM sandbox`_ for more details. + +**You need to rerun git-fleximod whenever Externals.cfg has +changed** (unless you have already manually updated the relevant +external(s) to have the correct branch/tag checked out). Common times +when this is needed are: + +* After checking out a new CTSM branch/tag + +* After merging some other CTSM branch/tag into your currently + checked-out branch + +**./bin/git-fleximod** must be run from the root of the source +tree. For example, if you cloned CTSM with:: + + git clone https://github.com/escomp/ctsm.git my_ctsm_sandbox + +then you must run **./bin/git-fleximod** from +``/path/to/my_ctsm_sandbox``. + +To see more details of **git-fleximod**, issue :: + + ./bin/git-fleximod --help + +Customizing your CTSM sandbox +============================= + +There are several use cases to consider when you want to customize or modify your CTSM sandbox. + +Switching to a different CTSM branch or tag +------------------------------------------- + +If you have already checked out a branch or tag and **HAVE NOT MADE ANY +MODIFICATIONS** it is simple to change your sandbox. Say that you +checked out ctsm1.0.0 but really wanted to have ctsm1.1.0; +you would simply do the following:: + + git checkout ctsm1.1.0 + ./bin/git-fleximod + +You should **not** use this method if you have made any source code +changes, or if you have any ongoing CTSM cases that were created from +this sandbox. In these cases, it is often easiest to do a second **git +clone**. + +Pointing to a different version of a component +---------------------------------------------- + +Each entry in **Externals.cfg** has the following form (we use CIME as an +example below):: + + [cime] + local_path = cime + protocol = git + repo_url = https://github.com/CESM-Development/cime + tag = cime5.4.0-alpha.20 + required = True + +Each entry specifies either a tag, a hash or a branch. To point to a new tag: + +#. Modify the relevant entry/entries in **Externals.cfg** (e.g., changing + ``cime5.4.0-alpha.20`` to ``cime5.4.0-alpha.21`` above) + +#. Checkout the new component(s):: + + ./bin/git-fleximod + +To point to a hash, the process is the same, except also change ``tag = ...`` to ``hash = ...``. + +To point to a branch, use ``branch = ...``. Pointing to a branch means that, each time you run ``./bin/git-fleximod`` you will get the current latest version of that branch. This can be convenient for in-progress development work, but should not be used when you need a stable version for scientific simulations. There are a number of gotchas with this workflow, so in general you should default to pointing to fixed hashes. (For CTSM master, we require a fixed hash or, usually, a tag.) + +Keep in mind that changing individual components from a tag may result +in an invalid model (won't compile, won't run, not scientifically +meaningful) and is unsupported. + +Committing your change to Externals.cfg +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +After making this change, it's a good idea to commit the change in your +local CTSM git repository. First create a branch in your local +repository, then commit it. (Unlike with subversion, branches are stored +locally unless you explicitly push them up to GitHub. Feel free to +create whatever local branches you'd like.) For example:: + + git checkout -b my_ctsm_branch + git add Externals.cfg + git commit -m "Update CIME to cime5.4.0-alpha.20" + From 03762a081fd3f283c4ff1b9336fe14b7f71a051a Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Thu, 30 May 2024 16:08:27 -0600 Subject: [PATCH 0379/1248] Updates to README_GITFLEXIMOD.rst as per Jim's review --- README_GITFLEXIMOD.rst | 68 +++++++++++++++++------------------------- 1 file changed, 28 insertions(+), 40 deletions(-) diff --git a/README_GITFLEXIMOD.rst b/README_GITFLEXIMOD.rst index f91ef30fae..ab8c412cee 100644 --- a/README_GITFLEXIMOD.rst +++ b/README_GITFLEXIMOD.rst @@ -15,11 +15,15 @@ To obtain the CTSM code you need to do the following: #. Run **./bin/git-fleximod update**. :: + cd my_ctsm_sandbox ./bin/git-fleximod update + ./bin/git-fleximod --help # for a user's guide **git-fleximod** is a package manager that will populate the ctsm directory with the relevant versions of each of the components along with the CIME infrastructure code. + Additional documentation for git-fleximod appears here: + https://github.com/ESMCI/git-fleximod?tab=readme-ov-file#git-fleximod At this point you have a working version of CTSM. @@ -28,18 +32,18 @@ To see full details of how to set up a case, compile and run, see the CIME docum More details on git-fleximod ---------------------------- -The file **Externals.cfg** in your top-level CTSM directory tells +The file **.gitmodules** in your top-level CTSM directory tells **git-fleximod** which tag/branch of each component should be -brought in to generate your sandbox. **Externals_CLM.cfg** is used similarly to point to the correct version of FATES (and possibly other CTSM-specific externals in the future); the below instructions referring to **Externals.cfg** also apply to modifying **Externals_CLM.cfg**. +brought in to generate your sandbox. -NOTE: git-fleximod will always attempt -to make the working copy exactly match the externals description. If -you manually modify an external without updating Externals.cfg, e.g. switch -to a different tag, then rerunning git-fleximod will switch you -back to the external described in Externals.cfg. See below -documentation `Customizing your CTSM sandbox`_ for more details. +NOTE: If you manually modify an external without updating .gitmodules, +e.g. switch to a different tag, then rerunning git-fleximod will warn you of +local changes you need to resolve. +git-fleximod will not change a modified external back to what is specified in +.gitmodules without the --force option. +See below documentation `Customizing your CTSM sandbox`_ for more details. -**You need to rerun git-fleximod whenever Externals.cfg has +**You need to rerun git-fleximod whenever .gitmodules has changed** (unless you have already manually updated the relevant external(s) to have the correct branch/tag checked out). Common times when this is needed are: @@ -49,18 +53,6 @@ when this is needed are: * After merging some other CTSM branch/tag into your currently checked-out branch -**./bin/git-fleximod** must be run from the root of the source -tree. For example, if you cloned CTSM with:: - - git clone https://github.com/escomp/ctsm.git my_ctsm_sandbox - -then you must run **./bin/git-fleximod** from -``/path/to/my_ctsm_sandbox``. - -To see more details of **git-fleximod**, issue :: - - ./bin/git-fleximod --help - Customizing your CTSM sandbox ============================= @@ -75,7 +67,7 @@ checked out ctsm1.0.0 but really wanted to have ctsm1.1.0; you would simply do the following:: git checkout ctsm1.1.0 - ./bin/git-fleximod + ./bin/git-fleximod update You should **not** use this method if you have made any source code changes, or if you have any ongoing CTSM cases that were created from @@ -85,35 +77,31 @@ clone**. Pointing to a different version of a component ---------------------------------------------- -Each entry in **Externals.cfg** has the following form (we use CIME as an +Each entry in **.gitmodules** has the following form (we use CIME as an example below):: - [cime] - local_path = cime - protocol = git - repo_url = https://github.com/CESM-Development/cime - tag = cime5.4.0-alpha.20 - required = True + [submodule "cime"] + path = cime + url = https://github.com/ESMCI/cime + fxtag = cime6.0.246 + fxrequired = ToplevelRequired + fxDONOTUSEurl = https://github.com/ESMCI/cime -Each entry specifies either a tag, a hash or a branch. To point to a new tag: +Each entry specifies either a tag or a hash. To point to a new tag or hash: -#. Modify the relevant entry/entries in **Externals.cfg** (e.g., changing - ``cime5.4.0-alpha.20`` to ``cime5.4.0-alpha.21`` above) +#. Modify the relevant entry/entries in **.gitmodules** (e.g., changing + ``cime6.0.246`` to ``cime6.0.247`` above) #. Checkout the new component(s):: - ./bin/git-fleximod - -To point to a hash, the process is the same, except also change ``tag = ...`` to ``hash = ...``. - -To point to a branch, use ``branch = ...``. Pointing to a branch means that, each time you run ``./bin/git-fleximod`` you will get the current latest version of that branch. This can be convenient for in-progress development work, but should not be used when you need a stable version for scientific simulations. There are a number of gotchas with this workflow, so in general you should default to pointing to fixed hashes. (For CTSM master, we require a fixed hash or, usually, a tag.) + ./bin/git-fleximod update Keep in mind that changing individual components from a tag may result in an invalid model (won't compile, won't run, not scientifically meaningful) and is unsupported. -Committing your change to Externals.cfg -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Committing your change to .gitmodules +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ After making this change, it's a good idea to commit the change in your local CTSM git repository. First create a branch in your local @@ -122,6 +110,6 @@ locally unless you explicitly push them up to GitHub. Feel free to create whatever local branches you'd like.) For example:: git checkout -b my_ctsm_branch - git add Externals.cfg + git add .gitmodules git commit -m "Update CIME to cime5.4.0-alpha.20" From 6fa0255660c848b4f49603511b1da79750b686c8 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Thu, 30 May 2024 16:09:26 -0600 Subject: [PATCH 0380/1248] Jim's suggestions for doc/.../lilac/.../obtaining-and-building-ctsm.rst --- .../obtaining-and-building-ctsm.rst | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/doc/source/lilac/obtaining-building-and-running/obtaining-and-building-ctsm.rst b/doc/source/lilac/obtaining-building-and-running/obtaining-and-building-ctsm.rst index 907f63f211..fcd8235b62 100644 --- a/doc/source/lilac/obtaining-building-and-running/obtaining-and-building-ctsm.rst +++ b/doc/source/lilac/obtaining-building-and-running/obtaining-and-building-ctsm.rst @@ -91,7 +91,7 @@ Building CTSM requires: - ESMF version 8 or later - - **ESMF is not needed in general for CTSM, but is needed for LILAC** + - **ESMF is needed for LILAC (and for CESM3 and later)** Obtaining CTSM ============== @@ -149,10 +149,11 @@ If you are using a machine that has been ported to CIME_ (for example, NCAR's `` machine), then you do not need to specify much information to ``build_ctsm``. In addition, in this case, CIME will load the appropriate modules and set the appropriate environment variables at build time, so you do not need to do anything to set up your environment -ahead of time. **Building CTSM with LILAC requires ESMF. ESMF is currently an optional -CIME dependency, so many CIME-ported machines do not provide information on an ESMF -installation. NCAR's derecho machine DOES provide ESMF, but for other machines, you may -need to add this to your CIME port.** +ahead of time. **Building CTSM with LILAC requires ESMF. ESMF is an optional +CIME dependency before CESM3 and not optional for CESM3. +NCAR's derecho machine DOES provide ESMF. For other machines, you may +need to add this to your CIME port. Please see esmf.org for download and build +instructions.** To build CTSM and its dependencies in this case, run:: From ae93d22bfee601a9fbe4561cedbd77945ab23bbf Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Thu, 30 May 2024 16:42:18 -0600 Subject: [PATCH 0381/1248] Remove cheyenne from testlis_clm.xml --- cime_config/testdefs/testlist_clm.xml | 651 +------------------------- 1 file changed, 1 insertion(+), 650 deletions(-) diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index 9cfba6f5b3..1ac2334ba8 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -43,8 +43,6 @@ - - @@ -259,24 +257,14 @@ --> - - - - - - - - - - @@ -360,8 +348,6 @@ - - @@ -422,15 +408,6 @@ - - - - - - - - - @@ -440,14 +417,6 @@ - - - - - - - - @@ -456,14 +425,6 @@ - - - - - - - - @@ -474,7 +435,6 @@ - @@ -483,8 +443,6 @@ - - @@ -494,7 +452,6 @@ - @@ -512,7 +469,6 @@ - @@ -539,8 +495,6 @@ - - @@ -548,15 +502,6 @@ - - - - - - - - - @@ -568,7 +513,6 @@ - @@ -788,7 +732,6 @@ - @@ -798,7 +741,6 @@ - @@ -808,7 +750,6 @@ - @@ -817,8 +758,6 @@ - - @@ -828,7 +767,6 @@ - @@ -838,8 +776,6 @@ - - @@ -857,7 +793,6 @@ - @@ -866,8 +801,6 @@ - - @@ -877,7 +810,6 @@ - @@ -922,15 +854,6 @@ - - - - - - - - - @@ -940,15 +863,6 @@ - - - - - - - - - @@ -960,7 +874,6 @@ - @@ -984,17 +897,6 @@ - - - - - - - - - - - @@ -1006,14 +908,6 @@ - - - - - - - - @@ -1022,15 +916,6 @@ - - - - - - - - - @@ -1058,14 +943,6 @@ - - - - - - - - @@ -1074,14 +951,6 @@ - - - - - - - - @@ -1090,14 +959,6 @@ - - - - - - - - @@ -1106,15 +967,6 @@ - - - - - - - - - @@ -1124,15 +976,6 @@ - - - - - - - - - @@ -1142,15 +985,6 @@ - - - - - - - - - @@ -1160,15 +994,6 @@ - - - - - - - - - @@ -1180,8 +1005,6 @@ - - @@ -1201,7 +1024,6 @@ - @@ -1210,8 +1032,6 @@ - - @@ -1229,7 +1049,6 @@ - @@ -1286,15 +1105,6 @@ - - - - - - - - - @@ -1306,7 +1116,6 @@ - @@ -1314,15 +1123,6 @@ - - - - - - - - - @@ -1333,14 +1133,6 @@ - - - - - - - - @@ -1349,15 +1141,6 @@ - - - - - - - - - @@ -1367,15 +1150,6 @@ - - - - - - - - - @@ -1387,23 +1161,12 @@ - - - - - - - - - - - @@ -1414,16 +1177,6 @@ - - - - - - - - - - @@ -1434,16 +1187,6 @@ - - - - - - - - - - @@ -1454,15 +1197,6 @@ - - - - - - - - - @@ -1472,14 +1206,6 @@ - - - - - - - - @@ -1489,15 +1215,6 @@ - - - - - - - - - @@ -1507,16 +1224,6 @@ - - - - - - - - - - @@ -1527,14 +1234,6 @@ - - - - - - - - @@ -1543,15 +1242,6 @@ - - - - - - - - - @@ -1561,16 +1251,6 @@ - - - - - - - - - - @@ -1581,16 +1261,6 @@ - - - - - - - - - - @@ -1603,22 +1273,12 @@ - - - - - - - - - - @@ -1639,7 +1299,6 @@ - @@ -1649,7 +1308,6 @@ - @@ -1659,7 +1317,6 @@ - @@ -1667,15 +1324,6 @@ - - - - - - - - - @@ -1687,10 +1335,6 @@ - - - - @@ -1702,7 +1346,6 @@ - @@ -1712,7 +1355,6 @@ - @@ -1721,7 +1363,6 @@ - @@ -1730,8 +1371,6 @@ - - @@ -1750,7 +1389,6 @@ - @@ -1805,7 +1443,6 @@ - @@ -1822,15 +1459,6 @@ - - - - - - - - - @@ -1840,15 +1468,6 @@ - - - - - - - - - @@ -1858,15 +1477,6 @@ - - - - - - - - - @@ -1878,7 +1488,6 @@ - @@ -1888,8 +1497,6 @@ - - @@ -1900,7 +1507,6 @@ - @@ -1931,7 +1537,6 @@ - @@ -1939,15 +1544,6 @@ - - - - - - - - - @@ -1959,7 +1555,6 @@ - @@ -1969,8 +1564,6 @@ - - @@ -1981,8 +1574,6 @@ - - @@ -1992,8 +1583,6 @@ - - @@ -2010,16 +1599,6 @@ - - - - - - - - - - @@ -2033,7 +1612,6 @@ - @@ -2043,7 +1621,6 @@ - @@ -2053,8 +1630,6 @@ - - @@ -2146,7 +1721,6 @@ - @@ -2156,7 +1730,6 @@ - @@ -2166,7 +1739,6 @@ - @@ -2204,12 +1776,10 @@ - - @@ -2225,16 +1795,6 @@ - - - - - - - - - - @@ -2255,10 +1815,6 @@ - - - - @@ -2270,9 +1826,6 @@ - - - @@ -2283,7 +1836,6 @@ - @@ -2292,8 +1844,6 @@ - - @@ -2356,20 +1906,9 @@ - - - - - - - - - - - - + @@ -2407,7 +1946,6 @@ - @@ -2426,7 +1964,6 @@ - @@ -2436,7 +1973,6 @@ - @@ -2456,7 +1992,6 @@ - @@ -2482,7 +2017,6 @@ - @@ -2492,7 +2026,6 @@ - @@ -2502,7 +2035,6 @@ - @@ -2584,7 +2116,6 @@ - @@ -2594,8 +2125,6 @@ - - @@ -2632,7 +2161,6 @@ - @@ -2642,7 +2170,6 @@ - @@ -2651,7 +2178,6 @@ - @@ -2660,8 +2186,6 @@ - - @@ -2690,7 +2214,6 @@ - @@ -2700,7 +2223,6 @@ - @@ -2710,7 +2232,6 @@ - @@ -2740,7 +2261,6 @@ - @@ -2759,8 +2279,6 @@ - - @@ -2771,7 +2289,6 @@ - @@ -2780,7 +2297,6 @@ - @@ -2790,7 +2306,6 @@ - @@ -2799,8 +2314,6 @@ - - @@ -2819,7 +2332,6 @@ - @@ -2829,8 +2341,6 @@ - - @@ -2838,14 +2348,6 @@ - - - - - - - - @@ -2856,12 +2358,9 @@ - - - @@ -2870,7 +2369,6 @@ - @@ -2879,7 +2377,6 @@ - @@ -2889,7 +2386,6 @@ - @@ -2900,7 +2396,6 @@ - @@ -2911,7 +2406,6 @@ - @@ -2922,7 +2416,6 @@ - @@ -2930,16 +2423,6 @@ - - - - - - - - - - @@ -2972,18 +2455,6 @@ - - - - - - - - - - - - @@ -2995,7 +2466,6 @@ - @@ -3003,18 +2473,6 @@ - - - - - - - - - - - - @@ -3027,7 +2485,6 @@ - @@ -3038,7 +2495,6 @@ - @@ -3048,7 +2504,6 @@ - @@ -3056,15 +2511,6 @@ - - - - - - - - - @@ -3076,7 +2522,6 @@ - @@ -3087,7 +2532,6 @@ - @@ -3098,7 +2542,6 @@ - @@ -3110,7 +2553,6 @@ - @@ -3121,7 +2563,6 @@ - @@ -3131,8 +2572,6 @@ - - @@ -3144,7 +2583,6 @@ - @@ -3155,7 +2593,6 @@ - @@ -3167,10 +2604,8 @@ - - @@ -3181,7 +2616,6 @@ - @@ -3192,7 +2626,6 @@ - @@ -3204,7 +2637,6 @@ - @@ -3215,7 +2647,6 @@ - @@ -3226,7 +2657,6 @@ - @@ -3237,7 +2667,6 @@ - @@ -3248,7 +2677,6 @@ - @@ -3258,7 +2686,6 @@ - @@ -3268,7 +2695,6 @@ - @@ -3278,7 +2704,6 @@ - @@ -3287,7 +2712,6 @@ - @@ -3298,7 +2722,6 @@ - @@ -3308,7 +2731,6 @@ - @@ -3319,7 +2741,6 @@ - @@ -3329,7 +2750,6 @@ - @@ -3339,7 +2759,6 @@ - @@ -3348,16 +2767,6 @@ - - - - - - - - - - @@ -3370,7 +2779,6 @@ - @@ -3380,7 +2788,6 @@ - @@ -3391,7 +2798,6 @@ - @@ -3402,8 +2808,6 @@ - - @@ -3414,7 +2818,6 @@ - @@ -3424,9 +2827,6 @@ - - - @@ -3448,7 +2848,6 @@ - @@ -3458,11 +2857,8 @@ - - - @@ -3471,7 +2867,6 @@ - @@ -3491,7 +2886,6 @@ - @@ -3539,8 +2933,6 @@ - - @@ -3561,16 +2953,6 @@ - - - - - - - - - - @@ -3580,16 +2962,6 @@ - - - - - - - - - - @@ -3599,16 +2971,6 @@ - - - - - - - - - - @@ -3618,15 +2980,6 @@ - - - - - - - - - @@ -3639,7 +2992,6 @@ - @@ -3650,7 +3002,6 @@ - From b25a02d904bf8cd010fb400b4b0181361f077d83 Mon Sep 17 00:00:00 2001 From: Jim Edwards Date: Fri, 31 May 2024 10:20:07 -0600 Subject: [PATCH 0382/1248] fix subtree add --- .../git-fleximod/.github/workflows/pre-commit | 13 - .../.github/workflows/pytest.yaml | 77 -- .lib/git-fleximod/.pre-commit-config.yaml | 18 - .lib/git-fleximod/License | 20 - .lib/git-fleximod/README.md | 110 --- .lib/git-fleximod/doc/Makefile | 20 - .lib/git-fleximod/doc/conf.py | 26 - .lib/git-fleximod/doc/index.rst | 24 - .lib/git-fleximod/doc/make.bat | 35 - .lib/git-fleximod/escomp_install | 25 - .lib/git-fleximod/git_fleximod/__init__.py | 0 .lib/git-fleximod/git_fleximod/cli.py | 119 --- .../git-fleximod/git_fleximod/git_fleximod.py | 601 --------------- .../git-fleximod/git_fleximod/gitinterface.py | 79 -- .lib/git-fleximod/git_fleximod/gitmodules.py | 97 --- .../git-fleximod/git_fleximod/lstripreader.py | 43 -- .lib/git-fleximod/git_fleximod/metoflexi.py | 236 ------ .lib/git-fleximod/git_fleximod/utils.py | 365 --------- .lib/git-fleximod/poetry.lock | 693 ------------------ .lib/git-fleximod/pyproject.toml | 41 -- .lib/git-fleximod/tbump.toml | 43 -- .lib/git-fleximod/tests/__init__.py | 3 - .lib/git-fleximod/tests/conftest.py | 138 ---- .lib/git-fleximod/tests/test_a_import.py | 8 - .lib/git-fleximod/tests/test_b_update.py | 26 - .lib/git-fleximod/tests/test_c_required.py | 30 - .lib/git-fleximod/tests/test_d_complex.py | 67 -- 27 files changed, 2957 deletions(-) delete mode 100644 .lib/git-fleximod/.github/workflows/pre-commit delete mode 100644 .lib/git-fleximod/.github/workflows/pytest.yaml delete mode 100644 .lib/git-fleximod/.pre-commit-config.yaml delete mode 100644 .lib/git-fleximod/License delete mode 100644 .lib/git-fleximod/README.md delete mode 100644 .lib/git-fleximod/doc/Makefile delete mode 100644 .lib/git-fleximod/doc/conf.py delete mode 100644 .lib/git-fleximod/doc/index.rst delete mode 100644 .lib/git-fleximod/doc/make.bat delete mode 100644 .lib/git-fleximod/escomp_install delete mode 100644 .lib/git-fleximod/git_fleximod/__init__.py delete mode 100644 .lib/git-fleximod/git_fleximod/cli.py delete mode 100755 .lib/git-fleximod/git_fleximod/git_fleximod.py delete mode 100644 .lib/git-fleximod/git_fleximod/gitinterface.py delete mode 100644 .lib/git-fleximod/git_fleximod/gitmodules.py delete mode 100644 .lib/git-fleximod/git_fleximod/lstripreader.py delete mode 100755 .lib/git-fleximod/git_fleximod/metoflexi.py delete mode 100644 .lib/git-fleximod/git_fleximod/utils.py delete mode 100644 .lib/git-fleximod/poetry.lock delete mode 100644 .lib/git-fleximod/pyproject.toml delete mode 100644 .lib/git-fleximod/tbump.toml delete mode 100644 .lib/git-fleximod/tests/__init__.py delete mode 100644 .lib/git-fleximod/tests/conftest.py delete mode 100644 .lib/git-fleximod/tests/test_a_import.py delete mode 100644 .lib/git-fleximod/tests/test_b_update.py delete mode 100644 .lib/git-fleximod/tests/test_c_required.py delete mode 100644 .lib/git-fleximod/tests/test_d_complex.py diff --git a/.lib/git-fleximod/.github/workflows/pre-commit b/.lib/git-fleximod/.github/workflows/pre-commit deleted file mode 100644 index 1a6ad0082a..0000000000 --- a/.lib/git-fleximod/.github/workflows/pre-commit +++ /dev/null @@ -1,13 +0,0 @@ -name: pre-commit -on: - pull_request: - push: - branches: [main] - -jobs: - pre-commit: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-python@v3 - - uses: pre-commit/action@v3.0.0 diff --git a/.lib/git-fleximod/.github/workflows/pytest.yaml b/.lib/git-fleximod/.github/workflows/pytest.yaml deleted file mode 100644 index 0868dd9a33..0000000000 --- a/.lib/git-fleximod/.github/workflows/pytest.yaml +++ /dev/null @@ -1,77 +0,0 @@ -# Run this job on pushes to `main`, and for pull requests. If you don't specify -# `branches: [main], then this actions runs _twice_ on pull requests, which is -# annoying. - -on: - push: - branches: [main] - pull_request: - branches: [main] - -jobs: - test: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - # If you wanted to use multiple Python versions, you'd have specify a matrix in the job and - # reference the matrixe python version here. - - uses: actions/setup-python@v5 - with: - python-version: '3.9' - - # Cache the installation of Poetry itself, e.g. the next step. This prevents the workflow - # from installing Poetry every time, which can be slow. Note the use of the Poetry version - # number in the cache key, and the "-0" suffix: this allows you to invalidate the cache - # manually if/when you want to upgrade Poetry, or if something goes wrong. This could be - # mildly cleaner by using an environment variable, but I don't really care. - - name: cache poetry install - uses: actions/cache@v4 - with: - path: ~/.local - key: poetry-1.7.1 - - # Install Poetry. You could do this manually, or there are several actions that do this. - # `snok/install-poetry` seems to be minimal yet complete, and really just calls out to - # Poetry's default install script, which feels correct. I pin the Poetry version here - # because Poetry does occasionally change APIs between versions and I don't want my - # actions to break if it does. - # - # The key configuration value here is `virtualenvs-in-project: true`: this creates the - # venv as a `.venv` in your testing directory, which allows the next step to easily - # cache it. - - uses: snok/install-poetry@v1 - with: - version: 1.7.1 - virtualenvs-create: true - virtualenvs-in-project: true - - # Cache your dependencies (i.e. all the stuff in your `pyproject.toml`). Note the cache - # key: if you're using multiple Python versions, or multiple OSes, you'd need to include - # them in the cache key. I'm not, so it can be simple and just depend on the poetry.lock. - - name: cache deps - id: cache-deps - uses: actions/cache@v4 - with: - path: .venv - key: pydeps-${{ hashFiles('**/poetry.lock') }} - - # Install dependencies. `--no-root` means "install all dependencies but not the project - # itself", which is what you want to avoid caching _your_ code. The `if` statement - # ensures this only runs on a cache miss. - - run: poetry install --no-interaction --no-root - if: steps.cache-deps.outputs.cache-hit != 'true' - - # Now install _your_ project. This isn't necessary for many types of projects -- particularly - # things like Django apps don't need this. But it's a good idea since it fully-exercises the - # pyproject.toml and makes that if you add things like console-scripts at some point that - # they'll be installed and working. - - run: poetry install --no-interaction - - # And finally run tests. I'm using pytest and all my pytest config is in my `pyproject.toml` - # so this line is super-simple. But it could be as complex as you need. - - run: | - git config --global user.name "${GITHUB_ACTOR}" - git config --global user.email "${GITHUB_ACTOR_ID}+${GITHUB_ACTOR}@users.noreply.github.com" - poetry run pytest - diff --git a/.lib/git-fleximod/.pre-commit-config.yaml b/.lib/git-fleximod/.pre-commit-config.yaml deleted file mode 100644 index 2f6089da72..0000000000 --- a/.lib/git-fleximod/.pre-commit-config.yaml +++ /dev/null @@ -1,18 +0,0 @@ -exclude: ^utils/.*$ - -repos: - - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.0.1 - hooks: - - id: end-of-file-fixer - - id: trailing-whitespace - - repo: https://github.com/psf/black - rev: 22.3.0 - hooks: - - id: black - - repo: https://github.com/PyCQA/pylint - rev: v2.11.1 - hooks: - - id: pylint - args: - - --disable=I,C,R,logging-not-lazy,wildcard-import,unused-wildcard-import,fixme,broad-except,bare-except,eval-used,exec-used,global-statement,logging-format-interpolation,no-name-in-module,arguments-renamed,unspecified-encoding,protected-access,import-error,no-member diff --git a/.lib/git-fleximod/License b/.lib/git-fleximod/License deleted file mode 100644 index 2c6fe768c2..0000000000 --- a/.lib/git-fleximod/License +++ /dev/null @@ -1,20 +0,0 @@ -Copyright 2024 National Center for Atmospheric Sciences (NCAR) - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -“Software”), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/.lib/git-fleximod/README.md b/.lib/git-fleximod/README.md deleted file mode 100644 index d1ef632f28..0000000000 --- a/.lib/git-fleximod/README.md +++ /dev/null @@ -1,110 +0,0 @@ -# git-fleximod - -Flexible, Enhanced Submodule Management for Git - -## Overview - -Git-fleximod is a Python-based tool that extends Git's submodule and sparse checkout capabilities, offering additional features for managing submodules in a more flexible and efficient way. - -## Installation - -#TODO Install using pip: -# pip install git-fleximod - If you choose to locate git-fleximod in your path you can access it via command: git fleximod - -## Usage - - Basic Usage: - git fleximod [options] - Available Commands: - status: Display the status of submodules. - update: Update submodules to the tag indicated in .gitmodules variable fxtag. - test: Make sure that fxtags and submodule hashes are consistant, - make sure that official urls (as defined by fxDONOTUSEurl) are set - make sure that fxtags are defined for all submodules - Additional Options: - See git fleximod --help for more details. - -## Supported .gitmodules Variables - - fxtag: Specify a specific tag or branch to checkout for a submodule. - fxrequired: Mark a submodule's checkout behavior, with allowed values: - - ToplevelRequired: Top-level and required (checked out only when this is the Toplevel module). - - ToplevelOptional: Top-level and optional (checked out with --optional flag if this is the Toplevel module). - - AlwaysRequired: Always required (always checked out). - - AlwaysOptional: Always optional (checked out with --optional flag). - fxsparse: Enable sparse checkout for a submodule, pointing to a file containing sparse checkout paths. - fxDONOTUSEurl: This is the url used in the test subcommand to assure that protected branches do not point to forks - **NOTE** the fxDONOTUSEurl variable is only used to identify the official project repository and should not be - changed by users. Use the url variable to change to a fork if desired. - -## Sparse Checkouts - - To enable sparse checkout for a submodule, set the fxsparse variable - in the .gitmodules file to the path of a file containing the desired - sparse checkout paths. Git-fleximod will automatically configure - sparse checkout based on this file when applicable commands are run. - See [git-sparse-checkout](https://git-scm.com/docs/git-sparse-checkout#_internalsfull_pattern_set) - for details on the format of this file. - -## Tests - - The git fleximod test action is designed to be used by, for example, github workflows - to assure that protected branches are consistant with respect to submodule hashes and fleximod fxtags - -## Examples - -Here are some common usage examples: - -Update all submodules, including optional ones: -```bash - git fleximod update --optional -``` - -Updating a specific submodule to the fxtag indicated in .gitmodules: - -```bash - git fleximod update submodule-name -``` -Example .gitmodules entry: -```ini, toml - [submodule "cosp2"] - path = src/physics/cosp2/src - url = https://github.com/CFMIP/COSPv2.0 - fxsparse = ../.cosp_sparse_checkout - fxrequired = AlwaysRequired - fxtag = v2.1.4cesm -``` -Explanation: - -This entry indicates that the submodule named cosp2 at tag v2.1.4cesm -should be checked out into the directory src/physics/cosp2/src -relative to the .gitmodules directory. It should be checked out from -the URL https://github.com/CFMIP/COSPv2.0 and use sparse checkout as -described in the file ../.cosp_sparse_checkout relative to the path -directory. It should be checked out anytime this .gitmodules entry is -read. - -Additional example: -```ini, toml - [submodule "cime"] - path = cime - url = https://github.com/jedwards4b/cime - fxrequired = ToplevelRequired - fxtag = cime6.0.198_rme01 -``` - -Explanation: - -This entry indicates that the submodule cime should be checked out -into a directory named cime at tag cime6.0.198_rme01 from the URL -https://github.com/jedwards4b/cime. This should only be done if -the .gitmodules file is at the top level of the repository clone. - -## Contributing - -We welcome contributions! Please see the CONTRIBUTING.md file for guidelines. - -## License - -Git-fleximod is released under the MIT License. diff --git a/.lib/git-fleximod/doc/Makefile b/.lib/git-fleximod/doc/Makefile deleted file mode 100644 index d4bb2cbb9e..0000000000 --- a/.lib/git-fleximod/doc/Makefile +++ /dev/null @@ -1,20 +0,0 @@ -# Minimal makefile for Sphinx documentation -# - -# You can set these variables from the command line, and also -# from the environment for the first two. -SPHINXOPTS ?= -SPHINXBUILD ?= sphinx-build -SOURCEDIR = . -BUILDDIR = _build - -# Put it first so that "make" without argument is like "make help". -help: - @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) - -.PHONY: help Makefile - -# Catch-all target: route all unknown targets to Sphinx using the new -# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). -%: Makefile - @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) diff --git a/.lib/git-fleximod/doc/conf.py b/.lib/git-fleximod/doc/conf.py deleted file mode 100644 index 423099eec9..0000000000 --- a/.lib/git-fleximod/doc/conf.py +++ /dev/null @@ -1,26 +0,0 @@ -# Configuration file for the Sphinx documentation builder. -# -# For the full list of built-in configuration values, see the documentation: -# https://www.sphinx-doc.org/en/master/usage/configuration.html - -# -- Project information ----------------------------------------------------- -# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information - -project = "git-fleximod" -author = "Jim Edwards " -release = "0.4.0" - -# -- General configuration --------------------------------------------------- -# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration - -extensions = ["sphinx_argparse_cli"] - -templates_path = ["_templates"] -exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"] - - -# -- Options for HTML output ------------------------------------------------- -# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output - -html_theme = "alabaster" -html_static_path = ["_static"] diff --git a/.lib/git-fleximod/doc/index.rst b/.lib/git-fleximod/doc/index.rst deleted file mode 100644 index 0f9c1a7f7e..0000000000 --- a/.lib/git-fleximod/doc/index.rst +++ /dev/null @@ -1,24 +0,0 @@ -.. git-fleximod documentation master file, created by - sphinx-quickstart on Sat Feb 3 12:02:22 2024. - You can adapt this file completely to your liking, but it should at least - contain the root `toctree` directive. - -Welcome to git-fleximod's documentation! -======================================== - -.. toctree:: - :maxdepth: 2 - :caption: Contents: -.. module:: sphinxcontrib.autoprogram -.. sphinx_argparse_cli:: - :module: git_fleximod.cli - :func: get_parser - :prog: git-fleximod - - -Indices and tables -================== - -* :ref:`genindex` -* :ref:`modindex` -* :ref:`search` diff --git a/.lib/git-fleximod/doc/make.bat b/.lib/git-fleximod/doc/make.bat deleted file mode 100644 index 32bb24529f..0000000000 --- a/.lib/git-fleximod/doc/make.bat +++ /dev/null @@ -1,35 +0,0 @@ -@ECHO OFF - -pushd %~dp0 - -REM Command file for Sphinx documentation - -if "%SPHINXBUILD%" == "" ( - set SPHINXBUILD=sphinx-build -) -set SOURCEDIR=. -set BUILDDIR=_build - -%SPHINXBUILD% >NUL 2>NUL -if errorlevel 9009 ( - echo. - echo.The 'sphinx-build' command was not found. Make sure you have Sphinx - echo.installed, then set the SPHINXBUILD environment variable to point - echo.to the full path of the 'sphinx-build' executable. Alternatively you - echo.may add the Sphinx directory to PATH. - echo. - echo.If you don't have Sphinx installed, grab it from - echo.https://www.sphinx-doc.org/ - exit /b 1 -) - -if "%1" == "" goto help - -%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% -goto end - -:help -%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% - -:end -popd diff --git a/.lib/git-fleximod/escomp_install b/.lib/git-fleximod/escomp_install deleted file mode 100644 index ae782e72a4..0000000000 --- a/.lib/git-fleximod/escomp_install +++ /dev/null @@ -1,25 +0,0 @@ -#!/usr/bin/env python -# updates git-fleximod in an ESCOMP model -# this script should be run from the model root directory, it expects -# git-fleximod to already be installed with the script in bin -# and the classes in lib/python/site-packages -import sys -import shutil -import os - -from glob import iglob - -fleximod_root = sys.argv[1] -fleximod_path = os.path.join(fleximod_root,"src","git-fleximod") -if os.path.isfile(fleximod_path): - with open(fleximod_path,"r") as f: - fleximod = f.readlines() - with open(os.path.join(".","bin","git-fleximod"),"w") as f: - for line in fleximod: - f.write(line) - if "import argparse" in line: - f.write('\nsys.path.append(os.path.join(os.path.dirname(__file__),"..","lib","python","site-packages"))\n\n') - - for file in iglob(os.path.join(fleximod_root, "src", "fleximod", "*.py")): - shutil.copy(file, - os.path.join("lib","python","site-packages","fleximod",os.path.basename(file))) diff --git a/.lib/git-fleximod/git_fleximod/__init__.py b/.lib/git-fleximod/git_fleximod/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/.lib/git-fleximod/git_fleximod/cli.py b/.lib/git-fleximod/git_fleximod/cli.py deleted file mode 100644 index 1fb959dad0..0000000000 --- a/.lib/git-fleximod/git_fleximod/cli.py +++ /dev/null @@ -1,119 +0,0 @@ -from pathlib import Path -import argparse - -__version__ = "0.7.4" - -def find_root_dir(filename=".git"): - d = Path.cwd() - root = Path(d.root) - while d != root: - attempt = d / filename - if attempt.is_dir(): - return attempt - d = d.parent - return None - - -def get_parser(): - description = """ - %(prog)s manages checking out groups of gitsubmodules with addtional support for Earth System Models - """ - parser = argparse.ArgumentParser( - description=description, formatter_class=argparse.RawDescriptionHelpFormatter - ) - - # - # user options - # - choices = ["update", "status", "test"] - parser.add_argument( - "action", - choices=choices, - default="update", - help=f"Subcommand of git-fleximod, choices are {choices[:-1]}", - ) - - parser.add_argument( - "components", - nargs="*", - help="Specific component(s) to checkout. By default, " - "all required submodules are checked out.", - ) - - parser.add_argument( - "-C", - "--path", - default=find_root_dir(), - help="Toplevel repository directory. Defaults to top git directory relative to current.", - ) - - parser.add_argument( - "-g", - "--gitmodules", - nargs="?", - default=".gitmodules", - help="The submodule description filename. " "Default: %(default)s.", - ) - - parser.add_argument( - "-x", - "--exclude", - nargs="*", - help="Component(s) listed in the gitmodules file which should be ignored.", - ) - parser.add_argument( - "-f", - "--force", - action="store_true", - default=False, - help="Override cautions and update or checkout over locally modified repository.", - ) - - parser.add_argument( - "-o", - "--optional", - action="store_true", - default=False, - help="By default only the required submodules " - "are checked out. This flag will also checkout the " - "optional submodules relative to the toplevel directory.", - ) - - parser.add_argument( - "-v", - "--verbose", - action="count", - default=0, - help="Output additional information to " - "the screen and log file. This flag can be " - "used up to two times, increasing the " - "verbosity level each time.", - ) - - parser.add_argument( - "-V", - "--version", - action="version", - version=f"%(prog)s {__version__}", - help="Print version and exit.", - ) - - # - # developer options - # - parser.add_argument( - "--backtrace", - action="store_true", - help="DEVELOPER: show exception backtraces as extra " "debugging output", - ) - - parser.add_argument( - "-d", - "--debug", - action="store_true", - default=False, - help="DEVELOPER: output additional debugging " - "information to the screen and log file.", - ) - - return parser diff --git a/.lib/git-fleximod/git_fleximod/git_fleximod.py b/.lib/git-fleximod/git_fleximod/git_fleximod.py deleted file mode 100755 index 103cc82a50..0000000000 --- a/.lib/git-fleximod/git_fleximod/git_fleximod.py +++ /dev/null @@ -1,601 +0,0 @@ -#!/usr/bin/env python -import sys - -MIN_PYTHON = (3, 7) -if sys.version_info < MIN_PYTHON: - sys.exit("Python %s.%s or later is required." % MIN_PYTHON) - -import os -import shutil -import logging -import textwrap -from git_fleximod import utils -from git_fleximod import cli -from git_fleximod.gitinterface import GitInterface -from git_fleximod.gitmodules import GitModules -from configparser import NoOptionError - -# logger variable is global -logger = None - - -def fxrequired_allowed_values(): - return ["ToplevelRequired", "ToplevelOptional", "AlwaysRequired", "AlwaysOptional"] - - -def commandline_arguments(args=None): - parser = cli.get_parser() - - if args: - options = parser.parse_args(args) - else: - options = parser.parse_args() - - # explicitly listing a component overrides the optional flag - if options.optional or options.components: - fxrequired = [ - "ToplevelRequired", - "ToplevelOptional", - "AlwaysRequired", - "AlwaysOptional", - ] - else: - fxrequired = ["ToplevelRequired", "AlwaysRequired"] - - action = options.action - if not action: - action = "update" - handlers = [logging.StreamHandler()] - - if options.debug: - try: - open("fleximod.log", "w") - except PermissionError: - sys.exit("ABORT: Could not write file fleximod.log") - level = logging.DEBUG - handlers.append(logging.FileHandler("fleximod.log")) - elif options.verbose: - level = logging.INFO - else: - level = logging.WARNING - # Configure the root logger - logging.basicConfig( - level=level, format="%(name)s - %(levelname)s - %(message)s", handlers=handlers - ) - - if hasattr(options, "version"): - exit() - - return ( - options.path, - options.gitmodules, - fxrequired, - options.components, - options.exclude, - options.force, - action, - ) - - -def submodule_sparse_checkout(root_dir, name, url, path, sparsefile, tag="master"): - """ - This function performs a sparse checkout of a git submodule. It does so by first creating the .git/info/sparse-checkout fileq - in the submodule and then checking out the desired tag. If the submodule is already checked out, it will not be checked out again. - Creating the sparse-checkout file first prevents the entire submodule from being checked out and then removed. This is important - because the submodule may have a large number of files and checking out the entire submodule and then removing it would be time - and disk space consuming. - - Parameters: - root_dir (str): The root directory for the git operation. - name (str): The name of the submodule. - url (str): The URL of the submodule. - path (str): The path to the submodule. - sparsefile (str): The sparse file for the submodule. - tag (str, optional): The tag to checkout. Defaults to "master". - - Returns: - None - """ - logger.info("Called sparse_checkout for {}".format(name)) - rgit = GitInterface(root_dir, logger) - superroot = rgit.git_operation("rev-parse", "--show-superproject-working-tree") - if superroot: - gitroot = superroot.strip() - else: - gitroot = root_dir.strip() - assert os.path.isdir(os.path.join(gitroot, ".git")) - # first create the module directory - if not os.path.isdir(os.path.join(root_dir, path)): - os.makedirs(os.path.join(root_dir, path)) - - # initialize a new git repo and set the sparse checkout flag - sprep_repo = os.path.join(root_dir, path) - sprepo_git = GitInterface(sprep_repo, logger) - if os.path.exists(os.path.join(sprep_repo, ".git")): - try: - logger.info("Submodule {} found".format(name)) - chk = sprepo_git.config_get_value("core", "sparseCheckout") - if chk == "true": - logger.info("Sparse submodule {} already checked out".format(name)) - return - except NoOptionError: - logger.debug("Sparse submodule {} not present".format(name)) - except Exception as e: - utils.fatal_error("Unexpected error {} occured.".format(e)) - - sprepo_git.config_set_value("core", "sparseCheckout", "true") - - # set the repository remote - - logger.info("Setting remote origin in {}/{}".format(root_dir, path)) - status = sprepo_git.git_operation("remote", "-v") - if url not in status: - sprepo_git.git_operation("remote", "add", "origin", url) - - topgit = os.path.join(gitroot, ".git") - - if gitroot != root_dir and os.path.isfile(os.path.join(root_dir, ".git")): - with open(os.path.join(root_dir, ".git")) as f: - gitpath = os.path.relpath( - os.path.join(root_dir, f.read().split()[1]), - start=os.path.join(root_dir, path), - ) - topgit = os.path.join(gitpath, "modules") - else: - topgit = os.path.relpath( - os.path.join(root_dir, ".git", "modules"), - start=os.path.join(root_dir, path), - ) - - with utils.pushd(sprep_repo): - if not os.path.isdir(topgit): - os.makedirs(topgit) - topgit += os.sep + name - - if os.path.isdir(os.path.join(root_dir, path, ".git")): - with utils.pushd(sprep_repo): - shutil.move(".git", topgit) - with open(".git", "w") as f: - f.write("gitdir: " + os.path.relpath(topgit)) - # assert(os.path.isdir(os.path.relpath(topgit, start=sprep_repo))) - gitsparse = os.path.abspath(os.path.join(topgit, "info", "sparse-checkout")) - if os.path.isfile(gitsparse): - logger.warning( - "submodule {} is already initialized {}".format(name, topgit) - ) - return - - with utils.pushd(sprep_repo): - shutil.copy(sparsefile, gitsparse) - - # Finally checkout the repo - sprepo_git.git_operation("fetch", "origin", "--tags") - sprepo_git.git_operation("checkout", tag) - - print(f"Successfully checked out {name:>20} at {tag}") - rgit.config_set_value(f'submodule "{name}"', "active", "true") - rgit.config_set_value(f'submodule "{name}"', "url", url) - - -def single_submodule_checkout( - root, name, path, url=None, tag=None, force=False, optional=False -): - """ - This function checks out a single git submodule. - - Parameters: - root (str): The root directory for the git operation. - name (str): The name of the submodule. - path (str): The path to the submodule. - url (str, optional): The URL of the submodule. Defaults to None. - tag (str, optional): The tag to checkout. Defaults to None. - force (bool, optional): If set to True, forces the checkout operation. Defaults to False. - optional (bool, optional): If set to True, the submodule is considered optional. Defaults to False. - - Returns: - None - """ - # function implementation... - git = GitInterface(root, logger) - repodir = os.path.join(root, path) - logger.info("Checkout {} into {}/{}".format(name, root, path)) - # if url is provided update to the new url - tmpurl = None - repo_exists = False - if os.path.exists(os.path.join(repodir, ".git")): - logger.info("Submodule {} already checked out".format(name)) - repo_exists = True - # Look for a .gitmodules file in the newly checkedout repo - if not repo_exists and url: - # ssh urls cause problems for those who dont have git accounts with ssh keys defined - # but cime has one since e3sm prefers ssh to https, because the .gitmodules file was - # opened with a GitModules object we don't need to worry about restoring the file here - # it will be done by the GitModules class - if url.startswith("git@"): - tmpurl = url - url = url.replace("git@github.com:", "https://github.com/") - git.git_operation("clone", url, path) - smgit = GitInterface(repodir, logger) - if not tag: - tag = smgit.git_operation("describe", "--tags", "--always").rstrip() - smgit.git_operation("checkout", tag) - # Now need to move the .git dir to the submodule location - rootdotgit = os.path.join(root, ".git") - if os.path.isfile(rootdotgit): - with open(rootdotgit) as f: - line = f.readline() - if line.startswith("gitdir: "): - rootdotgit = line[8:].rstrip() - - newpath = os.path.abspath(os.path.join(root, rootdotgit, "modules", name)) - if os.path.exists(newpath): - shutil.rmtree(os.path.join(repodir, ".git")) - else: - shutil.move(os.path.join(repodir, ".git"), newpath) - - with open(os.path.join(repodir, ".git"), "w") as f: - f.write("gitdir: " + os.path.relpath(newpath, start=repodir)) - - if not os.path.exists(repodir): - parent = os.path.dirname(repodir) - if not os.path.isdir(parent): - os.makedirs(parent) - git.git_operation("submodule", "add", "--name", name, "--", url, path) - - if not repo_exists or not tmpurl: - git.git_operation("submodule", "update", "--init", "--", path) - - if os.path.exists(os.path.join(repodir, ".gitmodules")): - # recursively handle this checkout - print(f"Recursively checking out submodules of {name}") - gitmodules = GitModules(logger, confpath=repodir) - requiredlist = ["AlwaysRequired"] - if optional: - requiredlist.append("AlwaysOptional") - submodules_checkout(gitmodules, repodir, requiredlist, force=force) - if not os.path.exists(os.path.join(repodir, ".git")): - utils.fatal_error( - f"Failed to checkout {name} {repo_exists} {tmpurl} {repodir} {path}" - ) - - if tmpurl: - print(git.git_operation("restore", ".gitmodules")) - - return - - -def submodules_status(gitmodules, root_dir, toplevel=False): - testfails = 0 - localmods = 0 - needsupdate = 0 - for name in gitmodules.sections(): - path = gitmodules.get(name, "path") - tag = gitmodules.get(name, "fxtag") - required = gitmodules.get(name, "fxrequired") - level = required and "Toplevel" in required - if not path: - utils.fatal_error("No path found in .gitmodules for {}".format(name)) - newpath = os.path.join(root_dir, path) - logger.debug("newpath is {}".format(newpath)) - if not os.path.exists(os.path.join(newpath, ".git")): - rootgit = GitInterface(root_dir, logger) - # submodule commands use path, not name - url = gitmodules.get(name, "url") - url = url.replace("git@github.com:", "https://github.com/") - tags = rootgit.git_operation("ls-remote", "--tags", url) - atag = None - needsupdate += 1 - if not toplevel and level: - continue - for htag in tags.split("\n"): - if tag and tag in htag: - atag = (htag.split()[1])[10:] - break - if tag and tag == atag: - print(f"e {name:>20} not checked out, aligned at tag {tag}") - elif tag: - ahash = rootgit.git_operation( - "submodule", "status", "{}".format(path) - ).rstrip() - ahash = ahash[1 : len(tag) + 1] - if tag == ahash: - print(f"e {name:>20} not checked out, aligned at hash {ahash}") - else: - print( - f"e {name:>20} not checked out, out of sync at tag {atag}, expected tag is {tag}" - ) - testfails += 1 - else: - print(f"e {name:>20} has no fxtag defined in .gitmodules") - testfails += 1 - else: - with utils.pushd(newpath): - git = GitInterface(newpath, logger) - atag = git.git_operation("describe", "--tags", "--always").rstrip() - ahash = git.git_operation("status").partition("\n")[0].split()[-1] - if tag and atag == tag: - print(f" {name:>20} at tag {tag}") - elif tag and ahash[: len(tag)] == tag: - print(f" {name:>20} at hash {ahash}") - elif atag == ahash: - print(f" {name:>20} at hash {ahash}") - elif tag: - print( - f"s {name:>20} {atag} {ahash} is out of sync with .gitmodules {tag}" - ) - testfails += 1 - needsupdate += 1 - else: - print( - f"e {name:>20} has no fxtag defined in .gitmodules, module at {atag}" - ) - testfails += 1 - - status = git.git_operation("status", "--ignore-submodules") - if "nothing to commit" not in status: - localmods = localmods + 1 - print("M" + textwrap.indent(status, " ")) - - return testfails, localmods, needsupdate - - -def submodules_update(gitmodules, root_dir, requiredlist, force): - _, localmods, needsupdate = submodules_status(gitmodules, root_dir) - - if localmods and not force: - local_mods_output() - return - if needsupdate == 0: - return - - for name in gitmodules.sections(): - fxtag = gitmodules.get(name, "fxtag") - path = gitmodules.get(name, "path") - url = gitmodules.get(name, "url") - logger.info( - "name={} path={} url={} fxtag={} requiredlist={}".format( - name, os.path.join(root_dir, path), url, fxtag, requiredlist - ) - ) - # if not os.path.exists(os.path.join(root_dir,path, ".git")): - fxrequired = gitmodules.get(name, "fxrequired") - assert fxrequired in fxrequired_allowed_values() - rgit = GitInterface(root_dir, logger) - superroot = rgit.git_operation("rev-parse", "--show-superproject-working-tree") - - fxsparse = gitmodules.get(name, "fxsparse") - - if ( - fxrequired - and (superroot and "Toplevel" in fxrequired) - or fxrequired not in requiredlist - ): - if "ToplevelOptional" == fxrequired: - print("Skipping optional component {}".format(name)) - continue - if fxsparse: - logger.debug( - "Callng submodule_sparse_checkout({}, {}, {}, {}, {}, {}".format( - root_dir, name, url, path, fxsparse, fxtag - ) - ) - submodule_sparse_checkout(root_dir, name, url, path, fxsparse, tag=fxtag) - else: - logger.info( - "Calling submodule_checkout({},{},{},{})".format( - root_dir, name, path, url - ) - ) - - single_submodule_checkout( - root_dir, - name, - path, - url=url, - tag=fxtag, - force=force, - optional=("AlwaysOptional" in requiredlist), - ) - - if os.path.exists(os.path.join(path, ".git")): - submoddir = os.path.join(root_dir, path) - with utils.pushd(submoddir): - git = GitInterface(submoddir, logger) - # first make sure the url is correct - upstream = git.git_operation("ls-remote", "--get-url").rstrip() - newremote = "origin" - if upstream != url: - # TODO - this needs to be a unique name - remotes = git.git_operation("remote", "-v") - if url in remotes: - for line in remotes: - if url in line and "fetch" in line: - newremote = line.split()[0] - break - else: - i = 0 - while newremote in remotes: - i = i + 1 - newremote = f"newremote.{i:02d}" - git.git_operation("remote", "add", newremote, url) - - tags = git.git_operation("tag", "-l") - if fxtag and fxtag not in tags: - git.git_operation("fetch", newremote, "--tags") - atag = git.git_operation("describe", "--tags", "--always").rstrip() - if fxtag and fxtag != atag: - try: - git.git_operation("checkout", fxtag) - print(f"{name:>20} updated to {fxtag}") - except Exception as error: - print(error) - elif not fxtag: - print(f"No fxtag found for submodule {name:>20}") - else: - print(f"{name:>20} up to date.") - - -def local_mods_output(): - text = """\ - The submodules labeled with 'M' above are not in a clean state. - The following are options for how to proceed: - (1) Go into each submodule which is not in a clean state and issue a 'git status' - Either revert or commit your changes so that the submodule is in a clean state. - (2) use the --force option to git-fleximod - (3) you can name the particular submodules to update using the git-fleximod command line - (4) As a last resort you can remove the submodule (via 'rm -fr [directory]') - then rerun git-fleximod update. -""" - print(text) - - -# checkout is done by update if required so this function may be depricated -def submodules_checkout(gitmodules, root_dir, requiredlist, force=False): - """ - This function checks out all git submodules based on the provided parameters. - - Parameters: - gitmodules (ConfigParser): The gitmodules configuration. - root_dir (str): The root directory for the git operation. - requiredlist (list): The list of required modules. - force (bool, optional): If set to True, forces the checkout operation. Defaults to False. - - Returns: - None - """ - # function implementation... - print("") - _, localmods, needsupdate = submodules_status(gitmodules, root_dir) - if localmods and not force: - local_mods_output() - return - if not needsupdate: - return - for name in gitmodules.sections(): - fxrequired = gitmodules.get(name, "fxrequired") - fxsparse = gitmodules.get(name, "fxsparse") - fxtag = gitmodules.get(name, "fxtag") - path = gitmodules.get(name, "path") - url = gitmodules.get(name, "url") - if fxrequired and fxrequired not in requiredlist: - if "Optional" in fxrequired: - print("Skipping optional component {}".format(name)) - continue - - if fxsparse: - logger.debug( - "Callng submodule_sparse_checkout({}, {}, {}, {}, {}, {}".format( - root_dir, name, url, path, fxsparse, fxtag - ) - ) - submodule_sparse_checkout(root_dir, name, url, path, fxsparse, tag=fxtag) - else: - logger.debug( - "Calling submodule_checkout({},{},{})".format(root_dir, name, path) - ) - single_submodule_checkout( - root_dir, - name, - path, - url=url, - tag=fxtag, - force=force, - optional="AlwaysOptional" in requiredlist, - ) - - -def submodules_test(gitmodules, root_dir): - """ - This function tests the git submodules based on the provided parameters. - - It first checks that fxtags are present and in sync with submodule hashes. - Then it ensures that urls are consistent with fxurls (not forks and not ssh) - and that sparse checkout files exist. - - Parameters: - gitmodules (ConfigParser): The gitmodules configuration. - root_dir (str): The root directory for the git operation. - - Returns: - int: The number of test failures. - """ - # First check that fxtags are present and in sync with submodule hashes - testfails, localmods, needsupdate = submodules_status(gitmodules, root_dir) - print("") - # Then make sure that urls are consistant with fxurls (not forks and not ssh) - # and that sparse checkout files exist - for name in gitmodules.sections(): - url = gitmodules.get(name, "url") - fxurl = gitmodules.get(name, "fxDONOTMODIFYurl") - fxsparse = gitmodules.get(name, "fxsparse") - path = gitmodules.get(name, "path") - fxurl = fxurl[:-4] if fxurl.endswith(".git") else fxurl - url = url[:-4] if url.endswith(".git") else url - if not fxurl or url.lower() != fxurl.lower(): - print(f"{name:>20} url {url} not in sync with required {fxurl}") - testfails += 1 - if fxsparse and not os.path.isfile(os.path.join(root_dir, path, fxsparse)): - print(f"{name:>20} sparse checkout file {fxsparse} not found") - testfails += 1 - return testfails + localmods + needsupdate - - -def main(): - ( - root_dir, - file_name, - fxrequired, - includelist, - excludelist, - force, - action, - ) = commandline_arguments() - # Get a logger for the package - global logger - logger = logging.getLogger(__name__) - - logger.info("action is {}".format(action)) - - if not os.path.isfile(os.path.join(root_dir, file_name)): - file_path = utils.find_upwards(root_dir, file_name) - - if file_path is None: - utils.fatal_error( - "No {} found in {} or any of it's parents".format(file_name, root_dir) - ) - - root_dir = os.path.dirname(file_path) - logger.info( - "root_dir is {} includelist={} excludelist={}".format( - root_dir, includelist, excludelist - ) - ) - gitmodules = GitModules( - logger, - confpath=root_dir, - conffile=file_name, - includelist=includelist, - excludelist=excludelist, - ) - if not gitmodules.sections(): - sys.exit("No submodule components found") - retval = 0 - if action == "update": - submodules_update(gitmodules, root_dir, fxrequired, force) - elif action == "status": - tfails, lmods, updates = submodules_status(gitmodules, root_dir, toplevel=True) - if tfails + lmods + updates > 0: - print( - f" testfails = {tfails}, local mods = {lmods}, needs updates {updates}\n" - ) - if lmods > 0: - local_mods_output() - elif action == "test": - retval = submodules_test(gitmodules, root_dir) - else: - utils.fatal_error(f"unrecognized action request {action}") - return retval - - -if __name__ == "__main__": - sys.exit(main()) diff --git a/.lib/git-fleximod/git_fleximod/gitinterface.py b/.lib/git-fleximod/git_fleximod/gitinterface.py deleted file mode 100644 index 93ae38ecde..0000000000 --- a/.lib/git-fleximod/git_fleximod/gitinterface.py +++ /dev/null @@ -1,79 +0,0 @@ -import os -import sys -from . import utils -from pathlib import Path - -class GitInterface: - def __init__(self, repo_path, logger): - logger.debug("Initialize GitInterface for {}".format(repo_path)) - if isinstance(repo_path, str): - self.repo_path = Path(repo_path).resolve() - elif isinstance(repo_path, Path): - self.repo_path = repo_path.resolve() - else: - raise TypeError("repo_path must be a str or Path object") - self.logger = logger - try: - import git - - self._use_module = True - try: - self.repo = git.Repo(str(self.repo_path)) # Initialize GitPython repo - except git.exc.InvalidGitRepositoryError: - self.git = git - self._init_git_repo() - msg = "Using GitPython interface to git" - except ImportError: - self._use_module = False - if not (self.repo_path / ".git").exists(): - self._init_git_repo() - msg = "Using shell interface to git" - self.logger.info(msg) - - def _git_command(self, operation, *args): - self.logger.info(operation) - if self._use_module and operation != "submodule": - try: - return getattr(self.repo.git, operation)(*args) - except Exception as e: - sys.exit(e) - else: - return ["git", "-C", str(self.repo_path), operation] + list(args) - - def _init_git_repo(self): - if self._use_module: - self.repo = self.git.Repo.init(str(self.repo_path)) - else: - command = ("git", "-C", str(self.repo_path), "init") - utils.execute_subprocess(command) - - # pylint: disable=unused-argument - def git_operation(self, operation, *args, **kwargs): - command = self._git_command(operation, *args) - self.logger.info(command) - if isinstance(command, list): - try: - return utils.execute_subprocess(command, output_to_caller=True) - except Exception as e: - sys.exit(e) - else: - return command - - def config_get_value(self, section, name): - if self._use_module: - config = self.repo.config_reader() - return config.get_value(section, name) - else: - cmd = ("git", "-C", str(self.repo_path), "config", "--get", f"{section}.{name}") - output = utils.execute_subprocess(cmd, output_to_caller=True) - return output.strip() - - def config_set_value(self, section, name, value): - if self._use_module: - with self.repo.config_writer() as writer: - writer.set_value(section, name, value) - writer.release() # Ensure changes are saved - else: - cmd = ("git", "-C", str(self.repo_path), "config", f"{section}.{name}", value) - self.logger.info(cmd) - utils.execute_subprocess(cmd, output_to_caller=True) diff --git a/.lib/git-fleximod/git_fleximod/gitmodules.py b/.lib/git-fleximod/git_fleximod/gitmodules.py deleted file mode 100644 index 68c82d066f..0000000000 --- a/.lib/git-fleximod/git_fleximod/gitmodules.py +++ /dev/null @@ -1,97 +0,0 @@ -import shutil -from pathlib import Path -from configparser import RawConfigParser, ConfigParser -from .lstripreader import LstripReader - - -class GitModules(RawConfigParser): - def __init__( - self, - logger, - confpath=Path.cwd(), - conffile=".gitmodules", - includelist=None, - excludelist=None, - ): - """ - confpath: Path to the directory containing the .gitmodules file (defaults to the current working directory). - conffile: Name of the configuration file (defaults to .gitmodules). - includelist: Optional list of submodules to include. - excludelist: Optional list of submodules to exclude. - """ - self.logger = logger - self.logger.debug( - "Creating a GitModules object {} {} {} {}".format( - confpath, conffile, includelist, excludelist - ) - ) - super().__init__() - self.conf_file = (Path(confpath) / Path(conffile)) - if self.conf_file.exists(): - self.read_file(LstripReader(str(self.conf_file)), source=conffile) - self.includelist = includelist - self.excludelist = excludelist - self.isdirty = False - - def reload(self): - self.clear() - if self.conf_file.exists(): - self.read_file(LstripReader(str(self.conf_file)), source=self.conf_file) - - - def set(self, name, option, value): - """ - Sets a configuration value for a specific submodule: - Ensures the appropriate section exists for the submodule. - Calls the parent class's set method to store the value. - """ - self.isdirty = True - self.logger.debug("set called {} {} {}".format(name, option, value)) - section = f'submodule "{name}"' - if not self.has_section(section): - self.add_section(section) - super().set(section, option, str(value)) - - # pylint: disable=redefined-builtin, arguments-differ - def get(self, name, option, raw=False, vars=None, fallback=None): - """ - Retrieves a configuration value for a specific submodule: - Uses the parent class's get method to access the value. - Handles potential errors if the section or option doesn't exist. - """ - self.logger.debug("get called {} {}".format(name, option)) - section = f'submodule "{name}"' - try: - return ConfigParser.get( - self, section, option, raw=raw, vars=vars, fallback=fallback - ) - except ConfigParser.NoOptionError: - return None - - def save(self): - if self.isdirty: - self.logger.info("Writing {}".format(self.conf_file)) - with open(self.conf_file, "w") as fd: - self.write(fd) - self.isdirty = False - - def __del__(self): - self.save() - - def sections(self): - """Strip the submodule part out of section and just use the name""" - self.logger.debug("calling GitModules sections iterator") - names = [] - for section in ConfigParser.sections(self): - name = section[11:-1] - if self.includelist and name not in self.includelist: - continue - if self.excludelist and name in self.excludelist: - continue - names.append(name) - return names - - def items(self, name, raw=False, vars=None): - self.logger.debug("calling GitModules items for {}".format(name)) - section = f'submodule "{name}"' - return ConfigParser.items(section, raw=raw, vars=vars) diff --git a/.lib/git-fleximod/git_fleximod/lstripreader.py b/.lib/git-fleximod/git_fleximod/lstripreader.py deleted file mode 100644 index 01d5580ee8..0000000000 --- a/.lib/git-fleximod/git_fleximod/lstripreader.py +++ /dev/null @@ -1,43 +0,0 @@ -class LstripReader(object): - "LstripReader formats .gitmodules files to be acceptable for configparser" - - def __init__(self, filename): - with open(filename, "r") as infile: - lines = infile.readlines() - self._lines = list() - self._num_lines = len(lines) - self._index = 0 - for line in lines: - self._lines.append(line.lstrip()) - - def readlines(self): - """Return all the lines from this object's file""" - return self._lines - - def readline(self, size=-1): - """Format and return the next line or raise StopIteration""" - try: - line = self.next() - except StopIteration: - line = "" - - if (size > 0) and (len(line) < size): - return line[0:size] - - return line - - def __iter__(self): - """Begin an iteration""" - self._index = 0 - return self - - def next(self): - """Return the next line or raise StopIteration""" - if self._index >= self._num_lines: - raise StopIteration - - self._index = self._index + 1 - return self._lines[self._index - 1] - - def __next__(self): - return self.next() diff --git a/.lib/git-fleximod/git_fleximod/metoflexi.py b/.lib/git-fleximod/git_fleximod/metoflexi.py deleted file mode 100755 index cc347db2dd..0000000000 --- a/.lib/git-fleximod/git_fleximod/metoflexi.py +++ /dev/null @@ -1,236 +0,0 @@ -#!/usr/bin/env python -from configparser import ConfigParser -import sys -import shutil -from pathlib import Path -import argparse -import logging -from git_fleximod.gitinterface import GitInterface -from git_fleximod.gitmodules import GitModules -from git_fleximod import utils - -logger = None - -def find_root_dir(filename=".git"): - d = Path.cwd() - root = Path(d.root) - while d != root: - attempt = d / filename - if attempt.is_dir(): - return d - d = d.parent - return None - - -def get_parser(): - description = """ - %(prog)s manages checking out groups of gitsubmodules with addtional support for Earth System Models - """ - parser = argparse.ArgumentParser( - description=description, formatter_class=argparse.RawDescriptionHelpFormatter - ) - - parser.add_argument('-e', '--externals', nargs='?', - default='Externals.cfg', - help='The externals description filename. ' - 'Default: %(default)s.') - - parser.add_argument( - "-C", - "--path", - default=find_root_dir(), - help="Toplevel repository directory. Defaults to top git directory relative to current.", - ) - - parser.add_argument( - "-g", - "--gitmodules", - nargs="?", - default=".gitmodules", - help="The submodule description filename. " "Default: %(default)s.", - ) - parser.add_argument( - "-v", - "--verbose", - action="count", - default=0, - help="Output additional information to " - "the screen and log file. This flag can be " - "used up to two times, increasing the " - "verbosity level each time.", - ) - parser.add_argument( - "-d", - "--debug", - action="store_true", - default=False, - help="DEVELOPER: output additional debugging " - "information to the screen and log file.", - ) - - return parser - -def commandline_arguments(args=None): - parser = get_parser() - - options = parser.parse_args(args) - handlers = [logging.StreamHandler()] - - if options.debug: - try: - open("fleximod.log", "w") - except PermissionError: - sys.exit("ABORT: Could not write file fleximod.log") - level = logging.DEBUG - handlers.append(logging.FileHandler("fleximod.log")) - elif options.verbose: - level = logging.INFO - else: - level = logging.WARNING - # Configure the root logger - logging.basicConfig( - level=level, format="%(name)s - %(levelname)s - %(message)s", handlers=handlers - ) - - return( - options.path, - options.gitmodules, - options.externals - ) - -class ExternalRepoTranslator: - """ - Translates external repositories configured in an INI-style externals file. - """ - - def __init__(self, rootpath, gitmodules, externals): - self.rootpath = rootpath - if gitmodules: - self.gitmodules = GitModules(logger, confpath=rootpath) - self.externals = (rootpath / Path(externals)).resolve() - print(f"Translating {self.externals}") - self.git = GitInterface(rootpath, logger) - -# def __del__(self): -# if (self.rootpath / "save.gitignore"): - - - def translate_single_repo(self, section, tag, url, path, efile, hash_, sparse, protocol): - """ - Translates a single repository based on configuration details. - - Args: - rootpath (str): Root path of the main repository. - gitmodules (str): Path to the .gitmodules file. - tag (str): The tag to use for the external repository. - url (str): The URL of the external repository. - path (str): The relative path within the main repository for the external repository. - efile (str): The external file or file containing submodules. - hash_ (str): The commit hash to checkout (if applicable). - sparse (str): Boolean indicating whether to use sparse checkout (if applicable). - protocol (str): The protocol to use (e.g., 'git', 'http'). - """ - assert protocol != "svn", "SVN protocol is not currently supported" - print(f"Translating repository {section}") - if efile: - file_path = Path(path) / Path(efile) - newroot = (self.rootpath / file_path).parent.resolve() - if not newroot.exists(): - newroot.mkdir(parents=True) - logger.info("Newroot is {}".format(newroot)) - newt = ExternalRepoTranslator(newroot, ".gitmodules", efile) - newt.translate_repo() - if protocol == "externals_only": - if tag: - self.gitmodules.set(section, "fxtag", tag) - if hash_: - self.gitmodules.set(section, "fxtag", hash_) - - self.gitmodules.set(section, "fxDONOTUSEurl", url) - if sparse: - self.gitmodules.set(section, "fxsparse", sparse) - self.gitmodules.set(section, "fxrequired", "ToplevelRequired") - else: - newpath = (self.rootpath / Path(path)) - if newpath.exists(): - shutil.rmtree(newpath) - logger.info("Creating directory {}".format(newpath)) - newpath.mkdir(parents=True) - if tag: - logger.info("cloning {}".format(section)) - try: - self.git.git_operation("clone", "-b", tag, "--depth", "1", url, path) - except: - self.git.git_operation("clone", url, path) - with utils.pushd(newpath): - ngit = GitInterface(newpath, logger) - ngit.git_operation("checkout", tag) - if hash_: - self.git.git_operation("clone", url, path) - git = GitInterface(newpath, logger) - git.git_operation("fetch", "origin") - git.git_operation("checkout", hash_) - if sparse: - print("setting as sparse submodule {}".format(section)) - sparsefile = (newpath / Path(sparse)) - newfile = (newpath / ".git" / "info" / "sparse-checkout") - print(f"sparsefile {sparsefile} newfile {newfile}") - shutil.copy(sparsefile, newfile) - - logger.info("adding submodule {}".format(section)) - self.gitmodules.save() - self.git.git_operation("submodule", "add", "-f", "--name", section, url, path) - self.git.git_operation("submodule","absorbgitdirs") - self.gitmodules.reload() - if tag: - self.gitmodules.set(section, "fxtag", tag) - if hash_: - self.gitmodules.set(section, "fxtag", hash_) - - self.gitmodules.set(section, "fxDONOTUSEurl", url) - if sparse: - self.gitmodules.set(section, "fxsparse", sparse) - self.gitmodules.set(section, "fxrequired", "ToplevelRequired") - - - def translate_repo(self): - """ - Translates external repositories defined within an external file. - - Args: - rootpath (str): Root path of the main repository. - gitmodules (str): Path to the .gitmodules file. - external_file (str): The path to the external file containing repository definitions. - """ - econfig = ConfigParser() - econfig.read((self.rootpath / Path(self.externals))) - - for section in econfig.sections(): - if section == "externals_description": - logger.info("skipping section {}".format(section)) - return - logger.info("Translating section {}".format(section)) - tag = econfig.get(section, "tag", raw=False, fallback=None) - url = econfig.get(section, "repo_url", raw=False, fallback=None) - path = econfig.get(section, "local_path", raw=False, fallback=None) - efile = econfig.get(section, "externals", raw=False, fallback=None) - hash_ = econfig.get(section, "hash", raw=False, fallback=None) - sparse = econfig.get(section, "sparse", raw=False, fallback=None) - protocol = econfig.get(section, "protocol", raw=False, fallback=None) - - self.translate_single_repo(section, tag, url, path, efile, hash_, sparse, protocol) - - - -def _main(): - rootpath, gitmodules, externals = commandline_arguments() - global logger - logger = logging.getLogger(__name__) - with utils.pushd(rootpath): - t = ExternalRepoTranslator(Path(rootpath), gitmodules, externals) - logger.info("Translating {}".format(rootpath)) - t.translate_repo() - - -if __name__ == "__main__": - sys.exit(_main()) diff --git a/.lib/git-fleximod/git_fleximod/utils.py b/.lib/git-fleximod/git_fleximod/utils.py deleted file mode 100644 index 7cc1de38cc..0000000000 --- a/.lib/git-fleximod/git_fleximod/utils.py +++ /dev/null @@ -1,365 +0,0 @@ -#!/usr/bin/env python3 -""" -Common public utilities for manic package - -""" - -import logging -import os -import subprocess -import sys -from threading import Timer -from pathlib import Path - -LOCAL_PATH_INDICATOR = "." -# --------------------------------------------------------------------- -# -# functions to massage text for output and other useful utilities -# -# --------------------------------------------------------------------- -from contextlib import contextmanager - - -@contextmanager -def pushd(new_dir): - """context for chdir. usage: with pushd(new_dir)""" - previous_dir = os.getcwd() - os.chdir(new_dir) - try: - yield - finally: - os.chdir(previous_dir) - - -def log_process_output(output): - """Log each line of process output at debug level so it can be - filtered if necessary. By default, output is a single string, and - logging.debug(output) will only put log info heading on the first - line. This makes it hard to filter with grep. - - """ - output = output.split("\n") - for line in output: - logging.debug(line) - - -def printlog(msg, **kwargs): - """Wrapper script around print to ensure that everything printed to - the screen also gets logged. - - """ - logging.info(msg) - if kwargs: - print(msg, **kwargs) - else: - print(msg) - sys.stdout.flush() - - -def find_upwards(root_dir, filename): - """Find a file in root dir or any of it's parents""" - d = Path(root_dir) - root = Path(d.root) - while d != root: - attempt = d / filename - if attempt.exists(): - return attempt - d = d.parent - return None - - -def last_n_lines(the_string, n_lines, truncation_message=None): - """Returns the last n lines of the given string - - Args: - the_string: str - n_lines: int - truncation_message: str, optional - - Returns a string containing the last n lines of the_string - - If truncation_message is provided, the returned string begins with - the given message if and only if the string is greater than n lines - to begin with. - """ - - lines = the_string.splitlines(True) - if len(lines) <= n_lines: - return_val = the_string - else: - lines_subset = lines[-n_lines:] - str_truncated = "".join(lines_subset) - if truncation_message: - str_truncated = truncation_message + "\n" + str_truncated - return_val = str_truncated - - return return_val - - -def indent_string(the_string, indent_level): - """Indents the given string by a given number of spaces - - Args: - the_string: str - indent_level: int - - Returns a new string that is the same as the_string, except that - each line is indented by 'indent_level' spaces. - - In python3, this can be done with textwrap.indent. - """ - - lines = the_string.splitlines(True) - padding = " " * indent_level - lines_indented = [padding + line for line in lines] - return "".join(lines_indented) - - -# --------------------------------------------------------------------- -# -# error handling -# -# --------------------------------------------------------------------- - - -def fatal_error(message): - """ - Error output function - """ - logging.error(message) - raise RuntimeError("{0}ERROR: {1}".format(os.linesep, message)) - - -# --------------------------------------------------------------------- -# -# Data conversion / manipulation -# -# --------------------------------------------------------------------- -def str_to_bool(bool_str): - """Convert a sting representation of as boolean into a true boolean. - - Conversion should be case insensitive. - """ - value = None - str_lower = bool_str.lower() - if str_lower in ("true", "t"): - value = True - elif str_lower in ("false", "f"): - value = False - if value is None: - msg = ( - 'ERROR: invalid boolean string value "{0}". ' - 'Must be "true" or "false"'.format(bool_str) - ) - fatal_error(msg) - return value - - -REMOTE_PREFIXES = ["http://", "https://", "ssh://", "git@"] - - -def is_remote_url(url): - """check if the user provided a local file path instead of a - remote. If so, it must be expanded to an absolute - path. - - """ - remote_url = False - for prefix in REMOTE_PREFIXES: - if url.startswith(prefix): - remote_url = True - return remote_url - - -def split_remote_url(url): - """check if the user provided a local file path or a - remote. If remote, try to strip off protocol info. - - """ - remote_url = is_remote_url(url) - if not remote_url: - return url - - for prefix in REMOTE_PREFIXES: - url = url.replace(prefix, "") - - if "@" in url: - url = url.split("@")[1] - - if ":" in url: - url = url.split(":")[1] - - return url - - -def expand_local_url(url, field): - """check if the user provided a local file path instead of a - remote. If so, it must be expanded to an absolute - path. - - Note: local paths of LOCAL_PATH_INDICATOR have special meaning and - represent local copy only, don't work with the remotes. - - """ - remote_url = is_remote_url(url) - if not remote_url: - if url.strip() == LOCAL_PATH_INDICATOR: - pass - else: - url = os.path.expandvars(url) - url = os.path.expanduser(url) - if not os.path.isabs(url): - msg = ( - 'WARNING: Externals description for "{0}" contains a ' - "url that is not remote and does not expand to an " - "absolute path. Version control operations may " - "fail.\n\nurl={1}".format(field, url) - ) - printlog(msg) - else: - url = os.path.normpath(url) - return url - - -# --------------------------------------------------------------------- -# -# subprocess -# -# --------------------------------------------------------------------- - -# Give the user a helpful message if we detect that a command seems to -# be hanging. -_HANGING_SEC = 300 - - -def _hanging_msg(working_directory, command): - print( - """ - -Command '{command}' -from directory {working_directory} -has taken {hanging_sec} seconds. It may be hanging. - -The command will continue to run, but you may want to abort -manage_externals with ^C and investigate. A possible cause of hangs is -when svn or git require authentication to access a private -repository. On some systems, svn and git requests for authentication -information will not be displayed to the user. In this case, the program -will appear to hang. Ensure you can run svn and git manually and access -all repositories without entering your authentication information. - -""".format( - command=command, - working_directory=working_directory, - hanging_sec=_HANGING_SEC, - ) - ) - - -def execute_subprocess(commands, status_to_caller=False, output_to_caller=False): - """Wrapper around subprocess.check_output to handle common - exceptions. - - check_output runs a command with arguments and waits - for it to complete. - - check_output raises an exception on a nonzero return code. if - status_to_caller is true, execute_subprocess returns the subprocess - return code, otherwise execute_subprocess treats non-zero return - status as an error and raises an exception. - - """ - cwd = os.getcwd() - msg = "In directory: {0}\nexecute_subprocess running command:".format(cwd) - logging.info(msg) - commands_str = " ".join(str(element) for element in commands) - logging.info(commands_str) - return_to_caller = status_to_caller or output_to_caller - status = -1 - output = "" - hanging_timer = Timer( - _HANGING_SEC, - _hanging_msg, - kwargs={"working_directory": cwd, "command": commands_str}, - ) - hanging_timer.start() - try: - output = subprocess.check_output( - commands, stderr=subprocess.STDOUT, universal_newlines=True - ) - log_process_output(output) - status = 0 - except OSError as error: - msg = failed_command_msg( - "Command execution failed. Does the executable exist?", commands - ) - logging.error(error) - fatal_error(msg) - except ValueError as error: - msg = failed_command_msg( - "DEV_ERROR: Invalid arguments trying to run subprocess", commands - ) - logging.error(error) - fatal_error(msg) - except subprocess.CalledProcessError as error: - # Only report the error if we are NOT returning to the - # caller. If we are returning to the caller, then it may be a - # simple status check. If returning, it is the callers - # responsibility determine if an error occurred and handle it - # appropriately. - if not return_to_caller: - msg_context = ( - "Process did not run successfully; " - "returned status {0}".format(error.returncode) - ) - msg = failed_command_msg(msg_context, commands, output=error.output) - logging.error(error) - logging.error(msg) - log_process_output(error.output) - fatal_error(msg) - status = error.returncode - finally: - hanging_timer.cancel() - - if status_to_caller and output_to_caller: - ret_value = (status, output) - elif status_to_caller: - ret_value = status - elif output_to_caller: - ret_value = output - else: - ret_value = None - - return ret_value - - -def failed_command_msg(msg_context, command, output=None): - """Template for consistent error messages from subprocess calls. - - If 'output' is given, it should provide the output from the failed - command - """ - - if output: - output_truncated = last_n_lines( - output, 20, truncation_message="[... Output truncated for brevity ...]" - ) - errmsg = ( - "Failed with output:\n" + indent_string(output_truncated, 4) + "\nERROR: " - ) - else: - errmsg = "" - - command_str = " ".join(command) - errmsg += """In directory - {cwd} -{context}: - {command} -""".format( - cwd=os.getcwd(), context=msg_context, command=command_str - ) - - if output: - errmsg += "See above for output from failed command.\n" - - return errmsg diff --git a/.lib/git-fleximod/poetry.lock b/.lib/git-fleximod/poetry.lock deleted file mode 100644 index b59ed3942c..0000000000 --- a/.lib/git-fleximod/poetry.lock +++ /dev/null @@ -1,693 +0,0 @@ -# This file is automatically @generated by Poetry 1.7.1 and should not be changed by hand. - -[[package]] -name = "alabaster" -version = "0.7.13" -description = "A configurable sidebar-enabled Sphinx theme" -optional = false -python-versions = ">=3.6" -files = [ - {file = "alabaster-0.7.13-py3-none-any.whl", hash = "sha256:1ee19aca801bbabb5ba3f5f258e4422dfa86f82f3e9cefb0859b283cdd7f62a3"}, - {file = "alabaster-0.7.13.tar.gz", hash = "sha256:a27a4a084d5e690e16e01e03ad2b2e552c61a65469419b907243193de1a84ae2"}, -] - -[[package]] -name = "babel" -version = "2.14.0" -description = "Internationalization utilities" -optional = false -python-versions = ">=3.7" -files = [ - {file = "Babel-2.14.0-py3-none-any.whl", hash = "sha256:efb1a25b7118e67ce3a259bed20545c29cb68be8ad2c784c83689981b7a57287"}, - {file = "Babel-2.14.0.tar.gz", hash = "sha256:6919867db036398ba21eb5c7a0f6b28ab8cbc3ae7a73a44ebe34ae74a4e7d363"}, -] - -[package.dependencies] -pytz = {version = ">=2015.7", markers = "python_version < \"3.9\""} - -[package.extras] -dev = ["freezegun (>=1.0,<2.0)", "pytest (>=6.0)", "pytest-cov"] - -[[package]] -name = "certifi" -version = "2024.2.2" -description = "Python package for providing Mozilla's CA Bundle." -optional = false -python-versions = ">=3.6" -files = [ - {file = "certifi-2024.2.2-py3-none-any.whl", hash = "sha256:dc383c07b76109f368f6106eee2b593b04a011ea4d55f652c6ca24a754d1cdd1"}, - {file = "certifi-2024.2.2.tar.gz", hash = "sha256:0569859f95fc761b18b45ef421b1290a0f65f147e92a1e5eb3e635f9a5e4e66f"}, -] - -[[package]] -name = "charset-normalizer" -version = "3.3.2" -description = "The Real First Universal Charset Detector. Open, modern and actively maintained alternative to Chardet." -optional = false -python-versions = ">=3.7.0" -files = [ - {file = "charset-normalizer-3.3.2.tar.gz", hash = "sha256:f30c3cb33b24454a82faecaf01b19c18562b1e89558fb6c56de4d9118a032fd5"}, - {file = "charset_normalizer-3.3.2-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:25baf083bf6f6b341f4121c2f3c548875ee6f5339300e08be3f2b2ba1721cdd3"}, - {file = "charset_normalizer-3.3.2-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:06435b539f889b1f6f4ac1758871aae42dc3a8c0e24ac9e60c2384973ad73027"}, - {file = "charset_normalizer-3.3.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:9063e24fdb1e498ab71cb7419e24622516c4a04476b17a2dab57e8baa30d6e03"}, - {file = "charset_normalizer-3.3.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6897af51655e3691ff853668779c7bad41579facacf5fd7253b0133308cf000d"}, - {file = "charset_normalizer-3.3.2-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:1d3193f4a680c64b4b6a9115943538edb896edc190f0b222e73761716519268e"}, - {file = "charset_normalizer-3.3.2-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:cd70574b12bb8a4d2aaa0094515df2463cb429d8536cfb6c7ce983246983e5a6"}, - {file = "charset_normalizer-3.3.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8465322196c8b4d7ab6d1e049e4c5cb460d0394da4a27d23cc242fbf0034b6b5"}, - {file = "charset_normalizer-3.3.2-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:a9a8e9031d613fd2009c182b69c7b2c1ef8239a0efb1df3f7c8da66d5dd3d537"}, - {file = "charset_normalizer-3.3.2-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:beb58fe5cdb101e3a055192ac291b7a21e3b7ef4f67fa1d74e331a7f2124341c"}, - {file = "charset_normalizer-3.3.2-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:e06ed3eb3218bc64786f7db41917d4e686cc4856944f53d5bdf83a6884432e12"}, - {file = "charset_normalizer-3.3.2-cp310-cp310-musllinux_1_1_ppc64le.whl", hash = "sha256:2e81c7b9c8979ce92ed306c249d46894776a909505d8f5a4ba55b14206e3222f"}, - {file = "charset_normalizer-3.3.2-cp310-cp310-musllinux_1_1_s390x.whl", hash = "sha256:572c3763a264ba47b3cf708a44ce965d98555f618ca42c926a9c1616d8f34269"}, - {file = "charset_normalizer-3.3.2-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:fd1abc0d89e30cc4e02e4064dc67fcc51bd941eb395c502aac3ec19fab46b519"}, - {file = "charset_normalizer-3.3.2-cp310-cp310-win32.whl", hash = "sha256:3d47fa203a7bd9c5b6cee4736ee84ca03b8ef23193c0d1ca99b5089f72645c73"}, - {file = "charset_normalizer-3.3.2-cp310-cp310-win_amd64.whl", hash = "sha256:10955842570876604d404661fbccbc9c7e684caf432c09c715ec38fbae45ae09"}, - {file = "charset_normalizer-3.3.2-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:802fe99cca7457642125a8a88a084cef28ff0cf9407060f7b93dca5aa25480db"}, - {file = "charset_normalizer-3.3.2-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:573f6eac48f4769d667c4442081b1794f52919e7edada77495aaed9236d13a96"}, - {file = "charset_normalizer-3.3.2-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:549a3a73da901d5bc3ce8d24e0600d1fa85524c10287f6004fbab87672bf3e1e"}, - {file = "charset_normalizer-3.3.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f27273b60488abe721a075bcca6d7f3964f9f6f067c8c4c605743023d7d3944f"}, - {file = "charset_normalizer-3.3.2-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:1ceae2f17a9c33cb48e3263960dc5fc8005351ee19db217e9b1bb15d28c02574"}, - {file = "charset_normalizer-3.3.2-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:65f6f63034100ead094b8744b3b97965785388f308a64cf8d7c34f2f2e5be0c4"}, - {file = "charset_normalizer-3.3.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:753f10e867343b4511128c6ed8c82f7bec3bd026875576dfd88483c5c73b2fd8"}, - {file = "charset_normalizer-3.3.2-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:4a78b2b446bd7c934f5dcedc588903fb2f5eec172f3d29e52a9096a43722adfc"}, - {file = "charset_normalizer-3.3.2-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:e537484df0d8f426ce2afb2d0f8e1c3d0b114b83f8850e5f2fbea0e797bd82ae"}, - {file = "charset_normalizer-3.3.2-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:eb6904c354526e758fda7167b33005998fb68c46fbc10e013ca97f21ca5c8887"}, - {file = "charset_normalizer-3.3.2-cp311-cp311-musllinux_1_1_ppc64le.whl", hash = "sha256:deb6be0ac38ece9ba87dea880e438f25ca3eddfac8b002a2ec3d9183a454e8ae"}, - {file = "charset_normalizer-3.3.2-cp311-cp311-musllinux_1_1_s390x.whl", hash = "sha256:4ab2fe47fae9e0f9dee8c04187ce5d09f48eabe611be8259444906793ab7cbce"}, - {file = "charset_normalizer-3.3.2-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:80402cd6ee291dcb72644d6eac93785fe2c8b9cb30893c1af5b8fdd753b9d40f"}, - {file = "charset_normalizer-3.3.2-cp311-cp311-win32.whl", hash = "sha256:7cd13a2e3ddeed6913a65e66e94b51d80a041145a026c27e6bb76c31a853c6ab"}, - {file = "charset_normalizer-3.3.2-cp311-cp311-win_amd64.whl", hash = "sha256:663946639d296df6a2bb2aa51b60a2454ca1cb29835324c640dafb5ff2131a77"}, - {file = "charset_normalizer-3.3.2-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:0b2b64d2bb6d3fb9112bafa732def486049e63de9618b5843bcdd081d8144cd8"}, - {file = "charset_normalizer-3.3.2-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:ddbb2551d7e0102e7252db79ba445cdab71b26640817ab1e3e3648dad515003b"}, - {file = "charset_normalizer-3.3.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:55086ee1064215781fff39a1af09518bc9255b50d6333f2e4c74ca09fac6a8f6"}, - {file = "charset_normalizer-3.3.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8f4a014bc36d3c57402e2977dada34f9c12300af536839dc38c0beab8878f38a"}, - {file = "charset_normalizer-3.3.2-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:a10af20b82360ab00827f916a6058451b723b4e65030c5a18577c8b2de5b3389"}, - {file = "charset_normalizer-3.3.2-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:8d756e44e94489e49571086ef83b2bb8ce311e730092d2c34ca8f7d925cb20aa"}, - {file = "charset_normalizer-3.3.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:90d558489962fd4918143277a773316e56c72da56ec7aa3dc3dbbe20fdfed15b"}, - {file = "charset_normalizer-3.3.2-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:6ac7ffc7ad6d040517be39eb591cac5ff87416c2537df6ba3cba3bae290c0fed"}, - {file = "charset_normalizer-3.3.2-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:7ed9e526742851e8d5cc9e6cf41427dfc6068d4f5a3bb03659444b4cabf6bc26"}, - {file = "charset_normalizer-3.3.2-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:8bdb58ff7ba23002a4c5808d608e4e6c687175724f54a5dade5fa8c67b604e4d"}, - {file = "charset_normalizer-3.3.2-cp312-cp312-musllinux_1_1_ppc64le.whl", hash = "sha256:6b3251890fff30ee142c44144871185dbe13b11bab478a88887a639655be1068"}, - {file = "charset_normalizer-3.3.2-cp312-cp312-musllinux_1_1_s390x.whl", hash = "sha256:b4a23f61ce87adf89be746c8a8974fe1c823c891d8f86eb218bb957c924bb143"}, - {file = "charset_normalizer-3.3.2-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:efcb3f6676480691518c177e3b465bcddf57cea040302f9f4e6e191af91174d4"}, - {file = "charset_normalizer-3.3.2-cp312-cp312-win32.whl", hash = "sha256:d965bba47ddeec8cd560687584e88cf699fd28f192ceb452d1d7ee807c5597b7"}, - {file = "charset_normalizer-3.3.2-cp312-cp312-win_amd64.whl", hash = "sha256:96b02a3dc4381e5494fad39be677abcb5e6634bf7b4fa83a6dd3112607547001"}, - {file = "charset_normalizer-3.3.2-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:95f2a5796329323b8f0512e09dbb7a1860c46a39da62ecb2324f116fa8fdc85c"}, - {file = "charset_normalizer-3.3.2-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c002b4ffc0be611f0d9da932eb0f704fe2602a9a949d1f738e4c34c75b0863d5"}, - {file = "charset_normalizer-3.3.2-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:a981a536974bbc7a512cf44ed14938cf01030a99e9b3a06dd59578882f06f985"}, - {file = "charset_normalizer-3.3.2-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:3287761bc4ee9e33561a7e058c72ac0938c4f57fe49a09eae428fd88aafe7bb6"}, - {file = "charset_normalizer-3.3.2-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:42cb296636fcc8b0644486d15c12376cb9fa75443e00fb25de0b8602e64c1714"}, - {file = "charset_normalizer-3.3.2-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:0a55554a2fa0d408816b3b5cedf0045f4b8e1a6065aec45849de2d6f3f8e9786"}, - {file = "charset_normalizer-3.3.2-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:c083af607d2515612056a31f0a8d9e0fcb5876b7bfc0abad3ecd275bc4ebc2d5"}, - {file = "charset_normalizer-3.3.2-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:87d1351268731db79e0f8e745d92493ee2841c974128ef629dc518b937d9194c"}, - {file = "charset_normalizer-3.3.2-cp37-cp37m-musllinux_1_1_ppc64le.whl", hash = "sha256:bd8f7df7d12c2db9fab40bdd87a7c09b1530128315d047a086fa3ae3435cb3a8"}, - {file = "charset_normalizer-3.3.2-cp37-cp37m-musllinux_1_1_s390x.whl", hash = "sha256:c180f51afb394e165eafe4ac2936a14bee3eb10debc9d9e4db8958fe36afe711"}, - {file = "charset_normalizer-3.3.2-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:8c622a5fe39a48f78944a87d4fb8a53ee07344641b0562c540d840748571b811"}, - {file = "charset_normalizer-3.3.2-cp37-cp37m-win32.whl", hash = "sha256:db364eca23f876da6f9e16c9da0df51aa4f104a972735574842618b8c6d999d4"}, - {file = "charset_normalizer-3.3.2-cp37-cp37m-win_amd64.whl", hash = "sha256:86216b5cee4b06df986d214f664305142d9c76df9b6512be2738aa72a2048f99"}, - {file = "charset_normalizer-3.3.2-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:6463effa3186ea09411d50efc7d85360b38d5f09b870c48e4600f63af490e56a"}, - {file = "charset_normalizer-3.3.2-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:6c4caeef8fa63d06bd437cd4bdcf3ffefe6738fb1b25951440d80dc7df8c03ac"}, - {file = "charset_normalizer-3.3.2-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:37e55c8e51c236f95b033f6fb391d7d7970ba5fe7ff453dad675e88cf303377a"}, - {file = "charset_normalizer-3.3.2-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:fb69256e180cb6c8a894fee62b3afebae785babc1ee98b81cdf68bbca1987f33"}, - {file = "charset_normalizer-3.3.2-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ae5f4161f18c61806f411a13b0310bea87f987c7d2ecdbdaad0e94eb2e404238"}, - {file = "charset_normalizer-3.3.2-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:b2b0a0c0517616b6869869f8c581d4eb2dd83a4d79e0ebcb7d373ef9956aeb0a"}, - {file = "charset_normalizer-3.3.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:45485e01ff4d3630ec0d9617310448a8702f70e9c01906b0d0118bdf9d124cf2"}, - {file = "charset_normalizer-3.3.2-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:eb00ed941194665c332bf8e078baf037d6c35d7c4f3102ea2d4f16ca94a26dc8"}, - {file = "charset_normalizer-3.3.2-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:2127566c664442652f024c837091890cb1942c30937add288223dc895793f898"}, - {file = "charset_normalizer-3.3.2-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:a50aebfa173e157099939b17f18600f72f84eed3049e743b68ad15bd69b6bf99"}, - {file = "charset_normalizer-3.3.2-cp38-cp38-musllinux_1_1_ppc64le.whl", hash = "sha256:4d0d1650369165a14e14e1e47b372cfcb31d6ab44e6e33cb2d4e57265290044d"}, - {file = "charset_normalizer-3.3.2-cp38-cp38-musllinux_1_1_s390x.whl", hash = "sha256:923c0c831b7cfcb071580d3f46c4baf50f174be571576556269530f4bbd79d04"}, - {file = "charset_normalizer-3.3.2-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:06a81e93cd441c56a9b65d8e1d043daeb97a3d0856d177d5c90ba85acb3db087"}, - {file = "charset_normalizer-3.3.2-cp38-cp38-win32.whl", hash = "sha256:6ef1d82a3af9d3eecdba2321dc1b3c238245d890843e040e41e470ffa64c3e25"}, - {file = "charset_normalizer-3.3.2-cp38-cp38-win_amd64.whl", hash = "sha256:eb8821e09e916165e160797a6c17edda0679379a4be5c716c260e836e122f54b"}, - {file = "charset_normalizer-3.3.2-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:c235ebd9baae02f1b77bcea61bce332cb4331dc3617d254df3323aa01ab47bd4"}, - {file = "charset_normalizer-3.3.2-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:5b4c145409bef602a690e7cfad0a15a55c13320ff7a3ad7ca59c13bb8ba4d45d"}, - {file = "charset_normalizer-3.3.2-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:68d1f8a9e9e37c1223b656399be5d6b448dea850bed7d0f87a8311f1ff3dabb0"}, - {file = "charset_normalizer-3.3.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:22afcb9f253dac0696b5a4be4a1c0f8762f8239e21b99680099abd9b2b1b2269"}, - {file = "charset_normalizer-3.3.2-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:e27ad930a842b4c5eb8ac0016b0a54f5aebbe679340c26101df33424142c143c"}, - {file = "charset_normalizer-3.3.2-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:1f79682fbe303db92bc2b1136016a38a42e835d932bab5b3b1bfcfbf0640e519"}, - {file = "charset_normalizer-3.3.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b261ccdec7821281dade748d088bb6e9b69e6d15b30652b74cbbac25e280b796"}, - {file = "charset_normalizer-3.3.2-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:122c7fa62b130ed55f8f285bfd56d5f4b4a5b503609d181f9ad85e55c89f4185"}, - {file = "charset_normalizer-3.3.2-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:d0eccceffcb53201b5bfebb52600a5fb483a20b61da9dbc885f8b103cbe7598c"}, - {file = "charset_normalizer-3.3.2-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:9f96df6923e21816da7e0ad3fd47dd8f94b2a5ce594e00677c0013018b813458"}, - {file = "charset_normalizer-3.3.2-cp39-cp39-musllinux_1_1_ppc64le.whl", hash = "sha256:7f04c839ed0b6b98b1a7501a002144b76c18fb1c1850c8b98d458ac269e26ed2"}, - {file = "charset_normalizer-3.3.2-cp39-cp39-musllinux_1_1_s390x.whl", hash = "sha256:34d1c8da1e78d2e001f363791c98a272bb734000fcef47a491c1e3b0505657a8"}, - {file = "charset_normalizer-3.3.2-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:ff8fa367d09b717b2a17a052544193ad76cd49979c805768879cb63d9ca50561"}, - {file = "charset_normalizer-3.3.2-cp39-cp39-win32.whl", hash = "sha256:aed38f6e4fb3f5d6bf81bfa990a07806be9d83cf7bacef998ab1a9bd660a581f"}, - {file = "charset_normalizer-3.3.2-cp39-cp39-win_amd64.whl", hash = "sha256:b01b88d45a6fcb69667cd6d2f7a9aeb4bf53760d7fc536bf679ec94fe9f3ff3d"}, - {file = "charset_normalizer-3.3.2-py3-none-any.whl", hash = "sha256:3e4d1f6587322d2788836a99c69062fbb091331ec940e02d12d179c1d53e25fc"}, -] - -[[package]] -name = "colorama" -version = "0.4.6" -description = "Cross-platform colored terminal text." -optional = false -python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7" -files = [ - {file = "colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6"}, - {file = "colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44"}, -] - -[[package]] -name = "docutils" -version = "0.19" -description = "Docutils -- Python Documentation Utilities" -optional = false -python-versions = ">=3.7" -files = [ - {file = "docutils-0.19-py3-none-any.whl", hash = "sha256:5e1de4d849fee02c63b040a4a3fd567f4ab104defd8a5511fbbc24a8a017efbc"}, - {file = "docutils-0.19.tar.gz", hash = "sha256:33995a6753c30b7f577febfc2c50411fec6aac7f7ffeb7c4cfe5991072dcf9e6"}, -] - -[[package]] -name = "exceptiongroup" -version = "1.2.0" -description = "Backport of PEP 654 (exception groups)" -optional = false -python-versions = ">=3.7" -files = [ - {file = "exceptiongroup-1.2.0-py3-none-any.whl", hash = "sha256:4bfd3996ac73b41e9b9628b04e079f193850720ea5945fc96a08633c66912f14"}, - {file = "exceptiongroup-1.2.0.tar.gz", hash = "sha256:91f5c769735f051a4290d52edd0858999b57e5876e9f85937691bd4c9fa3ed68"}, -] - -[package.extras] -test = ["pytest (>=6)"] - -[[package]] -name = "fsspec" -version = "2023.12.2" -description = "File-system specification" -optional = false -python-versions = ">=3.8" -files = [ - {file = "fsspec-2023.12.2-py3-none-any.whl", hash = "sha256:d800d87f72189a745fa3d6b033b9dc4a34ad069f60ca60b943a63599f5501960"}, - {file = "fsspec-2023.12.2.tar.gz", hash = "sha256:8548d39e8810b59c38014934f6b31e57f40c1b20f911f4cc2b85389c7e9bf0cb"}, -] - -[package.extras] -abfs = ["adlfs"] -adl = ["adlfs"] -arrow = ["pyarrow (>=1)"] -dask = ["dask", "distributed"] -devel = ["pytest", "pytest-cov"] -dropbox = ["dropbox", "dropboxdrivefs", "requests"] -full = ["adlfs", "aiohttp (!=4.0.0a0,!=4.0.0a1)", "dask", "distributed", "dropbox", "dropboxdrivefs", "fusepy", "gcsfs", "libarchive-c", "ocifs", "panel", "paramiko", "pyarrow (>=1)", "pygit2", "requests", "s3fs", "smbprotocol", "tqdm"] -fuse = ["fusepy"] -gcs = ["gcsfs"] -git = ["pygit2"] -github = ["requests"] -gs = ["gcsfs"] -gui = ["panel"] -hdfs = ["pyarrow (>=1)"] -http = ["aiohttp (!=4.0.0a0,!=4.0.0a1)", "requests"] -libarchive = ["libarchive-c"] -oci = ["ocifs"] -s3 = ["s3fs"] -sftp = ["paramiko"] -smb = ["smbprotocol"] -ssh = ["paramiko"] -tqdm = ["tqdm"] - -[[package]] -name = "gitdb" -version = "4.0.11" -description = "Git Object Database" -optional = false -python-versions = ">=3.7" -files = [ - {file = "gitdb-4.0.11-py3-none-any.whl", hash = "sha256:81a3407ddd2ee8df444cbacea00e2d038e40150acfa3001696fe0dcf1d3adfa4"}, - {file = "gitdb-4.0.11.tar.gz", hash = "sha256:bf5421126136d6d0af55bc1e7c1af1c397a34f5b7bd79e776cd3e89785c2b04b"}, -] - -[package.dependencies] -smmap = ">=3.0.1,<6" - -[[package]] -name = "gitpython" -version = "3.1.41" -description = "GitPython is a Python library used to interact with Git repositories" -optional = false -python-versions = ">=3.7" -files = [ - {file = "GitPython-3.1.41-py3-none-any.whl", hash = "sha256:c36b6634d069b3f719610175020a9aed919421c87552185b085e04fbbdb10b7c"}, - {file = "GitPython-3.1.41.tar.gz", hash = "sha256:ed66e624884f76df22c8e16066d567aaa5a37d5b5fa19db2c6df6f7156db9048"}, -] - -[package.dependencies] -gitdb = ">=4.0.1,<5" - -[package.extras] -test = ["black", "coverage[toml]", "ddt (>=1.1.1,!=1.4.3)", "mock", "mypy", "pre-commit", "pytest (>=7.3.1)", "pytest-cov", "pytest-instafail", "pytest-mock", "pytest-sugar", "sumtypes"] - -[[package]] -name = "idna" -version = "3.6" -description = "Internationalized Domain Names in Applications (IDNA)" -optional = false -python-versions = ">=3.5" -files = [ - {file = "idna-3.6-py3-none-any.whl", hash = "sha256:c05567e9c24a6b9faaa835c4821bad0590fbb9d5779e7caa6e1cc4978e7eb24f"}, - {file = "idna-3.6.tar.gz", hash = "sha256:9ecdbbd083b06798ae1e86adcbfe8ab1479cf864e4ee30fe4e46a003d12491ca"}, -] - -[[package]] -name = "imagesize" -version = "1.4.1" -description = "Getting image size from png/jpeg/jpeg2000/gif file" -optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" -files = [ - {file = "imagesize-1.4.1-py2.py3-none-any.whl", hash = "sha256:0d8d18d08f840c19d0ee7ca1fd82490fdc3729b7ac93f49870406ddde8ef8d8b"}, - {file = "imagesize-1.4.1.tar.gz", hash = "sha256:69150444affb9cb0d5cc5a92b3676f0b2fb7cd9ae39e947a5e11a36b4497cd4a"}, -] - -[[package]] -name = "importlib-metadata" -version = "7.0.1" -description = "Read metadata from Python packages" -optional = false -python-versions = ">=3.8" -files = [ - {file = "importlib_metadata-7.0.1-py3-none-any.whl", hash = "sha256:4805911c3a4ec7c3966410053e9ec6a1fecd629117df5adee56dfc9432a1081e"}, - {file = "importlib_metadata-7.0.1.tar.gz", hash = "sha256:f238736bb06590ae52ac1fab06a3a9ef1d8dce2b7a35b5ab329371d6c8f5d2cc"}, -] - -[package.dependencies] -zipp = ">=0.5" - -[package.extras] -docs = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "rst.linker (>=1.9)", "sphinx (<7.2.5)", "sphinx (>=3.5)", "sphinx-lint"] -perf = ["ipython"] -testing = ["flufl.flake8", "importlib-resources (>=1.3)", "packaging", "pyfakefs", "pytest (>=6)", "pytest-black (>=0.3.7)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)", "pytest-mypy (>=0.9.1)", "pytest-perf (>=0.9.2)", "pytest-ruff"] - -[[package]] -name = "iniconfig" -version = "2.0.0" -description = "brain-dead simple config-ini parsing" -optional = false -python-versions = ">=3.7" -files = [ - {file = "iniconfig-2.0.0-py3-none-any.whl", hash = "sha256:b6a85871a79d2e3b22d2d1b94ac2824226a63c6b741c88f7ae975f18b6778374"}, - {file = "iniconfig-2.0.0.tar.gz", hash = "sha256:2d91e135bf72d31a410b17c16da610a82cb55f6b0477d1a902134b24a455b8b3"}, -] - -[[package]] -name = "jinja2" -version = "3.1.3" -description = "A very fast and expressive template engine." -optional = false -python-versions = ">=3.7" -files = [ - {file = "Jinja2-3.1.3-py3-none-any.whl", hash = "sha256:7d6d50dd97d52cbc355597bd845fabfbac3f551e1f99619e39a35ce8c370b5fa"}, - {file = "Jinja2-3.1.3.tar.gz", hash = "sha256:ac8bd6544d4bb2c9792bf3a159e80bba8fda7f07e81bc3aed565432d5925ba90"}, -] - -[package.dependencies] -MarkupSafe = ">=2.0" - -[package.extras] -i18n = ["Babel (>=2.7)"] - -[[package]] -name = "markupsafe" -version = "2.1.5" -description = "Safely add untrusted strings to HTML/XML markup." -optional = false -python-versions = ">=3.7" -files = [ - {file = "MarkupSafe-2.1.5-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:a17a92de5231666cfbe003f0e4b9b3a7ae3afb1ec2845aadc2bacc93ff85febc"}, - {file = "MarkupSafe-2.1.5-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:72b6be590cc35924b02c78ef34b467da4ba07e4e0f0454a2c5907f473fc50ce5"}, - {file = "MarkupSafe-2.1.5-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e61659ba32cf2cf1481e575d0462554625196a1f2fc06a1c777d3f48e8865d46"}, - {file = "MarkupSafe-2.1.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2174c595a0d73a3080ca3257b40096db99799265e1c27cc5a610743acd86d62f"}, - {file = "MarkupSafe-2.1.5-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ae2ad8ae6ebee9d2d94b17fb62763125f3f374c25618198f40cbb8b525411900"}, - {file = "MarkupSafe-2.1.5-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:075202fa5b72c86ad32dc7d0b56024ebdbcf2048c0ba09f1cde31bfdd57bcfff"}, - {file = "MarkupSafe-2.1.5-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:598e3276b64aff0e7b3451b72e94fa3c238d452e7ddcd893c3ab324717456bad"}, - {file = "MarkupSafe-2.1.5-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:fce659a462a1be54d2ffcacea5e3ba2d74daa74f30f5f143fe0c58636e355fdd"}, - {file = "MarkupSafe-2.1.5-cp310-cp310-win32.whl", hash = "sha256:d9fad5155d72433c921b782e58892377c44bd6252b5af2f67f16b194987338a4"}, - {file = "MarkupSafe-2.1.5-cp310-cp310-win_amd64.whl", hash = "sha256:bf50cd79a75d181c9181df03572cdce0fbb75cc353bc350712073108cba98de5"}, - {file = "MarkupSafe-2.1.5-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:629ddd2ca402ae6dbedfceeba9c46d5f7b2a61d9749597d4307f943ef198fc1f"}, - {file = "MarkupSafe-2.1.5-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:5b7b716f97b52c5a14bffdf688f971b2d5ef4029127f1ad7a513973cfd818df2"}, - {file = "MarkupSafe-2.1.5-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6ec585f69cec0aa07d945b20805be741395e28ac1627333b1c5b0105962ffced"}, - {file = "MarkupSafe-2.1.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b91c037585eba9095565a3556f611e3cbfaa42ca1e865f7b8015fe5c7336d5a5"}, - {file = "MarkupSafe-2.1.5-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:7502934a33b54030eaf1194c21c692a534196063db72176b0c4028e140f8f32c"}, - {file = "MarkupSafe-2.1.5-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:0e397ac966fdf721b2c528cf028494e86172b4feba51d65f81ffd65c63798f3f"}, - {file = "MarkupSafe-2.1.5-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:c061bb86a71b42465156a3ee7bd58c8c2ceacdbeb95d05a99893e08b8467359a"}, - {file = "MarkupSafe-2.1.5-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:3a57fdd7ce31c7ff06cdfbf31dafa96cc533c21e443d57f5b1ecc6cdc668ec7f"}, - {file = "MarkupSafe-2.1.5-cp311-cp311-win32.whl", hash = "sha256:397081c1a0bfb5124355710fe79478cdbeb39626492b15d399526ae53422b906"}, - {file = "MarkupSafe-2.1.5-cp311-cp311-win_amd64.whl", hash = "sha256:2b7c57a4dfc4f16f7142221afe5ba4e093e09e728ca65c51f5620c9aaeb9a617"}, - {file = "MarkupSafe-2.1.5-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:8dec4936e9c3100156f8a2dc89c4b88d5c435175ff03413b443469c7c8c5f4d1"}, - {file = "MarkupSafe-2.1.5-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:3c6b973f22eb18a789b1460b4b91bf04ae3f0c4234a0a6aa6b0a92f6f7b951d4"}, - {file = "MarkupSafe-2.1.5-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ac07bad82163452a6884fe8fa0963fb98c2346ba78d779ec06bd7a6262132aee"}, - {file = "MarkupSafe-2.1.5-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f5dfb42c4604dddc8e4305050aa6deb084540643ed5804d7455b5df8fe16f5e5"}, - {file = "MarkupSafe-2.1.5-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ea3d8a3d18833cf4304cd2fc9cbb1efe188ca9b5efef2bdac7adc20594a0e46b"}, - {file = "MarkupSafe-2.1.5-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:d050b3361367a06d752db6ead6e7edeb0009be66bc3bae0ee9d97fb326badc2a"}, - {file = "MarkupSafe-2.1.5-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:bec0a414d016ac1a18862a519e54b2fd0fc8bbfd6890376898a6c0891dd82e9f"}, - {file = "MarkupSafe-2.1.5-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:58c98fee265677f63a4385256a6d7683ab1832f3ddd1e66fe948d5880c21a169"}, - {file = "MarkupSafe-2.1.5-cp312-cp312-win32.whl", hash = "sha256:8590b4ae07a35970728874632fed7bd57b26b0102df2d2b233b6d9d82f6c62ad"}, - {file = "MarkupSafe-2.1.5-cp312-cp312-win_amd64.whl", hash = "sha256:823b65d8706e32ad2df51ed89496147a42a2a6e01c13cfb6ffb8b1e92bc910bb"}, - {file = "MarkupSafe-2.1.5-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:c8b29db45f8fe46ad280a7294f5c3ec36dbac9491f2d1c17345be8e69cc5928f"}, - {file = "MarkupSafe-2.1.5-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ec6a563cff360b50eed26f13adc43e61bc0c04d94b8be985e6fb24b81f6dcfdf"}, - {file = "MarkupSafe-2.1.5-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a549b9c31bec33820e885335b451286e2969a2d9e24879f83fe904a5ce59d70a"}, - {file = "MarkupSafe-2.1.5-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:4f11aa001c540f62c6166c7726f71f7573b52c68c31f014c25cc7901deea0b52"}, - {file = "MarkupSafe-2.1.5-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:7b2e5a267c855eea6b4283940daa6e88a285f5f2a67f2220203786dfa59b37e9"}, - {file = "MarkupSafe-2.1.5-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:2d2d793e36e230fd32babe143b04cec8a8b3eb8a3122d2aceb4a371e6b09b8df"}, - {file = "MarkupSafe-2.1.5-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:ce409136744f6521e39fd8e2a24c53fa18ad67aa5bc7c2cf83645cce5b5c4e50"}, - {file = "MarkupSafe-2.1.5-cp37-cp37m-win32.whl", hash = "sha256:4096e9de5c6fdf43fb4f04c26fb114f61ef0bf2e5604b6ee3019d51b69e8c371"}, - {file = "MarkupSafe-2.1.5-cp37-cp37m-win_amd64.whl", hash = "sha256:4275d846e41ecefa46e2015117a9f491e57a71ddd59bbead77e904dc02b1bed2"}, - {file = "MarkupSafe-2.1.5-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:656f7526c69fac7f600bd1f400991cc282b417d17539a1b228617081106feb4a"}, - {file = "MarkupSafe-2.1.5-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:97cafb1f3cbcd3fd2b6fbfb99ae11cdb14deea0736fc2b0952ee177f2b813a46"}, - {file = "MarkupSafe-2.1.5-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1f3fbcb7ef1f16e48246f704ab79d79da8a46891e2da03f8783a5b6fa41a9532"}, - {file = "MarkupSafe-2.1.5-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:fa9db3f79de01457b03d4f01b34cf91bc0048eb2c3846ff26f66687c2f6d16ab"}, - {file = "MarkupSafe-2.1.5-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ffee1f21e5ef0d712f9033568f8344d5da8cc2869dbd08d87c84656e6a2d2f68"}, - {file = "MarkupSafe-2.1.5-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:5dedb4db619ba5a2787a94d877bc8ffc0566f92a01c0ef214865e54ecc9ee5e0"}, - {file = "MarkupSafe-2.1.5-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:30b600cf0a7ac9234b2638fbc0fb6158ba5bdcdf46aeb631ead21248b9affbc4"}, - {file = "MarkupSafe-2.1.5-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:8dd717634f5a044f860435c1d8c16a270ddf0ef8588d4887037c5028b859b0c3"}, - {file = "MarkupSafe-2.1.5-cp38-cp38-win32.whl", hash = "sha256:daa4ee5a243f0f20d528d939d06670a298dd39b1ad5f8a72a4275124a7819eff"}, - {file = "MarkupSafe-2.1.5-cp38-cp38-win_amd64.whl", hash = "sha256:619bc166c4f2de5caa5a633b8b7326fbe98e0ccbfacabd87268a2b15ff73a029"}, - {file = "MarkupSafe-2.1.5-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:7a68b554d356a91cce1236aa7682dc01df0edba8d043fd1ce607c49dd3c1edcf"}, - {file = "MarkupSafe-2.1.5-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:db0b55e0f3cc0be60c1f19efdde9a637c32740486004f20d1cff53c3c0ece4d2"}, - {file = "MarkupSafe-2.1.5-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3e53af139f8579a6d5f7b76549125f0d94d7e630761a2111bc431fd820e163b8"}, - {file = "MarkupSafe-2.1.5-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:17b950fccb810b3293638215058e432159d2b71005c74371d784862b7e4683f3"}, - {file = "MarkupSafe-2.1.5-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:4c31f53cdae6ecfa91a77820e8b151dba54ab528ba65dfd235c80b086d68a465"}, - {file = "MarkupSafe-2.1.5-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:bff1b4290a66b490a2f4719358c0cdcd9bafb6b8f061e45c7a2460866bf50c2e"}, - {file = "MarkupSafe-2.1.5-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:bc1667f8b83f48511b94671e0e441401371dfd0f0a795c7daa4a3cd1dde55bea"}, - {file = "MarkupSafe-2.1.5-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:5049256f536511ee3f7e1b3f87d1d1209d327e818e6ae1365e8653d7e3abb6a6"}, - {file = "MarkupSafe-2.1.5-cp39-cp39-win32.whl", hash = "sha256:00e046b6dd71aa03a41079792f8473dc494d564611a8f89bbbd7cb93295ebdcf"}, - {file = "MarkupSafe-2.1.5-cp39-cp39-win_amd64.whl", hash = "sha256:fa173ec60341d6bb97a89f5ea19c85c5643c1e7dedebc22f5181eb73573142c5"}, - {file = "MarkupSafe-2.1.5.tar.gz", hash = "sha256:d283d37a890ba4c1ae73ffadf8046435c76e7bc2247bbb63c00bd1a709c6544b"}, -] - -[[package]] -name = "packaging" -version = "23.2" -description = "Core utilities for Python packages" -optional = false -python-versions = ">=3.7" -files = [ - {file = "packaging-23.2-py3-none-any.whl", hash = "sha256:8c491190033a9af7e1d931d0b5dacc2ef47509b34dd0de67ed209b5203fc88c7"}, - {file = "packaging-23.2.tar.gz", hash = "sha256:048fb0e9405036518eaaf48a55953c750c11e1a1b68e0dd1a9d62ed0c092cfc5"}, -] - -[[package]] -name = "pluggy" -version = "1.4.0" -description = "plugin and hook calling mechanisms for python" -optional = false -python-versions = ">=3.8" -files = [ - {file = "pluggy-1.4.0-py3-none-any.whl", hash = "sha256:7db9f7b503d67d1c5b95f59773ebb58a8c1c288129a88665838012cfb07b8981"}, - {file = "pluggy-1.4.0.tar.gz", hash = "sha256:8c85c2876142a764e5b7548e7d9a0e0ddb46f5185161049a79b7e974454223be"}, -] - -[package.extras] -dev = ["pre-commit", "tox"] -testing = ["pytest", "pytest-benchmark"] - -[[package]] -name = "pyfakefs" -version = "5.3.5" -description = "pyfakefs implements a fake file system that mocks the Python file system modules." -optional = false -python-versions = ">=3.7" -files = [ - {file = "pyfakefs-5.3.5-py3-none-any.whl", hash = "sha256:751015c1de94e1390128c82b48cdedc3f088bbdbe4bc713c79d02a27f0f61e69"}, - {file = "pyfakefs-5.3.5.tar.gz", hash = "sha256:7cdc500b35a214cb7a614e1940543acc6650e69a94ac76e30f33c9373bd9cf90"}, -] - -[[package]] -name = "pygments" -version = "2.17.2" -description = "Pygments is a syntax highlighting package written in Python." -optional = false -python-versions = ">=3.7" -files = [ - {file = "pygments-2.17.2-py3-none-any.whl", hash = "sha256:b27c2826c47d0f3219f29554824c30c5e8945175d888647acd804ddd04af846c"}, - {file = "pygments-2.17.2.tar.gz", hash = "sha256:da46cec9fd2de5be3a8a784f434e4c4ab670b4ff54d605c4c2717e9d49c4c367"}, -] - -[package.extras] -plugins = ["importlib-metadata"] -windows-terminal = ["colorama (>=0.4.6)"] - -[[package]] -name = "pytest" -version = "8.0.0" -description = "pytest: simple powerful testing with Python" -optional = false -python-versions = ">=3.8" -files = [ - {file = "pytest-8.0.0-py3-none-any.whl", hash = "sha256:50fb9cbe836c3f20f0dfa99c565201fb75dc54c8d76373cd1bde06b06657bdb6"}, - {file = "pytest-8.0.0.tar.gz", hash = "sha256:249b1b0864530ba251b7438274c4d251c58d868edaaec8762893ad4a0d71c36c"}, -] - -[package.dependencies] -colorama = {version = "*", markers = "sys_platform == \"win32\""} -exceptiongroup = {version = ">=1.0.0rc8", markers = "python_version < \"3.11\""} -iniconfig = "*" -packaging = "*" -pluggy = ">=1.3.0,<2.0" -tomli = {version = ">=1.0.0", markers = "python_version < \"3.11\""} - -[package.extras] -testing = ["argcomplete", "attrs (>=19.2.0)", "hypothesis (>=3.56)", "mock", "nose", "pygments (>=2.7.2)", "requests", "setuptools", "xmlschema"] - -[[package]] -name = "pytz" -version = "2024.1" -description = "World timezone definitions, modern and historical" -optional = false -python-versions = "*" -files = [ - {file = "pytz-2024.1-py2.py3-none-any.whl", hash = "sha256:328171f4e3623139da4983451950b28e95ac706e13f3f2630a879749e7a8b319"}, - {file = "pytz-2024.1.tar.gz", hash = "sha256:2a29735ea9c18baf14b448846bde5a48030ed267578472d8955cd0e7443a9812"}, -] - -[[package]] -name = "requests" -version = "2.31.0" -description = "Python HTTP for Humans." -optional = false -python-versions = ">=3.7" -files = [ - {file = "requests-2.31.0-py3-none-any.whl", hash = "sha256:58cd2187c01e70e6e26505bca751777aa9f2ee0b7f4300988b709f44e013003f"}, - {file = "requests-2.31.0.tar.gz", hash = "sha256:942c5a758f98d790eaed1a29cb6eefc7ffb0d1cf7af05c3d2791656dbd6ad1e1"}, -] - -[package.dependencies] -certifi = ">=2017.4.17" -charset-normalizer = ">=2,<4" -idna = ">=2.5,<4" -urllib3 = ">=1.21.1,<3" - -[package.extras] -socks = ["PySocks (>=1.5.6,!=1.5.7)"] -use-chardet-on-py3 = ["chardet (>=3.0.2,<6)"] - -[[package]] -name = "smmap" -version = "5.0.1" -description = "A pure Python implementation of a sliding window memory map manager" -optional = false -python-versions = ">=3.7" -files = [ - {file = "smmap-5.0.1-py3-none-any.whl", hash = "sha256:e6d8668fa5f93e706934a62d7b4db19c8d9eb8cf2adbb75ef1b675aa332b69da"}, - {file = "smmap-5.0.1.tar.gz", hash = "sha256:dceeb6c0028fdb6734471eb07c0cd2aae706ccaecab45965ee83f11c8d3b1f62"}, -] - -[[package]] -name = "snowballstemmer" -version = "2.2.0" -description = "This package provides 29 stemmers for 28 languages generated from Snowball algorithms." -optional = false -python-versions = "*" -files = [ - {file = "snowballstemmer-2.2.0-py2.py3-none-any.whl", hash = "sha256:c8e1716e83cc398ae16824e5572ae04e0d9fc2c6b985fb0f900f5f0c96ecba1a"}, - {file = "snowballstemmer-2.2.0.tar.gz", hash = "sha256:09b16deb8547d3412ad7b590689584cd0fe25ec8db3be37788be3810cbf19cb1"}, -] - -[[package]] -name = "sphinx" -version = "5.3.0" -description = "Python documentation generator" -optional = false -python-versions = ">=3.6" -files = [ - {file = "Sphinx-5.3.0.tar.gz", hash = "sha256:51026de0a9ff9fc13c05d74913ad66047e104f56a129ff73e174eb5c3ee794b5"}, - {file = "sphinx-5.3.0-py3-none-any.whl", hash = "sha256:060ca5c9f7ba57a08a1219e547b269fadf125ae25b06b9fa7f66768efb652d6d"}, -] - -[package.dependencies] -alabaster = ">=0.7,<0.8" -babel = ">=2.9" -colorama = {version = ">=0.4.5", markers = "sys_platform == \"win32\""} -docutils = ">=0.14,<0.20" -imagesize = ">=1.3" -importlib-metadata = {version = ">=4.8", markers = "python_version < \"3.10\""} -Jinja2 = ">=3.0" -packaging = ">=21.0" -Pygments = ">=2.12" -requests = ">=2.5.0" -snowballstemmer = ">=2.0" -sphinxcontrib-applehelp = "*" -sphinxcontrib-devhelp = "*" -sphinxcontrib-htmlhelp = ">=2.0.0" -sphinxcontrib-jsmath = "*" -sphinxcontrib-qthelp = "*" -sphinxcontrib-serializinghtml = ">=1.1.5" - -[package.extras] -docs = ["sphinxcontrib-websupport"] -lint = ["docutils-stubs", "flake8 (>=3.5.0)", "flake8-bugbear", "flake8-comprehensions", "flake8-simplify", "isort", "mypy (>=0.981)", "sphinx-lint", "types-requests", "types-typed-ast"] -test = ["cython", "html5lib", "pytest (>=4.6)", "typed_ast"] - -[[package]] -name = "sphinxcontrib-applehelp" -version = "1.0.4" -description = "sphinxcontrib-applehelp is a Sphinx extension which outputs Apple help books" -optional = false -python-versions = ">=3.8" -files = [ - {file = "sphinxcontrib-applehelp-1.0.4.tar.gz", hash = "sha256:828f867945bbe39817c210a1abfd1bc4895c8b73fcaade56d45357a348a07d7e"}, - {file = "sphinxcontrib_applehelp-1.0.4-py3-none-any.whl", hash = "sha256:29d341f67fb0f6f586b23ad80e072c8e6ad0b48417db2bde114a4c9746feb228"}, -] - -[package.extras] -lint = ["docutils-stubs", "flake8", "mypy"] -test = ["pytest"] - -[[package]] -name = "sphinxcontrib-devhelp" -version = "1.0.2" -description = "sphinxcontrib-devhelp is a sphinx extension which outputs Devhelp document." -optional = false -python-versions = ">=3.5" -files = [ - {file = "sphinxcontrib-devhelp-1.0.2.tar.gz", hash = "sha256:ff7f1afa7b9642e7060379360a67e9c41e8f3121f2ce9164266f61b9f4b338e4"}, - {file = "sphinxcontrib_devhelp-1.0.2-py2.py3-none-any.whl", hash = "sha256:8165223f9a335cc1af7ffe1ed31d2871f325254c0423bc0c4c7cd1c1e4734a2e"}, -] - -[package.extras] -lint = ["docutils-stubs", "flake8", "mypy"] -test = ["pytest"] - -[[package]] -name = "sphinxcontrib-htmlhelp" -version = "2.0.1" -description = "sphinxcontrib-htmlhelp is a sphinx extension which renders HTML help files" -optional = false -python-versions = ">=3.8" -files = [ - {file = "sphinxcontrib-htmlhelp-2.0.1.tar.gz", hash = "sha256:0cbdd302815330058422b98a113195c9249825d681e18f11e8b1f78a2f11efff"}, - {file = "sphinxcontrib_htmlhelp-2.0.1-py3-none-any.whl", hash = "sha256:c38cb46dccf316c79de6e5515e1770414b797162b23cd3d06e67020e1d2a6903"}, -] - -[package.extras] -lint = ["docutils-stubs", "flake8", "mypy"] -test = ["html5lib", "pytest"] - -[[package]] -name = "sphinxcontrib-jsmath" -version = "1.0.1" -description = "A sphinx extension which renders display math in HTML via JavaScript" -optional = false -python-versions = ">=3.5" -files = [ - {file = "sphinxcontrib-jsmath-1.0.1.tar.gz", hash = "sha256:a9925e4a4587247ed2191a22df5f6970656cb8ca2bd6284309578f2153e0c4b8"}, - {file = "sphinxcontrib_jsmath-1.0.1-py2.py3-none-any.whl", hash = "sha256:2ec2eaebfb78f3f2078e73666b1415417a116cc848b72e5172e596c871103178"}, -] - -[package.extras] -test = ["flake8", "mypy", "pytest"] - -[[package]] -name = "sphinxcontrib-qthelp" -version = "1.0.3" -description = "sphinxcontrib-qthelp is a sphinx extension which outputs QtHelp document." -optional = false -python-versions = ">=3.5" -files = [ - {file = "sphinxcontrib-qthelp-1.0.3.tar.gz", hash = "sha256:4c33767ee058b70dba89a6fc5c1892c0d57a54be67ddd3e7875a18d14cba5a72"}, - {file = "sphinxcontrib_qthelp-1.0.3-py2.py3-none-any.whl", hash = "sha256:bd9fc24bcb748a8d51fd4ecaade681350aa63009a347a8c14e637895444dfab6"}, -] - -[package.extras] -lint = ["docutils-stubs", "flake8", "mypy"] -test = ["pytest"] - -[[package]] -name = "sphinxcontrib-serializinghtml" -version = "1.1.5" -description = "sphinxcontrib-serializinghtml is a sphinx extension which outputs \"serialized\" HTML files (json and pickle)." -optional = false -python-versions = ">=3.5" -files = [ - {file = "sphinxcontrib-serializinghtml-1.1.5.tar.gz", hash = "sha256:aa5f6de5dfdf809ef505c4895e51ef5c9eac17d0f287933eb49ec495280b6952"}, - {file = "sphinxcontrib_serializinghtml-1.1.5-py2.py3-none-any.whl", hash = "sha256:352a9a00ae864471d3a7ead8d7d79f5fc0b57e8b3f95e9867eb9eb28999b92fd"}, -] - -[package.extras] -lint = ["docutils-stubs", "flake8", "mypy"] -test = ["pytest"] - -[[package]] -name = "tomli" -version = "2.0.1" -description = "A lil' TOML parser" -optional = false -python-versions = ">=3.7" -files = [ - {file = "tomli-2.0.1-py3-none-any.whl", hash = "sha256:939de3e7a6161af0c887ef91b7d41a53e7c5a1ca976325f429cb46ea9bc30ecc"}, - {file = "tomli-2.0.1.tar.gz", hash = "sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f"}, -] - -[[package]] -name = "urllib3" -version = "2.2.0" -description = "HTTP library with thread-safe connection pooling, file post, and more." -optional = false -python-versions = ">=3.8" -files = [ - {file = "urllib3-2.2.0-py3-none-any.whl", hash = "sha256:ce3711610ddce217e6d113a2732fafad960a03fd0318c91faa79481e35c11224"}, - {file = "urllib3-2.2.0.tar.gz", hash = "sha256:051d961ad0c62a94e50ecf1af379c3aba230c66c710493493560c0c223c49f20"}, -] - -[package.extras] -brotli = ["brotli (>=1.0.9)", "brotlicffi (>=0.8.0)"] -h2 = ["h2 (>=4,<5)"] -socks = ["pysocks (>=1.5.6,!=1.5.7,<2.0)"] -zstd = ["zstandard (>=0.18.0)"] - -[[package]] -name = "wheel" -version = "0.42.0" -description = "A built-package format for Python" -optional = false -python-versions = ">=3.7" -files = [ - {file = "wheel-0.42.0-py3-none-any.whl", hash = "sha256:177f9c9b0d45c47873b619f5b650346d632cdc35fb5e4d25058e09c9e581433d"}, - {file = "wheel-0.42.0.tar.gz", hash = "sha256:c45be39f7882c9d34243236f2d63cbd58039e360f85d0913425fbd7ceea617a8"}, -] - -[package.extras] -test = ["pytest (>=6.0.0)", "setuptools (>=65)"] - -[[package]] -name = "zipp" -version = "3.17.0" -description = "Backport of pathlib-compatible object wrapper for zip files" -optional = false -python-versions = ">=3.8" -files = [ - {file = "zipp-3.17.0-py3-none-any.whl", hash = "sha256:0e923e726174922dce09c53c59ad483ff7bbb8e572e00c7f7c46b88556409f31"}, - {file = "zipp-3.17.0.tar.gz", hash = "sha256:84e64a1c28cf7e91ed2078bb8cc8c259cb19b76942096c8d7b84947690cabaf0"}, -] - -[package.extras] -docs = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "rst.linker (>=1.9)", "sphinx (<7.2.5)", "sphinx (>=3.5)", "sphinx-lint"] -testing = ["big-O", "jaraco.functools", "jaraco.itertools", "more-itertools", "pytest (>=6)", "pytest-black (>=0.3.7)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)", "pytest-ignore-flaky", "pytest-mypy (>=0.9.1)", "pytest-ruff"] - -[metadata] -lock-version = "2.0" -python-versions = "^3.8" -content-hash = "25ee2ae1d74abedde3a6637a60d4a3095ea5cf9731960875741bbc2ba84a475d" diff --git a/.lib/git-fleximod/pyproject.toml b/.lib/git-fleximod/pyproject.toml deleted file mode 100644 index 2484552e4f..0000000000 --- a/.lib/git-fleximod/pyproject.toml +++ /dev/null @@ -1,41 +0,0 @@ -[tool.poetry] -name = "git-fleximod" -version = "0.7.4" -description = "Extended support for git-submodule and git-sparse-checkout" -authors = ["Jim Edwards "] -maintainers = ["Jim Edwards "] -license = "MIT" -readme = "README.md" -homepage = "https://github.com/jedwards4b/git-fleximod" -keywords = ["git", "submodule", "sparse-checkout"] -packages = [ -{ include = "git_fleximod"}, -{ include = "doc"}, -] - -[tool.poetry.scripts] -git-fleximod = "git_fleximod.git_fleximod:main" -me2flexi = "git_fleximod.metoflexi:_main" -fsspec = "fsspec.fuse:main" - -[tool.poetry.dependencies] -python = "^3.8" -GitPython = "^3.1.0" -sphinx = "^5.0.0" -fsspec = "^2023.12.2" -wheel = "^0.42.0" -pytest = "^8.0.0" -pyfakefs = "^5.3.5" - -[tool.poetry.urls] -"Bug Tracker" = "https://github.com/jedwards4b/git-fleximod/issues" - -[tool.pytest.ini_options] -markers = [ - "skip_after_first: only run on first iteration" -] - -[build-system] -requires = ["poetry-core"] -build-backend = "poetry.core.masonry.api" - diff --git a/.lib/git-fleximod/tbump.toml b/.lib/git-fleximod/tbump.toml deleted file mode 100644 index d4b8eaee11..0000000000 --- a/.lib/git-fleximod/tbump.toml +++ /dev/null @@ -1,43 +0,0 @@ -# Uncomment this if your project is hosted on GitHub: -github_url = "https://github.com/jedwards4b/git-fleximod/" - -[version] -current = "0.7.4" - -# Example of a semver regexp. -# Make sure this matches current_version before -# using tbump -regex = ''' - (?P\d+) - \. - (?P\d+) - \. - (?P\d+) - ''' - -[git] -message_template = "Bump to {new_version}" -tag_template = "v{new_version}" - -# For each file to patch, add a [[file]] config -# section containing the path of the file, relative to the -# tbump.toml location. -[[file]] -src = "git_fleximod/cli.py" - -[[file]] -src = "pyproject.toml" - -# You can specify a list of commands to -# run after the files have been patched -# and before the git commit is made - -# [[before_commit]] -# name = "check changelog" -# cmd = "grep -q {new_version} Changelog.rst" - -# Or run some commands after the git tag and the branch -# have been pushed: -# [[after_push]] -# name = "publish" -# cmd = "./publish.sh" diff --git a/.lib/git-fleximod/tests/__init__.py b/.lib/git-fleximod/tests/__init__.py deleted file mode 100644 index 4d4c66c78e..0000000000 --- a/.lib/git-fleximod/tests/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -import sys, os - -sys.path.append(os.path.join(os.path.dirname(__file__), os.path.pardir, "src")) diff --git a/.lib/git-fleximod/tests/conftest.py b/.lib/git-fleximod/tests/conftest.py deleted file mode 100644 index 942a0efb97..0000000000 --- a/.lib/git-fleximod/tests/conftest.py +++ /dev/null @@ -1,138 +0,0 @@ -import pytest -from git_fleximod.gitinterface import GitInterface -import os -import subprocess -import logging -from pathlib import Path - -@pytest.fixture(scope='session') -def logger(): - logging.basicConfig( - level=logging.INFO, format="%(name)s - %(levelname)s - %(message)s", handlers=[logging.StreamHandler()] - ) - logger = logging.getLogger(__name__) - return logger - -all_repos=[ - {"subrepo_path": "modules/test", - "submodule_name": "test_submodule", - "status1" : "test_submodule MPIserial_2.5.0-3-gd82ce7c is out of sync with .gitmodules MPIserial_2.4.0", - "status2" : "test_submodule at tag MPIserial_2.4.0", - "status3" : "test_submodule at tag MPIserial_2.4.0", - "status4" : "test_submodule at tag MPIserial_2.4.0", - "gitmodules_content" : """ - [submodule "test_submodule"] - path = modules/test - url = https://github.com/ESMCI/mpi-serial.git - fxtag = MPIserial_2.4.0 - fxDONOTUSEurl = https://github.com/ESMCI/mpi-serial.git - fxrequired = ToplevelRequired -"""}, - {"subrepo_path": "modules/test_optional", - "submodule_name": "test_optional", - "status1" : "test_optional MPIserial_2.5.0-3-gd82ce7c is out of sync with .gitmodules MPIserial_2.4.0", - "status2" : "test_optional at tag MPIserial_2.4.0", - "status3" : "test_optional not checked out, aligned at tag MPIserial_2.4.0", - "status4" : "test_optional at tag MPIserial_2.4.0", - "gitmodules_content": """ - [submodule "test_optional"] - path = modules/test_optional - url = https://github.com/ESMCI/mpi-serial.git - fxtag = MPIserial_2.4.0 - fxDONOTUSEurl = https://github.com/ESMCI/mpi-serial.git - fxrequired = ToplevelOptional -"""}, - {"subrepo_path": "modules/test_alwaysoptional", - "submodule_name": "test_alwaysoptional", - "status1" : "test_alwaysoptional MPIserial_2.3.0 is out of sync with .gitmodules e5cf35c", - "status2" : "test_alwaysoptional at hash e5cf35c", - "status3" : "test_alwaysoptional not checked out, out of sync at tag MPIserial_2.3.0", - "status4" : "test_alwaysoptional at hash e5cf35c", - "gitmodules_content": """ - [submodule "test_alwaysoptional"] - path = modules/test_alwaysoptional - url = https://github.com/ESMCI/mpi-serial.git - fxtag = e5cf35c - fxDONOTUSEurl = https://github.com/ESMCI/mpi-serial.git - fxrequired = AlwaysOptional -"""}, - {"subrepo_path": "modules/test_sparse", - "submodule_name": "test_sparse", - "status1" : "test_sparse at tag MPIserial_2.5.0", - "status2" : "test_sparse at tag MPIserial_2.5.0", - "status3" : "test_sparse at tag MPIserial_2.5.0", - "status4" : "test_sparse at tag MPIserial_2.5.0", - "gitmodules_content": """ - [submodule "test_sparse"] - path = modules/test_sparse - url = https://github.com/ESMCI/mpi-serial.git - fxtag = MPIserial_2.5.0 - fxDONOTUSEurl = https://github.com/ESMCI/mpi-serial.git - fxrequired = AlwaysRequired - fxsparse = ../.sparse_file_list -"""}, -] -@pytest.fixture(params=all_repos) - -def shared_repos(request): - return request.param - -@pytest.fixture -def get_all_repos(): - return all_repos - -def write_sparse_checkout_file(fp): - sparse_content = """m4 -""" - fp.write_text(sparse_content) - -@pytest.fixture -def test_repo(shared_repos, tmp_path, logger): - subrepo_path = shared_repos["subrepo_path"] - submodule_name = shared_repos["submodule_name"] - test_dir = tmp_path / "testrepo" - test_dir.mkdir() - str_path = str(test_dir) - gitp = GitInterface(str_path, logger) - assert test_dir.joinpath(".git").is_dir() - (test_dir / "modules").mkdir() - if "sparse" in submodule_name: - (test_dir / subrepo_path).mkdir() - # Add the sparse checkout file - write_sparse_checkout_file(test_dir / "modules" / ".sparse_file_list") - gitp.git_operation("add","modules/.sparse_file_list") - else: - gitp = GitInterface(str(test_dir), logger) - gitp.git_operation("submodule", "add", "--depth","1","--name", submodule_name, "https://github.com/ESMCI/mpi-serial.git", subrepo_path) - assert test_dir.joinpath(".gitmodules").is_file() - gitp.git_operation("add",subrepo_path) - gitp.git_operation("commit","-a","-m","\"add submod\"") - test_dir2 = tmp_path / "testrepo2" - gitp.git_operation("clone",test_dir,test_dir2) - return test_dir2 - - -@pytest.fixture -def complex_repo(tmp_path, logger): - test_dir = tmp_path / "testcomplex" - test_dir.mkdir() - str_path = str(test_dir) - gitp = GitInterface(str_path, logger) - gitp.git_operation("remote", "add", "origin", "https://github.com/jedwards4b/fleximod-test2") - gitp.git_operation("fetch", "origin", "main") - gitp.git_operation("checkout", "main") - return test_dir - -@pytest.fixture -def git_fleximod(): - def _run_fleximod(path, args, input=None): - cmd = ["git", "fleximod"] + args.split() - result = subprocess.run(cmd, cwd=path, input=input, - stdout=subprocess.PIPE, stderr=subprocess.PIPE, - text=True) - if result.returncode: - print(result.stdout) - print(result.stderr) - return result - return _run_fleximod - diff --git a/.lib/git-fleximod/tests/test_a_import.py b/.lib/git-fleximod/tests/test_a_import.py deleted file mode 100644 index d5ca878de5..0000000000 --- a/.lib/git-fleximod/tests/test_a_import.py +++ /dev/null @@ -1,8 +0,0 @@ -# pylint: disable=unused-import -from git_fleximod import cli -from git_fleximod import utils -from git_fleximod.gitinterface import GitInterface -from git_fleximod.gitmodules import GitModules - -def test_import(): - print("here") diff --git a/.lib/git-fleximod/tests/test_b_update.py b/.lib/git-fleximod/tests/test_b_update.py deleted file mode 100644 index 159f1cfae0..0000000000 --- a/.lib/git-fleximod/tests/test_b_update.py +++ /dev/null @@ -1,26 +0,0 @@ -import pytest -from pathlib import Path - -def test_basic_checkout(git_fleximod, test_repo, shared_repos): - # Prepare a simple .gitmodules - gm = shared_repos['gitmodules_content'] - file_path = (test_repo / ".gitmodules") - repo_name = shared_repos["submodule_name"] - repo_path = shared_repos["subrepo_path"] - - file_path.write_text(gm) - - # Run the command - result = git_fleximod(test_repo, f"update {repo_name}") - - # Assertions - assert result.returncode == 0 - assert Path(test_repo / repo_path).exists() # Did the submodule directory get created? - if "sparse" in repo_name: - assert Path(test_repo / f"{repo_path}/m4").exists() # Did the submodule sparse directory get created? - assert not Path(test_repo / f"{repo_path}/README").exists() # Did only the submodule sparse directory get created? - - status = git_fleximod(test_repo, f"status {repo_name}") - - assert shared_repos["status2"] in status.stdout - diff --git a/.lib/git-fleximod/tests/test_c_required.py b/.lib/git-fleximod/tests/test_c_required.py deleted file mode 100644 index 89ab8d294d..0000000000 --- a/.lib/git-fleximod/tests/test_c_required.py +++ /dev/null @@ -1,30 +0,0 @@ -import pytest -from pathlib import Path - -def test_required(git_fleximod, test_repo, shared_repos): - file_path = (test_repo / ".gitmodules") - gm = shared_repos["gitmodules_content"] - repo_name = shared_repos["submodule_name"] - if file_path.exists(): - with file_path.open("r") as f: - gitmodules_content = f.read() - # add the entry if it does not exist - if repo_name not in gitmodules_content: - file_path.write_text(gitmodules_content+gm) - # or if it is incomplete - elif gm not in gitmodules_content: - file_path.write_text(gm) - else: - file_path.write_text(gm) - result = git_fleximod(test_repo, "update") - assert result.returncode == 0 - status = git_fleximod(test_repo, f"status {repo_name}") - assert shared_repos["status3"] in status.stdout - status = git_fleximod(test_repo, f"update --optional") - assert result.returncode == 0 - status = git_fleximod(test_repo, f"status {repo_name}") - assert shared_repos["status4"] in status.stdout - status = git_fleximod(test_repo, f"update {repo_name}") - assert result.returncode == 0 - status = git_fleximod(test_repo, f"status {repo_name}") - assert shared_repos["status4"] in status.stdout diff --git a/.lib/git-fleximod/tests/test_d_complex.py b/.lib/git-fleximod/tests/test_d_complex.py deleted file mode 100644 index fdce516274..0000000000 --- a/.lib/git-fleximod/tests/test_d_complex.py +++ /dev/null @@ -1,67 +0,0 @@ -import pytest -from pathlib import Path -from git_fleximod.gitinterface import GitInterface - -def test_complex_checkout(git_fleximod, complex_repo, logger): - status = git_fleximod(complex_repo, "status") - assert("ToplevelOptional not checked out, aligned at tag v5.3.2" in status.stdout) - assert("ToplevelRequired not checked out, aligned at tag MPIserial_2.5.0" in status.stdout) - assert("AlwaysRequired not checked out, aligned at tag MPIserial_2.4.0" in status.stdout) - assert("Complex not checked out, aligned at tag testtag01" in status.stdout) - assert("AlwaysOptional not checked out, aligned at tag MPIserial_2.3.0" in status.stdout) - - # This should checkout and update test_submodule and complex_sub - result = git_fleximod(complex_repo, "update") - assert result.returncode == 0 - - status = git_fleximod(complex_repo, "status") - assert("ToplevelOptional not checked out, aligned at tag v5.3.2" in status.stdout) - assert("ToplevelRequired at tag MPIserial_2.5.0" in status.stdout) - assert("AlwaysRequired at tag MPIserial_2.4.0" in status.stdout) - assert("Complex at tag testtag01" in status.stdout) - - # now check the complex_sub - root = (complex_repo / "modules" / "complex") - assert(not (root / "libraries" / "gptl" / ".git").exists()) - assert(not (root / "libraries" / "mpi-serial" / ".git").exists()) - assert((root / "modules" / "mpi-serial" / ".git").exists()) - assert(not (root / "modules" / "mpi-serial2" / ".git").exists()) - assert((root / "modules" / "mpi-sparse" / ".git").exists()) - assert((root / "modules" / "mpi-sparse" / "m4").exists()) - assert(not (root / "modules" / "mpi-sparse" / "README").exists()) - - # update a single optional submodule - - result = git_fleximod(complex_repo, "update ToplevelOptional") - assert result.returncode == 0 - - status = git_fleximod(complex_repo, "status") - assert("ToplevelOptional at tag v5.3.2" in status.stdout) - assert("ToplevelRequired at tag MPIserial_2.5.0" in status.stdout) - assert("AlwaysRequired at tag MPIserial_2.4.0" in status.stdout) - assert("Complex at tag testtag01" in status.stdout) - assert("AlwaysOptional not checked out, aligned at tag MPIserial_2.3.0" in status.stdout) - - - # Finally update optional - result = git_fleximod(complex_repo, "update --optional") - assert result.returncode == 0 - - status = git_fleximod(complex_repo, "status") - assert("ToplevelOptional at tag v5.3.2" in status.stdout) - assert("ToplevelRequired at tag MPIserial_2.5.0" in status.stdout) - assert("AlwaysRequired at tag MPIserial_2.4.0" in status.stdout) - assert("Complex at tag testtag01" in status.stdout) - assert("AlwaysOptional at tag MPIserial_2.3.0" in status.stdout) - - # now check the complex_sub - root = (complex_repo / "modules" / "complex" ) - assert(not (root / "libraries" / "gptl" / ".git").exists()) - assert(not (root / "libraries" / "mpi-serial" / ".git").exists()) - assert((root / "modules" / "mpi-serial" / ".git").exists()) - assert((root / "modules" / "mpi-serial2" / ".git").exists()) - assert((root / "modules" / "mpi-sparse" / ".git").exists()) - assert((root / "modules" / "mpi-sparse" / "m4").exists()) - assert(not (root / "modules" / "mpi-sparse" / "README").exists()) - - From eb94e4d298564d52197d9cf632d73ffad74c5f61 Mon Sep 17 00:00:00 2001 From: Jim Edwards Date: Fri, 31 May 2024 10:20:12 -0600 Subject: [PATCH 0383/1248] Squashed '.lib/git-fleximod/' content from commit a354b0528 git-subtree-dir: .lib/git-fleximod git-subtree-split: a354b0528228ac89ce103b3b42b2a203fe495ba5 --- .github/workflows/pre-commit | 13 + .github/workflows/pytest.yaml | 77 ++++ .pre-commit-config.yaml | 18 + License | 20 + README.md | 108 ++++++ doc/Makefile | 20 + doc/conf.py | 26 ++ doc/index.rst | 24 ++ doc/make.bat | 35 ++ escomp_install | 25 ++ git_fleximod/__init__.py | 0 git_fleximod/cli.py | 129 +++++++ git_fleximod/git_fleximod.py | 605 +++++++++++++++++++++++++++++ git_fleximod/gitinterface.py | 79 ++++ git_fleximod/gitmodules.py | 97 +++++ git_fleximod/lstripreader.py | 43 +++ git_fleximod/metoflexi.py | 236 ++++++++++++ git_fleximod/utils.py | 365 ++++++++++++++++++ poetry.lock | 693 ++++++++++++++++++++++++++++++++++ pyproject.toml | 41 ++ tbump.toml | 43 +++ tests/__init__.py | 3 + tests/conftest.py | 138 +++++++ tests/test_a_import.py | 8 + tests/test_b_update.py | 26 ++ tests/test_c_required.py | 30 ++ tests/test_d_complex.py | 67 ++++ 27 files changed, 2969 insertions(+) create mode 100644 .github/workflows/pre-commit create mode 100644 .github/workflows/pytest.yaml create mode 100644 .pre-commit-config.yaml create mode 100644 License create mode 100644 README.md create mode 100644 doc/Makefile create mode 100644 doc/conf.py create mode 100644 doc/index.rst create mode 100644 doc/make.bat create mode 100644 escomp_install create mode 100644 git_fleximod/__init__.py create mode 100644 git_fleximod/cli.py create mode 100755 git_fleximod/git_fleximod.py create mode 100644 git_fleximod/gitinterface.py create mode 100644 git_fleximod/gitmodules.py create mode 100644 git_fleximod/lstripreader.py create mode 100755 git_fleximod/metoflexi.py create mode 100644 git_fleximod/utils.py create mode 100644 poetry.lock create mode 100644 pyproject.toml create mode 100644 tbump.toml create mode 100644 tests/__init__.py create mode 100644 tests/conftest.py create mode 100644 tests/test_a_import.py create mode 100644 tests/test_b_update.py create mode 100644 tests/test_c_required.py create mode 100644 tests/test_d_complex.py diff --git a/.github/workflows/pre-commit b/.github/workflows/pre-commit new file mode 100644 index 0000000000..1a6ad0082a --- /dev/null +++ b/.github/workflows/pre-commit @@ -0,0 +1,13 @@ +name: pre-commit +on: + pull_request: + push: + branches: [main] + +jobs: + pre-commit: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v3 + - uses: pre-commit/action@v3.0.0 diff --git a/.github/workflows/pytest.yaml b/.github/workflows/pytest.yaml new file mode 100644 index 0000000000..0868dd9a33 --- /dev/null +++ b/.github/workflows/pytest.yaml @@ -0,0 +1,77 @@ +# Run this job on pushes to `main`, and for pull requests. If you don't specify +# `branches: [main], then this actions runs _twice_ on pull requests, which is +# annoying. + +on: + push: + branches: [main] + pull_request: + branches: [main] + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + # If you wanted to use multiple Python versions, you'd have specify a matrix in the job and + # reference the matrixe python version here. + - uses: actions/setup-python@v5 + with: + python-version: '3.9' + + # Cache the installation of Poetry itself, e.g. the next step. This prevents the workflow + # from installing Poetry every time, which can be slow. Note the use of the Poetry version + # number in the cache key, and the "-0" suffix: this allows you to invalidate the cache + # manually if/when you want to upgrade Poetry, or if something goes wrong. This could be + # mildly cleaner by using an environment variable, but I don't really care. + - name: cache poetry install + uses: actions/cache@v4 + with: + path: ~/.local + key: poetry-1.7.1 + + # Install Poetry. You could do this manually, or there are several actions that do this. + # `snok/install-poetry` seems to be minimal yet complete, and really just calls out to + # Poetry's default install script, which feels correct. I pin the Poetry version here + # because Poetry does occasionally change APIs between versions and I don't want my + # actions to break if it does. + # + # The key configuration value here is `virtualenvs-in-project: true`: this creates the + # venv as a `.venv` in your testing directory, which allows the next step to easily + # cache it. + - uses: snok/install-poetry@v1 + with: + version: 1.7.1 + virtualenvs-create: true + virtualenvs-in-project: true + + # Cache your dependencies (i.e. all the stuff in your `pyproject.toml`). Note the cache + # key: if you're using multiple Python versions, or multiple OSes, you'd need to include + # them in the cache key. I'm not, so it can be simple and just depend on the poetry.lock. + - name: cache deps + id: cache-deps + uses: actions/cache@v4 + with: + path: .venv + key: pydeps-${{ hashFiles('**/poetry.lock') }} + + # Install dependencies. `--no-root` means "install all dependencies but not the project + # itself", which is what you want to avoid caching _your_ code. The `if` statement + # ensures this only runs on a cache miss. + - run: poetry install --no-interaction --no-root + if: steps.cache-deps.outputs.cache-hit != 'true' + + # Now install _your_ project. This isn't necessary for many types of projects -- particularly + # things like Django apps don't need this. But it's a good idea since it fully-exercises the + # pyproject.toml and makes that if you add things like console-scripts at some point that + # they'll be installed and working. + - run: poetry install --no-interaction + + # And finally run tests. I'm using pytest and all my pytest config is in my `pyproject.toml` + # so this line is super-simple. But it could be as complex as you need. + - run: | + git config --global user.name "${GITHUB_ACTOR}" + git config --global user.email "${GITHUB_ACTOR_ID}+${GITHUB_ACTOR}@users.noreply.github.com" + poetry run pytest + diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000000..2f6089da72 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,18 @@ +exclude: ^utils/.*$ + +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.0.1 + hooks: + - id: end-of-file-fixer + - id: trailing-whitespace + - repo: https://github.com/psf/black + rev: 22.3.0 + hooks: + - id: black + - repo: https://github.com/PyCQA/pylint + rev: v2.11.1 + hooks: + - id: pylint + args: + - --disable=I,C,R,logging-not-lazy,wildcard-import,unused-wildcard-import,fixme,broad-except,bare-except,eval-used,exec-used,global-statement,logging-format-interpolation,no-name-in-module,arguments-renamed,unspecified-encoding,protected-access,import-error,no-member diff --git a/License b/License new file mode 100644 index 0000000000..88bc22515e --- /dev/null +++ b/License @@ -0,0 +1,20 @@ +Copyright 2024 NSF National Center for Atmospheric Sciences (NCAR) + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +“Software”), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000000..53917da400 --- /dev/null +++ b/README.md @@ -0,0 +1,108 @@ +# git-fleximod + +Flexible, Enhanced Submodule Management for Git + +## Overview + +Git-fleximod is a Python-based tool that extends Git's submodule and sparse checkout capabilities, offering additional features for managing submodules in a more flexible and efficient way. + +## Installation + + If you choose to locate git-fleximod in your path you can access it via command: git fleximod + +## Usage + + Basic Usage: + git fleximod [options] + Available Commands: + status: Display the status of submodules. + update: Update submodules to the tag indicated in .gitmodules variable fxtag. + test: Make sure that fxtags and submodule hashes are consistant, + make sure that official urls (as defined by fxDONOTUSEurl) are set + make sure that fxtags are defined for all submodules + Additional Options: + See git fleximod --help for more details. + +## Supported .gitmodules Variables + + fxtag: Specify a specific tag or branch to checkout for a submodule. + fxrequired: Mark a submodule's checkout behavior, with allowed values: + - ToplevelRequired: Top-level and required (checked out only when this is the Toplevel module). + - ToplevelOptional: Top-level and optional (checked out with --optional flag if this is the Toplevel module). + - AlwaysRequired: Always required (always checked out). + - AlwaysOptional: Always optional (checked out with --optional flag). + fxsparse: Enable sparse checkout for a submodule, pointing to a file containing sparse checkout paths. + fxDONOTUSEurl: This is the url used in the test subcommand to assure that protected branches do not point to forks + **NOTE** the fxDONOTUSEurl variable is only used to identify the official project repository and should not be + changed by users. Use the url variable to change to a fork if desired. + +## Sparse Checkouts + + To enable sparse checkout for a submodule, set the fxsparse variable + in the .gitmodules file to the path of a file containing the desired + sparse checkout paths. Git-fleximod will automatically configure + sparse checkout based on this file when applicable commands are run. + See [git-sparse-checkout](https://git-scm.com/docs/git-sparse-checkout#_internalsfull_pattern_set) + for details on the format of this file. + +## Tests + + The git fleximod test action is designed to be used by, for example, github workflows + to assure that protected branches are consistant with respect to submodule hashes and fleximod fxtags + +## Examples + +Here are some common usage examples: + +Update all submodules, including optional ones: +```bash + git fleximod update --optional +``` + +Updating a specific submodule to the fxtag indicated in .gitmodules: + +```bash + git fleximod update submodule-name +``` +Example .gitmodules entry: +```ini, toml + [submodule "cosp2"] + path = src/physics/cosp2/src + url = https://github.com/CFMIP/COSPv2.0 + fxsparse = ../.cosp_sparse_checkout + fxrequired = AlwaysRequired + fxtag = v2.1.4cesm +``` +Explanation: + +This entry indicates that the submodule named cosp2 at tag v2.1.4cesm +should be checked out into the directory src/physics/cosp2/src +relative to the .gitmodules directory. It should be checked out from +the URL https://github.com/CFMIP/COSPv2.0 and use sparse checkout as +described in the file ../.cosp_sparse_checkout relative to the path +directory. It should be checked out anytime this .gitmodules entry is +read. + +Additional example: +```ini, toml + [submodule "cime"] + path = cime + url = https://github.com/jedwards4b/cime + fxrequired = ToplevelRequired + fxtag = cime6.0.198_rme01 +``` + +Explanation: + +This entry indicates that the submodule cime should be checked out +into a directory named cime at tag cime6.0.198_rme01 from the URL +https://github.com/jedwards4b/cime. This should only be done if +the .gitmodules file is at the top level of the repository clone. + +## Contributing + +We welcome contributions! Please see the CONTRIBUTING.md file for guidelines. + +## License + +Git-fleximod is released under the MIT License. diff --git a/doc/Makefile b/doc/Makefile new file mode 100644 index 0000000000..d4bb2cbb9e --- /dev/null +++ b/doc/Makefile @@ -0,0 +1,20 @@ +# Minimal makefile for Sphinx documentation +# + +# You can set these variables from the command line, and also +# from the environment for the first two. +SPHINXOPTS ?= +SPHINXBUILD ?= sphinx-build +SOURCEDIR = . +BUILDDIR = _build + +# Put it first so that "make" without argument is like "make help". +help: + @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) + +.PHONY: help Makefile + +# Catch-all target: route all unknown targets to Sphinx using the new +# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). +%: Makefile + @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) diff --git a/doc/conf.py b/doc/conf.py new file mode 100644 index 0000000000..423099eec9 --- /dev/null +++ b/doc/conf.py @@ -0,0 +1,26 @@ +# Configuration file for the Sphinx documentation builder. +# +# For the full list of built-in configuration values, see the documentation: +# https://www.sphinx-doc.org/en/master/usage/configuration.html + +# -- Project information ----------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information + +project = "git-fleximod" +author = "Jim Edwards " +release = "0.4.0" + +# -- General configuration --------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration + +extensions = ["sphinx_argparse_cli"] + +templates_path = ["_templates"] +exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"] + + +# -- Options for HTML output ------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output + +html_theme = "alabaster" +html_static_path = ["_static"] diff --git a/doc/index.rst b/doc/index.rst new file mode 100644 index 0000000000..0f9c1a7f7e --- /dev/null +++ b/doc/index.rst @@ -0,0 +1,24 @@ +.. git-fleximod documentation master file, created by + sphinx-quickstart on Sat Feb 3 12:02:22 2024. + You can adapt this file completely to your liking, but it should at least + contain the root `toctree` directive. + +Welcome to git-fleximod's documentation! +======================================== + +.. toctree:: + :maxdepth: 2 + :caption: Contents: +.. module:: sphinxcontrib.autoprogram +.. sphinx_argparse_cli:: + :module: git_fleximod.cli + :func: get_parser + :prog: git-fleximod + + +Indices and tables +================== + +* :ref:`genindex` +* :ref:`modindex` +* :ref:`search` diff --git a/doc/make.bat b/doc/make.bat new file mode 100644 index 0000000000..32bb24529f --- /dev/null +++ b/doc/make.bat @@ -0,0 +1,35 @@ +@ECHO OFF + +pushd %~dp0 + +REM Command file for Sphinx documentation + +if "%SPHINXBUILD%" == "" ( + set SPHINXBUILD=sphinx-build +) +set SOURCEDIR=. +set BUILDDIR=_build + +%SPHINXBUILD% >NUL 2>NUL +if errorlevel 9009 ( + echo. + echo.The 'sphinx-build' command was not found. Make sure you have Sphinx + echo.installed, then set the SPHINXBUILD environment variable to point + echo.to the full path of the 'sphinx-build' executable. Alternatively you + echo.may add the Sphinx directory to PATH. + echo. + echo.If you don't have Sphinx installed, grab it from + echo.https://www.sphinx-doc.org/ + exit /b 1 +) + +if "%1" == "" goto help + +%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% +goto end + +:help +%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% + +:end +popd diff --git a/escomp_install b/escomp_install new file mode 100644 index 0000000000..ae782e72a4 --- /dev/null +++ b/escomp_install @@ -0,0 +1,25 @@ +#!/usr/bin/env python +# updates git-fleximod in an ESCOMP model +# this script should be run from the model root directory, it expects +# git-fleximod to already be installed with the script in bin +# and the classes in lib/python/site-packages +import sys +import shutil +import os + +from glob import iglob + +fleximod_root = sys.argv[1] +fleximod_path = os.path.join(fleximod_root,"src","git-fleximod") +if os.path.isfile(fleximod_path): + with open(fleximod_path,"r") as f: + fleximod = f.readlines() + with open(os.path.join(".","bin","git-fleximod"),"w") as f: + for line in fleximod: + f.write(line) + if "import argparse" in line: + f.write('\nsys.path.append(os.path.join(os.path.dirname(__file__),"..","lib","python","site-packages"))\n\n') + + for file in iglob(os.path.join(fleximod_root, "src", "fleximod", "*.py")): + shutil.copy(file, + os.path.join("lib","python","site-packages","fleximod",os.path.basename(file))) diff --git a/git_fleximod/__init__.py b/git_fleximod/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/git_fleximod/cli.py b/git_fleximod/cli.py new file mode 100644 index 0000000000..4c3fb1a8f9 --- /dev/null +++ b/git_fleximod/cli.py @@ -0,0 +1,129 @@ +from pathlib import Path +import argparse +from git_fleximod import utils + +__version__ = "0.7.5" + +def find_root_dir(filename=".gitmodules"): + """ finds the highest directory in tree + which contains a file called filename """ + d = Path.cwd() + root = Path(d.root) + dirlist = [] + dl = d + while dl != root: + dirlist.append(dl) + dl = dl.parent + dirlist.append(root) + dirlist.reverse() + + for dl in dirlist: + attempt = dl / filename + if attempt.is_file(): + return str(dl) + utils.fatal_error("No .gitmodules found in directory tree") + + +def get_parser(): + description = """ + %(prog)s manages checking out groups of gitsubmodules with addtional support for Earth System Models + """ + parser = argparse.ArgumentParser( + description=description, formatter_class=argparse.RawDescriptionHelpFormatter + ) + + # + # user options + # + choices = ["update", "status", "test"] + parser.add_argument( + "action", + choices=choices, + default="update", + help=f"Subcommand of git-fleximod, choices are {choices[:-1]}", + ) + + parser.add_argument( + "components", + nargs="*", + help="Specific component(s) to checkout. By default, " + "all required submodules are checked out.", + ) + + parser.add_argument( + "-C", + "--path", + default=find_root_dir(), + help="Toplevel repository directory. Defaults to top git directory relative to current.", + ) + + parser.add_argument( + "-g", + "--gitmodules", + nargs="?", + default=".gitmodules", + help="The submodule description filename. " "Default: %(default)s.", + ) + + parser.add_argument( + "-x", + "--exclude", + nargs="*", + help="Component(s) listed in the gitmodules file which should be ignored.", + ) + parser.add_argument( + "-f", + "--force", + action="store_true", + default=False, + help="Override cautions and update or checkout over locally modified repository.", + ) + + parser.add_argument( + "-o", + "--optional", + action="store_true", + default=False, + help="By default only the required submodules " + "are checked out. This flag will also checkout the " + "optional submodules relative to the toplevel directory.", + ) + + parser.add_argument( + "-v", + "--verbose", + action="count", + default=0, + help="Output additional information to " + "the screen and log file. This flag can be " + "used up to two times, increasing the " + "verbosity level each time.", + ) + + parser.add_argument( + "-V", + "--version", + action="version", + version=f"%(prog)s {__version__}", + help="Print version and exit.", + ) + + # + # developer options + # + parser.add_argument( + "--backtrace", + action="store_true", + help="DEVELOPER: show exception backtraces as extra " "debugging output", + ) + + parser.add_argument( + "-d", + "--debug", + action="store_true", + default=False, + help="DEVELOPER: output additional debugging " + "information to the screen and log file.", + ) + + return parser diff --git a/git_fleximod/git_fleximod.py b/git_fleximod/git_fleximod.py new file mode 100755 index 0000000000..f080513a52 --- /dev/null +++ b/git_fleximod/git_fleximod.py @@ -0,0 +1,605 @@ +#!/usr/bin/env python +import sys + +MIN_PYTHON = (3, 7) +if sys.version_info < MIN_PYTHON: + sys.exit("Python %s.%s or later is required." % MIN_PYTHON) + +import os +import shutil +import logging +import textwrap +from git_fleximod import utils +from git_fleximod import cli +from git_fleximod.gitinterface import GitInterface +from git_fleximod.gitmodules import GitModules +from configparser import NoOptionError + +# logger variable is global +logger = None + + +def fxrequired_allowed_values(): + return ["ToplevelRequired", "ToplevelOptional", "AlwaysRequired", "AlwaysOptional"] + + +def commandline_arguments(args=None): + parser = cli.get_parser() + + if args: + options = parser.parse_args(args) + else: + options = parser.parse_args() + + # explicitly listing a component overrides the optional flag + if options.optional or options.components: + fxrequired = [ + "ToplevelRequired", + "ToplevelOptional", + "AlwaysRequired", + "AlwaysOptional", + ] + else: + fxrequired = ["ToplevelRequired", "AlwaysRequired"] + + action = options.action + if not action: + action = "update" + handlers = [logging.StreamHandler()] + + if options.debug: + try: + open("fleximod.log", "w") + except PermissionError: + sys.exit("ABORT: Could not write file fleximod.log") + level = logging.DEBUG + handlers.append(logging.FileHandler("fleximod.log")) + elif options.verbose: + level = logging.INFO + else: + level = logging.WARNING + # Configure the root logger + logging.basicConfig( + level=level, format="%(name)s - %(levelname)s - %(message)s", handlers=handlers + ) + + if hasattr(options, "version"): + exit() + + return ( + options.path, + options.gitmodules, + fxrequired, + options.components, + options.exclude, + options.force, + action, + ) + + +def submodule_sparse_checkout(root_dir, name, url, path, sparsefile, tag="master"): + """ + This function performs a sparse checkout of a git submodule. It does so by first creating the .git/info/sparse-checkout fileq + in the submodule and then checking out the desired tag. If the submodule is already checked out, it will not be checked out again. + Creating the sparse-checkout file first prevents the entire submodule from being checked out and then removed. This is important + because the submodule may have a large number of files and checking out the entire submodule and then removing it would be time + and disk space consuming. + + Parameters: + root_dir (str): The root directory for the git operation. + name (str): The name of the submodule. + url (str): The URL of the submodule. + path (str): The path to the submodule. + sparsefile (str): The sparse file for the submodule. + tag (str, optional): The tag to checkout. Defaults to "master". + + Returns: + None + """ + logger.info("Called sparse_checkout for {}".format(name)) + rgit = GitInterface(root_dir, logger) + superroot = rgit.git_operation("rev-parse", "--show-superproject-working-tree") + if superroot: + gitroot = superroot.strip() + else: + gitroot = root_dir.strip() + assert os.path.isdir(os.path.join(gitroot, ".git")) + # first create the module directory + if not os.path.isdir(os.path.join(root_dir, path)): + os.makedirs(os.path.join(root_dir, path)) + + # initialize a new git repo and set the sparse checkout flag + sprep_repo = os.path.join(root_dir, path) + sprepo_git = GitInterface(sprep_repo, logger) + if os.path.exists(os.path.join(sprep_repo, ".git")): + try: + logger.info("Submodule {} found".format(name)) + chk = sprepo_git.config_get_value("core", "sparseCheckout") + if chk == "true": + logger.info("Sparse submodule {} already checked out".format(name)) + return + except NoOptionError: + logger.debug("Sparse submodule {} not present".format(name)) + except Exception as e: + utils.fatal_error("Unexpected error {} occured.".format(e)) + + sprepo_git.config_set_value("core", "sparseCheckout", "true") + + # set the repository remote + + logger.info("Setting remote origin in {}/{}".format(root_dir, path)) + status = sprepo_git.git_operation("remote", "-v") + if url not in status: + sprepo_git.git_operation("remote", "add", "origin", url) + + topgit = os.path.join(gitroot, ".git") + + if gitroot != root_dir and os.path.isfile(os.path.join(root_dir, ".git")): + with open(os.path.join(root_dir, ".git")) as f: + gitpath = os.path.relpath( + os.path.join(root_dir, f.read().split()[1]), + start=os.path.join(root_dir, path), + ) + topgit = os.path.join(gitpath, "modules") + else: + topgit = os.path.relpath( + os.path.join(root_dir, ".git", "modules"), + start=os.path.join(root_dir, path), + ) + + with utils.pushd(sprep_repo): + if not os.path.isdir(topgit): + os.makedirs(topgit) + topgit += os.sep + name + + if os.path.isdir(os.path.join(root_dir, path, ".git")): + with utils.pushd(sprep_repo): + shutil.move(".git", topgit) + with open(".git", "w") as f: + f.write("gitdir: " + os.path.relpath(topgit)) + # assert(os.path.isdir(os.path.relpath(topgit, start=sprep_repo))) + gitsparse = os.path.abspath(os.path.join(topgit, "info", "sparse-checkout")) + if os.path.isfile(gitsparse): + logger.warning( + "submodule {} is already initialized {}".format(name, topgit) + ) + return + + with utils.pushd(sprep_repo): + shutil.copy(sparsefile, gitsparse) + + # Finally checkout the repo + sprepo_git.git_operation("fetch", "origin", "--tags") + sprepo_git.git_operation("checkout", tag) + + print(f"Successfully checked out {name:>20} at {tag}") + rgit.config_set_value(f'submodule "{name}"', "active", "true") + rgit.config_set_value(f'submodule "{name}"', "url", url) + + +def single_submodule_checkout( + root, name, path, url=None, tag=None, force=False, optional=False +): + """ + This function checks out a single git submodule. + + Parameters: + root (str): The root directory for the git operation. + name (str): The name of the submodule. + path (str): The path to the submodule. + url (str, optional): The URL of the submodule. Defaults to None. + tag (str, optional): The tag to checkout. Defaults to None. + force (bool, optional): If set to True, forces the checkout operation. Defaults to False. + optional (bool, optional): If set to True, the submodule is considered optional. Defaults to False. + + Returns: + None + """ + # function implementation... + git = GitInterface(root, logger) + repodir = os.path.join(root, path) + logger.info("Checkout {} into {}/{}".format(name, root, path)) + # if url is provided update to the new url + tmpurl = None + repo_exists = False + if os.path.exists(os.path.join(repodir, ".git")): + logger.info("Submodule {} already checked out".format(name)) + repo_exists = True + # Look for a .gitmodules file in the newly checkedout repo + if not repo_exists and url: + # ssh urls cause problems for those who dont have git accounts with ssh keys defined + # but cime has one since e3sm prefers ssh to https, because the .gitmodules file was + # opened with a GitModules object we don't need to worry about restoring the file here + # it will be done by the GitModules class + if url.startswith("git@"): + tmpurl = url + url = url.replace("git@github.com:", "https://github.com/") + git.git_operation("clone", url, path) + smgit = GitInterface(repodir, logger) + if not tag: + tag = smgit.git_operation("describe", "--tags", "--always").rstrip() + smgit.git_operation("checkout", tag) + # Now need to move the .git dir to the submodule location + rootdotgit = os.path.join(root, ".git") + if os.path.isfile(rootdotgit): + with open(rootdotgit) as f: + line = f.readline() + if line.startswith("gitdir: "): + rootdotgit = line[8:].rstrip() + + newpath = os.path.abspath(os.path.join(root, rootdotgit, "modules", name)) + if os.path.exists(newpath): + shutil.rmtree(os.path.join(repodir, ".git")) + else: + shutil.move(os.path.join(repodir, ".git"), newpath) + + with open(os.path.join(repodir, ".git"), "w") as f: + f.write("gitdir: " + os.path.relpath(newpath, start=repodir)) + + if not os.path.exists(repodir): + parent = os.path.dirname(repodir) + if not os.path.isdir(parent): + os.makedirs(parent) + git.git_operation("submodule", "add", "--name", name, "--", url, path) + + if not repo_exists or not tmpurl: + git.git_operation("submodule", "update", "--init", "--", path) + + if os.path.exists(os.path.join(repodir, ".gitmodules")): + # recursively handle this checkout + print(f"Recursively checking out submodules of {name}") + gitmodules = GitModules(logger, confpath=repodir) + requiredlist = ["AlwaysRequired"] + if optional: + requiredlist.append("AlwaysOptional") + submodules_checkout(gitmodules, repodir, requiredlist, force=force) + if not os.path.exists(os.path.join(repodir, ".git")): + utils.fatal_error( + f"Failed to checkout {name} {repo_exists} {tmpurl} {repodir} {path}" + ) + + if tmpurl: + print(git.git_operation("restore", ".gitmodules")) + + return + + +def submodules_status(gitmodules, root_dir, toplevel=False): + testfails = 0 + localmods = 0 + needsupdate = 0 + for name in gitmodules.sections(): + path = gitmodules.get(name, "path") + tag = gitmodules.get(name, "fxtag") + required = gitmodules.get(name, "fxrequired") + level = required and "Toplevel" in required + if not path: + utils.fatal_error("No path found in .gitmodules for {}".format(name)) + newpath = os.path.join(root_dir, path) + logger.debug("newpath is {}".format(newpath)) + if not os.path.exists(os.path.join(newpath, ".git")): + rootgit = GitInterface(root_dir, logger) + # submodule commands use path, not name + url = gitmodules.get(name, "url") + url = url.replace("git@github.com:", "https://github.com/") + tags = rootgit.git_operation("ls-remote", "--tags", url) + atag = None + needsupdate += 1 + if not toplevel and level: + continue + for htag in tags.split("\n"): + if tag and tag in htag: + atag = (htag.split()[1])[10:] + break + if tag and tag == atag: + print(f"e {name:>20} not checked out, aligned at tag {tag}") + elif tag: + ahash = rootgit.git_operation( + "submodule", "status", "{}".format(path) + ).rstrip() + ahash = ahash[1 : len(tag) + 1] + if tag == ahash: + print(f"e {name:>20} not checked out, aligned at hash {ahash}") + else: + print( + f"e {name:>20} not checked out, out of sync at tag {atag}, expected tag is {tag}" + ) + testfails += 1 + else: + print(f"e {name:>20} has no fxtag defined in .gitmodules") + testfails += 1 + else: + with utils.pushd(newpath): + git = GitInterface(newpath, logger) + atag = git.git_operation("describe", "--tags", "--always").rstrip() + part = git.git_operation("status").partition("\n")[0] + # fake hash to initialize + ahash = "xxxx" + if part: + ahash = part.split()[-1] + if tag and atag == tag: + print(f" {name:>20} at tag {tag}") + elif tag and ahash[: len(tag)] == tag: + print(f" {name:>20} at hash {ahash}") + elif atag == ahash: + print(f" {name:>20} at hash {ahash}") + elif tag: + print( + f"s {name:>20} {atag} {ahash} is out of sync with .gitmodules {tag}" + ) + testfails += 1 + needsupdate += 1 + else: + print( + f"e {name:>20} has no fxtag defined in .gitmodules, module at {atag}" + ) + testfails += 1 + + status = git.git_operation("status", "--ignore-submodules") + if "nothing to commit" not in status: + localmods = localmods + 1 + print("M" + textwrap.indent(status, " ")) + + return testfails, localmods, needsupdate + + +def submodules_update(gitmodules, root_dir, requiredlist, force): + _, localmods, needsupdate = submodules_status(gitmodules, root_dir) + + if localmods and not force: + local_mods_output() + return + if needsupdate == 0: + return + + for name in gitmodules.sections(): + fxtag = gitmodules.get(name, "fxtag") + path = gitmodules.get(name, "path") + url = gitmodules.get(name, "url") + logger.info( + "name={} path={} url={} fxtag={} requiredlist={}".format( + name, os.path.join(root_dir, path), url, fxtag, requiredlist + ) + ) + # if not os.path.exists(os.path.join(root_dir,path, ".git")): + fxrequired = gitmodules.get(name, "fxrequired") + assert fxrequired in fxrequired_allowed_values() + rgit = GitInterface(root_dir, logger) + superroot = rgit.git_operation("rev-parse", "--show-superproject-working-tree") + + fxsparse = gitmodules.get(name, "fxsparse") + + if ( + fxrequired + and (superroot and "Toplevel" in fxrequired) + or fxrequired not in requiredlist + ): + if "ToplevelOptional" == fxrequired: + print("Skipping optional component {}".format(name)) + continue + if fxsparse: + logger.debug( + "Callng submodule_sparse_checkout({}, {}, {}, {}, {}, {}".format( + root_dir, name, url, path, fxsparse, fxtag + ) + ) + submodule_sparse_checkout(root_dir, name, url, path, fxsparse, tag=fxtag) + else: + logger.info( + "Calling submodule_checkout({},{},{},{})".format( + root_dir, name, path, url + ) + ) + + single_submodule_checkout( + root_dir, + name, + path, + url=url, + tag=fxtag, + force=force, + optional=("AlwaysOptional" in requiredlist), + ) + + if os.path.exists(os.path.join(path, ".git")): + submoddir = os.path.join(root_dir, path) + with utils.pushd(submoddir): + git = GitInterface(submoddir, logger) + # first make sure the url is correct + upstream = git.git_operation("ls-remote", "--get-url").rstrip() + newremote = "origin" + if upstream != url: + # TODO - this needs to be a unique name + remotes = git.git_operation("remote", "-v") + if url in remotes: + for line in remotes: + if url in line and "fetch" in line: + newremote = line.split()[0] + break + else: + i = 0 + while newremote in remotes: + i = i + 1 + newremote = f"newremote.{i:02d}" + git.git_operation("remote", "add", newremote, url) + + tags = git.git_operation("tag", "-l") + if fxtag and fxtag not in tags: + git.git_operation("fetch", newremote, "--tags") + atag = git.git_operation("describe", "--tags", "--always").rstrip() + if fxtag and fxtag != atag: + try: + git.git_operation("checkout", fxtag) + print(f"{name:>20} updated to {fxtag}") + except Exception as error: + print(error) + elif not fxtag: + print(f"No fxtag found for submodule {name:>20}") + else: + print(f"{name:>20} up to date.") + + +def local_mods_output(): + text = """\ + The submodules labeled with 'M' above are not in a clean state. + The following are options for how to proceed: + (1) Go into each submodule which is not in a clean state and issue a 'git status' + Either revert or commit your changes so that the submodule is in a clean state. + (2) use the --force option to git-fleximod + (3) you can name the particular submodules to update using the git-fleximod command line + (4) As a last resort you can remove the submodule (via 'rm -fr [directory]') + then rerun git-fleximod update. +""" + print(text) + + +# checkout is done by update if required so this function may be depricated +def submodules_checkout(gitmodules, root_dir, requiredlist, force=False): + """ + This function checks out all git submodules based on the provided parameters. + + Parameters: + gitmodules (ConfigParser): The gitmodules configuration. + root_dir (str): The root directory for the git operation. + requiredlist (list): The list of required modules. + force (bool, optional): If set to True, forces the checkout operation. Defaults to False. + + Returns: + None + """ + # function implementation... + print("") + _, localmods, needsupdate = submodules_status(gitmodules, root_dir) + if localmods and not force: + local_mods_output() + return + if not needsupdate: + return + for name in gitmodules.sections(): + fxrequired = gitmodules.get(name, "fxrequired") + fxsparse = gitmodules.get(name, "fxsparse") + fxtag = gitmodules.get(name, "fxtag") + path = gitmodules.get(name, "path") + url = gitmodules.get(name, "url") + if fxrequired and fxrequired not in requiredlist: + if "Optional" in fxrequired: + print("Skipping optional component {}".format(name)) + continue + + if fxsparse: + logger.debug( + "Callng submodule_sparse_checkout({}, {}, {}, {}, {}, {}".format( + root_dir, name, url, path, fxsparse, fxtag + ) + ) + submodule_sparse_checkout(root_dir, name, url, path, fxsparse, tag=fxtag) + else: + logger.debug( + "Calling submodule_checkout({},{},{})".format(root_dir, name, path) + ) + single_submodule_checkout( + root_dir, + name, + path, + url=url, + tag=fxtag, + force=force, + optional="AlwaysOptional" in requiredlist, + ) + + +def submodules_test(gitmodules, root_dir): + """ + This function tests the git submodules based on the provided parameters. + + It first checks that fxtags are present and in sync with submodule hashes. + Then it ensures that urls are consistent with fxurls (not forks and not ssh) + and that sparse checkout files exist. + + Parameters: + gitmodules (ConfigParser): The gitmodules configuration. + root_dir (str): The root directory for the git operation. + + Returns: + int: The number of test failures. + """ + # First check that fxtags are present and in sync with submodule hashes + testfails, localmods, needsupdate = submodules_status(gitmodules, root_dir) + print("") + # Then make sure that urls are consistant with fxurls (not forks and not ssh) + # and that sparse checkout files exist + for name in gitmodules.sections(): + url = gitmodules.get(name, "url") + fxurl = gitmodules.get(name, "fxDONOTMODIFYurl") + fxsparse = gitmodules.get(name, "fxsparse") + path = gitmodules.get(name, "path") + fxurl = fxurl[:-4] if fxurl.endswith(".git") else fxurl + url = url[:-4] if url.endswith(".git") else url + if not fxurl or url.lower() != fxurl.lower(): + print(f"{name:>20} url {url} not in sync with required {fxurl}") + testfails += 1 + if fxsparse and not os.path.isfile(os.path.join(root_dir, path, fxsparse)): + print(f"{name:>20} sparse checkout file {fxsparse} not found") + testfails += 1 + return testfails + localmods + needsupdate + + +def main(): + ( + root_dir, + file_name, + fxrequired, + includelist, + excludelist, + force, + action, + ) = commandline_arguments() + # Get a logger for the package + global logger + logger = logging.getLogger(__name__) + + logger.info("action is {} root_dir={} file_name={}".format(action, root_dir, file_name)) + + if not os.path.isfile(os.path.join(root_dir, file_name)): + file_path = utils.find_upwards(root_dir, file_name) + + if file_path is None: + utils.fatal_error( + "No {} found in {} or any of it's parents".format(file_name, root_dir) + ) + + root_dir = os.path.dirname(file_path) + logger.info( + "root_dir is {} includelist={} excludelist={}".format( + root_dir, includelist, excludelist + ) + ) + gitmodules = GitModules( + logger, + confpath=root_dir, + conffile=file_name, + includelist=includelist, + excludelist=excludelist, + ) + if not gitmodules.sections(): + sys.exit("No submodule components found") + retval = 0 + if action == "update": + submodules_update(gitmodules, root_dir, fxrequired, force) + elif action == "status": + tfails, lmods, updates = submodules_status(gitmodules, root_dir, toplevel=True) + if tfails + lmods + updates > 0: + print( + f" testfails = {tfails}, local mods = {lmods}, needs updates {updates}\n" + ) + if lmods > 0: + local_mods_output() + elif action == "test": + retval = submodules_test(gitmodules, root_dir) + else: + utils.fatal_error(f"unrecognized action request {action}") + return retval + + +if __name__ == "__main__": + sys.exit(main()) diff --git a/git_fleximod/gitinterface.py b/git_fleximod/gitinterface.py new file mode 100644 index 0000000000..93ae38ecde --- /dev/null +++ b/git_fleximod/gitinterface.py @@ -0,0 +1,79 @@ +import os +import sys +from . import utils +from pathlib import Path + +class GitInterface: + def __init__(self, repo_path, logger): + logger.debug("Initialize GitInterface for {}".format(repo_path)) + if isinstance(repo_path, str): + self.repo_path = Path(repo_path).resolve() + elif isinstance(repo_path, Path): + self.repo_path = repo_path.resolve() + else: + raise TypeError("repo_path must be a str or Path object") + self.logger = logger + try: + import git + + self._use_module = True + try: + self.repo = git.Repo(str(self.repo_path)) # Initialize GitPython repo + except git.exc.InvalidGitRepositoryError: + self.git = git + self._init_git_repo() + msg = "Using GitPython interface to git" + except ImportError: + self._use_module = False + if not (self.repo_path / ".git").exists(): + self._init_git_repo() + msg = "Using shell interface to git" + self.logger.info(msg) + + def _git_command(self, operation, *args): + self.logger.info(operation) + if self._use_module and operation != "submodule": + try: + return getattr(self.repo.git, operation)(*args) + except Exception as e: + sys.exit(e) + else: + return ["git", "-C", str(self.repo_path), operation] + list(args) + + def _init_git_repo(self): + if self._use_module: + self.repo = self.git.Repo.init(str(self.repo_path)) + else: + command = ("git", "-C", str(self.repo_path), "init") + utils.execute_subprocess(command) + + # pylint: disable=unused-argument + def git_operation(self, operation, *args, **kwargs): + command = self._git_command(operation, *args) + self.logger.info(command) + if isinstance(command, list): + try: + return utils.execute_subprocess(command, output_to_caller=True) + except Exception as e: + sys.exit(e) + else: + return command + + def config_get_value(self, section, name): + if self._use_module: + config = self.repo.config_reader() + return config.get_value(section, name) + else: + cmd = ("git", "-C", str(self.repo_path), "config", "--get", f"{section}.{name}") + output = utils.execute_subprocess(cmd, output_to_caller=True) + return output.strip() + + def config_set_value(self, section, name, value): + if self._use_module: + with self.repo.config_writer() as writer: + writer.set_value(section, name, value) + writer.release() # Ensure changes are saved + else: + cmd = ("git", "-C", str(self.repo_path), "config", f"{section}.{name}", value) + self.logger.info(cmd) + utils.execute_subprocess(cmd, output_to_caller=True) diff --git a/git_fleximod/gitmodules.py b/git_fleximod/gitmodules.py new file mode 100644 index 0000000000..68c82d066f --- /dev/null +++ b/git_fleximod/gitmodules.py @@ -0,0 +1,97 @@ +import shutil +from pathlib import Path +from configparser import RawConfigParser, ConfigParser +from .lstripreader import LstripReader + + +class GitModules(RawConfigParser): + def __init__( + self, + logger, + confpath=Path.cwd(), + conffile=".gitmodules", + includelist=None, + excludelist=None, + ): + """ + confpath: Path to the directory containing the .gitmodules file (defaults to the current working directory). + conffile: Name of the configuration file (defaults to .gitmodules). + includelist: Optional list of submodules to include. + excludelist: Optional list of submodules to exclude. + """ + self.logger = logger + self.logger.debug( + "Creating a GitModules object {} {} {} {}".format( + confpath, conffile, includelist, excludelist + ) + ) + super().__init__() + self.conf_file = (Path(confpath) / Path(conffile)) + if self.conf_file.exists(): + self.read_file(LstripReader(str(self.conf_file)), source=conffile) + self.includelist = includelist + self.excludelist = excludelist + self.isdirty = False + + def reload(self): + self.clear() + if self.conf_file.exists(): + self.read_file(LstripReader(str(self.conf_file)), source=self.conf_file) + + + def set(self, name, option, value): + """ + Sets a configuration value for a specific submodule: + Ensures the appropriate section exists for the submodule. + Calls the parent class's set method to store the value. + """ + self.isdirty = True + self.logger.debug("set called {} {} {}".format(name, option, value)) + section = f'submodule "{name}"' + if not self.has_section(section): + self.add_section(section) + super().set(section, option, str(value)) + + # pylint: disable=redefined-builtin, arguments-differ + def get(self, name, option, raw=False, vars=None, fallback=None): + """ + Retrieves a configuration value for a specific submodule: + Uses the parent class's get method to access the value. + Handles potential errors if the section or option doesn't exist. + """ + self.logger.debug("get called {} {}".format(name, option)) + section = f'submodule "{name}"' + try: + return ConfigParser.get( + self, section, option, raw=raw, vars=vars, fallback=fallback + ) + except ConfigParser.NoOptionError: + return None + + def save(self): + if self.isdirty: + self.logger.info("Writing {}".format(self.conf_file)) + with open(self.conf_file, "w") as fd: + self.write(fd) + self.isdirty = False + + def __del__(self): + self.save() + + def sections(self): + """Strip the submodule part out of section and just use the name""" + self.logger.debug("calling GitModules sections iterator") + names = [] + for section in ConfigParser.sections(self): + name = section[11:-1] + if self.includelist and name not in self.includelist: + continue + if self.excludelist and name in self.excludelist: + continue + names.append(name) + return names + + def items(self, name, raw=False, vars=None): + self.logger.debug("calling GitModules items for {}".format(name)) + section = f'submodule "{name}"' + return ConfigParser.items(section, raw=raw, vars=vars) diff --git a/git_fleximod/lstripreader.py b/git_fleximod/lstripreader.py new file mode 100644 index 0000000000..01d5580ee8 --- /dev/null +++ b/git_fleximod/lstripreader.py @@ -0,0 +1,43 @@ +class LstripReader(object): + "LstripReader formats .gitmodules files to be acceptable for configparser" + + def __init__(self, filename): + with open(filename, "r") as infile: + lines = infile.readlines() + self._lines = list() + self._num_lines = len(lines) + self._index = 0 + for line in lines: + self._lines.append(line.lstrip()) + + def readlines(self): + """Return all the lines from this object's file""" + return self._lines + + def readline(self, size=-1): + """Format and return the next line or raise StopIteration""" + try: + line = self.next() + except StopIteration: + line = "" + + if (size > 0) and (len(line) < size): + return line[0:size] + + return line + + def __iter__(self): + """Begin an iteration""" + self._index = 0 + return self + + def next(self): + """Return the next line or raise StopIteration""" + if self._index >= self._num_lines: + raise StopIteration + + self._index = self._index + 1 + return self._lines[self._index - 1] + + def __next__(self): + return self.next() diff --git a/git_fleximod/metoflexi.py b/git_fleximod/metoflexi.py new file mode 100755 index 0000000000..cc347db2dd --- /dev/null +++ b/git_fleximod/metoflexi.py @@ -0,0 +1,236 @@ +#!/usr/bin/env python +from configparser import ConfigParser +import sys +import shutil +from pathlib import Path +import argparse +import logging +from git_fleximod.gitinterface import GitInterface +from git_fleximod.gitmodules import GitModules +from git_fleximod import utils + +logger = None + +def find_root_dir(filename=".git"): + d = Path.cwd() + root = Path(d.root) + while d != root: + attempt = d / filename + if attempt.is_dir(): + return d + d = d.parent + return None + + +def get_parser(): + description = """ + %(prog)s manages checking out groups of gitsubmodules with addtional support for Earth System Models + """ + parser = argparse.ArgumentParser( + description=description, formatter_class=argparse.RawDescriptionHelpFormatter + ) + + parser.add_argument('-e', '--externals', nargs='?', + default='Externals.cfg', + help='The externals description filename. ' + 'Default: %(default)s.') + + parser.add_argument( + "-C", + "--path", + default=find_root_dir(), + help="Toplevel repository directory. Defaults to top git directory relative to current.", + ) + + parser.add_argument( + "-g", + "--gitmodules", + nargs="?", + default=".gitmodules", + help="The submodule description filename. " "Default: %(default)s.", + ) + parser.add_argument( + "-v", + "--verbose", + action="count", + default=0, + help="Output additional information to " + "the screen and log file. This flag can be " + "used up to two times, increasing the " + "verbosity level each time.", + ) + parser.add_argument( + "-d", + "--debug", + action="store_true", + default=False, + help="DEVELOPER: output additional debugging " + "information to the screen and log file.", + ) + + return parser + +def commandline_arguments(args=None): + parser = get_parser() + + options = parser.parse_args(args) + handlers = [logging.StreamHandler()] + + if options.debug: + try: + open("fleximod.log", "w") + except PermissionError: + sys.exit("ABORT: Could not write file fleximod.log") + level = logging.DEBUG + handlers.append(logging.FileHandler("fleximod.log")) + elif options.verbose: + level = logging.INFO + else: + level = logging.WARNING + # Configure the root logger + logging.basicConfig( + level=level, format="%(name)s - %(levelname)s - %(message)s", handlers=handlers + ) + + return( + options.path, + options.gitmodules, + options.externals + ) + +class ExternalRepoTranslator: + """ + Translates external repositories configured in an INI-style externals file. + """ + + def __init__(self, rootpath, gitmodules, externals): + self.rootpath = rootpath + if gitmodules: + self.gitmodules = GitModules(logger, confpath=rootpath) + self.externals = (rootpath / Path(externals)).resolve() + print(f"Translating {self.externals}") + self.git = GitInterface(rootpath, logger) + +# def __del__(self): +# if (self.rootpath / "save.gitignore"): + + + def translate_single_repo(self, section, tag, url, path, efile, hash_, sparse, protocol): + """ + Translates a single repository based on configuration details. + + Args: + rootpath (str): Root path of the main repository. + gitmodules (str): Path to the .gitmodules file. + tag (str): The tag to use for the external repository. + url (str): The URL of the external repository. + path (str): The relative path within the main repository for the external repository. + efile (str): The external file or file containing submodules. + hash_ (str): The commit hash to checkout (if applicable). + sparse (str): Boolean indicating whether to use sparse checkout (if applicable). + protocol (str): The protocol to use (e.g., 'git', 'http'). + """ + assert protocol != "svn", "SVN protocol is not currently supported" + print(f"Translating repository {section}") + if efile: + file_path = Path(path) / Path(efile) + newroot = (self.rootpath / file_path).parent.resolve() + if not newroot.exists(): + newroot.mkdir(parents=True) + logger.info("Newroot is {}".format(newroot)) + newt = ExternalRepoTranslator(newroot, ".gitmodules", efile) + newt.translate_repo() + if protocol == "externals_only": + if tag: + self.gitmodules.set(section, "fxtag", tag) + if hash_: + self.gitmodules.set(section, "fxtag", hash_) + + self.gitmodules.set(section, "fxDONOTUSEurl", url) + if sparse: + self.gitmodules.set(section, "fxsparse", sparse) + self.gitmodules.set(section, "fxrequired", "ToplevelRequired") + else: + newpath = (self.rootpath / Path(path)) + if newpath.exists(): + shutil.rmtree(newpath) + logger.info("Creating directory {}".format(newpath)) + newpath.mkdir(parents=True) + if tag: + logger.info("cloning {}".format(section)) + try: + self.git.git_operation("clone", "-b", tag, "--depth", "1", url, path) + except: + self.git.git_operation("clone", url, path) + with utils.pushd(newpath): + ngit = GitInterface(newpath, logger) + ngit.git_operation("checkout", tag) + if hash_: + self.git.git_operation("clone", url, path) + git = GitInterface(newpath, logger) + git.git_operation("fetch", "origin") + git.git_operation("checkout", hash_) + if sparse: + print("setting as sparse submodule {}".format(section)) + sparsefile = (newpath / Path(sparse)) + newfile = (newpath / ".git" / "info" / "sparse-checkout") + print(f"sparsefile {sparsefile} newfile {newfile}") + shutil.copy(sparsefile, newfile) + + logger.info("adding submodule {}".format(section)) + self.gitmodules.save() + self.git.git_operation("submodule", "add", "-f", "--name", section, url, path) + self.git.git_operation("submodule","absorbgitdirs") + self.gitmodules.reload() + if tag: + self.gitmodules.set(section, "fxtag", tag) + if hash_: + self.gitmodules.set(section, "fxtag", hash_) + + self.gitmodules.set(section, "fxDONOTUSEurl", url) + if sparse: + self.gitmodules.set(section, "fxsparse", sparse) + self.gitmodules.set(section, "fxrequired", "ToplevelRequired") + + + def translate_repo(self): + """ + Translates external repositories defined within an external file. + + Args: + rootpath (str): Root path of the main repository. + gitmodules (str): Path to the .gitmodules file. + external_file (str): The path to the external file containing repository definitions. + """ + econfig = ConfigParser() + econfig.read((self.rootpath / Path(self.externals))) + + for section in econfig.sections(): + if section == "externals_description": + logger.info("skipping section {}".format(section)) + return + logger.info("Translating section {}".format(section)) + tag = econfig.get(section, "tag", raw=False, fallback=None) + url = econfig.get(section, "repo_url", raw=False, fallback=None) + path = econfig.get(section, "local_path", raw=False, fallback=None) + efile = econfig.get(section, "externals", raw=False, fallback=None) + hash_ = econfig.get(section, "hash", raw=False, fallback=None) + sparse = econfig.get(section, "sparse", raw=False, fallback=None) + protocol = econfig.get(section, "protocol", raw=False, fallback=None) + + self.translate_single_repo(section, tag, url, path, efile, hash_, sparse, protocol) + + + +def _main(): + rootpath, gitmodules, externals = commandline_arguments() + global logger + logger = logging.getLogger(__name__) + with utils.pushd(rootpath): + t = ExternalRepoTranslator(Path(rootpath), gitmodules, externals) + logger.info("Translating {}".format(rootpath)) + t.translate_repo() + + +if __name__ == "__main__": + sys.exit(_main()) diff --git a/git_fleximod/utils.py b/git_fleximod/utils.py new file mode 100644 index 0000000000..7cc1de38cc --- /dev/null +++ b/git_fleximod/utils.py @@ -0,0 +1,365 @@ +#!/usr/bin/env python3 +""" +Common public utilities for manic package + +""" + +import logging +import os +import subprocess +import sys +from threading import Timer +from pathlib import Path + +LOCAL_PATH_INDICATOR = "." +# --------------------------------------------------------------------- +# +# functions to massage text for output and other useful utilities +# +# --------------------------------------------------------------------- +from contextlib import contextmanager + + +@contextmanager +def pushd(new_dir): + """context for chdir. usage: with pushd(new_dir)""" + previous_dir = os.getcwd() + os.chdir(new_dir) + try: + yield + finally: + os.chdir(previous_dir) + + +def log_process_output(output): + """Log each line of process output at debug level so it can be + filtered if necessary. By default, output is a single string, and + logging.debug(output) will only put log info heading on the first + line. This makes it hard to filter with grep. + + """ + output = output.split("\n") + for line in output: + logging.debug(line) + + +def printlog(msg, **kwargs): + """Wrapper script around print to ensure that everything printed to + the screen also gets logged. + + """ + logging.info(msg) + if kwargs: + print(msg, **kwargs) + else: + print(msg) + sys.stdout.flush() + + +def find_upwards(root_dir, filename): + """Find a file in root dir or any of it's parents""" + d = Path(root_dir) + root = Path(d.root) + while d != root: + attempt = d / filename + if attempt.exists(): + return attempt + d = d.parent + return None + + +def last_n_lines(the_string, n_lines, truncation_message=None): + """Returns the last n lines of the given string + + Args: + the_string: str + n_lines: int + truncation_message: str, optional + + Returns a string containing the last n lines of the_string + + If truncation_message is provided, the returned string begins with + the given message if and only if the string is greater than n lines + to begin with. + """ + + lines = the_string.splitlines(True) + if len(lines) <= n_lines: + return_val = the_string + else: + lines_subset = lines[-n_lines:] + str_truncated = "".join(lines_subset) + if truncation_message: + str_truncated = truncation_message + "\n" + str_truncated + return_val = str_truncated + + return return_val + + +def indent_string(the_string, indent_level): + """Indents the given string by a given number of spaces + + Args: + the_string: str + indent_level: int + + Returns a new string that is the same as the_string, except that + each line is indented by 'indent_level' spaces. + + In python3, this can be done with textwrap.indent. + """ + + lines = the_string.splitlines(True) + padding = " " * indent_level + lines_indented = [padding + line for line in lines] + return "".join(lines_indented) + + +# --------------------------------------------------------------------- +# +# error handling +# +# --------------------------------------------------------------------- + + +def fatal_error(message): + """ + Error output function + """ + logging.error(message) + raise RuntimeError("{0}ERROR: {1}".format(os.linesep, message)) + + +# --------------------------------------------------------------------- +# +# Data conversion / manipulation +# +# --------------------------------------------------------------------- +def str_to_bool(bool_str): + """Convert a sting representation of as boolean into a true boolean. + + Conversion should be case insensitive. + """ + value = None + str_lower = bool_str.lower() + if str_lower in ("true", "t"): + value = True + elif str_lower in ("false", "f"): + value = False + if value is None: + msg = ( + 'ERROR: invalid boolean string value "{0}". ' + 'Must be "true" or "false"'.format(bool_str) + ) + fatal_error(msg) + return value + + +REMOTE_PREFIXES = ["http://", "https://", "ssh://", "git@"] + + +def is_remote_url(url): + """check if the user provided a local file path instead of a + remote. If so, it must be expanded to an absolute + path. + + """ + remote_url = False + for prefix in REMOTE_PREFIXES: + if url.startswith(prefix): + remote_url = True + return remote_url + + +def split_remote_url(url): + """check if the user provided a local file path or a + remote. If remote, try to strip off protocol info. + + """ + remote_url = is_remote_url(url) + if not remote_url: + return url + + for prefix in REMOTE_PREFIXES: + url = url.replace(prefix, "") + + if "@" in url: + url = url.split("@")[1] + + if ":" in url: + url = url.split(":")[1] + + return url + + +def expand_local_url(url, field): + """check if the user provided a local file path instead of a + remote. If so, it must be expanded to an absolute + path. + + Note: local paths of LOCAL_PATH_INDICATOR have special meaning and + represent local copy only, don't work with the remotes. + + """ + remote_url = is_remote_url(url) + if not remote_url: + if url.strip() == LOCAL_PATH_INDICATOR: + pass + else: + url = os.path.expandvars(url) + url = os.path.expanduser(url) + if not os.path.isabs(url): + msg = ( + 'WARNING: Externals description for "{0}" contains a ' + "url that is not remote and does not expand to an " + "absolute path. Version control operations may " + "fail.\n\nurl={1}".format(field, url) + ) + printlog(msg) + else: + url = os.path.normpath(url) + return url + + +# --------------------------------------------------------------------- +# +# subprocess +# +# --------------------------------------------------------------------- + +# Give the user a helpful message if we detect that a command seems to +# be hanging. +_HANGING_SEC = 300 + + +def _hanging_msg(working_directory, command): + print( + """ + +Command '{command}' +from directory {working_directory} +has taken {hanging_sec} seconds. It may be hanging. + +The command will continue to run, but you may want to abort +manage_externals with ^C and investigate. A possible cause of hangs is +when svn or git require authentication to access a private +repository. On some systems, svn and git requests for authentication +information will not be displayed to the user. In this case, the program +will appear to hang. Ensure you can run svn and git manually and access +all repositories without entering your authentication information. + +""".format( + command=command, + working_directory=working_directory, + hanging_sec=_HANGING_SEC, + ) + ) + + +def execute_subprocess(commands, status_to_caller=False, output_to_caller=False): + """Wrapper around subprocess.check_output to handle common + exceptions. + + check_output runs a command with arguments and waits + for it to complete. + + check_output raises an exception on a nonzero return code. if + status_to_caller is true, execute_subprocess returns the subprocess + return code, otherwise execute_subprocess treats non-zero return + status as an error and raises an exception. + + """ + cwd = os.getcwd() + msg = "In directory: {0}\nexecute_subprocess running command:".format(cwd) + logging.info(msg) + commands_str = " ".join(str(element) for element in commands) + logging.info(commands_str) + return_to_caller = status_to_caller or output_to_caller + status = -1 + output = "" + hanging_timer = Timer( + _HANGING_SEC, + _hanging_msg, + kwargs={"working_directory": cwd, "command": commands_str}, + ) + hanging_timer.start() + try: + output = subprocess.check_output( + commands, stderr=subprocess.STDOUT, universal_newlines=True + ) + log_process_output(output) + status = 0 + except OSError as error: + msg = failed_command_msg( + "Command execution failed. Does the executable exist?", commands + ) + logging.error(error) + fatal_error(msg) + except ValueError as error: + msg = failed_command_msg( + "DEV_ERROR: Invalid arguments trying to run subprocess", commands + ) + logging.error(error) + fatal_error(msg) + except subprocess.CalledProcessError as error: + # Only report the error if we are NOT returning to the + # caller. If we are returning to the caller, then it may be a + # simple status check. If returning, it is the callers + # responsibility determine if an error occurred and handle it + # appropriately. + if not return_to_caller: + msg_context = ( + "Process did not run successfully; " + "returned status {0}".format(error.returncode) + ) + msg = failed_command_msg(msg_context, commands, output=error.output) + logging.error(error) + logging.error(msg) + log_process_output(error.output) + fatal_error(msg) + status = error.returncode + finally: + hanging_timer.cancel() + + if status_to_caller and output_to_caller: + ret_value = (status, output) + elif status_to_caller: + ret_value = status + elif output_to_caller: + ret_value = output + else: + ret_value = None + + return ret_value + + +def failed_command_msg(msg_context, command, output=None): + """Template for consistent error messages from subprocess calls. + + If 'output' is given, it should provide the output from the failed + command + """ + + if output: + output_truncated = last_n_lines( + output, 20, truncation_message="[... Output truncated for brevity ...]" + ) + errmsg = ( + "Failed with output:\n" + indent_string(output_truncated, 4) + "\nERROR: " + ) + else: + errmsg = "" + + command_str = " ".join(command) + errmsg += """In directory + {cwd} +{context}: + {command} +""".format( + cwd=os.getcwd(), context=msg_context, command=command_str + ) + + if output: + errmsg += "See above for output from failed command.\n" + + return errmsg diff --git a/poetry.lock b/poetry.lock new file mode 100644 index 0000000000..b59ed3942c --- /dev/null +++ b/poetry.lock @@ -0,0 +1,693 @@ +# This file is automatically @generated by Poetry 1.7.1 and should not be changed by hand. + +[[package]] +name = "alabaster" +version = "0.7.13" +description = "A configurable sidebar-enabled Sphinx theme" +optional = false +python-versions = ">=3.6" +files = [ + {file = "alabaster-0.7.13-py3-none-any.whl", hash = "sha256:1ee19aca801bbabb5ba3f5f258e4422dfa86f82f3e9cefb0859b283cdd7f62a3"}, + {file = "alabaster-0.7.13.tar.gz", hash = "sha256:a27a4a084d5e690e16e01e03ad2b2e552c61a65469419b907243193de1a84ae2"}, +] + +[[package]] +name = "babel" +version = "2.14.0" +description = "Internationalization utilities" +optional = false +python-versions = ">=3.7" +files = [ + {file = "Babel-2.14.0-py3-none-any.whl", hash = "sha256:efb1a25b7118e67ce3a259bed20545c29cb68be8ad2c784c83689981b7a57287"}, + {file = "Babel-2.14.0.tar.gz", hash = "sha256:6919867db036398ba21eb5c7a0f6b28ab8cbc3ae7a73a44ebe34ae74a4e7d363"}, +] + +[package.dependencies] +pytz = {version = ">=2015.7", markers = "python_version < \"3.9\""} + +[package.extras] +dev = ["freezegun (>=1.0,<2.0)", "pytest (>=6.0)", "pytest-cov"] + +[[package]] +name = "certifi" +version = "2024.2.2" +description = "Python package for providing Mozilla's CA Bundle." +optional = false +python-versions = ">=3.6" +files = [ + {file = "certifi-2024.2.2-py3-none-any.whl", hash = "sha256:dc383c07b76109f368f6106eee2b593b04a011ea4d55f652c6ca24a754d1cdd1"}, + {file = "certifi-2024.2.2.tar.gz", hash = "sha256:0569859f95fc761b18b45ef421b1290a0f65f147e92a1e5eb3e635f9a5e4e66f"}, +] + +[[package]] +name = "charset-normalizer" +version = "3.3.2" +description = "The Real First Universal Charset Detector. Open, modern and actively maintained alternative to Chardet." +optional = false +python-versions = ">=3.7.0" +files = [ + {file = "charset-normalizer-3.3.2.tar.gz", hash = "sha256:f30c3cb33b24454a82faecaf01b19c18562b1e89558fb6c56de4d9118a032fd5"}, + {file = "charset_normalizer-3.3.2-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:25baf083bf6f6b341f4121c2f3c548875ee6f5339300e08be3f2b2ba1721cdd3"}, + {file = "charset_normalizer-3.3.2-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:06435b539f889b1f6f4ac1758871aae42dc3a8c0e24ac9e60c2384973ad73027"}, + {file = "charset_normalizer-3.3.2-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:9063e24fdb1e498ab71cb7419e24622516c4a04476b17a2dab57e8baa30d6e03"}, + {file = "charset_normalizer-3.3.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6897af51655e3691ff853668779c7bad41579facacf5fd7253b0133308cf000d"}, + {file = "charset_normalizer-3.3.2-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:1d3193f4a680c64b4b6a9115943538edb896edc190f0b222e73761716519268e"}, + {file = "charset_normalizer-3.3.2-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:cd70574b12bb8a4d2aaa0094515df2463cb429d8536cfb6c7ce983246983e5a6"}, + {file = "charset_normalizer-3.3.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8465322196c8b4d7ab6d1e049e4c5cb460d0394da4a27d23cc242fbf0034b6b5"}, + {file = "charset_normalizer-3.3.2-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:a9a8e9031d613fd2009c182b69c7b2c1ef8239a0efb1df3f7c8da66d5dd3d537"}, + {file = "charset_normalizer-3.3.2-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:beb58fe5cdb101e3a055192ac291b7a21e3b7ef4f67fa1d74e331a7f2124341c"}, + {file = "charset_normalizer-3.3.2-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:e06ed3eb3218bc64786f7db41917d4e686cc4856944f53d5bdf83a6884432e12"}, + {file = "charset_normalizer-3.3.2-cp310-cp310-musllinux_1_1_ppc64le.whl", hash = "sha256:2e81c7b9c8979ce92ed306c249d46894776a909505d8f5a4ba55b14206e3222f"}, + {file = "charset_normalizer-3.3.2-cp310-cp310-musllinux_1_1_s390x.whl", hash = "sha256:572c3763a264ba47b3cf708a44ce965d98555f618ca42c926a9c1616d8f34269"}, + {file = "charset_normalizer-3.3.2-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:fd1abc0d89e30cc4e02e4064dc67fcc51bd941eb395c502aac3ec19fab46b519"}, + {file = "charset_normalizer-3.3.2-cp310-cp310-win32.whl", hash = "sha256:3d47fa203a7bd9c5b6cee4736ee84ca03b8ef23193c0d1ca99b5089f72645c73"}, + {file = "charset_normalizer-3.3.2-cp310-cp310-win_amd64.whl", hash = "sha256:10955842570876604d404661fbccbc9c7e684caf432c09c715ec38fbae45ae09"}, + {file = "charset_normalizer-3.3.2-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:802fe99cca7457642125a8a88a084cef28ff0cf9407060f7b93dca5aa25480db"}, + {file = "charset_normalizer-3.3.2-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:573f6eac48f4769d667c4442081b1794f52919e7edada77495aaed9236d13a96"}, + {file = "charset_normalizer-3.3.2-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:549a3a73da901d5bc3ce8d24e0600d1fa85524c10287f6004fbab87672bf3e1e"}, + {file = "charset_normalizer-3.3.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f27273b60488abe721a075bcca6d7f3964f9f6f067c8c4c605743023d7d3944f"}, + {file = "charset_normalizer-3.3.2-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:1ceae2f17a9c33cb48e3263960dc5fc8005351ee19db217e9b1bb15d28c02574"}, + {file = "charset_normalizer-3.3.2-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:65f6f63034100ead094b8744b3b97965785388f308a64cf8d7c34f2f2e5be0c4"}, + {file = "charset_normalizer-3.3.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:753f10e867343b4511128c6ed8c82f7bec3bd026875576dfd88483c5c73b2fd8"}, + {file = "charset_normalizer-3.3.2-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:4a78b2b446bd7c934f5dcedc588903fb2f5eec172f3d29e52a9096a43722adfc"}, + {file = "charset_normalizer-3.3.2-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:e537484df0d8f426ce2afb2d0f8e1c3d0b114b83f8850e5f2fbea0e797bd82ae"}, + {file = "charset_normalizer-3.3.2-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:eb6904c354526e758fda7167b33005998fb68c46fbc10e013ca97f21ca5c8887"}, + {file = "charset_normalizer-3.3.2-cp311-cp311-musllinux_1_1_ppc64le.whl", hash = "sha256:deb6be0ac38ece9ba87dea880e438f25ca3eddfac8b002a2ec3d9183a454e8ae"}, + {file = "charset_normalizer-3.3.2-cp311-cp311-musllinux_1_1_s390x.whl", hash = "sha256:4ab2fe47fae9e0f9dee8c04187ce5d09f48eabe611be8259444906793ab7cbce"}, + {file = "charset_normalizer-3.3.2-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:80402cd6ee291dcb72644d6eac93785fe2c8b9cb30893c1af5b8fdd753b9d40f"}, + {file = "charset_normalizer-3.3.2-cp311-cp311-win32.whl", hash = "sha256:7cd13a2e3ddeed6913a65e66e94b51d80a041145a026c27e6bb76c31a853c6ab"}, + {file = "charset_normalizer-3.3.2-cp311-cp311-win_amd64.whl", hash = "sha256:663946639d296df6a2bb2aa51b60a2454ca1cb29835324c640dafb5ff2131a77"}, + {file = "charset_normalizer-3.3.2-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:0b2b64d2bb6d3fb9112bafa732def486049e63de9618b5843bcdd081d8144cd8"}, + {file = "charset_normalizer-3.3.2-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:ddbb2551d7e0102e7252db79ba445cdab71b26640817ab1e3e3648dad515003b"}, + {file = "charset_normalizer-3.3.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:55086ee1064215781fff39a1af09518bc9255b50d6333f2e4c74ca09fac6a8f6"}, + {file = "charset_normalizer-3.3.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8f4a014bc36d3c57402e2977dada34f9c12300af536839dc38c0beab8878f38a"}, + {file = "charset_normalizer-3.3.2-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:a10af20b82360ab00827f916a6058451b723b4e65030c5a18577c8b2de5b3389"}, + {file = "charset_normalizer-3.3.2-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:8d756e44e94489e49571086ef83b2bb8ce311e730092d2c34ca8f7d925cb20aa"}, + {file = "charset_normalizer-3.3.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:90d558489962fd4918143277a773316e56c72da56ec7aa3dc3dbbe20fdfed15b"}, + {file = "charset_normalizer-3.3.2-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:6ac7ffc7ad6d040517be39eb591cac5ff87416c2537df6ba3cba3bae290c0fed"}, + {file = "charset_normalizer-3.3.2-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:7ed9e526742851e8d5cc9e6cf41427dfc6068d4f5a3bb03659444b4cabf6bc26"}, + {file = "charset_normalizer-3.3.2-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:8bdb58ff7ba23002a4c5808d608e4e6c687175724f54a5dade5fa8c67b604e4d"}, + {file = "charset_normalizer-3.3.2-cp312-cp312-musllinux_1_1_ppc64le.whl", hash = "sha256:6b3251890fff30ee142c44144871185dbe13b11bab478a88887a639655be1068"}, + {file = "charset_normalizer-3.3.2-cp312-cp312-musllinux_1_1_s390x.whl", hash = "sha256:b4a23f61ce87adf89be746c8a8974fe1c823c891d8f86eb218bb957c924bb143"}, + {file = "charset_normalizer-3.3.2-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:efcb3f6676480691518c177e3b465bcddf57cea040302f9f4e6e191af91174d4"}, + {file = "charset_normalizer-3.3.2-cp312-cp312-win32.whl", hash = "sha256:d965bba47ddeec8cd560687584e88cf699fd28f192ceb452d1d7ee807c5597b7"}, + {file = "charset_normalizer-3.3.2-cp312-cp312-win_amd64.whl", hash = "sha256:96b02a3dc4381e5494fad39be677abcb5e6634bf7b4fa83a6dd3112607547001"}, + {file = "charset_normalizer-3.3.2-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:95f2a5796329323b8f0512e09dbb7a1860c46a39da62ecb2324f116fa8fdc85c"}, + {file = "charset_normalizer-3.3.2-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c002b4ffc0be611f0d9da932eb0f704fe2602a9a949d1f738e4c34c75b0863d5"}, + {file = "charset_normalizer-3.3.2-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:a981a536974bbc7a512cf44ed14938cf01030a99e9b3a06dd59578882f06f985"}, + {file = "charset_normalizer-3.3.2-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:3287761bc4ee9e33561a7e058c72ac0938c4f57fe49a09eae428fd88aafe7bb6"}, + {file = "charset_normalizer-3.3.2-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:42cb296636fcc8b0644486d15c12376cb9fa75443e00fb25de0b8602e64c1714"}, + {file = "charset_normalizer-3.3.2-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:0a55554a2fa0d408816b3b5cedf0045f4b8e1a6065aec45849de2d6f3f8e9786"}, + {file = "charset_normalizer-3.3.2-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:c083af607d2515612056a31f0a8d9e0fcb5876b7bfc0abad3ecd275bc4ebc2d5"}, + {file = "charset_normalizer-3.3.2-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:87d1351268731db79e0f8e745d92493ee2841c974128ef629dc518b937d9194c"}, + {file = "charset_normalizer-3.3.2-cp37-cp37m-musllinux_1_1_ppc64le.whl", hash = "sha256:bd8f7df7d12c2db9fab40bdd87a7c09b1530128315d047a086fa3ae3435cb3a8"}, + {file = "charset_normalizer-3.3.2-cp37-cp37m-musllinux_1_1_s390x.whl", hash = "sha256:c180f51afb394e165eafe4ac2936a14bee3eb10debc9d9e4db8958fe36afe711"}, + {file = "charset_normalizer-3.3.2-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:8c622a5fe39a48f78944a87d4fb8a53ee07344641b0562c540d840748571b811"}, + {file = "charset_normalizer-3.3.2-cp37-cp37m-win32.whl", hash = "sha256:db364eca23f876da6f9e16c9da0df51aa4f104a972735574842618b8c6d999d4"}, + {file = "charset_normalizer-3.3.2-cp37-cp37m-win_amd64.whl", hash = "sha256:86216b5cee4b06df986d214f664305142d9c76df9b6512be2738aa72a2048f99"}, + {file = "charset_normalizer-3.3.2-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:6463effa3186ea09411d50efc7d85360b38d5f09b870c48e4600f63af490e56a"}, + {file = "charset_normalizer-3.3.2-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:6c4caeef8fa63d06bd437cd4bdcf3ffefe6738fb1b25951440d80dc7df8c03ac"}, + {file = "charset_normalizer-3.3.2-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:37e55c8e51c236f95b033f6fb391d7d7970ba5fe7ff453dad675e88cf303377a"}, + {file = "charset_normalizer-3.3.2-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:fb69256e180cb6c8a894fee62b3afebae785babc1ee98b81cdf68bbca1987f33"}, + {file = "charset_normalizer-3.3.2-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ae5f4161f18c61806f411a13b0310bea87f987c7d2ecdbdaad0e94eb2e404238"}, + {file = "charset_normalizer-3.3.2-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:b2b0a0c0517616b6869869f8c581d4eb2dd83a4d79e0ebcb7d373ef9956aeb0a"}, + {file = "charset_normalizer-3.3.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:45485e01ff4d3630ec0d9617310448a8702f70e9c01906b0d0118bdf9d124cf2"}, + {file = "charset_normalizer-3.3.2-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:eb00ed941194665c332bf8e078baf037d6c35d7c4f3102ea2d4f16ca94a26dc8"}, + {file = "charset_normalizer-3.3.2-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:2127566c664442652f024c837091890cb1942c30937add288223dc895793f898"}, + {file = "charset_normalizer-3.3.2-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:a50aebfa173e157099939b17f18600f72f84eed3049e743b68ad15bd69b6bf99"}, + {file = "charset_normalizer-3.3.2-cp38-cp38-musllinux_1_1_ppc64le.whl", hash = "sha256:4d0d1650369165a14e14e1e47b372cfcb31d6ab44e6e33cb2d4e57265290044d"}, + {file = "charset_normalizer-3.3.2-cp38-cp38-musllinux_1_1_s390x.whl", hash = "sha256:923c0c831b7cfcb071580d3f46c4baf50f174be571576556269530f4bbd79d04"}, + {file = "charset_normalizer-3.3.2-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:06a81e93cd441c56a9b65d8e1d043daeb97a3d0856d177d5c90ba85acb3db087"}, + {file = "charset_normalizer-3.3.2-cp38-cp38-win32.whl", hash = "sha256:6ef1d82a3af9d3eecdba2321dc1b3c238245d890843e040e41e470ffa64c3e25"}, + {file = "charset_normalizer-3.3.2-cp38-cp38-win_amd64.whl", hash = "sha256:eb8821e09e916165e160797a6c17edda0679379a4be5c716c260e836e122f54b"}, + {file = "charset_normalizer-3.3.2-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:c235ebd9baae02f1b77bcea61bce332cb4331dc3617d254df3323aa01ab47bd4"}, + {file = "charset_normalizer-3.3.2-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:5b4c145409bef602a690e7cfad0a15a55c13320ff7a3ad7ca59c13bb8ba4d45d"}, + {file = "charset_normalizer-3.3.2-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:68d1f8a9e9e37c1223b656399be5d6b448dea850bed7d0f87a8311f1ff3dabb0"}, + {file = "charset_normalizer-3.3.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:22afcb9f253dac0696b5a4be4a1c0f8762f8239e21b99680099abd9b2b1b2269"}, + {file = "charset_normalizer-3.3.2-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:e27ad930a842b4c5eb8ac0016b0a54f5aebbe679340c26101df33424142c143c"}, + {file = "charset_normalizer-3.3.2-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:1f79682fbe303db92bc2b1136016a38a42e835d932bab5b3b1bfcfbf0640e519"}, + {file = "charset_normalizer-3.3.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b261ccdec7821281dade748d088bb6e9b69e6d15b30652b74cbbac25e280b796"}, + {file = "charset_normalizer-3.3.2-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:122c7fa62b130ed55f8f285bfd56d5f4b4a5b503609d181f9ad85e55c89f4185"}, + {file = "charset_normalizer-3.3.2-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:d0eccceffcb53201b5bfebb52600a5fb483a20b61da9dbc885f8b103cbe7598c"}, + {file = "charset_normalizer-3.3.2-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:9f96df6923e21816da7e0ad3fd47dd8f94b2a5ce594e00677c0013018b813458"}, + {file = "charset_normalizer-3.3.2-cp39-cp39-musllinux_1_1_ppc64le.whl", hash = "sha256:7f04c839ed0b6b98b1a7501a002144b76c18fb1c1850c8b98d458ac269e26ed2"}, + {file = "charset_normalizer-3.3.2-cp39-cp39-musllinux_1_1_s390x.whl", hash = "sha256:34d1c8da1e78d2e001f363791c98a272bb734000fcef47a491c1e3b0505657a8"}, + {file = "charset_normalizer-3.3.2-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:ff8fa367d09b717b2a17a052544193ad76cd49979c805768879cb63d9ca50561"}, + {file = "charset_normalizer-3.3.2-cp39-cp39-win32.whl", hash = "sha256:aed38f6e4fb3f5d6bf81bfa990a07806be9d83cf7bacef998ab1a9bd660a581f"}, + {file = "charset_normalizer-3.3.2-cp39-cp39-win_amd64.whl", hash = "sha256:b01b88d45a6fcb69667cd6d2f7a9aeb4bf53760d7fc536bf679ec94fe9f3ff3d"}, + {file = "charset_normalizer-3.3.2-py3-none-any.whl", hash = "sha256:3e4d1f6587322d2788836a99c69062fbb091331ec940e02d12d179c1d53e25fc"}, +] + +[[package]] +name = "colorama" +version = "0.4.6" +description = "Cross-platform colored terminal text." +optional = false +python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7" +files = [ + {file = "colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6"}, + {file = "colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44"}, +] + +[[package]] +name = "docutils" +version = "0.19" +description = "Docutils -- Python Documentation Utilities" +optional = false +python-versions = ">=3.7" +files = [ + {file = "docutils-0.19-py3-none-any.whl", hash = "sha256:5e1de4d849fee02c63b040a4a3fd567f4ab104defd8a5511fbbc24a8a017efbc"}, + {file = "docutils-0.19.tar.gz", hash = "sha256:33995a6753c30b7f577febfc2c50411fec6aac7f7ffeb7c4cfe5991072dcf9e6"}, +] + +[[package]] +name = "exceptiongroup" +version = "1.2.0" +description = "Backport of PEP 654 (exception groups)" +optional = false +python-versions = ">=3.7" +files = [ + {file = "exceptiongroup-1.2.0-py3-none-any.whl", hash = "sha256:4bfd3996ac73b41e9b9628b04e079f193850720ea5945fc96a08633c66912f14"}, + {file = "exceptiongroup-1.2.0.tar.gz", hash = "sha256:91f5c769735f051a4290d52edd0858999b57e5876e9f85937691bd4c9fa3ed68"}, +] + +[package.extras] +test = ["pytest (>=6)"] + +[[package]] +name = "fsspec" +version = "2023.12.2" +description = "File-system specification" +optional = false +python-versions = ">=3.8" +files = [ + {file = "fsspec-2023.12.2-py3-none-any.whl", hash = "sha256:d800d87f72189a745fa3d6b033b9dc4a34ad069f60ca60b943a63599f5501960"}, + {file = "fsspec-2023.12.2.tar.gz", hash = "sha256:8548d39e8810b59c38014934f6b31e57f40c1b20f911f4cc2b85389c7e9bf0cb"}, +] + +[package.extras] +abfs = ["adlfs"] +adl = ["adlfs"] +arrow = ["pyarrow (>=1)"] +dask = ["dask", "distributed"] +devel = ["pytest", "pytest-cov"] +dropbox = ["dropbox", "dropboxdrivefs", "requests"] +full = ["adlfs", "aiohttp (!=4.0.0a0,!=4.0.0a1)", "dask", "distributed", "dropbox", "dropboxdrivefs", "fusepy", "gcsfs", "libarchive-c", "ocifs", "panel", "paramiko", "pyarrow (>=1)", "pygit2", "requests", "s3fs", "smbprotocol", "tqdm"] +fuse = ["fusepy"] +gcs = ["gcsfs"] +git = ["pygit2"] +github = ["requests"] +gs = ["gcsfs"] +gui = ["panel"] +hdfs = ["pyarrow (>=1)"] +http = ["aiohttp (!=4.0.0a0,!=4.0.0a1)", "requests"] +libarchive = ["libarchive-c"] +oci = ["ocifs"] +s3 = ["s3fs"] +sftp = ["paramiko"] +smb = ["smbprotocol"] +ssh = ["paramiko"] +tqdm = ["tqdm"] + +[[package]] +name = "gitdb" +version = "4.0.11" +description = "Git Object Database" +optional = false +python-versions = ">=3.7" +files = [ + {file = "gitdb-4.0.11-py3-none-any.whl", hash = "sha256:81a3407ddd2ee8df444cbacea00e2d038e40150acfa3001696fe0dcf1d3adfa4"}, + {file = "gitdb-4.0.11.tar.gz", hash = "sha256:bf5421126136d6d0af55bc1e7c1af1c397a34f5b7bd79e776cd3e89785c2b04b"}, +] + +[package.dependencies] +smmap = ">=3.0.1,<6" + +[[package]] +name = "gitpython" +version = "3.1.41" +description = "GitPython is a Python library used to interact with Git repositories" +optional = false +python-versions = ">=3.7" +files = [ + {file = "GitPython-3.1.41-py3-none-any.whl", hash = "sha256:c36b6634d069b3f719610175020a9aed919421c87552185b085e04fbbdb10b7c"}, + {file = "GitPython-3.1.41.tar.gz", hash = "sha256:ed66e624884f76df22c8e16066d567aaa5a37d5b5fa19db2c6df6f7156db9048"}, +] + +[package.dependencies] +gitdb = ">=4.0.1,<5" + +[package.extras] +test = ["black", "coverage[toml]", "ddt (>=1.1.1,!=1.4.3)", "mock", "mypy", "pre-commit", "pytest (>=7.3.1)", "pytest-cov", "pytest-instafail", "pytest-mock", "pytest-sugar", "sumtypes"] + +[[package]] +name = "idna" +version = "3.6" +description = "Internationalized Domain Names in Applications (IDNA)" +optional = false +python-versions = ">=3.5" +files = [ + {file = "idna-3.6-py3-none-any.whl", hash = "sha256:c05567e9c24a6b9faaa835c4821bad0590fbb9d5779e7caa6e1cc4978e7eb24f"}, + {file = "idna-3.6.tar.gz", hash = "sha256:9ecdbbd083b06798ae1e86adcbfe8ab1479cf864e4ee30fe4e46a003d12491ca"}, +] + +[[package]] +name = "imagesize" +version = "1.4.1" +description = "Getting image size from png/jpeg/jpeg2000/gif file" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" +files = [ + {file = "imagesize-1.4.1-py2.py3-none-any.whl", hash = "sha256:0d8d18d08f840c19d0ee7ca1fd82490fdc3729b7ac93f49870406ddde8ef8d8b"}, + {file = "imagesize-1.4.1.tar.gz", hash = "sha256:69150444affb9cb0d5cc5a92b3676f0b2fb7cd9ae39e947a5e11a36b4497cd4a"}, +] + +[[package]] +name = "importlib-metadata" +version = "7.0.1" +description = "Read metadata from Python packages" +optional = false +python-versions = ">=3.8" +files = [ + {file = "importlib_metadata-7.0.1-py3-none-any.whl", hash = "sha256:4805911c3a4ec7c3966410053e9ec6a1fecd629117df5adee56dfc9432a1081e"}, + {file = "importlib_metadata-7.0.1.tar.gz", hash = "sha256:f238736bb06590ae52ac1fab06a3a9ef1d8dce2b7a35b5ab329371d6c8f5d2cc"}, +] + +[package.dependencies] +zipp = ">=0.5" + +[package.extras] +docs = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "rst.linker (>=1.9)", "sphinx (<7.2.5)", "sphinx (>=3.5)", "sphinx-lint"] +perf = ["ipython"] +testing = ["flufl.flake8", "importlib-resources (>=1.3)", "packaging", "pyfakefs", "pytest (>=6)", "pytest-black (>=0.3.7)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)", "pytest-mypy (>=0.9.1)", "pytest-perf (>=0.9.2)", "pytest-ruff"] + +[[package]] +name = "iniconfig" +version = "2.0.0" +description = "brain-dead simple config-ini parsing" +optional = false +python-versions = ">=3.7" +files = [ + {file = "iniconfig-2.0.0-py3-none-any.whl", hash = "sha256:b6a85871a79d2e3b22d2d1b94ac2824226a63c6b741c88f7ae975f18b6778374"}, + {file = "iniconfig-2.0.0.tar.gz", hash = "sha256:2d91e135bf72d31a410b17c16da610a82cb55f6b0477d1a902134b24a455b8b3"}, +] + +[[package]] +name = "jinja2" +version = "3.1.3" +description = "A very fast and expressive template engine." +optional = false +python-versions = ">=3.7" +files = [ + {file = "Jinja2-3.1.3-py3-none-any.whl", hash = "sha256:7d6d50dd97d52cbc355597bd845fabfbac3f551e1f99619e39a35ce8c370b5fa"}, + {file = "Jinja2-3.1.3.tar.gz", hash = "sha256:ac8bd6544d4bb2c9792bf3a159e80bba8fda7f07e81bc3aed565432d5925ba90"}, +] + +[package.dependencies] +MarkupSafe = ">=2.0" + +[package.extras] +i18n = ["Babel (>=2.7)"] + +[[package]] +name = "markupsafe" +version = "2.1.5" +description = "Safely add untrusted strings to HTML/XML markup." +optional = false +python-versions = ">=3.7" +files = [ + {file = "MarkupSafe-2.1.5-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:a17a92de5231666cfbe003f0e4b9b3a7ae3afb1ec2845aadc2bacc93ff85febc"}, + {file = "MarkupSafe-2.1.5-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:72b6be590cc35924b02c78ef34b467da4ba07e4e0f0454a2c5907f473fc50ce5"}, + {file = "MarkupSafe-2.1.5-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e61659ba32cf2cf1481e575d0462554625196a1f2fc06a1c777d3f48e8865d46"}, + {file = "MarkupSafe-2.1.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2174c595a0d73a3080ca3257b40096db99799265e1c27cc5a610743acd86d62f"}, + {file = "MarkupSafe-2.1.5-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ae2ad8ae6ebee9d2d94b17fb62763125f3f374c25618198f40cbb8b525411900"}, + {file = "MarkupSafe-2.1.5-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:075202fa5b72c86ad32dc7d0b56024ebdbcf2048c0ba09f1cde31bfdd57bcfff"}, + {file = "MarkupSafe-2.1.5-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:598e3276b64aff0e7b3451b72e94fa3c238d452e7ddcd893c3ab324717456bad"}, + {file = "MarkupSafe-2.1.5-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:fce659a462a1be54d2ffcacea5e3ba2d74daa74f30f5f143fe0c58636e355fdd"}, + {file = "MarkupSafe-2.1.5-cp310-cp310-win32.whl", hash = "sha256:d9fad5155d72433c921b782e58892377c44bd6252b5af2f67f16b194987338a4"}, + {file = "MarkupSafe-2.1.5-cp310-cp310-win_amd64.whl", hash = "sha256:bf50cd79a75d181c9181df03572cdce0fbb75cc353bc350712073108cba98de5"}, + {file = "MarkupSafe-2.1.5-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:629ddd2ca402ae6dbedfceeba9c46d5f7b2a61d9749597d4307f943ef198fc1f"}, + {file = "MarkupSafe-2.1.5-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:5b7b716f97b52c5a14bffdf688f971b2d5ef4029127f1ad7a513973cfd818df2"}, + {file = "MarkupSafe-2.1.5-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6ec585f69cec0aa07d945b20805be741395e28ac1627333b1c5b0105962ffced"}, + {file = "MarkupSafe-2.1.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b91c037585eba9095565a3556f611e3cbfaa42ca1e865f7b8015fe5c7336d5a5"}, + {file = "MarkupSafe-2.1.5-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:7502934a33b54030eaf1194c21c692a534196063db72176b0c4028e140f8f32c"}, + {file = "MarkupSafe-2.1.5-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:0e397ac966fdf721b2c528cf028494e86172b4feba51d65f81ffd65c63798f3f"}, + {file = "MarkupSafe-2.1.5-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:c061bb86a71b42465156a3ee7bd58c8c2ceacdbeb95d05a99893e08b8467359a"}, + {file = "MarkupSafe-2.1.5-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:3a57fdd7ce31c7ff06cdfbf31dafa96cc533c21e443d57f5b1ecc6cdc668ec7f"}, + {file = "MarkupSafe-2.1.5-cp311-cp311-win32.whl", hash = "sha256:397081c1a0bfb5124355710fe79478cdbeb39626492b15d399526ae53422b906"}, + {file = "MarkupSafe-2.1.5-cp311-cp311-win_amd64.whl", hash = "sha256:2b7c57a4dfc4f16f7142221afe5ba4e093e09e728ca65c51f5620c9aaeb9a617"}, + {file = "MarkupSafe-2.1.5-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:8dec4936e9c3100156f8a2dc89c4b88d5c435175ff03413b443469c7c8c5f4d1"}, + {file = "MarkupSafe-2.1.5-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:3c6b973f22eb18a789b1460b4b91bf04ae3f0c4234a0a6aa6b0a92f6f7b951d4"}, + {file = "MarkupSafe-2.1.5-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ac07bad82163452a6884fe8fa0963fb98c2346ba78d779ec06bd7a6262132aee"}, + {file = "MarkupSafe-2.1.5-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f5dfb42c4604dddc8e4305050aa6deb084540643ed5804d7455b5df8fe16f5e5"}, + {file = "MarkupSafe-2.1.5-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ea3d8a3d18833cf4304cd2fc9cbb1efe188ca9b5efef2bdac7adc20594a0e46b"}, + {file = "MarkupSafe-2.1.5-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:d050b3361367a06d752db6ead6e7edeb0009be66bc3bae0ee9d97fb326badc2a"}, + {file = "MarkupSafe-2.1.5-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:bec0a414d016ac1a18862a519e54b2fd0fc8bbfd6890376898a6c0891dd82e9f"}, + {file = "MarkupSafe-2.1.5-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:58c98fee265677f63a4385256a6d7683ab1832f3ddd1e66fe948d5880c21a169"}, + {file = "MarkupSafe-2.1.5-cp312-cp312-win32.whl", hash = "sha256:8590b4ae07a35970728874632fed7bd57b26b0102df2d2b233b6d9d82f6c62ad"}, + {file = "MarkupSafe-2.1.5-cp312-cp312-win_amd64.whl", hash = "sha256:823b65d8706e32ad2df51ed89496147a42a2a6e01c13cfb6ffb8b1e92bc910bb"}, + {file = "MarkupSafe-2.1.5-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:c8b29db45f8fe46ad280a7294f5c3ec36dbac9491f2d1c17345be8e69cc5928f"}, + {file = "MarkupSafe-2.1.5-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ec6a563cff360b50eed26f13adc43e61bc0c04d94b8be985e6fb24b81f6dcfdf"}, + {file = "MarkupSafe-2.1.5-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a549b9c31bec33820e885335b451286e2969a2d9e24879f83fe904a5ce59d70a"}, + {file = "MarkupSafe-2.1.5-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:4f11aa001c540f62c6166c7726f71f7573b52c68c31f014c25cc7901deea0b52"}, + {file = "MarkupSafe-2.1.5-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:7b2e5a267c855eea6b4283940daa6e88a285f5f2a67f2220203786dfa59b37e9"}, + {file = "MarkupSafe-2.1.5-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:2d2d793e36e230fd32babe143b04cec8a8b3eb8a3122d2aceb4a371e6b09b8df"}, + {file = "MarkupSafe-2.1.5-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:ce409136744f6521e39fd8e2a24c53fa18ad67aa5bc7c2cf83645cce5b5c4e50"}, + {file = "MarkupSafe-2.1.5-cp37-cp37m-win32.whl", hash = "sha256:4096e9de5c6fdf43fb4f04c26fb114f61ef0bf2e5604b6ee3019d51b69e8c371"}, + {file = "MarkupSafe-2.1.5-cp37-cp37m-win_amd64.whl", hash = "sha256:4275d846e41ecefa46e2015117a9f491e57a71ddd59bbead77e904dc02b1bed2"}, + {file = "MarkupSafe-2.1.5-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:656f7526c69fac7f600bd1f400991cc282b417d17539a1b228617081106feb4a"}, + {file = "MarkupSafe-2.1.5-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:97cafb1f3cbcd3fd2b6fbfb99ae11cdb14deea0736fc2b0952ee177f2b813a46"}, + {file = "MarkupSafe-2.1.5-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1f3fbcb7ef1f16e48246f704ab79d79da8a46891e2da03f8783a5b6fa41a9532"}, + {file = "MarkupSafe-2.1.5-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:fa9db3f79de01457b03d4f01b34cf91bc0048eb2c3846ff26f66687c2f6d16ab"}, + {file = "MarkupSafe-2.1.5-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ffee1f21e5ef0d712f9033568f8344d5da8cc2869dbd08d87c84656e6a2d2f68"}, + {file = "MarkupSafe-2.1.5-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:5dedb4db619ba5a2787a94d877bc8ffc0566f92a01c0ef214865e54ecc9ee5e0"}, + {file = "MarkupSafe-2.1.5-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:30b600cf0a7ac9234b2638fbc0fb6158ba5bdcdf46aeb631ead21248b9affbc4"}, + {file = "MarkupSafe-2.1.5-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:8dd717634f5a044f860435c1d8c16a270ddf0ef8588d4887037c5028b859b0c3"}, + {file = "MarkupSafe-2.1.5-cp38-cp38-win32.whl", hash = "sha256:daa4ee5a243f0f20d528d939d06670a298dd39b1ad5f8a72a4275124a7819eff"}, + {file = "MarkupSafe-2.1.5-cp38-cp38-win_amd64.whl", hash = "sha256:619bc166c4f2de5caa5a633b8b7326fbe98e0ccbfacabd87268a2b15ff73a029"}, + {file = "MarkupSafe-2.1.5-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:7a68b554d356a91cce1236aa7682dc01df0edba8d043fd1ce607c49dd3c1edcf"}, + {file = "MarkupSafe-2.1.5-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:db0b55e0f3cc0be60c1f19efdde9a637c32740486004f20d1cff53c3c0ece4d2"}, + {file = "MarkupSafe-2.1.5-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3e53af139f8579a6d5f7b76549125f0d94d7e630761a2111bc431fd820e163b8"}, + {file = "MarkupSafe-2.1.5-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:17b950fccb810b3293638215058e432159d2b71005c74371d784862b7e4683f3"}, + {file = "MarkupSafe-2.1.5-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:4c31f53cdae6ecfa91a77820e8b151dba54ab528ba65dfd235c80b086d68a465"}, + {file = "MarkupSafe-2.1.5-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:bff1b4290a66b490a2f4719358c0cdcd9bafb6b8f061e45c7a2460866bf50c2e"}, + {file = "MarkupSafe-2.1.5-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:bc1667f8b83f48511b94671e0e441401371dfd0f0a795c7daa4a3cd1dde55bea"}, + {file = "MarkupSafe-2.1.5-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:5049256f536511ee3f7e1b3f87d1d1209d327e818e6ae1365e8653d7e3abb6a6"}, + {file = "MarkupSafe-2.1.5-cp39-cp39-win32.whl", hash = "sha256:00e046b6dd71aa03a41079792f8473dc494d564611a8f89bbbd7cb93295ebdcf"}, + {file = "MarkupSafe-2.1.5-cp39-cp39-win_amd64.whl", hash = "sha256:fa173ec60341d6bb97a89f5ea19c85c5643c1e7dedebc22f5181eb73573142c5"}, + {file = "MarkupSafe-2.1.5.tar.gz", hash = "sha256:d283d37a890ba4c1ae73ffadf8046435c76e7bc2247bbb63c00bd1a709c6544b"}, +] + +[[package]] +name = "packaging" +version = "23.2" +description = "Core utilities for Python packages" +optional = false +python-versions = ">=3.7" +files = [ + {file = "packaging-23.2-py3-none-any.whl", hash = "sha256:8c491190033a9af7e1d931d0b5dacc2ef47509b34dd0de67ed209b5203fc88c7"}, + {file = "packaging-23.2.tar.gz", hash = "sha256:048fb0e9405036518eaaf48a55953c750c11e1a1b68e0dd1a9d62ed0c092cfc5"}, +] + +[[package]] +name = "pluggy" +version = "1.4.0" +description = "plugin and hook calling mechanisms for python" +optional = false +python-versions = ">=3.8" +files = [ + {file = "pluggy-1.4.0-py3-none-any.whl", hash = "sha256:7db9f7b503d67d1c5b95f59773ebb58a8c1c288129a88665838012cfb07b8981"}, + {file = "pluggy-1.4.0.tar.gz", hash = "sha256:8c85c2876142a764e5b7548e7d9a0e0ddb46f5185161049a79b7e974454223be"}, +] + +[package.extras] +dev = ["pre-commit", "tox"] +testing = ["pytest", "pytest-benchmark"] + +[[package]] +name = "pyfakefs" +version = "5.3.5" +description = "pyfakefs implements a fake file system that mocks the Python file system modules." +optional = false +python-versions = ">=3.7" +files = [ + {file = "pyfakefs-5.3.5-py3-none-any.whl", hash = "sha256:751015c1de94e1390128c82b48cdedc3f088bbdbe4bc713c79d02a27f0f61e69"}, + {file = "pyfakefs-5.3.5.tar.gz", hash = "sha256:7cdc500b35a214cb7a614e1940543acc6650e69a94ac76e30f33c9373bd9cf90"}, +] + +[[package]] +name = "pygments" +version = "2.17.2" +description = "Pygments is a syntax highlighting package written in Python." +optional = false +python-versions = ">=3.7" +files = [ + {file = "pygments-2.17.2-py3-none-any.whl", hash = "sha256:b27c2826c47d0f3219f29554824c30c5e8945175d888647acd804ddd04af846c"}, + {file = "pygments-2.17.2.tar.gz", hash = "sha256:da46cec9fd2de5be3a8a784f434e4c4ab670b4ff54d605c4c2717e9d49c4c367"}, +] + +[package.extras] +plugins = ["importlib-metadata"] +windows-terminal = ["colorama (>=0.4.6)"] + +[[package]] +name = "pytest" +version = "8.0.0" +description = "pytest: simple powerful testing with Python" +optional = false +python-versions = ">=3.8" +files = [ + {file = "pytest-8.0.0-py3-none-any.whl", hash = "sha256:50fb9cbe836c3f20f0dfa99c565201fb75dc54c8d76373cd1bde06b06657bdb6"}, + {file = "pytest-8.0.0.tar.gz", hash = "sha256:249b1b0864530ba251b7438274c4d251c58d868edaaec8762893ad4a0d71c36c"}, +] + +[package.dependencies] +colorama = {version = "*", markers = "sys_platform == \"win32\""} +exceptiongroup = {version = ">=1.0.0rc8", markers = "python_version < \"3.11\""} +iniconfig = "*" +packaging = "*" +pluggy = ">=1.3.0,<2.0" +tomli = {version = ">=1.0.0", markers = "python_version < \"3.11\""} + +[package.extras] +testing = ["argcomplete", "attrs (>=19.2.0)", "hypothesis (>=3.56)", "mock", "nose", "pygments (>=2.7.2)", "requests", "setuptools", "xmlschema"] + +[[package]] +name = "pytz" +version = "2024.1" +description = "World timezone definitions, modern and historical" +optional = false +python-versions = "*" +files = [ + {file = "pytz-2024.1-py2.py3-none-any.whl", hash = "sha256:328171f4e3623139da4983451950b28e95ac706e13f3f2630a879749e7a8b319"}, + {file = "pytz-2024.1.tar.gz", hash = "sha256:2a29735ea9c18baf14b448846bde5a48030ed267578472d8955cd0e7443a9812"}, +] + +[[package]] +name = "requests" +version = "2.31.0" +description = "Python HTTP for Humans." +optional = false +python-versions = ">=3.7" +files = [ + {file = "requests-2.31.0-py3-none-any.whl", hash = "sha256:58cd2187c01e70e6e26505bca751777aa9f2ee0b7f4300988b709f44e013003f"}, + {file = "requests-2.31.0.tar.gz", hash = "sha256:942c5a758f98d790eaed1a29cb6eefc7ffb0d1cf7af05c3d2791656dbd6ad1e1"}, +] + +[package.dependencies] +certifi = ">=2017.4.17" +charset-normalizer = ">=2,<4" +idna = ">=2.5,<4" +urllib3 = ">=1.21.1,<3" + +[package.extras] +socks = ["PySocks (>=1.5.6,!=1.5.7)"] +use-chardet-on-py3 = ["chardet (>=3.0.2,<6)"] + +[[package]] +name = "smmap" +version = "5.0.1" +description = "A pure Python implementation of a sliding window memory map manager" +optional = false +python-versions = ">=3.7" +files = [ + {file = "smmap-5.0.1-py3-none-any.whl", hash = "sha256:e6d8668fa5f93e706934a62d7b4db19c8d9eb8cf2adbb75ef1b675aa332b69da"}, + {file = "smmap-5.0.1.tar.gz", hash = "sha256:dceeb6c0028fdb6734471eb07c0cd2aae706ccaecab45965ee83f11c8d3b1f62"}, +] + +[[package]] +name = "snowballstemmer" +version = "2.2.0" +description = "This package provides 29 stemmers for 28 languages generated from Snowball algorithms." +optional = false +python-versions = "*" +files = [ + {file = "snowballstemmer-2.2.0-py2.py3-none-any.whl", hash = "sha256:c8e1716e83cc398ae16824e5572ae04e0d9fc2c6b985fb0f900f5f0c96ecba1a"}, + {file = "snowballstemmer-2.2.0.tar.gz", hash = "sha256:09b16deb8547d3412ad7b590689584cd0fe25ec8db3be37788be3810cbf19cb1"}, +] + +[[package]] +name = "sphinx" +version = "5.3.0" +description = "Python documentation generator" +optional = false +python-versions = ">=3.6" +files = [ + {file = "Sphinx-5.3.0.tar.gz", hash = "sha256:51026de0a9ff9fc13c05d74913ad66047e104f56a129ff73e174eb5c3ee794b5"}, + {file = "sphinx-5.3.0-py3-none-any.whl", hash = "sha256:060ca5c9f7ba57a08a1219e547b269fadf125ae25b06b9fa7f66768efb652d6d"}, +] + +[package.dependencies] +alabaster = ">=0.7,<0.8" +babel = ">=2.9" +colorama = {version = ">=0.4.5", markers = "sys_platform == \"win32\""} +docutils = ">=0.14,<0.20" +imagesize = ">=1.3" +importlib-metadata = {version = ">=4.8", markers = "python_version < \"3.10\""} +Jinja2 = ">=3.0" +packaging = ">=21.0" +Pygments = ">=2.12" +requests = ">=2.5.0" +snowballstemmer = ">=2.0" +sphinxcontrib-applehelp = "*" +sphinxcontrib-devhelp = "*" +sphinxcontrib-htmlhelp = ">=2.0.0" +sphinxcontrib-jsmath = "*" +sphinxcontrib-qthelp = "*" +sphinxcontrib-serializinghtml = ">=1.1.5" + +[package.extras] +docs = ["sphinxcontrib-websupport"] +lint = ["docutils-stubs", "flake8 (>=3.5.0)", "flake8-bugbear", "flake8-comprehensions", "flake8-simplify", "isort", "mypy (>=0.981)", "sphinx-lint", "types-requests", "types-typed-ast"] +test = ["cython", "html5lib", "pytest (>=4.6)", "typed_ast"] + +[[package]] +name = "sphinxcontrib-applehelp" +version = "1.0.4" +description = "sphinxcontrib-applehelp is a Sphinx extension which outputs Apple help books" +optional = false +python-versions = ">=3.8" +files = [ + {file = "sphinxcontrib-applehelp-1.0.4.tar.gz", hash = "sha256:828f867945bbe39817c210a1abfd1bc4895c8b73fcaade56d45357a348a07d7e"}, + {file = "sphinxcontrib_applehelp-1.0.4-py3-none-any.whl", hash = "sha256:29d341f67fb0f6f586b23ad80e072c8e6ad0b48417db2bde114a4c9746feb228"}, +] + +[package.extras] +lint = ["docutils-stubs", "flake8", "mypy"] +test = ["pytest"] + +[[package]] +name = "sphinxcontrib-devhelp" +version = "1.0.2" +description = "sphinxcontrib-devhelp is a sphinx extension which outputs Devhelp document." +optional = false +python-versions = ">=3.5" +files = [ + {file = "sphinxcontrib-devhelp-1.0.2.tar.gz", hash = "sha256:ff7f1afa7b9642e7060379360a67e9c41e8f3121f2ce9164266f61b9f4b338e4"}, + {file = "sphinxcontrib_devhelp-1.0.2-py2.py3-none-any.whl", hash = "sha256:8165223f9a335cc1af7ffe1ed31d2871f325254c0423bc0c4c7cd1c1e4734a2e"}, +] + +[package.extras] +lint = ["docutils-stubs", "flake8", "mypy"] +test = ["pytest"] + +[[package]] +name = "sphinxcontrib-htmlhelp" +version = "2.0.1" +description = "sphinxcontrib-htmlhelp is a sphinx extension which renders HTML help files" +optional = false +python-versions = ">=3.8" +files = [ + {file = "sphinxcontrib-htmlhelp-2.0.1.tar.gz", hash = "sha256:0cbdd302815330058422b98a113195c9249825d681e18f11e8b1f78a2f11efff"}, + {file = "sphinxcontrib_htmlhelp-2.0.1-py3-none-any.whl", hash = "sha256:c38cb46dccf316c79de6e5515e1770414b797162b23cd3d06e67020e1d2a6903"}, +] + +[package.extras] +lint = ["docutils-stubs", "flake8", "mypy"] +test = ["html5lib", "pytest"] + +[[package]] +name = "sphinxcontrib-jsmath" +version = "1.0.1" +description = "A sphinx extension which renders display math in HTML via JavaScript" +optional = false +python-versions = ">=3.5" +files = [ + {file = "sphinxcontrib-jsmath-1.0.1.tar.gz", hash = "sha256:a9925e4a4587247ed2191a22df5f6970656cb8ca2bd6284309578f2153e0c4b8"}, + {file = "sphinxcontrib_jsmath-1.0.1-py2.py3-none-any.whl", hash = "sha256:2ec2eaebfb78f3f2078e73666b1415417a116cc848b72e5172e596c871103178"}, +] + +[package.extras] +test = ["flake8", "mypy", "pytest"] + +[[package]] +name = "sphinxcontrib-qthelp" +version = "1.0.3" +description = "sphinxcontrib-qthelp is a sphinx extension which outputs QtHelp document." +optional = false +python-versions = ">=3.5" +files = [ + {file = "sphinxcontrib-qthelp-1.0.3.tar.gz", hash = "sha256:4c33767ee058b70dba89a6fc5c1892c0d57a54be67ddd3e7875a18d14cba5a72"}, + {file = "sphinxcontrib_qthelp-1.0.3-py2.py3-none-any.whl", hash = "sha256:bd9fc24bcb748a8d51fd4ecaade681350aa63009a347a8c14e637895444dfab6"}, +] + +[package.extras] +lint = ["docutils-stubs", "flake8", "mypy"] +test = ["pytest"] + +[[package]] +name = "sphinxcontrib-serializinghtml" +version = "1.1.5" +description = "sphinxcontrib-serializinghtml is a sphinx extension which outputs \"serialized\" HTML files (json and pickle)." +optional = false +python-versions = ">=3.5" +files = [ + {file = "sphinxcontrib-serializinghtml-1.1.5.tar.gz", hash = "sha256:aa5f6de5dfdf809ef505c4895e51ef5c9eac17d0f287933eb49ec495280b6952"}, + {file = "sphinxcontrib_serializinghtml-1.1.5-py2.py3-none-any.whl", hash = "sha256:352a9a00ae864471d3a7ead8d7d79f5fc0b57e8b3f95e9867eb9eb28999b92fd"}, +] + +[package.extras] +lint = ["docutils-stubs", "flake8", "mypy"] +test = ["pytest"] + +[[package]] +name = "tomli" +version = "2.0.1" +description = "A lil' TOML parser" +optional = false +python-versions = ">=3.7" +files = [ + {file = "tomli-2.0.1-py3-none-any.whl", hash = "sha256:939de3e7a6161af0c887ef91b7d41a53e7c5a1ca976325f429cb46ea9bc30ecc"}, + {file = "tomli-2.0.1.tar.gz", hash = "sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f"}, +] + +[[package]] +name = "urllib3" +version = "2.2.0" +description = "HTTP library with thread-safe connection pooling, file post, and more." +optional = false +python-versions = ">=3.8" +files = [ + {file = "urllib3-2.2.0-py3-none-any.whl", hash = "sha256:ce3711610ddce217e6d113a2732fafad960a03fd0318c91faa79481e35c11224"}, + {file = "urllib3-2.2.0.tar.gz", hash = "sha256:051d961ad0c62a94e50ecf1af379c3aba230c66c710493493560c0c223c49f20"}, +] + +[package.extras] +brotli = ["brotli (>=1.0.9)", "brotlicffi (>=0.8.0)"] +h2 = ["h2 (>=4,<5)"] +socks = ["pysocks (>=1.5.6,!=1.5.7,<2.0)"] +zstd = ["zstandard (>=0.18.0)"] + +[[package]] +name = "wheel" +version = "0.42.0" +description = "A built-package format for Python" +optional = false +python-versions = ">=3.7" +files = [ + {file = "wheel-0.42.0-py3-none-any.whl", hash = "sha256:177f9c9b0d45c47873b619f5b650346d632cdc35fb5e4d25058e09c9e581433d"}, + {file = "wheel-0.42.0.tar.gz", hash = "sha256:c45be39f7882c9d34243236f2d63cbd58039e360f85d0913425fbd7ceea617a8"}, +] + +[package.extras] +test = ["pytest (>=6.0.0)", "setuptools (>=65)"] + +[[package]] +name = "zipp" +version = "3.17.0" +description = "Backport of pathlib-compatible object wrapper for zip files" +optional = false +python-versions = ">=3.8" +files = [ + {file = "zipp-3.17.0-py3-none-any.whl", hash = "sha256:0e923e726174922dce09c53c59ad483ff7bbb8e572e00c7f7c46b88556409f31"}, + {file = "zipp-3.17.0.tar.gz", hash = "sha256:84e64a1c28cf7e91ed2078bb8cc8c259cb19b76942096c8d7b84947690cabaf0"}, +] + +[package.extras] +docs = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "rst.linker (>=1.9)", "sphinx (<7.2.5)", "sphinx (>=3.5)", "sphinx-lint"] +testing = ["big-O", "jaraco.functools", "jaraco.itertools", "more-itertools", "pytest (>=6)", "pytest-black (>=0.3.7)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)", "pytest-ignore-flaky", "pytest-mypy (>=0.9.1)", "pytest-ruff"] + +[metadata] +lock-version = "2.0" +python-versions = "^3.8" +content-hash = "25ee2ae1d74abedde3a6637a60d4a3095ea5cf9731960875741bbc2ba84a475d" diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000000..ac1684ea0f --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,41 @@ +[tool.poetry] +name = "git-fleximod" +version = "0.7.5" +description = "Extended support for git-submodule and git-sparse-checkout" +authors = ["Jim Edwards "] +maintainers = ["Jim Edwards "] +license = "MIT" +readme = "README.md" +homepage = "https://github.com/jedwards4b/git-fleximod" +keywords = ["git", "submodule", "sparse-checkout"] +packages = [ +{ include = "git_fleximod"}, +{ include = "doc"}, +] + +[tool.poetry.scripts] +git-fleximod = "git_fleximod.git_fleximod:main" +me2flexi = "git_fleximod.metoflexi:_main" +fsspec = "fsspec.fuse:main" + +[tool.poetry.dependencies] +python = "^3.8" +GitPython = "^3.1.0" +sphinx = "^5.0.0" +fsspec = "^2023.12.2" +wheel = "^0.42.0" +pytest = "^8.0.0" +pyfakefs = "^5.3.5" + +[tool.poetry.urls] +"Bug Tracker" = "https://github.com/jedwards4b/git-fleximod/issues" + +[tool.pytest.ini_options] +markers = [ + "skip_after_first: only run on first iteration" +] + +[build-system] +requires = ["poetry-core"] +build-backend = "poetry.core.masonry.api" + diff --git a/tbump.toml b/tbump.toml new file mode 100644 index 0000000000..e644fc4d24 --- /dev/null +++ b/tbump.toml @@ -0,0 +1,43 @@ +# Uncomment this if your project is hosted on GitHub: +github_url = "https://github.com/jedwards4b/git-fleximod/" + +[version] +current = "0.7.5" + +# Example of a semver regexp. +# Make sure this matches current_version before +# using tbump +regex = ''' + (?P\d+) + \. + (?P\d+) + \. + (?P\d+) + ''' + +[git] +message_template = "Bump to {new_version}" +tag_template = "v{new_version}" + +# For each file to patch, add a [[file]] config +# section containing the path of the file, relative to the +# tbump.toml location. +[[file]] +src = "git_fleximod/cli.py" + +[[file]] +src = "pyproject.toml" + +# You can specify a list of commands to +# run after the files have been patched +# and before the git commit is made + +# [[before_commit]] +# name = "check changelog" +# cmd = "grep -q {new_version} Changelog.rst" + +# Or run some commands after the git tag and the branch +# have been pushed: +# [[after_push]] +# name = "publish" +# cmd = "./publish.sh" diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 0000000000..4d4c66c78e --- /dev/null +++ b/tests/__init__.py @@ -0,0 +1,3 @@ +import sys, os + +sys.path.append(os.path.join(os.path.dirname(__file__), os.path.pardir, "src")) diff --git a/tests/conftest.py b/tests/conftest.py new file mode 100644 index 0000000000..942a0efb97 --- /dev/null +++ b/tests/conftest.py @@ -0,0 +1,138 @@ +import pytest +from git_fleximod.gitinterface import GitInterface +import os +import subprocess +import logging +from pathlib import Path + +@pytest.fixture(scope='session') +def logger(): + logging.basicConfig( + level=logging.INFO, format="%(name)s - %(levelname)s - %(message)s", handlers=[logging.StreamHandler()] + ) + logger = logging.getLogger(__name__) + return logger + +all_repos=[ + {"subrepo_path": "modules/test", + "submodule_name": "test_submodule", + "status1" : "test_submodule MPIserial_2.5.0-3-gd82ce7c is out of sync with .gitmodules MPIserial_2.4.0", + "status2" : "test_submodule at tag MPIserial_2.4.0", + "status3" : "test_submodule at tag MPIserial_2.4.0", + "status4" : "test_submodule at tag MPIserial_2.4.0", + "gitmodules_content" : """ + [submodule "test_submodule"] + path = modules/test + url = https://github.com/ESMCI/mpi-serial.git + fxtag = MPIserial_2.4.0 + fxDONOTUSEurl = https://github.com/ESMCI/mpi-serial.git + fxrequired = ToplevelRequired +"""}, + {"subrepo_path": "modules/test_optional", + "submodule_name": "test_optional", + "status1" : "test_optional MPIserial_2.5.0-3-gd82ce7c is out of sync with .gitmodules MPIserial_2.4.0", + "status2" : "test_optional at tag MPIserial_2.4.0", + "status3" : "test_optional not checked out, aligned at tag MPIserial_2.4.0", + "status4" : "test_optional at tag MPIserial_2.4.0", + "gitmodules_content": """ + [submodule "test_optional"] + path = modules/test_optional + url = https://github.com/ESMCI/mpi-serial.git + fxtag = MPIserial_2.4.0 + fxDONOTUSEurl = https://github.com/ESMCI/mpi-serial.git + fxrequired = ToplevelOptional +"""}, + {"subrepo_path": "modules/test_alwaysoptional", + "submodule_name": "test_alwaysoptional", + "status1" : "test_alwaysoptional MPIserial_2.3.0 is out of sync with .gitmodules e5cf35c", + "status2" : "test_alwaysoptional at hash e5cf35c", + "status3" : "test_alwaysoptional not checked out, out of sync at tag MPIserial_2.3.0", + "status4" : "test_alwaysoptional at hash e5cf35c", + "gitmodules_content": """ + [submodule "test_alwaysoptional"] + path = modules/test_alwaysoptional + url = https://github.com/ESMCI/mpi-serial.git + fxtag = e5cf35c + fxDONOTUSEurl = https://github.com/ESMCI/mpi-serial.git + fxrequired = AlwaysOptional +"""}, + {"subrepo_path": "modules/test_sparse", + "submodule_name": "test_sparse", + "status1" : "test_sparse at tag MPIserial_2.5.0", + "status2" : "test_sparse at tag MPIserial_2.5.0", + "status3" : "test_sparse at tag MPIserial_2.5.0", + "status4" : "test_sparse at tag MPIserial_2.5.0", + "gitmodules_content": """ + [submodule "test_sparse"] + path = modules/test_sparse + url = https://github.com/ESMCI/mpi-serial.git + fxtag = MPIserial_2.5.0 + fxDONOTUSEurl = https://github.com/ESMCI/mpi-serial.git + fxrequired = AlwaysRequired + fxsparse = ../.sparse_file_list +"""}, +] +@pytest.fixture(params=all_repos) + +def shared_repos(request): + return request.param + +@pytest.fixture +def get_all_repos(): + return all_repos + +def write_sparse_checkout_file(fp): + sparse_content = """m4 +""" + fp.write_text(sparse_content) + +@pytest.fixture +def test_repo(shared_repos, tmp_path, logger): + subrepo_path = shared_repos["subrepo_path"] + submodule_name = shared_repos["submodule_name"] + test_dir = tmp_path / "testrepo" + test_dir.mkdir() + str_path = str(test_dir) + gitp = GitInterface(str_path, logger) + assert test_dir.joinpath(".git").is_dir() + (test_dir / "modules").mkdir() + if "sparse" in submodule_name: + (test_dir / subrepo_path).mkdir() + # Add the sparse checkout file + write_sparse_checkout_file(test_dir / "modules" / ".sparse_file_list") + gitp.git_operation("add","modules/.sparse_file_list") + else: + gitp = GitInterface(str(test_dir), logger) + gitp.git_operation("submodule", "add", "--depth","1","--name", submodule_name, "https://github.com/ESMCI/mpi-serial.git", subrepo_path) + assert test_dir.joinpath(".gitmodules").is_file() + gitp.git_operation("add",subrepo_path) + gitp.git_operation("commit","-a","-m","\"add submod\"") + test_dir2 = tmp_path / "testrepo2" + gitp.git_operation("clone",test_dir,test_dir2) + return test_dir2 + + +@pytest.fixture +def complex_repo(tmp_path, logger): + test_dir = tmp_path / "testcomplex" + test_dir.mkdir() + str_path = str(test_dir) + gitp = GitInterface(str_path, logger) + gitp.git_operation("remote", "add", "origin", "https://github.com/jedwards4b/fleximod-test2") + gitp.git_operation("fetch", "origin", "main") + gitp.git_operation("checkout", "main") + return test_dir + +@pytest.fixture +def git_fleximod(): + def _run_fleximod(path, args, input=None): + cmd = ["git", "fleximod"] + args.split() + result = subprocess.run(cmd, cwd=path, input=input, + stdout=subprocess.PIPE, stderr=subprocess.PIPE, + text=True) + if result.returncode: + print(result.stdout) + print(result.stderr) + return result + return _run_fleximod + diff --git a/tests/test_a_import.py b/tests/test_a_import.py new file mode 100644 index 0000000000..d5ca878de5 --- /dev/null +++ b/tests/test_a_import.py @@ -0,0 +1,8 @@ +# pylint: disable=unused-import +from git_fleximod import cli +from git_fleximod import utils +from git_fleximod.gitinterface import GitInterface +from git_fleximod.gitmodules import GitModules + +def test_import(): + print("here") diff --git a/tests/test_b_update.py b/tests/test_b_update.py new file mode 100644 index 0000000000..159f1cfae0 --- /dev/null +++ b/tests/test_b_update.py @@ -0,0 +1,26 @@ +import pytest +from pathlib import Path + +def test_basic_checkout(git_fleximod, test_repo, shared_repos): + # Prepare a simple .gitmodules + gm = shared_repos['gitmodules_content'] + file_path = (test_repo / ".gitmodules") + repo_name = shared_repos["submodule_name"] + repo_path = shared_repos["subrepo_path"] + + file_path.write_text(gm) + + # Run the command + result = git_fleximod(test_repo, f"update {repo_name}") + + # Assertions + assert result.returncode == 0 + assert Path(test_repo / repo_path).exists() # Did the submodule directory get created? + if "sparse" in repo_name: + assert Path(test_repo / f"{repo_path}/m4").exists() # Did the submodule sparse directory get created? + assert not Path(test_repo / f"{repo_path}/README").exists() # Did only the submodule sparse directory get created? + + status = git_fleximod(test_repo, f"status {repo_name}") + + assert shared_repos["status2"] in status.stdout + diff --git a/tests/test_c_required.py b/tests/test_c_required.py new file mode 100644 index 0000000000..89ab8d294d --- /dev/null +++ b/tests/test_c_required.py @@ -0,0 +1,30 @@ +import pytest +from pathlib import Path + +def test_required(git_fleximod, test_repo, shared_repos): + file_path = (test_repo / ".gitmodules") + gm = shared_repos["gitmodules_content"] + repo_name = shared_repos["submodule_name"] + if file_path.exists(): + with file_path.open("r") as f: + gitmodules_content = f.read() + # add the entry if it does not exist + if repo_name not in gitmodules_content: + file_path.write_text(gitmodules_content+gm) + # or if it is incomplete + elif gm not in gitmodules_content: + file_path.write_text(gm) + else: + file_path.write_text(gm) + result = git_fleximod(test_repo, "update") + assert result.returncode == 0 + status = git_fleximod(test_repo, f"status {repo_name}") + assert shared_repos["status3"] in status.stdout + status = git_fleximod(test_repo, f"update --optional") + assert result.returncode == 0 + status = git_fleximod(test_repo, f"status {repo_name}") + assert shared_repos["status4"] in status.stdout + status = git_fleximod(test_repo, f"update {repo_name}") + assert result.returncode == 0 + status = git_fleximod(test_repo, f"status {repo_name}") + assert shared_repos["status4"] in status.stdout diff --git a/tests/test_d_complex.py b/tests/test_d_complex.py new file mode 100644 index 0000000000..fdce516274 --- /dev/null +++ b/tests/test_d_complex.py @@ -0,0 +1,67 @@ +import pytest +from pathlib import Path +from git_fleximod.gitinterface import GitInterface + +def test_complex_checkout(git_fleximod, complex_repo, logger): + status = git_fleximod(complex_repo, "status") + assert("ToplevelOptional not checked out, aligned at tag v5.3.2" in status.stdout) + assert("ToplevelRequired not checked out, aligned at tag MPIserial_2.5.0" in status.stdout) + assert("AlwaysRequired not checked out, aligned at tag MPIserial_2.4.0" in status.stdout) + assert("Complex not checked out, aligned at tag testtag01" in status.stdout) + assert("AlwaysOptional not checked out, aligned at tag MPIserial_2.3.0" in status.stdout) + + # This should checkout and update test_submodule and complex_sub + result = git_fleximod(complex_repo, "update") + assert result.returncode == 0 + + status = git_fleximod(complex_repo, "status") + assert("ToplevelOptional not checked out, aligned at tag v5.3.2" in status.stdout) + assert("ToplevelRequired at tag MPIserial_2.5.0" in status.stdout) + assert("AlwaysRequired at tag MPIserial_2.4.0" in status.stdout) + assert("Complex at tag testtag01" in status.stdout) + + # now check the complex_sub + root = (complex_repo / "modules" / "complex") + assert(not (root / "libraries" / "gptl" / ".git").exists()) + assert(not (root / "libraries" / "mpi-serial" / ".git").exists()) + assert((root / "modules" / "mpi-serial" / ".git").exists()) + assert(not (root / "modules" / "mpi-serial2" / ".git").exists()) + assert((root / "modules" / "mpi-sparse" / ".git").exists()) + assert((root / "modules" / "mpi-sparse" / "m4").exists()) + assert(not (root / "modules" / "mpi-sparse" / "README").exists()) + + # update a single optional submodule + + result = git_fleximod(complex_repo, "update ToplevelOptional") + assert result.returncode == 0 + + status = git_fleximod(complex_repo, "status") + assert("ToplevelOptional at tag v5.3.2" in status.stdout) + assert("ToplevelRequired at tag MPIserial_2.5.0" in status.stdout) + assert("AlwaysRequired at tag MPIserial_2.4.0" in status.stdout) + assert("Complex at tag testtag01" in status.stdout) + assert("AlwaysOptional not checked out, aligned at tag MPIserial_2.3.0" in status.stdout) + + + # Finally update optional + result = git_fleximod(complex_repo, "update --optional") + assert result.returncode == 0 + + status = git_fleximod(complex_repo, "status") + assert("ToplevelOptional at tag v5.3.2" in status.stdout) + assert("ToplevelRequired at tag MPIserial_2.5.0" in status.stdout) + assert("AlwaysRequired at tag MPIserial_2.4.0" in status.stdout) + assert("Complex at tag testtag01" in status.stdout) + assert("AlwaysOptional at tag MPIserial_2.3.0" in status.stdout) + + # now check the complex_sub + root = (complex_repo / "modules" / "complex" ) + assert(not (root / "libraries" / "gptl" / ".git").exists()) + assert(not (root / "libraries" / "mpi-serial" / ".git").exists()) + assert((root / "modules" / "mpi-serial" / ".git").exists()) + assert((root / "modules" / "mpi-serial2" / ".git").exists()) + assert((root / "modules" / "mpi-sparse" / ".git").exists()) + assert((root / "modules" / "mpi-sparse" / "m4").exists()) + assert(not (root / "modules" / "mpi-sparse" / "README").exists()) + + From c834c30292c96bf27b63a78c0ce01be66c14f64d Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Fri, 31 May 2024 11:28:29 -0600 Subject: [PATCH 0384/1248] Draft of ChangeLog/ChageSum --- doc/ChangeLog | 96 +++++++++++++++++++++++++++++++++++++++++++++++++++ doc/ChangeSum | 1 + 2 files changed, 97 insertions(+) diff --git a/doc/ChangeLog b/doc/ChangeLog index b2f14a2c01..ee2e861be7 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,4 +1,100 @@ =============================================================== +Tag name: ctsm5.2.007 +Originator(s): jedwards4b (Jim Edwards, UCAR/CGD) slevis (Sam Levis, UCAR/CGD) +Date: Fri 31 May 2024 11:24:29 AM MDT +One-line Summary: Rm manage_externals and update documentation accordingly + +Purpose and description of changes +---------------------------------- +#2443 Jim replaced this PR with the next one +#2559 Remove manage externals +#2564 Replace checkout_externals with git-fleximod in documentation + +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_1 + +[ ] clm5_0 + +[ ] ctsm5_0-nwp + +[ ] clm4_5 + + +Bugs fixed +---------- +List of CTSM issues fixed (include CTSM Issue # and description) [one per line]: +Fixes #2537 Remove manage_externals stuff from run_sys_tests +Fixes #2536 Update documentation for git-fleximod +Fixes #2467 Remove references to cheyenne from the testlist + +Notes of particular relevance for users +--------------------------------------- +Caveats for users (e.g., need to interpolate initial conditions): + ./manage_externals/checkout_externals + is replaced with + ./bin/git-fleximod + +Changes to documentation: + Accordingly + +Testing summary: +---------------- + + [PASS means all tests PASS; OK means tests PASS other than expected fails.] + + build-namelist tests (if CLMBuildNamelist.pm has changed): + + derecho - PASS + + python testing (if python code has changed; see instructions in python/README.md; document testing done): + + derecho - PASS + + [If python code has changed and you are NOT running aux_clm (e.g., because the only changes are in python + code) then also run the clm_pymods test suite; this is a small subset of aux_clm that runs the system + tests impacted by python changes. The best way to do this, if you expect no changes from the last tag in + either model output or namelists, is: create sym links pointing to the last tag's baseline directory, + named with the upcoming tag; then run the clm_pymods test suite comparing against these baselines but NOT + doing their own baseline generation. If you are already running the full aux_clm then you do NOT need to + separately run the clm_pymods test suite, and you can remove the following line.] + + clm_pymods test suite on derecho - + + regular tests (aux_clm: https://github.com/ESCOMP/CTSM/wiki/System-Testing-Guide#pre-merge-system-testing): + + derecho ----- OK + izumi ------- OK + + any other testing (give details below): + + ctsm_sci + derecho ---- OK + +Answer changes +-------------- +Changes answers relative to baseline: No + +Other details +------------- +List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): + JIM: What's the answer here? + +Pull Requests that document the changes (include PR ids): + https://github.com/ESCOMP/ctsm/pull/2443 + https://github.com/ESCOMP/ctsm/pull/2559 + https://github.com/ESCOMP/ctsm/pull/2564 + +=============================================================== +=============================================================== Tag name: ctsm5.2.006 Originator(s): slevis (Samuel Levis) Date: Tue 28 May 2024 03:14:18 PM MDT diff --git a/doc/ChangeSum b/doc/ChangeSum index 77bc8a426d..b3f1632571 100644 --- a/doc/ChangeSum +++ b/doc/ChangeSum @@ -1,5 +1,6 @@ Tag Who Date Summary ============================================================================================================================ + ctsm5.2.007 multiple 05/31/2024 Rm manage_externals and update documentation accordingly ctsm5.2.006 slevis 05/28/2024 Update externals to cesm2_3_beta17, remove mct, retire /test/tools ctsm5.2.005 erik 05/13/2024 Fix clm6_0 defaults and CESM testing issues, add tests to detect these problems ctsm5.2.004 multiple 05/09/2024 CTSM5.2 1979 fsurdat and 1979-2026 landuse ne0np4 files + two fixes From 5911cea434581d33f1a4892699f029c32132e63e Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Fri, 31 May 2024 13:13:02 -0600 Subject: [PATCH 0385/1248] Move add_default() of model_year_align_cropcal to be with other year params. --- bld/CLMBuildNamelist.pm | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index fc80379201..bbe83a3dc5 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -4225,13 +4225,16 @@ sub setup_logic_cropcal_streams { $log->fatal_error("If providing any crop calendar input file(s), you must provide stream_meshfile_cropcal" ); } - # Set first and last stream years + # Set stream years add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_year_first_cropcal', 'sim_year'=>$nl_flags->{'sim_year'}, 'sim_year_range'=>$nl_flags->{'sim_year_range'}); add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_year_last_cropcal', 'sim_year'=>$nl_flags->{'sim_year'}, 'sim_year_range'=>$nl_flags->{'sim_year_range'}); + add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'model_year_align_cropcal', + 'sim_year'=>$nl_flags->{'sim_year'}, + 'sim_year_range'=>$nl_flags->{'sim_year_range'}); # Check/set things if first and last years are different if ( $nl->get_value('stream_year_first_cropcal') != @@ -4242,11 +4245,6 @@ sub setup_logic_cropcal_streams { if ( !&string_is_undef_or_empty($gdd20_baseline_file) ) { $log->fatal_error("If cropcals_rx_adapt is true (i.e., stream_fldFileName_gdd20_baseline is provided), no crop calendar input is allowed to vary over time (i.e., stream_year_first_cropcal and stream_year_last_cropcal must be the same)." ); } - - # Set align year - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, - 'model_year_align_cropcal', 'sim_year'=>$nl_flags->{'sim_year'}, - 'sim_year_range'=>$nl_flags->{'sim_year_range'}); } } From d89cb9d4bc3cd8ab5761d23cf398b9b682a047fa Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Fri, 31 May 2024 13:38:31 -0600 Subject: [PATCH 0386/1248] Split streams year params for swindows vs maturity reqts. --- bld/CLMBuildNamelist.pm | 29 +++++---- bld/namelist_files/namelist_defaults_ctsm.xml | 9 ++- .../namelist_definition_ctsm.xml | 27 ++++++-- cime_config/SystemTests/rxcropmaturity.py | 6 +- .../clm/sowingWindows/user_nl_clm | 4 +- .../Running-with-custom-crop-calendars.rst | 10 +-- src/cpl/share_esmf/cropcalStreamMod.F90 | 63 ++++++++++++------- 7 files changed, 93 insertions(+), 55 deletions(-) diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index bbe83a3dc5..26725b7d96 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -4226,25 +4226,30 @@ sub setup_logic_cropcal_streams { } # Set stream years - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_year_first_cropcal', + add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_year_first_cropcal_swindows', 'sim_year'=>$nl_flags->{'sim_year'}, 'sim_year_range'=>$nl_flags->{'sim_year_range'}); - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_year_last_cropcal', + add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_year_last_cropcal_swindows', 'sim_year'=>$nl_flags->{'sim_year'}, 'sim_year_range'=>$nl_flags->{'sim_year_range'}); - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'model_year_align_cropcal', + add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'model_year_align_cropcal_swindows', + 'sim_year'=>$nl_flags->{'sim_year'}, + 'sim_year_range'=>$nl_flags->{'sim_year_range'}); + add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_year_first_cropcal_cultivar_gdds', + 'sim_year'=>$nl_flags->{'sim_year'}, + 'sim_year_range'=>$nl_flags->{'sim_year_range'}); + add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_year_last_cropcal_cultivar_gdds', + 'sim_year'=>$nl_flags->{'sim_year'}, + 'sim_year_range'=>$nl_flags->{'sim_year_range'}); + add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'model_year_align_cropcal_cultivar_gdds', 'sim_year'=>$nl_flags->{'sim_year'}, 'sim_year_range'=>$nl_flags->{'sim_year_range'}); - # Check/set things if first and last years are different - if ( $nl->get_value('stream_year_first_cropcal') != - $nl->get_value('stream_year_last_cropcal') ) { - - # Do not allow maturity requirements to change over time if stream_fldFileName_gdd20_baseline is provided. That would be nonsensical. - # Note that this restricts sowing windows from changing over time as well, because there are not separate stream_year settings for that. - if ( !&string_is_undef_or_empty($gdd20_baseline_file) ) { - $log->fatal_error("If cropcals_rx_adapt is true (i.e., stream_fldFileName_gdd20_baseline is provided), no crop calendar input is allowed to vary over time (i.e., stream_year_first_cropcal and stream_year_last_cropcal must be the same)." ); - } + # Do not allow maturity requirements to change over time if stream_fldFileName_gdd20_baseline is provided. That would be nonsensical. + if ( $nl->get_value('stream_year_first_cropcal_cultivar_gdds') != + $nl->get_value('stream_year_last_cropcal_cultivar_gdds') + and !&string_is_undef_or_empty($gdd20_baseline_file) ) { + $log->fatal_error("If cropcals_rx_adapt is true (i.e., stream_fldFileName_gdd20_baseline is provided), baseline maturity requirements are allowed to vary over time (i.e., stream_year_first_cropcal_cultivar_gdds and stream_year_last_cropcal_cultivar_gdds must be the same)." ); } } diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index 85f37a22fd..da0a523adc 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -1689,9 +1689,12 @@ lnd/clm2/surfdata_esmf/NEON/surfdata_1x1_NEON_TOOL_hist_78pfts_CMIP6_simyr2000_c .false. .false. -2000 -2000 -2000 +2000 +2000 +2000 +2000 +2000 +2000 lnd/clm2/cropdata/calendars/processed/swindow_starts_ggcmi_crop_calendar_phase3_v1.01.2000-2000.20231005_145103.nc diff --git a/bld/namelist_files/namelist_definition_ctsm.xml b/bld/namelist_files/namelist_definition_ctsm.xml index f37ada6847..50e645519c 100644 --- a/bld/namelist_files/namelist_definition_ctsm.xml +++ b/bld/namelist_files/namelist_definition_ctsm.xml @@ -1783,19 +1783,34 @@ Flag to enable prescribed crop calendars (sowing window dates and maturity requi Flag to enable prescribed crop calendars (sowing window dates and maturity requirement), with maturity requirement adaptive based on recent climate - -First year to loop over for crop calendar data (not including gdd20_baseline file) +First year to loop over for crop sowing windows - -Last year to loop over for crop calendar data (not including gdd20_baseline file) +Last year to loop over for crop sowing windows - -Simulation year that aligns with stream_year_first_cropcal value +Simulation year that aligns with stream_year_first_cropcal_swindows value + + + +First year to loop over for crop maturity requirements + + + +Last year to loop over for crop maturity requirements + + + +Simulation year that aligns with stream_year_first_cropcal_cultivar_gdds value Date: Fri, 31 May 2024 13:54:53 -0600 Subject: [PATCH 0387/1248] Replace manage_externals with git-fleximod in an error message --- .lib/git-fleximod/git_fleximod/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.lib/git-fleximod/git_fleximod/utils.py b/.lib/git-fleximod/git_fleximod/utils.py index 7cc1de38cc..64a2e70d98 100644 --- a/.lib/git-fleximod/git_fleximod/utils.py +++ b/.lib/git-fleximod/git_fleximod/utils.py @@ -241,7 +241,7 @@ def _hanging_msg(working_directory, command): has taken {hanging_sec} seconds. It may be hanging. The command will continue to run, but you may want to abort -manage_externals with ^C and investigate. A possible cause of hangs is +git-fleximod with ^C and investigate. A possible cause of hangs is when svn or git require authentication to access a private repository. On some systems, svn and git requests for authentication information will not be displayed to the user. In this case, the program From eb27a2d79fd7d9d935b1ed9afc100fd5cefe1039 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Fri, 31 May 2024 13:55:29 -0600 Subject: [PATCH 0388/1248] Explain hard-coding of 2000 when reading GDD20 baseline file. --- src/cpl/share_esmf/cropcalStreamMod.F90 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/cpl/share_esmf/cropcalStreamMod.F90 b/src/cpl/share_esmf/cropcalStreamMod.F90 index 8f444a0479..413ddbefce 100644 --- a/src/cpl/share_esmf/cropcalStreamMod.F90 +++ b/src/cpl/share_esmf/cropcalStreamMod.F90 @@ -274,8 +274,9 @@ subroutine cropcal_init(bounds) end if ! Initialize the cdeps data type sdat_cropcal_gdd20_baseline - ! NOTE: stream_dtlimit 1.5 didn't work for some reason - !TODO SSR: Do not allow time axis length > 1 + ! NOTE: Hard-coded to one particular year because it should NOT vary over time. Note that the + ! particular year chosen doesn't matter. Users can base their file on whatever baseline they + ! want; they just need to put 2000 on the time axis. if (adapt_cropcal_rx_cultivar_gdds) then call shr_strdata_init_from_inline(sdat_cropcal_gdd20_baseline, & my_task = iam, & From c9020ec5320013121b84e4abc03bc0cf5bab2133 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Fri, 31 May 2024 13:57:53 -0600 Subject: [PATCH 0389/1248] Replace "externals directories" with "git submodules" in ChangeLogs --- doc/.ChangeLog_template | 2 +- doc/ChangeLog | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/doc/.ChangeLog_template b/doc/.ChangeLog_template index f6a6dbd2f8..60a7f49288 100644 --- a/doc/.ChangeLog_template +++ b/doc/.ChangeLog_template @@ -157,7 +157,7 @@ Other details ------------- [Remove any lines that don't apply. Remove entire section if nothing applies.] -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): +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) diff --git a/doc/ChangeLog b/doc/ChangeLog index ee2e861be7..8b6bb8f0d2 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,7 +1,7 @@ =============================================================== Tag name: ctsm5.2.007 Originator(s): jedwards4b (Jim Edwards, UCAR/CGD) slevis (Sam Levis, UCAR/CGD) -Date: Fri 31 May 2024 11:24:29 AM MDT +Date: Fri 31 May 2024 13:49:29 AM MDT One-line Summary: Rm manage_externals and update documentation accordingly Purpose and description of changes @@ -85,8 +85,11 @@ Changes answers relative to baseline: No Other details ------------- -List any externals directories updated (cime, rtm, mosart, cism, fates, etc.): - JIM: What's the answer here? +List any git submodules updated (cime, rtm, mosart, cism, fates, etc.): + Comparing .gitmodules against Externals.cfg and Externals_CLM_cfg: + - cismwrap_2_2_001 from cismwrap_2_1_100 + - cime6.0.246 from cime6.0.238_httpsbranch01 + - cdeps1.0.34 from cdeps1.0.33 Pull Requests that document the changes (include PR ids): https://github.com/ESCOMP/ctsm/pull/2443 From 34f2dd45ea32ea9e4a8d4e2c7d81f07806ca1710 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Fri, 31 May 2024 15:16:08 -0600 Subject: [PATCH 0390/1248] Make dns_aer a global constant --- src/biogeochem/DustEmisZender2003.F90 | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/biogeochem/DustEmisZender2003.F90 b/src/biogeochem/DustEmisZender2003.F90 index 22bbbe0742..d17ebc8f1c 100644 --- a/src/biogeochem/DustEmisZender2003.F90 +++ b/src/biogeochem/DustEmisZender2003.F90 @@ -43,7 +43,7 @@ module DustEmisZender2003 real(r8) , allocatable :: dmt_vwr(:) ![m] Mass-weighted mean diameter resolved real(r8) , allocatable :: stk_crc(:) ![frc] Correction to Stokes settling velocity real(r8) tmp1 !Factor in saltation computation (named as in Charlie's code) - real(r8) dns_aer ![kg m-3] Aerosol density + real(r8), parameter :: dns_aer = 2.5e+3_r8 ![kg m-3] Aerosol density ! ! !PUBLIC DATA TYPES: ! @@ -880,7 +880,6 @@ subroutine InitDustVars(this, bounds) gsd_anl = 2.0_r8 ! [frc] Geometric std dev PaG77 p. 2080 Table1 ln_gsd = log(gsd_anl) - dns_aer = 2.5e+3_r8 ! [kg m-3] Aerosol density ! Set a fundamental statistic for each bin From 75d7df65dc721083f19a92e801f883c6e4b5d8cb Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Fri, 31 May 2024 15:07:12 -0600 Subject: [PATCH 0391/1248] Functionize UpdateAccVars_CropGDDs(). --- src/biogeophys/TemperatureType.F90 | 121 ++++++++++++++++------------- 1 file changed, 69 insertions(+), 52 deletions(-) diff --git a/src/biogeophys/TemperatureType.F90 b/src/biogeophys/TemperatureType.F90 index ab310650c8..1b28b2e1aa 100644 --- a/src/biogeophys/TemperatureType.F90 +++ b/src/biogeophys/TemperatureType.F90 @@ -129,6 +129,7 @@ module TemperatureType procedure, public :: InitAccBuffer procedure, public :: InitAccVars procedure, public :: UpdateAccVars + procedure, private :: UpdateAccVars_CropGDDs end type temperature_type @@ -1357,6 +1358,71 @@ subroutine InitAccVars(this, bounds) end subroutine InitAccVars + subroutine UpdateAccVars_CropGDDs(this, rbufslp, begp, endp, month, day, secs, dtime, nstep, basetemp_int, gddx_patch) + ! + ! USES + use shr_const_mod , only : SHR_CONST_CDAY, SHR_CONST_TKFRZ + use accumulMod , only : update_accum_field, extract_accum_field, accumResetVal + ! + ! !ARGUMENTS + class(temperature_type) :: this + real(r8), intent(inout), pointer, dimension(:) :: rbufslp ! temporary single level - pft level + integer, intent(in) :: begp, endp + integer, intent(in) :: month, day, secs, dtime, nstep + integer, intent(in) :: basetemp_int ! Crop base temperature. Integer to avoid possible float weirdness + real(r8), intent(inout), pointer, dimension(:) :: gddx_patch ! E.g., gdd0_patch + ! + ! !LOCAL VARIABLES + real(r8) :: basetemp_r8 ! real(r8) version of basetemp for arithmetic + real(r8) :: max_accum ! Maximum daily accumulation + character(8) :: field_name ! E.g., GDD0 + character(32) :: format_string + integer :: p, g + + basetemp_r8 = real(basetemp_int, r8) + + ! Get maximum daily accumulation + if (basetemp_int == 0) then + ! SSR 2024-05-31: I'm not sure why this was different for base temp 0, but I'm keeping it as I refactor into UpdateAccVars_CropGDDs() + max_accum = 26._r8 + else + max_accum = 30._r8 + end if + + do p = begp,endp + + ! Avoid unnecessary calculations over inactive points + if (.not. patch%active(p)) then + cycle + end if + + g = patch%gridcell(p) + if (month==1 .and. day==1 .and. secs==dtime) then + rbufslp(p) = accumResetVal ! reset gdd + else if (( month > 3 .and. month < 10 .and. grc%latdeg(g) >= 0._r8) .or. & + ((month > 9 .or. month < 4) .and. grc%latdeg(g) < 0._r8) ) then + rbufslp(p) = max(0._r8, min(max_accum, & + this%t_ref2m_patch(p)-(SHR_CONST_TKFRZ + basetemp_r8))) * dtime/SHR_CONST_CDAY + else + rbufslp(p) = 0._r8 ! keeps gdd unchanged at other times (eg, through Dec in NH) + end if + end do + + ! Get field name + if (basetemp_int < 10) then + format_string = "(A3,I1)" + else if (basetemp_int < 100) then + format_string = "(A3,I2)" + else + format_string = "(A3,I3)" + end if + write(field_name, format_string) "GDD",basetemp_int + + ! Save + call update_accum_field (trim(field_name), rbufslp, nstep) + call extract_accum_field (trim(field_name), gddx_patch, nstep) + end subroutine UpdateAccVars_CropGDDs + !----------------------------------------------------------------------- subroutine UpdateAccVars (this, bounds) ! @@ -1538,63 +1604,14 @@ subroutine UpdateAccVars (this, bounds) ! Accumulate and extract GDD0 - - do p = begp,endp - ! Avoid unnecessary calculations over inactive points - if (patch%active(p)) then - g = patch%gridcell(p) - if (month==1 .and. day==1 .and. secs==dtime) then - rbufslp(p) = accumResetVal ! reset gdd - else if (( month > 3 .and. month < 10 .and. grc%latdeg(g) >= 0._r8) .or. & - ((month > 9 .or. month < 4) .and. grc%latdeg(g) < 0._r8) ) then - rbufslp(p) = max(0._r8, min(26._r8, this%t_ref2m_patch(p)-SHR_CONST_TKFRZ)) * dtime/SHR_CONST_CDAY - else - rbufslp(p) = 0._r8 ! keeps gdd unchanged at other times (eg, through Dec in NH) - end if - end if - end do - call update_accum_field ('GDD0', rbufslp, nstep) - call extract_accum_field ('GDD0', this%gdd0_patch, nstep) + call this%UpdateAccVars_CropGDDs(rbufslp, begp, endp, month, day, secs, dtime, nstep, 0, this%gdd0_patch) ! Accumulate and extract GDD8 - - do p = begp,endp - ! Avoid unnecessary calculations over inactive points - if (patch%active(p)) then - g = patch%gridcell(p) - if (month==1 .and. day==1 .and. secs==dtime) then - rbufslp(p) = accumResetVal ! reset gdd - else if (( month > 3 .and. month < 10 .and. grc%latdeg(g) >= 0._r8) .or. & - ((month > 9 .or. month < 4) .and. grc%latdeg(g) < 0._r8) ) then - rbufslp(p) = max(0._r8, min(30._r8, & - this%t_ref2m_patch(p)-(SHR_CONST_TKFRZ + 8._r8))) * dtime/SHR_CONST_CDAY - else - rbufslp(p) = 0._r8 ! keeps gdd unchanged at other times (eg, through Dec in NH) - end if - end if - end do - call update_accum_field ('GDD8', rbufslp, nstep) - call extract_accum_field ('GDD8', this%gdd8_patch, nstep) + call this%UpdateAccVars_CropGDDs(rbufslp, begp, endp, month, day, secs, dtime, nstep, 8, this%gdd8_patch) ! Accumulate and extract GDD10 + call this%UpdateAccVars_CropGDDs(rbufslp, begp, endp, month, day, secs, dtime, nstep, 10, this%gdd10_patch) - do p = begp,endp - ! Avoid unnecessary calculations over inactive points - if (patch%active(p)) then - g = patch%gridcell(p) - if (month==1 .and. day==1 .and. secs==dtime) then - rbufslp(p) = accumResetVal ! reset gdd - else if (( month > 3 .and. month < 10 .and. grc%latdeg(g) >= 0._r8) .or. & - ((month > 9 .or. month < 4) .and. grc%latdeg(g) < 0._r8) ) then - rbufslp(p) = max(0._r8, min(30._r8, & - this%t_ref2m_patch(p)-(SHR_CONST_TKFRZ + 10._r8))) * dtime/SHR_CONST_CDAY - else - rbufslp(p) = 0._r8 ! keeps gdd unchanged at other times (eg, through Dec in NH) - end if - end if - end do - call update_accum_field ('GDD10', rbufslp, nstep) - call extract_accum_field ('GDD10', this%gdd10_patch, nstep) ! Accumulate and extract running 20-year means if (is_end_curr_year()) then From 45aff290b33baed02b48b089858de6f0f4a89a74 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Fri, 31 May 2024 17:08:01 -0600 Subject: [PATCH 0392/1248] Optionally read/use gdd20 accum seasons from stream files. --- bld/CLMBuildNamelist.pm | 15 ++ bld/namelist_files/namelist_defaults_ctsm.xml | 3 + .../namelist_definition_ctsm.xml | 15 ++ src/biogeochem/CropType.F90 | 4 + src/biogeophys/TemperatureType.F90 | 54 +++-- src/cpl/share_esmf/cropcalStreamMod.F90 | 198 ++++++++++++++++-- src/main/clm_driver.F90 | 2 +- 7 files changed, 265 insertions(+), 26 deletions(-) diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index 26725b7d96..dddd17ced9 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -4175,6 +4175,7 @@ sub setup_logic_cropcal_streams { # Set up other crop calendar parameters add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'cropcals_rx'); add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'cropcals_rx_adapt'); + add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_gdd20_seasons'); add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'generate_crop_gdds'); add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'use_mxmat'); @@ -4185,6 +4186,20 @@ sub setup_logic_cropcal_streams { $log->fatal_error("cropcals_rx and cropcals_rx_adapt may not both be true" ); } + # Add defaults if reading gdd20 seasons from stream files + my $stream_gdd20_seasons = $nl->get_value('stream_gdd20_seasons') ; + my $gdd20_season_start_file = $nl->get_value('stream_fldFileName_gdd20_season_start') ; + my $gdd20_season_end_file = $nl->get_value('stream_fldFileName_gdd20_season_end') ; + if ( &value_is_true($stream_gdd20_seasons)) { + add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_fldFileName_gdd20_season_start'); + add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_fldFileName_gdd20_season_end'); + + # Check + if ( &string_is_undef_or_empty($gdd20_season_start_file) or &string_is_undef_or_empty($gdd20_season_end_file) ) { + $log->fatal_error("If stream_gdd20_seasons is true, gdd20 season start and end files must be provided." ); + } + } + # Add defaults if using prescribed crop calendars 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'); diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index da0a523adc..7e3ddb7c64 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -1689,6 +1689,7 @@ lnd/clm2/surfdata_esmf/NEON/surfdata_1x1_NEON_TOOL_hist_78pfts_CMIP6_simyr2000_c .false. .false. +.false. 2000 2000 2000 @@ -1705,6 +1706,8 @@ lnd/clm2/surfdata_esmf/NEON/surfdata_1x1_NEON_TOOL_hist_78pfts_CMIP6_simyr2000_c lnd/clm2/cropdata/calendars/processed/swindow_ends_ggcmi_crop_calendar_phase3_v1.01.2000-2000.20231005_145103.nc lnd/clm2/cropdata/calendars/processed/gdds_20230829_161011.nc lnd/clm2/testdata/gdd20baseline.tmp_dontupload.nc +lnd/clm2/cropdata/calendars/processed/sdates_ggcmi_crop_calendar_phase3_v1.01_nninterp-hcru_hcru_mt13.2000-2000.20230728_165845.nc +lnd/clm2/cropdata/calendars/processed/hdates_ggcmi_crop_calendar_phase3_v1.01_nninterp-hcru_hcru_mt13.2000-2000.20230728_165845.nc share/meshes/360x720_120830_ESMFmesh_c20210507_cdf5.nc diff --git a/bld/namelist_files/namelist_definition_ctsm.xml b/bld/namelist_files/namelist_definition_ctsm.xml index 50e645519c..036b9aca72 100644 --- a/bld/namelist_files/namelist_definition_ctsm.xml +++ b/bld/namelist_files/namelist_definition_ctsm.xml @@ -1838,6 +1838,21 @@ Filename of input stream data for cultivar growing degree-day targets Filename of input stream data for baseline GDD20 values + +Filename of input stream data for date (day of year) of start of gdd20 accumulation season. + + + +Set this to true to read gdd20 accumulation season start and end dates from stream files, rather than using hard-coded hemisphere-specific "warm seasons." + + + +Filename of input stream data for date (day of year) of end of gdd20 accumulation season. + + Filename of input stream data for crop calendar inputs diff --git a/src/biogeochem/CropType.F90 b/src/biogeochem/CropType.F90 index a7bccf1a73..04806f9349 100644 --- a/src/biogeochem/CropType.F90 +++ b/src/biogeochem/CropType.F90 @@ -53,6 +53,8 @@ module CropType integer , pointer :: rx_swindow_ends_thisyr_patch (:,:) ! all prescribed sowing window end dates for this patch this year (day of year) [patch, mxsowings] real(r8), pointer :: rx_cultivar_gdds_thisyr_patch (:,:) ! all cultivar GDD targets for this patch this year (ddays) [patch, mxsowings] real(r8), pointer :: gdd20_baseline_patch (:) ! GDD20 baseline for this patch (ddays) [patch] + integer , pointer :: gdd20_season_start_patch(:) ! gdd20 season start date for this patch (day of year) [patch] + integer , pointer :: gdd20_season_end_patch (:) ! gdd20 season end date for this patch (day of year) [patch] real(r8), pointer :: sdates_thisyr_patch (:,:) ! all actual sowing dates for this patch this year (day of year) [patch, mxsowings] real(r8), pointer :: swindow_starts_thisyr_patch(:,:) ! all sowing window start dates for this patch this year (day of year) [patch, mxsowings] real(r8), pointer :: swindow_ends_thisyr_patch (:,:) ! all sowing window end dates for this patch this year (day of year) [patch, mxsowings] @@ -237,6 +239,8 @@ subroutine InitAllocate(this, bounds) allocate(this%rx_swindow_ends_thisyr_patch(begp:endp,1:mxsowings)) ; this%rx_swindow_ends_thisyr_patch (:,:) = -1 allocate(this%rx_cultivar_gdds_thisyr_patch(begp:endp,1:mxsowings)) ; this%rx_cultivar_gdds_thisyr_patch(:,:) = spval allocate(this%gdd20_baseline_patch(begp:endp)) ; this%gdd20_baseline_patch(:) = spval + allocate(this%gdd20_season_start_patch(begp:endp)); this%gdd20_season_start_patch(:) = -1 + allocate(this%gdd20_season_end_patch(begp:endp)) ; this%gdd20_season_end_patch (:) = -1 allocate(this%sdates_thisyr_patch(begp:endp,1:mxsowings)) ; this%sdates_thisyr_patch(:,:) = spval allocate(this%swindow_starts_thisyr_patch(begp:endp,1:mxsowings)) ; this%swindow_starts_thisyr_patch(:,:) = spval allocate(this%swindow_ends_thisyr_patch (begp:endp,1:mxsowings)) ; this%swindow_ends_thisyr_patch (:,:) = spval diff --git a/src/biogeophys/TemperatureType.F90 b/src/biogeophys/TemperatureType.F90 index 1b28b2e1aa..31fba16274 100644 --- a/src/biogeophys/TemperatureType.F90 +++ b/src/biogeophys/TemperatureType.F90 @@ -1358,11 +1358,13 @@ subroutine InitAccVars(this, bounds) end subroutine InitAccVars - subroutine UpdateAccVars_CropGDDs(this, rbufslp, begp, endp, month, day, secs, dtime, nstep, basetemp_int, gddx_patch) + subroutine UpdateAccVars_CropGDDs(this, rbufslp, begp, endp, month, day, secs, dtime, nstep, basetemp_int, gddx_patch, crop_inst) ! ! USES use shr_const_mod , only : SHR_CONST_CDAY, SHR_CONST_TKFRZ use accumulMod , only : update_accum_field, extract_accum_field, accumResetVal + use clm_time_manager , only : is_doy_in_interval + use CropType, only : crop_type ! ! !ARGUMENTS class(temperature_type) :: this @@ -1371,13 +1373,22 @@ subroutine UpdateAccVars_CropGDDs(this, rbufslp, begp, endp, month, day, secs, d integer, intent(in) :: month, day, secs, dtime, nstep integer, intent(in) :: basetemp_int ! Crop base temperature. Integer to avoid possible float weirdness real(r8), intent(inout), pointer, dimension(:) :: gddx_patch ! E.g., gdd0_patch + type(crop_type), intent(inout) :: crop_inst ! ! !LOCAL VARIABLES real(r8) :: basetemp_r8 ! real(r8) version of basetemp for arithmetic real(r8) :: max_accum ! Maximum daily accumulation character(8) :: field_name ! E.g., GDD0 character(32) :: format_string - integer :: p, g + integer :: p + logical :: in_accumulation_season + real(r8) :: lat ! latitude + integer :: gdd20_season_start, gdd20_season_end + + associate( & + gdd20_season_starts => crop_inst%gdd20_season_start_patch, & + gdd20_season_ends => crop_inst%gdd20_season_end_patch & + ) basetemp_r8 = real(basetemp_int, r8) @@ -1396,15 +1407,28 @@ subroutine UpdateAccVars_CropGDDs(this, rbufslp, begp, endp, month, day, secs, d cycle end if - g = patch%gridcell(p) + ! Is this patch in its gdd20 accumulation season? + ! First, check based on latitude. This will be fallback if read-in gdd20 accumulation season is invalid. + lat = grc%latdeg(patch%gridcell(p)) + in_accumulation_season = & + ((month > 3 .and. month < 10) .and. lat >= 0._r8) .or. & + ((month > 9 .or. month < 4) .and. lat < 0._r8) + ! Replace with read-in gdd20 accumulation season, if valid + ! (If these aren't being read in or they're invalid, they'll be -1) + gdd20_season_start = crop_inst%gdd20_season_start_patch(p) + gdd20_season_end = crop_inst%gdd20_season_end_patch(p) + if (gdd20_season_start >= 1 .and. gdd20_season_end >= 1) then + in_accumulation_season = is_doy_in_interval( & + gdd20_season_starts(p), gdd20_season_ends(p), day) + end if + if (month==1 .and. day==1 .and. secs==dtime) then rbufslp(p) = accumResetVal ! reset gdd - else if (( month > 3 .and. month < 10 .and. grc%latdeg(g) >= 0._r8) .or. & - ((month > 9 .or. month < 4) .and. grc%latdeg(g) < 0._r8) ) then + else if (in_accumulation_season) then rbufslp(p) = max(0._r8, min(max_accum, & this%t_ref2m_patch(p)-(SHR_CONST_TKFRZ + basetemp_r8))) * dtime/SHR_CONST_CDAY else - rbufslp(p) = 0._r8 ! keeps gdd unchanged at other times (eg, through Dec in NH) + rbufslp(p) = 0._r8 ! keeps gdd unchanged outside accumulation season end if end do @@ -1421,24 +1445,28 @@ subroutine UpdateAccVars_CropGDDs(this, rbufslp, begp, endp, month, day, secs, d ! Save call update_accum_field (trim(field_name), rbufslp, nstep) call extract_accum_field (trim(field_name), gddx_patch, nstep) + + end associate end subroutine UpdateAccVars_CropGDDs !----------------------------------------------------------------------- - subroutine UpdateAccVars (this, bounds) + subroutine UpdateAccVars (this, bounds, crop_inst) ! ! USES - use shr_const_mod , only : SHR_CONST_CDAY, SHR_CONST_TKFRZ + use shr_const_mod , only : SHR_CONST_TKFRZ use clm_time_manager , only : get_step_size, get_nstep, is_end_curr_day, get_curr_date, is_end_curr_year - use accumulMod , only : update_accum_field, extract_accum_field, accumResetVal + use accumulMod , only : update_accum_field, extract_accum_field use CNSharedParamsMod, only : upper_soil_layer + use CropType , only : crop_type ! ! !ARGUMENTS: class(temperature_type) :: this type(bounds_type) , intent(in) :: bounds + type(crop_type), intent(inout) :: crop_inst ! ! !LOCAL VARIABLES: - integer :: m,g,l,c,p ! indices + integer :: m,l,c,p ! indices integer :: ier ! error status integer :: dtime ! timestep size [seconds] integer :: nstep ! timestep number @@ -1604,13 +1632,13 @@ subroutine UpdateAccVars (this, bounds) ! Accumulate and extract GDD0 - call this%UpdateAccVars_CropGDDs(rbufslp, begp, endp, month, day, secs, dtime, nstep, 0, this%gdd0_patch) + call this%UpdateAccVars_CropGDDs(rbufslp, begp, endp, month, day, secs, dtime, nstep, 0, this%gdd0_patch, crop_inst) ! Accumulate and extract GDD8 - call this%UpdateAccVars_CropGDDs(rbufslp, begp, endp, month, day, secs, dtime, nstep, 8, this%gdd8_patch) + call this%UpdateAccVars_CropGDDs(rbufslp, begp, endp, month, day, secs, dtime, nstep, 8, this%gdd8_patch, crop_inst) ! Accumulate and extract GDD10 - call this%UpdateAccVars_CropGDDs(rbufslp, begp, endp, month, day, secs, dtime, nstep, 10, this%gdd10_patch) + call this%UpdateAccVars_CropGDDs(rbufslp, begp, endp, month, day, secs, dtime, nstep, 10, this%gdd10_patch, crop_inst) ! Accumulate and extract running 20-year means diff --git a/src/cpl/share_esmf/cropcalStreamMod.F90 b/src/cpl/share_esmf/cropcalStreamMod.F90 index 413ddbefce..8196ca1dfb 100644 --- a/src/cpl/share_esmf/cropcalStreamMod.F90 +++ b/src/cpl/share_esmf/cropcalStreamMod.F90 @@ -38,9 +38,12 @@ module cropcalStreamMod type(shr_strdata_type) :: sdat_cropcal_swindow_end ! sowing window end input data stream type(shr_strdata_type) :: sdat_cropcal_cultivar_gdds ! maturity requirement input data stream type(shr_strdata_type) :: sdat_cropcal_gdd20_baseline ! GDD20 baseline input data stream + type(shr_strdata_type) :: sdat_cropcal_gdd20_season_start ! gdd20 season start input data stream + type(shr_strdata_type) :: sdat_cropcal_gdd20_season_end ! gdd20 season end input data stream character(len=CS), allocatable :: stream_varnames_sdate(:) ! used for both start and end dates character(len=CS), allocatable :: stream_varnames_cultivar_gdds(:) character(len=CS), allocatable :: stream_varnames_gdd20_baseline(:) + character(len=CS), allocatable :: stream_varnames_gdd20_season_enddate(:) ! start uses stream_varnames_sdate integer :: ncft ! Number of crop functional types (excl. generic crops) logical :: allow_invalid_swindow_inputs ! Fall back on paramfile sowing windows in cases of invalid values in stream_fldFileName_swindow_start and _end? character(len=CL) :: stream_fldFileName_swindow_start ! sowing window start stream filename to read @@ -49,6 +52,10 @@ module cropcalStreamMod character(len=CL) :: stream_fldFileName_gdd20_baseline ! GDD20 baseline stream filename to read logical :: cropcals_rx ! Used only for setting input files in namelist; does nothing in code, but needs to be here so namelist read doesn't crash logical :: cropcals_rx_adapt ! Used only for setting input files in namelist; does nothing in code, but needs to be here so namelist read doesn't crash + logical :: stream_gdd20_seasons ! Read stream file for GDD20 accumulation seasons, instead of per-hemisphere periods + logical :: allow_invalid_gdd20_season_inputs ! Fall back on hemisphere "warm periods" in cases of invalid values in stream_fldFileName_gdd20_season_start and _end? + character(len=CL) :: stream_fldFileName_gdd20_season_start ! Stream filename to read for start of gdd20 season + character(len=CL) :: stream_fldFileName_gdd20_season_end ! Stream filename to read for end of gdd20 season character(len=*), parameter :: sourcefile = & __FILE__ @@ -105,7 +112,11 @@ subroutine cropcal_init(bounds) stream_fldFileName_gdd20_baseline, & stream_meshfile_cropcal, & cropcals_rx, & - cropcals_rx_adapt + cropcals_rx_adapt, & + stream_gdd20_seasons, & + allow_invalid_gdd20_season_inputs, & + stream_fldFileName_gdd20_season_start, & + stream_fldFileName_gdd20_season_end ! Default values for namelist stream_year_first_cropcal_swindows = 1 ! first year in sowing window streams to use @@ -120,16 +131,22 @@ subroutine cropcal_init(bounds) stream_fldFileName_swindow_end = '' stream_fldFileName_cultivar_gdds = '' stream_fldFileName_gdd20_baseline = '' + stream_gdd20_seasons = .false. + allow_invalid_gdd20_season_inputs = .false. + stream_fldFileName_gdd20_season_start = '' + stream_fldFileName_gdd20_season_end = '' ! Will need modification to work with mxsowings > 1 ncft = mxpft - npcropmin + 1 ! Ignores generic crops allocate(stream_varnames_sdate(ncft)) allocate(stream_varnames_cultivar_gdds(ncft)) allocate(stream_varnames_gdd20_baseline(ncft)) + allocate(stream_varnames_gdd20_season_enddate(ncft)) do n = 1,ncft ivt = npcropmin + n - 1 write(stream_varnames_sdate(n),'(a,i0)') "sdate1_",ivt write(stream_varnames_cultivar_gdds(n),'(a,i0)') "gdd1_",ivt write(stream_varnames_gdd20_baseline(n),'(a,i0)') "gdd20bl_",ivt + write(stream_varnames_gdd20_season_enddate(n),'(a,i0)') "hdate1_",ivt end do ! Read cropcal_streams namelist @@ -158,6 +175,10 @@ subroutine cropcal_init(bounds) call shr_mpi_bcast(stream_fldFileName_cultivar_gdds, mpicom) call shr_mpi_bcast(stream_fldFileName_gdd20_baseline, mpicom) call shr_mpi_bcast(stream_meshfile_cropcal , mpicom) + call shr_mpi_bcast(stream_gdd20_seasons, mpicom) + call shr_mpi_bcast(allow_invalid_gdd20_season_inputs, mpicom) + call shr_mpi_bcast(stream_fldFileName_gdd20_season_start, mpicom) + call shr_mpi_bcast(stream_fldFileName_gdd20_season_end, mpicom) if (masterproc) then write(iulog,*) @@ -174,9 +195,14 @@ subroutine cropcal_init(bounds) write(iulog,'(a,a)' ) ' stream_fldFileName_cultivar_gdds = ',trim(stream_fldFileName_cultivar_gdds) write(iulog,'(a,a)' ) ' stream_fldFileName_gdd20_baseline = ',trim(stream_fldFileName_gdd20_baseline) write(iulog,'(a,a)' ) ' stream_meshfile_cropcal = ',trim(stream_meshfile_cropcal) + write(iulog,'(a,l1)') ' stream_gdd20_seasons = ',stream_gdd20_seasons + write(iulog,'(a,l1)') ' allow_invalid_gdd20_season_inputs = ',allow_invalid_gdd20_season_inputs + write(iulog,'(a,a)' ) ' stream_fldFileName_gdd20_season_start = ',stream_fldFileName_gdd20_season_start + write(iulog,'(a,a)' ) ' stream_fldFileName_gdd20_season_end = ',stream_fldFileName_gdd20_season_end do n = 1,ncft write(iulog,'(a,a)' ) ' stream_varnames_sdate = ',trim(stream_varnames_sdate(n)) write(iulog,'(a,a)' ) ' stream_varnames_cultivar_gdds = ',trim(stream_varnames_cultivar_gdds(n)) + write(iulog,'(a,a)' ) ' stream_varnames_gdd20_season_enddate = ',trim(stream_varnames_gdd20_season_enddate(n)) write(iulog,'(a,a)' ) ' stream_varnames_gdd20_baseline = ',trim(stream_varnames_gdd20_baseline(n)) end do write(iulog,*) @@ -304,6 +330,65 @@ subroutine cropcal_init(bounds) end if end if + if (stream_gdd20_seasons) then + ! Initialize the cdeps data type sdat_cropcal_gdd20_season_start + ! NOTE: Hard-coded to one particular year because it should NOT vary over time. Note that the + ! particular year chosen doesn't matter. + call shr_strdata_init_from_inline(sdat_cropcal_gdd20_season_start, & + my_task = iam, & + logunit = iulog, & + compname = 'LND', & + model_clock = model_clock, & + model_mesh = mesh, & + stream_meshfile = trim(stream_meshfile_cropcal), & + stream_lev_dimname = 'null', & + stream_mapalgo = trim(cropcal_mapalgo), & + stream_filenames = (/trim(stream_fldFileName_gdd20_season_start)/), & + stream_fldlistFile = stream_varnames_sdate, & + stream_fldListModel = stream_varnames_sdate, & + stream_yearFirst = 2000, & + stream_yearLast = 2000, & + stream_yearAlign = 2000, & + stream_offset = cropcal_offset, & + stream_taxmode = 'extend', & + stream_dtlimit = 1.0e30_r8, & + stream_tintalgo = cropcal_tintalgo, & + stream_name = 'gdd20 season start data', & + rc = rc) + if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) then + call ESMF_Finalize(endflag=ESMF_END_ABORT) + end if + + ! Initialize the cdeps data type sdat_cropcal_gdd20_season_end + ! NOTE: Hard-coded to one particular year because it should NOT vary over time. Note that the + ! particular year chosen doesn't matter. + call shr_strdata_init_from_inline(sdat_cropcal_gdd20_season_end, & + my_task = iam, & + logunit = iulog, & + compname = 'LND', & + model_clock = model_clock, & + model_mesh = mesh, & + stream_meshfile = trim(stream_meshfile_cropcal), & + stream_lev_dimname = 'null', & + stream_mapalgo = trim(cropcal_mapalgo), & + stream_filenames = (/trim(stream_fldFileName_gdd20_season_end)/), & + stream_fldlistFile = stream_varnames_gdd20_season_enddate, & + stream_fldListModel = stream_varnames_gdd20_season_enddate, & + stream_yearFirst = 2000, & + stream_yearLast = 2000, & + stream_yearAlign = 2000, & + stream_offset = cropcal_offset, & + stream_taxmode = 'extend', & + stream_dtlimit = 1.0e30_r8, & + stream_tintalgo = cropcal_tintalgo, & + stream_name = 'gdd20 season start data', & + rc = rc) + if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) then + call ESMF_Finalize(endflag=ESMF_END_ABORT) + end if + + end if + end subroutine cropcal_init !================================================================ @@ -347,7 +432,10 @@ subroutine cropcal_advance( bounds ) end if end if - ! GDD20 baseline values do not have an associated time axis and thus will not be advanced here + ! The following should not have an associated time axis and thus will not be advanced here: + ! - GDD20 baseline values + ! - GDD20 season start dates + ! - GDD20 season end dates if ( .not. allocated(g_to_ig) )then allocate (g_to_ig(bounds%begg:bounds%endg) ) @@ -393,15 +481,21 @@ subroutine cropcal_interp(bounds, num_pcropp, filter_pcropp, init, crop_inst) real(r8), pointer :: dataptr1d_swindow_end (:) real(r8), pointer :: dataptr1d_cultivar_gdds(:) real(r8), pointer :: dataptr1d_gdd20_baseline(:) + real(r8), pointer :: dataptr1d_gdd20_season_start(:) + real(r8), pointer :: dataptr1d_gdd20_season_end (:) real(r8), pointer :: dataptr2d_swindow_start(:,:) real(r8), pointer :: dataptr2d_swindow_end (:,:) real(r8), pointer :: dataptr2d_cultivar_gdds(:,:) real(r8), pointer :: dataptr2d_gdd20_baseline(:,:) + real(r8), pointer :: dataptr2d_gdd20_season_start(:,:) + real(r8), pointer :: dataptr2d_gdd20_season_end (:,:) !----------------------------------------------------------------------- associate( & - starts => crop_inst%rx_swindow_starts_thisyr_patch, & - ends => crop_inst%rx_swindow_ends_thisyr_patch & + swindow_starts => crop_inst%rx_swindow_starts_thisyr_patch, & + swindow_ends => crop_inst%rx_swindow_ends_thisyr_patch, & + gdd20_season_starts => crop_inst%gdd20_season_start_patch, & + gdd20_season_ends => crop_inst%gdd20_season_end_patch & ) SHR_ASSERT_FL( (lbound(g_to_ig,1) <= bounds%begg ), sourcefile, __LINE__) @@ -459,8 +553,8 @@ subroutine cropcal_interp(bounds, num_pcropp, filter_pcropp, init, crop_inst) n = ivt - npcropmin + 1 ! vegetated pft ig = g_to_ig(patch%gridcell(p)) - starts(p,1) = dataptr2d_swindow_start(ig,n) - ends(p,1) = dataptr2d_swindow_end (ig,n) + swindow_starts(p,1) = dataptr2d_swindow_start(ig,n) + swindow_ends(p,1) = dataptr2d_swindow_end (ig,n) else write(iulog,'(a,i0)') 'cropcal_interp(), prescribed sowing windows: Crop patch has ivt ',ivt call ESMF_Finalize(endflag=ESMF_END_ABORT) @@ -469,23 +563,23 @@ subroutine cropcal_interp(bounds, num_pcropp, filter_pcropp, init, crop_inst) ! Ensure that, if mxsowings > 1, sowing windows are ordered such that ENDS are monotonically increasing. This is necessary because of how get_swindow() works. if (mxsowings > 1) then - if (any(ends(begp:endp,2:mxsowings) <= ends(begp:endp,1:mxsowings-1) .and. & - ends(begp:endp,2:mxsowings) >= 1)) then + if (any(swindow_ends(begp:endp,2:mxsowings) <= swindow_ends(begp:endp,1:mxsowings-1) .and. & + swindow_ends(begp:endp,2:mxsowings) >= 1)) then write(iulog, *) 'Sowing window inputs must be ordered such that end dates are monotonically increasing.' call ESMF_Finalize(endflag=ESMF_END_ABORT) end if end if ! Handle invalid sowing window values - if (any(starts(begp:endp,:) < 1 .or. ends(begp:endp,:) < 1)) then + if (any(swindow_starts(begp:endp,:) < 1 .or. swindow_ends(begp:endp,:) < 1)) then ! Fail if not allowing fallback to paramfile sowing windows - if ((.not. allow_invalid_swindow_inputs) .and. any(all(starts(begp:endp,:) < 1, dim=2) .and. patch%wtgcell > 0._r8 .and. patch%itype >= npcropmin)) then + if ((.not. allow_invalid_swindow_inputs) .and. any(all(swindow_starts(begp:endp,:) < 1, dim=2) .and. patch%wtgcell > 0._r8 .and. patch%itype >= npcropmin)) then write(iulog, *) 'At least one crop in one gridcell has invalid prescribed sowing window start date(s). To ignore and fall back to paramfile sowing windows, set allow_invalid_swindow_inputs to .true.' write(iulog, *) 'Affected crops:' do ivt = npcropmin, mxpft do fp = 1, num_pcropp p = filter_pcropp(fp) - if (ivt == patch%itype(p) .and. patch%wtgcell(p) > 0._r8 .and. all(starts(p,:) < 1)) then + if (ivt == patch%itype(p) .and. patch%wtgcell(p) > 0._r8 .and. all(swindow_starts(p,:) < 1)) then write(iulog, *) ' ',pftname(ivt),' (',ivt,')' exit ! Stop looking for patches of this type end if @@ -494,7 +588,7 @@ subroutine cropcal_interp(bounds, num_pcropp, filter_pcropp, init, crop_inst) call ESMF_Finalize(endflag=ESMF_END_ABORT) ! Fail if a sowing window start date is prescribed without an end date (or vice versa) - else if (any((starts(begp:endp,:) >= 1 .and. ends(begp:endp,:) < 1) .or. (starts(begp:endp,:) < 1 .and. ends(begp:endp,:) >= 1))) then + else if (any((swindow_starts(begp:endp,:) >= 1 .and. swindow_ends(begp:endp,:) < 1) .or. (swindow_starts(begp:endp,:) < 1 .and. swindow_ends(begp:endp,:) >= 1))) then write(iulog, *) 'Every prescribed sowing window start date must have a corresponding end date.' call ESMF_Finalize(endflag=ESMF_END_ABORT) end if @@ -613,6 +707,86 @@ subroutine cropcal_interp(bounds, num_pcropp, filter_pcropp, init, crop_inst) deallocate(dataptr2d_gdd20_baseline) + ! Read prescribed gdd20 season start dates from input files + allocate(dataptr2d_gdd20_season_start(lsize, ncft)) + dataptr2d_gdd20_season_start(:,:) = -1._r8 + allocate(dataptr2d_gdd20_season_end (lsize, ncft)) + dataptr2d_gdd20_season_end(:,:) = -1._r8 + if (stream_gdd20_seasons .and. init) then + ! Starting with npcropmin will skip generic crops + do n = 1, ncft + call dshr_fldbun_getFldPtr(sdat_cropcal_gdd20_season_start%pstrm(1)%fldbun_model, trim(stream_varnames_sdate(n)), & + fldptr1=dataptr1d_gdd20_season_start, rc=rc) + if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) then + call ESMF_Finalize(endflag=ESMF_END_ABORT) + end if + call dshr_fldbun_getFldPtr(sdat_cropcal_gdd20_season_end%pstrm(1)%fldbun_model, trim(stream_varnames_gdd20_season_enddate(n)), & + fldptr1=dataptr1d_gdd20_season_end, rc=rc) + if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) then + call ESMF_Finalize(endflag=ESMF_END_ABORT) + end if + ! Note that the size of dataptr1d includes ocean points so it will be around 3x larger than lsize + ! So an explicit loop is required here + do g = 1,lsize + + ! If read-in value is invalid, set to -1. Will be handled later in this subroutine. + if (dataptr1d_gdd20_season_start(g) <= 0 .or. dataptr1d_gdd20_season_start(g) > 366 & + .or. dataptr1d_gdd20_season_end(g) <= 0 .or. dataptr1d_gdd20_season_end(g) > 366) then + dataptr1d_gdd20_season_start(g) = -1 + dataptr1d_gdd20_season_end (g) = -1 + end if + + dataptr2d_gdd20_season_start(g,n) = dataptr1d_gdd20_season_start(g) + dataptr2d_gdd20_season_end (g,n) = dataptr1d_gdd20_season_end (g) + end do + end do + + ! Set gdd20 season for each gridcell/patch combination + do fp = 1, num_pcropp + p = filter_pcropp(fp) + ivt = patch%itype(p) + ! Will skip generic crops + if (ivt >= npcropmin) then + n = ivt - npcropmin + 1 + ! vegetated pft + ig = g_to_ig(patch%gridcell(p)) + gdd20_season_starts(p) = dataptr2d_gdd20_season_start(ig,n) + gdd20_season_ends(p) = dataptr2d_gdd20_season_end (ig,n) + else + write(iulog,'(a,i0)') 'cropcal_interp(), gdd20 seasons: Crop patch has ivt ',ivt + call ESMF_Finalize(endflag=ESMF_END_ABORT) + endif + end do + + ! Handle invalid gdd20 season values + if (any(gdd20_season_starts(begp:endp) < 1 .or. gdd20_season_ends(begp:endp) < 1)) then + ! Fail if not allowing fallback to paramfile sowing windows + if ((.not. allow_invalid_gdd20_season_inputs) .and. any(gdd20_season_starts(begp:endp) < 1 .and. patch%wtgcell(begp:endp) > 0._r8 .and. patch%itype(begp:endp) >= npcropmin)) then + write(iulog, *) 'At least one crop in one gridcell has invalid gdd20 season start date(s). To ignore and fall back to paramfile sowing windows, set allow_invalid_gdd20_season_inputs to .true.' + write(iulog, *) 'Affected crops:' + do ivt = npcropmin, mxpft + do fp = 1, num_pcropp + p = filter_pcropp(fp) + if (ivt == patch%itype(p) .and. patch%wtgcell(p) > 0._r8 .and. gdd20_season_starts(p) < 1) then + write(iulog, *) ' ',pftname(ivt),' (',ivt,')' + exit ! Stop looking for patches of this type + end if + end do + end do + call ESMF_Finalize(endflag=ESMF_END_ABORT) + + ! Fail if a gdd20 season start date is given without an end date (or vice versa) + else if (any((gdd20_season_starts(begp:endp) >= 1 .and. gdd20_season_ends(begp:endp) < 1) .or. (gdd20_season_starts(begp:endp) < 1 .and. gdd20_season_ends(begp:endp) >= 1))) then + write(iulog, *) 'Every gdd20 season start date must have a corresponding end date.' + call ESMF_Finalize(endflag=ESMF_END_ABORT) + end if + end if + + end if ! stream_gdd20_seasons and init + deallocate(dataptr2d_gdd20_season_start) + deallocate(dataptr2d_gdd20_season_end) + + end associate end subroutine cropcal_interp diff --git a/src/main/clm_driver.F90 b/src/main/clm_driver.F90 index 2a3cef4b8b..e660ab9d8d 100644 --- a/src/main/clm_driver.F90 +++ b/src/main/clm_driver.F90 @@ -1374,7 +1374,7 @@ subroutine clm_drv(doalb, nextsw_cday, declinp1, declin, rstwr, nlend, rdate, ro call atm2lnd_inst%UpdateAccVars(bounds_proc) - call temperature_inst%UpdateAccVars(bounds_proc) + call temperature_inst%UpdateAccVars(bounds_proc, crop_inst) call canopystate_inst%UpdateAccVars(bounds_proc) From 0feff1f3d641ec47c616d41d8c6fe3e4b9208db1 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Fri, 31 May 2024 18:26:51 -0600 Subject: [PATCH 0393/1248] Fix check of invalid swindow inputs. --- src/cpl/share_esmf/cropcalStreamMod.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cpl/share_esmf/cropcalStreamMod.F90 b/src/cpl/share_esmf/cropcalStreamMod.F90 index 8196ca1dfb..4c4925f88e 100644 --- a/src/cpl/share_esmf/cropcalStreamMod.F90 +++ b/src/cpl/share_esmf/cropcalStreamMod.F90 @@ -573,7 +573,7 @@ subroutine cropcal_interp(bounds, num_pcropp, filter_pcropp, init, crop_inst) ! Handle invalid sowing window values if (any(swindow_starts(begp:endp,:) < 1 .or. swindow_ends(begp:endp,:) < 1)) then ! Fail if not allowing fallback to paramfile sowing windows - if ((.not. allow_invalid_swindow_inputs) .and. any(all(swindow_starts(begp:endp,:) < 1, dim=2) .and. patch%wtgcell > 0._r8 .and. patch%itype >= npcropmin)) then + if ((.not. allow_invalid_swindow_inputs) .and. any(all(swindow_starts(begp:endp,:) < 1, dim=2) .and. patch%wtgcell(begp:endp) > 0._r8 .and. patch%itype(begp:endp) >= npcropmin)) then write(iulog, *) 'At least one crop in one gridcell has invalid prescribed sowing window start date(s). To ignore and fall back to paramfile sowing windows, set allow_invalid_swindow_inputs to .true.' write(iulog, *) 'Affected crops:' do ivt = npcropmin, mxpft From 3729b6db9f2139399618e39c4c48084144eecf12 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Fri, 31 May 2024 22:35:35 -0600 Subject: [PATCH 0394/1248] Add RxCropCalsAdaptGGCMI testmod and test. --- cime_config/testdefs/testlist_clm.xml | 9 +++++++++ .../clm/RxCropCalsAdaptGGCMI/include_user_mods | 1 + .../testmods_dirs/clm/RxCropCalsAdaptGGCMI/user_nl_clm | 2 ++ 3 files changed, 12 insertions(+) create mode 100644 cime_config/testdefs/testmods_dirs/clm/RxCropCalsAdaptGGCMI/include_user_mods create mode 100644 cime_config/testdefs/testmods_dirs/clm/RxCropCalsAdaptGGCMI/user_nl_clm diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index bf763c4775..edb932d24e 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -3737,5 +3737,14 @@ + + + + + + + + + diff --git a/cime_config/testdefs/testmods_dirs/clm/RxCropCalsAdaptGGCMI/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/RxCropCalsAdaptGGCMI/include_user_mods new file mode 100644 index 0000000000..af5fe8591e --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/RxCropCalsAdaptGGCMI/include_user_mods @@ -0,0 +1 @@ +../RxCropCalsAdapt diff --git a/cime_config/testdefs/testmods_dirs/clm/RxCropCalsAdaptGGCMI/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/RxCropCalsAdaptGGCMI/user_nl_clm new file mode 100644 index 0000000000..fa0e4ec663 --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/RxCropCalsAdaptGGCMI/user_nl_clm @@ -0,0 +1,2 @@ + +stream_gdd20_seasons = .true. From d020eada257e99055b2b90600f78c630286492c1 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Sat, 1 Jun 2024 09:10:40 -0600 Subject: [PATCH 0395/1248] Fix check that gdd20 season files are provided. --- bld/CLMBuildNamelist.pm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index dddd17ced9..d5c2ffd54f 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -4188,14 +4188,17 @@ sub setup_logic_cropcal_streams { # Add defaults if reading gdd20 seasons from stream files my $stream_gdd20_seasons = $nl->get_value('stream_gdd20_seasons') ; - my $gdd20_season_start_file = $nl->get_value('stream_fldFileName_gdd20_season_start') ; - my $gdd20_season_end_file = $nl->get_value('stream_fldFileName_gdd20_season_end') ; if ( &value_is_true($stream_gdd20_seasons)) { add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_fldFileName_gdd20_season_start'); add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_fldFileName_gdd20_season_end'); # Check + my $gdd20_season_start_file = $nl->get_value('stream_fldFileName_gdd20_season_start') ; + my $gdd20_season_end_file = $nl->get_value('stream_fldFileName_gdd20_season_end') ; if ( &string_is_undef_or_empty($gdd20_season_start_file) or &string_is_undef_or_empty($gdd20_season_end_file) ) { + $log->message($gdd20_season_start_file); + $log->message('abcd'); + $log->message($gdd20_season_end_file); $log->fatal_error("If stream_gdd20_seasons is true, gdd20 season start and end files must be provided." ); } } From 42b0dbb9f7e02ab2138710904af129704867e466 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Sat, 1 Jun 2024 09:11:09 -0600 Subject: [PATCH 0396/1248] Minor rearrangement in cropcal namelist definition. --- bld/namelist_files/namelist_definition_ctsm.xml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/bld/namelist_files/namelist_definition_ctsm.xml b/bld/namelist_files/namelist_definition_ctsm.xml index 036b9aca72..5b6dcef87e 100644 --- a/bld/namelist_files/namelist_definition_ctsm.xml +++ b/bld/namelist_files/namelist_definition_ctsm.xml @@ -1838,16 +1838,16 @@ Filename of input stream data for cultivar growing degree-day targets Filename of input stream data for baseline GDD20 values - -Filename of input stream data for date (day of year) of start of gdd20 accumulation season. - - Set this to true to read gdd20 accumulation season start and end dates from stream files, rather than using hard-coded hemisphere-specific "warm seasons." + +Filename of input stream data for date (day of year) of start of gdd20 accumulation season. + + Filename of input stream data for date (day of year) of end of gdd20 accumulation season. From 92555b9c394a4542ff7412335a459dfab57a8979 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Sat, 1 Jun 2024 12:13:20 -0600 Subject: [PATCH 0397/1248] generate_gdd20_baseline.py now saves NETCDF3_CLASSIC. --- python/ctsm/crop_calendars/generate_gdd20_baseline.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/ctsm/crop_calendars/generate_gdd20_baseline.py b/python/ctsm/crop_calendars/generate_gdd20_baseline.py index d28bfda0e7..7b5fd625d6 100644 --- a/python/ctsm/crop_calendars/generate_gdd20_baseline.py +++ b/python/ctsm/crop_calendars/generate_gdd20_baseline.py @@ -226,7 +226,7 @@ def generate_gdd20_baseline(input_files, output_file, author): ds_out[var_out] = this_da # Save - ds_out.to_netcdf(output_file) + ds_out.to_netcdf(output_file, format="NETCDF3_CLASSIC") print("Done!") From 30eb31ce8e92a05bd104268e01e3d62b964ee486 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Sat, 1 Jun 2024 12:16:49 -0600 Subject: [PATCH 0398/1248] Update default to point to classic version. --- 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 7e3ddb7c64..2683c2e535 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -1705,7 +1705,7 @@ lnd/clm2/surfdata_esmf/NEON/surfdata_1x1_NEON_TOOL_hist_78pfts_CMIP6_simyr2000_c lnd/clm2/cropdata/calendars/processed/swindow_starts_ggcmi_crop_calendar_phase3_v1.01.2000-2000.20231005_145103.nc lnd/clm2/cropdata/calendars/processed/swindow_ends_ggcmi_crop_calendar_phase3_v1.01.2000-2000.20231005_145103.nc lnd/clm2/cropdata/calendars/processed/gdds_20230829_161011.nc -lnd/clm2/testdata/gdd20baseline.tmp_dontupload.nc +lnd/clm2/testdata/gdd20baseline.tmp_dontupload.classic.nc lnd/clm2/cropdata/calendars/processed/sdates_ggcmi_crop_calendar_phase3_v1.01_nninterp-hcru_hcru_mt13.2000-2000.20230728_165845.nc lnd/clm2/cropdata/calendars/processed/hdates_ggcmi_crop_calendar_phase3_v1.01_nninterp-hcru_hcru_mt13.2000-2000.20230728_165845.nc share/meshes/360x720_120830_ESMFmesh_c20210507_cdf5.nc From a6e2c1e23964b6e9c3bf35d1778a14187a0b62e9 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Sat, 1 Jun 2024 12:59:29 -0600 Subject: [PATCH 0399/1248] Add allow_invalid_gdd20_season_inputs to namelist XML. --- bld/namelist_files/namelist_definition_ctsm.xml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/bld/namelist_files/namelist_definition_ctsm.xml b/bld/namelist_files/namelist_definition_ctsm.xml index 5b6dcef87e..675c912900 100644 --- a/bld/namelist_files/namelist_definition_ctsm.xml +++ b/bld/namelist_files/namelist_definition_ctsm.xml @@ -1843,6 +1843,11 @@ Filename of input stream data for baseline GDD20 values Set this to true to read gdd20 accumulation season start and end dates from stream files, rather than using hard-coded hemisphere-specific "warm seasons." + +By default, a value in stream_fldFileName_gdd20_season_start or _end outside the range [1, 365] (or 366 in leap years) will cause the run to fail. Set this to .true. to instead have such cells fall back to the hard-coded hemisphere-specific "warm seasons." + + Filename of input stream data for date (day of year) of start of gdd20 accumulation season. From 9f04d71e0ac7f5e4f0bcadd195281dfcc2134f81 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Sat, 1 Jun 2024 13:22:59 -0600 Subject: [PATCH 0400/1248] Update missing values from generate_gdd20_baseline.py. --- python/ctsm/crop_calendars/generate_gdd20_baseline.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/python/ctsm/crop_calendars/generate_gdd20_baseline.py b/python/ctsm/crop_calendars/generate_gdd20_baseline.py index 7b5fd625d6..fd56d61550 100644 --- a/python/ctsm/crop_calendars/generate_gdd20_baseline.py +++ b/python/ctsm/crop_calendars/generate_gdd20_baseline.py @@ -20,7 +20,8 @@ VAR_LIST_IN = ["GDD0", "GDD8", "GDD10"] VAR_LIST_IN = [x + "20" for x in VAR_LIST_IN] # TODO: Delete this once using the right variables -MISSING_FILL = -1 # Something negative to ensure that gddmaturity never changes (see PlantCrop) +MISSING_FILL = -1 # Something impossible to ensure that you can mark it as a missing value, to be +# bilinear-interpolated STREAM_YEAR = 2000 # The year specified for stream_yearFirst and stream_yearLast in the call of # shr_strdata_init_from_inline() for sdat_cropcal_gdd20_baseline @@ -211,7 +212,8 @@ def generate_gdd20_baseline(input_files, output_file, author): long_name = "Dummy GDD20" print(" dummy GDD20") else: - this_da = ds_in[gddn].fillna(MISSING_FILL) + # this_da = ds_in[gddn].fillna(MISSING_FILL) + this_da = ds_in[gddn] this_da = _add_time_axis(this_da) long_name = gddn print(f" {gddn}") @@ -219,6 +221,7 @@ def generate_gdd20_baseline(input_files, output_file, author): # Add attributes this_da.attrs["long_name"] = long_name + f" baseline for {cft_str}" this_da.attrs["units"] = "°C days" + # this_da.attrs["_FillValue"] = MISSING_FILL # Copy that to ds_out var_out = _get_output_varname(cft_str) From 625fd5e7b9eebc61bf8e93824e92a3079bf937cd Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Sat, 1 Jun 2024 13:23:16 -0600 Subject: [PATCH 0401/1248] RxCropCalsAdaptGGCMI now uses allow_invalid_gdd20_season_inputs. --- .../testdefs/testmods_dirs/clm/RxCropCalsAdaptGGCMI/user_nl_clm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cime_config/testdefs/testmods_dirs/clm/RxCropCalsAdaptGGCMI/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/RxCropCalsAdaptGGCMI/user_nl_clm index fa0e4ec663..42e57a675c 100644 --- a/cime_config/testdefs/testmods_dirs/clm/RxCropCalsAdaptGGCMI/user_nl_clm +++ b/cime_config/testdefs/testmods_dirs/clm/RxCropCalsAdaptGGCMI/user_nl_clm @@ -1,2 +1,4 @@ stream_gdd20_seasons = .true. +!TODO SSR: Try without this once you have half-degree inputs +allow_invalid_gdd20_season_inputs = .true. From 0156d1aa928f5bc002c1eb8508962138c76f4a1d Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Sat, 1 Jun 2024 13:25:02 -0600 Subject: [PATCH 0402/1248] Move hist_addfld1d() for GDD0 to be with its siblings. --- src/biogeophys/TemperatureType.F90 | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/biogeophys/TemperatureType.F90 b/src/biogeophys/TemperatureType.F90 index 31fba16274..89dfd11074 100644 --- a/src/biogeophys/TemperatureType.F90 +++ b/src/biogeophys/TemperatureType.F90 @@ -597,9 +597,7 @@ subroutine InitHistory(this, bounds, is_simple_buildtemp, is_prog_buildtemp ) call hist_addfld1d (fname='GDD0', units='ddays', & avgflag='A', long_name='Growing degree days base 0C from planting', & ptr_patch=this%gdd0_patch, default='inactive') - end if - if (use_crop) then this%gdd8_patch(begp:endp) = spval call hist_addfld1d (fname='GDD8', units='ddays', & avgflag='A', long_name='Growing degree days base 8C from planting', & From b7c34ffcd7b4421f5266051d3bb7aeef2f790744 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Sat, 1 Jun 2024 13:34:16 -0600 Subject: [PATCH 0403/1248] Add max versions of GDD season accum outputs. --- src/biogeophys/TemperatureType.F90 | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/biogeophys/TemperatureType.F90 b/src/biogeophys/TemperatureType.F90 index 89dfd11074..f8d5206a1e 100644 --- a/src/biogeophys/TemperatureType.F90 +++ b/src/biogeophys/TemperatureType.F90 @@ -608,6 +608,21 @@ subroutine InitHistory(this, bounds, is_simple_buildtemp, is_prog_buildtemp ) avgflag='A', long_name='Growing degree days base 10C from planting', & ptr_patch=this%gdd10_patch, default='inactive') + this%gdd0_patch(begp:endp) = spval + call hist_addfld1d (fname='GDD0X', units='ddays', & + avgflag='X', long_name='Growing degree days base 0C from planting, max', & + ptr_patch=this%gdd0_patch, default='inactive') + + this%gdd8_patch(begp:endp) = spval + call hist_addfld1d (fname='GDD8X', units='ddays', & + avgflag='X', long_name='Growing degree days base 8C from planting, max', & + ptr_patch=this%gdd8_patch, default='inactive') + + this%gdd10_patch(begp:endp) = spval + call hist_addfld1d (fname='GDD10X', units='ddays', & + avgflag='X', long_name='Growing degree days base 10C from planting, max', & + ptr_patch=this%gdd10_patch, default='inactive') + this%gdd020_patch(begp:endp) = spval call hist_addfld1d (fname='GDD020', units='ddays', & avgflag='A', long_name='Twenty year average of growing degree days base 0C from planting', & From 6fbb432e97389e4c0bde8aad7d8da77646c98936 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Sat, 1 Jun 2024 15:52:19 -0600 Subject: [PATCH 0404/1248] Move tmp1 to inside the dustemis type --- src/biogeochem/DustEmisZender2003.F90 | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/biogeochem/DustEmisZender2003.F90 b/src/biogeochem/DustEmisZender2003.F90 index d17ebc8f1c..a2d4ed2d26 100644 --- a/src/biogeochem/DustEmisZender2003.F90 +++ b/src/biogeochem/DustEmisZender2003.F90 @@ -37,18 +37,18 @@ module DustEmisZender2003 implicit none private ! - ! !PUBLIC DATA: + ! !PRIVATE DATA: ! - real(r8) , allocatable :: ovr_src_snk_mss(:,:) + real(r8) , allocatable :: ovr_src_snk_mss(:,:) ! overlap factors between the source and sin real(r8) , allocatable :: dmt_vwr(:) ![m] Mass-weighted mean diameter resolved real(r8) , allocatable :: stk_crc(:) ![frc] Correction to Stokes settling velocity - real(r8) tmp1 !Factor in saltation computation (named as in Charlie's code) real(r8), parameter :: dns_aer = 2.5e+3_r8 ![kg m-3] Aerosol density ! ! !PUBLIC DATA TYPES: ! type, public :: dust_type + real(r8), private :: tmp1 ! Factor in saltation computation (named as in Charlie's code) real(r8), pointer, PUBLIC :: flx_mss_vrt_dst_patch (:,:) ! surface dust emission (kg/m**2/s) [ + = to atm] (ndst) real(r8), pointer, private :: flx_mss_vrt_dst_tot_patch (:) ! total dust flux into atmosphere real(r8), pointer, private :: vlc_trb_patch (:,:) ! turbulent deposition velocity (m/s) (ndst) @@ -293,7 +293,7 @@ subroutine GetConstVars(this, SaltationFactor ) class(dust_type) , intent(in) :: this real(r8) , intent(out) :: SaltationFactor - SaltationFactor = tmp1 + SaltationFactor = this%tmp1 end subroutine GetConstVars !------------------------------------------------------------------------ @@ -505,7 +505,7 @@ subroutine DustEmission (this, bounds, & ! subr. wnd_frc_thr_slt_get which computes dry threshold ! friction velocity for saltation - wnd_frc_thr_slt = tmp1 / sqrt(forc_rho(c)) * frc_thr_wet_fct * frc_thr_rgh_fct + wnd_frc_thr_slt = this%tmp1 / sqrt(forc_rho(c)) * frc_thr_wet_fct * frc_thr_rgh_fct ! reset these variables which will be updated in the following if-block @@ -846,7 +846,7 @@ subroutine InitDustVars(this, bounds) icf_fct = 1.0_r8 + 6.0e-07_r8 / (dns_slt * grav * (dmt_slt_opt**2.5_r8)) dns_fct = dns_slt * grav * dmt_slt_opt - tmp1 = sqrt(icf_fct * dns_fct * ryn_nbr_frc_thr_opt_fnc) + this%tmp1 = sqrt(icf_fct * dns_fct * ryn_nbr_frc_thr_opt_fnc) ! Introducing particle diameter. Needed by atm model and by dry dep model. ! Taken from Charlie Zender's subroutines dst_psd_ini, dst_sz_rsl, From 1cf137bf57ed63aa9f9716f6425917268e13e4e4 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Sat, 1 Jun 2024 16:05:33 -0600 Subject: [PATCH 0405/1248] Move three module variables to inside the data type --- src/biogeochem/DustEmisZender2003.F90 | 54 +++++++++++++-------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/src/biogeochem/DustEmisZender2003.F90 b/src/biogeochem/DustEmisZender2003.F90 index a2d4ed2d26..6adbac8521 100644 --- a/src/biogeochem/DustEmisZender2003.F90 +++ b/src/biogeochem/DustEmisZender2003.F90 @@ -39,15 +39,15 @@ module DustEmisZender2003 ! ! !PRIVATE DATA: ! - real(r8) , allocatable :: ovr_src_snk_mss(:,:) ! overlap factors between the source and sin - real(r8) , allocatable :: dmt_vwr(:) ![m] Mass-weighted mean diameter resolved - real(r8) , allocatable :: stk_crc(:) ![frc] Correction to Stokes settling velocity real(r8), parameter :: dns_aer = 2.5e+3_r8 ![kg m-3] Aerosol density ! ! !PUBLIC DATA TYPES: ! type, public :: dust_type + real(r8) , allocatable, private :: ovr_src_snk_mss(:,:) ! overlap factors between the source and sin + real(r8) , allocatable, private :: dmt_vwr(:) ! [m] Mass-weighted mean diameter resolved + real(r8) , allocatable, private :: stk_crc(:) ! [frc] Correction to Stokes settling velocity real(r8), private :: tmp1 ! Factor in saltation computation (named as in Charlie's code) real(r8), pointer, PUBLIC :: flx_mss_vrt_dst_patch (:,:) ! surface dust emission (kg/m**2/s) [ + = to atm] (ndst) real(r8), pointer, private :: flx_mss_vrt_dst_tot_patch (:) ! total dust flux into atmosphere @@ -116,9 +116,9 @@ subroutine Clean(this) deallocate(this%vlc_trb_4_patch) deallocate(this%mbl_bsn_fct_col) - deallocate (ovr_src_snk_mss) - deallocate (dmt_vwr) - deallocate (stk_crc) + deallocate (this%ovr_src_snk_mss) + deallocate (this%dmt_vwr) + deallocate (this%stk_crc) end subroutine Clean @@ -146,6 +146,11 @@ subroutine InitAllocate(this, bounds) allocate(this%vlc_trb_4_patch (begp:endp)) ; this%vlc_trb_4_patch (:) = nan allocate(this%mbl_bsn_fct_col (begc:endc)) ; this%mbl_bsn_fct_col (:) = nan + allocate (this%ovr_src_snk_mss(dst_src_nbr,ndst)) ; this%ovr_src_snk_mss (:,:) = nan + allocate (this%dmt_vwr(ndst)) ; this%dmt_vwr (:) = nan + allocate (this%stk_crc(ndst)) ; this%stk_crc (:) = nan + + end subroutine InitAllocate !------------------------------------------------------------------------ @@ -564,7 +569,7 @@ subroutine DustEmission (this, bounds, & do fp = 1,num_nolakep p = filter_nolakep(fp) if (lnd_frc_mbl(p) > 0.0_r8) then - flx_mss_vrt_dst(p,n) = flx_mss_vrt_dst(p,n) + ovr_src_snk_mss(m,n) * flx_mss_vrt_dst_ttl(p) + flx_mss_vrt_dst(p,n) = flx_mss_vrt_dst(p,n) + this%ovr_src_snk_mss(m,n) * flx_mss_vrt_dst_ttl(p) end if end do end do @@ -663,11 +668,11 @@ subroutine DustDryDep (this, bounds, & do m = 1, ndst slp_crc(p,m) = 1.0_r8 + 2.0_r8 * mfp_atm * & - (1.257_r8+0.4_r8*exp(-1.1_r8*dmt_vwr(m)/(2.0_r8*mfp_atm))) / & - dmt_vwr(m) ![frc] Slip correction factor SeP97 p. 464 - vlc_grv(p,m) = (1.0_r8/18.0_r8) * dmt_vwr(m) * dmt_vwr(m) * dns_aer * & + (1.257_r8+0.4_r8*exp(-1.1_r8*this%dmt_vwr(m)/(2.0_r8*mfp_atm))) / & + this%dmt_vwr(m) ![frc] Slip correction factor SeP97 p. 464 + vlc_grv(p,m) = (1.0_r8/18.0_r8) * this%dmt_vwr(m) * this%dmt_vwr(m) * dns_aer * & grav * slp_crc(p,m) / vsc_dyn_atm(p) ![m s-1] Stokes' settling velocity SeP97 p. 466 - vlc_grv(p,m) = vlc_grv(p,m) * stk_crc(m) ![m s-1] Correction to Stokes settling velocity + vlc_grv(p,m) = vlc_grv(p,m) * this%stk_crc(m) ![m s-1] Correction to Stokes settling velocity end do end if end do @@ -680,7 +685,7 @@ subroutine DustDryDep (this, bounds, & stk_nbr = vlc_grv(p,m) * fv(p) * fv(p) / (grav * vsc_knm_atm(p)) ![frc] SeP97 p.965 dff_aer = SHR_CONST_BOLTZ * forc_t(c) * slp_crc(p,m) / & ![m2 s-1] - (3.0_r8*SHR_CONST_PI * vsc_dyn_atm(p) * dmt_vwr(m)) !SeP97 p.474 + (3.0_r8*SHR_CONST_PI * vsc_dyn_atm(p) * this%dmt_vwr(m)) !SeP97 p.474 shm_nbr = vsc_knm_atm(p) / dff_aer ![frc] SeP97 p.972 shm_nbr_xpn = shm_nbr_xpn_lnd ![frc] @@ -796,11 +801,6 @@ subroutine InitDustVars(this, bounds) real(r8), parameter :: dns_slt = 2650.0_r8 ! [kg m-3] Density of optimal saltation particles !------------------------------------------------------------------------ - ! allocate module variable - allocate (ovr_src_snk_mss(dst_src_nbr,ndst)) - allocate (dmt_vwr(ndst)) - allocate (stk_crc(ndst)) - ! allocate local variable allocate (dmt_vma_src(dst_src_nbr)) allocate (gsd_anl_src(dst_src_nbr)) @@ -824,7 +824,7 @@ subroutine InitDustVars(this, bounds) lndminjovrdmdni = log(dmt_grd(n )/dmt_vma_src(m)) ovr_src_snk_frc = 0.5_r8 * (erf(lndmaxjovrdmdni/sqrt2lngsdi) - & erf(lndminjovrdmdni/sqrt2lngsdi)) - ovr_src_snk_mss(m,n) = ovr_src_snk_frc * mss_frc_src(m) + this%ovr_src_snk_mss(m,n) = ovr_src_snk_frc * mss_frc_src(m) end do end do @@ -914,7 +914,7 @@ subroutine InitDustVars(this, bounds) end do lngsdsqrttwopi_rcp = 1.0_r8 / (ln_gsd*sqrt(2.0_r8*SHR_CONST_PI)) - dmt_vwr(n) = 0.0_r8 ! [m] Mass wgted diameter resolved + this%dmt_vwr(n) = 0.0_r8 ! [m] Mass wgted diameter resolved vlm_rsl(n) = 0.0_r8 ! [m3 m-3] Volume concentration resolved do m = 1, sz_nbr @@ -924,7 +924,7 @@ subroutine InitDustVars(this, bounds) lgn_dst = lngsdsqrttwopi_rcp * exp(-0.5_r8*tmp*tmp) / sz_ctr(m) ! Integrate moments of size distribution - dmt_vwr(n) = dmt_vwr(n) + sz_ctr(m) * & + this%dmt_vwr(n) = this%dmt_vwr(n) + sz_ctr(m) * & SHR_CONST_PI / 6.0_r8 * (sz_ctr(m)**3.0_r8) * & ![m3] Volume lgn_dst * sz_dlt(m) ![# m-3] Number concentrn vlm_rsl(n) = vlm_rsl(n) + & @@ -933,7 +933,7 @@ subroutine InitDustVars(this, bounds) end do - dmt_vwr(n) = dmt_vwr(n) / vlm_rsl(n) ![m] Mass weighted diameter resolved + this%dmt_vwr(n) = this%dmt_vwr(n) / vlm_rsl(n) ![m] Mass weighted diameter resolved end do @@ -952,9 +952,9 @@ subroutine InitDustVars(this, bounds) do m = 1, ndst slp_crc(m) = 1.0_r8 + 2.0_r8 * mfp_atm * & - (1.257_r8+0.4_r8*exp(-1.1_r8*dmt_vwr(m)/(2.0_r8*mfp_atm))) / & - dmt_vwr(m) ! [frc] Slip correction factor SeP97 p.464 - vlc_stk(m) = (1.0_r8/18.0_r8) * dmt_vwr(m) * dmt_vwr(m) * dns_aer * & + (1.257_r8+0.4_r8*exp(-1.1_r8*this%dmt_vwr(m)/(2.0_r8*mfp_atm))) / & + this%dmt_vwr(m) ! [frc] Slip correction factor SeP97 p.464 + vlc_stk(m) = (1.0_r8/18.0_r8) * this%dmt_vwr(m) * this%dmt_vwr(m) * dns_aer * & grav * slp_crc(m) / vsc_dyn_atm ! [m s-1] SeP97 p.466 end do @@ -979,7 +979,7 @@ subroutine InitDustVars(this, bounds) ! Save terminal velocity for convergence test vlc_grv_old = vlc_grv(m) ![m s-1] - ryn_nbr_grv(m) = vlc_grv(m) * dmt_vwr(m) / vsc_knm_atm !SeP97 p.460 + ryn_nbr_grv(m) = vlc_grv(m) * this%dmt_vwr(m) / vsc_knm_atm !SeP97 p.460 ! Update drag coefficient based on new Reynolds number if (ryn_nbr_grv(m) < 0.1_r8) then @@ -1003,7 +1003,7 @@ subroutine InitDustVars(this, bounds) ! Update terminal velocity based on new Reynolds number and drag coeff ! [m s-1] Terminal veloc SeP97 p.467 (8.44) - vlc_grv(m) = sqrt(4.0_r8 * grav * dmt_vwr(m) * slp_crc(m) * dns_aer / & + vlc_grv(m) = sqrt(4.0_r8 * grav * this%dmt_vwr(m) * slp_crc(m) * dns_aer / & (3.0_r8*cff_drg_grv(m)*dns_mdp)) eps_crr = abs((vlc_grv(m)-vlc_grv_old)/vlc_grv(m)) !Relative convergence if (itr_idx == 12) then @@ -1027,7 +1027,7 @@ subroutine InitDustVars(this, bounds) ! actual settling velocities do m = 1, ndst - stk_crc(m) = vlc_grv(m) / vlc_stk(m) + this%stk_crc(m) = vlc_grv(m) / vlc_stk(m) end do end subroutine InitDustVars From 17864ceae227f9a42dd724b58dacc5987bcef27f Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Sat, 1 Jun 2024 16:13:08 -0600 Subject: [PATCH 0406/1248] Change name of tmp1 to saltation_factor --- src/biogeochem/DustEmisZender2003.F90 | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/biogeochem/DustEmisZender2003.F90 b/src/biogeochem/DustEmisZender2003.F90 index 6adbac8521..db6f93581a 100644 --- a/src/biogeochem/DustEmisZender2003.F90 +++ b/src/biogeochem/DustEmisZender2003.F90 @@ -39,7 +39,7 @@ module DustEmisZender2003 ! ! !PRIVATE DATA: ! - real(r8), parameter :: dns_aer = 2.5e+3_r8 ![kg m-3] Aerosol density + real(r8), parameter :: dns_aer = 2.5e+3_r8 ![kg m-3] Aerosol density ! ! !PUBLIC DATA TYPES: ! @@ -48,7 +48,7 @@ module DustEmisZender2003 real(r8) , allocatable, private :: ovr_src_snk_mss(:,:) ! overlap factors between the source and sin real(r8) , allocatable, private :: dmt_vwr(:) ! [m] Mass-weighted mean diameter resolved real(r8) , allocatable, private :: stk_crc(:) ! [frc] Correction to Stokes settling velocity - real(r8), private :: tmp1 ! Factor in saltation computation (named as in Charlie's code) + real(r8), private :: saltation_factor ! Factor in saltation computation (named as in Charlie's code) real(r8), pointer, PUBLIC :: flx_mss_vrt_dst_patch (:,:) ! surface dust emission (kg/m**2/s) [ + = to atm] (ndst) real(r8), pointer, private :: flx_mss_vrt_dst_tot_patch (:) ! total dust flux into atmosphere real(r8), pointer, private :: vlc_trb_patch (:,:) ! turbulent deposition velocity (m/s) (ndst) @@ -298,7 +298,7 @@ subroutine GetConstVars(this, SaltationFactor ) class(dust_type) , intent(in) :: this real(r8) , intent(out) :: SaltationFactor - SaltationFactor = this%tmp1 + SaltationFactor = this%saltation_factor end subroutine GetConstVars !------------------------------------------------------------------------ @@ -506,11 +506,11 @@ subroutine DustEmission (this, bounds, & ! the following lines come from subr. dst_mbl ! purpose: adjust threshold friction velocity to acct for moisture and - ! roughness. The ratio tmp1 / sqrt(forc_rho) comes from + ! roughness. The ratio saltation_factor / sqrt(forc_rho) comes from ! subr. wnd_frc_thr_slt_get which computes dry threshold ! friction velocity for saltation - wnd_frc_thr_slt = this%tmp1 / sqrt(forc_rho(c)) * frc_thr_wet_fct * frc_thr_rgh_fct + wnd_frc_thr_slt = this%saltation_factor / sqrt(forc_rho(c)) * frc_thr_wet_fct * frc_thr_rgh_fct ! reset these variables which will be updated in the following if-block @@ -733,7 +733,7 @@ subroutine InitDustVars(this, bounds) ! ! Compute source efficiency factor from topography ! Initialize other variables used in subroutine Dust: - ! ovr_src_snk_mss(m,n) and tmp1. + ! ovr_src_snk_mss(m,n) and saltation_factor. ! Define particle diameter and density needed by atm model ! as well as by dry dep model ! Source: Paul Ginoux (for source efficiency factor) @@ -829,7 +829,7 @@ subroutine InitDustVars(this, bounds) end do ! The following code from subroutine wnd_frc_thr_slt_get was placed - ! here because tmp1 needs to be defined just once + ! here because saltation_factor needs to be defined just once ryn_nbr_frc_thr_prx_opt = 0.38_r8 + 1331.0_r8 * (100.0_r8*dmt_slt_opt)**1.56_r8 @@ -846,7 +846,7 @@ subroutine InitDustVars(this, bounds) icf_fct = 1.0_r8 + 6.0e-07_r8 / (dns_slt * grav * (dmt_slt_opt**2.5_r8)) dns_fct = dns_slt * grav * dmt_slt_opt - this%tmp1 = sqrt(icf_fct * dns_fct * ryn_nbr_frc_thr_opt_fnc) + this%saltation_factor = sqrt(icf_fct * dns_fct * ryn_nbr_frc_thr_opt_fnc) ! Introducing particle diameter. Needed by atm model and by dry dep model. ! Taken from Charlie Zender's subroutines dst_psd_ini, dst_sz_rsl, From 535e2c5a43f309ea3bbe8eb851c963ee7cb33dcf Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Sat, 1 Jun 2024 17:01:44 -0600 Subject: [PATCH 0407/1248] Even gdd20 files need to be advance()d. --- src/cpl/share_esmf/cropcalStreamMod.F90 | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/cpl/share_esmf/cropcalStreamMod.F90 b/src/cpl/share_esmf/cropcalStreamMod.F90 index 4c4925f88e..faa13b5fda 100644 --- a/src/cpl/share_esmf/cropcalStreamMod.F90 +++ b/src/cpl/share_esmf/cropcalStreamMod.F90 @@ -432,10 +432,26 @@ subroutine cropcal_advance( bounds ) end if end if - ! The following should not have an associated time axis and thus will not be advanced here: + ! The following should not have an associated time axis, but still need to be here ! - GDD20 baseline values ! - GDD20 season start dates ! - GDD20 season end dates + if (adapt_cropcal_rx_cultivar_gdds) then + call shr_strdata_advance(sdat_cropcal_gdd20_baseline, ymd=mcdate, tod=sec, logunit=iulog, istr='cropcaldyn', rc=rc) + if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) then + call ESMF_Finalize(endflag=ESMF_END_ABORT) + end if + end if + if (stream_gdd20_seasons) then + call shr_strdata_advance(sdat_cropcal_gdd20_season_start, ymd=mcdate, tod=sec, logunit=iulog, istr='cropcaldyn', rc=rc) + if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) then + call ESMF_Finalize(endflag=ESMF_END_ABORT) + end if + call shr_strdata_advance(sdat_cropcal_gdd20_season_end, ymd=mcdate, tod=sec, logunit=iulog, istr='cropcaldyn', rc=rc) + if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) then + call ESMF_Finalize(endflag=ESMF_END_ABORT) + end if + end if if ( .not. allocated(g_to_ig) )then allocate (g_to_ig(bounds%begg:bounds%endg) ) From 3e524db1aa4f34a70cd08c48c740c8c35033db9d Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Sat, 1 Jun 2024 17:03:43 -0600 Subject: [PATCH 0408/1248] generate_gdd20_baseline.py now saves to double instead of float. --- python/ctsm/crop_calendars/generate_gdd20_baseline.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/python/ctsm/crop_calendars/generate_gdd20_baseline.py b/python/ctsm/crop_calendars/generate_gdd20_baseline.py index fd56d61550..8cf30bf44d 100644 --- a/python/ctsm/crop_calendars/generate_gdd20_baseline.py +++ b/python/ctsm/crop_calendars/generate_gdd20_baseline.py @@ -197,6 +197,7 @@ def generate_gdd20_baseline(input_files, output_file, author): "created": dt.datetime.now().astimezone().isoformat(), }, ) + encoding_dict = {} for cft_str in utils.define_mgdcrop_list(): cft_int = utils.vegtype_str2int(cft_str)[0] print(f"{cft_str} ({cft_int})") @@ -227,9 +228,10 @@ def generate_gdd20_baseline(input_files, output_file, author): var_out = _get_output_varname(cft_str) print(f" Output variable {var_out}") ds_out[var_out] = this_da + encoding_dict[var_out] = {"dtype": "float64"} # Save - ds_out.to_netcdf(output_file, format="NETCDF3_CLASSIC") + ds_out.to_netcdf(output_file, format="NETCDF3_CLASSIC", encoding=encoding_dict) print("Done!") From 18df6b4a04ac901737ccb5d9b806619e66ebe532 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Sat, 1 Jun 2024 17:06:19 -0600 Subject: [PATCH 0409/1248] stream_fldFileName_gdd20_baseline now defaults to half-deg fake file. --- 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 2683c2e535..bd5f7132ca 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -1705,7 +1705,7 @@ lnd/clm2/surfdata_esmf/NEON/surfdata_1x1_NEON_TOOL_hist_78pfts_CMIP6_simyr2000_c lnd/clm2/cropdata/calendars/processed/swindow_starts_ggcmi_crop_calendar_phase3_v1.01.2000-2000.20231005_145103.nc lnd/clm2/cropdata/calendars/processed/swindow_ends_ggcmi_crop_calendar_phase3_v1.01.2000-2000.20231005_145103.nc lnd/clm2/cropdata/calendars/processed/gdds_20230829_161011.nc -lnd/clm2/testdata/gdd20baseline.tmp_dontupload.classic.nc +lnd/clm2/cropdata/calendars/processed/gdd20bl.copied_from.gdds_20230829_161011.nc lnd/clm2/cropdata/calendars/processed/sdates_ggcmi_crop_calendar_phase3_v1.01_nninterp-hcru_hcru_mt13.2000-2000.20230728_165845.nc lnd/clm2/cropdata/calendars/processed/hdates_ggcmi_crop_calendar_phase3_v1.01_nninterp-hcru_hcru_mt13.2000-2000.20230728_165845.nc share/meshes/360x720_120830_ESMFmesh_c20210507_cdf5.nc From a3feed96de079cdc04f42e60a5cfc4ff22959606 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Sun, 2 Jun 2024 08:25:06 -0600 Subject: [PATCH 0410/1248] Use fixed gdd20 baseline file. --- 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 bd5f7132ca..8ed75be01a 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -1705,7 +1705,7 @@ lnd/clm2/surfdata_esmf/NEON/surfdata_1x1_NEON_TOOL_hist_78pfts_CMIP6_simyr2000_c lnd/clm2/cropdata/calendars/processed/swindow_starts_ggcmi_crop_calendar_phase3_v1.01.2000-2000.20231005_145103.nc lnd/clm2/cropdata/calendars/processed/swindow_ends_ggcmi_crop_calendar_phase3_v1.01.2000-2000.20231005_145103.nc lnd/clm2/cropdata/calendars/processed/gdds_20230829_161011.nc -lnd/clm2/cropdata/calendars/processed/gdd20bl.copied_from.gdds_20230829_161011.nc +lnd/clm2/cropdata/calendars/processed/gdd20bl.copied_from.gdds_20230829_161011.v2.nc lnd/clm2/cropdata/calendars/processed/sdates_ggcmi_crop_calendar_phase3_v1.01_nninterp-hcru_hcru_mt13.2000-2000.20230728_165845.nc lnd/clm2/cropdata/calendars/processed/hdates_ggcmi_crop_calendar_phase3_v1.01_nninterp-hcru_hcru_mt13.2000-2000.20230728_165845.nc share/meshes/360x720_120830_ESMFmesh_c20210507_cdf5.nc From 5144b36a7993ae6363bd8bb16b41219ed3e032ed Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Mon, 3 Jun 2024 10:58:43 -0600 Subject: [PATCH 0411/1248] gdd20 baseline now interpolated w/ nearest-neighbor. Revert this! --- src/cpl/share_esmf/cropcalStreamMod.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cpl/share_esmf/cropcalStreamMod.F90 b/src/cpl/share_esmf/cropcalStreamMod.F90 index faa13b5fda..ce595c0d70 100644 --- a/src/cpl/share_esmf/cropcalStreamMod.F90 +++ b/src/cpl/share_esmf/cropcalStreamMod.F90 @@ -312,7 +312,7 @@ subroutine cropcal_init(bounds) model_mesh = mesh, & stream_meshfile = trim(stream_meshfile_cropcal), & stream_lev_dimname = 'null', & - stream_mapalgo = 'bilinear', & + stream_mapalgo = 'nn', & stream_filenames = (/trim(stream_fldFileName_gdd20_baseline)/), & stream_fldlistFile = stream_varnames_gdd20_baseline, & stream_fldListModel = stream_varnames_gdd20_baseline, & From 90b938b5bbf8bc3e13d86e1211bb9519409b477d Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Mon, 3 Jun 2024 10:59:37 -0600 Subject: [PATCH 0412/1248] generate_gdd20_nbaseline: Use GDDNX. --- .../ctsm/crop_calendars/generate_gdd20_baseline.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/python/ctsm/crop_calendars/generate_gdd20_baseline.py b/python/ctsm/crop_calendars/generate_gdd20_baseline.py index 8cf30bf44d..7f60fb6a68 100644 --- a/python/ctsm/crop_calendars/generate_gdd20_baseline.py +++ b/python/ctsm/crop_calendars/generate_gdd20_baseline.py @@ -18,8 +18,7 @@ from ctsm.crop_calendars.import_ds import import_ds import ctsm.crop_calendars.cropcal_utils as utils -VAR_LIST_IN = ["GDD0", "GDD8", "GDD10"] -VAR_LIST_IN = [x + "20" for x in VAR_LIST_IN] # TODO: Delete this once using the right variables +VAR_LIST_IN = ["GDD0X", "GDD8X", "GDD10X"] MISSING_FILL = -1 # Something impossible to ensure that you can mark it as a missing value, to be # bilinear-interpolated STREAM_YEAR = 2000 # The year specified for stream_yearFirst and stream_yearLast in the call of @@ -111,26 +110,25 @@ def _get_gddn_for_cft(cft_str): cft_str (str): E.g., "irrigated_temperate_corn" Returns: - str or None: Name of variable to use (e.g., "GDD8"). If crop isn't yet handled, return None. + str or None: Name of variable to use (e.g., "GDD8X"). If crop isn't yet handled, return None. """ gddn = None gdd0_list_str = ["wheat", "cotton", "rice"] if cft_str in _get_cft_list(gdd0_list_str): - gddn = "GDD0" + gddn = 0 gdd8_list_str = ["corn", "sugarcane", "miscanthus", "switchgrass"] if cft_str in _get_cft_list(gdd8_list_str): - gddn = "GDD8" + gddn = 8 gdd10_list_str = ["soybean"] if cft_str in _get_cft_list(gdd10_list_str): - gddn = "GDD10" + gddn = 10 - # TODO: Delete this once using the right variables if gddn is not None: - gddn += "20" + gddn = f"GDD{gddn}X" return gddn From e82679df56e1a514f28ee4a38ae4d9c9b581b120 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Mon, 3 Jun 2024 11:25:37 -0600 Subject: [PATCH 0413/1248] generate_gdd20_baseline: Grid, if needed. --- .../ctsm/crop_calendars/generate_gdd20_baseline.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/python/ctsm/crop_calendars/generate_gdd20_baseline.py b/python/ctsm/crop_calendars/generate_gdd20_baseline.py index 7f60fb6a68..71125e332d 100644 --- a/python/ctsm/crop_calendars/generate_gdd20_baseline.py +++ b/python/ctsm/crop_calendars/generate_gdd20_baseline.py @@ -17,8 +17,10 @@ # pylint: disable=wrong-import-position from ctsm.crop_calendars.import_ds import import_ds import ctsm.crop_calendars.cropcal_utils as utils +from ctsm.crop_calendars.grid_one_variable import grid_one_variable VAR_LIST_IN = ["GDD0X", "GDD8X", "GDD10X"] +GRIDDING_VAR_LIST = ["patches1d_ixy", "patches1d_jxy", "lat", "lon"] MISSING_FILL = -1 # Something impossible to ensure that you can mark it as a missing value, to be # bilinear-interpolated STREAM_YEAR = 2000 # The year specified for stream_yearFirst and stream_yearLast in the call of @@ -171,7 +173,7 @@ def generate_gdd20_baseline(input_files, output_file, author): input_files.sort() # Import history files and ensure they have lat/lon dims - ds_in = import_ds(input_files, VAR_LIST_IN) + ds_in = import_ds(input_files, VAR_LIST_IN + GRIDDING_VAR_LIST) if not all(x in ds_in.dims for x in ["lat", "lon"]): raise RuntimeError("Input files must have lat and lon dimensions") @@ -188,8 +190,11 @@ def generate_gdd20_baseline(input_files, output_file, author): dummy_da = _add_time_axis(dummy_da) # Process all crops + data_var_dict = {} + for v in GRIDDING_VAR_LIST: + data_var_dict[v] = ds_in[v] ds_out = xr.Dataset( - data_vars=None, + data_vars=data_var_dict, attrs={ "author": author, "created": dt.datetime.now().astimezone().isoformat(), @@ -228,6 +233,10 @@ def generate_gdd20_baseline(input_files, output_file, author): ds_out[var_out] = this_da encoding_dict[var_out] = {"dtype": "float64"} + # Grid, if needed + if any(x not in this_da.dims for x in ["lat", "lon"]): + ds_out[var_out] = grid_one_variable(ds_out, var_out) + # Save ds_out.to_netcdf(output_file, format="NETCDF3_CLASSIC", encoding=encoding_dict) From 8b43fec5168d56df1b7c5ac6e22635d70024c3b0 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Mon, 3 Jun 2024 11:28:32 -0600 Subject: [PATCH 0414/1248] generate_gdd20_baseline: Improve long names. --- python/ctsm/crop_calendars/generate_gdd20_baseline.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/ctsm/crop_calendars/generate_gdd20_baseline.py b/python/ctsm/crop_calendars/generate_gdd20_baseline.py index 71125e332d..89a38a0a08 100644 --- a/python/ctsm/crop_calendars/generate_gdd20_baseline.py +++ b/python/ctsm/crop_calendars/generate_gdd20_baseline.py @@ -219,7 +219,7 @@ def generate_gdd20_baseline(input_files, output_file, author): # this_da = ds_in[gddn].fillna(MISSING_FILL) this_da = ds_in[gddn] this_da = _add_time_axis(this_da) - long_name = gddn + long_name = gddn.replace("X", "20") print(f" {gddn}") # Add attributes From dcacbd4003585edf1a8608bc9d70232285f01202 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Mon, 3 Jun 2024 11:47:38 -0600 Subject: [PATCH 0415/1248] Minor cleanup in UpdateAccVars_CropGDDs. --- src/biogeophys/TemperatureType.F90 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/biogeophys/TemperatureType.F90 b/src/biogeophys/TemperatureType.F90 index f8d5206a1e..5ae0b7b20c 100644 --- a/src/biogeophys/TemperatureType.F90 +++ b/src/biogeophys/TemperatureType.F90 @@ -1428,11 +1428,11 @@ subroutine UpdateAccVars_CropGDDs(this, rbufslp, begp, endp, month, day, secs, d ((month > 9 .or. month < 4) .and. lat < 0._r8) ! Replace with read-in gdd20 accumulation season, if valid ! (If these aren't being read in or they're invalid, they'll be -1) - gdd20_season_start = crop_inst%gdd20_season_start_patch(p) - gdd20_season_end = crop_inst%gdd20_season_end_patch(p) + gdd20_season_start = gdd20_season_starts(p) + gdd20_season_end = gdd20_season_ends(p) if (gdd20_season_start >= 1 .and. gdd20_season_end >= 1) then in_accumulation_season = is_doy_in_interval( & - gdd20_season_starts(p), gdd20_season_ends(p), day) + gdd20_season_start, gdd20_season_end, day) end if if (month==1 .and. day==1 .and. secs==dtime) then From 2cf491da0127f1caeec5ae6d7152d637f2975599 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Mon, 3 Jun 2024 11:53:44 -0600 Subject: [PATCH 0416/1248] Add outputs: GDD20_BASELINE, GDD20_SEASON_START/END. --- src/biogeochem/CropType.F90 | 28 +++++++++++++++++++++---- src/biogeophys/TemperatureType.F90 | 5 +++-- src/cpl/share_esmf/cropcalStreamMod.F90 | 18 ++++++++++------ 3 files changed, 39 insertions(+), 12 deletions(-) diff --git a/src/biogeochem/CropType.F90 b/src/biogeochem/CropType.F90 index 04806f9349..fdfdaa05aa 100644 --- a/src/biogeochem/CropType.F90 +++ b/src/biogeochem/CropType.F90 @@ -53,8 +53,11 @@ module CropType integer , pointer :: rx_swindow_ends_thisyr_patch (:,:) ! all prescribed sowing window end dates for this patch this year (day of year) [patch, mxsowings] real(r8), pointer :: rx_cultivar_gdds_thisyr_patch (:,:) ! all cultivar GDD targets for this patch this year (ddays) [patch, mxsowings] real(r8), pointer :: gdd20_baseline_patch (:) ! GDD20 baseline for this patch (ddays) [patch] - integer , pointer :: gdd20_season_start_patch(:) ! gdd20 season start date for this patch (day of year) [patch] - integer , pointer :: gdd20_season_end_patch (:) ! gdd20 season end date for this patch (day of year) [patch] + + ! REAL FOR DEVELOPMENT ONLY; REVERT TO INTEGER BEFORE MERGE + real(r8), pointer :: gdd20_season_start_patch(:) ! gdd20 season start date for this patch (day of year) [patch] + real(r8), pointer :: gdd20_season_end_patch (:) ! gdd20 season end date for this patch (day of year) [patch] + real(r8), pointer :: sdates_thisyr_patch (:,:) ! all actual sowing dates for this patch this year (day of year) [patch, mxsowings] real(r8), pointer :: swindow_starts_thisyr_patch(:,:) ! all sowing window start dates for this patch this year (day of year) [patch, mxsowings] real(r8), pointer :: swindow_ends_thisyr_patch (:,:) ! all sowing window end dates for this patch this year (day of year) [patch, mxsowings] @@ -239,8 +242,11 @@ subroutine InitAllocate(this, bounds) allocate(this%rx_swindow_ends_thisyr_patch(begp:endp,1:mxsowings)) ; this%rx_swindow_ends_thisyr_patch (:,:) = -1 allocate(this%rx_cultivar_gdds_thisyr_patch(begp:endp,1:mxsowings)) ; this%rx_cultivar_gdds_thisyr_patch(:,:) = spval allocate(this%gdd20_baseline_patch(begp:endp)) ; this%gdd20_baseline_patch(:) = spval - allocate(this%gdd20_season_start_patch(begp:endp)); this%gdd20_season_start_patch(:) = -1 - allocate(this%gdd20_season_end_patch(begp:endp)) ; this%gdd20_season_end_patch (:) = -1 + + ! REAL FOR DEVELOPMENT ONLY; REVERT TO INTEGER BEFORE MERGE + allocate(this%gdd20_season_start_patch(begp:endp)); this%gdd20_season_start_patch(:) = spval + allocate(this%gdd20_season_end_patch(begp:endp)) ; this%gdd20_season_end_patch (:) = spval + allocate(this%sdates_thisyr_patch(begp:endp,1:mxsowings)) ; this%sdates_thisyr_patch(:,:) = spval allocate(this%swindow_starts_thisyr_patch(begp:endp,1:mxsowings)) ; this%swindow_starts_thisyr_patch(:,:) = spval allocate(this%swindow_ends_thisyr_patch (begp:endp,1:mxsowings)) ; this%swindow_ends_thisyr_patch (:,:) = spval @@ -364,6 +370,20 @@ subroutine InitHistory(this, bounds) avgflag='I', long_name='Reason for each crop harvest; should only be output annually', & ptr_patch=this%harvest_reason_thisyr_patch, default='inactive') + ! DEVELOPMENT ONLY; DELETE BEFORE MERGE + this%gdd20_baseline_patch(begp:endp) = spval + call hist_addfld1d (fname='GDD20_BASELINE', units='ddays', & + avgflag='A', long_name='Baseline mean growing-degree days accumulated during accumulation period (from input)', & + ptr_patch=this%gdd20_baseline_patch, default='inactive') + this%gdd20_season_start_patch(begp:endp) = spval + call hist_addfld1d (fname='GDD20_SEASON_START', units='day of year', & + avgflag='A', long_name='Start of the GDD20 accumulation season (from input)', & + ptr_patch=this%gdd20_season_start_patch, default='inactive') + this%gdd20_season_end_patch(begp:endp) = spval + call hist_addfld1d (fname='GDD20_SEASON_END', units='day of year', & + avgflag='A', long_name='End of the GDD20 accumulation season (from input)', & + ptr_patch=this%gdd20_season_end_patch, default='inactive') + end subroutine InitHistory subroutine InitCold(this, bounds) diff --git a/src/biogeophys/TemperatureType.F90 b/src/biogeophys/TemperatureType.F90 index 5ae0b7b20c..ae5703237e 100644 --- a/src/biogeophys/TemperatureType.F90 +++ b/src/biogeophys/TemperatureType.F90 @@ -1428,8 +1428,9 @@ subroutine UpdateAccVars_CropGDDs(this, rbufslp, begp, endp, month, day, secs, d ((month > 9 .or. month < 4) .and. lat < 0._r8) ! Replace with read-in gdd20 accumulation season, if valid ! (If these aren't being read in or they're invalid, they'll be -1) - gdd20_season_start = gdd20_season_starts(p) - gdd20_season_end = gdd20_season_ends(p) + ! REAL FOR DEVELOPMENT ONLY; REVERT TO INTEGER BEFORE MERGE + gdd20_season_start = int(gdd20_season_starts(p)) + gdd20_season_end = int(gdd20_season_ends(p)) if (gdd20_season_start >= 1 .and. gdd20_season_end >= 1) then in_accumulation_season = is_doy_in_interval( & gdd20_season_start, gdd20_season_end, day) diff --git a/src/cpl/share_esmf/cropcalStreamMod.F90 b/src/cpl/share_esmf/cropcalStreamMod.F90 index ce595c0d70..802b669905 100644 --- a/src/cpl/share_esmf/cropcalStreamMod.F90 +++ b/src/cpl/share_esmf/cropcalStreamMod.F90 @@ -766,8 +766,10 @@ subroutine cropcal_interp(bounds, num_pcropp, filter_pcropp, init, crop_inst) n = ivt - npcropmin + 1 ! vegetated pft ig = g_to_ig(patch%gridcell(p)) - gdd20_season_starts(p) = dataptr2d_gdd20_season_start(ig,n) - gdd20_season_ends(p) = dataptr2d_gdd20_season_end (ig,n) + + ! REAL FOR DEVELOPMENT ONLY; REVERT TO INTEGER BEFORE MERGE + gdd20_season_starts(p) = real(dataptr2d_gdd20_season_start(ig,n), r8) + gdd20_season_ends(p) = real(dataptr2d_gdd20_season_end (ig,n), r8) else write(iulog,'(a,i0)') 'cropcal_interp(), gdd20 seasons: Crop patch has ivt ',ivt call ESMF_Finalize(endflag=ESMF_END_ABORT) @@ -775,15 +777,18 @@ subroutine cropcal_interp(bounds, num_pcropp, filter_pcropp, init, crop_inst) end do ! Handle invalid gdd20 season values - if (any(gdd20_season_starts(begp:endp) < 1 .or. gdd20_season_ends(begp:endp) < 1)) then + ! gdd20_season_starts and gdd20_season_ends REAL FOR DEVELOPMENT ONLY; REVERT TO INTEGER BEFORE MERGE + if (any(gdd20_season_starts(begp:endp) < 1._r8 .or. gdd20_season_ends(begp:endp) < 1._r8)) then ! Fail if not allowing fallback to paramfile sowing windows - if ((.not. allow_invalid_gdd20_season_inputs) .and. any(gdd20_season_starts(begp:endp) < 1 .and. patch%wtgcell(begp:endp) > 0._r8 .and. patch%itype(begp:endp) >= npcropmin)) then + ! gdd20_season_starts REAL FOR DEVELOPMENT ONLY; REVERT TO INTEGER BEFORE MERGE + if ((.not. allow_invalid_gdd20_season_inputs) .and. any(gdd20_season_starts(begp:endp) < 1._r8 .and. patch%wtgcell(begp:endp) > 0._r8 .and. patch%itype(begp:endp) >= npcropmin)) then write(iulog, *) 'At least one crop in one gridcell has invalid gdd20 season start date(s). To ignore and fall back to paramfile sowing windows, set allow_invalid_gdd20_season_inputs to .true.' write(iulog, *) 'Affected crops:' do ivt = npcropmin, mxpft do fp = 1, num_pcropp p = filter_pcropp(fp) - if (ivt == patch%itype(p) .and. patch%wtgcell(p) > 0._r8 .and. gdd20_season_starts(p) < 1) then + ! gdd20_season_starts REAL FOR DEVELOPMENT ONLY; REVERT TO INTEGER BEFORE MERGE + if (ivt == patch%itype(p) .and. patch%wtgcell(p) > 0._r8 .and. gdd20_season_starts(p) < 1._r8) then write(iulog, *) ' ',pftname(ivt),' (',ivt,')' exit ! Stop looking for patches of this type end if @@ -792,7 +797,8 @@ subroutine cropcal_interp(bounds, num_pcropp, filter_pcropp, init, crop_inst) call ESMF_Finalize(endflag=ESMF_END_ABORT) ! Fail if a gdd20 season start date is given without an end date (or vice versa) - else if (any((gdd20_season_starts(begp:endp) >= 1 .and. gdd20_season_ends(begp:endp) < 1) .or. (gdd20_season_starts(begp:endp) < 1 .and. gdd20_season_ends(begp:endp) >= 1))) then + ! gdd20_season_starts and gdd20_season_ends REAL FOR DEVELOPMENT ONLY; REVERT TO INTEGER BEFORE MERGE + else if (any((gdd20_season_starts(begp:endp) >= 1._r8 .and. gdd20_season_ends(begp:endp) < 1._r8) .or. (gdd20_season_starts(begp:endp) < 1._r8 .and. gdd20_season_ends(begp:endp) >= 1._r8))) then write(iulog, *) 'Every gdd20 season start date must have a corresponding end date.' call ESMF_Finalize(endflag=ESMF_END_ABORT) end if From 0083a08432859948707cf4e8e7b4937dc7f1d92c Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Mon, 3 Jun 2024 12:03:15 -0600 Subject: [PATCH 0417/1248] rxcropmaturity.py is now parent rxcropmaturityshared.py. --- ...ropmaturity.py => rxcropmaturityshared.py} | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) rename cime_config/SystemTests/{rxcropmaturity.py => rxcropmaturityshared.py} (97%) diff --git a/cime_config/SystemTests/rxcropmaturity.py b/cime_config/SystemTests/rxcropmaturityshared.py similarity index 97% rename from cime_config/SystemTests/rxcropmaturity.py rename to cime_config/SystemTests/rxcropmaturityshared.py index 75fff8a0e0..f8e4b1c9bb 100644 --- a/cime_config/SystemTests/rxcropmaturity.py +++ b/cime_config/SystemTests/rxcropmaturityshared.py @@ -11,6 +11,10 @@ code do the interpolation. However, that wouldn't act on harvest dates (which are needed for generate_gdds.py). I could have Python interpolate those, but this would cause a potential inconsistency. + +Note that this is just a parent class. The actual tests are RXCROPMATURITY and +RXCROPMATURITY_SKIPRUN, the latter of which does everything except perform and +check the CTSM runs. """ import os @@ -25,7 +29,7 @@ logger = logging.getLogger(__name__) -class RXCROPMATURITY(SystemTestsCommon): +class RXCROPMATURITYSHARED(SystemTestsCommon): def __init__(self, case): # initialize an object interface to the SMS system test SystemTestsCommon.__init__(self, case) @@ -84,7 +88,7 @@ def __init__(self, case): # Which conda environment should we use? self._get_conda_env() - def run_phase(self): + def _run_phase(self, skip_run=False): # Modeling this after the SSP test, we create a clone to be the case whose outputs we don't # want to be saved as baseline. @@ -146,9 +150,10 @@ def run_phase(self): # "No history files expected, set suffix=None to avoid compare error" # We *do* expect history files here, but anyway. This works. self._skip_pnl = False - self.run_indv(suffix=None, st_archive=True) - self._run_generate_gdds(case_gddgen) + if not skip_run: + self.run_indv(suffix=None, st_archive=True) + self._run_generate_gdds(case_gddgen) # ------------------------------------------------------------------- # (3) Set up and perform Prescribed Calendars run @@ -168,13 +173,15 @@ def run_phase(self): ] ) - self.run_indv() + if not skip_run: + self.run_indv() # ------------------------------------------------------------------- # (4) Check Prescribed Calendars run # ------------------------------------------------------------------- logger.info("RXCROPMATURITY log: output check: Prescribed Calendars") - self._run_check_rxboth_run() + if not skip_run: + self._run_check_rxboth_run() # Get sowing and harvest dates for this resolution. def _get_rx_dates(self): From f728f9676e5103298dd255fcec2a6796d22e0144 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Mon, 3 Jun 2024 13:44:07 -0600 Subject: [PATCH 0418/1248] Added back RXCROPMATURITY. --- cime_config/SystemTests/rxcropmaturity.py | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 cime_config/SystemTests/rxcropmaturity.py diff --git a/cime_config/SystemTests/rxcropmaturity.py b/cime_config/SystemTests/rxcropmaturity.py new file mode 100644 index 0000000000..3eadccfeb3 --- /dev/null +++ b/cime_config/SystemTests/rxcropmaturity.py @@ -0,0 +1,5 @@ +from RXCROPMATURITYSHARED import RXCROPMATURITYSHARED + +class RXCROPMATURITY(RXCROPMATURITYSHARED): + def run_phase(self): + self._run_phase() \ No newline at end of file From e4b97a233cd722ab915a9b0be27f5ece509c8ca9 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Mon, 3 Jun 2024 13:44:51 -0600 Subject: [PATCH 0419/1248] Add RXCROPMATURITYSKIPRUN. --- cime_config/SystemTests/rxcropmaturityskiprun.py | 6 ++++++ cime_config/config_tests.xml | 10 ++++++++++ 2 files changed, 16 insertions(+) create mode 100644 cime_config/SystemTests/rxcropmaturityskiprun.py diff --git a/cime_config/SystemTests/rxcropmaturityskiprun.py b/cime_config/SystemTests/rxcropmaturityskiprun.py new file mode 100644 index 0000000000..d52742f95a --- /dev/null +++ b/cime_config/SystemTests/rxcropmaturityskiprun.py @@ -0,0 +1,6 @@ +print("pre-import") +from RXCROPMATURITYSHARED import RXCROPMATURITYSHARED + +class RXCROPMATURITYSKIPRUN(RXCROPMATURITYSHARED): + def run_phase(self): + self._run_phase(skip_run=True) \ No newline at end of file diff --git a/cime_config/config_tests.xml b/cime_config/config_tests.xml index c0b6afed9d..98434da10e 100644 --- a/cime_config/config_tests.xml +++ b/cime_config/config_tests.xml @@ -133,6 +133,16 @@ This defines various CTSM-specific system tests $STOP_N + + As RXCROPMATURITY but don't actually run or postprocess; just setup + 1 + FALSE + FALSE + never + $STOP_OPTION + $STOP_N + + + diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index 1ac2334ba8..b40f00d5a6 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -2913,7 +2913,7 @@ - + diff --git a/cime_config/usermods_dirs/PLUMBER2/defaults/user_nl_datm_streams b/cime_config/usermods_dirs/PLUMBER2/defaults/user_nl_datm_streams index 35071ff415..29a8c675ac 100644 --- a/cime_config/usermods_dirs/PLUMBER2/defaults/user_nl_datm_streams +++ b/cime_config/usermods_dirs/PLUMBER2/defaults/user_nl_datm_streams @@ -21,7 +21,7 @@ ! foo:year_first = 1950 ! would change the stream year_first stream_entry to 1950 for the foo stream block !------------------------------------------------------------------------ -! This will come out when cdeps externals are updated +! This will come out when the cdeps submodule are updated CLM_USRDAT.PLUMBER2:datavars = ZBOT Sa_z, \ TBOT Sa_tbot, \ QBOT Sa_shum, \ diff --git a/doc/README.CHECKLIST.master_tags b/doc/README.CHECKLIST.master_tags index 0da52acaaa..51386c4238 100644 --- a/doc/README.CHECKLIST.master_tags +++ b/doc/README.CHECKLIST.master_tags @@ -14,7 +14,7 @@ https://github.com/ESCOMP/ctsm/wiki/CTSM-development-workflow 2a -- run 'git pull' to pull in the latest version from GitHub 2b -- run 'git status' and/or 'git diff' to make sure you don't have any uncommitted local changes - 2c -- run './bin/git-fleximod status' to make sure all externals are + 2c -- run './bin/git-fleximod status' to make sure all submodules are updated and don't have any uncommitted changes. If any are marked with 's' in the first column, run './bin/git-fleximod update'. @@ -26,7 +26,7 @@ https://github.com/ESCOMP/ctsm/wiki/CTSM-development-workflow $EDITOR cime_config/testdefs/ExpectedTestFails.xml 3c -- make sure you understand any changes to the baselines -- to document in ChangeLog 3d -- Check the log file for run_sys_tests (../run_sys_test.log), to make sure that - externals are correct (see 2c above) + submodules are correct (see 2c above) (4) Use diff and status to make sure any new files are in the repo and only the correct changes are on the branch diff --git a/python/ctsm/run_sys_tests.py b/python/ctsm/run_sys_tests.py index ecea2342a7..f5a7ed04dc 100644 --- a/python/ctsm/run_sys_tests.py +++ b/python/ctsm/run_sys_tests.py @@ -124,7 +124,7 @@ def run_sys_tests( cime_path (str): path to root of cime skip_testroot_creation (bool): if True, assume the testroot directory has already been created, so don't try to recreate it or re-make the link to it - skip_git_status (bool): if True, skip printing git and manage_externals status + skip_git_status (bool): if True, skip printing git and git-fleximod status dry_run (bool): if True, print commands to be run but don't run them suite_name (str): name of test suite/category to run testfile (str): path to file containing list of tests to run @@ -476,11 +476,11 @@ def _commandline_args(): parser.add_argument( "--skip-git-status", action="store_true", - help="Skip printing git and manage_externals status,\n" + help="Skip printing git and git-fleximod status,\n" "both to screen and to the SRCROOT_GIT_STATUS file in TESTROOT.\n" "This printing can often be helpful, but this option can be used to\n" "avoid extraneous output, to reduce the time needed to run this script,\n" - "or if git or manage_externals are currently broken in your sandbox.\n", + "or if git or git-fleximod are currently broken in your sandbox.\n", ) parser.add_argument( diff --git a/python/ctsm/test/test_unit_gen_mksurfdata_jobscript_single.py b/python/ctsm/test/test_unit_gen_mksurfdata_jobscript_single.py index 5038c6b3e1..8b8e2df32a 100755 --- a/python/ctsm/test/test_unit_gen_mksurfdata_jobscript_single.py +++ b/python/ctsm/test/test_unit_gen_mksurfdata_jobscript_single.py @@ -136,7 +136,7 @@ def test_simple_derecho_args(self): def test_derecho_mpirun(self): """ test derecho mpirun. This would've helped caught a problem we ran into - It will also be helpful when externals are updated to guide to solutions + It will also be helpful when sumodules are updated to guide to solutions to problems """ machine = "derecho" diff --git a/tools/mksurfdata_esmf/README.md b/tools/mksurfdata_esmf/README.md index 3d19c88ff0..a9c0b80de6 100644 --- a/tools/mksurfdata_esmf/README.md +++ b/tools/mksurfdata_esmf/README.md @@ -41,7 +41,7 @@ In addition for the build: python, bash-shell, CMake and GNU-Make are required These libraries need to be built such that they can all work together in the same executable. Hence, the above order may be required in building them. -CTSM externals that are required are: cime and ccs_config. See [Building](#building-the-executable) on getting +CTSM submodules that are required are: cime and ccs_config. See [Building](#building-the-executable) on getting those. A python environment that includes particular packages is also required we demonstrate how to use the ctsm_pylib environment that we support in CTSM. From e65c2034682afd9e5024361415c9002f8d82ca60 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Fri, 7 Jun 2024 13:49:07 -0600 Subject: [PATCH 0469/1248] Start the changelog --- doc/ChangeLog | 90 +++++++++++++++++++++++++++++++++++++++++++++++++++ doc/ChangeSum | 1 + 2 files changed, 91 insertions(+) diff --git a/doc/ChangeLog b/doc/ChangeLog index 8b6bb8f0d2..4600af34be 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,4 +1,94 @@ =============================================================== +Tag name: ctsm5.2.008 +Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326) +Date: Fri 07 Jun 2024 01:23:07 PM MDT +One-line Summary: Another update of git-fleximod + +Purpose and description of changes +---------------------------------- + +Just update the gitfleximod subtree to v0.7.7. This fixes an issue in identifying that a tag is out of sync in a submodule. +An issue about recursion on a submodule. Allows untracked files, and fixes a MS Window Memory error. + + +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_1 + +[ ] clm5_0 + +[ ] ctsm5_0-nwp + +[ ] clm4_5 + + +Bugs fixed +---------- + +List of CTSM issues fixed: + Fixes #2591 -- Start using submodule rather than external + +Notes of particular relevance for users +--------------------------------------- +Caveats for users (e.g., need to interpolate initial conditions): + doc-builder checkout seems to be required to use "git commit ." at the top level + +Changes to documentation: + Tweak some of the documentation around git-fleximod and use submodule rather than external. + +Notes of particular relevance for developers: +--------------------------------------------- +NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide +[Remove any lines that don't apply. Remove entire section if nothing applies.] + + +Testing summary: minimual +---------------- + + [PASS means all tests PASS; OK means tests PASS other than expected fails.] + + build-namelist tests (if CLMBuildNamelist.pm has changed): + + derecho - + + python testing (if python code has changed; see instructions in python/README.md; document testing done): + + (any machine) - + + regular tests (aux_clm: https://github.com/ESCOMP/CTSM/wiki/System-Testing-Guide#pre-merge-system-testing): + + derecho ----- + izumi ------- + + any other testing (give details below): + +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 +------------- +List any git submodules updated (cime, rtm, mosart, cism, fates, etc.): + git-fleximod subtree updated + +Pull Requests that document the changes (include PR ids): + #2577 -- Update git-fleximod +(https://github.com/ESCOMP/ctsm/pull) + +=============================================================== +=============================================================== Tag name: ctsm5.2.007 Originator(s): jedwards4b (Jim Edwards, UCAR/CGD) slevis (Sam Levis, UCAR/CGD) Date: Fri 31 May 2024 13:49:29 AM MDT diff --git a/doc/ChangeSum b/doc/ChangeSum index b3f1632571..275c4a5cfa 100644 --- a/doc/ChangeSum +++ b/doc/ChangeSum @@ -1,5 +1,6 @@ Tag Who Date Summary ============================================================================================================================ + ctsm5.2.008 erik 06/07/2024 Another update of git-fleximod ctsm5.2.007 multiple 05/31/2024 Rm manage_externals and update documentation accordingly ctsm5.2.006 slevis 05/28/2024 Update externals to cesm2_3_beta17, remove mct, retire /test/tools ctsm5.2.005 erik 05/13/2024 Fix clm6_0 defaults and CESM testing issues, add tests to detect these problems From dfebe5fdbdce10ba25cbdc6419c95f41f82f3848 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Fri, 7 Jun 2024 14:08:42 -0600 Subject: [PATCH 0470/1248] Remove user_nl_clm (added in 5431850) and replace 2 NIWO tests with HARV --- cime_config/testdefs/ExpectedTestFails.xml | 17 +---------------- cime_config/testdefs/testlist_clm.xml | 6 +++--- cime_config/usermods_dirs/NEON/NIWO/user_nl_clm | 8 -------- 3 files changed, 4 insertions(+), 27 deletions(-) delete mode 100644 cime_config/usermods_dirs/NEON/NIWO/user_nl_clm diff --git a/cime_config/testdefs/ExpectedTestFails.xml b/cime_config/testdefs/ExpectedTestFails.xml index 03f60ad824..5968e73760 100644 --- a/cime_config/testdefs/ExpectedTestFails.xml +++ b/cime_config/testdefs/ExpectedTestFails.xml @@ -78,15 +78,11 @@ - + FAIL #2310 - - FAIL - #2310 - @@ -100,17 +96,6 @@ - - - FAIL - #2310 - - - FAIL - #2310 - - - FAIL diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index 782af8bc34..9a2390bd58 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -2257,7 +2257,7 @@ - + @@ -2268,7 +2268,7 @@ - + @@ -2276,7 +2276,7 @@ - + diff --git a/cime_config/usermods_dirs/NEON/NIWO/user_nl_clm b/cime_config/usermods_dirs/NEON/NIWO/user_nl_clm deleted file mode 100644 index cf427d738b..0000000000 --- a/cime_config/usermods_dirs/NEON/NIWO/user_nl_clm +++ /dev/null @@ -1,8 +0,0 @@ -! 20240604 slevis introduced this file to bypass test failures in the -! cnmatrix branch (so cnmatrix on by default) with two izumi tests: -! SMS_Ld10_D_Mmpi-serial.CLM_USRDAT.I1PtClm60Bgc.izumi_nag.clm-default--clm-NEON-NIWO--clm-matrixcnOn -! SMS_Ld10_D_Mmpi-serial.CLM_USRDAT.I1PtClm60Bgc.izumi_nag.clm-default--clm-NEON-NIWO -! when the tests point to the default finidat, as documented in this post: -! https://github.com/ESCOMP/CTSM/pull/640#issuecomment-2143101361 -use_init_interp = .true. -finidat = '$DIN_LOC_ROOT/lnd/clm2/initdata_esmf/ctsm5.2/clmi.I2000Clm50BgcCrop.2011-01-01.1.9x2.5_gx1v7_gl4_simyr2000_c240223.nc' From 3041578054a85aba53840a421987cce6b9c4b887 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Mon, 10 Jun 2024 09:53:12 -0600 Subject: [PATCH 0471/1248] Move stream_gdd20_seasons stuff to controlMod. --- bld/namelist_files/namelist_definition_ctsm.xml | 2 +- src/cpl/share_esmf/cropcalStreamMod.F90 | 3 --- src/main/controlMod.F90 | 4 +++- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/bld/namelist_files/namelist_definition_ctsm.xml b/bld/namelist_files/namelist_definition_ctsm.xml index 675c912900..b510b14ccb 100644 --- a/bld/namelist_files/namelist_definition_ctsm.xml +++ b/bld/namelist_files/namelist_definition_ctsm.xml @@ -1839,7 +1839,7 @@ Filename of input stream data for baseline GDD20 values + group="clm_inparm" valid_values="" > Set this to true to read gdd20 accumulation season start and end dates from stream files, rather than using hard-coded hemisphere-specific "warm seasons." diff --git a/src/cpl/share_esmf/cropcalStreamMod.F90 b/src/cpl/share_esmf/cropcalStreamMod.F90 index 80314ee947..939ef67c91 100644 --- a/src/cpl/share_esmf/cropcalStreamMod.F90 +++ b/src/cpl/share_esmf/cropcalStreamMod.F90 @@ -113,7 +113,6 @@ subroutine cropcal_init(bounds) stream_meshfile_cropcal, & cropcals_rx, & cropcals_rx_adapt, & - stream_gdd20_seasons, & allow_invalid_gdd20_season_inputs, & stream_fldFileName_gdd20_season_start, & stream_fldFileName_gdd20_season_end @@ -131,7 +130,6 @@ subroutine cropcal_init(bounds) stream_fldFileName_swindow_end = '' stream_fldFileName_cultivar_gdds = '' stream_fldFileName_gdd20_baseline = '' - stream_gdd20_seasons = .false. allow_invalid_gdd20_season_inputs = .false. stream_fldFileName_gdd20_season_start = '' stream_fldFileName_gdd20_season_end = '' @@ -175,7 +173,6 @@ subroutine cropcal_init(bounds) call shr_mpi_bcast(stream_fldFileName_cultivar_gdds, mpicom) call shr_mpi_bcast(stream_fldFileName_gdd20_baseline, mpicom) call shr_mpi_bcast(stream_meshfile_cropcal , mpicom) - call shr_mpi_bcast(stream_gdd20_seasons, mpicom) call shr_mpi_bcast(allow_invalid_gdd20_season_inputs, mpicom) call shr_mpi_bcast(stream_fldFileName_gdd20_season_start, mpicom) call shr_mpi_bcast(stream_fldFileName_gdd20_season_end, mpicom) diff --git a/src/main/controlMod.F90 b/src/main/controlMod.F90 index 46d9e9958a..aabe753769 100644 --- a/src/main/controlMod.F90 +++ b/src/main/controlMod.F90 @@ -302,7 +302,7 @@ subroutine control_init(dtime) use_lch4, use_nitrif_denitrif, use_extralakelayers, & use_vichydro, use_cn, use_cndv, use_crop, use_fertilizer, & use_grainproduct, use_snicar_frc, use_vancouver, use_mexicocity, use_noio, & - use_nguardrail, crop_residue_removal_frac + use_nguardrail, crop_residue_removal_frac, stream_gdd20_seasons ! SNICAR namelist /clm_inparm/ & @@ -711,6 +711,7 @@ subroutine control_spmd() call mpi_bcast (use_cndv, 1, MPI_LOGICAL, 0, mpicom, ier) call mpi_bcast (use_nguardrail, 1, MPI_LOGICAL, 0, mpicom, ier) call mpi_bcast (use_crop, 1, MPI_LOGICAL, 0, mpicom, ier) + call mpi_bcast (stream_gdd20_seasons, 1, MPI_LOGICAL, 0, mpicom, ier) call mpi_bcast (use_fertilizer, 1, MPI_LOGICAL, 0, mpicom, ier) call mpi_bcast (use_grainproduct, 1, MPI_LOGICAL, 0, mpicom, ier) call mpi_bcast (crop_residue_removal_frac, 1, MPI_REAL8, 0, mpicom, ier) @@ -983,6 +984,7 @@ subroutine control_print () write(iulog,*) ' use_cn = ', use_cn write(iulog,*) ' use_cndv = ', use_cndv write(iulog,*) ' use_crop = ', use_crop + write(iulog,*) ' stream_gdd20_seasons = ', stream_gdd20_seasons write(iulog,*) ' use_fertilizer = ', use_fertilizer write(iulog,*) ' use_grainproduct = ', use_grainproduct write(iulog,*) ' crop_residue_removal_frac = ', crop_residue_removal_frac From 801fa0149668da07902da55ba14c217c30c2a08d Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Mon, 10 Jun 2024 10:45:00 -0600 Subject: [PATCH 0472/1248] CLMBuildNamelist: Always set stream_meshfile_cropcal. --- bld/CLMBuildNamelist.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index d5c2ffd54f..8bffec0d46 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -4178,6 +4178,7 @@ sub setup_logic_cropcal_streams { add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_gdd20_seasons'); add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'generate_crop_gdds'); add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'use_mxmat'); + add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_meshfile_cropcal'); # These can't both be true my $cropcals_rx = $nl->get_value('cropcals_rx') ; @@ -4208,7 +4209,6 @@ sub setup_logic_cropcal_streams { 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_meshfile_cropcal'); if ( &value_is_true($cropcals_rx_adapt) ) { add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_fldFileName_gdd20_baseline'); } @@ -4220,7 +4220,7 @@ sub setup_logic_cropcal_streams { my $gdd_file = $nl->get_value('stream_fldFileName_cultivar_gdds') ; my $gdd20_baseline_file = $nl->get_value('stream_fldFileName_gdd20_baseline') ; my $mesh_file = $nl->get_value('stream_meshfile_cropcal') ; - if ( !&string_is_undef_or_empty($swindow_start_file) or !&string_is_undef_or_empty($swindow_end_file) or !&string_is_undef_or_empty($gdd_file) or !&string_is_undef_or_empty($gdd20_baseline_file) or !&string_is_undef_or_empty($mesh_file)) { + if ( !&string_is_undef_or_empty($swindow_start_file) or !&string_is_undef_or_empty($swindow_end_file) or !&string_is_undef_or_empty($gdd_file) or !&string_is_undef_or_empty($gdd20_baseline_file)) { # User gave an input file without specifying cropcals_rx or cropcals_rx_adapt = .true. # Requiring this means nothing to the code, but helps namelist make more sense From dcff4f8eb9217ad9ad340957ddf7d5f01698c8dc Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Mon, 10 Jun 2024 11:10:32 -0600 Subject: [PATCH 0473/1248] Set gdd20 season start/end NaNs to -1. --- src/cpl/share_esmf/cropcalStreamMod.F90 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/cpl/share_esmf/cropcalStreamMod.F90 b/src/cpl/share_esmf/cropcalStreamMod.F90 index 939ef67c91..0a04278aa9 100644 --- a/src/cpl/share_esmf/cropcalStreamMod.F90 +++ b/src/cpl/share_esmf/cropcalStreamMod.F90 @@ -744,7 +744,9 @@ subroutine cropcal_interp(bounds, num_pcropp, filter_pcropp, init, crop_inst) ! If read-in value is invalid, set to -1. Will be handled later in this subroutine. if (dataptr1d_gdd20_season_start(g) <= 0 .or. dataptr1d_gdd20_season_start(g) > 366 & - .or. dataptr1d_gdd20_season_end(g) <= 0 .or. dataptr1d_gdd20_season_end(g) > 366) then + .or. dataptr1d_gdd20_season_end(g) <= 0 .or. dataptr1d_gdd20_season_end(g) > 366 & + .or. dataptr1d_gdd20_season_start(g) /= dataptr1d_gdd20_season_start(g) & + .or. dataptr1d_gdd20_season_end(g) /= dataptr1d_gdd20_season_end(g)) then dataptr1d_gdd20_season_start(g) = -1 dataptr1d_gdd20_season_end (g) = -1 end if From fbe292d49b348ee0649527497b86ab8810222361 Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Mon, 10 Jun 2024 11:34:50 -0600 Subject: [PATCH 0474/1248] removing c13 from allvars until it is fixed --- .../testdefs/testmods_dirs/clm/FatesColdAllVars/user_nl_clm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesColdAllVars/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/FatesColdAllVars/user_nl_clm index a426c775b0..92434df000 100644 --- a/cime_config/testdefs/testmods_dirs/clm/FatesColdAllVars/user_nl_clm +++ b/cime_config/testdefs/testmods_dirs/clm/FatesColdAllVars/user_nl_clm @@ -26,7 +26,7 @@ hist_fincl1 = 'FATES_TLONGTERM', 'FATES_MORTALITY_CROWNSCORCH_SZPF','FATES_MORTALITY_CAMBIALBURN_SZPF','FATES_MORTALITY_TERMINATION_SZPF', 'FATES_MORTALITY_LOGGING_SZPF','FATES_MORTALITY_FREEZING_SZPF','FATES_MORTALITY_SENESCENCE_SZPF', 'FATES_MORTALITY_AGESCEN_SZPF','FATES_MORTALITY_AGESCEN_ACPF','FATES_MORTALITY_CANOPY_SZPF', -'FATES_M3_MORTALITY_CANOPY_SZPF','FATES_M3_MORTALITY_USTORY_SZPF','FATES_C13DISC_SZPF', +'FATES_M3_MORTALITY_CANOPY_SZPF','FATES_M3_MORTALITY_USTORY_SZPF', 'FATES_STOREC_CANOPY_SZPF','FATES_LEAFC_CANOPY_SZPF','FATES_LAI_CANOPY_SZPF','FATES_CROWNAREA_CANOPY_SZPF', 'FATES_CROWNAREA_USTORY_SZPF','FATES_NPLANT_CANOPY_SZPF','FATES_MORTALITY_USTORY_SZPF','FATES_STOREC_USTORY_SZPF', 'FATES_LEAFC_USTORY_SZPF','FATES_LAI_USTORY_SZPF','FATES_NPLANT_USTORY_SZPF','FATES_CWD_ABOVEGROUND_DC', From be904a7da1b5ee182f2dde09c3efa50f69d43dc1 Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Mon, 10 Jun 2024 11:39:32 -0600 Subject: [PATCH 0475/1248] using flush_allvars --- src/utils/clmfates_interfaceMod.F90 | 49 ++--------------------------- 1 file changed, 2 insertions(+), 47 deletions(-) diff --git a/src/utils/clmfates_interfaceMod.F90 b/src/utils/clmfates_interfaceMod.F90 index 98845f8e62..a405850004 100644 --- a/src/utils/clmfates_interfaceMod.F90 +++ b/src/utils/clmfates_interfaceMod.F90 @@ -1973,29 +1973,7 @@ subroutine restart( this, bounds_proc, ncid, flag, waterdiagnosticbulk_inst, & ! not overwright values outside the columns that it is in charge of. ! ------------------------------------------------------------------------ - ! tbd: fates_hist%flush_all_hvars(nc) - - if_dim1: if(fates_history_dimlevel(1)>0) then - call fates_hist%flush_hvars(nc,upfreq_in=group_hifr_simple) - if (use_fates_planthydro) then - call fates_hist%flush_hvars(nc,upfreq_in=group_hydr_simple) - end if - if(fates_history_dimlevel(1)>1) then - call fates_hist%flush_hvars(nc,upfreq_in=group_hifr_complx) - if (use_fates_planthydro) then - call fates_hist%flush_hvars(nc,upfreq_in=group_hydr_complx) - end if - end if - end if if_dim1 - - if_dim2: if(fates_history_dimlevel(2)>0) then - call fates_hist%flush_hvars(nc,upfreq_in=group_dyna_simple) - call fates_hist%flush_hvars(nc,upfreq_in=group_nflx_simple) - if(fates_history_dimlevel(2)>1) then - call fates_hist%flush_hvars(nc,upfreq_in=group_dyna_complx) - call fates_hist%flush_hvars(nc,upfreq_in=group_nflx_complx) - end if - end if if_dim2 + call fates_hist%flush_all_hvars(nc) call fates_hist%update_history_dyn( nc, & this%fates(nc)%nsites, & @@ -2181,30 +2159,7 @@ subroutine init_coldstart(this, waterstatebulk_inst, waterdiagnosticbulk_inst, & ! We also start off by setting all values on FATES columns to zero. ! ------------------------------------------------------------------------ - ! tbd: fates_hist%flush_all_hvars(nc) - - if_dim1: if(fates_history_dimlevel(1)>0) then - call fates_hist%flush_hvars(nc,upfreq_in=group_hifr_simple) - if (use_fates_planthydro) then - call fates_hist%flush_hvars(nc,upfreq_in=group_hydr_simple) - end if - if(fates_history_dimlevel(1)>1) then - call fates_hist%flush_hvars(nc,upfreq_in=group_hifr_complx) - if (use_fates_planthydro) then - call fates_hist%flush_hvars(nc,upfreq_in=group_hydr_complx) - end if - end if - end if if_dim1 - - if_dim2: if(fates_history_dimlevel(2)>0) then - call fates_hist%flush_hvars(nc,upfreq_in=group_dyna_simple) - call fates_hist%flush_hvars(nc,upfreq_in=group_nflx_simple) - if(fates_history_dimlevel(2)>1) then - call fates_hist%flush_hvars(nc,upfreq_in=group_dyna_complx) - call fates_hist%flush_hvars(nc,upfreq_in=group_nflx_complx) - end if - end if if_dim2 - + call fates_hist%flush_all_hvars(nc) call fates_hist%update_history_dyn( nc, & this%fates(nc)%nsites, & From 34d7be9d8a8d5355a709a67871f4d38e0e2f14ca Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Mon, 10 Jun 2024 11:40:26 -0600 Subject: [PATCH 0476/1248] removing unused use statements --- src/utils/clmfates_interfaceMod.F90 | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/utils/clmfates_interfaceMod.F90 b/src/utils/clmfates_interfaceMod.F90 index a405850004..e97d9b3e37 100644 --- a/src/utils/clmfates_interfaceMod.F90 +++ b/src/utils/clmfates_interfaceMod.F90 @@ -134,10 +134,6 @@ module CLMFatesInterfaceMod use FatesParametersInterface, only : fates_parameters_type use FatesInterfaceMod , only : DetermineGridCellNeighbors - use FatesIOVariableKindMod, only : group_dyna_simple, group_dyna_complx - use FatesIOVariableKindMod, only : group_hifr_simple, group_hifr_complx - use FatesIOVariableKindMod, only : group_nflx_simple, group_nflx_complx - use FatesIOVariableKindMod, only : group_hydr_simple, group_hydr_complx use FatesHistoryInterfaceMod, only : fates_hist use FatesRestartInterfaceMod, only : fates_restart_interface_type From c4ef0e73c4139e485d10303a1b19d58ef7be145b Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Mon, 10 Jun 2024 11:54:12 -0600 Subject: [PATCH 0477/1248] UpdateAccVars_CropGDDs: Skip non-crops. --- src/biogeophys/TemperatureType.F90 | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/biogeophys/TemperatureType.F90 b/src/biogeophys/TemperatureType.F90 index 1f6d0958c6..1e60293fe3 100644 --- a/src/biogeophys/TemperatureType.F90 +++ b/src/biogeophys/TemperatureType.F90 @@ -1403,6 +1403,7 @@ subroutine UpdateAccVars_CropGDDs(this, rbufslp, begp, endp, month, day, secs, d use shr_const_mod , only : SHR_CONST_CDAY, SHR_CONST_TKFRZ use accumulMod , only : update_accum_field, extract_accum_field, markreset_accum_field use clm_time_manager , only : is_doy_in_interval + use pftconMod , only : npcropmin use CropType, only : crop_type ! ! !ARGUMENTS @@ -1420,6 +1421,7 @@ subroutine UpdateAccVars_CropGDDs(this, rbufslp, begp, endp, month, day, secs, d character(8) :: field_name ! E.g., GDD0 character(32) :: format_string integer :: p + integer :: ivt ! vegetation type logical :: in_accumulation_season real(r8) :: lat ! latitude integer :: gdd20_season_start, gdd20_season_end @@ -1451,8 +1453,9 @@ subroutine UpdateAccVars_CropGDDs(this, rbufslp, begp, endp, month, day, secs, d do p = begp,endp - ! Avoid unnecessary calculations over inactive points - if (.not. patch%active(p)) then + ! Avoid unnecessary calculations over inactive points and non-crops + ivt = patch%itype(p) + if (ivt < npcropmin .or. .not. patch%active(p)) then cycle end if From b90789ba3d6a6f675e706bb26efa346e03d17ea2 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Mon, 10 Jun 2024 11:55:58 -0600 Subject: [PATCH 0478/1248] use_cropcal_streams now includes gdd20 dates. --- src/biogeochem/CNPhenologyMod.F90 | 8 ++++---- src/cpl/share_esmf/cropcalStreamMod.F90 | 10 ++++++++-- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/biogeochem/CNPhenologyMod.F90 b/src/biogeochem/CNPhenologyMod.F90 index cfeee0b867..b0cc280e7e 100644 --- a/src/biogeochem/CNPhenologyMod.F90 +++ b/src/biogeochem/CNPhenologyMod.F90 @@ -1811,7 +1811,7 @@ subroutine CropPhenology(num_pcropp, filter_pcropp , & use clm_varctl , only : use_fertilizer use clm_varctl , only : use_c13, use_c14 use clm_varcon , only : c13ratio, c14ratio - use clm_varctl , only : use_cropcal_rx_swindows, use_cropcal_streams + use clm_varctl , only : use_cropcal_rx_swindows ! ! !ARGUMENTS: integer , intent(in) :: num_pcropp ! number of prog crop patches in filter @@ -2245,7 +2245,7 @@ subroutine CropPhenology(num_pcropp, filter_pcropp , & do_harvest = .true. fake_harvest = .true. harvest_reason = HARVEST_REASON_SOWNBADDEC31 - else if (use_cropcal_streams .and. do_plant .and. .not. did_plant) then + else if (use_cropcal_rx_swindows .and. do_plant .and. .not. did_plant) then ! Today was supposed to be the planting day, but the previous crop still hasn't been harvested. do_harvest = .true. harvest_reason = HARVEST_REASON_SOWTODAY @@ -2562,7 +2562,7 @@ subroutine PlantCrop(p, leafcn_in, jday, kyr, do_plant_normal, & ! !USES: use clm_varctl , only : use_c13, use_c14 - use clm_varctl , only : use_cropcal_rx_cultivar_gdds, use_cropcal_streams, adapt_cropcal_rx_cultivar_gdds + use clm_varctl , only : use_cropcal_rx_cultivar_gdds, adapt_cropcal_rx_cultivar_gdds use clm_varcon , only : c13ratio, c14ratio use clm_varpar , only : mxsowings use pftconMod , only : ntmp_corn, nswheat, nwwheat, ntmp_soybean @@ -2726,7 +2726,7 @@ subroutine PlantCrop(p, leafcn_in, jday, kyr, do_plant_normal, & endif - if (use_cropcal_streams .and. gddmaturity(p) < min_gddmaturity) then + if (use_cropcal_rx_cultivar_gdds .and. gddmaturity(p) < min_gddmaturity) then if (did_rx_gdds) then write(iulog,*) 'Some patch with ivt ',ivt(p),' has rx gddmaturity',gddmaturity(p),'; using min_gddmaturity instead (',min_gddmaturity,')' endif diff --git a/src/cpl/share_esmf/cropcalStreamMod.F90 b/src/cpl/share_esmf/cropcalStreamMod.F90 index 0a04278aa9..a352c7af97 100644 --- a/src/cpl/share_esmf/cropcalStreamMod.F90 +++ b/src/cpl/share_esmf/cropcalStreamMod.F90 @@ -209,9 +209,11 @@ subroutine cropcal_init(bounds) use_cropcal_rx_swindows = stream_fldFileName_swindow_start /= '' use_cropcal_rx_cultivar_gdds = stream_fldFileName_cultivar_gdds /= '' adapt_cropcal_rx_cultivar_gdds = stream_fldFileName_gdd20_baseline /= '' - use_cropcal_streams = use_cropcal_rx_swindows .or. use_cropcal_rx_cultivar_gdds + use_cropcal_streams = .false. ! Will be set to true if any file is read if (use_cropcal_rx_swindows) then + use_cropcal_streams = .true. + ! Initialize the cdeps data type sdat_cropcal_swindow_start ! NOTE: stream_dtlimit 1.5 didn't work for some reason call shr_strdata_init_from_inline(sdat_cropcal_swindow_start, & @@ -270,6 +272,7 @@ subroutine cropcal_init(bounds) ! Initialize the cdeps data type sdat_cropcal_cultivar_gdds ! NOTE: stream_dtlimit 1.5 didn't work for some reason if (use_cropcal_rx_cultivar_gdds) then + use_cropcal_streams = .true. call shr_strdata_init_from_inline(sdat_cropcal_cultivar_gdds, & my_task = iam, & logunit = iulog, & @@ -301,6 +304,7 @@ subroutine cropcal_init(bounds) ! particular year chosen doesn't matter. Users can base their file on whatever baseline they ! want; they just need to put 2000 on the time axis. if (adapt_cropcal_rx_cultivar_gdds) then + use_cropcal_streams = .true. call shr_strdata_init_from_inline(sdat_cropcal_gdd20_baseline, & my_task = iam, & logunit = iulog, & @@ -328,7 +332,9 @@ subroutine cropcal_init(bounds) end if if (stream_gdd20_seasons) then - ! Initialize the cdeps data type sdat_cropcal_gdd20_season_start + use_cropcal_streams = .true. + + ! Initialize the cdeps data type sdat_cropcal_gdd20_season_start ! NOTE: Hard-coded to one particular year because it should NOT vary over time. Note that the ! particular year chosen doesn't matter. call shr_strdata_init_from_inline(sdat_cropcal_gdd20_season_start, & From 0ffbd07da2c02561bfbcdbf6048c85547575159e Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Mon, 10 Jun 2024 12:02:46 -0600 Subject: [PATCH 0479/1248] Handle invalid gdd20_season_start and _end separately. --- src/cpl/share_esmf/cropcalStreamMod.F90 | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/cpl/share_esmf/cropcalStreamMod.F90 b/src/cpl/share_esmf/cropcalStreamMod.F90 index a352c7af97..69c529be24 100644 --- a/src/cpl/share_esmf/cropcalStreamMod.F90 +++ b/src/cpl/share_esmf/cropcalStreamMod.F90 @@ -750,10 +750,11 @@ subroutine cropcal_interp(bounds, num_pcropp, filter_pcropp, init, crop_inst) ! If read-in value is invalid, set to -1. Will be handled later in this subroutine. if (dataptr1d_gdd20_season_start(g) <= 0 .or. dataptr1d_gdd20_season_start(g) > 366 & - .or. dataptr1d_gdd20_season_end(g) <= 0 .or. dataptr1d_gdd20_season_end(g) > 366 & - .or. dataptr1d_gdd20_season_start(g) /= dataptr1d_gdd20_season_start(g) & - .or. dataptr1d_gdd20_season_end(g) /= dataptr1d_gdd20_season_end(g)) then + .or. dataptr1d_gdd20_season_start(g) /= dataptr1d_gdd20_season_start(g)) then dataptr1d_gdd20_season_start(g) = -1 + end if + if (dataptr1d_gdd20_season_end(g) <= 0 .or. dataptr1d_gdd20_season_end(g) > 366 & + .or. dataptr1d_gdd20_season_end(g) /= dataptr1d_gdd20_season_end(g)) then dataptr1d_gdd20_season_end (g) = -1 end if From 2ebe85d51e44503c1e33c42635bbddc16488048f Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Tue, 11 Jun 2024 11:46:28 -0600 Subject: [PATCH 0480/1248] Fix restartvar() for flush_gdd20. --- src/biogeophys/TemperatureType.F90 | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/biogeophys/TemperatureType.F90 b/src/biogeophys/TemperatureType.F90 index 1e60293fe3..831c99d9bf 100644 --- a/src/biogeophys/TemperatureType.F90 +++ b/src/biogeophys/TemperatureType.F90 @@ -911,7 +911,7 @@ subroutine Restart(this, bounds, ncid, flag, is_simple_buildtemp, is_prog_buildt ! !LOCAL VARIABLES: integer :: j,c,p ! indices logical :: readvar ! determine if variable is on initial file - integer, pointer :: logical_as_int(:) ! used for saving/reading logicals + integer :: idata !----------------------------------------------------------------------- call restartvar(ncid=ncid, flag=flag, varname='T_SOISNO', xtype=ncd_double, & @@ -1137,26 +1137,23 @@ subroutine Restart(this, bounds, ncid, flag, is_simple_buildtemp, is_prog_buildt end if if (use_crop .and. stream_gdd20_seasons) then - allocate(logical_as_int(1)) if (flag == 'write') then if (this%flush_gdd20) then - logical_as_int(1) = 1 + idata = 1 else - logical_as_int(1) = 0 + idata = 0 end if end if - call restartvar(ncid=ncid, flag=flag, varname='flush_gdd20', xtype=ncd_log, & - dim1name='pft', & + call restartvar(ncid=ncid, flag=flag, varname='flush_gdd20', xtype=ncd_int, & long_name='Flag indicating that GDD20 values need to be flushed', & - units='none', interpinic_flag='interp', readvar=readvar, data=logical_as_int) + units='none', interpinic_flag='copy', readvar=readvar, data=idata) if (flag == 'read') then - if (readvar .and. logical_as_int(1) == 0) then + if (readvar .and. idata == 0) then this%flush_gdd20 = .false. else this%flush_gdd20 = .true. end if end if - deallocate(logical_as_int) end if From 628be7bd39fb48acab7a456504be05c424f4510f Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Tue, 11 Jun 2024 12:20:30 -0700 Subject: [PATCH 0481/1248] temporarily update fates to point to latest pull request commit hash --- .gitmodules | 4 ++-- src/fates | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitmodules b/.gitmodules index 699ad22969..5b679e62bf 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,7 +1,7 @@ [submodule "fates"] path = src/fates -url = https://github.com/NGEET/fates -fxtag = sci.1.73.0_api.35.0.0 +url = https://github.com/ckoven/fates +fxtag = 4b018eade498d063b21dddf26f77c9658ff80261 fxrequired = AlwaysRequired fxDONOTUSEurl = https://github.com/NCAR/fates-release diff --git a/src/fates b/src/fates index adfa664806..4b018eade4 160000 --- a/src/fates +++ b/src/fates @@ -1 +1 @@ -Subproject commit adfa6648063408d443f5cae671bd37f713d3e3e8 +Subproject commit 4b018eade498d063b21dddf26f77c9658ff80261 From e9531dee57adcf9d997eb703a544e5c3656d99b0 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Wed, 12 Jun 2024 10:44:46 -0600 Subject: [PATCH 0482/1248] Add RXCROPMATURITYSKIPBUILD test. --- cime_config/SystemTests/rxcropmaturityskipbuild.py | 9 +++++++++ cime_config/config_tests.xml | 10 ++++++++++ 2 files changed, 19 insertions(+) create mode 100644 cime_config/SystemTests/rxcropmaturityskipbuild.py diff --git a/cime_config/SystemTests/rxcropmaturityskipbuild.py b/cime_config/SystemTests/rxcropmaturityskipbuild.py new file mode 100644 index 0000000000..4c3a69fb47 --- /dev/null +++ b/cime_config/SystemTests/rxcropmaturityskipbuild.py @@ -0,0 +1,9 @@ +from rxcropmaturityshared import RXCROPMATURITYSHARED + +class RXCROPMATURITYSKIPBUILD(RXCROPMATURITYSHARED): + def build_indv(self, sharedlib_only=False, model_only=False): + self._case.set_value("BUILD_COMPLETE", "TRUE") + + + def run_phase(self): + self._run_phase(skip_run=False) \ No newline at end of file diff --git a/cime_config/config_tests.xml b/cime_config/config_tests.xml index 98434da10e..115f4c0e89 100644 --- a/cime_config/config_tests.xml +++ b/cime_config/config_tests.xml @@ -143,6 +143,16 @@ This defines various CTSM-specific system tests $STOP_N + + As RXCROPMATURITY but don't actually build; just setup and then start "run." Will fail when run start is requested, but should successfully test preprocessing. + 1 + FALSE + FALSE + never + $STOP_OPTION + $STOP_N + + lnd/clm2/surfdata_esmf/ctsm5.2.0/landuse.timeseries_1x1_smallvilleIA_SSP2-4.5_1850-1855_78pfts_c240221.nc + + + diff --git a/bld/namelist_files/namelist_defaults_overall.xml b/bld/namelist_files/namelist_defaults_overall.xml index 479b2a02b7..5b7ae1bdd9 100644 --- a/bld/namelist_files/namelist_defaults_overall.xml +++ b/bld/namelist_files/namelist_defaults_overall.xml @@ -62,6 +62,7 @@ determine default values for namelists. 1x1_urbanc_alpha 1x1_numaIA 1x1_smallvilleIA +1x1_cidadinhoBR 2000 @@ -110,6 +111,7 @@ determine default values for namelists. test navy test +test gx1v7 diff --git a/bld/unit_testers/build-namelist_test.pl b/bld/unit_testers/build-namelist_test.pl index b0ddb1e448..5c8aa3468d 100755 --- a/bld/unit_testers/build-namelist_test.pl +++ b/bld/unit_testers/build-namelist_test.pl @@ -1590,21 +1590,23 @@ sub cat_and_create_namelistinfile { print "==================================================\n"; # Check for crop resolutions -my $crop1850_res = "1x1_smallvilleIA"; -$options = "-bgc bgc -crop -res $crop1850_res -use_case 1850_control -envxml_dir ."; -&make_env_run(); -eval{ system( "$bldnml $options > $tempfile 2>&1 " ); }; -is( $@, '', "$options" ); -$cfiles->checkfilesexist( "$options", $mode ); -$cfiles->shownmldiff( "default", "standard" ); -if ( defined($opts{'compare'}) ) { - $cfiles->doNOTdodiffonfile( "$tempfile", "$options", $mode ); - $cfiles->comparefiles( "$options", $mode, $opts{'compare'} ); -} -if ( defined($opts{'generate'}) ) { - $cfiles->copyfiles( "$options", $mode ); +my @crop1850_res = ( "1x1_smallvilleIA", "1x1_cidadinhoBR" ); +foreach my $res ( @crop1850_res ) { + $options = "-bgc bgc -crop -res $res -use_case 1850_control -envxml_dir ."; + &make_env_run(); + eval{ system( "$bldnml $options > $tempfile 2>&1 " ); }; + is( $@, '', "$options" ); + $cfiles->checkfilesexist( "$options", $mode ); + $cfiles->shownmldiff( "default", "standard" ); + if ( defined($opts{'compare'}) ) { + $cfiles->doNOTdodiffonfile( "$tempfile", "$options", $mode ); + $cfiles->comparefiles( "$options", $mode, $opts{'compare'} ); + } + if ( defined($opts{'generate'}) ) { + $cfiles->copyfiles( "$options", $mode ); + } + &cleanup(); } -&cleanup(); my @crop_res = ( "1x1_numaIA", "4x5", "10x15", "0.9x1.25", "1.9x2.5", "ne3np4.pg3", "ne30np4", "ne30np4.pg3", "C96", "mpasa120" ); foreach my $res ( @crop_res ) { diff --git a/tools/mksurfdata_esmf/Makefile b/tools/mksurfdata_esmf/Makefile index d8bacdc5dd..c344843d06 100644 --- a/tools/mksurfdata_esmf/Makefile +++ b/tools/mksurfdata_esmf/Makefile @@ -54,7 +54,10 @@ SUBSETDATA_POINT_URBAN = $(SUBSETDATA_POINT) --include-nonveg # Subset data sites... SUBSETDATA_1X1_BRAZIL := --lat -7 --lon -55 --site 1x1_brazil SUBSETDATA_1X1_NUMAIA := --lat 40.6878 --lon 267.0228 --site 1x1_numaIA -SUBSETDATA_1X1_SMALL := --lat 40.6878 --lon 267.0228 --site 1x1_smallvilleIA \ +SUBSETDATA_1X1_SMALL_IA := --lat 40.6878 --lon 267.0228 --site 1x1_smallvilleIA \ + --dompft 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 \ + --pctpft 6.5 1.5 1.6 1.7 1.8 1.9 1.5 1.6 1.7 1.8 1.9 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 +SUBSETDATA_1X1_SMALL_BR := --lat -12.9952 --lon 305.3233 --site 1x1_cidadinhoBR \ --dompft 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 \ --pctpft 6.5 1.5 1.6 1.7 1.8 1.9 1.5 1.6 1.7 1.8 1.9 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 1.5 # NOTE: The 1850 smallvilleIA site is constructed to start with 100% natural vegetation, so we can test transition to crops @@ -112,6 +115,7 @@ all-subset : \ 1x1-smallville-present \ 1x1-smallville-1850 \ 1x1-smallville-transient \ + 1x1-cidadinho-present \ urban DEBUG: @@ -239,7 +243,7 @@ crop-global-hist-ne30 : FORCE $(SUBSETDATA_POINT_ALLLU) --create-surface $(SUBSETDATA_1X1_NUMAIA) 1x1-smallville-present : FORCE - $(SUBSETDATA_POINT) --create-surface $(SUBSETDATA_1X1_SMALL) + $(SUBSETDATA_POINT) --create-surface $(SUBSETDATA_1X1_SMALL_IA) # Note that the smallville 1850 dataset is entirely natural vegetation. This # facilitates testing a transient case that starts with no crop, and then later @@ -254,6 +258,9 @@ crop-global-hist-ne30 : FORCE $(SUBSETDATA_POINT) --create-landuse $(SUBSETDATA_1X1_SMALLTRANSIENT) ../modify_input_files/modify_smallville.sh +1x1-cidadinho-present : FORCE + $(SUBSETDATA_POINT) --create-surface $(SUBSETDATA_1X1_SMALL_BR) + # # Crop with future scenarios # From d33ef3e5b3e695a627fa23dd4d56e85686794c2c Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Mon, 3 Jun 2024 12:03:15 -0600 Subject: [PATCH 0499/1248] Add partial versions of RXCROPMATURITY test. Useful for troubleshooting: * RXCROPMATURITYSKIPRUN skips the build and run phases. * RXCROPMATURITYSKIPBUILD just skips the build phase. It still does the run phase so as to test everything before actual run submission. --- cime_config/SystemTests/rxcropmaturity.py | 444 +---------------- .../SystemTests/rxcropmaturityshared.py | 451 ++++++++++++++++++ .../SystemTests/rxcropmaturityskipbuild.py | 9 + .../SystemTests/rxcropmaturityskiprun.py | 9 + cime_config/config_tests.xml | 20 + 5 files changed, 492 insertions(+), 441 deletions(-) create mode 100644 cime_config/SystemTests/rxcropmaturityshared.py create mode 100644 cime_config/SystemTests/rxcropmaturityskipbuild.py create mode 100644 cime_config/SystemTests/rxcropmaturityskiprun.py diff --git a/cime_config/SystemTests/rxcropmaturity.py b/cime_config/SystemTests/rxcropmaturity.py index acb63bb000..12ec608898 100644 --- a/cime_config/SystemTests/rxcropmaturity.py +++ b/cime_config/SystemTests/rxcropmaturity.py @@ -1,444 +1,6 @@ -""" -CTSM-specific test that first performs a GDD-generating run, then calls -Python code to generate the maturity requirement file. This is then used -in a sowing+maturity forced run, which finally is tested to ensure -correct behavior. +from rxcropmaturityshared import RXCROPMATURITYSHARED -Currently only supports 0.9x1.25, 1.9x2.5, and 10x15 resolutions. Eventually, -this test should be able to generate its own files at whatever resolution it's -called at. Well, really, the ultimate goal would be to give CLM the files -at the original resolution (for GGCMI phase 3, 0.5°) and have the stream -code do the interpolation. However, that wouldn't act on harvest dates -(which are needed for generate_gdds.py). I could have Python interpolate -those, but this would cause a potential inconsistency. -""" - -import os -import re -import systemtest_utils as stu -import subprocess -from CIME.SystemTests.system_tests_common import SystemTestsCommon -from CIME.XML.standard_module_setup import * -from CIME.SystemTests.test_utils.user_nl_utils import append_to_user_nl_files -import shutil, glob - -logger = logging.getLogger(__name__) - - -class RXCROPMATURITY(SystemTestsCommon): - def __init__(self, case): - # initialize an object interface to the SMS system test - SystemTestsCommon.__init__(self, case) - - # Ensure run length is at least 5 years. Minimum to produce one complete growing season (i.e., two complete calendar years) actually 4 years, but that only gets you 1 season usable for GDD generation, so you can't check for season-to-season consistency. - stop_n = self._case.get_value("STOP_N") - stop_option = self._case.get_value("STOP_OPTION") - stop_n_orig = stop_n - stop_option_orig = stop_option - if "nsecond" in stop_option: - stop_n /= 60 - stop_option = "nminutes" - if "nminute" in stop_option: - stop_n /= 60 - stop_option = "nhours" - if "nhour" in stop_option: - stop_n /= 24 - stop_option = "ndays" - if "nday" in stop_option: - stop_n /= 365 - stop_option = "nyears" - if "nmonth" in stop_option: - stop_n /= 12 - stop_option = "nyears" - error_message = None - if "nyear" not in stop_option: - error_message = ( - f"STOP_OPTION ({stop_option_orig}) must be nsecond(s), nminute(s), " - + "nhour(s), nday(s), nmonth(s), or nyear(s)" - ) - elif stop_n < 5: - error_message = ( - "RXCROPMATURITY must be run for at least 5 years; you requested " - + f"{stop_n_orig} {stop_option_orig[1:]}" - ) - if error_message is not None: - logger.error(error_message) - raise RuntimeError(error_message) - - # Get the number of complete years that will be run - self._run_Nyears = int(stop_n) - - # Only allow RXCROPMATURITY to be called with test cropMonthOutput - casebaseid = self._case.get_value("CASEBASEID") - if casebaseid.split("-")[-1] != "cropMonthOutput": - error_message = ( - "Only call RXCROPMATURITY with test cropMonthOutput " - + "to avoid potentially huge sets of daily outputs." - ) - logger.error(error_message) - raise RuntimeError(error_message) - - # Get files with prescribed sowing and harvest dates - self._get_rx_dates() - - # Which conda environment should we use? - self._get_conda_env() +class RXCROPMATURITY(RXCROPMATURITYSHARED): def run_phase(self): - # Modeling this after the SSP test, we create a clone to be the case whose outputs we don't - # want to be saved as baseline. - - # ------------------------------------------------------------------- - # (1) Set up GDD-generating run - # ------------------------------------------------------------------- - # Create clone to be GDD-Generating case - logger.info("RXCROPMATURITY log: cloning setup") - case_rxboth = self._case - caseroot = self._case.get_value("CASEROOT") - clone_path = f"{caseroot}.gddgen" - self._path_gddgen = clone_path - if os.path.exists(self._path_gddgen): - shutil.rmtree(self._path_gddgen) - logger.info("RXCROPMATURITY log: cloning") - case_gddgen = self._case.create_clone(clone_path, keepexe=True) - logger.info("RXCROPMATURITY log: done cloning") - - os.chdir(self._path_gddgen) - self._set_active_case(case_gddgen) - - # Set up stuff that applies to both tests - self._setup_all() - - # Add stuff specific to GDD-Generating run - logger.info("RXCROPMATURITY log: modify user_nl files: generate GDDs") - self._append_to_user_nl_clm( - [ - "generate_crop_gdds = .true.", - "use_mxmat = .false.", - " ", - "! (h2) Daily outputs for GDD generation and figure-making", - "hist_fincl3 = 'GDDACCUM', 'GDDHARV'", - "hist_nhtfrq(3) = -24", - "hist_mfilt(3) = 365", - "hist_type1d_pertape(3) = 'PFTS'", - "hist_dov2xy(3) = .false.", - ] - ) - - # If flanduse_timeseries is defined, we need to make a static version for this test. This - # should have every crop in most of the world. - self._get_flanduse_timeseries_in(case_gddgen) - if self._flanduse_timeseries_in is not None: - - # Download files from the server, if needed - case_gddgen.check_all_input_data() - - # Make custom version of surface file - logger.info("RXCROPMATURITY log: run fsurdat_modifier") - self._run_fsurdat_modifier() - - # ------------------------------------------------------------------- - # (2) Perform GDD-generating run and generate prescribed GDDs file - # ------------------------------------------------------------------- - logger.info("RXCROPMATURITY log: Start GDD-Generating run") - - # As per SSP test: - # "No history files expected, set suffix=None to avoid compare error" - # We *do* expect history files here, but anyway. This works. - self._skip_pnl = False - self.run_indv(suffix=None, st_archive=True) - - self._run_generate_gdds(case_gddgen) - - # ------------------------------------------------------------------- - # (3) Set up and perform Prescribed Calendars run - # ------------------------------------------------------------------- - os.chdir(caseroot) - self._set_active_case(case_rxboth) - - # Set up stuff that applies to both tests - self._setup_all() - - # Add stuff specific to Prescribed Calendars run - logger.info("RXCROPMATURITY log: modify user_nl files: Prescribed Calendars") - self._append_to_user_nl_clm( - [ - "generate_crop_gdds = .false.", - f"stream_fldFileName_cultivar_gdds = '{self._gdds_file}'", - ] - ) - - self.run_indv() - - # ------------------------------------------------------------------- - # (4) Check Prescribed Calendars run - # ------------------------------------------------------------------- - logger.info("RXCROPMATURITY log: output check: Prescribed Calendars") - self._run_check_rxboth_run() - - # Get sowing and harvest dates for this resolution. - def _get_rx_dates(self): - # Eventually, I want to remove these hard-coded resolutions so that this test can generate - # its own sowing and harvest date files at whatever resolution is requested. - lnd_grid = self._case.get_value("LND_GRID") - input_data_root = self._case.get_value("DIN_LOC_ROOT") - processed_crop_dates_dir = f"{input_data_root}/lnd/clm2/cropdata/calendars/processed" - if lnd_grid == "10x15": - self._sdatefile = os.path.join( - processed_crop_dates_dir, - "sdates_ggcmi_crop_calendar_phase3_v1.01_nninterp-f10_f10_mg37.2000-2000.20230330_165301.nc", - ) - self._hdatefile = os.path.join( - processed_crop_dates_dir, - "hdates_ggcmi_crop_calendar_phase3_v1.01_nninterp-f10_f10_mg37.2000-2000.20230330_165301.nc", - ) - elif lnd_grid == "1.9x2.5": - self._sdatefile = os.path.join( - processed_crop_dates_dir, - "sdates_ggcmi_crop_calendar_phase3_v1.01_nninterp-f19_g17.2000-2000.20230102_175625.nc", - ) - self._hdatefile = os.path.join( - processed_crop_dates_dir, - "hdates_ggcmi_crop_calendar_phase3_v1.01_nninterp-f19_g17.2000-2000.20230102_175625.nc", - ) - elif lnd_grid == "0.9x1.25": - self._sdatefile = os.path.join( - processed_crop_dates_dir, - "sdates_ggcmi_crop_calendar_phase3_v1.01_nninterp-f09_g17.2000-2000.20230520_134417.nc", - ) - self._hdatefile = os.path.join( - processed_crop_dates_dir, - "hdates_ggcmi_crop_calendar_phase3_v1.01_nninterp-f09_g17.2000-2000.20230520_134418.nc", - ) - else: - error_message = "ERROR: RXCROPMATURITY currently only supports 0.9x1.25, 1.9x2.5, and 10x15 resolutions" - logger.error(error_message) - raise RuntimeError(error_message) - - # Ensure files exist - error_message = None - if not os.path.exists(self._sdatefile): - error_message = f"ERROR: Sowing date file not found: {self._sdatefile}" - elif not os.path.exists(self._hdatefile): - error_message = f"ERROR: Harvest date file not found: {self._sdatefile}" - if error_message is not None: - logger.error(error_message) - raise RuntimeError(error_message) - - def _setup_all(self): - logger.info("RXCROPMATURITY log: _setup_all start") - - # Get some info - self._ctsm_root = self._case.get_value("COMP_ROOT_DIR_LND") - run_startdate = self._case.get_value("RUN_STARTDATE") - self._run_startyear = int(run_startdate.split("-")[0]) - - # Set sowing dates file (and other crop calendar settings) for all runs - logger.info("RXCROPMATURITY log: modify user_nl files: all tests") - self._modify_user_nl_allruns() - logger.info("RXCROPMATURITY log: _setup_all done") - - # Make a surface dataset that has every crop in every gridcell - def _run_fsurdat_modifier(self): - - # fsurdat should be defined. Where is it? - self._fsurdat_in = None - with open(self._lnd_in_path, "r") as lnd_in: - for line in lnd_in: - fsurdat_in = re.match(r" *fsurdat *= *'(.*)'", line) - if fsurdat_in: - self._fsurdat_in = fsurdat_in.group(1) - break - if self._fsurdat_in is None: - error_message = "fsurdat not defined" - logger.error(error_message) - raise RuntimeError(error_message) - - # Where we will save the fsurdat version for this test - path, ext = os.path.splitext(self._fsurdat_in) - dir_in, filename_in_noext = os.path.split(path) - self._fsurdat_out = os.path.join( - self._path_gddgen, f"{filename_in_noext}.all_crops_everywhere{ext}" - ) - - # Make fsurdat for this test, if not already done - if not os.path.exists(self._fsurdat_out): - tool_path = os.path.join( - self._ctsm_root, - "tools", - "modify_input_files", - "fsurdat_modifier", - ) - - # Create configuration file for fsurdat_modifier - self._cfg_path = os.path.join( - self._path_gddgen, - "modify_fsurdat_allcropseverywhere.cfg", - ) - self._create_config_file_evenlysplitcrop() - - command = f"python3 {tool_path} {self._cfg_path} " - stu.run_python_script( - self._get_caseroot(), - self._this_conda_env, - command, - tool_path, - ) - - # Modify namelist - logger.info("RXCROPMATURITY log: modify user_nl files: new fsurdat") - self._append_to_user_nl_clm( - [ - "fsurdat = '{}'".format(self._fsurdat_out), - "do_transient_crops = .false.", - "flanduse_timeseries = ''", - "use_init_interp = .true.", - ] - ) - - def _create_config_file_evenlysplitcrop(self): - """ - Open the new and the template .cfg files - Loop line by line through the template .cfg file - When string matches, replace that line's content - """ - cfg_template_path = os.path.join( - self._ctsm_root, "tools/modify_input_files/modify_fsurdat_template.cfg" - ) - - with open(self._cfg_path, "w", encoding="utf-8") as cfg_out: - # Copy template, replacing some lines - with open(cfg_template_path, "r", encoding="utf-8") as cfg_in: - for line in cfg_in: - if re.match(r" *evenly_split_cropland *=", line): - line = f"evenly_split_cropland = True" - elif re.match(r" *fsurdat_in *=", line): - line = f"fsurdat_in = {self._fsurdat_in}" - elif re.match(r" *fsurdat_out *=", line): - line = f"fsurdat_out = {self._fsurdat_out}" - elif re.match(r" *process_subgrid_section *=", line): - line = f"process_subgrid_section = True" - cfg_out.write(line) - - # Add new lines - cfg_out.write("\n") - cfg_out.write("[modify_fsurdat_subgrid_fractions]\n") - cfg_out.write("PCT_CROP = 100.0\n") - cfg_out.write("PCT_NATVEG = 0.0\n") - cfg_out.write("PCT_GLACIER = 0.0\n") - cfg_out.write("PCT_WETLAND = 0.0\n") - cfg_out.write("PCT_LAKE = 0.0\n") - cfg_out.write("PCT_OCEAN = 0.0\n") - cfg_out.write("PCT_URBAN = 0.0 0.0 0.0\n") - - def _run_check_rxboth_run(self): - - output_dir = os.path.join(self._get_caseroot(), "run") - first_usable_year = self._run_startyear + 2 - last_usable_year = self._run_startyear + self._run_Nyears - 2 - - tool_path = os.path.join( - self._ctsm_root, "python", "ctsm", "crop_calendars", "check_rxboth_run.py" - ) - command = ( - f"python3 {tool_path} " - + f"--directory {output_dir} " - + f"-y1 {first_usable_year} " - + f"-yN {last_usable_year} " - + f"--rx-sdates-file {self._sdatefile} " - + f"--rx-gdds-file {self._gdds_file} " - ) - stu.run_python_script( - self._get_caseroot(), - self._this_conda_env, - command, - tool_path, - ) - - def _modify_user_nl_allruns(self): - nl_additions = [ - "stream_meshfile_cropcal = '{}'".format(self._case.get_value("LND_DOMAIN_MESH")), - "stream_fldFileName_swindow_start = '{}'".format(self._sdatefile), - "stream_fldFileName_swindow_end = '{}'".format(self._sdatefile), - "stream_year_first_cropcal = 2000", - "stream_year_last_cropcal = 2000", - "model_year_align_cropcal = 2000", - " ", - "! (h1) Annual outputs on sowing or harvest axis", - "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.", - ] - self._append_to_user_nl_clm(nl_additions) - - def _run_generate_gdds(self, case_gddgen): - self._generate_gdds_dir = os.path.join(self._path_gddgen, "generate_gdds_out") - os.makedirs(self._generate_gdds_dir) - - # Get arguments to generate_gdds.py - dout_sr = case_gddgen.get_value("DOUT_S_ROOT") - input_dir = os.path.join(dout_sr, "lnd", "hist") - first_season = self._run_startyear + 2 - last_season = self._run_startyear + self._run_Nyears - 2 - sdates_file = self._sdatefile - hdates_file = self._hdatefile - - # It'd be much nicer to call generate_gdds.main(), but I can't import generate_gdds. - tool_path = os.path.join( - self._ctsm_root, "python", "ctsm", "crop_calendars", "generate_gdds.py" - ) - command = " ".join( - [ - f"python3 {tool_path}", - f"--input-dir {input_dir}", - f"--first-season {first_season}", - f"--last-season {last_season}", - f"--sdates-file {sdates_file}", - f"--hdates-file {hdates_file}", - f"--output-dir generate_gdds_out", - f"--skip-crops miscanthus,irrigated_miscanthus", - ] - ) - stu.run_python_script( - self._get_caseroot(), - self._this_conda_env, - command, - tool_path, - ) - - # Where were the prescribed maturity requirements saved? - generated_gdd_files = glob.glob(os.path.join(self._generate_gdds_dir, "gdds_*.nc")) - if len(generated_gdd_files) != 1: - error_message = f"ERROR: Expected one matching prescribed maturity requirements file; found {len(generated_gdd_files)}: {generated_gdd_files}" - logger.error(error_message) - raise RuntimeError(error_message) - self._gdds_file = generated_gdd_files[0] - - def _get_conda_env(self): - conda_setup_commands = stu.cmds_to_setup_conda(self._get_caseroot()) - - # If npl conda environment is available, use that (It has dask, which - # enables chunking, which makes reading daily 1-degree netCDF files - # much more efficient. - if "npl " in os.popen(conda_setup_commands + "conda env list").read(): - self._this_conda_env = "npl" - else: - self._this_conda_env = "ctsm_pylib" - - def _append_to_user_nl_clm(self, additions): - caseroot = self._get_caseroot() - append_to_user_nl_files(caseroot=caseroot, component="clm", contents=additions) - - # Is flanduse_timeseries defined? If so, where is it? - def _get_flanduse_timeseries_in(self, case): - case.create_namelists(component="lnd") - self._lnd_in_path = os.path.join(self._path_gddgen, "CaseDocs", "lnd_in") - self._flanduse_timeseries_in = None - with open(self._lnd_in_path, "r") as lnd_in: - for line in lnd_in: - flanduse_timeseries_in = re.match(r" *flanduse_timeseries *= *'(.*)'", line) - if flanduse_timeseries_in: - self._flanduse_timeseries_in = flanduse_timeseries_in.group(1) - break + self._run_phase() diff --git a/cime_config/SystemTests/rxcropmaturityshared.py b/cime_config/SystemTests/rxcropmaturityshared.py new file mode 100644 index 0000000000..6b3a3191de --- /dev/null +++ b/cime_config/SystemTests/rxcropmaturityshared.py @@ -0,0 +1,451 @@ +""" +CTSM-specific test that first performs a GDD-generating run, then calls +Python code to generate the maturity requirement file. This is then used +in a sowing+maturity forced run, which finally is tested to ensure +correct behavior. + +Currently only supports 0.9x1.25, 1.9x2.5, and 10x15 resolutions. Eventually, +this test should be able to generate its own files at whatever resolution it's +called at. Well, really, the ultimate goal would be to give CLM the files +at the original resolution (for GGCMI phase 3, 0.5°) and have the stream +code do the interpolation. However, that wouldn't act on harvest dates +(which are needed for generate_gdds.py). I could have Python interpolate +those, but this would cause a potential inconsistency. + +Note that this is just a parent class. The actual tests are RXCROPMATURITY and +RXCROPMATURITY_SKIPRUN, the latter of which does everything except perform and +check the CTSM runs. +""" + +import os +import re +import systemtest_utils as stu +import subprocess +from CIME.SystemTests.system_tests_common import SystemTestsCommon +from CIME.XML.standard_module_setup import * +from CIME.SystemTests.test_utils.user_nl_utils import append_to_user_nl_files +import shutil, glob + +logger = logging.getLogger(__name__) + + +class RXCROPMATURITYSHARED(SystemTestsCommon): + def __init__(self, case): + # initialize an object interface to the SMS system test + SystemTestsCommon.__init__(self, case) + + # Ensure run length is at least 5 years. Minimum to produce one complete growing season (i.e., two complete calendar years) actually 4 years, but that only gets you 1 season usable for GDD generation, so you can't check for season-to-season consistency. + stop_n = self._case.get_value("STOP_N") + stop_option = self._case.get_value("STOP_OPTION") + stop_n_orig = stop_n + stop_option_orig = stop_option + if "nsecond" in stop_option: + stop_n /= 60 + stop_option = "nminutes" + if "nminute" in stop_option: + stop_n /= 60 + stop_option = "nhours" + if "nhour" in stop_option: + stop_n /= 24 + stop_option = "ndays" + if "nday" in stop_option: + stop_n /= 365 + stop_option = "nyears" + if "nmonth" in stop_option: + stop_n /= 12 + stop_option = "nyears" + error_message = None + if "nyear" not in stop_option: + error_message = ( + f"STOP_OPTION ({stop_option_orig}) must be nsecond(s), nminute(s), " + + "nhour(s), nday(s), nmonth(s), or nyear(s)" + ) + elif stop_n < 5: + error_message = ( + "RXCROPMATURITY must be run for at least 5 years; you requested " + + f"{stop_n_orig} {stop_option_orig[1:]}" + ) + if error_message is not None: + logger.error(error_message) + raise RuntimeError(error_message) + + # Get the number of complete years that will be run + self._run_Nyears = int(stop_n) + + # Only allow RXCROPMATURITY to be called with test cropMonthOutput + casebaseid = self._case.get_value("CASEBASEID") + if casebaseid.split("-")[-1] != "cropMonthOutput": + error_message = ( + "Only call RXCROPMATURITY with test cropMonthOutput " + + "to avoid potentially huge sets of daily outputs." + ) + logger.error(error_message) + raise RuntimeError(error_message) + + # Get files with prescribed sowing and harvest dates + self._get_rx_dates() + + # Which conda environment should we use? + self._get_conda_env() + + def _run_phase(self, skip_run=False): + # Modeling this after the SSP test, we create a clone to be the case whose outputs we don't + # want to be saved as baseline. + + # ------------------------------------------------------------------- + # (1) Set up GDD-generating run + # ------------------------------------------------------------------- + # Create clone to be GDD-Generating case + logger.info("RXCROPMATURITY log: cloning setup") + case_rxboth = self._case + caseroot = self._case.get_value("CASEROOT") + clone_path = f"{caseroot}.gddgen" + self._path_gddgen = clone_path + if os.path.exists(self._path_gddgen): + shutil.rmtree(self._path_gddgen) + logger.info("RXCROPMATURITY log: cloning") + case_gddgen = self._case.create_clone(clone_path, keepexe=True) + logger.info("RXCROPMATURITY log: done cloning") + + os.chdir(self._path_gddgen) + self._set_active_case(case_gddgen) + + # Set up stuff that applies to both tests + self._setup_all() + + # Add stuff specific to GDD-Generating run + logger.info("RXCROPMATURITY log: modify user_nl files: generate GDDs") + self._append_to_user_nl_clm( + [ + "generate_crop_gdds = .true.", + "use_mxmat = .false.", + " ", + "! (h2) Daily outputs for GDD generation and figure-making", + "hist_fincl3 = 'GDDACCUM', 'GDDHARV'", + "hist_nhtfrq(3) = -24", + "hist_mfilt(3) = 365", + "hist_type1d_pertape(3) = 'PFTS'", + "hist_dov2xy(3) = .false.", + ] + ) + + # If flanduse_timeseries is defined, we need to make a static version for this test. This + # should have every crop in most of the world. + self._get_flanduse_timeseries_in(case_gddgen) + if self._flanduse_timeseries_in is not None: + + # Download files from the server, if needed + case_gddgen.check_all_input_data() + + # Make custom version of surface file + logger.info("RXCROPMATURITY log: run fsurdat_modifier") + self._run_fsurdat_modifier() + + # ------------------------------------------------------------------- + # (2) Perform GDD-generating run and generate prescribed GDDs file + # ------------------------------------------------------------------- + logger.info("RXCROPMATURITY log: Start GDD-Generating run") + + # As per SSP test: + # "No history files expected, set suffix=None to avoid compare error" + # We *do* expect history files here, but anyway. This works. + self._skip_pnl = False + + if not skip_run: + self.run_indv(suffix=None, st_archive=True) + self._run_generate_gdds(case_gddgen) + + # ------------------------------------------------------------------- + # (3) Set up and perform Prescribed Calendars run + # ------------------------------------------------------------------- + os.chdir(caseroot) + self._set_active_case(case_rxboth) + + # Set up stuff that applies to both tests + self._setup_all() + + # Add stuff specific to Prescribed Calendars run + logger.info("RXCROPMATURITY log: modify user_nl files: Prescribed Calendars") + self._append_to_user_nl_clm( + [ + "generate_crop_gdds = .false.", + f"stream_fldFileName_cultivar_gdds = '{self._gdds_file}'", + ] + ) + + if not skip_run: + self.run_indv() + + # ------------------------------------------------------------------- + # (4) Check Prescribed Calendars run + # ------------------------------------------------------------------- + logger.info("RXCROPMATURITY log: output check: Prescribed Calendars") + if not skip_run: + self._run_check_rxboth_run() + + # Get sowing and harvest dates for this resolution. + def _get_rx_dates(self): + # Eventually, I want to remove these hard-coded resolutions so that this test can generate + # its own sowing and harvest date files at whatever resolution is requested. + lnd_grid = self._case.get_value("LND_GRID") + input_data_root = self._case.get_value("DIN_LOC_ROOT") + processed_crop_dates_dir = f"{input_data_root}/lnd/clm2/cropdata/calendars/processed" + if lnd_grid == "10x15": + self._sdatefile = os.path.join( + processed_crop_dates_dir, + "sdates_ggcmi_crop_calendar_phase3_v1.01_nninterp-f10_f10_mg37.2000-2000.20230330_165301.nc", + ) + self._hdatefile = os.path.join( + processed_crop_dates_dir, + "hdates_ggcmi_crop_calendar_phase3_v1.01_nninterp-f10_f10_mg37.2000-2000.20230330_165301.nc", + ) + elif lnd_grid == "1.9x2.5": + self._sdatefile = os.path.join( + processed_crop_dates_dir, + "sdates_ggcmi_crop_calendar_phase3_v1.01_nninterp-f19_g17.2000-2000.20230102_175625.nc", + ) + self._hdatefile = os.path.join( + processed_crop_dates_dir, + "hdates_ggcmi_crop_calendar_phase3_v1.01_nninterp-f19_g17.2000-2000.20230102_175625.nc", + ) + elif lnd_grid == "0.9x1.25": + self._sdatefile = os.path.join( + processed_crop_dates_dir, + "sdates_ggcmi_crop_calendar_phase3_v1.01_nninterp-f09_g17.2000-2000.20230520_134417.nc", + ) + self._hdatefile = os.path.join( + processed_crop_dates_dir, + "hdates_ggcmi_crop_calendar_phase3_v1.01_nninterp-f09_g17.2000-2000.20230520_134418.nc", + ) + else: + error_message = "ERROR: RXCROPMATURITY currently only supports 0.9x1.25, 1.9x2.5, and 10x15 resolutions" + logger.error(error_message) + raise RuntimeError(error_message) + + # Ensure files exist + error_message = None + if not os.path.exists(self._sdatefile): + error_message = f"ERROR: Sowing date file not found: {self._sdatefile}" + elif not os.path.exists(self._hdatefile): + error_message = f"ERROR: Harvest date file not found: {self._sdatefile}" + if error_message is not None: + logger.error(error_message) + raise RuntimeError(error_message) + + def _setup_all(self): + logger.info("RXCROPMATURITY log: _setup_all start") + + # Get some info + self._ctsm_root = self._case.get_value("COMP_ROOT_DIR_LND") + run_startdate = self._case.get_value("RUN_STARTDATE") + self._run_startyear = int(run_startdate.split("-")[0]) + + # Set sowing dates file (and other crop calendar settings) for all runs + logger.info("RXCROPMATURITY log: modify user_nl files: all tests") + self._modify_user_nl_allruns() + logger.info("RXCROPMATURITY log: _setup_all done") + + # Make a surface dataset that has every crop in every gridcell + def _run_fsurdat_modifier(self): + + # fsurdat should be defined. Where is it? + self._fsurdat_in = None + with open(self._lnd_in_path, "r") as lnd_in: + for line in lnd_in: + fsurdat_in = re.match(r" *fsurdat *= *'(.*)'", line) + if fsurdat_in: + self._fsurdat_in = fsurdat_in.group(1) + break + if self._fsurdat_in is None: + error_message = "fsurdat not defined" + logger.error(error_message) + raise RuntimeError(error_message) + + # Where we will save the fsurdat version for this test + path, ext = os.path.splitext(self._fsurdat_in) + dir_in, filename_in_noext = os.path.split(path) + self._fsurdat_out = os.path.join( + self._path_gddgen, f"{filename_in_noext}.all_crops_everywhere{ext}" + ) + + # Make fsurdat for this test, if not already done + if not os.path.exists(self._fsurdat_out): + tool_path = os.path.join( + self._ctsm_root, + "tools", + "modify_input_files", + "fsurdat_modifier", + ) + + # Create configuration file for fsurdat_modifier + self._cfg_path = os.path.join( + self._path_gddgen, + "modify_fsurdat_allcropseverywhere.cfg", + ) + self._create_config_file_evenlysplitcrop() + + command = f"python3 {tool_path} {self._cfg_path} " + stu.run_python_script( + self._get_caseroot(), + self._this_conda_env, + command, + tool_path, + ) + + # Modify namelist + logger.info("RXCROPMATURITY log: modify user_nl files: new fsurdat") + self._append_to_user_nl_clm( + [ + "fsurdat = '{}'".format(self._fsurdat_out), + "do_transient_crops = .false.", + "flanduse_timeseries = ''", + "use_init_interp = .true.", + ] + ) + + def _create_config_file_evenlysplitcrop(self): + """ + Open the new and the template .cfg files + Loop line by line through the template .cfg file + When string matches, replace that line's content + """ + cfg_template_path = os.path.join( + self._ctsm_root, "tools/modify_input_files/modify_fsurdat_template.cfg" + ) + + with open(self._cfg_path, "w", encoding="utf-8") as cfg_out: + # Copy template, replacing some lines + with open(cfg_template_path, "r", encoding="utf-8") as cfg_in: + for line in cfg_in: + if re.match(r" *evenly_split_cropland *=", line): + line = f"evenly_split_cropland = True" + elif re.match(r" *fsurdat_in *=", line): + line = f"fsurdat_in = {self._fsurdat_in}" + elif re.match(r" *fsurdat_out *=", line): + line = f"fsurdat_out = {self._fsurdat_out}" + elif re.match(r" *process_subgrid_section *=", line): + line = f"process_subgrid_section = True" + cfg_out.write(line) + + # Add new lines + cfg_out.write("\n") + cfg_out.write("[modify_fsurdat_subgrid_fractions]\n") + cfg_out.write("PCT_CROP = 100.0\n") + cfg_out.write("PCT_NATVEG = 0.0\n") + cfg_out.write("PCT_GLACIER = 0.0\n") + cfg_out.write("PCT_WETLAND = 0.0\n") + cfg_out.write("PCT_LAKE = 0.0\n") + cfg_out.write("PCT_OCEAN = 0.0\n") + cfg_out.write("PCT_URBAN = 0.0 0.0 0.0\n") + + def _run_check_rxboth_run(self): + + output_dir = os.path.join(self._get_caseroot(), "run") + first_usable_year = self._run_startyear + 2 + last_usable_year = self._run_startyear + self._run_Nyears - 2 + + tool_path = os.path.join( + self._ctsm_root, "python", "ctsm", "crop_calendars", "check_rxboth_run.py" + ) + command = ( + f"python3 {tool_path} " + + f"--directory {output_dir} " + + f"-y1 {first_usable_year} " + + f"-yN {last_usable_year} " + + f"--rx-sdates-file {self._sdatefile} " + + f"--rx-gdds-file {self._gdds_file} " + ) + stu.run_python_script( + self._get_caseroot(), + self._this_conda_env, + command, + tool_path, + ) + + def _modify_user_nl_allruns(self): + nl_additions = [ + "stream_meshfile_cropcal = '{}'".format(self._case.get_value("LND_DOMAIN_MESH")), + "stream_fldFileName_swindow_start = '{}'".format(self._sdatefile), + "stream_fldFileName_swindow_end = '{}'".format(self._sdatefile), + "stream_year_first_cropcal = 2000", + "stream_year_last_cropcal = 2000", + "model_year_align_cropcal = 2000", + " ", + "! (h1) Annual outputs on sowing or harvest axis", + "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.", + ] + self._append_to_user_nl_clm(nl_additions) + + def _run_generate_gdds(self, case_gddgen): + self._generate_gdds_dir = os.path.join(self._path_gddgen, "generate_gdds_out") + os.makedirs(self._generate_gdds_dir) + + # Get arguments to generate_gdds.py + dout_sr = case_gddgen.get_value("DOUT_S_ROOT") + input_dir = os.path.join(dout_sr, "lnd", "hist") + first_season = self._run_startyear + 2 + last_season = self._run_startyear + self._run_Nyears - 2 + sdates_file = self._sdatefile + hdates_file = self._hdatefile + + # It'd be much nicer to call generate_gdds.main(), but I can't import generate_gdds. + tool_path = os.path.join( + self._ctsm_root, "python", "ctsm", "crop_calendars", "generate_gdds.py" + ) + command = " ".join( + [ + f"python3 {tool_path}", + f"--input-dir {input_dir}", + f"--first-season {first_season}", + f"--last-season {last_season}", + f"--sdates-file {sdates_file}", + f"--hdates-file {hdates_file}", + f"--output-dir generate_gdds_out", + f"--skip-crops miscanthus,irrigated_miscanthus", + ] + ) + stu.run_python_script( + self._get_caseroot(), + self._this_conda_env, + command, + tool_path, + ) + + # Where were the prescribed maturity requirements saved? + generated_gdd_files = glob.glob(os.path.join(self._generate_gdds_dir, "gdds_*.nc")) + if len(generated_gdd_files) != 1: + error_message = f"ERROR: Expected one matching prescribed maturity requirements file; found {len(generated_gdd_files)}: {generated_gdd_files}" + logger.error(error_message) + raise RuntimeError(error_message) + self._gdds_file = generated_gdd_files[0] + + def _get_conda_env(self): + conda_setup_commands = stu.cmds_to_setup_conda(self._get_caseroot()) + + # If npl conda environment is available, use that (It has dask, which + # enables chunking, which makes reading daily 1-degree netCDF files + # much more efficient. + if "npl " in os.popen(conda_setup_commands + "conda env list").read(): + self._this_conda_env = "npl" + else: + self._this_conda_env = "ctsm_pylib" + + def _append_to_user_nl_clm(self, additions): + caseroot = self._get_caseroot() + append_to_user_nl_files(caseroot=caseroot, component="clm", contents=additions) + + # Is flanduse_timeseries defined? If so, where is it? + def _get_flanduse_timeseries_in(self, case): + case.create_namelists(component="lnd") + self._lnd_in_path = os.path.join(self._path_gddgen, "CaseDocs", "lnd_in") + self._flanduse_timeseries_in = None + with open(self._lnd_in_path, "r") as lnd_in: + for line in lnd_in: + flanduse_timeseries_in = re.match(r" *flanduse_timeseries *= *'(.*)'", line) + if flanduse_timeseries_in: + self._flanduse_timeseries_in = flanduse_timeseries_in.group(1) + break diff --git a/cime_config/SystemTests/rxcropmaturityskipbuild.py b/cime_config/SystemTests/rxcropmaturityskipbuild.py new file mode 100644 index 0000000000..0e16c757fc --- /dev/null +++ b/cime_config/SystemTests/rxcropmaturityskipbuild.py @@ -0,0 +1,9 @@ +from rxcropmaturityshared import RXCROPMATURITYSHARED + + +class RXCROPMATURITYSKIPBUILD(RXCROPMATURITYSHARED): + def build_indv(self, sharedlib_only=False, model_only=False): + self._case.set_value("BUILD_COMPLETE", "TRUE") + + def run_phase(self): + self._run_phase(skip_run=False) diff --git a/cime_config/SystemTests/rxcropmaturityskiprun.py b/cime_config/SystemTests/rxcropmaturityskiprun.py new file mode 100644 index 0000000000..24fc288373 --- /dev/null +++ b/cime_config/SystemTests/rxcropmaturityskiprun.py @@ -0,0 +1,9 @@ +from rxcropmaturityshared import RXCROPMATURITYSHARED + + +class RXCROPMATURITYSKIPRUN(RXCROPMATURITYSHARED): + def build_indv(self, sharedlib_only=False, model_only=False): + self._case.set_value("BUILD_COMPLETE", "TRUE") + + def run_phase(self): + self._run_phase(skip_run=True) diff --git a/cime_config/config_tests.xml b/cime_config/config_tests.xml index c0b6afed9d..115f4c0e89 100644 --- a/cime_config/config_tests.xml +++ b/cime_config/config_tests.xml @@ -133,6 +133,26 @@ This defines various CTSM-specific system tests $STOP_N + + As RXCROPMATURITY but don't actually run or postprocess; just setup + 1 + FALSE + FALSE + never + $STOP_OPTION + $STOP_N + + + + As RXCROPMATURITY but don't actually build; just setup and then start "run." Will fail when run start is requested, but should successfully test preprocessing. + 1 + FALSE + FALSE + never + $STOP_OPTION + $STOP_N + + .false. diff --git a/bld/namelist_files/namelist_definition_ctsm.xml b/bld/namelist_files/namelist_definition_ctsm.xml index 37c457141c..1a6a5581a8 100644 --- a/bld/namelist_files/namelist_definition_ctsm.xml +++ b/bld/namelist_files/namelist_definition_ctsm.xml @@ -828,6 +828,11 @@ Toggle to turn on meteorological downscaling in hillslope model Toggle to turn on surface water routing in the hillslope hydrology model + +If true, set fsat to zero for hillslope columns + + Method for calculating hillslope saturated head gradient diff --git a/src/biogeophys/SaturatedExcessRunoffMod.F90 b/src/biogeophys/SaturatedExcessRunoffMod.F90 index 5643a95394..9956a7dfb8 100644 --- a/src/biogeophys/SaturatedExcessRunoffMod.F90 +++ b/src/biogeophys/SaturatedExcessRunoffMod.F90 @@ -12,8 +12,8 @@ module SaturatedExcessRunoffMod use shr_log_mod , only : errMsg => shr_log_errMsg use decompMod , only : bounds_type use abortutils , only : endrun - use clm_varctl , only : iulog, use_vichydro, crop_fsat_equals_zero - use clm_varcon , only : spval + use clm_varctl , only : iulog, use_vichydro, crop_fsat_equals_zero, hillslope_fsat_equals_zero + use clm_varcon , only : spval,ispval use LandunitType , only : landunit_type use landunit_varcon , only : istcrop use ColumnType , only : column_type @@ -266,6 +266,19 @@ subroutine SaturatedExcessRunoff (this, bounds, num_hydrologyc, filter_hydrology end do endif + ! ------------------------------------------------------------------------ + ! Set fsat to zero for upland hillslope columns + ! ------------------------------------------------------------------------ + if (hillslope_fsat_equals_zero) then + do fc = 1, num_hydrologyc + c = filter_hydrologyc(fc) + if(col%is_hillslope_column(c) .and. col%active(c)) then + ! Set fsat to zero for upland columns + if (col%cold(c) /= ispval) fsat(c) = 0._r8 + endif + end do + endif + ! ------------------------------------------------------------------------ ! Compute qflx_sat_excess_surf ! diff --git a/src/main/clm_varctl.F90 b/src/main/clm_varctl.F90 index 0daedbbb1f..7423b5ad6a 100644 --- a/src/main/clm_varctl.F90 +++ b/src/main/clm_varctl.F90 @@ -414,6 +414,8 @@ module clm_varctl logical, public :: use_hillslope = .false. ! true => use multi-column hillslope hydrology logical, public :: downscale_hillslope_meteorology = .false. ! true => downscale meteorological forcing in hillslope model logical, public :: use_hillslope_routing = .false. ! true => use surface water routing in hillslope hydrology + logical, public :: hillslope_fsat_equals_zero = .false. ! set saturated excess runoff to zero for hillslope columns + !---------------------------------------------------------- ! excess ice physics switch diff --git a/src/main/controlMod.F90 b/src/main/controlMod.F90 index 46d9e9958a..cde67aa12a 100644 --- a/src/main/controlMod.F90 +++ b/src/main/controlMod.F90 @@ -270,6 +270,8 @@ subroutine control_init(dtime) namelist /clm_inparm/ use_hillslope_routing + namelist /clm_inparm/ hillslope_fsat_equals_zero + namelist /clm_inparm/ use_hydrstress namelist /clm_inparm/ use_dynroot @@ -840,6 +842,8 @@ subroutine control_spmd() call mpi_bcast (use_hillslope_routing, 1, MPI_LOGICAL, 0, mpicom, ier) + call mpi_bcast (hillslope_fsat_equals_zero, 1, MPI_LOGICAL, 0, mpicom, ier) + call mpi_bcast (use_hydrstress, 1, MPI_LOGICAL, 0, mpicom, ier) call mpi_bcast (use_dynroot, 1, MPI_LOGICAL, 0, mpicom, ier) @@ -1124,8 +1128,9 @@ subroutine control_print () write(iulog,*) ' land-ice albedos (unitless 0-1) = ', albice write(iulog,*) ' hillslope hydrology = ', use_hillslope - write(iulog,*) ' downscale hillslope meteorology = ', downscale_hillslope_meteorology + write(iulog,*) ' downscale hillslope meteorology = ', downscale_hillslope_meteorology write(iulog,*) ' hillslope routing = ', use_hillslope_routing + write(iulog,*) ' hillslope_fsat_equals_zero = ', hillslope_fsat_equals_zero write(iulog,*) ' pre-defined soil layer structure = ', soil_layerstruct_predefined write(iulog,*) ' user-defined soil layer structure = ', soil_layerstruct_userdefined write(iulog,*) ' user-defined number of soil layers = ', soil_layerstruct_userdefined_nlevsoi From 46307bca0a850876c67a3041bf786a76441ca853 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Fri, 14 Jun 2024 14:19:01 -0600 Subject: [PATCH 0503/1248] generate_gdds: Don't fail if making figures but GDDHARV alll NaN. --- .../crop_calendars/generate_gdds_functions.py | 32 +++++++++++++------ 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/python/ctsm/crop_calendars/generate_gdds_functions.py b/python/ctsm/crop_calendars/generate_gdds_functions.py index 8af2fdc049..38c5d44384 100644 --- a/python/ctsm/crop_calendars/generate_gdds_functions.py +++ b/python/ctsm/crop_calendars/generate_gdds_functions.py @@ -575,6 +575,7 @@ def import_and_process_1yr( this_crop_gddaccum_da = this_crop_ds[clm_gdd_var] if save_figs: this_crop_gddharv_da = this_crop_ds["GDDHARV"] + check_gddharv = True if not this_crop_gddaccum_da.size: continue log(logger, f" {vegtype_str}...") @@ -625,11 +626,18 @@ def import_and_process_1yr( + "NaN after extracting GDDs accumulated at harvest", ) if save_figs and np.any(np.isnan(gddharv_atharv_p)): - log( - logger, - f" ❗ {np.sum(np.isnan(gddharv_atharv_p))}/{len(gddharv_atharv_p)} " - + "NaN after extracting GDDHARV", - ) + if np.all(np.isnan(gddharv_atharv_p)): + log( + logger, + " ❗ All GDDHARV are NaN; should only affect figure" + ) + check_gddharv = False + else: + log( + logger, + f" ❗ {np.sum(np.isnan(gddharv_atharv_p))}/{len(gddharv_atharv_p)} " + + "NaN after extracting GDDHARV", + ) # Assign these to growing seasons based on whether gs crossed new year this_year_active_patch_indices = [ @@ -712,7 +720,7 @@ def import_and_process_1yr( ) else: error(logger, "Unexpected NaN for last season's GDD accumulation.") - if save_figs and np.any( + if save_figs and check_gddharv and np.any( np.isnan( gddharv_yp_list[var][year_index - 1, active_this_year_where_gs_lastyr_indices] ) @@ -1160,9 +1168,13 @@ def make_figures( else: error(logger, f"layout {layout} not recognized") - this_min = int(np.round(np.nanmin(gddharv_map_yx))) - this_max = int(np.round(np.nanmax(gddharv_map_yx))) - this_title = f"{run1_name} (range {this_min}–{this_max})" + gddharv_all_nan = np.all(np.isnan(gddharv_map_yx.values)) + if gddharv_all_nan: + this_title = f"{run1_name} (GDDHARV all NaN?)" + else: + this_min = int(np.round(np.nanmin(gddharv_map_yx))) + this_max = int(np.round(np.nanmax(gddharv_map_yx))) + this_title = f"{run1_name} (range {this_min}–{this_max})" make_gengdd_map( this_axis, gddharv_map_yx, @@ -1195,7 +1207,7 @@ def make_figures( ) # Difference - if layout == "3x2": + if not gddharv_all_nan and layout == "3x2": this_axis = fig.add_subplot(spec[2, 0], projection=ccrs.PlateCarree()) this_min = int(np.round(np.nanmin(gdd_map_yx))) this_max = int(np.round(np.nanmax(gdd_map_yx))) From faa536eb00c0afb70cacce239423a5af82ccaf5a Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Fri, 14 Jun 2024 14:47:19 -0600 Subject: [PATCH 0504/1248] Revert "PlantCrop: GDD-gen runs get gddmaturity 1e36." GDD-generating runs should get the CLM default gddmaturity values. This reverts commit f2518b611408c12ae262c1b71b9b0a128196c934. --- src/biogeochem/CNPhenologyMod.F90 | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/biogeochem/CNPhenologyMod.F90 b/src/biogeochem/CNPhenologyMod.F90 index 41d4107f3f..b346cb119f 100644 --- a/src/biogeochem/CNPhenologyMod.F90 +++ b/src/biogeochem/CNPhenologyMod.F90 @@ -2694,10 +2694,7 @@ subroutine PlantCrop(p, leafcn_in, jday, kyr, do_plant_normal, & ! set GDD target did_rx_gdds = .false. - if (generate_crop_gdds) then - ! Value mostly doesn't matter; it just needs to be large enough to avoid divide-by-zero errors. - gddmaturity(p) = 1.e36_r8 - else if (use_cropcal_rx_cultivar_gdds .and. crop_inst%rx_cultivar_gdds_thisyr_patch(p,sowing_count(p)) .ge. 0._r8) then + if (use_cropcal_rx_cultivar_gdds .and. crop_inst%rx_cultivar_gdds_thisyr_patch(p,sowing_count(p)) .ge. 0._r8) then gddmaturity(p) = crop_inst%rx_cultivar_gdds_thisyr_patch(p,sowing_count(p)) did_rx_gdds = .true. if (adapt_cropcal_rx_cultivar_gdds .and. crop_inst%gdd20_baseline_patch(p) > min_gdd20_baseline) then From bbd63275549c1ad6cfa51bccacccb01e169772d4 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Fri, 14 Jun 2024 11:09:53 -0600 Subject: [PATCH 0505/1248] Add RXCROPMATURITYSKIPGEN test. --- .../SystemTests/rxcropmaturityshared.py | 71 +++++++++++++++++-- .../SystemTests/rxcropmaturityskipgen.py | 7 ++ cime_config/config_tests.xml | 10 +++ 3 files changed, 81 insertions(+), 7 deletions(-) create mode 100644 cime_config/SystemTests/rxcropmaturityskipgen.py diff --git a/cime_config/SystemTests/rxcropmaturityshared.py b/cime_config/SystemTests/rxcropmaturityshared.py index 0fc8a91cc2..991fe687b5 100644 --- a/cime_config/SystemTests/rxcropmaturityshared.py +++ b/cime_config/SystemTests/rxcropmaturityshared.py @@ -24,6 +24,7 @@ from CIME.SystemTests.system_tests_common import SystemTestsCommon from CIME.XML.standard_module_setup import * from CIME.SystemTests.test_utils.user_nl_utils import append_to_user_nl_files +from CIME.case import Case import shutil, glob logger = logging.getLogger(__name__) @@ -34,6 +35,11 @@ def __init__(self, case): # initialize an object interface to the SMS system test SystemTestsCommon.__init__(self, case) + # Is this a real RXCROPMATURITY test or not? + casebaseid = self._case.get_value("CASEBASEID") + full_test = "RXCROPMATURITY_" in casebaseid + skipgen_test = "RXCROPMATURITYSKIPGEN_" in casebaseid + # Ensure run length is at least 5 years. Minimum to produce one complete growing season (i.e., two complete calendar years) actually 4 years, but that only gets you 1 season usable for GDD generation, so you can't check for season-to-season consistency. stop_n = self._case.get_value("STOP_N") stop_option = self._case.get_value("STOP_OPTION") @@ -60,11 +66,17 @@ def __init__(self, case): f"STOP_OPTION ({stop_option_orig}) must be nsecond(s), nminute(s), " + "nhour(s), nday(s), nmonth(s), or nyear(s)" ) - elif stop_n < 5: + elif full_test and stop_n < 5: error_message = ( "RXCROPMATURITY must be run for at least 5 years; you requested " + f"{stop_n_orig} {stop_option_orig[1:]}" ) + elif skipgen_test and stop_n < 3: + # First year is discarded because crops are already in the ground at restart, and those aren't affected by the new crop calendar inputs. The second year is useable, but we need a third year so that all crops planted in the second year have a chance to finish. + error_message = ( + "RXCROPMATURITYSKIPGEN (both-forced part) must be run for at least 3 years; you requested " + + f"{stop_n_orig} {stop_option_orig[1:]}" + ) if error_message is not None: logger.error(error_message) raise RuntimeError(error_message) @@ -73,7 +85,6 @@ def __init__(self, case): self._run_Nyears = int(stop_n) # Only allow RXCROPMATURITY to be called with test cropMonthOutput - casebaseid = self._case.get_value("CASEBASEID") if casebaseid.split("-")[-1] != "cropMonthOutput": error_message = ( "Only call RXCROPMATURITY with test cropMonthOutput " @@ -85,10 +96,17 @@ def __init__(self, case): # Get files with prescribed sowing and harvest dates self._get_rx_dates() + # Get cultivar maturity requirement file to fall back on if not generating it here + self._gdds_file = None + self._fallback_gdds_file = os.path.join( + os.path.dirname(self._sdatefile), + "gdds_20230829_161011.nc" + ) + # Which conda environment should we use? self._get_conda_env() - def _run_phase(self, skip_run=False): + def _run_phase(self, skip_run=False, skip_gen=False): # Modeling this after the SSP test, we create a clone to be the case whose outputs we don't # want to be saved as baseline. @@ -157,8 +175,18 @@ def _run_phase(self, skip_run=False): # We *do* expect history files here, but anyway. This works. self._skip_pnl = False + # If not generating GDDs, only run a few days of this. + if skip_gen: + with Case(self._path_gddgen, read_only=False) as case: + case.set_value("STOP_N", 5) + case.set_value("STOP_OPTION", "ndays") + if not skip_run: self.run_indv(suffix=None, st_archive=True) + if skip_gen: + # Interpolate an existing GDD file. Needed to check obedience to GDD inputs. + self._run_interpolate_gdds() + else: self._run_generate_gdds(case_gddgen) # ------------------------------------------------------------------- @@ -187,7 +215,7 @@ def _run_phase(self, skip_run=False): # ------------------------------------------------------------------- logger.info("RXCROPMATURITY log: output check: Prescribed Calendars") if not skip_run: - self._run_check_rxboth_run() + self._run_check_rxboth_run(skip_gen) # Get sowing and harvest dates for this resolution. def _get_rx_dates(self): @@ -344,11 +372,16 @@ def _create_config_file_evenlysplitcrop(self): cfg_out.write("PCT_OCEAN = 0.0\n") cfg_out.write("PCT_URBAN = 0.0 0.0 0.0\n") - def _run_check_rxboth_run(self): + def _run_check_rxboth_run(self, skip_gen): output_dir = os.path.join(self._get_caseroot(), "run") - first_usable_year = self._run_startyear + 2 - last_usable_year = self._run_startyear + self._run_Nyears - 2 + + if skip_gen: + first_usable_year = self._run_startyear + 1 + last_usable_year = first_usable_year + else: + first_usable_year = self._run_startyear + 2 + last_usable_year = self._run_startyear + self._run_Nyears - 2 tool_path = os.path.join( self._ctsm_root, "python", "ctsm", "crop_calendars", "check_rxboth_run.py" @@ -429,6 +462,30 @@ def _run_generate_gdds(self, case_gddgen): raise RuntimeError(error_message) self._gdds_file = generated_gdd_files[0] + def _run_interpolate_gdds(self): + # Save where? + self._gdds_file = os.path.join(self._get_caseroot(), "interpolated_gdds.nc") + + # It'd be much nicer to call interpolate_gdds.main(), but I can't import interpolate_gdds. + tool_path = os.path.join( + self._ctsm_root, "python", "ctsm", "crop_calendars", "interpolate_gdds.py" + ) + command = " ".join( + [ + f"python3 {tool_path}", + f"--input-file {self._fallback_gdds_file}", + f"--target-file {self._sdatefile}", + f"--output-file {self._gdds_file}", + "--overwrite", + ] + ) + stu.run_python_script( + self._get_caseroot(), + self._this_conda_env, + command, + tool_path, + ) + def _get_conda_env(self): conda_setup_commands = stu.cmds_to_setup_conda(self._get_caseroot()) diff --git a/cime_config/SystemTests/rxcropmaturityskipgen.py b/cime_config/SystemTests/rxcropmaturityskipgen.py new file mode 100644 index 0000000000..4fb5257967 --- /dev/null +++ b/cime_config/SystemTests/rxcropmaturityskipgen.py @@ -0,0 +1,7 @@ +from rxcropmaturityshared import RXCROPMATURITYSHARED + + +class RXCROPMATURITYSKIPGEN(RXCROPMATURITYSHARED): + + def run_phase(self): + self._run_phase(skip_run=False, skip_gen=True) diff --git a/cime_config/config_tests.xml b/cime_config/config_tests.xml index 115f4c0e89..cbddc31b8d 100644 --- a/cime_config/config_tests.xml +++ b/cime_config/config_tests.xml @@ -133,6 +133,16 @@ This defines various CTSM-specific system tests $STOP_N + + As RXCROPMATURITY but don't actually generate GDDs. Allows short testing with existing GDD inputs. + 1 + FALSE + FALSE + never + $STOP_OPTION + $STOP_N + + As RXCROPMATURITY but don't actually run or postprocess; just setup 1 From 6bf99769d28391828b3cf72729ec8b120f0b839f Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Fri, 14 Jun 2024 15:33:24 -0600 Subject: [PATCH 0506/1248] interpolate_gdds: nearest-neighbor for safety. --- python/ctsm/crop_calendars/cropcal_module.py | 17 +++++++++++++---- python/ctsm/crop_calendars/interpolate_gdds.py | 18 +++++++++++------- 2 files changed, 24 insertions(+), 11 deletions(-) diff --git a/python/ctsm/crop_calendars/cropcal_module.py b/python/ctsm/crop_calendars/cropcal_module.py index 3fe6942f94..d25e16397e 100644 --- a/python/ctsm/crop_calendars/cropcal_module.py +++ b/python/ctsm/crop_calendars/cropcal_module.py @@ -13,6 +13,8 @@ from ctsm.crop_calendars.cropcal_constants import DEFAULT_GDD_MIN from ctsm.crop_calendars.import_ds import import_ds +MISSING_RX_GDD_VAL = -1 + def check_and_trim_years(year_1, year_n, ds_in): """ @@ -231,6 +233,13 @@ def import_max_gs_length(paramfile_dir, my_clm_ver, my_clm_subver): return mxmat_dict +def unexpected_negative_rx_gdd(data_array): + """ + Return True if there's a negative value not matching the designated missing value + """ + return np.any((data_array.values < 0) & (data_array.values != MISSING_RX_GDD_VAL)) + + def import_rx_dates(var_prefix, date_infile, dates_ds, set_neg1_to_nan=True): """ Import prescribed sowing/harvest dates @@ -260,19 +269,19 @@ def import_rx_dates(var_prefix, date_infile, dates_ds, set_neg1_to_nan=True): v_new = var.replace(var_prefix, "gs") this_ds = this_ds.rename({var: v_new}) - # Set -1 prescribed GDD values to NaN. Only warn the first time. + # Set GDD values matching MISSING_RX_GDD_VAL to NaN. Only warn the first time. if ( set_neg1_to_nan and var_prefix == "gdd" and v_new != var and np.any(this_ds[v_new].values < 0) ): - if np.any((this_ds[v_new].values < 0) & (this_ds[v_new].values != -1)): + if unexpected_negative_rx_gdd(this_ds[v_new]): raise RuntimeError(f"Unexpected negative value in {var}") if not did_warn: - print("Setting -1 rx GDD values to NaN") + print(f"Setting {MISSING_RX_GDD_VAL} rx GDD values to NaN") did_warn = True - this_ds[v_new] = this_ds[v_new].where(this_ds[v_new] != -1) + this_ds[v_new] = this_ds[v_new].where(this_ds[v_new] != MISSING_RX_GDD_VAL) return this_ds diff --git a/python/ctsm/crop_calendars/interpolate_gdds.py b/python/ctsm/crop_calendars/interpolate_gdds.py index b740766d3b..e9491480e9 100755 --- a/python/ctsm/crop_calendars/interpolate_gdds.py +++ b/python/ctsm/crop_calendars/interpolate_gdds.py @@ -13,6 +13,9 @@ sys.path.insert(1, _CTSM_PYTHON) from ctsm import ctsm_logging # pylint: disable=wrong-import-position +from ctsm.crop_calendars.cropcal_module import ( # pylint: disable=wrong-import-position + unexpected_negative_rx_gdd, +) logger = logging.getLogger(__name__) @@ -113,13 +116,14 @@ def interpolate_gdds(args): continue # Interpolate - da_in = ds_in[var] - da_out = ds_in[var].interp_like(ds_target) - - # Ensure minimum GDD is respected - min_allowed = min(0, da_in.min()) - da_out = da_out.where(da_out >= min_allowed) - da_out = da_out.fillna(min_allowed) + da_out = ds_in[var].interp_like( + ds_target, + method="nearest", + kwargs={"fill_value": "extrapolate"}, # Otherwise you get NaNs at edges + ) + + if unexpected_negative_rx_gdd(da_out): + raise RuntimeError("Unexpected negative value") # Add to dataset ds_out[var] = da_out From 81177dd169e3c2f15f97a23216eb9793de4d8f3a Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Fri, 14 Jun 2024 16:10:34 -0600 Subject: [PATCH 0507/1248] Revert all RXCROPMATURITY changes. --- cime_config/SystemTests/rxcropmaturity.py | 445 ++++++++++++++++- .../SystemTests/rxcropmaturityshared.py | 459 ------------------ .../SystemTests/rxcropmaturityskipbuild.py | 9 - .../SystemTests/rxcropmaturityskiprun.py | 9 - cime_config/config_tests.xml | 20 - 5 files changed, 442 insertions(+), 500 deletions(-) delete mode 100644 cime_config/SystemTests/rxcropmaturityshared.py delete mode 100644 cime_config/SystemTests/rxcropmaturityskipbuild.py delete mode 100644 cime_config/SystemTests/rxcropmaturityskiprun.py diff --git a/cime_config/SystemTests/rxcropmaturity.py b/cime_config/SystemTests/rxcropmaturity.py index 206476f051..75fff8a0e0 100644 --- a/cime_config/SystemTests/rxcropmaturity.py +++ b/cime_config/SystemTests/rxcropmaturity.py @@ -1,5 +1,444 @@ -from rxcropmaturityshared import RXCROPMATURITYSHARED +""" +CTSM-specific test that first performs a GDD-generating run, then calls +Python code to generate the maturity requirement file. This is then used +in a sowing+maturity forced run, which finally is tested to ensure +correct behavior. + +Currently only supports 0.9x1.25, 1.9x2.5, and 10x15 resolutions. Eventually, +this test should be able to generate its own files at whatever resolution it's +called at. Well, really, the ultimate goal would be to give CLM the files +at the original resolution (for GGCMI phase 3, 0.5°) and have the stream +code do the interpolation. However, that wouldn't act on harvest dates +(which are needed for generate_gdds.py). I could have Python interpolate +those, but this would cause a potential inconsistency. +""" + +import os +import re +import systemtest_utils as stu +import subprocess +from CIME.SystemTests.system_tests_common import SystemTestsCommon +from CIME.XML.standard_module_setup import * +from CIME.SystemTests.test_utils.user_nl_utils import append_to_user_nl_files +import shutil, glob + +logger = logging.getLogger(__name__) + + +class RXCROPMATURITY(SystemTestsCommon): + def __init__(self, case): + # initialize an object interface to the SMS system test + SystemTestsCommon.__init__(self, case) + + # Ensure run length is at least 5 years. Minimum to produce one complete growing season (i.e., two complete calendar years) actually 4 years, but that only gets you 1 season usable for GDD generation, so you can't check for season-to-season consistency. + stop_n = self._case.get_value("STOP_N") + stop_option = self._case.get_value("STOP_OPTION") + stop_n_orig = stop_n + stop_option_orig = stop_option + if "nsecond" in stop_option: + stop_n /= 60 + stop_option = "nminutes" + if "nminute" in stop_option: + stop_n /= 60 + stop_option = "nhours" + if "nhour" in stop_option: + stop_n /= 24 + stop_option = "ndays" + if "nday" in stop_option: + stop_n /= 365 + stop_option = "nyears" + if "nmonth" in stop_option: + stop_n /= 12 + stop_option = "nyears" + error_message = None + if "nyear" not in stop_option: + error_message = ( + f"STOP_OPTION ({stop_option_orig}) must be nsecond(s), nminute(s), " + + "nhour(s), nday(s), nmonth(s), or nyear(s)" + ) + elif stop_n < 5: + error_message = ( + "RXCROPMATURITY must be run for at least 5 years; you requested " + + f"{stop_n_orig} {stop_option_orig[1:]}" + ) + if error_message is not None: + logger.error(error_message) + raise RuntimeError(error_message) + + # Get the number of complete years that will be run + self._run_Nyears = int(stop_n) + + # Only allow RXCROPMATURITY to be called with test cropMonthOutput + casebaseid = self._case.get_value("CASEBASEID") + if casebaseid.split("-")[-1] != "cropMonthOutput": + error_message = ( + "Only call RXCROPMATURITY with test cropMonthOutput " + + "to avoid potentially huge sets of daily outputs." + ) + logger.error(error_message) + raise RuntimeError(error_message) + + # Get files with prescribed sowing and harvest dates + self._get_rx_dates() + + # Which conda environment should we use? + self._get_conda_env() -class RXCROPMATURITY(RXCROPMATURITYSHARED): def run_phase(self): - self._run_phase() \ No newline at end of file + # Modeling this after the SSP test, we create a clone to be the case whose outputs we don't + # want to be saved as baseline. + + # ------------------------------------------------------------------- + # (1) Set up GDD-generating run + # ------------------------------------------------------------------- + # Create clone to be GDD-Generating case + logger.info("RXCROPMATURITY log: cloning setup") + case_rxboth = self._case + caseroot = self._case.get_value("CASEROOT") + clone_path = f"{caseroot}.gddgen" + self._path_gddgen = clone_path + if os.path.exists(self._path_gddgen): + shutil.rmtree(self._path_gddgen) + logger.info("RXCROPMATURITY log: cloning") + case_gddgen = self._case.create_clone(clone_path, keepexe=True) + logger.info("RXCROPMATURITY log: done cloning") + + os.chdir(self._path_gddgen) + self._set_active_case(case_gddgen) + + # Set up stuff that applies to both tests + self._setup_all() + + # Add stuff specific to GDD-Generating run + logger.info("RXCROPMATURITY log: modify user_nl files: generate GDDs") + self._append_to_user_nl_clm( + [ + "generate_crop_gdds = .true.", + "use_mxmat = .false.", + " ", + "! (h2) Daily outputs for GDD generation and figure-making", + "hist_fincl3 = 'GDDACCUM', 'GDDHARV'", + "hist_nhtfrq(3) = -24", + "hist_mfilt(3) = 365", + "hist_type1d_pertape(3) = 'PFTS'", + "hist_dov2xy(3) = .false.", + ] + ) + + # If flanduse_timeseries is defined, we need to make a static version for this test. This + # should have every crop in most of the world. + self._get_flanduse_timeseries_in(case_gddgen) + if self._flanduse_timeseries_in is not None: + + # Download files from the server, if needed + case_gddgen.check_all_input_data() + + # Make custom version of surface file + logger.info("RXCROPMATURITY log: run fsurdat_modifier") + self._run_fsurdat_modifier() + + # ------------------------------------------------------------------- + # (2) Perform GDD-generating run and generate prescribed GDDs file + # ------------------------------------------------------------------- + logger.info("RXCROPMATURITY log: Start GDD-Generating run") + + # As per SSP test: + # "No history files expected, set suffix=None to avoid compare error" + # We *do* expect history files here, but anyway. This works. + self._skip_pnl = False + self.run_indv(suffix=None, st_archive=True) + + self._run_generate_gdds(case_gddgen) + + # ------------------------------------------------------------------- + # (3) Set up and perform Prescribed Calendars run + # ------------------------------------------------------------------- + os.chdir(caseroot) + self._set_active_case(case_rxboth) + + # Set up stuff that applies to both tests + self._setup_all() + + # Add stuff specific to Prescribed Calendars run + logger.info("RXCROPMATURITY log: modify user_nl files: Prescribed Calendars") + self._append_to_user_nl_clm( + [ + "generate_crop_gdds = .false.", + f"stream_fldFileName_cultivar_gdds = '{self._gdds_file}'", + ] + ) + + self.run_indv() + + # ------------------------------------------------------------------- + # (4) Check Prescribed Calendars run + # ------------------------------------------------------------------- + logger.info("RXCROPMATURITY log: output check: Prescribed Calendars") + self._run_check_rxboth_run() + + # Get sowing and harvest dates for this resolution. + def _get_rx_dates(self): + # Eventually, I want to remove these hard-coded resolutions so that this test can generate + # its own sowing and harvest date files at whatever resolution is requested. + lnd_grid = self._case.get_value("LND_GRID") + input_data_root = self._case.get_value("DIN_LOC_ROOT") + processed_crop_dates_dir = f"{input_data_root}/lnd/clm2/cropdata/calendars/processed" + if lnd_grid == "10x15": + self._sdatefile = os.path.join( + processed_crop_dates_dir, + "sdates_ggcmi_crop_calendar_phase3_v1.01_nninterp-f10_f10_mg37.2000-2000.20230330_165301.nc", + ) + self._hdatefile = os.path.join( + processed_crop_dates_dir, + "hdates_ggcmi_crop_calendar_phase3_v1.01_nninterp-f10_f10_mg37.2000-2000.20230330_165301.nc", + ) + elif lnd_grid == "1.9x2.5": + self._sdatefile = os.path.join( + processed_crop_dates_dir, + "sdates_ggcmi_crop_calendar_phase3_v1.01_nninterp-f19_g17.2000-2000.20230102_175625.nc", + ) + self._hdatefile = os.path.join( + processed_crop_dates_dir, + "hdates_ggcmi_crop_calendar_phase3_v1.01_nninterp-f19_g17.2000-2000.20230102_175625.nc", + ) + elif lnd_grid == "0.9x1.25": + self._sdatefile = os.path.join( + processed_crop_dates_dir, + "sdates_ggcmi_crop_calendar_phase3_v1.01_nninterp-f09_g17.2000-2000.20230520_134417.nc", + ) + self._hdatefile = os.path.join( + processed_crop_dates_dir, + "hdates_ggcmi_crop_calendar_phase3_v1.01_nninterp-f09_g17.2000-2000.20230520_134418.nc", + ) + else: + error_message = "ERROR: RXCROPMATURITY currently only supports 0.9x1.25, 1.9x2.5, and 10x15 resolutions" + logger.error(error_message) + raise RuntimeError(error_message) + + # Ensure files exist + error_message = None + if not os.path.exists(self._sdatefile): + error_message = f"ERROR: Sowing date file not found: {self._sdatefile}" + elif not os.path.exists(self._hdatefile): + error_message = f"ERROR: Harvest date file not found: {self._sdatefile}" + if error_message is not None: + logger.error(error_message) + raise RuntimeError(error_message) + + def _setup_all(self): + logger.info("RXCROPMATURITY log: _setup_all start") + + # Get some info + self._ctsm_root = self._case.get_value("COMP_ROOT_DIR_LND") + run_startdate = self._case.get_value("RUN_STARTDATE") + self._run_startyear = int(run_startdate.split("-")[0]) + + # Set sowing dates file (and other crop calendar settings) for all runs + logger.info("RXCROPMATURITY log: modify user_nl files: all tests") + self._modify_user_nl_allruns() + logger.info("RXCROPMATURITY log: _setup_all done") + + # Make a surface dataset that has every crop in every gridcell + def _run_fsurdat_modifier(self): + + # fsurdat should be defined. Where is it? + self._fsurdat_in = None + with open(self._lnd_in_path, "r") as lnd_in: + for line in lnd_in: + fsurdat_in = re.match(r" *fsurdat *= *'(.*)'", line) + if fsurdat_in: + self._fsurdat_in = fsurdat_in.group(1) + break + if self._fsurdat_in is None: + error_message = "fsurdat not defined" + logger.error(error_message) + raise RuntimeError(error_message) + + # Where we will save the fsurdat version for this test + path, ext = os.path.splitext(self._fsurdat_in) + dir_in, filename_in_noext = os.path.split(path) + self._fsurdat_out = os.path.join( + self._path_gddgen, f"{filename_in_noext}.all_crops_everywhere{ext}" + ) + + # Make fsurdat for this test, if not already done + if not os.path.exists(self._fsurdat_out): + tool_path = os.path.join( + self._ctsm_root, + "tools", + "modify_input_files", + "fsurdat_modifier", + ) + + # Create configuration file for fsurdat_modifier + self._cfg_path = os.path.join( + self._path_gddgen, + "modify_fsurdat_allcropseverywhere.cfg", + ) + self._create_config_file_evenlysplitcrop() + + command = f"python3 {tool_path} {self._cfg_path} " + stu.run_python_script( + self._get_caseroot(), + self._this_conda_env, + command, + tool_path, + ) + + # Modify namelist + logger.info("RXCROPMATURITY log: modify user_nl files: new fsurdat") + self._append_to_user_nl_clm( + [ + "fsurdat = '{}'".format(self._fsurdat_out), + "do_transient_crops = .false.", + "flanduse_timeseries = ''", + "use_init_interp = .true.", + ] + ) + + def _create_config_file_evenlysplitcrop(self): + """ + Open the new and the template .cfg files + Loop line by line through the template .cfg file + When string matches, replace that line's content + """ + cfg_template_path = os.path.join( + self._ctsm_root, "tools/modify_input_files/modify_fsurdat_template.cfg" + ) + + with open(self._cfg_path, "w", encoding="utf-8") as cfg_out: + # Copy template, replacing some lines + with open(cfg_template_path, "r", encoding="utf-8") as cfg_in: + for line in cfg_in: + if re.match(r" *evenly_split_cropland *=", line): + line = f"evenly_split_cropland = True" + elif re.match(r" *fsurdat_in *=", line): + line = f"fsurdat_in = {self._fsurdat_in}" + elif re.match(r" *fsurdat_out *=", line): + line = f"fsurdat_out = {self._fsurdat_out}" + elif re.match(r" *process_subgrid_section *=", line): + line = f"process_subgrid_section = True" + cfg_out.write(line) + + # Add new lines + cfg_out.write("\n") + cfg_out.write("[modify_fsurdat_subgrid_fractions]\n") + cfg_out.write("PCT_CROP = 100.0\n") + cfg_out.write("PCT_NATVEG = 0.0\n") + cfg_out.write("PCT_GLACIER = 0.0\n") + cfg_out.write("PCT_WETLAND = 0.0\n") + cfg_out.write("PCT_LAKE = 0.0\n") + cfg_out.write("PCT_OCEAN = 0.0\n") + cfg_out.write("PCT_URBAN = 0.0 0.0 0.0\n") + + def _run_check_rxboth_run(self): + + output_dir = os.path.join(self._get_caseroot(), "run") + first_usable_year = self._run_startyear + 2 + last_usable_year = self._run_startyear + self._run_Nyears - 2 + + tool_path = os.path.join( + self._ctsm_root, "python", "ctsm", "crop_calendars", "check_rxboth_run.py" + ) + command = ( + f"python3 {tool_path} " + + f"--directory {output_dir} " + + f"-y1 {first_usable_year} " + + f"-yN {last_usable_year} " + + f"--rx-sdates-file {self._sdatefile} " + + f"--rx-gdds-file {self._gdds_file} " + ) + stu.run_python_script( + self._get_caseroot(), + self._this_conda_env, + command, + tool_path, + ) + + def _modify_user_nl_allruns(self): + nl_additions = [ + "stream_meshfile_cropcal = '{}'".format(self._case.get_value("LND_DOMAIN_MESH")), + "stream_fldFileName_swindow_start = '{}'".format(self._sdatefile), + "stream_fldFileName_swindow_end = '{}'".format(self._sdatefile), + "stream_year_first_cropcal_swindows = 2000", + "stream_year_last_cropcal_swindows = 2000", + "model_year_align_cropcal_swindows = 2000", + " ", + "! (h1) Annual outputs on sowing or harvest axis", + "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.", + ] + self._append_to_user_nl_clm(nl_additions) + + def _run_generate_gdds(self, case_gddgen): + self._generate_gdds_dir = os.path.join(self._path_gddgen, "generate_gdds_out") + os.makedirs(self._generate_gdds_dir) + + # Get arguments to generate_gdds.py + dout_sr = case_gddgen.get_value("DOUT_S_ROOT") + input_dir = os.path.join(dout_sr, "lnd", "hist") + first_season = self._run_startyear + 2 + last_season = self._run_startyear + self._run_Nyears - 2 + sdates_file = self._sdatefile + hdates_file = self._hdatefile + + # It'd be much nicer to call generate_gdds.main(), but I can't import generate_gdds. + tool_path = os.path.join( + self._ctsm_root, "python", "ctsm", "crop_calendars", "generate_gdds.py" + ) + command = " ".join( + [ + f"python3 {tool_path}", + f"--input-dir {input_dir}", + f"--first-season {first_season}", + f"--last-season {last_season}", + f"--sdates-file {sdates_file}", + f"--hdates-file {hdates_file}", + f"--output-dir generate_gdds_out", + f"--skip-crops miscanthus,irrigated_miscanthus", + ] + ) + stu.run_python_script( + self._get_caseroot(), + self._this_conda_env, + command, + tool_path, + ) + + # Where were the prescribed maturity requirements saved? + generated_gdd_files = glob.glob(os.path.join(self._generate_gdds_dir, "gdds_*.nc")) + if len(generated_gdd_files) != 1: + error_message = f"ERROR: Expected one matching prescribed maturity requirements file; found {len(generated_gdd_files)}: {generated_gdd_files}" + logger.error(error_message) + raise RuntimeError(error_message) + self._gdds_file = generated_gdd_files[0] + + def _get_conda_env(self): + conda_setup_commands = stu.cmds_to_setup_conda(self._get_caseroot()) + + # If npl conda environment is available, use that (It has dask, which + # enables chunking, which makes reading daily 1-degree netCDF files + # much more efficient. + if "npl " in os.popen(conda_setup_commands + "conda env list").read(): + self._this_conda_env = "npl" + else: + self._this_conda_env = "ctsm_pylib" + + def _append_to_user_nl_clm(self, additions): + caseroot = self._get_caseroot() + append_to_user_nl_files(caseroot=caseroot, component="clm", contents=additions) + + # Is flanduse_timeseries defined? If so, where is it? + def _get_flanduse_timeseries_in(self, case): + case.create_namelists(component="lnd") + self._lnd_in_path = os.path.join(self._path_gddgen, "CaseDocs", "lnd_in") + self._flanduse_timeseries_in = None + with open(self._lnd_in_path, "r") as lnd_in: + for line in lnd_in: + flanduse_timeseries_in = re.match(r" *flanduse_timeseries *= *'(.*)'", line) + if flanduse_timeseries_in: + self._flanduse_timeseries_in = flanduse_timeseries_in.group(1) + break diff --git a/cime_config/SystemTests/rxcropmaturityshared.py b/cime_config/SystemTests/rxcropmaturityshared.py deleted file mode 100644 index 8a944efdf9..0000000000 --- a/cime_config/SystemTests/rxcropmaturityshared.py +++ /dev/null @@ -1,459 +0,0 @@ -""" -CTSM-specific test that first performs a GDD-generating run, then calls -Python code to generate the maturity requirement file. This is then used -in a sowing+maturity forced run, which finally is tested to ensure -correct behavior. - -Currently only supports 0.9x1.25, 1.9x2.5, and 10x15 resolutions. Eventually, -this test should be able to generate its own files at whatever resolution it's -called at. Well, really, the ultimate goal would be to give CLM the files -at the original resolution (for GGCMI phase 3, 0.5°) and have the stream -code do the interpolation. However, that wouldn't act on harvest dates -(which are needed for generate_gdds.py). I could have Python interpolate -those, but this would cause a potential inconsistency. - -Note that this is just a parent class. The actual tests are RXCROPMATURITY and -RXCROPMATURITY_SKIPRUN, the latter of which does everything except perform and -check the CTSM runs. -""" - -import os -import re -import systemtest_utils as stu -import subprocess -from CIME.SystemTests.system_tests_common import SystemTestsCommon -from CIME.XML.standard_module_setup import * -from CIME.SystemTests.test_utils.user_nl_utils import append_to_user_nl_files -import shutil, glob - -logger = logging.getLogger(__name__) - - -class RXCROPMATURITYSHARED(SystemTestsCommon): - def __init__(self, case): - # initialize an object interface to the SMS system test - SystemTestsCommon.__init__(self, case) - - # Ensure run length is at least 5 years. Minimum to produce one complete growing season (i.e., two complete calendar years) actually 4 years, but that only gets you 1 season usable for GDD generation, so you can't check for season-to-season consistency. - stop_n = self._case.get_value("STOP_N") - stop_option = self._case.get_value("STOP_OPTION") - stop_n_orig = stop_n - stop_option_orig = stop_option - if "nsecond" in stop_option: - stop_n /= 60 - stop_option = "nminutes" - if "nminute" in stop_option: - stop_n /= 60 - stop_option = "nhours" - if "nhour" in stop_option: - stop_n /= 24 - stop_option = "ndays" - if "nday" in stop_option: - stop_n /= 365 - stop_option = "nyears" - if "nmonth" in stop_option: - stop_n /= 12 - stop_option = "nyears" - error_message = None - if "nyear" not in stop_option: - error_message = ( - f"STOP_OPTION ({stop_option_orig}) must be nsecond(s), nminute(s), " - + "nhour(s), nday(s), nmonth(s), or nyear(s)" - ) - elif stop_n < 5: - error_message = ( - "RXCROPMATURITY must be run for at least 5 years; you requested " - + f"{stop_n_orig} {stop_option_orig[1:]}" - ) - if error_message is not None: - logger.error(error_message) - raise RuntimeError(error_message) - - # Get the number of complete years that will be run - self._run_Nyears = int(stop_n) - - # Only allow RXCROPMATURITY to be called with test cropMonthOutput - casebaseid = self._case.get_value("CASEBASEID") - if casebaseid.split("-")[-1] != "cropMonthOutput": - error_message = ( - "Only call RXCROPMATURITY with test cropMonthOutput " - + "to avoid potentially huge sets of daily outputs." - ) - logger.error(error_message) - raise RuntimeError(error_message) - - # Get files with prescribed sowing and harvest dates - self._get_rx_dates() - - # Which conda environment should we use? - self._get_conda_env() - - def _run_phase(self, skip_run=False): - # Modeling this after the SSP test, we create a clone to be the case whose outputs we don't - # want to be saved as baseline. - - # ------------------------------------------------------------------- - # (1) Set up GDD-generating run - # ------------------------------------------------------------------- - # Create clone to be GDD-Generating case - logger.info("RXCROPMATURITY log: cloning setup") - case_rxboth = self._case - caseroot = self._case.get_value("CASEROOT") - clone_path = f"{caseroot}.gddgen" - self._path_gddgen = clone_path - if os.path.exists(self._path_gddgen): - shutil.rmtree(self._path_gddgen) - logger.info("RXCROPMATURITY log: cloning") - case_gddgen = self._case.create_clone(clone_path, keepexe=True) - logger.info("RXCROPMATURITY log: done cloning") - - os.chdir(self._path_gddgen) - self._set_active_case(case_gddgen) - - # Set up stuff that applies to both tests - self._setup_all() - - # Add stuff specific to GDD-Generating run - logger.info("RXCROPMATURITY log: modify user_nl files: generate GDDs") - self._append_to_user_nl_clm( - [ - "generate_crop_gdds = .true.", - "stream_fldFileName_cultivar_gdds = ''", - "use_mxmat = .false.", - " ", - "! (h2) Daily outputs for GDD generation and figure-making", - "hist_fincl3 = 'GDDACCUM', 'GDDHARV'", - "hist_nhtfrq(3) = -24", - "hist_mfilt(3) = 365", - "hist_type1d_pertape(3) = 'PFTS'", - "hist_dov2xy(3) = .false.", - ] - ) - - # If flanduse_timeseries is defined, we need to make a static version for this test. This - # should have every crop in most of the world. - self._get_flanduse_timeseries_in(case_gddgen) - if self._flanduse_timeseries_in is not None: - - # Download files from the server, if needed - case_gddgen.check_all_input_data() - - # Copy needed file from original to gddgen directory - shutil.copyfile( - os.path.join(caseroot, ".env_mach_specific.sh"), - os.path.join(self._path_gddgen, ".env_mach_specific.sh"), - ) - - # Make custom version of surface file - logger.info("RXCROPMATURITY log: run fsurdat_modifier") - self._run_fsurdat_modifier() - - # ------------------------------------------------------------------- - # (2) Perform GDD-generating run and generate prescribed GDDs file - # ------------------------------------------------------------------- - logger.info("RXCROPMATURITY log: Start GDD-Generating run") - - # As per SSP test: - # "No history files expected, set suffix=None to avoid compare error" - # We *do* expect history files here, but anyway. This works. - self._skip_pnl = False - - if not skip_run: - self.run_indv(suffix=None, st_archive=True) - self._run_generate_gdds(case_gddgen) - - # ------------------------------------------------------------------- - # (3) Set up and perform Prescribed Calendars run - # ------------------------------------------------------------------- - os.chdir(caseroot) - self._set_active_case(case_rxboth) - - # Set up stuff that applies to both tests - self._setup_all() - - # Add stuff specific to Prescribed Calendars run - logger.info("RXCROPMATURITY log: modify user_nl files: Prescribed Calendars") - self._append_to_user_nl_clm( - [ - "generate_crop_gdds = .false.", - f"stream_fldFileName_cultivar_gdds = '{self._gdds_file}'", - ] - ) - - if not skip_run: - self.run_indv() - - # ------------------------------------------------------------------- - # (4) Check Prescribed Calendars run - # ------------------------------------------------------------------- - logger.info("RXCROPMATURITY log: output check: Prescribed Calendars") - if not skip_run: - self._run_check_rxboth_run() - - # Get sowing and harvest dates for this resolution. - def _get_rx_dates(self): - # Eventually, I want to remove these hard-coded resolutions so that this test can generate - # its own sowing and harvest date files at whatever resolution is requested. - lnd_grid = self._case.get_value("LND_GRID") - input_data_root = self._case.get_value("DIN_LOC_ROOT") - processed_crop_dates_dir = f"{input_data_root}/lnd/clm2/cropdata/calendars/processed" - if lnd_grid == "10x15": - self._sdatefile = os.path.join( - processed_crop_dates_dir, - "sdates_ggcmi_crop_calendar_phase3_v1.01_nninterp-f10_f10_mg37.2000-2000.20230330_165301.nc", - ) - self._hdatefile = os.path.join( - processed_crop_dates_dir, - "hdates_ggcmi_crop_calendar_phase3_v1.01_nninterp-f10_f10_mg37.2000-2000.20230330_165301.nc", - ) - elif lnd_grid == "1.9x2.5": - self._sdatefile = os.path.join( - processed_crop_dates_dir, - "sdates_ggcmi_crop_calendar_phase3_v1.01_nninterp-f19_g17.2000-2000.20230102_175625.nc", - ) - self._hdatefile = os.path.join( - processed_crop_dates_dir, - "hdates_ggcmi_crop_calendar_phase3_v1.01_nninterp-f19_g17.2000-2000.20230102_175625.nc", - ) - elif lnd_grid == "0.9x1.25": - self._sdatefile = os.path.join( - processed_crop_dates_dir, - "sdates_ggcmi_crop_calendar_phase3_v1.01_nninterp-f09_g17.2000-2000.20230520_134417.nc", - ) - self._hdatefile = os.path.join( - processed_crop_dates_dir, - "hdates_ggcmi_crop_calendar_phase3_v1.01_nninterp-f09_g17.2000-2000.20230520_134418.nc", - ) - else: - error_message = "ERROR: RXCROPMATURITY currently only supports 0.9x1.25, 1.9x2.5, and 10x15 resolutions" - logger.error(error_message) - raise RuntimeError(error_message) - - # Ensure files exist - error_message = None - if not os.path.exists(self._sdatefile): - error_message = f"ERROR: Sowing date file not found: {self._sdatefile}" - elif not os.path.exists(self._hdatefile): - error_message = f"ERROR: Harvest date file not found: {self._sdatefile}" - if error_message is not None: - logger.error(error_message) - raise RuntimeError(error_message) - - def _setup_all(self): - logger.info("RXCROPMATURITY log: _setup_all start") - - # Get some info - self._ctsm_root = self._case.get_value("COMP_ROOT_DIR_LND") - run_startdate = self._case.get_value("RUN_STARTDATE") - self._run_startyear = int(run_startdate.split("-")[0]) - - # Set sowing dates file (and other crop calendar settings) for all runs - logger.info("RXCROPMATURITY log: modify user_nl files: all tests") - self._modify_user_nl_allruns() - logger.info("RXCROPMATURITY log: _setup_all done") - - # Make a surface dataset that has every crop in every gridcell - def _run_fsurdat_modifier(self): - - # fsurdat should be defined. Where is it? - self._fsurdat_in = None - with open(self._lnd_in_path, "r") as lnd_in: - for line in lnd_in: - fsurdat_in = re.match(r" *fsurdat *= *'(.*)'", line) - if fsurdat_in: - self._fsurdat_in = fsurdat_in.group(1) - break - if self._fsurdat_in is None: - error_message = "fsurdat not defined" - logger.error(error_message) - raise RuntimeError(error_message) - - # Where we will save the fsurdat version for this test - path, ext = os.path.splitext(self._fsurdat_in) - dir_in, filename_in_noext = os.path.split(path) - self._fsurdat_out = os.path.join( - self._path_gddgen, f"{filename_in_noext}.all_crops_everywhere{ext}" - ) - - # Make fsurdat for this test, if not already done - if not os.path.exists(self._fsurdat_out): - tool_path = os.path.join( - self._ctsm_root, - "tools", - "modify_input_files", - "fsurdat_modifier", - ) - - # Create configuration file for fsurdat_modifier - self._cfg_path = os.path.join( - self._path_gddgen, - "modify_fsurdat_allcropseverywhere.cfg", - ) - self._create_config_file_evenlysplitcrop() - - command = f"python3 {tool_path} {self._cfg_path} " - stu.run_python_script( - self._get_caseroot(), - self._this_conda_env, - command, - tool_path, - ) - - # Modify namelist - logger.info("RXCROPMATURITY log: modify user_nl files: new fsurdat") - self._append_to_user_nl_clm( - [ - "fsurdat = '{}'".format(self._fsurdat_out), - "do_transient_crops = .false.", - "flanduse_timeseries = ''", - "use_init_interp = .true.", - ] - ) - - def _create_config_file_evenlysplitcrop(self): - """ - Open the new and the template .cfg files - Loop line by line through the template .cfg file - When string matches, replace that line's content - """ - cfg_template_path = os.path.join( - self._ctsm_root, "tools/modify_input_files/modify_fsurdat_template.cfg" - ) - - with open(self._cfg_path, "w", encoding="utf-8") as cfg_out: - # Copy template, replacing some lines - with open(cfg_template_path, "r", encoding="utf-8") as cfg_in: - for line in cfg_in: - if re.match(r" *evenly_split_cropland *=", line): - line = f"evenly_split_cropland = True" - elif re.match(r" *fsurdat_in *=", line): - line = f"fsurdat_in = {self._fsurdat_in}" - elif re.match(r" *fsurdat_out *=", line): - line = f"fsurdat_out = {self._fsurdat_out}" - elif re.match(r" *process_subgrid_section *=", line): - line = f"process_subgrid_section = True" - cfg_out.write(line) - - # Add new lines - cfg_out.write("\n") - cfg_out.write("[modify_fsurdat_subgrid_fractions]\n") - cfg_out.write("PCT_CROP = 100.0\n") - cfg_out.write("PCT_NATVEG = 0.0\n") - cfg_out.write("PCT_GLACIER = 0.0\n") - cfg_out.write("PCT_WETLAND = 0.0\n") - cfg_out.write("PCT_LAKE = 0.0\n") - cfg_out.write("PCT_OCEAN = 0.0\n") - cfg_out.write("PCT_URBAN = 0.0 0.0 0.0\n") - - def _run_check_rxboth_run(self): - - output_dir = os.path.join(self._get_caseroot(), "run") - first_usable_year = self._run_startyear + 2 - last_usable_year = self._run_startyear + self._run_Nyears - 2 - - tool_path = os.path.join( - self._ctsm_root, "python", "ctsm", "crop_calendars", "check_rxboth_run.py" - ) - command = ( - f"python3 {tool_path} " - + f"--directory {output_dir} " - + f"-y1 {first_usable_year} " - + f"-yN {last_usable_year} " - + f"--rx-sdates-file {self._sdatefile} " - + f"--rx-gdds-file {self._gdds_file} " - ) - stu.run_python_script( - self._get_caseroot(), - self._this_conda_env, - command, - tool_path, - ) - - def _modify_user_nl_allruns(self): - nl_additions = [ - "cropcals_rx = .true.", - "stream_meshfile_cropcal = '{}'".format(self._case.get_value("LND_DOMAIN_MESH")), - "stream_fldFileName_swindow_start = '{}'".format(self._sdatefile), - "stream_fldFileName_swindow_end = '{}'".format(self._sdatefile), - "stream_year_first_cropcal_swindows = 2000", - "stream_year_last_cropcal_swindows = 2000", - "model_year_align_cropcal_swindows = 2000", - " ", - "! (h1) Annual outputs on sowing or harvest axis", - "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.", - ] - self._append_to_user_nl_clm(nl_additions) - - def _run_generate_gdds(self, case_gddgen): - self._generate_gdds_dir = os.path.join(self._path_gddgen, "generate_gdds_out") - os.makedirs(self._generate_gdds_dir) - - # Get arguments to generate_gdds.py - dout_sr = case_gddgen.get_value("DOUT_S_ROOT") - input_dir = os.path.join(dout_sr, "lnd", "hist") - first_season = self._run_startyear + 2 - last_season = self._run_startyear + self._run_Nyears - 2 - sdates_file = self._sdatefile - hdates_file = self._hdatefile - - # It'd be much nicer to call generate_gdds.main(), but I can't import generate_gdds. - tool_path = os.path.join( - self._ctsm_root, "python", "ctsm", "crop_calendars", "generate_gdds.py" - ) - command = " ".join( - [ - f"python3 {tool_path}", - f"--input-dir {input_dir}", - f"--first-season {first_season}", - f"--last-season {last_season}", - f"--sdates-file {sdates_file}", - f"--hdates-file {hdates_file}", - f"--output-dir generate_gdds_out", - f"--skip-crops miscanthus,irrigated_miscanthus", - ] - ) - stu.run_python_script( - self._get_caseroot(), - self._this_conda_env, - command, - tool_path, - ) - - # Where were the prescribed maturity requirements saved? - generated_gdd_files = glob.glob(os.path.join(self._generate_gdds_dir, "gdds_*.nc")) - if len(generated_gdd_files) != 1: - error_message = f"ERROR: Expected one matching prescribed maturity requirements file; found {len(generated_gdd_files)}: {generated_gdd_files}" - logger.error(error_message) - raise RuntimeError(error_message) - self._gdds_file = generated_gdd_files[0] - - def _get_conda_env(self): - conda_setup_commands = stu.cmds_to_setup_conda(self._get_caseroot()) - - # If npl conda environment is available, use that (It has dask, which - # enables chunking, which makes reading daily 1-degree netCDF files - # much more efficient. - if "npl " in os.popen(conda_setup_commands + "conda env list").read(): - self._this_conda_env = "npl" - else: - self._this_conda_env = "ctsm_pylib" - - def _append_to_user_nl_clm(self, additions): - caseroot = self._get_caseroot() - append_to_user_nl_files(caseroot=caseroot, component="clm", contents=additions) - - # Is flanduse_timeseries defined? If so, where is it? - def _get_flanduse_timeseries_in(self, case): - case.create_namelists(component="lnd") - self._lnd_in_path = os.path.join(self._path_gddgen, "CaseDocs", "lnd_in") - self._flanduse_timeseries_in = None - with open(self._lnd_in_path, "r") as lnd_in: - for line in lnd_in: - flanduse_timeseries_in = re.match(r" *flanduse_timeseries *= *'(.*)'", line) - if flanduse_timeseries_in: - self._flanduse_timeseries_in = flanduse_timeseries_in.group(1) - break diff --git a/cime_config/SystemTests/rxcropmaturityskipbuild.py b/cime_config/SystemTests/rxcropmaturityskipbuild.py deleted file mode 100644 index 4c3a69fb47..0000000000 --- a/cime_config/SystemTests/rxcropmaturityskipbuild.py +++ /dev/null @@ -1,9 +0,0 @@ -from rxcropmaturityshared import RXCROPMATURITYSHARED - -class RXCROPMATURITYSKIPBUILD(RXCROPMATURITYSHARED): - def build_indv(self, sharedlib_only=False, model_only=False): - self._case.set_value("BUILD_COMPLETE", "TRUE") - - - def run_phase(self): - self._run_phase(skip_run=False) \ No newline at end of file diff --git a/cime_config/SystemTests/rxcropmaturityskiprun.py b/cime_config/SystemTests/rxcropmaturityskiprun.py deleted file mode 100644 index 7fd217c4ff..0000000000 --- a/cime_config/SystemTests/rxcropmaturityskiprun.py +++ /dev/null @@ -1,9 +0,0 @@ -from rxcropmaturityshared import RXCROPMATURITYSHARED - -class RXCROPMATURITYSKIPRUN(RXCROPMATURITYSHARED): - def build_indv(self, sharedlib_only=False, model_only=False): - self._case.set_value("BUILD_COMPLETE", "TRUE") - - - def run_phase(self): - self._run_phase(skip_run=True) \ No newline at end of file diff --git a/cime_config/config_tests.xml b/cime_config/config_tests.xml index 115f4c0e89..c0b6afed9d 100644 --- a/cime_config/config_tests.xml +++ b/cime_config/config_tests.xml @@ -133,26 +133,6 @@ This defines various CTSM-specific system tests $STOP_N - - As RXCROPMATURITY but don't actually run or postprocess; just setup - 1 - FALSE - FALSE - never - $STOP_OPTION - $STOP_N - - - - As RXCROPMATURITY but don't actually build; just setup and then start "run." Will fail when run start is requested, but should successfully test preprocessing. - 1 - FALSE - FALSE - never - $STOP_OPTION - $STOP_N - - - - - PEND - #2460 - - - FAIL From dd6e0cb0b8f722c74a6819b48ff4ec534fbc7a87 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Fri, 14 Jun 2024 15:50:47 -0600 Subject: [PATCH 0512/1248] Move RXCROPMATURITYSHARED into rxcropmaturity.py. --- cime_config/SystemTests/rxcropmaturity.py | 511 ++++++++++++++++- .../SystemTests/rxcropmaturityshared.py | 514 ------------------ .../SystemTests/rxcropmaturityskipgen.py | 2 +- 3 files changed, 511 insertions(+), 516 deletions(-) delete mode 100644 cime_config/SystemTests/rxcropmaturityshared.py diff --git a/cime_config/SystemTests/rxcropmaturity.py b/cime_config/SystemTests/rxcropmaturity.py index 12ec608898..e0f6f4df21 100644 --- a/cime_config/SystemTests/rxcropmaturity.py +++ b/cime_config/SystemTests/rxcropmaturity.py @@ -1,4 +1,513 @@ -from rxcropmaturityshared import RXCROPMATURITYSHARED +""" +CTSM-specific test that first performs a GDD-generating run, then calls +Python code to generate the maturity requirement file. This is then used +in a sowing+maturity forced run, which finally is tested to ensure +correct behavior. + +Currently only supports 0.9x1.25, 1.9x2.5, and 10x15 resolutions. Eventually, +this test should be able to generate its own files at whatever resolution it's +called at. Well, really, the ultimate goal would be to give CLM the files +at the original resolution (for GGCMI phase 3, 0.5°) and have the stream +code do the interpolation. However, that wouldn't act on harvest dates +(which are needed for generate_gdds.py). I could have Python interpolate +those, but this would cause a potential inconsistency. +""" + +import os +import re +import systemtest_utils as stu +import subprocess +from CIME.SystemTests.system_tests_common import SystemTestsCommon +from CIME.XML.standard_module_setup import * +from CIME.SystemTests.test_utils.user_nl_utils import append_to_user_nl_files +from CIME.case import Case +import shutil, glob + +logger = logging.getLogger(__name__) + + +class RXCROPMATURITYSHARED(SystemTestsCommon): + def __init__(self, case): + # initialize an object interface to the SMS system test + SystemTestsCommon.__init__(self, case) + + # Is this a real RXCROPMATURITY test or not? + casebaseid = self._case.get_value("CASEBASEID") + full_test = "RXCROPMATURITY_" in casebaseid + skipgen_test = "RXCROPMATURITYSKIPGEN_" in casebaseid + + # Ensure run length is at least 5 years. Minimum to produce one complete growing season (i.e., two complete calendar years) actually 4 years, but that only gets you 1 season usable for GDD generation, so you can't check for season-to-season consistency. + stop_n = self._case.get_value("STOP_N") + stop_option = self._case.get_value("STOP_OPTION") + stop_n_orig = stop_n + stop_option_orig = stop_option + if "nsecond" in stop_option: + stop_n /= 60 + stop_option = "nminutes" + if "nminute" in stop_option: + stop_n /= 60 + stop_option = "nhours" + if "nhour" in stop_option: + stop_n /= 24 + stop_option = "ndays" + if "nday" in stop_option: + stop_n /= 365 + stop_option = "nyears" + if "nmonth" in stop_option: + stop_n /= 12 + stop_option = "nyears" + error_message = None + if "nyear" not in stop_option: + error_message = ( + f"STOP_OPTION ({stop_option_orig}) must be nsecond(s), nminute(s), " + + "nhour(s), nday(s), nmonth(s), or nyear(s)" + ) + elif full_test and stop_n < 5: + error_message = ( + "RXCROPMATURITY must be run for at least 5 years; you requested " + + f"{stop_n_orig} {stop_option_orig[1:]}" + ) + elif skipgen_test and stop_n < 3: + # First year is discarded because crops are already in the ground at restart, and those aren't affected by the new crop calendar inputs. The second year is useable, but we need a third year so that all crops planted in the second year have a chance to finish. + error_message = ( + "RXCROPMATURITYSKIPGEN (both-forced part) must be run for at least 3 years; you requested " + + f"{stop_n_orig} {stop_option_orig[1:]}" + ) + if error_message is not None: + logger.error(error_message) + raise RuntimeError(error_message) + + # Get the number of complete years that will be run + self._run_Nyears = int(stop_n) + + # Only allow RXCROPMATURITY to be called with test cropMonthOutput + if casebaseid.split("-")[-1] != "cropMonthOutput": + error_message = ( + "Only call RXCROPMATURITY with test cropMonthOutput " + + "to avoid potentially huge sets of daily outputs." + ) + logger.error(error_message) + raise RuntimeError(error_message) + + # Get files with prescribed sowing and harvest dates + self._get_rx_dates() + + # Get cultivar maturity requirement file to fall back on if not generating it here + self._gdds_file = None + self._fallback_gdds_file = os.path.join( + os.path.dirname(self._sdatefile), + "gdds_20230829_161011.nc" + ) + + # Which conda environment should we use? + self._get_conda_env() + + def _run_phase(self, skip_run=False, skip_gen=False): + # Modeling this after the SSP test, we create a clone to be the case whose outputs we don't + # want to be saved as baseline. + + # ------------------------------------------------------------------- + # (1) Set up GDD-generating run + # ------------------------------------------------------------------- + # Create clone to be GDD-Generating case + logger.info("RXCROPMATURITY log: cloning setup") + case_rxboth = self._case + caseroot = self._case.get_value("CASEROOT") + clone_path = f"{caseroot}.gddgen" + self._path_gddgen = clone_path + if os.path.exists(self._path_gddgen): + shutil.rmtree(self._path_gddgen) + logger.info("RXCROPMATURITY log: cloning") + case_gddgen = self._case.create_clone(clone_path, keepexe=True) + logger.info("RXCROPMATURITY log: done cloning") + + os.chdir(self._path_gddgen) + self._set_active_case(case_gddgen) + + # Set up stuff that applies to both tests + self._setup_all() + + # Add stuff specific to GDD-Generating run + logger.info("RXCROPMATURITY log: modify user_nl files: generate GDDs") + self._append_to_user_nl_clm( + [ + "generate_crop_gdds = .true.", + "use_mxmat = .false.", + " ", + "! (h2) Daily outputs for GDD generation and figure-making", + "hist_fincl3 = 'GDDACCUM', 'GDDHARV'", + "hist_nhtfrq(3) = -24", + "hist_mfilt(3) = 365", + "hist_type1d_pertape(3) = 'PFTS'", + "hist_dov2xy(3) = .false.", + ] + ) + + # If flanduse_timeseries is defined, we need to make a static version for this test. This + # should have every crop in most of the world. + self._get_flanduse_timeseries_in(case_gddgen) + if self._flanduse_timeseries_in is not None: + + # Download files from the server, if needed + case_gddgen.check_all_input_data() + + # Copy needed file from original to gddgen directory + shutil.copyfile( + os.path.join(caseroot, ".env_mach_specific.sh"), + os.path.join(self._path_gddgen, ".env_mach_specific.sh"), + ) + + # Make custom version of surface file + logger.info("RXCROPMATURITY log: run fsurdat_modifier") + self._run_fsurdat_modifier() + + # ------------------------------------------------------------------- + # (2) Perform GDD-generating run and generate prescribed GDDs file + # ------------------------------------------------------------------- + logger.info("RXCROPMATURITY log: Start GDD-Generating run") + + # As per SSP test: + # "No history files expected, set suffix=None to avoid compare error" + # We *do* expect history files here, but anyway. This works. + self._skip_pnl = False + + # If not generating GDDs, only run a few days of this. + if skip_gen: + with Case(self._path_gddgen, read_only=False) as case: + case.set_value("STOP_N", 5) + case.set_value("STOP_OPTION", "ndays") + + if not skip_run: + self.run_indv(suffix=None, st_archive=True) + if skip_gen: + # Interpolate an existing GDD file. Needed to check obedience to GDD inputs. + self._run_interpolate_gdds() + else: + self._run_generate_gdds(case_gddgen) + + # ------------------------------------------------------------------- + # (3) Set up and perform Prescribed Calendars run + # ------------------------------------------------------------------- + os.chdir(caseroot) + self._set_active_case(case_rxboth) + + # Set up stuff that applies to both tests + self._setup_all() + + # Add stuff specific to Prescribed Calendars run + logger.info("RXCROPMATURITY log: modify user_nl files: Prescribed Calendars") + self._append_to_user_nl_clm( + [ + "generate_crop_gdds = .false.", + f"stream_fldFileName_cultivar_gdds = '{self._gdds_file}'", + ] + ) + + if not skip_run: + self.run_indv() + + # ------------------------------------------------------------------- + # (4) Check Prescribed Calendars run + # ------------------------------------------------------------------- + logger.info("RXCROPMATURITY log: output check: Prescribed Calendars") + if not skip_run: + self._run_check_rxboth_run(skip_gen) + + # Get sowing and harvest dates for this resolution. + def _get_rx_dates(self): + # Eventually, I want to remove these hard-coded resolutions so that this test can generate + # its own sowing and harvest date files at whatever resolution is requested. + lnd_grid = self._case.get_value("LND_GRID") + input_data_root = self._case.get_value("DIN_LOC_ROOT") + processed_crop_dates_dir = f"{input_data_root}/lnd/clm2/cropdata/calendars/processed" + if lnd_grid == "10x15": + self._sdatefile = os.path.join( + processed_crop_dates_dir, + "sdates_ggcmi_crop_calendar_phase3_v1.01_nninterp-f10_f10_mg37.2000-2000.20230330_165301.nc", + ) + self._hdatefile = os.path.join( + processed_crop_dates_dir, + "hdates_ggcmi_crop_calendar_phase3_v1.01_nninterp-f10_f10_mg37.2000-2000.20230330_165301.nc", + ) + elif lnd_grid == "1.9x2.5": + self._sdatefile = os.path.join( + processed_crop_dates_dir, + "sdates_ggcmi_crop_calendar_phase3_v1.01_nninterp-f19_g17.2000-2000.20230102_175625.nc", + ) + self._hdatefile = os.path.join( + processed_crop_dates_dir, + "hdates_ggcmi_crop_calendar_phase3_v1.01_nninterp-f19_g17.2000-2000.20230102_175625.nc", + ) + elif lnd_grid == "0.9x1.25": + self._sdatefile = os.path.join( + processed_crop_dates_dir, + "sdates_ggcmi_crop_calendar_phase3_v1.01_nninterp-f09_g17.2000-2000.20230520_134417.nc", + ) + self._hdatefile = os.path.join( + processed_crop_dates_dir, + "hdates_ggcmi_crop_calendar_phase3_v1.01_nninterp-f09_g17.2000-2000.20230520_134418.nc", + ) + else: + error_message = "ERROR: RXCROPMATURITY currently only supports 0.9x1.25, 1.9x2.5, and 10x15 resolutions" + logger.error(error_message) + raise RuntimeError(error_message) + + # Ensure files exist + error_message = None + if not os.path.exists(self._sdatefile): + error_message = f"ERROR: Sowing date file not found: {self._sdatefile}" + elif not os.path.exists(self._hdatefile): + error_message = f"ERROR: Harvest date file not found: {self._sdatefile}" + if error_message is not None: + logger.error(error_message) + raise RuntimeError(error_message) + + def _setup_all(self): + logger.info("RXCROPMATURITY log: _setup_all start") + + # Get some info + self._ctsm_root = self._case.get_value("COMP_ROOT_DIR_LND") + run_startdate = self._case.get_value("RUN_STARTDATE") + self._run_startyear = int(run_startdate.split("-")[0]) + + # Set sowing dates file (and other crop calendar settings) for all runs + logger.info("RXCROPMATURITY log: modify user_nl files: all tests") + self._modify_user_nl_allruns() + logger.info("RXCROPMATURITY log: _setup_all done") + + # Make a surface dataset that has every crop in every gridcell + def _run_fsurdat_modifier(self): + + # fsurdat should be defined. Where is it? + self._fsurdat_in = None + with open(self._lnd_in_path, "r") as lnd_in: + for line in lnd_in: + fsurdat_in = re.match(r" *fsurdat *= *'(.*)'", line) + if fsurdat_in: + self._fsurdat_in = fsurdat_in.group(1) + break + if self._fsurdat_in is None: + error_message = "fsurdat not defined" + logger.error(error_message) + raise RuntimeError(error_message) + + # Where we will save the fsurdat version for this test + path, ext = os.path.splitext(self._fsurdat_in) + dir_in, filename_in_noext = os.path.split(path) + self._fsurdat_out = os.path.join( + self._path_gddgen, f"{filename_in_noext}.all_crops_everywhere{ext}" + ) + + # Make fsurdat for this test, if not already done + if not os.path.exists(self._fsurdat_out): + tool_path = os.path.join( + self._ctsm_root, + "tools", + "modify_input_files", + "fsurdat_modifier", + ) + + # Create configuration file for fsurdat_modifier + self._cfg_path = os.path.join( + self._path_gddgen, + "modify_fsurdat_allcropseverywhere.cfg", + ) + self._create_config_file_evenlysplitcrop() + + command = f"python3 {tool_path} {self._cfg_path} " + stu.run_python_script( + self._get_caseroot(), + self._this_conda_env, + command, + tool_path, + ) + + # Modify namelist + logger.info("RXCROPMATURITY log: modify user_nl files: new fsurdat") + self._append_to_user_nl_clm( + [ + "fsurdat = '{}'".format(self._fsurdat_out), + "do_transient_crops = .false.", + "flanduse_timeseries = ''", + "use_init_interp = .true.", + ] + ) + + def _create_config_file_evenlysplitcrop(self): + """ + Open the new and the template .cfg files + Loop line by line through the template .cfg file + When string matches, replace that line's content + """ + cfg_template_path = os.path.join( + self._ctsm_root, "tools/modify_input_files/modify_fsurdat_template.cfg" + ) + + with open(self._cfg_path, "w", encoding="utf-8") as cfg_out: + # Copy template, replacing some lines + with open(cfg_template_path, "r", encoding="utf-8") as cfg_in: + for line in cfg_in: + if re.match(r" *evenly_split_cropland *=", line): + line = f"evenly_split_cropland = True" + elif re.match(r" *fsurdat_in *=", line): + line = f"fsurdat_in = {self._fsurdat_in}" + elif re.match(r" *fsurdat_out *=", line): + line = f"fsurdat_out = {self._fsurdat_out}" + elif re.match(r" *process_subgrid_section *=", line): + line = f"process_subgrid_section = True" + cfg_out.write(line) + + # Add new lines + cfg_out.write("\n") + cfg_out.write("[modify_fsurdat_subgrid_fractions]\n") + cfg_out.write("PCT_CROP = 100.0\n") + cfg_out.write("PCT_NATVEG = 0.0\n") + cfg_out.write("PCT_GLACIER = 0.0\n") + cfg_out.write("PCT_WETLAND = 0.0\n") + cfg_out.write("PCT_LAKE = 0.0\n") + cfg_out.write("PCT_OCEAN = 0.0\n") + cfg_out.write("PCT_URBAN = 0.0 0.0 0.0\n") + + def _run_check_rxboth_run(self, skip_gen): + + output_dir = os.path.join(self._get_caseroot(), "run") + + if skip_gen: + first_usable_year = self._run_startyear + 1 + last_usable_year = first_usable_year + else: + first_usable_year = self._run_startyear + 2 + last_usable_year = self._run_startyear + self._run_Nyears - 2 + + tool_path = os.path.join( + self._ctsm_root, "python", "ctsm", "crop_calendars", "check_rxboth_run.py" + ) + command = ( + f"python3 {tool_path} " + + f"--directory {output_dir} " + + f"-y1 {first_usable_year} " + + f"-yN {last_usable_year} " + + f"--rx-sdates-file {self._sdatefile} " + + f"--rx-gdds-file {self._gdds_file} " + ) + stu.run_python_script( + self._get_caseroot(), + self._this_conda_env, + command, + tool_path, + ) + + def _modify_user_nl_allruns(self): + nl_additions = [ + "stream_meshfile_cropcal = '{}'".format(self._case.get_value("LND_DOMAIN_MESH")), + "stream_fldFileName_swindow_start = '{}'".format(self._sdatefile), + "stream_fldFileName_swindow_end = '{}'".format(self._sdatefile), + "stream_year_first_cropcal = 2000", + "stream_year_last_cropcal = 2000", + "model_year_align_cropcal = 2000", + " ", + "! (h1) Annual outputs on sowing or harvest axis", + "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.", + ] + self._append_to_user_nl_clm(nl_additions) + + def _run_generate_gdds(self, case_gddgen): + self._generate_gdds_dir = os.path.join(self._path_gddgen, "generate_gdds_out") + os.makedirs(self._generate_gdds_dir) + + # Get arguments to generate_gdds.py + dout_sr = case_gddgen.get_value("DOUT_S_ROOT") + input_dir = os.path.join(dout_sr, "lnd", "hist") + first_season = self._run_startyear + 2 + last_season = self._run_startyear + self._run_Nyears - 2 + sdates_file = self._sdatefile + hdates_file = self._hdatefile + + # It'd be much nicer to call generate_gdds.main(), but I can't import generate_gdds. + tool_path = os.path.join( + self._ctsm_root, "python", "ctsm", "crop_calendars", "generate_gdds.py" + ) + command = " ".join( + [ + f"python3 {tool_path}", + f"--input-dir {input_dir}", + f"--first-season {first_season}", + f"--last-season {last_season}", + f"--sdates-file {sdates_file}", + f"--hdates-file {hdates_file}", + f"--output-dir generate_gdds_out", + f"--skip-crops miscanthus,irrigated_miscanthus", + ] + ) + stu.run_python_script( + self._get_caseroot(), + self._this_conda_env, + command, + tool_path, + ) + + # Where were the prescribed maturity requirements saved? + generated_gdd_files = glob.glob(os.path.join(self._generate_gdds_dir, "gdds_*.nc")) + if len(generated_gdd_files) != 1: + error_message = f"ERROR: Expected one matching prescribed maturity requirements file; found {len(generated_gdd_files)}: {generated_gdd_files}" + logger.error(error_message) + raise RuntimeError(error_message) + self._gdds_file = generated_gdd_files[0] + + def _run_interpolate_gdds(self): + # Save where? + self._gdds_file = os.path.join(self._get_caseroot(), "interpolated_gdds.nc") + + # It'd be much nicer to call interpolate_gdds.main(), but I can't import interpolate_gdds. + tool_path = os.path.join( + self._ctsm_root, "python", "ctsm", "crop_calendars", "interpolate_gdds.py" + ) + command = " ".join( + [ + f"python3 {tool_path}", + f"--input-file {self._fallback_gdds_file}", + f"--target-file {self._sdatefile}", + f"--output-file {self._gdds_file}", + "--overwrite", + ] + ) + stu.run_python_script( + self._get_caseroot(), + self._this_conda_env, + command, + tool_path, + ) + + def _get_conda_env(self): + conda_setup_commands = stu.cmds_to_setup_conda(self._get_caseroot()) + + # If npl conda environment is available, use that (It has dask, which + # enables chunking, which makes reading daily 1-degree netCDF files + # much more efficient. + if "npl " in os.popen(conda_setup_commands + "conda env list").read(): + self._this_conda_env = "npl" + else: + self._this_conda_env = "ctsm_pylib" + + def _append_to_user_nl_clm(self, additions): + caseroot = self._get_caseroot() + append_to_user_nl_files(caseroot=caseroot, component="clm", contents=additions) + + # Is flanduse_timeseries defined? If so, where is it? + def _get_flanduse_timeseries_in(self, case): + case.create_namelists(component="lnd") + self._lnd_in_path = os.path.join(self._path_gddgen, "CaseDocs", "lnd_in") + self._flanduse_timeseries_in = None + with open(self._lnd_in_path, "r") as lnd_in: + for line in lnd_in: + flanduse_timeseries_in = re.match(r" *flanduse_timeseries *= *'(.*)'", line) + if flanduse_timeseries_in: + self._flanduse_timeseries_in = flanduse_timeseries_in.group(1) + break class RXCROPMATURITY(RXCROPMATURITYSHARED): diff --git a/cime_config/SystemTests/rxcropmaturityshared.py b/cime_config/SystemTests/rxcropmaturityshared.py deleted file mode 100644 index 991fe687b5..0000000000 --- a/cime_config/SystemTests/rxcropmaturityshared.py +++ /dev/null @@ -1,514 +0,0 @@ -""" -CTSM-specific test that first performs a GDD-generating run, then calls -Python code to generate the maturity requirement file. This is then used -in a sowing+maturity forced run, which finally is tested to ensure -correct behavior. - -Currently only supports 0.9x1.25, 1.9x2.5, and 10x15 resolutions. Eventually, -this test should be able to generate its own files at whatever resolution it's -called at. Well, really, the ultimate goal would be to give CLM the files -at the original resolution (for GGCMI phase 3, 0.5°) and have the stream -code do the interpolation. However, that wouldn't act on harvest dates -(which are needed for generate_gdds.py). I could have Python interpolate -those, but this would cause a potential inconsistency. - -Note that this is just a parent class. The actual tests are RXCROPMATURITY and -RXCROPMATURITY_SKIPRUN, the latter of which does everything except perform and -check the CTSM runs. -""" - -import os -import re -import systemtest_utils as stu -import subprocess -from CIME.SystemTests.system_tests_common import SystemTestsCommon -from CIME.XML.standard_module_setup import * -from CIME.SystemTests.test_utils.user_nl_utils import append_to_user_nl_files -from CIME.case import Case -import shutil, glob - -logger = logging.getLogger(__name__) - - -class RXCROPMATURITYSHARED(SystemTestsCommon): - def __init__(self, case): - # initialize an object interface to the SMS system test - SystemTestsCommon.__init__(self, case) - - # Is this a real RXCROPMATURITY test or not? - casebaseid = self._case.get_value("CASEBASEID") - full_test = "RXCROPMATURITY_" in casebaseid - skipgen_test = "RXCROPMATURITYSKIPGEN_" in casebaseid - - # Ensure run length is at least 5 years. Minimum to produce one complete growing season (i.e., two complete calendar years) actually 4 years, but that only gets you 1 season usable for GDD generation, so you can't check for season-to-season consistency. - stop_n = self._case.get_value("STOP_N") - stop_option = self._case.get_value("STOP_OPTION") - stop_n_orig = stop_n - stop_option_orig = stop_option - if "nsecond" in stop_option: - stop_n /= 60 - stop_option = "nminutes" - if "nminute" in stop_option: - stop_n /= 60 - stop_option = "nhours" - if "nhour" in stop_option: - stop_n /= 24 - stop_option = "ndays" - if "nday" in stop_option: - stop_n /= 365 - stop_option = "nyears" - if "nmonth" in stop_option: - stop_n /= 12 - stop_option = "nyears" - error_message = None - if "nyear" not in stop_option: - error_message = ( - f"STOP_OPTION ({stop_option_orig}) must be nsecond(s), nminute(s), " - + "nhour(s), nday(s), nmonth(s), or nyear(s)" - ) - elif full_test and stop_n < 5: - error_message = ( - "RXCROPMATURITY must be run for at least 5 years; you requested " - + f"{stop_n_orig} {stop_option_orig[1:]}" - ) - elif skipgen_test and stop_n < 3: - # First year is discarded because crops are already in the ground at restart, and those aren't affected by the new crop calendar inputs. The second year is useable, but we need a third year so that all crops planted in the second year have a chance to finish. - error_message = ( - "RXCROPMATURITYSKIPGEN (both-forced part) must be run for at least 3 years; you requested " - + f"{stop_n_orig} {stop_option_orig[1:]}" - ) - if error_message is not None: - logger.error(error_message) - raise RuntimeError(error_message) - - # Get the number of complete years that will be run - self._run_Nyears = int(stop_n) - - # Only allow RXCROPMATURITY to be called with test cropMonthOutput - if casebaseid.split("-")[-1] != "cropMonthOutput": - error_message = ( - "Only call RXCROPMATURITY with test cropMonthOutput " - + "to avoid potentially huge sets of daily outputs." - ) - logger.error(error_message) - raise RuntimeError(error_message) - - # Get files with prescribed sowing and harvest dates - self._get_rx_dates() - - # Get cultivar maturity requirement file to fall back on if not generating it here - self._gdds_file = None - self._fallback_gdds_file = os.path.join( - os.path.dirname(self._sdatefile), - "gdds_20230829_161011.nc" - ) - - # Which conda environment should we use? - self._get_conda_env() - - def _run_phase(self, skip_run=False, skip_gen=False): - # Modeling this after the SSP test, we create a clone to be the case whose outputs we don't - # want to be saved as baseline. - - # ------------------------------------------------------------------- - # (1) Set up GDD-generating run - # ------------------------------------------------------------------- - # Create clone to be GDD-Generating case - logger.info("RXCROPMATURITY log: cloning setup") - case_rxboth = self._case - caseroot = self._case.get_value("CASEROOT") - clone_path = f"{caseroot}.gddgen" - self._path_gddgen = clone_path - if os.path.exists(self._path_gddgen): - shutil.rmtree(self._path_gddgen) - logger.info("RXCROPMATURITY log: cloning") - case_gddgen = self._case.create_clone(clone_path, keepexe=True) - logger.info("RXCROPMATURITY log: done cloning") - - os.chdir(self._path_gddgen) - self._set_active_case(case_gddgen) - - # Set up stuff that applies to both tests - self._setup_all() - - # Add stuff specific to GDD-Generating run - logger.info("RXCROPMATURITY log: modify user_nl files: generate GDDs") - self._append_to_user_nl_clm( - [ - "generate_crop_gdds = .true.", - "use_mxmat = .false.", - " ", - "! (h2) Daily outputs for GDD generation and figure-making", - "hist_fincl3 = 'GDDACCUM', 'GDDHARV'", - "hist_nhtfrq(3) = -24", - "hist_mfilt(3) = 365", - "hist_type1d_pertape(3) = 'PFTS'", - "hist_dov2xy(3) = .false.", - ] - ) - - # If flanduse_timeseries is defined, we need to make a static version for this test. This - # should have every crop in most of the world. - self._get_flanduse_timeseries_in(case_gddgen) - if self._flanduse_timeseries_in is not None: - - # Download files from the server, if needed - case_gddgen.check_all_input_data() - - # Copy needed file from original to gddgen directory - shutil.copyfile( - os.path.join(caseroot, ".env_mach_specific.sh"), - os.path.join(self._path_gddgen, ".env_mach_specific.sh"), - ) - - # Make custom version of surface file - logger.info("RXCROPMATURITY log: run fsurdat_modifier") - self._run_fsurdat_modifier() - - # ------------------------------------------------------------------- - # (2) Perform GDD-generating run and generate prescribed GDDs file - # ------------------------------------------------------------------- - logger.info("RXCROPMATURITY log: Start GDD-Generating run") - - # As per SSP test: - # "No history files expected, set suffix=None to avoid compare error" - # We *do* expect history files here, but anyway. This works. - self._skip_pnl = False - - # If not generating GDDs, only run a few days of this. - if skip_gen: - with Case(self._path_gddgen, read_only=False) as case: - case.set_value("STOP_N", 5) - case.set_value("STOP_OPTION", "ndays") - - if not skip_run: - self.run_indv(suffix=None, st_archive=True) - if skip_gen: - # Interpolate an existing GDD file. Needed to check obedience to GDD inputs. - self._run_interpolate_gdds() - else: - self._run_generate_gdds(case_gddgen) - - # ------------------------------------------------------------------- - # (3) Set up and perform Prescribed Calendars run - # ------------------------------------------------------------------- - os.chdir(caseroot) - self._set_active_case(case_rxboth) - - # Set up stuff that applies to both tests - self._setup_all() - - # Add stuff specific to Prescribed Calendars run - logger.info("RXCROPMATURITY log: modify user_nl files: Prescribed Calendars") - self._append_to_user_nl_clm( - [ - "generate_crop_gdds = .false.", - f"stream_fldFileName_cultivar_gdds = '{self._gdds_file}'", - ] - ) - - if not skip_run: - self.run_indv() - - # ------------------------------------------------------------------- - # (4) Check Prescribed Calendars run - # ------------------------------------------------------------------- - logger.info("RXCROPMATURITY log: output check: Prescribed Calendars") - if not skip_run: - self._run_check_rxboth_run(skip_gen) - - # Get sowing and harvest dates for this resolution. - def _get_rx_dates(self): - # Eventually, I want to remove these hard-coded resolutions so that this test can generate - # its own sowing and harvest date files at whatever resolution is requested. - lnd_grid = self._case.get_value("LND_GRID") - input_data_root = self._case.get_value("DIN_LOC_ROOT") - processed_crop_dates_dir = f"{input_data_root}/lnd/clm2/cropdata/calendars/processed" - if lnd_grid == "10x15": - self._sdatefile = os.path.join( - processed_crop_dates_dir, - "sdates_ggcmi_crop_calendar_phase3_v1.01_nninterp-f10_f10_mg37.2000-2000.20230330_165301.nc", - ) - self._hdatefile = os.path.join( - processed_crop_dates_dir, - "hdates_ggcmi_crop_calendar_phase3_v1.01_nninterp-f10_f10_mg37.2000-2000.20230330_165301.nc", - ) - elif lnd_grid == "1.9x2.5": - self._sdatefile = os.path.join( - processed_crop_dates_dir, - "sdates_ggcmi_crop_calendar_phase3_v1.01_nninterp-f19_g17.2000-2000.20230102_175625.nc", - ) - self._hdatefile = os.path.join( - processed_crop_dates_dir, - "hdates_ggcmi_crop_calendar_phase3_v1.01_nninterp-f19_g17.2000-2000.20230102_175625.nc", - ) - elif lnd_grid == "0.9x1.25": - self._sdatefile = os.path.join( - processed_crop_dates_dir, - "sdates_ggcmi_crop_calendar_phase3_v1.01_nninterp-f09_g17.2000-2000.20230520_134417.nc", - ) - self._hdatefile = os.path.join( - processed_crop_dates_dir, - "hdates_ggcmi_crop_calendar_phase3_v1.01_nninterp-f09_g17.2000-2000.20230520_134418.nc", - ) - else: - error_message = "ERROR: RXCROPMATURITY currently only supports 0.9x1.25, 1.9x2.5, and 10x15 resolutions" - logger.error(error_message) - raise RuntimeError(error_message) - - # Ensure files exist - error_message = None - if not os.path.exists(self._sdatefile): - error_message = f"ERROR: Sowing date file not found: {self._sdatefile}" - elif not os.path.exists(self._hdatefile): - error_message = f"ERROR: Harvest date file not found: {self._sdatefile}" - if error_message is not None: - logger.error(error_message) - raise RuntimeError(error_message) - - def _setup_all(self): - logger.info("RXCROPMATURITY log: _setup_all start") - - # Get some info - self._ctsm_root = self._case.get_value("COMP_ROOT_DIR_LND") - run_startdate = self._case.get_value("RUN_STARTDATE") - self._run_startyear = int(run_startdate.split("-")[0]) - - # Set sowing dates file (and other crop calendar settings) for all runs - logger.info("RXCROPMATURITY log: modify user_nl files: all tests") - self._modify_user_nl_allruns() - logger.info("RXCROPMATURITY log: _setup_all done") - - # Make a surface dataset that has every crop in every gridcell - def _run_fsurdat_modifier(self): - - # fsurdat should be defined. Where is it? - self._fsurdat_in = None - with open(self._lnd_in_path, "r") as lnd_in: - for line in lnd_in: - fsurdat_in = re.match(r" *fsurdat *= *'(.*)'", line) - if fsurdat_in: - self._fsurdat_in = fsurdat_in.group(1) - break - if self._fsurdat_in is None: - error_message = "fsurdat not defined" - logger.error(error_message) - raise RuntimeError(error_message) - - # Where we will save the fsurdat version for this test - path, ext = os.path.splitext(self._fsurdat_in) - dir_in, filename_in_noext = os.path.split(path) - self._fsurdat_out = os.path.join( - self._path_gddgen, f"{filename_in_noext}.all_crops_everywhere{ext}" - ) - - # Make fsurdat for this test, if not already done - if not os.path.exists(self._fsurdat_out): - tool_path = os.path.join( - self._ctsm_root, - "tools", - "modify_input_files", - "fsurdat_modifier", - ) - - # Create configuration file for fsurdat_modifier - self._cfg_path = os.path.join( - self._path_gddgen, - "modify_fsurdat_allcropseverywhere.cfg", - ) - self._create_config_file_evenlysplitcrop() - - command = f"python3 {tool_path} {self._cfg_path} " - stu.run_python_script( - self._get_caseroot(), - self._this_conda_env, - command, - tool_path, - ) - - # Modify namelist - logger.info("RXCROPMATURITY log: modify user_nl files: new fsurdat") - self._append_to_user_nl_clm( - [ - "fsurdat = '{}'".format(self._fsurdat_out), - "do_transient_crops = .false.", - "flanduse_timeseries = ''", - "use_init_interp = .true.", - ] - ) - - def _create_config_file_evenlysplitcrop(self): - """ - Open the new and the template .cfg files - Loop line by line through the template .cfg file - When string matches, replace that line's content - """ - cfg_template_path = os.path.join( - self._ctsm_root, "tools/modify_input_files/modify_fsurdat_template.cfg" - ) - - with open(self._cfg_path, "w", encoding="utf-8") as cfg_out: - # Copy template, replacing some lines - with open(cfg_template_path, "r", encoding="utf-8") as cfg_in: - for line in cfg_in: - if re.match(r" *evenly_split_cropland *=", line): - line = f"evenly_split_cropland = True" - elif re.match(r" *fsurdat_in *=", line): - line = f"fsurdat_in = {self._fsurdat_in}" - elif re.match(r" *fsurdat_out *=", line): - line = f"fsurdat_out = {self._fsurdat_out}" - elif re.match(r" *process_subgrid_section *=", line): - line = f"process_subgrid_section = True" - cfg_out.write(line) - - # Add new lines - cfg_out.write("\n") - cfg_out.write("[modify_fsurdat_subgrid_fractions]\n") - cfg_out.write("PCT_CROP = 100.0\n") - cfg_out.write("PCT_NATVEG = 0.0\n") - cfg_out.write("PCT_GLACIER = 0.0\n") - cfg_out.write("PCT_WETLAND = 0.0\n") - cfg_out.write("PCT_LAKE = 0.0\n") - cfg_out.write("PCT_OCEAN = 0.0\n") - cfg_out.write("PCT_URBAN = 0.0 0.0 0.0\n") - - def _run_check_rxboth_run(self, skip_gen): - - output_dir = os.path.join(self._get_caseroot(), "run") - - if skip_gen: - first_usable_year = self._run_startyear + 1 - last_usable_year = first_usable_year - else: - first_usable_year = self._run_startyear + 2 - last_usable_year = self._run_startyear + self._run_Nyears - 2 - - tool_path = os.path.join( - self._ctsm_root, "python", "ctsm", "crop_calendars", "check_rxboth_run.py" - ) - command = ( - f"python3 {tool_path} " - + f"--directory {output_dir} " - + f"-y1 {first_usable_year} " - + f"-yN {last_usable_year} " - + f"--rx-sdates-file {self._sdatefile} " - + f"--rx-gdds-file {self._gdds_file} " - ) - stu.run_python_script( - self._get_caseroot(), - self._this_conda_env, - command, - tool_path, - ) - - def _modify_user_nl_allruns(self): - nl_additions = [ - "stream_meshfile_cropcal = '{}'".format(self._case.get_value("LND_DOMAIN_MESH")), - "stream_fldFileName_swindow_start = '{}'".format(self._sdatefile), - "stream_fldFileName_swindow_end = '{}'".format(self._sdatefile), - "stream_year_first_cropcal = 2000", - "stream_year_last_cropcal = 2000", - "model_year_align_cropcal = 2000", - " ", - "! (h1) Annual outputs on sowing or harvest axis", - "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.", - ] - self._append_to_user_nl_clm(nl_additions) - - def _run_generate_gdds(self, case_gddgen): - self._generate_gdds_dir = os.path.join(self._path_gddgen, "generate_gdds_out") - os.makedirs(self._generate_gdds_dir) - - # Get arguments to generate_gdds.py - dout_sr = case_gddgen.get_value("DOUT_S_ROOT") - input_dir = os.path.join(dout_sr, "lnd", "hist") - first_season = self._run_startyear + 2 - last_season = self._run_startyear + self._run_Nyears - 2 - sdates_file = self._sdatefile - hdates_file = self._hdatefile - - # It'd be much nicer to call generate_gdds.main(), but I can't import generate_gdds. - tool_path = os.path.join( - self._ctsm_root, "python", "ctsm", "crop_calendars", "generate_gdds.py" - ) - command = " ".join( - [ - f"python3 {tool_path}", - f"--input-dir {input_dir}", - f"--first-season {first_season}", - f"--last-season {last_season}", - f"--sdates-file {sdates_file}", - f"--hdates-file {hdates_file}", - f"--output-dir generate_gdds_out", - f"--skip-crops miscanthus,irrigated_miscanthus", - ] - ) - stu.run_python_script( - self._get_caseroot(), - self._this_conda_env, - command, - tool_path, - ) - - # Where were the prescribed maturity requirements saved? - generated_gdd_files = glob.glob(os.path.join(self._generate_gdds_dir, "gdds_*.nc")) - if len(generated_gdd_files) != 1: - error_message = f"ERROR: Expected one matching prescribed maturity requirements file; found {len(generated_gdd_files)}: {generated_gdd_files}" - logger.error(error_message) - raise RuntimeError(error_message) - self._gdds_file = generated_gdd_files[0] - - def _run_interpolate_gdds(self): - # Save where? - self._gdds_file = os.path.join(self._get_caseroot(), "interpolated_gdds.nc") - - # It'd be much nicer to call interpolate_gdds.main(), but I can't import interpolate_gdds. - tool_path = os.path.join( - self._ctsm_root, "python", "ctsm", "crop_calendars", "interpolate_gdds.py" - ) - command = " ".join( - [ - f"python3 {tool_path}", - f"--input-file {self._fallback_gdds_file}", - f"--target-file {self._sdatefile}", - f"--output-file {self._gdds_file}", - "--overwrite", - ] - ) - stu.run_python_script( - self._get_caseroot(), - self._this_conda_env, - command, - tool_path, - ) - - def _get_conda_env(self): - conda_setup_commands = stu.cmds_to_setup_conda(self._get_caseroot()) - - # If npl conda environment is available, use that (It has dask, which - # enables chunking, which makes reading daily 1-degree netCDF files - # much more efficient. - if "npl " in os.popen(conda_setup_commands + "conda env list").read(): - self._this_conda_env = "npl" - else: - self._this_conda_env = "ctsm_pylib" - - def _append_to_user_nl_clm(self, additions): - caseroot = self._get_caseroot() - append_to_user_nl_files(caseroot=caseroot, component="clm", contents=additions) - - # Is flanduse_timeseries defined? If so, where is it? - def _get_flanduse_timeseries_in(self, case): - case.create_namelists(component="lnd") - self._lnd_in_path = os.path.join(self._path_gddgen, "CaseDocs", "lnd_in") - self._flanduse_timeseries_in = None - with open(self._lnd_in_path, "r") as lnd_in: - for line in lnd_in: - flanduse_timeseries_in = re.match(r" *flanduse_timeseries *= *'(.*)'", line) - if flanduse_timeseries_in: - self._flanduse_timeseries_in = flanduse_timeseries_in.group(1) - break diff --git a/cime_config/SystemTests/rxcropmaturityskipgen.py b/cime_config/SystemTests/rxcropmaturityskipgen.py index 4fb5257967..7b836a7b17 100644 --- a/cime_config/SystemTests/rxcropmaturityskipgen.py +++ b/cime_config/SystemTests/rxcropmaturityskipgen.py @@ -1,4 +1,4 @@ -from rxcropmaturityshared import RXCROPMATURITYSHARED +from rxcropmaturity import RXCROPMATURITYSHARED class RXCROPMATURITYSKIPGEN(RXCROPMATURITYSHARED): From 6c5fdb1d735531f8aaf129420448b2ac1d635a4c Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Fri, 14 Jun 2024 15:56:50 -0600 Subject: [PATCH 0513/1248] Remove refs to skip_run. --- cime_config/SystemTests/rxcropmaturity.py | 11 ++++------- cime_config/SystemTests/rxcropmaturityskipgen.py | 2 +- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/cime_config/SystemTests/rxcropmaturity.py b/cime_config/SystemTests/rxcropmaturity.py index e0f6f4df21..cffb832e8d 100644 --- a/cime_config/SystemTests/rxcropmaturity.py +++ b/cime_config/SystemTests/rxcropmaturity.py @@ -102,7 +102,7 @@ def __init__(self, case): # Which conda environment should we use? self._get_conda_env() - def _run_phase(self, skip_run=False, skip_gen=False): + def _run_phase(self, skip_gen=False): # Modeling this after the SSP test, we create a clone to be the case whose outputs we don't # want to be saved as baseline. @@ -177,8 +177,7 @@ def _run_phase(self, skip_run=False, skip_gen=False): case.set_value("STOP_N", 5) case.set_value("STOP_OPTION", "ndays") - if not skip_run: - self.run_indv(suffix=None, st_archive=True) + self.run_indv(suffix=None, st_archive=True) if skip_gen: # Interpolate an existing GDD file. Needed to check obedience to GDD inputs. self._run_interpolate_gdds() @@ -203,15 +202,13 @@ def _run_phase(self, skip_run=False, skip_gen=False): ] ) - if not skip_run: - self.run_indv() + self.run_indv() # ------------------------------------------------------------------- # (4) Check Prescribed Calendars run # ------------------------------------------------------------------- logger.info("RXCROPMATURITY log: output check: Prescribed Calendars") - if not skip_run: - self._run_check_rxboth_run(skip_gen) + self._run_check_rxboth_run(skip_gen) # Get sowing and harvest dates for this resolution. def _get_rx_dates(self): diff --git a/cime_config/SystemTests/rxcropmaturityskipgen.py b/cime_config/SystemTests/rxcropmaturityskipgen.py index 7b836a7b17..4feb661037 100644 --- a/cime_config/SystemTests/rxcropmaturityskipgen.py +++ b/cime_config/SystemTests/rxcropmaturityskipgen.py @@ -4,4 +4,4 @@ class RXCROPMATURITYSKIPGEN(RXCROPMATURITYSHARED): def run_phase(self): - self._run_phase(skip_run=False, skip_gen=True) + self._run_phase(skip_gen=True) From 3efa49aec741b01d324b2236ca347fa4d4bf349f Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Fri, 14 Jun 2024 17:02:16 -0600 Subject: [PATCH 0514/1248] Unexpected behavior in rxboth run now errors check_rxboth_run.py. --- .../crop_calendars/check_constant_vars.py | 2 +- python/ctsm/crop_calendars/check_rx_obeyed.py | 5 +++++ .../ctsm/crop_calendars/check_rxboth_run.py | 19 +++++++++++++++---- python/ctsm/crop_calendars/cropcal_module.py | 10 ++++++++-- 4 files changed, 29 insertions(+), 7 deletions(-) diff --git a/python/ctsm/crop_calendars/check_constant_vars.py b/python/ctsm/crop_calendars/check_constant_vars.py index aa25a412fe..be7718256a 100644 --- a/python/ctsm/crop_calendars/check_constant_vars.py +++ b/python/ctsm/crop_calendars/check_constant_vars.py @@ -382,4 +382,4 @@ def check_constant_vars( raise RuntimeError("Stopping due to failed check_constant_vars().") bad_patches = np.unique(bad_patches) - return [int(p) for p in bad_patches] + return [int(p) for p in bad_patches], any_bad diff --git a/python/ctsm/crop_calendars/check_rx_obeyed.py b/python/ctsm/crop_calendars/check_rx_obeyed.py index 99b8d80bde..8525f3e890 100644 --- a/python/ctsm/crop_calendars/check_rx_obeyed.py +++ b/python/ctsm/crop_calendars/check_rx_obeyed.py @@ -203,9 +203,12 @@ def check_rx_obeyed( else: break + bad = True if all_ok == 2: + bad = False print(f"✅ {which_ds}: Prescribed {output_var} always obeyed") elif all_ok == 1: + bad = False # print(f"🟨 {which_ds}: Prescribed {output_var} *not* always obeyed, but acceptable:") # for x in diff_str_list: print(x) print( @@ -214,3 +217,5 @@ def check_rx_obeyed( ) elif not verbose: print(f"❌ {which_ds}: Prescribed {output_var} *not* always obeyed. E.g., {diffs_eg_txt}") + + return bad diff --git a/python/ctsm/crop_calendars/check_rxboth_run.py b/python/ctsm/crop_calendars/check_rxboth_run.py index ae4decde30..8f416e9f8e 100644 --- a/python/ctsm/crop_calendars/check_rxboth_run.py +++ b/python/ctsm/crop_calendars/check_rxboth_run.py @@ -75,6 +75,8 @@ def main(argv): "HARVEST_REASON_PERHARV", ] + any_bad = False + annual_outfiles = glob.glob(os.path.join(args.directory, "*.clm2.h1.*.nc")) # These should be constant in a Prescribed Calendars (rxboth) run, as long as the inputs were @@ -85,13 +87,17 @@ def main(argv): "rx_gdds_file": args.rx_gdds_file, } - case["ds"] = cc.import_output( + case["ds"], any_bad_import_output = cc.import_output( annual_outfiles, my_vars=my_vars, year_1=args.first_usable_year, year_n=args.last_usable_year, + throw_errors=False, ) - check_constant_vars(case["ds"], case, ignore_nan=True, verbose=True, throw_error=True) + any_bad = any_bad or any_bad_import_output + + _, any_bad_check_const_vars = check_constant_vars(case["ds"], case, ignore_nan=True, verbose=True, throw_error=True) + any_bad = any_bad or any_bad_check_const_vars # Import GGCMI sowing and harvest dates, and check sims casename = "Prescribed Calendars" @@ -128,15 +134,16 @@ def main(argv): # Check if case["rx_sdates_file"]: - check_rx_obeyed( + sdate_not_obeyed = check_rx_obeyed( case["ds"].vegtype_str.values, case["rx_sdates_ds"].isel(time=0), case["ds"], casename, "SDATES", ) + any_bad = any_bad or sdate_not_obeyed if case["rx_gdds_file"]: - check_rx_obeyed( + gdds_not_obeyed = check_rx_obeyed( case["ds"].vegtype_str.values, case["rx_gdds_ds"].isel(time=0), case["ds"], @@ -144,6 +151,10 @@ def main(argv): "GDDHARV", gdd_min=gdd_min, ) + any_bad = any_bad or gdds_not_obeyed + + if any_bad: + raise RuntimeError("Unexpected behavior in rxboth run") if __name__ == "__main__": diff --git a/python/ctsm/crop_calendars/cropcal_module.py b/python/ctsm/crop_calendars/cropcal_module.py index d25e16397e..fa1cc30e7c 100644 --- a/python/ctsm/crop_calendars/cropcal_module.py +++ b/python/ctsm/crop_calendars/cropcal_module.py @@ -170,8 +170,10 @@ def check_v0_le_v1(this_ds, var_list, msg_txt=" ", both_nan_ok=False, throw_erro if both_nan_ok: gdd_lt_hui = gdd_lt_hui | (np.isnan(this_ds[var0]) & np.isnan(this_ds[var1])) if np.all(gdd_lt_hui): + any_bad = False print(f"✅{msg_txt}{var0} always <= {var1}") else: + any_bad = True msg = f"❌{msg_txt}{var0} *not* always <= {var1}" gdd_lt_hui_vals = gdd_lt_hui.values patch_index = np.where(~gdd_lt_hui_vals)[0][0] @@ -187,6 +189,7 @@ def check_v0_le_v1(this_ds, var_list, msg_txt=" ", both_nan_ok=False, throw_erro print(msg) else: raise RuntimeError(msg) + return any_bad def get_gs_len_da(this_da): @@ -346,10 +349,13 @@ def import_output( sdates_rx_ds=None, gdds_rx_ds=None, verbose=False, + throw_errors=True, ): """ Import CLM output """ + any_bad = False + # Import this_ds = import_ds(filename, my_vars=my_vars, my_vegtypes=my_vegtypes) @@ -419,7 +425,7 @@ def import_output( # Check that e.g., GDDACCUM <= HUI for var_list in [["GDDACCUM", "HUI"], ["SYEARS", "HYEARS"]]: if all(v in this_ds_gs for v in var_list): - check_v0_le_v1(this_ds_gs, var_list, both_nan_ok=True, throw_error=True) + any_bad = check_v0_le_v1(this_ds_gs, var_list, both_nan_ok=True, throw_error=throw_errors) # Check that prescribed calendars were obeyed if sdates_rx_ds: @@ -447,7 +453,7 @@ def import_output( raise RuntimeError("How to get NHARVEST_DISCREP for NHARVESTS > 2?") this_ds_gs["NHARVEST_DISCREP"] = (this_ds_gs["NHARVESTS"] == 2).astype(int) - return this_ds_gs + return this_ds_gs, any_bad def handle_zombie_crops(this_ds): From 045d90f1d80f713eb3ae0ac58f6c2352937f1eb0 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Fri, 14 Jun 2024 17:08:21 -0600 Subject: [PATCH 0515/1248] Reformat with black. --- cime_config/SystemTests/rxcropmaturity.py | 3 +-- cime_config/SystemTests/rxcropmaturityskipgen.py | 1 - python/ctsm/crop_calendars/check_rxboth_run.py | 4 +++- python/ctsm/crop_calendars/cropcal_module.py | 4 +++- python/ctsm/crop_calendars/interpolate_gdds.py | 2 +- 5 files changed, 8 insertions(+), 6 deletions(-) diff --git a/cime_config/SystemTests/rxcropmaturity.py b/cime_config/SystemTests/rxcropmaturity.py index cffb832e8d..a583432efe 100644 --- a/cime_config/SystemTests/rxcropmaturity.py +++ b/cime_config/SystemTests/rxcropmaturity.py @@ -95,8 +95,7 @@ def __init__(self, case): # Get cultivar maturity requirement file to fall back on if not generating it here self._gdds_file = None self._fallback_gdds_file = os.path.join( - os.path.dirname(self._sdatefile), - "gdds_20230829_161011.nc" + os.path.dirname(self._sdatefile), "gdds_20230829_161011.nc" ) # Which conda environment should we use? diff --git a/cime_config/SystemTests/rxcropmaturityskipgen.py b/cime_config/SystemTests/rxcropmaturityskipgen.py index 4feb661037..409f2b9847 100644 --- a/cime_config/SystemTests/rxcropmaturityskipgen.py +++ b/cime_config/SystemTests/rxcropmaturityskipgen.py @@ -2,6 +2,5 @@ class RXCROPMATURITYSKIPGEN(RXCROPMATURITYSHARED): - def run_phase(self): self._run_phase(skip_gen=True) diff --git a/python/ctsm/crop_calendars/check_rxboth_run.py b/python/ctsm/crop_calendars/check_rxboth_run.py index 8f416e9f8e..a1014b5e66 100644 --- a/python/ctsm/crop_calendars/check_rxboth_run.py +++ b/python/ctsm/crop_calendars/check_rxboth_run.py @@ -96,7 +96,9 @@ def main(argv): ) any_bad = any_bad or any_bad_import_output - _, any_bad_check_const_vars = check_constant_vars(case["ds"], case, ignore_nan=True, verbose=True, throw_error=True) + _, any_bad_check_const_vars = check_constant_vars( + case["ds"], case, ignore_nan=True, verbose=True, throw_error=True + ) any_bad = any_bad or any_bad_check_const_vars # Import GGCMI sowing and harvest dates, and check sims diff --git a/python/ctsm/crop_calendars/cropcal_module.py b/python/ctsm/crop_calendars/cropcal_module.py index fa1cc30e7c..b87d26816f 100644 --- a/python/ctsm/crop_calendars/cropcal_module.py +++ b/python/ctsm/crop_calendars/cropcal_module.py @@ -425,7 +425,9 @@ def import_output( # Check that e.g., GDDACCUM <= HUI for var_list in [["GDDACCUM", "HUI"], ["SYEARS", "HYEARS"]]: if all(v in this_ds_gs for v in var_list): - any_bad = check_v0_le_v1(this_ds_gs, var_list, both_nan_ok=True, throw_error=throw_errors) + any_bad = check_v0_le_v1( + this_ds_gs, var_list, both_nan_ok=True, throw_error=throw_errors + ) # Check that prescribed calendars were obeyed if sdates_rx_ds: diff --git a/python/ctsm/crop_calendars/interpolate_gdds.py b/python/ctsm/crop_calendars/interpolate_gdds.py index e9491480e9..2aa0b79997 100755 --- a/python/ctsm/crop_calendars/interpolate_gdds.py +++ b/python/ctsm/crop_calendars/interpolate_gdds.py @@ -13,7 +13,7 @@ sys.path.insert(1, _CTSM_PYTHON) from ctsm import ctsm_logging # pylint: disable=wrong-import-position -from ctsm.crop_calendars.cropcal_module import ( # pylint: disable=wrong-import-position +from ctsm.crop_calendars.cropcal_module import ( # pylint: disable=wrong-import-position unexpected_negative_rx_gdd, ) From 6af704f3c6d3d55aa9f288f736db2977792ef45a Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Fri, 14 Jun 2024 17:09:16 -0600 Subject: [PATCH 0516/1248] Add previous commit to .git-blame-ignore-revs. --- .git-blame-ignore-revs | 1 + 1 file changed, 1 insertion(+) diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs index f86a330408..dc56c6b7e2 100644 --- a/.git-blame-ignore-revs +++ b/.git-blame-ignore-revs @@ -45,3 +45,4 @@ aa04d1f7d86cc2503b98b7e2b2d84dbfff6c316b 6c6f57e948bfa31e60b383536cc21663fedb8b70 9660667b1267dcd4150889f5f39db540158be74a 665cf86102e09b4c4c5a140700676dca23bc55a9 +045d90f1d80f713eb3ae0ac58f6c2352937f1eb0 From 76b7df7d9fb8be59118ac7b260acd46852e196f8 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Fri, 14 Jun 2024 17:13:10 -0600 Subject: [PATCH 0517/1248] check_rx_obeyed.py: Satisfy pylint. --- python/ctsm/crop_calendars/check_rx_obeyed.py | 36 +++++++++++-------- 1 file changed, 22 insertions(+), 14 deletions(-) diff --git a/python/ctsm/crop_calendars/check_rx_obeyed.py b/python/ctsm/crop_calendars/check_rx_obeyed.py index 8525f3e890..a38b946ec5 100644 --- a/python/ctsm/crop_calendars/check_rx_obeyed.py +++ b/python/ctsm/crop_calendars/check_rx_obeyed.py @@ -104,6 +104,27 @@ def get_extreme_info(diff_array, rx_array, mxn, dims, gs_da, patches1d_lon, patc return round(themxn, 3), round(this_lon, 3), round(this_lat, 3), this_gs, round(this_rx) +def summarize_results(which_ds, output_var, verbose, all_ok, gdd_tolerance, diffs_eg_txt): + """ + Summarize results + """ + bad = True + if all_ok == 2: + bad = False + print(f"✅ {which_ds}: Prescribed {output_var} always obeyed") + elif all_ok == 1: + bad = False + # print(f"🟨 {which_ds}: Prescribed {output_var} *not* always obeyed, but acceptable:") + # for x in diff_str_list: print(x) + print( + f"🟨 {which_ds}: Prescribed {output_var} *not* always obeyed, but acceptable (diffs <= " + + f"{gdd_tolerance})" + ) + elif not verbose: + print(f"❌ {which_ds}: Prescribed {output_var} *not* always obeyed. E.g., {diffs_eg_txt}") + return bad + + def check_rx_obeyed( vegtype_list, rx_ds, dates_ds, which_ds, output_var, gdd_min=None, verbose=False ): @@ -203,19 +224,6 @@ def check_rx_obeyed( else: break - bad = True - if all_ok == 2: - bad = False - print(f"✅ {which_ds}: Prescribed {output_var} always obeyed") - elif all_ok == 1: - bad = False - # print(f"🟨 {which_ds}: Prescribed {output_var} *not* always obeyed, but acceptable:") - # for x in diff_str_list: print(x) - print( - f"🟨 {which_ds}: Prescribed {output_var} *not* always obeyed, but acceptable (diffs <= " - + f"{gdd_tolerance})" - ) - elif not verbose: - print(f"❌ {which_ds}: Prescribed {output_var} *not* always obeyed. E.g., {diffs_eg_txt}") + bad = summarize_results(which_ds, output_var, verbose, all_ok, gdd_tolerance, diffs_eg_txt) return bad From ba6cc32662ec445f7725ce0221ebacb112f440e3 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Fri, 14 Jun 2024 20:45:34 -0600 Subject: [PATCH 0518/1248] The gnu compiler on both Derecho and Izumi got confused about the InitAllocate methods in the base method as well as the Zender extension, I found this out in the debugger, this adds Base to the end of the ones in the Base class so they won't be confused with the Zender extension --- src/biogeochem/DustEmisBase.F90 | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/biogeochem/DustEmisBase.F90 b/src/biogeochem/DustEmisBase.F90 index ef509add06..c5e4260634 100644 --- a/src/biogeochem/DustEmisBase.F90 +++ b/src/biogeochem/DustEmisBase.F90 @@ -1,4 +1,5 @@ module DustEmisBase +#include "shr_assert.h" !----------------------------------------------------------------------- ! !DESCRIPTION: @@ -68,8 +69,8 @@ module DustEmisBase procedure , public :: GetConstVars ! Get important constant variables procedure , public :: CleanBase ! Base object deallocation (allows extension) procedure , public :: Clean => CleanBase ! Deallocation used by callers - procedure , private :: InitAllocate - procedure , private :: InitHistory + procedure , private :: InitAllocateBase + procedure , private :: InitHistoryBase procedure , private :: InitDustVars ! Initialize variables used in DustEmission method end type dust_emis_base_type @@ -130,8 +131,8 @@ subroutine InitBase(this, bounds, NLFilename) type(bounds_type), intent(in) :: bounds character(len=*), intent(in) :: NLFilename - call this%InitAllocate (bounds) - call this%InitHistory (bounds) + call this%InitAllocateBase (bounds) + call this%InitHistoryBase (bounds) call this%InitDustVars (bounds) end subroutine InitBase @@ -162,7 +163,7 @@ subroutine CleanBase(this) end subroutine CleanBase !------------------------------------------------------------------------ - subroutine InitAllocate(this, bounds) + subroutine InitAllocateBase(this, bounds) ! ! !ARGUMENTS: class (dust_emis_base_type) :: this @@ -188,10 +189,10 @@ subroutine InitAllocate(this, bounds) allocate (this%dmt_vwr(1:ndst)) ; this%dmt_vwr (:) = nan allocate (this%stk_crc(1:ndst)) ; this%stk_crc (:) = nan - end subroutine InitAllocate + end subroutine InitAllocateBase !------------------------------------------------------------------------ - subroutine InitHistory(this, bounds) + subroutine InitHistoryBase(this, bounds) ! ! !USES: use histFileMod, only : hist_addfld1d @@ -234,7 +235,7 @@ subroutine InitHistory(this, bounds) avgflag='A', long_name='turbulent deposition velocity 4', & ptr_patch=this%vlc_trb_4_patch, default='inactive') - end subroutine InitHistory + end subroutine InitHistoryBase !----------------------------------------------------------------------- @@ -554,6 +555,8 @@ subroutine InitDustVars(this, bounds) real(r8), parameter :: dns_slt = 2650.0_r8 ! [kg m-3] Density of optimal saltation particles !------------------------------------------------------------------------ + call shr_assert_all((lbound(this%ovr_src_snk_mss) == (/1,1/) ), file=sourcefile, line=__LINE__) + call shr_assert_all((ubound(this%ovr_src_snk_mss) == (/dst_src_nbr,ndst/) ), file=sourcefile, line=__LINE__) ! allocate local variable allocate (dmt_vma_src(dst_src_nbr)) allocate (gsd_anl_src(dst_src_nbr)) From fda1ae2b57993f84dd96953538bba08b8c5d74fe Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Sun, 16 Jun 2024 08:48:17 -0600 Subject: [PATCH 0519/1248] check_rxboth_run: Handle diffs_eg_txt never assigned. --- python/ctsm/crop_calendars/check_rx_obeyed.py | 1 + 1 file changed, 1 insertion(+) diff --git a/python/ctsm/crop_calendars/check_rx_obeyed.py b/python/ctsm/crop_calendars/check_rx_obeyed.py index a38b946ec5..383ebbf1e0 100644 --- a/python/ctsm/crop_calendars/check_rx_obeyed.py +++ b/python/ctsm/crop_calendars/check_rx_obeyed.py @@ -135,6 +135,7 @@ def check_rx_obeyed( dates_ds, which_ds, output_var, verbose ) + diffs_eg_txt = None for vegtype_str in vegtype_list: thisveg_patches = np.where(dates_ds.patches1d_itype_veg_str == vegtype_str)[0] if thisveg_patches.size == 0: From ca15115f512a8dafbf54d1f441dbe2227f96b482 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Sun, 16 Jun 2024 08:57:43 -0600 Subject: [PATCH 0520/1248] RXCROPMATURITY: Fix gdd-gen namelist. --- cime_config/SystemTests/rxcropmaturity.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cime_config/SystemTests/rxcropmaturity.py b/cime_config/SystemTests/rxcropmaturity.py index 0dbbcad291..0b9c5e8ee0 100644 --- a/cime_config/SystemTests/rxcropmaturity.py +++ b/cime_config/SystemTests/rxcropmaturity.py @@ -130,6 +130,8 @@ def _run_phase(self, skip_gen=False): logger.info("RXCROPMATURITY log: modify user_nl files: generate GDDs") self._append_to_user_nl_clm( [ + "cropcals_rx = .true.", + "stream_fldFileName_cultivar_gdds = ''", "generate_crop_gdds = .true.", "use_mxmat = .false.", " ", From 23f6fa295dd6df50770c8737a38297000533d4d9 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Sun, 16 Jun 2024 09:17:48 -0600 Subject: [PATCH 0521/1248] PlantCrop: Error if gdd20 <= 0. --- src/biogeochem/CNPhenologyMod.F90 | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/biogeochem/CNPhenologyMod.F90 b/src/biogeochem/CNPhenologyMod.F90 index b346cb119f..c3eff1538a 100644 --- a/src/biogeochem/CNPhenologyMod.F90 +++ b/src/biogeochem/CNPhenologyMod.F90 @@ -2704,6 +2704,10 @@ subroutine PlantCrop(p, leafcn_in, jday, kyr, do_plant_normal, & else if (ivt(p) == nwwheat .or. ivt(p) == nirrig_wwheat) then gddmaturity(p) = hybgdd(ivt(p)) else + if (gdd20 <= 0._r8) then + write(iulog, *) 'ERROR: gdd20 ',gdd20,' for ivt ',ivt(p) + call endrun(msg="Stopping") + end if if (ivt(p) == ntmp_soybean .or. ivt(p) == nirrig_tmp_soybean .or. & ivt(p) == ntrp_soybean .or. ivt(p) == nirrig_trp_soybean .or. & ivt(p) == nswheat .or. ivt(p) == nirrig_swheat .or. & @@ -2716,10 +2720,11 @@ subroutine PlantCrop(p, leafcn_in, jday, kyr, do_plant_normal, & ivt(p) == nmiscanthus .or. ivt(p) == nirrig_miscanthus .or. & ivt(p) == nswitchgrass .or. ivt(p) == nirrig_switchgrass) then gddmaturity(p) = max(950._r8, min(gdd20*0.85_r8, hybgdd(ivt(p)))) - if (do_plant_normal) then + if (do_plant_normal) then ! TODO SSR: Add ".and. .not. do_plant_prescribed"? gddmaturity(p) = max(950._r8, min(gddmaturity(p)+150._r8, 1850._r8)) end if else + ! TODO SSR: Add more descriptive error message call endrun(msg="Stopping") end if From 682c52651105114c63fd8735a6204a58b94863da Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Mon, 17 Jun 2024 12:18:49 -0600 Subject: [PATCH 0522/1248] Be explicit about the things needed from unittestSubGridMod, and remove two uneeded setttings --- .../test/DustEmis_test/test_DustEmisZender2003.pf | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/biogeochem/test/DustEmis_test/test_DustEmisZender2003.pf b/src/biogeochem/test/DustEmis_test/test_DustEmisZender2003.pf index 4df64c7da3..a8ac4630da 100644 --- a/src/biogeochem/test/DustEmis_test/test_DustEmisZender2003.pf +++ b/src/biogeochem/test/DustEmis_test/test_DustEmisZender2003.pf @@ -3,7 +3,7 @@ module test_DustEmisZender2003 ! Tests of DustEmisZender2003 use funit - use unittestSubgridMod + use unittestSubgridMod, only : bounds, unittest_subgrid_teardown use unittestSimpleSubgridSetupsMod, only : setup_single_veg_patch use clm_varpar, only : nlevsoi, nlevgrnd, nlevsno, clm_varpar_init, ndst use clm_varctl, only : soil_layerstruct_predefined, create_crop_landunit, use_crop, create_crop_landunit @@ -162,12 +162,6 @@ contains this%soilstate_inst%mss_frc_cly_vld_col(c) = MassFracClay( clay ) end do - - ! Use longitude along Greenich so don't have to calculate offsets for longitudes (that's calculated in clm_time_manager) - grc%londeg(:) = 0.0_r8 - - grc%area(:) = 10.0_r8 - end subroutine setupEnvironment !----------------------------------------------------------------------- From 67f4533a5c4fa6e6ab04563e2396532cb1b50dbf Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Mon, 17 Jun 2024 12:26:21 -0600 Subject: [PATCH 0523/1248] Move dust emission object creation as last --- src/biogeochem/test/DustEmis_test/test_DustEmisZender2003.pf | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/biogeochem/test/DustEmis_test/test_DustEmisZender2003.pf b/src/biogeochem/test/DustEmis_test/test_DustEmisZender2003.pf index a8ac4630da..856364e8db 100644 --- a/src/biogeochem/test/DustEmis_test/test_DustEmisZender2003.pf +++ b/src/biogeochem/test/DustEmis_test/test_DustEmisZender2003.pf @@ -81,7 +81,6 @@ contains endc = bounds%endc allocate( urb_em(begl:endl) ) - allocate(this%dust_emis, source = create_dust_emissions(bounds, NLFilename)) call filter_from_range(start=bounds%begp, end=bounds%endp, numf=this%num_nolakep, filter=this%filter_nolakep) atm2lnd_params = atm2lnd_params_type( repartition_rain_snow = .false., & glcmec_downscale_longwave = .false., & @@ -111,6 +110,8 @@ contains is_simple_buildtemp=.true., is_prog_buildtemp=.false.) deallocate (snow_depth_col ) deallocate( urb_em ) + ! Create the dust emission object last + allocate(this%dust_emis, source = create_dust_emissions(bounds, NLFilename)) end subroutine setUp !----------------------------------------------------------------------- From 499c4cfec445299e9e01be4e414372e26238f82a Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Mon, 17 Jun 2024 12:57:58 -0600 Subject: [PATCH 0524/1248] Remove setting of bedrock, which isn't needed --- src/biogeochem/test/DustEmis_test/test_DustEmisZender2003.pf | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/biogeochem/test/DustEmis_test/test_DustEmisZender2003.pf b/src/biogeochem/test/DustEmis_test/test_DustEmisZender2003.pf index 856364e8db..3d4f4c49c3 100644 --- a/src/biogeochem/test/DustEmis_test/test_DustEmisZender2003.pf +++ b/src/biogeochem/test/DustEmis_test/test_DustEmisZender2003.pf @@ -147,6 +147,7 @@ contains real(r8), parameter :: clay = 10.0_r8 !----------------------------------------------------------------------- + ! Setting the soil structrure is needed for water_state types col%dz(:,1:nlevgrnd) = 1.0_r8 do j = 1, nlevgrnd do c = bounds%begc, bounds%endc @@ -155,10 +156,6 @@ contains end do do c = bounds%begc, bounds%endc - ! Setting nbedrock to nlevsoi means that none of the layers from 1:nlevsoi are - ! considered bedrock - col%nbedrock(c) = nlevsoi - this%soilstate_inst%gwc_thr_col(c) = ThresholdSoilMoistZender2003( clay ) this%soilstate_inst%mss_frc_cly_vld_col(c) = MassFracClay( clay ) end do From 5e43b8f4aa71098b187b7719b3bf18e36aca0527 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Mon, 17 Jun 2024 13:18:32 -0600 Subject: [PATCH 0525/1248] Add some comments about the setup, and move atm2lnd init more together --- .../test/DustEmis_test/test_DustEmisZender2003.pf | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/biogeochem/test/DustEmis_test/test_DustEmisZender2003.pf b/src/biogeochem/test/DustEmis_test/test_DustEmisZender2003.pf index 3d4f4c49c3..332f808283 100644 --- a/src/biogeochem/test/DustEmis_test/test_DustEmisZender2003.pf +++ b/src/biogeochem/test/DustEmis_test/test_DustEmisZender2003.pf @@ -64,16 +64,19 @@ contains integer :: c type(atm2lnd_params_type) :: atm2lnd_params + ! Settings needed for clm_varpar soil_layerstruct_predefined = '20SL_8.5m' create_crop_landunit = .true. use_crop = .false. call clm_varpar_init( actual_maxsoil_patches=17, surf_numpft=15, surf_numcft=2, actual_nlevurb=5 ) call clm_varcon_init( is_simple_buildtemp=.true.) + ! Water factor initialization call this%water_factory%init() call this%water_factory%setup_before_subgrid( & my_nlevsoi = nlevsoi, & nlevgrnd_additional = nlevgrnd - nlevsoi, & my_nlevsno = 3) + ! Setup the subgrid structure for a single bare-soil patch call setup_single_veg_patch( pft_type=0 ) begl = bounds%begl endl = bounds%endl @@ -81,15 +84,21 @@ contains endc = bounds%endc allocate( urb_em(begl:endl) ) + ! Create the nolake filter call filter_from_range(start=bounds%begp, end=bounds%endp, numf=this%num_nolakep, filter=this%filter_nolakep) + ! atmospher to land parameter object atm2lnd_params = atm2lnd_params_type( repartition_rain_snow = .false., & glcmec_downscale_longwave = .false., & lapse_rate = 0.01_r8 & ! arbitrary (this is unused for these tests) ) + call this%atm2lnd_inst%InitForTesting(bounds, atm2lnd_params) + ! Hydrology and snow (needed for water types) allocate (snow_depth_col(begc:endc)) snow_depth_col(begc:endc) = 0.0_r8 call SnowHydrologySetControlForTesting() call InitSnowLayers(bounds, snow_depth_col(bounds%begc:bounds%endc)) + deallocate (snow_depth_col ) + ! Water and soil state -- after the subgrid setup call this%water_factory%setup_after_subgrid(snl = 3) call this%soilstate_inst%Init(bounds) do c = begc, endc @@ -97,7 +106,7 @@ contains end do call this%setupEnvironment( ) call this%water_factory%create_water_type(this%water_inst, watsat_col=this%soilstate_inst%watsat_col) - call this%atm2lnd_inst%InitForTesting(bounds, atm2lnd_params) + ! Canopy state, friction velocity, and temperature state ojects call this%canopystate_inst%SetNMLForTesting() call this%canopystate_inst%Init(bounds) call this%frictionvel_inst%InitForTesting(bounds) @@ -108,7 +117,6 @@ contains em_improad_lun=urb_em(begl:endl), & em_perroad_lun=urb_em(begl:endl), & is_simple_buildtemp=.true., is_prog_buildtemp=.false.) - deallocate (snow_depth_col ) deallocate( urb_em ) ! Create the dust emission object last allocate(this%dust_emis, source = create_dust_emissions(bounds, NLFilename)) From 281fb7b6ba3b4f249a1bb3b5b4da65b3380bf3bd Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Mon, 17 Jun 2024 13:35:17 -0600 Subject: [PATCH 0526/1248] Change name of setupEnvironment to setupSoilState and move the soil-state initialization together --- .../DustEmis_test/test_DustEmisZender2003.pf | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/src/biogeochem/test/DustEmis_test/test_DustEmisZender2003.pf b/src/biogeochem/test/DustEmis_test/test_DustEmisZender2003.pf index 332f808283..d05dcbaa6f 100644 --- a/src/biogeochem/test/DustEmis_test/test_DustEmisZender2003.pf +++ b/src/biogeochem/test/DustEmis_test/test_DustEmisZender2003.pf @@ -42,7 +42,7 @@ module test_DustEmisZender2003 contains procedure :: setUp procedure :: tearDown - procedure :: setupEnvironment + procedure :: setupSoilState procedure :: create_atm2lnd procedure :: create_fv procedure :: print_values @@ -70,7 +70,7 @@ contains use_crop = .false. call clm_varpar_init( actual_maxsoil_patches=17, surf_numpft=15, surf_numcft=2, actual_nlevurb=5 ) call clm_varcon_init( is_simple_buildtemp=.true.) - ! Water factor initialization + ! Water object initialization -- before subgrid call this%water_factory%init() call this%water_factory%setup_before_subgrid( & my_nlevsoi = nlevsoi, & @@ -82,11 +82,10 @@ contains endl = bounds%endl begc = bounds%begc endc = bounds%endc - allocate( urb_em(begl:endl) ) ! Create the nolake filter call filter_from_range(start=bounds%begp, end=bounds%endp, numf=this%num_nolakep, filter=this%filter_nolakep) - ! atmospher to land parameter object + ! atmosphere to land parameter object atm2lnd_params = atm2lnd_params_type( repartition_rain_snow = .false., & glcmec_downscale_longwave = .false., & lapse_rate = 0.01_r8 & ! arbitrary (this is unused for these tests) @@ -100,16 +99,13 @@ contains deallocate (snow_depth_col ) ! Water and soil state -- after the subgrid setup call this%water_factory%setup_after_subgrid(snl = 3) - call this%soilstate_inst%Init(bounds) - do c = begc, endc - this%soilstate_inst%watsat_col(c,:) = 0.05_r8 * (c - bounds%begc + 1) - end do - call this%setupEnvironment( ) + call this%setupSoilState( ) ! This needs to happen before the water_type object creation call this%water_factory%create_water_type(this%water_inst, watsat_col=this%soilstate_inst%watsat_col) ! Canopy state, friction velocity, and temperature state ojects call this%canopystate_inst%SetNMLForTesting() call this%canopystate_inst%Init(bounds) call this%frictionvel_inst%InitForTesting(bounds) + allocate( urb_em(begl:endl) ) urb_em(begl:endl) = 0.99_r8 call this%temperature_inst%Init(bounds, & em_roof_lun=urb_em(begl:endl), & @@ -138,7 +134,7 @@ contains !----------------------------------------------------------------------- - subroutine setupEnvironment(this) + subroutine setupSoilState(this) ! ! !DESCRIPTION: ! Sets up the external environment used by Dust emissions - i.e., things accessed via @@ -163,12 +159,17 @@ contains end do end do + call this%soilstate_inst%Init(bounds) + do c = bounds%begc, bounds%endc + this%soilstate_inst%watsat_col(c,:) = 0.05_r8 * (c - bounds%begc + 1) + end do + ! These are needed for dust emissions initialization do c = bounds%begc, bounds%endc this%soilstate_inst%gwc_thr_col(c) = ThresholdSoilMoistZender2003( clay ) this%soilstate_inst%mss_frc_cly_vld_col(c) = MassFracClay( clay ) end do - end subroutine setupEnvironment + end subroutine setupSoilState !----------------------------------------------------------------------- From 2db3f1c8200598f14cc64172b420b8241f224b43 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Mon, 17 Jun 2024 14:00:29 -0600 Subject: [PATCH 0527/1248] Don't actually need clm_varcon here --- src/biogeochem/test/DustEmis_test/test_DustEmisZender2003.pf | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/biogeochem/test/DustEmis_test/test_DustEmisZender2003.pf b/src/biogeochem/test/DustEmis_test/test_DustEmisZender2003.pf index d05dcbaa6f..90bc00803d 100644 --- a/src/biogeochem/test/DustEmis_test/test_DustEmisZender2003.pf +++ b/src/biogeochem/test/DustEmis_test/test_DustEmisZender2003.pf @@ -7,7 +7,6 @@ module test_DustEmisZender2003 use unittestSimpleSubgridSetupsMod, only : setup_single_veg_patch use clm_varpar, only : nlevsoi, nlevgrnd, nlevsno, clm_varpar_init, ndst use clm_varctl, only : soil_layerstruct_predefined, create_crop_landunit, use_crop, create_crop_landunit - use clm_varcon, only : clm_varcon_init, clm_varcon_clean use SnowHydrologyMod, only : InitSnowLayers, SnowHydrologySetControlForTesting, SnowHydrologyClean use DustEmisBase use DustEmisZender2003 @@ -69,7 +68,6 @@ contains create_crop_landunit = .true. use_crop = .false. call clm_varpar_init( actual_maxsoil_patches=17, surf_numpft=15, surf_numcft=2, actual_nlevurb=5 ) - call clm_varcon_init( is_simple_buildtemp=.true.) ! Water object initialization -- before subgrid call this%water_factory%init() call this%water_factory%setup_before_subgrid( & @@ -128,7 +126,6 @@ contains call SnowHydrologyClean() call unittest_subgrid_teardown() call this%atm2lnd_inst%Clean() - call clm_varcon_clean() deallocate( this%filter_nolakep ) end subroutine tearDown From b173ab575f2976c7b9e4880b2077e107dd905091 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Mon, 17 Jun 2024 14:11:11 -0600 Subject: [PATCH 0528/1248] remove snowHydrology parts that weren't needed --- .../test/DustEmis_test/test_DustEmisZender2003.pf | 9 --------- 1 file changed, 9 deletions(-) diff --git a/src/biogeochem/test/DustEmis_test/test_DustEmisZender2003.pf b/src/biogeochem/test/DustEmis_test/test_DustEmisZender2003.pf index 90bc00803d..250b7b3a61 100644 --- a/src/biogeochem/test/DustEmis_test/test_DustEmisZender2003.pf +++ b/src/biogeochem/test/DustEmis_test/test_DustEmisZender2003.pf @@ -7,7 +7,6 @@ module test_DustEmisZender2003 use unittestSimpleSubgridSetupsMod, only : setup_single_veg_patch use clm_varpar, only : nlevsoi, nlevgrnd, nlevsno, clm_varpar_init, ndst use clm_varctl, only : soil_layerstruct_predefined, create_crop_landunit, use_crop, create_crop_landunit - use SnowHydrologyMod, only : InitSnowLayers, SnowHydrologySetControlForTesting, SnowHydrologyClean use DustEmisBase use DustEmisZender2003 use shr_kind_mod , only : r8 => shr_kind_r8 @@ -57,7 +56,6 @@ contains class(TestDustEmisZender2003), intent(inout) :: this character(len=5) :: NLFilename = 'none' - real(r8), allocatable :: snow_depth_col(:) real(r8), allocatable :: urb_em(:) integer :: begl, endl, begc, endc integer :: c @@ -89,12 +87,6 @@ contains lapse_rate = 0.01_r8 & ! arbitrary (this is unused for these tests) ) call this%atm2lnd_inst%InitForTesting(bounds, atm2lnd_params) - ! Hydrology and snow (needed for water types) - allocate (snow_depth_col(begc:endc)) - snow_depth_col(begc:endc) = 0.0_r8 - call SnowHydrologySetControlForTesting() - call InitSnowLayers(bounds, snow_depth_col(bounds%begc:bounds%endc)) - deallocate (snow_depth_col ) ! Water and soil state -- after the subgrid setup call this%water_factory%setup_after_subgrid(snl = 3) call this%setupSoilState( ) ! This needs to happen before the water_type object creation @@ -123,7 +115,6 @@ contains call this%dust_emis%Clean() call this%water_factory%teardown(this%water_inst) - call SnowHydrologyClean() call unittest_subgrid_teardown() call this%atm2lnd_inst%Clean() deallocate( this%filter_nolakep ) From 7ddcbb147acc7e66601e4e1182efbd5683c2c2ef Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Mon, 17 Jun 2024 14:21:10 -0600 Subject: [PATCH 0529/1248] More notes, set snl with a parameter so consistent between two uses, and remove method not used --- .../test/DustEmis_test/test_DustEmisZender2003.pf | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/biogeochem/test/DustEmis_test/test_DustEmisZender2003.pf b/src/biogeochem/test/DustEmis_test/test_DustEmisZender2003.pf index 250b7b3a61..76bb036339 100644 --- a/src/biogeochem/test/DustEmis_test/test_DustEmisZender2003.pf +++ b/src/biogeochem/test/DustEmis_test/test_DustEmisZender2003.pf @@ -18,7 +18,7 @@ module test_DustEmisZender2003 use WaterType, only : water_type use FrictionVelocityMod, only : frictionvel_type use unittestWaterTypeFactory, only : unittest_water_type_factory_type - use SoilStateInitTimeConstMod, only : ThresholdSoilMoistZender2003, ThresholdSoilMoistKok2014, MassFracClay + use SoilStateInitTimeConstMod, only : ThresholdSoilMoistZender2003, MassFracClay use DustEmisFactory, only : create_dust_emissions implicit none @@ -54,12 +54,14 @@ contains subroutine setUp(this) use ColumnType, only : col class(TestDustEmisZender2003), intent(inout) :: this + ! Allocate and initiatlize the test object for input objects dust-emission needs character(len=5) :: NLFilename = 'none' real(r8), allocatable :: urb_em(:) integer :: begl, endl, begc, endc integer :: c type(atm2lnd_params_type) :: atm2lnd_params + integer, parameter :: snl = 3 ! Settings needed for clm_varpar soil_layerstruct_predefined = '20SL_8.5m' @@ -71,7 +73,7 @@ contains call this%water_factory%setup_before_subgrid( & my_nlevsoi = nlevsoi, & nlevgrnd_additional = nlevgrnd - nlevsoi, & - my_nlevsno = 3) + my_nlevsno = snl) ! Setup the subgrid structure for a single bare-soil patch call setup_single_veg_patch( pft_type=0 ) begl = bounds%begl @@ -88,7 +90,7 @@ contains ) call this%atm2lnd_inst%InitForTesting(bounds, atm2lnd_params) ! Water and soil state -- after the subgrid setup - call this%water_factory%setup_after_subgrid(snl = 3) + call this%water_factory%setup_after_subgrid(snl = snl) call this%setupSoilState( ) ! This needs to happen before the water_type object creation call this%water_factory%create_water_type(this%water_inst, watsat_col=this%soilstate_inst%watsat_col) ! Canopy state, friction velocity, and temperature state ojects @@ -96,7 +98,7 @@ contains call this%canopystate_inst%Init(bounds) call this%frictionvel_inst%InitForTesting(bounds) allocate( urb_em(begl:endl) ) - urb_em(begl:endl) = 0.99_r8 + urb_em(begl:endl) = 0.99_r8 ! Arbitrary won't matter here call this%temperature_inst%Init(bounds, & em_roof_lun=urb_em(begl:endl), & em_wall_lun=urb_em(begl:endl), & From 1633faac6bb4380f050e108af1220ac297080ea2 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Mon, 17 Jun 2024 15:56:31 -0600 Subject: [PATCH 0530/1248] Start moving dust emis inputs into it's own module to be shared by both Zender and Leung --- .../DustEmis_test/test_DustEmisZender2003.pf | 308 ++++-------------- src/unit_test_shr/CMakeLists.txt | 1 + src/unit_test_shr/unittestDustEmisInputs.F90 | 249 ++++++++++++++ 3 files changed, 315 insertions(+), 243 deletions(-) create mode 100644 src/unit_test_shr/unittestDustEmisInputs.F90 diff --git a/src/biogeochem/test/DustEmis_test/test_DustEmisZender2003.pf b/src/biogeochem/test/DustEmis_test/test_DustEmisZender2003.pf index 76bb036339..a26e2a5a33 100644 --- a/src/biogeochem/test/DustEmis_test/test_DustEmisZender2003.pf +++ b/src/biogeochem/test/DustEmis_test/test_DustEmisZender2003.pf @@ -3,6 +3,7 @@ module test_DustEmisZender2003 ! Tests of DustEmisZender2003 use funit + use unittestDustEmisInputs, only : unittest_dust_emis_input_type use unittestSubgridMod, only : bounds, unittest_subgrid_teardown use unittestSimpleSubgridSetupsMod, only : setup_single_veg_patch use clm_varpar, only : nlevsoi, nlevgrnd, nlevsno, clm_varpar_init, ndst @@ -28,21 +29,10 @@ module test_DustEmisZender2003 @TestCase type, extends(TestCase) :: TestDustEmisZender2003 class(dust_emis_base_type), allocatable :: dust_emis - integer, allocatable :: filter_nolakep(:) ! non-lake filter (patches) - integer :: num_nolakep ! number of patches in non-lake filter - type(atm2lnd_type) :: atm2lnd_inst - type(soilstate_type) :: soilstate_inst - type(canopystate_type) :: canopystate_inst - type(temperature_type) :: temperature_inst - type(unittest_water_type_factory_type) :: water_factory - type(water_type) :: water_inst - type(frictionvel_type) :: frictionvel_inst + type(unittest_dust_emis_input_type) :: input contains procedure :: setUp procedure :: tearDown - procedure :: setupSoilState - procedure :: create_atm2lnd - procedure :: create_fv procedure :: print_values procedure :: validate_patch end type TestDustEmisZender2003 @@ -52,60 +42,12 @@ contains !----------------------------------------------------------------------- subroutine setUp(this) - use ColumnType, only : col class(TestDustEmisZender2003), intent(inout) :: this - ! Allocate and initiatlize the test object for input objects dust-emission needs - + ! Allocate and initialize the test object for input objects dust-emission needs character(len=5) :: NLFilename = 'none' - real(r8), allocatable :: urb_em(:) - integer :: begl, endl, begc, endc - integer :: c - type(atm2lnd_params_type) :: atm2lnd_params - integer, parameter :: snl = 3 - - ! Settings needed for clm_varpar - soil_layerstruct_predefined = '20SL_8.5m' - create_crop_landunit = .true. - use_crop = .false. - call clm_varpar_init( actual_maxsoil_patches=17, surf_numpft=15, surf_numcft=2, actual_nlevurb=5 ) - ! Water object initialization -- before subgrid - call this%water_factory%init() - call this%water_factory%setup_before_subgrid( & - my_nlevsoi = nlevsoi, & - nlevgrnd_additional = nlevgrnd - nlevsoi, & - my_nlevsno = snl) - ! Setup the subgrid structure for a single bare-soil patch - call setup_single_veg_patch( pft_type=0 ) - begl = bounds%begl - endl = bounds%endl - begc = bounds%begc - endc = bounds%endc - - ! Create the nolake filter - call filter_from_range(start=bounds%begp, end=bounds%endp, numf=this%num_nolakep, filter=this%filter_nolakep) - ! atmosphere to land parameter object - atm2lnd_params = atm2lnd_params_type( repartition_rain_snow = .false., & - glcmec_downscale_longwave = .false., & - lapse_rate = 0.01_r8 & ! arbitrary (this is unused for these tests) - ) - call this%atm2lnd_inst%InitForTesting(bounds, atm2lnd_params) - ! Water and soil state -- after the subgrid setup - call this%water_factory%setup_after_subgrid(snl = snl) - call this%setupSoilState( ) ! This needs to happen before the water_type object creation - call this%water_factory%create_water_type(this%water_inst, watsat_col=this%soilstate_inst%watsat_col) - ! Canopy state, friction velocity, and temperature state ojects - call this%canopystate_inst%SetNMLForTesting() - call this%canopystate_inst%Init(bounds) - call this%frictionvel_inst%InitForTesting(bounds) - allocate( urb_em(begl:endl) ) - urb_em(begl:endl) = 0.99_r8 ! Arbitrary won't matter here - call this%temperature_inst%Init(bounds, & - em_roof_lun=urb_em(begl:endl), & - em_wall_lun=urb_em(begl:endl), & - em_improad_lun=urb_em(begl:endl), & - em_perroad_lun=urb_em(begl:endl), & - is_simple_buildtemp=.true., is_prog_buildtemp=.false.) - deallocate( urb_em ) + + call this%input%setUp() + ! Create the dust emission object last allocate(this%dust_emis, source = create_dust_emissions(bounds, NLFilename)) end subroutine setUp @@ -116,153 +58,33 @@ contains class(TestDustEmisZender2003), intent(inout) :: this call this%dust_emis%Clean() - call this%water_factory%teardown(this%water_inst) - call unittest_subgrid_teardown() - call this%atm2lnd_inst%Clean() - deallocate( this%filter_nolakep ) + call this%input%tearDown() end subroutine tearDown !----------------------------------------------------------------------- - subroutine setupSoilState(this) - ! - ! !DESCRIPTION: - ! Sets up the external environment used by Dust emissions - i.e., things accessed via - ! 'use' statements. - ! - ! Assumes nlevgrnd and nlevsoi have been set, and that all necessary subgrid setup has - ! been completed. - ! - use ColumnType, only : col - use GridcellType, only : grc - class(TestDustEmisZender2003), intent(in) :: this - ! - integer :: c,j - real(r8), parameter :: clay = 10.0_r8 - - !----------------------------------------------------------------------- - ! Setting the soil structrure is needed for water_state types - col%dz(:,1:nlevgrnd) = 1.0_r8 - do j = 1, nlevgrnd - do c = bounds%begc, bounds%endc - col%z(c,j) = sum(col%dz(c,1:j-1)) + 0.5_r8*col%dz(c,j) - end do - end do - - call this%soilstate_inst%Init(bounds) - do c = bounds%begc, bounds%endc - this%soilstate_inst%watsat_col(c,:) = 0.05_r8 * (c - bounds%begc + 1) - end do - ! These are needed for dust emissions initialization - do c = bounds%begc, bounds%endc - this%soilstate_inst%gwc_thr_col(c) = ThresholdSoilMoistZender2003( clay ) - this%soilstate_inst%mss_frc_cly_vld_col(c) = MassFracClay( clay ) - end do - - end subroutine setupSoilState - - !----------------------------------------------------------------------- - - subroutine create_atm2lnd(this, forc_t, forc_pbot, forc_rho ) - ! Initializes some fields needed for dust emissions in this%atm2lnd_inst, and sets - ! forcing fields based on inputs. Excluded inputs are given a default value - class(TestDustEmisZender2003), intent(inout) :: this - real(r8), intent(in), optional :: forc_t(:) - real(r8), intent(in), optional :: forc_pbot(:) - real(r8), intent(in), optional :: forc_rho(:) - - real(r8), parameter :: forc_t_default = 301._r8 - real(r8), parameter :: forc_pbot_default = 100000._r8 - real(r8), parameter :: forc_rho_default = 1.1_r8 - ! ------------------------------------------------------------------------ - - if (present(forc_t)) then - this%atm2lnd_inst%forc_t_downscaled_col(bounds%begc:bounds%endc) = forc_t(:) - else - this%atm2lnd_inst%forc_t_downscaled_col(bounds%begc:bounds%endc) = forc_t_default - end if - - if (present(forc_pbot)) then - this%atm2lnd_inst%forc_pbot_downscaled_col(bounds%begc:bounds%endc) = forc_pbot(:) - else - this%atm2lnd_inst%forc_pbot_downscaled_col(bounds%begc:bounds%endc) = forc_pbot_default - end if - - if (present(forc_rho)) then - this%atm2lnd_inst%forc_rho_downscaled_col(bounds%begc:bounds%endc) = forc_rho(:) - else - this%atm2lnd_inst%forc_rho_downscaled_col(bounds%begc:bounds%endc) = forc_rho_default - end if - - end subroutine create_atm2lnd - - !----------------------------------------------------------------------- - - subroutine create_fv(this, fv, u10, ram1) - ! Initializes some fields needed for dust emissions in this%frictionvel_inst, and sets - ! fields based on inputs. Excluded inputs are given a default value - class(TestDustEmisZender2003), intent(inout) :: this - real(r8), intent(in), optional :: fv - real(r8), intent(in), optional :: u10 - real(r8), intent(in), optional :: ram1 - - real(r8), parameter :: fv_default = 2.0_r8 - real(r8), parameter :: u10_default = 4._r8 - real(r8), parameter :: ram1_default = 200._r8 - ! ------------------------------------------------------------------------ - - if (present(fv)) then - this%frictionvel_inst%fv_patch(bounds%begp:bounds%endp) = fv - else - this%frictionvel_inst%fv_patch(bounds%begp:bounds%endp) = fv_default - end if - - if (present(u10)) then - this%frictionvel_inst%u10_patch(bounds%begp:bounds%endp) = u10 - else - this%frictionvel_inst%u10_patch(bounds%begp:bounds%endp) = u10_default - end if - - if (present(ram1)) then - this%frictionvel_inst%ram1_patch(bounds%begp:bounds%endp) = ram1 - else - this%frictionvel_inst%ram1_patch(bounds%begp:bounds%endp) = ram1_default - end if - - end subroutine create_fv - subroutine print_values(this) - use LandunitType, only : lun + ! For debugging use PatchType, only : patch class(TestDustEmisZender2003), intent(inout) :: this real(r8) :: SaltationFactor - integer :: p, c, l + integer :: p, c + call this%input%print_values() call this%dust_emis%GetConstVars( SaltationFactor ) - do l = bounds%begl, bounds%endl - print *, 'landunit type= ', lun%itype(l) - end do do c = bounds%begc, bounds%endc - print *, 'watsat = ', this%soilstate_inst%watsat_col(c,1) - print *, 'h2osoi_vol = ', this%water_inst%waterstatebulk_inst%h2osoi_vol_col(c,1) - print *, 'frac_sno = ', this%water_inst%waterdiagnosticbulk_inst%frac_sno_col(c) - print *, 'mss_frac_clay_vld = ', this%soilstate_inst%mss_frc_cly_vld_col(c) - print *, 'saltation per rho = ', (SaltationFactor / this%atm2lnd_inst%forc_rho_downscaled_col(c)) + print *, 'saltation per rho = ', (SaltationFactor / this%input%atm2lnd_inst%forc_rho_downscaled_col(c)) end do do p = bounds%begp, bounds%endp - print *, 'patch type= ', patch%itype(p) - print *, 'patch weight= ', patch%wtgcell(p) - print *, 'patch active= ', patch%active(p) - print *, 'tlai = ', this%canopystate_inst%tlai_patch(p) - print *, 'tsai = ', this%canopystate_inst%tsai_patch(p) c = patch%column(p) - print *, 'Wind threshold fraction = ', (SaltationFactor / this%atm2lnd_inst%forc_rho_downscaled_col(c)) & - / this%frictionvel_inst%fv_patch(p) + print *, 'Wind threshold fraction = ', (SaltationFactor / this%input%atm2lnd_inst%forc_rho_downscaled_col(c)) & + / this%input%frictionvel_inst%fv_patch(p) call this%dust_emis%WritePatchToLog( p ) end do end subroutine print_values - + !----------------------------------------------------------------------- + subroutine validate_patch(this, p) class(TestDustEmisZender2003), intent(inout) :: this integer, intent(in) :: p @@ -283,12 +105,12 @@ contains real(r8) :: vlc_trb_3 real(r8) :: vlc_trb_4 - call this%create_atm2lnd() - call this%create_fv() - call this%dust_emis%DustEmission(bounds, this%num_nolakep, this%filter_nolakep, this%atm2lnd_inst, & - this%soilstate_inst, this%canopystate_inst, this%water_inst%waterstatebulk_inst, & - this%water_inst%waterdiagnosticbulk_inst, this%frictionvel_inst) - call this%dust_emis%DustDryDep(bounds, this%atm2lnd_inst, this%frictionvel_inst) + call this%input%create_atm2lnd() + call this%input%create_fv() + call this%dust_emis%DustEmission(bounds, this%input%num_nolakep, this%input%filter_nolakep, this%input%atm2lnd_inst, & + this%input%soilstate_inst, this%input%canopystate_inst, this%input%water_inst%waterstatebulk_inst, & + this%input%water_inst%waterdiagnosticbulk_inst, this%input%frictionvel_inst) + call this%dust_emis%DustDryDep(bounds, this%input%atm2lnd_inst, this%input%frictionvel_inst) do p = bounds%begp, bounds%endp call this%validate_patch(p) call this%dust_emis%GetPatchVars( p, flx_mss_vrt_dst_tot=flx_mss_vrt_dst_tot, & @@ -314,15 +136,15 @@ contains real(r8) :: fv real(r8) :: SaltationFactor - call this%create_atm2lnd() + call this%input%create_atm2lnd() call this%dust_emis%GetConstVars( SaltationFactor ) ! Figure out what fv needs to be so that the wind threshold will be u10*(1/(1-eps)) - fv = ( SaltationFactor / sqrt( this%atm2lnd_inst%forc_rho_downscaled_col(bounds%begc)) ) - 1.d-15 - call this%create_fv( fv=fv ) - call this%dust_emis%DustEmission(bounds, this%num_nolakep, this%filter_nolakep, this%atm2lnd_inst, & - this%soilstate_inst, this%canopystate_inst, this%water_inst%waterstatebulk_inst, & - this%water_inst%waterdiagnosticbulk_inst, this%frictionvel_inst) - call this%dust_emis%DustDryDep(bounds, this%atm2lnd_inst, this%frictionvel_inst) + fv = ( SaltationFactor / sqrt( this%input%atm2lnd_inst%forc_rho_downscaled_col(bounds%begc)) ) - 1.d-15 + call this%input%create_fv( fv=fv ) + call this%dust_emis%DustEmission(bounds, this%input%num_nolakep, this%input%filter_nolakep, this%input%atm2lnd_inst, & + this%input%soilstate_inst, this%input%canopystate_inst, this%input%water_inst%waterstatebulk_inst, & + this%input%water_inst%waterdiagnosticbulk_inst, this%input%frictionvel_inst) + call this%dust_emis%DustDryDep(bounds, this%input%atm2lnd_inst, this%input%frictionvel_inst) call this%print_values() do p = bounds%begp, bounds%endp call this%validate_patch(p) @@ -341,13 +163,13 @@ contains integer :: p real(r8) :: flx_mss_vrt_dst_tot - call this%create_atm2lnd() - this%water_inst%waterdiagnosticbulk_inst%frac_sno_col(:) = 1.0_r8 - call this%create_fv( ) - call this%dust_emis%DustEmission(bounds, this%num_nolakep, this%filter_nolakep, this%atm2lnd_inst, & - this%soilstate_inst, this%canopystate_inst, this%water_inst%waterstatebulk_inst, & - this%water_inst%waterdiagnosticbulk_inst, this%frictionvel_inst) - call this%dust_emis%DustDryDep(bounds, this%atm2lnd_inst, this%frictionvel_inst) + call this%input%create_atm2lnd() + this%input%water_inst%waterdiagnosticbulk_inst%frac_sno_col(:) = 1.0_r8 + call this%input%create_fv( ) + call this%dust_emis%DustEmission(bounds, this%input%num_nolakep, this%input%filter_nolakep, this%input%atm2lnd_inst, & + this%input%soilstate_inst, this%input%canopystate_inst, this%input%water_inst%waterstatebulk_inst, & + this%input%water_inst%waterdiagnosticbulk_inst, this%input%frictionvel_inst) + call this%dust_emis%DustDryDep(bounds, this%input%atm2lnd_inst, this%input%frictionvel_inst) do p = bounds%begp, bounds%endp call this%dust_emis%GetPatchVars( p, flx_mss_vrt_dst_tot=flx_mss_vrt_dst_tot ) @assertEqual( flx_mss_vrt_dst_tot, 0.0_r8 ) @@ -366,15 +188,15 @@ contains integer :: p, l real(r8) :: flx_mss_vrt_dst_tot - call this%create_atm2lnd() - call this%create_fv( ) + call this%input%create_atm2lnd() + call this%input%create_fv( ) ! Set the lanunit type for do l = istcrop+1, max_lunit lun%itype(bounds%begl:bounds%endl) = l - call this%dust_emis%DustEmission(bounds, this%num_nolakep, this%filter_nolakep, this%atm2lnd_inst, & - this%soilstate_inst, this%canopystate_inst, this%water_inst%waterstatebulk_inst, & - this%water_inst%waterdiagnosticbulk_inst, this%frictionvel_inst) - call this%dust_emis%DustDryDep(bounds, this%atm2lnd_inst, this%frictionvel_inst) + call this%dust_emis%DustEmission(bounds, this%input%num_nolakep, this%input%filter_nolakep, this%input%atm2lnd_inst, & + this%input%soilstate_inst, this%input%canopystate_inst, this%input%water_inst%waterstatebulk_inst, & + this%input%water_inst%waterdiagnosticbulk_inst, this%input%frictionvel_inst) + call this%dust_emis%DustDryDep(bounds, this%input%atm2lnd_inst, this%input%frictionvel_inst) do p = bounds%begp, bounds%endp call this%dust_emis%GetPatchVars( p, flx_mss_vrt_dst_tot=flx_mss_vrt_dst_tot ) @assertEqual( flx_mss_vrt_dst_tot, 0.0_r8 ) @@ -392,13 +214,13 @@ contains real(r8) :: flx_mss_vrt_dst_tot character(100) :: expected_msg - call this%create_atm2lnd() - call this%create_fv( ) + call this%input%create_atm2lnd() + call this%input%create_fv( ) ! Dust should abort with an error on dust mobility when snow fraction greater than 1 - this%water_inst%waterdiagnosticbulk_inst%frac_sno_col(:) = 1.0_r8 + 1.e-15_r8 - call this%dust_emis%DustEmission(bounds, this%num_nolakep, this%filter_nolakep, this%atm2lnd_inst, & - this%soilstate_inst, this%canopystate_inst, this%water_inst%waterstatebulk_inst, & - this%water_inst%waterdiagnosticbulk_inst, this%frictionvel_inst) + this%input%water_inst%waterdiagnosticbulk_inst%frac_sno_col(:) = 1.0_r8 + 1.e-15_r8 + call this%dust_emis%DustEmission(bounds, this%input%num_nolakep, this%input%filter_nolakep, this%input%atm2lnd_inst, & + this%input%soilstate_inst, this%input%canopystate_inst, this%input%water_inst%waterstatebulk_inst, & + this%input%water_inst%waterdiagnosticbulk_inst, this%input%frictionvel_inst) expected_msg = "ABORTED: Bad value for dust mobilization fraction" @assertExceptionRaised(expected_msg) @@ -413,13 +235,13 @@ contains integer :: p real(r8) :: flx_mss_vrt_dst_tot - call this%create_atm2lnd() - call this%create_fv( ) - this%canopystate_inst%tlai_patch(:) = 0.3_r8 - call this%dust_emis%DustEmission(bounds, this%num_nolakep, this%filter_nolakep, this%atm2lnd_inst, & - this%soilstate_inst, this%canopystate_inst, this%water_inst%waterstatebulk_inst, & - this%water_inst%waterdiagnosticbulk_inst, this%frictionvel_inst) - call this%dust_emis%DustDryDep(bounds, this%atm2lnd_inst, this%frictionvel_inst) + call this%input%create_atm2lnd() + call this%input%create_fv( ) + this%input%canopystate_inst%tlai_patch(:) = 0.3_r8 + call this%dust_emis%DustEmission(bounds, this%input%num_nolakep, this%input%filter_nolakep, this%input%atm2lnd_inst, & + this%input%soilstate_inst, this%input%canopystate_inst, this%input%water_inst%waterstatebulk_inst, & + this%input%water_inst%waterdiagnosticbulk_inst, this%input%frictionvel_inst) + call this%dust_emis%DustDryDep(bounds, this%input%atm2lnd_inst, this%input%frictionvel_inst) do p = bounds%begp, bounds%endp call this%validate_patch(p) call this%dust_emis%GetPatchVars( p, flx_mss_vrt_dst_tot=flx_mss_vrt_dst_tot ) @@ -441,12 +263,12 @@ contains real(r8) :: total_dust0, total_dust_higher ! Run baseline u10 - call this%create_atm2lnd() - call this%create_fv( u10=u10, fv=fv ) - call this%dust_emis%DustEmission(bounds, this%num_nolakep, this%filter_nolakep, this%atm2lnd_inst, & - this%soilstate_inst, this%canopystate_inst, this%water_inst%waterstatebulk_inst, & - this%water_inst%waterdiagnosticbulk_inst, this%frictionvel_inst) - call this%dust_emis%DustDryDep(bounds, this%atm2lnd_inst, this%frictionvel_inst) + call this%input%create_atm2lnd() + call this%input%create_fv( u10=u10, fv=fv ) + call this%dust_emis%DustEmission(bounds, this%input%num_nolakep, this%input%filter_nolakep, this%input%atm2lnd_inst, & + this%input%soilstate_inst, this%input%canopystate_inst, this%input%water_inst%waterstatebulk_inst, & + this%input%water_inst%waterdiagnosticbulk_inst, this%input%frictionvel_inst) + call this%dust_emis%DustDryDep(bounds, this%input%atm2lnd_inst, this%input%frictionvel_inst) do p = bounds%begp, bounds%endp call this%validate_patch(p) call this%dust_emis%GetPatchVars( p, flx_mss_vrt_dst_tot=flx_mss_vrt_dst_tot ) @@ -454,11 +276,11 @@ contains @assertEqual( flx_mss_vrt_dst_tot, 2.273879554711299d-5, tolerance=tol ) end do ! Double u10 and show result is higher - call this%create_fv( u10=u10*2.0_r8, fv=fv) - call this%dust_emis%DustEmission(bounds, this%num_nolakep, this%filter_nolakep, this%atm2lnd_inst, & - this%soilstate_inst, this%canopystate_inst, this%water_inst%waterstatebulk_inst, & - this%water_inst%waterdiagnosticbulk_inst, this%frictionvel_inst) - call this%dust_emis%DustDryDep(bounds, this%atm2lnd_inst, this%frictionvel_inst) + call this%input%create_fv( u10=u10*2.0_r8, fv=fv) + call this%dust_emis%DustEmission(bounds, this%input%num_nolakep, this%input%filter_nolakep, this%input%atm2lnd_inst, & + this%input%soilstate_inst, this%input%canopystate_inst, this%input%water_inst%waterstatebulk_inst, & + this%input%water_inst%waterdiagnosticbulk_inst, this%input%frictionvel_inst) + call this%dust_emis%DustDryDep(bounds, this%input%atm2lnd_inst, this%input%frictionvel_inst) do p = bounds%begp, bounds%endp call this%validate_patch(p) call this%dust_emis%GetPatchVars( p, flx_mss_vrt_dst_tot=flx_mss_vrt_dst_tot ) diff --git a/src/unit_test_shr/CMakeLists.txt b/src/unit_test_shr/CMakeLists.txt index 9bf95c728f..f6a204bd72 100644 --- a/src/unit_test_shr/CMakeLists.txt +++ b/src/unit_test_shr/CMakeLists.txt @@ -9,6 +9,7 @@ sourcelist_to_parent(clm_genf90_sources) list(APPEND clm_sources "${clm_genf90_sources}") list(APPEND clm_sources + unittestDustEmisInputs.F90 unittestFilterBuilderMod.F90 unittestGlcMec.F90 unittestSimpleSubgridSetupsMod.F90 diff --git a/src/unit_test_shr/unittestDustEmisInputs.F90 b/src/unit_test_shr/unittestDustEmisInputs.F90 new file mode 100644 index 0000000000..4cc82fa55e --- /dev/null +++ b/src/unit_test_shr/unittestDustEmisInputs.F90 @@ -0,0 +1,249 @@ +module unittestDustEmisInputs + + ! unit testing dust emission inputs + + use unittestSubgridMod, only : bounds, unittest_subgrid_teardown + use unittestSimpleSubgridSetupsMod, only : setup_single_veg_patch + use clm_varpar, only : nlevsoi, nlevgrnd, nlevsno, clm_varpar_init, ndst + use clm_varctl, only : soil_layerstruct_predefined, create_crop_landunit, use_crop, create_crop_landunit + use shr_kind_mod , only : r8 => shr_kind_r8 + use unittestFilterBuilderMod, only : filter_from_range + use atm2lndType, only : atm2lnd_type, atm2lnd_params_type + use SoilStateType, only : soilstate_type + use CanopyStateType, only : canopystate_type + use TemperatureType, only : temperature_type + use WaterType, only : water_type + use FrictionVelocityMod, only : frictionvel_type + use unittestWaterTypeFactory, only : unittest_water_type_factory_type + use SoilStateInitTimeConstMod, only : ThresholdSoilMoistZender2003, MassFracClay + + implicit none + private + + type, public :: unittest_dust_emis_input_type + integer, allocatable :: filter_nolakep(:) ! non-lake filter (patches) + integer :: num_nolakep ! number of patches in non-lake filter + type(atm2lnd_type) :: atm2lnd_inst + type(soilstate_type) :: soilstate_inst + type(canopystate_type) :: canopystate_inst + type(temperature_type) :: temperature_inst + type(unittest_water_type_factory_type) :: water_factory + type(water_type) :: water_inst + type(frictionvel_type) :: frictionvel_inst + contains + procedure, public :: setUp + procedure, public :: tearDown + procedure, private:: setupSoilState + procedure, public :: create_atm2lnd + procedure, public :: create_fv + procedure, public :: print_values + end type unittest_dust_emis_input_type + +contains + + !----------------------------------------------------------------------- + + subroutine setUp(this) + use ColumnType, only : col + class(unittest_dust_emis_input_type), intent(inout) :: this + ! Allocate and initiatlize the test object for input objects dust-emission needs + + character(len=5) :: NLFilename = 'none' + real(r8), allocatable :: urb_em(:) + integer :: begl, endl, begc, endc + integer :: c + type(atm2lnd_params_type) :: atm2lnd_params + integer, parameter :: snl = 3 + + ! Settings needed for clm_varpar + soil_layerstruct_predefined = '20SL_8.5m' + create_crop_landunit = .true. + use_crop = .false. + call clm_varpar_init( actual_maxsoil_patches=17, surf_numpft=15, surf_numcft=2, actual_nlevurb=5 ) + ! Water object initialization -- before subgrid + call this%water_factory%init() + call this%water_factory%setup_before_subgrid( & + my_nlevsoi = nlevsoi, & + nlevgrnd_additional = nlevgrnd - nlevsoi, & + my_nlevsno = snl) + ! Setup the subgrid structure for a single bare-soil patch + call setup_single_veg_patch( pft_type=0 ) + begl = bounds%begl + endl = bounds%endl + begc = bounds%begc + endc = bounds%endc + + ! Create the nolake filter + call filter_from_range(start=bounds%begp, end=bounds%endp, numf=this%num_nolakep, filter=this%filter_nolakep) + ! atmosphere to land parameter object + atm2lnd_params = atm2lnd_params_type( repartition_rain_snow = .false., & + glcmec_downscale_longwave = .false., & + lapse_rate = 0.01_r8 & ! arbitrary (this is unused for these tests) + ) + call this%atm2lnd_inst%InitForTesting(bounds, atm2lnd_params) + ! Water and soil state -- after the subgrid setup + call this%water_factory%setup_after_subgrid(snl = snl) + call this%setupSoilState( ) ! This needs to happen before the water_type object creation + call this%water_factory%create_water_type(this%water_inst, watsat_col=this%soilstate_inst%watsat_col) + ! Canopy state, friction velocity, and temperature state ojects + call this%canopystate_inst%SetNMLForTesting() + call this%canopystate_inst%Init(bounds) + call this%frictionvel_inst%InitForTesting(bounds) + allocate( urb_em(begl:endl) ) + urb_em(begl:endl) = 0.99_r8 ! Arbitrary won't matter here + call this%temperature_inst%Init(bounds, & + em_roof_lun=urb_em(begl:endl), & + em_wall_lun=urb_em(begl:endl), & + em_improad_lun=urb_em(begl:endl), & + em_perroad_lun=urb_em(begl:endl), & + is_simple_buildtemp=.true., is_prog_buildtemp=.false.) + deallocate( urb_em ) + end subroutine setUp + + !----------------------------------------------------------------------- + + subroutine tearDown(this) + class(unittest_dust_emis_input_type), intent(inout) :: this + + call this%water_factory%teardown(this%water_inst) + call unittest_subgrid_teardown() + call this%atm2lnd_inst%Clean() + deallocate( this%filter_nolakep ) + end subroutine tearDown + + !----------------------------------------------------------------------- + + subroutine setupSoilState(this) + ! + ! !DESCRIPTION: + ! Sets up the external environment used by Dust emissions - i.e., things accessed via + ! 'use' statements. + ! + ! Assumes nlevgrnd and nlevsoi have been set, and that all necessary subgrid setup has + ! been completed. + ! + use ColumnType, only : col + use GridcellType, only : grc + class(unittest_dust_emis_input_type), intent(in) :: this + ! + integer :: c,j + real(r8), parameter :: clay = 10.0_r8 + + !----------------------------------------------------------------------- + ! Setting the soil structrure is needed for water_state types + col%dz(:,1:nlevgrnd) = 1.0_r8 + do j = 1, nlevgrnd + do c = bounds%begc, bounds%endc + col%z(c,j) = sum(col%dz(c,1:j-1)) + 0.5_r8*col%dz(c,j) + end do + end do + + call this%soilstate_inst%Init(bounds) + do c = bounds%begc, bounds%endc + this%soilstate_inst%watsat_col(c,:) = 0.05_r8 * (c - bounds%begc + 1) + end do + ! These are needed for dust emissions initialization + do c = bounds%begc, bounds%endc + this%soilstate_inst%gwc_thr_col(c) = ThresholdSoilMoistZender2003( clay ) + this%soilstate_inst%mss_frc_cly_vld_col(c) = MassFracClay( clay ) + end do + + end subroutine setupSoilState + + !----------------------------------------------------------------------- + + subroutine create_atm2lnd(this, forc_t, forc_pbot, forc_rho ) + ! Initializes some fields needed for dust emissions in this%atm2lnd_inst, and sets + ! forcing fields based on inputs. Excluded inputs are given a default value + class(unittest_dust_emis_input_type), intent(inout) :: this + real(r8), intent(in), optional :: forc_t(:) + real(r8), intent(in), optional :: forc_pbot(:) + real(r8), intent(in), optional :: forc_rho(:) + + real(r8), parameter :: forc_t_default = 301._r8 + real(r8), parameter :: forc_pbot_default = 100000._r8 + real(r8), parameter :: forc_rho_default = 1.1_r8 + ! ------------------------------------------------------------------------ + + if (present(forc_t)) then + this%atm2lnd_inst%forc_t_downscaled_col(bounds%begc:bounds%endc) = forc_t(:) + else + this%atm2lnd_inst%forc_t_downscaled_col(bounds%begc:bounds%endc) = forc_t_default + end if + + if (present(forc_pbot)) then + this%atm2lnd_inst%forc_pbot_downscaled_col(bounds%begc:bounds%endc) = forc_pbot(:) + else + this%atm2lnd_inst%forc_pbot_downscaled_col(bounds%begc:bounds%endc) = forc_pbot_default + end if + + if (present(forc_rho)) then + this%atm2lnd_inst%forc_rho_downscaled_col(bounds%begc:bounds%endc) = forc_rho(:) + else + this%atm2lnd_inst%forc_rho_downscaled_col(bounds%begc:bounds%endc) = forc_rho_default + end if + + end subroutine create_atm2lnd + + !----------------------------------------------------------------------- + + subroutine create_fv(this, fv, u10, ram1) + ! Initializes some fields needed for dust emissions in this%frictionvel_inst, and sets + ! fields based on inputs. Excluded inputs are given a default value + class(unittest_dust_emis_input_type), intent(inout) :: this + real(r8), intent(in), optional :: fv + real(r8), intent(in), optional :: u10 + real(r8), intent(in), optional :: ram1 + + real(r8), parameter :: fv_default = 2.0_r8 + real(r8), parameter :: u10_default = 4._r8 + real(r8), parameter :: ram1_default = 200._r8 + ! ------------------------------------------------------------------------ + + if (present(fv)) then + this%frictionvel_inst%fv_patch(bounds%begp:bounds%endp) = fv + else + this%frictionvel_inst%fv_patch(bounds%begp:bounds%endp) = fv_default + end if + + if (present(u10)) then + this%frictionvel_inst%u10_patch(bounds%begp:bounds%endp) = u10 + else + this%frictionvel_inst%u10_patch(bounds%begp:bounds%endp) = u10_default + end if + + if (present(ram1)) then + this%frictionvel_inst%ram1_patch(bounds%begp:bounds%endp) = ram1 + else + this%frictionvel_inst%ram1_patch(bounds%begp:bounds%endp) = ram1_default + end if + + end subroutine create_fv + + subroutine print_values(this) + use LandunitType, only : lun + use PatchType, only : patch + class(unittest_dust_emis_input_type), intent(inout) :: this + integer :: p, c, l + + do l = bounds%begl, bounds%endl + print *, 'landunit type= ', lun%itype(l) + end do + do c = bounds%begc, bounds%endc + print *, 'watsat = ', this%soilstate_inst%watsat_col(c,1) + print *, 'h2osoi_vol = ', this%water_inst%waterstatebulk_inst%h2osoi_vol_col(c,1) + print *, 'frac_sno = ', this%water_inst%waterdiagnosticbulk_inst%frac_sno_col(c) + print *, 'mss_frac_clay_vld = ', this%soilstate_inst%mss_frc_cly_vld_col(c) + end do + do p = bounds%begp, bounds%endp + print *, 'patch type= ', patch%itype(p) + print *, 'patch weight= ', patch%wtgcell(p) + print *, 'patch active= ', patch%active(p) + print *, 'tlai = ', this%canopystate_inst%tlai_patch(p) + print *, 'tsai = ', this%canopystate_inst%tsai_patch(p) + end do + end subroutine print_values + + !----------------------------------------------------------------------- + +end module unittestDustEmisInputs \ No newline at end of file From 65da9cf9c59b19f75e6621e3ca625c9443355dcf Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Mon, 17 Jun 2024 16:06:40 -0600 Subject: [PATCH 0531/1248] Remove things not needed --- .../test/DustEmis_test/test_DustEmisZender2003.pf | 14 +------------- src/unit_test_shr/unittestDustEmisInputs.F90 | 8 +++++--- 2 files changed, 6 insertions(+), 16 deletions(-) diff --git a/src/biogeochem/test/DustEmis_test/test_DustEmisZender2003.pf b/src/biogeochem/test/DustEmis_test/test_DustEmisZender2003.pf index a26e2a5a33..9bdaa685b0 100644 --- a/src/biogeochem/test/DustEmis_test/test_DustEmisZender2003.pf +++ b/src/biogeochem/test/DustEmis_test/test_DustEmisZender2003.pf @@ -4,22 +4,10 @@ module test_DustEmisZender2003 use funit use unittestDustEmisInputs, only : unittest_dust_emis_input_type - use unittestSubgridMod, only : bounds, unittest_subgrid_teardown - use unittestSimpleSubgridSetupsMod, only : setup_single_veg_patch - use clm_varpar, only : nlevsoi, nlevgrnd, nlevsno, clm_varpar_init, ndst - use clm_varctl, only : soil_layerstruct_predefined, create_crop_landunit, use_crop, create_crop_landunit + use unittestSubgridMod, only : bounds use DustEmisBase use DustEmisZender2003 use shr_kind_mod , only : r8 => shr_kind_r8 - use unittestFilterBuilderMod, only : filter_from_range - use atm2lndType, only : atm2lnd_type, atm2lnd_params_type - use SoilStateType, only : soilstate_type - use CanopyStateType, only : canopystate_type - use TemperatureType, only : temperature_type - use WaterType, only : water_type - use FrictionVelocityMod, only : frictionvel_type - use unittestWaterTypeFactory, only : unittest_water_type_factory_type - use SoilStateInitTimeConstMod, only : ThresholdSoilMoistZender2003, MassFracClay use DustEmisFactory, only : create_dust_emissions implicit none diff --git a/src/unit_test_shr/unittestDustEmisInputs.F90 b/src/unit_test_shr/unittestDustEmisInputs.F90 index 4cc82fa55e..6b15680ef7 100644 --- a/src/unit_test_shr/unittestDustEmisInputs.F90 +++ b/src/unit_test_shr/unittestDustEmisInputs.F90 @@ -4,7 +4,7 @@ module unittestDustEmisInputs use unittestSubgridMod, only : bounds, unittest_subgrid_teardown use unittestSimpleSubgridSetupsMod, only : setup_single_veg_patch - use clm_varpar, only : nlevsoi, nlevgrnd, nlevsno, clm_varpar_init, ndst + use clm_varpar, only : nlevsoi, nlevgrnd, clm_varpar_init use clm_varctl, only : soil_layerstruct_predefined, create_crop_landunit, use_crop, create_crop_landunit use shr_kind_mod , only : r8 => shr_kind_r8 use unittestFilterBuilderMod, only : filter_from_range @@ -26,8 +26,8 @@ module unittestDustEmisInputs type(atm2lnd_type) :: atm2lnd_inst type(soilstate_type) :: soilstate_inst type(canopystate_type) :: canopystate_inst - type(temperature_type) :: temperature_inst - type(unittest_water_type_factory_type) :: water_factory + type(temperature_type), private :: temperature_inst + type(unittest_water_type_factory_type), private :: water_factory type(water_type) :: water_inst type(frictionvel_type) :: frictionvel_inst contains @@ -220,6 +220,8 @@ subroutine create_fv(this, fv, u10, ram1) end subroutine create_fv + !----------------------------------------------------------------------- + subroutine print_values(this) use LandunitType, only : lun use PatchType, only : patch From eed6886a16996d823a49e0ffa0ae7aef06e56542 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Mon, 17 Jun 2024 16:15:32 -0600 Subject: [PATCH 0532/1248] Add note about the call to print_values subroutine used for debugging --- src/biogeochem/test/DustEmis_test/test_DustEmisZender2003.pf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/biogeochem/test/DustEmis_test/test_DustEmisZender2003.pf b/src/biogeochem/test/DustEmis_test/test_DustEmisZender2003.pf index 9bdaa685b0..c8ffb87c32 100644 --- a/src/biogeochem/test/DustEmis_test/test_DustEmisZender2003.pf +++ b/src/biogeochem/test/DustEmis_test/test_DustEmisZender2003.pf @@ -99,6 +99,7 @@ contains this%input%soilstate_inst, this%input%canopystate_inst, this%input%water_inst%waterstatebulk_inst, & this%input%water_inst%waterdiagnosticbulk_inst, this%input%frictionvel_inst) call this%dust_emis%DustDryDep(bounds, this%input%atm2lnd_inst, this%input%frictionvel_inst) + call this%print_values() ! Call print subroutine just to make sure it can be used for debugging do p = bounds%begp, bounds%endp call this%validate_patch(p) call this%dust_emis%GetPatchVars( p, flx_mss_vrt_dst_tot=flx_mss_vrt_dst_tot, & @@ -133,7 +134,6 @@ contains this%input%soilstate_inst, this%input%canopystate_inst, this%input%water_inst%waterstatebulk_inst, & this%input%water_inst%waterdiagnosticbulk_inst, this%input%frictionvel_inst) call this%dust_emis%DustDryDep(bounds, this%input%atm2lnd_inst, this%input%frictionvel_inst) - call this%print_values() do p = bounds%begp, bounds%endp call this%validate_patch(p) call this%dust_emis%GetPatchVars( p, flx_mss_vrt_dst_tot=flx_mss_vrt_dst_tot ) From 78c5d989e8664d968a156cdac9d2120b17256618 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Mon, 17 Jun 2024 16:21:08 -0600 Subject: [PATCH 0533/1248] Handle gdd20 < minimum if generate_crop_gdds. --- src/biogeochem/CNPhenologyMod.F90 | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/biogeochem/CNPhenologyMod.F90 b/src/biogeochem/CNPhenologyMod.F90 index c3eff1538a..d4f486acb7 100644 --- a/src/biogeochem/CNPhenologyMod.F90 +++ b/src/biogeochem/CNPhenologyMod.F90 @@ -2704,10 +2704,6 @@ subroutine PlantCrop(p, leafcn_in, jday, kyr, do_plant_normal, & else if (ivt(p) == nwwheat .or. ivt(p) == nirrig_wwheat) then gddmaturity(p) = hybgdd(ivt(p)) else - if (gdd20 <= 0._r8) then - write(iulog, *) 'ERROR: gdd20 ',gdd20,' for ivt ',ivt(p) - call endrun(msg="Stopping") - end if if (ivt(p) == ntmp_soybean .or. ivt(p) == nirrig_tmp_soybean .or. & ivt(p) == ntrp_soybean .or. ivt(p) == nirrig_trp_soybean .or. & ivt(p) == nswheat .or. ivt(p) == nirrig_swheat .or. & @@ -2731,7 +2727,7 @@ subroutine PlantCrop(p, leafcn_in, jday, kyr, do_plant_normal, & endif if (gddmaturity(p) < min_gddmaturity) then - if (use_cropcal_rx_cultivar_gdds) then + if (use_cropcal_rx_cultivar_gdds .or. generate_crop_gdds) then if (did_rx_gdds) then write(iulog,*) 'Some patch with ivt ',ivt(p),' has rx gddmaturity',gddmaturity(p),'; using min_gddmaturity instead (',min_gddmaturity,')' end if From f5407e4c578665fad46438514b480a4738565015 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Mon, 17 Jun 2024 17:55:49 -0600 Subject: [PATCH 0534/1248] Add some comments and change comment about dust-emis object by things asked for in the code review --- src/biogeochem/CNVegStateType.F90 | 2 +- src/biogeochem/DustEmisFactory.F90 | 18 ++++++++++++++++-- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/src/biogeochem/CNVegStateType.F90 b/src/biogeochem/CNVegStateType.F90 index 98c1a6ce3a..d63752c5b7 100644 --- a/src/biogeochem/CNVegStateType.F90 +++ b/src/biogeochem/CNVegStateType.F90 @@ -519,7 +519,7 @@ subroutine InitCold(this, bounds) ! -------------------------------------------------------------------- ! Initialize terms needed for dust model - ! TODO - move these terms to DustEmisZender2003 module variables + ! TODO - move these terms to DustEmisBase object variables ! -------------------------------------------------------------------- do c = bounds%begc, bounds%endc diff --git a/src/biogeochem/DustEmisFactory.F90 b/src/biogeochem/DustEmisFactory.F90 index 29787c1855..aee4af0a55 100644 --- a/src/biogeochem/DustEmisFactory.F90 +++ b/src/biogeochem/DustEmisFactory.F90 @@ -1,5 +1,9 @@ module DustEmisFactory - + !--------------------------------------------------------------------------- + ! + ! Factory to figure out whihc dust emission method to instantiate + ! + !--------------------------------------------------------------------------- use abortutils , only : endrun use shr_log_mod , only : errMsg => shr_log_errMsg use clm_varctl , only : iulog @@ -15,16 +19,24 @@ module DustEmisFactory contains + !--------------------------------------------------------------------------- + function create_dust_emissions(bounds, NLFilename) result(dust_emis) + !--------------------------------------------------------------------------- + ! Create a dust_emission base class objecct + ! The method implemented depends on namelist input + !--------------------------------------------------------------------------- use DustEmisBase , only : dust_emis_base_type use DustEmisZender2003, only : dust_emis_zender2003_type use clm_varctl , only : dust_emis_method use decompMod , only : bounds_type use shr_kind_mod , only : CL => shr_kind_cl implicit none + ! Arguments class(dust_emis_base_type), allocatable :: dust_emis type(bounds_type), intent(in) :: bounds character(len=*), intent(in) :: NLFilename + ! Local variables character(len=CL) :: method method = dust_emis_method @@ -48,4 +60,6 @@ function create_dust_emissions(bounds, NLFilename) result(dust_emis) end function create_dust_emissions -end module DustEmisFactory \ No newline at end of file + !--------------------------------------------------------------------------- + +end module DustEmisFactory From 8e69f12020659b836bec06e7f50a1e2ffe9456fa Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Mon, 17 Jun 2024 18:01:16 -0600 Subject: [PATCH 0535/1248] Use dust_emis_method directly as in the review --- src/biogeochem/DustEmisFactory.F90 | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/biogeochem/DustEmisFactory.F90 b/src/biogeochem/DustEmisFactory.F90 index aee4af0a55..371e77d6dc 100644 --- a/src/biogeochem/DustEmisFactory.F90 +++ b/src/biogeochem/DustEmisFactory.F90 @@ -37,11 +37,8 @@ function create_dust_emissions(bounds, NLFilename) result(dust_emis) type(bounds_type), intent(in) :: bounds character(len=*), intent(in) :: NLFilename ! Local variables - character(len=CL) :: method - method = dust_emis_method - - select case ( trim(method) ) + select case ( trim(dust_emis_method) ) case( "Zender_2003" ) allocate(dust_emis, source=dust_emis_zender2003_type() ) @@ -50,7 +47,7 @@ function create_dust_emissions(bounds, NLFilename) result(dust_emis) !case( "Leung_2023" ) ! allocate(dust_emis, source=dust_emis_zender2003_type() ) case default - write(iulog,*) 'ERROR: unknown dust_emis_method: ', method, & + write(iulog,*) 'ERROR: unknown dust_emis_method: ', dust_emis_method, & errMsg(sourcefile, __LINE__) call endrun( "Unrecognized dust_emis_method" ) From e291534b6b058d6e6ea220432a22e2f8cb2fb97d Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Mon, 17 Jun 2024 18:08:07 -0600 Subject: [PATCH 0536/1248] Remove the ifs around different dust-emis methods for the Zender case as pointed out in the review --- src/biogeochem/DustEmisZender2003.F90 | 26 +++++--------------------- 1 file changed, 5 insertions(+), 21 deletions(-) diff --git a/src/biogeochem/DustEmisZender2003.F90 b/src/biogeochem/DustEmisZender2003.F90 index e3c4d4115e..cee704ad47 100644 --- a/src/biogeochem/DustEmisZender2003.F90 +++ b/src/biogeochem/DustEmisZender2003.F90 @@ -31,7 +31,6 @@ module DustEmisZender2003 use PatchType , only : patch use ZenderSoilErodStreamType, only : soil_erod_stream_type use DustEmisBase , only : dust_emis_base_type - use clm_varctl , only : dust_emis_method ! ! !PUBLIC TYPES implicit none @@ -160,6 +159,7 @@ end subroutine InitHistory subroutine InitCold(this, bounds) ! + ! Initialize values from a cold start ! !ARGUMENTS: class (dust_emis_zender2003_type) :: this type(bounds_type), intent(in) :: bounds @@ -168,27 +168,11 @@ subroutine InitCold(this, bounds) integer :: c,l !----------------------------------------------------------------------- - ! Set basin factor to 1 for now - - if (dust_emis_method == 'Leung_2023') then - !do c = bounds%begc, bounds%endc - ! l = col%landunit(c) - - ! if (.not.lun%lakpoi(l)) then - ! this%mbl_bsn_fct_col(c) = 1.0_r8 - ! end if - !end do - call endrun( msg="Leung_2023 dust_emis_method is currently not available"//errMsg(sourcefile, __LINE__)) - else if (dust_emis_method == 'Zender_2003') then - if ( this%soil_erod_stream%UseStreams() )then - call this%soil_erod_stream%CalcDustSource( bounds, & - this%mbl_bsn_fct_col(bounds%begc:bounds%endc) ) - else - this%mbl_bsn_fct_col(:) = 1.0_r8 - end if + if ( this%soil_erod_stream%UseStreams() )then + call this%soil_erod_stream%CalcDustSource( bounds, & + this%mbl_bsn_fct_col(bounds%begc:bounds%endc) ) else - write(iulog,*) 'dust_emis_method not recognized = ', trim(dust_emis_method) - call endrun( msg="dust_emis_method namelist item is not valid "//errMsg(sourcefile, __LINE__)) + this%mbl_bsn_fct_col(:) = 1.0_r8 end if end subroutine InitCold From 2060a9d77496feeadb106fdb311485f1b9b99c81 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Mon, 17 Jun 2024 18:22:57 -0600 Subject: [PATCH 0537/1248] Set the veg patch type explicitly to 1 and add some comments regarding it, based on the code review --- .../test/DustEmis_test/test_DustEmisZender2003.pf | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/biogeochem/test/DustEmis_test/test_DustEmisZender2003.pf b/src/biogeochem/test/DustEmis_test/test_DustEmisZender2003.pf index c8ffb87c32..8641b8cceb 100644 --- a/src/biogeochem/test/DustEmis_test/test_DustEmisZender2003.pf +++ b/src/biogeochem/test/DustEmis_test/test_DustEmisZender2003.pf @@ -218,11 +218,18 @@ contains @Test subroutine dust_zero_when_tlai_high(this) + use PatchType, only : patch ! Check dust emissions are zero when LAI is high enough class(TestDustEmisZender2003), intent(inout) :: this integer :: p real(r8) :: flx_mss_vrt_dst_tot + ! Explicitly set the patch type to a hard-coded 1 (so NOT bare-soil) + ! pft indices can't be used without reading them from the parameter file + ! + ! To do this fully the subgrid setup in unittestDustEmisInputs to baresoil + ! should really be run again. But, just doing this is likely sufficient for testing + patch%itype(bounds%begp:bounds%endp) = 1 call this%input%create_atm2lnd() call this%input%create_fv( ) this%input%canopystate_inst%tlai_patch(:) = 0.3_r8 From f618893aa8598727e37e6ae8064f317fa3f13182 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Tue, 18 Jun 2024 08:46:47 -0600 Subject: [PATCH 0538/1248] Set cropcal_rx true for both parts of RXCROPMATURITY*. --- cime_config/SystemTests/rxcropmaturity.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cime_config/SystemTests/rxcropmaturity.py b/cime_config/SystemTests/rxcropmaturity.py index 0b9c5e8ee0..46ed8f8be3 100644 --- a/cime_config/SystemTests/rxcropmaturity.py +++ b/cime_config/SystemTests/rxcropmaturity.py @@ -130,7 +130,6 @@ def _run_phase(self, skip_gen=False): logger.info("RXCROPMATURITY log: modify user_nl files: generate GDDs") self._append_to_user_nl_clm( [ - "cropcals_rx = .true.", "stream_fldFileName_cultivar_gdds = ''", "generate_crop_gdds = .true.", "use_mxmat = .false.", @@ -397,6 +396,7 @@ def _run_check_rxboth_run(self, skip_gen): def _modify_user_nl_allruns(self): nl_additions = [ + "cropcals_rx = .true.", "stream_meshfile_cropcal = '{}'".format(self._case.get_value("LND_DOMAIN_MESH")), "stream_fldFileName_swindow_start = '{}'".format(self._sdatefile), "stream_fldFileName_swindow_end = '{}'".format(self._sdatefile), From 7578787061226c463828f80fbc6612cdd2388ddc Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Tue, 18 Jun 2024 10:04:17 -0600 Subject: [PATCH 0539/1248] Add GddGen(OnlyOutputs(Surf)) testmods. --- .../testmods_dirs/clm/GddGen/include_user_mods | 1 + .../testdefs/testmods_dirs/clm/GddGen/user_nl_clm | 11 +++++++++++ .../clm/GddGenOnlyOutputs/include_user_mods | 1 + .../clm/GddGenOnlyOutputs/user_nl_clm | 14 ++++++++++++++ .../clm/GddGenOnlyOutputsSurf/include_user_mods | 1 + .../clm/GddGenOnlyOutputsSurf/user_nl_clm | 5 +++++ 6 files changed, 33 insertions(+) create mode 100644 cime_config/testdefs/testmods_dirs/clm/GddGen/include_user_mods create mode 100644 cime_config/testdefs/testmods_dirs/clm/GddGen/user_nl_clm create mode 100644 cime_config/testdefs/testmods_dirs/clm/GddGenOnlyOutputs/include_user_mods create mode 100644 cime_config/testdefs/testmods_dirs/clm/GddGenOnlyOutputs/user_nl_clm create mode 100644 cime_config/testdefs/testmods_dirs/clm/GddGenOnlyOutputsSurf/include_user_mods create mode 100644 cime_config/testdefs/testmods_dirs/clm/GddGenOnlyOutputsSurf/user_nl_clm diff --git a/cime_config/testdefs/testmods_dirs/clm/GddGen/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/GddGen/include_user_mods new file mode 100644 index 0000000000..6cc92bc8b3 --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/GddGen/include_user_mods @@ -0,0 +1 @@ +../GddGenOnlyOutputsSurf diff --git a/cime_config/testdefs/testmods_dirs/clm/GddGen/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/GddGen/user_nl_clm new file mode 100644 index 0000000000..f36ffd26b9 --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/GddGen/user_nl_clm @@ -0,0 +1,11 @@ +cropcals_rx = .true. +stream_meshfile_cropcal = '/glade/campaign/cesm/cesmdata/inputdata/share/meshes/10x15_nomask_c110308_ESMFmesh.nc' +stream_fldFileName_swindow_start = '/glade/campaign/cesm/cesmdata/inputdata/lnd/clm2/cropdata/calendars/processed/sdates_ggcmi_crop_calendar_phase3_v1.01_nninterp-f10_f10_mg37.2000-2000.20230330_165301.nc' +stream_fldFileName_swindow_end = '/glade/campaign/cesm/cesmdata/inputdata/lnd/clm2/cropdata/calendars/processed/sdates_ggcmi_crop_calendar_phase3_v1.01_nninterp-f10_f10_mg37.2000-2000.20230330_165301.nc' +stream_year_first_cropcal_swindows = 2000 +stream_year_last_cropcal_swindows = 2000 +model_year_align_cropcal_swindows = 2000 + +stream_fldFileName_cultivar_gdds = '' +generate_crop_gdds = .true. +use_mxmat = .false. diff --git a/cime_config/testdefs/testmods_dirs/clm/GddGenOnlyOutputs/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/GddGenOnlyOutputs/include_user_mods new file mode 100644 index 0000000000..02ec13743f --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/GddGenOnlyOutputs/include_user_mods @@ -0,0 +1 @@ +../cropMonthOutput diff --git a/cime_config/testdefs/testmods_dirs/clm/GddGenOnlyOutputs/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/GddGenOnlyOutputs/user_nl_clm new file mode 100644 index 0000000000..8fe842624d --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/GddGenOnlyOutputs/user_nl_clm @@ -0,0 +1,14 @@ +! (h1) Annual outputs on sowing or harvest axis +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 and figure-making +hist_fincl3 = 'GDDACCUM', 'GDDHARV' +hist_nhtfrq(3) = -24 +hist_mfilt(3) = 365 +hist_type1d_pertape(3) = 'PFTS' +hist_dov2xy(3) = .false. + diff --git a/cime_config/testdefs/testmods_dirs/clm/GddGenOnlyOutputsSurf/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/GddGenOnlyOutputsSurf/include_user_mods new file mode 100644 index 0000000000..8c6e50384c --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/GddGenOnlyOutputsSurf/include_user_mods @@ -0,0 +1 @@ +../GddGenOnlyOutputs diff --git a/cime_config/testdefs/testmods_dirs/clm/GddGenOnlyOutputsSurf/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/GddGenOnlyOutputsSurf/user_nl_clm new file mode 100644 index 0000000000..184043f013 --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/GddGenOnlyOutputsSurf/user_nl_clm @@ -0,0 +1,5 @@ +fsurdat = '/glade/derecho/scratch/samrabin/tests_0618-093950de/RXCROPMATURITY_Lm61.f10_f10_mg37.IHistClm50BgcCrop.derecho_intel.clm-cropMonthOutput.0618-093950de.gddgen/surfdata_10x15_hist_1850_78pfts_c240216.all_crops_everywhere.nc' +do_transient_crops = .false. +flanduse_timeseries = '' +use_init_interp = .true. + From 787c2f2600212685ee4df732fe2bf33797084fb6 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Tue, 18 Jun 2024 15:37:04 -0600 Subject: [PATCH 0540/1248] Improve a comment. --- cime_config/SystemTests/rxcropmaturity.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cime_config/SystemTests/rxcropmaturity.py b/cime_config/SystemTests/rxcropmaturity.py index a583432efe..7a179cdf56 100644 --- a/cime_config/SystemTests/rxcropmaturity.py +++ b/cime_config/SystemTests/rxcropmaturity.py @@ -455,7 +455,7 @@ def _run_generate_gdds(self, case_gddgen): self._gdds_file = generated_gdd_files[0] def _run_interpolate_gdds(self): - # Save where? + # File where interpolated GDDs should be saved self._gdds_file = os.path.join(self._get_caseroot(), "interpolated_gdds.nc") # It'd be much nicer to call interpolate_gdds.main(), but I can't import interpolate_gdds. From 752ba73b9df6cf4997685789f2dc2fa1962768e8 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Tue, 18 Jun 2024 15:38:39 -0600 Subject: [PATCH 0541/1248] Describe rxcropmaturity suite in testlist_clm.xml. --- cime_config/testdefs/testlist_clm.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index 432f8e3e9a..5443acf2d7 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -10,6 +10,7 @@ prebeta: Run before CESM beta tags (more extensive, but should have tests outside of prealpha) (subset of aux_clm tests) aux_cime_baselines: CESM cime baselines (subset of aux_clm tests) hillslope: Experimental test list used for the hillslope option of the model + rxcropmaturity: Short tests to be run during development related to prescribed crop calendars --> From 6fdcf4cd198cd53733437136a8e90d59e4935369 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Tue, 18 Jun 2024 15:50:59 -0600 Subject: [PATCH 0542/1248] UpdateAccVars_CropGDDs: Remove check that patch is a crop. --- src/biogeophys/TemperatureType.F90 | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/biogeophys/TemperatureType.F90 b/src/biogeophys/TemperatureType.F90 index afe0948e6d..79bdce64ef 100644 --- a/src/biogeophys/TemperatureType.F90 +++ b/src/biogeophys/TemperatureType.F90 @@ -1400,7 +1400,6 @@ subroutine UpdateAccVars_CropGDDs(this, rbufslp, begp, endp, month, day, secs, d use shr_const_mod , only : SHR_CONST_CDAY, SHR_CONST_TKFRZ use accumulMod , only : update_accum_field, extract_accum_field, markreset_accum_field use clm_time_manager , only : is_doy_in_interval, get_curr_calday - use pftconMod , only : npcropmin use CropType, only : crop_type ! ! !ARGUMENTS @@ -1418,7 +1417,6 @@ subroutine UpdateAccVars_CropGDDs(this, rbufslp, begp, endp, month, day, secs, d character(8) :: field_name ! E.g., GDD0 character(32) :: format_string integer :: p - integer :: ivt ! vegetation type logical :: in_accumulation_season real(r8) :: lat ! latitude integer :: gdd20_season_start, gdd20_season_end @@ -1456,9 +1454,8 @@ subroutine UpdateAccVars_CropGDDs(this, rbufslp, begp, endp, month, day, secs, d do p = begp,endp - ! Avoid unnecessary calculations over inactive points and non-crops - ivt = patch%itype(p) - if (ivt < npcropmin .or. .not. patch%active(p)) then + ! Avoid unnecessary calculations over inactive points + if (.not. patch%active(p)) then cycle end if From c6ae96bd6dd557b6baf734431799b78351fd1910 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Tue, 18 Jun 2024 16:05:11 -0600 Subject: [PATCH 0543/1248] Add StreamGdd20Seasons testmod. --- .../testdefs/testmods_dirs/clm/StreamGdd20Seasons/user_nl_clm | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 cime_config/testdefs/testmods_dirs/clm/StreamGdd20Seasons/user_nl_clm diff --git a/cime_config/testdefs/testmods_dirs/clm/StreamGdd20Seasons/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/StreamGdd20Seasons/user_nl_clm new file mode 100644 index 0000000000..dd6cd3451d --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/StreamGdd20Seasons/user_nl_clm @@ -0,0 +1,2 @@ +stream_gdd20_seasons = .true. + From 9c5b2792c38a572e8b297701ebfcf1234e13043d Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Tue, 18 Jun 2024 16:22:24 -0600 Subject: [PATCH 0544/1248] StreamGdd20Seasons: Set allow_invalid_gdd20_season_inputs .true. --- .../testdefs/testmods_dirs/clm/StreamGdd20Seasons/user_nl_clm | 1 + 1 file changed, 1 insertion(+) diff --git a/cime_config/testdefs/testmods_dirs/clm/StreamGdd20Seasons/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/StreamGdd20Seasons/user_nl_clm index dd6cd3451d..86cdffe96a 100644 --- a/cime_config/testdefs/testmods_dirs/clm/StreamGdd20Seasons/user_nl_clm +++ b/cime_config/testdefs/testmods_dirs/clm/StreamGdd20Seasons/user_nl_clm @@ -1,2 +1,3 @@ stream_gdd20_seasons = .true. +allow_invalid_gdd20_season_inputs = .true. From 70b8fe32f6f437d3458013b99b2ae5bb136a6255 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Tue, 18 Jun 2024 16:38:16 -0600 Subject: [PATCH 0545/1248] Don't check gdd20_season_starts/ends if not crop. --- src/biogeophys/TemperatureType.F90 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/biogeophys/TemperatureType.F90 b/src/biogeophys/TemperatureType.F90 index 79bdce64ef..4212bcdd0f 100644 --- a/src/biogeophys/TemperatureType.F90 +++ b/src/biogeophys/TemperatureType.F90 @@ -1400,6 +1400,7 @@ subroutine UpdateAccVars_CropGDDs(this, rbufslp, begp, endp, month, day, secs, d use shr_const_mod , only : SHR_CONST_CDAY, SHR_CONST_TKFRZ use accumulMod , only : update_accum_field, extract_accum_field, markreset_accum_field use clm_time_manager , only : is_doy_in_interval, get_curr_calday + use pftconMod , only : npcropmin use CropType, only : crop_type ! ! !ARGUMENTS @@ -1467,7 +1468,7 @@ subroutine UpdateAccVars_CropGDDs(this, rbufslp, begp, endp, month, day, secs, d ((month > 9 .or. month < 4) .and. lat < 0._r8) ! Replace with read-in gdd20 accumulation season, if needed and valid ! (If these aren't being read in or they're invalid, they'll be -1) - if (stream_gdd20_seasons) then + if (stream_gdd20_seasons .and. patch%itype(p) >= npcropmin) then gdd20_season_start = int(gdd20_season_starts(p)) gdd20_season_end = int(gdd20_season_ends(p)) if (gdd20_season_start >= 1 .and. gdd20_season_end >= 1) then From 41e30bd412045e74d33bb53137a4aa08bb401739 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Tue, 18 Jun 2024 16:58:33 -0600 Subject: [PATCH 0546/1248] Correct comment in crop testmod user_nl_clm. --- cime_config/testdefs/testmods_dirs/clm/crop/user_nl_clm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cime_config/testdefs/testmods_dirs/clm/crop/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/crop/user_nl_clm index 67042ea01a..c9598772a2 100644 --- a/cime_config/testdefs/testmods_dirs/clm/crop/user_nl_clm +++ b/cime_config/testdefs/testmods_dirs/clm/crop/user_nl_clm @@ -9,7 +9,7 @@ hist_fincl2 += 'DYN_COL_SOIL_ADJUSTMENTS_C' -! Annual crop variables on per-sowing/per-harvest axes, per PFT. +! Annual crop variables (including per-sowing/per-harvest axes), per PFT. hist_fincl3 = 'SDATES', 'SDATES_PERHARV', 'SYEARS_PERHARV', 'HDATES', 'GRAINC_TO_FOOD_PERHARV', 'GRAINC_TO_FOOD_ANN', 'GRAINN_TO_FOOD_PERHARV', 'GRAINN_TO_FOOD_ANN', 'GRAINC_TO_SEED_PERHARV', 'GRAINC_TO_SEED_ANN', 'GRAINN_TO_SEED_PERHARV', 'GRAINN_TO_SEED_ANN', 'HDATES', 'GDDHARV_PERHARV', 'GDDACCUM_PERHARV', 'HUI_PERHARV', 'SOWING_REASON_PERHARV', 'HARVEST_REASON_PERHARV', 'SWINDOW_STARTS', 'SWINDOW_ENDS' hist_nhtfrq(3) = 17520 hist_mfilt(3) = 1 From 30597ce4b917d88d3f31d850eee7615bfd06d830 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Tue, 18 Jun 2024 17:10:47 -0600 Subject: [PATCH 0547/1248] Add four tests to crop_calendars suite: * SMS_Ld65.f10_f10_mg37.IHistClm50BgcCrop.derecho_intel.clm-GddGen.0618-170953de_int * SMS_Ld65.f10_f10_mg37.IHistClm50BgcCrop.derecho_intel.clm-GddGen--clm-StreamGdd20Seasons * SMS_Ld65.f10_f10_mg37.IHistClm60BgcCrop.derecho_intel.clm-GddGen * SMS_Ld65.f10_f10_mg37.IHistClm60BgcCrop.derecho_intel.clm-GddGen--clm-StreamGdd20Seasons --- cime_config/testdefs/testlist_clm.xml | 36 +++++++++++++++++++ .../clm/StreamGdd20Seasons/user_nl_clm | 2 ++ 2 files changed, 38 insertions(+) diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index 254d60c74b..a51e1f92ac 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -3767,5 +3767,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/cime_config/testdefs/testmods_dirs/clm/StreamGdd20Seasons/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/StreamGdd20Seasons/user_nl_clm index 86cdffe96a..7f140eb719 100644 --- a/cime_config/testdefs/testmods_dirs/clm/StreamGdd20Seasons/user_nl_clm +++ b/cime_config/testdefs/testmods_dirs/clm/StreamGdd20Seasons/user_nl_clm @@ -1,3 +1,5 @@ stream_gdd20_seasons = .true. allow_invalid_gdd20_season_inputs = .true. +! Annual crop variables (including per-sowing/per-harvest axes), per PFT. +hist_fincl3 += 'GDD20_BASELINE', 'GDD20_SEASON_START', 'GDD20_SEASON_END' \ No newline at end of file From 2573c34721f9dd74f4b82fbbb062edd9b1b48c70 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Tue, 18 Jun 2024 18:46:57 -0600 Subject: [PATCH 0548/1248] Fix walltime for GddGen tests. --- cime_config/testdefs/testlist_clm.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index a51e1f92ac..c5aa12387c 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -3772,7 +3772,7 @@ - + @@ -3781,7 +3781,7 @@ - + @@ -3790,7 +3790,7 @@ - + @@ -3799,7 +3799,7 @@ - + From 400c4590ba07db052c6903bf48ee5cc54856497e Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Wed, 19 Jun 2024 11:03:23 -0600 Subject: [PATCH 0549/1248] Remove some commented-out code from check_rx_obeyed. --- python/ctsm/crop_calendars/check_rx_obeyed.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/python/ctsm/crop_calendars/check_rx_obeyed.py b/python/ctsm/crop_calendars/check_rx_obeyed.py index 383ebbf1e0..4d8ccd1788 100644 --- a/python/ctsm/crop_calendars/check_rx_obeyed.py +++ b/python/ctsm/crop_calendars/check_rx_obeyed.py @@ -114,8 +114,6 @@ def summarize_results(which_ds, output_var, verbose, all_ok, gdd_tolerance, diff print(f"✅ {which_ds}: Prescribed {output_var} always obeyed") elif all_ok == 1: bad = False - # print(f"🟨 {which_ds}: Prescribed {output_var} *not* always obeyed, but acceptable:") - # for x in diff_str_list: print(x) print( f"🟨 {which_ds}: Prescribed {output_var} *not* always obeyed, but acceptable (diffs <= " + f"{gdd_tolerance})" From d01520b9000b32de107dcbef35b483ec966c9dc8 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Wed, 19 Jun 2024 11:11:09 -0600 Subject: [PATCH 0550/1248] Add reference to issue ESCOMP/CTSM#2603. https://github.com/ESCOMP/CTSM/issues/2603 --- cime_config/SystemTests/rxcropmaturity.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cime_config/SystemTests/rxcropmaturity.py b/cime_config/SystemTests/rxcropmaturity.py index 7a179cdf56..31deb1442b 100644 --- a/cime_config/SystemTests/rxcropmaturity.py +++ b/cime_config/SystemTests/rxcropmaturity.py @@ -424,6 +424,7 @@ def _run_generate_gdds(self, case_gddgen): hdates_file = self._hdatefile # It'd be much nicer to call generate_gdds.main(), but I can't import generate_gdds. + # See https://github.com/ESCOMP/CTSM/issues/2603 tool_path = os.path.join( self._ctsm_root, "python", "ctsm", "crop_calendars", "generate_gdds.py" ) @@ -459,6 +460,7 @@ def _run_interpolate_gdds(self): self._gdds_file = os.path.join(self._get_caseroot(), "interpolated_gdds.nc") # It'd be much nicer to call interpolate_gdds.main(), but I can't import interpolate_gdds. + # See https://github.com/ESCOMP/CTSM/issues/2603 tool_path = os.path.join( self._ctsm_root, "python", "ctsm", "crop_calendars", "interpolate_gdds.py" ) From 98e3689e04a2ad2ef2de4c893cab2cf91007aebb Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Wed, 19 Jun 2024 11:29:05 -0600 Subject: [PATCH 0551/1248] rxcropmaturity: Wrap two long comments. --- cime_config/SystemTests/rxcropmaturity.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/cime_config/SystemTests/rxcropmaturity.py b/cime_config/SystemTests/rxcropmaturity.py index 31deb1442b..d25bd015ca 100644 --- a/cime_config/SystemTests/rxcropmaturity.py +++ b/cime_config/SystemTests/rxcropmaturity.py @@ -36,7 +36,9 @@ def __init__(self, case): full_test = "RXCROPMATURITY_" in casebaseid skipgen_test = "RXCROPMATURITYSKIPGEN_" in casebaseid - # Ensure run length is at least 5 years. Minimum to produce one complete growing season (i.e., two complete calendar years) actually 4 years, but that only gets you 1 season usable for GDD generation, so you can't check for season-to-season consistency. + # Ensure run length is at least 5 years. Minimum to produce one complete growing season + # (i.e., two complete calendar years) actually 4 years, but that only gets you 1 season + # usable for GDD generation, so you can't check for season-to-season consistency. stop_n = self._case.get_value("STOP_N") stop_option = self._case.get_value("STOP_OPTION") stop_n_orig = stop_n @@ -68,7 +70,10 @@ def __init__(self, case): + f"{stop_n_orig} {stop_option_orig[1:]}" ) elif skipgen_test and stop_n < 3: - # First year is discarded because crops are already in the ground at restart, and those aren't affected by the new crop calendar inputs. The second year is useable, but we need a third year so that all crops planted in the second year have a chance to finish. + # First year is discarded because crops are already in the ground at restart, and those + # aren't affected by the new crop calendar inputs. The second year is useable, but we + # need a third year so that all crops planted in the second year have a chance to + # finish. error_message = ( "RXCROPMATURITYSKIPGEN (both-forced part) must be run for at least 3 years; you requested " + f"{stop_n_orig} {stop_option_orig[1:]}" From 418f6bed1d757d8aada4a0ce932dc501c37d47df Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Wed, 19 Jun 2024 11:53:55 -0600 Subject: [PATCH 0552/1248] GDD20_BASELINE and GDD20_SEASON_START/END now instantaneous. --- src/biogeochem/CropType.F90 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/biogeochem/CropType.F90 b/src/biogeochem/CropType.F90 index b1e0e4571d..77da895135 100644 --- a/src/biogeochem/CropType.F90 +++ b/src/biogeochem/CropType.F90 @@ -366,15 +366,15 @@ subroutine InitHistory(this, bounds) this%gdd20_baseline_patch(begp:endp) = spval call hist_addfld1d (fname='GDD20_BASELINE', units='ddays', & - avgflag='A', long_name='Baseline mean growing-degree days accumulated during accumulation period (from input)', & + avgflag='I', long_name='Baseline mean growing-degree days accumulated during accumulation period (from input)', & ptr_patch=this%gdd20_baseline_patch, default='inactive') this%gdd20_season_start_patch(begp:endp) = spval call hist_addfld1d (fname='GDD20_SEASON_START', units='day of year', & - avgflag='A', long_name='Start of the GDD20 accumulation season (from input)', & + avgflag='I', long_name='Start of the GDD20 accumulation season (from input)', & ptr_patch=this%gdd20_season_start_patch, default='inactive') this%gdd20_season_end_patch(begp:endp) = spval call hist_addfld1d (fname='GDD20_SEASON_END', units='day of year', & - avgflag='A', long_name='End of the GDD20 accumulation season (from input)', & + avgflag='I', long_name='End of the GDD20 accumulation season (from input)', & ptr_patch=this%gdd20_season_end_patch, default='inactive') end subroutine InitHistory From e3a00f84b3b3b276659673ac766b0d24bfc0d881 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Wed, 19 Jun 2024 11:55:57 -0600 Subject: [PATCH 0553/1248] Save GDD20_BASELINE and GDD20_SEASON_START/END in crop testmod. --- cime_config/testdefs/testmods_dirs/clm/crop/user_nl_clm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cime_config/testdefs/testmods_dirs/clm/crop/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/crop/user_nl_clm index c9598772a2..a368e97593 100644 --- a/cime_config/testdefs/testmods_dirs/clm/crop/user_nl_clm +++ b/cime_config/testdefs/testmods_dirs/clm/crop/user_nl_clm @@ -9,8 +9,8 @@ hist_fincl2 += 'DYN_COL_SOIL_ADJUSTMENTS_C' -! Annual crop variables (including per-sowing/per-harvest axes), per PFT. -hist_fincl3 = 'SDATES', 'SDATES_PERHARV', 'SYEARS_PERHARV', 'HDATES', 'GRAINC_TO_FOOD_PERHARV', 'GRAINC_TO_FOOD_ANN', 'GRAINN_TO_FOOD_PERHARV', 'GRAINN_TO_FOOD_ANN', 'GRAINC_TO_SEED_PERHARV', 'GRAINC_TO_SEED_ANN', 'GRAINN_TO_SEED_PERHARV', 'GRAINN_TO_SEED_ANN', 'HDATES', 'GDDHARV_PERHARV', 'GDDACCUM_PERHARV', 'HUI_PERHARV', 'SOWING_REASON_PERHARV', 'HARVEST_REASON_PERHARV', 'SWINDOW_STARTS', 'SWINDOW_ENDS' +! Annual instantaneous crop variables (including per-sowing/per-harvest axes), per PFT. +hist_fincl3 = 'SDATES', 'SDATES_PERHARV', 'SYEARS_PERHARV', 'HDATES', 'GRAINC_TO_FOOD_PERHARV', 'GRAINC_TO_FOOD_ANN', 'GRAINN_TO_FOOD_PERHARV', 'GRAINN_TO_FOOD_ANN', 'GRAINC_TO_SEED_PERHARV', 'GRAINC_TO_SEED_ANN', 'GRAINN_TO_SEED_PERHARV', 'GRAINN_TO_SEED_ANN', 'HDATES', 'GDDHARV_PERHARV', 'GDDACCUM_PERHARV', 'HUI_PERHARV', 'SOWING_REASON_PERHARV', 'HARVEST_REASON_PERHARV', 'SWINDOW_STARTS', 'SWINDOW_ENDS', 'GDD20_BASELINE', 'GDD20_SEASON_START', 'GDD20_SEASON_END' hist_nhtfrq(3) = 17520 hist_mfilt(3) = 1 hist_type1d_pertape(3) = 'PFTS' From 3b915fdd953bfcf24fd7a0e3c29722041ca119c1 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Wed, 19 Jun 2024 12:10:14 -0600 Subject: [PATCH 0554/1248] Simplify crop calendar tests. --- cime_config/testdefs/testlist_clm.xml | 22 ++----------------- .../testdefs/testmods_dirs/clm/GddGen/README | 5 +++++ .../clm/GddGen/include_user_mods | 2 +- .../testmods_dirs/clm/GddGen/user_nl_clm | 14 ++++++------ .../clm/GddGenOnlyOutputs/include_user_mods | 1 - .../clm/GddGenOnlyOutputs/user_nl_clm | 14 ------------ .../GddGenOnlyOutputsSurf/include_user_mods | 1 - .../clm/GddGenOnlyOutputsSurf/user_nl_clm | 5 ----- .../clm/StreamGdd20Seasons/user_nl_clm | 3 --- .../clm/cropAnnOutputMonthly/user_nl_clm | 3 +++ 10 files changed, 18 insertions(+), 52 deletions(-) create mode 100644 cime_config/testdefs/testmods_dirs/clm/GddGen/README delete mode 100644 cime_config/testdefs/testmods_dirs/clm/GddGenOnlyOutputs/include_user_mods delete mode 100644 cime_config/testdefs/testmods_dirs/clm/GddGenOnlyOutputs/user_nl_clm delete mode 100644 cime_config/testdefs/testmods_dirs/clm/GddGenOnlyOutputsSurf/include_user_mods delete mode 100644 cime_config/testdefs/testmods_dirs/clm/GddGenOnlyOutputsSurf/user_nl_clm create mode 100644 cime_config/testdefs/testmods_dirs/clm/cropAnnOutputMonthly/user_nl_clm diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index c5aa12387c..1a09ce4e80 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -3767,7 +3767,7 @@ - + @@ -3776,25 +3776,7 @@ - - - - - - - - - - - - - - - - - - - + diff --git a/cime_config/testdefs/testmods_dirs/clm/GddGen/README b/cime_config/testdefs/testmods_dirs/clm/GddGen/README new file mode 100644 index 0000000000..3236ca609a --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/GddGen/README @@ -0,0 +1,5 @@ +The GddGen test is set up just like a GDD-Generating run, with two differences: +1) It doesn't include an all-crops-everywhere surface dataset, +2) it doesn't actually run the GDD-generating script, +and +3) it includes some extra outputs. diff --git a/cime_config/testdefs/testmods_dirs/clm/GddGen/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/GddGen/include_user_mods index 6cc92bc8b3..02ec13743f 100644 --- a/cime_config/testdefs/testmods_dirs/clm/GddGen/include_user_mods +++ b/cime_config/testdefs/testmods_dirs/clm/GddGen/include_user_mods @@ -1 +1 @@ -../GddGenOnlyOutputsSurf +../cropMonthOutput diff --git a/cime_config/testdefs/testmods_dirs/clm/GddGen/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/GddGen/user_nl_clm index f36ffd26b9..87cdd5d5b5 100644 --- a/cime_config/testdefs/testmods_dirs/clm/GddGen/user_nl_clm +++ b/cime_config/testdefs/testmods_dirs/clm/GddGen/user_nl_clm @@ -1,11 +1,11 @@ cropcals_rx = .true. -stream_meshfile_cropcal = '/glade/campaign/cesm/cesmdata/inputdata/share/meshes/10x15_nomask_c110308_ESMFmesh.nc' -stream_fldFileName_swindow_start = '/glade/campaign/cesm/cesmdata/inputdata/lnd/clm2/cropdata/calendars/processed/sdates_ggcmi_crop_calendar_phase3_v1.01_nninterp-f10_f10_mg37.2000-2000.20230330_165301.nc' -stream_fldFileName_swindow_end = '/glade/campaign/cesm/cesmdata/inputdata/lnd/clm2/cropdata/calendars/processed/sdates_ggcmi_crop_calendar_phase3_v1.01_nninterp-f10_f10_mg37.2000-2000.20230330_165301.nc' -stream_year_first_cropcal_swindows = 2000 -stream_year_last_cropcal_swindows = 2000 -model_year_align_cropcal_swindows = 2000 - stream_fldFileName_cultivar_gdds = '' generate_crop_gdds = .true. use_mxmat = .false. + +! (h3) Daily outputs for GDD generation and figure-making +hist_fincl4 = 'GDDACCUM', 'GDDHARV' +hist_nhtfrq(4) = -24 +hist_mfilt(4) = 365 +hist_type1d_pertape(4) = 'PFTS' +hist_dov2xy(4) = .false. diff --git a/cime_config/testdefs/testmods_dirs/clm/GddGenOnlyOutputs/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/GddGenOnlyOutputs/include_user_mods deleted file mode 100644 index 02ec13743f..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/GddGenOnlyOutputs/include_user_mods +++ /dev/null @@ -1 +0,0 @@ -../cropMonthOutput diff --git a/cime_config/testdefs/testmods_dirs/clm/GddGenOnlyOutputs/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/GddGenOnlyOutputs/user_nl_clm deleted file mode 100644 index 8fe842624d..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/GddGenOnlyOutputs/user_nl_clm +++ /dev/null @@ -1,14 +0,0 @@ -! (h1) Annual outputs on sowing or harvest axis -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 and figure-making -hist_fincl3 = 'GDDACCUM', 'GDDHARV' -hist_nhtfrq(3) = -24 -hist_mfilt(3) = 365 -hist_type1d_pertape(3) = 'PFTS' -hist_dov2xy(3) = .false. - diff --git a/cime_config/testdefs/testmods_dirs/clm/GddGenOnlyOutputsSurf/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/GddGenOnlyOutputsSurf/include_user_mods deleted file mode 100644 index 8c6e50384c..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/GddGenOnlyOutputsSurf/include_user_mods +++ /dev/null @@ -1 +0,0 @@ -../GddGenOnlyOutputs diff --git a/cime_config/testdefs/testmods_dirs/clm/GddGenOnlyOutputsSurf/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/GddGenOnlyOutputsSurf/user_nl_clm deleted file mode 100644 index 184043f013..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/GddGenOnlyOutputsSurf/user_nl_clm +++ /dev/null @@ -1,5 +0,0 @@ -fsurdat = '/glade/derecho/scratch/samrabin/tests_0618-093950de/RXCROPMATURITY_Lm61.f10_f10_mg37.IHistClm50BgcCrop.derecho_intel.clm-cropMonthOutput.0618-093950de.gddgen/surfdata_10x15_hist_1850_78pfts_c240216.all_crops_everywhere.nc' -do_transient_crops = .false. -flanduse_timeseries = '' -use_init_interp = .true. - diff --git a/cime_config/testdefs/testmods_dirs/clm/StreamGdd20Seasons/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/StreamGdd20Seasons/user_nl_clm index 7f140eb719..8b040d9d43 100644 --- a/cime_config/testdefs/testmods_dirs/clm/StreamGdd20Seasons/user_nl_clm +++ b/cime_config/testdefs/testmods_dirs/clm/StreamGdd20Seasons/user_nl_clm @@ -1,5 +1,2 @@ stream_gdd20_seasons = .true. allow_invalid_gdd20_season_inputs = .true. - -! Annual crop variables (including per-sowing/per-harvest axes), per PFT. -hist_fincl3 += 'GDD20_BASELINE', 'GDD20_SEASON_START', 'GDD20_SEASON_END' \ No newline at end of file diff --git a/cime_config/testdefs/testmods_dirs/clm/cropAnnOutputMonthly/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/cropAnnOutputMonthly/user_nl_clm new file mode 100644 index 0000000000..1c47a2ebd1 --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/cropAnnOutputMonthly/user_nl_clm @@ -0,0 +1,3 @@ +! These variables SHOULD only be saved annually in real runs, but for testing purposes it's fine to have them monthly. +! Modifies h2 history file defined in crop testmod. +hist_nhtfrq(3) = 0 From 501ba25c34e9f727442d77c0d3d43d7f2f7c9133 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Wed, 19 Jun 2024 13:19:18 -0600 Subject: [PATCH 0555/1248] Add tricky ERP test of RxCropCalsAdaptGGCMI. --- cime_config/testdefs/testlist_clm.xml | 10 ++++++++++ .../testmods_dirs/clm/RxCropCalsAdaptGGCMI/user_nl_clm | 1 + .../testmods_dirs/clm/midDecStart/include_user_mods | 1 + .../testmods_dirs/clm/midDecStart/shell_commands | 2 ++ 4 files changed, 14 insertions(+) create mode 100644 cime_config/testdefs/testmods_dirs/clm/midDecStart/include_user_mods create mode 100755 cime_config/testdefs/testmods_dirs/clm/midDecStart/shell_commands diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index 1a09ce4e80..40f351ab4a 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -3767,6 +3767,16 @@ + + + + + + + + + + diff --git a/cime_config/testdefs/testmods_dirs/clm/RxCropCalsAdaptGGCMI/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/RxCropCalsAdaptGGCMI/user_nl_clm index 42e57a675c..dd4ac3117c 100644 --- a/cime_config/testdefs/testmods_dirs/clm/RxCropCalsAdaptGGCMI/user_nl_clm +++ b/cime_config/testdefs/testmods_dirs/clm/RxCropCalsAdaptGGCMI/user_nl_clm @@ -1,4 +1,5 @@ stream_gdd20_seasons = .true. +flush_gdd20 = .true. !TODO SSR: Try without this once you have half-degree inputs allow_invalid_gdd20_season_inputs = .true. diff --git a/cime_config/testdefs/testmods_dirs/clm/midDecStart/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/midDecStart/include_user_mods new file mode 100644 index 0000000000..fe0e18cf88 --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/midDecStart/include_user_mods @@ -0,0 +1 @@ +../default diff --git a/cime_config/testdefs/testmods_dirs/clm/midDecStart/shell_commands b/cime_config/testdefs/testmods_dirs/clm/midDecStart/shell_commands new file mode 100755 index 0000000000..d044ab8c3b --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/midDecStart/shell_commands @@ -0,0 +1,2 @@ +./xmlchange RUN_STARTDATE=2001-12-15 +./xmlchange CLM_BLDNML_OPTS=-ignore_warnings --append From 8d754533f0bf796fd5ee365d4fd1eedaee53ab20 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Thu, 20 Jun 2024 13:03:36 -0600 Subject: [PATCH 0556/1248] TemperatureType: Save flush_gdd20 regardless of stream_gdd20_seasons. --- src/biogeophys/TemperatureType.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/biogeophys/TemperatureType.F90 b/src/biogeophys/TemperatureType.F90 index 4212bcdd0f..bb579b8031 100644 --- a/src/biogeophys/TemperatureType.F90 +++ b/src/biogeophys/TemperatureType.F90 @@ -1136,7 +1136,7 @@ subroutine Restart(this, bounds, ncid, flag, is_simple_buildtemp, is_prog_buildt end if end if - if (use_crop .and. stream_gdd20_seasons) then + if (use_crop) then if (flag == 'write') then if (this%flush_gdd20) then idata = 1 From 6810090b7258c2d4648204e3fe12d2c999cb55f7 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Thu, 20 Jun 2024 13:27:05 -0600 Subject: [PATCH 0557/1248] cropcal_interp: Ignore init when considering stream_gdd20_seasons. --- src/cpl/share_esmf/cropcalStreamMod.F90 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cpl/share_esmf/cropcalStreamMod.F90 b/src/cpl/share_esmf/cropcalStreamMod.F90 index ef406a7e60..4034f550d4 100644 --- a/src/cpl/share_esmf/cropcalStreamMod.F90 +++ b/src/cpl/share_esmf/cropcalStreamMod.F90 @@ -741,7 +741,7 @@ subroutine cropcal_interp(bounds, num_pcropp, filter_pcropp, init, crop_inst) dataptr2d_gdd20_season_start(:,:) = -1._r8 allocate(dataptr2d_gdd20_season_end (lsize, ncft)) dataptr2d_gdd20_season_end(:,:) = -1._r8 - if (stream_gdd20_seasons .and. init) then + if (stream_gdd20_seasons) then ! Starting with npcropmin will skip generic crops do n = 1, ncft call dshr_fldbun_getFldPtr(sdat_cropcal_gdd20_season_start%pstrm(1)%fldbun_model, trim(stream_varnames_sdate(n)), & @@ -815,7 +815,7 @@ subroutine cropcal_interp(bounds, num_pcropp, filter_pcropp, init, crop_inst) end if end if - end if ! stream_gdd20_seasons and init + end if ! stream_gdd20_seasons deallocate(dataptr2d_gdd20_season_start) deallocate(dataptr2d_gdd20_season_end) From 7f2a5c0192aa8f8b842e06259d46f8c095f2ee2b Mon Sep 17 00:00:00 2001 From: wwieder Date: Thu, 20 Jun 2024 14:25:27 -0600 Subject: [PATCH 0558/1248] addresses #2563 --- py_env_create | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py_env_create b/py_env_create index 9a9b8d940c..ac705edb3c 100755 --- a/py_env_create +++ b/py_env_create @@ -122,7 +122,7 @@ if [ "$verbose" == "Yes" ]; then verbosity="--verbose" loglevel="INFO" fi -cmd="conda install --yes $verbosity --channel conda-forge --name $ctsm_python $condadir/$condafile $option" +cmd="conda install --yes $verbosity --channel conda-forge --name $ctsm_python --file $condadir/$condafile $option" echo "$cmd" $cmd if [ $? != 0 ]; then From 23b62613040d3c926a134e7068406289a2edfeae Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Thu, 20 Jun 2024 15:36:43 -0600 Subject: [PATCH 0559/1248] Draft ChangeLog/ChangeSum --- doc/ChangeLog | 80 +++++++++++++++++++++++++++++++++++++++++++++++++++ doc/ChangeSum | 1 + 2 files changed, 81 insertions(+) diff --git a/doc/ChangeLog b/doc/ChangeLog index 8b6bb8f0d2..e83b64c564 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,4 +1,84 @@ =============================================================== +Tag name: tmp-240620.n01.ctsm5.2.007 +Originator(s): slevis (Samuel Levis,UCAR/TSS,303-665-1310) +Date: Thu 20 Jun 2024 03:00:43 PM MDT +One-line Summary: Merge b4b-dev + +Purpose and description of changes +---------------------------------- + + Fix long names #2512 + Dust emissions moved to Object Oriented design #2552 + Fix RXCROPMATURITY test #2599 + + NB: This is the first temporary tag (n01, see full tag name above) in + a series of temporary tags while we wait for the completion of the + beta01 cesm tag. + +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_1 + +[ ] clm5_0 + +[ ] ctsm5_0-nwp + +[ ] clm4_5 + +Bugs fixed +---------- +List of CTSM issues fixed (include CTSM Issue # and description) [one per line]: + Fixes #2512 + Fixes #2552 + Fixes #2599 + +Notes of particular relevance for developers: +--------------------------------------------- +Changes to tests or testing: + Fix RXCROPMATURITY test #2599 + +Testing summary: +---------------- + + [PASS means all tests PASS; OK means tests PASS other than expected fails.] + + build-namelist tests (if CLMBuildNamelist.pm has changed): + + derecho - PASS + + 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 ----- IN PROG + izumi ------- IN PROG + + any other testing (give details below): + + ctsm_sci + derecho ---- + +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/2604 + +=============================================================== +=============================================================== Tag name: ctsm5.2.007 Originator(s): jedwards4b (Jim Edwards, UCAR/CGD) slevis (Sam Levis, UCAR/CGD) Date: Fri 31 May 2024 13:49:29 AM MDT diff --git a/doc/ChangeSum b/doc/ChangeSum index b3f1632571..ace44b8037 100644 --- a/doc/ChangeSum +++ b/doc/ChangeSum @@ -1,5 +1,6 @@ Tag Who Date Summary ============================================================================================================================ +tmp-240620.n01.cts slevis 06/20/2024 Merge b4b-dev (full tag name is tmp-240620.n01.ctsm5.2.007) ctsm5.2.007 multiple 05/31/2024 Rm manage_externals and update documentation accordingly ctsm5.2.006 slevis 05/28/2024 Update externals to cesm2_3_beta17, remove mct, retire /test/tools ctsm5.2.005 erik 05/13/2024 Fix clm6_0 defaults and CESM testing issues, add tests to detect these problems From d3e68143a2ca5e52568965a666cd6c53be7d0434 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Thu, 20 Jun 2024 17:30:14 -0600 Subject: [PATCH 0560/1248] Temporary .gitmodules points to the branches of the modules that changed --- .gitmodules | 20 ++++++++++---------- ccs_config | 2 +- components/cism | 2 +- components/cmeps | 2 +- components/mosart | 2 +- components/rtm | 2 +- 6 files changed, 15 insertions(+), 15 deletions(-) diff --git a/.gitmodules b/.gitmodules index 699ad22969..e1df4e650c 100644 --- a/.gitmodules +++ b/.gitmodules @@ -7,22 +7,22 @@ fxDONOTUSEurl = https://github.com/NCAR/fates-release [submodule "cism"] path = components/cism -url = https://github.com/ESCOMP/CISM-wrapper -fxtag = cismwrap_2_2_001 +url = https://github.com/mvertens/CISM-wrapper +fxtag = 34339777afa7b810fd4822fce1039826668b33e4 fxrequired = ToplevelRequired fxDONOTUSEurl = https://github.com/ESCOMP/CISM-wrapper [submodule "rtm"] path = components/rtm -url = https://github.com/ESCOMP/RTM -fxtag = rtm1_0_79 +url = https://github.com/swensosc/RTM +fxtag = 420c5979d8abf05184992fdfba5ac41c41c91c2e fxrequired = ToplevelRequired fxDONOTUSEurl = https://github.com/ESCOMP/RTM [submodule "mosart"] path = components/mosart -url = https://github.com/ESCOMP/MOSART -fxtag = mosart1_0_49 +url = https://github.com/mvertens/MOSART +fxtag = 01f40dcf589d4e6c5932c76128e3d42faea91e9f fxrequired = ToplevelRequired fxDONOTUSEurl = https://github.com/ESCOMP/MOSART @@ -35,8 +35,8 @@ fxDONOTUSEurl = https://github.com/ESCOMP/mizuRoute [submodule "ccs_config"] path = ccs_config -url = https://github.com/ESMCI/ccs_config_cesm.git -fxtag = ccs_config_cesm0.0.106 +url = https://github.com/mvertens/ccs_config_cesm.git +fxtag = dbb02c0ccd1492fe278885f8a07a71fa80064319 fxrequired = ToplevelRequired fxDONOTUSEurl = https://github.com/ESMCI/ccs_config_cesm.git @@ -49,8 +49,8 @@ fxDONOTUSEurl = https://github.com/ESMCI/cime [submodule "cmeps"] path = components/cmeps -url = https://github.com/ESCOMP/CMEPS.git -fxtag = cmeps0.14.63 +url = https://github.com/mvertens/CMEPS.git +fxtag = 4dca7c602e54189b74b1d0195c433d1b83475553 fxrequired = ToplevelRequired fxDONOTUSEurl = https://github.com/ESCOMP/CMEPS.git diff --git a/ccs_config b/ccs_config index 2ff978f92a..dbb02c0ccd 160000 --- a/ccs_config +++ b/ccs_config @@ -1 +1 @@ -Subproject commit 2ff978f92a5ac9a6ab243e5c14d06a7e2d2f5799 +Subproject commit dbb02c0ccd1492fe278885f8a07a71fa80064319 diff --git a/components/cism b/components/cism index c05dd5c4fc..34339777af 160000 --- a/components/cism +++ b/components/cism @@ -1 +1 @@ -Subproject commit c05dd5c4fc85327e76523aaea9cfe1e388748928 +Subproject commit 34339777afa7b810fd4822fce1039826668b33e4 diff --git a/components/cmeps b/components/cmeps index 6384ff4e4a..4dca7c602e 160000 --- a/components/cmeps +++ b/components/cmeps @@ -1 +1 @@ -Subproject commit 6384ff4e4a6bc82a678f9419a43ffbd5d53ac209 +Subproject commit 4dca7c602e54189b74b1d0195c433d1b83475553 diff --git a/components/mosart b/components/mosart index 8c682b1b7f..01f40dcf58 160000 --- a/components/mosart +++ b/components/mosart @@ -1 +1 @@ -Subproject commit 8c682b1b7f15d146816de302e0d359da3e957056 +Subproject commit 01f40dcf589d4e6c5932c76128e3d42faea91e9f diff --git a/components/rtm b/components/rtm index 88503adbc2..420c5979d8 160000 --- a/components/rtm +++ b/components/rtm @@ -1 +1 @@ -Subproject commit 88503adbc275fb2ccbb6b598e460deaeb140e515 +Subproject commit 420c5979d8abf05184992fdfba5ac41c41c91c2e From 24845d2ad8e5f235053bebdcfb845fa0513d42c7 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Fri, 21 Jun 2024 08:59:56 -0600 Subject: [PATCH 0561/1248] cropcal_interp: Ignore init when considering adapt_cropcal_rx_cultivar_gdds. --- src/cpl/share_esmf/cropcalStreamMod.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cpl/share_esmf/cropcalStreamMod.F90 b/src/cpl/share_esmf/cropcalStreamMod.F90 index 4034f550d4..ef3bab03c5 100644 --- a/src/cpl/share_esmf/cropcalStreamMod.F90 +++ b/src/cpl/share_esmf/cropcalStreamMod.F90 @@ -685,7 +685,7 @@ subroutine cropcal_interp(bounds, num_pcropp, filter_pcropp, init, crop_inst) deallocate(dataptr2d_cultivar_gdds) allocate(dataptr2d_gdd20_baseline(lsize, ncft)) - if (adapt_cropcal_rx_cultivar_gdds .and. init) then + if (adapt_cropcal_rx_cultivar_gdds) then ! Read GDD20 baselines from input files ! Starting with npcropmin will skip generic crops do n = 1, ncft From a8f1daa14affaca9ddb21b51fe4cd49f6f1e8771 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Fri, 21 Jun 2024 09:20:45 -0600 Subject: [PATCH 0562/1248] Add header with notes on variables (copied from the CESM header) --- .gitmodules | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/.gitmodules b/.gitmodules index 699ad22969..8a173f0ddd 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,30 @@ +# This is a git submodule file with additional support for +# git-fleximod (https://github.com/ESMCI/git-fleximod) +# +# The additional flags supported by git-fleximod are +# fxtag - the tag associated with the submodule, this tag can be tested for +# consistancy with the submodule hash using git-fleximod status +# the hash can be updated to the tag using git-fleximod update +# +# fxrequired - indicates if a given submodule should be checked out on install +# submoudules can be toplevel or internal and required or optional +# toplevel means that the submodule should only be checked out if the +# module is the toplevel of the git repo (is not a submodule itself) +# internal means that the submodule is needed by the component whether +# the component is toplevel or the submodule of another repo +# required means that the submodule should always be checked out +# optional means that the submodule should only be checked out if the +# optional flag is provided to git-fleximod or the submodule name is +# explicitly listed on the git-fleximod command line. +# +# fxsparse - this is a path to a git sparse checkout file indicating that the +# submodule should be checked out in sparse mode +# +# fxDONOTUSEurl - this field is used by git-fleximod test to insure that the url is pointing +# to the official url of the repo and not to an unofficial fork. +# It is intended for use of github workflows to test commits to protected +# repository branches. +# [submodule "fates"] path = src/fates url = https://github.com/NGEET/fates From 5b49d91ace8161c2a2c14b85b73dac994b1b6413 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Fri, 21 Jun 2024 09:41:46 -0600 Subject: [PATCH 0563/1248] Forgot to commit RxCropCalsAdaptFlush testmod. --- .../testmods_dirs/clm/RxCropCalsAdaptFlush/include_user_mods | 1 + .../testdefs/testmods_dirs/clm/RxCropCalsAdaptFlush/user_nl_clm | 2 ++ 2 files changed, 3 insertions(+) create mode 100644 cime_config/testdefs/testmods_dirs/clm/RxCropCalsAdaptFlush/include_user_mods create mode 100644 cime_config/testdefs/testmods_dirs/clm/RxCropCalsAdaptFlush/user_nl_clm diff --git a/cime_config/testdefs/testmods_dirs/clm/RxCropCalsAdaptFlush/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/RxCropCalsAdaptFlush/include_user_mods new file mode 100644 index 0000000000..af5fe8591e --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/RxCropCalsAdaptFlush/include_user_mods @@ -0,0 +1 @@ +../RxCropCalsAdapt diff --git a/cime_config/testdefs/testmods_dirs/clm/RxCropCalsAdaptFlush/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/RxCropCalsAdaptFlush/user_nl_clm new file mode 100644 index 0000000000..4c6af0f6d2 --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/RxCropCalsAdaptFlush/user_nl_clm @@ -0,0 +1,2 @@ + +flush_gdd20 = .true. From f7b9b29d686d88abef3e3b29a561598ae9a80da7 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Fri, 21 Jun 2024 09:46:49 -0600 Subject: [PATCH 0564/1248] Update ChangeLog/ChangeSum --- doc/ChangeLog | 6 +++--- doc/ChangeSum | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index e83b64c564..e6e9215397 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,7 +1,7 @@ =============================================================== Tag name: tmp-240620.n01.ctsm5.2.007 Originator(s): slevis (Samuel Levis,UCAR/TSS,303-665-1310) -Date: Thu 20 Jun 2024 03:00:43 PM MDT +Date: Fri 21 Jun 2024 09:42:26 AM MDT One-line Summary: Merge b4b-dev Purpose and description of changes @@ -60,8 +60,8 @@ Testing summary: regular tests (aux_clm: https://github.com/ESCOMP/CTSM/wiki/System-Testing-Guide#pre-merge-system-testing): - derecho ----- IN PROG - izumi ------- IN PROG + derecho ----- OK + izumi ------- OK any other testing (give details below): diff --git a/doc/ChangeSum b/doc/ChangeSum index ace44b8037..a612b7d2d1 100644 --- a/doc/ChangeSum +++ b/doc/ChangeSum @@ -1,6 +1,6 @@ Tag Who Date Summary ============================================================================================================================ -tmp-240620.n01.cts slevis 06/20/2024 Merge b4b-dev (full tag name is tmp-240620.n01.ctsm5.2.007) +tmp-240620.n01.cts slevis 06/21/2024 Merge b4b-dev (full tag name is tmp-240620.n01.ctsm5.2.007) ctsm5.2.007 multiple 05/31/2024 Rm manage_externals and update documentation accordingly ctsm5.2.006 slevis 05/28/2024 Update externals to cesm2_3_beta17, remove mct, retire /test/tools ctsm5.2.005 erik 05/13/2024 Fix clm6_0 defaults and CESM testing issues, add tests to detect these problems From 64f1229cebd936536967a9522af703079379d7e3 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Fri, 21 Jun 2024 13:56:04 -0600 Subject: [PATCH 0565/1248] Add note about each fxDONOTUSEurl line --- .gitmodules | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.gitmodules b/.gitmodules index 8a173f0ddd..e437f56d61 100644 --- a/.gitmodules +++ b/.gitmodules @@ -30,6 +30,7 @@ path = src/fates url = https://github.com/NGEET/fates fxtag = sci.1.73.0_api.35.0.0 fxrequired = AlwaysRequired +# Standard Fork to compare to with "git fleximod test" to ensure personal forks aren't committed fxDONOTUSEurl = https://github.com/NCAR/fates-release [submodule "cism"] @@ -37,6 +38,7 @@ path = components/cism url = https://github.com/ESCOMP/CISM-wrapper fxtag = cismwrap_2_2_001 fxrequired = ToplevelRequired +# Standard Fork to compare to with "git fleximod test" to ensure personal forks aren't committed fxDONOTUSEurl = https://github.com/ESCOMP/CISM-wrapper [submodule "rtm"] @@ -44,6 +46,7 @@ path = components/rtm url = https://github.com/ESCOMP/RTM fxtag = rtm1_0_79 fxrequired = ToplevelRequired +# Standard Fork to compare to with "git fleximod test" to ensure personal forks aren't committed fxDONOTUSEurl = https://github.com/ESCOMP/RTM [submodule "mosart"] @@ -51,6 +54,7 @@ path = components/mosart url = https://github.com/ESCOMP/MOSART fxtag = mosart1_0_49 fxrequired = ToplevelRequired +# Standard Fork to compare to with "git fleximod test" to ensure personal forks aren't committed fxDONOTUSEurl = https://github.com/ESCOMP/MOSART [submodule "mizuRoute"] @@ -58,6 +62,7 @@ path = components/mizuRoute url = https://github.com/ESCOMP/mizuRoute fxtag = cesm-coupling.n02_v2.1.2 fxrequired = ToplevelRequired +# Standard Fork to compare to with "git fleximod test" to ensure personal forks aren't committed fxDONOTUSEurl = https://github.com/ESCOMP/mizuRoute [submodule "ccs_config"] @@ -65,6 +70,7 @@ path = ccs_config url = https://github.com/ESMCI/ccs_config_cesm.git fxtag = ccs_config_cesm0.0.106 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 [submodule "cime"] @@ -72,6 +78,7 @@ path = cime url = https://github.com/ESMCI/cime fxtag = cime6.0.246 fxrequired = ToplevelRequired +# Standard Fork to compare to with "git fleximod test" to ensure personal forks aren't committed fxDONOTUSEurl = https://github.com/ESMCI/cime [submodule "cmeps"] @@ -79,6 +86,7 @@ path = components/cmeps url = https://github.com/ESCOMP/CMEPS.git fxtag = cmeps0.14.63 fxrequired = ToplevelRequired +# Standard Fork to compare to with "git fleximod test" to ensure personal forks aren't committed fxDONOTUSEurl = https://github.com/ESCOMP/CMEPS.git [submodule "cdeps"] @@ -86,6 +94,7 @@ path = components/cdeps url = https://github.com/ESCOMP/CDEPS.git fxtag = cdeps1.0.34 fxrequired = ToplevelRequired +# Standard Fork to compare to with "git fleximod test" to ensure personal forks aren't committed fxDONOTUSEurl = https://github.com/ESCOMP/CDEPS.git [submodule "share"] @@ -93,6 +102,7 @@ path = share url = https://github.com/ESCOMP/CESM_share fxtag = share1.0.19 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 [submodule "mct"] @@ -100,6 +110,7 @@ path = libraries/mct url = https://github.com/MCSclimate/MCT fxtag = MCT_2.11.0 fxrequired = ToplevelRequired +# Standard Fork to compare to with "git fleximod test" to ensure personal forks aren't committed fxDONOTUSEurl = https://github.com/MCSclimate/MCT [submodule "parallelio"] @@ -107,6 +118,7 @@ path = libraries/parallelio url = https://github.com/NCAR/ParallelIO fxtag = pio2_6_2 fxrequired = ToplevelRequired +# Standard Fork to compare to with "git fleximod test" to ensure personal forks aren't committed fxDONOTUSEurl = https://github.com/NCAR/ParallelIO [submodule "doc-builder"] @@ -114,4 +126,5 @@ path = doc/doc-builder url = https://github.com/ESMCI/doc-builder fxtag = v1.0.8 fxrequired = ToplevelOptional +# Standard Fork to compare to with "git fleximod test" to ensure personal forks aren't committed fxDONOTUSEurl = https://github.com/ESMCI/doc-builder From 540d87fcc791c68ecac02eb786ca58a2e6874b9c Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Fri, 21 Jun 2024 16:34:58 -0600 Subject: [PATCH 0566/1248] Update .gitmodules with latest mosart commit --- .gitmodules | 2 +- components/mosart | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitmodules b/.gitmodules index e1df4e650c..3d3cb88e80 100644 --- a/.gitmodules +++ b/.gitmodules @@ -22,7 +22,7 @@ fxDONOTUSEurl = https://github.com/ESCOMP/RTM [submodule "mosart"] path = components/mosart url = https://github.com/mvertens/MOSART -fxtag = 01f40dcf589d4e6c5932c76128e3d42faea91e9f +fxtag = ca0acc0336365456bec653c4c233abb57d9bc62d fxrequired = ToplevelRequired fxDONOTUSEurl = https://github.com/ESCOMP/MOSART diff --git a/components/mosart b/components/mosart index 01f40dcf58..ca0acc0336 160000 --- a/components/mosart +++ b/components/mosart @@ -1 +1 @@ -Subproject commit 01f40dcf589d4e6c5932c76128e3d42faea91e9f +Subproject commit ca0acc0336365456bec653c4c233abb57d9bc62d From 596dc135a49918c225ce726122874ed55611ad87 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Fri, 21 Jun 2024 17:52:16 -0600 Subject: [PATCH 0567/1248] Update .gitmodules with new mosart and rtm tags --- .gitmodules | 8 ++++---- components/mosart | 2 +- components/rtm | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.gitmodules b/.gitmodules index 3d3cb88e80..6d4298befc 100644 --- a/.gitmodules +++ b/.gitmodules @@ -14,15 +14,15 @@ fxDONOTUSEurl = https://github.com/ESCOMP/CISM-wrapper [submodule "rtm"] path = components/rtm -url = https://github.com/swensosc/RTM -fxtag = 420c5979d8abf05184992fdfba5ac41c41c91c2e +url = https://github.com/ESCOMP/RTM +fxtag = rtm1_0_80 fxrequired = ToplevelRequired fxDONOTUSEurl = https://github.com/ESCOMP/RTM [submodule "mosart"] path = components/mosart -url = https://github.com/mvertens/MOSART -fxtag = ca0acc0336365456bec653c4c233abb57d9bc62d +url = https://github.com/ESCOMP/MOSART +fxtag = mosart1.1.02 fxrequired = ToplevelRequired fxDONOTUSEurl = https://github.com/ESCOMP/MOSART diff --git a/components/mosart b/components/mosart index ca0acc0336..e2ffe00004 160000 --- a/components/mosart +++ b/components/mosart @@ -1 +1 @@ -Subproject commit ca0acc0336365456bec653c4c233abb57d9bc62d +Subproject commit e2ffe00004cc416cfc8bcfae2a949474075c1d1f diff --git a/components/rtm b/components/rtm index 420c5979d8..b3dfcfbba5 160000 --- a/components/rtm +++ b/components/rtm @@ -1 +1 @@ -Subproject commit 420c5979d8abf05184992fdfba5ac41c41c91c2e +Subproject commit b3dfcfbba58c151ac5a6ab513b3515ef3deff798 From c2e471833dfbbb95bac1e3bf31ddf5de8d16e5f1 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Fri, 21 Jun 2024 22:23:47 -0600 Subject: [PATCH 0568/1248] Update change files --- doc/ChangeLog | 4 +--- doc/ChangeSum | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index 4da6b9379f..c4e7ca469e 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,7 +1,7 @@ =============================================================== Tag name: tmp-240620.n02.ctsm5.2.007 Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326) -Date: Thu 13 Jun 2024 01:13:24 PM MDT +Date: Fri 21 Jun 2024 10:21:01 PM MDT One-line Summary: Another update of git-fleximod Purpose and description of changes @@ -47,8 +47,6 @@ Changes to documentation: Notes of particular relevance for developers: --------------------------------------------- -NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide -[Remove any lines that don't apply. Remove entire section if nothing applies.] Testing summary: regular diff --git a/doc/ChangeSum b/doc/ChangeSum index 029f88fe7e..0bffb18cf4 100644 --- a/doc/ChangeSum +++ b/doc/ChangeSum @@ -1,6 +1,6 @@ Tag Who Date Summary ============================================================================================================================ -tmp-240620.n02.ctsm5.2.007 erik 06/13/2024 Another update of git-fleximod +tmp-240620.n02.ctsm5.2.007 erik 06/21/2024 Another update of git-fleximod tmp-240620.n01.ctsm5.2.007 slevis 06/21/2024 Merge b4b-dev (full tag name is tmp-240620.n01.ctsm5.2.007) ctsm5.2.007 multiple 05/31/2024 Rm manage_externals and update documentation accordingly ctsm5.2.006 slevis 05/28/2024 Update externals to cesm2_3_beta17, remove mct, retire /test/tools From 5f5c10a30cb78b6d5b8a8c80d545ca5c980303de Mon Sep 17 00:00:00 2001 From: Keith Oleson Date: Mon, 24 Jun 2024 10:35:14 -0600 Subject: [PATCH 0569/1248] Turn off explicit ac for clm6_0 and clm5_1 --- 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 4b8b7d3571..d0a45c5727 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -147,8 +147,8 @@ attributes from the config_cache.xml file (with keys converted to upper-case). NONE -.true. -.true. +.false. +.false. .false. .false. From 917baf78154a9c3116bb3b93b8ca0399d5049734 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Mon, 24 Jun 2024 15:54:14 -0600 Subject: [PATCH 0570/1248] Add OBU to the restart file since it's needed by Leung-2024 dust emissions --- src/biogeophys/FrictionVelocityMod.F90 | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/biogeophys/FrictionVelocityMod.F90 b/src/biogeophys/FrictionVelocityMod.F90 index 92d960a7b3..584c490f4a 100644 --- a/src/biogeophys/FrictionVelocityMod.F90 +++ b/src/biogeophys/FrictionVelocityMod.F90 @@ -437,6 +437,11 @@ subroutine Restart(this, bounds, ncid, flag) long_name='ground momentum roughness length', units='m', & interpinic_flag='interp', readvar=readvar, data=this%z0mg_col) + call restartvar(ncid=ncid, flag=flag, varname='OBU', xtype=ncd_double, & + dim1name='pft', & + long_name='Monin-Obukhov length', units='m', & + interpinic_flag='interp', readvar=readvar, data=this%obu_patch) + if(use_luna)then call restartvar(ncid=ncid, flag=flag, varname='rb10', xtype=ncd_double, & dim1name='pft', long_name='10-day mean boundary layer resistance at the pacth', units='s/m', & From 463fac1241827d975948a418dc6a9c90ee34fbc0 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Mon, 24 Jun 2024 17:32:47 -0600 Subject: [PATCH 0571/1248] Minor comment updates --- bld/CLMBuildNamelist.pm | 4 ++-- bld/unit_testers/build-namelist_test.pl | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index 44aa07ee28..d0d9328218 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -4678,14 +4678,14 @@ sub setup_logic_cnmatrix { if ( &value_is_true($nl->get_value("use_matrixcn")) && &value_is_true($nl_flags->{"for_testing_use_repr_structure_pool"}) ) { $log->fatal_error("for_testing_use_repr_structure_pool can NOT be on when use_matrixcn is on" ); } - # If both matrixcn and soil_matrix are off outmatrix can't be on + # If both matrixcn and soil_matrix are off hist_wrt_matrixcn_diag can't be on if ( ! &value_is_true($nl->get_value("use_matrixcn")) && ! &value_is_true($nl_flags->{"use_soil_matrixcn"}) ) { my $var = "hist_wrt_matrixcn_diag"; if ( &value_is_true($nl->get_value($var)) ) { $log->fatal_error("$var can NOT be on when both use_matrixcn and use_soil_matrixcn are off" ); } } - # If soil_matrix is off ispspinup can't be on + # If soil_matrix is off spinup_matrixcn can't be on if ( ! &value_is_true($nl_flags->{"use_soil_matrixcn"}) ) { my $var = "spinup_matrixcn"; if ( &value_is_true($nl->get_value($var)) ) { diff --git a/bld/unit_testers/build-namelist_test.pl b/bld/unit_testers/build-namelist_test.pl index 28a2392736..9b83f9e7ec 100755 --- a/bld/unit_testers/build-namelist_test.pl +++ b/bld/unit_testers/build-namelist_test.pl @@ -942,12 +942,12 @@ sub cat_and_create_namelistinfile { GLC_TWO_WAY_COUPLING=>"TRUE", phys=>"clm5_0", }, - "outmatrixWOmatrix" =>{ options=>"-envxml_dir . -bgc bgc", + "matrixcn_diagWOmatrix" =>{ options=>"-envxml_dir . -bgc bgc", namelst=>"use_soil_matrixcn=.false.,use_matrixcn=F,hist_wrt_matrixcn_diag=T", GLC_TWO_WAY_COUPLING=>"TRUE", phys=>"clm5_0", }, - "spinupWOsoilmatrix" =>{ options=>"-envxml_dir . -bgc bgc", + "spinupWOsoilmatrix" =>{ options=>"-envxml_dir . -bgc bgc", namelst=>"use_soil_matrixcn=F,use_matrixcn=T,spinup_matrixcn=T", GLC_TWO_WAY_COUPLING=>"TRUE", phys=>"clm5_0", From 47234a9d429e29612599bcf0590e647b895c28d2 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Mon, 24 Jun 2024 18:06:30 -0600 Subject: [PATCH 0572/1248] Add overridable warning that cnmatrix may fail in transient mode --- bld/CLMBuildNamelist.pm | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index d0d9328218..ffe1c4e522 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -4650,6 +4650,16 @@ sub setup_logic_cnmatrix { , 'spinup_matrixcn'=>$nl_flags->{'spinup_matrixcn'}, 'clm_accelerated_spinup'=>$nl_flags->{'clm_accelerated_spinup'} ); } @matrixlist = ( "use_matrixcn", "use_soil_matrixcn", "hist_wrt_matrixcn_diag", "spinup_matrixcn" ); + # Matrix items can't be on for transient + $nl_flags->{'flanduse_timeseries'} = "null"; + my $flanduse_timeseries = $nl->get_value('flanduse_timeseries'); + if ( $flanduse_timeseries ne "null" ) { + foreach my $var ( @matrixlist ) { + if ( &value_is_true($nl->get_value($var)) ) { + $log->warning("$var may FAIL with balance error in transient mode" ); + } + } + } # Matrix items can't be on for SP mode if ( $nl_flags->{'bgc_mode'} eq "sp" ) { foreach my $var ( @matrixlist ) { From 4f702c33657ace2b931a0f33559a2ab676fd4bd4 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Tue, 25 Jun 2024 11:51:39 -0600 Subject: [PATCH 0573/1248] Add ERP test of RxCropCalsAdaptGGCMI to expected failure list. --- 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 03eb6a157d..0fac518374 100644 --- a/cime_config/testdefs/ExpectedTestFails.xml +++ b/cime_config/testdefs/ExpectedTestFails.xml @@ -170,6 +170,13 @@ + + + FAIL + #2593 + + + From 18e63e354e604d43c6dd0bca4a43abef3f4480ee Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Tue, 25 Jun 2024 12:02:01 -0600 Subject: [PATCH 0574/1248] Abort if matrixcn is .true. and nrepr is not 1 --- src/biogeochem/CropReprPoolsMod.F90 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/biogeochem/CropReprPoolsMod.F90 b/src/biogeochem/CropReprPoolsMod.F90 index dcbb4e4fd9..695af9f00e 100644 --- a/src/biogeochem/CropReprPoolsMod.F90 +++ b/src/biogeochem/CropReprPoolsMod.F90 @@ -98,6 +98,10 @@ subroutine crop_repr_pools_init() end if nrepr = nrepr_grain + nrepr_structure + ! matrixcn works with nrepr = 1 only + if (use_matrixcn .and. nrepr != 1) then + call endrun(msg="ERROR: nrepr should be 1 when use_matrixcn = .true."//errMsg(sourcefile, __LINE__)) + end if allocate(repr_hist_fnames(nrepr)) allocate(repr_rest_fnames(nrepr)) allocate(repr_longnames(nrepr)) From d13508bef6c0b31e8569daa758c44c379f9309b8 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Tue, 25 Jun 2024 12:05:45 -0600 Subject: [PATCH 0575/1248] run_sys_tests: Check Python env for RXCROPMATURITY. --- python/ctsm/run_sys_tests.py | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/python/ctsm/run_sys_tests.py b/python/ctsm/run_sys_tests.py index de93081504..9961fd325d 100644 --- a/python/ctsm/run_sys_tests.py +++ b/python/ctsm/run_sys_tests.py @@ -736,13 +736,29 @@ def _check_py_env(test_attributes): # whether import is possible. # pylint: disable=import-error disable - # Check requirements for FSURDATMODIFYCTSM, if needed - if any("FSURDATMODIFYCTSM" in t for t in test_attributes): + # Check requirements for using modify_fsurdat, if needed + modify_fsurdat_users = ["FSURDATMODIFYCTSM", "RXCROPMATURITY"] + if any(any(u in t for u in modify_fsurdat_users) for t in test_attributes): try: import ctsm.modify_input_files.modify_fsurdat except ModuleNotFoundError as err: raise ModuleNotFoundError("modify_fsurdat" + err_msg) from err + # Check requirements for RXCROPMATURITY, if needed + if any("RXCROPMATURITY" in t for t in test_attributes): + try: + import ctsm.crop_calendars.check_rxboth_run + except ModuleNotFoundError as err: + raise ModuleNotFoundError("check_rxboth_run" + err_msg) from err + try: + import ctsm.crop_calendars.generate_gdds + except ModuleNotFoundError as err: + raise ModuleNotFoundError("generate_gdds" + err_msg) from err + try: + import ctsm.crop_calendars.interpolate_gdds + except ModuleNotFoundError as err: + raise ModuleNotFoundError("interpolate_gdds" + err_msg) from err + # Check that list for any testmods that use modify_fates_paramfile.py testmods_to_check = ["clm-FatesColdTwoStream", "clm-FatesColdTwoStreamNoCompFixedBioGeo"] testmods = _get_testmod_list(test_attributes) From 422f06f7389094b32baa763628865a53467d0830 Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Tue, 25 Jun 2024 13:33:42 -0700 Subject: [PATCH 0576/1248] add fates potential vegetation spin up to transient test mod --- 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 85824a4404..0706a1ef53 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -2615,6 +2615,15 @@ + + + + + + + + + From f9d8349021458c56912edf626a0c8e229e4f58da Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Tue, 25 Jun 2024 13:53:01 -0700 Subject: [PATCH 0577/1248] rename fates luh2 harvest modes --- .../include_user_mods | 0 .../{FatesColdLUH2Mode3 => FatesColdLUH2HarvestArea}/user_nl_clm | 0 .../include_user_mods | 0 .../{FatesColdLUH2Mode1 => FatesColdLUH2HarvestEvent}/user_nl_clm | 0 .../include_user_mods | 0 .../{FatesColdLUH2Mode4 => FatesColdLUH2HarvestMass}/user_nl_clm | 0 .../include_user_mods | 0 .../{FatesColdLUH2Mode2 => FatesColdLUH2HarvestSurf}/user_nl_clm | 0 .../include_user_mods | 0 .../{FatesColdLUH2Mode0 => FatesColdLUH2NoHarvest}/user_nl_clm | 0 10 files changed, 0 insertions(+), 0 deletions(-) rename cime_config/testdefs/testmods_dirs/clm/{FatesColdLUH2Mode0 => FatesColdLUH2HarvestArea}/include_user_mods (100%) rename cime_config/testdefs/testmods_dirs/clm/{FatesColdLUH2Mode3 => FatesColdLUH2HarvestArea}/user_nl_clm (100%) rename cime_config/testdefs/testmods_dirs/clm/{FatesColdLUH2Mode1 => FatesColdLUH2HarvestEvent}/include_user_mods (100%) rename cime_config/testdefs/testmods_dirs/clm/{FatesColdLUH2Mode1 => FatesColdLUH2HarvestEvent}/user_nl_clm (100%) rename cime_config/testdefs/testmods_dirs/clm/{FatesColdLUH2Mode2 => FatesColdLUH2HarvestMass}/include_user_mods (100%) rename cime_config/testdefs/testmods_dirs/clm/{FatesColdLUH2Mode4 => FatesColdLUH2HarvestMass}/user_nl_clm (100%) rename cime_config/testdefs/testmods_dirs/clm/{FatesColdLUH2Mode3 => FatesColdLUH2HarvestSurf}/include_user_mods (100%) rename cime_config/testdefs/testmods_dirs/clm/{FatesColdLUH2Mode2 => FatesColdLUH2HarvestSurf}/user_nl_clm (100%) rename cime_config/testdefs/testmods_dirs/clm/{FatesColdLUH2Mode4 => FatesColdLUH2NoHarvest}/include_user_mods (100%) rename cime_config/testdefs/testmods_dirs/clm/{FatesColdLUH2Mode0 => FatesColdLUH2NoHarvest}/user_nl_clm (100%) diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2Mode0/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2HarvestArea/include_user_mods similarity index 100% rename from cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2Mode0/include_user_mods rename to cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2HarvestArea/include_user_mods diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2Mode3/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2HarvestArea/user_nl_clm similarity index 100% rename from cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2Mode3/user_nl_clm rename to cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2HarvestArea/user_nl_clm diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2Mode1/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2HarvestEvent/include_user_mods similarity index 100% rename from cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2Mode1/include_user_mods rename to cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2HarvestEvent/include_user_mods diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2Mode1/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2HarvestEvent/user_nl_clm similarity index 100% rename from cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2Mode1/user_nl_clm rename to cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2HarvestEvent/user_nl_clm diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2Mode2/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2HarvestMass/include_user_mods similarity index 100% rename from cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2Mode2/include_user_mods rename to cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2HarvestMass/include_user_mods diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2Mode4/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2HarvestMass/user_nl_clm similarity index 100% rename from cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2Mode4/user_nl_clm rename to cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2HarvestMass/user_nl_clm diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2Mode3/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2HarvestSurf/include_user_mods similarity index 100% rename from cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2Mode3/include_user_mods rename to cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2HarvestSurf/include_user_mods diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2Mode2/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2HarvestSurf/user_nl_clm similarity index 100% rename from cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2Mode2/user_nl_clm rename to cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2HarvestSurf/user_nl_clm diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2Mode4/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2NoHarvest/include_user_mods similarity index 100% rename from cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2Mode4/include_user_mods rename to cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2NoHarvest/include_user_mods diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2Mode0/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2NoHarvest/user_nl_clm similarity index 100% rename from cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2Mode0/user_nl_clm rename to cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2NoHarvest/user_nl_clm From f8330c9a7fba12652562efbc87a56f0de358b669 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Tue, 25 Jun 2024 17:16:45 -0600 Subject: [PATCH 0578/1248] Correct earlier commit 47234a9: warning about cnmatrix and transient --- bld/CLMBuildNamelist.pm | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index ffe1c4e522..329030d985 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -4651,9 +4651,7 @@ sub setup_logic_cnmatrix { } @matrixlist = ( "use_matrixcn", "use_soil_matrixcn", "hist_wrt_matrixcn_diag", "spinup_matrixcn" ); # Matrix items can't be on for transient - $nl_flags->{'flanduse_timeseries'} = "null"; - my $flanduse_timeseries = $nl->get_value('flanduse_timeseries'); - if ( $flanduse_timeseries ne "null" ) { + if (not string_is_undef_or_empty($nl->get_value('flanduse_timeseries'))) { foreach my $var ( @matrixlist ) { if ( &value_is_true($nl->get_value($var)) ) { $log->warning("$var may FAIL with balance error in transient mode" ); From 17143eea0e9c447eca85bde97b7f1dda7c2b1ffe Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Tue, 25 Jun 2024 17:24:15 -0600 Subject: [PATCH 0579/1248] Correct earlier commit 18e63e3: abort if matrixcn and nrepr not 1 --- src/biogeochem/CropReprPoolsMod.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/biogeochem/CropReprPoolsMod.F90 b/src/biogeochem/CropReprPoolsMod.F90 index 695af9f00e..cbc2f3e2a2 100644 --- a/src/biogeochem/CropReprPoolsMod.F90 +++ b/src/biogeochem/CropReprPoolsMod.F90 @@ -99,7 +99,7 @@ subroutine crop_repr_pools_init() nrepr = nrepr_grain + nrepr_structure ! matrixcn works with nrepr = 1 only - if (use_matrixcn .and. nrepr != 1) then + if (use_matrixcn .and. nrepr /= 1) then call endrun(msg="ERROR: nrepr should be 1 when use_matrixcn = .true."//errMsg(sourcefile, __LINE__)) end if allocate(repr_hist_fnames(nrepr)) From 4b18e79ae14e8c56c51b718aad722ce679b37972 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Tue, 25 Jun 2024 17:29:56 -0600 Subject: [PATCH 0580/1248] Replace clm45_monthly_matrixcn_soilCN30 testmod and test with clm60 --- .../clm/clm45_monthly_matrixcn_soilCN30/user_nl_clm | 2 -- .../include_user_mods | 0 .../clm/clm60_monthly_matrixcn_soilCN30/user_nl_clm | 4 ++++ 3 files changed, 4 insertions(+), 2 deletions(-) delete mode 100644 cime_config/testdefs/testmods_dirs/clm/clm45_monthly_matrixcn_soilCN30/user_nl_clm rename cime_config/testdefs/testmods_dirs/clm/{clm45_monthly_matrixcn_soilCN30 => clm60_monthly_matrixcn_soilCN30}/include_user_mods (100%) create mode 100644 cime_config/testdefs/testmods_dirs/clm/clm60_monthly_matrixcn_soilCN30/user_nl_clm diff --git a/cime_config/testdefs/testmods_dirs/clm/clm45_monthly_matrixcn_soilCN30/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/clm45_monthly_matrixcn_soilCN30/user_nl_clm deleted file mode 100644 index c7436f5acb..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/clm45_monthly_matrixcn_soilCN30/user_nl_clm +++ /dev/null @@ -1,2 +0,0 @@ - use_soil_matrixcn = .true. - paramfile = '$DIN_LOC_ROOT/lnd/clm2/paramdata/clm45_params.soilCN30.c220321.nc' diff --git a/cime_config/testdefs/testmods_dirs/clm/clm45_monthly_matrixcn_soilCN30/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/clm60_monthly_matrixcn_soilCN30/include_user_mods similarity index 100% rename from cime_config/testdefs/testmods_dirs/clm/clm45_monthly_matrixcn_soilCN30/include_user_mods rename to cime_config/testdefs/testmods_dirs/clm/clm60_monthly_matrixcn_soilCN30/include_user_mods diff --git a/cime_config/testdefs/testmods_dirs/clm/clm60_monthly_matrixcn_soilCN30/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/clm60_monthly_matrixcn_soilCN30/user_nl_clm new file mode 100644 index 0000000000..d22154bef6 --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/clm60_monthly_matrixcn_soilCN30/user_nl_clm @@ -0,0 +1,4 @@ +use_soil_matrixcn = .true. +paramfile = '/glade/u/home/slevis/paramfiles/ctsm60_params_cn30.c240625.nc' +! If we keep this paramfile, it should move to the repository +! paramfile = '$DIN_LOC_ROOT/lnd/clm2/paramdata/ctsm60_params_cn30.c240625.nc' From 1761a7becb50cad2849db794243b1f2d37e602c3 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Tue, 25 Jun 2024 17:34:50 -0600 Subject: [PATCH 0581/1248] Move new param file to inputdata and rimport --- .../clm/clm60_monthly_matrixcn_soilCN30/user_nl_clm | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/cime_config/testdefs/testmods_dirs/clm/clm60_monthly_matrixcn_soilCN30/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/clm60_monthly_matrixcn_soilCN30/user_nl_clm index d22154bef6..df20ced9e8 100644 --- a/cime_config/testdefs/testmods_dirs/clm/clm60_monthly_matrixcn_soilCN30/user_nl_clm +++ b/cime_config/testdefs/testmods_dirs/clm/clm60_monthly_matrixcn_soilCN30/user_nl_clm @@ -1,4 +1,2 @@ use_soil_matrixcn = .true. -paramfile = '/glade/u/home/slevis/paramfiles/ctsm60_params_cn30.c240625.nc' -! If we keep this paramfile, it should move to the repository -! paramfile = '$DIN_LOC_ROOT/lnd/clm2/paramdata/ctsm60_params_cn30.c240625.nc' +paramfile = '$DIN_LOC_ROOT/lnd/clm2/paramdata/ctsm60_params_cn30.c240625.nc' From 1e97001d0dc5e7359d8fb3b11c37118e3e429fe3 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Tue, 25 Jun 2024 17:59:00 -0600 Subject: [PATCH 0582/1248] Change use_matrixcn, use_soil_matrixcn to default .false. before merge --- bld/namelist_files/namelist_defaults_ctsm.xml | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index 90e397d544..933b504606 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -618,19 +618,11 @@ attributes from the config_cache.xml file (with keys converted to upper-case). +.false. .true. -.true. -.false. -.false. -.false. - +.false. .true. -.true. -.false. -.false. -.false. -.false. .false. .false. From 7feb6572d51e5d3ba2596ae9a1b4ededd045928d Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Tue, 25 Jun 2024 18:04:46 -0600 Subject: [PATCH 0583/1248] Rm redunant LG* and LR* tests and corresponding expected fails --- cime_config/testdefs/ExpectedTestFails.xml | 13 ------------- cime_config/testdefs/testlist_clm.xml | 20 -------------------- 2 files changed, 33 deletions(-) diff --git a/cime_config/testdefs/ExpectedTestFails.xml b/cime_config/testdefs/ExpectedTestFails.xml index 5968e73760..664b1c8e35 100644 --- a/cime_config/testdefs/ExpectedTestFails.xml +++ b/cime_config/testdefs/ExpectedTestFails.xml @@ -58,19 +58,6 @@ - - - FAIL - #640, same test with clm-ciso_soil_matrixcn_only works - - - - - FAIL - #640, same test with clm-ciso_soil_matrixcn_only works - - - FAIL diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index 9a2390bd58..625a9f3504 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -3386,26 +3386,6 @@ - - - - - - - - - - - - - - - - - - - - From bb1bd9ca8ed2cfe2e8b8d6ae756925af3100bee3 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Tue, 25 Jun 2024 22:21:10 -0600 Subject: [PATCH 0584/1248] Make Leung_2023 the default, remove error checking about using it --- bld/CLMBuildNamelist.pm | 3 --- bld/namelist_files/namelist_defaults_ctsm.xml | 2 +- bld/unit_testers/build-namelist_test.pl | 7 +------ 3 files changed, 2 insertions(+), 10 deletions(-) diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index 6a24e6c899..549622a765 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -4008,9 +4008,6 @@ sub setup_logic_dust_emis { "$option is being set, need to change one or the other" ); } } - if ( $dust_emis_method eq "Leung_2023" ) { - $log->warning("dust_emis_method is Leung_2023 and that option has NOT been brought into CTSM yet"); - } } } diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index 7fe7fb18c1..753a08b081 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -2780,7 +2780,7 @@ use_crop=".true.">lnd/clm2/surfdata_map/ctsm5.1.dev052/landuse.timeseries_mpasa1 -Zender_2003 +Leung_2023 atm bilinear { options=>"-envxml_dir .", - namelst=>"dust_emis_method = 'Leung_2023'", - GLC_TWO_WAY_COUPLING=>"FALSE", - phys=>"clm5_1", - }, "coldwfinidat" =>{ options=>"-envxml_dir . -clm_start_type cold", namelst=>"finidat = 'testfile.nc'", GLC_TWO_WAY_COUPLING=>"FALSE", From 5a46b9382ee15fea803cb5e7091ed6915c2169a1 Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Wed, 26 Jun 2024 10:53:02 -0700 Subject: [PATCH 0585/1248] remove fates land use no harvest due to overlap --- .../testmods_dirs/clm/FatesColdLUH2NoHarvest/include_user_mods | 1 - .../testmods_dirs/clm/FatesColdLUH2NoHarvest/user_nl_clm | 1 - 2 files changed, 2 deletions(-) delete mode 100644 cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2NoHarvest/include_user_mods delete mode 100644 cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2NoHarvest/user_nl_clm diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2NoHarvest/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2NoHarvest/include_user_mods deleted file mode 100644 index 7eb8bb1579..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2NoHarvest/include_user_mods +++ /dev/null @@ -1 +0,0 @@ -../FatesColdLUH2 diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2NoHarvest/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2NoHarvest/user_nl_clm deleted file mode 100644 index b3b338e232..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2NoHarvest/user_nl_clm +++ /dev/null @@ -1 +0,0 @@ -fates_harvest_mode = no_harvest From 3318d3b46df34013afcb5fadc4ad9f4184779f28 Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Wed, 26 Jun 2024 11:03:10 -0700 Subject: [PATCH 0586/1248] update fates landuse harvest test mod names --- cime_config/testdefs/testlist_clm.xml | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index 0706a1ef53..ed0627f242 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -2570,7 +2570,7 @@ - + @@ -2579,7 +2579,7 @@ - + @@ -2588,7 +2588,7 @@ - + @@ -2597,16 +2597,7 @@ - - - - - - - - - - + @@ -2621,7 +2612,7 @@ - + From f15eadec091721e236f0c83af26cc99ad2b1754e Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Wed, 26 Jun 2024 12:10:24 -0600 Subject: [PATCH 0587/1248] Repl. NIWO with HARV in a test and update expected fails for two tests --- cime_config/testdefs/ExpectedTestFails.xml | 17 +---------------- cime_config/testdefs/testlist_clm.xml | 2 +- 2 files changed, 2 insertions(+), 17 deletions(-) diff --git a/cime_config/testdefs/ExpectedTestFails.xml b/cime_config/testdefs/ExpectedTestFails.xml index 156bee9f80..cf348c0f8d 100644 --- a/cime_config/testdefs/ExpectedTestFails.xml +++ b/cime_config/testdefs/ExpectedTestFails.xml @@ -58,15 +58,11 @@ - + FAIL #2310 - - FAIL - #2310 - @@ -80,17 +76,6 @@ - - - FAIL - #2310 - - - FAIL - #2310 - - - FAIL diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index 049d9cf873..fee8e1a429 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -1873,7 +1873,7 @@ - + From 00e3d62d1f4c38a651178a77fd075b21b3572f3c Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 26 Jun 2024 12:26:05 -0600 Subject: [PATCH 0588/1248] Remove abort on Leung dust method Add some log statements around this. --- src/biogeochem/DUSTMod.F90 | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/biogeochem/DUSTMod.F90 b/src/biogeochem/DUSTMod.F90 index c6a48b8145..4af9fe0acd 100644 --- a/src/biogeochem/DUSTMod.F90 +++ b/src/biogeochem/DUSTMod.F90 @@ -330,14 +330,7 @@ subroutine InitCold(this, bounds) ! Set basin factor to 1 for now if (dust_emis_method == 'Leung_2023') then - !do c = bounds%begc, bounds%endc - ! l = col%landunit(c) - - ! if (.not.lun%lakpoi(l)) then - ! this%mbl_bsn_fct_col(c) = 1.0_r8 - ! end if - !end do - call endrun( msg="Leung_2023 dust_emis_method is currently not available"//errMsg(sourcefile, __LINE__)) + write(iulog,*) 'Using the new Leung_2023 dust emission scheme' else if (dust_emis_method == 'Zender_2003') then if ( this%soil_erod_stream%UseStreams() )then call this%soil_erod_stream%CalcDustSource( bounds, & @@ -345,6 +338,7 @@ subroutine InitCold(this, bounds) else this%mbl_bsn_fct_col(:) = 1.0_r8 end if + write(iulog,*) 'WARNING: Asked to use the old Zender_2003 dust emission scheme, which is not currently setup completely' else write(iulog,*) 'dust_emis_method not recognized = ', trim(dust_emis_method) call endrun( msg="dust_emis_method namelist item is not valid "//errMsg(sourcefile, __LINE__)) From a5da93ec5d016aabc11452870d8c3fab1677ef25 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Wed, 26 Jun 2024 12:31:05 -0600 Subject: [PATCH 0589/1248] generate_gdd20_baseline: Add optional -y1 and -yN args. --- .../crop_calendars/generate_gdd20_baseline.py | 39 +++++++++++++++++-- 1 file changed, 35 insertions(+), 4 deletions(-) diff --git a/python/ctsm/crop_calendars/generate_gdd20_baseline.py b/python/ctsm/crop_calendars/generate_gdd20_baseline.py index 89a38a0a08..4357bd6dd1 100644 --- a/python/ctsm/crop_calendars/generate_gdd20_baseline.py +++ b/python/ctsm/crop_calendars/generate_gdd20_baseline.py @@ -70,6 +70,24 @@ def _parse_args(): help="Overwrite existing output file, if any", action="store_true", ) + parser.add_argument( + "-y1", + "--first-year", + help=( + "First calendar year to include" + ), + type=int, + required=False, + ) + parser.add_argument( + "-yN", + "--last-year", + help=( + "Last calendar year to include" + ), + type=int, + required=False, + ) # Get arguments args = parser.parse_args(sys.argv[1:]) @@ -78,7 +96,19 @@ def _parse_args(): if os.path.exists(args.output_file) and not args.overwrite: raise FileExistsError("Output file exists but --overwrite is not specified") - return args + # Process time slice + # Assumes CESM behavior where data for e.g. 1987 is saved as 1988-01-01 + if args.first_year is not None: + date_1 = f"{args.first_year+1}-01-01" + else: + date_1 = "0000-01-01" + if args.last_year is not None: + date_n = f"{args.last_year+1}-01-01" + else: + date_n = "9999-12-31" + time_slice = slice(date_1, date_n) + + return args, time_slice def _get_cft_list(crop_list): @@ -161,7 +191,7 @@ def _add_time_axis(da_in): return da_out -def generate_gdd20_baseline(input_files, output_file, author): +def generate_gdd20_baseline(input_files, output_file, author, time_slice): """ Generate stream_fldFileName_gdd20_baseline file from CTSM outputs """ @@ -173,7 +203,7 @@ def generate_gdd20_baseline(input_files, output_file, author): input_files.sort() # Import history files and ensure they have lat/lon dims - ds_in = import_ds(input_files, VAR_LIST_IN + GRIDDING_VAR_LIST) + ds_in = import_ds(input_files, VAR_LIST_IN + GRIDDING_VAR_LIST, time_slice=time_slice) if not all(x in ds_in.dims for x in ["lat", "lon"]): raise RuntimeError("Input files must have lat and lon dimensions") @@ -247,9 +277,10 @@ def main(): """ main() function for calling generate_gdd20_baseline.py from command line. """ - args = _parse_args() + args, time_slice = _parse_args() generate_gdd20_baseline( args.input_files, args.output_file, args.author, + time_slice ) From ddef21bdde3fdbe0990a45b6997393faaa70ccde Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Wed, 26 Jun 2024 12:35:58 -0600 Subject: [PATCH 0590/1248] Correction to the expected-fails update for one of the tests --- 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 cf348c0f8d..c5d8a85724 100644 --- a/cime_config/testdefs/ExpectedTestFails.xml +++ b/cime_config/testdefs/ExpectedTestFails.xml @@ -76,6 +76,13 @@ + + + FAIL + #2310 + + + FAIL From 5427891e02b3d6e4292e30ac3a1f827394a294d5 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Wed, 26 Jun 2024 12:50:25 -0600 Subject: [PATCH 0591/1248] Revert last correction (it was fine to begin with) --- 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 c5d8a85724..cf348c0f8d 100644 --- a/cime_config/testdefs/ExpectedTestFails.xml +++ b/cime_config/testdefs/ExpectedTestFails.xml @@ -76,13 +76,6 @@ - - - FAIL - #2310 - - - FAIL From b0c79e1c2ccde049102caf390656b123503a648a Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Wed, 26 Jun 2024 12:54:34 -0600 Subject: [PATCH 0592/1248] Make one more update to expected fails --- 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 cf348c0f8d..a62a25151a 100644 --- a/cime_config/testdefs/ExpectedTestFails.xml +++ b/cime_config/testdefs/ExpectedTestFails.xml @@ -244,10 +244,6 @@ FAIL #2310 - - FAIL - #2310 - From 4edaa461a4cbd56bf98c5014aa85b9cd84e7fe3c Mon Sep 17 00:00:00 2001 From: Jim Edwards Date: Wed, 26 Jun 2024 14:21:18 -0600 Subject: [PATCH 0593/1248] move from depricated shr_file to shr_log --- src/cpl/nuopc/lnd_comp_nuopc.F90 | 37 ++++++++++++++++---------------- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/src/cpl/nuopc/lnd_comp_nuopc.F90 b/src/cpl/nuopc/lnd_comp_nuopc.F90 index 3852a1bf1b..7fe93454ac 100644 --- a/src/cpl/nuopc/lnd_comp_nuopc.F90 +++ b/src/cpl/nuopc/lnd_comp_nuopc.F90 @@ -29,7 +29,7 @@ module lnd_comp_nuopc use NUOPC_Model , only : NUOPC_ModelGet use shr_kind_mod , only : r8 => shr_kind_r8, cl=>shr_kind_cl use shr_sys_mod , only : shr_sys_abort - use shr_file_mod , only : shr_file_getlogunit, shr_file_setlogunit + use shr_log_mod , only : shr_log_setLogUnit, shr_log_getLogUnit use shr_orb_mod , only : shr_orb_decl, shr_orb_params, SHR_ORB_UNDEF_REAL, SHR_ORB_UNDEF_INT use shr_cal_mod , only : shr_cal_noleap, shr_cal_gregorian, shr_cal_ymd2date use spmdMod , only : masterproc, mpicom, spmd_init @@ -66,7 +66,7 @@ module lnd_comp_nuopc private :: clm_orbital_init ! Initialize the orbital information private :: clm_orbital_update ! Update the orbital information private :: CheckImport - + !-------------------------------------------------------------------------- ! Private module data !-------------------------------------------------------------------------- @@ -333,8 +333,7 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc) !---------------------------------------------------------------------------- ! reset shr logging to original values !---------------------------------------------------------------------------- - - call shr_file_setLogUnit (shrlogunit) + call shr_log_setLogUnit(shrlogunit) call ESMF_LogWrite(subname//' done', ESMF_LOGMSG_INFO) end subroutine InitializeAdvertise @@ -497,8 +496,8 @@ subroutine InitializeRealize(gcomp, importState, exportState, clock, rc) ! Reset shr logging to my log file !---------------------------------------------------------------------------- - call shr_file_getLogUnit (shrlogunit) - call shr_file_setLogUnit (iulog) + call shr_log_getLogUnit (shrlogunit) + call shr_log_setLogUnit (iulog) #if (defined _MEMTRACE) if (masterproc) then lbnum=1 @@ -683,7 +682,7 @@ subroutine InitializeRealize(gcomp, importState, exportState, clock, rc) if (ChkErr(rc,__LINE__,u_FILE_u)) return endif - call shr_file_setLogUnit (shrlogunit) + call shr_log_setLogUnit (shrlogunit) #if (defined _MEMTRACE) if(masterproc) then @@ -774,8 +773,8 @@ subroutine ModelAdvance(gcomp, rc) ! Reset share log units !-------------------------------- - call shr_file_getLogUnit (shrlogunit) - call shr_file_setLogUnit (iulog) + call shr_log_getLogUnit (shrlogunit) + call shr_log_setLogUnit (iulog) #if (defined _MEMTRACE) if(masterproc) then @@ -864,7 +863,7 @@ subroutine ModelAdvance(gcomp, rc) rstwr = .false. if (nlend .and. write_restart_at_endofrun) then rstwr = .true. - else + else call ESMF_ClockGetAlarm(clock, alarmname='alarm_restart', alarm=alarm, rc=rc) if (ChkErr(rc,__LINE__,u_FILE_u)) return if (ESMF_AlarmIsCreated(alarm, rc=rc)) then @@ -964,7 +963,7 @@ subroutine ModelAdvance(gcomp, rc) ! Reset shr logging to my original values !-------------------------------- - call shr_file_setLogUnit (shrlogunit) + call shr_log_setLogUnit (shrlogunit) call ESMF_LogWrite(subname//' done', ESMF_LOGMSG_INFO) @@ -1289,14 +1288,14 @@ subroutine CheckImport(gcomp, rc) type(ESMF_GridComp) :: gcomp integer, intent(out) :: rc character(len=*) , parameter :: subname = "("//__FILE__//":CheckImport)" - + ! This is the routine that enforces the explicit time dependence on the ! import fields. This simply means that the timestamps on the Fields in the - ! importState are checked against the currentTime on the Component's + ! importState are checked against the currentTime on the Component's ! internalClock. Consequenty, this model starts out with forcing fields - ! at the current time as it does its forward step from currentTime to + ! at the current time as it does its forward step from currentTime to ! currentTime + timeStep. - + ! local variables type(ESMF_Clock) :: clock type(ESMF_Time) :: time @@ -1320,7 +1319,7 @@ subroutine CheckImport(gcomp, rc) ! query the component for info call NUOPC_CompGet(gcomp, name=name, rc=rc) if (chkerr(rc,__LINE__,u_FILE_u)) return - + ! query the Component for its clock and importState call ESMF_GridCompGet(gcomp, clock=clock, importState=importState, rc=rc) if (chkerr(rc,__LINE__,u_FILE_u)) return @@ -1328,11 +1327,11 @@ subroutine CheckImport(gcomp, rc) ! get the current time out of the clock call ESMF_ClockGet(clock, currTime=time, rc=rc) if (chkerr(rc,__LINE__,u_FILE_u)) return - + ! check that Fields in the importState show correct timestamp allCurrent = NUOPC_IsAtTime(importState, time, fieldList=fieldList, rc=rc) if (chkerr(rc,__LINE__,u_FILE_u)) return - + if (.not.allCurrent) then !TODO: introduce and use INCOMPATIBILITY return codes!!!! do i=1, size(fieldList) @@ -1354,6 +1353,6 @@ subroutine CheckImport(gcomp, rc) rcToReturn=rc) return ! bail out endif - + end subroutine CheckImport end module lnd_comp_nuopc From 23c8743ae67e8b550ee3ba89c10f2a2d17a51c3b Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Wed, 26 Jun 2024 14:27:22 -0600 Subject: [PATCH 0594/1248] generate_gdds: Map sdate in/out diffs. --- .../crop_calendars/generate_gdd20_baseline.py | 5 +++- python/ctsm/crop_calendars/generate_gdds.py | 1 + .../crop_calendars/generate_gdds_functions.py | 28 +++++++++++++++++-- 3 files changed, 31 insertions(+), 3 deletions(-) diff --git a/python/ctsm/crop_calendars/generate_gdd20_baseline.py b/python/ctsm/crop_calendars/generate_gdd20_baseline.py index 4357bd6dd1..476717b887 100644 --- a/python/ctsm/crop_calendars/generate_gdd20_baseline.py +++ b/python/ctsm/crop_calendars/generate_gdd20_baseline.py @@ -97,7 +97,10 @@ def _parse_args(): raise FileExistsError("Output file exists but --overwrite is not specified") # Process time slice - # Assumes CESM behavior where data for e.g. 1987 is saved as 1988-01-01 + # Assumes CESM behavior where data for e.g. 1987 is saved as 1988-01-01. + # It would be more robust, accounting for upcoming behavior (where timestamp for a year is the + # middle of that year), to do slice("YEAR1-01-03", "YEARN-01-02"), but that's not compatible + # with ctsm_pylib as of the version using python 3.7.9. See safer_timeslice() in cropcal_utils. if args.first_year is not None: date_1 = f"{args.first_year+1}-01-01" else: diff --git a/python/ctsm/crop_calendars/generate_gdds.py b/python/ctsm/crop_calendars/generate_gdds.py index 156ebfb20e..49226e6f75 100644 --- a/python/ctsm/crop_calendars/generate_gdds.py +++ b/python/ctsm/crop_calendars/generate_gdds.py @@ -178,6 +178,7 @@ def main( mxmats, cc.get_gs_len_da, skip_crops, + outdir_figs, logger, ) diff --git a/python/ctsm/crop_calendars/generate_gdds_functions.py b/python/ctsm/crop_calendars/generate_gdds_functions.py index 38c5d44384..2658e1de87 100644 --- a/python/ctsm/crop_calendars/generate_gdds_functions.py +++ b/python/ctsm/crop_calendars/generate_gdds_functions.py @@ -22,6 +22,7 @@ # pylint: disable=import-error from ctsm.crop_calendars.cropcal_figs_module import * from matplotlib.transforms import Bbox + import matplotlib.pyplot as plt warnings.filterwarnings( "ignore", @@ -63,7 +64,7 @@ def error(logger, string): raise RuntimeError(string) -def check_sdates(dates_ds, sdates_rx, logger, verbose=False): +def check_sdates(dates_ds, sdates_rx, outdir_figs, logger, verbose=False): """ Checking that input and output sdates match """ @@ -106,8 +107,28 @@ def check_sdates(dates_ds, sdates_rx, logger, verbose=False): log(logger, out_map_notnan[here][0:4]) log(logger, "diff:") log(logger, diff_map_notnan[here][0:4]) + first_diff = all_ok all_ok = False + if CAN_PLOT: + sdate_diffs_dir = os.path.join(outdir_figs, "sdate_diffs") + if first_diff: + log(logger, f"Saving sdate difference figures to {sdate_diffs_dir}") + if not os.path.exists(sdate_diffs_dir): + os.makedirs(sdate_diffs_dir) + in_map.where(~np.isnan(out_map)).plot() + plt.title(f"{vegtype_str} sdates in (masked)") + plt.savefig(os.path.join(sdate_diffs_dir, f"{vegtype_str}.in.png")) + plt.close() + out_map.plot() + plt.title(f"{vegtype_str} sdates out") + plt.savefig(os.path.join(sdate_diffs_dir, f"{vegtype_str}.out.png")) + plt.close() + diff_map.plot() + plt.title(f"{vegtype_str} sdates diff (out - in)") + plt.savefig(os.path.join(sdate_diffs_dir, f"{vegtype_str}.diff.png")) + plt.close() + if not any_found: error(logger, "No matching variables found in sdates_rx!") @@ -234,6 +255,7 @@ def import_and_process_1yr( mxmats, get_gs_len_da, skip_crops, + outdir_figs, logger, ): """ @@ -272,6 +294,8 @@ def import_and_process_1yr( time_slice=slice(f"{this_year}-01-01", f"{this_year}-12-31"), chunks=chunks, ) + for timestep in dates_ds["time"].values: + print(timestep) if dates_ds.dims["time"] > 1: if dates_ds.dims["time"] == 365: @@ -466,7 +490,7 @@ def import_and_process_1yr( # Import expected sowing dates. This will also be used as our template output file. imported_sdates = isinstance(sdates_rx, str) sdates_rx = import_rx_dates("s", sdates_rx, incl_patches1d_itype_veg, mxsowings, logger) - check_sdates(dates_incl_ds, sdates_rx, logger) + check_sdates(dates_incl_ds, sdates_rx, outdir_figs, logger) # Import hdates, if needed imported_hdates = isinstance(hdates_rx, str) From 19f793f2ff0764f7a5877440f765cdd8a5d9f8b3 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 26 Jun 2024 17:53:03 -0600 Subject: [PATCH 0595/1248] Update cam and cice6 tags to that in cesm2_3_beta17 --- Externals.cfg | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Externals.cfg b/Externals.cfg index 5ae9973d32..58639eafb3 100644 --- a/Externals.cfg +++ b/Externals.cfg @@ -41,15 +41,15 @@ local_path = components/cice5 required = True [cice6] -tag = cesm_cice6_4_1_10 +tag = cesm_cice6_5_0_7 protocol = git repo_url = https://github.com/ESCOMP/CESM_CICE local_path = components/cice externals = Externals.cfg required = True -[cam6] -tag = cam6_3_135 +[cam] +tag = cam6_3_160 protocol = git repo_url = https://github.com/ESCOMP/CAM local_path = components/cam From 34c4db0b185b4cb62fc6fa22de96b23c949c0dfd Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Wed, 26 Jun 2024 23:47:14 -0700 Subject: [PATCH 0596/1248] Revert "Apply relevant changes from rgknox/fates-auto-params." This reverts commit 7216006b1c2400d1ca2932899671f9bcec85b6af. --- .../testdefs/testmods_dirs/clm/Fates/shell_commands | 5 ----- .../testdefs/testmods_dirs/clm/Fates/user_nl_clm | 1 - .../testdefs/testmods_dirs/clm/_scripts/README | 2 -- .../clm/_scripts/get_fates_shell_commands_vars.sh | 11 ----------- 4 files changed, 19 deletions(-) delete mode 100644 cime_config/testdefs/testmods_dirs/clm/_scripts/README delete mode 100755 cime_config/testdefs/testmods_dirs/clm/_scripts/get_fates_shell_commands_vars.sh diff --git a/cime_config/testdefs/testmods_dirs/clm/Fates/shell_commands b/cime_config/testdefs/testmods_dirs/clm/Fates/shell_commands index 3443bacef0..41a2342a51 100644 --- a/cime_config/testdefs/testmods_dirs/clm/Fates/shell_commands +++ b/cime_config/testdefs/testmods_dirs/clm/Fates/shell_commands @@ -1,7 +1,2 @@ ./xmlchange CLM_BLDNML_OPTS="-no-megan" --append ./xmlchange BFBFLAG="TRUE" - -SRCROOT=`./xmlquery SRCROOT --value` -. "${SRCROOT}"/cime_config/testdefs/testmods_dirs/clm/_scripts/get_fates_shell_commands_vars.sh - -ncgen -o $FATESPARAMFILE $FATESDIR/parameter_files/fates_params_default.cdl diff --git a/cime_config/testdefs/testmods_dirs/clm/Fates/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/Fates/user_nl_clm index 57adea1ff6..91df3e2e61 100644 --- a/cime_config/testdefs/testmods_dirs/clm/Fates/user_nl_clm +++ b/cime_config/testdefs/testmods_dirs/clm/Fates/user_nl_clm @@ -4,7 +4,6 @@ hist_nhtfrq = -24 hist_empty_htapes = .true. hist_ndens = 1 fates_spitfire_mode = 1 -fates_paramfile='${SRCROOT}/src/fates/parameter_files/binaries/${CASE}-params.nc' hist_fincl1 = 'FATES_NCOHORTS', 'FATES_TRIMMING', 'FATES_AREA_PLANTS', 'FATES_AREA_TREES', 'FATES_COLD_STATUS', 'FATES_GDD', 'FATES_NCHILLDAYS', 'FATES_NCOLDDAYS', 'FATES_DAYSINCE_COLDLEAFOFF','FATES_DAYSINCE_COLDLEAFON', diff --git a/cime_config/testdefs/testmods_dirs/clm/_scripts/README b/cime_config/testdefs/testmods_dirs/clm/_scripts/README deleted file mode 100644 index 66eb22a375..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/_scripts/README +++ /dev/null @@ -1,2 +0,0 @@ -This directory contains scripts that can be called in -shell_commands of multiple testmods. diff --git a/cime_config/testdefs/testmods_dirs/clm/_scripts/get_fates_shell_commands_vars.sh b/cime_config/testdefs/testmods_dirs/clm/_scripts/get_fates_shell_commands_vars.sh deleted file mode 100755 index 382fb4e53e..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/_scripts/get_fates_shell_commands_vars.sh +++ /dev/null @@ -1,11 +0,0 @@ -# This script should be called in shell_commands with -# . "${SRCROOT}"/cime_config/testdefs/testmods_dirs/clm/_scripts/get_fates_shell_commands_vars.sh -# where the leading period ensures it's run in the same shell. - -CASE=`./xmlquery CASE --value` -FATESDIR="${SRCROOT}/src/fates" -FATESPARAMDIR="${SRCROOT}/src/fates/parameter_files/binaries" -mkdir -p "${FATESPARAMDIR}" -FATESPARAMFILE="${FATESPARAMDIR}/${CASE}-params.nc" - -# No exit status because it should be called in the same shell. From 0c9b5489e5bc81b75478499461c19ec33ecd0775 Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Thu, 27 Jun 2024 12:22:42 -0400 Subject: [PATCH 0597/1248] changing prescribed N and P uptake to 1 in the PRT2 test --- .../testmods_dirs/clm/FatesColdPRT2/shell_commands | 11 +++++++++++ .../testmods_dirs/clm/FatesColdPRT2/user_nl_clm | 1 + 2 files changed, 12 insertions(+) create mode 100644 cime_config/testdefs/testmods_dirs/clm/FatesColdPRT2/shell_commands diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesColdPRT2/shell_commands b/cime_config/testdefs/testmods_dirs/clm/FatesColdPRT2/shell_commands new file mode 100644 index 0000000000..632b61bf15 --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/FatesColdPRT2/shell_commands @@ -0,0 +1,11 @@ +SRCDIR=`./xmlquery SRCROOT --value` +CASEDIR=`./xmlquery CASEROOT --value` +FATESDIR=$SRCDIR/src/fates/ +FATESPARAMFILE=$CASEDIR/fates_params_prt2_prescribed_np.nc + +ncgen -o $FATESPARAMFILE $FATESDIR/parameter_files/fates_params_default.cdl + +$FATESDIR/tools/modify_fates_paramfile.py --O --fin $FATESPARAMFILE --fout $FATESPARAMFILE --var fates_cnp_prescribed_nuptake --val 1.0 --allpfts + +$FATESDIR/tools/modify_fates_paramfile.py --O --fin $FATESPARAMFILE --fout $FATESPARAMFILE --var fates_cnp_prescribed_puptake --val 1.0 --allpfts + diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesColdPRT2/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/FatesColdPRT2/user_nl_clm index 679f025b60..196d559cb7 100644 --- a/cime_config/testdefs/testmods_dirs/clm/FatesColdPRT2/user_nl_clm +++ b/cime_config/testdefs/testmods_dirs/clm/FatesColdPRT2/user_nl_clm @@ -1,3 +1,4 @@ +fates_paramfile = '$CASEROOT/fates_params_prt2_prescribed_np.nc' fates_parteh_mode = 2 hist_fincl1 = 'FATES_L2FR','FATES_L2FR_CANOPY_REC_PF','FATES_L2FR_USTORY_REC_PF', 'FATES_NH4UPTAKE_SZPF','FATES_NO3UPTAKE_SZPF','FATES_NEFFLUX_SZPF', From 6f3a068cc301039ce7eb6ce98fc062f4a1257bb0 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Thu, 27 Jun 2024 14:22:32 -0600 Subject: [PATCH 0598/1248] Finish fsat_hillslope merge (update ChangeLog/Sum). --- doc/ChangeLog | 59 +++++++++++++++++++++++++++++++++++++++++++++++++++ doc/ChangeSum | 1 + 2 files changed, 60 insertions(+) diff --git a/doc/ChangeLog b/doc/ChangeLog index c4e7ca469e..05b43c20ab 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,4 +1,63 @@ =============================================================== +Tag name: tmp-240620.n03.ctsm5.2.007 +Originator(s): samrabin (Sam Rabin, UCAR/TSS, samrabin@ucar.edu) +Date: Thu Jun 27 14:17:02 MDT 2024 +One-line Summary: Set upland hillslope column fsat values to zero + +Purpose and description of changes +---------------------------------- + +The topmodel-based fsat surface runoff scheme is not appropriate for upland hillslope columns, so set upland hillslope column fsat values to zero. User can revert this behavior by setting hillslope_fsat_equals_zero to false. + + +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.) + +[ ] clm6_0 + +[ ] clm5_1 + +[ ] clm5_0 + +[ ] ctsm5_0-nwp + +[ ] clm4_5 + + + +Notes of particular relevance for users +--------------------------------------- + +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): +- Added parameter hillslope_fsat_equals_zero (default true). Set to false for previous behavior. + + +Testing summary: +---------------- + + regular tests (aux_clm: https://github.com/ESCOMP/CTSM/wiki/System-Testing-Guide#pre-merge-system-testing): + + derecho ----- DIFF + izumi ------- DIFF + + +Answer changes +-------------- + +Changes answers relative to baseline: Yes, but only for hillslope tests. + + +Other details +------------- + +Pull Requests that document the changes (include PR ids): +- ESCOMP/CTSM#2600 (https://github.com/ESCOMP/CTSM/pull/2600) + +=============================================================== +=============================================================== Tag name: tmp-240620.n02.ctsm5.2.007 Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326) Date: Fri 21 Jun 2024 10:21:01 PM MDT diff --git a/doc/ChangeSum b/doc/ChangeSum index 0bffb18cf4..7dd063df45 100644 --- a/doc/ChangeSum +++ b/doc/ChangeSum @@ -1,5 +1,6 @@ Tag Who Date Summary ============================================================================================================================ +tmp-240620.n03.ctsm5.2.007 samrabin 06/27/2024 Set upland hillslope column fsat values to zero tmp-240620.n02.ctsm5.2.007 erik 06/21/2024 Another update of git-fleximod tmp-240620.n01.ctsm5.2.007 slevis 06/21/2024 Merge b4b-dev (full tag name is tmp-240620.n01.ctsm5.2.007) ctsm5.2.007 multiple 05/31/2024 Rm manage_externals and update documentation accordingly From 99d0f2bb4c93c739e5875781070a3d66c6bb8cbd Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Thu, 27 Jun 2024 16:56:21 -0700 Subject: [PATCH 0599/1248] move fates landuse test mods to fates suite --- cime_config/testdefs/testlist_clm.xml | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index ef4358f763..347fd33e8e 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -2573,8 +2573,7 @@ - - + @@ -2582,8 +2581,7 @@ - - + @@ -2591,8 +2589,7 @@ - - + @@ -2600,8 +2597,7 @@ - - + @@ -2609,8 +2605,7 @@ - - + From 535033b959f6eab9c5d39d7edff410c47dfacb80 Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Thu, 27 Jun 2024 17:11:47 -0700 Subject: [PATCH 0600/1248] remove flandusepft and fluh_times pointers for testmod Use default currently. --- .../testdefs/testmods_dirs/clm/FatesColdLUH2/user_nl_clm | 2 -- 1 file changed, 2 deletions(-) diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2/user_nl_clm index 970e7df7cd..e25490ffbb 100644 --- a/cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2/user_nl_clm +++ b/cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2/user_nl_clm @@ -2,10 +2,8 @@ ! Run a transient case, with vegetation starting from bare ground, but land use starting from LUH state vector on starting date, in a nocomp configuration. ! From Charlie's list of valid FATES configurations: ! https://docs.google.com/spreadsheets/d/1eE3sRMYxfocZKbT8uIQhXpjjtfM2feXPRSWXJNoo4jM/edit#gid=0 -flandusepftdat = '$DIN_LOC_ROOT/lnd/clm2/surfdata_map/fates-sci.1.73.0_api.36.0.0/fates_landuse_pft_map_4x5_240206.nc' use_fates_luh = .true. use_fates_nocomp = .true. use_fates_fixed_biogeog = .true. use_fates_sp = .false. use_fates_potentialveg = .false. -fluh_timeseries = '$DIN_LOC_ROOT/lnd/clm2/surfdata_map/fates-sci.1.68.3_api.31.0.0_tools.1.0.1/LUH2_states_transitions_management.timeseries_4x5_hist_simyr1850-2015_c231101.nc' From 8793f477483bf0332bf423e3c7b3bb66b31f88aa Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Thu, 27 Jun 2024 17:15:29 -0700 Subject: [PATCH 0601/1248] add readme noting grid resolution limitation --- cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2/README | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2/README diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2/README b/cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2/README new file mode 100644 index 0000000000..79d6511d17 --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2/README @@ -0,0 +1,2 @@ +Currently the FATES LUH2 category of test mods currently only supports +4x5 grid resolutions. From 35d5a5081c6b95690276f43d78e965792d7b3dd6 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Fri, 28 Jun 2024 12:26:54 -0600 Subject: [PATCH 0602/1248] Update Change files --- doc/ChangeLog | 68 +++++++++++++++++++++++++++++++++++++++++++++++++++ doc/ChangeSum | 7 +++--- 2 files changed, 72 insertions(+), 3 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index 05b43c20ab..2ab7676ddc 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,4 +1,72 @@ =============================================================== +Tag name: ctsm5.2.008 +Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326) +Date: Fri 28 Jun 2024 12:22:46 PM MDT +One-line Summary: Bring changes on temp-branch to master: b4b-dev, git-fleximod, hillslope fsat + +Purpose and description of changes +---------------------------------- + +Bring in changes that came in on the tmp-240620 branch to master now that cesm3_0_beta01 has +been made. The changes are documented in below but include the following tags: + + tmp-240620.n03.ctsm5.2.007 samrabin -- upland hillslope column fsat values to zero + tmp-240620.n02.ctsm5.2.007 erik ------ Another update of git-fleximod + tmp-240620.n01.ctsm5.2.007 slevis ---- Merge b4b-dev + +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_1 + +[ ] clm5_0 + +[ ] ctsm5_0-nwp + +[ ] clm4_5 + + +Bugs fixed +---------- + +Notes of particular relevance for users +--------------------------------------- + +Notes of particular relevance for developers: +--------------------------------------------- + +Testing summary: +---------------- + + build-namelist tests (if CLMBuildNamelist.pm has changed): + + derecho - PASS + + python testing (if python code has changed; see instructions in python/README.md; document testing done): + + derecho - PASS + + +Answer changes +-------------- + +Changes answers relative to baseline: No bit-for-bit with branch_tags/tmp-240620.n03.ctsm5.2.007 + +Other details +------------- + +Pull Requests that document the changes (include PR ids): +(https://github.com/ESCOMP/ctsm/pull) + +=============================================================== +=============================================================== Tag name: tmp-240620.n03.ctsm5.2.007 Originator(s): samrabin (Sam Rabin, UCAR/TSS, samrabin@ucar.edu) Date: Thu Jun 27 14:17:02 MDT 2024 diff --git a/doc/ChangeSum b/doc/ChangeSum index 7dd063df45..ea9417fe41 100644 --- a/doc/ChangeSum +++ b/doc/ChangeSum @@ -1,8 +1,9 @@ Tag Who Date Summary ============================================================================================================================ -tmp-240620.n03.ctsm5.2.007 samrabin 06/27/2024 Set upland hillslope column fsat values to zero -tmp-240620.n02.ctsm5.2.007 erik 06/21/2024 Another update of git-fleximod -tmp-240620.n01.ctsm5.2.007 slevis 06/21/2024 Merge b4b-dev (full tag name is tmp-240620.n01.ctsm5.2.007) + ctsm5.2.008 erik 06/28/2024 Bring changes on temp-branch to master: b4b-dev, git-fleximod, hillslope fsat +tmp-240620.n03.ctsm5.2.007 06/27/2024 Set upland hillslope column fsat values to zero (samrabin) +tmp-240620.n02.ctsm5.2.007 06/21/2024 Another update of git-fleximod (erik) +tmp-240620.n01.ctsm5.2.007 06/21/2024 Merge b4b-dev (full tag name is tmp-240620.n01.ctsm5.2.007) (slevis) ctsm5.2.007 multiple 05/31/2024 Rm manage_externals and update documentation accordingly ctsm5.2.006 slevis 05/28/2024 Update externals to cesm2_3_beta17, remove mct, retire /test/tools ctsm5.2.005 erik 05/13/2024 Fix clm6_0 defaults and CESM testing issues, add tests to detect these problems From 95bf3f82fb09d4022ac1af285569e9c1fd1aefa0 Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Fri, 28 Jun 2024 13:52:40 -0700 Subject: [PATCH 0603/1248] add fates harvest event expected failure --- cime_config/testdefs/ExpectedTestFails.xml | 7 +++++++ cime_config/testdefs/testlist_clm.xml | 3 ++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/cime_config/testdefs/ExpectedTestFails.xml b/cime_config/testdefs/ExpectedTestFails.xml index 65419a5903..de864aeee6 100644 --- a/cime_config/testdefs/ExpectedTestFails.xml +++ b/cime_config/testdefs/ExpectedTestFails.xml @@ -165,6 +165,13 @@ + + + FAIL + FATES#1216 + + + FAIL diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index 347fd33e8e..16359b88be 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -2579,7 +2579,7 @@ - + @@ -2609,6 +2609,7 @@ + From 889cc97d4172e85edc7f6c53f4a71ec89048a4d5 Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Thu, 27 Jun 2024 17:51:13 -0600 Subject: [PATCH 0604/1248] update seed dispersal test mod to put on-the-fly generated paramfile in the case directory --- .../testdefs/testmods_dirs/clm/FatesColdSeedDisp/shell_commands | 2 +- .../testdefs/testmods_dirs/clm/FatesColdSeedDisp/user_nl_clm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesColdSeedDisp/shell_commands b/cime_config/testdefs/testmods_dirs/clm/FatesColdSeedDisp/shell_commands index 94a832af25..db5a1f8672 100644 --- a/cime_config/testdefs/testmods_dirs/clm/FatesColdSeedDisp/shell_commands +++ b/cime_config/testdefs/testmods_dirs/clm/FatesColdSeedDisp/shell_commands @@ -1,7 +1,7 @@ SRCDIR=`./xmlquery SRCROOT --value` CASEDIR=`./xmlquery CASEROOT --value` FATESDIR=$SRCDIR/src/fates/ -FATESPARAMFILE=$SRCDIR/fates_params_seeddisp_4x5.nc +FATESPARAMFILE=$CASEDIR/fates_params_seeddisp_4x5.nc ncgen -o $FATESPARAMFILE $FATESDIR/parameter_files/fates_params_default.cdl diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesColdSeedDisp/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/FatesColdSeedDisp/user_nl_clm index e8d24253c1..ecd1dc8b57 100644 --- a/cime_config/testdefs/testmods_dirs/clm/FatesColdSeedDisp/user_nl_clm +++ b/cime_config/testdefs/testmods_dirs/clm/FatesColdSeedDisp/user_nl_clm @@ -1,3 +1,3 @@ -fates_paramfile = '$SRCROOT/fates_params_seeddisp_4x5.nc' +fates_paramfile = '$CASEROOT/fates_params_seeddisp_4x5.nc' fates_seeddisp_cadence = 1 hist_fincl1 = 'FATES_SEEDS_IN_GRIDCELL_PF', 'FATES_SEEDS_OUT_GRIDCELL_PF' From f58cd7ee463f5ad7d8838a618f6e51bc7c37fb07 Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Thu, 27 Jun 2024 23:43:20 -0600 Subject: [PATCH 0605/1248] reinstate fates-landuse as a second, shorter test list --- cime_config/testdefs/testlist_clm.xml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index 16359b88be..68862c0dce 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -2565,6 +2565,7 @@ + @@ -2574,6 +2575,7 @@ + @@ -2582,6 +2584,7 @@ + @@ -2590,6 +2593,7 @@ + @@ -2598,6 +2602,7 @@ + @@ -2606,6 +2611,7 @@ + From 9465da6202b0fd2ca8cbd9d39b6ffb5cc2e9f1e0 Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Thu, 27 Jun 2024 23:44:49 -0600 Subject: [PATCH 0606/1248] fix luh2 harvest testmod --- .../testmods_dirs/clm/FatesColdLUH2HarvestArea/user_nl_clm | 2 +- .../testmods_dirs/clm/FatesColdLUH2HarvestMass/user_nl_clm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2HarvestArea/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2HarvestArea/user_nl_clm index d760105e68..426b41b49e 100644 --- a/cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2HarvestArea/user_nl_clm +++ b/cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2HarvestArea/user_nl_clm @@ -1 +1 @@ -fates_harvest_mode = luhdata_area +fates_harvest_mode = 'luhdata_area' diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2HarvestMass/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2HarvestMass/user_nl_clm index bb5f30f75d..7b6bc24f5a 100644 --- a/cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2HarvestMass/user_nl_clm +++ b/cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2HarvestMass/user_nl_clm @@ -1 +1 @@ -fates_harvest_mode = luhdata_mass +fates_harvest_mode = 'luhdata_mass' From c2deb25a278e7b177c47b5ae189f1c8697cd8d58 Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Thu, 27 Jun 2024 23:48:18 -0600 Subject: [PATCH 0607/1248] rename fates landuse to luh2harvestevent --- .../testmods_dirs/clm/FatesColdLUH2HarvestSurf/user_nl_clm | 3 ++- .../testmods_dirs/clm/FatesColdLandUse/include_user_mods | 1 - .../testdefs/testmods_dirs/clm/FatesColdLandUse/user_nl_clm | 2 -- 3 files changed, 2 insertions(+), 4 deletions(-) delete mode 100644 cime_config/testdefs/testmods_dirs/clm/FatesColdLandUse/include_user_mods delete mode 100644 cime_config/testdefs/testmods_dirs/clm/FatesColdLandUse/user_nl_clm diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2HarvestSurf/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2HarvestSurf/user_nl_clm index 61e1daaa93..a23336f36c 100644 --- a/cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2HarvestSurf/user_nl_clm +++ b/cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2HarvestSurf/user_nl_clm @@ -1 +1,2 @@ -fates_harvest_mode = surfdata_file +flanduse_timeseries = '$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/ctsm5.2.0/landuse.timeseries_4x5_hist_16_CMIP6_1850-2015_c230620.nc' +fates_harvest_mode = 'surfdata_file' diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesColdLandUse/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/FatesColdLandUse/include_user_mods deleted file mode 100644 index 14f7591b72..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/FatesColdLandUse/include_user_mods +++ /dev/null @@ -1 +0,0 @@ -../FatesCold diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesColdLandUse/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/FatesColdLandUse/user_nl_clm deleted file mode 100644 index 668f9c861d..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/FatesColdLandUse/user_nl_clm +++ /dev/null @@ -1,2 +0,0 @@ -flanduse_timeseries = '$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/ctsm5.2.0/landuse.timeseries_4x5_hist_16_CMIP6_1850-2015_c230620.nc' -do_harvest = .true. From 4d0b49a81fa68653ba92ca59cfdd791cc053378a Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Fri, 28 Jun 2024 12:32:36 -0600 Subject: [PATCH 0608/1248] fix fates harvest event code testmod --- .../testmods_dirs/clm/FatesColdLUH2HarvestEvent/user_nl_clm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2HarvestEvent/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2HarvestEvent/user_nl_clm index c0e1c476be..d2079d9e43 100644 --- a/cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2HarvestEvent/user_nl_clm +++ b/cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2HarvestEvent/user_nl_clm @@ -1 +1 @@ -fates_harvest_mode = event_code +fates_harvest_mode = 'event_code' From 387ac5ed9163f77bd037ff8f935e56e73a832702 Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Fri, 28 Jun 2024 14:49:55 -0600 Subject: [PATCH 0609/1248] add description to flandusepftdat definition --- bld/namelist_files/namelist_definition_ctsm.xml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/bld/namelist_files/namelist_definition_ctsm.xml b/bld/namelist_files/namelist_definition_ctsm.xml index c12cb75ab6..fd3020f320 100644 --- a/bld/namelist_files/namelist_definition_ctsm.xml +++ b/bld/namelist_files/namelist_definition_ctsm.xml @@ -826,7 +826,13 @@ types to vary over time. -Full pathname of fates landuse x pft static data map. +Full pathname of fates landuse x pft association static data map. +The file associates land use types with pfts across a static global map. +This file is necessary for running FATES with use_fates_luh, +use_fates_nocomp, and use_fates_fixedbiogeo engaged. The file is output +by the FATES land use data tool (https://github.com/NGEET/tools-fates-landusedata) +which processes the raw land use data from the THEMIS tool data sets +(https://doi.org/10.5065/29s7-7b41) Date: Fri, 28 Jun 2024 14:04:09 -0700 Subject: [PATCH 0610/1248] update flandusepftdat description with note about use_fates_lupft --- bld/namelist_files/namelist_definition_ctsm.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bld/namelist_files/namelist_definition_ctsm.xml b/bld/namelist_files/namelist_definition_ctsm.xml index fd3020f320..fb4f5d07a9 100644 --- a/bld/namelist_files/namelist_definition_ctsm.xml +++ b/bld/namelist_files/namelist_definition_ctsm.xml @@ -829,7 +829,8 @@ types to vary over time. Full pathname of fates landuse x pft association static data map. The file associates land use types with pfts across a static global map. This file is necessary for running FATES with use_fates_luh, -use_fates_nocomp, and use_fates_fixedbiogeo engaged. The file is output +use_fates_nocomp, and use_fates_fixedbiogeo engaged (note that use_fates_lupft +is provided as a namelist option to engage all necessary options). The file is output by the FATES land use data tool (https://github.com/NGEET/tools-fates-landusedata) which processes the raw land use data from the THEMIS tool data sets (https://doi.org/10.5065/29s7-7b41) From f985fbafafd5710e944d7715522966e042743361 Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Fri, 28 Jun 2024 14:23:29 -0700 Subject: [PATCH 0611/1248] rename misleading surfdata_file option name to the landuse_timeseries --- bld/CLMBuildNamelist.pm | 4 ++-- bld/namelist_files/namelist_definition_ctsm.xml | 7 ++++--- .../testmods_dirs/clm/FatesColdLUH2HarvestSurf/user_nl_clm | 2 +- src/dyn_subgrid/dynFATESLandUseChangeMod.F90 | 2 +- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index c336d41ca9..0fb7963c67 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -4652,7 +4652,7 @@ sub setup_logic_fates { if ( ! &value_is_true($nl->get_value('use_fates_luh')) ) { $log->fatal_error("use_fates_luh is required to be true when $var is luhdata_mass or luhdata_area" ); } - } elsif ( $mode eq 'surfdata_file' ) { + } elsif ( $mode eq 'landuse_timeseries' ) { # Check to make sure that the user set the flanduse_timeseries file # Since the flanduse_timeseries logic checking is upstream of the fates logic, # don't add the default here. The onus is on the user to match the correct timeseries @@ -4660,7 +4660,7 @@ sub setup_logic_fates { my $var = "flanduse_timeseries"; my $fname = remove_leading_and_trailing_quotes( $nl->get_value($var) ); if ( ! defined($nl->get_value($var)) ) { - $log->fatal_error("$var is required when fates_harvest_mode is surfdata_file" ); + $log->fatal_error("$var is required when fates_harvest_mode is landuse_timeseries" ); } elsif ( ! -f "$fname" ) { $log->fatal_error("$var does NOT point to a valid filename" ); } diff --git a/bld/namelist_files/namelist_definition_ctsm.xml b/bld/namelist_files/namelist_definition_ctsm.xml index fb4f5d07a9..046de32c11 100644 --- a/bld/namelist_files/namelist_definition_ctsm.xml +++ b/bld/namelist_files/namelist_definition_ctsm.xml @@ -734,15 +734,16 @@ Toggle to turn on no competition mode (only relevant if FATES is being used). Toggle to turn on FATES satellite phenology mode (only relevant if FATES is being used). - + Set FATES harvesting mode by setting fates_harvest_mode to a valid string option. Allowed values are: no_harvest: no fates harvesting of any kind event_code: fates logging via fates logging event codes (see fates parameter file) only - surfdata_file: fates harvest driven by CLM landuse timeseries data (dynHarvestMod) + landuse_timeseries: fates harvest driven by CLM flanduse_timeseries file (dynHarvestMod) luhdata_area: fates harvest driven by LUH2 raw harvest data, area-based (dynFATESLandUseChangeMod) luhdata_mass: fates harvest driven by LUH2 raw harvest data, mass-based (dynFATESLandUseChangeMod) +Note that the landuse_timeseries option is not the same as the FATES fluh_timeseries data file. Date: Fri, 28 Jun 2024 14:25:37 -0700 Subject: [PATCH 0612/1248] add language about age and possible future deprication of landuse_timeseries option --- bld/namelist_files/namelist_definition_ctsm.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/bld/namelist_files/namelist_definition_ctsm.xml b/bld/namelist_files/namelist_definition_ctsm.xml index 046de32c11..9b495ccda4 100644 --- a/bld/namelist_files/namelist_definition_ctsm.xml +++ b/bld/namelist_files/namelist_definition_ctsm.xml @@ -744,6 +744,7 @@ Allowed values are: luhdata_area: fates harvest driven by LUH2 raw harvest data, area-based (dynFATESLandUseChangeMod) luhdata_mass: fates harvest driven by LUH2 raw harvest data, mass-based (dynFATESLandUseChangeMod) Note that the landuse_timeseries option is not the same as the FATES fluh_timeseries data file. +This option is older than the luhdata options and may be depricated at some point in the future. Date: Fri, 28 Jun 2024 14:29:38 -0700 Subject: [PATCH 0613/1248] fix copy/paste typo --- bld/namelist_files/namelist_definition_ctsm.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bld/namelist_files/namelist_definition_ctsm.xml b/bld/namelist_files/namelist_definition_ctsm.xml index 9b495ccda4..b80bbda2d6 100644 --- a/bld/namelist_files/namelist_definition_ctsm.xml +++ b/bld/namelist_files/namelist_definition_ctsm.xml @@ -806,7 +806,7 @@ This is enabled by default if fates_harvest_mode is set to use the raw LUH2 harv + group="clm_inparm" valid_values="" value=".false."> If TRUE, enable use of fates land use x pft mapping data file. (Only valid for use_fates = true and is incompatible with transient runs currently.) From 32b2554189d6cbdb11361ed376eb53c4bb8d2857 Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Fri, 28 Jun 2024 14:32:39 -0700 Subject: [PATCH 0614/1248] add clarifying language for use_fates_potentialveg --- bld/namelist_files/namelist_definition_ctsm.xml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bld/namelist_files/namelist_definition_ctsm.xml b/bld/namelist_files/namelist_definition_ctsm.xml index b80bbda2d6..bbc860df6c 100644 --- a/bld/namelist_files/namelist_definition_ctsm.xml +++ b/bld/namelist_files/namelist_definition_ctsm.xml @@ -814,7 +814,9 @@ If TRUE, enable use of fates land use x pft mapping data file. If TRUE, ignore the land-use state vector and transitions, and assert that all lands -are primary, and that there is no harvest. +are primary, and that there is no harvest. This mode is only relevant for FATES +spin-up workflows that are intending to use the spin-up restart output to start a +FATES land use transient case using the use_fates_lupft namelist option. From aaaff224b18585a4f93c4b83595b2017ee96f607 Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Fri, 28 Jun 2024 14:40:32 -0700 Subject: [PATCH 0615/1248] add clearer instructions about when to use_fates_potentialveg --- bld/namelist_files/namelist_definition_ctsm.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bld/namelist_files/namelist_definition_ctsm.xml b/bld/namelist_files/namelist_definition_ctsm.xml index bbc860df6c..252d83aa21 100644 --- a/bld/namelist_files/namelist_definition_ctsm.xml +++ b/bld/namelist_files/namelist_definition_ctsm.xml @@ -816,7 +816,8 @@ If TRUE, enable use of fates land use x pft mapping data file. If TRUE, ignore the land-use state vector and transitions, and assert that all lands are primary, and that there is no harvest. This mode is only relevant for FATES spin-up workflows that are intending to use the spin-up restart output to start a -FATES land use transient case using the use_fates_lupft namelist option. +FATES land use transient case using the use_fates_lupft namelist option. The option +should be set to true for the spin-up case and false for the transient case. From f6f7b2d135253f5a13dbd6e5ae66328a01c97d76 Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Fri, 28 Jun 2024 14:45:13 -0700 Subject: [PATCH 0616/1248] add language explaining what use_fates_lupft does --- bld/namelist_files/namelist_definition_ctsm.xml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bld/namelist_files/namelist_definition_ctsm.xml b/bld/namelist_files/namelist_definition_ctsm.xml index 252d83aa21..5a478f0bfa 100644 --- a/bld/namelist_files/namelist_definition_ctsm.xml +++ b/bld/namelist_files/namelist_definition_ctsm.xml @@ -807,7 +807,9 @@ This is enabled by default if fates_harvest_mode is set to use the raw LUH2 harv -If TRUE, enable use of fates land use x pft mapping data file. +If TRUE, enable use of FATES land use with no competition and fixed biogeography. This mode +requires the use of the land use x pft association static data map file. See the +flandusepftdat definition entry in this file for more information. (Only valid for use_fates = true and is incompatible with transient runs currently.) From 2539cea91b481f4680e2696c6c517df3d952befa Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Fri, 28 Jun 2024 16:31:36 -0700 Subject: [PATCH 0617/1248] add readme to FatesLUPFT test mod --- cime_config/testdefs/testmods_dirs/clm/FatesLUPFT/README | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 cime_config/testdefs/testmods_dirs/clm/FatesLUPFT/README diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesLUPFT/README b/cime_config/testdefs/testmods_dirs/clm/FatesLUPFT/README new file mode 100644 index 0000000000..88f5c2c8fb --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/FatesLUPFT/README @@ -0,0 +1,9 @@ +This test mod does not use cold start and is intended to +be used in conjunction with a test workflow that provides +an initialization file. Currently this is accomplished +by using the test mod in conjunction with the PVT +system test. The PVT system test runs a FATES spin-up +case using the use_fates_potentialveg mode and then +references the restart output to run a use_fates_lupft +transient mode case. + From bf46d33d289f85077082dc01ec79c1945c42c3f4 Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Sun, 30 Jun 2024 23:04:07 -0700 Subject: [PATCH 0618/1248] update fates logging test with new harvest event code Remove duplicate and misnamed FatesColdLUH2HarvestEvent --- .../clm/FatesColdLUH2HarvestEvent/include_user_mods | 1 - .../testmods_dirs/clm/FatesColdLUH2HarvestEvent/user_nl_clm | 1 - .../testdefs/testmods_dirs/clm/FatesColdLogging/user_nl_clm | 3 +-- 3 files changed, 1 insertion(+), 4 deletions(-) delete mode 100644 cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2HarvestEvent/include_user_mods delete mode 100644 cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2HarvestEvent/user_nl_clm diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2HarvestEvent/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2HarvestEvent/include_user_mods deleted file mode 100644 index 7eb8bb1579..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2HarvestEvent/include_user_mods +++ /dev/null @@ -1 +0,0 @@ -../FatesColdLUH2 diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2HarvestEvent/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2HarvestEvent/user_nl_clm deleted file mode 100644 index d2079d9e43..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2HarvestEvent/user_nl_clm +++ /dev/null @@ -1 +0,0 @@ -fates_harvest_mode = 'event_code' diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesColdLogging/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/FatesColdLogging/user_nl_clm index 5f457f3f1c..d2079d9e43 100644 --- a/cime_config/testdefs/testmods_dirs/clm/FatesColdLogging/user_nl_clm +++ b/cime_config/testdefs/testmods_dirs/clm/FatesColdLogging/user_nl_clm @@ -1,2 +1 @@ -! TODO SSR: Replace this with fates_harvest_mode -use_fates_logging= .true. +fates_harvest_mode = 'event_code' From 96d1a78b3c28c9f1bc8185e646f6a4f975236a42 Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Sun, 30 Jun 2024 23:07:59 -0700 Subject: [PATCH 0619/1248] reinstate FatesColdLandUse This will provide continuity to the previous test and fixes the incorrect use of FatesColdLUH2 as the test to inherit from --- .../testmods_dirs/clm/FatesColdLUH2HarvestSurf/include_user_mods | 1 - .../testmods_dirs/clm/FatesColdLandUse/include_user_mods | 1 + .../{FatesColdLUH2HarvestSurf => FatesColdLandUse}/user_nl_clm | 0 3 files changed, 1 insertion(+), 1 deletion(-) delete mode 100644 cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2HarvestSurf/include_user_mods create mode 100644 cime_config/testdefs/testmods_dirs/clm/FatesColdLandUse/include_user_mods rename cime_config/testdefs/testmods_dirs/clm/{FatesColdLUH2HarvestSurf => FatesColdLandUse}/user_nl_clm (100%) diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2HarvestSurf/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2HarvestSurf/include_user_mods deleted file mode 100644 index 7eb8bb1579..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2HarvestSurf/include_user_mods +++ /dev/null @@ -1 +0,0 @@ -../FatesColdLUH2 diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesColdLandUse/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/FatesColdLandUse/include_user_mods new file mode 100644 index 0000000000..14f7591b72 --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/FatesColdLandUse/include_user_mods @@ -0,0 +1 @@ +../FatesCold diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2HarvestSurf/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/FatesColdLandUse/user_nl_clm similarity index 100% rename from cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2HarvestSurf/user_nl_clm rename to cime_config/testdefs/testmods_dirs/clm/FatesColdLandUse/user_nl_clm From f47e2bfe035571268743f5bed11b2b97169d31e0 Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Sun, 30 Jun 2024 23:10:43 -0700 Subject: [PATCH 0620/1248] remove duplicate tests --- cime_config/testdefs/testlist_clm.xml | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index 68862c0dce..272d4093d8 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -2581,15 +2581,6 @@ - - - - - - - - - @@ -2599,15 +2590,6 @@ - - - - - - - - - From 6dd55eeef55c093e53f500867d516df1beb16f39 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Mon, 1 Jul 2024 11:31:06 -0600 Subject: [PATCH 0621/1248] Update .gitmodules with new cismwrapper, cmeps, and ccs_config tags --- .gitmodules | 12 ++++++------ ccs_config | 2 +- components/cism | 2 +- components/cmeps | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.gitmodules b/.gitmodules index 6d4298befc..eb2a0980f4 100644 --- a/.gitmodules +++ b/.gitmodules @@ -7,8 +7,8 @@ fxDONOTUSEurl = https://github.com/NCAR/fates-release [submodule "cism"] path = components/cism -url = https://github.com/mvertens/CISM-wrapper -fxtag = 34339777afa7b810fd4822fce1039826668b33e4 +url = https://github.com/ESCOMP/CISM-wrapper +fxtag = cismwrap_2_2_001 fxrequired = ToplevelRequired fxDONOTUSEurl = https://github.com/ESCOMP/CISM-wrapper @@ -35,8 +35,8 @@ fxDONOTUSEurl = https://github.com/ESCOMP/mizuRoute [submodule "ccs_config"] path = ccs_config -url = https://github.com/mvertens/ccs_config_cesm.git -fxtag = dbb02c0ccd1492fe278885f8a07a71fa80064319 +url = https://github.com/ESMCI/ccs_config_cesm.git +fxtag = ccs_config_cesm0.0.110 fxrequired = ToplevelRequired fxDONOTUSEurl = https://github.com/ESMCI/ccs_config_cesm.git @@ -49,8 +49,8 @@ fxDONOTUSEurl = https://github.com/ESMCI/cime [submodule "cmeps"] path = components/cmeps -url = https://github.com/mvertens/CMEPS.git -fxtag = 4dca7c602e54189b74b1d0195c433d1b83475553 +url = https://github.com/ESCOMP/CMEPS.git +fxtag = cmeps0.14.67 fxrequired = ToplevelRequired fxDONOTUSEurl = https://github.com/ESCOMP/CMEPS.git diff --git a/ccs_config b/ccs_config index dbb02c0ccd..c30a283155 160000 --- a/ccs_config +++ b/ccs_config @@ -1 +1 @@ -Subproject commit dbb02c0ccd1492fe278885f8a07a71fa80064319 +Subproject commit c30a2831556f269675971b11c5c156ea92599878 diff --git a/components/cism b/components/cism index 34339777af..c05dd5c4fc 160000 --- a/components/cism +++ b/components/cism @@ -1 +1 @@ -Subproject commit 34339777afa7b810fd4822fce1039826668b33e4 +Subproject commit c05dd5c4fc85327e76523aaea9cfe1e388748928 diff --git a/components/cmeps b/components/cmeps index 4dca7c602e..90f815ba9e 160000 --- a/components/cmeps +++ b/components/cmeps @@ -1 +1 @@ -Subproject commit 4dca7c602e54189b74b1d0195c433d1b83475553 +Subproject commit 90f815ba9e7493d71043b5d8e627a3f20bd5dc78 From fb9529577c1e1f294cce17c0a0285f78b98554ce Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Mon, 1 Jul 2024 12:59:23 -0600 Subject: [PATCH 0622/1248] Update cismwrapper tag to the correct new one --- .gitmodules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitmodules b/.gitmodules index eb2a0980f4..615de28b6f 100644 --- a/.gitmodules +++ b/.gitmodules @@ -8,7 +8,7 @@ fxDONOTUSEurl = https://github.com/NCAR/fates-release [submodule "cism"] path = components/cism url = https://github.com/ESCOMP/CISM-wrapper -fxtag = cismwrap_2_2_001 +fxtag = cismwrap_2_2_002 fxrequired = ToplevelRequired fxDONOTUSEurl = https://github.com/ESCOMP/CISM-wrapper From de1b44ca4c9ef7c9116b41f1969a7998bcf21a84 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Mon, 1 Jul 2024 13:01:37 -0600 Subject: [PATCH 0623/1248] Ran ./bin/git-fleximod update, so now update the cism module itself --- components/cism | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/cism b/components/cism index c05dd5c4fc..c84cc9f5b3 160000 --- a/components/cism +++ b/components/cism @@ -1 +1 @@ -Subproject commit c05dd5c4fc85327e76523aaea9cfe1e388748928 +Subproject commit c84cc9f5b3103766a35d0a7ddd5e9dbd7deae762 From e1b2bdabb4b2c74a27bbf12d4cca677452396de7 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Tue, 2 Jul 2024 17:03:19 -0600 Subject: [PATCH 0624/1248] Correct the tags that I used for ccs_config and cmeps --- .gitmodules | 4 ++-- ccs_config | 2 +- components/cmeps | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.gitmodules b/.gitmodules index 615de28b6f..897824e9cc 100644 --- a/.gitmodules +++ b/.gitmodules @@ -36,7 +36,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_cesm0.0.110 +fxtag = ccs_config_cesm1.0.0 fxrequired = ToplevelRequired fxDONOTUSEurl = https://github.com/ESMCI/ccs_config_cesm.git @@ -50,7 +50,7 @@ fxDONOTUSEurl = https://github.com/ESMCI/cime [submodule "cmeps"] path = components/cmeps url = https://github.com/ESCOMP/CMEPS.git -fxtag = cmeps0.14.67 +fxtag = cmeps0.14.77 fxrequired = ToplevelRequired fxDONOTUSEurl = https://github.com/ESCOMP/CMEPS.git diff --git a/ccs_config b/ccs_config index c30a283155..69a958581e 160000 --- a/ccs_config +++ b/ccs_config @@ -1 +1 @@ -Subproject commit c30a2831556f269675971b11c5c156ea92599878 +Subproject commit 69a958581ecd2d32ee9cb1c38bcd3847b8b920bf diff --git a/components/cmeps b/components/cmeps index 90f815ba9e..47fb4e633a 160000 --- a/components/cmeps +++ b/components/cmeps @@ -1 +1 @@ -Subproject commit 90f815ba9e7493d71043b5d8e627a3f20bd5dc78 +Subproject commit 47fb4e633a76ec6d60969b1af751f90790387246 From 0e6eed5f399eb85744410ecf1962c0416c7846ba Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Fri, 5 Jul 2024 10:57:34 -0700 Subject: [PATCH 0625/1248] Revert "update seed dispersal test mod to put on-the-fly generated paramfile in the case directory" This reverts commit 889cc97d4172e85edc7f6c53f4a71ec89048a4d5. I forgot that #2322 prevents this from working. --- .../testdefs/testmods_dirs/clm/FatesColdSeedDisp/shell_commands | 2 +- .../testdefs/testmods_dirs/clm/FatesColdSeedDisp/user_nl_clm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesColdSeedDisp/shell_commands b/cime_config/testdefs/testmods_dirs/clm/FatesColdSeedDisp/shell_commands index db5a1f8672..94a832af25 100644 --- a/cime_config/testdefs/testmods_dirs/clm/FatesColdSeedDisp/shell_commands +++ b/cime_config/testdefs/testmods_dirs/clm/FatesColdSeedDisp/shell_commands @@ -1,7 +1,7 @@ SRCDIR=`./xmlquery SRCROOT --value` CASEDIR=`./xmlquery CASEROOT --value` FATESDIR=$SRCDIR/src/fates/ -FATESPARAMFILE=$CASEDIR/fates_params_seeddisp_4x5.nc +FATESPARAMFILE=$SRCDIR/fates_params_seeddisp_4x5.nc ncgen -o $FATESPARAMFILE $FATESDIR/parameter_files/fates_params_default.cdl diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesColdSeedDisp/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/FatesColdSeedDisp/user_nl_clm index ecd1dc8b57..e8d24253c1 100644 --- a/cime_config/testdefs/testmods_dirs/clm/FatesColdSeedDisp/user_nl_clm +++ b/cime_config/testdefs/testmods_dirs/clm/FatesColdSeedDisp/user_nl_clm @@ -1,3 +1,3 @@ -fates_paramfile = '$CASEROOT/fates_params_seeddisp_4x5.nc' +fates_paramfile = '$SRCROOT/fates_params_seeddisp_4x5.nc' fates_seeddisp_cadence = 1 hist_fincl1 = 'FATES_SEEDS_IN_GRIDCELL_PF', 'FATES_SEEDS_OUT_GRIDCELL_PF' From 8ae9c3329165f8f5f63cd35a415e3ba9478d52f8 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Fri, 5 Jul 2024 13:53:49 -0600 Subject: [PATCH 0626/1248] Add cam7 lnd_tuning moode options and settings --- bld/namelist_files/namelist_defaults_ctsm.xml | 468 ++++++++++++++++++ .../namelist_definition_ctsm.xml | 4 +- bld/unit_testers/build-namelist_test.pl | 4 +- 3 files changed, 472 insertions(+), 4 deletions(-) diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index e04db59cae..8656389103 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -243,18 +243,24 @@ attributes from the config_cache.xml file (with keys converted to upper-case). >30.0d00 30.0d00 +20.0d00 20.0d00 20.0d00 20.0d00 +20.0d00 20.0d00 20.0d00 20.0d00 +20.0d00 20.0d00 0.010d00 0.010d00 +0.008d00 0.008d00 0.008d00 0.008d00 +0.008d00 0.008d00 0.008d00 0.008d00 +0.008d00 0.008d00 + + +.true. +.true. +.true. +.true. + +.true. + + +.true. + + +.true. +.true. +.true. +.true. + +.true. + + +.true. + + + +.true. +.true. +.true. +.true. + +.true. + + +.true. + @@ -701,6 +772,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). .true. .true. +.true. .true. @@ -734,6 +806,10 @@ attributes from the config_cache.xml file (with keys converted to upper-case). >hgrid=0.9x1.25 maxpft=17 mask=gx1v7 use_cn=.true. use_crop=.false. irrigate=.true. glc_nec=10 do_transient_pfts=.false. +hgrid=0.9x1.25 maxpft=79 mask=gx1v7 use_cn=.true. use_crop=.true. irrigate=.false. glc_nec=10 do_transient_pfts=.false. + + hgrid=0.9x1.25 maxpft=79 mask=gx1v7 use_cn=.true. use_crop=.true. irrigate=.false. glc_nec=10 do_transient_pfts=.false. @@ -755,6 +831,10 @@ attributes from the config_cache.xml file (with keys converted to upper-case). >hgrid=0.9x1.25 maxpft=17 mask=gx1v7 use_cn=.false. use_crop=.false. irrigate=.true. glc_nec=10 do_transient_pfts=.false. +hgrid=0.9x1.25 maxpft=79 mask=gx1v7 use_cn=.true. use_crop=.true. irrigate=.false. glc_nec=10 do_transient_pfts=.false. + + hgrid=0.9x1.25 maxpft=79 mask=gx1v7 use_cn=.true. use_crop=.true. irrigate=.false. glc_nec=10 do_transient_pfts=.false. @@ -777,6 +857,10 @@ attributes from the config_cache.xml file (with keys converted to upper-case). >hgrid=1.9x2.5 maxpft=79 mask=gx1v7 use_cn=.true. use_crop=.true. irrigate=.true. glc_nec=10 do_transient_pfts=.false. +hgrid=0.9x1.25 maxpft=17 mask=gx1v7 use_cn=.false. use_crop=.false. irrigate=.true. glc_nec=10 do_transient_pfts=.false. + + hgrid=0.9x1.25 maxpft=17 mask=gx1v7 use_cn=.false. use_crop=.false. irrigate=.true. glc_nec=10 do_transient_pfts=.false. @@ -800,6 +884,150 @@ attributes from the config_cache.xml file (with keys converted to upper-case). >hgrid=1.9x2.5 maxpft=79 mask=gx1v7 use_cn=.true. use_crop=.true. irrigate=.true. glc_nec=10 do_transient_pfts=.false. + +hgrid=0.9x1.25 maxpft=79 mask=gx1v7 use_cn=.true. use_crop=.true. irrigate=.true. glc_nec=10 do_transient_pfts=.false. + + +hgrid=0.9x1.25 maxpft=79 mask=gx1v7 use_cn=.true. use_crop=.true. irrigate=.true. glc_nec=10 do_transient_pfts=.false. + + +hgrid=0.9x1.25 maxpft=79 mask=gx1v7 use_cn=.true. use_crop=.true. irrigate=.true. glc_nec=10 do_transient_pfts=.false. + + +hgrid=0.9x1.25 maxpft=79 mask=gx1v7 use_cn=.true. use_crop=.true. irrigate=.true. glc_nec=10 do_transient_pfts=.false. + + +hgrid=0.9x1.25 maxpft=79 mask=gx1v7 use_cn=.true. use_crop=.true. irrigate=.true. glc_nec=10 do_transient_pfts=.false. + + +hgrid=0.9x1.25 maxpft=79 mask=gx1v7 use_cn=.true. use_crop=.true. irrigate=.true. glc_nec=10 do_transient_pfts=.false. + + +hgrid=0.9x1.25 maxpft=79 mask=gx1v7 use_cn=.true. use_crop=.true. irrigate=.true. glc_nec=10 do_transient_pfts=.false. + + +hgrid=0.9x1.25 maxpft=79 mask=gx1v7 use_cn=.true. use_crop=.true. irrigate=.true. glc_nec=10 do_transient_pfts=.false. + + +hgrid=0.9x1.25 maxpft=79 mask=gx1v7 use_cn=.true. use_crop=.true. irrigate=.true. glc_nec=10 do_transient_pfts=.false. + + +hgrid=0.9x1.25 maxpft=79 mask=gx1v7 use_cn=.true. use_crop=.true. irrigate=.true. glc_nec=10 do_transient_pfts=.false. + + +hgrid=0.9x1.25 maxpft=79 mask=gx1v7 use_cn=.true. use_crop=.true. irrigate=.true. glc_nec=10 do_transient_pfts=.false. + + +hgrid=0.9x1.25 maxpft=79 mask=gx1v7 use_cn=.true. use_crop=.true. irrigate=.true. glc_nec=10 do_transient_pfts=.false. + + + +hgrid=0.9x1.25 maxpft=79 mask=gx1v7 use_cn=.true. use_crop=.true. irrigate=.true. glc_nec=10 do_transient_pfts=.false. + + + +hgrid=0.9x1.25 maxpft=79 mask=gx1v7 use_cn=.true. use_crop=.true. irrigate=.true. glc_nec=10 do_transient_pfts=.false. + + + +hgrid=0.9x1.25 maxpft=79 mask=gx1v7 use_cn=.true. use_crop=.true. irrigate=.true. glc_nec=10 do_transient_pfts=.false. + + +hgrid=0.9x1.25 maxpft=79 mask=gx1v7 use_cn=.true. use_crop=.true. irrigate=.true. glc_nec=10 do_transient_pfts=.false. + + +hgrid=0.9x1.25 maxpft=79 mask=gx1v7 use_cn=.true. use_crop=.true. irrigate=.true. glc_nec=10 do_transient_pfts=.false. + + +hgrid=0.9x1.25 maxpft=79 mask=gx1v7 use_cn=.true. use_crop=.true. irrigate=.true. glc_nec=10 do_transient_pfts=.false. + + +hgrid=0.9x1.25 maxpft=79 mask=gx1v7 use_cn=.true. use_crop=.true. irrigate=.true. glc_nec=10 do_transient_pfts=.false. + + +hgrid=0.9x1.25 maxpft=79 mask=gx1v7 use_cn=.true. use_crop=.true. irrigate=.true. glc_nec=10 do_transient_pfts=.false. + + + + +hgrid=ne120np4.pg3 maxpft=79 mask=tx0.1v3 use_cn=.true. use_crop=.true. irrigate=.true. glc_nec=10 do_transient_pfts=.false. + + + + +hgrid=0.9x1.25 maxpft=17 mask=gx1v7 use_cn=.false. use_crop=.false. irrigate=.true. glc_nec=10 do_transient_pfts=.false. + + +hgrid=1.9x2.5 maxpft=17 mask=gx1v7 use_cn=.false. use_crop=.false. irrigate=.true. glc_nec=10 do_transient_pfts=.false. + + +hgrid=ne0np4.ARCTIC.ne30x4 maxpft=17 mask=tx0.1v2 use_cn=.false. use_crop=.false. irrigate=.true. glc_nec=10 do_transient_pfts=.false. + + +hgrid=ne0np4.ARCTICGRIS.ne30x8 maxpft=17 mask=tx0.1v2 use_cn=.false. use_crop=.false. irrigate=.true. glc_nec=10 do_transient_pfts=.false. + + + +hgrid=1.9x2.5 maxpft=17 mask=gx1v7 use_cn=.false. use_crop=.false. irrigate=.true. glc_nec=10 do_transient_pfts=.false. + + + +hgrid=ne0np4CONUS.ne30x8 maxpft=17 mask=tx0.1v2 use_cn=.false. use_crop=.false. irrigate=.true. glc_nec=10 do_transient_pfts=.false. + + + + lnd/clm2/initdata_map/clmi.I1850Clm45BgcCruGs.1101-01-01.0.9x1.25_gx1v7_simyr1850_c200806.nc +lnd/clm2/initdata_map/clmi.B1850Clm45BgcGs.0161-01-01.0.9x1.25_gx1v7_simyr1850_c200806.nc + + lnd/clm2/initdata_esmf/ctsm5.2/clmi.I1850Clm50BgcCropCru-ciso.1526-01-01.0.9x1.25_gx1v7_simyr1850_c240223.nc +lnd/clm2/initdata_map/clmi.B1850Clm50BgcCrop.0161-01-01.0.9x1.25_gx1v7_simyr1850_c200729.nc + lnd/clm2/initdata_esmf/ctsm5.2/clmi.I2000Clm50BgcCrop.2011-01-01.1.9x2.5_gx1v7_gl4_simyr2000_c240223.nc + +lnd/clm2/initdata_map/clmi.BHIST.2000-01-01.0.9x1.25_gx1v7_simyr1979_c200806.nc + + lnd/clm2/initdata_map/clmi.BHIST.2000-01-01.0.9x1.25_gx1v7_simyr1979_c200806.nc + + +lnd/clm2/initdata_map/clmi.BHIST.2000-01-01.0.9x1.25_gx1v7_simyr1979_c200806.nc + + +lnd/clm2/initdata_map/clmi.BHIST.2000-01-01.1.9x2.5_gx1v7_simyr1979_c200806.nc + + + +lnd/clm2/initdata_map/clmi.FHISTSp.1979-01-01.ARCTIC_ne30x4_mt12_simyr1979_c200806.nc + + + +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.BHIST.2000-01-01.0.9x1.25_gx1v7_simyr2000_c200728.nc + + +lnd/clm2/initdata_map/clmi.BHIST.2000-01-01.0.9x1.25_gx1v7_simyr2000_c200728.nc + + +lnd/clm2/initdata_map/clmi.BHIST.2000-01-01.0.9x1.25_gx1v7_simyr2000_c200728.nc + + + +lnd/clm2/initdata_map/clmi.BHISTSp.2000-01-01.1.9x2.5_gx1v7_simyr2003_c200807.nc + + + + +lnd/clm2/initdata_map/clmi.FHISTSp.2013-01-01.ne0CONUSne30x8_mt12_simyr2013_c200806.nc + + +lnd/clm2/initdata_map/clmi.BHIST.2000-01-01.0.9x1.25_gx1v7_simyr1979_c200806.nc + + +lnd/clm2/initdata_map/clmi.BHIST.2000-01-01.1.9x2.5_gx1v7_simyr1979_c200806.nc + + + +lnd/clm2/initdata_map/clmi.FHISTSp.1979-01-01.ARCTIC_ne30x4_mt12_simyr1979_c200806.nc + + + +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.BHIST.2000-01-01.0.9x1.25_gx1v7_simyr2000_c200728.nc + + + +lnd/clm2/initdata_map/clmi.BHISTSp.2000-01-01.1.9x2.5_gx1v7_simyr2003_c200807.nc + + + + +lnd/clm2/initdata_map/clmi.FHISTSp.2013-01-01.ne0CONUSne30x8_mt12_simyr2013_c200806.nc + + +lnd/clm2/initdata_map/clmi.BHIST.2000-01-01.0.9x1.25_gx1v7_simyr1979_c200806.nc + + +lnd/clm2/initdata_map/clmi.BHIST.2000-01-01.1.9x2.5_gx1v7_simyr1979_c200806.nc + + + +lnd/clm2/initdata_map/clmi.FHISTSp.1979-01-01.ARCTIC_ne30x4_mt12_simyr1979_c200806.nc + + + +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.BHIST.2000-01-01.0.9x1.25_gx1v7_simyr2000_c200728.nc + + + +lnd/clm2/initdata_map/clmi.BHISTSp.2000-01-01.1.9x2.5_gx1v7_simyr2003_c200807.nc + + + + +lnd/clm2/initdata_map/clmi.FHISTSp.2013-01-01.ne0CONUSne30x8_mt12_simyr2013_c200806.nc + + @@ -1951,6 +2407,12 @@ lnd/clm2/surfdata_esmf/NEON/surfdata_1x1_NEON_TOOL_hist_78pfts_CMIP6_simyr2000_c Zender_2003 atm bilinear +lnd/clm2/dustemisdata/dst_source2x2tunedcam6-2x2-forCLM_cdf5_c230312.nc +lnd/clm2/dustemisdata/dst_source2x2tunedcam6-2x2-forCLM_cdf5_c230312.nc +lnd/clm2/dustemisdata/dst_source2x2tunedcam6-2x2-forCLM_cdf5_c230312.nc lnd/clm2/dustemisdata/dst_source2x2tunedcam6-2x2-forCLM_cdf5_c230312.nc lnd/clm2/dustemisdata/dst_source1x1tuned-cam4-forCLM_cdf5_c240202.nc lnd/clm2/dustemisdata/dst_source1x1tuned-cam4-forCLM_cdf5_c240202.nc +lnd/clm2/dustemisdata/dst_source2x2tunedcam6-2x2-forCLM_cdf5_c230312.nc +lnd/clm2/dustemisdata/dst_source2x2tunedcam6-2x2-forCLM_cdf5_c230312.nc +lnd/clm2/dustemisdata/dst_source2x2tunedcam6-2x2-forCLM_cdf5_c230312.nc lnd/clm2/dustemisdata/dst_source2x2tunedcam6-2x2-forCLM_cdf5_c230312.nc - + + valid_values="clm4_5_CRUv7,clm4_5_GSWP3v1,clm4_5_cam7.0,clm4_5_cam6.0,clm4_5_cam5.0,clm4_5_cam4_0,clm5_0_cam7.0,clm5_0_cam6.0,clm5_0_cam5.0,clm5_0_cam4.0,clm5_0_CRUv7,clm5_0_GSWP3v1,clm5_1_GSWP3v1,clm5_1_CRUv7,clm5_1_cam7.0,clm5_1_cam6.0,clm5_1_cam5.0,clm5_1_cam4.0,clm6_0_GSWP3v1,clm6_0_cam7.0,clm6_0_cam6.0,clm6_0_cam5.0,clm6_0_cam4.0"> General configuration of model version and atmospheric forcing to tune the model to run under. This sets the model to run with constants and initial conditions that were set to run well under the configuration of model version and atmospheric forcing. To run well constants would need to be changed diff --git a/bld/unit_testers/build-namelist_test.pl b/bld/unit_testers/build-namelist_test.pl index 53c71ae0e9..2147fdea31 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 = 3254; +my $ntests = 3278; if ( defined($opts{'compare'}) ) { $ntests += 2001; @@ -1802,7 +1802,7 @@ sub cat_and_create_namelistinfile { my $mode = "-phys $phys"; &make_config_cache($phys); my @forclist = (); - @forclist = ( "CRUv7", "GSWP3v1", "cam6.0", "cam5.0", "cam4.0" ); + @forclist = ( "CRUv7", "GSWP3v1", "cam7.0", "cam6.0", "cam5.0", "cam4.0" ); foreach my $forc ( @forclist ) { foreach my $bgc ( "sp", "bgc" ) { my $lndtuningmode = "${phys}_${forc}"; From f303264ff62cfc0f9752573a0bc404573287c787 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Fri, 5 Jul 2024 15:11:58 -0600 Subject: [PATCH 0627/1248] Fix cam4.0 clm4_5 lnd_tuning_mode name --- bld/namelist_files/namelist_definition_ctsm.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bld/namelist_files/namelist_definition_ctsm.xml b/bld/namelist_files/namelist_definition_ctsm.xml index 02b7356b52..5e65a3a603 100644 --- a/bld/namelist_files/namelist_definition_ctsm.xml +++ b/bld/namelist_files/namelist_definition_ctsm.xml @@ -2043,7 +2043,7 @@ Land mask description + valid_values="clm4_5_CRUv7,clm4_5_GSWP3v1,clm4_5_cam7.0,clm4_5_cam6.0,clm4_5_cam5.0,clm4_5_cam4.0,clm5_0_cam7.0,clm5_0_cam6.0,clm5_0_cam5.0,clm5_0_cam4.0,clm5_0_CRUv7,clm5_0_GSWP3v1,clm5_1_GSWP3v1,clm5_1_CRUv7,clm5_1_cam7.0,clm5_1_cam6.0,clm5_1_cam5.0,clm5_1_cam4.0,clm6_0_GSWP3v1,clm6_0_cam7.0,clm6_0_cam6.0,clm6_0_cam5.0,clm6_0_cam4.0"> General configuration of model version and atmospheric forcing to tune the model to run under. This sets the model to run with constants and initial conditions that were set to run well under the configuration of model version and atmospheric forcing. To run well constants would need to be changed From 4670b6e2c3df9af6d03eb900cd0eed4877eaab59 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Fri, 5 Jul 2024 15:57:35 -0600 Subject: [PATCH 0628/1248] Allow a C or E to follow the period, which is needed by cesm3 all active compsets --- cime_config/config_component.xml | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/cime_config/config_component.xml b/cime_config/config_component.xml index d69bdbc302..859883db8e 100644 --- a/cime_config/config_component.xml +++ b/cime_config/config_component.xml @@ -199,22 +199,22 @@ UNSET - 2010_control - 2000_control - 1850_control + 2010_control + 2000_control + 1850_control 1850_noanthro_control 1850_noanthro_control - 20thC_transient - 1850-2100_SSP5-8.5_transient - 1850-2100_SSP1-2.6_transient - 1850-2100_SSP3-7.0_transient - 1850-2100_SSP5-3.4_transient - 1850-2100_SSP2-4.5_transient + 20thC_transient + 1850-2100_SSP5-8.5_transient + 1850-2100_SSP1-2.6_transient + 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 - 1850-2100_SSP5-8.5_transient + 1850-2100_SSP1-1.9_transient + 1850-2100_SSP4-3.4_transient + 1850-2100_SSP4-6.0_transient + 1850-2100_SSP5-8.5_transient 20thC_transient 1850-2100_SSP5-8.5_transient From 03fb25a2a6d94753d7abbb4300fa32b917883969 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Fri, 5 Jul 2024 16:18:47 -0600 Subject: [PATCH 0629/1248] Two new tests in testlist_clm and two new tests in expected fails --- cime_config/testdefs/ExpectedTestFails.xml | 15 +++++++++++++++ cime_config/testdefs/testlist_clm.xml | 20 ++++++++++++++++++++ 2 files changed, 35 insertions(+) diff --git a/cime_config/testdefs/ExpectedTestFails.xml b/cime_config/testdefs/ExpectedTestFails.xml index 664b1c8e35..59802d9109 100644 --- a/cime_config/testdefs/ExpectedTestFails.xml +++ b/cime_config/testdefs/ExpectedTestFails.xml @@ -44,6 +44,21 @@ + + + FAIL + #2619 + This failure relates to the following REP failure. + + + + + FAIL + #2619 + This failure relates to the preceding ERP failure. + + + FAIL diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index 625a9f3504..23cc5ebcc5 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -1445,6 +1445,26 @@ + + + + + + + + + + + + + + + + + + + + From 0efd37fe16814134389b9c49a30c7c033828c462 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Fri, 5 Jul 2024 17:55:44 -0600 Subject: [PATCH 0630/1248] New testmods /matrixcnOn_Hist to use -ignore_warnings in IHist compsets --- cime_config/testdefs/ExpectedTestFails.xml | 4 +-- cime_config/testdefs/testlist_clm.xml | 28 +++++++++---------- .../clm/matrixcnOn_Hist/include_user_mods | 1 + .../clm/matrixcnOn_Hist/shell_commands | 3 ++ 4 files changed, 20 insertions(+), 16 deletions(-) create mode 100644 cime_config/testdefs/testmods_dirs/clm/matrixcnOn_Hist/include_user_mods create mode 100644 cime_config/testdefs/testmods_dirs/clm/matrixcnOn_Hist/shell_commands diff --git a/cime_config/testdefs/ExpectedTestFails.xml b/cime_config/testdefs/ExpectedTestFails.xml index 59802d9109..1243c125c0 100644 --- a/cime_config/testdefs/ExpectedTestFails.xml +++ b/cime_config/testdefs/ExpectedTestFails.xml @@ -44,14 +44,14 @@ - + FAIL #2619 This failure relates to the following REP failure. - + FAIL #2619 diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index 23cc5ebcc5..1fe5ed770d 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -548,7 +548,7 @@ - + @@ -794,7 +794,7 @@ - + @@ -1002,7 +1002,7 @@ - + @@ -1020,7 +1020,7 @@ - + @@ -1038,7 +1038,7 @@ - + @@ -1234,7 +1234,7 @@ - + @@ -1354,7 +1354,7 @@ - + @@ -1435,7 +1435,7 @@ - + @@ -1445,7 +1445,7 @@ - + @@ -1455,7 +1455,7 @@ - + @@ -1793,7 +1793,7 @@ - + @@ -1849,7 +1849,7 @@ - + @@ -1925,7 +1925,7 @@ - + @@ -2369,7 +2369,7 @@ - + diff --git a/cime_config/testdefs/testmods_dirs/clm/matrixcnOn_Hist/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/matrixcnOn_Hist/include_user_mods new file mode 100644 index 0000000000..a3c70cba11 --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/matrixcnOn_Hist/include_user_mods @@ -0,0 +1 @@ +../matrixcnOn diff --git a/cime_config/testdefs/testmods_dirs/clm/matrixcnOn_Hist/shell_commands b/cime_config/testdefs/testmods_dirs/clm/matrixcnOn_Hist/shell_commands new file mode 100644 index 0000000000..f0547f3f26 --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/matrixcnOn_Hist/shell_commands @@ -0,0 +1,3 @@ +#!/bin/bash + +./xmlchange CLM_BLDNML_OPTS="-ignore_warnings" --append From a486e86065223a882790a6078647a82c592ffdaf Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Fri, 5 Jul 2024 17:15:08 -0700 Subject: [PATCH 0631/1248] update harvest parameter variables lengths Updating all lengths to account for the update to the clmlanduse name option change --- src/dyn_subgrid/dynFATESLandUseChangeMod.F90 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/dyn_subgrid/dynFATESLandUseChangeMod.F90 b/src/dyn_subgrid/dynFATESLandUseChangeMod.F90 index b440b55dc9..681d39f38c 100644 --- a/src/dyn_subgrid/dynFATESLandUseChangeMod.F90 +++ b/src/dyn_subgrid/dynFATESLandUseChangeMod.F90 @@ -35,11 +35,11 @@ module dynFATESLandUseChangeMod integer, public, parameter :: num_landuse_harvest_vars = 5 ! Define the fates landuse namelist mode switch values - character(len=13), public, parameter :: fates_harvest_no_logging = 'no_harvest' - character(len=13), public, parameter :: fates_harvest_logging_only = 'event_code' - character(len=13), public, parameter :: fates_harvest_clmlanduse = 'landuse_timeseries' - character(len=13), public, parameter :: fates_harvest_luh_area = 'luhdata_area' - character(len=13), public, parameter :: fates_harvest_luh_mass = 'luhdata_mass' + character(len=18), public, parameter :: fates_harvest_no_logging = 'no_harvest' + character(len=18), public, parameter :: fates_harvest_logging_only = 'event_code' + character(len=18), public, parameter :: fates_harvest_clmlanduse = 'landuse_timeseries' + character(len=18), public, parameter :: fates_harvest_luh_area = 'luhdata_area' + character(len=18), public, parameter :: fates_harvest_luh_mass = 'luhdata_mass' ! Define landuse harvest unit integer representation integer, public, parameter :: landuse_harvest_area_units = 1 From d940ee014cb52f92cdc0da415084f349ab45abae Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Sat, 6 Jul 2024 13:00:34 -0600 Subject: [PATCH 0632/1248] Add ._r8 to hardwired constants --- src/biogeochem/VOCEmissionMod.F90 | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/biogeochem/VOCEmissionMod.F90 b/src/biogeochem/VOCEmissionMod.F90 index 9833fe3de9..7ba90fd457 100644 --- a/src/biogeochem/VOCEmissionMod.F90 +++ b/src/biogeochem/VOCEmissionMod.F90 @@ -835,13 +835,13 @@ function get_gamma_SM(btran_in) real(r8),intent(in) :: btran_in !!!------- the drought algorithm-------- - real(r8), parameter :: a1 = -7.4463 - real(r8), parameter :: b1 = 3.2552 + real(r8), parameter :: a1 = -7.4463_r8 + real(r8), parameter :: b1 = 3.2552_r8 real(r8) :: get_gamma_SM - if (btran_in >= 1.) then + if (btran_in >= 1._r8) then get_gamma_SM = 1 else - get_gamma_SM = 1/(1+b1*exp(a1*(btran_in-0.2))) + get_gamma_SM = 1._r8 / (1._r8 + b1 * exp(a1 * (btran_in - 0.2_r8))) endif end function get_gamma_SM @@ -968,9 +968,9 @@ function get_gamma_T(t_veg240_in, t_veg24_in,t_veg_in, ct1_in, ct2_in, betaT_in, topt = co1 + (co2 * (t_veg240_in-tstd0)) if ( (ivt_in == nbrdlf_dcd_brl_shrub) ) then ! boreal-deciduous-shrub ! coming from BEAR-oNS campaign willows results - Eopt = 7.9 * exp (0.217_r8 * (t_veg24_in-273.15_r8-24.0_r8)) + Eopt = 7.9_r8 * exp (0.217_r8 * (t_veg24_in - 273.15_r8 - 24.0_r8)) else if ( (ivt_in == nc3_arctic_grass ) ) then ! boreal-grass - Eopt = exp(0.12*(t_veg240_in-288.15_r8)) + Eopt = exp(0.12_r8 * (t_veg240_in - 288.15_r8)) else Eopt = Ceo_in * exp (co4 * (t_veg24_in-tstd0)) * exp(co4 * (t_veg240_in -tstd0)) endif @@ -982,13 +982,13 @@ function get_gamma_T(t_veg240_in, t_veg24_in,t_veg_in, ct1_in, ct2_in, betaT_in, x = ( (1._r8/topt) - (1._r8/(t_veg_in)) ) / ct3 ! for the boreal grass from BEAR-oNS campaign if ( (ivt_in == nc3_arctic_grass ) ) then ! boreal-grass - bet_arc_c3 = 95+9.49*exp(0.53*(288.15_r8-t_veg240_in)) - if (bet_arc_c3 .gt. 300) then - bet_arc_c3 = 300 + bet_arc_c3 = 95._r8 + 9.49_r8 * exp(0.53_r8 * (288.15_r8 - t_veg240_in)) + if (bet_arc_c3 > 300._r8) then + bet_arc_c3 = 300._r8 endif - gamma_t_LDF = Eopt * exp(bet_arc_c3*((1/303.15_r8 - 1.0_r8/(t_veg_in))/ct3)) + gamma_t_LDF = Eopt * exp(bet_arc_c3 * ((1._r8 / 303.15_r8 - 1.0_r8 / t_veg_in) / ct3)) else - gamma_t_LDF = Eopt * ( ct2_in * exp(ct1_in * x)/(ct2_in - ct1_in * (1._r8 - exp(ct2_in * x))) ) + gamma_t_LDF = Eopt * ( ct2_in * exp(ct1_in * x) / (ct2_in - ct1_in * (1._r8 - exp(ct2_in * x))) ) endif From de689e418343c903193bbb4e0f7075a91a94dc1b Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Mon, 8 Jul 2024 11:23:22 -0600 Subject: [PATCH 0633/1248] Update bld/namelist_files/namelist_defaults_ctsm.xml Co-authored-by: Samuel Levis --- 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 8656389103..e81cd6dab9 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -2407,11 +2407,11 @@ lnd/clm2/surfdata_esmf/NEON/surfdata_1x1_NEON_TOOL_hist_78pfts_CMIP6_simyr2000_c Zender_2003 atm bilinear -lnd/clm2/dustemisdata/dst_source2x2tunedcam6-2x2-forCLM_cdf5_c230312.nc -lnd/clm2/dustemisdata/dst_source2x2tunedcam6-2x2-forCLM_cdf5_c230312.nc -lnd/clm2/dustemisdata/dst_source2x2tunedcam6-2x2-forCLM_cdf5_c230312.nc lnd/clm2/dustemisdata/dst_source2x2tunedcam6-2x2-forCLM_cdf5_c230312.nc From f745c21641baa3cbabd0e2dbe5e734a237a31e22 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Mon, 8 Jul 2024 13:33:10 -0600 Subject: [PATCH 0634/1248] Consistency in RE and don't require a C or E Make the Regular Expressions more consistent. Don't allow the use of CLM51 for all options. Make CPLHIST CAM version depend on which CLM version is used. Make sure explicit matches for CAM60 are there. --- cime_config/config_component.xml | 68 +++++++++++++++++--------------- 1 file changed, 36 insertions(+), 32 deletions(-) diff --git a/cime_config/config_component.xml b/cime_config/config_component.xml index 859883db8e..04306c0e40 100644 --- a/cime_config/config_component.xml +++ b/cime_config/config_component.xml @@ -87,10 +87,11 @@ clm4_5_CRUv7 clm4_5_GSWP3v1 clm4_5_cam6.0 - clm4_5_cam4.0 - clm4_5_cam5.0 - clm4_5_cam7.0 - clm4_5_cam6.0 + clm4_5_cam4.0 + clm4_5_cam5.0 + clm4_5_cam6.0 + clm4_5_cam7.0 + clm4_5_cam5.0 clm4_5_QIAN clm4_5_QIAN clm4_5_1PT @@ -102,9 +103,10 @@ clm5_0_GSWP3v1 clm5_0_GSWP3v1 clm5_0_cam6.0 - clm5_0_cam4.0 - clm5_0_cam5.0 - clm5_0_cam7.0 + clm5_0_cam4.0 + clm5_0_cam5.0 + clm5_0_cam6.0 + clm5_0_cam7.0 clm5_0_cam6.0 clm5_0_QIAN clm5_0_QIAN @@ -112,22 +114,24 @@ clm5_0_NLDAS2 clm5_0_ERA5 - clm5_1_GSWP3v1 clm5_1_GSWP3v1 - clm5_1_cam6.0 - clm5_1_cam4.0 - clm5_1_cam5.0 - clm5_1_cam6.0 + INVALID_USE_CLM60_NOT_CLM51 + clm5_1_cam4.0 + clm5_1_cam5.0 + clm5_1_cam6.0 + INVALID_USE_CLM60_NOT_CLM51_FOR_CAM70 + INVALID_USE_CLM60_NOT_CLM51_FOR_CPLHIST clm6_0_CRUv7 clm6_0_CRUv7 clm6_0_GSWP3v1 clm6_0_GSWP3v1 clm6_0_cam6.0 - clm6_0_cam4.0 - clm6_0_cam5.0 - clm6_0_cam7.0 - clm6_0_cam6.0 + clm6_0_cam4.0 + clm6_0_cam5.0 + clm6_0_cam6.0 + clm6_0_cam7.0 + clm6_0_cam7.0 clm6_0_QIAN clm6_0_QIAN clm6_0_1PT @@ -199,24 +203,24 @@ UNSET - 2010_control - 2000_control - 1850_control + 2010_control + 2000_control + 1850_control 1850_noanthro_control 1850_noanthro_control - 20thC_transient - 1850-2100_SSP5-8.5_transient - 1850-2100_SSP1-2.6_transient - 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 - 1850-2100_SSP5-8.5_transient - 20thC_transient - 1850-2100_SSP5-8.5_transient + 20thC_transient + 1850-2100_SSP5-8.5_transient + 1850-2100_SSP1-2.6_transient + 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 + 1850-2100_SSP5-8.5_transient + 20thC_transient + 1850-2100_SSP5-8.5_transient run_component_ctsm env_run.xml From bf02a881a6e18c137e5e7917754d381d62c2b94b Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Mon, 8 Jul 2024 13:51:42 -0600 Subject: [PATCH 0635/1248] Change some comments to respond to @slevis-lmwg review --- bld/namelist_files/namelist_defaults_ctsm.xml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index e81cd6dab9..eb25cbf486 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -706,7 +706,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). maxpft="17" use_cn=".false." use_crop=".false." hgrid="ne0np4CONUS.ne30x8" >.true. .true. 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 - + 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 - + 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 - + Date: Mon, 8 Jul 2024 14:07:35 -0600 Subject: [PATCH 0636/1248] More lines to describe the finidat sections Add some comments to talk about what kind of land tuning mode is being done for a section of finidat files. --- bld/namelist_files/namelist_defaults_ctsm.xml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index eb25cbf486..c6430bfff2 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -1326,7 +1326,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). - + lnd/clm2/initdata_map/clmi.BHIST.2000-01-01.0.9x1.25_gx1v7_simyr2000_c200728.nc + + lnd/clm2/initdata_map/clmi.BHIST.2000-01-01.0.9x1.25_gx1v7_simyr2000_c200728.nc + lnd/clm2/initdata_map/clmi.BHIST.2000-01-01.0.9x1.25_gx1v7_simyr2000_c200728.nc + - + lnd/clm2/initdata_map/clmi.FHISTSp.2013-01-01.ne0CONUSne30x8_mt12_simyr2013_c200806.nc + lnd/clm2/initdata_map/clmi.FHISTSp.2013-01-01.ne0CONUSne30x8_mt12_simyr2013_c200806.nc + Date: Mon, 8 Jul 2024 14:30:22 -0600 Subject: [PATCH 0637/1248] Update test number --- 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 2147fdea31..3464dfadef 100755 --- a/bld/unit_testers/build-namelist_test.pl +++ b/bld/unit_testers/build-namelist_test.pl @@ -166,7 +166,7 @@ sub cat_and_create_namelistinfile { my $ntests = 3278; if ( defined($opts{'compare'}) ) { - $ntests += 2001; + $ntests += 1981; } plan( tests=>$ntests ); From fafc8137baeb39c07c65e697def4488b86aab612 Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Mon, 8 Jul 2024 14:53:52 -0700 Subject: [PATCH 0638/1248] update fates submodule to api 36 --- .gitmodules | 4 ++-- src/fates | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitmodules b/.gitmodules index 049c62ade8..9ed4402c7e 100644 --- a/.gitmodules +++ b/.gitmodules @@ -27,8 +27,8 @@ # [submodule "fates"] path = src/fates -url = https://github.com/ckoven/fates -fxtag = 4b018eade498d063b21dddf26f77c9658ff80261 +url = https://github.com/NGEET/fates +fxtag = sci.1.77.0_api.36.0.0 fxrequired = AlwaysRequired # Standard Fork to compare to with "git fleximod test" to ensure personal forks aren't committed fxDONOTUSEurl = https://github.com/NCAR/fates-release diff --git a/src/fates b/src/fates index 4b018eade4..fd7f3438c2 160000 --- a/src/fates +++ b/src/fates @@ -1 +1 @@ -Subproject commit 4b018eade498d063b21dddf26f77c9658ff80261 +Subproject commit fd7f3438c2ff821672b703050e7011f293649ee9 From 7fac3e9c5c205391b0e359a4838bc48447b58240 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Mon, 8 Jul 2024 16:46:10 -0600 Subject: [PATCH 0639/1248] Change cam6 lnd_tuning_mode to cam7, and remove the cam7 Zender Dust tests (as Zender won't be the option for cam7) --- cime_config/testdefs/testlist_clm.xml | 79 ++++++++++--------- .../include_user_mods | 1 - .../clm60cam6LndTuningModeCiso/user_nl_clm | 5 -- .../include_user_mods | 1 - .../user_nl_clm | 3 - .../include_user_mods | 1 - .../include_user_mods | 1 - .../include_user_mods | 1 + .../shell_commands | 0 .../include_user_mods | 1 + .../shell_commands | 0 11 files changed, 42 insertions(+), 51 deletions(-) delete mode 100644 cime_config/testdefs/testmods_dirs/clm/clm60cam6LndTuningModeCiso/include_user_mods delete mode 100644 cime_config/testdefs/testmods_dirs/clm/clm60cam6LndTuningModeCiso/user_nl_clm delete mode 100644 cime_config/testdefs/testmods_dirs/clm/clm60cam6LndTuningModeZDustSoilErod/include_user_mods delete mode 100644 cime_config/testdefs/testmods_dirs/clm/clm60cam6LndTuningModeZDustSoilErod/user_nl_clm delete mode 100644 cime_config/testdefs/testmods_dirs/clm/clm60cam6LndTuningMode_1979Start/include_user_mods delete mode 100644 cime_config/testdefs/testmods_dirs/clm/clm60cam6LndTuningMode_2013Start/include_user_mods create mode 100644 cime_config/testdefs/testmods_dirs/clm/clm60cam7LndTuningMode_1979Start/include_user_mods rename cime_config/testdefs/testmods_dirs/clm/{clm60cam6LndTuningMode_1979Start => clm60cam7LndTuningMode_1979Start}/shell_commands (100%) create mode 100644 cime_config/testdefs/testmods_dirs/clm/clm60cam7LndTuningMode_2013Start/include_user_mods rename cime_config/testdefs/testmods_dirs/clm/{clm60cam6LndTuningMode_2013Start => clm60cam7LndTuningMode_2013Start}/shell_commands (100%) diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index 707a310f89..4b6f1dc46f 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -63,6 +63,7 @@ + @@ -80,22 +81,22 @@ - + - + - + - + @@ -109,7 +110,7 @@ - + @@ -118,7 +119,7 @@ - + @@ -127,7 +128,7 @@ - + @@ -136,7 +137,7 @@ - + @@ -145,7 +146,7 @@ - + @@ -155,7 +156,7 @@ - + @@ -182,7 +183,7 @@ - + @@ -191,7 +192,7 @@ - + @@ -200,7 +201,7 @@ - + @@ -209,7 +210,7 @@ - + @@ -218,7 +219,7 @@ - + @@ -227,7 +228,7 @@ - + @@ -236,7 +237,7 @@ - + @@ -246,7 +247,7 @@ lnd/clm2/surfdata_map/fates-sci.1.68.3_api.31.0.0_tools.1.0.1/LUH2_states_transitions_management.timeseries_4x5_hist_simyr1650-2015_c240216.nc + >lnd/clm2/surfdata_map/fates-sci.1.68.3_api.31.0.0_tools.1.0.1/LUH2_states_transitions_management.timeseries_4x5_hist_simyr0850-2015_c240216.nc .false. From 03ab3bdefa98b776263c057b50cf4b803f6c4fd7 Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Tue, 9 Jul 2024 10:41:40 -0700 Subject: [PATCH 0645/1248] remove out-dated-comment Checking the landuse x pft data is handled on the fates-side --- src/utils/clmfates_interfaceMod.F90 | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/utils/clmfates_interfaceMod.F90 b/src/utils/clmfates_interfaceMod.F90 index 43a574d6e3..d15288d3a3 100644 --- a/src/utils/clmfates_interfaceMod.F90 +++ b/src/utils/clmfates_interfaceMod.F90 @@ -3915,8 +3915,6 @@ subroutine GetLandusePFTData(bounds, landuse_pft_file, landuse_pft_map, landuse_ deallocate(arraylocal_bareground) call ncd_pio_closefile(ncid) - ! Check that sums equal to unity - end subroutine GetLandusePFTData From 272f99f405e95adec9774519323a34c0f2f9c874 Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Tue, 9 Jul 2024 13:41:55 -0700 Subject: [PATCH 0646/1248] remove unused land use mod subroutine --- src/utils/clmfates_interfaceMod.F90 | 1 - 1 file changed, 1 deletion(-) diff --git a/src/utils/clmfates_interfaceMod.F90 b/src/utils/clmfates_interfaceMod.F90 index d15288d3a3..e3e7644b90 100644 --- a/src/utils/clmfates_interfaceMod.F90 +++ b/src/utils/clmfates_interfaceMod.F90 @@ -182,7 +182,6 @@ module CLMFatesInterfaceMod use dynFATESLandUseChangeMod, only : num_landuse_transition_vars, num_landuse_state_vars use dynFATESLandUseChangeMod, only : landuse_transitions, landuse_states use dynFATESLandUseChangeMod, only : landuse_transition_varnames, landuse_state_varnames - use dynFATESLandUseChangeMod, only : dynFatesLandUseInterp use dynFATESLandUseChangeMod, only : num_landuse_harvest_vars use dynFATESLandUseChangeMod, only : fates_harvest_no_logging use dynFATESLandUseChangeMod, only : fates_harvest_clmlanduse From 72ab1cbf97522984acaceda494b5279fb4ea3621 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Tue, 9 Jul 2024 15:48:06 -0600 Subject: [PATCH 0647/1248] Remove use_dynroot and corresponding code and testing --- bld/CLMBuildNamelist.pm | 20 -- bld/namelist_files/namelist_defaults_ctsm.xml | 3 - .../namelist_definition_ctsm.xml | 5 - bld/unit_testers/build-namelist_test.pl | 5 - cime_config/testdefs/testlist_clm.xml | 17 -- .../clm/clm50dynroots/include_user_mods | 1 - .../clm/clm50dynroots/user_nl_clm | 2 - src/biogeochem/CNDriverMod.F90 | 17 +- src/biogeochem/CNRootDynMod.F90 | 271 ------------------ src/biogeophys/IrrigationMod.F90 | 5 +- src/biogeophys/SoilStateType.F90 | 26 +- src/main/clm_varctl.F90 | 6 - src/main/controlMod.F90 | 10 - src/main/pftconMod.F90 | 14 +- 14 files changed, 7 insertions(+), 395 deletions(-) delete mode 100644 cime_config/testdefs/testmods_dirs/clm/clm50dynroots/include_user_mods delete mode 100644 cime_config/testdefs/testmods_dirs/clm/clm50dynroots/user_nl_clm delete mode 100644 src/biogeochem/CNRootDynMod.F90 diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index f65414e4af..146cf5bd32 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -1582,7 +1582,6 @@ sub process_namelist_inline_logic { setup_logic_hillslope($opts, $nl_flags, $definition, $defaults, $nl); setup_logic_o3_veg_stress_method($opts, $nl_flags, $definition, $defaults, $nl,$physv); setup_logic_hydrstress($opts, $nl_flags, $definition, $defaults, $nl); - setup_logic_dynamic_roots($opts, $nl_flags, $definition, $defaults, $nl, $physv); setup_logic_params_file($opts, $nl_flags, $definition, $defaults, $nl); setup_logic_create_crop_landunit($opts, $nl_flags, $definition, $defaults, $nl); setup_logic_subgrid($opts, $nl_flags, $definition, $defaults, $nl); @@ -3581,25 +3580,6 @@ sub setup_logic_grainproduct { #------------------------------------------------------------------------------- -sub setup_logic_dynamic_roots { - # - # dynamic root model - # - my ($opts, $nl_flags, $definition, $defaults, $nl, $physv) = @_; - - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'use_dynroot', 'phys'=>$physv->as_string(), 'bgc_mode'=>$nl_flags->{'bgc_mode'}); - my $use_dynroot = $nl->get_value('use_dynroot'); - if ( &value_is_true($use_dynroot) && ($nl_flags->{'bgc_mode'} eq "sp") ) { - $log->fatal_error("Cannot turn dynroot mode on mode bgc=sp\n" . - "Set the bgc mode to 'bgc'."); - } - if ( &value_is_true( $use_dynroot ) && &value_is_true( $nl_flags->{'use_hydrstress'} ) ) { - $log->fatal_error("Cannot turn use_dynroot on when use_hydrstress is on" ); - } -} - -#------------------------------------------------------------------------------- - sub setup_logic_c_isotope { # # Error checking for C-isotope options diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index 655e97c47c..794c9278ca 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -568,9 +568,6 @@ attributes from the config_cache.xml file (with keys converted to upper-case). .true. - -.false. - .false. .true. diff --git a/bld/namelist_files/namelist_definition_ctsm.xml b/bld/namelist_files/namelist_definition_ctsm.xml index 37c457141c..e13d8f867a 100644 --- a/bld/namelist_files/namelist_definition_ctsm.xml +++ b/bld/namelist_files/namelist_definition_ctsm.xml @@ -1364,11 +1364,6 @@ Percentage threshold above which the model keeps the urban landunits. Selecting Default: 0 - -Toggle to turn on the dynamic root model - - Toggle to turn on on diagnostic Snow Radiative Effect diff --git a/bld/unit_testers/build-namelist_test.pl b/bld/unit_testers/build-namelist_test.pl index 53c71ae0e9..e754883785 100755 --- a/bld/unit_testers/build-namelist_test.pl +++ b/bld/unit_testers/build-namelist_test.pl @@ -1062,11 +1062,6 @@ sub cat_and_create_namelistinfile { GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm5_0", }, - "useHYDSTwithdynroot" =>{ options=>"-bgc bgc -envxml_dir . -megan", - namelst=>"use_hydrstress=.true., use_dynroot=.true.", - GLC_TWO_WAY_COUPLING=>"FALSE", - phys=>"clm5_0", - }, "specWOfireemis" =>{ options=>"-envxml_dir . -no-fire_emis", namelst=>"fire_emis_specifier='bc_a1 = BC'", GLC_TWO_WAY_COUPLING=>"FALSE", diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index fee8e1a429..e3c0053698 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -1345,15 +1345,6 @@ - - - - - - - - - @@ -2134,14 +2125,6 @@ - - - - - - - - diff --git a/cime_config/testdefs/testmods_dirs/clm/clm50dynroots/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/clm50dynroots/include_user_mods deleted file mode 100644 index fe0e18cf88..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/clm50dynroots/include_user_mods +++ /dev/null @@ -1 +0,0 @@ -../default diff --git a/cime_config/testdefs/testmods_dirs/clm/clm50dynroots/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/clm50dynroots/user_nl_clm deleted file mode 100644 index e493c3e8e7..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/clm50dynroots/user_nl_clm +++ /dev/null @@ -1,2 +0,0 @@ -use_dynroot = .true. -use_hydrstress = .false. diff --git a/src/biogeochem/CNDriverMod.F90 b/src/biogeochem/CNDriverMod.F90 index b23019eb23..0381711258 100644 --- a/src/biogeochem/CNDriverMod.F90 +++ b/src/biogeochem/CNDriverMod.F90 @@ -6,7 +6,7 @@ module CNDriverMod ! ! !USES: use shr_kind_mod , only : r8 => shr_kind_r8 - use clm_varctl , only : use_c13, use_c14, use_fates, use_fates_bgc, use_dynroot + use clm_varctl , only : use_c13, use_c14, use_fates, use_fates_bgc use dynSubgridControlMod , only : get_do_harvest, get_do_grossunrep use decompMod , only : bounds_type use perf_mod , only : t_startf, t_stopf @@ -147,7 +147,6 @@ subroutine CNDriverNoLeaching(bounds, use SoilBiogeochemNitrifDenitrifMod , only: SoilBiogeochemNitrifDenitrif use SoilBiogeochemNStateUpdate1Mod , only: SoilBiogeochemNStateUpdate1 use NutrientCompetitionMethodMod , only: nutrient_competition_method_type - use CNRootDynMod , only: CNRootDyn use CNPrecisionControlMod , only: CNPrecisionControl ! ! !ARGUMENTS: @@ -564,20 +563,6 @@ subroutine CNDriverNoLeaching(bounds, call t_stopf('CNGResp') - !-------------------------------------------- - ! Dynamic Roots - !-------------------------------------------- - - if( use_dynroot ) then - call t_startf('CNRootDyn') - - call CNRootDyn(bounds, num_bgc_soilc, filter_bgc_soilc, num_bgc_vegp, filter_bgc_vegp, & - cnveg_carbonstate_inst, cnveg_nitrogenstate_inst, cnveg_carbonflux_inst, & - cnveg_state_inst, crop_inst, soilstate_inst, soilbiogeochem_nitrogenstate_inst) - - call t_stopf('CNRootDyn') - end if - !-------------------------------------------------------------------------- ! CNUpdate0 ! The state updates are still called for the matrix solution (use_matrixn diff --git a/src/biogeochem/CNRootDynMod.F90 b/src/biogeochem/CNRootDynMod.F90 deleted file mode 100644 index 3f43424cfa..0000000000 --- a/src/biogeochem/CNRootDynMod.F90 +++ /dev/null @@ -1,271 +0,0 @@ -module CNRootDynMod - -!----------------------------------------------------------------------- -! !DESCRIPTION: -! Module holding routines used for determining fine root distribution for all pfts. -! Includes dynamic root depth for crops -! -! !USES: - use shr_kind_mod , only : r8 => shr_kind_r8 - use clm_time_manager , only : get_step_size_real - use abortutils , only : endrun - use clm_varpar , only : nlevsoi, nlevgrnd - use clm_varctl , only : use_bedrock - use decompMod , only : bounds_type - use pftconMod , only : noveg, npcropmin, pftcon - use ColumnType , only : col - use PatchType , only : patch - use CNVegStateType , only : cnveg_state_type - use CNVegCarbonStateType , only : cnveg_carbonstate_type - use CNVegCarbonFluxType , only : cnveg_carbonflux_type - use CNVegnitrogenstateType , only : cnveg_nitrogenstate_type - use SoilStateType , only : soilstate_type - use SoilBiogeochemNitrogenStateType , only : soilbiogeochem_nitrogenstate_type - use CropType , only : crop_type - -! !PUBLIC TYPES: - implicit none - save - private - public :: CNRootDyn -!----------------------------------------------------------------------- - -contains - -!----------------------------------------------------------------------- -! -subroutine CNRootDyn(bounds, num_soilc, filter_soilc, num_soilp, filter_soilp, & - cnveg_carbonstate_inst, cnveg_nitrogenstate_inst, cnveg_carbonflux_inst, & - cnveg_state_inst, crop_inst, soilstate_inst, soilbiogeochem_nitrogenstate_inst) -! -! !DESCRIPTION: -! This routine determine the fine root distribution -! Needs to be called after the photosynthesis calculation -! May need to update other subroutines that use the fixed root profile for calculations -! i.e. CNVerticalProfileMod -! -! !USES: - - -! !ARGUMENTS: - type(bounds_type), intent(in) :: bounds ! bounds - integer, intent(in) :: num_soilc - integer, intent(in) :: filter_soilc(:) - integer, intent(in) :: num_soilp ! number of soil pfts in filter - integer, intent(in) :: filter_soilp(:) ! filter for soil pfts - type(cnveg_state_type) , intent(in) :: cnveg_state_inst - type(cnveg_carbonstate_type) , intent(in) :: cnveg_carbonstate_inst - type(cnveg_carbonflux_type) , intent(in) :: cnveg_carbonflux_inst - type(cnveg_nitrogenstate_type) , intent(in) :: cnveg_nitrogenstate_inst - type(crop_type) , intent(in) :: crop_inst - type(soilbiogeochem_nitrogenstate_type) , intent(in) :: soilbiogeochem_nitrogenstate_inst - type(soilstate_type) , intent(inout) :: soilstate_inst - -! -! !LOCAL VARIABLES: - - integer :: f,c,p,lev,j ! indices - real(r8):: dt ! radiation time step delta t (seconds) - real(r8), allocatable :: w_limit(:) - real(r8), allocatable :: rswa(:,:) ! soil water availability in each soil layer - real(r8), allocatable :: rsmn(:,:) ! soil nitrogen availability in each soil layer - real(r8), allocatable :: sumrswa(:) ! scaling soil water availability in each soil layer - real(r8), allocatable :: sumrsmn(:) ! scaling soil mineral N availability in each soil layer - real(r8) :: frootc_dz(bounds%begp:bounds%endp, 1:nlevgrnd) - real(r8), allocatable :: sumfrootc(:) ! fine root carbon total before turnover in each step - real(r8):: minpsi ! minimum soil moisture potential - real(r8):: psi - real(r8):: maxpsi - real(r8):: new_growth - -!----------------------------------------------------------------------- - ! Assign local pointers to derived type arrays (in) - associate(& - ivt => patch%itype , & ! Input: [integer (:)] pft vegetation type - pcolumn => patch%column , & ! Input: [integer (:)] pft's column index - roota_par => pftcon%roota_par , & ! Input: [real(r8) (:)] pft's roota index - rootb_par => pftcon%rootb_par , & ! Input: [real(r8) (:)] pft's rootb index - root_dmx => pftcon%root_dmx , & ! Input: [real(r8) (:)] crop maximum root depth - cpool_to_frootc => cnveg_carbonflux_inst%cpool_to_frootc_patch , & ! Input: [real(r8) (:)] allocation to fine root C (gC/m2/s) - frootc_xfer_to_frootc => cnveg_carbonflux_inst%frootc_xfer_to_frootc_patch , & ! Input: [real(r8) (:)] fine root C growth from storage (gC/m2/s) - dormant_flag => cnveg_state_inst%dormant_flag_patch , & ! Input: [real(r8) (:)] dormancy flag - root_depth => soilstate_inst%root_depth_patch , & ! InOut: [real(r8) (:)] current root depth - dz => col%dz , & ! Input: layer thickness (m) (-nlevsno+1:nlevgrnd) - zi => col%zi , & ! Input: interface level below a "z" level (m) (-nlevsno+0:nlevgrnd) - rootfr => soilstate_inst%rootfr_patch , & ! Output: [real(r8) (:,:)] fraction of roots in each soil layer - sucsat => soilstate_inst%sucsat_col , & ! Input: minimum soil suction (mm) - soilpsi => soilstate_inst%soilpsi_col , & ! Input: soil water potential in each soil layer (MPa) - sminn_vr => soilbiogeochem_nitrogenstate_inst%sminn_vr_col , & ! Iniput: [real(r8) (:,:)] (gN/m3) soil mineral N - frootc => cnveg_carbonstate_inst%frootc_patch , & ! Input: [real(r8) (:)] (gC/m2) fine root C - hui => crop_inst%hui_patch , & ! Input: [real(r8) (:)] crop patch heat unit index (growing degree-days); set to 0 at sowing and accumulated until harvest - croplive => crop_inst%croplive_patch , & ! Input: [logical (:)] flag, true if planted, not harvested - huigrain => cnveg_state_inst%huigrain_patch & ! Input: [real(r8) (:)] same to reach vegetative maturity - ) - -! set time steps - dt = get_step_size_real() - -! set minpsi to permanent wilting point - minpsi = -1.5_r8 - - allocate(sumrswa(bounds%begp:bounds%endp)) - allocate(sumrsmn(bounds%begp:bounds%endp)) - allocate(sumfrootc(bounds%begp:bounds%endp)) - allocate(rswa(bounds%begp:bounds%endp,nlevgrnd)) - allocate(rsmn(bounds%begp:bounds%endp,nlevgrnd)) - allocate(w_limit(bounds%begp:bounds%endp)) - -!initialize to 0 - w_limit(bounds%begp:bounds%endp) = 0._r8 - sumrswa(bounds%begp:bounds%endp) = 0._r8 - sumrsmn(bounds%begp:bounds%endp) = 0._r8 - sumfrootc(bounds%begp:bounds%endp) = 0._r8 - rswa(bounds%begp:bounds%endp,:) = 0._r8 - rsmn(bounds%begp:bounds%endp,:) = 0._r8 - - frootc_dz(bounds%begp:bounds%endp,1:nlevgrnd) = 0._r8 - - -!--------------------------------------------------------------- -! Set root depth, dynamic for crops, fixed for other vegetation -!--------------------------------------------------------------- - - do f = 1, num_soilp - p = filter_soilp(f) - c = pcolumn(p) - if (ivt(p) /= noveg) then - if((ivt(p)) >= npcropmin)then !skip generic crop types - if (.not. croplive(p)) then - root_depth(p) = 0._r8 - else if(huigrain(p) > 0._r8)then - root_depth(p) = max(zi(c,2), min(hui(p)/huigrain(p)* root_dmx(ivt(p)), root_dmx(ivt(p)))) - end if - else - ! this can be changed to any depth (i.e. the maximum soil depth) - root_depth(p) = zi(c,nlevsoi) - end if - if (use_bedrock) then - root_depth(p) = min(root_depth(p),zi(c,col%nbedrock(c))) - end if - else - root_depth(p) = 0._r8 - end if - end do - -!---------------------------------------------------------------- -! ! calculate a weighting function by soil depth that depends on the - ! fine root distribution per pft and depth and the pft weight on the column. - ! This will be used to weight the temperature and water potential scalars - ! for decomposition control. - - ! calculate the rate constant scalar for soil water content. - ! Uses the log relationship with water potential given in - ! Andren, O., and K. Paustian, 1987. Barley straw decomposition in the field: - ! a comparison of models. Ecology, 68(5):1190-1200. - ! and supported by data in - ! Orchard, V.A., and F.J. Cook, 1983. Relationship between soil respiration - ! and soil moisture. Soil Biol. Biochem., 15(4):447-453. - - do j = 1,nlevsoi - do f = 1,num_soilp - p = filter_soilp(f) - c = pcolumn(p) - maxpsi = sucsat(c,j) * (-9.8e-6_r8) - psi = min(soilpsi(c,j),maxpsi) - if (psi > minpsi) then -! First calculate water in the root zone - if(root_depth(p) > 0.15_r8 .and. (zi(c,j) <= root_depth(p) .or. & - (zi(c,j-1) < root_depth(p) .and. zi(c,j) > root_depth(p)))) then - w_limit(p) = w_limit(p) + max(0._r8,log(minpsi/psi)/log(minpsi/maxpsi))*rootfr(p,j) - end if -! Calculate the water in each soil layer - if (root_depth(p) >= zi(c,j) .or. & - (zi(c,j-1) < root_depth(p) .and. zi(c,j) > root_depth(p))) then - rswa(p,j) = max(0._r8, (log(minpsi/psi)/log(minpsi/maxpsi))) - end if - end if - sumrswa(p) = sumrswa(p) + rswa(p,j) - -! Calculate the nitrogen profile in each layer -! For now, the profile for each PFT is equivilent to the -! column profile, in the future, this could be changed to a weighted profile - rsmn(p,j) = sminn_vr(c,j) - if (root_depth(p) >= zi(c,j).or. & - (zi(c,j-1) < root_depth(p) .and. zi(c,j) > root_depth(p))) then - sumrsmn(p) = sumrsmn(p) + rsmn(p,j) - end if - end do - end do - - -!-------------------------------------------------------------------- -! Now calculate the density of roots in each soil layer for each pft -! based on this timesteps growth -!-------------------------------------------------------------------- - do lev = 1, nlevgrnd - - do f = 1, num_soilp - p = filter_soilp(f) - c = pcolumn(p) - - new_growth = (cpool_to_frootc(p) + frootc_xfer_to_frootc(p))*dt - if(zi(c,lev) <= root_depth(p) .or. & - (zi(c,lev-1) < root_depth(p) .and. zi(c,lev) > root_depth(p))) then - if(sumrswa(p) <= 0._r8 .or. sumrsmn(p) <= 0._r8) then -! when sumrswa or sumrsmn are less than or equal to 0 rootfr will not be updated - else - frootc_dz(p,lev) = (frootc(p))*rootfr(p,lev) & - + new_growth * ((1._r8 - w_limit(p)) * rswa(p,lev) / sumrswa(p) & - + w_limit(p) * rsmn(p,lev) / sumrsmn(p)) - end if - else - frootc_dz(p,lev) = 0._r8 - end if - - sumfrootc(p) = sumfrootc(p) + frootc_dz(p,lev) - - end do - end do -!---------------------------------- -!Calculate root fraction -!---------------------------------- - - do lev = 1, nlevgrnd - do f = 1, num_soilp - p = filter_soilp(f) - c = pcolumn(p) - if(sumfrootc(p) > 0._r8)then - rootfr(p,lev) = frootc_dz(p,lev)/sumfrootc(p) - end if - if(ivt(p) >= npcropmin .and. .not. croplive(p))then -! CROPS are dormant, there are no roots! -! but, need an initial frootr so crops can start root production - if (lev < 2)then - rootfr(p,lev) = .5_r8*( exp(-roota_par(patch%itype(p)) * zi(c,lev-1)) & - + exp(-rootb_par(patch%itype(p)) * zi(c,lev-1)) & - - exp(-roota_par(patch%itype(p)) * zi(c,lev )) & - - exp(-rootb_par(patch%itype(p)) * zi(c,lev )) ) - elseif (lev == 2) then - rootfr(p,lev) = .5_r8*( exp(-roota_par(patch%itype(p)) * zi(c,lev-1)) & - + exp(-rootb_par(patch%itype(p)) * zi(c,lev-1)) ) - else - rootfr(p,lev) = 0.0_r8 - end if - - end if - end do - end do - -!********************** - deallocate(sumrswa) - deallocate(sumrsmn) - deallocate(sumfrootc) - deallocate(rsmn) - deallocate(rswa) - deallocate(w_limit) - - end associate - - end subroutine CNRootDyn - -end module CNRootDynMod diff --git a/src/biogeophys/IrrigationMod.F90 b/src/biogeophys/IrrigationMod.F90 index 27cf050dd3..11c9132eea 100644 --- a/src/biogeophys/IrrigationMod.F90 +++ b/src/biogeophys/IrrigationMod.F90 @@ -221,9 +221,8 @@ module IrrigationMod ! There is no reason to make this a tunable parameter, because the behavior it governs ! (the trigger for irrigation) can be tuned via other parameters. ! - ! TODO(wjs, 2016-09-08) It looks like there is other code in CLM that also uses an - ! assumed wilting point (CNRootDynMod, maybe others). We should probably make this a - ! shared parameter, e.g., in clm_varcon. + ! TODO(wjs, 2016-09-08, updated by slevis 2024-07-06) assumed wilting point: + ! Make this a shared parameter? E.g., in clm_varcon real(r8), parameter, private :: wilting_point_smp = -150000._r8 ! Conversion factors diff --git a/src/biogeophys/SoilStateType.F90 b/src/biogeophys/SoilStateType.F90 index e301cc27b9..2e7225f962 100644 --- a/src/biogeophys/SoilStateType.F90 +++ b/src/biogeophys/SoilStateType.F90 @@ -9,7 +9,7 @@ module SoilStateType use abortutils , only : endrun use clm_varpar , only : nlevsoi, nlevgrnd, nlevlak, nlayer, nlevsno, nlevmaxurbgrnd use clm_varcon , only : spval - use clm_varctl , only : use_hydrstress, use_cn, use_lch4, use_dynroot, use_fates + use clm_varctl , only : use_hydrstress, use_cn, use_lch4, use_fates use clm_varctl , only : iulog, hist_wrtch4diag use LandunitType , only : lun use ColumnType , only : col @@ -231,20 +231,6 @@ subroutine InitHistory(this, bounds) ptr_col=this%bsw_col, default='inactive') end if - if (use_dynroot) then - this%rootfr_patch(begp:endp,:) = spval - call hist_addfld2d (fname='ROOTFR', units='proportion', type2d='levgrnd', & - avgflag='A', long_name='fraction of roots in each soil layer', & - ptr_patch=this%rootfr_patch, default='active') - end if - - if ( use_dynroot ) then - this%root_depth_patch(begp:endp) = spval - call hist_addfld1d (fname='ROOT_DEPTH', units="m", & - avgflag='A', long_name='rooting depth', & - ptr_patch=this%root_depth_patch ) - end if - if (use_cn) then this%rootr_patch(begp:endp,:) = spval call hist_addfld2d (fname='ROOTR', units='proportion', type2d='levgrnd', & @@ -393,15 +379,7 @@ subroutine Restart(this, bounds, ncid, flag) scale_by_thickness=.true., & interpinic_flag='interp', readvar=readvar, data=this%hk_l_col) - if( use_dynroot ) then - call restartvar(ncid=ncid, flag=flag, varname='rootfr', xtype=ncd_double, & - dim1name='pft', dim2name='levgrnd', switchdim=.true., & - long_name='root fraction', units='', & - scale_by_thickness=.false., & - interpinic_flag='interp', readvar=readrootfr, data=this%rootfr_patch) - else - readrootfr = .false. - end if + readrootfr = .false. if (flag=='read' .and. .not. readrootfr ) then if (masterproc) then write(iulog,*) "can't find rootfr in restart (or initial) file..." diff --git a/src/main/clm_varctl.F90 b/src/main/clm_varctl.F90 index 0daedbbb1f..cbfcbfd8ea 100644 --- a/src/main/clm_varctl.F90 +++ b/src/main/clm_varctl.F90 @@ -426,12 +426,6 @@ module clm_varctl logical, public :: use_hydrstress = .false. ! true => use plant hydraulic stress calculation - !---------------------------------------------------------- - ! dynamic root switch - !---------------------------------------------------------- - - logical, public :: use_dynroot = .false. ! true => use dynamic root module - !---------------------------------------------------------- ! glacier_mec control variables: default values (may be overwritten by namelist) !---------------------------------------------------------- diff --git a/src/main/controlMod.F90 b/src/main/controlMod.F90 index 46d9e9958a..4773cc6921 100644 --- a/src/main/controlMod.F90 +++ b/src/main/controlMod.F90 @@ -272,8 +272,6 @@ subroutine control_init(dtime) namelist /clm_inparm/ use_hydrstress - namelist /clm_inparm/ use_dynroot - namelist /clm_inparm/ & use_c14_bombspike, atm_c14_filename, use_c13_timeseries, atm_c13_filename @@ -613,11 +611,6 @@ subroutine control_init(dtime) errMsg(sourcefile, __LINE__)) end if - if ( use_dynroot .and. use_hydrstress ) then - call endrun(msg=' ERROR:: dynroot and hydrstress can NOT be on at the same time'//& - errMsg(sourcefile, __LINE__)) - end if - ! Check on run type if (nsrest == iundef) then call endrun(msg=' ERROR:: must set nsrest'//& @@ -842,8 +835,6 @@ subroutine control_spmd() call mpi_bcast (use_hydrstress, 1, MPI_LOGICAL, 0, mpicom, ier) - call mpi_bcast (use_dynroot, 1, MPI_LOGICAL, 0, mpicom, ier) - if (use_cn .or. use_fates) then ! vertical soil mixing variables call mpi_bcast (som_adv_flux, 1, MPI_REAL8, 0, mpicom, ier) @@ -1130,7 +1121,6 @@ subroutine control_print () write(iulog,*) ' user-defined soil layer structure = ', soil_layerstruct_userdefined write(iulog,*) ' user-defined number of soil layers = ', soil_layerstruct_userdefined_nlevsoi write(iulog,*) ' plant hydraulic stress = ', use_hydrstress - write(iulog,*) ' dynamic roots = ', use_dynroot if (nsrest == nsrContinue) then write(iulog,*) 'restart warning:' write(iulog,*) ' Namelist not checked for agreement with initial run.' diff --git a/src/main/pftconMod.F90 b/src/main/pftconMod.F90 index e5379100e0..7988b57e75 100644 --- a/src/main/pftconMod.F90 +++ b/src/main/pftconMod.F90 @@ -280,9 +280,6 @@ module pftconMod real(r8), allocatable :: FUN_fracfixers(:) ! Fraction of C that can be used for fixation. - ! pft parameters for dynamic root code - real(r8), allocatable :: root_dmx(:) !maximum root depth - contains procedure, public :: Init @@ -494,7 +491,6 @@ subroutine InitAllocate (this) allocate( this%kn_nonmyc (0:mxpft) ) allocate( this%kr_resorb (0:mxpft) ) allocate( this%perecm (0:mxpft) ) - allocate( this%root_dmx (0:mxpft) ) allocate( this%fun_cn_flex_a (0:mxpft) ) allocate( this%fun_cn_flex_b (0:mxpft) ) allocate( this%fun_cn_flex_c (0:mxpft) ) @@ -520,7 +516,7 @@ subroutine InitRead(this) use fileutils , only : getfil use ncdio_pio , only : ncd_io, ncd_pio_closefile, ncd_pio_openfile, file_desc_t use ncdio_pio , only : ncd_inqdid, ncd_inqdlen - use clm_varctl , only : paramfile, use_fates, use_flexibleCN, use_dynroot, use_biomass_heat_storage, z0param_method + use clm_varctl , only : paramfile, use_fates, use_flexibleCN, use_biomass_heat_storage, z0param_method use spmdMod , only : masterproc use CLMFatesParamInterfaceMod, only : FatesReadPFTs use SoilBiogeochemDecompCascadeConType, only : mimics_decomp, decomp_method @@ -1105,13 +1101,8 @@ subroutine InitRead(this) end if ! - ! Dynamic Root variables for crops ! - if ( use_crop .and. use_dynroot )then - call ncd_io('root_dmx', this%root_dmx, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - end if - + ! call ncd_io('nstem',this%nstem, 'read', ncid, readvar=readv) if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) call ncd_io('taper',this%taper, 'read', ncid, readvar=readv) @@ -1583,7 +1574,6 @@ subroutine Clean(this) deallocate( this%kn_nonmyc) deallocate( this%kr_resorb) deallocate( this%perecm) - deallocate( this%root_dmx) deallocate( this%fun_cn_flex_a) deallocate( this%fun_cn_flex_b) deallocate( this%fun_cn_flex_c) From a5b4d34720d81eac9f052ea7e8230af57955dee8 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Tue, 9 Jul 2024 21:57:55 -0600 Subject: [PATCH 0648/1248] Fix the lnd_tuning_mode for the zendersoil files --- bld/namelist_files/namelist_defaults_ctsm.xml | 48 +++++++++---------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index c6430bfff2..c535bc96e4 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -2419,53 +2419,53 @@ lnd/clm2/surfdata_esmf/NEON/surfdata_1x1_NEON_TOOL_hist_78pfts_CMIP6_simyr2000_c >lnd/clm2/dustemisdata/dst_source2x2tunedcam6-2x2-forCLM_cdf5_c230312.nc lnd/clm2/dustemisdata/dst_source2x2tunedcam6-2x2-forCLM_cdf5_c230312.nc -lnd/clm2/dustemisdata/dst_source2x2tunedcam6-2x2-forCLM_cdf5_c230312.nc -lnd/clm2/dustemisdata/dst_source2x2tunedcam6-2x2-forCLM_cdf5_c230312.nc -lnd/clm2/dustemisdata/dst_source2x2tunedcam6-2x2-forCLM_cdf5_c230312.nc -lnd/clm2/dustemisdata/dst_source2x2_cam5.4-forCLM_cdf5_c240202.nc -lnd/clm2/dustemisdata/dst_source2x2_cam5.4-forCLM_cdf5_c240202.nc -lnd/clm2/dustemisdata/dst_source2x2_cam5.4-forCLM_cdf5_c240202.nc -lnd/clm2/dustemisdata/dst_source2x2tuned-cam4-forCLM_cdf5_c240202.nc -lnd/clm2/dustemisdata/dst_source2x2tuned-cam4-forCLM_cdf5_c240202.nc -lnd/clm2/dustemisdata/dst_source2x2tuned-cam4-forCLM_cdf5_c240202.nc -lnd/clm2/dustemisdata/dst_source1x1tuned-cam4-forCLM_cdf5_c240202.nc -lnd/clm2/dustemisdata/dst_source1x1tuned-cam4-forCLM_cdf5_c240202.nc -lnd/clm2/dustemisdata/dst_source1x1tuned-cam4-forCLM_cdf5_c240202.nc -lnd/clm2/dustemisdata/dst_source2x2tunedcam6-2x2-forCLM_cdf5_c230312.nc -lnd/clm2/dustemisdata/dst_source2x2tunedcam6-2x2-forCLM_cdf5_c230312.nc -lnd/clm2/dustemisdata/dst_source2x2tunedcam6-2x2-forCLM_cdf5_c230312.nc -lnd/clm2/dustemisdata/dst_source2x2tunedcam6-2x2-forCLM_cdf5_c230312.nc -lnd/clm2/dustemisdata/dst_source2x2tunedcam6-2x2-forCLM_cdf5_c230312.nc -lnd/clm2/dustemisdata/dst_source2x2tunedcam6-2x2-forCLM_cdf5_c230312.nc -lnd/clm2/dustemisdata/dst_source2x2tunedcam6-2x2-forCLM_cdf5_c230312.nc -lnd/clm2/dustemisdata/dst_source2x2tunedcam6-2x2-forCLM_cdf5_c230312.nc -lnd/clm2/dustemisdata/dst_source2x2tunedcam6-2x2-forCLM_cdf5_c230312.nc -lnd/clm2/dustemisdata/dst_source2x2tunedcam6-2x2-forCLM_cdf5_c230312.nc -lnd/clm2/dustemisdata/dst_source2x2tunedcam6-2x2-forCLM_cdf5_c230312.nc -lnd/clm2/dustemisdata/dst_source2x2tunedcam6-2x2-forCLM_cdf5_c230312.nc Date: Tue, 9 Jul 2024 23:54:45 -0600 Subject: [PATCH 0649/1248] Add clm6_0 for Zdust --- bld/namelist_files/namelist_defaults_ctsm.xml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index c535bc96e4..a2200cb7fa 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -2419,54 +2419,72 @@ lnd/clm2/surfdata_esmf/NEON/surfdata_1x1_NEON_TOOL_hist_78pfts_CMIP6_simyr2000_c >lnd/clm2/dustemisdata/dst_source2x2tunedcam6-2x2-forCLM_cdf5_c230312.nc lnd/clm2/dustemisdata/dst_source2x2tunedcam6-2x2-forCLM_cdf5_c230312.nc +lnd/clm2/dustemisdata/dst_source2x2tunedcam6-2x2-forCLM_cdf5_c230312.nc lnd/clm2/dustemisdata/dst_source2x2tunedcam6-2x2-forCLM_cdf5_c230312.nc lnd/clm2/dustemisdata/dst_source2x2tunedcam6-2x2-forCLM_cdf5_c230312.nc lnd/clm2/dustemisdata/dst_source2x2tunedcam6-2x2-forCLM_cdf5_c230312.nc +lnd/clm2/dustemisdata/dst_source2x2tunedcam6-2x2-forCLM_cdf5_c230312.nc lnd/clm2/dustemisdata/dst_source2x2_cam5.4-forCLM_cdf5_c240202.nc lnd/clm2/dustemisdata/dst_source2x2_cam5.4-forCLM_cdf5_c240202.nc lnd/clm2/dustemisdata/dst_source2x2_cam5.4-forCLM_cdf5_c240202.nc +lnd/clm2/dustemisdata/dst_source2x2_cam5.4-forCLM_cdf5_c240202.nc lnd/clm2/dustemisdata/dst_source2x2tuned-cam4-forCLM_cdf5_c240202.nc lnd/clm2/dustemisdata/dst_source2x2tuned-cam4-forCLM_cdf5_c240202.nc lnd/clm2/dustemisdata/dst_source2x2tuned-cam4-forCLM_cdf5_c240202.nc +lnd/clm2/dustemisdata/dst_source2x2tuned-cam4-forCLM_cdf5_c240202.nc lnd/clm2/dustemisdata/dst_source1x1tuned-cam4-forCLM_cdf5_c240202.nc lnd/clm2/dustemisdata/dst_source1x1tuned-cam4-forCLM_cdf5_c240202.nc lnd/clm2/dustemisdata/dst_source1x1tuned-cam4-forCLM_cdf5_c240202.nc +lnd/clm2/dustemisdata/dst_source1x1tuned-cam4-forCLM_cdf5_c240202.nc lnd/clm2/dustemisdata/dst_source2x2tunedcam6-2x2-forCLM_cdf5_c230312.nc lnd/clm2/dustemisdata/dst_source2x2tunedcam6-2x2-forCLM_cdf5_c230312.nc lnd/clm2/dustemisdata/dst_source2x2tunedcam6-2x2-forCLM_cdf5_c230312.nc +lnd/clm2/dustemisdata/dst_source2x2tunedcam6-2x2-forCLM_cdf5_c230312.nc lnd/clm2/dustemisdata/dst_source2x2tunedcam6-2x2-forCLM_cdf5_c230312.nc lnd/clm2/dustemisdata/dst_source2x2tunedcam6-2x2-forCLM_cdf5_c230312.nc lnd/clm2/dustemisdata/dst_source2x2tunedcam6-2x2-forCLM_cdf5_c230312.nc +lnd/clm2/dustemisdata/dst_source2x2tunedcam6-2x2-forCLM_cdf5_c230312.nc lnd/clm2/dustemisdata/dst_source2x2tunedcam6-2x2-forCLM_cdf5_c230312.nc lnd/clm2/dustemisdata/dst_source2x2tunedcam6-2x2-forCLM_cdf5_c230312.nc lnd/clm2/dustemisdata/dst_source2x2tunedcam6-2x2-forCLM_cdf5_c230312.nc +lnd/clm2/dustemisdata/dst_source2x2tunedcam6-2x2-forCLM_cdf5_c230312.nc lnd/clm2/dustemisdata/dst_source2x2tunedcam6-2x2-forCLM_cdf5_c230312.nc lnd/clm2/dustemisdata/dst_source2x2tunedcam6-2x2-forCLM_cdf5_c230312.nc lnd/clm2/dustemisdata/dst_source2x2tunedcam6-2x2-forCLM_cdf5_c230312.nc +lnd/clm2/dustemisdata/dst_source2x2tunedcam6-2x2-forCLM_cdf5_c230312.nc lnd/clm2/dustemisdata/dust_2x2_ESMFmesh_cdf5_c230730.nc From 97b8c552f4df54eff77f05cb1dad078c2fa2908e Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 10 Jul 2024 00:07:48 -0600 Subject: [PATCH 0650/1248] Add files for the new clm60cam7 test mod --- .../clm/clm60cam7LndTuningMode/include_user_mods | 1 + .../testmods_dirs/clm/clm60cam7LndTuningMode/shell_commands | 5 +++++ 2 files changed, 6 insertions(+) create mode 100644 cime_config/testdefs/testmods_dirs/clm/clm60cam7LndTuningMode/include_user_mods create mode 100644 cime_config/testdefs/testmods_dirs/clm/clm60cam7LndTuningMode/shell_commands diff --git a/cime_config/testdefs/testmods_dirs/clm/clm60cam7LndTuningMode/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/clm60cam7LndTuningMode/include_user_mods new file mode 100644 index 0000000000..fe0e18cf88 --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/clm60cam7LndTuningMode/include_user_mods @@ -0,0 +1 @@ +../default diff --git a/cime_config/testdefs/testmods_dirs/clm/clm60cam7LndTuningMode/shell_commands b/cime_config/testdefs/testmods_dirs/clm/clm60cam7LndTuningMode/shell_commands new file mode 100644 index 0000000000..7dd25a08bf --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/clm60cam7LndTuningMode/shell_commands @@ -0,0 +1,5 @@ +#!/bin/bash + +./xmlchange LND_TUNING_MODE="clm6_0_cam7.0" +./xmlchange ROF_NCPL='$ATM_NCPL' + From 197e8abb184425d1ed46c53435340a2803efdd3a Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 10 Jul 2024 00:14:35 -0600 Subject: [PATCH 0651/1248] Update expected fail for new test --- cime_config/testdefs/ExpectedTestFails.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cime_config/testdefs/ExpectedTestFails.xml b/cime_config/testdefs/ExpectedTestFails.xml index dad6acb63d..3c3bde2ff6 100644 --- a/cime_config/testdefs/ExpectedTestFails.xml +++ b/cime_config/testdefs/ExpectedTestFails.xml @@ -44,7 +44,7 @@ - + FAIL #2542 From 334b144b59ce0d649116408be1d67007c0ff6d14 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 10 Jul 2024 01:38:21 -0600 Subject: [PATCH 0652/1248] Fix typo in lnd_tuning_mode for Zender dust emission soil eroditability file --- bld/CLMBuildNamelist.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index fbf7b9a8bc..b3141f1b42 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -4002,7 +4002,7 @@ sub setup_logic_dust_emis { foreach my $option ( @zender_files_in_lnd_opts ) { add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, $option, 'dust_emis_method'=>$dust_emis_method, 'zender_soil_erod_source'=>$zender_source, - 'hgrid'=>$nl_flags->{'res'}, 'lnd_tuning_mod'=>$nl_flags->{'lnd_tuning_mode'} ); + 'hgrid'=>$nl_flags->{'res'}, 'lnd_tuning_mode'=>$nl_flags->{'lnd_tuning_mode'} ); } } else { foreach my $option ( @zender_files_in_lnd_opts ) { From 734dbf2e24b7f98d108e3ab9a6605f978cdb5787 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 10 Jul 2024 13:34:29 -0600 Subject: [PATCH 0653/1248] Update change files --- doc/ChangeLog | 94 +++++++++++++++++++++++++++++++++++++++++++++++++++ doc/ChangeSum | 1 + 2 files changed, 95 insertions(+) diff --git a/doc/ChangeLog b/doc/ChangeLog index 2ab7676ddc..9f62ca5a87 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,4 +1,98 @@ =============================================================== +Tag name: ctsm5.2.009 +Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326) +Date: Wed 10 Jul 2024 12:21:23 PM MDT +One-line Summary: Allow for CAM7 in lnd_tuning_mode and handle C or E in long compset names + +Purpose and description of changes +---------------------------------- + +Changes so that CAM7 is allowed for the land-tuning mode. Allow "C" and "E" after period designation in long compset names. Fix an +issue with Zender dust emission soil eroditability files. + +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_1 + +[ ] clm5_0 + +[ ] ctsm5_0-nwp + +[ ] clm4_5 + + +Bugs fixed +---------- + +List of CTSM issues fixed (include CTSM Issue # and description) [one per line]: + Fixes #2480 -- cam7 lnd_tuning_mode + Fixes #2634 -- allow period part of long-compset name to have a "C" or "E" + Fixes #2637 -- bad lnd_tuning_mode for Zender soil eroditability file settings + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): + LND_TUNING_MODE will fail with an error for CAM (that's NOT cam4/cam5/cam6), or CPLHIST with CLM51 + use CLM60 instead + +Changes made to namelist defaults (e.g., changed parameter values): + Add lnd_tuning_mode options for cam7.0 to namelist defaults + +Notes of particular relevance for developers: +--------------------------------------------- + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): + lnd_tuning_mode options duplicate a bunch of XML code lines and should be refactored + +Changes to tests or testing: + Add cam7.0 test mod directories + Change tests for clm6_0_cam6.0 lnd_tuning_mode to clm6_0_cam7.0 + +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 - PASS + + 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: Only the cam4/cam5 lnd_tuning_mode tests + + Summarize any changes to answers, i.e., + - what code configurations: lnd_tuning_mode ending with _cam4.0 or _cam5.0 suffix with zender_soil_erod_source='lnd' + - what platforms/compilers: All + - nature of change: new dust emissions + +Other details +------------- + +Pull Requests that document the changes (include PR ids): +(https://github.com/ESCOMP/ctsm/pull) + #2632 -- Handle CAM7 + +=============================================================== +=============================================================== Tag name: ctsm5.2.008 Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326) Date: Fri 28 Jun 2024 12:22:46 PM MDT diff --git a/doc/ChangeSum b/doc/ChangeSum index ea9417fe41..22a9b12230 100644 --- a/doc/ChangeSum +++ b/doc/ChangeSum @@ -1,5 +1,6 @@ Tag Who Date Summary ============================================================================================================================ + ctsm5.2.009 erik 07/10/2024 Allow for CAM7 in lnd_tuning_mode and handle C or E in long compset names ctsm5.2.008 erik 06/28/2024 Bring changes on temp-branch to master: b4b-dev, git-fleximod, hillslope fsat tmp-240620.n03.ctsm5.2.007 06/27/2024 Set upland hillslope column fsat values to zero (samrabin) tmp-240620.n02.ctsm5.2.007 06/21/2024 Another update of git-fleximod (erik) From 525914480cdbb7aab6963942c284ae80972b37d8 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 10 Jul 2024 13:47:58 -0600 Subject: [PATCH 0654/1248] Add cam7 testing and change tests for cam6.0 to cam7.0 --- bld/unit_testers/build-namelist_test.pl | 26 ++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/bld/unit_testers/build-namelist_test.pl b/bld/unit_testers/build-namelist_test.pl index 53c71ae0e9..183a511020 100755 --- a/bld/unit_testers/build-namelist_test.pl +++ b/bld/unit_testers/build-namelist_test.pl @@ -163,10 +163,10 @@ sub cat_and_create_namelistinfile { # # Figure out number of tests that will run # -my $ntests = 3254; +my $ntests = 3278; if ( defined($opts{'compare'}) ) { - $ntests += 2001; + $ntests += 1981; } plan( tests=>$ntests ); @@ -414,17 +414,17 @@ sub cat_and_create_namelistinfile { $mode = "-phys $phys"; &make_config_cache($phys); foreach my $options ( - "-res ne0np4.ARCTIC.ne30x4 -bgc sp -use_case 2000_control -namelist '&a start_ymd=19790101/' -lnd_tuning_mode ${phys}_cam6.0", - "-res ne0np4.ARCTICGRIS.ne30x8 -bgc sp -use_case 1850_control -namelist '&a start_ymd=19790101/' -lnd_tuning_mode ${phys}_cam6.0", - "-res 1.9x2.5 -bgc sp -use_case 20thC_transient -namelist '&a start_ymd=19790101/' -lnd_tuning_mode ${phys}_cam6.0", - "-res 0.9x1.25 -bgc sp -use_case 20thC_transient -namelist '&a start_ymd=19790101/' -lnd_tuning_mode ${phys}_cam6.0", - "-res 0.9x1.25 -bgc bgc -crop -use_case 20thC_transient -namelist '&a start_ymd=19500101/' -lnd_tuning_mode ${phys}_cam6.0", - "-res ne0np4CONUS.ne30x8 -bgc sp -use_case 2000_control -namelist '&a start_ymd=20130101/' -lnd_tuning_mode ${phys}_cam6.0", - "-res 1.9x2.5 -bgc sp -use_case 20thC_transient -namelist '&a start_ymd=20030101/' -lnd_tuning_mode ${phys}_cam6.0", - "-res 1.9x2.5 -bgc sp -use_case 2010_control -namelist '&a start_ymd=20100101/' -lnd_tuning_mode ${phys}_cam6.0", + "-res ne0np4.ARCTIC.ne30x4 -bgc sp -use_case 2000_control -namelist '&a start_ymd=19790101/' -lnd_tuning_mode ${phys}_cam7.0", + "-res ne0np4.ARCTICGRIS.ne30x8 -bgc sp -use_case 1850_control -namelist '&a start_ymd=19790101/' -lnd_tuning_mode ${phys}_cam7.0", + "-res 1.9x2.5 -bgc sp -use_case 20thC_transient -namelist '&a start_ymd=19790101/' -lnd_tuning_mode ${phys}_cam7.0", + "-res 0.9x1.25 -bgc sp -use_case 20thC_transient -namelist '&a start_ymd=19790101/' -lnd_tuning_mode ${phys}_cam7.0", + "-res 0.9x1.25 -bgc bgc -crop -use_case 20thC_transient -namelist '&a start_ymd=19500101/' -lnd_tuning_mode ${phys}_cam7.0", + "-res ne0np4CONUS.ne30x8 -bgc sp -use_case 2000_control -namelist '&a start_ymd=20130101/' -lnd_tuning_mode ${phys}_cam7.0", + "-res 1.9x2.5 -bgc sp -use_case 20thC_transient -namelist '&a start_ymd=20030101/' -lnd_tuning_mode ${phys}_cam7.0", + "-res 1.9x2.5 -bgc sp -use_case 2010_control -namelist '&a start_ymd=20100101/' -lnd_tuning_mode ${phys}_cam7.0", "-res 1x1_brazil -no-megan -use_case 2000_control -lnd_tuning_mode ${phys}_CRUv7", - "-res C96 -bgc sp -use_case 2010_control -namelist '&a start_ymd=20100101/' -lnd_tuning_mode ${phys}_cam6.0", - "-res ne0np4.ARCTIC.ne30x4 -bgc sp -use_case 2000_control -namelist '&a start_ymd=20130101/' -lnd_tuning_mode ${phys}_cam6.0", + "-res C96 -bgc sp -use_case 2010_control -namelist '&a start_ymd=20100101/' -lnd_tuning_mode ${phys}_cam7.0", + "-res ne0np4.ARCTIC.ne30x4 -bgc sp -use_case 2000_control -namelist '&a start_ymd=20130101/' -lnd_tuning_mode ${phys}_cam7.0", ) { &make_env_run(); eval{ system( "$bldnml -envxml_dir . $options > $tempfile 2>&1 " ); }; @@ -1802,7 +1802,7 @@ sub cat_and_create_namelistinfile { my $mode = "-phys $phys"; &make_config_cache($phys); my @forclist = (); - @forclist = ( "CRUv7", "GSWP3v1", "cam6.0", "cam5.0", "cam4.0" ); + @forclist = ( "CRUv7", "GSWP3v1", "cam7.0", "cam6.0", "cam5.0", "cam4.0" ); foreach my $forc ( @forclist ) { foreach my $bgc ( "sp", "bgc" ) { my $lndtuningmode = "${phys}_${forc}"; From 237f84815c06b9ea86eb00f96b29cc35abd044c8 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Wed, 10 Jul 2024 15:11:49 -0600 Subject: [PATCH 0655/1248] Revert "Add ._r8 to hardwired constants" This reverts commit d940ee014cb52f92cdc0da415084f349ab45abae because answers were changing from the baseline in tests ERS_D_Ld15.f45_f45_mg37.I2000Clm50FatesRs.derecho_intel.clm-FatesColdTwoStream ERS_D_Ld15.f45_f45_mg37.I2000Clm50FatesRs.izumi_nag.clm-FatesColdTwoStream --- src/biogeochem/VOCEmissionMod.F90 | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/biogeochem/VOCEmissionMod.F90 b/src/biogeochem/VOCEmissionMod.F90 index 7ba90fd457..9833fe3de9 100644 --- a/src/biogeochem/VOCEmissionMod.F90 +++ b/src/biogeochem/VOCEmissionMod.F90 @@ -835,13 +835,13 @@ function get_gamma_SM(btran_in) real(r8),intent(in) :: btran_in !!!------- the drought algorithm-------- - real(r8), parameter :: a1 = -7.4463_r8 - real(r8), parameter :: b1 = 3.2552_r8 + real(r8), parameter :: a1 = -7.4463 + real(r8), parameter :: b1 = 3.2552 real(r8) :: get_gamma_SM - if (btran_in >= 1._r8) then + if (btran_in >= 1.) then get_gamma_SM = 1 else - get_gamma_SM = 1._r8 / (1._r8 + b1 * exp(a1 * (btran_in - 0.2_r8))) + get_gamma_SM = 1/(1+b1*exp(a1*(btran_in-0.2))) endif end function get_gamma_SM @@ -968,9 +968,9 @@ function get_gamma_T(t_veg240_in, t_veg24_in,t_veg_in, ct1_in, ct2_in, betaT_in, topt = co1 + (co2 * (t_veg240_in-tstd0)) if ( (ivt_in == nbrdlf_dcd_brl_shrub) ) then ! boreal-deciduous-shrub ! coming from BEAR-oNS campaign willows results - Eopt = 7.9_r8 * exp (0.217_r8 * (t_veg24_in - 273.15_r8 - 24.0_r8)) + Eopt = 7.9 * exp (0.217_r8 * (t_veg24_in-273.15_r8-24.0_r8)) else if ( (ivt_in == nc3_arctic_grass ) ) then ! boreal-grass - Eopt = exp(0.12_r8 * (t_veg240_in - 288.15_r8)) + Eopt = exp(0.12*(t_veg240_in-288.15_r8)) else Eopt = Ceo_in * exp (co4 * (t_veg24_in-tstd0)) * exp(co4 * (t_veg240_in -tstd0)) endif @@ -982,13 +982,13 @@ function get_gamma_T(t_veg240_in, t_veg24_in,t_veg_in, ct1_in, ct2_in, betaT_in, x = ( (1._r8/topt) - (1._r8/(t_veg_in)) ) / ct3 ! for the boreal grass from BEAR-oNS campaign if ( (ivt_in == nc3_arctic_grass ) ) then ! boreal-grass - bet_arc_c3 = 95._r8 + 9.49_r8 * exp(0.53_r8 * (288.15_r8 - t_veg240_in)) - if (bet_arc_c3 > 300._r8) then - bet_arc_c3 = 300._r8 + bet_arc_c3 = 95+9.49*exp(0.53*(288.15_r8-t_veg240_in)) + if (bet_arc_c3 .gt. 300) then + bet_arc_c3 = 300 endif - gamma_t_LDF = Eopt * exp(bet_arc_c3 * ((1._r8 / 303.15_r8 - 1.0_r8 / t_veg_in) / ct3)) + gamma_t_LDF = Eopt * exp(bet_arc_c3*((1/303.15_r8 - 1.0_r8/(t_veg_in))/ct3)) else - gamma_t_LDF = Eopt * ( ct2_in * exp(ct1_in * x) / (ct2_in - ct1_in * (1._r8 - exp(ct2_in * x))) ) + gamma_t_LDF = Eopt * ( ct2_in * exp(ct1_in * x)/(ct2_in - ct1_in * (1._r8 - exp(ct2_in * x))) ) endif From ee3e6a678ff3c336fdc1bc17c5a61ed8557d92e9 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Wed, 10 Jul 2024 17:21:18 -0600 Subject: [PATCH 0656/1248] Update ChangeLog/ChangeSum --- doc/ChangeLog | 77 +++++++++++++++++++++++++++++++++++++++++++++++++++ doc/ChangeSum | 1 + 2 files changed, 78 insertions(+) diff --git a/doc/ChangeLog b/doc/ChangeLog index 9f62ca5a87..f9fa259a05 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,4 +1,81 @@ =============================================================== +Tag name: ctsm5.2.010 +Originator(s): @cathyxinchangli (Cathy Xinchang Li, U of Illinois - Urbana-Champaign), @Face2sea, @olyson, @fang-bowen, @keerzhang1 +Date: Wed 10 Jul 2024 05:00:24 PM MDT +One-line Summary: Explicit A/C adoption + +Purpose and description of changes +---------------------------------- + + Code changes for adding an explicit air-conditioning (AC) adoption parameterization scheme in CLMU. This includes adding a new time-varying input variable (AC adoption rate, p_ac), changes to building energy calculations, and a toggle (new namelist variable urban_explicit_ac) + + In this tag we keep the change off by default in order to show that answers do not change: + - If explicit AC adoption is off, the p_ac_[TBD/HD/MD] variables are set to 1 universally, and the building interior setpoints (tbuildmax_[TBD/HD/MD]) remain unchanged, to ensure the model reproduces previous results. + - If explicit AC adoption is on, the p_ac_[TBD/HD/MD] variables take on actual AC adoption rate values (present-day global data were developed together with the code change), and tbuildmax_[TBD/HD/MD] are set to 300K/27°C universally. + +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_1 + +[ ] clm5_0 + +[ ] ctsm5_0-nwp + +[ ] clm4_5 + + +Bugs fixed +---------- +List of CTSM issues fixed (include CTSM Issue # and description) [one per line]: + Fixes #2254 Explicitly representing air-conditioning adoption in CESM + +Notes of particular relevance for users +--------------------------------------- + +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): + New namelist variable urban_explicit_ac = .false. by default + +Changes to the datasets (e.g., parameter, surface or initial files): + The default urban time-varying input data file (namelist variable stream_fldfilename_urbantv) now includes p_ac_[TBD/HD/MD] variables, whether or not the explicit-AC-adoption scheme is on and the new file has been rimported to svn: CTSM52_urbantv_Li_2024_0.9x1.25_simyr1849-2106_c20230621.nc + +Changes to documentation: + +Substantial timing or memory changes: +[e.g., check PFS test in the test suite and look at timings, if you +expect possible significant timing changes] + + +Testing summary: +---------------- + + [PASS means all tests PASS; OK means tests PASS other than expected fails.] + + regular tests (aux_clm: https://github.com/ESCOMP/CTSM/wiki/System-Testing-Guide#pre-merge-system-testing): + + derecho ----- IN PROGRESS + izumi ------- + +Answer changes +-------------- + +Changes answers relative to baseline: + No, because we have introduced the changes as default .false. at this time + +Other details +------------- +Pull Requests that document the changes (include PR ids): + https://github.com/ESCOMP/ctsm/pull/2275 + +=============================================================== +=============================================================== Tag name: ctsm5.2.009 Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326) Date: Wed 10 Jul 2024 12:21:23 PM MDT diff --git a/doc/ChangeSum b/doc/ChangeSum index 22a9b12230..be04c9c22e 100644 --- a/doc/ChangeSum +++ b/doc/ChangeSum @@ -1,5 +1,6 @@ Tag Who Date Summary ============================================================================================================================ + ctsm5.2.010 multiple 07/10/2024 Explicit A/C adoption ctsm5.2.009 erik 07/10/2024 Allow for CAM7 in lnd_tuning_mode and handle C or E in long compset names ctsm5.2.008 erik 06/28/2024 Bring changes on temp-branch to master: b4b-dev, git-fleximod, hillslope fsat tmp-240620.n03.ctsm5.2.007 06/27/2024 Set upland hillslope column fsat values to zero (samrabin) From 4ca2b6aeeb3388efa9b4026b826d902d8a9f6f95 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Wed, 10 Jul 2024 18:17:29 -0600 Subject: [PATCH 0657/1248] Add error: matrixcn not ok with NTHRDS_LND > 1 (the check does not work) --- bld/CLMBuildNamelist.pm | 16 ++++++++++++++-- bld/unit_testers/build-namelist_test.pl | 2 +- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index 329030d985..7038351688 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -1655,7 +1655,7 @@ sub process_namelist_inline_logic { if ( remove_leading_and_trailing_quotes($nl_flags->{'clm_start_type'}) ne "branch" ) { setup_logic_initial_conditions($opts, $nl_flags, $definition, $defaults, $nl, $physv); } - setup_logic_cnmatrix($opts, $nl_flags, $definition, $defaults, $nl); + setup_logic_cnmatrix($opts, $nl_flags, $definition, $defaults, $nl, $envxml_ref); setup_logic_spinup($opts, $nl_flags, $definition, $defaults, $nl); setup_logic_supplemental_nitrogen($opts, $nl_flags, $definition, $defaults, $nl); setup_logic_snowpack($opts, $nl_flags, $definition, $defaults, $nl); @@ -4640,7 +4640,7 @@ sub setup_logic_cnmatrix { # # Set some default options related to the CN Matrix options # - my ($opts, $nl_flags, $definition, $defaults, $nl) = @_; + my ($opts, $nl_flags, $definition, $defaults, $nl, $envxml_ref) = @_; my @matrixlist = ( "use_matrixcn", "hist_wrt_matrixcn_diag" ); foreach my $var ( @matrixlist ) { @@ -4650,6 +4650,18 @@ sub setup_logic_cnmatrix { , 'spinup_matrixcn'=>$nl_flags->{'spinup_matrixcn'}, 'clm_accelerated_spinup'=>$nl_flags->{'clm_accelerated_spinup'} ); } @matrixlist = ( "use_matrixcn", "use_soil_matrixcn", "hist_wrt_matrixcn_diag", "spinup_matrixcn" ); + # Matrix items can't be on for NTHRDS_LND > 1 + my $var_xml = "NTHRDS_LND"; + my $val_xml = int($envxml_ref->{$var_xml}); + print "$var_xml = $val_xml"; + if ( $val_xml > 1) { + foreach my $var ( @matrixlist ) { + if ( &value_is_true($nl->get_value($var)) ) { + $log->warning("$var and $var_xml > 1 causes a clm threading test to FAIL (as of 2024/7/10), so use at your own risk." ); + } + } + } + # Matrix items can't be on for transient if (not string_is_undef_or_empty($nl->get_value('flanduse_timeseries'))) { foreach my $var ( @matrixlist ) { diff --git a/bld/unit_testers/build-namelist_test.pl b/bld/unit_testers/build-namelist_test.pl index 9b83f9e7ec..df159a8870 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", NEONSITE=>"" ); + my %env_vars = ( DIN_LOC_ROOT=>"MYDINLOCROOT", GLC_TWO_WAY_COUPLING=>"FALSE", NTHRDS_LND=>"1", NEONSITE=>"" ); # Set any settings that came in from function call foreach my $item ( keys(%settings) ) { $env_vars{$item} = $settings{$item}; From 17fb3d8ee57c94c757405b8f77afcf97de5b927f Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Thu, 11 Jul 2024 01:27:49 -0600 Subject: [PATCH 0658/1248] Changes to remove dust_emis namelist items from CTSM fortran code and use shr_dust_emis_mod from CMEPS --- components/cmeps | 2 +- src/biogeochem/DustEmisBase.F90 | 1 - src/biogeochem/DustEmisFactory.F90 | 14 ++++++-------- .../DustEmis_test/test_DustEmisZender2003.pf | 2 ++ src/cpl/nuopc/lnd_import_export.F90 | 5 +++++ .../share_esmf/ZenderSoilErodStreamType.F90 | 18 ++++++------------ src/main/clm_varctl.F90 | 5 ----- src/main/controlMod.F90 | 6 ------ 8 files changed, 20 insertions(+), 33 deletions(-) diff --git a/components/cmeps b/components/cmeps index 6384ff4e4a..e1335d32fc 160000 --- a/components/cmeps +++ b/components/cmeps @@ -1 +1 @@ -Subproject commit 6384ff4e4a6bc82a678f9419a43ffbd5d53ac209 +Subproject commit e1335d32fca0e5571a0d5a7edb0d1473266b7923 diff --git a/src/biogeochem/DustEmisBase.F90 b/src/biogeochem/DustEmisBase.F90 index c5e4260634..47f2f32688 100644 --- a/src/biogeochem/DustEmisBase.F90 +++ b/src/biogeochem/DustEmisBase.F90 @@ -31,7 +31,6 @@ module DustEmisBase use LandunitType , only : lun use ColumnType , only : col use PatchType , only : patch - use clm_varctl , only : dust_emis_method ! ! !PUBLIC TYPES implicit none diff --git a/src/biogeochem/DustEmisFactory.F90 b/src/biogeochem/DustEmisFactory.F90 index 371e77d6dc..24162fde24 100644 --- a/src/biogeochem/DustEmisFactory.F90 +++ b/src/biogeochem/DustEmisFactory.F90 @@ -28,9 +28,9 @@ function create_dust_emissions(bounds, NLFilename) result(dust_emis) !--------------------------------------------------------------------------- use DustEmisBase , only : dust_emis_base_type use DustEmisZender2003, only : dust_emis_zender2003_type - use clm_varctl , only : dust_emis_method use decompMod , only : bounds_type use shr_kind_mod , only : CL => shr_kind_cl + use shr_dust_emis_mod , only : is_dust_emis_zender, is_dust_emis_leung implicit none ! Arguments class(dust_emis_base_type), allocatable :: dust_emis @@ -38,20 +38,18 @@ function create_dust_emissions(bounds, NLFilename) result(dust_emis) character(len=*), intent(in) :: NLFilename ! Local variables - select case ( trim(dust_emis_method) ) - - case( "Zender_2003" ) + if ( is_dust_emis_zender() )then allocate(dust_emis, source=dust_emis_zender2003_type() ) ! This will be added when the Leung2023 comes in - !case( "Leung_2023" ) + !else if ( is_dust_emis_leung() ) ! allocate(dust_emis, source=dust_emis_zender2003_type() ) - case default - write(iulog,*) 'ERROR: unknown dust_emis_method: ', dust_emis_method, & + else + write(iulog,*) 'ERROR: unknown dust_emis_method: ', & errMsg(sourcefile, __LINE__) call endrun( "Unrecognized dust_emis_method" ) - end select + end if call dust_emis%Init(bounds, NLFilename) diff --git a/src/biogeochem/test/DustEmis_test/test_DustEmisZender2003.pf b/src/biogeochem/test/DustEmis_test/test_DustEmisZender2003.pf index 8641b8cceb..0289cadabc 100644 --- a/src/biogeochem/test/DustEmis_test/test_DustEmisZender2003.pf +++ b/src/biogeochem/test/DustEmis_test/test_DustEmisZender2003.pf @@ -9,6 +9,7 @@ module test_DustEmisZender2003 use DustEmisZender2003 use shr_kind_mod , only : r8 => shr_kind_r8 use DustEmisFactory, only : create_dust_emissions + use shr_dust_emis_mod, only : dust_emis_set_options implicit none @@ -37,6 +38,7 @@ contains call this%input%setUp() ! Create the dust emission object last + call dust_emis_set_options( 'Zender_2003', 'atm') allocate(this%dust_emis, source = create_dust_emissions(bounds, NLFilename)) end subroutine setUp diff --git a/src/cpl/nuopc/lnd_import_export.F90 b/src/cpl/nuopc/lnd_import_export.F90 index b9966f81e9..624590b9a6 100644 --- a/src/cpl/nuopc/lnd_import_export.F90 +++ b/src/cpl/nuopc/lnd_import_export.F90 @@ -160,9 +160,11 @@ subroutine advertise_fields(gcomp, flds_scalar_name, glc_present, cism_evolve, r use shr_carma_mod , only : shr_carma_readnl use shr_ndep_mod , only : shr_ndep_readnl + use shr_dust_emis_mod , only : shr_dust_emis_readnl use shr_fire_emis_mod , only : shr_fire_emis_readnl use clm_varctl , only : ndep_from_cpl use controlMod , only : NLFilename + use spmdMod , only : mpicom ! input/output variables type(ESMF_GridComp) :: gcomp @@ -237,6 +239,9 @@ subroutine advertise_fields(gcomp, flds_scalar_name, glc_present, cism_evolve, r ! The following namelist reads should always be called regardless of the send_to_atm value + ! Dust emissions from land to atmosphere + call shr_dust_emis_readnl( mpicom, "drv_flds_in") + ! Dry Deposition velocities from land - ALSO initialize drydep here call shr_drydep_readnl("drv_flds_in", drydep_nflds) diff --git a/src/cpl/share_esmf/ZenderSoilErodStreamType.F90 b/src/cpl/share_esmf/ZenderSoilErodStreamType.F90 index 194e022132..32e776063b 100644 --- a/src/cpl/share_esmf/ZenderSoilErodStreamType.F90 +++ b/src/cpl/share_esmf/ZenderSoilErodStreamType.F90 @@ -42,7 +42,6 @@ module ZenderSoilErodStreamType ! ! PRIVATE DATA: type, private :: streamcontrol_type - character(len=CL) :: zender_soil_erod_source ! if calculed in lnd or atm character(len=CL) :: stream_fldFileName_zendersoilerod ! data Filename character(len=CL) :: stream_meshfile_zendersoilerod ! mesh Filename character(len=CL) :: zendersoilerod_mapalgo ! map algo @@ -179,7 +178,7 @@ logical function UseStreams(this) ! file is being used with it ! ! !USES: - use clm_varctl, only : dust_emis_method + use shr_dust_emis_mod, only : is_dust_emis_zender, is_zender_soil_erod_from_land ! ! !ARGUMENTS: implicit none @@ -189,7 +188,7 @@ logical function UseStreams(this) if ( .not. control%namelist_set )then call endrun(msg=' ERROR namelist NOT set before being used'//errMsg(sourcefile, __LINE__)) end if - if ( (trim(dust_emis_method) == 'Zender_2003') .and. (control%zender_soil_erod_source == "lnd") )then + if ( is_dust_emis_zender() .and. is_zender_soil_erod_from_land() )then UseStreams = .true. else UseStreams = .false. @@ -289,6 +288,7 @@ subroutine ReadNML(this, bounds, NLFilename) use shr_nl_mod , only : shr_nl_find_group_name use shr_log_mod , only : errMsg => shr_log_errMsg use shr_mpi_mod , only : shr_mpi_bcast + use shr_dust_emis_mod, only : is_zender_soil_erod_from_land ! ! arguments implicit none @@ -304,14 +304,13 @@ subroutine ReadNML(this, bounds, NLFilename) character(len=CL) :: stream_meshfile_zendersoilerod = ' ' character(len=CL) :: zendersoilerod_mapalgo = ' ' character(len=CL) :: tmp_file_array(3) - character(len=3) :: zender_soil_erod_source = 'atm' character(len=*), parameter :: namelist_name = 'zendersoilerod' ! MUST agree with group name in namelist definition to read. character(len=*), parameter :: subName = "('zendersoilerod::ReadNML')" !----------------------------------------------------------------------- namelist /zendersoilerod/ & ! MUST agree with namelist_name above zendersoilerod_mapalgo, stream_fldFileName_zendersoilerod, & - stream_meshfile_zendersoilerod, zender_soil_erod_source + stream_meshfile_zendersoilerod ! Default values for namelist @@ -330,12 +329,11 @@ subroutine ReadNML(this, bounds, NLFilename) close(nu_nml) endif - call shr_mpi_bcast(zender_soil_erod_source , mpicom) call shr_mpi_bcast(zendersoilerod_mapalgo , mpicom) call shr_mpi_bcast(stream_fldFileName_zendersoilerod , mpicom) call shr_mpi_bcast(stream_meshfile_zendersoilerod , mpicom) - if (masterproc .and. (zender_soil_erod_source == "lnd") ) then + if (masterproc .and. is_zender_soil_erod_from_land() ) then write(iulog,*) ' ' write(iulog,*) namelist_name, ' stream settings:' write(iulog,*) ' stream_fldFileName_zendersoilerod = ',stream_fldFileName_zendersoilerod @@ -343,13 +341,10 @@ subroutine ReadNML(this, bounds, NLFilename) write(iulog,*) ' zendersoilerod_mapalgo = ',zendersoilerod_mapalgo endif - if ( (trim(zender_soil_erod_source) /= 'atm') .and. (trim(zender_soil_erod_source) /= 'lnd') )then - call endrun(msg=' ERROR zender_soil_erod_source must be either lnd or atm and is NOT'//errMsg(sourcefile, __LINE__)) - end if tmp_file_array(1) = stream_fldFileName_zendersoilerod tmp_file_array(2) = stream_meshfile_zendersoilerod tmp_file_array(3) = zendersoilerod_mapalgo - if ( trim(zender_soil_erod_source) == 'lnd' )then + if ( is_zender_soil_erod_from_land() ) then do i = 1, size(tmp_file_array) if ( len_trim(tmp_file_array(i)) == 0 )then call endrun(msg=' ERROR '//trim(tmp_file_array(i))//' must be set when Zender_2003 is being used and zender_soil_erod_source is lnd'//errMsg(sourcefile, __LINE__)) @@ -365,7 +360,6 @@ subroutine ReadNML(this, bounds, NLFilename) this%stream_fldFileName_zendersoilerod = stream_fldFileName_zendersoilerod this%stream_meshfile_zendersoilerod = stream_meshfile_zendersoilerod this%zendersoilerod_mapalgo = zendersoilerod_mapalgo - this%zender_soil_erod_source = zender_soil_erod_source this%namelist_set = .true. diff --git a/src/main/clm_varctl.F90 b/src/main/clm_varctl.F90 index cbfcbfd8ea..97c818af94 100644 --- a/src/main/clm_varctl.F90 +++ b/src/main/clm_varctl.F90 @@ -276,11 +276,6 @@ module clm_varctl ! option to activate OC in snow in SNICAR logical, public :: do_sno_oc = .false. ! control to include organic carbon (OC) in snow - !---------------------------------------------------------- - ! DUST emission method - !---------------------------------------------------------- - character(len=25), public :: dust_emis_method = 'Zender_2003' ! Dust emisison method to use: Zender_2003 or Leung_2023 - !---------------------------------------------------------- ! C isotopes !---------------------------------------------------------- diff --git a/src/main/controlMod.F90 b/src/main/controlMod.F90 index 4773cc6921..c92732806c 100644 --- a/src/main/controlMod.F90 +++ b/src/main/controlMod.F90 @@ -207,12 +207,6 @@ subroutine control_init(dtime) for_testing_no_crop_seed_replenishment, & z0param_method, use_z0m_snowmelt - ! NOTE: EBK 02/26/2024: dust_emis_method is here in CTSM temporarily until it's moved to CMEPS - ! See: https://github.com/ESCOMP/CMEPS/pull/429 - ! Normally this should also need error checking and a broadcast, but since - ! there is only one hardcoded option right now that is unneeded. - namelist /clm_inparm/ dust_emis_method - ! vertical soil mixing variables namelist /clm_inparm/ & som_adv_flux, max_depth_cryoturb From 7dd9af0195592c2a2d9c49fc6767f53ea1bff128 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Thu, 11 Jul 2024 02:48:19 -0600 Subject: [PATCH 0659/1248] Update test number --- 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 a24b308620..cf5aedef9b 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 = 3259; +my $ntests = 3256; if ( defined($opts{'compare'}) ) { $ntests += 2001; From 18084b8614d36b6ec24860af95e34df400aa8872 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Thu, 11 Jul 2024 11:59:22 -0600 Subject: [PATCH 0660/1248] Final ChangeLog/ChangeSum --- doc/ChangeLog | 10 +++------- doc/ChangeSum | 2 +- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index f9fa259a05..beca7fbd7f 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,7 +1,7 @@ =============================================================== Tag name: ctsm5.2.010 Originator(s): @cathyxinchangli (Cathy Xinchang Li, U of Illinois - Urbana-Champaign), @Face2sea, @olyson, @fang-bowen, @keerzhang1 -Date: Wed 10 Jul 2024 05:00:24 PM MDT +Date: Thu 11 Jul 2024 11:57:15 AM MDT One-line Summary: Explicit A/C adoption Purpose and description of changes @@ -48,10 +48,6 @@ Changes to the datasets (e.g., parameter, surface or initial files): Changes to documentation: -Substantial timing or memory changes: -[e.g., check PFS test in the test suite and look at timings, if you -expect possible significant timing changes] - Testing summary: ---------------- @@ -60,8 +56,8 @@ Testing summary: regular tests (aux_clm: https://github.com/ESCOMP/CTSM/wiki/System-Testing-Guide#pre-merge-system-testing): - derecho ----- IN PROGRESS - izumi ------- + derecho ----- OK + izumi ------- OK Answer changes -------------- diff --git a/doc/ChangeSum b/doc/ChangeSum index be04c9c22e..5df9aa34cf 100644 --- a/doc/ChangeSum +++ b/doc/ChangeSum @@ -1,6 +1,6 @@ Tag Who Date Summary ============================================================================================================================ - ctsm5.2.010 multiple 07/10/2024 Explicit A/C adoption + ctsm5.2.010 multiple 07/11/2024 Explicit A/C adoption ctsm5.2.009 erik 07/10/2024 Allow for CAM7 in lnd_tuning_mode and handle C or E in long compset names ctsm5.2.008 erik 06/28/2024 Bring changes on temp-branch to master: b4b-dev, git-fleximod, hillslope fsat tmp-240620.n03.ctsm5.2.007 06/27/2024 Set upland hillslope column fsat values to zero (samrabin) From 976347ddcd0e158a54483b72f7a48d8825c96f37 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Thu, 11 Jul 2024 13:16:32 -0600 Subject: [PATCH 0661/1248] Update cmeps and ccs_config to versions used in #2590 which allows cases to build --- .gitmodules | 4 ++-- ccs_config | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitmodules b/.gitmodules index b48068c9f6..ee06997ce5 100644 --- a/.gitmodules +++ b/.gitmodules @@ -36,7 +36,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_cesm0.0.106 +fxtag = ccs_config_cesm1.0.0 fxrequired = ToplevelRequired fxDONOTUSEurl = https://github.com/ESMCI/ccs_config_cesm.git @@ -50,7 +50,7 @@ fxDONOTUSEurl = https://github.com/ESMCI/cime [submodule "cmeps"] path = components/cmeps url = https://github.com/ESCOMP/CMEPS.git -fxtag = cmeps0.14.73 +fxtag = cmeps0.14.77 fxrequired = ToplevelRequired fxDONOTUSEurl = https://github.com/ESCOMP/CMEPS.git diff --git a/ccs_config b/ccs_config index 2ff978f92a..69a958581e 160000 --- a/ccs_config +++ b/ccs_config @@ -1 +1 @@ -Subproject commit 2ff978f92a5ac9a6ab243e5c14d06a7e2d2f5799 +Subproject commit 69a958581ecd2d32ee9cb1c38bcd3847b8b920bf From 170b3a518701e7fb0494423bcc9ef11d90e87f62 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Thu, 11 Jul 2024 13:17:21 -0600 Subject: [PATCH 0662/1248] Update cmeps and ccs_config to versions used in #2590 which allows cases to build --- components/cmeps | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/cmeps b/components/cmeps index e1335d32fc..47fb4e633a 160000 --- a/components/cmeps +++ b/components/cmeps @@ -1 +1 @@ -Subproject commit e1335d32fca0e5571a0d5a7edb0d1473266b7923 +Subproject commit 47fb4e633a76ec6d60969b1af751f90790387246 From ba28bea5ca49e44e48d3739647baae04915d805f Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Thu, 11 Jul 2024 13:20:10 -0600 Subject: [PATCH 0663/1248] Update number of tests and comment out the whole values section as it fails without at least one thing set --- bld/unit_testers/build-namelist_test.pl | 2 +- cime_config/config_component.xml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bld/unit_testers/build-namelist_test.pl b/bld/unit_testers/build-namelist_test.pl index cf5aedef9b..5abb381c16 100755 --- a/bld/unit_testers/build-namelist_test.pl +++ b/bld/unit_testers/build-namelist_test.pl @@ -166,7 +166,7 @@ sub cat_and_create_namelistinfile { my $ntests = 3256; if ( defined($opts{'compare'}) ) { - $ntests += 2001; + $ntests += 1965; } plan( tests=>$ntests ); diff --git a/cime_config/config_component.xml b/cime_config/config_component.xml index 01990e162f..7500668905 100644 --- a/cime_config/config_component.xml +++ b/cime_config/config_component.xml @@ -166,11 +166,11 @@ logical TRUE,FALSE TRUE + + --> run_component_cpl env_run.xml If CTSM will set the dust settings in drv_flds_in (TRUE), or if ATM (i.e. CAM) will - DO NOT EDIT (set by compset name) From d67a354298714a5de2357a0216770b1b74603d09 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Thu, 11 Jul 2024 13:46:45 -0600 Subject: [PATCH 0664/1248] Correct number of tests in build-namelist_test and update ChangeLog --- bld/unit_testers/build-namelist_test.pl | 2 +- doc/ChangeLog | 78 +++++++++++++++++++++++++ doc/ChangeSum | 3 +- 3 files changed, 81 insertions(+), 2 deletions(-) diff --git a/bld/unit_testers/build-namelist_test.pl b/bld/unit_testers/build-namelist_test.pl index 7c2be32719..02088eecbe 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 = 3278; +my $ntests = 3277; if ( defined($opts{'compare'}) ) { $ntests += 1981; diff --git a/doc/ChangeLog b/doc/ChangeLog index beca7fbd7f..3a33553f64 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,4 +1,82 @@ =============================================================== +Tag name: ctsm5.2.011 +Originator(s): slevis (Samuel Levis,UCAR/TSS,303-665-1310) +Date: Thu 11 Jul 2024 01:14:12 PM MDT +One-line Summary: Merge b4b-dev + +Purpose and description of changes +---------------------------------- + +#2638 Remove use_dynroot and corresponding code and testing (slevis) +#2623 Change a NIWO test to HARV and update expected failures (slevis) +#2607 Fix py env create (wwieder) + +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_1 + +[ ] clm5_0 + +[ ] ctsm5_0-nwp + +[ ] clm4_5 + + +Bugs fixed +---------- +List of CTSM issues fixed (include CTSM Issue # and description) [one per line]: +Fixes #2451 Remove use_dynroot from clm codes and testing +Fixes #2563 Unable to install ctsm_pylib environment for mksurfdata_esmf in CTSM5.2.005 + +Notes of particular relevance for developers: +--------------------------------------------- +Changes to tests or testing: +Change a NIWO test to HARV and update expected failures + +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 - OK + + regular tests (aux_clm: https://github.com/ESCOMP/CTSM/wiki/System-Testing-Guide#pre-merge-system-testing): + + derecho ----- IN PROG + izumi ------- NOT STARTED + +Answer changes +-------------- + +Changes answers relative to baseline: NO + +Other details +------------- +[Remove any lines that don't apply. Remove entire section if nothing applies.] + +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/2638 + https://github.com/ESCOMP/ctsm/pull/2623 + https://github.com/ESCOMP/ctsm/pull/2607 + +=============================================================== +=============================================================== Tag name: ctsm5.2.010 Originator(s): @cathyxinchangli (Cathy Xinchang Li, U of Illinois - Urbana-Champaign), @Face2sea, @olyson, @fang-bowen, @keerzhang1 Date: Thu 11 Jul 2024 11:57:15 AM MDT diff --git a/doc/ChangeSum b/doc/ChangeSum index 5df9aa34cf..892913c52f 100644 --- a/doc/ChangeSum +++ b/doc/ChangeSum @@ -1,11 +1,12 @@ Tag Who Date Summary ============================================================================================================================ + ctsm5.2.011 slevis 07/11/2024 Merge b4b-dev ctsm5.2.010 multiple 07/11/2024 Explicit A/C adoption ctsm5.2.009 erik 07/10/2024 Allow for CAM7 in lnd_tuning_mode and handle C or E in long compset names ctsm5.2.008 erik 06/28/2024 Bring changes on temp-branch to master: b4b-dev, git-fleximod, hillslope fsat tmp-240620.n03.ctsm5.2.007 06/27/2024 Set upland hillslope column fsat values to zero (samrabin) tmp-240620.n02.ctsm5.2.007 06/21/2024 Another update of git-fleximod (erik) -tmp-240620.n01.ctsm5.2.007 06/21/2024 Merge b4b-dev (full tag name is tmp-240620.n01.ctsm5.2.007) (slevis) +tmp-240620.n01.ctsm5.2.007 06/21/2024 Merge b4b-dev (slevis) ctsm5.2.007 multiple 05/31/2024 Rm manage_externals and update documentation accordingly ctsm5.2.006 slevis 05/28/2024 Update externals to cesm2_3_beta17, remove mct, retire /test/tools ctsm5.2.005 erik 05/13/2024 Fix clm6_0 defaults and CESM testing issues, add tests to detect these problems From 4f436dcc855d00d0daf69c8d351cf8b19f525924 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Thu, 11 Jul 2024 15:48:50 -0600 Subject: [PATCH 0665/1248] Draft ChangeLog/ChangeSum files --- doc/ChangeLog | 66 +++++++++++++++++++++++++++++++++++++++++++++++++++ doc/ChangeSum | 1 + 2 files changed, 67 insertions(+) diff --git a/doc/ChangeLog b/doc/ChangeLog index 2ab7676ddc..4ebd09163a 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,4 +1,70 @@ =============================================================== +Tag name: ctsm5.2.013 +Originator(s): sacks (Bill Sacks, UCAR/NCAR/CGD) +Date: Thu 11 Jul 2024 03:38:12 PM MDT +One-line Summary: Relax tolerance for truncating small snocan values in CanopyFluxes + +Purpose and description of changes +---------------------------------- + +Details in the PR #2457. + + +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_1 + +[ ] clm5_0 + +[ ] ctsm5_0-nwp + +[ ] clm4_5 + + +Bugs fixed +---------- +List of CTSM issues fixed (include CTSM Issue # and description) [one per line]: +Fixes #2444 Failing water isotope test on the ctsm5.2 branch + +Notes of particular relevance for users +--------------------------------------- +Changes to documentation: None + +Testing summary: +---------------- + + [PASS means all tests PASS; OK means tests PASS other than expected fails.] + + 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: + Yes, roundoff. + + - what code configurations: All + - what platforms/compilers: All + - nature of change: Changes start roundoff level and grow over time. + +Other details +------------- +Pull Requests that document the changes (include PR ids): + https://github.com/ESCOMP/ctsm/pull/2457 + +=============================================================== +=============================================================== Tag name: ctsm5.2.008 Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326) Date: Fri 28 Jun 2024 12:22:46 PM MDT diff --git a/doc/ChangeSum b/doc/ChangeSum index ea9417fe41..1af9fcf58e 100644 --- a/doc/ChangeSum +++ b/doc/ChangeSum @@ -1,5 +1,6 @@ Tag Who Date Summary ============================================================================================================================ + ctsm5.2.013 sacks 07/??/2024 Relax tolerance for truncating small snocan values in CanopyFluxes ctsm5.2.008 erik 06/28/2024 Bring changes on temp-branch to master: b4b-dev, git-fleximod, hillslope fsat tmp-240620.n03.ctsm5.2.007 06/27/2024 Set upland hillslope column fsat values to zero (samrabin) tmp-240620.n02.ctsm5.2.007 06/21/2024 Another update of git-fleximod (erik) From 7994c82a4427860494c79611fc32fa0efecadeb3 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Thu, 11 Jul 2024 16:29:12 -0600 Subject: [PATCH 0666/1248] Save crop date variables in testmods more frequently. --- cime_config/testdefs/testmods_dirs/clm/crop/user_nl_clm | 7 +++++-- .../testdefs/testmods_dirs/clm/cropMonthOutput/user_nl_clm | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/cime_config/testdefs/testmods_dirs/clm/crop/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/crop/user_nl_clm index a368e97593..aea8e39e6c 100644 --- a/cime_config/testdefs/testmods_dirs/clm/crop/user_nl_clm +++ b/cime_config/testdefs/testmods_dirs/clm/crop/user_nl_clm @@ -9,9 +9,12 @@ hist_fincl2 += 'DYN_COL_SOIL_ADJUSTMENTS_C' -! Annual instantaneous crop variables (including per-sowing/per-harvest axes), per PFT. +! Instantaneous crop variables (including per-sowing/per-harvest axes), per PFT. +! Note that, under normal circumstances, these should only be saved annually. +! That's needed for the mxsowings and mxharvests axes to make sense. +! However, for testing purposes, it makes sense to save more frequently. hist_fincl3 = 'SDATES', 'SDATES_PERHARV', 'SYEARS_PERHARV', 'HDATES', 'GRAINC_TO_FOOD_PERHARV', 'GRAINC_TO_FOOD_ANN', 'GRAINN_TO_FOOD_PERHARV', 'GRAINN_TO_FOOD_ANN', 'GRAINC_TO_SEED_PERHARV', 'GRAINC_TO_SEED_ANN', 'GRAINN_TO_SEED_PERHARV', 'GRAINN_TO_SEED_ANN', 'HDATES', 'GDDHARV_PERHARV', 'GDDACCUM_PERHARV', 'HUI_PERHARV', 'SOWING_REASON_PERHARV', 'HARVEST_REASON_PERHARV', 'SWINDOW_STARTS', 'SWINDOW_ENDS', 'GDD20_BASELINE', 'GDD20_SEASON_START', 'GDD20_SEASON_END' -hist_nhtfrq(3) = 17520 +hist_nhtfrq(3) = -24 hist_mfilt(3) = 1 hist_type1d_pertape(3) = 'PFTS' hist_dov2xy(3) = .false. diff --git a/cime_config/testdefs/testmods_dirs/clm/cropMonthOutput/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/cropMonthOutput/user_nl_clm index 8f779ed011..18220de5ef 100644 --- a/cime_config/testdefs/testmods_dirs/clm/cropMonthOutput/user_nl_clm +++ b/cime_config/testdefs/testmods_dirs/clm/cropMonthOutput/user_nl_clm @@ -1,4 +1,4 @@ - hist_nhtfrq = 0,-240,17520 + hist_nhtfrq = 0,-240,0 hist_mfilt = 1,1,1 ! NOTE slevis (2024/2/23) Adding option for tests to pass. In the long term From 014800df4825a909f3a0297951fcd4f8f05f232b Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Thu, 11 Jul 2024 16:32:25 -0600 Subject: [PATCH 0667/1248] Add tweak_latlons.py. --- python/ctsm/crop_calendars/tweak_latlons.py | 168 ++++++++++++++++++++ 1 file changed, 168 insertions(+) create mode 100644 python/ctsm/crop_calendars/tweak_latlons.py diff --git a/python/ctsm/crop_calendars/tweak_latlons.py b/python/ctsm/crop_calendars/tweak_latlons.py new file mode 100644 index 0000000000..de35ced0d1 --- /dev/null +++ b/python/ctsm/crop_calendars/tweak_latlons.py @@ -0,0 +1,168 @@ +# %% +import numpy as np +import xarray as xr +import os +import sys +from netCDF4 import Dataset +import contextlib + +# -- add python/ctsm to path (needed if we want to run this stand-alone) +_CTSM_PYTHON = os.path.join(os.path.dirname(os.path.realpath(__file__)), os.pardir, os.pardir) +sys.path.insert(1, _CTSM_PYTHON) +# pylint: disable=wrong-import-position +from ctsm.mesh_maker import main as mesh_maker + +topdir = "/glade/campaign/cesm/cesmdata/inputdata/lnd/clm2/cropdata/calendars/processed/" +file_list_in = [ + "swindow_starts_ggcmi_crop_calendar_phase3_v1.01.2000-2000.20231005_145103.nc", + "swindow_ends_ggcmi_crop_calendar_phase3_v1.01.2000-2000.20231005_145103.nc", + "gdds_20230829_161011.nc", +] +file_mesh_in = ( + "/glade/campaign/cesm/cesmdata/inputdata/share/meshes/360x720_120830_ESMFmesh_c20210507_cdf5.nc" +) + +file_list_out = [] +coord_list = ["lat", "lon"] + +# %% + + +def apply_tweak(ds, coord_str, tweak=1e-6): + # Apply tweak + da = ds[coord_str] + coord2 = da.values + coord2 += tweak + while np.any(coord2 == da.values): + tweak *= 10 + coord2 = da.values + coord2 += tweak + coord_tweak = np.full_like(coord2, tweak) + + # Ensure that no value is above maximum in input data. This is needed for mesh_maker to work. + max_coord = np.max(da.values) + where_toohigh = np.where(coord2 > max_coord) + Ntoohigh = len(where_toohigh[0]) + if Ntoohigh != 1: + raise RuntimeError(f"Expected 1 coordinate value too high; got {Ntoohigh}") + coord2[where_toohigh] = max_coord + coord_tweak[where_toohigh] = max_coord + + # Convert to DataArray + new_coords_dict = {coord_str: coord2} + da2 = xr.DataArray( + data=coord2, + coords=new_coords_dict, + dims=da.dims, + attrs=da.attrs, + ) + + # Replace coordinate in dataset + ds[coord_str] = da2 + + # Add a variable with the amount of the tweak + tweak_attrs = {} + if "standard_name" in da: + coord_name = da.attrs["standard_name"] + else: + coord_name = da.attrs["long_name"].replace("coordinate_", "") + tweak_attrs["standard_name"] = coord_name + "_tweak" + tweak_attrs[ + "long_name" + ] = f"Amount {coord_name} was shifted to avoid ambiguous nearest neighbors" + tweak_attrs["units"] = da.attrs["units"] + da_tweak = xr.DataArray( + data=coord_tweak, + coords=new_coords_dict, + dims=da.dims, + attrs=tweak_attrs, + ) + tweak_name = coord_str + "_tweak" + ds[tweak_name] = da_tweak + + return ds + + +# %% Apply tweak to all files + +for filename in file_list_in: + file_in = os.path.join(topdir, filename) + ds = xr.open_dataset(file_in) + + for coord in coord_list: + ds = apply_tweak(ds, coord, tweak=1e-6) + + # Set up for save + file_out = file_in.replace(".nc", ".tweaked_latlons.nc") + with Dataset(file_in, "r") as netcdf_file: + netcdf_format = netcdf_file.data_model + + # Save + print(f"Saving {file_out}") + ds.to_netcdf(file_out, format=netcdf_format) + file_list_out.append(file_out) +print("Done") + + +# %% Ensure all files got the same tweaks + +ds = xr.open_dataset(file_list_out[0]) + +for filename in file_list_out[1:]: + ds2 = xr.open_dataset(filename) + for coord in coord_list: + # Ensure that coordinates are the same + var = coord + assert np.array_equal(ds[var].values, ds2[var].values) + # Ensure that tweaks were the same + var = coord + "_tweak" + assert np.array_equal(ds[var].values, ds2[var].values) +print("All good!") + + +# %% Save new mesh file + +outfile_name = os.path.basename(file_mesh_in) +outfile_name = outfile_name.replace(".nc", ".tweaked_latlons.nc") +outdir = os.path.dirname(file_list_out[0]) +file_mesh_out = os.path.join(outdir, outfile_name) + +@contextlib.contextmanager +def redirect_argv(arglist): + argv_tmp = sys.argv[:] + sys.argv=arglist + yield + sys.argv = argv_tmp + + +mesh_maker_args = [ + "mesh_maker", + "--input", + file_list_out[0], + "--output", + file_mesh_out, + "--lat", + "lat", + "--lon", + "lon", + "--overwrite", +] +print(f"Saving {file_mesh_out}...") +with redirect_argv(mesh_maker_args): + mesh_maker() + +# Change format, if needed +with Dataset(file_mesh_in, "r") as netcdf_file: + netcdf_format_in = netcdf_file.data_model +with Dataset(file_mesh_out, "r") as netcdf_file: + netcdf_format_out = netcdf_file.data_model +if netcdf_format_in != netcdf_format_out: + file_mesh_out_tmp = file_mesh_out + ".tmp" + os.rename(file_mesh_out, file_mesh_out_tmp) + ds = xr.open_dataset(file_mesh_out_tmp) + ds.to_netcdf(file_mesh_out, format=netcdf_format_in) + os.remove(file_mesh_out_tmp) + + +print("Done") +# %% From 4c1d66f88985340b2b95dc909b55587475d75514 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Thu, 11 Jul 2024 16:37:20 -0600 Subject: [PATCH 0668/1248] mesh_type.py: Handle a broadcast error. --- python/ctsm/site_and_regional/mesh_type.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/python/ctsm/site_and_regional/mesh_type.py b/python/ctsm/site_and_regional/mesh_type.py index be785e745d..0260f1c816 100644 --- a/python/ctsm/site_and_regional/mesh_type.py +++ b/python/ctsm/site_and_regional/mesh_type.py @@ -235,8 +235,16 @@ def create_2d_coords(self): lons_size = self.center_lons.size # -- convert center points from 1d to 2d - self.center_lat2d = np.broadcast_to(self.center_lats[:], (lons_size, lats_size)) - self.center_lon2d = np.broadcast_to(self.center_lons[:], (lons_size, lats_size)) + try: + self.center_lat2d = np.broadcast_to(self.center_lats[:], (lons_size, lats_size)) + self.center_lon2d = np.broadcast_to(self.center_lons[:], (lons_size, lats_size)) + except ValueError: + self.center_lat2d = np.broadcast_to( + np.expand_dims(self.center_lats[:], 0), (lons_size, lats_size) + ) + self.center_lon2d = np.broadcast_to( + np.expand_dims(self.center_lons[:], 1), (lons_size, lats_size) + ) elif self.lat_dims == 2: # -- 2D lats and lons dims = self.center_lons.shape From f11003ba4e751e7749ebf2ddfb7a26a73ebb04f7 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Thu, 11 Jul 2024 16:37:46 -0600 Subject: [PATCH 0669/1248] mesh_type.py: Improve error for lon > 360. --- python/ctsm/site_and_regional/mesh_type.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/ctsm/site_and_regional/mesh_type.py b/python/ctsm/site_and_regional/mesh_type.py index 0260f1c816..47c0295593 100644 --- a/python/ctsm/site_and_regional/mesh_type.py +++ b/python/ctsm/site_and_regional/mesh_type.py @@ -359,7 +359,7 @@ def calculate_corners(self, unit="degrees"): ) # Longitudes should stay within 0 to 360 if np.any(self.corner_lons > 360.0): - abort("Corners have longitudes greater than 360") + abort(f"Corners have longitudes greater than 360 (max: {np.max(self.corner_lons)})") if np.any(self.corner_lons < 0.0): logger.warning( "Corners have longitudes less than zero -- %s %s", From 231b4ac4372421a714106ec10178416dcb3cb2c6 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Thu, 11 Jul 2024 16:44:31 -0600 Subject: [PATCH 0670/1248] tweak_latlons.py: Add more files. --- python/ctsm/crop_calendars/tweak_latlons.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/python/ctsm/crop_calendars/tweak_latlons.py b/python/ctsm/crop_calendars/tweak_latlons.py index de35ced0d1..89144a80ae 100644 --- a/python/ctsm/crop_calendars/tweak_latlons.py +++ b/python/ctsm/crop_calendars/tweak_latlons.py @@ -17,6 +17,9 @@ "swindow_starts_ggcmi_crop_calendar_phase3_v1.01.2000-2000.20231005_145103.nc", "swindow_ends_ggcmi_crop_calendar_phase3_v1.01.2000-2000.20231005_145103.nc", "gdds_20230829_161011.nc", + "gdd20bl.copied_from.gdds_20230829_161011.v2.nc", + "sdates_ggcmi_crop_calendar_phase3_v1.01_nninterp-hcru_hcru_mt13.2000-2000.20230728_165845.nc", + "hdates_ggcmi_crop_calendar_phase3_v1.01_nninterp-hcru_hcru_mt13.2000-2000.20230728_165845.nc", ] file_mesh_in = ( "/glade/campaign/cesm/cesmdata/inputdata/share/meshes/360x720_120830_ESMFmesh_c20210507_cdf5.nc" From 9f186d489d9ce2d3b982cd367756dd43102262a8 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Thu, 11 Jul 2024 16:45:50 -0600 Subject: [PATCH 0671/1248] Use tweaked_latlon cropcal inputs. This avoids different "nearest neighbors" being chosen when using a different number of processors. See https://github.com/orgs/esmf-org/discussions/261 --- bld/namelist_files/namelist_defaults_ctsm.xml | 22 +++++++++---------- .../clm/sowingWindows/user_nl_clm | 6 ++--- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index ae9f9dee6a..d1f9d8545c 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -1704,17 +1704,17 @@ lnd/clm2/surfdata_esmf/NEON/surfdata_1x1_NEON_TOOL_hist_78pfts_CMIP6_simyr2000_c 2000 -lnd/clm2/cropdata/calendars/processed/swindow_starts_ggcmi_crop_calendar_phase3_v1.01.2000-2000.20231005_145103.nc -lnd/clm2/cropdata/calendars/processed/swindow_ends_ggcmi_crop_calendar_phase3_v1.01.2000-2000.20231005_145103.nc -lnd/clm2/cropdata/calendars/processed/gdds_20230829_161011.nc -share/meshes/360x720_120830_ESMFmesh_c20210507_cdf5.nc -lnd/clm2/cropdata/calendars/processed/swindow_starts_ggcmi_crop_calendar_phase3_v1.01.2000-2000.20231005_145103.nc -lnd/clm2/cropdata/calendars/processed/swindow_ends_ggcmi_crop_calendar_phase3_v1.01.2000-2000.20231005_145103.nc -lnd/clm2/cropdata/calendars/processed/gdds_20230829_161011.nc -lnd/clm2/cropdata/calendars/processed/gdd20bl.copied_from.gdds_20230829_161011.v2.nc -lnd/clm2/cropdata/calendars/processed/sdates_ggcmi_crop_calendar_phase3_v1.01_nninterp-hcru_hcru_mt13.2000-2000.20230728_165845.nc -lnd/clm2/cropdata/calendars/processed/hdates_ggcmi_crop_calendar_phase3_v1.01_nninterp-hcru_hcru_mt13.2000-2000.20230728_165845.nc -share/meshes/360x720_120830_ESMFmesh_c20210507_cdf5.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/swindow_starts_ggcmi_crop_calendar_phase3_v1.01.2000-2000.20231005_145103.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/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/swindow_starts_ggcmi_crop_calendar_phase3_v1.01.2000-2000.20231005_145103.tweaked_latlons.nc diff --git a/cime_config/testdefs/testmods_dirs/clm/sowingWindows/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/sowingWindows/user_nl_clm index 545e5f6ebd..7024e99b96 100644 --- a/cime_config/testdefs/testmods_dirs/clm/sowingWindows/user_nl_clm +++ b/cime_config/testdefs/testmods_dirs/clm/sowingWindows/user_nl_clm @@ -1,5 +1,5 @@ -stream_fldFileName_swindow_start = '$DIN_LOC_ROOT/lnd/clm2/cropdata/calendars/processed/swindow_starts_ggcmi_crop_calendar_phase3_v1.01.2000-2000.20231005_145103.nc' -stream_fldFileName_swindow_end = '$DIN_LOC_ROOT/lnd/clm2/cropdata/calendars/processed/swindow_ends_ggcmi_crop_calendar_phase3_v1.01.2000-2000.20231005_145103.nc' -stream_meshfile_cropcal = '$DIN_LOC_ROOT/share/meshes/360x720_120830_ESMFmesh_c20210507_cdf5.nc' +stream_fldFileName_swindow_start = '$DIN_LOC_ROOT/lnd/clm2/cropdata/calendars/processed/swindow_starts_ggcmi_crop_calendar_phase3_v1.01.2000-2000.20231005_145103.tweaked_latlons.nc' +stream_fldFileName_swindow_end = '$DIN_LOC_ROOT/lnd/clm2/cropdata/calendars/processed/swindow_ends_ggcmi_crop_calendar_phase3_v1.01.2000-2000.20231005_145103.tweaked_latlons.nc' +stream_meshfile_cropcal = '$DIN_LOC_ROOT/lnd/clm2/cropdata/calendars/processed/swindow_starts_ggcmi_crop_calendar_phase3_v1.01.2000-2000.20231005_145103.tweaked_latlons.nc' stream_year_first_cropcal_swindows = 2000 stream_year_last_cropcal_swindows = 2000 From 3ce1bb42c09670d87cd9fdca86cdbd24b19fd1f2 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Thu, 11 Jul 2024 17:34:25 -0600 Subject: [PATCH 0672/1248] Code mods to get the error check in the previous commit to work --- bld/CLMBuildNamelist.pm | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index 7038351688..caa116e3bc 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -4650,14 +4650,13 @@ sub setup_logic_cnmatrix { , 'spinup_matrixcn'=>$nl_flags->{'spinup_matrixcn'}, 'clm_accelerated_spinup'=>$nl_flags->{'clm_accelerated_spinup'} ); } @matrixlist = ( "use_matrixcn", "use_soil_matrixcn", "hist_wrt_matrixcn_diag", "spinup_matrixcn" ); - # Matrix items can't be on for NTHRDS_LND > 1 - my $var_xml = "NTHRDS_LND"; - my $val_xml = int($envxml_ref->{$var_xml}); - print "$var_xml = $val_xml"; + # Matrix items can't be on for OMP_NUM_THREADS (also known as NTHRDS_LND) > 1 + my $var_xml = "OMP_NUM_THREADS"; + my $val_xml = $ENV{$var_xml}; if ( $val_xml > 1) { foreach my $var ( @matrixlist ) { if ( &value_is_true($nl->get_value($var)) ) { - $log->warning("$var and $var_xml > 1 causes a clm threading test to FAIL (as of 2024/7/10), so use at your own risk." ); + $log->warning("$var and $var_xml > 1 (in this case $val_xml) causes a clm threading test to FAIL (as of 2024/7/10), so use at your own risk." ); } } } From c6fba2250092ac1ad776b0ab2fbff9a09db6ad46 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Fri, 12 Jul 2024 09:47:27 -0600 Subject: [PATCH 0673/1248] Final ChangeLog/ChangeSum files --- doc/ChangeLog | 6 +++--- doc/ChangeSum | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index 3a33553f64..d12c30e731 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,7 +1,7 @@ =============================================================== Tag name: ctsm5.2.011 Originator(s): slevis (Samuel Levis,UCAR/TSS,303-665-1310) -Date: Thu 11 Jul 2024 01:14:12 PM MDT +Date: Fri 12 Jul 2024 09:45:59 AM MDT One-line Summary: Merge b4b-dev Purpose and description of changes @@ -56,8 +56,8 @@ Testing summary: regular tests (aux_clm: https://github.com/ESCOMP/CTSM/wiki/System-Testing-Guide#pre-merge-system-testing): - derecho ----- IN PROG - izumi ------- NOT STARTED + derecho ----- OK + izumi ------- OK Answer changes -------------- diff --git a/doc/ChangeSum b/doc/ChangeSum index 892913c52f..79ee06377d 100644 --- a/doc/ChangeSum +++ b/doc/ChangeSum @@ -1,6 +1,6 @@ Tag Who Date Summary ============================================================================================================================ - ctsm5.2.011 slevis 07/11/2024 Merge b4b-dev + ctsm5.2.011 slevis 07/12/2024 Merge b4b-dev ctsm5.2.010 multiple 07/11/2024 Explicit A/C adoption ctsm5.2.009 erik 07/10/2024 Allow for CAM7 in lnd_tuning_mode and handle C or E in long compset names ctsm5.2.008 erik 06/28/2024 Bring changes on temp-branch to master: b4b-dev, git-fleximod, hillslope fsat From 1377d48022c5db5a7352744b7356aa4cce1e8413 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Fri, 12 Jul 2024 10:12:26 -0600 Subject: [PATCH 0674/1248] Fix default stream_meshfile_cropcal. --- 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 d1f9d8545c..3f8bc1f382 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -1707,14 +1707,14 @@ lnd/clm2/surfdata_esmf/NEON/surfdata_1x1_NEON_TOOL_hist_78pfts_CMIP6_simyr2000_c 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/swindow_starts_ggcmi_crop_calendar_phase3_v1.01.2000-2000.20231005_145103.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/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/swindow_starts_ggcmi_crop_calendar_phase3_v1.01.2000-2000.20231005_145103.tweaked_latlons.nc +lnd/clm2/cropdata/calendars/processed/360x720_120830_ESMFmesh_c20210507_cdf5.tweaked_latlons.nc From d60dc80d74609096b63c942ca41e0ca38177683b Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Fri, 12 Jul 2024 10:13:06 -0600 Subject: [PATCH 0675/1248] Fix reset of sowing_reason_perharv_patch. --- src/biogeochem/CNPhenologyMod.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/biogeochem/CNPhenologyMod.F90 b/src/biogeochem/CNPhenologyMod.F90 index d4f486acb7..d1d3c85b21 100644 --- a/src/biogeochem/CNPhenologyMod.F90 +++ b/src/biogeochem/CNPhenologyMod.F90 @@ -1976,7 +1976,7 @@ subroutine CropPhenology(num_pcropp, filter_pcropp , & cnveg_state_inst%gddmaturity_thisyr(p,s) = -1._r8 crop_inst%gddaccum_thisyr_patch(p,s) = -1._r8 crop_inst%hui_thisyr_patch(p,s) = -1._r8 - crop_inst%sowing_reason_perharv_patch = -1._r8 + crop_inst%sowing_reason_perharv_patch(p,s) = -1._r8 crop_inst%harvest_reason_thisyr_patch(p,s) = -1._r8 do k = repr_grain_min, repr_grain_max cnveg_carbonflux_inst%repr_grainc_to_food_perharv_patch(p,s,k) = 0._r8 From 093f5fb615988c4ec3cf9e41997178ca45e4808c Mon Sep 17 00:00:00 2001 From: Gregory Lemieux <7565064+glemieux@users.noreply.github.com> Date: Fri, 12 Jul 2024 09:55:43 -0700 Subject: [PATCH 0676/1248] Update bld/namelist_files/namelist_definition_ctsm.xml with note asterisks --- bld/namelist_files/namelist_definition_ctsm.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bld/namelist_files/namelist_definition_ctsm.xml b/bld/namelist_files/namelist_definition_ctsm.xml index c8118031cc..ce2c1b3c5a 100644 --- a/bld/namelist_files/namelist_definition_ctsm.xml +++ b/bld/namelist_files/namelist_definition_ctsm.xml @@ -740,7 +740,7 @@ Set FATES harvesting mode by setting fates_harvest_mode to a valid string option Allowed values are: no_harvest: no fates harvesting of any kind event_code: fates logging via fates logging event codes (see fates parameter file) only - landuse_timeseries: fates harvest driven by CLM flanduse_timeseries file (dynHarvestMod) + landuse_timeseries: fates harvest driven by CLM flanduse_timeseries file (dynHarvestMod)** luhdata_area: fates harvest driven by LUH2 raw harvest data, area-based (dynFATESLandUseChangeMod) luhdata_mass: fates harvest driven by LUH2 raw harvest data, mass-based (dynFATESLandUseChangeMod) Note that the landuse_timeseries option is not the same as the FATES fluh_timeseries data file. From 63c458254274edf650aac6bb0da359630446bfca Mon Sep 17 00:00:00 2001 From: Gregory Lemieux <7565064+glemieux@users.noreply.github.com> Date: Fri, 12 Jul 2024 09:57:09 -0700 Subject: [PATCH 0677/1248] Update bld/namelist_files/namelist_definition_ctsm.xml with astericks Link to note --- bld/namelist_files/namelist_definition_ctsm.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bld/namelist_files/namelist_definition_ctsm.xml b/bld/namelist_files/namelist_definition_ctsm.xml index ce2c1b3c5a..208c42038e 100644 --- a/bld/namelist_files/namelist_definition_ctsm.xml +++ b/bld/namelist_files/namelist_definition_ctsm.xml @@ -743,7 +743,7 @@ Allowed values are: landuse_timeseries: fates harvest driven by CLM flanduse_timeseries file (dynHarvestMod)** luhdata_area: fates harvest driven by LUH2 raw harvest data, area-based (dynFATESLandUseChangeMod) luhdata_mass: fates harvest driven by LUH2 raw harvest data, mass-based (dynFATESLandUseChangeMod) -Note that the landuse_timeseries option is not the same as the FATES fluh_timeseries data file. +**Note that the landuse_timeseries option is not the same as the FATES fluh_timeseries data file. This option is older than the luhdata options and may be depricated at some point in the future. From 7417640e49d9b83932b0ba608b13987b5e62de2c Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Fri, 12 Jul 2024 11:07:12 -0600 Subject: [PATCH 0678/1248] Allow tests with threading to proceed with -ignore_warnings --- cime_config/testdefs/testlist_clm.xml | 42 +++++++++---------- .../clm/matrixcnOn_Hist/shell_commands | 3 -- .../include_user_mods | 0 .../matrixcnOn_ignore_warnings/shell_commands | 7 ++++ 4 files changed, 28 insertions(+), 24 deletions(-) delete mode 100644 cime_config/testdefs/testmods_dirs/clm/matrixcnOn_Hist/shell_commands rename cime_config/testdefs/testmods_dirs/clm/{matrixcnOn_Hist => matrixcnOn_ignore_warnings}/include_user_mods (100%) create mode 100644 cime_config/testdefs/testmods_dirs/clm/matrixcnOn_ignore_warnings/shell_commands diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index 1fe5ed770d..7ead363a6d 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -548,7 +548,7 @@ - + @@ -794,7 +794,7 @@ - + @@ -1002,7 +1002,7 @@ - + @@ -1020,7 +1020,7 @@ - + @@ -1038,7 +1038,7 @@ - + @@ -1074,7 +1074,7 @@ - + @@ -1092,7 +1092,7 @@ - + @@ -1145,7 +1145,7 @@ - + @@ -1162,7 +1162,7 @@ - + @@ -1234,7 +1234,7 @@ - + @@ -1354,7 +1354,7 @@ - + @@ -1390,7 +1390,7 @@ - + @@ -1435,7 +1435,7 @@ - + @@ -1445,7 +1445,7 @@ - + @@ -1455,7 +1455,7 @@ - + @@ -1793,7 +1793,7 @@ - + @@ -1849,7 +1849,7 @@ - + @@ -1897,7 +1897,7 @@ - + @@ -1925,7 +1925,7 @@ - + @@ -1982,7 +1982,7 @@ - + @@ -2369,7 +2369,7 @@ - + diff --git a/cime_config/testdefs/testmods_dirs/clm/matrixcnOn_Hist/shell_commands b/cime_config/testdefs/testmods_dirs/clm/matrixcnOn_Hist/shell_commands deleted file mode 100644 index f0547f3f26..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/matrixcnOn_Hist/shell_commands +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -./xmlchange CLM_BLDNML_OPTS="-ignore_warnings" --append diff --git a/cime_config/testdefs/testmods_dirs/clm/matrixcnOn_Hist/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/matrixcnOn_ignore_warnings/include_user_mods similarity index 100% rename from cime_config/testdefs/testmods_dirs/clm/matrixcnOn_Hist/include_user_mods rename to cime_config/testdefs/testmods_dirs/clm/matrixcnOn_ignore_warnings/include_user_mods diff --git a/cime_config/testdefs/testmods_dirs/clm/matrixcnOn_ignore_warnings/shell_commands b/cime_config/testdefs/testmods_dirs/clm/matrixcnOn_ignore_warnings/shell_commands new file mode 100644 index 0000000000..d94ef06a5c --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/matrixcnOn_ignore_warnings/shell_commands @@ -0,0 +1,7 @@ +#!/bin/bash + +./xmlchange CLM_BLDNML_OPTS="-ignore_warnings" --append + +# In this testmod directory we are ignoring warnings about running +# matrixcn in transient simulations AND/OR +# warnings about running matrixcn with threading NTHRDS_LND > 1. From 1e9df4973fdfcb9e685026ecaed2b56745b24663 Mon Sep 17 00:00:00 2001 From: Gregory Lemieux <7565064+glemieux@users.noreply.github.com> Date: Fri, 12 Jul 2024 10:27:07 -0700 Subject: [PATCH 0679/1248] update comment regarding landuse x pft data set Pre-generating files is a more likely next step relative to auto-gen --- cime_config/SystemTests/pvt.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/cime_config/SystemTests/pvt.py b/cime_config/SystemTests/pvt.py index feef6cb04c..2a3dbafdc3 100644 --- a/cime_config/SystemTests/pvt.py +++ b/cime_config/SystemTests/pvt.py @@ -30,9 +30,8 @@ def __init__(self,case): error_message = (f"Only call PVT with testmod FatesLUPFT. {casebaseid} selected.") # Only allow to run if resolution is 4x5 for now - # Eventually we could set this up to generate the necessary land use x pft mapping - # on the fly, although this would also require generating the land use timeseries - # regridding on the fly which is a more time consuming endevour currently + # Other grid resolutions will be pre-processed and included in the namelist defaults at a future date. + # Potentially we could generate these on the fly although doing so would result in increased build time lnd_grid = self._case.get_value("LND_GRID") if lnd_grid != "4x5": error_message = (f"PVT can currently only be run with 4x5 resolution. {lnd_grid} selected.") From 48aeb43c9575c80a1547a85c1b02b529b690ac05 Mon Sep 17 00:00:00 2001 From: Gregory Lemieux <7565064+glemieux@users.noreply.github.com> Date: Fri, 12 Jul 2024 10:40:15 -0700 Subject: [PATCH 0680/1248] Update README with suggested clarification --- cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2/README | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2/README b/cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2/README index 79d6511d17..9b782cb2a7 100644 --- a/cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2/README +++ b/cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2/README @@ -1,2 +1,4 @@ Currently the FATES LUH2 category of test mods currently only supports -4x5 grid resolutions. +4x5 grid resolutions. This is because we only have one LUH2 time series +dataset for the 4x5 resolution. In the future we will provide more resolutions +which will be added to the namelist defaults. From 5c3e71fe608c73c47f8f3e9b8ac6ee4102ce63a5 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Fri, 12 Jul 2024 11:46:58 -0600 Subject: [PATCH 0681/1248] Remove midDecStart-RxCropCalsAdaptGGCMI test from expected fails. --- 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 0fac518374..03eb6a157d 100644 --- a/cime_config/testdefs/ExpectedTestFails.xml +++ b/cime_config/testdefs/ExpectedTestFails.xml @@ -170,13 +170,6 @@ - - - FAIL - #2593 - - - From dc488c77a715bba7115c92c43948b668c6c38bc0 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Fri, 12 Jul 2024 14:46:59 -0600 Subject: [PATCH 0682/1248] Improve interpolate_gdds.py. --- python/ctsm/crop_calendars/interpolate_gdds.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/python/ctsm/crop_calendars/interpolate_gdds.py b/python/ctsm/crop_calendars/interpolate_gdds.py index 2aa0b79997..809be98826 100755 --- a/python/ctsm/crop_calendars/interpolate_gdds.py +++ b/python/ctsm/crop_calendars/interpolate_gdds.py @@ -64,6 +64,14 @@ def _setup_process_args(): type=str, required=True, ) + parser.add_argument( + "-p", + "--variable-prefix", + help="Interpolate variables whose names start with this string", + type=str, + required=False, + default="gdd1_" + ) parser.add_argument( "--overwrite", help="If output file exists, overwrite it.", @@ -110,8 +118,12 @@ def interpolate_gdds(args): for var in ds_in: # Check variable - if "gdd1_" not in var: - raise RuntimeError(f"Unexpected variable {var} on input file") + if "lat" not in ds_in[var].dims and "lon" not in ds_in[var].dims: + print(f"Skipping variable {var} with dimensions {ds_in[var].dims}") + continue + elif args.variable_prefix not in var: + print(f"Unexpected variable {var} on input file. Skipping.") + continue if args.dry_run: continue From 9ee75610973c32376f6dc407c99a0bc8d55cad83 Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Fri, 12 Jul 2024 14:09:26 -0700 Subject: [PATCH 0683/1248] fix how harvest mode is passed to add_default for use_fates_luh --- bld/CLMBuildNamelist.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index 47e0fff402..ac87d6f4ca 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -4522,7 +4522,7 @@ sub setup_logic_fates { add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'use_fates_luh', 'use_fates'=>$nl_flags->{'use_fates'}, 'use_fates_lupft'=>$nl->get_value('use_fates_lupft'), 'use_fates_potentialveg'=>$nl->get_value('use_fates_potentialveg'), - 'fates_harvest_mode'=>$nl->get_value('fates_harvest_mode') ); + 'fates_harvest_mode'=>remove_leading_and_trailing_quotes($nl->get_value('fates_harvest_mode')) ); add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'use_fates_nocomp', 'use_fates'=>$nl_flags->{'use_fates'}, 'use_fates_lupft'=>$nl->get_value('use_fates_lupft'), 'use_fates_sp'=>$nl_flags->{'use_fates_sp'} ); From 48368ac9a5fd2c36fb57cd21c3be76f773e3744d Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Fri, 12 Jul 2024 15:11:48 -0700 Subject: [PATCH 0684/1248] add comment pointing to luh2 data set readme --- src/dyn_subgrid/dynFATESLandUseChangeMod.F90 | 1 + 1 file changed, 1 insertion(+) diff --git a/src/dyn_subgrid/dynFATESLandUseChangeMod.F90 b/src/dyn_subgrid/dynFATESLandUseChangeMod.F90 index 681d39f38c..1bc6ab929e 100644 --- a/src/dyn_subgrid/dynFATESLandUseChangeMod.F90 +++ b/src/dyn_subgrid/dynFATESLandUseChangeMod.F90 @@ -50,6 +50,7 @@ module dynFATESLandUseChangeMod type(dyn_file_type), target :: dynFatesLandUse_file ! LUH2 raw wood harvest area fraction + ! LUH2 data set variable names can be found at https://luh.umd.edu/LUH2/LUH2_v2h_README.pdf character(len=10), target :: landuse_harvest_area_varnames(num_landuse_harvest_vars) = & [character(len=10) :: 'primf_harv', 'primn_harv', 'secmf_harv', 'secyf_harv', 'secnf_harv'] From b0e6565a8d802db3c1a4a2ad3322726ed680b09f Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Fri, 12 Jul 2024 15:18:54 -0700 Subject: [PATCH 0685/1248] add single quotes around fates_harvest_mode in unit tests --- bld/unit_testers/build-namelist_test.pl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bld/unit_testers/build-namelist_test.pl b/bld/unit_testers/build-namelist_test.pl index b343e3d194..e60a411ccb 100755 --- a/bld/unit_testers/build-namelist_test.pl +++ b/bld/unit_testers/build-namelist_test.pl @@ -1009,7 +1009,7 @@ sub cat_and_create_namelistinfile { phys=>"clm5_0", }, "useloggingButNOTFATES" =>{ options=>"-envxml_dir . -no-megan", - namelst=>"fates_harvest_mode=event_code", + namelst=>"fates_harvest_mode='event_code'", GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm4_5", }, @@ -1064,12 +1064,12 @@ sub cat_and_create_namelistinfile { phys=>"clm5_0", }, "useFATESPOTVEGwithHARVEST" =>{ options=>"-bgc fates -envxml_dir . -no-megan", - namelst=>"use_fates_potentialveg=T,fates_harvest_mode=event_code", + namelst=>"use_fates_potentialveg=T,fates_harvest_mode='event_code'", GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm5_0", }, "useFATESHARVEST3WOLUH" =>{ options=>"-bgc fates -envxml_dir . -no-megan", - namelst=>"use_fates_luh=F,fates_harvest_mode=luhdata_area", + namelst=>"use_fates_luh=F,fates_harvest_mode='luhdata_area'", GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm5_0", }, From 3db9bf2788141d9eaea0d9f8dd331c96f7d01165 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Fri, 12 Jul 2024 15:08:03 -0600 Subject: [PATCH 0686/1248] tweak_latlons: Include gdd20 files. --- python/ctsm/crop_calendars/tweak_latlons.py | 105 +++++++++++++++----- 1 file changed, 80 insertions(+), 25 deletions(-) diff --git a/python/ctsm/crop_calendars/tweak_latlons.py b/python/ctsm/crop_calendars/tweak_latlons.py index 89144a80ae..0031d492e0 100644 --- a/python/ctsm/crop_calendars/tweak_latlons.py +++ b/python/ctsm/crop_calendars/tweak_latlons.py @@ -20,6 +20,8 @@ "gdd20bl.copied_from.gdds_20230829_161011.v2.nc", "sdates_ggcmi_crop_calendar_phase3_v1.01_nninterp-hcru_hcru_mt13.2000-2000.20230728_165845.nc", "hdates_ggcmi_crop_calendar_phase3_v1.01_nninterp-hcru_hcru_mt13.2000-2000.20230728_165845.nc", + "/glade/work/samrabin/cropCals_testing_20240626/gdds_20240712_114642_10x15_interpd_halfdeg.nc", + "/glade/work/samrabin/gdd20_baselines/gswp3.10x15_interpd_halfdeg.1980-2009.nc", ] file_mesh_in = ( "/glade/campaign/cesm/cesmdata/inputdata/share/meshes/360x720_120830_ESMFmesh_c20210507_cdf5.nc" @@ -27,19 +29,43 @@ file_list_out = [] coord_list = ["lat", "lon"] +COORD_DATATYPE = np.float64 -# %% - +# %% Define functions -def apply_tweak(ds, coord_str, tweak=1e-6): - # Apply tweak - da = ds[coord_str] - coord2 = da.values +def get_ds(topdir, file_in): + if not os.path.exists(file_in): + file_in = os.path.join(topdir, file_in) + ds = xr.open_dataset(file_in) + return file_in, ds + +def get_tweak(ds_in, coord_str, init_tweak): + """ + Get the tweak that will be applied to all datasets' lat/lon coordinates + """ + da = ds_in[coord_str] + coord2_orig = da.values.astype(COORD_DATATYPE) + coord2 = coord2_orig + tweak = init_tweak coord2 += tweak + + # This is necessary if precision is lower than float64 + max_tweak = 1e-2 while np.any(coord2 == da.values): tweak *= 10 - coord2 = da.values + if tweak > max_tweak: + raise RuntimeError(f"Tweaking by +{max_tweak} failed to 'take'") + coord2 = coord2_orig coord2 += tweak + return tweak + +def apply_tweak(ds_in, coord_str, tweak): + # Apply tweak + da = ds_in[coord_str] + coord2 = da.values.astype(COORD_DATATYPE) + coord2 += tweak + if np.any(coord2 == da.values): + raise RuntimeError('Tweak didn''t "take"') coord_tweak = np.full_like(coord2, tweak) # Ensure that no value is above maximum in input data. This is needed for mesh_maker to work. @@ -61,19 +87,22 @@ def apply_tweak(ds, coord_str, tweak=1e-6): ) # Replace coordinate in dataset - ds[coord_str] = da2 + ds_in[coord_str] = da2 # Add a variable with the amount of the tweak tweak_attrs = {} - if "standard_name" in da: + if "standard_name" in da.attrs: coord_name = da.attrs["standard_name"] - else: + elif "long_name" in da.attrs: coord_name = da.attrs["long_name"].replace("coordinate_", "") + else: + coord_name = coord_str tweak_attrs["standard_name"] = coord_name + "_tweak" tweak_attrs[ "long_name" ] = f"Amount {coord_name} was shifted to avoid ambiguous nearest neighbors" - tweak_attrs["units"] = da.attrs["units"] + if "units" in da.attrs: + tweak_attrs["units"] = da.attrs["units"] da_tweak = xr.DataArray( data=coord_tweak, coords=new_coords_dict, @@ -81,19 +110,48 @@ def apply_tweak(ds, coord_str, tweak=1e-6): attrs=tweak_attrs, ) tweak_name = coord_str + "_tweak" - ds[tweak_name] = da_tweak + ds_in[tweak_name] = da_tweak + + return ds_in + +def check(ds, f0_base, ds2, f_base, var): + if not np.array_equal(ds[var].values, ds2[var].values): + if not np.array_equal(ds[var].shape, ds2[var].shape): + msg = f"{var} shapes differ b/w {f0_base} ({ds[var].shape}) and {f_base} ({ds2[var].shape})" + raise RuntimeError(msg) + max_diff = np.max(np.abs(ds[var].values - ds2[var].values)) + msg = f"{var}s differ between {f0_base} and {f_base}; max = {max_diff}" + type0 = type(ds[var].values[0]) + type2 = type(ds2[var].values[0]) + if type0 != type2: + msg += f"\nTypes also differ: {type0} vs. {type2}" + raise RuntimeError(msg) - return ds +# %% Apply tweak to all files +# Set up empty dicts +tweak_dict = {} +coord_type_dict = {} +for coord in coord_list: + tweak_dict[coord] = -np.inf -# %% Apply tweak to all files +# Get tweaks +for file_in in file_list_in: + file_in, ds = get_ds(topdir, file_in) + for coord in coord_list: + this_tweak = get_tweak(ds, coord, init_tweak=1e-6) + if this_tweak > tweak_dict[coord]: + tweak_dict[coord] = this_tweak +for coord in coord_list: + print(f"Tweaking {coord} by {tweak_dict[coord]}") +print(" ") -for filename in file_list_in: - file_in = os.path.join(topdir, filename) - ds = xr.open_dataset(file_in) +# Apply tweaks +for file_in in file_list_in: + file_in, ds = get_ds(topdir, file_in) for coord in coord_list: - ds = apply_tweak(ds, coord, tweak=1e-6) + ds = apply_tweak(ds, coord, tweak_dict[coord]) # Set up for save file_out = file_in.replace(".nc", ".tweaked_latlons.nc") @@ -110,16 +168,14 @@ def apply_tweak(ds, coord_str, tweak=1e-6): # %% Ensure all files got the same tweaks ds = xr.open_dataset(file_list_out[0]) +f0_base = os.path.basename(file_list_out[0]) for filename in file_list_out[1:]: ds2 = xr.open_dataset(filename) + f_base = os.path.basename(filename) for coord in coord_list: - # Ensure that coordinates are the same - var = coord - assert np.array_equal(ds[var].values, ds2[var].values) - # Ensure that tweaks were the same - var = coord + "_tweak" - assert np.array_equal(ds[var].values, ds2[var].values) + check(ds, f0_base, ds2, f_base, coord) + check(ds, f0_base, ds2, f_base, coord + "_tweak") print("All good!") @@ -168,4 +224,3 @@ def redirect_argv(arglist): print("Done") -# %% From 8e618bb5384ba72d2b53b45a778aad29be542221 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Fri, 12 Jul 2024 16:44:47 -0600 Subject: [PATCH 0687/1248] Add new test to build-namelist_test.pl (currently failing) --- bld/unit_testers/build-namelist_test.pl | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/bld/unit_testers/build-namelist_test.pl b/bld/unit_testers/build-namelist_test.pl index 005f2c3f96..1810d4434b 100755 --- a/bld/unit_testers/build-namelist_test.pl +++ b/bld/unit_testers/build-namelist_test.pl @@ -41,7 +41,7 @@ sub make_env_run { # my %settings = @_; - # Set default settings + # Set default settings TODO slevis: NTHRDS_LND fails, OMP_NUM_THREADS fails my %env_vars = ( DIN_LOC_ROOT=>"MYDINLOCROOT", GLC_TWO_WAY_COUPLING=>"FALSE", NTHRDS_LND=>"1", NEONSITE=>"" ); # Set any settings that came in from function call foreach my $item ( keys(%settings) ) { @@ -163,7 +163,7 @@ sub cat_and_create_namelistinfile { # # Figure out number of tests that will run # -my $ntests = 3306; +my $ntests = 3309; if ( defined($opts{'compare'}) ) { $ntests += 2045; @@ -1320,6 +1320,12 @@ sub cat_and_create_namelistinfile { my %warntest = ( # Warnings without the -ignore_warnings option given + "matrixcnOn_with_threading" =>{ options=>"-envxml_dir . -bgc bgc", + namelst=>"use_matrixcn=.true.", + GLC_TWO_WAY_COUPLING=>"TRUE", + NTHRDS_LND=>"2", + phys=>"clm5_0", + }, "dustemisLeung" =>{ options=>"-envxml_dir .", namelst=>"dust_emis_method = 'Leung_2023'", GLC_TWO_WAY_COUPLING=>"FALSE", @@ -1376,7 +1382,13 @@ sub cat_and_create_namelistinfile { &make_config_cache($warntest{$key}{"phys"}); my $options = $warntest{$key}{"options"}; my $namelist = $warntest{$key}{"namelst"}; - &make_env_run( GLC_TWO_WAY_COUPLING=>$warntest{$key}{"GLC_TWO_WAY_COUPLING"} ); + my %settings; + foreach my $xmlvar ( "GLC_TWO_WAY_COUPLING", "NTHRDS_LND") { + if ( defined($failtest{$key}{$xmlvar}) ) { + $settings{$xmlvar} = $failtest{$key}{$xmlvar}; + } + } + &make_env_run( %settings ); eval{ system( "$bldnml $options -namelist \"&clmexp $namelist /\" > $tempfile 2>&1 " ); }; isnt( $?, 0, $key ); system( "cat $tempfile" ); From 64302ad0c48b2afd7a074659c6509ae3344a4ac3 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Fri, 12 Jul 2024 16:54:46 -0600 Subject: [PATCH 0688/1248] Additions/tweaks to CLM testlist. --- cime_config/testdefs/testlist_clm.xml | 44 +++++++++++++++++++++++++-- 1 file changed, 42 insertions(+), 2 deletions(-) diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index 40f351ab4a..3fde176440 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -3663,6 +3663,8 @@ + + @@ -3673,6 +3675,7 @@ + @@ -3684,6 +3687,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -3754,13 +3793,14 @@ - + + @@ -3773,7 +3813,7 @@ - + From 12c60f3de477bbdaa2cf7a8afe0d089886d2c960 Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Fri, 12 Jul 2024 16:01:12 -0700 Subject: [PATCH 0689/1248] correct POTVEG fail unit test This needs to have use_fates_luh to avoid the false negative of failing due to not having this mode with use_fates_potentialveg --- 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 fc1e83f162..741964d8a1 100755 --- a/bld/unit_testers/build-namelist_test.pl +++ b/bld/unit_testers/build-namelist_test.pl @@ -1063,7 +1063,7 @@ sub cat_and_create_namelistinfile { phys=>"clm5_0", }, "useFATESPOTVEGwithHARVEST" =>{ options=>"-bgc fates -envxml_dir . -no-megan", - namelst=>"use_fates_potentialveg=T,fates_harvest_mode='event_code'", + namelst=>"use_fates_potentialveg=T,fates_harvest_mode='event_code',use_fates_luh=T", GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm5_0", }, From 0da6eb5c706217606c1323b2b1a57eb136e32f1a Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Sun, 14 Jul 2024 12:01:58 -0600 Subject: [PATCH 0690/1248] Remove Clm50 RXCROPMATURITY tests. --- cime_config/testdefs/testlist_clm.xml | 37 +-------------------------- 1 file changed, 1 insertion(+), 36 deletions(-) diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index 3fde176440..86210256ff 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -3660,42 +3660,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + From 87d1fa1a4b2a69c2d01898be9d8f9e661af8d163 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Sun, 14 Jul 2024 12:43:31 -0600 Subject: [PATCH 0691/1248] Move tweak_latlons.py to tools/contrib/. This is hopefully not something that will be needed permanently or even in the medium term, so it's not worth cleaning up and unit-/system-testing. --- {python/ctsm/crop_calendars => tools/contrib}/tweak_latlons.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {python/ctsm/crop_calendars => tools/contrib}/tweak_latlons.py (100%) diff --git a/python/ctsm/crop_calendars/tweak_latlons.py b/tools/contrib/tweak_latlons.py similarity index 100% rename from python/ctsm/crop_calendars/tweak_latlons.py rename to tools/contrib/tweak_latlons.py From f6ff13409d58a50299d0d62207e99a12b2c426a6 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Sun, 14 Jul 2024 14:07:51 -0600 Subject: [PATCH 0692/1248] Rework tweak_latlons.py to run from command line. --- tools/contrib/tweak_latlons.py | 285 +++++++++++++++++++-------------- 1 file changed, 164 insertions(+), 121 deletions(-) diff --git a/tools/contrib/tweak_latlons.py b/tools/contrib/tweak_latlons.py index 0031d492e0..2bae06d229 100644 --- a/tools/contrib/tweak_latlons.py +++ b/tools/contrib/tweak_latlons.py @@ -1,44 +1,23 @@ -# %% -import numpy as np -import xarray as xr +""" +'Tweak' the latitude and longitude coordinates to avoid ambiguous nearest neighbors +""" import os import sys -from netCDF4 import Dataset import contextlib +import argparse +import numpy as np +import xarray as xr +from netCDF4 import Dataset # pylint: disable=no-name-in-module # -- add python/ctsm to path (needed if we want to run this stand-alone) -_CTSM_PYTHON = os.path.join(os.path.dirname(os.path.realpath(__file__)), os.pardir, os.pardir) +_CTSM_PYTHON = os.path.join(os.path.dirname(os.path.realpath(__file__)), os.pardir, os.pardir, "python") sys.path.insert(1, _CTSM_PYTHON) # pylint: disable=wrong-import-position from ctsm.mesh_maker import main as mesh_maker -topdir = "/glade/campaign/cesm/cesmdata/inputdata/lnd/clm2/cropdata/calendars/processed/" -file_list_in = [ - "swindow_starts_ggcmi_crop_calendar_phase3_v1.01.2000-2000.20231005_145103.nc", - "swindow_ends_ggcmi_crop_calendar_phase3_v1.01.2000-2000.20231005_145103.nc", - "gdds_20230829_161011.nc", - "gdd20bl.copied_from.gdds_20230829_161011.v2.nc", - "sdates_ggcmi_crop_calendar_phase3_v1.01_nninterp-hcru_hcru_mt13.2000-2000.20230728_165845.nc", - "hdates_ggcmi_crop_calendar_phase3_v1.01_nninterp-hcru_hcru_mt13.2000-2000.20230728_165845.nc", - "/glade/work/samrabin/cropCals_testing_20240626/gdds_20240712_114642_10x15_interpd_halfdeg.nc", - "/glade/work/samrabin/gdd20_baselines/gswp3.10x15_interpd_halfdeg.1980-2009.nc", -] -file_mesh_in = ( - "/glade/campaign/cesm/cesmdata/inputdata/share/meshes/360x720_120830_ESMFmesh_c20210507_cdf5.nc" -) - -file_list_out = [] -coord_list = ["lat", "lon"] +COORD_LIST = ["lat", "lon"] COORD_DATATYPE = np.float64 -# %% Define functions - -def get_ds(topdir, file_in): - if not os.path.exists(file_in): - file_in = os.path.join(topdir, file_in) - ds = xr.open_dataset(file_in) - return file_in, ds - def get_tweak(ds_in, coord_str, init_tweak): """ Get the tweak that will be applied to all datasets' lat/lon coordinates @@ -73,7 +52,9 @@ def apply_tweak(ds_in, coord_str, tweak): where_toohigh = np.where(coord2 > max_coord) Ntoohigh = len(where_toohigh[0]) if Ntoohigh != 1: - raise RuntimeError(f"Expected 1 coordinate value too high; got {Ntoohigh}") + raise RuntimeError( + f"Expected 1 coordinate value too high; got {Ntoohigh}" + ) coord2[where_toohigh] = max_coord coord_tweak[where_toohigh] = max_coord @@ -127,100 +108,162 @@ def check(ds, f0_base, ds2, f_base, var): msg += f"\nTypes also differ: {type0} vs. {type2}" raise RuntimeError(msg) -# %% Apply tweak to all files - -# Set up empty dicts -tweak_dict = {} -coord_type_dict = {} -for coord in coord_list: - tweak_dict[coord] = -np.inf - -# Get tweaks -for file_in in file_list_in: - file_in, ds = get_ds(topdir, file_in) - for coord in coord_list: - this_tweak = get_tweak(ds, coord, init_tweak=1e-6) - if this_tweak > tweak_dict[coord]: - tweak_dict[coord] = this_tweak -for coord in coord_list: - print(f"Tweaking {coord} by {tweak_dict[coord]}") -print(" ") - -# Apply tweaks -for file_in in file_list_in: - file_in, ds = get_ds(topdir, file_in) - - for coord in coord_list: - ds = apply_tweak(ds, coord, tweak_dict[coord]) - - # Set up for save - file_out = file_in.replace(".nc", ".tweaked_latlons.nc") - with Dataset(file_in, "r") as netcdf_file: - netcdf_format = netcdf_file.data_model - - # Save - print(f"Saving {file_out}") - ds.to_netcdf(file_out, format=netcdf_format) - file_list_out.append(file_out) -print("Done") - - -# %% Ensure all files got the same tweaks - -ds = xr.open_dataset(file_list_out[0]) -f0_base = os.path.basename(file_list_out[0]) - -for filename in file_list_out[1:]: - ds2 = xr.open_dataset(filename) - f_base = os.path.basename(filename) - for coord in coord_list: - check(ds, f0_base, ds2, f_base, coord) - check(ds, f0_base, ds2, f_base, coord + "_tweak") -print("All good!") - - -# %% Save new mesh file - -outfile_name = os.path.basename(file_mesh_in) -outfile_name = outfile_name.replace(".nc", ".tweaked_latlons.nc") -outdir = os.path.dirname(file_list_out[0]) -file_mesh_out = os.path.join(outdir, outfile_name) - @contextlib.contextmanager def redirect_argv(arglist): + """ + Preserve actual arg list while giving a new one to mesh_maker + """ argv_tmp = sys.argv[:] - sys.argv=arglist + sys.argv = arglist yield sys.argv = argv_tmp +def main(input_files, mesh_file_in, output_files): + """ + Apply tweak to all files + """ + + # Set up + tweak_dict = {} + for coord in COORD_LIST: + tweak_dict[coord] = -np.inf + mesh_file_out = output_files[-1] + output_files = output_files[:-1] + + # Get tweaks + for file_in in input_files: + ds = xr.open_dataset(file_in) + for coord in COORD_LIST: + this_tweak = get_tweak(ds, coord, init_tweak=1e-6) + if this_tweak > tweak_dict[coord]: + tweak_dict[coord] = this_tweak + for coord in COORD_LIST: + print(f"Tweaking {coord} by {tweak_dict[coord]}") + print(" ") + + # Apply tweaks + for i, file_in in enumerate(input_files): + ds = xr.open_dataset(file_in) + + for coord in COORD_LIST: + ds = apply_tweak(ds, coord, tweak_dict[coord]) + + # Set up for save + file_out = output_files[i] + with Dataset(file_in, "r") as netcdf_file: + netcdf_format = netcdf_file.data_model + + # Make output dir, if needed + output_dir = os.path.dirname(file_out) + if not os.path.exists(output_dir): + os.makedirs(output_dir) + + # Save + print(f"Saving {file_out}") + ds.to_netcdf(file_out, format=netcdf_format) + print("Done") + + + # Ensure all files got the same tweaks + ds = xr.open_dataset(output_files[0]) + f0_base = os.path.basename(output_files[0]) + for file_out in output_files[1:]: + ds2 = xr.open_dataset(file_out) + f_base = os.path.basename(file_out) + for coord in COORD_LIST: + check(ds, f0_base, ds2, f_base, coord) + check(ds, f0_base, ds2, f_base, coord + "_tweak") + + + # Save new mesh file + mesh_maker_args = [ + "mesh_maker", + "--input", + output_files[0], + "--output", + mesh_file_out, + "--lat", + "lat", + "--lon", + "lon", + "--overwrite", + ] + print(f"Saving {mesh_file_out}...") + with redirect_argv(mesh_maker_args): + mesh_maker() + + # Change format, if needed + with Dataset(mesh_file_in, "r") as netcdf_file: + netcdf_format_in = netcdf_file.data_model + with Dataset(mesh_file_out, "r") as netcdf_file: + netcdf_format_out = netcdf_file.data_model + if netcdf_format_in != netcdf_format_out: + mesh_file_out_tmp = mesh_file_out + ".tmp" + os.rename(mesh_file_out, mesh_file_out_tmp) + ds = xr.open_dataset(mesh_file_out_tmp) + ds.to_netcdf(mesh_file_out, format=netcdf_format_in) + os.remove(mesh_file_out_tmp) + + print("Done") + + + + +if __name__ == "__main__": + ############################### + ### Process input arguments ### + ############################### + parser = argparse.ArgumentParser( + description="'Tweak' the latitude and longitude coordinates to avoid ambiguous nearest neighbors", + ) + + # Required + parser.add_argument( + "-i", + "--input-files", + help="Comma-separated stream files whose coordinates need tweaking", + required=True, + ) + parser.add_argument( + "-m", + "--mesh-file", + help="Mesh file associated with input files", + required=True, + ) + + # Optional + parser.add_argument( + "--overwrite", + help="Overwrite any existing output files", + action="store_true", + default=False, + ) + default_output_dir = os.getcwd() + parser.add_argument( + "-o", + "--output-dir", + help=f"Directory where output files should be saved. Default is current working directory: {default_output_dir}", + default=default_output_dir, + ) -mesh_maker_args = [ - "mesh_maker", - "--input", - file_list_out[0], - "--output", - file_mesh_out, - "--lat", - "lat", - "--lon", - "lon", - "--overwrite", -] -print(f"Saving {file_mesh_out}...") -with redirect_argv(mesh_maker_args): - mesh_maker() - -# Change format, if needed -with Dataset(file_mesh_in, "r") as netcdf_file: - netcdf_format_in = netcdf_file.data_model -with Dataset(file_mesh_out, "r") as netcdf_file: - netcdf_format_out = netcdf_file.data_model -if netcdf_format_in != netcdf_format_out: - file_mesh_out_tmp = file_mesh_out + ".tmp" - os.rename(file_mesh_out, file_mesh_out_tmp) - ds = xr.open_dataset(file_mesh_out_tmp) - ds.to_netcdf(file_mesh_out, format=netcdf_format_in) - os.remove(file_mesh_out_tmp) - - -print("Done") + # Get arguments + args = parser.parse_args(sys.argv[1:]) + + # Check/process input and output files + _input_files = args.input_files.split(",") + _output_files = [] + for file in _input_files + [args.mesh_file]: + if not os.path.exists(file): + raise FileNotFoundError(f"File not found: {file}") + + filename, ext = os.path.splitext(os.path.basename(file)) + output_file = os.path.join( + args.output_dir, filename + ".tweaked_latlons" + ext + ) + if os.path.exists(output_file) and not args.overwrite: + raise FileExistsError( + f"Output file exists but --overwrite not specified: {output_file}" + ) + _output_files.append(output_file) + + main(_input_files, args.mesh_file, _output_files) From 227426345fcd0bd552e755b5c4cceb503cea94c6 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Sun, 14 Jul 2024 14:28:50 -0600 Subject: [PATCH 0693/1248] Refine RxCropCals* testlist. --- cime_config/testdefs/testlist_clm.xml | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index 86210256ff..c2926a25e7 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -3755,7 +3755,7 @@ - + @@ -3765,7 +3765,8 @@ - + + @@ -3782,6 +3783,17 @@ + + + + + + + + + + + From f957f21066335c99f10336560e66b1d72cb4e217 Mon Sep 17 00:00:00 2001 From: mvdebolskiy Date: Mon, 15 Jul 2024 11:12:50 -0600 Subject: [PATCH 0694/1248] fix argument passing --- src/main/clm_instMod.F90 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/clm_instMod.F90 b/src/main/clm_instMod.F90 index f3cfa9923d..04c4af6611 100644 --- a/src/main/clm_instMod.F90 +++ b/src/main/clm_instMod.F90 @@ -316,7 +316,8 @@ subroutine clm_instInit(bounds) em_wall_lun=urbanparams_inst%em_wall(begl:endl), & em_improad_lun=urbanparams_inst%em_improad(begl:endl), & em_perroad_lun=urbanparams_inst%em_perroad(begl:endl), & - is_simple_buildtemp=IsSimpleBuildTemp(), is_prog_buildtemp=IsProgBuildTemp() ) + is_simple_buildtemp=IsSimpleBuildTemp(), is_prog_buildtemp=IsProgBuildTemp(), & + exice_init_stream_col=exice_init_stream_col(bounds%begc:bounds%endc) ) call active_layer_inst%Init(bounds) From 5686defdd31c03cdba0bcc247e3d590a0069d9d4 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Mon, 15 Jul 2024 11:40:38 -0600 Subject: [PATCH 0695/1248] Update bld/unit_testers/build-namelist_test.pl Syntax of breaking up into two lines was confusing, so just making a longer line that is more clear. --- bld/unit_testers/build-namelist_test.pl | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/bld/unit_testers/build-namelist_test.pl b/bld/unit_testers/build-namelist_test.pl index 5abb381c16..a22cdd4059 100755 --- a/bld/unit_testers/build-namelist_test.pl +++ b/bld/unit_testers/build-namelist_test.pl @@ -1095,8 +1095,7 @@ sub cat_and_create_namelistinfile { phys=>"clm5_1", }, "soil_erod_none_w_Zender" =>{ options=>"--envxml_dir .", - namelst=>"dust_emis_method='Zender_2003', " . - "zender_soil_erod_source='none'", + namelst=>"dust_emis_method='Zender_2003', zender_soil_erod_source='none'", GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm5_1", }, From af11aaab0644357cbff66aecbbc2f94a25778ab7 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Mon, 15 Jul 2024 14:02:15 -0600 Subject: [PATCH 0696/1248] Remove new test from build-namelist_test.pl for now --- bld/unit_testers/build-namelist_test.pl | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/bld/unit_testers/build-namelist_test.pl b/bld/unit_testers/build-namelist_test.pl index 1810d4434b..16f6ba2a62 100755 --- a/bld/unit_testers/build-namelist_test.pl +++ b/bld/unit_testers/build-namelist_test.pl @@ -41,8 +41,8 @@ sub make_env_run { # my %settings = @_; - # Set default settings TODO slevis: NTHRDS_LND fails, OMP_NUM_THREADS fails - my %env_vars = ( DIN_LOC_ROOT=>"MYDINLOCROOT", GLC_TWO_WAY_COUPLING=>"FALSE", NTHRDS_LND=>"1", NEONSITE=>"" ); + # Set default settings + my %env_vars = ( DIN_LOC_ROOT=>"MYDINLOCROOT", GLC_TWO_WAY_COUPLING=>"FALSE", NEONSITE=>"" ); # Set any settings that came in from function call foreach my $item ( keys(%settings) ) { $env_vars{$item} = $settings{$item}; @@ -1320,12 +1320,6 @@ sub cat_and_create_namelistinfile { my %warntest = ( # Warnings without the -ignore_warnings option given - "matrixcnOn_with_threading" =>{ options=>"-envxml_dir . -bgc bgc", - namelst=>"use_matrixcn=.true.", - GLC_TWO_WAY_COUPLING=>"TRUE", - NTHRDS_LND=>"2", - phys=>"clm5_0", - }, "dustemisLeung" =>{ options=>"-envxml_dir .", namelst=>"dust_emis_method = 'Leung_2023'", GLC_TWO_WAY_COUPLING=>"FALSE", @@ -1383,7 +1377,7 @@ sub cat_and_create_namelistinfile { my $options = $warntest{$key}{"options"}; my $namelist = $warntest{$key}{"namelst"}; my %settings; - foreach my $xmlvar ( "GLC_TWO_WAY_COUPLING", "NTHRDS_LND") { + foreach my $xmlvar ( "GLC_TWO_WAY_COUPLING" ) { if ( defined($failtest{$key}{$xmlvar}) ) { $settings{$xmlvar} = $failtest{$key}{$xmlvar}; } From 322097f0a2b5cf0c3b6bdd5a3eccb70845cb6990 Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Mon, 15 Jul 2024 13:05:59 -0700 Subject: [PATCH 0697/1248] change folder name for fates land use x pft files This matches the corresponding fates tag that also impliments using this file --- 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 6f29513e6b..d4167228b9 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -2019,7 +2019,7 @@ lnd/clm2/surfdata_esmf/NEON/surfdata_1x1_NEON_TOOL_hist_78pfts_CMIP6_simyr2000_c >lnd/clm2/surfdata_map/fates-sci.1.68.3_api.31.0.0_tools.1.0.1/LUH2_states_transitions_management.timeseries_4x5_hist_simyr1850-2015_c231101.nc -lnd/clm2/surfdata_map/fates-sci.1.73.0_api.36.0.0/fates_landuse_pft_map_4x5_240206.nc +lnd/clm2/surfdata_map/fates-sci.1.77.0_api.36.0.0/fates_landuse_pft_map_4x5_240206.nc Date: Mon, 15 Jul 2024 15:08:44 -0600 Subject: [PATCH 0698/1248] Remove duplicated tests, and new dust tests with clm6_0 --- bld/unit_testers/build-namelist_test.pl | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/bld/unit_testers/build-namelist_test.pl b/bld/unit_testers/build-namelist_test.pl index 5abb381c16..0b26e86476 100755 --- a/bld/unit_testers/build-namelist_test.pl +++ b/bld/unit_testers/build-namelist_test.pl @@ -1072,39 +1072,27 @@ sub cat_and_create_namelistinfile { "soil_erod_wo_Zender" =>{ options=>"--envxml_dir . --ignore_warnings", namelst=>"dust_emis_method='Leung_2023', " . "stream_meshfile_zendersoilerod = '/dev/null'", - phys=>"clm5_1", + phys=>"clm6_0", }, "soil_erod_wo_lnd_source" =>{ options=>"--envxml_dir .", namelst=>"dust_emis_method='Zender_2003', " . "stream_fldfilename_zendersoilerod = '/dev/null', zender_soil_erod_source='atm'", - phys=>"clm5_1", + phys=>"clm6_0", }, "soil_erod_none_w_Zender" =>{ options=>"--envxml_dir .", namelst=>"dust_emis_method='Zender_2003', " . "zender_soil_erod_source='none'", - phys=>"clm5_1", + phys=>"clm6_0", }, "soil_erod_bad_w_Zender" =>{ options=>"--envxml_dir .", namelst=>"dust_emis_method='Zender_2003', " . "zender_soil_erod_source='zztop'", - phys=>"clm5_1", + phys=>"clm6_0", }, "Set_Dust_When_CAM_Sets" =>{ options=>"--envxml_dir .", namelst=>"dust_emis_method='Zender_2003'", LND_SETS_DUST_EMIS_DRV_FLDS=>"FALSE", - phys=>"clm5_1", - }, - "soil_erod_none_w_Zender" =>{ options=>"--envxml_dir .", - namelst=>"dust_emis_method='Zender_2003', " . - "zender_soil_erod_source='none'", - GLC_TWO_WAY_COUPLING=>"FALSE", - phys=>"clm5_1", - }, - "soil_erod_bad_w_Zender" =>{ options=>"--envxml_dir .", - namelst=>"dust_emis_method='Zender_2003', " . - "zender_soil_erod_source='zztop'", - GLC_TWO_WAY_COUPLING=>"FALSE", - phys=>"clm5_1", + phys=>"clm6_0", }, ); foreach my $key ( keys(%failtest) ) { From 02f9cb325d3884add3ecfb45904c34bb3edb0f62 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Mon, 15 Jul 2024 15:25:35 -0600 Subject: [PATCH 0699/1248] Make fail tests lines where the namelst option is split up into two lines into one long line, because the way they were concatonated look obscure and possibly wrong, the long lines are easier to read --- bld/unit_testers/build-namelist_test.pl | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/bld/unit_testers/build-namelist_test.pl b/bld/unit_testers/build-namelist_test.pl index 0b26e86476..d72331b1c2 100755 --- a/bld/unit_testers/build-namelist_test.pl +++ b/bld/unit_testers/build-namelist_test.pl @@ -1070,23 +1070,19 @@ sub cat_and_create_namelistinfile { phys=>"clm5_0", }, "soil_erod_wo_Zender" =>{ options=>"--envxml_dir . --ignore_warnings", - namelst=>"dust_emis_method='Leung_2023', " . - "stream_meshfile_zendersoilerod = '/dev/null'", + namelst=>"dust_emis_method='Leung_2023', stream_meshfile_zendersoilerod = '/dev/null'", phys=>"clm6_0", }, "soil_erod_wo_lnd_source" =>{ options=>"--envxml_dir .", - namelst=>"dust_emis_method='Zender_2003', " . - "stream_fldfilename_zendersoilerod = '/dev/null', zender_soil_erod_source='atm'", + namelst=>"dust_emis_method='Zender_2003', stream_fldfilename_zendersoilerod = '/dev/null', zender_soil_erod_source='atm'", phys=>"clm6_0", }, "soil_erod_none_w_Zender" =>{ options=>"--envxml_dir .", - namelst=>"dust_emis_method='Zender_2003', " . - "zender_soil_erod_source='none'", + namelst=>"dust_emis_method='Zender_2003', zender_soil_erod_source='none'", phys=>"clm6_0", }, "soil_erod_bad_w_Zender" =>{ options=>"--envxml_dir .", - namelst=>"dust_emis_method='Zender_2003', " . - "zender_soil_erod_source='zztop'", + namelst=>"dust_emis_method='Zender_2003', zender_soil_erod_source='zztop'", phys=>"clm6_0", }, "Set_Dust_When_CAM_Sets" =>{ options=>"--envxml_dir .", From 6e806b5a0d0b1db561f01a403cbae2fc5b450e82 Mon Sep 17 00:00:00 2001 From: mvdebolskiy Date: Tue, 16 Jul 2024 08:50:08 -0600 Subject: [PATCH 0700/1248] update defaults --- bld/namelist_files/namelist_defaults_ctsm.xml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index 2c6b375140..47f9802aff 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -2058,8 +2058,9 @@ lnd/clm2/surfdata_esmf/NEON/surfdata_1x1_NEON_TOOL_hist_78pfts_CMIP6_simyr2000_c .false. - --2.15 +0.0 +1.0 +-3.15 0.5 lnd/clm2/paramdata/exice_init_0.125x0.125_c20220516.nc lnd/clm2/paramdata/exice_init_0.125x0.125_ESMFmesh_cdf5_c20220802.nc From 455ae5ad3a34761dbe55c312ee5fbd7b17f0f756 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Tue, 16 Jul 2024 08:58:38 -0600 Subject: [PATCH 0701/1248] Final ChangeLog/ChangeSum --- doc/ChangeLog | 2 +- doc/ChangeSum | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index b723b849ae..00c576d0d8 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,7 +1,7 @@ =============================================================== Tag name: ctsm5.2.012 Originator(s): sacks (Bill Sacks, UCAR/NCAR/CGD) -Date: Mon 15 Jul 2024 11:55:45 AM MDT +Date: Tue 16 Jul 2024 08:57:42 AM MDT One-line Summary: Relax tolerance for truncating small snocan values in CanopyFluxes Purpose and description of changes diff --git a/doc/ChangeSum b/doc/ChangeSum index 034c02429c..381b0db858 100644 --- a/doc/ChangeSum +++ b/doc/ChangeSum @@ -1,6 +1,6 @@ Tag Who Date Summary ============================================================================================================================ - ctsm5.2.012 sacks 07/15/2024 Relax tolerance for truncating small snocan values in CanopyFluxes + ctsm5.2.012 sacks 07/16/2024 Relax tolerance for truncating small snocan values in CanopyFluxes ctsm5.2.011 slevis 07/12/2024 Merge b4b-dev ctsm5.2.010 multiple 07/11/2024 Explicit A/C adoption ctsm5.2.009 erik 07/10/2024 Allow for CAM7 in lnd_tuning_mode and handle C or E in long compset names From aa923a4d2dc279cd9a85c2f691fd73ab7ab83e56 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Tue, 16 Jul 2024 12:12:33 -0600 Subject: [PATCH 0702/1248] Correct two test names in ExpectedTestFails.xml --- cime_config/testdefs/ExpectedTestFails.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cime_config/testdefs/ExpectedTestFails.xml b/cime_config/testdefs/ExpectedTestFails.xml index 6a2186d6d9..7a07a056f7 100644 --- a/cime_config/testdefs/ExpectedTestFails.xml +++ b/cime_config/testdefs/ExpectedTestFails.xml @@ -37,14 +37,14 @@ - + FAIL #2619 This failure relates to the following REP failure. - + FAIL #2619 From ef970e2e8062e0852583216acda18c4ade60cd5e Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Tue, 16 Jul 2024 12:13:21 -0600 Subject: [PATCH 0703/1248] Make hillslope_fsat_equals_zero .false. unless use_hillslope = .true. --- bld/namelist_files/namelist_defaults_ctsm.xml | 3 ++- bld/namelist_files/namelist_definition_ctsm.xml | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index 0777f423ca..e2ba2de74b 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -625,7 +625,8 @@ attributes from the config_cache.xml file (with keys converted to upper-case). Standard Uniform .true. -.true. +.false. +.true. .false. diff --git a/bld/namelist_files/namelist_definition_ctsm.xml b/bld/namelist_files/namelist_definition_ctsm.xml index 52f5aee138..bc92dafbf0 100644 --- a/bld/namelist_files/namelist_definition_ctsm.xml +++ b/bld/namelist_files/namelist_definition_ctsm.xml @@ -829,7 +829,7 @@ Toggle to turn on surface water routing in the hillslope hydrology model + group="clm_inparm" valid_values="" value=".false."> If true, set fsat to zero for hillslope columns From 8478b730663ee4a6698b70804e95a1f029662aab Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Tue, 16 Jul 2024 13:58:00 -0600 Subject: [PATCH 0704/1248] Comments about move to CMEPS --- src/drv_test/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/drv_test/CMakeLists.txt b/src/drv_test/CMakeLists.txt index adf66b8b92..938e55a598 100644 --- a/src/drv_test/CMakeLists.txt +++ b/src/drv_test/CMakeLists.txt @@ -1 +1,3 @@ +# This test should be moved to be under CMEPS +# See: https://github.com/ESCOMP/CMEPS/issues/458 add_subdirectory(shr_dust_emis_test) From 9db4d48623697669e5120830ded96ea2cb7047e0 Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Tue, 16 Jul 2024 15:38:28 -0700 Subject: [PATCH 0705/1248] add izumi luh2 failure to expected list --- 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 a4033aa6cd..ee1f188f15 100644 --- a/cime_config/testdefs/ExpectedTestFails.xml +++ b/cime_config/testdefs/ExpectedTestFails.xml @@ -150,6 +150,13 @@ + + + FAIL + #2653 + + + FAIL From 525c78bf49e9c6d71a082cf35f979c48fa6683ab Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Tue, 16 Jul 2024 19:12:39 -0600 Subject: [PATCH 0706/1248] Remove leftover conflict header, so can compile --- src/biogeochem/DUSTMod.F90 | 1 - 1 file changed, 1 deletion(-) diff --git a/src/biogeochem/DUSTMod.F90 b/src/biogeochem/DUSTMod.F90 index 24c4f13069..bf04311cbe 100644 --- a/src/biogeochem/DUSTMod.F90 +++ b/src/biogeochem/DUSTMod.F90 @@ -743,7 +743,6 @@ subroutine DustEmission (bounds, & !################### for Leung et al. (2023) ################################################ !################ uncomment the below block if want to use Leung's scheme ################### -<<<<<<< HEAD !flx_mss_vrt_dst_ttl(p) = dst_emiss_coeff(p) * mss_frc_cly_vld(c) * forc_rho(c) * ((wnd_frc_slt**2.0_r8 - wnd_frc_thr_slt_it**2.0_r8) / wnd_frc_thr_slt_std) * (wnd_frc_slt / wnd_frc_thr_slt_it)**frag_expt ! Leung et al. (2022) uses Kok et al. (2014) dust emission euqation for emission flux ! dmleung: instead of using mss_frc_cly_vld(c) with a range of [0,0.2] , which makes dust too sensitive to input clay surface dataset), for now use 0.1 + mss_frc_cly_vld(c) * 0.1 / 0.20 with a range of [0.1,0.2]. So, instead of scaling dust emission to 1/20 times for El Djouf (western Sahara) because of its 1 % clay fraction, scale its emission to 1/2 times. This reduces the sensitivity of dust emission to the clay input dataset. In particular, because dust emission is a small-scale process and the grid-averaged clay from the new WISE surface dataset over El Djouf is 1 %, much lower than the former FAO estimation of 5 %, dmleung is not sure if the clay value of 1 % suppresses too much of El Djouf's small-scale dust emission process. Similar to Charlie Zender's feeling suspicious about the soil texture datasets (or the dust emission schemes' sandblasting process), dmleung feels the same and for now decides to still allow dust emission to weakly scale with clay fraction, however limiting the scaling factor to 0.1-0.2. See modification in SoilStateInitTimeConst.F90. dmleung 5 Jul 2024 From 1de58fbb04d862245f69239835a00c15e062dc54 Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Wed, 17 Jul 2024 12:37:45 -0700 Subject: [PATCH 0707/1248] update fates to sci.1.77.1_api.36.0.0 --- .gitmodules | 2 +- src/fates | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitmodules b/.gitmodules index 9ed4402c7e..8127cac482 100644 --- a/.gitmodules +++ b/.gitmodules @@ -28,7 +28,7 @@ [submodule "fates"] path = src/fates url = https://github.com/NGEET/fates -fxtag = sci.1.77.0_api.36.0.0 +fxtag = sci.1.77.1_api.36.0.0 fxrequired = AlwaysRequired # Standard Fork to compare to with "git fleximod test" to ensure personal forks aren't committed fxDONOTUSEurl = https://github.com/NCAR/fates-release diff --git a/src/fates b/src/fates index fd7f3438c2..1982b0032c 160000 --- a/src/fates +++ b/src/fates @@ -1 +1 @@ -Subproject commit fd7f3438c2ff821672b703050e7011f293649ee9 +Subproject commit 1982b0032c3cab6278892eccb85f643114ffb1af From 47571d844674d836a7501c3cd98f65ac545f4e39 Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Wed, 17 Jul 2024 13:23:11 -0700 Subject: [PATCH 0708/1248] formatting fixed for changelog --- doc/ChangeLog | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/ChangeLog b/doc/ChangeLog index 71b07aa2f2..54e3b4cc4b 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,5 @@ +=============================================================== +Tag name: ctsm5.2.013 Originator(s): samrabin (Sam Rabin, UCAR/TSS, samrabin@ucar.edu) glemieux (Gregory Lemieux, LBNL, glemieux@lbl.gov) Date: Wed 17 Jul 2024 01:20:00 PM MDT From e4142b96425712afa44cb6ab440d297a56aeaae1 Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Wed, 17 Jul 2024 13:26:45 -0700 Subject: [PATCH 0709/1248] fixing bad merge with changelog --- doc/ChangeLog | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index 54e3b4cc4b..3c6a104725 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -79,7 +79,6 @@ Changes to tests or testing: and use_fates_lupft namelist options. Additoinally a new system text prefix, PVT, has been added to test the use_fates_potentialveg spin-up to use_fates_lupft transient workflow. These have been added to the fates test suite. -======= Bugs fixed ---------- @@ -154,6 +153,19 @@ Does this tag change answers significantly for any of the following physics conf [ ] clm4_5 + +Bugs fixed +---------- +List of CTSM issues fixed (include CTSM Issue # and description) [one per line]: +Fixes #2444 Failing water isotope test on the ctsm5.2 branch + +Notes of particular relevance for users +--------------------------------------- +Changes to documentation: None + +Testing summary: +---------------- + [PASS means all tests PASS; OK means tests PASS other than expected fails.] regular tests (aux_clm: https://github.com/ESCOMP/CTSM/wiki/System-Testing-Guide#pre-merge-system-testing): From 75cd2f4c866bd8148dff0e310e1ba0711bef13f3 Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Wed, 17 Jul 2024 14:07:23 -0700 Subject: [PATCH 0710/1248] reformat new and updated systests with black --- cime_config/SystemTests/pvt.py | 15 +++++++++------ cime_config/SystemTests/systemtest_utils.py | 7 ++++--- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/cime_config/SystemTests/pvt.py b/cime_config/SystemTests/pvt.py index 2a3dbafdc3..cf923dd334 100644 --- a/cime_config/SystemTests/pvt.py +++ b/cime_config/SystemTests/pvt.py @@ -16,9 +16,10 @@ logger = logging.getLogger(__name__) + class PVT(SystemTestsCommon): - def __init__(self,case): - SystemTestsCommon.__init__(self,case) + def __init__(self, case): + SystemTestsCommon.__init__(self, case) # Do not allow PVT to be run with certain testmods # Should this be targeted to a specific testmod for simplicity for now? @@ -27,14 +28,16 @@ def __init__(self,case): casebaseid = self._case.get_value("CASEBASEID") casebaseid = casebaseid.split("-")[-1] if casebaseid[0:10] != "FatesLUPFT": - error_message = (f"Only call PVT with testmod FatesLUPFT. {casebaseid} selected.") + error_message = f"Only call PVT with testmod FatesLUPFT. {casebaseid} selected." # Only allow to run if resolution is 4x5 for now # Other grid resolutions will be pre-processed and included in the namelist defaults at a future date. # Potentially we could generate these on the fly although doing so would result in increased build time lnd_grid = self._case.get_value("LND_GRID") if lnd_grid != "4x5": - error_message = (f"PVT can currently only be run with 4x5 resolution. {lnd_grid} selected.") + error_message = ( + f"PVT can currently only be run with 4x5 resolution. {lnd_grid} selected." + ) if error_message is not None: logger.error(error_message) @@ -79,7 +82,7 @@ def run_phase(self): # Turn off fates_harvest_mode for the spin up. logger.info("PVT log: modify user_nl_clm file for spin up run") - added_content = ["use_fates_potentialveg = .true.","fates_harvest_mode = 'no_harvest'"] + added_content = ["use_fates_potentialveg = .true.", "fates_harvest_mode = 'no_harvest'"] append_to_user_nl_files(clone_path, "clm", added_content) # Run the spin up case @@ -100,7 +103,7 @@ def run_phase(self): # obtain rpointer files and necessary restart files from short term archiving directory rundir = self._case.get_value("RUNDIR") - refdate = str(refcase_year) + '-01-01-00000' + refdate = str(refcase_year) + "-01-01-00000" rest_path = os.path.join(dout_sr, "rest", "{}".format(refdate)) for item in glob.glob("{}/*{}*".format(rest_path, refdate)): diff --git a/cime_config/SystemTests/systemtest_utils.py b/cime_config/SystemTests/systemtest_utils.py index c39f5171ba..c252f73251 100644 --- a/cime_config/SystemTests/systemtest_utils.py +++ b/cime_config/SystemTests/systemtest_utils.py @@ -86,14 +86,15 @@ def run_python_script(caseroot, this_conda_env, command_in, tool_path): print(f"ERROR trying to run {tool_name}.") raise + # Read a user_nl file and return the namelist option if found def find_user_nl_option(caseroot, component, namelist_option): - + # This is a copy of the CIME _get_list_of_user_nl_files # which could be used if this moved into the CIME project file_pattern = "user_nl_" + component + "*" file_list = glob.glob(os.path.join(caseroot, file_pattern)) - + # Check that there is at least one file if len(file_list) == 0: raise RuntimeError("No user_nl files found for component " + component) @@ -103,7 +104,7 @@ def find_user_nl_option(caseroot, component, namelist_option): for one_file in file_list: with open(one_file, "r") as user_nl_file: user_nl_text = user_nl_file.read() - reg = fr'{namelist_option}.*?(?=,|\n)' + reg = rf"{namelist_option}.*?(?=,|\n)" find_out = re.findall(reg, user_nl_text) output[one_file] = find_out return output From e14313858df6e9e6f2488951af2551349e349c65 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Thu, 18 Jul 2024 10:11:33 -0600 Subject: [PATCH 0711/1248] generate_gdd20_baseline: Clarity rearrangement. --- python/ctsm/crop_calendars/generate_gdd20_baseline.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/python/ctsm/crop_calendars/generate_gdd20_baseline.py b/python/ctsm/crop_calendars/generate_gdd20_baseline.py index 476717b887..5d4fac3aff 100644 --- a/python/ctsm/crop_calendars/generate_gdd20_baseline.py +++ b/python/ctsm/crop_calendars/generate_gdd20_baseline.py @@ -246,16 +246,18 @@ def generate_gdd20_baseline(input_files, output_file, author, time_slice): if gddn is None: # Crop not handled yet? Fill it entirely with missing value this_da = dummy_da - long_name = "Dummy GDD20" print(" dummy GDD20") else: # this_da = ds_in[gddn].fillna(MISSING_FILL) this_da = ds_in[gddn] this_da = _add_time_axis(this_da) - long_name = gddn.replace("X", "20") print(f" {gddn}") - # Add attributes + # Add attributes of output file + if gddn is None: + long_name = "Dummy GDD20" + else: + long_name = gddn.replace("X", "20") this_da.attrs["long_name"] = long_name + f" baseline for {cft_str}" this_da.attrs["units"] = "°C days" # this_da.attrs["_FillValue"] = MISSING_FILL From 699936eef5097066b4faea29de920541be1d36d0 Mon Sep 17 00:00:00 2001 From: mvdebolskiy Date: Thu, 18 Jul 2024 10:47:24 -0600 Subject: [PATCH 0712/1248] Move namelist vars, add checks --- bld/CLMBuildNamelist.pm | 43 +++++++-- .../namelist_definition_ctsm.xml | 9 +- src/biogeophys/TemperatureType.F90 | 91 ++++++++++++++++++- src/main/clm_instMod.F90 | 4 +- src/main/clm_varctl.F90 | 4 - src/main/controlMod.F90 | 12 +-- 6 files changed, 132 insertions(+), 31 deletions(-) diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index 45c0a7bdb8..498de96a4d 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -1812,10 +1812,15 @@ sub process_namelist_inline_logic { ######################################### setup_logic_initinterp($opts, $nl_flags, $definition, $defaults, $nl); - ############################### - # namelist group: exice_streams # - ############################### + ################################# + # namelist group: exice_streams # + ################################# setup_logic_exice($opts, $nl_flags, $definition, $defaults, $nl); + + ########################################## + # namelist group: clm_temperature_inparm # + ########################################## + setup_logic_coldstart_temp($opts,$nl_flags, $definition, $defaults, $nl); } #------------------------------------------------------------------------------- @@ -4599,7 +4604,7 @@ sub setup_logic_exice { } # Otherwise if ice streams are off } else { - my @list = ( "stream_meshfile_exice", "stream_fldfilename_exice" , "excess_ice_coldstart_temp" , "excess_ice_coldstart_depth"); + my @list = ( "stream_meshfile_exice", "stream_fldfilename_exice" ); # fail is excess ice streams files are set foreach my $var ( @list ) { if ( defined($nl->get_value($var)) ) { @@ -4618,8 +4623,6 @@ sub setup_logic_exice { if (defined($use_exice_streams) && value_is_true($use_exice_streams)) { add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_fldfilename_exice'); add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_mapalgo_exice'); - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'excess_ice_coldstart_temp'); - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'excess_ice_coldstart_depth'); # If excess ice streams on, but NOT the NUOPC driver fail if ( not $opts->{'driver'} eq "nuopc" ) { $log->fatal_error("nuopc driver is required when use_excess_ice_streams is set to true" ); @@ -4633,6 +4636,33 @@ sub setup_logic_exice { } # end exice streams +sub setup_logic_coldstart_temp { + + my ($opts, $nl_flags, $definition, $defaults, $nl) = @_; + + # set initial temperatures for excess ice gridcells: + + add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'excess_ice_coldstart_temp'); + add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'excess_ice_coldstart_depth'); + + my $use_exice = $nl->get_value( 'use_excess_ice' ); + my $use_exice_streams = $nl->get_value( 'use_excess_ice_streams' ); + my $exice_cs_temp = $nl->get_value( 'excess_ice_coldstart_temp' ); + my $exice_cs_depth = $nl->get_value( 'excess_ice_coldstart_depth' ); + + if (defined($use_exice) && value_is_true($use_exice)) { + # Checking this setting only needed IF excess ice streams are on get the stream defaults + if (defined($use_exice_streams) && value_is_true($use_exice_streams)) { + if (defined($exice_cs_depth) && $exice_cs_depth <= 0.0 ) { + $log->fatal_error("excess_ice_coldstart_depth is <= 0.0" ); + } + if (defined($exice_cs_temp) && $exice_cs_temp >= 0.0 ) { + $log->fatal_error("excess_ice_coldstart_temp is >= 0.0, no excess ice will be present in this run" ); + } + } + } +} + #------------------------------------------------------------------------------- sub setup_logic_z0param { @@ -4728,6 +4758,7 @@ sub write_output_files { push @groups, "lifire_inparm"; push @groups, "ch4finundated"; push @groups, "exice_streams"; + push @groups, "clm_temperature_inparm"; push @groups, "soilbgc_decomp"; push @groups, "clm_canopy_inparm"; push @groups, "zendersoilerod"; diff --git a/bld/namelist_files/namelist_definition_ctsm.xml b/bld/namelist_files/namelist_definition_ctsm.xml index 2eb8a67e8c..575d72856f 100644 --- a/bld/namelist_files/namelist_definition_ctsm.xml +++ b/bld/namelist_files/namelist_definition_ctsm.xml @@ -2825,13 +2825,14 @@ If TRUE turn on the excess ice physics, (Lee et al., 2014; Cai et al., 2020) -Initial soil temperature to use for gridcells with excess ice present during a run starting with coldstart (deg C) + group="clm_temperature_inparm" > +Initial soil temperature to use for gridcells with excess ice present during a run starting with coldstart (deg C). Value is only apply if use_excess_ice is true. -Soil depth below which initial excess ice concentration will be applied during a run starting with coldstart (m) + group="clm_temperature_inparm" > +Soil depth below which initial excess ice concentration will be applied during a run starting with coldstart (m). Value is only apply if use_excess_ice is true. +If this is set below depth of the soil depth, only the last soil layer will get excess ice. diff --git a/src/biogeophys/TemperatureType.F90 b/src/biogeophys/TemperatureType.F90 index 0a31bba6e6..6084c7ee2c 100644 --- a/src/biogeophys/TemperatureType.F90 +++ b/src/biogeophys/TemperatureType.F90 @@ -118,6 +118,10 @@ module TemperatureType real(r8), pointer :: xmf_h2osfc_col (:) ! latent heat of phase change of surface water real(r8), pointer :: fact_col (:,:) ! used in computing tridiagonal matrix real(r8), pointer :: c_h2osfc_col (:) ! heat capacity of surface water + + ! Namelist parameters for initialization + real(r8), private :: excess_ice_coldstart_depth ! depth below which excess ice will be present + real(r8), private :: excess_ice_coldstart_temp ! coldstart temperature of layers with excess ice present contains @@ -130,6 +134,8 @@ module TemperatureType procedure, public :: InitAccVars procedure, public :: UpdateAccVars + procedure, private :: ReadNL + end type temperature_type character(len=*), parameter, private :: sourcefile = & @@ -141,7 +147,7 @@ module TemperatureType !------------------------------------------------------------------------ subroutine Init(this, bounds, & em_roof_lun, em_wall_lun, em_improad_lun, em_perroad_lun, & - is_simple_buildtemp, is_prog_buildtemp, exice_init_stream_col) + is_simple_buildtemp, is_prog_buildtemp, exice_init_stream_col, NLFileName) ! ! !DESCRIPTION: ! @@ -157,7 +163,10 @@ subroutine Init(this, bounds, & logical , intent(in) :: is_simple_buildtemp ! Simple building temp is being used logical , intent(in) :: is_prog_buildtemp ! Prognostic building temp is being used real(r8) , intent(in) :: exice_init_stream_col(bounds%begc:) ! initial excess ice concentration from the stream file + character(len=*) , intent(in) :: NLFilename ! Namelist filename + + call this%ReadNL(NLFilename) call this%InitAllocate ( bounds ) call this%InitHistory ( bounds, is_simple_buildtemp, is_prog_buildtemp ) call this%InitCold ( bounds, & @@ -654,7 +663,7 @@ subroutine InitCold(this, bounds, & use column_varcon , only : icol_road_imperv, icol_roof, icol_sunwall use column_varcon , only : icol_shadewall, icol_road_perv use clm_varctl , only : iulog, use_vancouver, use_mexicocity - use clm_varctl , only : use_excess_ice, excess_ice_coldstart_depth, excess_ice_coldstart_temp + use clm_varctl , only : use_excess_ice use initVerticalMod , only : find_soil_layer_containing_depth ! ! !ARGUMENTS: @@ -750,12 +759,21 @@ subroutine InitCold(this, bounds, & this%t_soisno_col(c,1:nlevgrnd) = 272._r8 if (use_excess_ice .and. exice_init_stream_col(c) > 0.0_r8) then nexice_start = nlevsoi - 1 - if (zisoi(nlevsoi) >= excess_ice_coldstart_depth) then - call find_soil_layer_containing_depth(0.5_r8,nexice_start) + if (this%excess_ice_coldstart_depth <= 0.0_r8) then + ! we double check this here, and when building namelists + call endrun(msg="ERROR excess_ice_coldstart_depth <= 0.0. Set a positive value in the namelist"//errmsg(sourcefile, __LINE__)) + endif + if (zisoi(nlevsoi) >= this%excess_ice_coldstart_depth) then + call find_soil_layer_containing_depth(this%excess_ice_coldstart_depth,nexice_start) else nexice_start=nlevsoi-1 endif - this%t_soisno_col(c,nexice_start:nlevgrnd) = SHR_CONST_TKFRZ + excess_ice_coldstart_temp !needs to be below freezing to properly initiate excess ice + if (this%excess_ice_coldstart_temp >= 0.0_r8) then + ! this is here, since we care about excess_ice_coldstart_temp only when there is excess ice in the gridcell + ! which happens only when the streams are read. + call endrun(msg="ERROR excess_ice_coldstart_temp is not below freezing point"//errmsg(sourcefile, __LINE__)) + endif + this%t_soisno_col(c,nexice_start:nlevgrnd) = SHR_CONST_TKFRZ + this%excess_ice_coldstart_temp end if endif endif @@ -1646,4 +1664,67 @@ subroutine Clean(this) end subroutine Clean + !----------------------------------------------------------------------- + subroutine ReadNL( this, NLFilename ) + ! + ! !DESCRIPTION: + ! Read namelist for Temperature type + ! right now (17.07.2024) it only reads variables related to excess ice coldstart initialization + ! but can be extended to replace hardocded values in InitCold by namelist variables + ! + ! !USES: + use shr_mpi_mod , only : shr_mpi_bcast + use shr_log_mod , only : errMsg => shr_log_errMsg + use spmdMod , only : masterproc, mpicom + use fileutils , only : getavu, relavu, opnfil + use clm_nlUtilsMod , only : find_nlgroup_name + use clm_varctl , only : iulog + use abortutils , only : endrun + ! + ! !ARGUMENTS: + class(temperature_type) :: this + character(len=*), intent(in) :: NLFilename ! Namelist filename + ! + ! !LOCAL VARIABLES: + integer :: ierr ! error code + integer :: unitn ! unit for namelist file + real(r8) :: excess_ice_coldstart_temp = spval ! coldstart temperature of layers with excess ice present (deg C) + real(r8) :: excess_ice_coldstart_depth = spval ! depth below which excess ice will be present (m) + character(len=32) :: subname = 'Temperature_readnl' ! subroutine name + !----------------------------------------------------------------------- + + namelist / clm_temperature_inparm / excess_ice_coldstart_depth, excess_ice_coldstart_temp + + if ( masterproc )then + + unitn = getavu() + write(iulog,*) 'Read in clm_temperature_inparm namelist' + call opnfil (NLFilename, unitn, 'F') + call find_nlgroup_name(unitn, 'clm_temperature_inparm', status=ierr) + if (ierr == 0) then + read(unitn, nml=clm_temperature_inparm, iostat=ierr) + if (ierr /= 0) then + call endrun(msg="ERROR reading clm_temperature_inparm namelist"//errmsg(sourcefile, __LINE__)) + end if + else + call endrun(msg="ERROR finding clm_temperature_inparm namelist"//errmsg(sourcefile, __LINE__)) + end if + call relavu( unitn ) + ! namelist might be read but the values not properly set + if ( excess_ice_coldstart_depth == spval ) then + call endrun(msg="ERROR exice_coldstart_depth namelist value is not properly set"//errmsg(sourcefile, __LINE__)) + endif + if ( excess_ice_coldstart_temp == spval ) then + call endrun(msg="ERROR exice_coldstart_temp namelist value is not properly set"//errmsg(sourcefile, __LINE__)) + endif + end if + + call shr_mpi_bcast(excess_ice_coldstart_depth, mpicom) + call shr_mpi_bcast(excess_ice_coldstart_temp, mpicom) + + this%excess_ice_coldstart_depth = excess_ice_coldstart_depth + this%excess_ice_coldstart_temp = excess_ice_coldstart_temp + + end subroutine ReadNL + end module TemperatureType diff --git a/src/main/clm_instMod.F90 b/src/main/clm_instMod.F90 index 04c4af6611..242df92c43 100644 --- a/src/main/clm_instMod.F90 +++ b/src/main/clm_instMod.F90 @@ -222,7 +222,7 @@ subroutine clm_instInit(bounds) type(file_desc_t) :: params_ncid ! pio netCDF file id for parameter file real(r8), allocatable :: h2osno_col(:) real(r8), allocatable :: snow_depth_col(:) - real(r8), allocatable :: exice_init_stream_col(:) + real(r8), allocatable :: exice_init_stream_col(:) ! initial concentration of excess ice in the soil (-) type(excessicestream_type) :: exice_stream integer :: dummy_to_make_pgi_happy @@ -317,7 +317,7 @@ subroutine clm_instInit(bounds) em_improad_lun=urbanparams_inst%em_improad(begl:endl), & em_perroad_lun=urbanparams_inst%em_perroad(begl:endl), & is_simple_buildtemp=IsSimpleBuildTemp(), is_prog_buildtemp=IsProgBuildTemp(), & - exice_init_stream_col=exice_init_stream_col(bounds%begc:bounds%endc) ) + exice_init_stream_col=exice_init_stream_col(bounds%begc:bounds%endc) , NLFileName=NLFilename) call active_layer_inst%Init(bounds) diff --git a/src/main/clm_varctl.F90 b/src/main/clm_varctl.F90 index eff05511cd..8804ad2c01 100644 --- a/src/main/clm_varctl.F90 +++ b/src/main/clm_varctl.F90 @@ -422,10 +422,6 @@ module clm_varctl !---------------------------------------------------------- logical, public :: use_excess_ice = .false. ! true. => use excess ice physics - real(r8), public :: excess_ice_coldstart_temp = rundef ! initial coldstart soil temperature for gridcells where excess ice is present - - real(r8), public :: excess_ice_coldstart_depth = rundef ! initial coldstart depth at which excess ice might be present and excess_ice_coldstart_temp will be applied - !---------------------------------------------------------- ! plant hydraulic stress switch !---------------------------------------------------------- diff --git a/src/main/controlMod.F90 b/src/main/controlMod.F90 index a5321e0797..47ce6dce7c 100644 --- a/src/main/controlMod.F90 +++ b/src/main/controlMod.F90 @@ -256,8 +256,8 @@ subroutine control_init(dtime) namelist /clm_inparm/ use_soil_moisture_streams - ! excess ice flag and parameters - namelist /clm_inparm/ use_excess_ice , excess_ice_coldstart_depth, excess_ice_coldstart_temp + ! excess ice flag + namelist /clm_inparm/ use_excess_ice namelist /clm_inparm/ use_lai_streams @@ -829,10 +829,6 @@ subroutine control_spmd() call mpi_bcast (use_excess_ice, 1, MPI_LOGICAL, 0, mpicom,ier) - call mpi_bcast (excess_ice_coldstart_depth, 1, MPI_REAL8, 0, mpicom, ier) - - call mpi_bcast (excess_ice_coldstart_temp, 1, MPI_REAL8, 0, mpicom, ier) - call mpi_bcast (use_lai_streams, 1, MPI_LOGICAL, 0, mpicom, ier) call mpi_bcast (use_cropcal_streams, 1, MPI_LOGICAL, 0, mpicom, ier) @@ -989,10 +985,6 @@ subroutine control_print () write(iulog,*) ' use_extralakelayers = ', use_extralakelayers write(iulog,*) ' use_vichydro = ', use_vichydro write(iulog,*) ' use_excess_ice = ', use_excess_ice - if (use_excess_ice) then - write(iulog,*) ' excess_ice_coldstart_depth = ', excess_ice_coldstart_depth - write(iulog,*) ' excess_ice_coldstart_temp = ', excess_ice_coldstart_temp - endif write(iulog,*) ' use_cn = ', use_cn write(iulog,*) ' use_cndv = ', use_cndv write(iulog,*) ' use_crop = ', use_crop From 3416574a862e2f1df62d29abb82efe76686084dd Mon Sep 17 00:00:00 2001 From: adrifoster Date: Thu, 18 Jul 2024 10:51:28 -0600 Subject: [PATCH 0713/1248] update date --- doc/ChangeLog | 2 +- doc/ChangeSum | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index 3c6a104725..8cc3198fae 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -2,7 +2,7 @@ Tag name: ctsm5.2.013 Originator(s): samrabin (Sam Rabin, UCAR/TSS, samrabin@ucar.edu) glemieux (Gregory Lemieux, LBNL, glemieux@lbl.gov) -Date: Wed 17 Jul 2024 01:20:00 PM MDT +Date: Thu Jul 18 10:51:11 MDT 2024 One-line Summary: FATES Land Use V2 Purpose and description of changes diff --git a/doc/ChangeSum b/doc/ChangeSum index 92ca8281cf..df8e6dcf6a 100644 --- a/doc/ChangeSum +++ b/doc/ChangeSum @@ -1,6 +1,6 @@ Tag Who Date Summary ============================================================================================================================ - ctsm5.2.013 glemieux 07/17/2024 FATES Land Use V2 + ctsm5.2.013 glemieux 07/18/2024 FATES Land Use V2 ctsm5.2.012 sacks 07/16/2024 Relax tolerance for truncating small snocan values in CanopyFluxes ctsm5.2.011 slevis 07/12/2024 Merge b4b-dev ctsm5.2.010 multiple 07/11/2024 Explicit A/C adoption From 647fc52df1eb32b10646eb54ed4240d4cc9cfc00 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Thu, 18 Jul 2024 11:07:00 -0600 Subject: [PATCH 0714/1248] import_ds: Workaround to import multiple files without dask. --- python/ctsm/crop_calendars/import_ds.py | 53 +++++++++++++++++-------- 1 file changed, 37 insertions(+), 16 deletions(-) diff --git a/python/ctsm/crop_calendars/import_ds.py b/python/ctsm/crop_calendars/import_ds.py index 77a22b626b..0526d3c720 100644 --- a/python/ctsm/crop_calendars/import_ds.py +++ b/python/ctsm/crop_calendars/import_ds.py @@ -41,6 +41,29 @@ def compute_derived_vars(ds_in, var): return ds_in +def manual_mfdataset(filelist, my_vars, my_vegtypes, time_slice): + """ + Opening a list of files with Xarray's open_mfdataset requires dask. This function is a + workaround for Python environments that don't have dask. + """ + ds_out = None + for filename in filelist: + ds_in = xr.open_dataset(filename) + ds_in = mfdataset_preproc(ds_in, my_vars, my_vegtypes, time_slice) + if ds_out is None: + ds_out = ds_in + else: + ds_out = xr.concat( + [ds_out, ds_in], + data_vars="minimal", + compat="override", + coords="all", + dim="time", + # combine="nested", + ) + return ds_out + + def mfdataset_preproc(ds_in, vars_to_import, vegtypes_to_import, time_slice): """ Function to drop unwanted variables in preprocessing of open_mfdataset(). @@ -221,22 +244,20 @@ def import_ds( if isinstance(filelist, list): with warnings.catch_warnings(): warnings.filterwarnings(action="ignore", category=DeprecationWarning) - if find_spec("dask") is None: - raise ModuleNotFoundError( - "You have asked xarray to import a list of files as a single Dataset using" - " open_mfdataset(), but this requires dask, which is not available.\nFile" - f" list: {filelist}" - ) - this_ds = xr.open_mfdataset( - sorted(filelist), - data_vars="minimal", - preprocess=mfdataset_preproc_closure, - compat="override", - coords="all", - concat_dim="time", - combine="nested", - chunks=chunks, - ) + dask_unavailable = find_spec("dask") is None + if dask_unavailable: + this_ds = manual_mfdataset(filelist, my_vars, my_vegtypes, time_slice) + else: + this_ds = xr.open_mfdataset( + sorted(filelist), + data_vars="minimal", + preprocess=mfdataset_preproc_closure, + compat="override", + coords="all", + concat_dim="time", + combine="nested", + chunks=chunks, + ) elif isinstance(filelist, str): this_ds = xr.open_dataset(filelist, chunks=chunks) this_ds = mfdataset_preproc(this_ds, my_vars, my_vegtypes, time_slice) From 96015dacbc7a22d57bcd242e358356f5c0cb028b Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Thu, 18 Jul 2024 11:11:52 -0600 Subject: [PATCH 0715/1248] generate_gdd20_baseline: Can now specify -v/--variable GDDBX or GDDB20. --- .../crop_calendars/generate_gdd20_baseline.py | 64 +++++++++++++------ 1 file changed, 46 insertions(+), 18 deletions(-) diff --git a/python/ctsm/crop_calendars/generate_gdd20_baseline.py b/python/ctsm/crop_calendars/generate_gdd20_baseline.py index 5d4fac3aff..4b8e68e8f9 100644 --- a/python/ctsm/crop_calendars/generate_gdd20_baseline.py +++ b/python/ctsm/crop_calendars/generate_gdd20_baseline.py @@ -19,7 +19,6 @@ import ctsm.crop_calendars.cropcal_utils as utils from ctsm.crop_calendars.grid_one_variable import grid_one_variable -VAR_LIST_IN = ["GDD0X", "GDD8X", "GDD10X"] GRIDDING_VAR_LIST = ["patches1d_ixy", "patches1d_jxy", "lat", "lon"] MISSING_FILL = -1 # Something impossible to ensure that you can mark it as a missing value, to be # bilinear-interpolated @@ -88,6 +87,16 @@ def _parse_args(): type=int, required=False, ) + parser.add_argument( + "-v", + "--variable", + help=( + "Which type of variable should be processed?" + ), + required=False, + default="GDDBX", + choices=["GDDBX", "GDDB20"], + ) # Get arguments args = parser.parse_args(sys.argv[1:]) @@ -96,6 +105,12 @@ def _parse_args(): if os.path.exists(args.output_file) and not args.overwrite: raise FileExistsError("Output file exists but --overwrite is not specified") + # Get and check input files + args.input_files = args.input_files.split(" ") + for filename in args.input_files: + if not os.path.exists(filename): + raise FileNotFoundError(f"Input file not found: {filename}") + # Process time slice # Assumes CESM behavior where data for e.g. 1987 is saved as 1988-01-01. # It would be more robust, accounting for upcoming behavior (where timestamp for a year is the @@ -137,7 +152,7 @@ def _get_cft_list(crop_list): return cft_str_list -def _get_gddn_for_cft(cft_str): +def _get_gddn_for_cft(cft_str, variable): """ Given a CFT name, return the GDDN variable it uses. @@ -149,6 +164,7 @@ def _get_gddn_for_cft(cft_str): """ gddn = None + gddn_str = None gdd0_list_str = ["wheat", "cotton", "rice"] if cft_str in _get_cft_list(gdd0_list_str): @@ -163,9 +179,9 @@ def _get_gddn_for_cft(cft_str): gddn = 10 if gddn is not None: - gddn = f"GDD{gddn}X" + gddn_str = variable.replace("B", str(gddn)) - return gddn + return gddn, gddn_str def _get_output_varname(cft_str): @@ -194,19 +210,28 @@ def _add_time_axis(da_in): return da_out -def generate_gdd20_baseline(input_files, output_file, author, time_slice): +def generate_gdd20_baseline(input_files, output_file, author, time_slice, variable): """ Generate stream_fldFileName_gdd20_baseline file from CTSM outputs """ - # Get input file list - input_files = input_files.split(sep=" ") + # Define variables to process + if variable == "GDDBX": + suffix = "X" + elif variable == "GDDB20": + suffix = "20" + else: + raise ValueError(f"-v/--variable {variable} not recoginzed") + var_list_in = [] + for base_temp in [0, 8, 10]: + var_list_in.append(f"GDD{base_temp}{suffix}") + # Get unique values and sort input_files = list(set(input_files)) input_files.sort() # Import history files and ensure they have lat/lon dims - ds_in = import_ds(input_files, VAR_LIST_IN + GRIDDING_VAR_LIST, time_slice=time_slice) + ds_in = import_ds(input_files, var_list_in + GRIDDING_VAR_LIST, time_slice=time_slice) if not all(x in ds_in.dims for x in ["lat", "lon"]): raise RuntimeError("Input files must have lat and lon dimensions") @@ -216,9 +241,9 @@ def generate_gdd20_baseline(input_files, output_file, author, time_slice): # Set up a dummy DataArray to use for crops without an assigned GDDN variable dummy_da = xr.DataArray( - data=MISSING_FILL * np.ones_like(ds_in[VAR_LIST_IN[0]].values), - dims=ds_in[VAR_LIST_IN[0]].dims, - coords=ds_in[VAR_LIST_IN[0]].coords, + data=MISSING_FILL * np.ones_like(ds_in[var_list_in[0]].values), + dims=ds_in[var_list_in[0]].dims, + coords=ds_in[var_list_in[0]].coords, ) dummy_da = _add_time_axis(dummy_da) @@ -239,25 +264,27 @@ def generate_gdd20_baseline(input_files, output_file, author, time_slice): print(f"{cft_str} ({cft_int})") # Which GDDN history variable does this crop use? E.g., GDD0, GDD10 - gddn = _get_gddn_for_cft(cft_str) + gddn, gddn_str = _get_gddn_for_cft(cft_str, variable) # Fill any missing values with MISSING_FILL. This will mean that gddmaturity in these cells # never changes. - if gddn is None: + if gddn_str is None: # Crop not handled yet? Fill it entirely with missing value this_da = dummy_da print(" dummy GDD20") else: # this_da = ds_in[gddn].fillna(MISSING_FILL) - this_da = ds_in[gddn] + this_da = ds_in[gddn_str] this_da = _add_time_axis(this_da) - print(f" {gddn}") + print(f" {gddn_str}") # Add attributes of output file - if gddn is None: + if (gddn is None) != (gddn_str is None): + raise RuntimeError("gddn and gddn_str must either both be None or both be not None") + if gddn_str is None: long_name = "Dummy GDD20" else: - long_name = gddn.replace("X", "20") + long_name = f"GDD{gddn}20" this_da.attrs["long_name"] = long_name + f" baseline for {cft_str}" this_da.attrs["units"] = "°C days" # this_da.attrs["_FillValue"] = MISSING_FILL @@ -287,5 +314,6 @@ def main(): args.input_files, args.output_file, args.author, - time_slice + time_slice, + args.variable, ) From 3cc1d0fafb3290c1b249d22f828429c92a3719c4 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Thu, 18 Jul 2024 11:14:33 -0600 Subject: [PATCH 0716/1248] generate_gdd20_baseline: Satisfy pylint. --- python/ctsm/crop_calendars/generate_gdd20_baseline.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/python/ctsm/crop_calendars/generate_gdd20_baseline.py b/python/ctsm/crop_calendars/generate_gdd20_baseline.py index 4b8e68e8f9..d2f96965b7 100644 --- a/python/ctsm/crop_calendars/generate_gdd20_baseline.py +++ b/python/ctsm/crop_calendars/generate_gdd20_baseline.py @@ -160,7 +160,7 @@ def _get_gddn_for_cft(cft_str, variable): cft_str (str): E.g., "irrigated_temperate_corn" Returns: - str or None: Name of variable to use (e.g., "GDD8X"). If crop isn't yet handled, return None. + str or None: Name of variable to use (e.g., "GDD8X"). If crop not yet handled, return None. """ gddn = None @@ -249,8 +249,8 @@ def generate_gdd20_baseline(input_files, output_file, author, time_slice, variab # Process all crops data_var_dict = {} - for v in GRIDDING_VAR_LIST: - data_var_dict[v] = ds_in[v] + for gridding_var in GRIDDING_VAR_LIST: + data_var_dict[gridding_var] = ds_in[gridding_var] ds_out = xr.Dataset( data_vars=data_var_dict, attrs={ From b1bbe15eb03a57a26eb010a850a285fd600dfe3b Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Thu, 18 Jul 2024 11:27:10 -0600 Subject: [PATCH 0717/1248] generate_gdd20_baseline: Save input file list as attribute(s). --- python/ctsm/crop_calendars/generate_gdd20_baseline.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/python/ctsm/crop_calendars/generate_gdd20_baseline.py b/python/ctsm/crop_calendars/generate_gdd20_baseline.py index d2f96965b7..b03d1fd658 100644 --- a/python/ctsm/crop_calendars/generate_gdd20_baseline.py +++ b/python/ctsm/crop_calendars/generate_gdd20_baseline.py @@ -247,7 +247,7 @@ def generate_gdd20_baseline(input_files, output_file, author, time_slice, variab ) dummy_da = _add_time_axis(dummy_da) - # Process all crops + # Set up output Dataset data_var_dict = {} for gridding_var in GRIDDING_VAR_LIST: data_var_dict[gridding_var] = ds_in[gridding_var] @@ -258,6 +258,14 @@ def generate_gdd20_baseline(input_files, output_file, author, time_slice, variab "created": dt.datetime.now().astimezone().isoformat(), }, ) + all_files_in_same_dir = len(np.unique([os.path.dirname(file) for file in input_files])) == 1 + if all_files_in_same_dir: + ds_out.attrs["input_files_dir"] = os.path.dirname(input_files[0]) + ds_out.attrs["input_files"] = ", ".join([os.path.basename(file) for file in input_files]) + else: + ds_out.attrs["input_files"] = ", ".join(input_files) + + # Process all crops encoding_dict = {} for cft_str in utils.define_mgdcrop_list(): cft_int = utils.vegtype_str2int(cft_str)[0] From a703cb6549576c63cedde68756292fab630543a5 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Thu, 18 Jul 2024 11:31:46 -0600 Subject: [PATCH 0718/1248] generate_gdd20_baseline: Save input year range as attribute. --- python/ctsm/crop_calendars/generate_gdd20_baseline.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/python/ctsm/crop_calendars/generate_gdd20_baseline.py b/python/ctsm/crop_calendars/generate_gdd20_baseline.py index b03d1fd658..14e2d5974f 100644 --- a/python/ctsm/crop_calendars/generate_gdd20_baseline.py +++ b/python/ctsm/crop_calendars/generate_gdd20_baseline.py @@ -210,7 +210,7 @@ def _add_time_axis(da_in): return da_out -def generate_gdd20_baseline(input_files, output_file, author, time_slice, variable): +def generate_gdd20_baseline(input_files, output_file, author, time_slice, variable, year_args): """ Generate stream_fldFileName_gdd20_baseline file from CTSM outputs """ @@ -256,6 +256,7 @@ def generate_gdd20_baseline(input_files, output_file, author, time_slice, variab attrs={ "author": author, "created": dt.datetime.now().astimezone().isoformat(), + "input_year_range": f"{year_args[0]}-{year_args[1]}", }, ) all_files_in_same_dir = len(np.unique([os.path.dirname(file) for file in input_files])) == 1 @@ -324,4 +325,5 @@ def main(): args.author, time_slice, args.variable, + [args.first_year, args.last_year], ) From 7a5e067dd09970d74708ed9c678f1de7d8f29af6 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Thu, 18 Jul 2024 11:32:33 -0600 Subject: [PATCH 0719/1248] generate_gdd20_baseline: Save input variable type as attribute. --- python/ctsm/crop_calendars/generate_gdd20_baseline.py | 1 + 1 file changed, 1 insertion(+) diff --git a/python/ctsm/crop_calendars/generate_gdd20_baseline.py b/python/ctsm/crop_calendars/generate_gdd20_baseline.py index 14e2d5974f..a87a2edb79 100644 --- a/python/ctsm/crop_calendars/generate_gdd20_baseline.py +++ b/python/ctsm/crop_calendars/generate_gdd20_baseline.py @@ -257,6 +257,7 @@ def generate_gdd20_baseline(input_files, output_file, author, time_slice, variab "author": author, "created": dt.datetime.now().astimezone().isoformat(), "input_year_range": f"{year_args[0]}-{year_args[1]}", + "input_variable": variable, }, ) all_files_in_same_dir = len(np.unique([os.path.dirname(file) for file in input_files])) == 1 From 25896e460ac556a5cef78201f55b8f04fc6ce154 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Thu, 18 Jul 2024 11:34:19 -0600 Subject: [PATCH 0720/1248] generate_gdd20_baseline: Functionize setup_output_dataset(). --- .../crop_calendars/generate_gdd20_baseline.py | 44 +++++++++++-------- 1 file changed, 26 insertions(+), 18 deletions(-) diff --git a/python/ctsm/crop_calendars/generate_gdd20_baseline.py b/python/ctsm/crop_calendars/generate_gdd20_baseline.py index a87a2edb79..5d6809f7ff 100644 --- a/python/ctsm/crop_calendars/generate_gdd20_baseline.py +++ b/python/ctsm/crop_calendars/generate_gdd20_baseline.py @@ -210,6 +210,31 @@ def _add_time_axis(da_in): return da_out +def setup_output_dataset(input_files, author, variable, year_args, ds_in): + """ + Set up output Dataset + """ + data_var_dict = {} + for gridding_var in GRIDDING_VAR_LIST: + data_var_dict[gridding_var] = ds_in[gridding_var] + ds_out = xr.Dataset( + data_vars=data_var_dict, + attrs={ + "author": author, + "created": dt.datetime.now().astimezone().isoformat(), + "input_year_range": f"{year_args[0]}-{year_args[1]}", + "input_variable": variable, + }, + ) + all_files_in_same_dir = len(np.unique([os.path.dirname(file) for file in input_files])) == 1 + if all_files_in_same_dir: + ds_out.attrs["input_files_dir"] = os.path.dirname(input_files[0]) + ds_out.attrs["input_files"] = ", ".join([os.path.basename(file) for file in input_files]) + else: + ds_out.attrs["input_files"] = ", ".join(input_files) + return ds_out + + def generate_gdd20_baseline(input_files, output_file, author, time_slice, variable, year_args): """ Generate stream_fldFileName_gdd20_baseline file from CTSM outputs @@ -248,24 +273,7 @@ def generate_gdd20_baseline(input_files, output_file, author, time_slice, variab dummy_da = _add_time_axis(dummy_da) # Set up output Dataset - data_var_dict = {} - for gridding_var in GRIDDING_VAR_LIST: - data_var_dict[gridding_var] = ds_in[gridding_var] - ds_out = xr.Dataset( - data_vars=data_var_dict, - attrs={ - "author": author, - "created": dt.datetime.now().astimezone().isoformat(), - "input_year_range": f"{year_args[0]}-{year_args[1]}", - "input_variable": variable, - }, - ) - all_files_in_same_dir = len(np.unique([os.path.dirname(file) for file in input_files])) == 1 - if all_files_in_same_dir: - ds_out.attrs["input_files_dir"] = os.path.dirname(input_files[0]) - ds_out.attrs["input_files"] = ", ".join([os.path.basename(file) for file in input_files]) - else: - ds_out.attrs["input_files"] = ", ".join(input_files) + ds_out = setup_output_dataset(input_files, author, variable, year_args, ds_in) # Process all crops encoding_dict = {} From 7c2f5968702c3f17ab13e34d99cbbed642ba7604 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Thu, 18 Jul 2024 11:45:33 -0600 Subject: [PATCH 0721/1248] Revisions according to review, plus some clean-up I used this test to confirm same answers: ./create_test ERS_D_Ld15.f45_f45_mg37.I2000Clm50FatesRs.derecho_intel.clm-FatesColdTwoStream -c /glade/campaign/cgd/tss/ctsm_baselines/ctsm5.2.012 This test had indicated differences with an earlier commit that I subsequently reverted. --- src/biogeochem/VOCEmissionMod.F90 | 140 +++++++----------------------- 1 file changed, 31 insertions(+), 109 deletions(-) diff --git a/src/biogeochem/VOCEmissionMod.F90 b/src/biogeochem/VOCEmissionMod.F90 index 9833fe3de9..b84d6a4ae8 100644 --- a/src/biogeochem/VOCEmissionMod.F90 +++ b/src/biogeochem/VOCEmissionMod.F90 @@ -423,7 +423,6 @@ subroutine VOCEmission (bounds, num_soilp, filter_soilp, & type(photosyns_type) , intent(in) :: photosyns_inst type(temperature_type) , intent(in) :: temperature_inst type(vocemis_type) , intent(inout) :: vocemis_inst - !by Hui, type(energyflux_type) , intent(in) :: energyflux_inst ! ! !REVISION HISTORY: @@ -479,15 +478,7 @@ subroutine VOCEmission (bounds, num_soilp, filter_soilp, & end if associate( & - !dz => col%dz , & ! Input: [real(r8) (:,:) ] depth of layer (m) - !bsw => soilstate_inst%bsw_col , & ! Input: [real(r8) (:,:) ] Clapp and Hornberger "b" (nlevgrnd) - !clayfrac => soilstate_inst%clayfrac_col , & ! Input: [real(r8) (:) ] fraction of soil that is clay - !sandfrac => soilstate_inst%sandfrac_col , & ! Input: [real(r8) (:) ] fraction of soil that is sand - !watsat => soilstate_inst%watsat_col , & ! Input: [real(r8) (:,:) ] volumetric soil water at saturation (porosity) (nlevgrnd) - !sucsat => soilstate_inst%sucsat_col , & ! Input: [real(r8) (:,:) ] minimum soil suction (mm) (nlevgrnd) - !h2osoi_vol => waterstate_inst%h2osoi_vol_col , & ! Input: [real(r8) (:,:) ] volumetric soil water (m3/m3) - !h2osoi_ice => waterstate_inst%h2osoi_ice_col , & ! Input: [real(r8) (:,:) ] ice soil content (kg/m3) - btran => energyflux_inst%btran_patch , & ! Input: [real(r8) (:) ] transpiration wetness factor (0 to 1) + btran => energyflux_inst%btran_patch , & ! Input: [real(r8) (:) ] transpiration wetness factor (0 to 1) forc_solad => atm2lnd_inst%forc_solad_downscaled_col, & ! Input: [real(r8) (:,:) ] direct beam radiation (visible only) forc_solai => atm2lnd_inst%forc_solai_grc , & ! Input: [real(r8) (:,:) ] diffuse radiation (visible only) @@ -573,12 +564,8 @@ subroutine VOCEmission (bounds, num_soilp, filter_soilp, & ! Activity factor for LAI (Guenther et al., 2006): all species gamma_l = get_gamma_L(fsun240(p), elai(p)) - !gamma_sm = 1.0_r8 - !Impact of soil moisture on isoprene emission + ! Impact of soil moisture on isoprene emission gamma_sm = get_gamma_SM(btran(p)) - ! Activity factor for soil moisture: all species (commented out for now) - ! gamma_sm = get_gamma_SM(clayfrac(p), sandfrac(p), h2osoi_vol(c,:), h2osoi_ice(c,:), & - ! col%dz(c,:), soilstate_inst%bsw_col(c,:), watsat(c,:), sucsat(c,:), root_depth(patch%itype(p))) ! Loop through VOCs for light, temperature and leaf age activity factor & apply ! all final activity factors to baseline emission factors @@ -825,105 +812,38 @@ end function get_gamma_L !----------------------------------------------------------------------- function get_gamma_SM(btran_in) + !--------------------------------------- ! May 22, 2024 ! Activity factor for soil moisture of Isoprene (Wang et al., 2022, JAMES) ! It is based on eq. (11) in the paper. Because the temperature response - ! of isoprene has been explicitly included in CLM; + ! of isoprene has been explicitly included in CLM; + !ARGUMENTS: implicit none real(r8),intent(in) :: btran_in - + !!!------- the drought algorithm-------- - real(r8), parameter :: a1 = -7.4463 - real(r8), parameter :: b1 = 3.2552 + real(r8), parameter :: a1 = -7.4463_r8 + real(r8), parameter :: b1 = 3.2552_r8 real(r8) :: get_gamma_SM - if (btran_in >= 1.) then - get_gamma_SM = 1 - else - get_gamma_SM = 1/(1+b1*exp(a1*(btran_in-0.2))) - endif + !--------------------------------------- + + if (btran_in >= 1._r8) then + get_gamma_SM = 1._r8 + else + get_gamma_SM = 1._r8 / (1._r8 + b1 * exp(a1 * (btran_in - 0.2_r8))) + endif + end function get_gamma_SM - - !function get_gamma_SM(clayfrac_in, sandfrac_in, h2osoi_vol_in, h2osoi_ice_in, dz_in, & - ! bsw_in, watsat_in, sucsat_in, root_depth_in) - ! ! - ! ! Activity factor for soil moisture (Guenther et al., 2006): all species - ! !---------------------------------- - ! ! Calculate the mean scaling factor throughout the root depth. - ! ! wilting point potential is in units of matric potential (mm) - ! ! (1 J/Kg = 0.001 MPa, approx = 0.1 m) - ! ! convert to volumetric soil water using equation 7.118 of the CLM4 Technical Note - ! ! - ! ! !USES: - ! use clm_varcon , only : denice - ! use clm_varpar , only : nlevsoi - ! ! - ! ! !ARGUMENTS: - ! implicit none - ! real(r8),intent(in) :: clayfrac_in - ! real(r8),intent(in) :: sandfrac_in - ! real(r8),intent(in) :: h2osoi_vol_in(nlevsoi) - ! real(r8),intent(in) :: h2osoi_ice_in(nlevsoi) - ! real(r8),intent(in) :: dz_in(nlevsoi) - ! real(r8),intent(in) :: bsw_in(nlevsoi) - ! real(r8),intent(in) :: watsat_in(nlevsoi) - ! real(r8),intent(in) :: sucsat_in(nlevsoi) - ! real(r8),intent(in) :: root_depth_in - ! ! - ! ! !LOCAL VARIABLES: - ! real(r8) :: get_gamma_SM - ! integer :: j - ! real(r8) :: nl ! temporary number of soil levels - ! real(r8) :: theta_ice ! water content in ice in m3/m3 - ! real(r8) :: wilt ! wilting point in m3/m3 - ! real(r8) :: theta1 ! temporary - ! real(r8), parameter :: deltheta1=0.06_r8 ! empirical coefficient - ! real(r8), parameter :: smpmax = 2.57e5_r8 ! maximum soil matrix potential - ! !----------------------------------------------------------------------- - - ! if ((clayfrac_in > 0) .and. (sandfrac_in > 0)) then - ! get_gamma_SM = 0._r8 - ! nl=0._r8 - ! - ! do j = 1,nlevsoi - ! if (sum(dz_in(1:j)) < root_depth_in) then - ! theta_ice = h2osoi_ice_in(j)/(dz_in(j)*denice) - ! wilt = ((smpmax/sucsat_in(j))**(-1._r8/bsw_in(j))) * (watsat_in(j) - theta_ice) - ! theta1 = wilt + deltheta1 - ! if (h2osoi_vol_in(j) >= theta1) then - ! get_gamma_SM = get_gamma_SM + 1._r8 - ! else if ( (h2osoi_vol_in(j) > wilt) .and. (h2osoi_vol_in(j) < theta1) ) then - ! get_gamma_SM = get_gamma_SM + ( h2osoi_vol_in(j) - wilt ) / deltheta1 - ! else - ! get_gamma_SM = get_gamma_SM + 0._r8 - ! end if - ! nl=nl+1._r8 - ! end if - ! end do - ! - ! if (nl > 0._r8) then - ! get_gamma_SM = get_gamma_SM/nl - ! endif - - ! if (get_gamma_SM > 1.0_r8) then - ! write(iulog,*) 'healdSM > 1: gamma_SM, nl', get_gamma_SM, nl - ! get_gamma_SM=1.0_r8 - ! endif - - ! else - ! get_gamma_SM = 1.0_r8 - ! end if - - !end function get_gamma_SM - + !----------------------------------------------------------------------- function get_gamma_T(t_veg240_in, t_veg24_in,t_veg_in, ct1_in, ct2_in, betaT_in, LDF_in, Ceo_in, Eopt, topt, ivt_in) - ! Activity factor for temperature + ! Activity factor for temperature !-------------------------------- - ! May 24, 2024 Hui updated the temperature response curves of isoprene for - ! Boreal Broadleaf Deciduous Shrub and Arctic C3 grass based on + ! May 24, 2024 Hui updated the temperature response curves of isoprene for + ! Boreal Broadleaf Deciduous Shrub and Arctic C3 grass based on ! Wang et al., 2024 (GRL) and Wang et al., 2024 (Nature Communications) !-------------------------------- ! Calculate both a light-dependent fraction as in Guenther et al., 2006 for isoprene @@ -931,6 +851,9 @@ function get_gamma_T(t_veg240_in, t_veg24_in,t_veg_in, ct1_in, ct2_in, betaT_in, ! form of an exponential. Final activity factor depends on light dependent fraction ! of compound type. ! + ! !USES: + use clm_varcon, only: tfrz + ! !ARGUMENTS: implicit none integer,intent(in) :: ivt_in @@ -951,6 +874,7 @@ function get_gamma_T(t_veg240_in, t_veg24_in,t_veg_in, ct1_in, ct2_in, betaT_in, real(r8) :: gamma_t_LIF ! activity factor for temperature real(r8) :: x ! temporary i real(r8) :: bet_arc_c3 + real(r8), parameter :: bet_arc_c3_max = 300._r8 real(r8), parameter :: co1 = 313._r8 ! empirical coefficient real(r8), parameter :: co2 = 0.6_r8 ! empirical coefficient real(r8), parameter :: co4 = 0.05_r8 ! empirical coefficient @@ -968,11 +892,11 @@ function get_gamma_T(t_veg240_in, t_veg24_in,t_veg_in, ct1_in, ct2_in, betaT_in, topt = co1 + (co2 * (t_veg240_in-tstd0)) if ( (ivt_in == nbrdlf_dcd_brl_shrub) ) then ! boreal-deciduous-shrub ! coming from BEAR-oNS campaign willows results - Eopt = 7.9 * exp (0.217_r8 * (t_veg24_in-273.15_r8-24.0_r8)) + Eopt = 7.9_r8 * exp (0.217_r8 * (t_veg24_in - tfrz - 24.0_r8)) else if ( (ivt_in == nc3_arctic_grass ) ) then ! boreal-grass - Eopt = exp(0.12*(t_veg240_in-288.15_r8)) + Eopt = exp(0.12_r8 * (t_veg240_in - tfrz - 15._r8)) else - Eopt = Ceo_in * exp (co4 * (t_veg24_in-tstd0)) * exp(co4 * (t_veg240_in -tstd0)) + Eopt = Ceo_in * exp (co4 * (t_veg24_in - tstd0)) * exp(co4 * (t_veg240_in - tstd0)) endif else @@ -982,13 +906,11 @@ function get_gamma_T(t_veg240_in, t_veg24_in,t_veg_in, ct1_in, ct2_in, betaT_in, x = ( (1._r8/topt) - (1._r8/(t_veg_in)) ) / ct3 ! for the boreal grass from BEAR-oNS campaign if ( (ivt_in == nc3_arctic_grass ) ) then ! boreal-grass - bet_arc_c3 = 95+9.49*exp(0.53*(288.15_r8-t_veg240_in)) - if (bet_arc_c3 .gt. 300) then - bet_arc_c3 = 300 - endif - gamma_t_LDF = Eopt * exp(bet_arc_c3*((1/303.15_r8 - 1.0_r8/(t_veg_in))/ct3)) + bet_arc_c3 = 95._r8 + 9.49_r8 * exp(0.53_r8 * (tfrz + 15._r8 - t_veg240_in)) + bet_arc_c3 = min(bet_arc_c3, bet_arc_c3_max) + gamma_t_LDF = Eopt * exp(bet_arc_c3 * ((1._r8 / (tfrz + 30._r8) - 1._r8 / t_veg_in) / ct3)) else - gamma_t_LDF = Eopt * ( ct2_in * exp(ct1_in * x)/(ct2_in - ct1_in * (1._r8 - exp(ct2_in * x))) ) + gamma_t_LDF = Eopt * ( ct2_in * exp(ct1_in * x) / (ct2_in - ct1_in * (1._r8 - exp(ct2_in * x))) ) endif From f909d2da504328459dd8129df708e289dfe33de3 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Thu, 18 Jul 2024 13:15:49 -0600 Subject: [PATCH 0722/1248] Fill all land cells with MISSING_RX_GDD_VAL. --- python/ctsm/crop_calendars/generate_gdd20_baseline.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/python/ctsm/crop_calendars/generate_gdd20_baseline.py b/python/ctsm/crop_calendars/generate_gdd20_baseline.py index 5d6809f7ff..c0c9adb30b 100644 --- a/python/ctsm/crop_calendars/generate_gdd20_baseline.py +++ b/python/ctsm/crop_calendars/generate_gdd20_baseline.py @@ -18,10 +18,9 @@ from ctsm.crop_calendars.import_ds import import_ds import ctsm.crop_calendars.cropcal_utils as utils from ctsm.crop_calendars.grid_one_variable import grid_one_variable +from ctsm.crop_calendars.cropcal_module import MISSING_RX_GDD_VAL GRIDDING_VAR_LIST = ["patches1d_ixy", "patches1d_jxy", "lat", "lon"] -MISSING_FILL = -1 # Something impossible to ensure that you can mark it as a missing value, to be -# bilinear-interpolated STREAM_YEAR = 2000 # The year specified for stream_yearFirst and stream_yearLast in the call of # shr_strdata_init_from_inline() for sdat_cropcal_gdd20_baseline @@ -266,7 +265,7 @@ def generate_gdd20_baseline(input_files, output_file, author, time_slice, variab # Set up a dummy DataArray to use for crops without an assigned GDDN variable dummy_da = xr.DataArray( - data=MISSING_FILL * np.ones_like(ds_in[var_list_in[0]].values), + data=np.full_like(ds_in[var_list_in[0]].values, MISSING_RX_GDD_VAL), dims=ds_in[var_list_in[0]].dims, coords=ds_in[var_list_in[0]].coords, ) @@ -284,10 +283,10 @@ def generate_gdd20_baseline(input_files, output_file, author, time_slice, variab # Which GDDN history variable does this crop use? E.g., GDD0, GDD10 gddn, gddn_str = _get_gddn_for_cft(cft_str, variable) - # Fill any missing values with MISSING_FILL. This will mean that gddmaturity in these cells + # Fill any missing values with MISSING_RX_GDD_VAL. This will mean that gddmaturity there # never changes. if gddn_str is None: - # Crop not handled yet? Fill it entirely with missing value + # Crop not handled yet? It's already filled with missing value this_da = dummy_da print(" dummy GDD20") else: @@ -295,6 +294,7 @@ def generate_gdd20_baseline(input_files, output_file, author, time_slice, variab this_da = ds_in[gddn_str] this_da = _add_time_axis(this_da) print(f" {gddn_str}") + this_da = this_da.fillna(MISSING_RX_GDD_VAL) # Add attributes of output file if (gddn is None) != (gddn_str is None): @@ -305,7 +305,6 @@ def generate_gdd20_baseline(input_files, output_file, author, time_slice, variab long_name = f"GDD{gddn}20" this_da.attrs["long_name"] = long_name + f" baseline for {cft_str}" this_da.attrs["units"] = "°C days" - # this_da.attrs["_FillValue"] = MISSING_FILL # Copy that to ds_out var_out = _get_output_varname(cft_str) From 8fa8506ceb753e6e1571f4b93adb4c43ea51d8d1 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Thu, 18 Jul 2024 13:39:15 -0600 Subject: [PATCH 0723/1248] Set different gdd20 baseline file if using default gdd20 baseline seasons. --- bld/namelist_files/namelist_defaults_ctsm.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index 3f8bc1f382..70ff048aa7 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -1711,7 +1711,8 @@ lnd/clm2/surfdata_esmf/NEON/surfdata_1x1_NEON_TOOL_hist_78pfts_CMIP6_simyr2000_c 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/gdd20bl.copied_from.gdds_20230829_161011.v2.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 From 945c8bbd142d0c528cbddbafd529a790a88c2dd8 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Thu, 18 Jul 2024 14:34:03 -0600 Subject: [PATCH 0724/1248] Add utility function to get list of managed crops WITH grasses. define_mgdcrop_list() had excluded foddergrass and switchgrass. New function define_mgdcrop_list_withgrasses includes them. Renamed the existing function to define_mgdcrop_list_nograsses for clarity. --- python/ctsm/crop_calendars/cropcal_module.py | 2 +- python/ctsm/crop_calendars/cropcal_utils.py | 11 ++++++++++- python/ctsm/crop_calendars/generate_gdd20_baseline.py | 4 ++-- python/ctsm/crop_calendars/generate_gdds_functions.py | 4 ++-- 4 files changed, 15 insertions(+), 6 deletions(-) diff --git a/python/ctsm/crop_calendars/cropcal_module.py b/python/ctsm/crop_calendars/cropcal_module.py index b87d26816f..08754f8823 100644 --- a/python/ctsm/crop_calendars/cropcal_module.py +++ b/python/ctsm/crop_calendars/cropcal_module.py @@ -345,7 +345,7 @@ def import_output( my_vars, year_1=None, year_n=None, - my_vegtypes=utils.define_mgdcrop_list(), + my_vegtypes=utils.define_mgdcrop_list_nograsses(), sdates_rx_ds=None, gdds_rx_ds=None, verbose=False, diff --git a/python/ctsm/crop_calendars/cropcal_utils.py b/python/ctsm/crop_calendars/cropcal_utils.py index 00ed2413d2..2157dc87f4 100644 --- a/python/ctsm/crop_calendars/cropcal_utils.py +++ b/python/ctsm/crop_calendars/cropcal_utils.py @@ -207,7 +207,7 @@ def is_each_vegtype(this_vegtypelist, this_filter, this_method): return [is_this_vegtype(x, this_filter, this_method) for x in this_vegtypelist] -def define_mgdcrop_list(): +def define_mgdcrop_list_nograsses(): """ List (strings) of managed crops in CLM. """ @@ -216,6 +216,15 @@ def define_mgdcrop_list(): is_crop = is_each_vegtype(defined_pftlist, notcrop_list, "notok_contains") return [defined_pftlist[i] for i, x in enumerate(is_crop) if x] +def define_mgdcrop_list_withgrasses(): + """ + List (strings) of managed crops in CLM. + """ + notcrop_list = ["tree", "c3_arctic_grass", "c3_non-arctic_grass", "c4_grass", "shrub", "unmanaged", "not_vegetated"] + defined_pftlist = define_pftlist() + is_crop = is_each_vegtype(defined_pftlist, notcrop_list, "notok_contains") + return [defined_pftlist[i] for i, x in enumerate(is_crop) if x] + def vegtype_str2int(vegtype_str, vegtype_mainlist=None): """ diff --git a/python/ctsm/crop_calendars/generate_gdd20_baseline.py b/python/ctsm/crop_calendars/generate_gdd20_baseline.py index c0c9adb30b..64cfd804fa 100644 --- a/python/ctsm/crop_calendars/generate_gdd20_baseline.py +++ b/python/ctsm/crop_calendars/generate_gdd20_baseline.py @@ -144,7 +144,7 @@ def _get_cft_list(crop_list): "cotton", "irrigated_cotton"] """ - mgdcrop_list = utils.define_mgdcrop_list() + mgdcrop_list = utils.define_mgdcrop_list_nograsses() cft_str_list = [] for crop_str in crop_list: cft_str_list += [x for x in mgdcrop_list if crop_str in x] @@ -276,7 +276,7 @@ def generate_gdd20_baseline(input_files, output_file, author, time_slice, variab # Process all crops encoding_dict = {} - for cft_str in utils.define_mgdcrop_list(): + for cft_str in utils.define_mgdcrop_list_nograsses(): cft_int = utils.vegtype_str2int(cft_str)[0] print(f"{cft_str} ({cft_int})") diff --git a/python/ctsm/crop_calendars/generate_gdds_functions.py b/python/ctsm/crop_calendars/generate_gdds_functions.py index 2658e1de87..83c167af00 100644 --- a/python/ctsm/crop_calendars/generate_gdds_functions.py +++ b/python/ctsm/crop_calendars/generate_gdds_functions.py @@ -282,9 +282,9 @@ def import_and_process_1yr( # Get list of crops to include if skip_crops is not None: - crops_to_read = [c for c in utils.define_mgdcrop_list() if c not in skip_crops] + crops_to_read = [c for c in utils.define_mgdcrop_list_nograsses() if c not in skip_crops] else: - crops_to_read = utils.define_mgdcrop_list() + crops_to_read = utils.define_mgdcrop_list_nograsses() print(h1_filelist) dates_ds = import_ds( From ec9f07f2a6cc5f79e6c207e8050db74ff2d857ea Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Thu, 18 Jul 2024 14:36:41 -0600 Subject: [PATCH 0725/1248] generate_gdd20_baseline: Use MGDCROP_LIST constant. --- python/ctsm/crop_calendars/generate_gdd20_baseline.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/python/ctsm/crop_calendars/generate_gdd20_baseline.py b/python/ctsm/crop_calendars/generate_gdd20_baseline.py index 64cfd804fa..1de6b5a739 100644 --- a/python/ctsm/crop_calendars/generate_gdd20_baseline.py +++ b/python/ctsm/crop_calendars/generate_gdd20_baseline.py @@ -23,6 +23,7 @@ GRIDDING_VAR_LIST = ["patches1d_ixy", "patches1d_jxy", "lat", "lon"] STREAM_YEAR = 2000 # The year specified for stream_yearFirst and stream_yearLast in the call of # shr_strdata_init_from_inline() for sdat_cropcal_gdd20_baseline +MGDCROP_LIST = utils.define_mgdcrop_list_nograsses() def _parse_args(): @@ -144,10 +145,9 @@ def _get_cft_list(crop_list): "cotton", "irrigated_cotton"] """ - mgdcrop_list = utils.define_mgdcrop_list_nograsses() cft_str_list = [] for crop_str in crop_list: - cft_str_list += [x for x in mgdcrop_list if crop_str in x] + cft_str_list += [x for x in MGDCROP_LIST if crop_str in x] return cft_str_list @@ -276,7 +276,7 @@ def generate_gdd20_baseline(input_files, output_file, author, time_slice, variab # Process all crops encoding_dict = {} - for cft_str in utils.define_mgdcrop_list_nograsses(): + for cft_str in MGDCROP_LIST: cft_int = utils.vegtype_str2int(cft_str)[0] print(f"{cft_str} ({cft_int})") From 669f227921e1bdf59157cf1da1c9b4e5176851bc Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Thu, 18 Jul 2024 14:37:05 -0600 Subject: [PATCH 0726/1248] generate_gdd20_baseline: Include mgd grasses. --- python/ctsm/crop_calendars/generate_gdd20_baseline.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/ctsm/crop_calendars/generate_gdd20_baseline.py b/python/ctsm/crop_calendars/generate_gdd20_baseline.py index 1de6b5a739..effc8e54ec 100644 --- a/python/ctsm/crop_calendars/generate_gdd20_baseline.py +++ b/python/ctsm/crop_calendars/generate_gdd20_baseline.py @@ -23,7 +23,7 @@ GRIDDING_VAR_LIST = ["patches1d_ixy", "patches1d_jxy", "lat", "lon"] STREAM_YEAR = 2000 # The year specified for stream_yearFirst and stream_yearLast in the call of # shr_strdata_init_from_inline() for sdat_cropcal_gdd20_baseline -MGDCROP_LIST = utils.define_mgdcrop_list_nograsses() +MGDCROP_LIST = utils.define_mgdcrop_list_withgrasses() def _parse_args(): From a62460642403d827b58807cfe5961df0db026c71 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Thu, 18 Jul 2024 14:41:46 -0600 Subject: [PATCH 0727/1248] generate_gdd20_baseline: Include unmanaged crops. --- python/ctsm/crop_calendars/cropcal_utils.py | 8 ++++++++ python/ctsm/crop_calendars/generate_gdd20_baseline.py | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/python/ctsm/crop_calendars/cropcal_utils.py b/python/ctsm/crop_calendars/cropcal_utils.py index 2157dc87f4..1a80448c1b 100644 --- a/python/ctsm/crop_calendars/cropcal_utils.py +++ b/python/ctsm/crop_calendars/cropcal_utils.py @@ -206,6 +206,14 @@ def is_each_vegtype(this_vegtypelist, this_filter, this_method): return [is_this_vegtype(x, this_filter, this_method) for x in this_vegtypelist] +def define_crop_list(): + """ + List (strings) of managed crops in CLM. + """ + notcrop_list = ["tree", "c3_arctic_grass", "c3_non-arctic_grass", "c4_grass", "shrub", "not_vegetated"] + defined_pftlist = define_pftlist() + is_crop = is_each_vegtype(defined_pftlist, notcrop_list, "notok_contains") + return [defined_pftlist[i] for i, x in enumerate(is_crop) if x] def define_mgdcrop_list_nograsses(): """ diff --git a/python/ctsm/crop_calendars/generate_gdd20_baseline.py b/python/ctsm/crop_calendars/generate_gdd20_baseline.py index effc8e54ec..3d082d0fde 100644 --- a/python/ctsm/crop_calendars/generate_gdd20_baseline.py +++ b/python/ctsm/crop_calendars/generate_gdd20_baseline.py @@ -23,7 +23,7 @@ GRIDDING_VAR_LIST = ["patches1d_ixy", "patches1d_jxy", "lat", "lon"] STREAM_YEAR = 2000 # The year specified for stream_yearFirst and stream_yearLast in the call of # shr_strdata_init_from_inline() for sdat_cropcal_gdd20_baseline -MGDCROP_LIST = utils.define_mgdcrop_list_withgrasses() +MGDCROP_LIST = utils.define_crop_list() def _parse_args(): From c031e1c699be02a96123df5c0ed780f4c9ce73bc Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Thu, 18 Jul 2024 15:14:14 -0600 Subject: [PATCH 0728/1248] Update ntests in build-namelist_test.pl --- 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 16f6ba2a62..9b283af334 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 = 3309; +my $ntests = 3306; if ( defined($opts{'compare'}) ) { $ntests += 2045; From c2b6c43f44c0dc3b6b9ad65b5dc979951090c3da Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Thu, 18 Jul 2024 17:35:07 -0600 Subject: [PATCH 0729/1248] Draft ChangeLog/ChangeSum --- doc/ChangeLog | 144 ++++++++++++++++++++++++++++++++++++++++++++++++++ doc/ChangeSum | 1 + 2 files changed, 145 insertions(+) diff --git a/doc/ChangeLog b/doc/ChangeLog index 8cc3198fae..5f2896ebc9 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,4 +1,148 @@ =============================================================== +Tag name: ctsm5.2.014 +Originator(s): chrislxj (Xingjie Lu, Northern Arizona U., xingjie.lu@nau.edu) +Date: Thu 18 Jul 2024 03:50:56 PM MDT +One-line Summary: use_matrixcn, use_soil_matrixcn come in but as default .false. + +Purpose and description of changes +---------------------------------- + + Currently set as default .false.: + - Add matrix module for vegetation and soil C and N cycle + - Add diagnostic variables C and N storage capacity in history files + - Add Sparse matrix module to increase the code efficiency + - Create spin-up switch, and be ready for matrix spin up development + + Additional contributors: Yuanyuan Huang, Zhenggang Du, and Yiqi Luo from + Professor Yiqi Luo's EcoLab at Northern Arizona University, now at Cornell U. + + In TSS/CGD/NCAR, contributors in the last year include slevis, ekluzek, wwieder. + Others may have been involved prior. I apologize for omissions. + +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_1 + +[ ] clm5_0 + +[ ] ctsm5_0-nwp + +[ ] clm4_5 + + +Bugs fixed +---------- +List of CTSM issues fixed (include CTSM Issue # and description) [one per line]: + Fixes #903 Bring CN-Matrix solution into CTSM + Fixes #2450 Cn-matrix testing in the aux_clm test-suites + Fixes #2621 matrixcn does not work with nrepr != 1 (number of crop reproductive pools) + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): + use_matrixcn and use_soil_matrixcn ARE recommended for accelerating bgc spin-ups + and NOT recommended for + - transient simulations (e.g. IHist) + - simulations that use threading (e.g. see tests with P64x2) + - NWP compsets + +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): + New: use_matrixcn, use_soil_matrixcn, hist_wrt_matrixcn_diag. + All three are default .false. at this time. + +Changes made to namelist defaults (e.g., changed parameter values): + Changed hillslope_fsat_equals_zero to default .false. when + use_hillslope = .false. as per issue #2652 + clm_accelerated_spinup can be set to off, on, sasu, the latter being + the setting that uses matrixcn + +Changes to the datasets (e.g., parameter, surface or initial files): + No. + +Changes to documentation: + None at this time. A description of the spinup procedure appears in + https://github.com/NCAR/LMWG_dev/issues/58 + +Substantial timing or memory changes: + ***Check PFS test in the test suite and look at timings + + +Notes of particular relevance for developers: +--------------------------------------------- + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): + - Future changes to the bgc will likely require changes in both + matrix and non-matrix parts of the code. + - I have found matrixcn to be sensitive to changes in the subgrid + heterogeneity and other subtleties. For example, matrixcn simulations + have failed from using a finidat file from a different simulation (#2592), + from running in transient mode (#2592), from running with threading (#2619), + and from setting hillslope_fsat_equals_zero = .true. (issue #2652). + - We recommend using matrixcn to accelerate bgc spin-ups and not for + most (possibly any) other purposes. + +Changes to tests or testing: + Numerous new tests in aux_clm and in build-namelist_test.pl that can be + identified by searching "matr" + + +Testing summary: +---------------- + + [PASS means all tests PASS; OK means tests PASS other than expected fails.] + + build-namelist tests (if CLMBuildNamelist.pm has changed): + + derecho - PASS + + 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 ----- IN PROG + izumi ------- IN PROG + + ctsm_sci + derecho ---- IN PROG + + +Answer changes +-------------- + +Changes answers relative to baseline: Yes, roundoff + + Summarize any changes to answers, i.e., + - what code configurations: All + - what platforms/compilers: All + - nature of change: roundoff + use_matrixcn and use_soil_matrixcn are default .false.. We get + roundoff diffs due to order-of-operation changes in a few locations, + done to improve code readability and streamlining in the presence of matrix. + + Testing with the non-default use_matrixcn = .true. and use_soil_matrixcn = .true. + appears here: https://github.com/NCAR/LMWG_dev/issues/58 + + PR #640 associated with this tag explains how answers are expected to + change from non-matrix to matrix simulations. + +Other details +------------- +Pull Requests that document the changes (include PR ids): + https://github.com/ESCOMP/ctsm/pull/640 + +=============================================================== +=============================================================== Tag name: ctsm5.2.013 Originator(s): samrabin (Sam Rabin, UCAR/TSS, samrabin@ucar.edu) glemieux (Gregory Lemieux, LBNL, glemieux@lbl.gov) diff --git a/doc/ChangeSum b/doc/ChangeSum index df8e6dcf6a..8579fbee98 100644 --- a/doc/ChangeSum +++ b/doc/ChangeSum @@ -1,5 +1,6 @@ Tag Who Date Summary ============================================================================================================================ + ctsm5.2.014 chrislxj 07/18/2024 use_matrixcn, use_soil_matrixcn come in but as default .false. ctsm5.2.013 glemieux 07/18/2024 FATES Land Use V2 ctsm5.2.012 sacks 07/16/2024 Relax tolerance for truncating small snocan values in CanopyFluxes ctsm5.2.011 slevis 07/12/2024 Merge b4b-dev From 5aeb618ebffdb8ab49521d47aa2d04037f76aa6f Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Fri, 19 Jul 2024 11:53:37 -0600 Subject: [PATCH 0730/1248] Update ChangeLog/ChangeSum --- doc/ChangeLog | 57 +++++++++++++++++++++++++-------------------------- doc/ChangeSum | 2 +- 2 files changed, 29 insertions(+), 30 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index 5f2896ebc9..35ad747636 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,8 +1,8 @@ =============================================================== Tag name: ctsm5.2.014 Originator(s): chrislxj (Xingjie Lu, Northern Arizona U., xingjie.lu@nau.edu) -Date: Thu 18 Jul 2024 03:50:56 PM MDT -One-line Summary: use_matrixcn, use_soil_matrixcn come in but as default .false. +Date: Fri 19 Jul 2024 11:04:17 AM MDT +One-line Summary: use_matrixcn, use_soil_matrixcn come in as default .false. Purpose and description of changes ---------------------------------- @@ -16,8 +16,9 @@ Purpose and description of changes Additional contributors: Yuanyuan Huang, Zhenggang Du, and Yiqi Luo from Professor Yiqi Luo's EcoLab at Northern Arizona University, now at Cornell U. - In TSS/CGD/NCAR, contributors in the last year include slevis, ekluzek, wwieder. - Others may have been involved prior. I apologize for omissions. + In TSS/CGD/NCAR/UCAR, contributors in the last year include slevis, ekluzek, wwieder. + I apologize if I have omitted others who may have been involved prior. + Significant changes to scientifically-supported configurations -------------------------------------------------------------- @@ -45,12 +46,13 @@ List of CTSM issues fixed (include CTSM Issue # and description) [one per line]: Fixes #2450 Cn-matrix testing in the aux_clm test-suites Fixes #2621 matrixcn does not work with nrepr != 1 (number of crop reproductive pools) + Notes of particular relevance for users --------------------------------------- Caveats for users (e.g., need to interpolate initial conditions): - use_matrixcn and use_soil_matrixcn ARE recommended for accelerating bgc spin-ups - and NOT recommended for + use_matrixcn and use_soil_matrixcn ARE recommended for accelerating bgc + spin-ups (keep reading for more info) and NOT recommended for - transient simulations (e.g. IHist) - simulations that use threading (e.g. see tests with P64x2) - NWP compsets @@ -60,21 +62,17 @@ Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): All three are default .false. at this time. Changes made to namelist defaults (e.g., changed parameter values): - Changed hillslope_fsat_equals_zero to default .false. when + - hillslope_fsat_equals_zero is now default .false. when use_hillslope = .false. as per issue #2652 - clm_accelerated_spinup can be set to off, on, sasu, the latter being - the setting that uses matrixcn - -Changes to the datasets (e.g., parameter, surface or initial files): - No. + - clm_accelerated_spinup can be set to on, sasu, off; matrixcn spin-up + is performed in that order (on, sasu, off); in the "on" phase, matrixcn + is not active, in the "sasu" phase matrixcn is active, and in the "off" + phase, matrixcn may be active Changes to documentation: None at this time. A description of the spinup procedure appears in https://github.com/NCAR/LMWG_dev/issues/58 -Substantial timing or memory changes: - ***Check PFS test in the test suite and look at timings - Notes of particular relevance for developers: --------------------------------------------- @@ -82,17 +80,17 @@ Notes of particular relevance for developers: Caveats for developers (e.g., code that is duplicated that requires double maintenance): - Future changes to the bgc will likely require changes in both matrix and non-matrix parts of the code. - - I have found matrixcn to be sensitive to changes in the subgrid - heterogeneity and other subtleties. For example, matrixcn simulations - have failed from using a finidat file from a different simulation (#2592), + - matrixcn seems sensitive to changes in subgrid heterogeneity and + other subtleties. For example, matrixcn simulations have failed from + using a finidat file from a different simulation (#2592), from running in transient mode (#2592), from running with threading (#2619), and from setting hillslope_fsat_equals_zero = .true. (issue #2652). - We recommend using matrixcn to accelerate bgc spin-ups and not for - most (possibly any) other purposes. + most (any?) other purposes. Changes to tests or testing: - Numerous new tests in aux_clm and in build-namelist_test.pl that can be - identified by searching "matr" + We introduced numerous new tests to the aux_clm and build-namelist_test.pl + test-suites that can be identified by searching "matrix" Testing summary: @@ -110,11 +108,11 @@ Testing summary: regular tests (aux_clm: https://github.com/ESCOMP/CTSM/wiki/System-Testing-Guide#pre-merge-system-testing): - derecho ----- IN PROG - izumi ------- IN PROG + derecho ----- OK + izumi ------- OK ctsm_sci - derecho ---- IN PROG + derecho ---- OK Answer changes @@ -123,17 +121,18 @@ Answer changes Changes answers relative to baseline: Yes, roundoff Summarize any changes to answers, i.e., - - what code configurations: All + - what code configurations: Non-matrix - what platforms/compilers: All - nature of change: roundoff use_matrixcn and use_soil_matrixcn are default .false.. We get - roundoff diffs due to order-of-operation changes in a few locations, - done to improve code readability and streamlining in the presence of matrix. + roundoff diffs due to order-of-operation changes in a few sections + of code, which improve readability and streamlining of the code + in the presence of matrix. - Testing with the non-default use_matrixcn = .true. and use_soil_matrixcn = .true. + Testing with the non-default use_matrixcn and use_soil_matrixcn = .true. appears here: https://github.com/NCAR/LMWG_dev/issues/58 - PR #640 associated with this tag explains how answers are expected to + PR #640 explains how answers are expected to change from non-matrix to matrix simulations. Other details diff --git a/doc/ChangeSum b/doc/ChangeSum index 8579fbee98..21237cbac8 100644 --- a/doc/ChangeSum +++ b/doc/ChangeSum @@ -1,6 +1,6 @@ Tag Who Date Summary ============================================================================================================================ - ctsm5.2.014 chrislxj 07/18/2024 use_matrixcn, use_soil_matrixcn come in but as default .false. + ctsm5.2.014 chrislxj 07/19/2024 use_matrixcn, use_soil_matrixcn come in as default .false. ctsm5.2.013 glemieux 07/18/2024 FATES Land Use V2 ctsm5.2.012 sacks 07/16/2024 Relax tolerance for truncating small snocan values in CanopyFluxes ctsm5.2.011 slevis 07/12/2024 Merge b4b-dev From 63b3c3fdfa8e9d5aec763bd872a81a69b2832d8e Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Fri, 19 Jul 2024 17:19:36 -0600 Subject: [PATCH 0731/1248] Namelist corrections after an izumi test failed ERS_D.f19_g17.I1850Clm50BgcCrop.izumi_nag.clm-ciso_monthly_matrixcn_spinup failed during the build because a namelist variable needed renaming --- .../user_nl_mosart | 2 +- .../testmods_dirs/clm/rtmColdSSP/user_nl_rtm | 8 +++---- lilac/bld_templates/mosart_in | 22 +++++++++---------- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/cime_config/testdefs/testmods_dirs/clm/ciso_monthly_matrixcn_spinup/user_nl_mosart b/cime_config/testdefs/testmods_dirs/clm/ciso_monthly_matrixcn_spinup/user_nl_mosart index 9e109fc131..82243d7d3d 100644 --- a/cime_config/testdefs/testmods_dirs/clm/ciso_monthly_matrixcn_spinup/user_nl_mosart +++ b/cime_config/testdefs/testmods_dirs/clm/ciso_monthly_matrixcn_spinup/user_nl_mosart @@ -1 +1 @@ -frivinp_rtm = '/dev/null' +frivinp = '/dev/null' diff --git a/cime_config/testdefs/testmods_dirs/clm/rtmColdSSP/user_nl_rtm b/cime_config/testdefs/testmods_dirs/clm/rtmColdSSP/user_nl_rtm index d1a0254a0b..e78d13a51c 100644 --- a/cime_config/testdefs/testmods_dirs/clm/rtmColdSSP/user_nl_rtm +++ b/cime_config/testdefs/testmods_dirs/clm/rtmColdSSP/user_nl_rtm @@ -1,4 +1,4 @@ -finidat_rtm = " " -rtmhist_mfilt = 1 -rtmhist_ndens = 2 -rtmhist_nhtfrq = 0 +finidat = " " +mfilt = 1 +ndens = 2 +nhtfrq = 0 diff --git a/lilac/bld_templates/mosart_in b/lilac/bld_templates/mosart_in index 091ec69285..0bc2242dda 100644 --- a/lilac/bld_templates/mosart_in +++ b/lilac/bld_templates/mosart_in @@ -4,18 +4,18 @@ delt_mosart = 1800 do_rtm = .true. do_rtmflood = .false. - finidat_rtm = " " - frivinp_rtm = "/glade/campaign/cesm/cesmdata/cseg/inputdata/rof/mosart/MOSART_routing_Global_0.5x0.5_c170601.nc" + finidat = " " + frivinp = "/glade/campaign/cesm/cesmdata/cseg/inputdata/rof/mosart/MOSART_routing_Global_0.5x0.5_c170601.nc" ice_runoff = .true. qgwl_runoff_option = "threshold" - rtmhist_fexcl1 = "" - rtmhist_fexcl2 = "" - rtmhist_fexcl3 = "" - rtmhist_fincl1 = "" - rtmhist_fincl2 = "" - rtmhist_fincl3 = "" - rtmhist_mfilt = 1 - rtmhist_ndens = 1 - rtmhist_nhtfrq = 0 + fexcl1 = "" + fexcl2 = "" + fexcl3 = "" + fincl1 = "" + fincl2 = "" + fincl3 = "" + mfilt = 1 + ndens = 1 + nhtfrq = 0 smat_option = "Xonly" / From a32a9eb121af3fcb7de1af94b5812f51eac49666 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Fri, 19 Jul 2024 18:42:31 -0600 Subject: [PATCH 0732/1248] Draft ChangeLog/ChangeSum (comments welcome) --- doc/ChangeLog | 130 +++++++++++++++++++++++++++++++++++++++++++++++++- doc/ChangeSum | 3 +- 2 files changed, 131 insertions(+), 2 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index 35ad747636..785b26db9e 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,4 +1,131 @@ =============================================================== +Tag name: ctsm5.2.015 +Originator(s): multiple (Samuel Levis,UCAR/TSS,303-665-1310, @mvertens, @jedwards4b, @billsacks, @Katetc) +Date: Fri 19 Jul 2024 06:02:22 PM MDT +One-line Summary: Update submodule tags to pass runoff from cism to rof + +Purpose and description of changes +---------------------------------- + + - Update MOSART, CMEPS, and CISM so CISM runoff goes to ROF rather than CTSM + - Update RTM with fix needed for Paleo LGM work + + +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_1 + +[ ] clm5_0 + +[ ] ctsm5_0-nwp + +[ ] clm4_5 + + +Bugs fixed +---------- +List of CTSM issues fixed (include CTSM Issue # and description) [one per line]: + Fixes #2590 Update CMEPS/MOSART/CISM/RTM tags + Fixes https://github.com/ESCOMP/RTM/issues/50 Likely wrong RTM river flux to MOM6 within cesm2_3_beta17 + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): + Issue https://github.com/ESCOMP/RTM/issues/50 + Likely wrong RTM river flux to MOM6 within cesm2_3_beta17 is now fixed with + https://github.com/ESCOMP/RTM/pull/51 + +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): + Differences in namelist 'mosart_inparm': + missing variable: 'do_rtmflood' + missing variable: 'finidat_rtm' + missing variable: 'frivinp_rtm' + missing variable: 'rtmhist_fexcl1' + missing variable: 'rtmhist_fexcl2' + missing variable: 'rtmhist_fexcl3' + missing variable: 'rtmhist_fincl1' + missing variable: 'rtmhist_fincl2' + missing variable: 'rtmhist_fincl3' + missing variable: 'rtmhist_mfilt' + missing variable: 'rtmhist_ndens' + missing variable: 'rtmhist_nhtfrq' + found extra variable: 'budget_frq' + found extra variable: 'fexcl1' + found extra variable: 'fexcl2' + found extra variable: 'fexcl3' + found extra variable: 'fincl1' + found extra variable: 'fincl2' + found extra variable: 'fincl3' + found extra variable: 'finidat' + found extra variable: 'frivinp' + found extra variable: 'mfilt' + found extra variable: 'mosart_euler_calc' + found extra variable: 'mosart_tracers' + found extra variable: 'ndens' + found extra variable: 'nhtfrq' + found extra variable: 'use_halo_option' + +Changes to documentation: + Not that I am aware of + + +Testing summary: +---------------- + + [PASS means all tests PASS; OK means tests PASS other than expected fails.] + + build-namelist tests (if CLMBuildNamelist.pm has changed): + + derecho - PASS + + 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 + + ctsm_sci + derecho ---- OK (while in tag ctsm5.2.007; I did not repeat with the latest; see checklist in #2590) + + +Answer changes +-------------- + +Changes answers relative to baseline: Yes + + Summarize any changes to answers, i.e., + - what code configurations: mosart and rtm + - what platforms/compilers: all + - nature of change: mosart roundoff; rtm larger than roundoff due to bug fix + + +Other details +------------- +List any git submodules updated (cime, rtm, mosart, cism, fates, etc.): + See .gitmodules: cism, rtm, mosart, ccs_config, cmeps + +Pull Requests that document the changes (include PR ids): + https://github.com/ESCOMP/ctsm/pull/2605 + https://github.com/ESCOMP/RTM/pull/51 + https://github.com/ESCOMP/MOSART/pull/94 + https://github.com/ESCOMP/CISM-wrapper/pull/100 + https://github.com/ESCOMP/CMEPS/pull/463 + https://github.com/ESMCI/ccs_config_cesm/pull/174 + +=============================================================== +=============================================================== Tag name: ctsm5.2.014 Originator(s): chrislxj (Xingjie Lu, Northern Arizona U., xingjie.lu@nau.edu) Date: Fri 19 Jul 2024 11:04:17 AM MDT @@ -51,7 +178,8 @@ Notes of particular relevance for users --------------------------------------- Caveats for users (e.g., need to interpolate initial conditions): - use_matrixcn and use_soil_matrixcn ARE recommended for accelerating bgc + use_matrixcn and use_soil_matrixcn ARE NOT available for clm4_5 + and ARE recommended for accelerating bgc spin-ups (keep reading for more info) and NOT recommended for - transient simulations (e.g. IHist) - simulations that use threading (e.g. see tests with P64x2) diff --git a/doc/ChangeSum b/doc/ChangeSum index 21237cbac8..5c7123b5e0 100644 --- a/doc/ChangeSum +++ b/doc/ChangeSum @@ -1,6 +1,7 @@ Tag Who Date Summary ============================================================================================================================ - ctsm5.2.014 chrislxj 07/19/2024 use_matrixcn, use_soil_matrixcn come in as default .false. + ctsm5.2.015 multiple 07/19/2024 Update submodule tags to pass runoff from cism to rof + ctsm5.2.014 multiple 07/19/2024 use_matrixcn, use_soil_matrixcn come in as default .false. ctsm5.2.013 glemieux 07/18/2024 FATES Land Use V2 ctsm5.2.012 sacks 07/16/2024 Relax tolerance for truncating small snocan values in CanopyFluxes ctsm5.2.011 slevis 07/12/2024 Merge b4b-dev From 9ba2b5f164ad800e6c10f9e7b5f373c9f31ab504 Mon Sep 17 00:00:00 2001 From: mvdebolskiy Date: Mon, 22 Jul 2024 10:51:05 -0600 Subject: [PATCH 0733/1248] rename vars, add arg to test and depth arg. --- src/biogeophys/TemperatureType.F90 | 16 ++++----- src/biogeophys/WaterStateBulkType.F90 | 8 ++--- src/biogeophys/WaterStateType.F90 | 28 +++++++-------- src/biogeophys/WaterType.F90 | 34 ++++++++++--------- src/main/clm_instMod.F90 | 15 ++++---- .../unittestWaterTypeFactory.F90 | 28 ++++++++++++++- 6 files changed, 79 insertions(+), 50 deletions(-) diff --git a/src/biogeophys/TemperatureType.F90 b/src/biogeophys/TemperatureType.F90 index 6084c7ee2c..a256e22eb7 100644 --- a/src/biogeophys/TemperatureType.F90 +++ b/src/biogeophys/TemperatureType.F90 @@ -120,8 +120,8 @@ module TemperatureType real(r8), pointer :: c_h2osfc_col (:) ! heat capacity of surface water ! Namelist parameters for initialization - real(r8), private :: excess_ice_coldstart_depth ! depth below which excess ice will be present - real(r8), private :: excess_ice_coldstart_temp ! coldstart temperature of layers with excess ice present + real(r8) :: excess_ice_coldstart_depth ! depth below which excess ice will be present + real(r8) :: excess_ice_coldstart_temp ! coldstart temperature of layers with excess ice present contains @@ -147,7 +147,7 @@ module TemperatureType !------------------------------------------------------------------------ subroutine Init(this, bounds, & em_roof_lun, em_wall_lun, em_improad_lun, em_perroad_lun, & - is_simple_buildtemp, is_prog_buildtemp, exice_init_stream_col, NLFileName) + is_simple_buildtemp, is_prog_buildtemp, exice_init_conc_col, NLFileName) ! ! !DESCRIPTION: ! @@ -162,7 +162,7 @@ subroutine Init(this, bounds, & real(r8) , intent(in) :: em_perroad_lun(bounds%begl:) logical , intent(in) :: is_simple_buildtemp ! Simple building temp is being used logical , intent(in) :: is_prog_buildtemp ! Prognostic building temp is being used - real(r8) , intent(in) :: exice_init_stream_col(bounds%begc:) ! initial excess ice concentration from the stream file + real(r8) , intent(in) :: exice_init_conc_col(bounds%begc:) ! initial coldstart excess ice concentration (from the stream file) character(len=*) , intent(in) :: NLFilename ! Namelist filename @@ -175,7 +175,7 @@ subroutine Init(this, bounds, & em_improad_lun(bounds%begl:bounds%endl), & em_perroad_lun(bounds%begl:bounds%endl), & is_simple_buildtemp, is_prog_buildtemp, & - exice_init_stream_col(bounds%begc:bounds%endc) ) + exice_init_conc_col(bounds%begc:bounds%endc) ) end subroutine Init @@ -650,7 +650,7 @@ end subroutine InitHistory !----------------------------------------------------------------------- subroutine InitCold(this, bounds, & em_roof_lun, em_wall_lun, em_improad_lun, em_perroad_lun, & - is_simple_buildtemp, is_prog_buildtemp, exice_init_stream_col) + is_simple_buildtemp, is_prog_buildtemp, exice_init_conc_col) ! ! !DESCRIPTION: ! Initialize cold start conditions for module variables @@ -675,7 +675,7 @@ subroutine InitCold(this, bounds, & real(r8) , intent(in) :: em_perroad_lun(bounds%begl:) logical , intent(in) :: is_simple_buildtemp ! Simple building temp is being used logical , intent(in) :: is_prog_buildtemp ! Prognostic building temp is being used - real(r8) , intent(in) :: exice_init_stream_col(bounds%begc:) ! initial ammount of excess ice from the stream file + real(r8) , intent(in) :: exice_init_conc_col(bounds%begc:) ! initial coldstart excess ice concentration (from the stream file) ! ! !LOCAL VARIABLES: integer :: j,l,c,p ! indices @@ -757,7 +757,7 @@ subroutine InitCold(this, bounds, & end if else this%t_soisno_col(c,1:nlevgrnd) = 272._r8 - if (use_excess_ice .and. exice_init_stream_col(c) > 0.0_r8) then + if (use_excess_ice .and. exice_init_conc_col(c) > 0.0_r8) then nexice_start = nlevsoi - 1 if (this%excess_ice_coldstart_depth <= 0.0_r8) then ! we double check this here, and when building namelists diff --git a/src/biogeophys/WaterStateBulkType.F90 b/src/biogeophys/WaterStateBulkType.F90 index 4f03ba177e..4cd425c976 100644 --- a/src/biogeophys/WaterStateBulkType.F90 +++ b/src/biogeophys/WaterStateBulkType.F90 @@ -47,7 +47,7 @@ module WaterStateBulkType !------------------------------------------------------------------------ subroutine InitBulk(this, bounds, info, vars, & - h2osno_input_col, watsat_col, t_soisno_col, use_aquifer_layer, NLFilename, exice_init_stream_col) + h2osno_input_col, watsat_col, t_soisno_col, use_aquifer_layer, exice_coldstart_depth, exice_init_conc_col) class(waterstatebulk_type), intent(inout) :: this type(bounds_type) , intent(in) :: bounds @@ -57,8 +57,8 @@ subroutine InitBulk(this, bounds, info, vars, & real(r8) , intent(in) :: watsat_col(bounds%begc:, 1:) ! volumetric soil water at saturation (porosity) real(r8) , intent(in) :: t_soisno_col(bounds%begc:, -nlevsno+1:) ! col soil temperature (Kelvin) logical , intent(in) :: use_aquifer_layer ! whether an aquifer layer is used in this run - character(len=*) , intent(in) :: NLFilename ! Namelist filename - real(r8) , intent(in) :: exice_init_stream_col(bounds%begc:) ! initial ammount of excess ice from stream + real(r8) , intent(in) :: exice_coldstart_depth ! depth below which excess ice will be present + real(r8) , intent(in) :: exice_init_conc_col(bounds%begc:) ! initial coldstart excess ice concentration (from the stream file) call this%Init(bounds = bounds, & info = info, & @@ -67,7 +67,7 @@ subroutine InitBulk(this, bounds, info, vars, & watsat_col = watsat_col, & t_soisno_col = t_soisno_col, & use_aquifer_layer = use_aquifer_layer, & - NLFilename = NLFilename, exice_init_stream_col = exice_init_stream_col(bounds%begc:bounds%endc)) + exice_coldstart_depth = exice_coldstart_depth, exice_init_conc_col = exice_init_conc_col(bounds%begc:bounds%endc)) call this%InitBulkAllocate(bounds) diff --git a/src/biogeophys/WaterStateType.F90 b/src/biogeophys/WaterStateType.F90 index 4c82e4efa6..8f0ba89104 100644 --- a/src/biogeophys/WaterStateType.F90 +++ b/src/biogeophys/WaterStateType.F90 @@ -80,7 +80,7 @@ module WaterStateType !------------------------------------------------------------------------ subroutine Init(this, bounds, info, tracer_vars, & - h2osno_input_col, watsat_col, t_soisno_col, use_aquifer_layer, NLFilename, exice_init_stream_col) + h2osno_input_col, watsat_col, t_soisno_col, use_aquifer_layer, exice_coldstart_depth, exice_init_conc_col) class(waterstate_type), intent(inout) :: this type(bounds_type) , intent(in) :: bounds @@ -90,8 +90,8 @@ subroutine Init(this, bounds, info, tracer_vars, & real(r8) , intent(in) :: watsat_col(bounds%begc:, 1:) ! volumetric soil water at saturation (porosity) real(r8) , intent(in) :: t_soisno_col(bounds%begc:, -nlevsno+1:) ! col soil temperature (Kelvin) logical , intent(in) :: use_aquifer_layer ! whether an aquifer layer is used in this run - character(len=*) , intent(in) :: NLFilename ! Namelist filename - real(r8) , intent(in) :: exice_init_stream_col(bounds%begc:bounds%endc) ! initial ammount of excess ice from stream + real(r8) , intent(in) :: exice_coldstart_depth ! depth below which excess ice will be present + real(r8) , intent(in) :: exice_init_conc_col(bounds%begc:bounds%endc) ! initial coldstart excess ice concentration (from the stream file) this%info => info @@ -103,7 +103,7 @@ subroutine Init(this, bounds, info, tracer_vars, & watsat_col = watsat_col, & t_soisno_col = t_soisno_col, & use_aquifer_layer = use_aquifer_layer, & - NLFilename = NLFilename, exice_init_stream_col = exice_init_stream_col) + exice_coldstart_depth = exice_coldstart_depth , exice_init_conc_col = exice_init_conc_col) end subroutine Init @@ -322,7 +322,7 @@ end subroutine InitHistory !----------------------------------------------------------------------- subroutine InitCold(this, bounds, & - h2osno_input_col, watsat_col, t_soisno_col, use_aquifer_layer, NLFilename, exice_init_stream_col) + h2osno_input_col, watsat_col, t_soisno_col, use_aquifer_layer, exice_coldstart_depth, exice_init_conc_col) ! ! !DESCRIPTION: ! Initialize time constant variables and cold start conditions @@ -342,12 +342,12 @@ subroutine InitCold(this, bounds, & real(r8) , intent(in) :: watsat_col(bounds%begc:, 1:) ! volumetric soil water at saturation (porosity) real(r8) , intent(in) :: t_soisno_col(bounds%begc:, -nlevsno+1:) ! col soil temperature (Kelvin) logical , intent(in) :: use_aquifer_layer ! whether an aquifer layer is used in this run - character(len=*) , intent(in) :: NLFilename ! Namelist filename - real(r8) , intent(in) :: exice_init_stream_col(bounds%begc:bounds%endc) ! initial ammount of excess ice from stream + real(r8) , intent(in) :: exice_coldstart_depth ! depth below which excess ice will be present + real(r8) , intent(in) :: exice_init_conc_col(bounds%begc:bounds%endc) ! initial coldstart excess ice concentration (from the stream file) ! ! !LOCAL VARIABLES: integer :: c,j,l,nlevs,g - integer :: nbedrock, n05m ! layer containing 0.5 m + integer :: nbedrock, nexice ! layer containing 0.5 m real(r8) :: ratio !----------------------------------------------------------------------- @@ -550,7 +550,7 @@ subroutine InitCold(this, bounds, & this%dynbal_baseline_ice_col(bounds%begc:bounds%endc) = 0._r8 !Initialize excess ice - this%exice_bulk_init(bounds%begc:bounds%endc) = exice_init_stream_col(bounds%begc:bounds%endc) + this%exice_bulk_init(bounds%begc:bounds%endc) = exice_init_conc_col(bounds%begc:bounds%endc) this%excess_ice_col(bounds%begc:bounds%endc,:) = 0.0_r8 if (use_excess_ice) then do c = bounds%begc,bounds%endc @@ -558,10 +558,10 @@ subroutine InitCold(this, bounds, & l = col%landunit(c) if (.not. lun%lakpoi(l)) then !not lake if (lun%itype(l) == istsoil .or. lun%itype(l) == istcrop) then - if (zisoi(nlevsoi) >= 0.5_r8) then - call find_soil_layer_containing_depth(0.5_r8,n05m) + if (zisoi(nlevsoi) >= exice_coldstart_depth) then + call find_soil_layer_containing_depth(exice_coldstart_depth,nexice) else - n05m=nlevsoi-1 + nexice=nlevsoi-1 endif if (use_bedrock .and. col%nbedrock(c) <=nlevsoi) then nbedrock = col%nbedrock(c) @@ -569,8 +569,8 @@ subroutine InitCold(this, bounds, & nbedrock = nlevsoi endif do j = 2, nlevmaxurbgrnd ! ignore first layer - if (n05m= n05m .and. j= nexice .and. j Date: Mon, 22 Jul 2024 10:55:49 -0600 Subject: [PATCH 0734/1248] add defaults for the stream test. --- .../testdefs/testmods_dirs/clm/ExcessIceStreams/user_nl_clm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cime_config/testdefs/testmods_dirs/clm/ExcessIceStreams/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/ExcessIceStreams/user_nl_clm index f61ca32a79..aa2c9efa5b 100644 --- a/cime_config/testdefs/testmods_dirs/clm/ExcessIceStreams/user_nl_clm +++ b/cime_config/testdefs/testmods_dirs/clm/ExcessIceStreams/user_nl_clm @@ -1,2 +1,4 @@ use_excess_ice = .true. use_excess_ice_streams = .true. + excess_ice_coldstart_depth = 0.5 + excess_ice_coldstart_temp = -5.0 From dbf00993bfb1ff626f4f326e03b585293f9bc5da Mon Sep 17 00:00:00 2001 From: mvdebolskiy Date: Mon, 22 Jul 2024 10:58:36 -0600 Subject: [PATCH 0735/1248] fix indent --- bld/CLMBuildNamelist.pm | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index 498de96a4d..fa0d4a0382 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -4589,13 +4589,13 @@ sub setup_logic_exice { my $finidat = $nl->get_value('finidat'); # If coldstart and use_excess_ice is on: if ( ( (not defined($use_exice_streams)) && value_is_true($use_exice) ) && string_is_undef_or_empty($finidat) ) { - $nl->set_variable_value('exice_streams', 'use_excess_ice_streams' , '.true.'); - $use_exice_streams = '.true.'; - # if excess ice is turned off - } elsif ( (not defined($use_exice_streams)) && (not value_is_true($use_exice)) ) { - $nl->set_variable_value('exice_streams', 'use_excess_ice_streams' , '.false.'); - $use_exice_streams = '.false.'; - } + $nl->set_variable_value('exice_streams', 'use_excess_ice_streams' , '.true.'); + $use_exice_streams = '.true.'; + # if excess ice is turned off + } elsif ( (not defined($use_exice_streams)) && (not value_is_true($use_exice)) ) { + $nl->set_variable_value('exice_streams', 'use_excess_ice_streams' , '.false.'); + $use_exice_streams = '.false.'; + } # If excess ice streams is on if (defined($use_exice_streams) && value_is_true($use_exice_streams)) { # Can only be true if excess ice is also on, otherwise fail From a4a9ede604eb36e1b1f6541fb1e40b712176ffa5 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Mon, 22 Jul 2024 16:04:00 -0600 Subject: [PATCH 0736/1248] Update ChangeLog/ChangeSum --- doc/ChangeLog | 4 +++- doc/ChangeSum | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index 785b26db9e..506b3d5ad0 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,7 +1,7 @@ =============================================================== Tag name: ctsm5.2.015 Originator(s): multiple (Samuel Levis,UCAR/TSS,303-665-1310, @mvertens, @jedwards4b, @billsacks, @Katetc) -Date: Fri 19 Jul 2024 06:02:22 PM MDT +Date: Mon 22 Jul 2024 12:46:17 PM MDT One-line Summary: Update submodule tags to pass runoff from cism to rof Purpose and description of changes @@ -110,6 +110,8 @@ Changes answers relative to baseline: Yes - what platforms/compilers: all - nature of change: mosart roundoff; rtm larger than roundoff due to bug fix + We are ignoring strange diffs from baseline in two tests in variable + FATES_TRANSITION_MATRIX_LULU as explained in issue #2656. Other details ------------- diff --git a/doc/ChangeSum b/doc/ChangeSum index 5c7123b5e0..9c6524b33d 100644 --- a/doc/ChangeSum +++ b/doc/ChangeSum @@ -1,6 +1,6 @@ Tag Who Date Summary ============================================================================================================================ - ctsm5.2.015 multiple 07/19/2024 Update submodule tags to pass runoff from cism to rof + ctsm5.2.015 multiple 07/22/2024 Update submodule tags to pass runoff from cism to rof ctsm5.2.014 multiple 07/19/2024 use_matrixcn, use_soil_matrixcn come in as default .false. ctsm5.2.013 glemieux 07/18/2024 FATES Land Use V2 ctsm5.2.012 sacks 07/16/2024 Relax tolerance for truncating small snocan values in CanopyFluxes From 753fda3ff0147837231a73c9c728dd9ce47b5997 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Tue, 23 Jul 2024 09:27:15 -0600 Subject: [PATCH 0737/1248] Format with black. --- python/ctsm/crop_calendars/cropcal_utils.py | 22 +++++++++++++++++-- .../crop_calendars/generate_gdd20_baseline.py | 12 +++------- .../crop_calendars/generate_gdds_functions.py | 17 ++++++++------ .../ctsm/crop_calendars/interpolate_gdds.py | 2 +- 4 files changed, 34 insertions(+), 19 deletions(-) diff --git a/python/ctsm/crop_calendars/cropcal_utils.py b/python/ctsm/crop_calendars/cropcal_utils.py index 1a80448c1b..584046edee 100644 --- a/python/ctsm/crop_calendars/cropcal_utils.py +++ b/python/ctsm/crop_calendars/cropcal_utils.py @@ -206,15 +206,24 @@ def is_each_vegtype(this_vegtypelist, this_filter, this_method): return [is_this_vegtype(x, this_filter, this_method) for x in this_vegtypelist] + def define_crop_list(): """ List (strings) of managed crops in CLM. """ - notcrop_list = ["tree", "c3_arctic_grass", "c3_non-arctic_grass", "c4_grass", "shrub", "not_vegetated"] + notcrop_list = [ + "tree", + "c3_arctic_grass", + "c3_non-arctic_grass", + "c4_grass", + "shrub", + "not_vegetated", + ] defined_pftlist = define_pftlist() is_crop = is_each_vegtype(defined_pftlist, notcrop_list, "notok_contains") return [defined_pftlist[i] for i, x in enumerate(is_crop) if x] + def define_mgdcrop_list_nograsses(): """ List (strings) of managed crops in CLM. @@ -224,11 +233,20 @@ def define_mgdcrop_list_nograsses(): is_crop = is_each_vegtype(defined_pftlist, notcrop_list, "notok_contains") return [defined_pftlist[i] for i, x in enumerate(is_crop) if x] + def define_mgdcrop_list_withgrasses(): """ List (strings) of managed crops in CLM. """ - notcrop_list = ["tree", "c3_arctic_grass", "c3_non-arctic_grass", "c4_grass", "shrub", "unmanaged", "not_vegetated"] + notcrop_list = [ + "tree", + "c3_arctic_grass", + "c3_non-arctic_grass", + "c4_grass", + "shrub", + "unmanaged", + "not_vegetated", + ] defined_pftlist = define_pftlist() is_crop = is_each_vegtype(defined_pftlist, notcrop_list, "notok_contains") return [defined_pftlist[i] for i, x in enumerate(is_crop) if x] diff --git a/python/ctsm/crop_calendars/generate_gdd20_baseline.py b/python/ctsm/crop_calendars/generate_gdd20_baseline.py index 3d082d0fde..06d3a9cd21 100644 --- a/python/ctsm/crop_calendars/generate_gdd20_baseline.py +++ b/python/ctsm/crop_calendars/generate_gdd20_baseline.py @@ -72,27 +72,21 @@ def _parse_args(): parser.add_argument( "-y1", "--first-year", - help=( - "First calendar year to include" - ), + help=("First calendar year to include"), type=int, required=False, ) parser.add_argument( "-yN", "--last-year", - help=( - "Last calendar year to include" - ), + help=("Last calendar year to include"), type=int, required=False, ) parser.add_argument( "-v", "--variable", - help=( - "Which type of variable should be processed?" - ), + help=("Which type of variable should be processed?"), required=False, default="GDDBX", choices=["GDDBX", "GDDB20"], diff --git a/python/ctsm/crop_calendars/generate_gdds_functions.py b/python/ctsm/crop_calendars/generate_gdds_functions.py index 83c167af00..50e2ac3d00 100644 --- a/python/ctsm/crop_calendars/generate_gdds_functions.py +++ b/python/ctsm/crop_calendars/generate_gdds_functions.py @@ -651,10 +651,7 @@ def import_and_process_1yr( ) if save_figs and np.any(np.isnan(gddharv_atharv_p)): if np.all(np.isnan(gddharv_atharv_p)): - log( - logger, - " ❗ All GDDHARV are NaN; should only affect figure" - ) + log(logger, " ❗ All GDDHARV are NaN; should only affect figure") check_gddharv = False else: log( @@ -744,9 +741,15 @@ def import_and_process_1yr( ) else: error(logger, "Unexpected NaN for last season's GDD accumulation.") - if save_figs and check_gddharv and np.any( - np.isnan( - gddharv_yp_list[var][year_index - 1, active_this_year_where_gs_lastyr_indices] + if ( + save_figs + and check_gddharv + and np.any( + np.isnan( + gddharv_yp_list[var][ + year_index - 1, active_this_year_where_gs_lastyr_indices + ] + ) ) ): if incorrectly_daily: diff --git a/python/ctsm/crop_calendars/interpolate_gdds.py b/python/ctsm/crop_calendars/interpolate_gdds.py index 809be98826..830df18c73 100755 --- a/python/ctsm/crop_calendars/interpolate_gdds.py +++ b/python/ctsm/crop_calendars/interpolate_gdds.py @@ -70,7 +70,7 @@ def _setup_process_args(): help="Interpolate variables whose names start with this string", type=str, required=False, - default="gdd1_" + default="gdd1_", ) parser.add_argument( "--overwrite", From c0a3556886e31c5c4bfc55ceccec0925e407b1f4 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Tue, 23 Jul 2024 09:27:53 -0600 Subject: [PATCH 0738/1248] Add previous commit to .git-blame-ignore-revs. --- .git-blame-ignore-revs | 1 + 1 file changed, 1 insertion(+) diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs index 44a697c343..31f63ef8ae 100644 --- a/.git-blame-ignore-revs +++ b/.git-blame-ignore-revs @@ -48,3 +48,4 @@ aa04d1f7d86cc2503b98b7e2b2d84dbfff6c316b 9660667b1267dcd4150889f5f39db540158be74a 665cf86102e09b4c4c5a140700676dca23bc55a9 045d90f1d80f713eb3ae0ac58f6c2352937f1eb0 +753fda3ff0147837231a73c9c728dd9ce47b5997 From 811659f6a6bd59a91bef8f10aa0d20b0fc268630 Mon Sep 17 00:00:00 2001 From: mvdebolskiy Date: Tue, 23 Jul 2024 11:11:41 -0600 Subject: [PATCH 0739/1248] make unit-tests happy --- src/biogeophys/TemperatureType.F90 | 9 +++++++-- src/unit_test_shr/unittestDustEmisInputs.F90 | 6 +++++- src/unit_test_shr/unittestWaterTypeFactory.F90 | 6 +++--- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/src/biogeophys/TemperatureType.F90 b/src/biogeophys/TemperatureType.F90 index a256e22eb7..3771735bb7 100644 --- a/src/biogeophys/TemperatureType.F90 +++ b/src/biogeophys/TemperatureType.F90 @@ -163,10 +163,15 @@ subroutine Init(this, bounds, & logical , intent(in) :: is_simple_buildtemp ! Simple building temp is being used logical , intent(in) :: is_prog_buildtemp ! Prognostic building temp is being used real(r8) , intent(in) :: exice_init_conc_col(bounds%begc:) ! initial coldstart excess ice concentration (from the stream file) - character(len=*) , intent(in) :: NLFilename ! Namelist filename + character(len=*) , intent(in), optional :: NLFilename ! Namelist filename - call this%ReadNL(NLFilename) + if ( present(NLFilename) ) then + call this%ReadNL(NLFilename) + else ! this is needed for testing + this%excess_ice_coldstart_depth = 0.5_r8 + this%excess_ice_coldstart_temp = -5.0_r8 + endif call this%InitAllocate ( bounds ) call this%InitHistory ( bounds, is_simple_buildtemp, is_prog_buildtemp ) call this%InitCold ( bounds, & diff --git a/src/unit_test_shr/unittestDustEmisInputs.F90 b/src/unit_test_shr/unittestDustEmisInputs.F90 index 6b15680ef7..af3ad63890 100644 --- a/src/unit_test_shr/unittestDustEmisInputs.F90 +++ b/src/unit_test_shr/unittestDustEmisInputs.F90 @@ -50,6 +50,7 @@ subroutine setUp(this) character(len=5) :: NLFilename = 'none' real(r8), allocatable :: urb_em(:) + real(r8), allocatable :: exice_init_conc_col(:) integer :: begl, endl, begc, endc integer :: c type(atm2lnd_params_type) :: atm2lnd_params @@ -91,12 +92,15 @@ subroutine setUp(this) call this%frictionvel_inst%InitForTesting(bounds) allocate( urb_em(begl:endl) ) urb_em(begl:endl) = 0.99_r8 ! Arbitrary won't matter here + allocate( exice_init_conc_col(begc:endc) ) + exice_init_conc_col(begc:endc) = 0.0_r8 ! zero, so it doesn't affect anything. call this%temperature_inst%Init(bounds, & em_roof_lun=urb_em(begl:endl), & em_wall_lun=urb_em(begl:endl), & em_improad_lun=urb_em(begl:endl), & em_perroad_lun=urb_em(begl:endl), & - is_simple_buildtemp=.true., is_prog_buildtemp=.false.) + is_simple_buildtemp=.true., is_prog_buildtemp=.false., & + exice_init_conc_col = exice_init_conc_col(begc:endc)) deallocate( urb_em ) end subroutine setUp diff --git a/src/unit_test_shr/unittestWaterTypeFactory.F90 b/src/unit_test_shr/unittestWaterTypeFactory.F90 index 06362ee1d0..2d83fd0058 100644 --- a/src/unit_test_shr/unittestWaterTypeFactory.F90 +++ b/src/unit_test_shr/unittestWaterTypeFactory.F90 @@ -140,7 +140,7 @@ subroutine create_water_type(this, water_inst, & end if if (present(exice_init_conc_col)) then - SHR_ASSERT_ALL_FL((ubound(exice_init_conc_col,1) == bounds%enc), sourcefile, __LINE__) + SHR_ASSERT_ALL_FL((ubound(exice_init_conc_col,1) == bounds%endc), sourcefile, __LINE__) endif if (present(enable_consistency_checks)) then @@ -177,9 +177,9 @@ subroutine create_water_type(this, water_inst, & l_exice_coldstart_depth = 0.5_r8 endif if (present(exice_init_conc_col)) then - l_exice_init_conc_col(:,:) = exice_init_conc_col + l_exice_init_conc_col(:) = exice_init_conc_col else - l_exice_init_conc_col(:,:) = 0.01_r8 + l_exice_init_conc_col(:) = 0.0_r8 endif call water_inst%InitForTesting(bounds, params, & From 88adda49954f51a4aa3fb1763e0c9d2e152f7c04 Mon Sep 17 00:00:00 2001 From: mvdebolskiy Date: Tue, 23 Jul 2024 12:29:08 -0600 Subject: [PATCH 0740/1248] Make warning for non-equilibrium. --- src/biogeophys/WaterStateType.F90 | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/biogeophys/WaterStateType.F90 b/src/biogeophys/WaterStateType.F90 index 8f0ba89104..35441d65d9 100644 --- a/src/biogeophys/WaterStateType.F90 +++ b/src/biogeophys/WaterStateType.F90 @@ -724,6 +724,17 @@ subroutine Restart(this, bounds, ncid, flag, & ! Restart excess ice vars if (.not. use_excess_ice) then ! no need to even define the restart vars + call RestartExcessIceIssue( & + ncid = ncid, & + flag = flag, & + excess_ice_on_restart = excess_ice_on_restart) + if( excess_ice_on_restart ) then + if (masterproc) then + write(iulog,*) '--WARNING-- Starting from initial conditions with excess ice present.' + write(iulog,*) 'But use_excess_ice=.false.' + write(iulog,*) 'This will cause soil moisture and temperature not being in equilibrium' + endif + endif this%excess_ice_col(bounds%begc:bounds%endc,-nlevsno+1:nlevmaxurbgrnd)=0.0_r8 else call RestartExcessIceIssue( & From b11bc8923bbaa6edc6c60913c37c1ba7f906d2b6 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 24 Jul 2024 11:21:17 -0600 Subject: [PATCH 0741/1248] Update cism to work with this cmeps version --- .gitmodules | 2 +- components/cism | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitmodules b/.gitmodules index 501708f587..810b43a266 100644 --- a/.gitmodules +++ b/.gitmodules @@ -36,7 +36,7 @@ fxDONOTUSEurl = https://github.com/NCAR/fates-release [submodule "cism"] path = components/cism url = https://github.com/ESCOMP/CISM-wrapper -fxtag = cismwrap_2_2_001 +fxtag = cismwrap_2_2_002 fxrequired = ToplevelRequired # Standard Fork to compare to with "git fleximod test" to ensure personal forks aren't committed fxDONOTUSEurl = https://github.com/ESCOMP/CISM-wrapper diff --git a/components/cism b/components/cism index c05dd5c4fc..c84cc9f5b3 160000 --- a/components/cism +++ b/components/cism @@ -1 +1 @@ -Subproject commit c05dd5c4fc85327e76523aaea9cfe1e388748928 +Subproject commit c84cc9f5b3103766a35d0a7ddd5e9dbd7deae762 From 838ea5f3bdab72ed9b54db969c23a86f548e3114 Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Wed, 24 Jul 2024 10:47:58 -0700 Subject: [PATCH 0742/1248] move fates and update land use history outputs This moves the land use outputs from the baseline fates testmod into the LUH2 base testmod --- cime_config/testdefs/testmods_dirs/clm/Fates/user_nl_clm | 3 +-- .../testdefs/testmods_dirs/clm/FatesColdLUH2/user_nl_clm | 2 ++ 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/cime_config/testdefs/testmods_dirs/clm/Fates/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/Fates/user_nl_clm index 91df3e2e61..8bd9f01335 100644 --- a/cime_config/testdefs/testmods_dirs/clm/Fates/user_nl_clm +++ b/cime_config/testdefs/testmods_dirs/clm/Fates/user_nl_clm @@ -26,5 +26,4 @@ hist_fincl1 = 'FATES_NCOHORTS', 'FATES_TRIMMING', 'FATES_AREA_PLANTS', 'FATES_NEP', 'FATES_HET_RESP', 'FATES_FIRE_CLOSS', 'FATES_FIRE_FLUX_EL', 'FATES_CBALANCE_ERROR', 'FATES_ERROR_EL', 'FATES_LEAF_ALLOC', 'FATES_SEED_ALLOC', 'FATES_STEM_ALLOC', 'FATES_FROOT_ALLOC', -'FATES_CROOT_ALLOC', 'FATES_STORE_ALLOC', -'FATES_PATCHAREA_LU', 'FATES_DISTURBANCE_RATE_MATRIX_LULU' +'FATES_CROOT_ALLOC', 'FATES_STORE_ALLOC' diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2/user_nl_clm index e25490ffbb..6478669bee 100644 --- a/cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2/user_nl_clm +++ b/cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2/user_nl_clm @@ -7,3 +7,5 @@ use_fates_nocomp = .true. use_fates_fixed_biogeog = .true. use_fates_sp = .false. use_fates_potentialveg = .false. +hist_fincl1 = 'FATES_PATCHAREA_LU', 'FATES_DISTURBANCE_RATE_MATRIX_LULU', +'FATES_TRANSITIONS_MATRIX_LULU' From 38656f9c9904a312b041afaf9d15ed2e95f3838a Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 24 Jul 2024 11:49:01 -0600 Subject: [PATCH 0743/1248] Get LILAC test working --- bld/env_run.xml | 1 + python/ctsm/lilac_make_runtime_inputs.py | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/bld/env_run.xml b/bld/env_run.xml index f3b7467168..cd865ad82c 100644 --- a/bld/env_run.xml +++ b/bld/env_run.xml @@ -9,6 +9,7 @@ Sample env_run.xml file that allows build-namelist to be run for testing in this --> + diff --git a/python/ctsm/lilac_make_runtime_inputs.py b/python/ctsm/lilac_make_runtime_inputs.py index 71f3c9bbe4..33b87c543e 100644 --- a/python/ctsm/lilac_make_runtime_inputs.py +++ b/python/ctsm/lilac_make_runtime_inputs.py @@ -47,6 +47,12 @@ TRUE,FALSE + + + logical + TRUE,FALSE + + """ From 472891822d219c503dec159f991daa670ad7a10c Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Wed, 24 Jul 2024 10:51:31 -0700 Subject: [PATCH 0744/1248] update fates satellite phenology test coverage This moves one of the FatesColdSatPhen tests to a gnu compiler to provide compiler coverage for issues like #2656. This also adds an nvhpc compiler test to the fates test suite. --- cime_config/testdefs/testlist_clm.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index 59044feb10..dc335e03da 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -1998,6 +1998,7 @@ + @@ -3169,7 +3170,7 @@ - + From e438a907e1fa23934255a10dddcfee4601bcd20d Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 24 Jul 2024 12:14:39 -0600 Subject: [PATCH 0745/1248] Fix test number --- 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 198df535ad..1533e00d73 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 = 3311; +my $ntests = 3317; if ( defined($opts{'compare'}) ) { $ntests += 2052; From 71ca96d2d8e14fbbe9bc7686c2d905907b4d43d5 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Wed, 24 Jul 2024 15:29:29 -0600 Subject: [PATCH 0746/1248] Delete an unused ncd_log. --- src/biogeophys/TemperatureType.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/biogeophys/TemperatureType.F90 b/src/biogeophys/TemperatureType.F90 index bb579b8031..5ba64f9b1e 100644 --- a/src/biogeophys/TemperatureType.F90 +++ b/src/biogeophys/TemperatureType.F90 @@ -897,7 +897,7 @@ subroutine Restart(this, bounds, ncid, flag, is_simple_buildtemp, is_prog_buildt use shr_log_mod , only : errMsg => shr_log_errMsg use spmdMod , only : masterproc use abortutils , only : endrun - use ncdio_pio , only : file_desc_t, ncd_double, ncd_int, ncd_log + use ncdio_pio , only : file_desc_t, ncd_double, ncd_int use restUtilMod ! ! !ARGUMENTS: From ad2c7f3af389ad2b2b6464987a06d1200049a813 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Wed, 24 Jul 2024 15:30:31 -0600 Subject: [PATCH 0747/1248] Delete a troubleshooting log message. --- bld/CLMBuildNamelist.pm | 1 - 1 file changed, 1 deletion(-) diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index ad110b017e..5202717d74 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -4200,7 +4200,6 @@ sub setup_logic_cropcal_streams { my $gdd20_season_end_file = $nl->get_value('stream_fldFileName_gdd20_season_end') ; if ( &string_is_undef_or_empty($gdd20_season_start_file) or &string_is_undef_or_empty($gdd20_season_end_file) ) { $log->message($gdd20_season_start_file); - $log->message('abcd'); $log->message($gdd20_season_end_file); $log->fatal_error("If stream_gdd20_seasons is true, gdd20 season start and end files must be provided." ); } From 592476f7c6ae5751b6360c372ed70ad4f94af0c7 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Wed, 24 Jul 2024 15:34:29 -0600 Subject: [PATCH 0748/1248] Improve comments/error at "Handle invalid gdd20 season values." --- src/cpl/share_esmf/cropcalStreamMod.F90 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/cpl/share_esmf/cropcalStreamMod.F90 b/src/cpl/share_esmf/cropcalStreamMod.F90 index ef3bab03c5..d17ce1c259 100644 --- a/src/cpl/share_esmf/cropcalStreamMod.F90 +++ b/src/cpl/share_esmf/cropcalStreamMod.F90 @@ -793,9 +793,10 @@ subroutine cropcal_interp(bounds, num_pcropp, filter_pcropp, init, crop_inst) ! Handle invalid gdd20 season values if (any(gdd20_season_starts(begp:endp) < 1._r8 .or. gdd20_season_ends(begp:endp) < 1._r8)) then - ! Fail if not allowing fallback to paramfile sowing windows + ! Fail if not allowing fallback to paramfile sowing windows. Only need to check for + ! values < 1 because values outside [1, 366] are set to -1 above. if ((.not. allow_invalid_gdd20_season_inputs) .and. any(gdd20_season_starts(begp:endp) < 1._r8 .and. patch%wtgcell(begp:endp) > 0._r8 .and. patch%itype(begp:endp) >= npcropmin)) then - write(iulog, *) 'At least one crop in one gridcell has invalid gdd20 season start date(s). To ignore and fall back to paramfile sowing windows, set allow_invalid_gdd20_season_inputs to .true.' + write(iulog, *) 'At least one crop in one gridcell has invalid gdd20 season start and/or end date(s). To ignore and fall back to paramfile sowing windows for such crop-gridcells, set allow_invalid_gdd20_season_inputs to .true.' write(iulog, *) 'Affected crops:' do ivt = npcropmin, mxpft do fp = 1, num_pcropp From 013028c4687f564953ef5443e159b02f00220297 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Wed, 24 Jul 2024 15:35:49 -0600 Subject: [PATCH 0749/1248] Replace SSR with Sam Rabin. --- src/biogeochem/CNPhenologyMod.F90 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/biogeochem/CNPhenologyMod.F90 b/src/biogeochem/CNPhenologyMod.F90 index d1d3c85b21..159e688dbd 100644 --- a/src/biogeochem/CNPhenologyMod.F90 +++ b/src/biogeochem/CNPhenologyMod.F90 @@ -2699,7 +2699,7 @@ subroutine PlantCrop(p, leafcn_in, jday, kyr, do_plant_normal, & did_rx_gdds = .true. if (adapt_cropcal_rx_cultivar_gdds .and. crop_inst%gdd20_baseline_patch(p) > min_gdd20_baseline) then gddmaturity(p) = gddmaturity(p) * gdd20 / crop_inst%gdd20_baseline_patch(p) - !TODO SSR: Set maximum and minimum gddmaturity + !TODO Sam Rabin: Set maximum and minimum gddmaturity end if else if (ivt(p) == nwwheat .or. ivt(p) == nirrig_wwheat) then gddmaturity(p) = hybgdd(ivt(p)) @@ -2716,11 +2716,11 @@ subroutine PlantCrop(p, leafcn_in, jday, kyr, do_plant_normal, & ivt(p) == nmiscanthus .or. ivt(p) == nirrig_miscanthus .or. & ivt(p) == nswitchgrass .or. ivt(p) == nirrig_switchgrass) then gddmaturity(p) = max(950._r8, min(gdd20*0.85_r8, hybgdd(ivt(p)))) - if (do_plant_normal) then ! TODO SSR: Add ".and. .not. do_plant_prescribed"? + if (do_plant_normal) then ! TODO Sam Rabin: Add ".and. .not. do_plant_prescribed"? gddmaturity(p) = max(950._r8, min(gddmaturity(p)+150._r8, 1850._r8)) end if else - ! TODO SSR: Add more descriptive error message + ! TODO Sam Rabin: Add more descriptive error message call endrun(msg="Stopping") end if From 96c7c2d96cf39347cd6e259366f5d321971e75eb Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Wed, 24 Jul 2024 15:37:30 -0600 Subject: [PATCH 0750/1248] import_ds.py: Delete a commented-out line. --- python/ctsm/crop_calendars/import_ds.py | 1 - 1 file changed, 1 deletion(-) diff --git a/python/ctsm/crop_calendars/import_ds.py b/python/ctsm/crop_calendars/import_ds.py index 0526d3c720..486757492f 100644 --- a/python/ctsm/crop_calendars/import_ds.py +++ b/python/ctsm/crop_calendars/import_ds.py @@ -59,7 +59,6 @@ def manual_mfdataset(filelist, my_vars, my_vegtypes, time_slice): compat="override", coords="all", dim="time", - # combine="nested", ) return ds_out From 1d9e93989c656c91b44389a307bf07602727bcfd Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Wed, 24 Jul 2024 15:38:29 -0600 Subject: [PATCH 0751/1248] Improve a comment in run_sys_tests.py. --- python/ctsm/run_sys_tests.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/ctsm/run_sys_tests.py b/python/ctsm/run_sys_tests.py index 9961fd325d..b3a3b78379 100644 --- a/python/ctsm/run_sys_tests.py +++ b/python/ctsm/run_sys_tests.py @@ -736,7 +736,7 @@ def _check_py_env(test_attributes): # whether import is possible. # pylint: disable=import-error disable - # Check requirements for using modify_fsurdat, if needed + # Check requirements for using modify_fsurdat Python module, if needed modify_fsurdat_users = ["FSURDATMODIFYCTSM", "RXCROPMATURITY"] if any(any(u in t for u in modify_fsurdat_users) for t in test_attributes): try: From 78d9f98060c62ec486b32ef20dd2b14718d3c428 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Wed, 24 Jul 2024 15:40:49 -0600 Subject: [PATCH 0752/1248] Improve error messages in PlantCrop(). --- src/biogeochem/CNPhenologyMod.F90 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/biogeochem/CNPhenologyMod.F90 b/src/biogeochem/CNPhenologyMod.F90 index 159e688dbd..855a1476f8 100644 --- a/src/biogeochem/CNPhenologyMod.F90 +++ b/src/biogeochem/CNPhenologyMod.F90 @@ -2720,7 +2720,7 @@ subroutine PlantCrop(p, leafcn_in, jday, kyr, do_plant_normal, & gddmaturity(p) = max(950._r8, min(gddmaturity(p)+150._r8, 1850._r8)) end if else - ! TODO Sam Rabin: Add more descriptive error message + write(iulog, *) 'ERROR: PlantCrop(): unrecognized ivt for GDD target: ',ivt(p) call endrun(msg="Stopping") end if @@ -2729,7 +2729,7 @@ subroutine PlantCrop(p, leafcn_in, jday, kyr, do_plant_normal, & if (gddmaturity(p) < min_gddmaturity) then if (use_cropcal_rx_cultivar_gdds .or. generate_crop_gdds) then if (did_rx_gdds) then - write(iulog,*) 'Some patch with ivt ',ivt(p),' has rx gddmaturity',gddmaturity(p),'; using min_gddmaturity instead (',min_gddmaturity,')' + write(iulog,*) 'Some patch with ivt ',ivt(p),' has rx gddmaturity ',gddmaturity(p),'; using min_gddmaturity instead (',min_gddmaturity,')' end if gddmaturity(p) = min_gddmaturity else From d3e6cbf13c4347ad2e61bbd5841b1bb9a7363fb8 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Wed, 24 Jul 2024 15:41:54 -0600 Subject: [PATCH 0753/1248] CropType: Fix a comment. --- src/biogeochem/CropType.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/biogeochem/CropType.F90 b/src/biogeochem/CropType.F90 index 77da895135..0f650a4a9f 100644 --- a/src/biogeochem/CropType.F90 +++ b/src/biogeochem/CropType.F90 @@ -54,7 +54,7 @@ module CropType real(r8), pointer :: rx_cultivar_gdds_thisyr_patch (:,:) ! all cultivar GDD targets for this patch this year (ddays) [patch, mxsowings] real(r8), pointer :: gdd20_baseline_patch (:) ! GDD20 baseline for this patch (ddays) [patch] real(r8), pointer :: gdd20_season_start_patch(:) ! gdd20 season start date for this patch (day of year) [patch]. Real to enable history field. - real(r8), pointer :: gdd20_season_end_patch (:) ! gdd20 season end date for this patch (day of year) [patch]/ Real to enable history field. + real(r8), pointer :: gdd20_season_end_patch (:) ! gdd20 season end date for this patch (day of year) [patch]. Real to enable history field. real(r8), pointer :: sdates_thisyr_patch (:,:) ! all actual sowing dates for this patch this year (day of year) [patch, mxsowings] real(r8), pointer :: swindow_starts_thisyr_patch(:,:) ! all sowing window start dates for this patch this year (day of year) [patch, mxsowings] real(r8), pointer :: swindow_ends_thisyr_patch (:,:) ! all sowing window end dates for this patch this year (day of year) [patch, mxsowings] From 6546a681b92f736e460a106b33b4523b290f1cbc Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Wed, 24 Jul 2024 15:42:57 -0600 Subject: [PATCH 0754/1248] TemperatureType Restart(): Delete unused p. --- src/biogeophys/TemperatureType.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/biogeophys/TemperatureType.F90 b/src/biogeophys/TemperatureType.F90 index 5ba64f9b1e..787efa81a0 100644 --- a/src/biogeophys/TemperatureType.F90 +++ b/src/biogeophys/TemperatureType.F90 @@ -909,7 +909,7 @@ subroutine Restart(this, bounds, ncid, flag, is_simple_buildtemp, is_prog_buildt logical , intent(in) :: is_prog_buildtemp ! Prognostic building temp is being used ! ! !LOCAL VARIABLES: - integer :: j,c,p ! indices + integer :: j,c ! indices logical :: readvar ! determine if variable is on initial file integer :: idata !----------------------------------------------------------------------- From c96ce350ed85600c8525b655f3acbfd2f6831059 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Wed, 24 Jul 2024 15:49:19 -0600 Subject: [PATCH 0755/1248] Delete unused sowingWindows testmod. --- .../testmods_dirs/clm/sowingWindows/include_user_mods | 1 - .../testdefs/testmods_dirs/clm/sowingWindows/user_nl_clm | 5 ----- 2 files changed, 6 deletions(-) delete mode 100644 cime_config/testdefs/testmods_dirs/clm/sowingWindows/include_user_mods delete mode 100644 cime_config/testdefs/testmods_dirs/clm/sowingWindows/user_nl_clm diff --git a/cime_config/testdefs/testmods_dirs/clm/sowingWindows/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/sowingWindows/include_user_mods deleted file mode 100644 index fe0e18cf88..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/sowingWindows/include_user_mods +++ /dev/null @@ -1 +0,0 @@ -../default diff --git a/cime_config/testdefs/testmods_dirs/clm/sowingWindows/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/sowingWindows/user_nl_clm deleted file mode 100644 index 7024e99b96..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/sowingWindows/user_nl_clm +++ /dev/null @@ -1,5 +0,0 @@ -stream_fldFileName_swindow_start = '$DIN_LOC_ROOT/lnd/clm2/cropdata/calendars/processed/swindow_starts_ggcmi_crop_calendar_phase3_v1.01.2000-2000.20231005_145103.tweaked_latlons.nc' -stream_fldFileName_swindow_end = '$DIN_LOC_ROOT/lnd/clm2/cropdata/calendars/processed/swindow_ends_ggcmi_crop_calendar_phase3_v1.01.2000-2000.20231005_145103.tweaked_latlons.nc' -stream_meshfile_cropcal = '$DIN_LOC_ROOT/lnd/clm2/cropdata/calendars/processed/swindow_starts_ggcmi_crop_calendar_phase3_v1.01.2000-2000.20231005_145103.tweaked_latlons.nc' -stream_year_first_cropcal_swindows = 2000 -stream_year_last_cropcal_swindows = 2000 From b96ec9107fe8e5b02260689190cd79799f589938 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Wed, 24 Jul 2024 15:52:49 -0600 Subject: [PATCH 0756/1248] check_rxboth_run.py: Improve error message. --- python/ctsm/crop_calendars/check_rxboth_run.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/python/ctsm/crop_calendars/check_rxboth_run.py b/python/ctsm/crop_calendars/check_rxboth_run.py index a1014b5e66..fa4affd220 100644 --- a/python/ctsm/crop_calendars/check_rxboth_run.py +++ b/python/ctsm/crop_calendars/check_rxboth_run.py @@ -156,7 +156,16 @@ def main(argv): any_bad = any_bad or gdds_not_obeyed if any_bad: - raise RuntimeError("Unexpected behavior in rxboth run") + msg = "\n ".join( + [ + "Unexpected behavior in rxboth run:", + f"any_bad_import_output: {any_bad_import_output}", + f"any_bad_check_const_vars: {any_bad_check_const_vars}", + f"sdate_not_obeyed: {sdate_not_obeyed}", + f"gdds_not_obeyed: {gdds_not_obeyed}", + ] + ) + raise RuntimeError(msg) if __name__ == "__main__": From 876e23bb4fe4c6274e5f328212b4377ae1dd9c1d Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Wed, 24 Jul 2024 15:59:46 -0600 Subject: [PATCH 0757/1248] interpolate_gdds.py: Strict check for prefix match. --- python/ctsm/crop_calendars/interpolate_gdds.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/python/ctsm/crop_calendars/interpolate_gdds.py b/python/ctsm/crop_calendars/interpolate_gdds.py index 830df18c73..92bb112e3f 100755 --- a/python/ctsm/crop_calendars/interpolate_gdds.py +++ b/python/ctsm/crop_calendars/interpolate_gdds.py @@ -6,6 +6,7 @@ import sys import argparse import logging +import re import xarray as xr # -- add python/ctsm to path (needed if we want to run this stand-alone) @@ -121,7 +122,7 @@ def interpolate_gdds(args): if "lat" not in ds_in[var].dims and "lon" not in ds_in[var].dims: print(f"Skipping variable {var} with dimensions {ds_in[var].dims}") continue - elif args.variable_prefix not in var: + if not re.compile("^" + args.variable_prefix).match(var) print(f"Unexpected variable {var} on input file. Skipping.") continue if args.dry_run: From fecad299757de00f235217add67f70e60f7cda33 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Wed, 24 Jul 2024 16:06:22 -0600 Subject: [PATCH 0758/1248] Delete unneeded cropAnnOutputMonthly testmod. --- cime_config/testdefs/testlist_clm.xml | 4 ++-- .../testmods_dirs/clm/cropAnnOutputMonthly/user_nl_clm | 3 --- 2 files changed, 2 insertions(+), 5 deletions(-) delete mode 100644 cime_config/testdefs/testmods_dirs/clm/cropAnnOutputMonthly/user_nl_clm diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index c2926a25e7..e5a1ae7ef4 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -3794,7 +3794,7 @@ - + @@ -3803,7 +3803,7 @@ - + diff --git a/cime_config/testdefs/testmods_dirs/clm/cropAnnOutputMonthly/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/cropAnnOutputMonthly/user_nl_clm deleted file mode 100644 index 1c47a2ebd1..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/cropAnnOutputMonthly/user_nl_clm +++ /dev/null @@ -1,3 +0,0 @@ -! These variables SHOULD only be saved annually in real runs, but for testing purposes it's fine to have them monthly. -! Modifies h2 history file defined in crop testmod. -hist_nhtfrq(3) = 0 From c94aeeab68a6f98188f0f94127b3685d2c89dd49 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Wed, 24 Jul 2024 16:09:35 -0600 Subject: [PATCH 0759/1248] Add READMEs to testmods decStart and midDecStart. --- cime_config/testdefs/testmods_dirs/clm/decStart/README | 1 + cime_config/testdefs/testmods_dirs/clm/midDecStart/README | 1 + 2 files changed, 2 insertions(+) create mode 100644 cime_config/testdefs/testmods_dirs/clm/decStart/README create mode 100644 cime_config/testdefs/testmods_dirs/clm/midDecStart/README diff --git a/cime_config/testdefs/testmods_dirs/clm/decStart/README b/cime_config/testdefs/testmods_dirs/clm/decStart/README new file mode 100644 index 0000000000..7cdab6abfd --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/decStart/README @@ -0,0 +1 @@ +Use midDecStart instead of decStart if you want ERP/ERS/etc. tests longer than 2 days to be able to have the split in December instead of January (i.e., before rather than after new year). \ No newline at end of file diff --git a/cime_config/testdefs/testmods_dirs/clm/midDecStart/README b/cime_config/testdefs/testmods_dirs/clm/midDecStart/README new file mode 100644 index 0000000000..7cdab6abfd --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/midDecStart/README @@ -0,0 +1 @@ +Use midDecStart instead of decStart if you want ERP/ERS/etc. tests longer than 2 days to be able to have the split in December instead of January (i.e., before rather than after new year). \ No newline at end of file From 833d4f67e888c747cfb2c35d8ae8354974987061 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Wed, 24 Jul 2024 16:11:48 -0600 Subject: [PATCH 0760/1248] import_output(): Bugfix in call of check_v0_le_v1(). --- python/ctsm/crop_calendars/cropcal_module.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/ctsm/crop_calendars/cropcal_module.py b/python/ctsm/crop_calendars/cropcal_module.py index 08754f8823..927bdc9100 100644 --- a/python/ctsm/crop_calendars/cropcal_module.py +++ b/python/ctsm/crop_calendars/cropcal_module.py @@ -425,7 +425,7 @@ def import_output( # Check that e.g., GDDACCUM <= HUI for var_list in [["GDDACCUM", "HUI"], ["SYEARS", "HYEARS"]]: if all(v in this_ds_gs for v in var_list): - any_bad = check_v0_le_v1( + any_bad = any_bad or check_v0_le_v1( this_ds_gs, var_list, both_nan_ok=True, throw_error=throw_errors ) From 7303c61744bddaeee8e47af561e9ef6e841bd503 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Wed, 24 Jul 2024 16:13:51 -0600 Subject: [PATCH 0761/1248] CTSM5.3 updates to the mksurfdata_esmf namelist --- .../ctsm/toolchain/gen_mksurfdata_namelist.py | 39 ++++++------- .../gen_mksurfdata_namelist.xml | 57 +++++++++++-------- 2 files changed, 53 insertions(+), 43 deletions(-) diff --git a/python/ctsm/toolchain/gen_mksurfdata_namelist.py b/python/ctsm/toolchain/gen_mksurfdata_namelist.py index 361616419f..b0c2016ccb 100755 --- a/python/ctsm/toolchain/gen_mksurfdata_namelist.py +++ b/python/ctsm/toolchain/gen_mksurfdata_namelist.py @@ -463,16 +463,16 @@ def check_ssp_years(start_year, end_year): """ Check years associated with SSP period """ - if int(start_year) > 2015: + if int(start_year) > 2022: error_msg = ( - "ERROR: if start-year > 2015 must add an --ssp_rcp " + "ERROR: if start-year > 2022 must add an --ssp_rcp " "argument that is not none: valid opts for ssp-rcp " f"are {valid_opts}" ) sys.exit(error_msg) - elif int(end_year) > 2015: + elif int(end_year) > 2022: error_msg = ( - "ERROR: if end-year > 2015 must add an --ssp-rcp " + "ERROR: if end-year > 2022 must add an --ssp-rcp " "argument that is not none: valid opts for ssp-rcp " f"are {valid_opts}" ) @@ -537,6 +537,8 @@ def determine_pft_years(start_year, end_year, potveg): pft_years_ssp = "-999" if potveg: pft_years = "PtVg" + elif int(start_year) == 1700 and int(end_year) == 1700: + pft_years = "1700" elif int(start_year) == 1850 and int(end_year) == 1850: pft_years = "1850" elif int(start_year) == 2000 and int(end_year) == 2000: @@ -545,21 +547,21 @@ def determine_pft_years(start_year, end_year, potveg): pft_years = "2005" elif int(start_year) >= 850 and int(end_year) <= 1849: pft_years = "0850-1849" - elif int(start_year) >= 1850 and int(start_year) <= 2100 and int(end_year) <= 2015: - pft_years = "1850-2015" - elif int(start_year) >= 1850 and int(start_year) <= 2100 and int(end_year) <= 2100: - pft_years = "1850-2015" - pft_years_ssp = "2016-2100" - elif int(start_year) >= 2016 and int(start_year) <= 2100 and int(end_year) <= 2100: + elif int(start_year) >= 1700 and int(start_year) <= 2100 and int(end_year) <= 2022: + pft_years = "1700-2022" + elif int(start_year) >= 1700 and int(start_year) <= 2100 and int(end_year) <= 2100: + pft_years = "1700-2022" + pft_years_ssp = "2023-2100" + elif int(start_year) >= 2023 and int(start_year) <= 2100 and int(end_year) <= 2100: pft_years = "-999" - pft_years_ssp = "2016-2100" + pft_years_ssp = "2023-2100" else: error_msg = ( f"ERROR: start_year is {start_year} and end_year is " f"{end_year}; expected start/end-year options are: " - "- 1850, 2000, 2005 for time-slice options " + "- 1700, 1850, 2000, 2005 for time-slice options " "- in the range from 850 to 1849 " - "- in the range from 1850 to 2100 " + "- in the range from 1700 to 2100 " "- TODO in the range from 2101 to 2300 " "- OR user must set the potveg_flag " ) @@ -645,7 +647,7 @@ def write_nml_rawinput( # write everything else nlfile.write(f" {key} = '{value}' \n") - if start_year <= 2015: + if start_year <= 2022: mksrf_fvegtyp = rawdata_files["mksrf_fvegtyp"] mksrf_fvegtyp_mesh = rawdata_files["mksrf_fvegtyp_mesh"] mksrf_fhrvtyp = rawdata_files["mksrf_fvegtyp"] @@ -714,7 +716,7 @@ def handle_transient_run( with open(landuse_fname, "w", encoding="utf-8") as landuse_file: for year in range(start_year, end_year + 1): year_str = str(year) - if year <= 2015: + if year <= 2022: file1 = rawdata_files["mksrf_fvegtyp"] file2 = rawdata_files["mksrf_fvegtyp_urban"] file3 = rawdata_files["mksrf_fvegtyp_lake"] @@ -832,16 +834,15 @@ def determine_input_rawdata(start_year, input_path, attribute_list): max_match_child = child2 if max_match_child is None: - # TODO slevis: Are these if-statements backwards? - # For years greater than 2015 - mksrf_fvegtyp_ssp must have a match - if start_year <= 2015: + # For years greater than 2022 - mksrf_fvegtyp_ssp must have a match + if start_year > 2022: if "mksrf_fvegtyp_ssp" not in child1.tag: error_msg = f"ERROR: {child1.tag} has no matches" sys.exit(error_msg) else: continue else: - # For years less than 2015 - mksrf_fvegtyp must have a match + # For years less than 2023 - mksrf_fvegtyp must have a match if "mksrf_fvegtyp" not in child1.tag: error_msg = f"ERROR: {child1.tag} has no matches" sys.exit(error_msg) diff --git a/tools/mksurfdata_esmf/gen_mksurfdata_namelist.xml b/tools/mksurfdata_esmf/gen_mksurfdata_namelist.xml index f4318880ea..e90949741d 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/CTSM52RawData/globalctsm52histMKSRFDeg025_231228/mksrf_landuse_ctsm52_pftlai_CLIM.c231228.nc + /glade/campaign/cesm/development/lmwg/landuse_source_data/CTSM53RawData/globalctsm53histMKSRFDeg025_240709/mksrf_landuse_ctsm53_pftlai_CLIM.c240709.nc lnd/clm2/mappingdata/grids/UNSTRUCTgrid_0.25x0.25_nomask_cdf5_c200129.nc @@ -25,7 +25,7 @@ - /glade/campaign/cesm/development/lmwg/landuse_source_data/CTSM52RawData/globalctsm52histMKSRFDeg025_231228/mksrf_landuse_ctsm52_soilcolor_CLIM.c231228.nc + /glade/campaign/cesm/development/lmwg/landuse_source_data/CTSM53RawData/globalctsm53histMKSRFDeg025_240709/mksrf_landuse_ctsm53_soilcolor_CLIM.c240709.nc lnd/clm2/mappingdata/grids/UNSTRUCTgrid_0.25x0.25_nomask_cdf5_c200129.nc @@ -212,7 +212,7 @@ version of the raw dataset will probably go away. - + lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.noanthro.c20230226/mksrf_landuse_ctsm52_noanthroLUH2_1.c20230226.nc lnd/clm2/mappingdata/grids/UNSTRUCTgrid_0.25x0.25_nomask_cdf5_c200129.nc @@ -220,22 +220,29 @@ version of the raw dataset will probably go away. lnd/clm2/rawdata/mksrf_urban_0.05x0.05_zerourbanpct.cdf5.c181014.nc + + /glade/campaign/cesm/development/lmwg/landuse_source_data/CTSM53RawData/globalctsm53histTRENDY2023Deg025_240709/mksrf_landuse_ctsm53_histTRENDY2023_1700.c240709.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/gao_oneill_urban/historical/urban_properties_GaoOneil_05deg_ThreeClass_1850_cdf5_c20220910.nc + + - /glade/campaign/cesm/development/lmwg/landuse_source_data/CTSM52RawData/globalctsm52histLUH2Deg025_231228/mksrf_landuse_ctsm52_histLUH2_1850.c231228.nc + /glade/campaign/cesm/development/lmwg/landuse_source_data/CTSM53RawData/globalctsm53histTRENDY2023Deg025_240709/mksrf_landuse_ctsm53_histTRENDY2023_1850.c240709.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/gao_oneill_urban/historical/urban_properties_GaoOneil_05deg_ThreeClass_1850_cdf5_c20220910.nc - /glade/campaign/cesm/development/lmwg/landuse_source_data/CTSM52RawData/globalctsm52histLUH2Deg025_231228/mksrf_landuse_ctsm52_histLUH2_2000.c231228.nc + /glade/campaign/cesm/development/lmwg/landuse_source_data/CTSM53RawData/globalctsm53histTRENDY2023Deg025_240709/mksrf_landuse_ctsm53_histTRENDY2023_2000.c240709.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/gao_oneill_urban/historical/urban_properties_GaoOneil_05deg_ThreeClass_2000_cdf5_c20220910.nc - lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr1850-2015.c20230226/mksrf_landuse_ctsm52_histLUH2_2005.c20230226.nc + /glade/campaign/cesm/development/lmwg/landuse_source_data/CTSM53RawData/globalctsm53histTRENDY2023Deg025_240709/mksrf_landuse_ctsm53_histTRENDY2023_2005.c240709.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/gao_oneill_urban/historical/urban_properties_GaoOneil_05deg_ThreeClass_2005_cdf5_c20220910.nc @@ -256,9 +263,10 @@ version of the raw dataset will probably go away. lnd/clm2/rawdata/gao_oneill_urban/historical/urban_properties_GaoOneil_05deg_ThreeClass_1850_cdf5_c20220910.nc - - - /glade/campaign/cesm/development/lmwg/landuse_source_data/CTSM52RawData/globalctsm52histLUH2Deg025_231228/mksrf_landuse_ctsm52_histLUH2_%y.c231228.nc + + + + /glade/campaign/cesm/development/lmwg/landuse_source_data/CTSM53RawData/globalctsm53histTRENDY2023Deg025_240709/mksrf_landuse_ctsm53_histTRENDY2023_%y.c240709.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/historical/urban_properties_GaoOneil_05deg_ThreeClass_%y_cdf5_c20220910.nc @@ -268,11 +276,12 @@ version of the raw dataset will probably go away. + - - - /glade/campaign/cesm/development/lmwg/landuse_source_data/CTSM52RawData/globalctsm52SSP126Deg025_231228/mksrf_landuse_ctsm52_SSP126_%y.c231228.nc + + + /glade/campaign/cesm/development/lmwg/landuse_source_data/CTSM53RawData/globalctsm53TRSSP126Deg025_240717/mksrf_landuse_ctsm53_TRSSP126_%y.c240717.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 @@ -284,43 +293,43 @@ version of the raw dataset will probably go away. lnd/clm2/rawdata/gao_oneill_urban/ssp1/urban_properties_GaoOneil_05deg_ThreeClass_ssp1_2100_cdf5_c20220910.nc - - /glade/campaign/cesm/development/lmwg/landuse_source_data/CTSM52RawData/globalctsm52SSP119Deg025_231228/mksrf_landuse_ctsm52_SSP119_%y.c231228.nc + + /glade/campaign/cesm/development/lmwg/landuse_source_data/CTSM53RawData/globalctsm53TRSSP119Deg025_240717/mksrf_landuse_ctsm53_TRSSP119_%y.c240717.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/development/lmwg/landuse_source_data/CTSM52RawData/globalctsm52SSP245Deg025_231228/mksrf_landuse_ctsm52_SSP245_%y.c231228.nc + + /glade/campaign/cesm/development/lmwg/landuse_source_data/CTSM53RawData/globalctsm53TRSSP245Deg025_240717/mksrf_landuse_ctsm53_TRSSP245_%y.c240717.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/development/lmwg/landuse_source_data/CTSM52RawData/globalctsm52SSP370Deg025_231228/mksrf_landuse_ctsm52_SSP370_2100.c231228.nc + + /glade/campaign/cesm/development/lmwg/landuse_source_data/CTSM53RawData/globalctsm53TRSSP370Deg025_240717/mksrf_landuse_ctsm53_TRSSP370_%y.c240717.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 - + lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-3.4.simyr2015-2100.c20230226/mksrf_landuse_ctsm52_SSP4-3.4_%y.c20230226.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/development/lmwg/landuse_source_data/CTSM52RawData/globalctsm52SSP460Deg025_231228/mksrf_landuse_ctsm52_SSP460_%y.c231228.nc + + /glade/campaign/cesm/development/lmwg/landuse_source_data/CTSM53RawData/globalctsm53TRSSP460Deg025_240717/mksrf_landuse_ctsm53_TRSSP460_%y.c240717.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/development/lmwg/landuse_source_data/CTSM52RawData/globalctsm52SSP585Deg025_231228/mksrf_landuse_ctsm52_SSP585_%y.c231228.nc + + /glade/campaign/cesm/development/lmwg/landuse_source_data/CTSM53RawData/globalctsm53TRSSP585Deg025_240717/mksrf_landuse_ctsm53_TRSSP585_%y.c240717.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 @@ -332,7 +341,7 @@ version of the raw dataset will probably go away. lnd/clm2/rawdata/gao_oneill_urban/ssp5/urban_properties_GaoOneil_05deg_ThreeClass_ssp5_2100_cdf5_c20220910.nc - + lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-3.4.simyr2015-2100.c20230226/mksrf_landuse_ctsm52_SSP5-3.4_%y.c20230226.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 From 56523e4cbb4969e9648adb2601c40d847cb9d408 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Wed, 24 Jul 2024 16:15:28 -0600 Subject: [PATCH 0762/1248] Remove 1-degree RXCROPMATURITY test from rxcropmaturity, crop_calendars suites. --- cime_config/testdefs/testlist_clm.xml | 2 -- 1 file changed, 2 deletions(-) diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index e5a1ae7ef4..5d3fbeb11a 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -3663,8 +3663,6 @@ - - From d06e8642a180190fea9f31c0a6af042758c31b81 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Wed, 24 Jul 2024 16:18:38 -0600 Subject: [PATCH 0763/1248] Remove unneeded RxCropCalsAdaptFlush testmod. --- .../testmods_dirs/clm/RxCropCalsAdaptFlush/include_user_mods | 1 - .../testdefs/testmods_dirs/clm/RxCropCalsAdaptFlush/user_nl_clm | 2 -- 2 files changed, 3 deletions(-) delete mode 100644 cime_config/testdefs/testmods_dirs/clm/RxCropCalsAdaptFlush/include_user_mods delete mode 100644 cime_config/testdefs/testmods_dirs/clm/RxCropCalsAdaptFlush/user_nl_clm diff --git a/cime_config/testdefs/testmods_dirs/clm/RxCropCalsAdaptFlush/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/RxCropCalsAdaptFlush/include_user_mods deleted file mode 100644 index af5fe8591e..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/RxCropCalsAdaptFlush/include_user_mods +++ /dev/null @@ -1 +0,0 @@ -../RxCropCalsAdapt diff --git a/cime_config/testdefs/testmods_dirs/clm/RxCropCalsAdaptFlush/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/RxCropCalsAdaptFlush/user_nl_clm deleted file mode 100644 index 4c6af0f6d2..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/RxCropCalsAdaptFlush/user_nl_clm +++ /dev/null @@ -1,2 +0,0 @@ - -flush_gdd20 = .true. From a2bf12483a8fd1f33488b6df09ffe2b291aa2f43 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Wed, 24 Jul 2024 16:21:18 -0600 Subject: [PATCH 0764/1248] generate_gdd20_baseline.py: Add a clarifying comment. --- python/ctsm/crop_calendars/generate_gdd20_baseline.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/python/ctsm/crop_calendars/generate_gdd20_baseline.py b/python/ctsm/crop_calendars/generate_gdd20_baseline.py index 06d3a9cd21..13668fc850 100644 --- a/python/ctsm/crop_calendars/generate_gdd20_baseline.py +++ b/python/ctsm/crop_calendars/generate_gdd20_baseline.py @@ -284,8 +284,7 @@ def generate_gdd20_baseline(input_files, output_file, author, time_slice, variab this_da = dummy_da print(" dummy GDD20") else: - # this_da = ds_in[gddn].fillna(MISSING_FILL) - this_da = ds_in[gddn_str] + this_da = ds_in[gddn_str] # Already did ds_in.mean(dim="time") above this_da = _add_time_axis(this_da) print(f" {gddn_str}") this_da = this_da.fillna(MISSING_RX_GDD_VAL) From c9ff0ee33410b82462fbf4fc876b4130811e13cc Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Wed, 24 Jul 2024 16:24:14 -0600 Subject: [PATCH 0765/1248] PlantCrop(): Resolve (dismiss) a TODO. --- src/biogeochem/CNPhenologyMod.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/biogeochem/CNPhenologyMod.F90 b/src/biogeochem/CNPhenologyMod.F90 index 855a1476f8..1fb13d32eb 100644 --- a/src/biogeochem/CNPhenologyMod.F90 +++ b/src/biogeochem/CNPhenologyMod.F90 @@ -2716,7 +2716,7 @@ subroutine PlantCrop(p, leafcn_in, jday, kyr, do_plant_normal, & ivt(p) == nmiscanthus .or. ivt(p) == nirrig_miscanthus .or. & ivt(p) == nswitchgrass .or. ivt(p) == nirrig_switchgrass) then gddmaturity(p) = max(950._r8, min(gdd20*0.85_r8, hybgdd(ivt(p)))) - if (do_plant_normal) then ! TODO Sam Rabin: Add ".and. .not. do_plant_prescribed"? + if (do_plant_normal) then gddmaturity(p) = max(950._r8, min(gddmaturity(p)+150._r8, 1850._r8)) end if else From 6e0533749a45d8a845e3d0c37b81e9b3ea2da40c Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Wed, 24 Jul 2024 16:38:46 -0600 Subject: [PATCH 0766/1248] Remove obsolete comment --- 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 e90949741d..7a31a94510 100644 --- a/tools/mksurfdata_esmf/gen_mksurfdata_namelist.xml +++ b/tools/mksurfdata_esmf/gen_mksurfdata_namelist.xml @@ -279,7 +279,7 @@ version of the raw dataset will probably go away. - + /glade/campaign/cesm/development/lmwg/landuse_source_data/CTSM53RawData/globalctsm53TRSSP126Deg025_240717/mksrf_landuse_ctsm53_TRSSP126_%y.c240717.nc lnd/clm2/mappingdata/grids/UNSTRUCTgrid_0.25x0.25_nomask_cdf5_c200129.nc From bc055919bd68719b53d6563d1f7a37976ec11c44 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Wed, 24 Jul 2024 16:47:49 -0600 Subject: [PATCH 0767/1248] Improve flush_gdd20 restart logic. Previously, TemperatureType%flush_gdd20 would get set to true upon restart unless it was read and false. This change makes it so that: - If TemperatureType%flush_gdd20 isn't read from the restart file, it falls back to the flush_gdd20 from clm_varctl. - If TemperatureType%flush_gdd20 IS read from the restart file, it is set to true if it's true on the restart file OR if the flush_gdd20 from clm_varctl is true. --- src/biogeophys/TemperatureType.F90 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/biogeophys/TemperatureType.F90 b/src/biogeophys/TemperatureType.F90 index 787efa81a0..98f6d0f638 100644 --- a/src/biogeophys/TemperatureType.F90 +++ b/src/biogeophys/TemperatureType.F90 @@ -1148,10 +1148,10 @@ subroutine Restart(this, bounds, ncid, flag, is_simple_buildtemp, is_prog_buildt long_name='Flag indicating that GDD20 values need to be flushed', & units='none', interpinic_flag='copy', readvar=readvar, data=idata) if (flag == 'read') then - if (readvar .and. idata == 0) then - this%flush_gdd20 = .false. + if (readvar) then + this%flush_gdd20 = flush_gdd20 .or. idata == 1 else - this%flush_gdd20 = .true. + this%flush_gdd20 = flush_gdd20 end if end if end if From d298aef9438d0b13bf37ccd162e1f5a303f6e4b4 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Wed, 24 Jul 2024 16:53:54 -0600 Subject: [PATCH 0768/1248] Do not use flush_gdd20 from clm_varctl in flush decision. Not directly, at least. Instead, rely on TemperatureType%flush_gdd20 having been set correctly. --- src/biogeophys/TemperatureType.F90 | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/biogeophys/TemperatureType.F90 b/src/biogeophys/TemperatureType.F90 index 98f6d0f638..4929b24307 100644 --- a/src/biogeophys/TemperatureType.F90 +++ b/src/biogeophys/TemperatureType.F90 @@ -169,6 +169,9 @@ subroutine Init(this, bounds, & em_perroad_lun(bounds%begl:bounds%endl), & is_simple_buildtemp, is_prog_buildtemp) + ! Finish up + this%flush_gdd20 = flush_gdd20 + end subroutine Init !------------------------------------------------------------------------ @@ -1693,13 +1696,13 @@ subroutine UpdateAccVars (this, bounds, crop_inst) ! Accumulate and extract running 20-year means if (is_end_curr_year()) then ! Flush, if needed - if (flush_gdd20 .or. this%flush_gdd20) then + if (this%flush_gdd20) then write(iulog, *) 'Flushing GDD20 variables' call markreset_accum_field('GDD020') call markreset_accum_field('GDD820') call markreset_accum_field('GDD1020') this%flush_gdd20 = .false. - flush_gdd20 = .false. + flush_gdd20 = .false. ! Shouldn't be necessary, because flush_gdd20 shouldn't be considered after Init and Restart. But just in case... end if call update_accum_field ('GDD020', this%gdd0_patch, nstep) call extract_accum_field ('GDD020', this%gdd020_patch, nstep) From 21ec2bae64581024dce26a7e6406852d71f34258 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 24 Jul 2024 17:31:58 -0600 Subject: [PATCH 0769/1248] Remove commented out lines make sure reproduces results for aux_clm on Derecho --- src/biogeochem/DUSTMod.F90 | 7 +------ src/biogeophys/SoilStateInitTimeConstMod.F90 | 9 ++++----- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/src/biogeochem/DUSTMod.F90 b/src/biogeochem/DUSTMod.F90 index bf04311cbe..3831f4d430 100644 --- a/src/biogeochem/DUSTMod.F90 +++ b/src/biogeochem/DUSTMod.F90 @@ -714,9 +714,8 @@ subroutine DustEmission (bounds, & frc_thr_rghn_fct(p) = frc_thr_rgh_fct ! save and output hybrid drag partition factor else ! for lnd_frc_mbl=0, do not change friction velocity and assume drag partition factor = 0 - !wnd_frc_slt = fv(p) ! The value here is not important since once lnd_frc_mbl(p) <= 0.0_r8 there will be no emission. - frc_thr_rghn_fct(p) = 0.0_r8 ! When LAI > 1, the drag partition effect is zero. dmleung 16 Feb 2024. wnd_frc_slt = fv(p) * frc_thr_rghn_fct(p) ! The value here is not important since once lnd_frc_mbl(p) <= 0.0_r8 there will be no emission. dmleung added 5 Jul 2024 + frc_thr_rghn_fct(p) = 0.0_r8 ! When LAI > 1, the drag partition effect is zero. dmleung 16 Feb 2024. end if !########## end of drag partition effect ####################################################### @@ -741,13 +740,9 @@ subroutine DustEmission (bounds, & if (wnd_frc_slt > wnd_frc_thr_slt_it) then! if using Leung's scheme, use impact threshold for dust emission equation; if Zender, uses fluid threshold (wnd_frc_thr_slt) for dust emission equation !################### for Leung et al. (2023) ################################################ - !################ uncomment the below block if want to use Leung's scheme ################### - - !flx_mss_vrt_dst_ttl(p) = dst_emiss_coeff(p) * mss_frc_cly_vld(c) * forc_rho(c) * ((wnd_frc_slt**2.0_r8 - wnd_frc_thr_slt_it**2.0_r8) / wnd_frc_thr_slt_std) * (wnd_frc_slt / wnd_frc_thr_slt_it)**frag_expt ! Leung et al. (2022) uses Kok et al. (2014) dust emission euqation for emission flux ! dmleung: instead of using mss_frc_cly_vld(c) with a range of [0,0.2] , which makes dust too sensitive to input clay surface dataset), for now use 0.1 + mss_frc_cly_vld(c) * 0.1 / 0.20 with a range of [0.1,0.2]. So, instead of scaling dust emission to 1/20 times for El Djouf (western Sahara) because of its 1 % clay fraction, scale its emission to 1/2 times. This reduces the sensitivity of dust emission to the clay input dataset. In particular, because dust emission is a small-scale process and the grid-averaged clay from the new WISE surface dataset over El Djouf is 1 %, much lower than the former FAO estimation of 5 %, dmleung is not sure if the clay value of 1 % suppresses too much of El Djouf's small-scale dust emission process. Similar to Charlie Zender's feeling suspicious about the soil texture datasets (or the dust emission schemes' sandblasting process), dmleung feels the same and for now decides to still allow dust emission to weakly scale with clay fraction, however limiting the scaling factor to 0.1-0.2. See modification in SoilStateInitTimeConst.F90. dmleung 5 Jul 2024 flx_mss_vrt_dst_ttl(p) = dst_emiss_coeff(p) * mss_frc_cly_vld(c) * forc_rho(c) * ((wnd_frc_slt**2.0_r8 - wnd_frc_thr_slt_it**2.0_r8) / wnd_frc_thr_slt_it) * (wnd_frc_slt / wnd_frc_thr_slt_it)**frag_expt ! Leung et al. (2022) uses Kok et al. (2014) dust emission euqation for emission flux - !flx_mss_vrt_dst_ttl(p) = dst_emiss_coeff(p) * ( 0.1_r8 + mss_frc_cly_vld(c) * 0.1_r8 / 0.20_r8 ) * forc_rho(c) * ((wnd_frc_slt**2.0_r8 - wnd_frc_thr_slt_it**2.0_r8) / wnd_frc_thr_slt_it) * (wnd_frc_slt / wnd_frc_thr_slt_it)**frag_expt ! account for bare soil fraction, frozen soil fraction, and apply global tuning parameter (Kok et al. 2014) flx_mss_vrt_dst_ttl(p) = flx_mss_vrt_dst_ttl(p) * lnd_frc_mbl(p) * C_tune * liqfrac diff --git a/src/biogeophys/SoilStateInitTimeConstMod.F90 b/src/biogeophys/SoilStateInitTimeConstMod.F90 index b22ea2278a..74148d1b08 100644 --- a/src/biogeophys/SoilStateInitTimeConstMod.F90 +++ b/src/biogeophys/SoilStateInitTimeConstMod.F90 @@ -696,9 +696,9 @@ subroutine SoilStateInitTimeConst(bounds, soilstate_inst, nlfilename) end do ! -------------------------------------------------------------------- - ! Initialize threshold soil moisture, and mass fraction of clay as + ! Initialize threshold soil moisture, and mass fraction of clay as ! scaling coefficient of dust emission flux (kg/m2/s) in DUSTMod.F90 - ! dmleung modified 5 Jul 2024, reducing sensitivity of dust emission + ! dmleung modified 5 Jul 2024, reducing sensitivity of dust emission ! flux to clay fraction. ! Also, for threshold soil moisture, dmleung followed Zender (2003) ! DEAD scheme to again avoid dust flux being too sensitive to the choice @@ -713,10 +713,9 @@ subroutine SoilStateInitTimeConst(bounds, soilstate_inst, nlfilename) ! dmleung++ added 24 May 2024: The below calculates the threshold gravimetric water content for the dust emission calculation in DUSTMod.F90. The equation comes from Eq. 14 of Fecan et al. (1999; https://doi.org/10.1007/s00585-999-0149-7). - !gwc_thr_col = 0.17*clay3d + 0.0014*(clay3d**2), and we only concern the topmost soil layer. + !gwc_thr_col = 0.17*clay3d + 0.0014*(clay3d**2), and we only concern the topmost soil layer. ! Charlie Zender later on added a tuning factor (a) such that the equation becomes gwc_thr_col = a*[0.17*clay3d + 0.0014*(clay3d**2)]. (Zender et al., 2003a; https://doi.org/10.1029/2002JD002775) - ! There are different options: E.g., a = 1 gives the first line below. E.g., Kok et al. (2014a, b) chose to use a = 1. A second choice is proposed by Charlie Zender (2003a): a = 1/clay3d, which gives the second line below. - !soilstate_inst%gwc_thr_col(c) = 0.01_r8*(0.17_r8*clay3d(g,1) + 0.0014_r8*clay3d(g,1)*clay3d(g,1)) ! Jasper Kok et al. (2014) modified the equation of soil moisture effect for dust emissions using a tuning factor of a = 1. 0.01 is to convert the threshold gravimetric soil moisture from % to fraction. Danny M. Leung et al. (2023) followed K14 and used this equation for offline dust emission calculations using MERRA-2 met fields. Later, Leung et al. (2024) changed to a = 2 for CESM2 simulations. However, Danny Leung later (Dec 2023) decided to revert to Zender's choice and use a = 1 / (clay3d), which overall encourages more dust emissions from seriamid and more marginal dust sources. This note should probably be on the CLM tech note since dmleung has made a different decision for CESM than his own paper. dmleung added this detailed comment on 19 Feb 2024; edited 24 May 2024. + ! There are different options: E.g., a = 1 gives the first line below. E.g., Kok et al. (2014a, b) chose to use a = 1. A second choice is proposed by Charlie Zender (2003a): a = 1/clay3d, which gives the second line below. soilstate_inst%gwc_thr_col(c) = 0.17_r8 + 0.14_r8 * clay3d(g,1) * 0.01_r8 ! This was the original equation with a = 1 / (%clay) being the tuning factor for soil moisture effect in Zender's dust emission scheme. Danny M. Leung decided (Dec, 2023) that the Leung et al. (2023) dust emission scheme in the CESM will use Zender's tuning of a = 1 / (%clay), which overall encourages more dust emissions from seriamid and more marginal dust sources. Another advantage of using this tuning factor instead of a = 1 is that the dust emission threshold is linearly dependent on the clay fraction instead of parabolically dependent on clay fraction as in the above line. This means that dust emission becomes a little less sensitive to clay content (soil texture). 0.17 and 0.14 are fitting coefficients in Fecan et al. (1999), and 0.01 is used to convert surface clay fraction from percentage to fraction. dmleung added this detailed comment on 19 Feb 2024. ! dust emission scaling factor dependent on clay fraction From 827632e12b1f55253c8c75b999f4d8abd6f87b7a Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Wed, 24 Jul 2024 18:08:09 -0600 Subject: [PATCH 0770/1248] Actually don't use TemperatureType%flush_gdd20 at all. Having that alongside flush_gdd20 from clm_varctl means that they can disagree when restarting, and it's not obvious which should win. Note that the user being able to request a flush at all is dangerous. If they start a run with it true, they might continue that run without setting it to false. Instead, the restart decision should be made by the model---if a gridcell has different prescribed gdd20 season from what its restart file says, then that gridcell should be flushed. --- src/biogeophys/TemperatureType.F90 | 29 ++--------------------------- 1 file changed, 2 insertions(+), 27 deletions(-) diff --git a/src/biogeophys/TemperatureType.F90 b/src/biogeophys/TemperatureType.F90 index 4929b24307..71722d84fb 100644 --- a/src/biogeophys/TemperatureType.F90 +++ b/src/biogeophys/TemperatureType.F90 @@ -95,7 +95,6 @@ module TemperatureType real(r8), pointer :: gdd020_patch (:) ! patch 20-year average of gdd0 (ddays) real(r8), pointer :: gdd820_patch (:) ! patch 20-year average of gdd8 (ddays) real(r8), pointer :: gdd1020_patch (:) ! patch 20-year average of gdd10 (ddays) - logical :: flush_gdd20 = .false. ! whether accumulated GDD20s need to be flushed ! Heat content real(r8), pointer :: beta_col (:) ! coefficient of convective velocity [-] @@ -169,9 +168,6 @@ subroutine Init(this, bounds, & em_perroad_lun(bounds%begl:bounds%endl), & is_simple_buildtemp, is_prog_buildtemp) - ! Finish up - this%flush_gdd20 = flush_gdd20 - end subroutine Init !------------------------------------------------------------------------ @@ -1139,26 +1135,6 @@ subroutine Restart(this, bounds, ncid, flag, is_simple_buildtemp, is_prog_buildt end if end if - if (use_crop) then - if (flag == 'write') then - if (this%flush_gdd20) then - idata = 1 - else - idata = 0 - end if - end if - call restartvar(ncid=ncid, flag=flag, varname='flush_gdd20', xtype=ncd_int, & - long_name='Flag indicating that GDD20 values need to be flushed', & - units='none', interpinic_flag='copy', readvar=readvar, data=idata) - if (flag == 'read') then - if (readvar) then - this%flush_gdd20 = flush_gdd20 .or. idata == 1 - else - this%flush_gdd20 = flush_gdd20 - end if - end if - end if - end subroutine Restart @@ -1696,13 +1672,12 @@ subroutine UpdateAccVars (this, bounds, crop_inst) ! Accumulate and extract running 20-year means if (is_end_curr_year()) then ! Flush, if needed - if (this%flush_gdd20) then + if (flush_gdd20) then write(iulog, *) 'Flushing GDD20 variables' call markreset_accum_field('GDD020') call markreset_accum_field('GDD820') call markreset_accum_field('GDD1020') - this%flush_gdd20 = .false. - flush_gdd20 = .false. ! Shouldn't be necessary, because flush_gdd20 shouldn't be considered after Init and Restart. But just in case... + flush_gdd20 = .false. end if call update_accum_field ('GDD020', this%gdd0_patch, nstep) call extract_accum_field ('GDD020', this%gdd020_patch, nstep) From 4ab30a5ddb9ac54cba659abc8682f1152e8eb844 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Wed, 24 Jul 2024 18:20:21 -0600 Subject: [PATCH 0771/1248] crop_calendars Python stuff now includes crop grasses. --- python/ctsm/crop_calendars/cropcal_module.py | 2 +- python/ctsm/crop_calendars/generate_gdds_functions.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/python/ctsm/crop_calendars/cropcal_module.py b/python/ctsm/crop_calendars/cropcal_module.py index 927bdc9100..719d352665 100644 --- a/python/ctsm/crop_calendars/cropcal_module.py +++ b/python/ctsm/crop_calendars/cropcal_module.py @@ -345,7 +345,7 @@ def import_output( my_vars, year_1=None, year_n=None, - my_vegtypes=utils.define_mgdcrop_list_nograsses(), + my_vegtypes=utils.define_mgdcrop_list_withgrasses(), sdates_rx_ds=None, gdds_rx_ds=None, verbose=False, diff --git a/python/ctsm/crop_calendars/generate_gdds_functions.py b/python/ctsm/crop_calendars/generate_gdds_functions.py index 50e2ac3d00..14bd6b2e40 100644 --- a/python/ctsm/crop_calendars/generate_gdds_functions.py +++ b/python/ctsm/crop_calendars/generate_gdds_functions.py @@ -282,9 +282,9 @@ def import_and_process_1yr( # Get list of crops to include if skip_crops is not None: - crops_to_read = [c for c in utils.define_mgdcrop_list_nograsses() if c not in skip_crops] + crops_to_read = [c for c in utils.define_mgdcrop_list_withgrasses() if c not in skip_crops] else: - crops_to_read = utils.define_mgdcrop_list_nograsses() + crops_to_read = utils.define_mgdcrop_list_withgrasses() print(h1_filelist) dates_ds = import_ds( From aeb4182302dc63bc88a3c8a5186233901f310f37 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Wed, 24 Jul 2024 18:22:58 -0600 Subject: [PATCH 0772/1248] interpolate_gdds.py: Syntax fix. --- python/ctsm/crop_calendars/interpolate_gdds.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/ctsm/crop_calendars/interpolate_gdds.py b/python/ctsm/crop_calendars/interpolate_gdds.py index 92bb112e3f..123d40af38 100755 --- a/python/ctsm/crop_calendars/interpolate_gdds.py +++ b/python/ctsm/crop_calendars/interpolate_gdds.py @@ -122,7 +122,7 @@ def interpolate_gdds(args): if "lat" not in ds_in[var].dims and "lon" not in ds_in[var].dims: print(f"Skipping variable {var} with dimensions {ds_in[var].dims}") continue - if not re.compile("^" + args.variable_prefix).match(var) + if not re.compile("^" + args.variable_prefix).match(var): print(f"Unexpected variable {var} on input file. Skipping.") continue if args.dry_run: From 929ec5d6c43a4234e35b060b02223888466554fc Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Wed, 24 Jul 2024 23:08:27 -0600 Subject: [PATCH 0773/1248] Skip switchgrass in RXCROPMATURITY. --- cime_config/SystemTests/rxcropmaturity.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cime_config/SystemTests/rxcropmaturity.py b/cime_config/SystemTests/rxcropmaturity.py index 46ed8f8be3..965398821f 100644 --- a/cime_config/SystemTests/rxcropmaturity.py +++ b/cime_config/SystemTests/rxcropmaturity.py @@ -438,7 +438,7 @@ def _run_generate_gdds(self, case_gddgen): f"--sdates-file {sdates_file}", f"--hdates-file {hdates_file}", f"--output-dir generate_gdds_out", - f"--skip-crops miscanthus,irrigated_miscanthus", + f"--skip-crops miscanthus,irrigated_miscanthus,switchgrass,irrigated_switchgrass", ] ) stu.run_python_script( From b70c156fed30f835a8b32cbca4d82dcbfe4888b2 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Wed, 24 Jul 2024 23:16:00 -0600 Subject: [PATCH 0774/1248] Manually specify sowing date file for GddGen testmod. --- cime_config/testdefs/testmods_dirs/clm/GddGen/user_nl_clm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cime_config/testdefs/testmods_dirs/clm/GddGen/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/GddGen/user_nl_clm index 87cdd5d5b5..cfde517fd9 100644 --- a/cime_config/testdefs/testmods_dirs/clm/GddGen/user_nl_clm +++ b/cime_config/testdefs/testmods_dirs/clm/GddGen/user_nl_clm @@ -1,4 +1,6 @@ cropcals_rx = .true. +stream_fldFileName_swindow_start = '$DIN_LOC_ROOT/lnd/clm2/cropdata/calendars/processed/sdates_ggcmi_crop_calendar_phase3_v1.01_nninterp-hcru_hcru_mt13.2000-2000.20230728_165845.tweaked_latlons.nc' +stream_fldFileName_swindow_end = '$DIN_LOC_ROOT/lnd/clm2/cropdata/calendars/processed/sdates_ggcmi_crop_calendar_phase3_v1.01_nninterp-hcru_hcru_mt13.2000-2000.20230728_165845.tweaked_latlons.nc' stream_fldFileName_cultivar_gdds = '' generate_crop_gdds = .true. use_mxmat = .false. From 7400d5bb153bd64be3eeb7f560e85128d736ed5c Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Thu, 25 Jul 2024 05:14:01 -0600 Subject: [PATCH 0775/1248] Add izumi_nag.clm-RxCropCalsAdaptGGCMI test to expected fails. SMS_P128x1_Lm25.f10_f10_mg37.IHistClm60BgcCrop.izumi_nag.clm-RxCropCalsAdaptGGCMI --- 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 03eb6a157d..e5e1410d1e 100644 --- a/cime_config/testdefs/ExpectedTestFails.xml +++ b/cime_config/testdefs/ExpectedTestFails.xml @@ -170,6 +170,13 @@ + + + FAIL + #2659 + + + From 388c7ed45e9561206a88efeecdb6faec054522d1 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Thu, 25 Jul 2024 05:55:45 -0600 Subject: [PATCH 0776/1248] Move stream_gdd20_seasons to cropCalStreamMod. --- bld/namelist_files/namelist_definition_ctsm.xml | 2 +- src/biogeophys/TemperatureType.F90 | 7 +++++-- src/cpl/share_esmf/cropcalStreamMod.F90 | 5 ++++- src/main/clm_varctl.F90 | 1 - src/main/controlMod.F90 | 4 +--- 5 files changed, 11 insertions(+), 8 deletions(-) diff --git a/bld/namelist_files/namelist_definition_ctsm.xml b/bld/namelist_files/namelist_definition_ctsm.xml index 31ce220d9c..a24f59339a 100644 --- a/bld/namelist_files/namelist_definition_ctsm.xml +++ b/bld/namelist_files/namelist_definition_ctsm.xml @@ -1839,7 +1839,7 @@ Filename of input stream data for baseline GDD20 values + group="cropcal_streams" valid_values="" > Set this to true to read gdd20 accumulation season start and end dates from stream files, rather than using hard-coded hemisphere-specific "warm seasons." diff --git a/src/biogeophys/TemperatureType.F90 b/src/biogeophys/TemperatureType.F90 index 71722d84fb..707218cc27 100644 --- a/src/biogeophys/TemperatureType.F90 +++ b/src/biogeophys/TemperatureType.F90 @@ -8,7 +8,7 @@ module TemperatureType use decompMod , only : bounds_type use abortutils , only : endrun use clm_varctl , only : use_cndv, iulog, use_luna, use_crop, use_biomass_heat_storage - use clm_varctl , only : stream_gdd20_seasons, flush_gdd20 + use clm_varctl , only : flush_gdd20 use clm_varpar , only : nlevsno, nlevgrnd, nlevlak, nlevurb, nlevmaxurbgrnd use clm_varcon , only : spval, ispval use GridcellType , only : grc @@ -1401,6 +1401,7 @@ subroutine UpdateAccVars_CropGDDs(this, rbufslp, begp, endp, month, day, secs, d real(r8) :: lat ! latitude integer :: gdd20_season_start, gdd20_season_end integer :: jday ! Julian day of year (1, ..., 366) + logical :: stream_gdd20_seasons_tt ! Local derivation of this to avoid circular dependency associate( & gdd20_season_starts => crop_inst%gdd20_season_start_patch, & @@ -1432,6 +1433,8 @@ subroutine UpdateAccVars_CropGDDs(this, rbufslp, begp, endp, month, day, secs, d end if write(field_name, format_string) "GDD",basetemp_int + stream_gdd20_seasons_tt = any(gdd20_season_starts(begp:endp) > 0.5_r8) .and. any(gdd20_season_starts(begp:endp) < 366.5_r8) + do p = begp,endp ! Avoid unnecessary calculations over inactive points @@ -1447,7 +1450,7 @@ subroutine UpdateAccVars_CropGDDs(this, rbufslp, begp, endp, month, day, secs, d ((month > 9 .or. month < 4) .and. lat < 0._r8) ! Replace with read-in gdd20 accumulation season, if needed and valid ! (If these aren't being read in or they're invalid, they'll be -1) - if (stream_gdd20_seasons .and. patch%itype(p) >= npcropmin) then + if (stream_gdd20_seasons_tt .and. patch%itype(p) >= npcropmin) then gdd20_season_start = int(gdd20_season_starts(p)) gdd20_season_end = int(gdd20_season_ends(p)) if (gdd20_season_start >= 1 .and. gdd20_season_end >= 1) then diff --git a/src/cpl/share_esmf/cropcalStreamMod.F90 b/src/cpl/share_esmf/cropcalStreamMod.F90 index d17ce1c259..85218a0e1c 100644 --- a/src/cpl/share_esmf/cropcalStreamMod.F90 +++ b/src/cpl/share_esmf/cropcalStreamMod.F90 @@ -16,7 +16,6 @@ module cropcalStreamMod use clm_varctl , only : iulog use clm_varctl , only : use_cropcal_rx_swindows, use_cropcal_rx_cultivar_gdds, use_cropcal_streams use clm_varctl , only : adapt_cropcal_rx_cultivar_gdds - use clm_varctl , only : stream_gdd20_seasons use clm_varpar , only : mxpft use clm_varpar , only : mxsowings use perf_mod , only : t_startf, t_stopf @@ -53,6 +52,7 @@ module cropcalStreamMod character(len=CL) :: stream_fldFileName_gdd20_baseline ! GDD20 baseline stream filename to read logical :: cropcals_rx ! Used only for setting input files in namelist; does nothing in code, but needs to be here so namelist read doesn't crash logical :: cropcals_rx_adapt ! Used only for setting input files in namelist; does nothing in code, but needs to be here so namelist read doesn't crash + logical :: stream_gdd20_seasons ! Read start and end dates for gdd20 seasons from streams instead of using hemisphere-specific values logical :: allow_invalid_gdd20_season_inputs ! Fall back on hemisphere "warm periods" in cases of invalid values in stream_fldFileName_gdd20_season_start and _end? character(len=CL) :: stream_fldFileName_gdd20_season_start ! Stream filename to read for start of gdd20 season character(len=CL) :: stream_fldFileName_gdd20_season_end ! Stream filename to read for end of gdd20 season @@ -113,6 +113,7 @@ subroutine cropcal_init(bounds) stream_meshfile_cropcal, & cropcals_rx, & cropcals_rx_adapt, & + stream_gdd20_seasons, & allow_invalid_gdd20_season_inputs, & stream_fldFileName_gdd20_season_start, & stream_fldFileName_gdd20_season_end @@ -130,6 +131,7 @@ subroutine cropcal_init(bounds) stream_fldFileName_swindow_end = '' stream_fldFileName_cultivar_gdds = '' stream_fldFileName_gdd20_baseline = '' + stream_gdd20_seasons = .false. allow_invalid_gdd20_season_inputs = .false. stream_fldFileName_gdd20_season_start = '' stream_fldFileName_gdd20_season_end = '' @@ -173,6 +175,7 @@ subroutine cropcal_init(bounds) call shr_mpi_bcast(stream_fldFileName_cultivar_gdds, mpicom) call shr_mpi_bcast(stream_fldFileName_gdd20_baseline, mpicom) call shr_mpi_bcast(stream_meshfile_cropcal , mpicom) + call shr_mpi_bcast(stream_gdd20_seasons, mpicom) call shr_mpi_bcast(allow_invalid_gdd20_season_inputs, mpicom) call shr_mpi_bcast(stream_fldFileName_gdd20_season_start, mpicom) call shr_mpi_bcast(stream_fldFileName_gdd20_season_end, mpicom) diff --git a/src/main/clm_varctl.F90 b/src/main/clm_varctl.F90 index a1ca2fd3f7..678f386f23 100644 --- a/src/main/clm_varctl.F90 +++ b/src/main/clm_varctl.F90 @@ -392,7 +392,6 @@ module clm_varctl logical, public :: use_cropcal_rx_swindows = .false. logical, public :: use_cropcal_rx_cultivar_gdds = .false. logical, public :: adapt_cropcal_rx_cultivar_gdds = .false. - logical, public :: stream_gdd20_seasons = .false. logical, public :: flush_gdd20 = .false. !---------------------------------------------------------- diff --git a/src/main/controlMod.F90 b/src/main/controlMod.F90 index 98e0d1afac..634128798b 100644 --- a/src/main/controlMod.F90 +++ b/src/main/controlMod.F90 @@ -302,7 +302,7 @@ subroutine control_init(dtime) use_lch4, use_nitrif_denitrif, use_extralakelayers, & use_vichydro, use_cn, use_cndv, use_crop, use_fertilizer, & use_grainproduct, use_snicar_frc, use_vancouver, use_mexicocity, use_noio, & - use_nguardrail, crop_residue_removal_frac, stream_gdd20_seasons, flush_gdd20 + use_nguardrail, crop_residue_removal_frac, flush_gdd20 ! SNICAR namelist /clm_inparm/ & @@ -711,7 +711,6 @@ subroutine control_spmd() call mpi_bcast (use_cndv, 1, MPI_LOGICAL, 0, mpicom, ier) call mpi_bcast (use_nguardrail, 1, MPI_LOGICAL, 0, mpicom, ier) call mpi_bcast (use_crop, 1, MPI_LOGICAL, 0, mpicom, ier) - call mpi_bcast (stream_gdd20_seasons, 1, MPI_LOGICAL, 0, mpicom, ier) call mpi_bcast (flush_gdd20, 1, MPI_LOGICAL, 0, mpicom, ier) call mpi_bcast (use_fertilizer, 1, MPI_LOGICAL, 0, mpicom, ier) call mpi_bcast (use_grainproduct, 1, MPI_LOGICAL, 0, mpicom, ier) @@ -985,7 +984,6 @@ subroutine control_print () write(iulog,*) ' use_cn = ', use_cn write(iulog,*) ' use_cndv = ', use_cndv write(iulog,*) ' use_crop = ', use_crop - write(iulog,*) ' stream_gdd20_seasons = ', stream_gdd20_seasons write(iulog,*) ' flush_gdd20 = ', flush_gdd20 write(iulog,*) ' use_fertilizer = ', use_fertilizer write(iulog,*) ' use_grainproduct = ', use_grainproduct From 0d4a300112f16ee35332af5e72e8016ea1990c8a Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Thu, 25 Jul 2024 14:21:40 -0600 Subject: [PATCH 0777/1248] Fix setting of stream_fldFileName_gdd20_baseline. --- bld/CLMBuildNamelist.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index 232b15c3b1..c2d23ce962 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -4247,7 +4247,7 @@ sub setup_logic_cropcal_streams { 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'); if ( &value_is_true($cropcals_rx_adapt) ) { - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_fldFileName_gdd20_baseline'); + add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_fldFileName_gdd20_baseline', 'stream_gdd20_seasons'=>$stream_gdd20_seasons); } } From 649547c5015e59ab582436c8c1bcfc39e296dd8f Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Thu, 25 Jul 2024 16:21:16 -0600 Subject: [PATCH 0778/1248] Don't specify PE layout for SMS crop_calendars tests. --- cime_config/testdefs/testlist_clm.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index b8e3dd2f31..ecdeeb659d 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -3560,7 +3560,7 @@ - + @@ -3578,7 +3578,7 @@ - + From 26ce0bbb0ac7835f11251c0585eec778b4a79859 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Thu, 25 Jul 2024 16:04:00 -0600 Subject: [PATCH 0779/1248] Add izumi versions of most derecho crop_calendars tests. --- cime_config/testdefs/testlist_clm.xml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index ecdeeb659d..18e66d4d64 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -3563,6 +3563,7 @@ + @@ -3581,6 +3582,7 @@ + @@ -3593,6 +3595,7 @@ + @@ -3603,6 +3606,7 @@ + @@ -3613,6 +3617,7 @@ + @@ -3622,6 +3627,7 @@ + From ae4af6b53cf0e525cd125a1eea97472ad2c72799 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Thu, 25 Jul 2024 16:26:14 -0600 Subject: [PATCH 0780/1248] Fix PE layouts of izumi crop_calendars tests. --- cime_config/testdefs/testlist_clm.xml | 30 +++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index 18e66d4d64..edbfd3c4eb 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -3579,6 +3579,15 @@ + + + + + + + + + @@ -3595,18 +3604,25 @@ - + + + + + + + + + - @@ -3614,6 +3630,16 @@ + + + + + + + + + + From e757d3df5154d3671129a26d9afab667f337591f Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Thu, 25 Jul 2024 14:54:24 -0600 Subject: [PATCH 0781/1248] Add oldCropCals testmod and two aux_clm tests that use it. --- cime_config/testdefs/testlist_clm.xml | 27 +++++++++++++++++++ .../testmods_dirs/clm/oldCropCals/user_nl_clm | 3 +++ 2 files changed, 30 insertions(+) create mode 100644 cime_config/testdefs/testmods_dirs/clm/oldCropCals/user_nl_clm diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index edbfd3c4eb..ffaf4edc29 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -3660,5 +3660,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/cime_config/testdefs/testmods_dirs/clm/oldCropCals/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/oldCropCals/user_nl_clm new file mode 100644 index 0000000000..5885f6f2a0 --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/oldCropCals/user_nl_clm @@ -0,0 +1,3 @@ +cropcals_rx = .false. +cropcals_rx_adapt = .false. +stream_gdd20_seasons = .false. \ No newline at end of file From 7070abcd9272cc4b0f55d086321ea6968f1d2e83 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Thu, 25 Jul 2024 16:29:34 -0600 Subject: [PATCH 0782/1248] Add cropcals_rx(_adapt) in some testmods; rename RxCropCals to RxCropCalsNoAdapt. --- cime_config/testdefs/testlist_clm.xml | 2 +- cime_config/testdefs/testmods_dirs/clm/GddGen/include_user_mods | 1 + cime_config/testdefs/testmods_dirs/clm/RxCropCals/user_nl_clm | 2 -- .../testmods_dirs/clm/RxCropCalsAdapt/include_user_mods | 2 +- .../clm/{RxCropCals => RxCropCalsNoAdapt}/include_user_mods | 0 .../testdefs/testmods_dirs/clm/RxCropCalsNoAdapt/user_nl_clm | 2 ++ 6 files changed, 5 insertions(+), 4 deletions(-) delete mode 100644 cime_config/testdefs/testmods_dirs/clm/RxCropCals/user_nl_clm rename cime_config/testdefs/testmods_dirs/clm/{RxCropCals => RxCropCalsNoAdapt}/include_user_mods (100%) create mode 100644 cime_config/testdefs/testmods_dirs/clm/RxCropCalsNoAdapt/user_nl_clm diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index ffaf4edc29..cca879604d 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -3560,7 +3560,7 @@ - + diff --git a/cime_config/testdefs/testmods_dirs/clm/GddGen/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/GddGen/include_user_mods index 02ec13743f..4d75082583 100644 --- a/cime_config/testdefs/testmods_dirs/clm/GddGen/include_user_mods +++ b/cime_config/testdefs/testmods_dirs/clm/GddGen/include_user_mods @@ -1 +1,2 @@ ../cropMonthOutput +../oldCropCals \ No newline at end of file diff --git a/cime_config/testdefs/testmods_dirs/clm/RxCropCals/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/RxCropCals/user_nl_clm deleted file mode 100644 index 8a0b4a91be..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/RxCropCals/user_nl_clm +++ /dev/null @@ -1,2 +0,0 @@ - -cropcals_rx = .true. diff --git a/cime_config/testdefs/testmods_dirs/clm/RxCropCalsAdapt/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/RxCropCalsAdapt/include_user_mods index 88c9694365..4f46c0ce95 100644 --- a/cime_config/testdefs/testmods_dirs/clm/RxCropCalsAdapt/include_user_mods +++ b/cime_config/testdefs/testmods_dirs/clm/RxCropCalsAdapt/include_user_mods @@ -1 +1 @@ -../RxCropCals +../RxCropCalsNoAdapt diff --git a/cime_config/testdefs/testmods_dirs/clm/RxCropCals/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/RxCropCalsNoAdapt/include_user_mods similarity index 100% rename from cime_config/testdefs/testmods_dirs/clm/RxCropCals/include_user_mods rename to cime_config/testdefs/testmods_dirs/clm/RxCropCalsNoAdapt/include_user_mods diff --git a/cime_config/testdefs/testmods_dirs/clm/RxCropCalsNoAdapt/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/RxCropCalsNoAdapt/user_nl_clm new file mode 100644 index 0000000000..625960b389 --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/RxCropCalsNoAdapt/user_nl_clm @@ -0,0 +1,2 @@ +cropcals_rx = .true. +cropcals_rx_adapt = .false. From f0a221f0a68c0aac10cf0c449406c1dcd27a6294 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Thu, 25 Jul 2024 15:38:20 -0600 Subject: [PATCH 0783/1248] Rework RxCropCalsAdaptGGCMI to not require RxCropCalsAdapt. The latter will be deleted in the next commit. --- .../testmods_dirs/clm/RxCropCalsAdaptGGCMI/include_user_mods | 2 +- .../testmods_dirs/clm/RxCropCalsAdaptGGCMI/user_nl_clm | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/cime_config/testdefs/testmods_dirs/clm/RxCropCalsAdaptGGCMI/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/RxCropCalsAdaptGGCMI/include_user_mods index af5fe8591e..23ea3745e6 100644 --- a/cime_config/testdefs/testmods_dirs/clm/RxCropCalsAdaptGGCMI/include_user_mods +++ b/cime_config/testdefs/testmods_dirs/clm/RxCropCalsAdaptGGCMI/include_user_mods @@ -1 +1 @@ -../RxCropCalsAdapt +../crop diff --git a/cime_config/testdefs/testmods_dirs/clm/RxCropCalsAdaptGGCMI/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/RxCropCalsAdaptGGCMI/user_nl_clm index dd4ac3117c..fdf5a86c26 100644 --- a/cime_config/testdefs/testmods_dirs/clm/RxCropCalsAdaptGGCMI/user_nl_clm +++ b/cime_config/testdefs/testmods_dirs/clm/RxCropCalsAdaptGGCMI/user_nl_clm @@ -1,4 +1,5 @@ - +cropcals_rx = .false. +cropcals_rx_adapt = .true. stream_gdd20_seasons = .true. flush_gdd20 = .true. !TODO SSR: Try without this once you have half-degree inputs From 5dabe6287e9ad843003f08122cf58327aaf356b3 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Thu, 25 Jul 2024 16:31:07 -0600 Subject: [PATCH 0784/1248] Delete RxCropCalsAdapt test. --- cime_config/testdefs/testlist_clm.xml | 18 ------------------ .../clm/RxCropCalsAdapt/include_user_mods | 1 - .../clm/RxCropCalsAdapt/user_nl_clm | 3 --- 3 files changed, 22 deletions(-) delete mode 100644 cime_config/testdefs/testmods_dirs/clm/RxCropCalsAdapt/include_user_mods delete mode 100644 cime_config/testdefs/testmods_dirs/clm/RxCropCalsAdapt/user_nl_clm diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index cca879604d..4e5574932e 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -3570,24 +3570,6 @@ - - - - - - - - - - - - - - - - - - diff --git a/cime_config/testdefs/testmods_dirs/clm/RxCropCalsAdapt/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/RxCropCalsAdapt/include_user_mods deleted file mode 100644 index 4f46c0ce95..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/RxCropCalsAdapt/include_user_mods +++ /dev/null @@ -1 +0,0 @@ -../RxCropCalsNoAdapt diff --git a/cime_config/testdefs/testmods_dirs/clm/RxCropCalsAdapt/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/RxCropCalsAdapt/user_nl_clm deleted file mode 100644 index 709c7221e0..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/RxCropCalsAdapt/user_nl_clm +++ /dev/null @@ -1,3 +0,0 @@ - -cropcals_rx = .false. -cropcals_rx_adapt = .true. From ca6b608ce59eb9043297d4452a5d0107eb5b8e82 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Thu, 25 Jul 2024 15:52:10 -0600 Subject: [PATCH 0785/1248] Add 'cropcals_rx_adapt = .false.' to RXCROPMATURITYSHARED. --- cime_config/SystemTests/rxcropmaturity.py | 1 + 1 file changed, 1 insertion(+) diff --git a/cime_config/SystemTests/rxcropmaturity.py b/cime_config/SystemTests/rxcropmaturity.py index b1de55836b..fb254c408f 100644 --- a/cime_config/SystemTests/rxcropmaturity.py +++ b/cime_config/SystemTests/rxcropmaturity.py @@ -402,6 +402,7 @@ def _run_check_rxboth_run(self, skip_gen): def _modify_user_nl_allruns(self): nl_additions = [ "cropcals_rx = .true.", + "cropcals_rx_adapt = .false.", "stream_meshfile_cropcal = '{}'".format(self._case.get_value("LND_DOMAIN_MESH")), "stream_fldFileName_swindow_start = '{}'".format(self._sdatefile), "stream_fldFileName_swindow_end = '{}'".format(self._sdatefile), From dc9996fa36033e340b790ecc0fe716cd2a48a062 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Thu, 25 Jul 2024 17:08:56 -0600 Subject: [PATCH 0786/1248] Minor yet important update to comments --- tools/mksurfdata_esmf/gen_mksurfdata_namelist.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/mksurfdata_esmf/gen_mksurfdata_namelist.xml b/tools/mksurfdata_esmf/gen_mksurfdata_namelist.xml index 7a31a94510..1e24accc4d 100644 --- a/tools/mksurfdata_esmf/gen_mksurfdata_namelist.xml +++ b/tools/mksurfdata_esmf/gen_mksurfdata_namelist.xml @@ -265,6 +265,8 @@ version of the raw dataset will probably go away. + + /glade/campaign/cesm/development/lmwg/landuse_source_data/CTSM53RawData/globalctsm53histTRENDY2023Deg025_240709/mksrf_landuse_ctsm53_histTRENDY2023_%y.c240709.nc lnd/clm2/mappingdata/grids/UNSTRUCTgrid_0.25x0.25_nomask_cdf5_c200129.nc From 904e6b2f99164165a4a197436f4b583148bdc087 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Thu, 25 Jul 2024 18:22:36 -0600 Subject: [PATCH 0787/1248] Change a test name in ExpectedTestFails.xml. --- cime_config/testdefs/ExpectedTestFails.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cime_config/testdefs/ExpectedTestFails.xml b/cime_config/testdefs/ExpectedTestFails.xml index 9b653d8e0b..d5e3e4e378 100644 --- a/cime_config/testdefs/ExpectedTestFails.xml +++ b/cime_config/testdefs/ExpectedTestFails.xml @@ -163,7 +163,7 @@ - + FAIL #2659 From a3d8158c65dcff4cabc1a9e3dd86fe762050f7f3 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Thu, 25 Jul 2024 20:01:54 -0600 Subject: [PATCH 0788/1248] Turn on cropcals_rx_adapt by default for physics other than clm4_5, clm5_0, and clm5_1. --- 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 706b4dd26d..5f336dabf8 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -2199,7 +2199,10 @@ lnd/clm2/surfdata_esmf/NEON/surfdata_1x1_NEON_TOOL_hist_78pfts_CMIP6_simyr2000_c .false. -.false. +.true. +.false. +.false. +.false. .false. .false. 2000 From dcdd587848f18f2087543966856f6b0373a64adb Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Thu, 25 Jul 2024 22:36:49 -0600 Subject: [PATCH 0789/1248] Remove most Izumi crop_calendars tests. --- cime_config/testdefs/testlist_clm.xml | 32 --------------------------- 1 file changed, 32 deletions(-) diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index 4e5574932e..efeb011844 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -3563,7 +3563,6 @@ - @@ -3573,7 +3572,6 @@ - @@ -3592,15 +3590,6 @@ - - - - - - - - - @@ -3612,20 +3601,9 @@ - - - - - - - - - - - @@ -3635,7 +3613,6 @@ - @@ -3660,14 +3637,5 @@ - - - - - - - - - From af02bca9e98661c1f9450cf7602c96dc3aab2b15 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Thu, 25 Jul 2024 23:17:56 -0700 Subject: [PATCH 0790/1248] Update ChangeLog and ChangeSum. --- doc/ChangeLog | 137 ++++++++++++++++++++++++++++++++++++++++++++++++++ doc/ChangeSum | 1 + 2 files changed, 138 insertions(+) diff --git a/doc/ChangeLog b/doc/ChangeLog index 506b3d5ad0..501a67720f 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,4 +1,141 @@ =============================================================== +Tag name: ctsm5.2.016 +Originator(s): samrabin (Sam Rabin, UCAR/TSS, samrabin@ucar.edu) +Date: Thu Jul 25 22:39:39 MST 2024 +One-line Summary: Enable new crop calendars for clm60 compsets + +Purpose and description of changes +---------------------------------- + +This commit switches clm60 compsets (really, any compset other than clm45, clm50, and clm51) to use: +- Per-gridcell and -crop sowing windows derived from the GGCMI phase 3b group II static growing seasons +- Per-gridcell and -crop maturity requirements derived from those same growing seasons, over the 1980-2009 growing seasons +- Code to adjust those prescribed maturity requirements based on recent climate + + +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.) + +[X] clm6_0 + +[ ] clm5_1 + +[ ] clm5_0 + +[?] ctsm5_0-nwp: Probably? Haven't tested, but didn't exclude that setup. + +[ ] clm4_5 + + +Bugs fixed +---------- + +List of CTSM issues fixed (include CTSM Issue # and description): +- Fixes ESCOMP/CTSM#2584: Reset accumulators to initval instead of 0 (https://github.com/ESCOMP/CTSM/issues/2584) + +Notes of particular relevance for users +--------------------------------------- +[Remove any lines that don't apply. Remove entire section if nothing applies.] + +Caveats for users (e.g., need to interpolate initial conditions): + +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): +- Add cropcals_rx, default false. +- Add cropcals_rx_adapt, default true. This is what changes default behavior. +- Rename stream_year_first_cropcal to stream_year_first_cropcal_swindows +- Rename stream_year_last_cropcal to stream_year_last_cropcal_swindows +- Rename model_year_align_cropcal to model_year_align_cropcal_swindows +- Add stream_year_first_cropcal_cultivar_gdds +- Add stream_year_last_cropcal_cultivar_gdds +- Add model_year_align_cropcal_cultivar_gdds +- Add stream_fldFileName_gdd20_baseline +- Add stream_gdd20_seasons (experimental) +- Add flush_gdd20 (experimental) +- Add stream_fldFileName_gdd20_season_start (experimental) +- Add stream_fldFileName_gdd20_season_end (experimental) +- Add allow_invalid_gdd20_season_inputs + +Changes to the datasets (e.g., parameter, surface or initial files): +- Many new default and optional stream files added. + +Changes to documentation: +- None yet. + +Notes of particular relevance for developers: +--------------------------------------------- + +Caveats for developers: +- tools/contrib/tweak_latlons.py: This is a script I made to avoid the "ambiguous nearest neighbor" issue described in the discussion at https://github.com/orgs/esmf-org/discussions/261. It's hopefully just a temporary thing as we wait for ESMF to fix that bug. If they end up deciding not to, then this should be moved into python/ctsm/ and fully tested. +- Unit and system testing needs to be added for generate_gdd20_baseline.py. +- RXCROPMATURITY SystemTest should be updated to also call generate_gdd20_baseline.py. + +Changes to tests or testing: +- Adds testmods: + - midDecStart: Like decStart, except starts Dec. 15 instead of 30. Useful for ERP/ERS tests where you want the split in December. + - GddGen + - oldCropCals: To recreate previous crop calendars + - RxCropCalsAdaptGGCMI (experimental) + - RxCropCalsNoAdapt + - StreamGDD20Seasons (experimental) +- Removes sowingWindows testmod +- Adds and changes various tests related to crop calendars + +Note that testmods marked "experimental" are fine to be marked as expected failures, if needed. + + +Testing summary: +---------------- + +[Remove any lines that don't apply.] + + [PASS means all tests PASS; OK means tests PASS other than expected fails.] + + build-namelist tests (if CLMBuildNamelist.pm has changed): + + derecho - + + python testing (if python code has changed; see instructions in python/README.md; document testing done): + + (any machine) - + + regular tests (aux_clm: https://github.com/ESCOMP/CTSM/wiki/System-Testing-Guide#pre-merge-system-testing): + + derecho ----- + izumi ------- + +Answer changes +-------------- + +Changes answers relative to baseline: + + Summarize any changes to answers, i.e., + - what code configurations: crop-enabled compsets with clm60 (or more specifically, other than clm45, clm50, clm51) + - what platforms/compilers: all + - nature of change (roundoff; larger than roundoff/same climate; new climate): new climate + + Probably? At least, there can be large regional shifts in crop growing season. Results are similar to those for the Prescribed Calendars setup in Rabin et al. (2023; https://gmd.copernicus.org/articles/16/7253/2023/gmd-16-7253-2023.html). + + If this tag changes climate describe the run(s) done to evaluate the new + climate (put details of the simulations in the experiment database) + - None + + +Other details +------------- + +Pull Requests that document the changes (include PR ids): +- ESCOMP/CTSM#2560: Allow prescribed gddmaturity to vary based on recent climate (initial work, v2) (https://github.com/ESCOMP/CTSM/pull/2560) +- ESCOMP/CTSM#2585: Allow "manual" resets of all accumulator types (https://github.com/ESCOMP/CTSM/pull/2585) +- ESCOMP/CTSM#2593: Optionally base GDD20 on per-gridcell windows, not per-hemisphere (https://github.com/ESCOMP/CTSM/pull/2593) +- ESCOMP/CTSM#2661: Merge ctsm5.2.015 into scale-maturity-reqs (https://github.com/ESCOMP/CTSM/pull/2661) +- ESCOMP/CTSM#2664: Enable new crop calendars for clm60 compsets (https://github.com/ESCOMP/CTSM/pull/2664) +- ESCOMP/CTSM#2665: Merge new crop calendars into master (https://github.com/ESCOMP/CTSM/pull/2665) + +=============================================================== +=============================================================== Tag name: ctsm5.2.015 Originator(s): multiple (Samuel Levis,UCAR/TSS,303-665-1310, @mvertens, @jedwards4b, @billsacks, @Katetc) Date: Mon 22 Jul 2024 12:46:17 PM MDT diff --git a/doc/ChangeSum b/doc/ChangeSum index 9c6524b33d..f043ab8b34 100644 --- a/doc/ChangeSum +++ b/doc/ChangeSum @@ -1,5 +1,6 @@ Tag Who Date Summary ============================================================================================================================ + ctsm5.2.016 samrabin 07/25/2024 Enable new crop calendars for clm60 compsets ctsm5.2.015 multiple 07/22/2024 Update submodule tags to pass runoff from cism to rof ctsm5.2.014 multiple 07/19/2024 use_matrixcn, use_soil_matrixcn come in as default .false. ctsm5.2.013 glemieux 07/18/2024 FATES Land Use V2 From 542f7080432e76073ea2734be0ed50393e9a6bb8 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Fri, 26 Jul 2024 01:40:34 -0600 Subject: [PATCH 0791/1248] Wrap cropcal subroutine calls in use_crop. Avoids issue with undefined pointer to crop_inst%rx_swindow_starts_thisyr_patch and probably other arrays. --- src/cpl/share_esmf/cropcalStreamMod.F90 | 1 + src/main/clm_driver.F90 | 4 ++-- src/main/clm_initializeMod.F90 | 26 +++++++++++++------------ 3 files changed, 17 insertions(+), 14 deletions(-) diff --git a/src/cpl/share_esmf/cropcalStreamMod.F90 b/src/cpl/share_esmf/cropcalStreamMod.F90 index 85218a0e1c..a39ba40754 100644 --- a/src/cpl/share_esmf/cropcalStreamMod.F90 +++ b/src/cpl/share_esmf/cropcalStreamMod.F90 @@ -14,6 +14,7 @@ module cropcalStreamMod use decompMod , only : bounds_type use abortutils , only : endrun use clm_varctl , only : iulog + use clm_varctl , only : use_crop use clm_varctl , only : use_cropcal_rx_swindows, use_cropcal_rx_cultivar_gdds, use_cropcal_streams use clm_varctl , only : adapt_cropcal_rx_cultivar_gdds use clm_varpar , only : mxpft diff --git a/src/main/clm_driver.F90 b/src/main/clm_driver.F90 index 01c0ec409e..53b1e55f7c 100644 --- a/src/main/clm_driver.F90 +++ b/src/main/clm_driver.F90 @@ -475,7 +475,7 @@ subroutine clm_drv(doalb, nextsw_cday, declinp1, declin, rstwr, nlend, rdate, ro ! When crop calendar streams are being used ! NOTE: This call needs to happen outside loops over nclumps (as streams are not threadsafe) - if (use_cropcal_streams .and. is_beg_curr_year()) then + if (use_crop .and. use_cropcal_streams .and. is_beg_curr_year()) then call cropcal_advance( bounds_proc ) end if @@ -1073,7 +1073,7 @@ subroutine clm_drv(doalb, nextsw_cday, declinp1, declin, rstwr, nlend, rdate, ro frictionvel_inst, photosyns_inst, drydepvel_inst) call t_stopf('depvel') - if (use_cropcal_streams .and. is_beg_curr_year()) then + if (use_crop .and. use_cropcal_streams .and. is_beg_curr_year()) then ! ============================================================================ ! Update crop calendars ! ============================================================================ diff --git a/src/main/clm_initializeMod.F90 b/src/main/clm_initializeMod.F90 index e8f70bdef8..0c0570c577 100644 --- a/src/main/clm_initializeMod.F90 +++ b/src/main/clm_initializeMod.F90 @@ -659,19 +659,21 @@ subroutine initialize2(ni,nj) end if ! Initialize crop calendars - call t_startf('init_cropcal') - call cropcal_init(bounds_proc) - if (use_cropcal_streams) then - call cropcal_advance( bounds_proc ) - !$OMP PARALLEL DO PRIVATE (nc, bounds_clump) - do nc = 1,nclumps - call get_clump_bounds(nc, bounds_clump) - call cropcal_interp(bounds_clump, filter_inactive_and_active(nc)%num_pcropp, & - filter_inactive_and_active(nc)%pcropp, .true., crop_inst) - end do - !$OMP END PARALLEL DO + if (use_crop) then + call t_startf('init_cropcal') + call cropcal_init(bounds_proc) + if (use_cropcal_streams) then + call cropcal_advance( bounds_proc ) + !$OMP PARALLEL DO PRIVATE (nc, bounds_clump) + do nc = 1,nclumps + call get_clump_bounds(nc, bounds_clump) + call cropcal_interp(bounds_clump, filter_inactive_and_active(nc)%num_pcropp, & + filter_inactive_and_active(nc)%pcropp, .true., crop_inst) + end do + !$OMP END PARALLEL DO + end if + call t_stopf('init_cropcal') end if - call t_stopf('init_cropcal') ! Initialize active history fields. ! This is only done if not a restart run. If a restart run, then this From 126ce292f1380e96ff22750ec4cd0dc1a518e8d6 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Fri, 26 Jul 2024 07:49:53 -0600 Subject: [PATCH 0792/1248] Allocate first dim on dataptr2d_*_start/end arrays with begp:endp. Instead of just :. Hopefully will eliminate too-high index errors in threading tests. --- src/cpl/share_esmf/cropcalStreamMod.F90 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/cpl/share_esmf/cropcalStreamMod.F90 b/src/cpl/share_esmf/cropcalStreamMod.F90 index a39ba40754..3fdf1ba06c 100644 --- a/src/cpl/share_esmf/cropcalStreamMod.F90 +++ b/src/cpl/share_esmf/cropcalStreamMod.F90 @@ -545,9 +545,9 @@ subroutine cropcal_interp(bounds, num_pcropp, filter_pcropp, init, crop_inst) ! Read prescribed sowing window start dates from input files allocate(dataptr2d_swindow_start(lsize, ncft)) - dataptr2d_swindow_start(:,:) = -1._r8 + dataptr2d_swindow_start(begp:endp,:) = -1._r8 allocate(dataptr2d_swindow_end (lsize, ncft)) - dataptr2d_swindow_end(:,:) = -1._r8 + dataptr2d_swindow_end(begp:endp,:) = -1._r8 if (use_cropcal_rx_swindows) then ! Starting with npcropmin will skip generic crops do n = 1, ncft @@ -742,9 +742,9 @@ subroutine cropcal_interp(bounds, num_pcropp, filter_pcropp, init, crop_inst) ! Read prescribed gdd20 season start dates from input files allocate(dataptr2d_gdd20_season_start(lsize, ncft)) - dataptr2d_gdd20_season_start(:,:) = -1._r8 + dataptr2d_gdd20_season_start(begp:endp,:) = -1._r8 allocate(dataptr2d_gdd20_season_end (lsize, ncft)) - dataptr2d_gdd20_season_end(:,:) = -1._r8 + dataptr2d_gdd20_season_end(begp:endp,:) = -1._r8 if (stream_gdd20_seasons) then ! Starting with npcropmin will skip generic crops do n = 1, ncft From b7a8fb58e2186d9d6b9dcd20b8b6c57301bfcd8e Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Fri, 26 Jul 2024 08:14:51 -0600 Subject: [PATCH 0793/1248] Allocate 2d arrays with begp:endp, not lsize. Hopefully will eliminate too-high index errors in threading tests. --- src/cpl/share_esmf/cropcalStreamMod.F90 | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/cpl/share_esmf/cropcalStreamMod.F90 b/src/cpl/share_esmf/cropcalStreamMod.F90 index 3fdf1ba06c..36c6c78f22 100644 --- a/src/cpl/share_esmf/cropcalStreamMod.F90 +++ b/src/cpl/share_esmf/cropcalStreamMod.F90 @@ -544,9 +544,9 @@ subroutine cropcal_interp(bounds, num_pcropp, filter_pcropp, init, crop_inst) dayspyr = get_curr_days_per_year() ! Read prescribed sowing window start dates from input files - allocate(dataptr2d_swindow_start(lsize, ncft)) + allocate(dataptr2d_swindow_start(begp:endp, ncft)) dataptr2d_swindow_start(begp:endp,:) = -1._r8 - allocate(dataptr2d_swindow_end (lsize, ncft)) + allocate(dataptr2d_swindow_end (begp:endp, ncft)) dataptr2d_swindow_end(begp:endp,:) = -1._r8 if (use_cropcal_rx_swindows) then ! Starting with npcropmin will skip generic crops @@ -631,7 +631,7 @@ subroutine cropcal_interp(bounds, num_pcropp, filter_pcropp, init, crop_inst) deallocate(dataptr2d_swindow_start) deallocate(dataptr2d_swindow_end) - allocate(dataptr2d_cultivar_gdds(lsize, ncft)) + allocate(dataptr2d_cultivar_gdds(begp:endp, ncft)) if (use_cropcal_rx_cultivar_gdds) then ! Read prescribed cultivar GDDs from input files ! Starting with npcropmin will skip generic crops @@ -688,7 +688,7 @@ subroutine cropcal_interp(bounds, num_pcropp, filter_pcropp, init, crop_inst) deallocate(dataptr2d_cultivar_gdds) - allocate(dataptr2d_gdd20_baseline(lsize, ncft)) + allocate(dataptr2d_gdd20_baseline(begp:endp, ncft)) if (adapt_cropcal_rx_cultivar_gdds) then ! Read GDD20 baselines from input files ! Starting with npcropmin will skip generic crops @@ -741,9 +741,9 @@ subroutine cropcal_interp(bounds, num_pcropp, filter_pcropp, init, crop_inst) ! Read prescribed gdd20 season start dates from input files - allocate(dataptr2d_gdd20_season_start(lsize, ncft)) + allocate(dataptr2d_gdd20_season_start(begp:endp, ncft)) dataptr2d_gdd20_season_start(begp:endp,:) = -1._r8 - allocate(dataptr2d_gdd20_season_end (lsize, ncft)) + allocate(dataptr2d_gdd20_season_end (begp:endp, ncft)) dataptr2d_gdd20_season_end(begp:endp,:) = -1._r8 if (stream_gdd20_seasons) then ! Starting with npcropmin will skip generic crops From 63b66b66944e0bacf55da5e87f48a1a860ca9211 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Fri, 26 Jul 2024 08:22:57 -0600 Subject: [PATCH 0794/1248] Add ERP_D_Ld10_P64x2.f10_f10_mg37.IHistClm60BgcCrop.derecho_intel.clm-default to crop_calendars suite. --- cime_config/testdefs/testlist_clm.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index efeb011844..bb421c8e9e 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -1016,6 +1016,7 @@ + From 7e04126d66429ee7419441538447bb3a3cc4b448 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Fri, 26 Jul 2024 08:26:32 -0600 Subject: [PATCH 0795/1248] dataptr2d arrays' first dim is gridcell, not patch. Hopefully will eliminate too-high index errors in threading tests. --- src/cpl/share_esmf/cropcalStreamMod.F90 | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/cpl/share_esmf/cropcalStreamMod.F90 b/src/cpl/share_esmf/cropcalStreamMod.F90 index 36c6c78f22..d19c74ad37 100644 --- a/src/cpl/share_esmf/cropcalStreamMod.F90 +++ b/src/cpl/share_esmf/cropcalStreamMod.F90 @@ -544,10 +544,10 @@ subroutine cropcal_interp(bounds, num_pcropp, filter_pcropp, init, crop_inst) dayspyr = get_curr_days_per_year() ! Read prescribed sowing window start dates from input files - allocate(dataptr2d_swindow_start(begp:endp, ncft)) - dataptr2d_swindow_start(begp:endp,:) = -1._r8 - allocate(dataptr2d_swindow_end (begp:endp, ncft)) - dataptr2d_swindow_end(begp:endp,:) = -1._r8 + allocate(dataptr2d_swindow_start(bounds%begg:bounds%endg, ncft)) + dataptr2d_swindow_start(bounds%begg:bounds%endg,:) = -1._r8 + allocate(dataptr2d_swindow_end (bounds%begg:bounds%endg, ncft)) + dataptr2d_swindow_end(bounds%begg:bounds%endg,:) = -1._r8 if (use_cropcal_rx_swindows) then ! Starting with npcropmin will skip generic crops do n = 1, ncft @@ -563,7 +563,7 @@ subroutine cropcal_interp(bounds, num_pcropp, filter_pcropp, init, crop_inst) end if ! Note that the size of dataptr1d includes ocean points so it will be around 3x larger than lsize ! So an explicit loop is required here - do g = 1,lsize + do g = bounds%begg, bounds%endg ! If read-in value is invalid, set to -1. Will be handled later in this subroutine. if (dataptr1d_swindow_start(g) <= 0 .or. dataptr1d_swindow_start(g) > dayspyr & @@ -631,7 +631,7 @@ subroutine cropcal_interp(bounds, num_pcropp, filter_pcropp, init, crop_inst) deallocate(dataptr2d_swindow_start) deallocate(dataptr2d_swindow_end) - allocate(dataptr2d_cultivar_gdds(begp:endp, ncft)) + allocate(dataptr2d_cultivar_gdds(bounds%begg:bounds%endg, ncft)) if (use_cropcal_rx_cultivar_gdds) then ! Read prescribed cultivar GDDs from input files ! Starting with npcropmin will skip generic crops @@ -688,7 +688,7 @@ subroutine cropcal_interp(bounds, num_pcropp, filter_pcropp, init, crop_inst) deallocate(dataptr2d_cultivar_gdds) - allocate(dataptr2d_gdd20_baseline(begp:endp, ncft)) + allocate(dataptr2d_gdd20_baseline(bounds%begg:bounds%endg, ncft)) if (adapt_cropcal_rx_cultivar_gdds) then ! Read GDD20 baselines from input files ! Starting with npcropmin will skip generic crops @@ -741,10 +741,10 @@ subroutine cropcal_interp(bounds, num_pcropp, filter_pcropp, init, crop_inst) ! Read prescribed gdd20 season start dates from input files - allocate(dataptr2d_gdd20_season_start(begp:endp, ncft)) - dataptr2d_gdd20_season_start(begp:endp,:) = -1._r8 - allocate(dataptr2d_gdd20_season_end (begp:endp, ncft)) - dataptr2d_gdd20_season_end(begp:endp,:) = -1._r8 + allocate(dataptr2d_gdd20_season_start(bounds%begg:bounds%endg, ncft)) + dataptr2d_gdd20_season_start(bounds%begg:bounds%endg,:) = -1._r8 + allocate(dataptr2d_gdd20_season_end (bounds%begg:bounds%endg, ncft)) + dataptr2d_gdd20_season_end(bounds%begg:bounds%endg,:) = -1._r8 if (stream_gdd20_seasons) then ! Starting with npcropmin will skip generic crops do n = 1, ncft From d47b28a5e3e44b66a11fc8055d57f24c02d8bbbc Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Fri, 26 Jul 2024 08:36:47 -0600 Subject: [PATCH 0796/1248] Use begg and endg instead of lsize. Hopefully will eliminate too-high index errors in threading tests. --- src/cpl/share_esmf/cropcalStreamMod.F90 | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/cpl/share_esmf/cropcalStreamMod.F90 b/src/cpl/share_esmf/cropcalStreamMod.F90 index d19c74ad37..02cfc5e67a 100644 --- a/src/cpl/share_esmf/cropcalStreamMod.F90 +++ b/src/cpl/share_esmf/cropcalStreamMod.F90 @@ -507,7 +507,6 @@ subroutine cropcal_interp(bounds, num_pcropp, filter_pcropp, init, crop_inst) integer :: nc, fp integer :: dayspyr integer :: n, g - integer :: lsize integer :: rc integer :: begp, endp real(r8), pointer :: dataptr1d_swindow_start(:) @@ -536,7 +535,6 @@ subroutine cropcal_interp(bounds, num_pcropp, filter_pcropp, init, crop_inst) ! Get pointer for stream data that is time and spatially interpolate to model time and grid ! Place all data from each type into a temporary 2d array - lsize = bounds%endg - bounds%begg + 1 begp = bounds%begp endp = bounds%endp @@ -644,7 +642,7 @@ subroutine cropcal_interp(bounds, num_pcropp, filter_pcropp, init, crop_inst) ! Note that the size of dataptr1d includes ocean points so it will be around 3x larger than lsize ! So an explicit loop is required here - do g = 1,lsize + do g = bounds%begg, bounds%endg ! If read-in value is invalid, have PlantCrop() set gddmaturity to PFT-default value. if (dataptr1d_cultivar_gdds(g) < 0 .or. dataptr1d_cultivar_gdds(g) > 1000000._r8) then @@ -672,8 +670,8 @@ subroutine cropcal_interp(bounds, num_pcropp, filter_pcropp, init, crop_inst) ! vegetated pft ig = g_to_ig(patch%gridcell(p)) - if (ig > lsize) then - write(iulog,'(a,i0,a,i0,a)') 'ig (',ig,') > lsize (',lsize,')' + if (ig < bounds%begg .or. ig > bounds%endg) then + write(iulog,'(a,i0,a,i0,a)') 'ig (',ig,') < begg (',bounds%begg,') or > endg (',bounds%endg,')' call ESMF_Finalize(endflag=ESMF_END_ABORT) end if @@ -701,7 +699,7 @@ subroutine cropcal_interp(bounds, num_pcropp, filter_pcropp, init, crop_inst) ! Note that the size of dataptr1d includes ocean points so it will be around 3x larger than lsize ! So an explicit loop is required here - do g = 1,lsize + do g = bounds%begg, bounds%endg dataptr2d_gdd20_baseline(g,n) = dataptr1d_gdd20_baseline(g) end do end do @@ -723,8 +721,8 @@ subroutine cropcal_interp(bounds, num_pcropp, filter_pcropp, init, crop_inst) ! vegetated pft ig = g_to_ig(patch%gridcell(p)) - if (ig > lsize) then - write(iulog,'(a,i0,a,i0,a)') 'ig (',ig,') > lsize (',lsize,')' + if (ig < bounds%begg .or. ig > bounds%endg) then + write(iulog,'(a,i0,a,i0,a)') 'ig (',ig,') < begg (',bounds%begg,') or > endg (',bounds%endg,')' call ESMF_Finalize(endflag=ESMF_END_ABORT) end if @@ -760,7 +758,7 @@ subroutine cropcal_interp(bounds, num_pcropp, filter_pcropp, init, crop_inst) end if ! Note that the size of dataptr1d includes ocean points so it will be around 3x larger than lsize ! So an explicit loop is required here - do g = 1,lsize + do g = bounds%begg, bounds%endg ! If read-in value is invalid, set to -1. Will be handled later in this subroutine. if (dataptr1d_gdd20_season_start(g) <= 0 .or. dataptr1d_gdd20_season_start(g) > 366 & From 2156c7206c61a131d3a4a6da69940acafb3d1dcf Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Fri, 26 Jul 2024 08:40:18 -0600 Subject: [PATCH 0797/1248] Use begg/endg instead of referring to bounds%. --- src/cpl/share_esmf/cropcalStreamMod.F90 | 51 ++++++++++++++----------- 1 file changed, 29 insertions(+), 22 deletions(-) diff --git a/src/cpl/share_esmf/cropcalStreamMod.F90 b/src/cpl/share_esmf/cropcalStreamMod.F90 index 02cfc5e67a..5587641c21 100644 --- a/src/cpl/share_esmf/cropcalStreamMod.F90 +++ b/src/cpl/share_esmf/cropcalStreamMod.F90 @@ -422,6 +422,7 @@ subroutine cropcal_advance( bounds ) ! ! !LOCAL VARIABLES: integer :: g, ig ! Indices + integer :: begg, endg ! gridcell bounds 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 @@ -430,6 +431,9 @@ subroutine cropcal_advance( bounds ) integer :: rc !----------------------------------------------------------------------- + begg = bounds%begg + endg = bounds%endg + call get_curr_date(year, mon, day, sec) mcdate = year*10000 + mon*100 + day if (use_cropcal_rx_swindows) then @@ -471,9 +475,9 @@ subroutine cropcal_advance( bounds ) end if if ( .not. allocated(g_to_ig) )then - allocate (g_to_ig(bounds%begg:bounds%endg) ) + allocate (g_to_ig(begg:endg) ) ig = 0 - do g = bounds%begg,bounds%endg + do g = begg,endg ig = ig+1 g_to_ig(g) = ig end do @@ -508,6 +512,7 @@ subroutine cropcal_interp(bounds, num_pcropp, filter_pcropp, init, crop_inst) integer :: dayspyr integer :: n, g integer :: rc + integer :: begg, endg integer :: begp, endp real(r8), pointer :: dataptr1d_swindow_start(:) real(r8), pointer :: dataptr1d_swindow_end (:) @@ -530,8 +535,10 @@ subroutine cropcal_interp(bounds, num_pcropp, filter_pcropp, init, crop_inst) gdd20_season_ends => crop_inst%gdd20_season_end_patch & ) - SHR_ASSERT_FL( (lbound(g_to_ig,1) <= bounds%begg ), sourcefile, __LINE__) - SHR_ASSERT_FL( (ubound(g_to_ig,1) >= bounds%endg ), sourcefile, __LINE__) + begg = bounds%begg + endg = bounds%endg + SHR_ASSERT_FL( (lbound(g_to_ig,1) <= begg ), sourcefile, __LINE__) + SHR_ASSERT_FL( (ubound(g_to_ig,1) >= endg ), sourcefile, __LINE__) ! Get pointer for stream data that is time and spatially interpolate to model time and grid ! Place all data from each type into a temporary 2d array @@ -542,10 +549,10 @@ subroutine cropcal_interp(bounds, num_pcropp, filter_pcropp, init, crop_inst) dayspyr = get_curr_days_per_year() ! Read prescribed sowing window start dates from input files - allocate(dataptr2d_swindow_start(bounds%begg:bounds%endg, ncft)) - dataptr2d_swindow_start(bounds%begg:bounds%endg,:) = -1._r8 - allocate(dataptr2d_swindow_end (bounds%begg:bounds%endg, ncft)) - dataptr2d_swindow_end(bounds%begg:bounds%endg,:) = -1._r8 + allocate(dataptr2d_swindow_start(begg:endg, ncft)) + dataptr2d_swindow_start(begg:endg,:) = -1._r8 + allocate(dataptr2d_swindow_end (begg:endg, ncft)) + dataptr2d_swindow_end(begg:endg,:) = -1._r8 if (use_cropcal_rx_swindows) then ! Starting with npcropmin will skip generic crops do n = 1, ncft @@ -561,7 +568,7 @@ subroutine cropcal_interp(bounds, num_pcropp, filter_pcropp, init, crop_inst) end if ! Note that the size of dataptr1d includes ocean points so it will be around 3x larger than lsize ! So an explicit loop is required here - do g = bounds%begg, bounds%endg + do g = begg, endg ! If read-in value is invalid, set to -1. Will be handled later in this subroutine. if (dataptr1d_swindow_start(g) <= 0 .or. dataptr1d_swindow_start(g) > dayspyr & @@ -629,7 +636,7 @@ subroutine cropcal_interp(bounds, num_pcropp, filter_pcropp, init, crop_inst) deallocate(dataptr2d_swindow_start) deallocate(dataptr2d_swindow_end) - allocate(dataptr2d_cultivar_gdds(bounds%begg:bounds%endg, ncft)) + allocate(dataptr2d_cultivar_gdds(begg:endg, ncft)) if (use_cropcal_rx_cultivar_gdds) then ! Read prescribed cultivar GDDs from input files ! Starting with npcropmin will skip generic crops @@ -642,7 +649,7 @@ subroutine cropcal_interp(bounds, num_pcropp, filter_pcropp, init, crop_inst) ! Note that the size of dataptr1d includes ocean points so it will be around 3x larger than lsize ! So an explicit loop is required here - do g = bounds%begg, bounds%endg + do g = begg, endg ! If read-in value is invalid, have PlantCrop() set gddmaturity to PFT-default value. if (dataptr1d_cultivar_gdds(g) < 0 .or. dataptr1d_cultivar_gdds(g) > 1000000._r8) then @@ -670,8 +677,8 @@ subroutine cropcal_interp(bounds, num_pcropp, filter_pcropp, init, crop_inst) ! vegetated pft ig = g_to_ig(patch%gridcell(p)) - if (ig < bounds%begg .or. ig > bounds%endg) then - write(iulog,'(a,i0,a,i0,a)') 'ig (',ig,') < begg (',bounds%begg,') or > endg (',bounds%endg,')' + if (ig < begg .or. ig > endg) then + write(iulog,'(a,i0,a,i0,a)') 'ig (',ig,') < begg (',begg,') or > endg (',endg,')' call ESMF_Finalize(endflag=ESMF_END_ABORT) end if @@ -686,7 +693,7 @@ subroutine cropcal_interp(bounds, num_pcropp, filter_pcropp, init, crop_inst) deallocate(dataptr2d_cultivar_gdds) - allocate(dataptr2d_gdd20_baseline(bounds%begg:bounds%endg, ncft)) + allocate(dataptr2d_gdd20_baseline(begg:endg, ncft)) if (adapt_cropcal_rx_cultivar_gdds) then ! Read GDD20 baselines from input files ! Starting with npcropmin will skip generic crops @@ -699,7 +706,7 @@ subroutine cropcal_interp(bounds, num_pcropp, filter_pcropp, init, crop_inst) ! Note that the size of dataptr1d includes ocean points so it will be around 3x larger than lsize ! So an explicit loop is required here - do g = bounds%begg, bounds%endg + do g = begg, endg dataptr2d_gdd20_baseline(g,n) = dataptr1d_gdd20_baseline(g) end do end do @@ -721,8 +728,8 @@ subroutine cropcal_interp(bounds, num_pcropp, filter_pcropp, init, crop_inst) ! vegetated pft ig = g_to_ig(patch%gridcell(p)) - if (ig < bounds%begg .or. ig > bounds%endg) then - write(iulog,'(a,i0,a,i0,a)') 'ig (',ig,') < begg (',bounds%begg,') or > endg (',bounds%endg,')' + if (ig < begg .or. ig > endg) then + write(iulog,'(a,i0,a,i0,a)') 'ig (',ig,') < begg (',begg,') or > endg (',endg,')' call ESMF_Finalize(endflag=ESMF_END_ABORT) end if @@ -739,10 +746,10 @@ subroutine cropcal_interp(bounds, num_pcropp, filter_pcropp, init, crop_inst) ! Read prescribed gdd20 season start dates from input files - allocate(dataptr2d_gdd20_season_start(bounds%begg:bounds%endg, ncft)) - dataptr2d_gdd20_season_start(bounds%begg:bounds%endg,:) = -1._r8 - allocate(dataptr2d_gdd20_season_end (bounds%begg:bounds%endg, ncft)) - dataptr2d_gdd20_season_end(bounds%begg:bounds%endg,:) = -1._r8 + allocate(dataptr2d_gdd20_season_start(begg:endg, ncft)) + dataptr2d_gdd20_season_start(begg:endg,:) = -1._r8 + allocate(dataptr2d_gdd20_season_end (begg:endg, ncft)) + dataptr2d_gdd20_season_end(begg:endg,:) = -1._r8 if (stream_gdd20_seasons) then ! Starting with npcropmin will skip generic crops do n = 1, ncft @@ -758,7 +765,7 @@ subroutine cropcal_interp(bounds, num_pcropp, filter_pcropp, init, crop_inst) end if ! Note that the size of dataptr1d includes ocean points so it will be around 3x larger than lsize ! So an explicit loop is required here - do g = bounds%begg, bounds%endg + do g = begg, endg ! If read-in value is invalid, set to -1. Will be handled later in this subroutine. if (dataptr1d_gdd20_season_start(g) <= 0 .or. dataptr1d_gdd20_season_start(g) > 366 & From b1aed3f36e79cb8eaf278f1a72be77de88ad1c64 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Fri, 26 Jul 2024 09:12:57 -0600 Subject: [PATCH 0798/1248] Update ChangeLog and ChangeSum. --- doc/ChangeLog | 13 ++++++------- doc/ChangeSum | 2 +- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index 501a67720f..88c322e990 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,7 +1,7 @@ =============================================================== Tag name: ctsm5.2.016 Originator(s): samrabin (Sam Rabin, UCAR/TSS, samrabin@ucar.edu) -Date: Thu Jul 25 22:39:39 MST 2024 +Date: Fri 26 Jul 2024 09:11:52 AM MDT One-line Summary: Enable new crop calendars for clm60 compsets Purpose and description of changes @@ -89,22 +89,21 @@ Note that testmods marked "experimental" are fine to be marked as expected failu Testing summary: ---------------- -[Remove any lines that don't apply.] - [PASS means all tests PASS; OK means tests PASS other than expected fails.] build-namelist tests (if CLMBuildNamelist.pm has changed): - derecho - + derecho - FAIL + 1x1_cidadinhoBR tests only. That's fine. Filed Issue #2666: 1x1_cidadinhoBR tests fail in build-namelist_test.pl (https://github.com/ESCOMP/CTSM/issues/2666). python testing (if python code has changed; see instructions in python/README.md; document testing done): - (any machine) - + derecho - PASS regular tests (aux_clm: https://github.com/ESCOMP/CTSM/wiki/System-Testing-Guide#pre-merge-system-testing): - derecho ----- - izumi ------- + derecho ----- OK + izumi ------- OK Answer changes -------------- diff --git a/doc/ChangeSum b/doc/ChangeSum index f043ab8b34..edc9e4cada 100644 --- a/doc/ChangeSum +++ b/doc/ChangeSum @@ -1,6 +1,6 @@ Tag Who Date Summary ============================================================================================================================ - ctsm5.2.016 samrabin 07/25/2024 Enable new crop calendars for clm60 compsets + ctsm5.2.016 samrabin 07/26/2024 Enable new crop calendars for clm60 compsets ctsm5.2.015 multiple 07/22/2024 Update submodule tags to pass runoff from cism to rof ctsm5.2.014 multiple 07/19/2024 use_matrixcn, use_soil_matrixcn come in as default .false. ctsm5.2.013 glemieux 07/18/2024 FATES Land Use V2 From d393cbfcdad4ed023cf97736265e819e6c195687 Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Fri, 26 Jul 2024 09:14:00 -0700 Subject: [PATCH 0799/1248] update fates tag This addresses #2656 --- .gitmodules | 2 +- src/fates | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitmodules b/.gitmodules index 19bc024208..4e9f5b51fb 100644 --- a/.gitmodules +++ b/.gitmodules @@ -28,7 +28,7 @@ [submodule "fates"] path = src/fates url = https://github.com/NGEET/fates -fxtag = sci.1.77.1_api.36.0.0 +fxtag = sci.1.77.2_api.36.0.0 fxrequired = AlwaysRequired # Standard Fork to compare to with "git fleximod test" to ensure personal forks aren't committed fxDONOTUSEurl = https://github.com/NCAR/fates-release diff --git a/src/fates b/src/fates index 1982b0032c..e372f0b6cd 160000 --- a/src/fates +++ b/src/fates @@ -1 +1 @@ -Subproject commit 1982b0032c3cab6278892eccb85f643114ffb1af +Subproject commit e372f0b6cdf46f76f888ee6ac92d9a3572464e8b From 66e28d184b6d68f55c8ac2bf3d26b5d46399e7bb Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Fri, 26 Jul 2024 12:12:23 -0600 Subject: [PATCH 0800/1248] Changes one Izumi test from f19 to 10x15 resolution. - Was: ERS_D.f19_g17.I1850Clm50BgcCrop.izumi_nag.clm-ciso_monthly_matrixcn_spinup - Now: ERS_D.f10_f10_mg37.I1850Clm50BgcCrop.izumi_nag.clm-ciso_monthly_matrixcn_spinup Fixes ESCOMP/CTSM#2667: Change out a f19 resolution test on Izumi for f10 (https://github.com/ESCOMP/CTSM/issues/2667) --- cime_config/testdefs/testlist_clm.xml | 8 ++++++++ doc/ChangeLog | 9 +++++---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index bb421c8e9e..951e0d8d5b 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -863,6 +863,14 @@ + + + + + + + + diff --git a/doc/ChangeLog b/doc/ChangeLog index 88c322e990..0057567561 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,7 +1,7 @@ =============================================================== Tag name: ctsm5.2.016 Originator(s): samrabin (Sam Rabin, UCAR/TSS, samrabin@ucar.edu) -Date: Fri 26 Jul 2024 09:11:52 AM MDT +Date: Fri Jul 26 12:20:46 MDT 2024 One-line Summary: Enable new crop calendars for clm60 compsets Purpose and description of changes @@ -35,12 +35,10 @@ Bugs fixed List of CTSM issues fixed (include CTSM Issue # and description): - Fixes ESCOMP/CTSM#2584: Reset accumulators to initval instead of 0 (https://github.com/ESCOMP/CTSM/issues/2584) +- Fixes ESCOMP/CTSM#2667: Change out a f19 resolution test on Izumi for f10 (https://github.com/ESCOMP/CTSM/issues/2667) Notes of particular relevance for users --------------------------------------- -[Remove any lines that don't apply. Remove entire section if nothing applies.] - -Caveats for users (e.g., need to interpolate initial conditions): Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): - Add cropcals_rx, default false. @@ -82,6 +80,9 @@ Changes to tests or testing: - StreamGDD20Seasons (experimental) - Removes sowingWindows testmod - Adds and changes various tests related to crop calendars +- Changes one Izumi test from f19 to 10x15 resolution: + - Was: ERS_D.f19_g17.I1850Clm50BgcCrop.izumi_nag.clm-ciso_monthly_matrixcn_spinup + - Now: ERS_D.f10_f10_mg37.I1850Clm50BgcCrop.izumi_nag.clm-ciso_monthly_matrixcn_spinup Note that testmods marked "experimental" are fine to be marked as expected failures, if needed. From 3ee733375e55e024054904244bf341526b70fc23 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Fri, 26 Jul 2024 13:31:35 -0600 Subject: [PATCH 0801/1248] Bring in changes from Danny into the soil state functions, and update dust unit tests to use the appropriate ones for Zender and Leung tests, add tests for the new MassFracClayLeung2023 function, get the unit tests all working again --- .../DustEmis_test/test_DustEmisLeung2023.pf | 4 +-- .../DustEmis_test/test_DustEmisZender2003.pf | 6 ++--- src/biogeophys/SoilStateInitTimeConstMod.F90 | 24 ++++++++++++++--- .../test_dust_soil_clay_functions.pf | 17 +++++++++++- src/unit_test_shr/unittestDustEmisInputs.F90 | 27 ++++++++++++++++--- 5 files changed, 64 insertions(+), 14 deletions(-) diff --git a/src/biogeochem/test/DustEmis_test/test_DustEmisLeung2023.pf b/src/biogeochem/test/DustEmis_test/test_DustEmisLeung2023.pf index 5fdf20b89d..2b87f4be0a 100644 --- a/src/biogeochem/test/DustEmis_test/test_DustEmisLeung2023.pf +++ b/src/biogeochem/test/DustEmis_test/test_DustEmisLeung2023.pf @@ -35,10 +35,10 @@ contains ! Allocate and initialize the test object for input objects dust-emission needs character(len=5) :: NLFilename = 'none' - call this%input%setUp() + dust_emis_method = 'Leung_2023' + call this%input%setUp( dust_emis_method=dust_emis_method ) ! Create the dust emission object last - dust_emis_method = 'Leung_2023' allocate(this%dust_emis, source = create_dust_emissions(bounds, NLFilename)) end subroutine setUp diff --git a/src/biogeochem/test/DustEmis_test/test_DustEmisZender2003.pf b/src/biogeochem/test/DustEmis_test/test_DustEmisZender2003.pf index 212da0af5a..db5b54aa08 100644 --- a/src/biogeochem/test/DustEmis_test/test_DustEmisZender2003.pf +++ b/src/biogeochem/test/DustEmis_test/test_DustEmisZender2003.pf @@ -107,7 +107,7 @@ contains call this%dust_emis%GetPatchVars( p, flx_mss_vrt_dst_tot=flx_mss_vrt_dst_tot, & vlc_trb_1=vlc_trb_1, vlc_trb_2=vlc_trb_2, vlc_trb_3=vlc_trb_3, & vlc_trb_4=vlc_trb_4) - @assertEqual( flx_mss_vrt_dst_tot, 1.208384635884010d-5, tolerance=tol ) + @assertEqual( flx_mss_vrt_dst_tot, 2.583480541056971d-6, tolerance=tol ) @assertEqual( vlc_trb_1, 3.407721147709135d-003, tolerance=tol ) @assertEqual( vlc_trb_2, 4.961153753164878d-003, tolerance=tol ) @assertEqual( vlc_trb_3, 4.980100969983446d-003, tolerance=tol ) @@ -270,7 +270,7 @@ contains call this%validate_patch(p) call this%dust_emis%GetPatchVars( p, flx_mss_vrt_dst_tot=flx_mss_vrt_dst_tot ) total_dust0 = flx_mss_vrt_dst_tot - @assertEqual( flx_mss_vrt_dst_tot, 1.063573374792962d-4, tolerance=tol ) + @assertEqual( flx_mss_vrt_dst_tot, 2.273879554711299d-5, tolerance=tol ) end do ! Double u10 and show result is higher call this%input%create_fv( u10=u10*2.0_r8, fv=fv) @@ -282,7 +282,7 @@ contains call this%validate_patch(p) call this%dust_emis%GetPatchVars( p, flx_mss_vrt_dst_tot=flx_mss_vrt_dst_tot ) total_dust_higher = flx_mss_vrt_dst_tot - @assertEqual( flx_mss_vrt_dst_tot, 1.774023264204829d-4, tolerance=tol ) + @assertEqual( flx_mss_vrt_dst_tot, 3.792794484764924d-5, tolerance=tol ) end do @assertGreaterThan( total_dust_higher, total_dust0 ) diff --git a/src/biogeophys/SoilStateInitTimeConstMod.F90 b/src/biogeophys/SoilStateInitTimeConstMod.F90 index ce051514bd..f03e1f83c7 100644 --- a/src/biogeophys/SoilStateInitTimeConstMod.F90 +++ b/src/biogeophys/SoilStateInitTimeConstMod.F90 @@ -10,6 +10,8 @@ module SoilStateInitTimeConstMod use LandunitType , only : lun use ColumnType , only : col use PatchType , only : patch + use abortUtils , only : endrun + use shr_infnan_mod, only : nan => shr_infnan_nan, assignment(=) ! implicit none private @@ -22,6 +24,7 @@ module SoilStateInitTimeConstMod public :: ThresholdSoilMoistZender2003 public :: ThresholdSoilMoistKok2014 public :: MassFracClay + public :: MassFracClayLeung2023 ! ! !PRIVATE MEMBER FUNCTIONS: private :: ReadNL @@ -177,6 +180,7 @@ subroutine SoilStateInitTimeConst(bounds, soilstate_inst, nlfilename) use clm_varcon , only : secspday, denh2o, denice, grlnd use clm_varctl , only : use_cn, use_lch4, use_fates use clm_varctl , only : iulog, fsurdat, paramfile, soil_layerstruct_predefined + use clm_varctl , only : dust_emis_method use landunit_varcon , only : istdlak, istwet, istsoil, istcrop, istice use column_varcon , only : icol_roof, icol_sunwall, icol_shadewall, icol_road_perv, icol_road_imperv use fileutils , only : getfil @@ -717,7 +721,11 @@ subroutine SoilStateInitTimeConst(bounds, soilstate_inst, nlfilename) g = col%gridcell(c) soilstate_inst%gwc_thr_col(c) = ThresholdSoilMoistZender2003( clay3d(g,1) ) - soilstate_inst%mss_frc_cly_vld_col(c) = MassFracClay( clay3d(g,1) ) + if ( trim(dust_emis_method) == "Leung_2023" ) then + soilstate_inst%mss_frc_cly_vld_col(c) = MassFracClayLeung2023( clay3d(g,1) ) + else + soilstate_inst%mss_frc_cly_vld_col(c) = MassFracClay( clay3d(g,1) ) + end if end do @@ -757,8 +765,6 @@ real(r8) function ThresholdSoilMoistZender2003( clay ) ! Notes from: dmleung 19 Feb 2024. ! !------------------------------------------------------------------------------ - use abortUtils , only : endrun - use shr_infnan_mod, only : nan => shr_infnan_nan, assignment(=) real(r8), intent(IN) :: clay ! Fraction of clay in the soil (%) if ( clay < 0.0_r8 .or. clay > 100.0_r8 )then @@ -800,9 +806,19 @@ real(r8) function MassFracClay( clay ) real(r8), intent(IN) :: clay ! Fraction of lay in the soil (%) MassFracClay = min(clay * 0.01_r8, 0.20_r8) - MassFracClay = 0.1_r8 + MassFracClay * 0.1_r8 / 0.20_r8 ! dmleung added this line to reduce the sensitivity of dust emission flux to clay fraction in DUSTMod. 5 Jul 2024 end function MassFracClay !------------------------------------------------------------------------------ + real(r8) function MassFracClayLeung2023( clay ) + ! Calculate the mass fraction of clay needed for dust emission, based on clay content + ! Based on the base Zender_2003 version, with a slight modification for Leung_2023 + real(r8), intent(IN) :: clay ! Fraction of lay in the soil (%) + + MassFracClayLeung2023 = MassFracClay( clay ) + MassFracClayLeung2023 = 0.1_r8 + MassFracClayLeung2023 * 0.1_r8 / 0.20_r8 ! dmleung added this line to reduce the sensitivity of dust emission flux to clay fraction in DUSTMod. 5 Jul 2024 + end function MassFracClayLeung2023 + + !------------------------------------------------------------------------------ + end module SoilStateInitTimeConstMod diff --git a/src/biogeophys/test/SoilStateInitTimeConst_test/test_dust_soil_clay_functions.pf b/src/biogeophys/test/SoilStateInitTimeConst_test/test_dust_soil_clay_functions.pf index 867e7ace6a..53a3d66987 100644 --- a/src/biogeophys/test/SoilStateInitTimeConst_test/test_dust_soil_clay_functions.pf +++ b/src/biogeophys/test/SoilStateInitTimeConst_test/test_dust_soil_clay_functions.pf @@ -70,7 +70,7 @@ contains real(r8) :: value value = MassFracClay( 0.0_r8 ) - @assertEqual( value, 0.1_r8, tolerance=tol ) + @assertEqual( value, 0.0_r8, tolerance=tol ) value = MassFracClay( 20.0_r8 ) @assertEqual( value, 0.20_r8, tolerance=tol ) value = MassFracClay( 25.0_r8 ) @@ -78,4 +78,19 @@ contains end subroutine TestClayMassFracValues + + @Test + subroutine TestClayMassFracValuesLeung2023(this) + class(TestDustEmisSoilFunctions), intent(inout) :: this + real(r8) :: value + + value = MassFracClayLeung2023( 0.0_r8 ) + @assertEqual( value, 0.1_r8, tolerance=tol ) + value = MassFracClayLeung2023( 20.0_r8 ) + @assertEqual( value, 0.20_r8, tolerance=tol ) + value = MassFracClayLeung2023( 25.0_r8 ) + @assertEqual( value, 0.20_r8, tolerance=tol ) + + end subroutine TestClayMassFracValuesLeung2023 + end module test_dust_soil_clay_functions diff --git a/src/unit_test_shr/unittestDustEmisInputs.F90 b/src/unit_test_shr/unittestDustEmisInputs.F90 index 6b15680ef7..d272002638 100644 --- a/src/unit_test_shr/unittestDustEmisInputs.F90 +++ b/src/unit_test_shr/unittestDustEmisInputs.F90 @@ -16,6 +16,8 @@ module unittestDustEmisInputs use FrictionVelocityMod, only : frictionvel_type use unittestWaterTypeFactory, only : unittest_water_type_factory_type use SoilStateInitTimeConstMod, only : ThresholdSoilMoistZender2003, MassFracClay + use SoilStateInitTimeConstMod, only : MassFracClayLeung2023 + use abortutils, only : endrun implicit none private @@ -43,9 +45,10 @@ module unittestDustEmisInputs !----------------------------------------------------------------------- - subroutine setUp(this) + subroutine setUp(this, dust_emis_method) use ColumnType, only : col class(unittest_dust_emis_input_type), intent(inout) :: this + character(len=*), intent(in), optional :: dust_emis_method ! Allocate and initiatlize the test object for input objects dust-emission needs character(len=5) :: NLFilename = 'none' @@ -54,6 +57,14 @@ subroutine setUp(this) integer :: c type(atm2lnd_params_type) :: atm2lnd_params integer, parameter :: snl = 3 + character(len=50) :: in_dust_emis_method + + !----------------------------------------------------------------------- + if ( present(dust_emis_method) )then + in_dust_emis_method = trim(dust_emis_method) + else + in_dust_emis_method = "Zender_2003" + end if ! Settings needed for clm_varpar soil_layerstruct_predefined = '20SL_8.5m' @@ -83,7 +94,7 @@ subroutine setUp(this) call this%atm2lnd_inst%InitForTesting(bounds, atm2lnd_params) ! Water and soil state -- after the subgrid setup call this%water_factory%setup_after_subgrid(snl = snl) - call this%setupSoilState( ) ! This needs to happen before the water_type object creation + call this%setupSoilState( in_dust_emis_method ) ! This needs to happen before the water_type object creation call this%water_factory%create_water_type(this%water_inst, watsat_col=this%soilstate_inst%watsat_col) ! Canopy state, friction velocity, and temperature state ojects call this%canopystate_inst%SetNMLForTesting() @@ -113,7 +124,7 @@ end subroutine tearDown !----------------------------------------------------------------------- - subroutine setupSoilState(this) + subroutine setupSoilState(this, dust_emis_method) ! ! !DESCRIPTION: ! Sets up the external environment used by Dust emissions - i.e., things accessed via @@ -125,6 +136,7 @@ subroutine setupSoilState(this) use ColumnType, only : col use GridcellType, only : grc class(unittest_dust_emis_input_type), intent(in) :: this + character(len=*), intent(in) :: dust_emis_method ! integer :: c,j real(r8), parameter :: clay = 10.0_r8 @@ -145,7 +157,14 @@ subroutine setupSoilState(this) ! These are needed for dust emissions initialization do c = bounds%begc, bounds%endc this%soilstate_inst%gwc_thr_col(c) = ThresholdSoilMoistZender2003( clay ) - this%soilstate_inst%mss_frc_cly_vld_col(c) = MassFracClay( clay ) + if ( trim(dust_emis_method) == "Zender_2003")then + this%soilstate_inst%mss_frc_cly_vld_col(c) = MassFracClay( clay ) + else if ( trim(dust_emis_method) == "Leung_2023")then + this%soilstate_inst%mss_frc_cly_vld_col(c) = MassFracClayLeung2023( clay ) + else + print *, 'dust_emis_method = ', trim(dust_emis_method) + call endrun("ERROR: do NOT know about this dust_emis_method") + end if end do end subroutine setupSoilState From cc96bedc0b848d251c1a959598b06a11bbf10e4b Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Sat, 27 Jul 2024 08:58:51 -0700 Subject: [PATCH 0802/1248] fix fates history output type in LUH2 tests --- .../testdefs/testmods_dirs/clm/FatesColdLUH2/user_nl_clm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2/user_nl_clm index 6478669bee..55650230a4 100644 --- a/cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2/user_nl_clm +++ b/cime_config/testdefs/testmods_dirs/clm/FatesColdLUH2/user_nl_clm @@ -8,4 +8,4 @@ use_fates_fixed_biogeog = .true. use_fates_sp = .false. use_fates_potentialveg = .false. hist_fincl1 = 'FATES_PATCHAREA_LU', 'FATES_DISTURBANCE_RATE_MATRIX_LULU', -'FATES_TRANSITIONS_MATRIX_LULU' +'FATES_TRANSITION_MATRIX_LULU' From 2422cef7f1e0ef1cc184eb51c0f973f2125396e9 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Sat, 27 Jul 2024 17:15:10 -0600 Subject: [PATCH 0803/1248] Update date on Change files --- doc/ChangeLog | 2 +- doc/ChangeSum | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index 0057567561..79d640242d 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,7 +1,7 @@ =============================================================== Tag name: ctsm5.2.016 Originator(s): samrabin (Sam Rabin, UCAR/TSS, samrabin@ucar.edu) -Date: Fri Jul 26 12:20:46 MDT 2024 +Date: Sat 27 Jul 2024 05:13:08 PM MDT One-line Summary: Enable new crop calendars for clm60 compsets Purpose and description of changes diff --git a/doc/ChangeSum b/doc/ChangeSum index edc9e4cada..382e5cf7cb 100644 --- a/doc/ChangeSum +++ b/doc/ChangeSum @@ -1,6 +1,6 @@ Tag Who Date Summary ============================================================================================================================ - ctsm5.2.016 samrabin 07/26/2024 Enable new crop calendars for clm60 compsets + ctsm5.2.016 samrabin 07/27/2024 Enable new crop calendars for clm60 compsets ctsm5.2.015 multiple 07/22/2024 Update submodule tags to pass runoff from cism to rof ctsm5.2.014 multiple 07/19/2024 use_matrixcn, use_soil_matrixcn come in as default .false. ctsm5.2.013 glemieux 07/18/2024 FATES Land Use V2 From ef8acabe22df4925f33b7e09172a2af5fb73c28a Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Sun, 28 Jul 2024 12:49:55 -0600 Subject: [PATCH 0804/1248] Bring in actuall Leung_2023 DustEmissions subroutine, unit test fails because of change in answers --- src/biogeochem/DustEmisLeung2023.F90 | 331 +++++++++++++++++++++------ 1 file changed, 260 insertions(+), 71 deletions(-) diff --git a/src/biogeochem/DustEmisLeung2023.F90 b/src/biogeochem/DustEmisLeung2023.F90 index 0acd254c92..f6cd6bed89 100644 --- a/src/biogeochem/DustEmisLeung2023.F90 +++ b/src/biogeochem/DustEmisLeung2023.F90 @@ -24,8 +24,8 @@ module DustEmisLeung2023 use atm2lndType , only : atm2lnd_type use SoilStateType , only : soilstate_type use CanopyStateType , only : canopystate_type - use WaterStateBulkType , only : waterstatebulk_type - use WaterDiagnosticBulkType , only : waterdiagnosticbulk_type + use WaterStateBulkType , only : waterstatebulk_type + use WaterDiagnosticBulkType, only : waterdiagnosticbulk_type use FrictionVelocityMod , only : frictionvel_type use LandunitType , only : lun use PatchType , only : patch @@ -47,7 +47,7 @@ module DustEmisLeung2023 real(r8), pointer, private :: dst_emiss_coeff_patch (:) ! dust emission coefficient (unitless) real(r8), pointer, private :: wnd_frc_thr_patch (:) ! wet fluid threshold (m/s) real(r8), pointer, private :: wnd_frc_thr_dry_patch (:) ! dry fluid threshold (m/s) - real(r8), pointer, private :: wnd_frc_thr_it_patch (:) ! impact threshold (m/s) + real(r8), pointer, private :: wnd_frc_thr_it_patch (:) ! impact threshold (m/s) real(r8), pointer, private :: lnd_frc_mble_patch (:) ! land mobile fraction real(r8), pointer, private :: liq_frac_patch (:) ! liquid fraction of total water real(r8), pointer, private :: wnd_frc_soil_patch (:) ! soil wind friction velocity (m/s) @@ -62,7 +62,7 @@ module DustEmisLeung2023 real(r8), pointer, private :: prb_crs_fld_thr_patch (:) ! probability of wind speed crossing fluid threshold real(r8), pointer, private :: prb_crs_impct_thr_patch (:) ! probability of wind speed crossing impact threshold real(r8), pointer, private :: ssr_patch (:) ! [dimless] integrated shear stress ratiio, defined by Okin (2008) and then integrated by Caroline Pierre et al. (2014) - real(r8), pointer, private :: vai_Okin_patch (:) ! [m2 leaf /m2 land] LAI+SAI for calculating Okin drag partition + real(r8), pointer, private :: vai_Okin_patch (:) ! [m2 leaf /m2 land] LAI+SAI for calculating Okin drag partition real(r8), pointer, private :: frc_thr_rghn_fct_patch (:) ! [dimless] hybrid drag partition (or called roughness) factor real(r8), pointer, private :: wnd_frc_thr_std_patch (:) ! standardized fluid threshold friction velocity (m/s) type(prigent_roughness_stream_type), private :: prigent_roughness_stream ! Prigent roughness stream data @@ -316,7 +316,7 @@ subroutine InitCold(this, bounds) ! ! !LOCAL VARIABLES: !----------------------------------------------------------------------- - ! Caulculate Drag Partition factor (Marticorena and Bergametti 1995 formulation) + ! Calculate Drag Partition factor (Marticorena and Bergametti 1995 formulation) if ( this%prigent_roughness_stream%useStreams() )then !if usestreams == true, and it should be always true call this%CalcDragPartition( bounds ) else @@ -367,8 +367,6 @@ subroutine DustEmission (this, bounds, & real(r8) :: flx_mss_vrt_dst_ttl(bounds%begp:bounds%endp) real(r8) :: frc_thr_wet_fct real(r8) :: frc_thr_rgh_fct - real(r8) :: wnd_frc_thr_slt - real(r8) :: wnd_rfr_thr_slt real(r8) :: wnd_frc_slt real(r8) :: lnd_frc_mbl(bounds%begp:bounds%endp) real(r8) :: bd @@ -378,20 +376,48 @@ subroutine DustEmission (this, bounds, & real(r8) :: sumwt(bounds%begl:bounds%endl) ! sum of weights logical :: found ! temporary for error check integer :: index + + real(r8) :: tmp2 ! calculates the dry fluid threshold using Shao and Lu (2000) scheme; + ! replace the tmp1 (Iversen and White, 1982) that was passed from Dustini to DustEmission; + ! tmp2 will be calculated here + real(r8) :: wnd_frc_thr_slt_std ! [m/s] The soil threshold friction speed at standard air density (1.2250 kg/m3) + real(r8) :: frag_expt ! fragmentation exponent + real(r8) :: wnd_frc_thr_slt_it ! [m/s] created for impact threshold friction velocity + real(r8) :: wnd_frc_thr_slt ! [m/s] used for wet fluid threshold friction velocity + real(r8) :: K_length ! [dimless] normalized mean interobstacle distance, or called gap length (Okin, 2008) + real(r8) :: bare_frc ! LUH2 bare soil land cover fraction + real(r8) :: veg_frc ! LUH2 natural vegetation + crop land cover fraction ! ! constants ! real(r8), parameter :: cst_slt = 2.61_r8 ! [frc] Saltation constant real(r8), parameter :: flx_mss_fdg_fct = 5.0e-4_r8 ! [frc] Empir. mass flx tuning eflx_lh_vegt - real(r8), parameter :: vai_mbl_thr = 0.3_r8 ! [m2 m-2] VAI threshold quenching dust mobilization + real(r8), parameter :: vai_mbl_thr = 1.0_r8 ! [m2 m-2] new VAI threshold; Danny M. Leung suggests 1, and Zender's scheme uses 0.3 + + real(r8), parameter :: Cd0 = 4.4e-5_r8 ! [dimless] proportionality constant in calculation of dust emission coefficient + real(r8), parameter :: Ca = 2.7_r8 ! [dimless] proportionality constant in scaling of dust emission exponent + real(r8), parameter :: Ce = 2.0_r8 ! [dimless] proportionality constant scaling exponential dependence of dust emission coefficient on standardized soil threshold friction speed + real(r8), parameter :: C_tune = 0.05_r8 ! [dimless] global tuning constant for vertical dust flux; set to produce ~same global dust flux in control sim (I_2000) as old parameterization + real(r8), parameter :: wnd_frc_thr_slt_std_min = 0.16_r8 ! [m/s] minimum standardized soil threshold friction speed + real(r8), parameter :: forc_rho_std = 1.2250_r8 ! [kg/m3] density of air at standard pressure (101325) and temperature (293 K) + real(r8), parameter :: dns_slt = 2650.0_r8 ! [kg m-3] Density of optimal saltation particles + real(r8), parameter :: B_it = 0.82_r8 ! [dimless] ratio = u_star_it / u_star_ft0 + real(r8), parameter :: k = 0.4_r8 ! [dimless] von Karman constant + real(r8), parameter :: f_0 = 0.32_r8 ! [dimless] SSR in the immediate lee of a plant + real(r8), parameter :: c_e = 4.8_r8 ! [dimless] e-folding distance velocity recovery + real(r8), parameter :: D_p = 130e-6_r8 ! [m] Medium soil particle diameter, assuming a global constant of ~130 um following Leung et al. (2023). dmleung 16 Feb 2024 + real(r8), parameter :: gamma_Shao = 1.65e-4_r8 ! [kg s-2] interparticle cohesion: fitting parameter in Shao and Lu (2000) (S&L00). dmleung 16 Feb 2024 + real(r8), parameter :: A_Shao = 0.0123_r8 ! [dimless] coefficient for aerodynamic force: fitting parameter in Shao and Lu (2000). dmleung 16 Feb 2024 + real(r8), parameter :: frag_expt_thr = 5.0_r8 ! [dimless] threshold for fragmentation exponent defined in Leung et al. (2023), somewhere within 3 to 5. It is used to prevent a local AOD blowup (over Patagonia, Argentina), but one can test larger values and relax the threshold if wanted. dmleung 16 Feb 2024 + real(r8), parameter :: z0a_glob = 1e-4_r8 ! [m] assumed globally constant aeolian roughness length value in Leung et al. (2023), for the log law of the wall for Comola et al. (2019) intermittency scheme. dmleung 20 Feb 2024 + real(r8), parameter :: hgt_sal = 0.1_r8 ! [m] saltation height used by Comola et al. (2019) intermittency scheme for the log law of the wall. dmleung 20 Feb 2024 + real(r8), parameter :: vai0_Okin = 0.1_r8 ! [m2/m2] minimum VAI needed for Okin-Pierre's vegetation drag partition equation. lai=0 in the equation will lead to infinity, so a small value is added into this lai dmleung defined. + real(r8), parameter :: zii = 1000.0_r8 ! [m] convective boundary layer height added by dmleung 20 Feb 2024, following other CTSM modules (e.g., CanopyFluxesMod). Should we transfer PBL height (PBLH) from CAM? + real(r8) :: numer ! Numerator term for threshold crossing rate + real(r8) :: denom ! Denominator term for threshold crossing rate character(len=*),parameter :: subname = 'DUSTEmission' !------------------------------------------------------------------------ - write(iulog,*) - write(iulog,*) - write(iulog,*) subname//'::WARNING: CURRENTLY THIS IS JUST THE ZENDER 2003 VERIONS OF DUST EMISSIONS!' - write(iulog,*) - write(iulog,*) associate( & forc_rho => atm2lnd_inst%forc_rho_downscaled_col , & ! Input: [real(r8) (:) ] downscaled density (kg/m**3) @@ -402,16 +428,40 @@ subroutine DustEmission (this, bounds, & tlai => canopystate_inst%tlai_patch , & ! Input: [real(r8) (:) ] one-sided leaf area index, no burying by snow tsai => canopystate_inst%tsai_patch , & ! Input: [real(r8) (:) ] one-sided stem area index, no burying by snow - frac_sno => waterdiagnosticbulk_inst%frac_sno_col , & ! Input: [real(r8) (:) ] fraction of ground covered by snow (0 to 1) - h2osoi_vol => waterstatebulk_inst%h2osoi_vol_col , & ! Input: [real(r8) (:,:) ] volumetric soil water (0<=h2osoi_vol<=watsat) - h2osoi_liq => waterstatebulk_inst%h2osoi_liq_col , & ! Input: [real(r8) (:,:) ] liquid soil water (kg/m2) - h2osoi_ice => waterstatebulk_inst%h2osoi_ice_col , & ! Input: [real(r8) (:,:) ] frozen soil water (kg/m2) + frac_sno => waterdiagnosticbulk_inst%frac_sno_col, & ! Input: [real(r8) (:) ] fraction of ground covered by snow (0 to 1) + h2osoi_vol => waterstatebulk_inst%h2osoi_vol_col , & ! Input: [real(r8) (:,:) ] volumetric soil water (0<=h2osoi_vol<=watsat) + h2osoi_liq => waterstatebulk_inst%h2osoi_liq_col , & ! Input: [real(r8) (:,:) ] liquid soil water (kg/m2) + h2osoi_ice => waterstatebulk_inst%h2osoi_ice_col , & ! Input: [real(r8) (:,:) ] frozen soil water (kg/m2) fv => frictionvel_inst%fv_patch , & ! Input: [real(r8) (:) ] friction velocity (m/s) (for dust model) u10 => frictionvel_inst%u10_patch , & ! Input: [real(r8) (:) ] 10-m wind (m/s) (created for dust model) flx_mss_vrt_dst => this%flx_mss_vrt_dst_patch , & ! Output: [real(r8) (:,:) ] surface dust emission (kg/m**2/s) - flx_mss_vrt_dst_tot => this%flx_mss_vrt_dst_tot_patch & ! Output: [real(r8) (:) ] total dust flux back to atmosphere (pft) + flx_mss_vrt_dst_tot => this%flx_mss_vrt_dst_tot_patch , & ! Output: [real(r8) (:) ] total dust flux back to atmosphere (pft) + ! below variables are defined in Kok et al. (2014) or (mostly) Leung et al. (2023) dust emission scheme. dmleung 16 Feb 2024 + dst_emiss_coeff => this%dst_emiss_coeff_patch , & ! Output dust emission coefficient + wnd_frc_thr => this%wnd_frc_thr_patch , & ! output fluid threshold + wnd_frc_thr_dry => this%wnd_frc_thr_dry_patch , & ! output dry fluid threshold + wnd_frc_thr_it => this%wnd_frc_thr_it_patch , & ! output impact threshold + lnd_frc_mble => this%lnd_frc_mble_patch , & ! output bare land fraction + wnd_frc_soil => this%wnd_frc_soil_patch , & ! soil friction velocity u_*s = (u_*)(f_eff) + gwc => this%gwc_patch , & ! output gravimetric water content + liq_frac => this%liq_frac_patch , & ! output fraction of liquid moisture + intrmtncy_fct => this%intrmtncy_fct_patch , & ! output intermittency factor eta (fraction of time that dust emission is active within a timestep) + stblty => this%stblty_patch , & ! stability in similarity theory (no need to output) + u_mean_slt => this%u_mean_slt_patch , & ! output mean wind speed at 0.1 m height translated from friction velocity using the log law of the wall, assuming neutral condition + u_sd_slt => this%u_sd_slt_patch , & ! output standard deviation of wind speed from similarity theory + u_fld_thr => this%u_fld_thr_patch , & ! output fluid threshold wind speed at 0.1 m height translated from the log law of the wall + u_impct_thr => this%u_impct_thr_patch , & ! output impact threshold wind speed at 0.1 m height translated from the log law of the wall + thr_crs_rate => this%thr_crs_rate_patch , & ! output threshold crossing rate in Comola 2019 intermittency parameterization + prb_crs_fld_thr => this%prb_crs_fld_thr_patch , & ! output probability of instantaneous wind crossing fluid threshold in Comola 2019 intermittency parameterization + prb_crs_impct_thr => this%prb_crs_impct_thr_patch , & ! output probability of instantaneous wind crossing impact threshold in Comola 2019 intermittency parameterization + ssr => this%ssr_patch , & ! output vegetation drag partition factor in Okin 2008 vegetation roughness effect (called shear stress ratio, SSR in Okin 2008) + vai_Okin => this%vai_Okin_patch , & ! vegetation area index for calculating Okin-Pierre vegetation drag partitioning. vai=0 in the ssr equation will lead to infinity, so a small value is added into this vai dmleung defined. (no need to output) 16 Feb 2024 + frc_thr_rghn_fct => this%frc_thr_rghn_fct_patch , & ! output hybrid/total drag partition factor considering both rock and vegetation drag partition factors. + wnd_frc_thr_std => this%wnd_frc_thr_std_patch , & ! standardized dust emission threshold friction velocity defined in Jasper Kok et al. (2014). + dpfct_rock => this%dpfct_rock_patch , & ! output rock drag partition factor defined in Marticorena and Bergametti 1995. A fraction between 0 and 1. + obu => frictionvel_inst%obu_patch & ! Input: [real(r8) (:) ] Monin-Obukhov length from the friction Velocity module obu => frictionvel_inst%obu_patch & ! Input: [real(r8) (:) ] Monin-Obukhov length from the friction Velocity module ) ttlai(bounds%begp : bounds%endp) = 0._r8 @@ -486,11 +536,33 @@ subroutine DustEmission (this, bounds, & end if end do + ! dmleung add output for bare_frc and veg_frc here if wanted !!!!---------------------- + ! reset history output variables before next if-statement to avoid output = inf do fp = 1,num_nolakep p = filter_nolakep(fp) flx_mss_vrt_dst_tot(p) = 0.0_r8 + dst_emiss_coeff(p) = 0.0_r8 + wnd_frc_thr(p) = 0.0_r8 + wnd_frc_thr_dry(p) = 0.0_r8 + lnd_frc_mble(p) = 0.0_r8 + wnd_frc_soil(p) = 0.0_r8 + gwc(p) = 0.0_r8 + liq_frac(p) = 0.0_r8 + u_mean_slt(p) = 0.0_r8 + u_sd_slt(p) = 0.0_r8 + stblty(p) = 0.0_r8 + u_fld_thr(p) = 0.0_r8 + u_impct_thr(p) = 0.0_r8 + thr_crs_rate(p) = 0.0_r8 + prb_crs_fld_thr(p) = 0.0_r8 + prb_crs_impct_thr(p) = 0.0_r8 + intrmtncy_fct(p) = 0.0_r8 + ssr(p) = 0.0_r8 + vai_Okin(p) = 0.0_r8 + frc_thr_rghn_fct(p) = 0.0_r8 + wnd_frc_thr_std(p) = 0.0_r8 end do do n = 1, ndst do fp = 1,num_nolakep @@ -505,86 +577,203 @@ subroutine DustEmission (this, bounds, & l = patch%landunit(p) g = patch%gridcell(p) - ! only perform the following calculations if lnd_frc_mbl is non-zero - - if (lnd_frc_mbl(p) > 0.0_r8) then + !-------------------------------------------------------------------------------------------------- + ! put dust emission calculation here to output threshold friction velocity for the whole globe, + ! not just when lnd_frc_mbl = 0. Danny M. Leung 27 Nov 2021 + + !#################################################################################################### + ! calculate soil moisture effect for dust emission threshold + ! following Fecan, Marticorena et al. (1999) + ! also see Zender et al. (2003) for DUST emission scheme and Kok et al. (2014b) for K14 emission scheme in CESM + bd = (1._r8-watsat(c,1))*dns_slt ![kg m-3] Bulk density of dry surface soil (dmleung changed from 2700 to dns_slt, soil particle density, on 16 Feb 2024. Note that dn s_slt=2650 kg m-3 so the value is changed by a tiny bit from 2700 to 2650. dns_slt has been here for many years so dns_slt should be used here instead of explicitly typing the value out. dmleung 16 Feb 2024) + + ! use emission threshold to calculate standardized threshold and dust emission coefficient + + ! Here convert h2osoi_vol (H2OSOI) at the topmost CTSM soil layer from volumetric (m3 water / m3 soil) to gravimetric soil moisture (kg water / kg soil) + gwc_sfc = h2osoi_vol(c,1)*SHR_CONST_RHOFW/bd ![kg kg-1] Gravimetric H2O cont + if (gwc_sfc > gwc_thr(c)) then + frc_thr_wet_fct = sqrt(1.0_r8 + 1.21_r8 * (100.0_r8*(gwc_sfc - gwc_thr(c)))**0.68_r8) ! dmleung's comment: this is an empirical equation by Fecan, Marticorena et al. (1999) on relating the soil moisture factor on enhancing dust emission threshold to gravimetric soil moisture. 1.21 and 0.68 are fitting parameters in the regression done by Fecan; 100 is to convert gracimetric soil moisture from fraction (kg water / kg soil) to percentage. Note that gwc_thr was defined in SoilStateInitConst.F90 as a fraction. 1.0_r8 means there is no soil moisture effect on enhancing dust emission threhsold. dmleung 16 Feb 2024. + else + frc_thr_wet_fct = 1.0_r8 + end if - ! the following comes from subr. frc_thr_rgh_fct_get - ! purpose: compute factor by which surface roughness increases threshold - ! friction velocity (currently a constant) + ! output moisture variables + gwc(p) = gwc_sfc ! output surface gravimetric water content + + ! slevis: adding liqfrac here, because related to effects from soil water + liqfrac = max( 0.0_r8, min( 1.0_r8, h2osoi_liq(c,1) / (h2osoi_ice(c,1)+h2osoi_liq(c,1)+1.0e-6_r8) ) ) + ! dmleung: output liquid fraction + liq_frac(p) = liqfrac + + !####################################################################################################### + ! calculate Shao & Lu (2000) dust emission threshold scheme here + ! use tmp1 from DUSTini for Iversen and White I&W (1982) (~75 um is optimal); use tmp2 for S&L (2000) (~80 um is optimal) + ! see Danny M. Leung et al. (2023) + !####################################################################################################### + tmp2 = sqrt(A_Shao * (dns_slt*grav*D_p + gamma_Shao/D_p)) ! calculate S&L (2000) scheme here for threshold; gamma = 1.65e-4 following S&L00, D_p = 127 um ~ 130 um following Leung et al. (2023). dmleung use defined parameters instead of typing numerical values 16 Feb 2024 + wnd_frc_thr_dry(p) = tmp2 / sqrt(forc_rho(c)) ! dry fluid threshold + wnd_frc_thr_slt = tmp2 / sqrt(forc_rho(c)) * frc_thr_wet_fct !* frc_thr_rgh_fct ! fluid threshold. dmleung commented out frc_thr_rgh_fct since it is used to modify the wind, not the wind threshold. + wnd_frc_thr_slt_it = B_it * tmp2 / sqrt(forc_rho(c)) ! define impact threshold + + ! the above formula is true for Iversen and White (1982) and Shao and Lu (2000) scheme + wnd_frc_thr(p) = wnd_frc_thr_slt ! output fluid threshold + wnd_frc_thr_it(p) = wnd_frc_thr_slt_it ! output impact threshold + + !############################################################################################## + ! dmleung: here, calculate quantities relevant to the fluid threshold + ! standardized fluid threshold + wnd_frc_thr_slt_std = wnd_frc_thr_slt * sqrt(forc_rho(c) / forc_rho_std) ! standardized soil threshold friction speed (defined using fluid threshold) + wnd_frc_thr_std(p) = wnd_frc_thr_slt_std ! output standardized fluid threshold + ! dust emission coefficient or soil erodibility coefficient (this is analogous to the soil erodibility map or prefenertial source filter in Zender; see zendersoilerodstream) + dst_emiss_coeff(p) = Cd0 * exp(-Ce * (wnd_frc_thr_slt_std - wnd_frc_thr_slt_std_min) / wnd_frc_thr_slt_std_min) ! save dust emission coefficient here for all grids + + ! framentation exponent (dependent on fluid threshold) + frag_expt = (Ca * (wnd_frc_thr_slt_std - wnd_frc_thr_slt_std_min) / wnd_frc_thr_slt_std_min) ! fragmentation exponent, defined in Kok et al. (2014a) + if (frag_expt > frag_expt_thr) then ! set fragmentation exponent to be 3 or 5 at maximum, to avoid local AOD blowup + frag_expt = frag_expt_thr + end if - frc_thr_rgh_fct = 1.0_r8 + !############################################################################################## + !################ drag partition effect, and soil-surface friction velocity ################### + ! subsection on computing vegetation drag partition and hybrid drag partition factors + ! in Leung et al. (2023), drag partition effect is applied on the wind instead of the threshold + !############################################################################################## + ! the following comes from subr. frc_thr_rgh_fct_get + ! purpose: compute factor by which surface roughness increases threshold + ! friction velocity (currently a constant) + + if (lnd_frc_mbl(p) > 0.0_r8 .AND. tlai_lu(l)<=1_r8) then + !if (lnd_frc_mbl(p) > 0.0_r8 .AND. ttlai(p)<=1_r8) then + ! vegetation drag partition equation following Gregory Okin (2008) + Caroline Pierre et al. (2014) + !lai(p) = tlai_lu(l)+0.1_r8 ! LAI+SAI averaged to landunit level; the equation is undefined at lai=0, and LAI in CTSM has some zeros over deserts, so we add in a small number. + !lai(p) = ttlai(p) + lai0_Okin ! ttlai = tlai+tsai. Okin-Pierre's equation is undefined at lai=0, and LAI in CTSM has some zeros over deserts, so we add in a small number. On 26 Feb 2024, dmleung changed from tlai_lu(l) to ttlai(p) + !if (lai(p) > 1_r8) then + ! lai(p) = 1_r8 ! setting LAI = 1 to be a max value (since K_length goes to negative when LAI>1) + !end if ! + + !if (ttlai(p) + vai0_Okin <= 1_r8) then + ! vai_Okin(p) = ttlai(p) + vai0_Okin ! ttlai = vai = tlai+tsai. Okin-Pierre's equation is undefined at vai=0, and VAI in CTSM has some zeros over deserts, so we add in a small number. On 26 Feb 2024, dmleung changed from tlai_lu(l) to ttlai(p) + !end if ! In the Okin-Pierre formulation, VAI has to be 0 < VAI <= 1. + + vai_Okin(p) = tlai_lu(l)+vai0_Okin ! LAI+SAI averaged to landunit level; the equation is undefined at lai=0, and LAI in CTSM has some zeros over deserts, so we add in a small number. + if (vai_Okin(p) > 1_r8) then + vai_Okin(p) = 1_r8 ! setting LAI = 1 to be a max value (since K_length goes to negative when LAI>1) + end if - ! the following comes from subr. frc_thr_wet_fct_get - ! purpose: compute factor by which soil moisture increases threshold friction velocity - ! adjust threshold velocity for inhibition by moisture - ! modified 4/5/2002 (slevis) to use gravimetric instead of volumetric - ! water content - bd = (1._r8-watsat(c,1))*2.7e3_r8 ![kg m-3] Bulk density of dry surface soil - gwc_sfc = h2osoi_vol(c,1)*SHR_CONST_RHOFW/bd ![kg kg-1] Gravimetric H2O cont - if (gwc_sfc > gwc_thr(c)) then - frc_thr_wet_fct = sqrt(1.0_r8 + 1.21_r8 * (100.0_r8*(gwc_sfc - gwc_thr(c)))**0.68_r8) + ! calculate Okin's shear stress ratio (SSR, which is vegetation drag partition factor) using Pierre's equation + K_length = 2_r8 * (1_r8/vai_Okin(p) - 1_r8) ! Here LAI has to be non-zero to avoid blowup, and < 1 to avoid -ve K_length. See this equation in Leung et al. (2023). This line is Okin's formulation + ssr(p) = (K_length+f_0*c_e)/(K_length+c_e) ! see this equation in Caroline Pierre et al. (2014) or Leung et al. (2023). This line is Pierre's formulation. + + ! calculation of the hybrid/total drag partition effect considering both rock and vegetation drag partitioning using LUH2 bare and veg fractions within a grid + if (lun%itype(l) == istsoil .or. lun%itype(l) == istcrop) then + if (patch%itype(p) == noveg) then ! if bare, uses rock drag partition factor + if (dpfct_rock(p) /= dpfct_rock(p)) then ! dmleung added 24 May 2024: dpfct_rock(p) could be NaN; CLM could run when DEBUG=FALSE in env_build.xml but dies when DEBUG=TRUE (usually when checking if wnd_frc_slt > wnd_frc_thr_slt_it and if numer/denom < 30._r8 below) + !write(iulog,*) 'dpfct_rock(p) == NaN; dpfct_rock(p) = ', dpfct_rock(p) + frc_thr_rgh_fct = 0.001_r8 ! Set drag partition effect to be a very small value (or zero) such that there is no emission whenever dpfct_rock(p) = NaN; dmleung 24 May 2024 + else + !write(iulog,*) 'dpfct_rock(p) = ', dpfct_rock(p) + frc_thr_rgh_fct = dpfct_rock(p) + end if + !frc_thr_rgh_fct = dpfct_rock(p) ! This should be the original code when dpfct_rock(p) has values everywhere + else ! if vegetation, uses vegetation drag partition factor + frc_thr_rgh_fct = ssr(p) + end if else - frc_thr_wet_fct = 1.0_r8 + frc_thr_rgh_fct = 1.0_r8 end if - ! slevis: adding liqfrac here, because related to effects from soil water + wnd_frc_slt = fv(p) * frc_thr_rgh_fct ! wnd_frc_slt is the drag-parition-modified wind speed and will be used in the dust emission equation below + + frc_thr_rghn_fct(p) = frc_thr_rgh_fct ! save and output hybrid drag partition factor - liqfrac = max( 0.0_r8, min( 1.0_r8, h2osoi_liq(c,1) / (h2osoi_ice(c,1)+h2osoi_liq(c,1)+1.0e-6_r8) ) ) + else ! for lnd_frc_mbl=0, do not change friction velocity and assume drag partition factor = 0 + wnd_frc_slt = fv(p) * frc_thr_rghn_fct(p) ! The value here is not important since once lnd_frc_mbl(p) <= 0.0_r8 there will be no emission. dmleung added 5 Jul 2024 + frc_thr_rghn_fct(p) = 0.0_r8 ! When LAI > 1, the drag partition effect is zero. dmleung 16 Feb 2024. + end if + + !########## end of drag partition effect ####################################################### - ! the following lines come from subr. dst_mbl - ! purpose: adjust threshold friction velocity to acct for moisture and - ! roughness. The ratio saltation_factor / sqrt(forc_rho) comes from - ! subr. wnd_frc_thr_slt_get which computes dry threshold - ! friction velocity for saltation + ! save soil friction velocity and roughness effect before the if-statement + wnd_frc_soil(p) = wnd_frc_slt ! save soil friction velocity for CLM output, which has drag partition and Owen effect + ! 20 Feb 2024: dmleung notes that Leung does not consider the Owen's effect. This is Jasper Kok's decision. The Owen's effect should be in Zender's DUST emission scheme. - wnd_frc_thr_slt = this%saltation_factor / sqrt(forc_rho(c)) * frc_thr_wet_fct * frc_thr_rgh_fct + ! save land mobile fraction + lnd_frc_mble(p) = lnd_frc_mbl(p) ! save land mobile fraction first, before the if-statement + ! only perform the following calculations if lnd_frc_mbl is non-zero + + if (lnd_frc_mbl(p) > 0.0_r8) then ! if bare land fraction is larger than 0 then calculate the dust emission equation ! reset these variables which will be updated in the following if-block - wnd_frc_slt = fv(p) flx_mss_hrz_slt_ttl = 0.0_r8 flx_mss_vrt_dst_ttl(p) = 0.0_r8 - ! the following line comes from subr. dst_mbl - ! purpose: threshold saltation wind speed + ! the following comes from subr. flx_mss_hrz_slt_ttl_Whi79_get + ! purpose: compute vertically integrated streamwise mass flux of particles - wnd_rfr_thr_slt = u10(p) * wnd_frc_thr_slt / fv(p) + if (wnd_frc_slt > wnd_frc_thr_slt_it) then! if using Leung's scheme, use impact threshold for dust emission equation; if Zender, uses fluid threshold (wnd_frc_thr_slt) for dust emission equation - ! the following if-block comes from subr. wnd_frc_slt_get - ! purpose: compute the saltating friction velocity - ! theory: saltation roughens the boundary layer, AKA "Owen's effect" + !################### for Leung et al. (2023) ################################################ + ! dmleung: instead of using mss_frc_cly_vld(c) with a range of [0,0.2] , which makes dust too sensitive to input clay surface dataset), for now use 0.1 + mss_frc_cly_vld(c) * 0.1 / 0.20 with a range of [0.1,0.2]. So, instead of scaling dust emission to 1/20 times for El Djouf (western Sahara) because of its 1 % clay fraction, scale its emission to 1/2 times. This reduces the sensitivity of dust emission to the clay input dataset. In particular, because dust emission is a small-scale process and the grid-averaged clay from the new WISE surface dataset over El Djouf is 1 %, much lower than the former FAO estimation of 5 %, dmleung is not sure if the clay value of 1 % suppresses too much of El Djouf's small-scale dust emission process. Similar to Charlie Zender's feeling suspicious about the soil texture datasets (or the dust emission schemes' sandblasting process), dmleung feels the same and for now decides to still allow dust emission to weakly scale with clay fraction, however limiting the scaling factor to 0.1-0.2. See modification in SoilStateInitTimeConst.F90. dmleung 5 Jul 2024 + flx_mss_vrt_dst_ttl(p) = dst_emiss_coeff(p) * mss_frc_cly_vld(c) * forc_rho(c) * ((wnd_frc_slt**2.0_r8 - wnd_frc_thr_slt_it**2.0_r8) / wnd_frc_thr_slt_it) * (wnd_frc_slt / wnd_frc_thr_slt_it)**frag_expt ! Leung et al. (2022) uses Kok et al. (2014) dust emission euqation for emission flux - if (u10(p) >= wnd_rfr_thr_slt) then - wnd_rfr_dlt = u10(p) - wnd_rfr_thr_slt - wnd_frc_slt_dlt = 0.003_r8 * wnd_rfr_dlt * wnd_rfr_dlt - wnd_frc_slt = fv(p) + wnd_frc_slt_dlt + ! account for bare soil fraction, frozen soil fraction, and apply global tuning parameter (Kok et al. 2014) + flx_mss_vrt_dst_ttl(p) = flx_mss_vrt_dst_ttl(p) * lnd_frc_mbl(p) * C_tune * liqfrac + !######################################################################################## end if - ! the following comes from subr. flx_mss_hrz_slt_ttl_Whi79_get - ! purpose: compute vertically integrated streamwise mass flux of particles + !############## Danny M. Leung added the intermittency calculation ################################# + ! subsection for intermittency factor calculation (only used by Leung's scheme, not Zender's scheme) + ! Leung et al. (2023) uses the Comola et al. (2019) intermittency scheme for the calculation of intermittent dust emissions. + ! This part takes care of the sub-timestep, high-frequency (< 1 minute period) turblent wind fluctuations occuring at the planetary boundary layer (PBL) near surface. Subtimestep wind gusts and episodes are important for generating emissions in marginal dust source regions, such as semiarid areas and high-latitude polar deserts. + ! 2 Dec 2021: assume no buoyancy contribution to the wind fluctuation (u_sd_slt), so no obul(p) is needed. It is shown to be important for the wind fluctuations contribute little to the intermittency factor. We might add this back in the future revisions. + ! 20 Feb 2024: dmleung notes that dmleung may revise Comola's scheme in the future to improve Comola's formulation of the statistical parameterization. - if (wnd_frc_slt > wnd_frc_thr_slt) then - wnd_frc_rat = wnd_frc_thr_slt / wnd_frc_slt - flx_mss_hrz_slt_ttl = cst_slt * forc_rho(c) * (wnd_frc_slt**3.0_r8) * & - (1.0_r8 - wnd_frc_rat) * (1.0_r8 + wnd_frc_rat) * (1.0_r8 + wnd_frc_rat) / grav + ! mean lowpass-filtered wind speed at hgt_sal = 0.1 m saltation height (assuming aerodynamic roughness length z0a_glob = 1e-4 m globally for ease; also assuming neutral condition) + u_mean_slt(p) = (wnd_frc_slt/k) * log(hgt_sal / z0a_glob) ! translating from ustar (velocity scale) to actual wind - ! the following loop originates from subr. dst_mbl - ! purpose: apply land sfc and veg limitations and global tuning factor - ! slevis: multiply flx_mss_hrz_slt_ttl by liqfrac to incude the effect - ! of frozen soil + !stblty(p) = 0_r8 ! -dmleung 2 Dec 2021: use stability = 0 for now, assuming no buoyancy contribution. Might uncomment the above lines in future revisions. + stblty(p) = zii / obu(p) ! -dmleung 20 Feb 2024: use obu from CTSM and PBL height = zii (= 1000_r8) which is default in CTSM. Should we transfer PBL height from CAM? + if ((12_r8 - 0.5_r8 * stblty(p)) .GE. 0.001_r8) then ! should have used 0 theoretically; used 0.001 here to avoid undefined values + u_sd_slt(p) = wnd_frc_slt * (12_r8 - 0.5_r8 * stblty(p))**0.333_r8 + else + u_sd_slt(p) = wnd_frc_slt * (0.001_r8)**0.333_r8 ! should have used 0 theoretically; used 0.001 here to avoid undefined values + end if - flx_mss_hrz_slt_ttl = flx_mss_hrz_slt_ttl * lnd_frc_mbl(p) * & - flx_mss_fdg_fct * liqfrac + ! threshold velocities + ! Here wnd_frc_thr_slt is the fluid threshold; wnd_frc_thr_dry(p) is the dry fluid threshold; B_it*wnd_frc_thr_dry(p) is the impact threshold + ! fluid threshold wind at 0.1 m saltation height + u_fld_thr(p) = (wnd_frc_thr_slt/k) * log(hgt_sal / z0a_glob) ! assume a globally constant z0a value for the log law of the wall, but it can be z0m from CLM or, better, z0a from Prigent's roughness dataset. Danny M. Leung et al. (2023) chose to assume a global constant z0a = 1e-4 m. dmleung 20 Feb 2024 + ! impact threshold wind at 0.1 m saltation height + u_impct_thr(p) = (wnd_frc_thr_slt_it/k) * log(hgt_sal / z0a_glob) + + ! threshold crossing rate + numer = (u_fld_thr(p)**2.0_r8 - u_impct_thr(p)**2.0_r8 - 2.0_r8 * u_mean_slt(p) * (u_fld_thr(p) - u_impct_thr(p))) + denom = (2.0_r8 * u_sd_slt(p)**2.0_r8) ! note that u_sd_slt should be always positive + ! Truncate to zero if the expression inside exp is becoming too large + if ( numer/denom < 30._r8 ) then ! set numer/denom to be < 30 given exp(30) below is already very large; also denom itself should be non-zero and non-negative given the standard deviation (u_sd_slt) of the subtimestep wind fluctuation is non-negative. dmleung 28 May 2024 + thr_crs_rate(p) = (exp((u_fld_thr(p)**2.0_r8 - u_impct_thr(p)**2.0_r8 - 2.0_r8 * u_mean_slt(p) * (u_fld_thr(p) - u_impct_thr(p))) / (2.0_r8 * u_sd_slt(p)**2.0_r8)) + 1.0_r8)**(-1.0_r8) + else + thr_crs_rate(p) = 0.0_r8 end if - ! the following comes from subr. flx_mss_vrt_dst_ttl_MaB95_get - ! purpose: diagnose total vertical mass flux of dust from vertically - ! integrated streamwise mass flux + ! probability that lowpass-filtered wind speed does not exceed u_ft + prb_crs_fld_thr(p) = 0.5_r8 * (1.0_r8 + erf((u_fld_thr(p) - u_mean_slt(p)) / ( sqrt(2.0_r8) * u_sd_slt(p)))) + ! probability that lowpass-filtered wind speed does not exceed u_it + prb_crs_impct_thr(p) = 0.5_r8 * (1.0_r8 + erf((u_impct_thr(p) - u_mean_slt(p)) / ( sqrt(2.0_r8) * u_sd_slt(p)))) + + ! intermittency factor (eta; ranging from 0 to 1) + intrmtncy_fct(p) = 1.0_r8 - prb_crs_fld_thr(p) + thr_crs_rate(p) * (prb_crs_fld_thr(p) - prb_crs_impct_thr(p)) + + ! multiply dust emission flux by intermittency factor + if (intrmtncy_fct(p) /= intrmtncy_fct(p)) then ! if intrmtncy_fct(p) is not NaN then multiply by intermittency factor; this statement is needed because dust emission flx_mss_vrt_dst_ttl(p) has to be non NaN (at least zero) to be outputted + flx_mss_vrt_dst_ttl(p) = flx_mss_vrt_dst_ttl(p) + else + flx_mss_vrt_dst_ttl(p) = flx_mss_vrt_dst_ttl(p) * intrmtncy_fct(p) ! multiply dust flux by intermittency + end if - dst_slt_flx_rat_ttl = 100.0_r8 * exp( log(10.0_r8) * (13.4_r8 * mss_frc_cly_vld(c) - 6.0_r8) ) - flx_mss_vrt_dst_ttl(p) = flx_mss_hrz_slt_ttl * dst_slt_flx_rat_ttl + !############ end the intermittency subsection here; only use for Leung's scheme ########################## end if ! lnd_frc_mbl > 0.0 From 667003d404dd4b9ca63efce0c3a0a115c0b42651 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Sun, 28 Jul 2024 16:59:51 -0600 Subject: [PATCH 0805/1248] Fix several of the Leung 2023 unit tests because of change in answers, still two fail --- src/biogeochem/test/DustEmis_test/test_DustEmisLeung2023.pf | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/biogeochem/test/DustEmis_test/test_DustEmisLeung2023.pf b/src/biogeochem/test/DustEmis_test/test_DustEmisLeung2023.pf index 2b87f4be0a..e18e00e269 100644 --- a/src/biogeochem/test/DustEmis_test/test_DustEmisLeung2023.pf +++ b/src/biogeochem/test/DustEmis_test/test_DustEmisLeung2023.pf @@ -107,7 +107,7 @@ contains call this%dust_emis%GetPatchVars( p, flx_mss_vrt_dst_tot=flx_mss_vrt_dst_tot, & vlc_trb_1=vlc_trb_1, vlc_trb_2=vlc_trb_2, vlc_trb_3=vlc_trb_3, & vlc_trb_4=vlc_trb_4) - @assertEqual( flx_mss_vrt_dst_tot, 1.208384635884010d-5, tolerance=tol ) + @assertEqual( flx_mss_vrt_dst_tot, 1.305341724414137d-006, tolerance=tol ) @assertEqual( vlc_trb_1, 3.407721147709135d-003, tolerance=tol ) @assertEqual( vlc_trb_2, 4.961153753164878d-003, tolerance=tol ) @assertEqual( vlc_trb_3, 4.980100969983446d-003, tolerance=tol ) @@ -270,7 +270,7 @@ contains call this%validate_patch(p) call this%dust_emis%GetPatchVars( p, flx_mss_vrt_dst_tot=flx_mss_vrt_dst_tot ) total_dust0 = flx_mss_vrt_dst_tot - @assertEqual( flx_mss_vrt_dst_tot, 1.063573374792962d-4, tolerance=tol ) + @assertEqual( flx_mss_vrt_dst_tot, 1.064145669761461d-5, tolerance=tol ) end do ! Double u10 and show result is higher call this%input%create_fv( u10=u10*2.0_r8, fv=fv) @@ -282,7 +282,7 @@ contains call this%validate_patch(p) call this%dust_emis%GetPatchVars( p, flx_mss_vrt_dst_tot=flx_mss_vrt_dst_tot ) total_dust_higher = flx_mss_vrt_dst_tot - @assertEqual( flx_mss_vrt_dst_tot, 1.774023264204829d-4, tolerance=tol ) + @assertEqual( flx_mss_vrt_dst_tot, 1.064145669761461d-5, tolerance=tol ) end do @assertGreaterThan( total_dust_higher, total_dust0 ) From 0f9fee7ea3b3f6732e2f0dd7bf75f7f6536b3cfa Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Mon, 29 Jul 2024 11:42:44 -0600 Subject: [PATCH 0806/1248] LILAC needs to read and handle the drv_flds_in file as dust emission settings are required and it's namelist must be read --- cime_config/SystemTests/lilacsmoke.py | 2 +- python/ctsm/lilac_make_runtime_inputs.py | 1 - src/CMakeLists.txt | 1 + src/cpl/lilac/lnd_comp_esmf.F90 | 5 +++++ 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/cime_config/SystemTests/lilacsmoke.py b/cime_config/SystemTests/lilacsmoke.py index 1287301ba2..5bdbb31ec1 100644 --- a/cime_config/SystemTests/lilacsmoke.py +++ b/cime_config/SystemTests/lilacsmoke.py @@ -38,7 +38,7 @@ logger = logging.getLogger(__name__) -_LILAC_RUNTIME_FILES = ["lnd_in", "lnd_modelio.nml", "lilac_in"] +_LILAC_RUNTIME_FILES = ["lnd_in", "lnd_modelio.nml", "drv_flds_in", "lilac_in"] class LILACSMOKE(SystemTestsCommon): diff --git a/python/ctsm/lilac_make_runtime_inputs.py b/python/ctsm/lilac_make_runtime_inputs.py index 33b87c543e..e751f6c931 100644 --- a/python/ctsm/lilac_make_runtime_inputs.py +++ b/python/ctsm/lilac_make_runtime_inputs.py @@ -307,7 +307,6 @@ def buildnml(cime_path, rundir): # remove temporary files in rundir os.remove(os.path.join(rundir, "config_cache.xml")) os.remove(os.path.join(rundir, "env_lilac.xml")) - os.remove(os.path.join(rundir, "drv_flds_in")) os.remove(infile) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 9388e65bc2..5b0f6c9b1b 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -107,5 +107,6 @@ add_subdirectory(${CLM_ROOT}/src/init_interp/test clm_init_interp_test) add_subdirectory(${CLM_ROOT}/src/self_tests/test clm_self_tests_test) # Add driver unit test directories +# (these should be moved to the appropriate submodule) add_subdirectory(${CLM_ROOT}/src/drv_test drv_test) diff --git a/src/cpl/lilac/lnd_comp_esmf.F90 b/src/cpl/lilac/lnd_comp_esmf.F90 index 298aa730c0..6c8bb2a491 100644 --- a/src/cpl/lilac/lnd_comp_esmf.F90 +++ b/src/cpl/lilac/lnd_comp_esmf.F90 @@ -114,6 +114,8 @@ subroutine lnd_init(comp, import_state, export_state, clock, rc) use ESMF , only : ESMF_StateAdd use ESMF , only : operator(==) + use shr_dust_emis_mod , only : shr_dust_emis_readnl + ! input/output variables type(ESMF_GridComp) :: comp ! CLM gridded component type(ESMF_State) :: import_state ! CLM import state @@ -270,6 +272,9 @@ subroutine lnd_init(comp, import_state, export_state, clock, rc) ! Fill in the value for model_meshfile in lnd_comp_shr used by the stream routines in share_esmf/ model_meshfile = trim(lnd_mesh_filename) + ! Reading in the drv_flds_in namelist is required for dust emissions + call shr_dust_emis_readnl( mpicom, "drv_flds_in") + !---------------------- ! Obtain caseid and start type from attributes in import state !---------------------- From 6d07a80bb6a4d0238863907c92a8f984480e72ad Mon Sep 17 00:00:00 2001 From: mvdebolskiy Date: Mon, 29 Jul 2024 11:50:48 -0600 Subject: [PATCH 0807/1248] pass physics and proper defaults. --- bld/CLMBuildNamelist.pm | 15 +++++++++------ bld/namelist_files/namelist_defaults_ctsm.xml | 4 ++-- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index fa0d4a0382..77fb8a679f 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -1815,7 +1815,7 @@ sub process_namelist_inline_logic { ################################# # namelist group: exice_streams # ################################# - setup_logic_exice($opts, $nl_flags, $definition, $defaults, $nl); + setup_logic_exice($opts, $nl_flags, $definition, $defaults, $nl, $physv); ########################################## # namelist group: clm_temperature_inparm # @@ -2322,7 +2322,6 @@ sub setup_logic_soilstate { add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'organic_frac_squared' ); add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'use_bedrock', 'use_fates'=>$nl_flags->{'use_fates'}, 'vichydro'=>$nl_flags->{'vichydro'} ); - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'use_excess_ice'); # excess ice flag should be read before stream vars my $var1 = "soil_layerstruct_predefined"; my $var2 = "soil_layerstruct_userdefined"; @@ -4583,7 +4582,8 @@ sub setup_logic_exice { # # excess ice streams # - my ($opts, $nl_flags, $definition, $defaults, $nl) = @_; + my ($opts, $nl_flags, $definition, $defaults, $nl, $physv) = @_; + add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'use_excess_ice', 'phys'=>$physv->as_string()); my $use_exice = $nl->get_value( 'use_excess_ice' ); my $use_exice_streams = $nl->get_value( 'use_excess_ice_streams' ); my $finidat = $nl->get_value('finidat'); @@ -4642,10 +4642,13 @@ sub setup_logic_coldstart_temp { # set initial temperatures for excess ice gridcells: - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'excess_ice_coldstart_temp'); - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'excess_ice_coldstart_depth'); - my $use_exice = $nl->get_value( 'use_excess_ice' ); + + add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'excess_ice_coldstart_temp', + 'use_excess_ice'=>$use_exice); + add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'excess_ice_coldstart_depth', + 'use_excess_ice'=>$use_exice); + my $use_exice_streams = $nl->get_value( 'use_excess_ice_streams' ); my $exice_cs_temp = $nl->get_value( 'excess_ice_coldstart_temp' ); my $exice_cs_depth = $nl->get_value( 'excess_ice_coldstart_depth' ); diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index 47f9802aff..7ce2235a84 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -2058,8 +2058,8 @@ lnd/clm2/surfdata_esmf/NEON/surfdata_1x1_NEON_TOOL_hist_78pfts_CMIP6_simyr2000_c .false. -0.0 -1.0 +-1.0 +0.5 -3.15 0.5 lnd/clm2/paramdata/exice_init_0.125x0.125_c20220516.nc From 7208b6671a7dde13624ecca56bc0e165a111ac9b Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Mon, 29 Jul 2024 16:36:29 -0600 Subject: [PATCH 0808/1248] Fix grammar --- bld/namelist_files/namelist_definition_ctsm.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bld/namelist_files/namelist_definition_ctsm.xml b/bld/namelist_files/namelist_definition_ctsm.xml index 575d72856f..a987fc1300 100644 --- a/bld/namelist_files/namelist_definition_ctsm.xml +++ b/bld/namelist_files/namelist_definition_ctsm.xml @@ -2826,12 +2826,12 @@ If TRUE turn on the excess ice physics, (Lee et al., 2014; Cai et al., 2020) -Initial soil temperature to use for gridcells with excess ice present during a run starting with coldstart (deg C). Value is only apply if use_excess_ice is true. +Initial soil temperature to use for gridcells with excess ice present during a run starting with coldstart (deg C). Value only applys if use_excess_ice is true. -Soil depth below which initial excess ice concentration will be applied during a run starting with coldstart (m). Value is only apply if use_excess_ice is true. +Soil depth below which initial excess ice concentration will be applied during a run starting with coldstart (m). Value only applys if use_excess_ice is true. If this is set below depth of the soil depth, only the last soil layer will get excess ice. From 17c748bad564c560cf305549b744c7c82c13b5c5 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Mon, 29 Jul 2024 17:06:26 -0600 Subject: [PATCH 0809/1248] Fix 1x1_cidadinhoBR tests by specifying 2000_control for it and 1850_control for smallville --- bld/unit_testers/build-namelist_test.pl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bld/unit_testers/build-namelist_test.pl b/bld/unit_testers/build-namelist_test.pl index c92f428d82..d6291c94de 100755 --- a/bld/unit_testers/build-namelist_test.pl +++ b/bld/unit_testers/build-namelist_test.pl @@ -1532,7 +1532,11 @@ sub cat_and_create_namelistinfile { # Check for crop resolutions my @crop1850_res = ( "1x1_smallvilleIA", "1x1_cidadinhoBR" ); foreach my $res ( @crop1850_res ) { - $options = "-bgc bgc -crop -res $res -use_case 1850_control -envxml_dir ."; + my $use_case = "1850_control"; + if ( $res =~ /1x1_cidadinhoBR/ ) { + $use_case = "2000_control"; + } + $options = "-bgc bgc -crop -res $res -use_case $use_case -envxml_dir ."; &make_env_run(); eval{ system( "$bldnml $options > $tempfile 2>&1 " ); }; is( $@, '', "$options" ); From 0903d70234eab143bdb5f48959fed725e6766422 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Mon, 29 Jul 2024 18:00:13 -0600 Subject: [PATCH 0810/1248] This looks wrong, but is actually correct in order to get this to work through initialization, otherwise it fails thinking stremas are off --- src/cpl/share_esmf/PrigentRoughnessStreamType.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cpl/share_esmf/PrigentRoughnessStreamType.F90 b/src/cpl/share_esmf/PrigentRoughnessStreamType.F90 index 564891bcac..2e78704614 100644 --- a/src/cpl/share_esmf/PrigentRoughnessStreamType.F90 +++ b/src/cpl/share_esmf/PrigentRoughnessStreamType.F90 @@ -184,7 +184,7 @@ logical function UseStreams(this) UseStreams = .true. end if else - UseStreams = .false. ! Prigent streams are off without a filename given + UseStreams = .true. end if end function UseStreams From a58ad0fba8030617211b3e7d36167cc0a70631d6 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Mon, 29 Jul 2024 18:01:35 -0600 Subject: [PATCH 0811/1248] Get unit tests all working by adjusting the Leung 2023 test by what's doing on inside the Leung 2023 code --- .../test/DustEmis_test/test_DustEmisLeung2023.pf | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/biogeochem/test/DustEmis_test/test_DustEmisLeung2023.pf b/src/biogeochem/test/DustEmis_test/test_DustEmisLeung2023.pf index e18e00e269..e6634d9ad7 100644 --- a/src/biogeochem/test/DustEmis_test/test_DustEmisLeung2023.pf +++ b/src/biogeochem/test/DustEmis_test/test_DustEmisLeung2023.pf @@ -234,7 +234,7 @@ contains patch%itype(bounds%begp:bounds%endp) = 1 call this%input%create_atm2lnd() call this%input%create_fv( ) - this%input%canopystate_inst%tlai_patch(:) = 0.3_r8 + this%input%canopystate_inst%tlai_patch(:) = 1.0_r8 call this%dust_emis%DustEmission(bounds, this%input%num_nolakep, this%input%filter_nolakep, this%input%atm2lnd_inst, & this%input%soilstate_inst, this%input%canopystate_inst, this%input%water_inst%waterstatebulk_inst, & this%input%water_inst%waterdiagnosticbulk_inst, this%input%frictionvel_inst) @@ -250,8 +250,8 @@ contains !----------------------------------------------------------------------- @Test - subroutine check_dust_emis_increasing_wind(this) - ! Check dust emissions with increasing wind + subroutine check_dust_emis_increasing_fv(this) + ! Check dust emissions with increasing friction velocity class(TestDustEmisLeung2023), intent(inout) :: this integer :: p, c real(r8) :: flx_mss_vrt_dst_tot @@ -259,7 +259,7 @@ contains real(r8) :: u10 = 10._r8 real(r8) :: total_dust0, total_dust_higher - ! Run baseline u10 + ! Run baseline fv call this%input%create_atm2lnd() call this%input%create_fv( u10=u10, fv=fv ) call this%dust_emis%DustEmission(bounds, this%input%num_nolakep, this%input%filter_nolakep, this%input%atm2lnd_inst, & @@ -272,8 +272,8 @@ contains total_dust0 = flx_mss_vrt_dst_tot @assertEqual( flx_mss_vrt_dst_tot, 1.064145669761461d-5, tolerance=tol ) end do - ! Double u10 and show result is higher - call this%input%create_fv( u10=u10*2.0_r8, fv=fv) + ! Double fv and show result is higher + call this%input%create_fv( u10=u10, fv=fv*2.0_r8) call this%dust_emis%DustEmission(bounds, this%input%num_nolakep, this%input%filter_nolakep, this%input%atm2lnd_inst, & this%input%soilstate_inst, this%input%canopystate_inst, this%input%water_inst%waterstatebulk_inst, & this%input%water_inst%waterdiagnosticbulk_inst, this%input%frictionvel_inst) @@ -282,11 +282,11 @@ contains call this%validate_patch(p) call this%dust_emis%GetPatchVars( p, flx_mss_vrt_dst_tot=flx_mss_vrt_dst_tot ) total_dust_higher = flx_mss_vrt_dst_tot - @assertEqual( flx_mss_vrt_dst_tot, 1.064145669761461d-5, tolerance=tol ) + @assertEqual( flx_mss_vrt_dst_tot, 8.309603073613188d-5, tolerance=tol ) end do @assertGreaterThan( total_dust_higher, total_dust0 ) - end subroutine check_dust_emis_increasing_wind + end subroutine check_dust_emis_increasing_fv !----------------------------------------------------------------------- From a8ff15afcd6e4c7f813c4cd9b93605b8ddc7f216 Mon Sep 17 00:00:00 2001 From: mvdebolskiy Date: Tue, 30 Jul 2024 08:01:23 -0600 Subject: [PATCH 0812/1248] add error when user sets streams to false and exice to true on coldstart --- bld/CLMBuildNamelist.pm | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index 77fb8a679f..ca99c131b0 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -4595,6 +4595,11 @@ sub setup_logic_exice { } elsif ( (not defined($use_exice_streams)) && (not value_is_true($use_exice)) ) { $nl->set_variable_value('exice_streams', 'use_excess_ice_streams' , '.false.'); $use_exice_streams = '.false.'; + # Checking for cold clm_start_type and not finidat here since finidat can be not set set in branch/hybrid runs and + # These cases are handled in the restart routines in the model + } elsif ( defined($use_exice_streams) && (not value_is_true($use_exice_streams)) && value_is_true($use_exice) && + ( $nl_flags->{'clm_start_type'} eq "'cold'" || $nl_flags->{'clm_start_type'} eq "'arb_ic'" )) { + $log->fatal_error("use_excess_ice_streams can NOT be FALSE when use_excess_ice is TRUE on the cold start" ); } # If excess ice streams is on if (defined($use_exice_streams) && value_is_true($use_exice_streams)) { From 4d4fe83b759c972c9f4e8d0ad9422d1cd36c7693 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Tue, 30 Jul 2024 08:38:44 -0600 Subject: [PATCH 0813/1248] Fix test numbers --- 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 d6291c94de..5bccb3b77c 100755 --- a/bld/unit_testers/build-namelist_test.pl +++ b/bld/unit_testers/build-namelist_test.pl @@ -163,10 +163,10 @@ sub cat_and_create_namelistinfile { # # Figure out number of tests that will run # -my $ntests = 3317; +my $ntests = 3329; if ( defined($opts{'compare'}) ) { - $ntests += 2052; + $ntests += 1999; } plan( tests=>$ntests ); From cdb36a0f681d02a2c5720940c169a559783a3e9b Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Tue, 30 Jul 2024 08:39:36 -0600 Subject: [PATCH 0814/1248] Update change files --- doc/ChangeLog | 115 ++++++++++++++++++++++++++++++++++++++++++++++++++ doc/ChangeSum | 1 + 2 files changed, 116 insertions(+) diff --git a/doc/ChangeLog b/doc/ChangeLog index 79d640242d..8c01174329 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,4 +1,119 @@ =============================================================== +Tag name: ctsm5.2.017 +Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326) +Date: Tue 30 Jul 2024 08:39:20 AM MDT +One-line Summary: Dust emissions control moved to cmeps + +Purpose and description of changes +---------------------------------- + +Remove the dust emissions namelist items from CTSM and use the namelist in the drv_flds_in for CMEPS. + +This updates CTSM to use the namelist control in CMEPS (in ESCOMP/CMEPS#429). So the CMEPS external needs to be updated, and the +namelist control in CTSM changed to use CMEPS rather than the internal CTSM control settings and the CTSM ones removed. + +The new XML variable: + + LND_SETS_DUST_EMIS_DRV_FLDS + +controls whether dust emission settings are set by CTSM or by CAM. Only one or the other can set them, and it's required so when CAM +and CTSM are running together they need to know which one will select. + +This required some changes for LILAC. The drv_flds_in namelist file is now required for LILAC, and read for dust emissions +(and dust emissions only) at the LILAC lnd_comp_esmf.F90 level. + +Add a unit test for the CMEPS code to make sure it's working correctly. This validates the code both for CAM and CTSM. + +Fix the cidinahoBR test in the build-namelist unit tester. + + +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_1 + +[ ] clm5_0 + +[ ] ctsm5_0-nwp + +[ ] clm4_5 + + +Bugs fixed +---------- + +List of CTSM issues fixed (include CTSM Issue # and description) [one per line]: + + Fixes #2376 -- Update CTSM with CMEPS that controls dust emission options + Fixes #2150 -- Ability to flip between different dust emission methods + Fixes #2524 -- Add option to NOT set dust emission settings when coupled to CAM + Fixes #2666 -- cidinahoBR test in build-namelist + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): + dust_emis_method can NOT be set to Leung_2023 -- yet. + See below about LND_SETS_DUST_EMIS_DRV_FLDS + +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): + CTSM namelist items moved to the dust_emis_inparm namelist in drv_flds_in: + zender_soil_erod_source and dust_emis_method + + New logical XML variable: + LND_SETS_DUST_EMIS_DRV_FLDS + If TRUE CTSM sets the dust emission namelist, otherwise CAM will (when coupled to CAM) + If you are NOT coupled to CAM and LND_SETS_DUST_EMIS_DRV_FLDS==FALSE, the model will abort + trying to read the dust_emis_inparm namelist in drv_flds_in. + +Notes of particular relevance for developers: +--------------------------------------------- + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): + Added a PF unit test for CMEPS dust emission code. This should be moved to CMEPS, but still run here. + Control design in DustEmisFactory, uses a Functional Programming design pattern with pure functions + from CMEPS for CTSM to know the drv_flds_in settings. Design notes were added in that regard. + +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 - PASS (1006 are different because of the namelist changes) + + 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 bit-for-bit + +Other details +------------- + +Pull Requests that document the changes (include PR ids): +(https://github.com/ESCOMP/ctsm/pull) + #2545 -- Dust emission control moved to CMEPS + +=============================================================== +=============================================================== Tag name: ctsm5.2.016 Originator(s): samrabin (Sam Rabin, UCAR/TSS, samrabin@ucar.edu) Date: Sat 27 Jul 2024 05:13:08 PM MDT diff --git a/doc/ChangeSum b/doc/ChangeSum index 382e5cf7cb..15a67bcf04 100644 --- a/doc/ChangeSum +++ b/doc/ChangeSum @@ -1,5 +1,6 @@ Tag Who Date Summary ============================================================================================================================ + ctsm5.2.017 erik 07/30/2024 Dust emissions control moved to cmeps ctsm5.2.016 samrabin 07/27/2024 Enable new crop calendars for clm60 compsets ctsm5.2.015 multiple 07/22/2024 Update submodule tags to pass runoff from cism to rof ctsm5.2.014 multiple 07/19/2024 use_matrixcn, use_soil_matrixcn come in as default .false. From f28ecdb5cbd3ab3ab28ffd149ef54761055e926e Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Tue, 30 Jul 2024 08:44:59 -0600 Subject: [PATCH 0815/1248] Add note about the fails compared to baselines --- doc/ChangeLog | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/doc/ChangeLog b/doc/ChangeLog index 8c01174329..aeb7b2972f 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -105,6 +105,12 @@ Answer changes Changes answers relative to baseline: No bit-for-bit + The following tests compared different to baseline because of reproducability issues: + ERP_P64x2_Lm13.f10_f10_mg37.IHistClm60Bgc.derecho_intel.clm-monthly--clm-matrixcnOn_ignore_warnings + SMS_D.1x1_brazil.I2000Clm60FatesSpCruRsGs.derecho_gnu.clm-FatesColdDryDepSatPhen + SMS_D.1x1_brazil.I2000Clm60FatesSpCruRsGs.derecho_gnu.clm-FatesColdMeganSatPhen + The CN-MATRIX issue is because of #2619 and FATES because of #2656 + Other details ------------- From e5656454d59db3b2f414993bfb41d18ca54ba1b3 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Tue, 30 Jul 2024 21:26:45 -0600 Subject: [PATCH 0816/1248] Add more excess ice tests for fail conditions, the last two don't pass as they aren't setup yet --- bld/unit_testers/build-namelist_test.pl | 31 ++++++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/bld/unit_testers/build-namelist_test.pl b/bld/unit_testers/build-namelist_test.pl index 53c71ae0e9..b9d20cbba9 100755 --- a/bld/unit_testers/build-namelist_test.pl +++ b/bld/unit_testers/build-namelist_test.pl @@ -163,10 +163,10 @@ sub cat_and_create_namelistinfile { # # Figure out number of tests that will run # -my $ntests = 3254; +my $ntests = 3263; if ( defined($opts{'compare'}) ) { - $ntests += 2001; + $ntests += 1965; } plan( tests=>$ntests ); @@ -322,7 +322,7 @@ sub cat_and_create_namelistinfile { "-res 0.9x1.25 -namelist '&a irrigate=.true./'", "-res 0.9x1.25 -verbose", "-res 0.9x1.25 -ssp_rcp SSP2-4.5", "-res 0.9x1.25 -test", "-res 0.9x1.25 -sim_year 1850", "-res 0.9x1.25 -namelist '&a use_lai_streams=.true.,use_soil_moisture_streams=.true./'", "-res 0.9x1.25 -namelist '&a use_excess_ice=.true. use_excess_ice_streams=.true./'", - "-res 0.9x1.25 -namelist '&a use_excess_ice=.true. use_excess_ice_streams=.false./'", + "-res 0.9x1.25 --clm_start_type cold -namelist '&a use_excess_ice=.true. use_excess_ice_streams=.true./'", "-res 0.9x1.25 -use_case 1850_control", "-res 1x1pt_US-UMB -clm_usr_name 1x1pt_US-UMB -namelist '&a fsurdat=\"/dev/null\"/'", "-res 1x1_brazil", @@ -542,6 +542,21 @@ sub cat_and_create_namelistinfile { GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm5_0", }, + "coldstart exice on wo stream"=>{ options=>"-res 0.9x1.25 -envxml_dir . --clm_start_type cold", + namelst=>"use_excess_ice=.true., use_excess_ice_streams = .false.", + GLC_TWO_WAY_COUPLING=>"FALSE", + phys=>"clm6_0", + }, + "coldstart exice on bad temp" =>{ options=>"-res 0.9x1.25 -envxml_dir . --clm_start_type cold", + namelst=>"use_excess_ice=.true., use_excess_ice_streams = .true., excess_ice_coldstart_temp=0.0", + GLC_TWO_WAY_COUPLING=>"FALSE", + phys=>"clm6_0", + }, + "coldstart exice on bad depth" =>{ options=>"-res 0.9x1.25 -envxml_dir . --clm_start_type cold", + namelst=>"use_excess_ice=.true., use_excess_ice_streams = .true., excess_ice_coldstart_depth=0.0", + GLC_TWO_WAY_COUPLING=>"FALSE", + phys=>"clm6_0", + }, "clm50CNDVwtransient" =>{ options=>" -envxml_dir . -use_case 20thC_transient -dynamic_vegetation -res 10x15 -ignore_warnings", namelst=>"", GLC_TWO_WAY_COUPLING=>"FALSE", @@ -1295,6 +1310,16 @@ sub cat_and_create_namelistinfile { GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm6_0", }, + "Set coldtemp wo coldstart" =>{ options=>"-envxml_dir . --clm_start_type startup", + namelst=>"use_excess_ice=.true.,excess_ice_coldstart_temp=-10.", + GLC_TWO_WAY_COUPLING=>"FALSE", + phys=>"clm6_0", + }, + "Set colddepth wo coldstart" =>{ options=>"-envxml_dir . --clm_start_type startup", + namelst=>"use_excess_ice=.true.,excess_ice_coldstart_depth=0.5", + GLC_TWO_WAY_COUPLING=>"FALSE", + phys=>"clm6_0", + }, "NotNEONbutNEONlightres" =>{ options=>"--res CLM_USRDAT --clm_usr_name regional --envxml_dir . --bgc bgc --light_res 106x174", namelst=>"fsurdat='build-namelist_test.pl'", GLC_TWO_WAY_COUPLING=>"FALSE", From e3605abe8fb9e614873fe273967ab6554209b27c Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 31 Jul 2024 14:28:18 -0600 Subject: [PATCH 0817/1248] Change the checks a bit, the coldstart temps always need to be set even if excess ice is off --- bld/CLMBuildNamelist.pm | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index ca99c131b0..ee82afdb17 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -4645,9 +4645,22 @@ sub setup_logic_coldstart_temp { my ($opts, $nl_flags, $definition, $defaults, $nl) = @_; - # set initial temperatures for excess ice gridcells: + # set initial temperatures for excess ice gridcells: needs to be set whether excess ice is on or not my $use_exice = $nl->get_value( 'use_excess_ice' ); + my $finidat = $nl->get_value('finidat'); + + my @list = ( "excess_ice_coldstart_temp", "excess_ice_coldstart_depth" ); + + # Only needs to be set if it's a coldstart + if ( ! string_is_undef_or_empty($finidat) ) { + foreach my $var ( @list ) { + my $val = $nl->get_value( $var ); + if ( defined($val) ) { + $log->warning("$var only needs to be set if this is a cold-start, although InitCold is always called"); + } + } + } add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'excess_ice_coldstart_temp', 'use_excess_ice'=>$use_exice); @@ -4658,15 +4671,12 @@ sub setup_logic_coldstart_temp { my $exice_cs_temp = $nl->get_value( 'excess_ice_coldstart_temp' ); my $exice_cs_depth = $nl->get_value( 'excess_ice_coldstart_depth' ); - if (defined($use_exice) && value_is_true($use_exice)) { - # Checking this setting only needed IF excess ice streams are on get the stream defaults - if (defined($use_exice_streams) && value_is_true($use_exice_streams)) { - if (defined($exice_cs_depth) && $exice_cs_depth <= 0.0 ) { - $log->fatal_error("excess_ice_coldstart_depth is <= 0.0" ); - } - if (defined($exice_cs_temp) && $exice_cs_temp >= 0.0 ) { - $log->fatal_error("excess_ice_coldstart_temp is >= 0.0, no excess ice will be present in this run" ); - } + if (defined($use_exice_streams) && value_is_true($use_exice_streams)) { + if (defined($exice_cs_depth) && $exice_cs_depth <= 0.0 ) { + $log->fatal_error("excess_ice_coldstart_depth is <= 0.0" ); + } + if (defined($exice_cs_temp) && $exice_cs_temp >= 0.0 ) { + $log->fatal_error("excess_ice_coldstart_temp is >= 0.0, no excess ice will be present in this run" ); } } } From 18df0661ea867a1b2e8cc75027be5ddaf0ea5753 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 31 Jul 2024 14:59:17 -0600 Subject: [PATCH 0818/1248] Save use_excice_streams to nl_flags so it doesn't have to be set to false when not needed --- bld/CLMBuildNamelist.pm | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index ee82afdb17..ab70d698f4 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -4593,7 +4593,6 @@ sub setup_logic_exice { $use_exice_streams = '.true.'; # if excess ice is turned off } elsif ( (not defined($use_exice_streams)) && (not value_is_true($use_exice)) ) { - $nl->set_variable_value('exice_streams', 'use_excess_ice_streams' , '.false.'); $use_exice_streams = '.false.'; # Checking for cold clm_start_type and not finidat here since finidat can be not set set in branch/hybrid runs and # These cases are handled in the restart routines in the model @@ -4601,6 +4600,9 @@ sub setup_logic_exice { ( $nl_flags->{'clm_start_type'} eq "'cold'" || $nl_flags->{'clm_start_type'} eq "'arb_ic'" )) { $log->fatal_error("use_excess_ice_streams can NOT be FALSE when use_excess_ice is TRUE on the cold start" ); } + + # Put use_exice_streams into nl_flags so can be referenced later + $nl_flags->{'use_excice_streams'} = $use_exice_streams; # If excess ice streams is on if (defined($use_exice_streams) && value_is_true($use_exice_streams)) { # Can only be true if excess ice is also on, otherwise fail @@ -4652,7 +4654,7 @@ sub setup_logic_coldstart_temp { my @list = ( "excess_ice_coldstart_temp", "excess_ice_coldstart_depth" ); - # Only needs to be set if it's a coldstart + # Only needs to be set by the user if it's a coldstart if ( ! string_is_undef_or_empty($finidat) ) { foreach my $var ( @list ) { my $val = $nl->get_value( $var ); @@ -4667,7 +4669,7 @@ sub setup_logic_coldstart_temp { add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'excess_ice_coldstart_depth', 'use_excess_ice'=>$use_exice); - my $use_exice_streams = $nl->get_value( 'use_excess_ice_streams' ); + my $use_exice_streams = $nl_flags->{'use_excice_streams'}; my $exice_cs_temp = $nl->get_value( 'excess_ice_coldstart_temp' ); my $exice_cs_depth = $nl->get_value( 'excess_ice_coldstart_depth' ); From 797444f1a5878c138ac6e198000f5ed292a992cf Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 31 Jul 2024 16:51:57 -0600 Subject: [PATCH 0819/1248] Start the ChangeLog --- doc/ChangeLog | 104 ++++++++++++++++++++++++++++++++++++++++++++++++++ doc/ChangeSum | 1 + 2 files changed, 105 insertions(+) diff --git a/doc/ChangeLog b/doc/ChangeLog index aeb7b2972f..f3bf5c91c1 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,4 +1,108 @@ =============================================================== +Tag name: ctsm5.2.018 +Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326) +Date: Wed 31 Jul 2024 04:38:36 PM MDT +One-line Summary: Fix/excess ice cold start + +Purpose and description of changes +---------------------------------- + +Changed the way soil temperature is initialized when excess ice is on and the model starts from cold. + +Specific notes + +Added 2 parameters: excess_ice_coldstart_depth and excess_ice_coldstart_temp which control top depth and soil temperature for soil layers in columns where excess ice is present. Other columns get their default soil temperature. + +excessicestream_type has been taken out of waterstate_type and its routines are called directly in clm_inst%Init. Checks for UseExcessIceStreams() are still in place in WaterStateType.F90 for double-checking. + + +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_1 + +[ ] clm5_0 + +[ ] ctsm5_0-nwp + +[ ] clm4_5 + + +Bugs fixed +---------- + +List of CTSM issues fixed (include CTSM Issue # and description) [one per line]: + Fixes #2384 -- Cold start temperature init when excess ice is on + Fixes #2373 -- SMS_Lm3_D_Mmpi-serial.1x1_brazil.I2000Clm50FatesCruRsGs.izumi_intel.clm-FatesColdHydro fails + +Notes of particular relevance for users +--------------------------------------- + +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): + Added: excess_ice_coldstart_temp and excess_ice_coldstart_depth + +Changes made to namelist defaults (e.g., changed parameter values): + Set new namelist items differently when excess ice is on or off + +Notes of particular relevance for developers: +--------------------------------------------- + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): + Note that the coldstart variables are always used even without excess ice or with an finidat file. + InitCold is always called so the variables are always set. + +Changes to tests or testing: + New tests for build-namelist unit tester + +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 - PASS (998 are different from baseline) + + 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 ----- + izumi ------- + + any other testing (give details below): + + SMS_Lm12.f09_f09_mg17.I1850Clm60Sp.derecho_intel.clm-ExcessIceStartup_output_sp_exice + derecho ---- PASS + +Answer changes +-------------- + +Changes answers relative to baseline: + + Summarize any changes to answers, i.e., + - what code configurations: + - what platforms/compilers: + - nature of change (roundoff; larger than roundoff/same climate; new climate): + +Other details +------------- + +Pull Requests that document the changes (include PR ids): +(https://github.com/ESCOMP/ctsm/pull) + #2465 -- fix excess ice cold starts + +=============================================================== +=============================================================== Tag name: ctsm5.2.017 Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326) Date: Tue 30 Jul 2024 08:39:20 AM MDT diff --git a/doc/ChangeSum b/doc/ChangeSum index 15a67bcf04..c70d3a372b 100644 --- a/doc/ChangeSum +++ b/doc/ChangeSum @@ -1,5 +1,6 @@ Tag Who Date Summary ============================================================================================================================ + ctsm5.2.018 erik 07/31/2024 Fix/excess ice cold start ctsm5.2.017 erik 07/30/2024 Dust emissions control moved to cmeps ctsm5.2.016 samrabin 07/27/2024 Enable new crop calendars for clm60 compsets ctsm5.2.015 multiple 07/22/2024 Update submodule tags to pass runoff from cism to rof From 574380df9b4a465cfdb76d861d16b3f0ea8ec667 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 31 Jul 2024 16:54:27 -0600 Subject: [PATCH 0820/1248] Fix author --- doc/ChangeLog | 2 +- doc/ChangeSum | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index f3bf5c91c1..049a075ad6 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,6 +1,6 @@ =============================================================== Tag name: ctsm5.2.018 -Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326) +Originator(s): mvdebolskiy Date: Wed 31 Jul 2024 04:38:36 PM MDT One-line Summary: Fix/excess ice cold start diff --git a/doc/ChangeSum b/doc/ChangeSum index c70d3a372b..d631d2d7dc 100644 --- a/doc/ChangeSum +++ b/doc/ChangeSum @@ -1,6 +1,6 @@ Tag Who Date Summary ============================================================================================================================ - ctsm5.2.018 erik 07/31/2024 Fix/excess ice cold start + ctsm5.2.018 mvdebols 07/31/2024 Fix/excess ice cold start ctsm5.2.017 erik 07/30/2024 Dust emissions control moved to cmeps ctsm5.2.016 samrabin 07/27/2024 Enable new crop calendars for clm60 compsets ctsm5.2.015 multiple 07/22/2024 Update submodule tags to pass runoff from cism to rof From fb4941b301bead3f5cd42d5147a47a0efa07ac75 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Thu, 1 Aug 2024 00:59:41 -0600 Subject: [PATCH 0821/1248] Don't need to set coldstart temp or depth as these tests are starting up from finidat files --- .../testdefs/testmods_dirs/clm/ExcessIceStreams/user_nl_clm | 2 -- 1 file changed, 2 deletions(-) diff --git a/cime_config/testdefs/testmods_dirs/clm/ExcessIceStreams/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/ExcessIceStreams/user_nl_clm index aa2c9efa5b..f61ca32a79 100644 --- a/cime_config/testdefs/testmods_dirs/clm/ExcessIceStreams/user_nl_clm +++ b/cime_config/testdefs/testmods_dirs/clm/ExcessIceStreams/user_nl_clm @@ -1,4 +1,2 @@ use_excess_ice = .true. use_excess_ice_streams = .true. - excess_ice_coldstart_depth = 0.5 - excess_ice_coldstart_temp = -5.0 From 3ed874dd619f2d2af32e4292ae12a37fb765084f Mon Sep 17 00:00:00 2001 From: mvdebolskiy Date: Thu, 1 Aug 2024 05:40:03 -0600 Subject: [PATCH 0822/1248] add more to notes. --- doc/ChangeLog | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index 049a075ad6..9bd2f3e86f 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -11,9 +11,13 @@ Changed the way soil temperature is initialized when excess ice is on and the mo Specific notes -Added 2 parameters: excess_ice_coldstart_depth and excess_ice_coldstart_temp which control top depth and soil temperature for soil layers in columns where excess ice is present. Other columns get their default soil temperature. +TemperatureType now has a private ReadNL subroutine that reads two new namelist options: excess_ice_coldstart_depth and excess_ice_coldstart_temp which control top depth (higher layers get default initial temperature) and soil temperature for soil layers ONLY in columns where excess ice is present. Other columns get their default soil temperature. + +New namelist options belong to a new group "clm_temperature_inparm" with its own logic routine. This is done so in the future hardcoded cold start temperatures can be moved to the namelists. Two namelist tests have been added to check for invalid values logic as well as a test for use_excess_ice_streams logic. use_excess_ice_streams has no default value (due to options for restart) and default value set in the CLMBuildNamelist.pm. + +excessicestream_type has been taken out of waterstate_type and its routines are called directly in clm_inst%Init. Checks for UseExcessIceStreams() are still in place in WaterStateType.F90 for double-checking. clm_inst%Init now has a new local variable with excess ice concentration that are read from streams (or zeros if use_excess_ice is false). Arguments for temperature_type%Init and water_type%Init (and children types) have been changed to include this new variable. Fortran unit tests are also updated to account for these new arguments. + -excessicestream_type has been taken out of waterstate_type and its routines are called directly in clm_inst%Init. Checks for UseExcessIceStreams() are still in place in WaterStateType.F90 for double-checking. Significant changes to scientifically-supported configurations From 3a47c5d1e5b4044018a572c6aa3788edd73f14ad Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Thu, 1 Aug 2024 09:53:41 -0600 Subject: [PATCH 0823/1248] CTSM5.3 updates part 2 (incomplete because SSPs pending) --- .../ctsm/toolchain/gen_mksurfdata_namelist.py | 26 +++++++++---------- .../gen_mksurfdata_namelist.xml | 8 +++--- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/python/ctsm/toolchain/gen_mksurfdata_namelist.py b/python/ctsm/toolchain/gen_mksurfdata_namelist.py index b0c2016ccb..662e58bc8b 100755 --- a/python/ctsm/toolchain/gen_mksurfdata_namelist.py +++ b/python/ctsm/toolchain/gen_mksurfdata_namelist.py @@ -463,16 +463,16 @@ def check_ssp_years(start_year, end_year): """ Check years associated with SSP period """ - if int(start_year) > 2022: + if int(start_year) > 2023: error_msg = ( - "ERROR: if start-year > 2022 must add an --ssp_rcp " + "ERROR: if start-year > 2023 must add an --ssp_rcp " "argument that is not none: valid opts for ssp-rcp " f"are {valid_opts}" ) sys.exit(error_msg) - elif int(end_year) > 2022: + elif int(end_year) > 2023: error_msg = ( - "ERROR: if end-year > 2022 must add an --ssp-rcp " + "ERROR: if end-year > 2023 must add an --ssp-rcp " "argument that is not none: valid opts for ssp-rcp " f"are {valid_opts}" ) @@ -547,14 +547,14 @@ def determine_pft_years(start_year, end_year, potveg): pft_years = "2005" elif int(start_year) >= 850 and int(end_year) <= 1849: pft_years = "0850-1849" - elif int(start_year) >= 1700 and int(start_year) <= 2100 and int(end_year) <= 2022: - pft_years = "1700-2022" + elif int(start_year) >= 1700 and int(start_year) <= 2100 and int(end_year) <= 2023: + pft_years = "1700-2023" elif int(start_year) >= 1700 and int(start_year) <= 2100 and int(end_year) <= 2100: - pft_years = "1700-2022" - pft_years_ssp = "2023-2100" + pft_years = "1700-2023" + pft_years_ssp = "2024-2100" elif int(start_year) >= 2023 and int(start_year) <= 2100 and int(end_year) <= 2100: pft_years = "-999" - pft_years_ssp = "2023-2100" + pft_years_ssp = "2024-2100" else: error_msg = ( f"ERROR: start_year is {start_year} and end_year is " @@ -647,7 +647,7 @@ def write_nml_rawinput( # write everything else nlfile.write(f" {key} = '{value}' \n") - if start_year <= 2022: + if start_year <= 2023: mksrf_fvegtyp = rawdata_files["mksrf_fvegtyp"] mksrf_fvegtyp_mesh = rawdata_files["mksrf_fvegtyp_mesh"] mksrf_fhrvtyp = rawdata_files["mksrf_fvegtyp"] @@ -716,7 +716,7 @@ def handle_transient_run( with open(landuse_fname, "w", encoding="utf-8") as landuse_file: for year in range(start_year, end_year + 1): year_str = str(year) - if year <= 2022: + if year <= 2023: file1 = rawdata_files["mksrf_fvegtyp"] file2 = rawdata_files["mksrf_fvegtyp_urban"] file3 = rawdata_files["mksrf_fvegtyp_lake"] @@ -834,8 +834,8 @@ def determine_input_rawdata(start_year, input_path, attribute_list): max_match_child = child2 if max_match_child is None: - # For years greater than 2022 - mksrf_fvegtyp_ssp must have a match - if start_year > 2022: + # For years greater than 2023 - mksrf_fvegtyp_ssp must have a match + if start_year > 2023: if "mksrf_fvegtyp_ssp" not in child1.tag: error_msg = f"ERROR: {child1.tag} has no matches" sys.exit(error_msg) diff --git a/tools/mksurfdata_esmf/gen_mksurfdata_namelist.xml b/tools/mksurfdata_esmf/gen_mksurfdata_namelist.xml index 1e24accc4d..102162c0dc 100644 --- a/tools/mksurfdata_esmf/gen_mksurfdata_namelist.xml +++ b/tools/mksurfdata_esmf/gen_mksurfdata_namelist.xml @@ -221,7 +221,7 @@ version of the raw dataset will probably go away. - /glade/campaign/cesm/development/lmwg/landuse_source_data/CTSM53RawData/globalctsm53histTRENDY2023Deg025_240709/mksrf_landuse_ctsm53_histTRENDY2023_1700.c240709.nc + /glade/campaign/cesm/development/lmwg/landuse_source_data/CTSM53RawData/globalctsm53histTRENDY2024Deg025_240728/mksrf_landuse_ctsm53_histTRENDY2024_1700.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_1850.cdf5.c20220325.nc lnd/clm2/rawdata/gao_oneill_urban/historical/urban_properties_GaoOneil_05deg_ThreeClass_1850_cdf5_c20220910.nc @@ -263,12 +263,12 @@ version of the raw dataset will probably go away. lnd/clm2/rawdata/gao_oneill_urban/historical/urban_properties_GaoOneil_05deg_ThreeClass_1850_cdf5_c20220910.nc - + - - /glade/campaign/cesm/development/lmwg/landuse_source_data/CTSM53RawData/globalctsm53histTRENDY2023Deg025_240709/mksrf_landuse_ctsm53_histTRENDY2023_%y.c240709.nc + + /glade/campaign/cesm/development/lmwg/landuse_source_data/CTSM53RawData/globalctsm53histTRENDY2024Deg025_240728/mksrf_landuse_ctsm53_histTRENDY2024_%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/historical/urban_properties_GaoOneil_05deg_ThreeClass_%y_cdf5_c20220910.nc From d5e1eef7c81e53000ac477cc9e8bb07186a28a8e Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Thu, 1 Aug 2024 11:23:17 -0600 Subject: [PATCH 0824/1248] CTSM5.3 updates part 2b (should have been in the prev. commit) --- .../mksurfdata_esmf/gen_mksurfdata_namelist.xml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tools/mksurfdata_esmf/gen_mksurfdata_namelist.xml b/tools/mksurfdata_esmf/gen_mksurfdata_namelist.xml index 102162c0dc..c4c11cb93a 100644 --- a/tools/mksurfdata_esmf/gen_mksurfdata_namelist.xml +++ b/tools/mksurfdata_esmf/gen_mksurfdata_namelist.xml @@ -282,7 +282,7 @@ version of the raw dataset will probably go away. - + /glade/campaign/cesm/development/lmwg/landuse_source_data/CTSM53RawData/globalctsm53TRSSP126Deg025_240717/mksrf_landuse_ctsm53_TRSSP126_%y.c240717.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 @@ -295,42 +295,42 @@ version of the raw dataset will probably go away. lnd/clm2/rawdata/gao_oneill_urban/ssp1/urban_properties_GaoOneil_05deg_ThreeClass_ssp1_2100_cdf5_c20220910.nc - + /glade/campaign/cesm/development/lmwg/landuse_source_data/CTSM53RawData/globalctsm53TRSSP119Deg025_240717/mksrf_landuse_ctsm53_TRSSP119_%y.c240717.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/development/lmwg/landuse_source_data/CTSM53RawData/globalctsm53TRSSP245Deg025_240717/mksrf_landuse_ctsm53_TRSSP245_%y.c240717.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/development/lmwg/landuse_source_data/CTSM53RawData/globalctsm53TRSSP370Deg025_240717/mksrf_landuse_ctsm53_TRSSP370_%y.c240717.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 - + lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP4-3.4.simyr2015-2100.c20230226/mksrf_landuse_ctsm52_SSP4-3.4_%y.c20230226.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/development/lmwg/landuse_source_data/CTSM53RawData/globalctsm53TRSSP460Deg025_240717/mksrf_landuse_ctsm53_TRSSP460_%y.c240717.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/development/lmwg/landuse_source_data/CTSM53RawData/globalctsm53TRSSP585Deg025_240717/mksrf_landuse_ctsm53_TRSSP585_%y.c240717.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 @@ -343,7 +343,7 @@ version of the raw dataset will probably go away. lnd/clm2/rawdata/gao_oneill_urban/ssp5/urban_properties_GaoOneil_05deg_ThreeClass_ssp5_2100_cdf5_c20220910.nc - + lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.SSP5-3.4.simyr2015-2100.c20230226/mksrf_landuse_ctsm52_SSP5-3.4_%y.c20230226.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 From 6012fc622a7f5867f6ed087841a0dd00fa6ea4c6 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Thu, 1 Aug 2024 14:59:21 -0600 Subject: [PATCH 0825/1248] Update changelog with more info on the expected answer changes --- doc/ChangeLog | 21 ++++++++++++++------- doc/ChangeSum | 2 +- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index 049a075ad6..55e0bb1329 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,7 +1,7 @@ =============================================================== Tag name: ctsm5.2.018 Originator(s): mvdebolskiy -Date: Wed 31 Jul 2024 04:38:36 PM MDT +Date: Thu 01 Aug 2024 02:53:41 PM MDT One-line Summary: Fix/excess ice cold start Purpose and description of changes @@ -76,13 +76,13 @@ Testing summary: regular regular tests (aux_clm: https://github.com/ESCOMP/CTSM/wiki/System-Testing-Guide#pre-merge-system-testing): - derecho ----- - izumi ------- + derecho ----- OK + izumi ------- OK any other testing (give details below): SMS_Lm12.f09_f09_mg17.I1850Clm60Sp.derecho_intel.clm-ExcessIceStartup_output_sp_exice - derecho ---- PASS + derecho ---- PASS (but different from baseline) Answer changes -------------- @@ -90,9 +90,16 @@ Answer changes Changes answers relative to baseline: Summarize any changes to answers, i.e., - - what code configurations: - - what platforms/compilers: - - nature of change (roundoff; larger than roundoff/same climate; new climate): + - what code configurations: excess ice on + - what platforms/compilers: all + - nature of change: different at startup + Different for cold-start and can be different for a few points where the cold-start + values are still used on interpoaltion of an existing finidat file + + Tests that compare different to baseline: + ERS_D.f10_f10_mg37.I1850Clm60Sp.izumi_nag.clm-ExcessIceStreams + SMS_Lm12.f09_f09_mg17.I1850Clm60Sp.derecho_intel.clm-ExcessIceStartup_output_sp_exice + failed baseline comparison (though answers for default physics configurations have not changed). Other details ------------- diff --git a/doc/ChangeSum b/doc/ChangeSum index d631d2d7dc..7766c18851 100644 --- a/doc/ChangeSum +++ b/doc/ChangeSum @@ -1,6 +1,6 @@ Tag Who Date Summary ============================================================================================================================ - ctsm5.2.018 mvdebols 07/31/2024 Fix/excess ice cold start + ctsm5.2.018 mvdebols 08/01/2024 Fix/excess ice cold start ctsm5.2.017 erik 07/30/2024 Dust emissions control moved to cmeps ctsm5.2.016 samrabin 07/27/2024 Enable new crop calendars for clm60 compsets ctsm5.2.015 multiple 07/22/2024 Update submodule tags to pass runoff from cism to rof From 0f147f87c63d7cec705fb86f704a5c41ea73cebb Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Thu, 1 Aug 2024 16:43:46 -0600 Subject: [PATCH 0826/1248] Name hardwired coefficients into named params --- src/biogeochem/VOCEmissionMod.F90 | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/biogeochem/VOCEmissionMod.F90 b/src/biogeochem/VOCEmissionMod.F90 index b84d6a4ae8..3a6976a9ba 100644 --- a/src/biogeochem/VOCEmissionMod.F90 +++ b/src/biogeochem/VOCEmissionMod.F90 @@ -826,13 +826,14 @@ function get_gamma_SM(btran_in) !!!------- the drought algorithm-------- real(r8), parameter :: a1 = -7.4463_r8 real(r8), parameter :: b1 = 3.2552_r8 + real(r8), parameter :: btran_threshold = 0.2_r8 real(r8) :: get_gamma_SM !--------------------------------------- if (btran_in >= 1._r8) then get_gamma_SM = 1._r8 else - get_gamma_SM = 1._r8 / (1._r8 + b1 * exp(a1 * (btran_in - 0.2_r8))) + get_gamma_SM = 1._r8 / (1._r8 + b1 * exp(a1 * (btran_in - btran_threshold))) endif end function get_gamma_SM @@ -884,6 +885,12 @@ function get_gamma_T(t_veg240_in, t_veg24_in,t_veg_in, ct1_in, ct2_in, betaT_in, real(r8), parameter :: ct3 = 0.00831_r8 ! empirical coefficient (0.0083 in User's Guide) real(r8), parameter :: tstd = 303.15_r8 ! std temperature [K] real(r8), parameter :: bet = 0.09_r8 ! beta empirical coefficient [K-1] + real(r8), parameter :: std_act_energy_isopr = 95._r8 ! standard activation energy for isoprene + real(r8), parameter :: empirical_param_1 = 9.49_r8 ! empirical param for the activation energy in response to 10-day temperature change + real(r8), parameter :: empirical_param_2 = 0.53_r8 ! empirical param for the activation energy in response to 10-day temperature change + real(r8), parameter :: empirical_param_3 = 0.12_r8 ! empirical param for the emission factors of arctic C3 grass in response to 10-day temperature change + real(r8), parameter :: empirical_param_4 = 7.9_r8 ! empirical param for the emission factors of broadleaf deciduous boreal shrubs in response to 10-day temperature change + real(r8), parameter :: empirical_param_5 = 0.217_r8 ! empirical param for the emission factors of broadleaf deciduous boreal shrubs in response to 10-day temperature change !----------------------------------------------------------------------- ! Light dependent fraction (Guenther et al., 2006) @@ -892,11 +899,11 @@ function get_gamma_T(t_veg240_in, t_veg24_in,t_veg_in, ct1_in, ct2_in, betaT_in, topt = co1 + (co2 * (t_veg240_in-tstd0)) if ( (ivt_in == nbrdlf_dcd_brl_shrub) ) then ! boreal-deciduous-shrub ! coming from BEAR-oNS campaign willows results - Eopt = 7.9_r8 * exp (0.217_r8 * (t_veg24_in - tfrz - 24.0_r8)) + Eopt = empirical_param_4 * exp (empirical_param_5 * (t_veg24_in - tfrz - 24.0_r8)) else if ( (ivt_in == nc3_arctic_grass ) ) then ! boreal-grass - Eopt = exp(0.12_r8 * (t_veg240_in - tfrz - 15._r8)) + Eopt = exp(empirical_param_3 * (t_veg240_in - tfrz - 15._r8)) else - Eopt = Ceo_in * exp (co4 * (t_veg24_in - tstd0)) * exp(co4 * (t_veg240_in - tstd0)) + Eopt = Ceo_in * exp (co4 * (t_veg24_in - tstd0)) * exp(co4 * (t_veg240_in - tstd0)) endif else @@ -906,7 +913,7 @@ function get_gamma_T(t_veg240_in, t_veg24_in,t_veg_in, ct1_in, ct2_in, betaT_in, x = ( (1._r8/topt) - (1._r8/(t_veg_in)) ) / ct3 ! for the boreal grass from BEAR-oNS campaign if ( (ivt_in == nc3_arctic_grass ) ) then ! boreal-grass - bet_arc_c3 = 95._r8 + 9.49_r8 * exp(0.53_r8 * (tfrz + 15._r8 - t_veg240_in)) + bet_arc_c3 = std_act_energy_isopr + empirical_param_1 * exp(empirical_param_2 * (tfrz + 15._r8 - t_veg240_in)) bet_arc_c3 = min(bet_arc_c3, bet_arc_c3_max) gamma_t_LDF = Eopt * exp(bet_arc_c3 * ((1._r8 / (tfrz + 30._r8) - 1._r8 / t_veg_in) / ct3)) else From c5fb0bbb9a4cacb7e285f5169c5d5c39c25216e3 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Thu, 1 Aug 2024 17:45:40 -0600 Subject: [PATCH 0827/1248] Documentation for two variables --- src/biogeochem/VOCEmissionMod.F90 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/biogeochem/VOCEmissionMod.F90 b/src/biogeochem/VOCEmissionMod.F90 index 3a6976a9ba..533c7d892e 100644 --- a/src/biogeochem/VOCEmissionMod.F90 +++ b/src/biogeochem/VOCEmissionMod.F90 @@ -874,8 +874,8 @@ function get_gamma_T(t_veg240_in, t_veg24_in,t_veg_in, ct1_in, ct2_in, betaT_in, real(r8) :: gamma_t_LDF ! activity factor for temperature real(r8) :: gamma_t_LIF ! activity factor for temperature real(r8) :: x ! temporary i - real(r8) :: bet_arc_c3 - real(r8), parameter :: bet_arc_c3_max = 300._r8 + real(r8) :: bet_arc_c3 ! activity factor for temperature for arctic C3 grass + real(r8), parameter :: bet_arc_c3_max = 300._r8 ! max value, activity factor for temperature for arctic C3 graass real(r8), parameter :: co1 = 313._r8 ! empirical coefficient real(r8), parameter :: co2 = 0.6_r8 ! empirical coefficient real(r8), parameter :: co4 = 0.05_r8 ! empirical coefficient From 9dfc55a14af2ab918372e3323434c98a6ec78207 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Thu, 1 Aug 2024 17:47:20 -0600 Subject: [PATCH 0828/1248] Draft ChangeLog/ChangeSum --- doc/ChangeLog | 70 +++++++++++++++++++++++++++++++++++++++++++++++++++ doc/ChangeSum | 1 + 2 files changed, 71 insertions(+) diff --git a/doc/ChangeLog b/doc/ChangeLog index aeb7b2972f..03a3c8999b 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,4 +1,74 @@ =============================================================== +Tag name: ctsm5.2.0?? +Originator(s): HuiWangWanderInGitHub (Hui Wang,huiw16@uci.edu) +Date: Thu 01 Aug 2024 05:09:46 PM MDT +One-line Summary: MEGAN updates (MEGAN-CLM6) + +Purpose and description of changes +---------------------------------- + + We add new features to MEGANv2.1 for simulating isoprene emissions based on three recent studies conducted at the BAI lab in the University of California, Irvine. The first one is about the drought impact on isoprene (Wang et al., 2022). The second study investigates the effect of temperature history on the emission factors of boreal broadleaf deciduous shrubs (Wang et al., 2024a). The third study explores a different temperature response curve for C3 Arctic grass (Wang et al., 2024b, under press). These changes improved the model's representation of isoprene emissions during drought and in high-latitude ecosystems. + + This work relates to issue #1323 and is based on the old MEGANv2.1 framework, but incorporates new scientific insights. + +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_1 + +[ ] clm5_0 + +[ ] ctsm5_0-nwp + +[ ] clm4_5 + + +Notes of particular relevance for users +--------------------------------------- + +Changes to documentation: + Hui Wang has offered to provide the modifications to the documentation that we need. + The PR https://github.com/ESCOMP/CTSM/pull/2588 includes a list of references. + +Substantial timing or memory changes: +[e.g., check PFS test in the test suite and look at timings, if you +expect possible significant timing changes] + + +Testing summary: +---------------- + + [PASS means all tests PASS; OK means tests PASS other than expected fails.] + + 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: Yes + + Summarize any changes to answers, i.e., + - what code configurations: All that calculate BVOCs (so not FATES) + - what platforms/compilers: All + - nature of change: Larger than roundoff, only in BVOC output and specifically limited to MEG_ and _voc variables. + +Other details +------------- +Pull Requests that document the changes (include PR ids): + https://github.com/ESCOMP/CTSM/pull/2588 + +=============================================================== +=============================================================== Tag name: ctsm5.2.017 Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326) Date: Tue 30 Jul 2024 08:39:20 AM MDT diff --git a/doc/ChangeSum b/doc/ChangeSum index 15a67bcf04..315a5cb470 100644 --- a/doc/ChangeSum +++ b/doc/ChangeSum @@ -1,5 +1,6 @@ Tag Who Date Summary ============================================================================================================================ + ctsm5.2.0?? slevis 08/01/2024 MEGAN updates (MEGAN-CLM6) ctsm5.2.017 erik 07/30/2024 Dust emissions control moved to cmeps ctsm5.2.016 samrabin 07/27/2024 Enable new crop calendars for clm60 compsets ctsm5.2.015 multiple 07/22/2024 Update submodule tags to pass runoff from cism to rof From a8371f7c1d76ea7b0ccb75ebe9ca63ae090473b2 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Fri, 2 Aug 2024 09:27:21 -0600 Subject: [PATCH 0829/1248] Update change files --- doc/ChangeLog | 7 +++---- doc/ChangeSum | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index c5c7c3b9f7..f5cf28096c 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,7 +1,7 @@ =============================================================== Tag name: ctsm5.2.018 Originator(s): mvdebolskiy -Date: Thu 01 Aug 2024 02:53:41 PM MDT +Date: Fri 02 Aug 2024 09:26:33 AM MDT One-line Summary: Fix/excess ice cold start Purpose and description of changes @@ -86,7 +86,7 @@ Testing summary: regular any other testing (give details below): SMS_Lm12.f09_f09_mg17.I1850Clm60Sp.derecho_intel.clm-ExcessIceStartup_output_sp_exice - derecho ---- PASS (but different from baseline) + derecho ---- PASS Answer changes -------------- @@ -94,7 +94,7 @@ Answer changes Changes answers relative to baseline: Summarize any changes to answers, i.e., - - what code configurations: excess ice on + - what code configurations: excess ice on, with coldstart or with finidat file interpolation - what platforms/compilers: all - nature of change: different at startup Different for cold-start and can be different for a few points where the cold-start @@ -102,7 +102,6 @@ Changes answers relative to baseline: Tests that compare different to baseline: ERS_D.f10_f10_mg37.I1850Clm60Sp.izumi_nag.clm-ExcessIceStreams - SMS_Lm12.f09_f09_mg17.I1850Clm60Sp.derecho_intel.clm-ExcessIceStartup_output_sp_exice failed baseline comparison (though answers for default physics configurations have not changed). Other details diff --git a/doc/ChangeSum b/doc/ChangeSum index 7766c18851..3d9d70bc54 100644 --- a/doc/ChangeSum +++ b/doc/ChangeSum @@ -1,6 +1,6 @@ Tag Who Date Summary ============================================================================================================================ - ctsm5.2.018 mvdebols 08/01/2024 Fix/excess ice cold start + ctsm5.2.018 mvdebols 08/02/2024 Fix/excess ice cold start ctsm5.2.017 erik 07/30/2024 Dust emissions control moved to cmeps ctsm5.2.016 samrabin 07/27/2024 Enable new crop calendars for clm60 compsets ctsm5.2.015 multiple 07/22/2024 Update submodule tags to pass runoff from cism to rof From 61d99830c34fcb2b04dca54a605956e4add50350 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Fri, 2 Aug 2024 11:24:46 -0600 Subject: [PATCH 0830/1248] CTSM5.3 updates part 3 (SSPs) --- tools/mksurfdata_esmf/gen_mksurfdata_namelist.xml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tools/mksurfdata_esmf/gen_mksurfdata_namelist.xml b/tools/mksurfdata_esmf/gen_mksurfdata_namelist.xml index c4c11cb93a..dde824e02c 100644 --- a/tools/mksurfdata_esmf/gen_mksurfdata_namelist.xml +++ b/tools/mksurfdata_esmf/gen_mksurfdata_namelist.xml @@ -283,7 +283,7 @@ version of the raw dataset will probably go away. - /glade/campaign/cesm/development/lmwg/landuse_source_data/CTSM53RawData/globalctsm53TRSSP126Deg025_240717/mksrf_landuse_ctsm53_TRSSP126_%y.c240717.nc + /glade/campaign/cesm/development/lmwg/landuse_source_data/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 @@ -296,21 +296,21 @@ version of the raw dataset will probably go away. - /glade/campaign/cesm/development/lmwg/landuse_source_data/CTSM53RawData/globalctsm53TRSSP119Deg025_240717/mksrf_landuse_ctsm53_TRSSP119_%y.c240717.nc + /glade/campaign/cesm/development/lmwg/landuse_source_data/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/development/lmwg/landuse_source_data/CTSM53RawData/globalctsm53TRSSP245Deg025_240717/mksrf_landuse_ctsm53_TRSSP245_%y.c240717.nc + /glade/campaign/cesm/development/lmwg/landuse_source_data/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/development/lmwg/landuse_source_data/CTSM53RawData/globalctsm53TRSSP370Deg025_240717/mksrf_landuse_ctsm53_TRSSP370_%y.c240717.nc + /glade/campaign/cesm/development/lmwg/landuse_source_data/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 @@ -324,14 +324,14 @@ version of the raw dataset will probably go away. - /glade/campaign/cesm/development/lmwg/landuse_source_data/CTSM53RawData/globalctsm53TRSSP460Deg025_240717/mksrf_landuse_ctsm53_TRSSP460_%y.c240717.nc + /glade/campaign/cesm/development/lmwg/landuse_source_data/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/development/lmwg/landuse_source_data/CTSM53RawData/globalctsm53TRSSP585Deg025_240717/mksrf_landuse_ctsm53_TRSSP585_%y.c240717.nc + /glade/campaign/cesm/development/lmwg/landuse_source_data/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 From b09ef392ba4026ac80f4416c6c9b88bf780d34d8 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Mon, 5 Aug 2024 15:46:52 -0600 Subject: [PATCH 0831/1248] mpi bcast dust_emis_method so can go between Leung and Zender methods --- src/main/controlMod.F90 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/controlMod.F90 b/src/main/controlMod.F90 index 46d9e9958a..ef4ead3709 100644 --- a/src/main/controlMod.F90 +++ b/src/main/controlMod.F90 @@ -871,6 +871,9 @@ subroutine control_spmd() call mpi_bcast (anoxia, 1, MPI_LOGICAL, 0, mpicom, ier) end if + ! dust emissions + call mpi_bcast (dust_emis_method, len(dust_emis_method), MPI_CHARACTER, 0, mpicom, ier) + ! lakes call mpi_bcast (deepmixing_depthcrit, 1, MPI_REAL8, 0, mpicom, ier) call mpi_bcast (deepmixing_mixfact, 1, MPI_REAL8, 0, mpicom, ier) From 90b534af01502b20e7bbd3ceb8250746b4eadfd5 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Mon, 5 Aug 2024 17:56:19 -0600 Subject: [PATCH 0832/1248] Change Izumi nag RxCropCalsAdaptGGCMI to debug. Previously: SMS_P128x1_Lm25.f10_f10_mg37.IHistClm60BgcCrop.izumi_nag.clm-RxCropCalsAdaptGGCMI Now: SMS_D_P128x1_Lm25.f10_f10_mg37.IHistClm60BgcCrop.izumi_nag.clm-RxCropCalsAdaptGGCMI --- cime_config/testdefs/testlist_clm.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index 951e0d8d5b..ce2b6de435 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -3578,7 +3578,7 @@ - + From 7387303e8f5c1f40a60604dbf170dea12a877039 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Mon, 5 Aug 2024 17:59:53 -0600 Subject: [PATCH 0833/1248] Change 25-month crop_calendars tests to use cropMonthOutput. --- cime_config/testdefs/testlist_clm.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index ce2b6de435..d6ea6b08da 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -3569,7 +3569,7 @@ - + @@ -3578,7 +3578,7 @@ - + From d3de08bfff1ec10ba088442d39f0da59ee106378 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Mon, 5 Aug 2024 18:01:36 -0600 Subject: [PATCH 0834/1248] Change 25-month crop_calendars tests to be 733 days instead. --- cime_config/testdefs/testlist_clm.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index d6ea6b08da..3ab3f86436 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -3569,7 +3569,7 @@ - + @@ -3578,7 +3578,7 @@ - + From f40bdbb139656885a37d6199f9d4c37eda45069a Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Mon, 5 Aug 2024 18:04:01 -0600 Subject: [PATCH 0835/1248] Add temporary test suite fix_nag_bld_2659. --- cime_config/testdefs/testlist_clm.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index 3ab3f86436..ea02ac9375 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -3572,6 +3572,7 @@ + @@ -3583,6 +3584,7 @@ + From e72354571a2186c14400791490cc967887565de5 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Mon, 5 Aug 2024 22:25:03 -0600 Subject: [PATCH 0836/1248] Add a subroutine to set drag partition for testing, label input/output variables for DustEmission, remove begc/endc --- src/biogeochem/DustEmisLeung2023.F90 | 81 ++++++++++++++++++---------- 1 file changed, 53 insertions(+), 28 deletions(-) diff --git a/src/biogeochem/DustEmisLeung2023.F90 b/src/biogeochem/DustEmisLeung2023.F90 index f6cd6bed89..6cc86e4eb5 100644 --- a/src/biogeochem/DustEmisLeung2023.F90 +++ b/src/biogeochem/DustEmisLeung2023.F90 @@ -77,6 +77,8 @@ module DustEmisLeung2023 procedure , private :: InitHistory ! History initialization procedure , private :: InitCold procedure , private :: CalcDragPartition ! Calculate drag partitioning based on Prigent roughness stream + ! Public for unit testing + procedure , public :: SetDragPartition ! Set drag partitioning for testing end type dust_emis_leung2023_type @@ -126,11 +128,9 @@ subroutine InitAllocate(this, bounds) type(bounds_type), intent(in) :: bounds ! ! !LOCAL VARIABLES: - integer :: begc,endc integer :: begp,endp !------------------------------------------------------------------------ - begc = bounds%begc ; endc = bounds%endc begp = bounds%begp ; endp = bounds%endp allocate(this%dst_emiss_coeff_patch (begp:endp)) ; this%dst_emiss_coeff_patch (:) = nan allocate(this%wnd_frc_thr_patch (begp:endp)) ; this%wnd_frc_thr_patch (:) = nan @@ -208,11 +208,9 @@ subroutine InitHistory(this, bounds) type(bounds_type), intent(in) :: bounds ! ! !LOCAL VARIABLES: - integer :: begc,endc integer :: begp,endp !------------------------------------------------------------------------ - begc = bounds%begc; endc = bounds%endc begp = bounds%begp; endp = bounds%endp this%dst_emiss_coeff_patch(begp:endp) = spval call hist_addfld1d (fname='DUST_EMIS_COEFF', units='dimensionless', & @@ -434,34 +432,34 @@ subroutine DustEmission (this, bounds, & h2osoi_ice => waterstatebulk_inst%h2osoi_ice_col , & ! Input: [real(r8) (:,:) ] frozen soil water (kg/m2) fv => frictionvel_inst%fv_patch , & ! Input: [real(r8) (:) ] friction velocity (m/s) (for dust model) - u10 => frictionvel_inst%u10_patch , & ! Input: [real(r8) (:) ] 10-m wind (m/s) (created for dust model) + obu => frictionvel_inst%obu_patch , & ! Input: [real(r8) (:) ] Monin-Obukhov length from the friction Velocity module obu => frictionvel_inst%obu_patch & ! Input: [real(r8) (:) ] Monin-Obukhov length from the friction Velocity module + + dpfct_rock => this%dpfct_rock_patch , & ! Input: rock drag partition factor defined in Marticorena and Bergametti 1995. A fraction between 0 and 1. flx_mss_vrt_dst => this%flx_mss_vrt_dst_patch , & ! Output: [real(r8) (:,:) ] surface dust emission (kg/m**2/s) flx_mss_vrt_dst_tot => this%flx_mss_vrt_dst_tot_patch , & ! Output: [real(r8) (:) ] total dust flux back to atmosphere (pft) ! below variables are defined in Kok et al. (2014) or (mostly) Leung et al. (2023) dust emission scheme. dmleung 16 Feb 2024 - dst_emiss_coeff => this%dst_emiss_coeff_patch , & ! Output dust emission coefficient - wnd_frc_thr => this%wnd_frc_thr_patch , & ! output fluid threshold - wnd_frc_thr_dry => this%wnd_frc_thr_dry_patch , & ! output dry fluid threshold - wnd_frc_thr_it => this%wnd_frc_thr_it_patch , & ! output impact threshold - lnd_frc_mble => this%lnd_frc_mble_patch , & ! output bare land fraction - wnd_frc_soil => this%wnd_frc_soil_patch , & ! soil friction velocity u_*s = (u_*)(f_eff) - gwc => this%gwc_patch , & ! output gravimetric water content - liq_frac => this%liq_frac_patch , & ! output fraction of liquid moisture - intrmtncy_fct => this%intrmtncy_fct_patch , & ! output intermittency factor eta (fraction of time that dust emission is active within a timestep) - stblty => this%stblty_patch , & ! stability in similarity theory (no need to output) - u_mean_slt => this%u_mean_slt_patch , & ! output mean wind speed at 0.1 m height translated from friction velocity using the log law of the wall, assuming neutral condition - u_sd_slt => this%u_sd_slt_patch , & ! output standard deviation of wind speed from similarity theory - u_fld_thr => this%u_fld_thr_patch , & ! output fluid threshold wind speed at 0.1 m height translated from the log law of the wall - u_impct_thr => this%u_impct_thr_patch , & ! output impact threshold wind speed at 0.1 m height translated from the log law of the wall - thr_crs_rate => this%thr_crs_rate_patch , & ! output threshold crossing rate in Comola 2019 intermittency parameterization - prb_crs_fld_thr => this%prb_crs_fld_thr_patch , & ! output probability of instantaneous wind crossing fluid threshold in Comola 2019 intermittency parameterization - prb_crs_impct_thr => this%prb_crs_impct_thr_patch , & ! output probability of instantaneous wind crossing impact threshold in Comola 2019 intermittency parameterization - ssr => this%ssr_patch , & ! output vegetation drag partition factor in Okin 2008 vegetation roughness effect (called shear stress ratio, SSR in Okin 2008) - vai_Okin => this%vai_Okin_patch , & ! vegetation area index for calculating Okin-Pierre vegetation drag partitioning. vai=0 in the ssr equation will lead to infinity, so a small value is added into this vai dmleung defined. (no need to output) 16 Feb 2024 - frc_thr_rghn_fct => this%frc_thr_rghn_fct_patch , & ! output hybrid/total drag partition factor considering both rock and vegetation drag partition factors. - wnd_frc_thr_std => this%wnd_frc_thr_std_patch , & ! standardized dust emission threshold friction velocity defined in Jasper Kok et al. (2014). - dpfct_rock => this%dpfct_rock_patch , & ! output rock drag partition factor defined in Marticorena and Bergametti 1995. A fraction between 0 and 1. - obu => frictionvel_inst%obu_patch & ! Input: [real(r8) (:) ] Monin-Obukhov length from the friction Velocity module obu => frictionvel_inst%obu_patch & ! Input: [real(r8) (:) ] Monin-Obukhov length from the friction Velocity module + dst_emiss_coeff => this%dst_emiss_coeff_patch , & ! Output: dust emission coefficient + wnd_frc_thr => this%wnd_frc_thr_patch , & ! Output: fluid threshold + wnd_frc_thr_dry => this%wnd_frc_thr_dry_patch , & ! Output: dry fluid threshold + wnd_frc_thr_it => this%wnd_frc_thr_it_patch , & ! Output: impact threshold + lnd_frc_mble => this%lnd_frc_mble_patch , & ! Output: bare land fraction + wnd_frc_soil => this%wnd_frc_soil_patch , & ! Output: soil friction velocity u_*s = (u_*)(f_eff) + gwc => this%gwc_patch , & ! output: gravimetric water content + liq_frac => this%liq_frac_patch , & ! Output: fraction of liquid moisture + intrmtncy_fct => this%intrmtncy_fct_patch , & ! Output: intermittency factor eta (fraction of time that dust emission is active within a timestep) + stblty => this%stblty_patch , & ! Output: stability in similarity theory (no need to output) + u_mean_slt => this%u_mean_slt_patch , & ! Output: mean wind speed at 0.1 m height translated from friction velocity using the log law of the wall, assuming neutral condition + u_sd_slt => this%u_sd_slt_patch , & ! Output: standard deviation of wind speed from similarity theory + u_fld_thr => this%u_fld_thr_patch , & ! Output: fluid threshold wind speed at 0.1 m height translated from the log law of the wall + u_impct_thr => this%u_impct_thr_patch , & ! Output: impact threshold wind speed at 0.1 m height translated from the log law of the wall + thr_crs_rate => this%thr_crs_rate_patch , & ! Output: threshold crossing rate in Comola 2019 intermittency parameterization + prb_crs_fld_thr => this%prb_crs_fld_thr_patch , & ! Output: probability of instantaneous wind crossing fluid threshold in Comola 2019 intermittency parameterization + prb_crs_impct_thr => this%prb_crs_impct_thr_patch , & ! Output: probability of instantaneous wind crossing impact threshold in Comola 2019 intermittency parameterization + ssr => this%ssr_patch , & ! Output: vegetation drag partition factor in Okin 2008 vegetation roughness effect (called shear stress ratio, SSR in Okin 2008) + vai_Okin => this%vai_Okin_patch , & ! Output: vegetation area index for calculating Okin-Pierre vegetation drag partitioning. vai=0 in the ssr equation will lead to infinity, so a small value is added into this vai dmleung defined. (no need to output) 16 Feb 2024 + frc_thr_rghn_fct => this%frc_thr_rghn_fct_patch , & ! Output: hybrid/total drag partition factor considering both rock and vegetation drag partition factors. + wnd_frc_thr_std => this%wnd_frc_thr_std_patch & ! Output: standardized dust emission threshold friction velocity defined in Jasper Kok et al. (2014). ) ttlai(bounds%begp : bounds%endp) = 0._r8 @@ -869,6 +867,33 @@ subroutine CalcDragPartition(this, bounds) end subroutine CalcDragPartition + + !------------------------------------------------------------------------ + + subroutine SetDragPartition(this, bounds, drag_partition) + ! + ! !DESCRIPTION: + ! Set the drag partition for testing + ! + ! !USES: + ! + ! !ARGUMENTS: + implicit none + class (dust_emis_leung2023_type) :: this + type(bounds_type), intent(in) :: bounds + real(r8), intent(in) :: drag_partition + ! + ! !LOCAL VARIABLES: + integer :: p ! Indices + + !--------------------------------------------------------------------- + + do p = bounds%begp,bounds%endp + this%dpfct_rock_patch(p) = drag_partition + end do + + end subroutine SetDragPartition + !============================================================================== end module DustEmisLeung2023 \ No newline at end of file From 064c37cc02a207002e49cb7ab5e13195ffb0d669 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 7 Aug 2024 09:32:06 -0600 Subject: [PATCH 0837/1248] By default prigent streams are off for Zender dust emissions --- bld/CLMBuildNamelist.pm | 11 ++++++++--- bld/namelist_files/namelist_defaults_ctsm.xml | 3 ++- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index f449dcc6e3..f1e5935196 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -1601,7 +1601,6 @@ sub process_namelist_inline_logic { setup_logic_fates($opts, $nl_flags, $definition, $defaults, $nl); setup_logic_z0param($opts, $nl_flags, $definition, $defaults, $nl); setup_logic_misc($opts, $nl_flags, $definition, $defaults, $nl); - setup_logic_prigent_roughness($opts, $nl_flags, $definition, $defaults, $nl); ######################################### # namelist group: atm2lnd_inparm @@ -1703,6 +1702,7 @@ sub process_namelist_inline_logic { # namelist options for dust emissions ###################################### setup_logic_dust_emis($opts, $nl_flags, $definition, $defaults, $nl); + setup_logic_prigent_roughness($opts, $nl_flags, $definition, $defaults, $nl); ################################# # namelist group: megan_emis_nl # @@ -4671,12 +4671,17 @@ sub setup_logic_prigent_roughness { # my ($opts, $nl_flags, $definition, $defaults, $nl) = @_; my $var = "use_prigent_roughness"; - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, $var ); + my $dust_emis_method = remove_leading_and_trailing_quotes( $nl->get_value('dust_emis_method') ); + add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, $var, + 'dust_emis_method'=>$dust_emis_method ); my $use_prigent = $nl->get_value($var); if ( &value_is_true($use_prigent) ) { + if ( $dust_emis_method eq "Leung_2023" ) { + $log->warning( "$var does NOT need to be set without dust_emis_method being Leung_2023" ); + } add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_fldfilename_prigentroughness' ); add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_meshfile_prigentroughness' ); - } else { + } elsif ( $dust_emis_method eq "Leung_2023" ) { $log->fatal_error("variable \"$var\" MUST be true when Leung_2023 dust emission method is being used" ); } } diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index 9a56c1f1b0..ea82141663 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -2001,7 +2001,8 @@ lnd/clm2/surfdata_esmf/NEON/surfdata_1x1_NEON_TOOL_hist_78pfts_CMIP6_simyr2000_c -.true. +.true. +.false. lnd/clm2/dustemisdata/Prigent_2005_roughness_0.25x0.25_cdf5_c240127.nc Date: Wed, 7 Aug 2024 11:43:29 -0600 Subject: [PATCH 0838/1248] Remove include_user_mods from RxCropCals* and midDecStart testmods. --- cime_config/testdefs/testlist_clm.xml | 8 +++++--- .../clm/RxCropCalsAdaptGGCMI/include_user_mods | 1 - .../testmods_dirs/clm/RxCropCalsNoAdapt/include_user_mods | 1 - .../testmods_dirs/clm/midDecStart/include_user_mods | 1 - 4 files changed, 5 insertions(+), 6 deletions(-) delete mode 100644 cime_config/testdefs/testmods_dirs/clm/RxCropCalsAdaptGGCMI/include_user_mods delete mode 100644 cime_config/testdefs/testmods_dirs/clm/RxCropCalsNoAdapt/include_user_mods delete mode 100644 cime_config/testdefs/testmods_dirs/clm/midDecStart/include_user_mods diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index ea02ac9375..1e687522e4 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -3587,24 +3587,26 @@ - + - + + - + + diff --git a/cime_config/testdefs/testmods_dirs/clm/RxCropCalsAdaptGGCMI/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/RxCropCalsAdaptGGCMI/include_user_mods deleted file mode 100644 index 23ea3745e6..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/RxCropCalsAdaptGGCMI/include_user_mods +++ /dev/null @@ -1 +0,0 @@ -../crop diff --git a/cime_config/testdefs/testmods_dirs/clm/RxCropCalsNoAdapt/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/RxCropCalsNoAdapt/include_user_mods deleted file mode 100644 index 23ea3745e6..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/RxCropCalsNoAdapt/include_user_mods +++ /dev/null @@ -1 +0,0 @@ -../crop diff --git a/cime_config/testdefs/testmods_dirs/clm/midDecStart/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/midDecStart/include_user_mods deleted file mode 100644 index fe0e18cf88..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/midDecStart/include_user_mods +++ /dev/null @@ -1 +0,0 @@ -../default From 38926beaa6623270bf54ae9a2efdaa19305366a1 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Wed, 7 Aug 2024 12:40:02 -0600 Subject: [PATCH 0839/1248] Copy CNFireLi2021Mod.F90 to new CNFireLi2024Mod.F90. Includes new fire_method li2024gswpfrc. --- bld/namelist_files/namelist_defaults_ctsm.xml | 15 + .../namelist_definition_ctsm.xml | 3 +- src/biogeochem/CNFireFactoryMod.F90 | 3 + src/biogeochem/CNFireLi2024Mod.F90 | 658 ++++++++++++++++++ 4 files changed, 678 insertions(+), 1 deletion(-) create mode 100644 src/biogeochem/CNFireLi2024Mod.F90 diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index 655e97c47c..a7e59935a4 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -319,6 +319,21 @@ attributes from the config_cache.xml file (with keys converted to upper-case). 0.5d00 0.28d00 +30.0d00 +80.0d00 +0.85d00 +0.98d00 +0.025d00 +0.09d-4 +0.010d00 +0.17d-3 +1.6d-4 +0.33d00 +75.d00 +1050.d00 +0.5d00 +0.28d00 + .false. .true. diff --git a/bld/namelist_files/namelist_definition_ctsm.xml b/bld/namelist_files/namelist_definition_ctsm.xml index 37c457141c..6b70c117e5 100644 --- a/bld/namelist_files/namelist_definition_ctsm.xml +++ b/bld/namelist_files/namelist_definition_ctsm.xml @@ -252,13 +252,14 @@ formulation (1). + group="cnfire_inparm" valid_values="nofire,li2014qianfrc,li2016crufrc,li2021gswpfrc,li2024gswpfrc" > The method type to use for CNFire nofire: Turn fire effects off li2014qianfrc: Reference paper Li, et. al.(2014) tuned with QIAN atmospheric forcing li2016crufrc: Reference paper Li, et. al.(2016) tuned with CRU-NCEP atmospheric forcing li2021gswpfrc: Reference paper Li, et. al.(2021?) tuned with GSWP3 atmospheric forcing +li2024gswpfrc: No reference paper yet shr_kind_r8, CL => shr_kind_CL + use shr_const_mod , only : SHR_CONST_PI,SHR_CONST_TKFRZ + use shr_infnan_mod , only : shr_infnan_isnan + use clm_varctl , only : iulog + use clm_varpar , only : nlevdecomp, ndecomp_pools, nlevdecomp_full, nlevgrnd + use clm_varcon , only : dzsoi_decomp + use pftconMod , only : noveg, pftcon + use abortutils , only : endrun + use decompMod , only : bounds_type + use subgridAveMod , only : p2c + use atm2lndType , only : atm2lnd_type + use CNDVType , only : dgvs_type + use CNVegStateType , only : cnveg_state_type + use CNVegCarbonStateType , only : cnveg_carbonstate_type, spinup_factor_deadwood + use CNVegCarbonFluxType , only : cnveg_carbonflux_type + use CNVegNitrogenStateType , only : cnveg_nitrogenstate_type + use CNVegNitrogenFluxType , only : cnveg_nitrogenflux_type + use SoilBiogeochemDecompCascadeConType , only : decomp_cascade_con + use EnergyFluxType , only : energyflux_type + use SaturatedExcessRunoffMod , only : saturated_excess_runoff_type + use WaterDiagnosticBulkType , only : waterdiagnosticbulk_type + use Wateratm2lndBulkType , only : wateratm2lndbulk_type + use WaterStateBulkType , only : waterstatebulk_type + use SoilStateType , only : soilstate_type + use SoilWaterRetentionCurveMod , only : soil_water_retention_curve_type + use GridcellType , only : grc + use ColumnType , only : col + use PatchType , only : patch + use SoilBiogeochemStateType , only : get_spinup_latitude_term + use FireMethodType , only : fire_method_type + use CNFireBaseMod , only : cnfire_base_type, cnfire_const, cnfire_params + ! + implicit none + private + ! + ! !PUBLIC TYPES: + public :: cnfire_li2024_type + ! + type, extends(cnfire_base_type) :: cnfire_li2024_type + private + contains + ! + ! !PUBLIC MEMBER FUNCTIONS: + procedure, public :: need_lightning_and_popdens + procedure, public :: CNFireArea ! Calculate fire area + end type cnfire_li2024_type + + ! + ! !PRIVATE MEMBER DATA: + !----------------------------------------------------------------------- + + character(len=*), parameter, private :: sourcefile = & + __FILE__ + +contains + + !----------------------------------------------------------------------- + function need_lightning_and_popdens(this) + ! !ARGUMENTS: + class(cnfire_li2024_type), intent(in) :: this + logical :: need_lightning_and_popdens ! function result + ! + ! !LOCAL VARIABLES: + + character(len=*), parameter :: subname = 'need_lightning_and_popdens' + !----------------------------------------------------------------------- + + need_lightning_and_popdens = .true. + end function need_lightning_and_popdens + + !----------------------------------------------------------------------- + subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_soilp, & + num_exposedvegp, filter_exposedvegp, num_noexposedvegp, filter_noexposedvegp, & + atm2lnd_inst, energyflux_inst, saturated_excess_runoff_inst, waterdiagnosticbulk_inst, & + wateratm2lndbulk_inst, waterstatebulk_inst, soilstate_inst, soil_water_retention_curve, & + cnveg_state_inst, cnveg_carbonstate_inst, totlitc_col, decomp_cpools_vr_col, t_soi17cm_col) + ! + ! !DESCRIPTION: + ! Computes column-level burned area + ! + ! !USES: + use clm_time_manager , only: get_step_size_real, get_curr_days_per_year, get_curr_date, get_nstep + use clm_varcon , only: secspday, secsphr + use clm_varctl , only: spinup_state + use pftconMod , only: nc4_grass, nc3crop, ndllf_evr_tmp_tree + use pftconMod , only: nbrdlf_evr_trp_tree, nbrdlf_dcd_trp_tree, nbrdlf_evr_shrub + use dynSubgridControlMod , only : run_has_transient_landcover + ! + ! !ARGUMENTS: + class(cnfire_li2024_type) :: this + type(bounds_type) , intent(in) :: bounds + integer , intent(in) :: num_soilc ! number of soil columns in filter + integer , intent(in) :: filter_soilc(:) ! filter for soil columns + integer , intent(in) :: num_soilp ! number of soil patches in filter + integer , intent(in) :: filter_soilp(:) ! filter for soil patches + integer , intent(in) :: num_exposedvegp ! number of points in filter_exposedvegp + integer , intent(in) :: filter_exposedvegp(:) ! patch filter for non-snow-covered veg + integer , intent(in) :: num_noexposedvegp ! number of points in filter_noexposedvegp + integer , intent(in) :: filter_noexposedvegp(:) ! patch filter where frac_veg_nosno is 0 + type(atm2lnd_type) , intent(in) :: atm2lnd_inst + type(energyflux_type) , intent(in) :: energyflux_inst + type(saturated_excess_runoff_type) , intent(in) :: saturated_excess_runoff_inst + type(waterdiagnosticbulk_type) , intent(in) :: waterdiagnosticbulk_inst + type(wateratm2lndbulk_type) , intent(in) :: wateratm2lndbulk_inst + type(waterstatebulk_type) , intent(in) :: waterstatebulk_inst + type(soilstate_type) , intent(in) :: soilstate_inst + class(soil_water_retention_curve_type), intent(in) :: soil_water_retention_curve + type(cnveg_state_type) , intent(inout) :: cnveg_state_inst + type(cnveg_carbonstate_type) , intent(inout) :: cnveg_carbonstate_inst + real(r8) , intent(in) :: totlitc_col(bounds%begc:) + real(r8) , intent(in) :: decomp_cpools_vr_col(bounds%begc:,1:,1:) + real(r8) , intent(in) :: t_soi17cm_col(bounds%begc:) + ! + ! !LOCAL VARIABLES: + ! + integer :: g,l,c,p,pi,j,fc,fp,kyr, kmo, kda, mcsec ! index variables + real(r8) :: dt ! time step variable (s) + real(r8) :: dayspyr ! days per year + real(r8) :: cli ! effect of climate on deforestation fires (0-1) + real(r8) :: cri ! thresholds used for cli, (mm/d), see Eq.(7) in Li et al.(2013) + real(r8) :: fb ! availability of fuel for regs A and C + real(r8) :: fhd ! impact of hd on agricultural fire + real(r8) :: fgdp ! impact of gdp on agricultural fire + real(r8) :: fire_m ! combustability of fuel for fire occurrence + real(r8) :: spread_m ! combustability of fuel for fire spread + real(r8) :: Lb_lf ! length-to-breadth ratio added by Lifang + integer :: i_cwd ! cwd pool + real(r8) :: lh ! anthro. ignitions (count/km2/hr) + real(r8) :: fs ! hd-dependent fires suppression (0-1) + real(r8) :: ig ! total ignitions (count/km2/hr) + real(r8) :: hdmlf ! human density + 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) + logical :: transient_landcover ! whether this run has any prescribed transient landcover + real(r8), target :: prec60_col_target(bounds%begc:bounds%endc) + real(r8), target :: prec10_col_target(bounds%begc:bounds%endc) + real(r8), target :: rh30_col_target(bounds%begc:bounds%endc) + real(r8), pointer :: prec60_col(:) + real(r8), pointer :: prec10_col(:) + real(r8), pointer :: rh30_col(:) + !----------------------------------------------------------------------- + + SHR_ASSERT_ALL_FL((ubound(totlitc_col) == (/bounds%endc/)), sourcefile, __LINE__) + SHR_ASSERT_ALL_FL((ubound(decomp_cpools_vr_col) == (/bounds%endc,nlevdecomp_full,ndecomp_pools/)), sourcefile, __LINE__) + SHR_ASSERT_ALL_FL((ubound(t_soi17cm_col) == (/bounds%endc/)), sourcefile, __LINE__) + + associate( & + totlitc => totlitc_col , & ! Input: [real(r8) (:) ] (gC/m2) total lit C (column-level mean) + decomp_cpools_vr => decomp_cpools_vr_col , & ! Input: [real(r8) (:,:,:) ] (gC/m3) VR decomp. (litter, cwd, soil) + tsoi17 => t_soi17cm_col , & ! Input: [real(r8) (:) ] (K) soil T for top 0.17 m + + lfuel => cnfire_const%lfuel , & ! Input: [real(r8) ] (gC/m2) Lower threshold of fuel mass + ufuel => cnfire_const%ufuel , & ! Input: [real(r8) ] (gC/m2) Upper threshold of fuel mass + rh_hgh => cnfire_const%rh_hgh , & ! Input: [real(r8) ] (%) High relative humidity + rh_low => cnfire_const%rh_low , & ! Input: [real(r8) ] (%) Low relative humidity + cli_scale => cnfire_const%cli_scale , & ! Input: [real(r8) ] (/d) global constant for deforestation fires + cropfire_a1 => cnfire_const%cropfire_a1 , & ! Input: [real(r8) ] (/hr) a1 parameter for cropland fire + non_boreal_peatfire_c => cnfire_const%non_boreal_peatfire_c , & ! Input: [real(r8) ] (/hr) c parameter for non-boreal peatland fire + pot_hmn_ign_counts_alpha => cnfire_const%pot_hmn_ign_counts_alpha , & ! Input: [real(r8) ] (/person/month) Potential human ignition counts + boreal_peatfire_c => cnfire_const%boreal_peatfire_c , & ! Input: [real(r8) ] (/hr) c parameter for boreal peatland fire + + fsr_pft => pftcon%fsr_pft , & ! Input: + fd_pft => pftcon%fd_pft , & ! Input: + rswf_min => pftcon%rswf_min , & ! Input: + rswf_max => pftcon%rswf_max , & ! Input: + btran2 => this%cnfire_base_type%btran2_patch , & ! Input: [real(r8) (:) ] root zone soil wetness + fsat => saturated_excess_runoff_inst%fsat_col , & ! Input: [real(r8) (:) ] fractional area with water table at surface + wf2 => waterdiagnosticbulk_inst%wf2_col , & ! Input: [real(r8) (:) ] soil water as frac. of whc for top 0.17 m + + is_cwd => decomp_cascade_con%is_cwd , & ! Input: [logical (:) ] TRUE => pool is a cwd pool + spinup_factor => decomp_cascade_con%spinup_factor , & ! Input: [real(r8) (:) ] factor for AD spinup associated with each pool + + forc_rh => wateratm2lndbulk_inst%forc_rh_grc , & ! Input: [real(r8) (:) ] relative humidity + forc_wind => atm2lnd_inst%forc_wind_grc , & ! Input: [real(r8) (:) ] atmospheric wind speed (m/s) + 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 + prec60 => wateratm2lndbulk_inst%prec60_patch , & ! Input: [real(r8) (:) ] 60-day running mean of tot. precipitation + prec10 => wateratm2lndbulk_inst%prec10_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. precipitation + 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 + peatf_lf => this%peatf_lf_col , & ! Input: [real(r8) (:) ] peatland fraction data + abm_lf => this%abm_lf_col , & ! Input: [integer (:) ] prescribed crop fire time + baf_crop => cnveg_state_inst%baf_crop_col , & ! Output: [real(r8) (:) ] burned area fraction for cropland (/sec) + baf_peatf => cnveg_state_inst%baf_peatf_col , & ! Output: [real(r8) (:) ] burned area fraction for peatland (/sec) + burndate => cnveg_state_inst%burndate_patch , & ! Output: [integer (:) ] burn date for crop + fbac => cnveg_state_inst%fbac_col , & ! Output: [real(r8) (:) ] total burned area out of conversion (/sec) + fbac1 => cnveg_state_inst%fbac1_col , & ! Output: [real(r8) (:) ] burned area out of conversion region due to land use fire + farea_burned => cnveg_state_inst%farea_burned_col , & ! Output: [real(r8) (:) ] total fractional area burned (/sec) + nfire => cnveg_state_inst%nfire_col , & ! Output: [real(r8) (:) ] fire counts (count/km2/sec), valid only in Reg. C + fsr_col => cnveg_state_inst%fsr_col , & ! Output: [real(r8) (:) ] fire spread rate at column level + fd_col => cnveg_state_inst%fd_col , & ! Output: [real(r8) (:) ] fire duration rate at column level + lgdp_col => cnveg_state_inst%lgdp_col , & ! Output: [real(r8) (:) ] gdp limitation factor for nfire + lgdp1_col => cnveg_state_inst%lgdp1_col , & ! Output: [real(r8) (:) ] gdp limitation factor for baf per fire + lpop_col => cnveg_state_inst%lpop_col , & ! Output: [real(r8) (:) ] pop limitation factor for baf per fire + lfwt => cnveg_state_inst%lfwt_col , & ! Output: [real(r8) (:) ] fractional coverage of non-crop and non-bare-soil Patches + trotr1_col => cnveg_state_inst%trotr1_col , & ! Output: [real(r8) (:) ] patch weight of BET on the column (0-1) + trotr2_col => cnveg_state_inst%trotr2_col , & ! Output: [real(r8) (:) ] patch weight of BDT on the column (0-1) + dtrotr_col => cnveg_state_inst%dtrotr_col , & ! Output: [real(r8) (:) ] decreased frac. coverage of BET+BDT on grid for dt + lfc => cnveg_state_inst%lfc_col , & ! Output: [real(r8) (:) ] conversion area frac. of BET+BDT that haven't burned before + wtlf => cnveg_state_inst%wtlf_col , & ! Output: [real(r8) (:) ] fractional coverage of non-crop Patches + + totvegc => cnveg_carbonstate_inst%totvegc_col , & ! Input: [real(r8) (:) ] totvegc at column level + deadcrootc => cnveg_carbonstate_inst%deadcrootc_patch , & ! Input: [real(r8) (:) ] (gC/m2) dead coarse root C + deadcrootc_storage => cnveg_carbonstate_inst%deadcrootc_storage_patch , & ! Input: [real(r8) (:) ] (gC/m2) dead coarse root C storage + deadcrootc_xfer => cnveg_carbonstate_inst%deadcrootc_xfer_patch , & ! Input: [real(r8) (:) ] (gC/m2) dead coarse root C transfer + deadstemc => cnveg_carbonstate_inst%deadstemc_patch , & ! Input: [real(r8) (:) ] (gC/m2) dead stem root C + frootc => cnveg_carbonstate_inst%frootc_patch , & ! Input: [real(r8) (:) ] (gC/m2) fine root C + frootc_storage => cnveg_carbonstate_inst%frootc_storage_patch , & ! Input: [real(r8) (:) ] (gC/m2) fine root C storage + frootc_xfer => cnveg_carbonstate_inst%frootc_xfer_patch , & ! Input: [real(r8) (:) ] (gC/m2) fine root C transfer + livecrootc => cnveg_carbonstate_inst%livecrootc_patch , & ! Input: [real(r8) (:) ] (gC/m2) live coarse root C + livecrootc_storage => cnveg_carbonstate_inst%livecrootc_storage_patch , & ! Input: [real(r8) (:) ] (gC/m2) live coarse root C storage + livecrootc_xfer => cnveg_carbonstate_inst%livecrootc_xfer_patch , & ! Input: [real(r8) (:) ] (gC/m2) live coarse root C transfer + leafc => cnveg_carbonstate_inst%leafc_patch , & ! Input: [real(r8) (:) ] (gC/m2) leaf C + leafc_storage => cnveg_carbonstate_inst%leafc_storage_patch , & ! Input: [real(r8) (:) ] (gC/m2) leaf C storage + leafc_xfer => cnveg_carbonstate_inst%leafc_xfer_patch , & ! Input: [real(r8) (:) ] (gC/m2) leaf C transfer + rootc_col => cnveg_carbonstate_inst%rootc_col , & ! Output: [real(r8) (:) ] root carbon + leafc_col => cnveg_carbonstate_inst%leafc_col , & ! Output: [real(r8) (:) ] leaf carbon at column level + deadstemc_col => cnveg_carbonstate_inst%deadstemc_col , & ! Output: [real(r8) (:) ] deadstem carbon at column level + fuelc => cnveg_carbonstate_inst%fuelc_col , & ! Output: [real(r8) (:) ] fuel load coutside cropland + fuelc_crop => cnveg_carbonstate_inst%fuelc_crop_col & ! Output: [real(r8) (:) ] fuel load for cropland + ) + + transient_landcover = run_has_transient_landcover() + + !pft to column average + prec10_col =>prec10_col_target + call p2c(bounds, num_soilc, filter_soilc, & + prec10(bounds%begp:bounds%endp), & + prec10_col(bounds%begc:bounds%endc)) + + prec60_col =>prec60_col_target + call p2c(bounds, num_soilc, filter_soilc, & + prec60(bounds%begp:bounds%endp), & + prec60_col(bounds%begc:bounds%endc)) + + rh30_col =>rh30_col_target + call p2c(bounds, num_soilc, filter_soilc, & + rh30(bounds%begp:bounds%endp), & + rh30_col(bounds%begc:bounds%endc)) + + call p2c(bounds, num_soilc, filter_soilc, & + leafc(bounds%begp:bounds%endp), & + leafc_col(bounds%begc:bounds%endc)) + + call p2c(bounds, num_soilc, filter_soilc, & + deadstemc(bounds%begp:bounds%endp), & + deadstemc_col(bounds%begc:bounds%endc)) + + call get_curr_date (kyr, kmo, kda, mcsec) + dayspyr = get_curr_days_per_year() + ! Get model step size + dt = get_step_size_real() + ! + ! On first time-step, just set area burned to zero and exit + ! + if ( get_nstep() == 0 )then + do fc = 1,num_soilc + c = filter_soilc(fc) + farea_burned(c) = 0._r8 + baf_crop(c) = 0._r8 + baf_peatf(c) = 0._r8 + fbac(c) = 0._r8 + fbac1(c) = 0._r8 + cropf_col(c) = 0._r8 + end do + return + end if + ! + ! Calculate fraction of crop (cropf_col) and non-crop and non-bare-soil + ! vegetation (lfwt) in vegetated column + ! + do fc = 1,num_soilc + c = filter_soilc(fc) + cropf_col(c) = 0._r8 + lfwt(c) = 0._r8 + end do + do fp = 1, num_soilp + p = filter_soilp(fp) + c = patch%column(p) + ! For crop veg types + if( patch%itype(p) > nc4_grass )then + cropf_col(c) = cropf_col(c) + patch%wtcol(p) + end if + ! For natural vegetation (non-crop and non-bare-soil) + if( patch%itype(p) >= ndllf_evr_tmp_tree .and. patch%itype(p) <= nc4_grass )then + lfwt(c) = lfwt(c) + patch%wtcol(p) + end if + end do + ! + ! Calculate crop fuel + ! + do fc = 1,num_soilc + c = filter_soilc(fc) + fuelc_crop(c)=0._r8 + end do + do fp = 1, num_soilp + p = filter_soilp(fp) + c = patch%column(p) + ! For crop PFTs, fuel load includes leaf and litter; only + ! column-level litter carbon + ! is available, so we use leaf carbon to estimate the + ! litter carbon for crop PFTs + if( patch%itype(p) > nc4_grass .and. patch%wtcol(p) > 0._r8 .and. leafc_col(c) > 0._r8 )then + fuelc_crop(c)=fuelc_crop(c) + (leafc(p) + leafc_storage(p) + & + leafc_xfer(p))*patch%wtcol(p)/cropf_col(c) + & + totlitc(c)*leafc(p)/leafc_col(c)*patch%wtcol(p)/cropf_col(c) + end if + end do + ! + ! Calculate noncrop column variables + ! + do fc = 1,num_soilc + c = filter_soilc(fc) + fsr_col(c) = 0._r8 + fd_col(c) = 0._r8 + rootc_col(c) = 0._r8 + lgdp_col(c) = 0._r8 + lgdp1_col(c) = 0._r8 + lpop_col(c) = 0._r8 + btran_col(c) = 0._r8 + wtlf(c) = 0._r8 + trotr1_col(c)= 0._r8 + trotr2_col(c)= 0._r8 + if (transient_landcover) then + dtrotr_col(c)=0._r8 + end if + end do + + ! This subroutine calculates btran2 + call this%CNFire_calc_fire_root_wetness_Li2021(bounds, & + num_exposedvegp, filter_exposedvegp, num_noexposedvegp, filter_noexposedvegp, & + waterstatebulk_inst, soilstate_inst, soil_water_retention_curve) + do fp = 1, num_exposedvegp + p = filter_exposedvegp(fp) + c = patch%column(p) + ! For non-crop -- natural vegetation and bare-soil + if( patch%itype(p) < nc3crop .and. cropf_col(c) < 1.0_r8 )then + btran_col(c) = btran_col(c)+max(0._r8, min(1._r8, & + (btran2(p)-rswf_min(patch%itype(p)))/(rswf_max(patch%itype(p)) & + -rswf_min(patch%itype(p)))))*patch%wtcol(p) + wtlf(c) = wtlf(c)+patch%wtcol(p) + end if + end do + + do fp = 1, num_soilp + p = filter_soilp(fp) + c = patch%column(p) + g = col%gridcell(c) + + ! For non-crop -- natural vegetation and bare-soil + if( patch%itype(p) < nc3crop .and. cropf_col(c) < 1.0_r8 )then + + ! NOTE(wjs, 2016-12-15) These calculations of the fraction of evergreen + ! and deciduous tropical trees (used to determine if a column is + ! tropical closed forest) use the current fractions. However, I think + ! they are used in code that applies to land cover change. Note that + ! land cover change is currently generated on the first time step of the + ! year (even though the fire code sees the annually-smoothed dwt). Thus, + ! I think that, for this to be totally consistent, this code should + ! consider the fractional coverage of each PFT prior to the relevant + ! land cover change event. (These fractions could be computed in the + ! code that handles land cover change, so that the fire code remains + ! agnostic to exactly how and when land cover change happens.) + ! + ! For example, if a year started with fractional coverages of + ! nbrdlf_evr_trp_tree = 0.35 and nbrdlf_dcd_trp_tree = 0.35, but then + ! the start-of-year land cover change reduced both of these to 0.2: The + ! current code would consider the column to NOT be tropical closed + ! forest (because nbrdlf_evr_trp_tree+nbrdlf_dcd_trp_tree < 0.6), + ! whereas in fact the land cover change occurred when the column *was* + ! tropical closed forest. + if( patch%itype(p) == nbrdlf_evr_trp_tree .and. patch%wtcol(p) > 0._r8 )then + trotr1_col(c)=trotr1_col(c)+patch%wtcol(p) + end if + if( patch%itype(p) == nbrdlf_dcd_trp_tree .and. patch%wtcol(p) > 0._r8 )then + trotr2_col(c)=trotr2_col(c)+patch%wtcol(p) + end if + + if (transient_landcover) then + if( patch%itype(p) == nbrdlf_evr_trp_tree .or. patch%itype(p) == nbrdlf_dcd_trp_tree )then + if(dwt_smoothed(p) < 0._r8)then + ! Land cover change in CLM happens all at once on the first time + ! step of the year. However, the fire code needs deforestation + ! rates throughout the year, in order to combine these + ! deforestation rates with the current season's climate. So we + ! use a smoothed version of dwt. + ! + ! This isn't ideal, because the carbon stocks that the fire code + ! is operating on will have decreased by the full annual amount + ! before the fire code does anything. But the biggest effect of + ! these deforestation fires is as a trigger for other fires, and + ! the C fluxes are merely diagnostic so don't need to be + ! conservative, so this isn't a big issue. + ! + ! (Actually, it would be even better if the fire code had a + ! realistic breakdown of annual deforestation into the + ! different seasons. But having deforestation spread evenly + ! throughout the year is much better than having it all + ! concentrated on January 1.) + dtrotr_col(c)=dtrotr_col(c)-dwt_smoothed(p) + end if + end if + end if + rootc_col(c) = rootc_col(c) + (frootc(p) + frootc_storage(p) + & + frootc_xfer(p) + deadcrootc(p) * spinup_factor_deadwood + & + deadcrootc_storage(p) + deadcrootc_xfer(p) + & + livecrootc(p)+livecrootc_storage(p) + & + livecrootc_xfer(p))*patch%wtcol(p) + + fsr_col(c) = fsr_col(c) + fsr_pft(patch%itype(p))*patch%wtcol(p)/(1.0_r8-cropf_col(c)) + + hdmlf=this%forc_hdm(g) + + ! all these constants are in Li et al. BG (2012a,b;2013) + + if( hdmlf > 0.1_r8 )then + ! For NOT bare-soil + if( patch%itype(p) /= noveg )then + ! For shrub and grass (crop already excluded above) + if( patch%itype(p) >= nbrdlf_evr_shrub )then !for shurb and grass + lgdp_col(c) = lgdp_col(c) + (0.1_r8 + 0.9_r8* & + exp(-1._r8*SHR_CONST_PI* & + (gdp_lf(c)/8._r8)**0.5_r8))*patch%wtcol(p) & + /(1.0_r8 - cropf_col(c)) + lgdp1_col(c) = lgdp1_col(c) + (0.2_r8 + 0.8_r8* & + exp(-1._r8*SHR_CONST_PI* & + (gdp_lf(c)/7._r8)))*patch%wtcol(p)/(1._r8 - cropf_col(c)) + lpop_col(c) = lpop_col(c) + (0.2_r8 + 0.8_r8* & + exp(-1._r8*SHR_CONST_PI* & + (hdmlf/450._r8)**0.5_r8))*patch%wtcol(p)/(1._r8 - cropf_col(c)) + else ! for trees + if( gdp_lf(c) > 20._r8 )then + lgdp_col(c) =lgdp_col(c)+cnfire_const%occur_hi_gdp_tree*patch%wtcol(p)/(1._r8 - cropf_col(c)) + lgdp1_col(c) =lgdp1_col(c)+0.62_r8*patch%wtcol(p)/(1._r8 - cropf_col(c)) + else + if( gdp_lf(c) > 8._r8 )then + lgdp_col(c)=lgdp_col(c)+0.79_r8*patch%wtcol(p)/(1._r8 - cropf_col(c)) + lgdp1_col(c)=lgdp1_col(c)+0.83_r8*patch%wtcol(p)/(1._r8 - cropf_col(c)) + else + lgdp_col(c) = lgdp_col(c)+patch%wtcol(p)/(1._r8 - cropf_col(c)) + lgdp1_col(c)=lgdp1_col(c)+patch%wtcol(p)/(1._r8 - cropf_col(c)) + end if + end if + lpop_col(c) = lpop_col(c) + (0.4_r8 + 0.6_r8* & + exp(-1._r8*SHR_CONST_PI* & + (hdmlf/125._r8)))*patch%wtcol(p)/(1._r8 -cropf_col(c)) + end if + end if + else + lgdp_col(c) = lgdp_col(c)+patch%wtcol(p)/(1.0_r8 - cropf_col(c)) + lgdp1_col(c) = lgdp1_col(c)+patch%wtcol(p)/(1.0_r8 -cropf_col(c)) + lpop_col(c) = lpop_col(c)+patch%wtcol(p)/(1.0_r8 -cropf_col(c)) + end if + + fd_col(c) = fd_col(c) + fd_pft(patch%itype(p)) * patch%wtcol(p) * secsphr / (1.0_r8-cropf_col(c)) + end if + end do + + ! estimate annual decreased fractional coverage of BET+BDT + ! land cover conversion in CLM4.5 is the same for each timestep except for the beginning + + if (transient_landcover) then + do fc = 1,num_soilc + c = filter_soilc(fc) + if( dtrotr_col(c) > 0._r8 )then + if( kmo == 1 .and. kda == 1 .and. mcsec == 0)then + lfc(c) = 0._r8 + end if + if( kmo == 1 .and. kda == 1 .and. mcsec == dt)then + lfc(c) = dtrotr_col(c)*dayspyr*secspday/dt + end if + else + lfc(c)=0._r8 + end if + end do + end if + ! + ! calculate burned area fraction in cropland + ! + do fc = 1,num_soilc + c = filter_soilc(fc) + baf_crop(c)=0._r8 + end do + + do fp = 1,num_soilp + p = filter_soilp(fp) + if( kmo == 1 .and. kda == 1 .and. mcsec == 0 )then + burndate(p) = 10000 ! init. value; actual range [0 365] + end if + end do + + do fp = 1, num_soilp + p = filter_soilp(fp) + c = patch%column(p) + g = col%gridcell(c) + + ! For crop + if( forc_t(c) >= SHR_CONST_TKFRZ .and. patch%itype(p) > nc4_grass .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) + + ! calculate human density impact on ag. fire + fhd = 0.04_r8+0.96_r8*exp(-1._r8*SHR_CONST_PI*(hdmlf/350._r8)**0.5_r8) + + ! calculate impact of GDP on ag. fire + fgdp = 0.01_r8+0.99_r8*exp(-1._r8*SHR_CONST_PI*(gdp_lf(c)/10._r8)) + + ! calculate burned area + fb = max(0.0_r8,min(1.0_r8,(fuelc_crop(c)-lfuel)/(ufuel-lfuel))) + + ! crop fire only for generic crop types at this time + ! managed crops are treated as grasses if crop model is turned on + baf_crop(c) = baf_crop(c) + cropfire_a1/secsphr*fhd*fgdp*patch%wtcol(p) + if( fb*fhd*fgdp*patch%wtcol(p) > 0._r8)then + burndate(p)=kda + end if + end if + end do + ! + ! calculate peatland fire + ! + do fc = 1, num_soilc + c = filter_soilc(fc) + g= col%gridcell(c) + if(grc%latdeg(g) < cnfire_const%borealat )then + baf_peatf(c) = non_boreal_peatfire_c/secsphr*max(0._r8, & + min(1._r8,(4.0_r8-prec60_col(c)*secspday)/ & + 4.0_r8))**2*peatf_lf(c)*(1._r8-fsat(c)) + else + baf_peatf(c) = boreal_peatfire_c/secsphr*exp(-SHR_CONST_PI*(max(wf2(c),0._r8)/0.3_r8))* & + max(0._r8,min(1._r8,(tsoi17(c)-SHR_CONST_TKFRZ)/10._r8))*peatf_lf(c)* & + (1._r8-fsat(c)) + end if + end do + ! + ! calculate other fires + ! + + ! Set the number of timesteps for e-folding. + ! When the simulation has run fewer than this number of steps, + ! re-scale the e-folding time to get a stable early estimate. + + ! find which pool is the cwd pool + i_cwd = 0 + do l = 1, ndecomp_pools + if ( is_cwd(l) ) then + i_cwd = l + endif + end do + + ! + ! begin column loop to calculate fractional area affected by fire + ! + do fc = 1, num_soilc + c = filter_soilc(fc) + g = col%gridcell(c) + hdmlf=this%forc_hdm(g) + nfire(c) = 0._r8 + if( cropf_col(c) < 1._r8 )then + fuelc(c) = totlitc(c)+totvegc(c)-rootc_col(c)-fuelc_crop(c)*cropf_col(c) + if (spinup_state == 2) then + fuelc(c) = fuelc(c) + ((spinup_factor_deadwood - 1._r8)*deadstemc_col(c)) + do j = 1, nlevdecomp + fuelc(c) = fuelc(c)+decomp_cpools_vr(c,j,i_cwd) * dzsoi_decomp(j) * spinup_factor(i_cwd) & + * get_spinup_latitude_term(grc%latdeg(col%gridcell(c))) + end do + else + do j = 1, nlevdecomp + fuelc(c) = fuelc(c)+decomp_cpools_vr(c,j,i_cwd) * dzsoi_decomp(j) + end do + end if + fuelc(c) = fuelc(c)/(1._r8-cropf_col(c)) + fb = max(0.0_r8,min(1.0_r8,(fuelc(c)-lfuel)/(ufuel-lfuel))) + if (trotr1_col(c)+trotr2_col(c)<=0.6_r8) then + afuel =min(1._r8,max(0._r8,(fuelc(c)-2500._r8)/(5000._r8-2500._r8))) + arh=1._r8-max(0._r8, min(1._r8,(forc_rh(g)-rh_low)/(rh_hgh-rh_low))) + arh30=1._r8-max(cnfire_params%prh30, min(1._r8,rh30_col(c)/90._r8)) + if (forc_rh(g) < rh_hgh.and. wtlf(c) > 0._r8 .and. tsoi17(c)> SHR_CONST_TKFRZ)then + fire_m = ((afuel*arh30+(1._r8-afuel)*arh)**1.5_r8) & + *((1._r8-btran_col(c)/wtlf(c))**0.5_r8) + else + fire_m = 0._r8 + end if + lh = pot_hmn_ign_counts_alpha*6.8_r8*hdmlf**(0.43_r8)/30._r8/24._r8 + fs = 1._r8-(0.01_r8+0.98_r8*exp(-0.025_r8*hdmlf)) + ig = (lh+this%forc_lnfm(g)/(5.16_r8+2.16_r8* & + cos(SHR_CONST_PI/180._r8*3*min(60._r8,abs(grc%latdeg(g)))))* & + cnfire_params%ignition_efficiency)*(1._r8-fs)*(1._r8-cropf_col(c)) + nfire(c) = ig/secsphr*fb*fire_m*lgdp_col(c) !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 + farea_burned(c) = min(1._r8,(cnfire_const%g0*spread_m*fsr_col(c)* & + fd_col(c)/1000._r8)**2*lgdp1_col(c)* & + lpop_col(c)*nfire(c)*SHR_CONST_PI*Lb_lf+ & + baf_crop(c)+baf_peatf(c)) ! fraction (0-1) per sec + else + farea_burned(c)=min(1._r8,baf_crop(c)+baf_peatf(c)) + end if + ! + ! if landuse change data is used, calculate deforestation fires and + ! add it in the total of burned area fraction + ! + if (transient_landcover) then + if( trotr1_col(c)+trotr2_col(c) > 0.6_r8 )then + if(( kmo == 1 .and. kda == 1 .and. mcsec == 0) .or. & + dtrotr_col(c) <=0._r8 )then + fbac1(c) = 0._r8 + farea_burned(c) = baf_crop(c)+baf_peatf(c) + else + cri = (4.0_r8*trotr1_col(c)+1.8_r8*trotr2_col(c))/(trotr1_col(c)+trotr2_col(c)) + cli = (max(0._r8,min(1._r8,(cri-prec60_col(c)*secspday)/cri))**0.5)* & + (max(0._r8,min(1._r8,(cri-prec10_col(c)*secspday)/cri))**0.5)* & + (15._r8*min(0.0016_r8,dtrotr_col(c)/dt*dayspyr*secspday)+0.009_r8)* & + max(0._r8,min(1._r8,(0.25_r8-(forc_rain(c)+forc_snow(c))*secsphr)/0.25_r8)) + farea_burned(c) = fb*cli*(cli_scale/secspday)+baf_crop(c)+baf_peatf(c) + ! burned area out of conversion region due to land use fire + fbac1(c) = max(0._r8,fb*cli*(cli_scale/secspday) - 2.0_r8*lfc(c)/dt) + end if + ! total burned area out of conversion + fbac(c) = fbac1(c)+baf_crop(c)+baf_peatf(c) + else + fbac(c) = farea_burned(c) + end if + end if + + else + farea_burned(c) = min(1._r8,baf_crop(c)+baf_peatf(c)) + end if + + end do ! end of column loop + + end associate + + end subroutine CNFireArea + +end module CNFireLi2024Mod From 5b95a3e6a658e20e80b3869df823c81636067304 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Wed, 7 Aug 2024 13:06:36 -0600 Subject: [PATCH 0840/1248] Fix bugs and develop crop fire modeling In the CNFireLi2024Mod.F90, (1) fixed the bug described in https://github.com/ESCOMP/CTSM/issues/2566 to avoid incorrect accumulation of baf_crop and ensure that crop fires do not occur during the crop growing season; (2) confined crop fires to periods after harvest and before planting when crop module is active; (3) removed the dependency of baf_crop on fuel availability; (4) improved the modeling of the influence of socio-economic factors on crop burned area; (5) recalibrated the cropfire_a1 constant based on GFED5 crop burned area; (6) modify the declaration of CNFireArea in these F90 files to include the variable crop_inst, declare the variable crop_inst, and import and utilize crop_type from the module CropType. In addition, the modules CNDriverMod.F90, CNFireLi2014Mod.F90, CNFireLi2016Mod.F90, CNFireLi2021Mod.F90, CNFireNoFireMod.F90, FATESFireBase.F90, and FireMethodType.F90 include the subroutine CNFireArea. (6) is implemented in these modules. (Original commit by Fang Li, lifang@mail.iap.ac.cn.) --- src/biogeochem/CNDriverMod.F90 | 2 +- src/biogeochem/CNFireLi2014Mod.F90 | 4 +++- src/biogeochem/CNFireLi2016Mod.F90 | 4 +++- src/biogeochem/CNFireLi2021Mod.F90 | 4 +++- src/biogeochem/CNFireLi2024Mod.F90 | 26 +++++++++++++------------- src/biogeochem/CNFireNoFireMod.F90 | 4 +++- src/biogeochem/FATESFireBase.F90 | 5 ++++- src/main/FireMethodType.F90 | 4 +++- 8 files changed, 33 insertions(+), 20 deletions(-) diff --git a/src/biogeochem/CNDriverMod.F90 b/src/biogeochem/CNDriverMod.F90 index b23019eb23..ee97bcc360 100644 --- a/src/biogeochem/CNDriverMod.F90 +++ b/src/biogeochem/CNDriverMod.F90 @@ -936,7 +936,7 @@ subroutine CNDriverNoLeaching(bounds, num_exposedvegp, filter_exposedvegp, num_noexposedvegp, filter_noexposedvegp, & atm2lnd_inst, energyflux_inst, saturated_excess_runoff_inst, waterdiagnosticbulk_inst, wateratm2lndbulk_inst, & waterstatebulk_inst, soilstate_inst, soil_water_retention_curve, & - cnveg_state_inst, cnveg_carbonstate_inst, & + crop_inst, cnveg_state_inst, cnveg_carbonstate_inst, & totlitc_col=soilbiogeochem_carbonstate_inst%totlitc_col(begc:endc), & decomp_cpools_vr_col=soilbiogeochem_carbonstate_inst%decomp_cpools_vr_col(begc:endc,1:nlevdecomp_full,1:ndecomp_pools), & t_soi17cm_col=temperature_inst%t_soi17cm_col(begc:endc)) diff --git a/src/biogeochem/CNFireLi2014Mod.F90 b/src/biogeochem/CNFireLi2014Mod.F90 index 6ea21a530b..cb41230a10 100644 --- a/src/biogeochem/CNFireLi2014Mod.F90 +++ b/src/biogeochem/CNFireLi2014Mod.F90 @@ -87,7 +87,7 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ num_exposedvegp, filter_exposedvegp, num_noexposedvegp, filter_noexposedvegp, & atm2lnd_inst, energyflux_inst, saturated_excess_runoff_inst, waterdiagnosticbulk_inst, & wateratm2lndbulk_inst, waterstatebulk_inst, soilstate_inst, soil_water_retention_curve, & - cnveg_state_inst, cnveg_carbonstate_inst, totlitc_col, decomp_cpools_vr_col, t_soi17cm_col) + crop_inst, cnveg_state_inst, cnveg_carbonstate_inst, totlitc_col, decomp_cpools_vr_col, t_soi17cm_col) ! ! !DESCRIPTION: ! Computes column-level burned area @@ -98,6 +98,7 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ use pftconMod , only: nc4_grass, nc3crop, ndllf_evr_tmp_tree use pftconMod , only: nbrdlf_evr_trp_tree, nbrdlf_dcd_trp_tree, nbrdlf_evr_shrub use dynSubgridControlMod , only: run_has_transient_landcover + use CropType , only: crop_type ! ! !ARGUMENTS: class(cnfire_li2014_type) :: this @@ -120,6 +121,7 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ class(soil_water_retention_curve_type), intent(in) :: soil_water_retention_curve type(cnveg_state_type) , intent(inout) :: cnveg_state_inst type(cnveg_carbonstate_type) , intent(inout) :: cnveg_carbonstate_inst + type(crop_type) , intent(in) :: crop_inst real(r8) , intent(in) :: totlitc_col(bounds%begc:) real(r8) , intent(in) :: decomp_cpools_vr_col(bounds%begc:,1:,1:) real(r8) , intent(in) :: t_soi17cm_col(bounds%begc:) diff --git a/src/biogeochem/CNFireLi2016Mod.F90 b/src/biogeochem/CNFireLi2016Mod.F90 index 7bbb183860..6021901a28 100644 --- a/src/biogeochem/CNFireLi2016Mod.F90 +++ b/src/biogeochem/CNFireLi2016Mod.F90 @@ -89,7 +89,7 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ num_exposedvegp, filter_exposedvegp, num_noexposedvegp, filter_noexposedvegp, & atm2lnd_inst, energyflux_inst, saturated_excess_runoff_inst, waterdiagnosticbulk_inst, & wateratm2lndbulk_inst, waterstatebulk_inst, soilstate_inst, soil_water_retention_curve, & - cnveg_state_inst, cnveg_carbonstate_inst, totlitc_col, decomp_cpools_vr_col, t_soi17cm_col) + crop_inst, cnveg_state_inst, cnveg_carbonstate_inst, totlitc_col, decomp_cpools_vr_col, t_soi17cm_col) ! ! !DESCRIPTION: ! Computes column-level burned area @@ -101,6 +101,7 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ use pftconMod , only: nc4_grass, nc3crop, ndllf_evr_tmp_tree use pftconMod , only: nbrdlf_evr_trp_tree, nbrdlf_dcd_trp_tree, nbrdlf_evr_shrub use dynSubgridControlMod , only : run_has_transient_landcover + use CropType , only: crop_type ! ! !ARGUMENTS: class(cnfire_li2016_type) :: this @@ -123,6 +124,7 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ class(soil_water_retention_curve_type), intent(in) :: soil_water_retention_curve type(cnveg_state_type) , intent(inout) :: cnveg_state_inst type(cnveg_carbonstate_type) , intent(inout) :: cnveg_carbonstate_inst + type(crop_type) , intent(in) :: crop_inst real(r8) , intent(in) :: totlitc_col(bounds%begc:) real(r8) , intent(in) :: decomp_cpools_vr_col(bounds%begc:,1:,1:) real(r8) , intent(in) :: t_soi17cm_col(bounds%begc:) diff --git a/src/biogeochem/CNFireLi2021Mod.F90 b/src/biogeochem/CNFireLi2021Mod.F90 index 86d5cc235d..74f553eb5c 100644 --- a/src/biogeochem/CNFireLi2021Mod.F90 +++ b/src/biogeochem/CNFireLi2021Mod.F90 @@ -89,7 +89,7 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ num_exposedvegp, filter_exposedvegp, num_noexposedvegp, filter_noexposedvegp, & atm2lnd_inst, energyflux_inst, saturated_excess_runoff_inst, waterdiagnosticbulk_inst, & wateratm2lndbulk_inst, waterstatebulk_inst, soilstate_inst, soil_water_retention_curve, & - cnveg_state_inst, cnveg_carbonstate_inst, totlitc_col, decomp_cpools_vr_col, t_soi17cm_col) + crop_inst, cnveg_state_inst, cnveg_carbonstate_inst, totlitc_col, decomp_cpools_vr_col, t_soi17cm_col) ! ! !DESCRIPTION: ! Computes column-level burned area @@ -101,6 +101,7 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ use pftconMod , only: nc4_grass, nc3crop, ndllf_evr_tmp_tree use pftconMod , only: nbrdlf_evr_trp_tree, nbrdlf_dcd_trp_tree, nbrdlf_evr_shrub use dynSubgridControlMod , only : run_has_transient_landcover + use CropType , only: crop_type ! ! !ARGUMENTS: class(cnfire_li2021_type) :: this @@ -123,6 +124,7 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ class(soil_water_retention_curve_type), intent(in) :: soil_water_retention_curve type(cnveg_state_type) , intent(inout) :: cnveg_state_inst type(cnveg_carbonstate_type) , intent(inout) :: cnveg_carbonstate_inst + type(crop_type) , intent(in) :: crop_inst real(r8) , intent(in) :: totlitc_col(bounds%begc:) real(r8) , intent(in) :: decomp_cpools_vr_col(bounds%begc:,1:,1:) real(r8) , intent(in) :: t_soi17cm_col(bounds%begc:) diff --git a/src/biogeochem/CNFireLi2024Mod.F90 b/src/biogeochem/CNFireLi2024Mod.F90 index 9908732018..6d3bf6657a 100644 --- a/src/biogeochem/CNFireLi2024Mod.F90 +++ b/src/biogeochem/CNFireLi2024Mod.F90 @@ -89,7 +89,7 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ num_exposedvegp, filter_exposedvegp, num_noexposedvegp, filter_noexposedvegp, & atm2lnd_inst, energyflux_inst, saturated_excess_runoff_inst, waterdiagnosticbulk_inst, & wateratm2lndbulk_inst, waterstatebulk_inst, soilstate_inst, soil_water_retention_curve, & - cnveg_state_inst, cnveg_carbonstate_inst, totlitc_col, decomp_cpools_vr_col, t_soi17cm_col) + crop_inst, cnveg_state_inst, cnveg_carbonstate_inst, totlitc_col, decomp_cpools_vr_col, t_soi17cm_col) ! ! !DESCRIPTION: ! Computes column-level burned area @@ -97,10 +97,11 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ ! !USES: use clm_time_manager , only: get_step_size_real, get_curr_days_per_year, get_curr_date, get_nstep use clm_varcon , only: secspday, secsphr - use clm_varctl , only: spinup_state + use clm_varctl , only: spinup_state, use_crop use pftconMod , only: nc4_grass, nc3crop, ndllf_evr_tmp_tree use pftconMod , only: nbrdlf_evr_trp_tree, nbrdlf_dcd_trp_tree, nbrdlf_evr_shrub use dynSubgridControlMod , only : run_has_transient_landcover + use CropType , only: crop_type ! ! !ARGUMENTS: class(cnfire_li2024_type) :: this @@ -123,6 +124,7 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ class(soil_water_retention_curve_type), intent(in) :: soil_water_retention_curve type(cnveg_state_type) , intent(inout) :: cnveg_state_inst type(cnveg_carbonstate_type) , intent(inout) :: cnveg_carbonstate_inst + type(crop_type) , intent(in) :: crop_inst real(r8) , intent(in) :: totlitc_col(bounds%begc:) real(r8) , intent(in) :: decomp_cpools_vr_col(bounds%begc:,1:,1:) real(r8) , intent(in) :: t_soi17cm_col(bounds%begc:) @@ -237,7 +239,8 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ leafc_col => cnveg_carbonstate_inst%leafc_col , & ! Output: [real(r8) (:) ] leaf carbon at column level deadstemc_col => cnveg_carbonstate_inst%deadstemc_col , & ! Output: [real(r8) (:) ] deadstem carbon at column level fuelc => cnveg_carbonstate_inst%fuelc_col , & ! Output: [real(r8) (:) ] fuel load coutside cropland - fuelc_crop => cnveg_carbonstate_inst%fuelc_crop_col & ! Output: [real(r8) (:) ] fuel load for cropland + fuelc_crop => cnveg_carbonstate_inst%fuelc_crop_col , & ! Output: [real(r8) (:) ] fuel load for cropland + croplive => crop_inst%croplive_patch & ! Input: [logical (:) ] flag, true if planted, not harvested ) transient_landcover = run_has_transient_landcover() @@ -522,21 +525,18 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ hdmlf = this%forc_hdm(g) ! calculate human density impact on ag. fire - fhd = 0.04_r8+0.96_r8*exp(-1._r8*SHR_CONST_PI*(hdmlf/350._r8)**0.5_r8) + fhd = 0.2_r8+0.8_r8*exp(-1._r8*SHR_CONST_PI*(hdmlf/400._r8)) ! calculate impact of GDP on ag. fire - fgdp = 0.01_r8+0.99_r8*exp(-1._r8*SHR_CONST_PI*(gdp_lf(c)/10._r8)) + fgdp = 0.05_r8+0.95_r8*exp(-1._r8*SHR_CONST_PI*(gdp_lf(c)/20._r8)) ! calculate burned area - fb = max(0.0_r8,min(1.0_r8,(fuelc_crop(c)-lfuel)/(ufuel-lfuel))) - - ! crop fire only for generic crop types at this time - ! managed crops are treated as grasses if crop model is turned on - baf_crop(c) = baf_crop(c) + cropfire_a1/secsphr*fhd*fgdp*patch%wtcol(p) - if( fb*fhd*fgdp*patch%wtcol(p) > 0._r8)then - burndate(p)=kda + if((use_crop .and. (.not. croplive(p))) & + .or. (.not. use_crop)) then + burndate(p) = kda + baf_crop(c) = baf_crop(c)+0.21_r8 / secsphr * fhd * fgdp * patch%wtcol(p) end if - end if + end if end do ! ! calculate peatland fire diff --git a/src/biogeochem/CNFireNoFireMod.F90 b/src/biogeochem/CNFireNoFireMod.F90 index 0dc1ee39d1..6785faa851 100644 --- a/src/biogeochem/CNFireNoFireMod.F90 +++ b/src/biogeochem/CNFireNoFireMod.F90 @@ -62,13 +62,14 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ atm2lnd_inst, energyflux_inst, saturated_excess_runoff_inst, & waterdiagnosticbulk_inst, wateratm2lndbulk_inst, & waterstatebulk_inst, soilstate_inst, soil_water_retention_curve, & - cnveg_state_inst, cnveg_carbonstate_inst, totlitc_col, decomp_cpools_vr_col, t_soi17cm_col) + crop_inst, cnveg_state_inst, cnveg_carbonstate_inst, totlitc_col, decomp_cpools_vr_col, t_soi17cm_col) ! ! !DESCRIPTION: ! Computes column-level burned area ! ! !USES: use subgridAveMod , only : p2c + use CropType , only : crop_type ! ! !ARGUMENTS: class(cnfire_nofire_type) :: this @@ -91,6 +92,7 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ class(soil_water_retention_curve_type), intent(in) :: soil_water_retention_curve type(cnveg_state_type) , intent(inout) :: cnveg_state_inst type(cnveg_carbonstate_type) , intent(inout) :: cnveg_carbonstate_inst + type(crop_type) , intent(in) :: crop_inst real(r8) , intent(in) :: totlitc_col(bounds%begc:) real(r8) , intent(in) :: decomp_cpools_vr_col(bounds%begc:,1:,1:) real(r8) , intent(in) :: t_soi17cm_col(bounds%begc:) diff --git a/src/biogeochem/FATESFireBase.F90 b/src/biogeochem/FATESFireBase.F90 index a47ff2e8c4..59279d7625 100644 --- a/src/biogeochem/FATESFireBase.F90 +++ b/src/biogeochem/FATESFireBase.F90 @@ -206,7 +206,7 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ atm2lnd_inst, energyflux_inst, saturated_excess_runoff_inst, & waterdiagnosticbulk_inst, wateratm2lndbulk_inst, & waterstatebulk_inst, soilstate_inst, soil_water_retention_curve, & - cnveg_state_inst, cnveg_carbonstate_inst, totlitc_col, decomp_cpools_vr_col, t_soi17cm_col) + crop_inst, cnveg_state_inst, cnveg_carbonstate_inst, totlitc_col, decomp_cpools_vr_col, t_soi17cm_col) ! ! !DESCRIPTION: ! Computes column-level burned area (NOT USED FOR FATES) @@ -220,6 +220,7 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ use SoilStateType , only : soilstate_type use SoilWaterRetentionCurveMod , only : soil_water_retention_curve_type use atm2lndType , only : atm2lnd_type + use CropType , only: crop_type ! ! !ARGUMENTS: class(fates_fire_base_type) :: this @@ -242,6 +243,8 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ class(soil_water_retention_curve_type), intent(in) :: soil_water_retention_curve type(cnveg_state_type) , intent(inout) :: cnveg_state_inst type(cnveg_carbonstate_type) , intent(inout) :: cnveg_carbonstate_inst + type(crop_type) , intent(in) :: crop_inst + real(r8) , intent(in) :: totlitc_col(bounds%begc:) real(r8) , intent(in) :: decomp_cpools_vr_col(bounds%begc:,1:,1:) real(r8) , intent(in) :: t_soi17cm_col(bounds%begc:) diff --git a/src/main/FireMethodType.F90 b/src/main/FireMethodType.F90 index 63c05821b7..978450e65f 100644 --- a/src/main/FireMethodType.F90 +++ b/src/main/FireMethodType.F90 @@ -119,7 +119,7 @@ subroutine CNFireArea_interface (this, bounds, num_soilc, filter_soilc, num_soil atm2lnd_inst, energyflux_inst, saturated_excess_runoff_inst, & waterdiagnosticbulk_inst, wateratm2lndbulk_inst, & waterstatebulk_inst, soilstate_inst, soil_water_retention_curve, & - cnveg_state_inst, cnveg_carbonstate_inst, totlitc_col, decomp_cpools_vr_col, t_soi17cm_col) + crop_inst, cnveg_state_inst, cnveg_carbonstate_inst, totlitc_col, decomp_cpools_vr_col, t_soi17cm_col) ! ! !DESCRIPTION: ! Computes column-level burned area @@ -137,6 +137,7 @@ subroutine CNFireArea_interface (this, bounds, num_soilc, filter_soilc, num_soil use SoilWaterRetentionCurveMod , only : soil_water_retention_curve_type use CNVegStateType , only : cnveg_state_type use CNVegCarbonStateType , only : cnveg_carbonstate_type + use CropType , only : crop_type import :: fire_method_type ! ! !ARGUMENTS: @@ -160,6 +161,7 @@ subroutine CNFireArea_interface (this, bounds, num_soilc, filter_soilc, num_soil class(soil_water_retention_curve_type), intent(in) :: soil_water_retention_curve type(cnveg_state_type) , intent(inout) :: cnveg_state_inst type(cnveg_carbonstate_type) , intent(inout) :: cnveg_carbonstate_inst + type(crop_type) , intent(in) :: crop_inst real(r8) , intent(in) :: totlitc_col(bounds%begc:) real(r8) , intent(in) :: decomp_cpools_vr_col(bounds%begc:,1:,1:) real(r8) , intent(in) :: t_soi17cm_col(bounds%begc:) From 412bb3e1bb1df35fb2503acf4a86f0256fbaa77e Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Wed, 7 Aug 2024 13:16:09 -0600 Subject: [PATCH 0841/1248] change the cropfire_a1 to 0.21 in namelist_defaults. (Original commit by Fang Li, lifang@mail.iap.ac.cn.) --- bld/namelist_files/namelist_defaults_ctsm.xml | 2 +- src/biogeochem/CNFireLi2024Mod.F90 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index a7e59935a4..b301bcfb28 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -327,7 +327,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). 0.09d-4 0.010d00 0.17d-3 -1.6d-4 +0.21d00 0.33d00 75.d00 1050.d00 diff --git a/src/biogeochem/CNFireLi2024Mod.F90 b/src/biogeochem/CNFireLi2024Mod.F90 index 6d3bf6657a..503ed28488 100644 --- a/src/biogeochem/CNFireLi2024Mod.F90 +++ b/src/biogeochem/CNFireLi2024Mod.F90 @@ -534,7 +534,7 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ if((use_crop .and. (.not. croplive(p))) & .or. (.not. use_crop)) then burndate(p) = kda - baf_crop(c) = baf_crop(c)+0.21_r8 / secsphr * fhd * fgdp * patch%wtcol(p) + baf_crop(c) = baf_crop(c)+cropfire_a1 / secsphr * fhd * fgdp * patch%wtcol(p) end if end if end do From be82840310150f694824ce7c2504c6049362497e Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Wed, 7 Aug 2024 15:17:47 -0600 Subject: [PATCH 0842/1248] cropMonthOutput h2 file is now finally monthly. Specifying hist_nhtfrq(3) seems to override later specification of h2 in "hist_nhtfrq = 0,-240,0" --- cime_config/testdefs/testmods_dirs/clm/crop/user_nl_clm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cime_config/testdefs/testmods_dirs/clm/crop/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/crop/user_nl_clm index aea8e39e6c..8ad588381e 100644 --- a/cime_config/testdefs/testmods_dirs/clm/crop/user_nl_clm +++ b/cime_config/testdefs/testmods_dirs/clm/crop/user_nl_clm @@ -14,7 +14,7 @@ hist_fincl2 += 'DYN_COL_SOIL_ADJUSTMENTS_C' ! That's needed for the mxsowings and mxharvests axes to make sense. ! However, for testing purposes, it makes sense to save more frequently. hist_fincl3 = 'SDATES', 'SDATES_PERHARV', 'SYEARS_PERHARV', 'HDATES', 'GRAINC_TO_FOOD_PERHARV', 'GRAINC_TO_FOOD_ANN', 'GRAINN_TO_FOOD_PERHARV', 'GRAINN_TO_FOOD_ANN', 'GRAINC_TO_SEED_PERHARV', 'GRAINC_TO_SEED_ANN', 'GRAINN_TO_SEED_PERHARV', 'GRAINN_TO_SEED_ANN', 'HDATES', 'GDDHARV_PERHARV', 'GDDACCUM_PERHARV', 'HUI_PERHARV', 'SOWING_REASON_PERHARV', 'HARVEST_REASON_PERHARV', 'SWINDOW_STARTS', 'SWINDOW_ENDS', 'GDD20_BASELINE', 'GDD20_SEASON_START', 'GDD20_SEASON_END' -hist_nhtfrq(3) = -24 -hist_mfilt(3) = 1 +hist_nhtfrq = -24,-8,-24 +hist_mfilt = 1,1,1 hist_type1d_pertape(3) = 'PFTS' -hist_dov2xy(3) = .false. +hist_dov2xy = .true.,.false.,.false. From 2e4ceb8bee60884c0ea9de05577228803a8e3a8d Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 7 Aug 2024 17:15:14 -0600 Subject: [PATCH 0843/1248] Fix the error check --- bld/CLMBuildNamelist.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index f1e5935196..ff796efca9 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -4676,7 +4676,7 @@ sub setup_logic_prigent_roughness { 'dust_emis_method'=>$dust_emis_method ); my $use_prigent = $nl->get_value($var); if ( &value_is_true($use_prigent) ) { - if ( $dust_emis_method eq "Leung_2023" ) { + if ( $dust_emis_method ne "Leung_2023" ) { $log->warning( "$var does NOT need to be set without dust_emis_method being Leung_2023" ); } add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_fldfilename_prigentroughness' ); From 00cb8a1a0766711bcaf0ea51323b65a8bdd71ec0 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Wed, 7 Aug 2024 17:15:55 -0600 Subject: [PATCH 0844/1248] Reduce Izumi cropMonthOutput-RxCropCalsAdaptGGCMI test to 65 days. --- cime_config/testdefs/testlist_clm.xml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index 1e687522e4..3e47ca2d95 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -3582,12 +3582,20 @@ + + + + + + + + - + From 31f4c03f5cf14e7eb7559e2b9ac5f238abe1ae36 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Wed, 7 Aug 2024 17:50:03 -0600 Subject: [PATCH 0845/1248] Remove fix_nag_bld_2659 test suite. --- cime_config/testdefs/testlist_clm.xml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index 3e47ca2d95..3f6fe51ea0 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -3572,7 +3572,6 @@ - @@ -3592,7 +3591,6 @@ - @@ -3603,7 +3601,6 @@ - @@ -3614,7 +3611,6 @@ - From a63a4786f9d26ccdc02fea3d8561c1a5fab19db0 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Wed, 7 Aug 2024 17:51:45 -0600 Subject: [PATCH 0846/1248] Remove expected fail that's now fixed. SMS_Lm25.f10_f10_mg37.IHistClm60BgcCrop.izumi_nag.clm-RxCropCalsAdaptGGCMI --- 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 d5e3e4e378..d1e0a1a8b8 100644 --- a/cime_config/testdefs/ExpectedTestFails.xml +++ b/cime_config/testdefs/ExpectedTestFails.xml @@ -163,13 +163,6 @@ - - - FAIL - #2659 - - - From b89a8292bb60cac454cbc4a89615c0f3a3094e96 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Thu, 8 Aug 2024 00:04:00 -0600 Subject: [PATCH 0847/1248] Add test for prigent on without Leung --- bld/unit_testers/build-namelist_test.pl | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/bld/unit_testers/build-namelist_test.pl b/bld/unit_testers/build-namelist_test.pl index 5c70aa613a..0e230aecd8 100755 --- a/bld/unit_testers/build-namelist_test.pl +++ b/bld/unit_testers/build-namelist_test.pl @@ -163,10 +163,10 @@ sub cat_and_create_namelistinfile { # # Figure out number of tests that will run # -my $ntests = 3254; +my $ntests = 3255; if ( defined($opts{'compare'}) ) { - $ntests += 2001; + $ntests += 1965; } plan( tests=>$ntests ); @@ -1295,6 +1295,11 @@ sub cat_and_create_namelistinfile { GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm6_0", }, + "PrigentOnWOLeung" =>{ options=>"-envxml_dir . -bgc sp", + namelst=>"use_prigent_roughness=.true.,dust_emis_method='Zender_2003'", + GLC_TWO_WAY_COUPLING=>"FALSE", + phys=>"clm6_0", + }, "NotNEONbutNEONlightres" =>{ options=>"--res CLM_USRDAT --clm_usr_name regional --envxml_dir . --bgc bgc --light_res 106x174", namelst=>"fsurdat='build-namelist_test.pl'", GLC_TWO_WAY_COUPLING=>"FALSE", From 915af954a034a1e6d4f777623cde90977e614499 Mon Sep 17 00:00:00 2001 From: mvdebolskiy Date: Thu, 8 Aug 2024 10:33:31 -0600 Subject: [PATCH 0848/1248] add spellcheck in bld-nml-tester --- bld/unit_testers/build-namelist_test.pl | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/bld/unit_testers/build-namelist_test.pl b/bld/unit_testers/build-namelist_test.pl index fe6591c16b..d31d8e9294 100755 --- a/bld/unit_testers/build-namelist_test.pl +++ b/bld/unit_testers/build-namelist_test.pl @@ -1211,6 +1211,13 @@ sub cat_and_create_namelistinfile { ); foreach my $key ( keys(%failtest) ) { print( "$key\n" ); + my $var; + foreach $var ( "phys" , "options", "namelst" ) { + if ( not exists $failtest{$key}{$var} ) { + die "ERROR: Subkey $var does not exist for failtest $key\nERROR:Check if you spelled $var correctly\n" + } + } + &make_config_cache($failtest{$key}{"phys"}); my $options = $failtest{$key}{"options"}; my $namelist = $failtest{$key}{"namelst"}; @@ -1288,6 +1295,14 @@ sub cat_and_create_namelistinfile { ); foreach my $key ( keys(%warntest) ) { print( "$key\n" ); + + my $var; + foreach $var ( "phys" , "options", "namelst" ) { + if ( not exists $failtest{$key}{$var} ) { + die "ERROR: Subkey $var does not exist for warntest $key\nERROR:Check if you spelled $var correctly\n" + } + } + &make_config_cache($warntest{$key}{"phys"}); my $options = $warntest{$key}{"options"}; my $namelist = $warntest{$key}{"namelst"}; @@ -1517,6 +1532,14 @@ sub cat_and_create_namelistinfile { foreach my $key ( keys(%finidat_files) ) { print( "$key\n" ); + + my $var; + foreach $var ( "phys" , "atm_forc", "res", "bgc", "crop", "use_case", "start_ymd", "namelist" ) { + if ( not exists $failtest{$key}{$var} ) { + die "ERROR: Subkey $var does not exist for finidat_file $key\nERROR:Check if you spelled $var correctly\n" + } + } + my $phys = $finidat_files{$key}{'phys'}; print "physics = $phys\n"; &make_config_cache($phys); From 1041a7c93b27dc45a4c1587b02da5c1dac04b7cd Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Thu, 8 Aug 2024 11:09:21 -0600 Subject: [PATCH 0849/1248] Add testmods and tests for all fire methods. --- cime_config/testdefs/testlist_clm.xml | 40 +++++++++++++++++++ .../clm/FireLi2014Qian/include_user_mods | 1 + .../clm/FireLi2014Qian/user_nl_clm | 1 + .../clm/FireLi2016Cru/include_user_mods | 1 + .../clm/FireLi2016Cru/user_nl_clm | 1 + .../clm/FireLi2021GSWP/include_user_mods | 1 + .../clm/FireLi2021GSWP/user_nl_clm | 1 + .../clm/FireLi2024GSWP/include_user_mods | 1 + .../clm/FireLi2024GSWP/user_nl_clm | 1 + 9 files changed, 48 insertions(+) create mode 100644 cime_config/testdefs/testmods_dirs/clm/FireLi2014Qian/include_user_mods create mode 100644 cime_config/testdefs/testmods_dirs/clm/FireLi2014Qian/user_nl_clm create mode 100644 cime_config/testdefs/testmods_dirs/clm/FireLi2016Cru/include_user_mods create mode 100644 cime_config/testdefs/testmods_dirs/clm/FireLi2016Cru/user_nl_clm create mode 100644 cime_config/testdefs/testmods_dirs/clm/FireLi2021GSWP/include_user_mods create mode 100644 cime_config/testdefs/testmods_dirs/clm/FireLi2021GSWP/user_nl_clm create mode 100644 cime_config/testdefs/testmods_dirs/clm/FireLi2024GSWP/include_user_mods create mode 100644 cime_config/testdefs/testmods_dirs/clm/FireLi2024GSWP/user_nl_clm diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index 1ac2334ba8..36da30043c 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -3070,5 +3070,45 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/cime_config/testdefs/testmods_dirs/clm/FireLi2014Qian/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/FireLi2014Qian/include_user_mods new file mode 100644 index 0000000000..fe0e18cf88 --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/FireLi2014Qian/include_user_mods @@ -0,0 +1 @@ +../default diff --git a/cime_config/testdefs/testmods_dirs/clm/FireLi2014Qian/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/FireLi2014Qian/user_nl_clm new file mode 100644 index 0000000000..3e05de8cad --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/FireLi2014Qian/user_nl_clm @@ -0,0 +1 @@ +fire_method = 'li2014qianfrc' diff --git a/cime_config/testdefs/testmods_dirs/clm/FireLi2016Cru/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/FireLi2016Cru/include_user_mods new file mode 100644 index 0000000000..fe0e18cf88 --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/FireLi2016Cru/include_user_mods @@ -0,0 +1 @@ +../default diff --git a/cime_config/testdefs/testmods_dirs/clm/FireLi2016Cru/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/FireLi2016Cru/user_nl_clm new file mode 100644 index 0000000000..eecbd5b2d9 --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/FireLi2016Cru/user_nl_clm @@ -0,0 +1 @@ +fire_method = 'li2016crufrc' diff --git a/cime_config/testdefs/testmods_dirs/clm/FireLi2021GSWP/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/FireLi2021GSWP/include_user_mods new file mode 100644 index 0000000000..fe0e18cf88 --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/FireLi2021GSWP/include_user_mods @@ -0,0 +1 @@ +../default diff --git a/cime_config/testdefs/testmods_dirs/clm/FireLi2021GSWP/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/FireLi2021GSWP/user_nl_clm new file mode 100644 index 0000000000..8703daf6f8 --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/FireLi2021GSWP/user_nl_clm @@ -0,0 +1 @@ +fire_method = 'li2021gswpfrc' diff --git a/cime_config/testdefs/testmods_dirs/clm/FireLi2024GSWP/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/FireLi2024GSWP/include_user_mods new file mode 100644 index 0000000000..fe0e18cf88 --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/FireLi2024GSWP/include_user_mods @@ -0,0 +1 @@ +../default diff --git a/cime_config/testdefs/testmods_dirs/clm/FireLi2024GSWP/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/FireLi2024GSWP/user_nl_clm new file mode 100644 index 0000000000..7926de5891 --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/FireLi2024GSWP/user_nl_clm @@ -0,0 +1 @@ +fire_method = 'li2024gswpfrc' From b0c986cd9af32e300118eac565acb5582a32ec8d Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Tue, 11 Jun 2024 14:45:11 -0600 Subject: [PATCH 0850/1248] Functionize check_missing_initdata_status(). --- src/main/clm_initializeMod.F90 | 12 +---------- src/main/controlMod.F90 | 38 ++++++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+), 11 deletions(-) diff --git a/src/main/clm_initializeMod.F90 b/src/main/clm_initializeMod.F90 index 9bf0cc59a2..8b03531000 100644 --- a/src/main/clm_initializeMod.F90 +++ b/src/main/clm_initializeMod.F90 @@ -520,17 +520,7 @@ subroutine initialize2(ni,nj) else if (trim(finidat) == trim(finidat_interp_dest)) then ! Check to see if status file for finidat exists - klen = len_trim(finidat_interp_dest) - 3 ! remove the .nc - locfn = finidat_interp_dest(1:klen)//'.status' - inquire(file=trim(locfn), exist=lexists) - if (.not. lexists) then - if (masterproc) then - write(iulog,'(a)')' failed to find file '//trim(locfn) - write(iulog,'(a)')' this indicates a problem in creating '//trim(finidat_interp_dest) - write(iulog,'(a)')' remove '//trim(finidat_interp_dest)//' and try again' - end if - call endrun() - end if + call check_missing_initdata_status(finidat_interp_dest) end if if (masterproc) then write(iulog,'(a)')'Reading initial conditions from file '//trim(finidat) diff --git a/src/main/controlMod.F90 b/src/main/controlMod.F90 index f876e97176..8712e6cf50 100644 --- a/src/main/controlMod.F90 +++ b/src/main/controlMod.F90 @@ -62,6 +62,7 @@ module controlMod ! ! ! !PRIVATE MEMBER FUNCTIONS: + private :: check_missing_initdata_status ! check for missing finidat_interp_dest .status file private :: apply_use_init_interp ! apply the use_init_interp namelist option, if set ! ! !PRIVATE TYPES: @@ -1220,6 +1221,38 @@ subroutine control_print () end if end subroutine control_print + + !----------------------------------------------------------------------- + subroutine check_missing_initdata_status(finidat_interp_dest) + ! + ! !DESCRIPTION: + ! Checks that the finidat_interp_dest .status file was written (i.e., that write of + ! finidat_interp_dest succeeded) + ! + ! !ARGUMENTS: + character(len=*), intent(in) :: finidat_interp_dest + ! + ! !LOCAL VARIABLES: + logical :: lexists + integer :: klen + character(len=SHR_KIND_CL) :: status_file + character(len=*), parameter :: subname = 'check_missing_initdata_status' + !----------------------------------------------------------------------- + + klen = len_trim(finidat_interp_dest) - 3 ! remove the .nc + status_file = finidat_interp_dest(1:klen)//'.status' + inquire(file=trim(status_file), exist=lexists) + if (.not. lexists) then + if (masterproc) then + write(iulog,'(a)')' failed to find file '//trim(status_file) + write(iulog,'(a)')' this indicates a problem in creating '//trim(finidat_interp_dest) + write(iulog,'(a)')' remove '//trim(finidat_interp_dest)//' and try again' + end if + call endrun(subname//': finidat_interp_dest file exists but is probably bad') + end if + + end subroutine check_missing_initdata_status + !----------------------------------------------------------------------- subroutine apply_use_init_interp(finidat_interp_dest, finidat, finidat_interp_source) @@ -1271,6 +1304,11 @@ subroutine apply_use_init_interp(finidat_interp_dest, finidat, finidat_interp_so inquire(file=trim(finidat_interp_dest), exist=lexists) if (lexists) then + + ! Check that the status file also exists (i.e., that finidat_interp_dest was written successfully) + call check_missing_initdata_status(finidat_interp_dest) + + write(iulog, *) 'ssr apply_use_init_interp: point 3' ! open the input file and check for the name of the input source file status = nf90_open(trim(finidat_interp_dest), 0, ncid) if (status /= nf90_noerr) call handle_err(status) From 4d17ba36020e9740b0090d62027e67374e4368a0 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Tue, 11 Jun 2024 14:47:57 -0600 Subject: [PATCH 0851/1248] Remove troubleshooting printout. --- src/cpl/nuopc/lnd_comp_nuopc.F90 | 1 - src/main/controlMod.F90 | 5 ----- 2 files changed, 6 deletions(-) diff --git a/src/cpl/nuopc/lnd_comp_nuopc.F90 b/src/cpl/nuopc/lnd_comp_nuopc.F90 index 3852a1bf1b..b9c2eeb784 100644 --- a/src/cpl/nuopc/lnd_comp_nuopc.F90 +++ b/src/cpl/nuopc/lnd_comp_nuopc.F90 @@ -626,7 +626,6 @@ subroutine InitializeRealize(gcomp, importState, exportState, clock, rc) version_in=model_version, & hostname_in=hostname, & username_in=username) - call initialize1(dtime=dtime_sync) ! --------------------- diff --git a/src/main/controlMod.F90 b/src/main/controlMod.F90 index 8712e6cf50..e3badbd7bd 100644 --- a/src/main/controlMod.F90 +++ b/src/main/controlMod.F90 @@ -571,7 +571,6 @@ subroutine control_init(dtime) ! ---------------------------------------------------------------------- ! Read in other namelists for other modules ! ---------------------------------------------------------------------- - call mpi_bcast (use_init_interp, 1, MPI_LOGICAL, 0, mpicom, ierr) if (use_init_interp) then call initInterp_readnl( NLFilename ) @@ -581,7 +580,6 @@ subroutine control_init(dtime) !For future version, I suggest to put the following two calls inside their !own modules, which are called from their own initializing methods call init_hydrology( NLFilename ) - call soil_resistance_readnl ( NLFilename ) call CanopyFluxesReadNML ( NLFilename ) call CanopyHydrology_readnl ( NLFilename ) @@ -594,7 +592,6 @@ subroutine control_init(dtime) ! ---------------------------------------------------------------------- ! Broadcast all control information if appropriate ! ---------------------------------------------------------------------- - call control_spmd() ! ---------------------------------------------------------------------- @@ -1307,8 +1304,6 @@ subroutine apply_use_init_interp(finidat_interp_dest, finidat, finidat_interp_so ! Check that the status file also exists (i.e., that finidat_interp_dest was written successfully) call check_missing_initdata_status(finidat_interp_dest) - - write(iulog, *) 'ssr apply_use_init_interp: point 3' ! open the input file and check for the name of the input source file status = nf90_open(trim(finidat_interp_dest), 0, ncid) if (status /= nf90_noerr) call handle_err(status) From 1a79cdb474eb5fe68cc2e7cd4529522a5c2ad818 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Tue, 11 Jun 2024 14:52:38 -0600 Subject: [PATCH 0852/1248] Final cleanup. --- src/cpl/nuopc/lnd_comp_nuopc.F90 | 1 + src/main/controlMod.F90 | 10 +++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/cpl/nuopc/lnd_comp_nuopc.F90 b/src/cpl/nuopc/lnd_comp_nuopc.F90 index b9c2eeb784..3852a1bf1b 100644 --- a/src/cpl/nuopc/lnd_comp_nuopc.F90 +++ b/src/cpl/nuopc/lnd_comp_nuopc.F90 @@ -626,6 +626,7 @@ subroutine InitializeRealize(gcomp, importState, exportState, clock, rc) version_in=model_version, & hostname_in=hostname, & username_in=username) + call initialize1(dtime=dtime_sync) ! --------------------- diff --git a/src/main/controlMod.F90 b/src/main/controlMod.F90 index e3badbd7bd..c7025c5718 100644 --- a/src/main/controlMod.F90 +++ b/src/main/controlMod.F90 @@ -571,6 +571,7 @@ subroutine control_init(dtime) ! ---------------------------------------------------------------------- ! Read in other namelists for other modules ! ---------------------------------------------------------------------- + call mpi_bcast (use_init_interp, 1, MPI_LOGICAL, 0, mpicom, ierr) if (use_init_interp) then call initInterp_readnl( NLFilename ) @@ -580,6 +581,7 @@ subroutine control_init(dtime) !For future version, I suggest to put the following two calls inside their !own modules, which are called from their own initializing methods call init_hydrology( NLFilename ) + call soil_resistance_readnl ( NLFilename ) call CanopyFluxesReadNML ( NLFilename ) call CanopyHydrology_readnl ( NLFilename ) @@ -592,6 +594,7 @@ subroutine control_init(dtime) ! ---------------------------------------------------------------------- ! Broadcast all control information if appropriate ! ---------------------------------------------------------------------- + call control_spmd() ! ---------------------------------------------------------------------- @@ -1218,7 +1221,7 @@ subroutine control_print () end if end subroutine control_print - + !----------------------------------------------------------------------- subroutine check_missing_initdata_status(finidat_interp_dest) ! @@ -1302,8 +1305,9 @@ subroutine apply_use_init_interp(finidat_interp_dest, finidat, finidat_interp_so inquire(file=trim(finidat_interp_dest), exist=lexists) if (lexists) then - ! Check that the status file also exists (i.e., that finidat_interp_dest was written successfully) - call check_missing_initdata_status(finidat_interp_dest) + ! Check that the status file also exists (i.e., that finidat_interp_dest was written successfully) + call check_missing_initdata_status(finidat_interp_dest) + ! open the input file and check for the name of the input source file status = nf90_open(trim(finidat_interp_dest), 0, ncid) if (status /= nf90_noerr) call handle_err(status) From 5e7e5b591d627e13854245f82a7e7b7246981f38 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Tue, 11 Jun 2024 15:08:10 -0600 Subject: [PATCH 0853/1248] Add a missing use statement. --- src/main/clm_initializeMod.F90 | 2 +- src/main/controlMod.F90 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/clm_initializeMod.F90 b/src/main/clm_initializeMod.F90 index 8b03531000..6e80869833 100644 --- a/src/main/clm_initializeMod.F90 +++ b/src/main/clm_initializeMod.F90 @@ -174,7 +174,7 @@ subroutine initialize2(ni,nj) use SatellitePhenologyMod , only : SatellitePhenologyInit, readAnnualVegetation, interpMonthlyVeg, SatellitePhenology use SnowSnicarMod , only : SnowAge_init, SnowOptics_init use lnd2atmMod , only : lnd2atm_minimal - use controlMod , only : NLFilename + use controlMod , only : NLFilename, check_missing_initdata_status use clm_instMod , only : clm_fates use BalanceCheckMod , only : BalanceCheckInit use CNSharedParamsMod , only : CNParamsSetSoilDepth diff --git a/src/main/controlMod.F90 b/src/main/controlMod.F90 index c7025c5718..1af68b0af6 100644 --- a/src/main/controlMod.F90 +++ b/src/main/controlMod.F90 @@ -59,10 +59,10 @@ module controlMod public :: control_setNL ! Set namelist filename public :: control_init ! initial run control information public :: control_print ! print run control information + public :: check_missing_initdata_status ! check for missing finidat_interp_dest .status file ! ! ! !PRIVATE MEMBER FUNCTIONS: - private :: check_missing_initdata_status ! check for missing finidat_interp_dest .status file private :: apply_use_init_interp ! apply the use_init_interp namelist option, if set ! ! !PRIVATE TYPES: From d0f7fc2b56d0094b0bbb5e6ecc1ef580a55c8431 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Fri, 9 Aug 2024 15:54:51 -0600 Subject: [PATCH 0854/1248] Update cam and cice to version in cesm3_0_beta02, there is a gitfleximod problem in updating to this CAM version --- .gitmodules | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitmodules b/.gitmodules index 07a4f7e3e6..bc8db311ec 100644 --- a/.gitmodules +++ b/.gitmodules @@ -40,14 +40,14 @@ fxDONOTUSEurl = https://github.com/NCAR/fates-release [submodule "cice"] path = components/cice url = https://github.com/ESCOMP/CESM_CICE -fxtag = cesm_cice6_5_0_9 +fxtag = cesm_cice6_5_0_10 fxrequired = ToplevelRequired fxDONOTUSEurl = https://github.com/ESCOMP/CESM_CICE [submodule "cam"] path = components/cam url = https://github.com/ESCOMP/CAM -fxtag = cam6_3_162 +fxtag = cam6_4_016 fxrequired = ToplevelRequired fxDONOTUSEurl = https://github.com/ESCOMP/CAM # From 5084ea66320b447af6a600cf90dd9d580366e5d6 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Fri, 9 Aug 2024 16:19:00 -0600 Subject: [PATCH 0855/1248] Remove CAM and CICE from the submodules for coming into CTSM master --- .gitmodules | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/.gitmodules b/.gitmodules index bc8db311ec..19bc024208 100644 --- a/.gitmodules +++ b/.gitmodules @@ -33,27 +33,6 @@ fxrequired = AlwaysRequired # Standard Fork to compare to with "git fleximod test" to ensure personal forks aren't committed fxDONOTUSEurl = https://github.com/NCAR/fates-release -# -# CAM and CICE in order to do F compsets along this brunch -# (Remove before going to master) -# -[submodule "cice"] - path = components/cice - url = https://github.com/ESCOMP/CESM_CICE -fxtag = cesm_cice6_5_0_10 -fxrequired = ToplevelRequired -fxDONOTUSEurl = https://github.com/ESCOMP/CESM_CICE - -[submodule "cam"] -path = components/cam -url = https://github.com/ESCOMP/CAM -fxtag = cam6_4_016 -fxrequired = ToplevelRequired -fxDONOTUSEurl = https://github.com/ESCOMP/CAM -# -# End -# - [submodule "cism"] path = components/cism url = https://github.com/ESCOMP/CISM-wrapper From 870588a1a03edb35591f9495adec140bca20acdb Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Fri, 9 Aug 2024 16:44:26 -0600 Subject: [PATCH 0856/1248] Add a LDust testmod and tests for it Add a testmod for running Leung_2023 dust emission explicitly. And change some existing aux_clm tests over to it (but not all). --- cime_config/testdefs/testlist_clm.xml | 12 ++++++------ .../clm60cam7LndTuningModeLDust/include_user_mods | 1 + .../clm/clm60cam7LndTuningModeLDust/user_nl_clm | 1 + 3 files changed, 8 insertions(+), 6 deletions(-) create mode 100644 cime_config/testdefs/testmods_dirs/clm/clm60cam7LndTuningModeLDust/include_user_mods create mode 100644 cime_config/testdefs/testmods_dirs/clm/clm60cam7LndTuningModeLDust/user_nl_clm diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index 951e0d8d5b..f4484c7410 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -100,7 +100,7 @@ - + @@ -109,7 +109,7 @@ - + @@ -129,7 +129,7 @@ - + @@ -138,7 +138,7 @@ - + @@ -156,7 +156,7 @@ - + @@ -247,7 +247,7 @@ - + diff --git a/cime_config/testdefs/testmods_dirs/clm/clm60cam7LndTuningModeLDust/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/clm60cam7LndTuningModeLDust/include_user_mods new file mode 100644 index 0000000000..ef8619d930 --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/clm60cam7LndTuningModeLDust/include_user_mods @@ -0,0 +1 @@ +../clm60cam7LndTuningMode diff --git a/cime_config/testdefs/testmods_dirs/clm/clm60cam7LndTuningModeLDust/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/clm60cam7LndTuningModeLDust/user_nl_clm new file mode 100644 index 0000000000..54057b1893 --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/clm60cam7LndTuningModeLDust/user_nl_clm @@ -0,0 +1 @@ +dust_emis_method = 'Leung_2023' From b669df61dccd3831c6b9851de0aff41c4cd8c64e Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Fri, 9 Aug 2024 17:28:26 -0600 Subject: [PATCH 0857/1248] Add some comments about how this can be removed --- .../share_esmf/PrigentRoughnessStreamType.F90 | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/unit_test_stubs/share_esmf/PrigentRoughnessStreamType.F90 b/src/unit_test_stubs/share_esmf/PrigentRoughnessStreamType.F90 index 71fb04f942..d9ded09c30 100644 --- a/src/unit_test_stubs/share_esmf/PrigentRoughnessStreamType.F90 +++ b/src/unit_test_stubs/share_esmf/PrigentRoughnessStreamType.F90 @@ -3,6 +3,12 @@ module PrigentRoughnessStreamType !----------------------------------------------------------------------- ! !DESCRIPTION: ! UNIT-TEST STUB for Prigent Roughtness Stream + ! This just allows the Leung dust emission code to be tested without + ! reading in the streams data, by faking it and setting it to a + ! constant value. + ! NOTE: THIS SHOULD BE REMOVED WHEN THE MAIN VERSION ALLOWS IT TO BE OFF. + ! https://github.com/ESCOMP/CTSM/issues/2381 + ! Removing this version will remove testing code duplication. ! !USES use shr_kind_mod , only : r8 => shr_kind_r8, CL => shr_kind_cl use shr_log_mod , only : errMsg => shr_log_errMsg @@ -50,7 +56,7 @@ subroutine Init(this, bounds, NLFilename) ! local variables !----------------------------------------------------------------------- allocate(this%prigent_rghn(bounds%begg:bounds%endg)) - this%prigent_rghn(:) = 1.0_r8 + this%prigent_rghn(:) = 1.0_r8 ! This should likely be a smaller value like 0.1 based on the Prigent dataset average values InitDone = .true. end subroutine Init From 2d889afb1b94a4c25143a9f8003395188fe81110 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Fri, 9 Aug 2024 17:37:19 -0600 Subject: [PATCH 0858/1248] Add some comments and revise the warning as per code review --- bld/CLMBuildNamelist.pm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index 463bd9c429..b99be288e7 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -5091,11 +5091,15 @@ sub setup_logic_prigent_roughness { my $use_prigent = $nl->get_value($var); if ( &value_is_true($use_prigent) ) { if ( $dust_emis_method ne "Leung_2023" ) { - $log->warning( "$var does NOT need to be set without dust_emis_method being Leung_2023" ); + # The Prigent dataset could be used for other purposes + # (such as roughness as in https://github.com/ESCOMP/CTSM/issues/2349) + $log->warning( "$var does NOT need to on without dust_emis_method being Leung_2023, it simply won't be used" ); } add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_fldfilename_prigentroughness' ); add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'stream_meshfile_prigentroughness' ); } elsif ( $dust_emis_method eq "Leung_2023" ) { + # In the future we WILL allow it to be turned off for testing and Paleo work + # see: https://github.com/ESCOMP/CTSM/issues/2381) $log->fatal_error("variable \"$var\" MUST be true when Leung_2023 dust emission method is being used" ); } } From e76b9d1092cb8b5ea6ceb82bda5016a5b336f608 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Fri, 9 Aug 2024 17:38:36 -0600 Subject: [PATCH 0859/1248] REmove all of the settings of GLC_TWO_WAY_COUPLING set to FALSE since that's the default and it's not needed --- bld/unit_testers/build-namelist_test.pl | 7 ------- 1 file changed, 7 deletions(-) diff --git a/bld/unit_testers/build-namelist_test.pl b/bld/unit_testers/build-namelist_test.pl index 1fe98b392e..d7c94b8538 100755 --- a/bld/unit_testers/build-namelist_test.pl +++ b/bld/unit_testers/build-namelist_test.pl @@ -519,7 +519,6 @@ sub cat_and_create_namelistinfile { }, "LeungDust_WO_Prigent" =>{ options=>" -envxml_dir . -bgc sp", namelst=>"use_prigent_roughness=.false.", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm5_1", }, "soilm_stream off w file" =>{ options=>"-res 0.9x1.25 -envxml_dir .", @@ -544,17 +543,14 @@ sub cat_and_create_namelistinfile { }, "coldstart exice on wo stream"=>{ options=>"-res 0.9x1.25 -envxml_dir . --clm_start_type cold", namelst=>"use_excess_ice=.true., use_excess_ice_streams = .false.", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm6_0", }, "coldstart exice on bad temp" =>{ options=>"-res 0.9x1.25 -envxml_dir . --clm_start_type cold", namelst=>"use_excess_ice=.true., use_excess_ice_streams = .true., excess_ice_coldstart_temp=0.0", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm6_0", }, "coldstart exice on bad depth" =>{ options=>"-res 0.9x1.25 -envxml_dir . --clm_start_type cold", namelst=>"use_excess_ice=.true., use_excess_ice_streams = .true., excess_ice_coldstart_depth=0.0", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm6_0", }, "clm50CNDVwtransient" =>{ options=>" -envxml_dir . -use_case 20thC_transient -dynamic_vegetation -res 10x15 -ignore_warnings", @@ -1274,17 +1270,14 @@ sub cat_and_create_namelistinfile { }, "Set coldtemp wo coldstart" =>{ options=>"-envxml_dir . --clm_start_type startup", namelst=>"use_excess_ice=.true.,excess_ice_coldstart_temp=-10.", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm6_0", }, "Set colddepth wo coldstart" =>{ options=>"-envxml_dir . --clm_start_type startup", namelst=>"use_excess_ice=.true.,excess_ice_coldstart_depth=0.5", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm6_0", }, "PrigentOnWOLeung" =>{ options=>"-envxml_dir . -bgc sp", namelst=>"use_prigent_roughness=.true.,dust_emis_method='Zender_2003'", - GLC_TWO_WAY_COUPLING=>"FALSE", phys=>"clm6_0", }, "NotNEONbutNEONlightres" =>{ options=>"--res CLM_USRDAT --clm_usr_name regional --envxml_dir . --bgc bgc --light_res 106x174", From 00537d1e28e787c80c1769a6c458197ca7d2a5ca Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Fri, 9 Aug 2024 18:21:48 -0600 Subject: [PATCH 0860/1248] Add dust fields including FV to output history files for the Zender and Leung dust tests --- .../clm/clm45cam4LndTuningModeZDustSoilErod/user_nl_clm | 1 + .../clm/clm50cam5LndTuningModeZDustSoilErod/user_nl_clm | 1 + .../clm/clm51cam6LndTuningModeZDustSoilErod/user_nl_clm | 1 + .../testmods_dirs/clm/clm60cam7LndTuningModeLDust/user_nl_clm | 4 ++++ 4 files changed, 7 insertions(+) diff --git a/cime_config/testdefs/testmods_dirs/clm/clm45cam4LndTuningModeZDustSoilErod/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/clm45cam4LndTuningModeZDustSoilErod/user_nl_clm index 93b7ee2e48..d97fbbac57 100644 --- a/cime_config/testdefs/testmods_dirs/clm/clm45cam4LndTuningModeZDustSoilErod/user_nl_clm +++ b/cime_config/testdefs/testmods_dirs/clm/clm45cam4LndTuningModeZDustSoilErod/user_nl_clm @@ -1,3 +1,4 @@ ! Turn on using the soil eroditability file in CTSM dust_emis_method = 'Zender_2003' zender_soil_erod_source = 'lnd' +hist_fincl1 += 'FV' diff --git a/cime_config/testdefs/testmods_dirs/clm/clm50cam5LndTuningModeZDustSoilErod/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/clm50cam5LndTuningModeZDustSoilErod/user_nl_clm index 93b7ee2e48..d97fbbac57 100644 --- a/cime_config/testdefs/testmods_dirs/clm/clm50cam5LndTuningModeZDustSoilErod/user_nl_clm +++ b/cime_config/testdefs/testmods_dirs/clm/clm50cam5LndTuningModeZDustSoilErod/user_nl_clm @@ -1,3 +1,4 @@ ! Turn on using the soil eroditability file in CTSM dust_emis_method = 'Zender_2003' zender_soil_erod_source = 'lnd' +hist_fincl1 += 'FV' diff --git a/cime_config/testdefs/testmods_dirs/clm/clm51cam6LndTuningModeZDustSoilErod/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/clm51cam6LndTuningModeZDustSoilErod/user_nl_clm index 93b7ee2e48..d97fbbac57 100644 --- a/cime_config/testdefs/testmods_dirs/clm/clm51cam6LndTuningModeZDustSoilErod/user_nl_clm +++ b/cime_config/testdefs/testmods_dirs/clm/clm51cam6LndTuningModeZDustSoilErod/user_nl_clm @@ -1,3 +1,4 @@ ! Turn on using the soil eroditability file in CTSM dust_emis_method = 'Zender_2003' zender_soil_erod_source = 'lnd' +hist_fincl1 += 'FV' diff --git a/cime_config/testdefs/testmods_dirs/clm/clm60cam7LndTuningModeLDust/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/clm60cam7LndTuningModeLDust/user_nl_clm index 54057b1893..e6da29bbe9 100644 --- a/cime_config/testdefs/testmods_dirs/clm/clm60cam7LndTuningModeLDust/user_nl_clm +++ b/cime_config/testdefs/testmods_dirs/clm/clm60cam7LndTuningModeLDust/user_nl_clm @@ -1 +1,5 @@ dust_emis_method = 'Leung_2023' +! Add all of the Leung optional history fields +hist_fincl1 += 'FV', 'DUST_EMIS_COEFF', 'WND_FRC_FT', 'WND_FRC_FT_DRY', 'WND_FRC_IT', 'WND_FRC_SOIL', 'LND_FRC_MBLE', 'GWC', 'LIQ_FRAC', + 'U_S_MEAN', 'U_S_MEAN', 'ZETAOBU', 'U_FT', 'U_IT', 'ALPHA_TC_RATE', 'P_IT'. 'ETA', 'SSR', 'VAI_OKIN', + 'FRC_THR_RGHN_FCT', 'WND_FRC_FT_STD', 'DPFCT_ROCK' From f484425c53260f1294faf5e7c3f410bc69659ac8 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Fri, 9 Aug 2024 18:34:20 -0600 Subject: [PATCH 0861/1248] Modify some of the comments based on code review, and simplify the MassFracClayLeung2023 function --- src/biogeophys/SoilStateInitTimeConstMod.F90 | 27 ++++++++++---------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/src/biogeophys/SoilStateInitTimeConstMod.F90 b/src/biogeophys/SoilStateInitTimeConstMod.F90 index edcc14430b..e6fcca0f27 100644 --- a/src/biogeophys/SoilStateInitTimeConstMod.F90 +++ b/src/biogeophys/SoilStateInitTimeConstMod.F90 @@ -706,15 +706,8 @@ subroutine SoilStateInitTimeConst(bounds, soilstate_inst, nlfilename) ! -------------------------------------------------------------------- ! Initialize threshold soil moisture, and mass fraction of clay as - ! scaling coefficient of dust emission flux (kg/m2/s) in DUSTMod.F90 - ! dmleung modified 5 Jul 2024, reducing sensitivity of dust emission - ! flux to clay fraction. - ! Also, for threshold soil moisture, dmleung followed Zender (2003) - ! DEAD scheme to again avoid dust flux being too sensitive to the choice - ! of clay dataset. This is different from what Leung et al. (2023) - ! intended to do. - ! Both decisions are based on tuning preference and could subject to - ! future changes. dmleung 5 Jul 2024 + ! scaling coefficient of dust emission flux (kg/m2/s) in each DustEmisType + ! module. See the comments in each function. ! -------------------------------------------------------------------- do c = begc,endc @@ -751,6 +744,7 @@ real(r8) function ThresholdSoilMoistZender2003( clay ) ! convert surface clay fraction from percentage to fraction. ! The equation comes from Eq. 14 of Fecan et al. (1999; https://doi.org/10.1007/s00585-999-0149-7). ! + ! NOTE: dmleung 19 Feb 2024. !------------------------------------------------------------------------------ ! For future developments Danny M. Leung decided (Dec, 2023) that the Leung et al. (2023) o ! dust emission scheme in the CESM will use Zender's tuning as well, which overall @@ -762,7 +756,11 @@ real(r8) function ThresholdSoilMoistZender2003( clay ) ! ! Also see the notes below for ThresholdSoilMoistKok2014. ! - ! Notes from: dmleung 19 Feb 2024. + ! NOTE on Leung dust emissions: dmleung Jul 5 2024: + ! + ! dmleung followed Zender (2003) DUST scheme to again avoid dust flux being too sensitive to the choice + ! of clay dataset. This is different from what Leung et al. (2023) intended to do. + ! NOTE: This might need to be adjusted for tuning in the future. ! !------------------------------------------------------------------------------ real(r8), intent(IN) :: clay ! Fraction of clay in the soil (%) @@ -781,6 +779,8 @@ real(r8) function ThresholdSoilMoistKok2014( clay ) !------------------------------------------------------------------------------ ! Calculate the threshold soil moisture needed for dust emission, based on clay content ! + ! NOTE: dmleung 24 May 2024. + ! ! The below calculates the threshold gravimetric water content for the dust emission ! calculation in DustEmis. The equation comes from Eq. 14 of Fecan et al. ! (1999; https://doi.org/10.1007/s00585-999-0149-7). @@ -792,7 +792,6 @@ real(r8) function ThresholdSoilMoistKok2014( clay ) ! Charlie Zender (2003a) chose: a = 1/clay3d, which gives the ThresholdSoilMoistZender2003 ! function above. ! - ! Notes from: dmleung 24 May 2024. !------------------------------------------------------------------------------ real(r8), intent(IN) :: clay ! Fraction of clay in the soil (%) @@ -813,10 +812,12 @@ end function MassFracClay real(r8) function MassFracClayLeung2023( clay ) ! Calculate the mass fraction of clay needed for dust emission, based on clay content ! Based on the base Zender_2003 version, with a slight modification for Leung_2023 + ! dmleung modified 5 Jul 2024, reducing sensitivity of dust emission + ! flux to clay fraction. + ! NOTE: This might need to be adjusted for tuning in the future. real(r8), intent(IN) :: clay ! Fraction of lay in the soil (%) - MassFracClayLeung2023 = MassFracClay( clay ) - MassFracClayLeung2023 = 0.1_r8 + MassFracClayLeung2023 * 0.1_r8 / 0.20_r8 ! dmleung added this line to reduce the sensitivity of dust emission flux to clay fraction in DUSTMod. 5 Jul 2024 + MassFracClayLeung2023 = 0.1_r8 + MassFracClay( clay ) * 0.1_r8 / 0.20_r8 ! dmleung added this line to reduce the sensitivity of dust emission flux to clay fraction in DUSTMod. 5 Jul 2024 end function MassFracClayLeung2023 !------------------------------------------------------------------------------ From d7e5a6ddf2668c1379a85fa7fadd5b259ca6540c Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Fri, 9 Aug 2024 18:43:51 -0600 Subject: [PATCH 0862/1248] Add back the comment that got accidentally removed --- src/unit_test_shr/unittestDustEmisInputs.F90 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/unit_test_shr/unittestDustEmisInputs.F90 b/src/unit_test_shr/unittestDustEmisInputs.F90 index a8473460b9..6f1a7b09f7 100644 --- a/src/unit_test_shr/unittestDustEmisInputs.F90 +++ b/src/unit_test_shr/unittestDustEmisInputs.F90 @@ -84,10 +84,11 @@ subroutine setUp(this) glcmec_downscale_longwave = .false., & lapse_rate = 0.01_r8 & ! arbitrary (this is unused for these tests) ) + call this%atm2lnd_inst%InitForTesting(bounds, atm2lnd_params) ! Water and soil state -- after the subgrid setup call this%water_factory%setup_after_subgrid(snl = snl) - call this%setupSoilState( ) + call this%setupSoilState( ) ! This needs to happen before the water_type object creation call this%water_factory%create_water_type(this%water_inst, watsat_col=this%soilstate_inst%watsat_col) ! Canopy state, friction velocity, and temperature state ojects call this%canopystate_inst%SetNMLForTesting() From e83caa8e79bec1c25bd7d353838606b36efbc42d Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Fri, 9 Aug 2024 18:47:43 -0600 Subject: [PATCH 0863/1248] Remove if for use_cn around adding FV to the history file and make it default inactive --- src/biogeophys/FrictionVelocityMod.F90 | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/biogeophys/FrictionVelocityMod.F90 b/src/biogeophys/FrictionVelocityMod.F90 index 8e06e66e32..44e1bf6294 100644 --- a/src/biogeophys/FrictionVelocityMod.F90 +++ b/src/biogeophys/FrictionVelocityMod.F90 @@ -262,12 +262,10 @@ subroutine InitHistory(this, bounds) ptr_patch=this%ram1_patch, default='inactive') end if - !if (use_cn) then this%fv_patch(begp:endp) = spval call hist_addfld1d (fname='FV', units='m/s', & avgflag='A', long_name='friction velocity', & - ptr_patch=this%fv_patch) - !end if + ptr_patch=this%fv_patch, default='inactive') call hist_addfld1d (fname='RAH1', units='s/m', & avgflag='A', long_name='aerodynamical resistance ', & From 4daf9246649eb0ba77800706614ff039c36d747b Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Fri, 9 Aug 2024 18:59:46 -0600 Subject: [PATCH 0864/1248] Code review noticed a couple places where a 1_8 really should be vai_mbl_thr --- src/biogeochem/DustEmisLeung2023.F90 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/biogeochem/DustEmisLeung2023.F90 b/src/biogeochem/DustEmisLeung2023.F90 index 6cc86e4eb5..c96853b710 100644 --- a/src/biogeochem/DustEmisLeung2023.F90 +++ b/src/biogeochem/DustEmisLeung2023.F90 @@ -640,7 +640,7 @@ subroutine DustEmission (this, bounds, & ! purpose: compute factor by which surface roughness increases threshold ! friction velocity (currently a constant) - if (lnd_frc_mbl(p) > 0.0_r8 .AND. tlai_lu(l)<=1_r8) then + if (lnd_frc_mbl(p) > 0.0_r8 .AND. tlai_lu(l)<= vai_mbl_thr) then !if (lnd_frc_mbl(p) > 0.0_r8 .AND. ttlai(p)<=1_r8) then ! vegetation drag partition equation following Gregory Okin (2008) + Caroline Pierre et al. (2014) !lai(p) = tlai_lu(l)+0.1_r8 ! LAI+SAI averaged to landunit level; the equation is undefined at lai=0, and LAI in CTSM has some zeros over deserts, so we add in a small number. @@ -687,7 +687,7 @@ subroutine DustEmission (this, bounds, & else ! for lnd_frc_mbl=0, do not change friction velocity and assume drag partition factor = 0 wnd_frc_slt = fv(p) * frc_thr_rghn_fct(p) ! The value here is not important since once lnd_frc_mbl(p) <= 0.0_r8 there will be no emission. dmleung added 5 Jul 2024 - frc_thr_rghn_fct(p) = 0.0_r8 ! When LAI > 1, the drag partition effect is zero. dmleung 16 Feb 2024. + frc_thr_rghn_fct(p) = 0.0_r8 ! When LAI > vai_mbl_thr, the drag partition effect is zero. dmleung 16 Feb 2024. end if !########## end of drag partition effect ####################################################### From 5007a1a8850c1635f13d9e21ef8a07a31fe2db23 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Fri, 9 Aug 2024 19:10:09 -0600 Subject: [PATCH 0865/1248] Remove cam and cice as submodules --- components/cam | 1 - components/cice | 1 - 2 files changed, 2 deletions(-) delete mode 160000 components/cam delete mode 160000 components/cice diff --git a/components/cam b/components/cam deleted file mode 160000 index ab476f9b73..0000000000 --- a/components/cam +++ /dev/null @@ -1 +0,0 @@ -Subproject commit ab476f9b7345cbefdc4cf67ff17f0fe85d8c7387 diff --git a/components/cice b/components/cice deleted file mode 160000 index bdf6ea04d6..0000000000 --- a/components/cice +++ /dev/null @@ -1 +0,0 @@ -Subproject commit bdf6ea04d6133434fcaa4de5336de106f01290d0 From 63a2e73deb72088d84160e020b8ae2b254edfa88 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Fri, 9 Aug 2024 19:47:32 -0600 Subject: [PATCH 0866/1248] Remove commented out code for clarity --- src/biogeochem/DustEmisLeung2023.F90 | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/src/biogeochem/DustEmisLeung2023.F90 b/src/biogeochem/DustEmisLeung2023.F90 index c96853b710..1746056fbf 100644 --- a/src/biogeochem/DustEmisLeung2023.F90 +++ b/src/biogeochem/DustEmisLeung2023.F90 @@ -641,17 +641,6 @@ subroutine DustEmission (this, bounds, & ! friction velocity (currently a constant) if (lnd_frc_mbl(p) > 0.0_r8 .AND. tlai_lu(l)<= vai_mbl_thr) then - !if (lnd_frc_mbl(p) > 0.0_r8 .AND. ttlai(p)<=1_r8) then - ! vegetation drag partition equation following Gregory Okin (2008) + Caroline Pierre et al. (2014) - !lai(p) = tlai_lu(l)+0.1_r8 ! LAI+SAI averaged to landunit level; the equation is undefined at lai=0, and LAI in CTSM has some zeros over deserts, so we add in a small number. - !lai(p) = ttlai(p) + lai0_Okin ! ttlai = tlai+tsai. Okin-Pierre's equation is undefined at lai=0, and LAI in CTSM has some zeros over deserts, so we add in a small number. On 26 Feb 2024, dmleung changed from tlai_lu(l) to ttlai(p) - !if (lai(p) > 1_r8) then - ! lai(p) = 1_r8 ! setting LAI = 1 to be a max value (since K_length goes to negative when LAI>1) - !end if ! - - !if (ttlai(p) + vai0_Okin <= 1_r8) then - ! vai_Okin(p) = ttlai(p) + vai0_Okin ! ttlai = vai = tlai+tsai. Okin-Pierre's equation is undefined at vai=0, and VAI in CTSM has some zeros over deserts, so we add in a small number. On 26 Feb 2024, dmleung changed from tlai_lu(l) to ttlai(p) - !end if ! In the Okin-Pierre formulation, VAI has to be 0 < VAI <= 1. vai_Okin(p) = tlai_lu(l)+vai0_Okin ! LAI+SAI averaged to landunit level; the equation is undefined at lai=0, and LAI in CTSM has some zeros over deserts, so we add in a small number. if (vai_Okin(p) > 1_r8) then @@ -667,13 +656,10 @@ subroutine DustEmission (this, bounds, & if (lun%itype(l) == istsoil .or. lun%itype(l) == istcrop) then if (patch%itype(p) == noveg) then ! if bare, uses rock drag partition factor if (dpfct_rock(p) /= dpfct_rock(p)) then ! dmleung added 24 May 2024: dpfct_rock(p) could be NaN; CLM could run when DEBUG=FALSE in env_build.xml but dies when DEBUG=TRUE (usually when checking if wnd_frc_slt > wnd_frc_thr_slt_it and if numer/denom < 30._r8 below) - !write(iulog,*) 'dpfct_rock(p) == NaN; dpfct_rock(p) = ', dpfct_rock(p) frc_thr_rgh_fct = 0.001_r8 ! Set drag partition effect to be a very small value (or zero) such that there is no emission whenever dpfct_rock(p) = NaN; dmleung 24 May 2024 else - !write(iulog,*) 'dpfct_rock(p) = ', dpfct_rock(p) frc_thr_rgh_fct = dpfct_rock(p) end if - !frc_thr_rgh_fct = dpfct_rock(p) ! This should be the original code when dpfct_rock(p) has values everywhere else ! if vegetation, uses vegetation drag partition factor frc_thr_rgh_fct = ssr(p) end if @@ -731,7 +717,6 @@ subroutine DustEmission (this, bounds, & ! mean lowpass-filtered wind speed at hgt_sal = 0.1 m saltation height (assuming aerodynamic roughness length z0a_glob = 1e-4 m globally for ease; also assuming neutral condition) u_mean_slt(p) = (wnd_frc_slt/k) * log(hgt_sal / z0a_glob) ! translating from ustar (velocity scale) to actual wind - !stblty(p) = 0_r8 ! -dmleung 2 Dec 2021: use stability = 0 for now, assuming no buoyancy contribution. Might uncomment the above lines in future revisions. stblty(p) = zii / obu(p) ! -dmleung 20 Feb 2024: use obu from CTSM and PBL height = zii (= 1000_r8) which is default in CTSM. Should we transfer PBL height from CAM? if ((12_r8 - 0.5_r8 * stblty(p)) .GE. 0.001_r8) then ! should have used 0 theoretically; used 0.001 here to avoid undefined values u_sd_slt(p) = wnd_frc_slt * (12_r8 - 0.5_r8 * stblty(p))**0.333_r8 From 5a2c873d89b0001baac42480182b115fbec19a98 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Fri, 9 Aug 2024 21:38:49 -0600 Subject: [PATCH 0867/1248] Clarify the error message that the prigent streams file is required for Leung 2023 dust emissions --- src/biogeochem/DustEmisLeung2023.F90 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/biogeochem/DustEmisLeung2023.F90 b/src/biogeochem/DustEmisLeung2023.F90 index 1746056fbf..5f92d58425 100644 --- a/src/biogeochem/DustEmisLeung2023.F90 +++ b/src/biogeochem/DustEmisLeung2023.F90 @@ -319,7 +319,8 @@ subroutine InitCold(this, bounds) call this%CalcDragPartition( bounds ) else - call endrun( "ERROR:: Drag partitioning MUST now use a streams file of aeolian roughness length to calculate, it can no longer read from the fsurdat file" ) + call endrun( "ERROR:: dus_emis_Leung_2023 requires requires a streams file of aeolian roughness length to calculate drag partitioning" ) + end if end subroutine InitCold From 96d2de57dd024b712035d5cca54dbe7d3cec65e5 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Fri, 9 Aug 2024 22:59:31 -0600 Subject: [PATCH 0868/1248] Fix a syntax topo, so will work --- .../testmods_dirs/clm/clm60cam7LndTuningModeLDust/user_nl_clm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cime_config/testdefs/testmods_dirs/clm/clm60cam7LndTuningModeLDust/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/clm60cam7LndTuningModeLDust/user_nl_clm index e6da29bbe9..09887c81b8 100644 --- a/cime_config/testdefs/testmods_dirs/clm/clm60cam7LndTuningModeLDust/user_nl_clm +++ b/cime_config/testdefs/testmods_dirs/clm/clm60cam7LndTuningModeLDust/user_nl_clm @@ -1,5 +1,5 @@ dust_emis_method = 'Leung_2023' ! Add all of the Leung optional history fields hist_fincl1 += 'FV', 'DUST_EMIS_COEFF', 'WND_FRC_FT', 'WND_FRC_FT_DRY', 'WND_FRC_IT', 'WND_FRC_SOIL', 'LND_FRC_MBLE', 'GWC', 'LIQ_FRAC', - 'U_S_MEAN', 'U_S_MEAN', 'ZETAOBU', 'U_FT', 'U_IT', 'ALPHA_TC_RATE', 'P_IT'. 'ETA', 'SSR', 'VAI_OKIN', + 'U_S_MEAN', 'U_S_MEAN', 'ZETAOBU', 'U_FT', 'U_IT', 'ALPHA_TC_RATE', 'P_IT', 'ETA', 'SSR', 'VAI_OKIN', 'FRC_THR_RGHN_FCT', 'WND_FRC_FT_STD', 'DPFCT_ROCK' From 38c42ae7b0ec946ee95b56b3840e0ba4c6d6515f Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Sat, 10 Aug 2024 14:13:06 -0600 Subject: [PATCH 0869/1248] Add a unit test to check if dpfct_rock can be nan, currently fails as the nan handling inside of DustEmissions for Leung is not sufficient --- src/biogeochem/DustEmisBase.F90 | 19 ++++++++ .../DustEmis_test/test_DustEmisLeung2023.pf | 47 +++++++++++++++++-- 2 files changed, 62 insertions(+), 4 deletions(-) diff --git a/src/biogeochem/DustEmisBase.F90 b/src/biogeochem/DustEmisBase.F90 index d13df40992..84467c701d 100644 --- a/src/biogeochem/DustEmisBase.F90 +++ b/src/biogeochem/DustEmisBase.F90 @@ -69,6 +69,8 @@ module DustEmisBase procedure , public :: GetConstVars ! Get important constant variables procedure , public :: CleanBase ! Base object deallocation (allows extension) procedure , public :: Clean => CleanBase ! Deallocation used by callers + procedure , public :: SetDragPartitionBase ! Base SetDragPartition method that just aborts + procedure , public :: SetDragPartition => SetDragPartitionBase ! SetDrgPartiotion used by callers procedure , private :: InitAllocateBase procedure , private :: InitHistoryBase procedure , private :: InitDustVars ! Initialize variables used in DustEmission method @@ -237,6 +239,23 @@ subroutine InitHistoryBase(this, bounds) end subroutine InitHistoryBase + !------------------------------------------------------------------------ + + subroutine SetDragPartitionBase(this, bounds, drag_partition) + ! + ! !DESCRIPTION: + ! Set the drag partition for testing -- only aborts as only used by the Leung instance + ! + ! !USES: + ! !ARGUMENTS: + class(dust_emis_base_type) :: this + type(bounds_type), intent(in) :: bounds + real(r8), intent(in) :: drag_partition + + call endrun(msg="SetDragPartition is NOT allowed for this dust emission class type") + + end subroutine SetDragPartitionBase + !----------------------------------------------------------------------- subroutine WritePatchToLog(this, p) diff --git a/src/biogeochem/test/DustEmis_test/test_DustEmisLeung2023.pf b/src/biogeochem/test/DustEmis_test/test_DustEmisLeung2023.pf index 4947a76d60..7aac658d33 100644 --- a/src/biogeochem/test/DustEmis_test/test_DustEmisLeung2023.pf +++ b/src/biogeochem/test/DustEmis_test/test_DustEmisLeung2023.pf @@ -7,7 +7,9 @@ module test_DustEmisLeung2023 use unittestSubgridMod, only : bounds use DustEmisBase use DustEmisLeung2023 + use abortutils, only : endrun use shr_kind_mod , only : r8 => shr_kind_r8 + use shr_infnan_mod, only : nan => shr_infnan_nan, assignment(=) use DustEmisFactory, only : create_dust_emissions use shr_dust_emis_mod, only : dust_emis_set_options @@ -37,7 +39,7 @@ contains call dust_emis_set_options( 'Leung_2023', 'none') call this%input%setUp( ) - + ! Create the dust emission object last allocate(this%dust_emis, source = create_dust_emissions(bounds, NLFilename)) end subroutine setUp @@ -72,7 +74,7 @@ contains call this%dust_emis%WritePatchToLog( p ) end do end subroutine print_values - + !----------------------------------------------------------------------- subroutine validate_patch(this, p) @@ -203,7 +205,7 @@ contains class(TestDustEmisLeung2023), intent(inout) :: this real(r8) :: flx_mss_vrt_dst_tot character(100) :: expected_msg - + call this%input%create_atm2lnd() call this%input%create_fv( ) ! Dust should abort with an error on dust mobility when snow fraction greater than 1 @@ -215,7 +217,7 @@ contains @assertExceptionRaised(expected_msg) end subroutine aborts_on_bad_dust_mobility - + !----------------------------------------------------------------------- @Test @@ -248,7 +250,44 @@ contains end subroutine dust_zero_when_tlai_high !----------------------------------------------------------------------- + @Test + subroutine dust_handles_dpfct_rock_nan(this) + use PatchType, only : patch + ! Check dust emissions can handle dpftc_rock being set to NaN + class(TestDustEmisLeung2023), intent(inout) :: this + integer :: p, i + real(r8) :: flx_mss_vrt_dst_tot, drag_partition, previous_dst_tot + call this%input%create_atm2lnd() + call this%input%create_fv( ) + ! Loop over twice first with nan and then with the tiny value that nan should be changed to + do i = 1, 2 + if ( i == 1 )then + drag_partition = nan + else if ( i == 2 ) then + drag_partition = 0.001 + else + call endrun( "Looping over too many iterations should just be 2" ) + end if + call this%dust_emis%SetDragPartition(bounds, drag_partition) + call this%dust_emis%DustEmission(bounds, this%input%num_nolakep, this%input%filter_nolakep, this%input%atm2lnd_inst, & + this%input%soilstate_inst, this%input%canopystate_inst, this%input%water_inst%waterstatebulk_inst, & + this%input%water_inst%waterdiagnosticbulk_inst, this%input%frictionvel_inst) + do p = bounds%begp, bounds%endp + call this%dust_emis%GetPatchVars( p, flx_mss_vrt_dst_tot=flx_mss_vrt_dst_tot ) + @assertEqual( flx_mss_vrt_dst_tot, 0.0_r8 ) + if ( i == 1 )then + previous_dst_tot = flx_mss_vrt_dst_tot + else + ! Verify that the result with nan is equal to the result with the tiny value as expected + @assertEqual( flx_mss_vrt_dst_tot, previous_dst_tot ) + end if + end do + end do + + end subroutine dust_handles_dpfct_rock_nan + + !----------------------------------------------------------------------- @Test subroutine check_dust_emis_increasing_fv(this) ! Check dust emissions with increasing friction velocity From 1fe61e623a20fe94e9221d2e405d8fcc3d7263b4 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Sat, 10 Aug 2024 14:19:33 -0600 Subject: [PATCH 0870/1248] Now passes the unit-test --- src/biogeochem/DustEmisLeung2023.F90 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/biogeochem/DustEmisLeung2023.F90 b/src/biogeochem/DustEmisLeung2023.F90 index 5f92d58425..bab1eba4ed 100644 --- a/src/biogeochem/DustEmisLeung2023.F90 +++ b/src/biogeochem/DustEmisLeung2023.F90 @@ -14,7 +14,7 @@ module DustEmisLeung2023 ! !USES: use shr_kind_mod , only : r8 => shr_kind_r8 use shr_log_mod , only : errMsg => shr_log_errMsg - use shr_infnan_mod , only : nan => shr_infnan_nan, assignment(=) + use shr_infnan_mod , only : nan => shr_infnan_nan, assignment(=), shr_infnan_isnan use clm_varpar , only : dst_src_nbr, ndst use clm_varcon , only : grav, spval use landunit_varcon , only : istcrop, istsoil @@ -656,7 +656,7 @@ subroutine DustEmission (this, bounds, & ! calculation of the hybrid/total drag partition effect considering both rock and vegetation drag partitioning using LUH2 bare and veg fractions within a grid if (lun%itype(l) == istsoil .or. lun%itype(l) == istcrop) then if (patch%itype(p) == noveg) then ! if bare, uses rock drag partition factor - if (dpfct_rock(p) /= dpfct_rock(p)) then ! dmleung added 24 May 2024: dpfct_rock(p) could be NaN; CLM could run when DEBUG=FALSE in env_build.xml but dies when DEBUG=TRUE (usually when checking if wnd_frc_slt > wnd_frc_thr_slt_it and if numer/denom < 30._r8 below) + if (shr_infnan_isnan(dpfct_rock(p)) ) then ! dmleung added 24 May 2024: dpfct_rock(p) could be NaN; CLM could run when DEBUG=FALSE in env_build.xml but dies when DEBUG=TRUE (usually when checking if wnd_frc_slt > wnd_frc_thr_slt_it and if numer/denom < 30._r8 below) frc_thr_rgh_fct = 0.001_r8 ! Set drag partition effect to be a very small value (or zero) such that there is no emission whenever dpfct_rock(p) = NaN; dmleung 24 May 2024 else frc_thr_rgh_fct = dpfct_rock(p) From 1895cba46af487a6dcd84c80add4d97559929efe Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Sat, 10 Aug 2024 15:40:58 -0600 Subject: [PATCH 0871/1248] Add obu to create_fv, and add test for obu of zero, and error handling for it (since downstream values can be corrupted if it's NaN or zero), also use shr_infnan_isnan for intrmtncy_fct --- src/biogeochem/DustEmisLeung2023.F90 | 6 ++++- .../DustEmis_test/test_DustEmisLeung2023.pf | 23 ++++++++++++++++--- 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/src/biogeochem/DustEmisLeung2023.F90 b/src/biogeochem/DustEmisLeung2023.F90 index bab1eba4ed..4c80c3b8ca 100644 --- a/src/biogeochem/DustEmisLeung2023.F90 +++ b/src/biogeochem/DustEmisLeung2023.F90 @@ -718,6 +718,10 @@ subroutine DustEmission (this, bounds, & ! mean lowpass-filtered wind speed at hgt_sal = 0.1 m saltation height (assuming aerodynamic roughness length z0a_glob = 1e-4 m globally for ease; also assuming neutral condition) u_mean_slt(p) = (wnd_frc_slt/k) * log(hgt_sal / z0a_glob) ! translating from ustar (velocity scale) to actual wind + if ( obu(p) == 0.0_r8 )then + call endrun(msg='Input obu is zero and can NOT be' ) + return + end if stblty(p) = zii / obu(p) ! -dmleung 20 Feb 2024: use obu from CTSM and PBL height = zii (= 1000_r8) which is default in CTSM. Should we transfer PBL height from CAM? if ((12_r8 - 0.5_r8 * stblty(p)) .GE. 0.001_r8) then ! should have used 0 theoretically; used 0.001 here to avoid undefined values u_sd_slt(p) = wnd_frc_slt * (12_r8 - 0.5_r8 * stblty(p))**0.333_r8 @@ -751,7 +755,7 @@ subroutine DustEmission (this, bounds, & intrmtncy_fct(p) = 1.0_r8 - prb_crs_fld_thr(p) + thr_crs_rate(p) * (prb_crs_fld_thr(p) - prb_crs_impct_thr(p)) ! multiply dust emission flux by intermittency factor - if (intrmtncy_fct(p) /= intrmtncy_fct(p)) then ! if intrmtncy_fct(p) is not NaN then multiply by intermittency factor; this statement is needed because dust emission flx_mss_vrt_dst_ttl(p) has to be non NaN (at least zero) to be outputted + if ( shr_infnan_isnan(intrmtncy_fct(p)) ) then ! if intrmtncy_fct(p) is not NaN then multiply by intermittency factor; this statement is needed because dust emission flx_mss_vrt_dst_ttl(p) has to be non NaN (at least zero) to be outputted flx_mss_vrt_dst_ttl(p) = flx_mss_vrt_dst_ttl(p) else flx_mss_vrt_dst_ttl(p) = flx_mss_vrt_dst_ttl(p) * intrmtncy_fct(p) ! multiply dust flux by intermittency diff --git a/src/biogeochem/test/DustEmis_test/test_DustEmisLeung2023.pf b/src/biogeochem/test/DustEmis_test/test_DustEmisLeung2023.pf index 7aac658d33..66f0191c06 100644 --- a/src/biogeochem/test/DustEmis_test/test_DustEmisLeung2023.pf +++ b/src/biogeochem/test/DustEmis_test/test_DustEmisLeung2023.pf @@ -109,7 +109,7 @@ contains call this%dust_emis%GetPatchVars( p, flx_mss_vrt_dst_tot=flx_mss_vrt_dst_tot, & vlc_trb_1=vlc_trb_1, vlc_trb_2=vlc_trb_2, vlc_trb_3=vlc_trb_3, & vlc_trb_4=vlc_trb_4) - @assertEqual( flx_mss_vrt_dst_tot, 1.305341724414137d-006, tolerance=tol ) + @assertEqual( flx_mss_vrt_dst_tot, 1.305340725852736d-006, tolerance=tol ) @assertEqual( vlc_trb_1, 3.407721147709135d-003, tolerance=tol ) @assertEqual( vlc_trb_2, 4.961153753164878d-003, tolerance=tol ) @assertEqual( vlc_trb_3, 4.980100969983446d-003, tolerance=tol ) @@ -287,6 +287,23 @@ contains end subroutine dust_handles_dpfct_rock_nan + !----------------------------------------------------------------------- + @Test + subroutine dust_aborts_on_zero_obu(this) + use PatchType, only : patch + ! Check dust emissions can handle dpftc_rock being set to NaN + class(TestDustEmisLeung2023), intent(inout) :: this + character(100) :: expected_msg + + call this%input%create_atm2lnd() + call this%input%create_fv( obu=0.0_r8 ) + call this%dust_emis%DustEmission(bounds, this%input%num_nolakep, this%input%filter_nolakep, this%input%atm2lnd_inst, & + this%input%soilstate_inst, this%input%canopystate_inst, this%input%water_inst%waterstatebulk_inst, & + this%input%water_inst%waterdiagnosticbulk_inst, this%input%frictionvel_inst) + expected_msg = "ABORTED: Input obu is zero and can NOT be" + @assertExceptionRaised(expected_msg) + + end subroutine dust_aborts_on_zero_obu !----------------------------------------------------------------------- @Test subroutine check_dust_emis_increasing_fv(this) @@ -309,7 +326,7 @@ contains call this%validate_patch(p) call this%dust_emis%GetPatchVars( p, flx_mss_vrt_dst_tot=flx_mss_vrt_dst_tot ) total_dust0 = flx_mss_vrt_dst_tot - @assertEqual( flx_mss_vrt_dst_tot, 1.064145669761461d-5, tolerance=tol ) + @assertEqual( flx_mss_vrt_dst_tot, 1.064145664977026d-5, tolerance=tol ) end do ! Double fv and show result is higher call this%input%create_fv( u10=u10, fv=fv*2.0_r8) @@ -321,7 +338,7 @@ contains call this%validate_patch(p) call this%dust_emis%GetPatchVars( p, flx_mss_vrt_dst_tot=flx_mss_vrt_dst_tot ) total_dust_higher = flx_mss_vrt_dst_tot - @assertEqual( flx_mss_vrt_dst_tot, 8.309603073613188d-5, tolerance=tol ) + @assertEqual( flx_mss_vrt_dst_tot, 8.309603071671919d-5, tolerance=tol ) end do @assertGreaterThan( total_dust_higher, total_dust0 ) From d42679740bbcec5dfd3c29721b5b359197508cd2 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Sat, 10 Aug 2024 18:53:07 -0600 Subject: [PATCH 0872/1248] Set obu in create_fv since it's needed for the Leung method --- src/unit_test_shr/unittestDustEmisInputs.F90 | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/unit_test_shr/unittestDustEmisInputs.F90 b/src/unit_test_shr/unittestDustEmisInputs.F90 index 6f1a7b09f7..771eb410f7 100644 --- a/src/unit_test_shr/unittestDustEmisInputs.F90 +++ b/src/unit_test_shr/unittestDustEmisInputs.F90 @@ -202,17 +202,19 @@ end subroutine create_atm2lnd !----------------------------------------------------------------------- - subroutine create_fv(this, fv, u10, ram1) + subroutine create_fv(this, fv, u10, ram1, obu) ! Initializes some fields needed for dust emissions in this%frictionvel_inst, and sets ! fields based on inputs. Excluded inputs are given a default value class(unittest_dust_emis_input_type), intent(inout) :: this real(r8), intent(in), optional :: fv real(r8), intent(in), optional :: u10 real(r8), intent(in), optional :: ram1 + real(r8), intent(in), optional :: obu real(r8), parameter :: fv_default = 2.0_r8 real(r8), parameter :: u10_default = 4._r8 real(r8), parameter :: ram1_default = 200._r8 + real(r8), parameter :: obu_default = -100._r8 ! ------------------------------------------------------------------------ if (present(fv)) then @@ -233,6 +235,12 @@ subroutine create_fv(this, fv, u10, ram1) this%frictionvel_inst%ram1_patch(bounds%begp:bounds%endp) = ram1_default end if + if (present(obu)) then + this%frictionvel_inst%obu_patch(bounds%begp:bounds%endp) = obu + else + this%frictionvel_inst%obu_patch(bounds%begp:bounds%endp) = obu_default + end if + end subroutine create_fv !----------------------------------------------------------------------- From f29bfb42ed99ccbbf3d9d5955721af21c2787436 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Sat, 10 Aug 2024 18:54:42 -0600 Subject: [PATCH 0873/1248] Add a couple more asserts for MassFracClayLeung which helps clarify it's behavior --- .../test_dust_soil_clay_functions.pf | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/biogeophys/test/SoilStateInitTimeConst_test/test_dust_soil_clay_functions.pf b/src/biogeophys/test/SoilStateInitTimeConst_test/test_dust_soil_clay_functions.pf index 53a3d66987..d2d458994c 100644 --- a/src/biogeophys/test/SoilStateInitTimeConst_test/test_dust_soil_clay_functions.pf +++ b/src/biogeophys/test/SoilStateInitTimeConst_test/test_dust_soil_clay_functions.pf @@ -71,8 +71,11 @@ contains value = MassFracClay( 0.0_r8 ) @assertEqual( value, 0.0_r8, tolerance=tol ) + value = MassFracClay( 10.0_r8 ) + @assertEqual( value, 0.10_r8, tolerance=tol ) value = MassFracClay( 20.0_r8 ) @assertEqual( value, 0.20_r8, tolerance=tol ) + ! value after 20% clay should stay at 0.2 value = MassFracClay( 25.0_r8 ) @assertEqual( value, 0.20_r8, tolerance=tol ) @@ -86,8 +89,11 @@ contains value = MassFracClayLeung2023( 0.0_r8 ) @assertEqual( value, 0.1_r8, tolerance=tol ) + value = MassFracClayLeung2023( 10.0_r8 ) + @assertEqual( value, 0.15_r8, tolerance=tol ) value = MassFracClayLeung2023( 20.0_r8 ) @assertEqual( value, 0.20_r8, tolerance=tol ) + ! value after 20% clay should stay at 0.2 value = MassFracClayLeung2023( 25.0_r8 ) @assertEqual( value, 0.20_r8, tolerance=tol ) From 601b090980fc1bd59f00f06f190a65b6041c00b6 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Sat, 10 Aug 2024 23:50:53 -0600 Subject: [PATCH 0874/1248] Add a test that low stabiility is constant dust emission output, change tolerance to accomidate that, use asserts rather than endrun in the test code, increase fv and obu for one of the tests --- .../DustEmis_test/test_DustEmisLeung2023.pf | 50 +++++++++++++++++-- 1 file changed, 45 insertions(+), 5 deletions(-) diff --git a/src/biogeochem/test/DustEmis_test/test_DustEmisLeung2023.pf b/src/biogeochem/test/DustEmis_test/test_DustEmisLeung2023.pf index 66f0191c06..31adea76e9 100644 --- a/src/biogeochem/test/DustEmis_test/test_DustEmisLeung2023.pf +++ b/src/biogeochem/test/DustEmis_test/test_DustEmisLeung2023.pf @@ -7,7 +7,6 @@ module test_DustEmisLeung2023 use unittestSubgridMod, only : bounds use DustEmisBase use DustEmisLeung2023 - use abortutils, only : endrun use shr_kind_mod , only : r8 => shr_kind_r8 use shr_infnan_mod, only : nan => shr_infnan_nan, assignment(=) use DustEmisFactory, only : create_dust_emissions @@ -15,7 +14,7 @@ module test_DustEmisLeung2023 implicit none - real(r8), parameter :: tol = 1.e-18_r8 + real(r8), parameter :: tol = 1.e-16_r8 @TestCase type, extends(TestCase) :: TestDustEmisLeung2023 @@ -259,7 +258,7 @@ contains real(r8) :: flx_mss_vrt_dst_tot, drag_partition, previous_dst_tot call this%input%create_atm2lnd() - call this%input%create_fv( ) + call this%input%create_fv( obu = -500.0_r8, fv=15.0_r8 ) ! Loop over twice first with nan and then with the tiny value that nan should be changed to do i = 1, 2 if ( i == 1 )then @@ -267,7 +266,7 @@ contains else if ( i == 2 ) then drag_partition = 0.001 else - call endrun( "Looping over too many iterations should just be 2" ) + @assertEqual( i, 1, "Iteration too high, should just be up to 2" ) end if call this%dust_emis%SetDragPartition(bounds, drag_partition) call this%dust_emis%DustEmission(bounds, this%input%num_nolakep, this%input%filter_nolakep, this%input%atm2lnd_inst, & @@ -287,7 +286,48 @@ contains end subroutine dust_handles_dpfct_rock_nan - !----------------------------------------------------------------------- + !----------------------------------------------------------------------- + + @Test + subroutine dust_constant_low_stability(this) + use PatchType, only : patch + ! Check that dust emissions stay constant until stability high enough + class(TestDustEmisLeung2023), intent(inout) :: this + integer :: p, i + real(r8) :: flx_mss_vrt_dst_tot, obu, previous_dst_tot + + call this%input%create_atm2lnd() + do i = 1, 3 + if ( i == 1 )then + obu = 100._r8 + else if ( i == 2 ) then + obu = 50._r8 + else if ( i == 3 ) then + obu = 41.67013917826486_r8 + else + @assertEqual( i, 1, "Iteration too high, should just be up to 3" ) + end if + call this%input%create_fv( obu=obu ) + call this%dust_emis%DustEmission(bounds, this%input%num_nolakep, this%input%filter_nolakep, this%input%atm2lnd_inst, & + this%input%soilstate_inst, this%input%canopystate_inst, this%input%water_inst%waterstatebulk_inst, & + this%input%water_inst%waterdiagnosticbulk_inst, this%input%frictionvel_inst) + do p = bounds%begp, bounds%endp + call this%dust_emis%GetPatchVars( p, flx_mss_vrt_dst_tot=flx_mss_vrt_dst_tot ) + print *, ' obu = ', obu, ' dust_tot = ', flx_mss_vrt_dst_tot + @assertEqual( flx_mss_vrt_dst_tot, 1.305341766366198d-006, tolerance=tol ) + if ( i == 1 )then + previous_dst_tot = flx_mss_vrt_dst_tot + else + ! Verify that the previous result is identical to the others + @assertEqual( flx_mss_vrt_dst_tot, previous_dst_tot, tolerance=tol ) + end if + end do + end do + + end subroutine dust_constant_low_stability + + !----------------------------------------------------------------------- + @Test subroutine dust_aborts_on_zero_obu(this) use PatchType, only : patch From 02b4f9ab051efdbaab30644d1799724b1574c233 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Sun, 11 Aug 2024 00:17:51 -0600 Subject: [PATCH 0875/1248] Change constants so they are more recognizable as floating point with a decimal, and remove subname in favor of giving line and filename with errmsg --- src/biogeochem/DustEmisLeung2023.F90 | 86 +++++++++---------- .../DustEmis_test/test_DustEmisLeung2023.pf | 10 +-- 2 files changed, 48 insertions(+), 48 deletions(-) diff --git a/src/biogeochem/DustEmisLeung2023.F90 b/src/biogeochem/DustEmisLeung2023.F90 index 4c80c3b8ca..869c18c0dc 100644 --- a/src/biogeochem/DustEmisLeung2023.F90 +++ b/src/biogeochem/DustEmisLeung2023.F90 @@ -215,87 +215,87 @@ subroutine InitHistory(this, bounds) this%dst_emiss_coeff_patch(begp:endp) = spval call hist_addfld1d (fname='DUST_EMIS_COEFF', units='dimensionless', & avgflag='A', long_name='soil erodibility or dust emission coefficient for Kok emission scheme', & - ptr_patch=this%dst_emiss_coeff_patch, set_lake=0._r8, set_urb=0._r8) + ptr_patch=this%dst_emiss_coeff_patch, set_lake=0.0_r8, set_urb=0.0_r8) this%wnd_frc_thr_patch(begp:endp) = spval call hist_addfld1d (fname='WND_FRC_FT', units='m/s', & avgflag='A', long_name='fluid threshold friction velocity', & - ptr_patch=this%wnd_frc_thr_patch, set_lake=0._r8, set_urb=0._r8) + ptr_patch=this%wnd_frc_thr_patch, set_lake=0.0_r8, set_urb=0.0_r8) this%wnd_frc_thr_dry_patch(begp:endp) = spval call hist_addfld1d (fname='WND_FRC_FT_DRY', units='m/s', & avgflag='A', long_name='dry fluid threshold friction velocity', & - ptr_patch=this%wnd_frc_thr_dry_patch, set_lake=0._r8, set_urb=0._r8) + ptr_patch=this%wnd_frc_thr_dry_patch, set_lake=0.0_r8, set_urb=0.0_r8) this%wnd_frc_thr_it_patch(begp:endp) = spval call hist_addfld1d (fname='WND_FRC_IT', units='m/s', & avgflag='A', long_name='impact threshold friction velocity', & - ptr_patch=this%wnd_frc_thr_it_patch, set_lake=0._r8, set_urb=0._r8) + ptr_patch=this%wnd_frc_thr_it_patch, set_lake=0.0_r8, set_urb=0.0_r8) this%wnd_frc_soil_patch(begp:endp) = spval call hist_addfld1d (fname='WND_FRC_SOIL', units='m/s', & avgflag='A', long_name='soil surface wind friction velocity', & - ptr_patch=this%wnd_frc_soil_patch, set_lake=0._r8, set_urb=0._r8) + ptr_patch=this%wnd_frc_soil_patch, set_lake=0.0_r8, set_urb=0.0_r8) this%lnd_frc_mble_patch(begp:endp) = spval call hist_addfld1d (fname='LND_FRC_MBLE', units='dimensionless', & avgflag='A', long_name='land mobile fraction', & - ptr_patch=this%lnd_frc_mble_patch, set_lake=0._r8, set_urb=0._r8) + ptr_patch=this%lnd_frc_mble_patch, set_lake=0.0_r8, set_urb=0.0_r8) this%gwc_patch(begp:endp) = spval call hist_addfld1d (fname='GWC', units='kg/kg', & avgflag='A', long_name='gravimetric soil moisture at the topmost soil layer', & - ptr_patch=this%gwc_patch, set_lake=0._r8, set_urb=0._r8) + ptr_patch=this%gwc_patch, set_lake=0.0_r8, set_urb=0.0_r8) this%liq_frac_patch(begp:endp) = spval call hist_addfld1d (fname='LIQ_FRAC', units='dimensionless', & avgflag='A', long_name='fraction of total water that is liquid', & - ptr_patch=this%liq_frac_patch, set_lake=0._r8, set_urb=0._r8) + ptr_patch=this%liq_frac_patch, set_lake=0.0_r8, set_urb=0.0_r8) this%u_mean_slt_patch(begp:endp) = spval call hist_addfld1d (fname='U_S_MEAN', units='m/s', & avgflag='A', long_name='mean wind velocity at saltation level', & - ptr_patch=this%u_mean_slt_patch, set_lake=0._r8, set_urb=0._r8) + ptr_patch=this%u_mean_slt_patch, set_lake=0.0_r8, set_urb=0.0_r8) this%u_sd_slt_patch(begp:endp) = spval call hist_addfld1d (fname='U_S_SIGMA', units='m/s', & avgflag='A', long_name='sd of wind velocity at saltation level', & - ptr_patch=this%u_sd_slt_patch, set_lake=0._r8, set_urb=0._r8) + ptr_patch=this%u_sd_slt_patch, set_lake=0.0_r8, set_urb=0.0_r8) this%stblty_patch(begp:endp) = spval call hist_addfld1d (fname='ZETAOBU', units='', & avgflag='A', long_name='stability parameter', & - ptr_patch=this%stblty_patch, set_lake=0._r8, set_urb=0._r8) + ptr_patch=this%stblty_patch, set_lake=0.0_r8, set_urb=0.0_r8) this%u_fld_thr_patch(begp:endp) = spval call hist_addfld1d (fname='U_FT', units='m/s', & avgflag='A', long_name='fluid threshold velocity at saltation level', & - ptr_patch=this%u_fld_thr_patch, set_lake=0._r8, set_urb=0._r8) + ptr_patch=this%u_fld_thr_patch, set_lake=0.0_r8, set_urb=0.0_r8) this%u_impct_thr_patch(begp:endp) = spval call hist_addfld1d (fname='U_IT', units='m/s', & avgflag='A', long_name='impact threshold velocity at saltation level', & - ptr_patch=this%u_impct_thr_patch, set_lake=0._r8, set_urb=0._r8) + ptr_patch=this%u_impct_thr_patch, set_lake=0.0_r8, set_urb=0.0_r8) this%thr_crs_rate_patch(begp:endp) = spval call hist_addfld1d (fname='ALPHA_TC_RATE', units='', & avgflag='A', long_name='threshold crossing rate', & - ptr_patch=this%thr_crs_rate_patch, set_lake=0._r8, set_urb=0._r8) + ptr_patch=this%thr_crs_rate_patch, set_lake=0.0_r8, set_urb=0.0_r8) this%prb_crs_fld_thr_patch(begp:endp) = spval call hist_addfld1d (fname='P_FT', units='', & avgflag='A', long_name='probability of winds crossing fluid threshold', & - ptr_patch=this%prb_crs_fld_thr_patch, set_lake=0._r8, set_urb=0._r8) + ptr_patch=this%prb_crs_fld_thr_patch, set_lake=0.0_r8, set_urb=0.0_r8) this%prb_crs_impct_thr_patch(begp:endp) = spval call hist_addfld1d (fname='P_IT', units='', & avgflag='A', long_name='probability of winds crossing impact threshold', & - ptr_patch=this%prb_crs_impct_thr_patch, set_lake=0._r8, set_urb=0._r8) + ptr_patch=this%prb_crs_impct_thr_patch, set_lake=0.0_r8, set_urb=0.0_r8) this%intrmtncy_fct_patch(begp:endp) = spval call hist_addfld1d (fname='ETA', units='', & avgflag='A', long_name='intermittency factor', & - ptr_patch=this%intrmtncy_fct_patch, set_lake=0._r8, set_urb=0._r8) + ptr_patch=this%intrmtncy_fct_patch, set_lake=0.0_r8, set_urb=0.0_r8) this%ssr_patch(begp:endp) = spval call hist_addfld1d (fname='SSR', units='m/s', & avgflag='A', long_name='Okin-Pierre vegetation shear stress ratio (drag partition factor)', & - ptr_patch=this%ssr_patch, set_lake=0._r8, set_urb=0._r8) + ptr_patch=this%ssr_patch, set_lake=0.0_r8, set_urb=0.0_r8) this%vai_Okin_patch(begp:endp) = spval call hist_addfld1d (fname='VAI_OKIN', units='m/s', & avgflag='A', long_name='vegetation area index used in the Okin-Pierre plant drag partition scheme', & - ptr_patch=this%vai_Okin_patch, set_lake=0._r8, set_urb=0._r8) + ptr_patch=this%vai_Okin_patch, set_lake=0.0_r8, set_urb=0.0_r8) this%frc_thr_rghn_fct_patch(begp:endp) = spval call hist_addfld1d (fname='FRC_THR_RGHN_FCT', units='dimensionless', & avgflag='A', long_name='hybrid drag partition (or roughness) factor', & - ptr_patch=this%frc_thr_rghn_fct_patch, set_lake=0._r8, set_urb=0._r8) + ptr_patch=this%frc_thr_rghn_fct_patch, set_lake=0.0_r8, set_urb=0.0_r8) this%wnd_frc_thr_std_patch(begp:endp) = spval call hist_addfld1d (fname='WND_FRC_FT_STD', units='m/s', & avgflag='A', long_name='standardized fluid threshold friction velocity', & - ptr_patch=this%wnd_frc_thr_std_patch, set_lake=0._r8, set_urb=0._r8) + ptr_patch=this%wnd_frc_thr_std_patch, set_lake=0.0_r8, set_urb=0.0_r8) this%dpfct_rock_patch(begp:endp) = spval call hist_addfld1d (fname='DPFCT_ROCK', units='m/s', & avgflag='A', long_name='rock drag partition factor', & @@ -414,7 +414,6 @@ subroutine DustEmission (this, bounds, & real(r8), parameter :: zii = 1000.0_r8 ! [m] convective boundary layer height added by dmleung 20 Feb 2024, following other CTSM modules (e.g., CanopyFluxesMod). Should we transfer PBL height (PBLH) from CAM? real(r8) :: numer ! Numerator term for threshold crossing rate real(r8) :: denom ! Denominator term for threshold crossing rate - character(len=*),parameter :: subname = 'DUSTEmission' !------------------------------------------------------------------------ associate( & @@ -463,7 +462,7 @@ subroutine DustEmission (this, bounds, & wnd_frc_thr_std => this%wnd_frc_thr_std_patch & ! Output: standardized dust emission threshold friction velocity defined in Jasper Kok et al. (2014). ) - ttlai(bounds%begp : bounds%endp) = 0._r8 + ttlai(bounds%begp : bounds%endp) = 0.0_r8 ! make lai average at landunit level do fp = 1,num_nolakep p = filter_nolakep(fp) @@ -471,12 +470,12 @@ subroutine DustEmission (this, bounds, & enddo tlai_lu(bounds%begl : bounds%endl) = spval - sumwt(bounds%begl : bounds%endl) = 0._r8 + sumwt(bounds%begl : bounds%endl) = 0.0_r8 do p = bounds%begp,bounds%endp - if (ttlai(p) /= spval .and. patch%active(p) .and. patch%wtlunit(p) /= 0._r8) then + if (ttlai(p) /= spval .and. patch%active(p) .and. patch%wtlunit(p) /= 0.0_r8) then c = patch%column(p) l = patch%landunit(p) - if (sumwt(l) == 0._r8) tlai_lu(l) = 0._r8 + if (sumwt(l) == 0.0_r8) tlai_lu(l) = 0.0_r8 tlai_lu(l) = tlai_lu(l) + ttlai(p) * patch%wtlunit(p) sumwt(l) = sumwt(l) + patch%wtlunit(p) end if @@ -487,19 +486,20 @@ subroutine DustEmission (this, bounds, & found = .true. index = l exit - else if (sumwt(l) /= 0._r8) then + else if (sumwt(l) /= 0.0_r8) then tlai_lu(l) = tlai_lu(l)/sumwt(l) end if end do if (found) then - write(iulog,*) subname//':: error: sumwt is greater than 1.0 at l= ',index + write(iulog,*) 'error: sumwt is greater than 1.0 at l= ',index call endrun(subgrid_index=index, subgrid_level=subgrid_level_landunit, msg=errMsg(sourcefile, __LINE__)) + return end if ! Loop through patches ! initialize variables which get passed to the atmosphere - flx_mss_vrt_dst(bounds%begp:bounds%endp,:)=0._r8 + flx_mss_vrt_dst(bounds%begp:bounds%endp,:)=0.0_r8 do fp = 1,num_nolakep p = filter_nolakep(fp) @@ -584,7 +584,7 @@ subroutine DustEmission (this, bounds, & ! calculate soil moisture effect for dust emission threshold ! following Fecan, Marticorena et al. (1999) ! also see Zender et al. (2003) for DUST emission scheme and Kok et al. (2014b) for K14 emission scheme in CESM - bd = (1._r8-watsat(c,1))*dns_slt ![kg m-3] Bulk density of dry surface soil (dmleung changed from 2700 to dns_slt, soil particle density, on 16 Feb 2024. Note that dn s_slt=2650 kg m-3 so the value is changed by a tiny bit from 2700 to 2650. dns_slt has been here for many years so dns_slt should be used here instead of explicitly typing the value out. dmleung 16 Feb 2024) + bd = (1.0_r8-watsat(c,1))*dns_slt ![kg m-3] Bulk density of dry surface soil (dmleung changed from 2700 to dns_slt, soil particle density, on 16 Feb 2024. Note that dn s_slt=2650 kg m-3 so the value is changed by a tiny bit from 2700 to 2650. dns_slt has been here for many years so dns_slt should be used here instead of explicitly typing the value out. dmleung 16 Feb 2024) ! use emission threshold to calculate standardized threshold and dust emission coefficient @@ -644,19 +644,19 @@ subroutine DustEmission (this, bounds, & if (lnd_frc_mbl(p) > 0.0_r8 .AND. tlai_lu(l)<= vai_mbl_thr) then vai_Okin(p) = tlai_lu(l)+vai0_Okin ! LAI+SAI averaged to landunit level; the equation is undefined at lai=0, and LAI in CTSM has some zeros over deserts, so we add in a small number. - if (vai_Okin(p) > 1_r8) then - vai_Okin(p) = 1_r8 ! setting LAI = 1 to be a max value (since K_length goes to negative when LAI>1) + if (vai_Okin(p) > 1.0_r8) then + vai_Okin(p) = 1.0_r8 ! setting LAI = 1 to be a max value (since K_length goes to negative when LAI>1) end if ! calculate Okin's shear stress ratio (SSR, which is vegetation drag partition factor) using Pierre's equation - K_length = 2_r8 * (1_r8/vai_Okin(p) - 1_r8) ! Here LAI has to be non-zero to avoid blowup, and < 1 to avoid -ve K_length. See this equation in Leung et al. (2023). This line is Okin's formulation + K_length = 2.0_r8 * (1.0_r8/vai_Okin(p) - 1.0_r8) ! Here LAI has to be non-zero to avoid blowup, and < 1 to avoid -ve K_length. See this equation in Leung et al. (2023). This line is Okin's formulation ssr(p) = (K_length+f_0*c_e)/(K_length+c_e) ! see this equation in Caroline Pierre et al. (2014) or Leung et al. (2023). This line is Pierre's formulation. ! calculation of the hybrid/total drag partition effect considering both rock and vegetation drag partitioning using LUH2 bare and veg fractions within a grid if (lun%itype(l) == istsoil .or. lun%itype(l) == istcrop) then if (patch%itype(p) == noveg) then ! if bare, uses rock drag partition factor - if (shr_infnan_isnan(dpfct_rock(p)) ) then ! dmleung added 24 May 2024: dpfct_rock(p) could be NaN; CLM could run when DEBUG=FALSE in env_build.xml but dies when DEBUG=TRUE (usually when checking if wnd_frc_slt > wnd_frc_thr_slt_it and if numer/denom < 30._r8 below) + if (shr_infnan_isnan(dpfct_rock(p)) ) then ! dmleung added 24 May 2024: dpfct_rock(p) could be NaN; CLM could run when DEBUG=FALSE in env_build.xml but dies when DEBUG=TRUE (usually when checking if wnd_frc_slt > wnd_frc_thr_slt_it and if numer/denom < 30 below) frc_thr_rgh_fct = 0.001_r8 ! Set drag partition effect to be a very small value (or zero) such that there is no emission whenever dpfct_rock(p) = NaN; dmleung 24 May 2024 else frc_thr_rgh_fct = dpfct_rock(p) @@ -723,8 +723,8 @@ subroutine DustEmission (this, bounds, & return end if stblty(p) = zii / obu(p) ! -dmleung 20 Feb 2024: use obu from CTSM and PBL height = zii (= 1000_r8) which is default in CTSM. Should we transfer PBL height from CAM? - if ((12_r8 - 0.5_r8 * stblty(p)) .GE. 0.001_r8) then ! should have used 0 theoretically; used 0.001 here to avoid undefined values - u_sd_slt(p) = wnd_frc_slt * (12_r8 - 0.5_r8 * stblty(p))**0.333_r8 + if ((12.0_r8 - 0.5_r8 * stblty(p)) .GE. 0.001_r8) then ! should have used 0 theoretically; used 0.001 here to avoid undefined values + u_sd_slt(p) = wnd_frc_slt * (12.0_r8 - 0.5_r8 * stblty(p))**0.333_r8 else u_sd_slt(p) = wnd_frc_slt * (0.001_r8)**0.333_r8 ! should have used 0 theoretically; used 0.001 here to avoid undefined values end if @@ -740,7 +740,7 @@ subroutine DustEmission (this, bounds, & numer = (u_fld_thr(p)**2.0_r8 - u_impct_thr(p)**2.0_r8 - 2.0_r8 * u_mean_slt(p) * (u_fld_thr(p) - u_impct_thr(p))) denom = (2.0_r8 * u_sd_slt(p)**2.0_r8) ! note that u_sd_slt should be always positive ! Truncate to zero if the expression inside exp is becoming too large - if ( numer/denom < 30._r8 ) then ! set numer/denom to be < 30 given exp(30) below is already very large; also denom itself should be non-zero and non-negative given the standard deviation (u_sd_slt) of the subtimestep wind fluctuation is non-negative. dmleung 28 May 2024 + if ( numer/denom < 30.0_r8 ) then ! set numer/denom to be < 30 given exp(30) below is already very large; also denom itself should be non-zero and non-negative given the standard deviation (u_sd_slt) of the subtimestep wind fluctuation is non-negative. dmleung 28 May 2024 thr_crs_rate(p) = (exp((u_fld_thr(p)**2.0_r8 - u_impct_thr(p)**2.0_r8 - 2.0_r8 * u_mean_slt(p) * (u_fld_thr(p) - u_impct_thr(p))) / (2.0_r8 * u_sd_slt(p)**2.0_r8)) + 1.0_r8)**(-1.0_r8) else thr_crs_rate(p) = 0.0_r8 @@ -829,20 +829,20 @@ subroutine CalcDragPartition(this, bounds) ! estimating roughness effect at a distance of 10 m following Leung et al. (2023) real(r8), parameter :: b1 = 0.7_r8 ! [dimless] first fitting coefficient for the drag partition equation by Marticorena and Bergametti (1995), later modified by Darmenova et al. (2009). real(r8), parameter :: b2 = 0.8_r8 ! [dimless] second fitting coefficient for the drag partition equation by Marticorena and Bergametti (1995), later modified by Darmenova et al. (2009). - character(len=*), parameter :: subname = 'PrigentRoughnessStream::CalcDragPartition' !--------------------------------------------------------------------- ! Make sure we've initialized the Prigent roughness streams if ( .not. this%prigent_roughness_stream%IsStreamInit() )then - call endrun(msg=subname//' ERROR: Streams have not been initialized, make sure Init is called first' & - //', and streams are on') + write(iulog,*)'Error : Prigent roughness stream is NOT on: ', errMsg(sourcefile, __LINE__) + call endrun(msg=' ERROR: Streams have not been initialized, make sure Init is called first' & + //', and streams are on') + return end if ! dmleung: this loop calculates the drag partition effect (or roughness effect) of rocks. ! We save the drag partition factor as a patch level quantity. ! TODO: EBK 02/13/2024: Several magic numbers here that should become parameters so the meaning is preserved - !z0s = 2_r8/30_r8 * D_p ! equation for smooth roughness length for soil grain. See Danny M. Leung et al. (2023) and Martina Klose et al. (2021) for instance. 1/15 is a coefficient that relates roughness to soil particle diameter D_p. - z0s = 2_r8 * D_p / 30_r8 ! equation for smooth roughness length for soil grain. See Danny M. Leung et al. (2023) and Martina Klose et al. (2021) for instance. 1/15 is a coefficient that relates roughness to soil particle diameter D_p. + z0s = 2.0_r8 * D_p / 30.0_r8 ! equation for smooth roughness length for soil grain. See Danny M. Leung et al. (2023) and Martina Klose et al. (2021) for instance. 1/15 is a coefficient that relates roughness to soil particle diameter D_p. ! Here we assume soil medium size is a global constant, and so is smooth roughness length. do p = bounds%begp,bounds%endp g = patch%gridcell(p) @@ -850,7 +850,7 @@ subroutine CalcDragPartition(this, bounds) if (lun%itype(l) /= istdlak) then ! Calculating rock drag partition factor using the Marticorena and Bergametti (1995) formulation. ! 0.01 is used to convert Prigent's roughness length dataset from centimeter to meter. - this%dpfct_rock_patch(p) = 1._r8 - ( log(this%prigent_roughness_stream%prigent_rghn(g)*0.01_r8/z0s) & + this%dpfct_rock_patch(p) = 1.0_r8 - ( log(this%prigent_roughness_stream%prigent_rghn(g)*0.01_r8/z0s) & / log(b1 * (X/z0s)**b2 ) ) end if end do diff --git a/src/biogeochem/test/DustEmis_test/test_DustEmisLeung2023.pf b/src/biogeochem/test/DustEmis_test/test_DustEmisLeung2023.pf index 31adea76e9..77e0cba4c0 100644 --- a/src/biogeochem/test/DustEmis_test/test_DustEmisLeung2023.pf +++ b/src/biogeochem/test/DustEmis_test/test_DustEmisLeung2023.pf @@ -121,7 +121,7 @@ contains @Test subroutine dust_zero_for_fixed_ratio(this) - ! Check dust emissions are zero for a no wind + ! Check dust emissions are zero for a fixed ratio class(TestDustEmisLeung2023), intent(inout) :: this integer :: p real(r8) :: flx_mss_vrt_dst_tot @@ -130,7 +130,7 @@ contains call this%input%create_atm2lnd() call this%dust_emis%GetConstVars( SaltationFactor ) - ! Figure out what fv needs to be so that the wind threshold will be u10*(1/(1-eps)) + ! Figure out what fv needs to be so that the wind threshold will result in zero dust emission fv = ( SaltationFactor / sqrt( this%input%atm2lnd_inst%forc_rho_downscaled_col(bounds%begc)) ) - 1.d-15 call this%input%create_fv( fv=fv ) call this%dust_emis%DustEmission(bounds, this%input%num_nolakep, this%input%filter_nolakep, this%input%atm2lnd_inst, & @@ -274,6 +274,7 @@ contains this%input%water_inst%waterdiagnosticbulk_inst, this%input%frictionvel_inst) do p = bounds%begp, bounds%endp call this%dust_emis%GetPatchVars( p, flx_mss_vrt_dst_tot=flx_mss_vrt_dst_tot ) + ! TODO: To have a more robust test the input should be adjusted so that there is dust emissions rather than zero @assertEqual( flx_mss_vrt_dst_tot, 0.0_r8 ) if ( i == 1 )then previous_dst_tot = flx_mss_vrt_dst_tot @@ -352,12 +353,11 @@ contains integer :: p, c real(r8) :: flx_mss_vrt_dst_tot real(r8) :: fv = 4.0_r8 - real(r8) :: u10 = 10._r8 real(r8) :: total_dust0, total_dust_higher ! Run baseline fv call this%input%create_atm2lnd() - call this%input%create_fv( u10=u10, fv=fv ) + call this%input%create_fv( fv=fv ) call this%dust_emis%DustEmission(bounds, this%input%num_nolakep, this%input%filter_nolakep, this%input%atm2lnd_inst, & this%input%soilstate_inst, this%input%canopystate_inst, this%input%water_inst%waterstatebulk_inst, & this%input%water_inst%waterdiagnosticbulk_inst, this%input%frictionvel_inst) @@ -369,7 +369,7 @@ contains @assertEqual( flx_mss_vrt_dst_tot, 1.064145664977026d-5, tolerance=tol ) end do ! Double fv and show result is higher - call this%input%create_fv( u10=u10, fv=fv*2.0_r8) + call this%input%create_fv( fv=fv*2.0_r8) call this%dust_emis%DustEmission(bounds, this%input%num_nolakep, this%input%filter_nolakep, this%input%atm2lnd_inst, & this%input%soilstate_inst, this%input%canopystate_inst, this%input%water_inst%waterstatebulk_inst, & this%input%water_inst%waterdiagnosticbulk_inst, this%input%frictionvel_inst) From 07a62b62f60c3f326c750cf477d2487d7832f04c Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Sun, 11 Aug 2024 01:50:33 -0600 Subject: [PATCH 0876/1248] Update change files --- doc/ChangeLog | 112 ++++++++++++++++++++++++++++++++++++++++++++++++++ doc/ChangeSum | 1 + 2 files changed, 113 insertions(+) diff --git a/doc/ChangeLog b/doc/ChangeLog index f5cf28096c..e166e65dad 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,4 +1,116 @@ =============================================================== +Tag name: ctsm5.2.019 +Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326) +Date: Sun 11 Aug 2024 12:31:34 AM MDT +One-line Summary: Add in an additional dust emission method Leung_2023, by default off + +Purpose and description of changes +---------------------------------- + +Author: Danny Leung +This is a scheme that builds upon a switch of CESM2's default dust emission scheme (Zender et al., 2003) to +@jfkok's more physical and less empirical one (Kok et al., 2014). This brings in additional modifications and add new aeolian +physics to the Kok's scheme, most notably, by adding the roughness effect (or called drag partition effect) which discounts surface +soil erosion by winds due to the presence of local-scale land-surface roughness elements (mostly plants and rocks). We use a hybrid +approach to account for both roughness from rocks (with a 2-D time-invariant dataset provided by Prigent et al., 2005; 2012) and +roughness from plants (time-varying, as a function of CLM's LAI). We further include the dust emission intermittency effects due to +boundary-layer turbulence. + +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_1 + +[ ] clm5_0 + +[ ] ctsm5_0-nwp + +[ ] clm4_5 + + +Bugs fixed +---------- + +List of CTSM issues fixed (include CTSM Issue # and description) [one per line]: + #1604 -- A new physically based dust emission scheme with more aeolian physics (updated) + +Notes of particular relevance for users +--------------------------------------- + +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): New namelist items + dust_emis_method can now be set to Leung_2023 + + use_prigent_roughness ---------------- Logical to use the Prigent dataset (default on when Leung_2023 is used) + stream_fldfilename_prigentroughness -- Prigent streams dataset + stream_meshile_prigentroughness ------ Mesh file for the dataset + + History field FV can now be output for any compset, but it's default off + +Changes to the datasets (e.g., parameter, surface or initial files): + New Prigent streams dataset with aeolian roughness length + +Notes of particular relevance for developers: +--------------------------------------------- + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): + Some issues will be worked on later + + #2568 -- Turn on Leung by default for clm6_0 physics + + #2381 -- Allow Prigent streams to be off in Leung_2023 dust emissions for Paleo work + (Fixing this will allow a unit-test module to be removed) + + #2680 -- prigentroughnessmapalgo is hardcoded to bilinear add it to the namelist so it can change (change name to snake-case) + + #2681 -- Add global dust variables to the DustEmisBase class that apply to both Zender and Leung dust emission methods bfb enhancement next + + #2682 -- Small function and saved constants for convective velocity code cleanup enhancement priority + +Changes to tests or testing: + New test mod that explicitly turns on Leung_2023 dust emissions: clm60cam7LndTuningModeLDust + Some of the tests with clm60cam7LndTuningMode were converted to this test mod + PF unit tester was added for Leung_2023 + + +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 - PASS + + 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 bit-for-bit (unless you turn the new dust scheme on) + +Other details +------------- + +Pull Requests that document the changes (include PR ids): +(https://github.com/ESCOMP/ctsm/pull) + #1897 -- A new physically based dust emission scheme with more aeolian physics (updated) + +=============================================================== +=============================================================== Tag name: ctsm5.2.018 Originator(s): mvdebolskiy Date: Fri 02 Aug 2024 09:26:33 AM MDT diff --git a/doc/ChangeSum b/doc/ChangeSum index 3d9d70bc54..207dd158d6 100644 --- a/doc/ChangeSum +++ b/doc/ChangeSum @@ -1,5 +1,6 @@ Tag Who Date Summary ============================================================================================================================ + ctsm5.2.019 erik 08/11/2024 Add in an additional dust emission method Leung_2023, by default off ctsm5.2.018 mvdebols 08/02/2024 Fix/excess ice cold start ctsm5.2.017 erik 07/30/2024 Dust emissions control moved to cmeps ctsm5.2.016 samrabin 07/27/2024 Enable new crop calendars for clm60 compsets From 0d17de5aeda75717a9ac969823c29e9051a49a56 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Sun, 11 Aug 2024 03:04:52 -0600 Subject: [PATCH 0877/1248] Update test number --- 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 d7c94b8538..c51b0b0cb3 100755 --- a/bld/unit_testers/build-namelist_test.pl +++ b/bld/unit_testers/build-namelist_test.pl @@ -166,7 +166,7 @@ sub cat_and_create_namelistinfile { my $ntests = 3339; if ( defined($opts{'compare'}) ) { - $ntests += 1963; + $ntests += 1999; } plan( tests=>$ntests ); From 39ecaf0ff822f7ccbd1502a5040ff0becc0e8c5b Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Sun, 11 Aug 2024 03:05:17 -0600 Subject: [PATCH 0878/1248] Update Change files --- doc/ChangeLog | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index e166e65dad..09c71a47df 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,7 +1,7 @@ =============================================================== Tag name: ctsm5.2.019 Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326) -Date: Sun 11 Aug 2024 12:31:34 AM MDT +Date: Sun 11 Aug 2024 03:05:01 AM MDT One-line Summary: Add in an additional dust emission method Leung_2023, by default off Purpose and description of changes @@ -77,7 +77,7 @@ Changes to tests or testing: New test mod that explicitly turns on Leung_2023 dust emissions: clm60cam7LndTuningModeLDust Some of the tests with clm60cam7LndTuningMode were converted to this test mod PF unit tester was added for Leung_2023 - + More work could be done in the unit-testers to exercise more of the code Testing summary: regular ---------------- @@ -86,7 +86,7 @@ Testing summary: regular build-namelist tests (if CLMBuildNamelist.pm has changed): - derecho - PASS + derecho - PASS (1002 are different) python testing (if python code has changed; see instructions in python/README.md; document testing done): From 9b1ff2430442cb153aeafc285a75fd0da042deb9 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Sun, 11 Aug 2024 03:13:38 -0600 Subject: [PATCH 0879/1248] Change default back to Zender --- bld/namelist_files/namelist_defaults_dust_emis.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bld/namelist_files/namelist_defaults_dust_emis.xml b/bld/namelist_files/namelist_defaults_dust_emis.xml index 319110cc55..40bf3d9078 100644 --- a/bld/namelist_files/namelist_defaults_dust_emis.xml +++ b/bld/namelist_files/namelist_defaults_dust_emis.xml @@ -14,7 +14,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). --> -Leung_2023 +Zender_2003 atm From b45a7fafd79b886a2582249d95f747a5998f7d78 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Sun, 11 Aug 2024 08:59:33 -0600 Subject: [PATCH 0880/1248] Remove the PEM test with CISM for LDust since it changes answers --- cime_config/testdefs/testlist_clm.xml | 9 --------- 1 file changed, 9 deletions(-) diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index f4484c7410..cd4c41f23c 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -138,15 +138,6 @@ - - - - - - - - - From 503c47f084319f216dca499f0a5a93fd44a50c1c Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Sun, 11 Aug 2024 09:02:29 -0600 Subject: [PATCH 0881/1248] Update change files --- doc/ChangeLog | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index 09c71a47df..92f4657f9d 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,7 +1,7 @@ =============================================================== Tag name: ctsm5.2.019 Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326) -Date: Sun 11 Aug 2024 03:05:01 AM MDT +Date: Sun 11 Aug 2024 09:00:43 AM MDT One-line Summary: Add in an additional dust emission method Leung_2023, by default off Purpose and description of changes @@ -101,6 +101,7 @@ Answer changes -------------- Changes answers relative to baseline: no bit-for-bit (unless you turn the new dust scheme on) + Tests with BGC change answers because fieldlists are different (FV is no longer on history files by default) Other details ------------- From ea69fffb308e4d132c184d4a5fe5e95f133d7b00 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Mon, 12 Aug 2024 08:52:34 -0600 Subject: [PATCH 0882/1248] Remove broken assign-to-project workflow. --- .github/workflows/assign-to-project.yml | 23 ----------------------- 1 file changed, 23 deletions(-) delete mode 100644 .github/workflows/assign-to-project.yml diff --git a/.github/workflows/assign-to-project.yml b/.github/workflows/assign-to-project.yml deleted file mode 100644 index 225c223bde..0000000000 --- a/.github/workflows/assign-to-project.yml +++ /dev/null @@ -1,23 +0,0 @@ -name: Auto Assign to Project(s) - -on: - issues: - types: [opened, labeled] - pull_request: - types: [opened, labeled] - issue_comment: - types: [created] - -jobs: - assign_high_priority: - runs-on: ubuntu-latest - name: Assign to High Priority project - steps: - - name: Assign issues and pull requests with priority-high label to project 25 - uses: srggrs/assign-one-project-github-action@1.3.1 - if: | - contains(github.event.issue.labels.*.name, 'priority: high') || - contains(github.event.pull_request.labels.*.name, 'priority: high') - with: - project: 'https://github.com/ESCOMP/CTSM/projects/25' - column_name: 'Needs triage' From 2797829a586b13ba9db4f7266d33e034d60c7976 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Mon, 12 Aug 2024 11:12:21 -0600 Subject: [PATCH 0883/1248] Add comment explaining dummy use of crop_inst. --- src/biogeochem/CNFireLi2014Mod.F90 | 2 +- src/biogeochem/CNFireLi2016Mod.F90 | 2 +- src/biogeochem/CNFireLi2021Mod.F90 | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/biogeochem/CNFireLi2014Mod.F90 b/src/biogeochem/CNFireLi2014Mod.F90 index a11e9d5edc..fcd27a7951 100644 --- a/src/biogeochem/CNFireLi2014Mod.F90 +++ b/src/biogeochem/CNFireLi2014Mod.F90 @@ -122,7 +122,7 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ class(soil_water_retention_curve_type), intent(in) :: soil_water_retention_curve type(cnveg_state_type) , intent(inout) :: cnveg_state_inst type(cnveg_carbonstate_type) , intent(inout) :: cnveg_carbonstate_inst - type(crop_type) , intent(in) :: crop_inst + type(crop_type) , intent(in) :: crop_inst ! Dummy argument; not used in this version of CNFireArea real(r8) , intent(in) :: totlitc_col(bounds%begc:) real(r8) , intent(in) :: decomp_cpools_vr_col(bounds%begc:,1:,1:) real(r8) , intent(in) :: t_soi17cm_col(bounds%begc:) diff --git a/src/biogeochem/CNFireLi2016Mod.F90 b/src/biogeochem/CNFireLi2016Mod.F90 index 6021901a28..955d7fe398 100644 --- a/src/biogeochem/CNFireLi2016Mod.F90 +++ b/src/biogeochem/CNFireLi2016Mod.F90 @@ -124,7 +124,7 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ class(soil_water_retention_curve_type), intent(in) :: soil_water_retention_curve type(cnveg_state_type) , intent(inout) :: cnveg_state_inst type(cnveg_carbonstate_type) , intent(inout) :: cnveg_carbonstate_inst - type(crop_type) , intent(in) :: crop_inst + type(crop_type) , intent(in) :: crop_inst ! Dummy argument; not used in this version of CNFireArea real(r8) , intent(in) :: totlitc_col(bounds%begc:) real(r8) , intent(in) :: decomp_cpools_vr_col(bounds%begc:,1:,1:) real(r8) , intent(in) :: t_soi17cm_col(bounds%begc:) diff --git a/src/biogeochem/CNFireLi2021Mod.F90 b/src/biogeochem/CNFireLi2021Mod.F90 index 74f553eb5c..6d504a1e26 100644 --- a/src/biogeochem/CNFireLi2021Mod.F90 +++ b/src/biogeochem/CNFireLi2021Mod.F90 @@ -124,7 +124,7 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ class(soil_water_retention_curve_type), intent(in) :: soil_water_retention_curve type(cnveg_state_type) , intent(inout) :: cnveg_state_inst type(cnveg_carbonstate_type) , intent(inout) :: cnveg_carbonstate_inst - type(crop_type) , intent(in) :: crop_inst + type(crop_type) , intent(in) :: crop_inst ! Dummy argument; not used in this version of CNFireArea real(r8) , intent(in) :: totlitc_col(bounds%begc:) real(r8) , intent(in) :: decomp_cpools_vr_col(bounds%begc:,1:,1:) real(r8) , intent(in) :: t_soi17cm_col(bounds%begc:) From 197ac0d5759343fdc53bd9699a30d4f0cec8983d Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Tue, 13 Aug 2024 08:10:09 -0600 Subject: [PATCH 0884/1248] update the FATES tag --- .gitmodules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitmodules b/.gitmodules index 19bc024208..4e9f5b51fb 100644 --- a/.gitmodules +++ b/.gitmodules @@ -28,7 +28,7 @@ [submodule "fates"] path = src/fates url = https://github.com/NGEET/fates -fxtag = sci.1.77.1_api.36.0.0 +fxtag = sci.1.77.2_api.36.0.0 fxrequired = AlwaysRequired # Standard Fork to compare to with "git fleximod test" to ensure personal forks aren't committed fxDONOTUSEurl = https://github.com/NCAR/fates-release From 13839f783221c6705a0ceadf3a5d382cf66d56d2 Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Tue, 13 Aug 2024 15:18:37 -0600 Subject: [PATCH 0885/1248] Updating the fates pointer to sci.1.77.2_api.36.0.0 --- src/fates | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fates b/src/fates index 1982b0032c..e372f0b6cd 160000 --- a/src/fates +++ b/src/fates @@ -1 +1 @@ -Subproject commit 1982b0032c3cab6278892eccb85f643114ffb1af +Subproject commit e372f0b6cdf46f76f888ee6ac92d9a3572464e8b From ac85dbc04426b2649387bd19fc8de56ce8565a6d Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Tue, 13 Aug 2024 15:34:13 -0600 Subject: [PATCH 0886/1248] updated changlog --- doc/ChangeLog | 68 +++++++++++++++++++++++++++++++++++++++++++++++++++ doc/ChangeSum | 1 + 2 files changed, 69 insertions(+) diff --git a/doc/ChangeLog b/doc/ChangeLog index c1f5dfaa5a..af975c9975 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,4 +1,72 @@ =============================================================== +Tag name: ctsm5.2.021 +Originator(s): rgknox (Ryan Knox,LAWRENCE BERKELEY NATIONAL LABORATORY,510-495-2153) +Date: Tue 13 Aug 2024 03:22:34 PM MDT +One-line Summary: Adding on-the-fly parameter settings for prescribed N and P in FATES + +Purpose and description of changes +---------------------------------- + +This set of changes makes it so that the FATES PRT2 test is forced to have prescribed N and P uptake in FATES. + +This allows the default to be coupled N and P, which is less confusing to new FATES-CNP users. + +The FATES tag is also updated to sci.1.77.2_api.36.0.0 which has a bug-fix for the output variable FATES_TRANSITION_MATRIX_LULU. + + +Significant changes to scientifically-supported configurations +-------------------------------------------------------------- + +Does this tag change answers significantly for any of the following physics configurations? NO + +Bugs fixed +---------- + + +List of CTSM issues fixed (include CTSM Issue # and description) [one per line]: + + +Notes of particular relevance for users +--------------------------------------- + +CLM-FATES with N and cycling is not fully coupled yet. Therefor, these changes are only relevant to the testing infrastructure. +Users are not encouraged to use fates_parteh_mode = 2 + +Notes of particular relevance for developers: +--------------------------------------------- + +Changes to tests or testing: Existing scripting that FATES has used in other tests to update parameters in certain tests, is now +being called for FatesColdPRT2 tests. This forces parameters fates_cnp_prescribed_nuptake and fates_cnp_prescribed_puptake to be 1. + + +Testing summary: +---------------- + + 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: NONE, except: + +FATES_TRANSITION_MATRIX_LULU reflects a BASELINE DIFF from a bug fix in two FATES tests. + +All other tests are B4B. + + +Other details +------------- + +FATES submodule was updated, pointing to tag sci.1.77.2_api.36.0.0 + +Pull Requests that document the changes (include PR ids): https://github.com/ESCOMP/CTSM/pull/2624 + + +=============================================================== +=============================================================== Tag name: ctsm5.2.020 Originator(s): HuiWangWanderInGitHub (Hui Wang,huiw16@uci.edu) Date: Mon 12 Aug 2024 10:51:04 AM MDT diff --git a/doc/ChangeSum b/doc/ChangeSum index d035fe4861..852ec9e838 100644 --- a/doc/ChangeSum +++ b/doc/ChangeSum @@ -1,5 +1,6 @@ Tag Who Date Summary ============================================================================================================================ + ctsm5.2.021 rgknox 08/13/2024 Adding on-the-fly parameter settings for prescribed N and P in FATES ctsm5.2.020 slevis 08/12/2024 MEGAN updates (MEGAN-CLM6) ctsm5.2.019 erik 08/11/2024 Add in an additional dust emission method Leung_2023, by default off ctsm5.2.018 mvdebols 08/02/2024 Fix/excess ice cold start From 02885d4457a2f49e1742e6a46bc6276794ff085d Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Wed, 14 Aug 2024 12:31:40 -0600 Subject: [PATCH 0887/1248] Update ChangeLog and ChangeSum. --- doc/ChangeLog | 71 +++++++++++++++++++++++++++++++++++++++++++++++++++ doc/ChangeSum | 1 + 2 files changed, 72 insertions(+) diff --git a/doc/ChangeLog b/doc/ChangeLog index af975c9975..5850069532 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,4 +1,75 @@ =============================================================== +Tag name: ctsm5.2.022 +Originator(s): samrabin (Sam Rabin, UCAR/TSS, samrabin@ucar.edu) +Date: Wed Aug 14 12:24:27 MDT 2024 +One-line Summary: Rework crop_calendars suite and cropMonthOutput + +Purpose and description of changes +---------------------------------- + +- Changes cropMonthOutput testmod so that h2 files are actually monthly instead of daily +- Changes a nag test to use debug mode (fixing a build error) and run for shorter (fixing cputime exceedance) +- Reworks RxCropCals* testmods to not include crop testmod + +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.) + +[ ] clm6_0 + +[ ] clm5_1 + +[ ] clm5_0 + +[ ] ctsm5_0-nwp + +[ ] clm4_5 + + +Bugs fixed +---------- +[Remove any lines that don't apply. Remove entire section if nothing applies.] + +List of CTSM issues fixed (include CTSM Issue # and description): +- Fixes ESCOMP/CTSM#2659: Test build failure: SMS_P128x1_Lm25.f10_f10_mg37.IHistClm60BgcCrop.izumi_nag.clm-RxCropCalsAdaptGGCMI (https://github.com/ESCOMP/CTSM/issues/2659) + + +Notes of particular relevance for developers: +--------------------------------------------- +NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide + +Changes to tests or testing: +- Changes answers to all cropMonthOutput tests due to changed h2 file frequency. Also affects frequency of one other test. + + +Testing summary: +---------------- + + [PASS means all tests PASS; OK means tests PASS other than expected fails.] + + 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: + - Only in testmods, not production runs + + +Other details +------------- + +Pull Requests that document the changes (include PR ids): +- ESCOMP/CTSM#2676: Rework crop_calendars suite and cropMonthOutput (https://github.com/ESCOMP/CTSM/pull/2676) + +=============================================================== +=============================================================== Tag name: ctsm5.2.021 Originator(s): rgknox (Ryan Knox,LAWRENCE BERKELEY NATIONAL LABORATORY,510-495-2153) Date: Tue 13 Aug 2024 03:22:34 PM MDT diff --git a/doc/ChangeSum b/doc/ChangeSum index 852ec9e838..61bf4985de 100644 --- a/doc/ChangeSum +++ b/doc/ChangeSum @@ -1,5 +1,6 @@ Tag Who Date Summary ============================================================================================================================ + ctsm5.2.022 samrabin 08/14/2024 Rework crop_calendars suite and cropMonthOutput ctsm5.2.021 rgknox 08/13/2024 Adding on-the-fly parameter settings for prescribed N and P in FATES ctsm5.2.020 slevis 08/12/2024 MEGAN updates (MEGAN-CLM6) ctsm5.2.019 erik 08/11/2024 Add in an additional dust emission method Leung_2023, by default off From 4333a66ca69d32a2f24aa81cbb9214ead5e8b763 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Wed, 14 Aug 2024 15:57:27 -0600 Subject: [PATCH 0888/1248] PPE mods from /glade/work/linnia/PPEn14trans brought to ctsm5.2.015 Bringing the diffs between branch_tags/PPE16... and branch_tags/PPE15... to b4b-dev manually --- src/biogeochem/CNFUNMod.F90 | 8 -------- src/biogeochem/CNPhenologyMod.F90 | 23 +++++++++++++---------- src/main/initVerticalMod.F90 | 11 +++++++++++ src/main/pftconMod.F90 | 11 +++++++++++ 4 files changed, 35 insertions(+), 18 deletions(-) diff --git a/src/biogeochem/CNFUNMod.F90 b/src/biogeochem/CNFUNMod.F90 index dde666c1f7..a6614fe4b9 100644 --- a/src/biogeochem/CNFUNMod.F90 +++ b/src/biogeochem/CNFUNMod.F90 @@ -53,7 +53,6 @@ module CNFUNMod public:: CNFUN ! Run FUN type, private :: params_type - real(r8) :: ndays_on ! number of days to complete leaf onset real(r8) :: ndays_off ! number of days to complete leaf offset end type params_type @@ -64,7 +63,6 @@ module CNFUNMod ! ! !PRIVATE DATA MEMBERS: real(r8) :: dt ! decomp timestep (seconds) - real(r8) :: ndays_on ! number of days to complete onset real(r8) :: ndays_off ! number of days to complete offset integer, private, parameter :: COST_METHOD = 2 !new way of doing the N uptake @@ -104,11 +102,6 @@ subroutine readParams ( ncid ) ! read in parameters - tString='ndays_on' - call ncd_io(varname=trim(tString),data=tempr, flag='read', ncid=ncid, readvar=readv) - if ( .not. readv ) call endrun( msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) - params_inst%ndays_on=tempr - tString='ndays_off' call ncd_io(varname=trim(tString),data=tempr, flag='read', ncid=ncid, readvar=readv) if ( .not. readv ) call endrun( msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) @@ -172,7 +165,6 @@ subroutine CNFUNInit (bounds,cnveg_state_inst,cnveg_carbonstate_inst,cnveg_nitro timestep_fun = real(secspday * fun_period) nstep_fun = int(secspday * dayspyr / dt) - ndays_on = params_inst%ndays_on ndays_off = params_inst%ndays_off !-------------------------------------------------------------------- diff --git a/src/biogeochem/CNPhenologyMod.F90 b/src/biogeochem/CNPhenologyMod.F90 index 9c7e5a331a..d8789eb30f 100644 --- a/src/biogeochem/CNPhenologyMod.F90 +++ b/src/biogeochem/CNPhenologyMod.F90 @@ -94,7 +94,6 @@ module CNPhenologyMod real(r8) :: crit_dayl_lat_slope ! Slope of time for critical day length with latitude (sec/deg) ! (Birch et. all 2021 it was 720 see line below) ! 15hr-11hr/(65N-45N)=linear slope = 720 min/latitude (Birch et. al 2021) - real(r8) :: ndays_on ! number of days to complete leaf onset real(r8) :: ndays_off ! number of days to complete leaf offset real(r8) :: fstor2tran ! fraction of storage to move to transfer for each onset real(r8) :: crit_onset_fdd ! critical number of freezing days to set gdd counter @@ -113,7 +112,6 @@ module CNPhenologyMod real(r8) :: dt ! time step delta t (seconds) real(r8) :: fracday ! dtime as a fraction of day real(r8) :: crit_dayl ! critical daylength for offset (seconds) - real(r8) :: ndays_on ! number of days to complete onset real(r8) :: ndays_off ! number of days to complete offset real(r8) :: fstor2tran ! fraction of storage to move to transfer on each onset real(r8) :: crit_onset_fdd ! critical number of freezing days @@ -310,7 +308,6 @@ subroutine readParams ( ncid ) call readNcdioScalar(ncid, 'crit_dayl', subname, params_inst%crit_dayl) call readNcdioScalar(ncid, 'crit_dayl_at_high_lat', subname, params_inst%crit_dayl_at_high_lat) call readNcdioScalar(ncid, 'crit_dayl_lat_slope', subname, params_inst%crit_dayl_lat_slope) - call readNcdioScalar(ncid, 'ndays_on', subname, params_inst%ndays_on) call readNcdioScalar(ncid, 'ndays_off', subname, params_inst%ndays_off) call readNcdioScalar(ncid, 'fstor2tran', subname, params_inst%fstor2tran) call readNcdioScalar(ncid, 'crit_onset_fdd', subname, params_inst%crit_onset_fdd) @@ -471,7 +468,6 @@ subroutine CNPhenologyInit(bounds) crit_dayl=params_inst%crit_dayl ! Set constants for CNSeasonDecidPhenology and CNStressDecidPhenology - ndays_on=params_inst%ndays_on ndays_off=params_inst%ndays_off ! set transfer parameters @@ -882,6 +878,8 @@ subroutine CNSeasonDecidPhenology (num_soilp, filter_soilp , & woody => pftcon%woody , & ! Input: binary flag for woody lifeform (1=woody, 0=not woody) season_decid => pftcon%season_decid , & ! Input: binary flag for seasonal-deciduous leaf habit (0 or 1) season_decid_temperate => pftcon%season_decid_temperate , & ! Input: binary flag for seasonal-deciduous temperate leaf habit (0 or 1) + crit_onset_gdd_sf => pftcon%crit_onset_gdd_sf , & ! Input: scale factor for crit_onset_gdd (unitless) + ndays_on => pftcon%ndays_on , & ! Input: number of days to complete leaf onset (days t_soisno => temperature_inst%t_soisno_col , & ! Input: [real(r8) (:,:) ] soil temperature (Kelvin) (-nlevsno+1:nlevgrnd) soila10 => temperature_inst%soila10_col , & ! Input: [real(r8) (:) ] @@ -1016,7 +1014,8 @@ subroutine CNSeasonDecidPhenology (num_soilp, filter_soilp , & lgsf(p) = 0._r8 ! onset gdd sum from Biome-BGC, v4.1.2 - crit_onset_gdd = exp(4.8_r8 + 0.13_r8*(annavg_t2m(p) - SHR_CONST_TKFRZ)) + crit_onset_gdd = crit_onset_gdd_sf(ivt(p)) * exp(4.8_r8 + 0.13_r8*(annavg_t2m(p) & + - SHR_CONST_TKFRZ)) ! set flag for solstice period (winter->summer = 1, summer->winter = 0) if (dayl(g) >= prev_dayl(g)) then @@ -1109,7 +1108,8 @@ subroutine CNSeasonDecidPhenology (num_soilp, filter_soilp , & onset_gddflag(p) = 0.0_r8 onset_gdd(p) = 0.0_r8 do_onset = .false. - onset_counter(p) = ndays_on * secspday + onset_counter(p) = ndays_on(ivt(p)) * secspday + ! move all the storage pools into transfer pools, ! where they will be transfered to displayed growth over the onset period. @@ -1399,7 +1399,10 @@ subroutine CNStressDecidPhenology (num_soilp, filter_soilp , & stress_decid => pftcon%stress_decid , & ! Input: binary flag for stress-deciduous leaf habit (0 or 1) leafcn => pftcon%leafcn , & ! Input: leaf C:N (gC/gN) frootcn => pftcon%frootcn , & ! Input: fine root C:N (gC/gN) - + + crit_onset_gdd_sf => pftcon%crit_onset_gdd_sf , & ! Input: scale factor for crit_onset_gdd (unitless) + ndays_on => pftcon%ndays_on , & ! Input: number of days to complete leaf onset (days) + soilpsi => soilstate_inst%soilpsi_col , & ! Input: [real(r8) (:,:) ] soil water potential in each soil layer (MPa) t_soisno => temperature_inst%t_soisno_col , & ! Input: [real(r8) (:,:) ] soil temperature (Kelvin) (-nlevsno+1:nlevgrnd) @@ -1532,8 +1535,8 @@ subroutine CNStressDecidPhenology (num_soilp, filter_soilp , & psi = soilpsi(c, phenology_soil_layer) ! onset gdd sum from Biome-BGC, v4.1.2 - crit_onset_gdd = exp(4.8_r8 + 0.13_r8*(annavg_t2m(p) - SHR_CONST_TKFRZ)) - + crit_onset_gdd = crit_onset_gdd_sf(ivt(p)) * exp(4.8_r8 + 0.13_r8*(annavg_t2m(p) & + - SHR_CONST_TKFRZ)) ! update offset_counter and test for the end of the offset period if (offset_flag(p) == 1._r8) then @@ -1673,7 +1676,7 @@ subroutine CNStressDecidPhenology (num_soilp, filter_soilp , & onset_fdd(p) = 0._r8 onset_gdd(p) = 0._r8 onset_swi(p) = 0._r8 - onset_counter(p) = ndays_on * secspday + onset_counter(p) = ndays_on(ivt(p)) * secspday ! call subroutine to move all the storage pools into transfer pools, ! where they will be transfered to displayed growth over the onset period. diff --git a/src/main/initVerticalMod.F90 b/src/main/initVerticalMod.F90 index b91c3439aa..64383e7a7c 100644 --- a/src/main/initVerticalMod.F90 +++ b/src/main/initVerticalMod.F90 @@ -47,6 +47,8 @@ module initVerticalMod type, private :: params_type real(r8) :: slopebeta ! exponent for microtopography pdf sigma (unitless) real(r8) :: slopemax ! max topographic slope for microtopography pdf sigma (unitless) + real(r8) :: zbedrock ! parameter to substitute for zbedrock (m) + real(r8) :: zbedrock_sf ! parameter to scale zbedrock (m) end type params_type type(params_type), private :: params_inst ! @@ -79,6 +81,9 @@ subroutine readParams( ncid ) ! Max topographic slope for microtopography pdf sigma (unitless) call readNcdioScalar(ncid, 'slopemax', subname, params_inst%slopemax) + call readNcdioScalar(ncid, 'zbedrock', subname, params_inst%zbedrock) + call readNcdioScalar(ncid, 'zbedrock_sf', subname, params_inst%zbedrock_sf) + end subroutine readParams !------------------------------------------------------------------------ @@ -447,6 +452,12 @@ subroutine initVertical(bounds, glc_behavior, thick_wall, thick_roof) call endrun( 'ERROR:: zbedrock not found on surface data set, and use_bedrock is true.'//errmsg(sourcefile, __LINE__) ) end if end if + if (params_inst%zbedrock>=0._r8) then + zbedrock_in(:) = params_inst%zbedrock + end if + if (params_inst%zbedrock_sf/=1._r8) then + zbedrock_in(:) = params_inst%zbedrock_sf*zbedrock_in(:) + end if ! if use_bedrock = false, set zbedrock to lowest layer bottom interface else diff --git a/src/main/pftconMod.F90 b/src/main/pftconMod.F90 index 7988b57e75..b987879c03 100644 --- a/src/main/pftconMod.F90 +++ b/src/main/pftconMod.F90 @@ -162,6 +162,8 @@ module pftconMod real(r8), allocatable :: taper (:) ! tapering ratio of height:radius_breast_height real(r8), allocatable :: rstem_per_dbh (:) ! stem resistance per dbh (s/m/m) real(r8), allocatable :: wood_density (:) ! wood density (kg/m3) + real(r8), allocatable :: crit_onset_gdd_sf(:)! scale factor for crit_onset_gdd + real(r8), allocatable :: ndays_on(:) ! number of days to complete leaf onset ! crop @@ -502,6 +504,8 @@ subroutine InitAllocate (this) allocate( this%taper (0:mxpft) ) allocate( this%rstem_per_dbh (0:mxpft) ) allocate( this%wood_density (0:mxpft) ) + allocate( this%crit_onset_gdd_sf (0:mxpft) ) + allocate( this%ndays_on (0:mxpft) ) end subroutine InitAllocate @@ -843,6 +847,11 @@ subroutine InitRead(this) call ncd_io('season_decid_temperate', this%season_decid_temperate, 'read', ncid, readvar=readv, posNOTonfile=.true.) if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) + call ncd_io('crit_onset_gdd_sf', this%crit_onset_gdd_sf, 'read', ncid, readvar=readv, posNOTonfile=.true.) + if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) + + call ncd_io('ndays_on', this%ndays_on, 'read', ncid, readvar=readv, posNOTonfile=.true.) + if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) call ncd_io('pftpar20', this%pftpar20, 'read', ncid, readvar=readv, posNOTonfile=.true.) if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) @@ -1585,6 +1594,8 @@ subroutine Clean(this) deallocate( this%rstem_per_dbh) deallocate( this%wood_density) deallocate( this%taper) + deallocate( this%crit_onset_gdd_sf) + deallocate( this%ndays_on) end subroutine Clean end module pftconMod From 7d8d0f6e2b47de2c0cb7a989942c995481a9c775 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 14 Aug 2024 17:35:00 -0600 Subject: [PATCH 0889/1248] Add failing tests for running with dust set by CAM so LND_SETS_DUST_EMIS_DRV_FLDS is FALSE --- bld/unit_testers/build-namelist_test.pl | 29 +++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/bld/unit_testers/build-namelist_test.pl b/bld/unit_testers/build-namelist_test.pl index c51b0b0cb3..28e6084f0e 100755 --- a/bld/unit_testers/build-namelist_test.pl +++ b/bld/unit_testers/build-namelist_test.pl @@ -447,7 +447,32 @@ sub cat_and_create_namelistinfile { &cleanup(); } } - +print "\n===============================================================================\n"; +print "Test setting drv_flds_in fields in CAM"; +print "=================================================================================\n"; +foreach my $phys ( "clm5_0", "clm6_0" ) { + $mode = "-phys $phys CAM_SETS_DRV_FLDS"; + &make_config_cache($phys); + foreach my $options ( + "--res 1.9x2.5 --mask gx1v7 --bgc sp --no-megan --use_case 20thC_transient --namelist '&a start_ymd=19790101/' --lnd_tuning_mode ${phys}_cam6.0", + "--res 1.9x2.5 --mask gx1v7 --bgc sp --no-megan --use_case 20thC_transient --namelist '&a start_ymd=19790101/' --lnd_tuning_mode ${phys}_cam7.0", + ) { + &make_env_run( 'LND_SETS_DUST_EMIS_DRV_FLDS'=>"FALSE" ); + 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(); + } +} print "\n==============================================================\n"; print "Test several use_cases and specific configurations for clm5_0\n"; print "==============================================================\n"; @@ -518,7 +543,7 @@ sub cat_and_create_namelistinfile { phys=>"clm4_5", }, "LeungDust_WO_Prigent" =>{ options=>" -envxml_dir . -bgc sp", - namelst=>"use_prigent_roughness=.false.", + namelst=>"use_prigent_roughness=.true.", phys=>"clm5_1", }, "soilm_stream off w file" =>{ options=>"-res 0.9x1.25 -envxml_dir .", From a590ca7e57c965e1cfc46779cb5c6f1dc34bfb27 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Thu, 15 Aug 2024 01:59:10 -0600 Subject: [PATCH 0890/1248] When LND_SETS_DUST_EMIS_DRV_FLDS is FALSE read in CAM drv_flds_in namelist to use to determine dust_emis settings, still check that they aren't set in the user_nl_clm file --- bld/CLMBuildNamelist.pm | 51 +++++++++++++++---------- bld/unit_testers/build-namelist_test.pl | 4 +- bld/unit_testers/empty_user_nl_clm | 1 + 3 files changed, 33 insertions(+), 23 deletions(-) create mode 100644 bld/unit_testers/empty_user_nl_clm diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index b99be288e7..daf4320c18 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -1470,6 +1470,32 @@ sub process_namelist_commandline_namelist { } } +sub process_namelist_infile { + my ($definition, $nl, $envxml_ref, $infile) = @_; + + # Make sure a valid file was found + if ( -f "$infile" ) { + # Otherwise abort as a valid file doesn't exist + } else { + $log->fatal_error("input namelist file does NOT exist $infile.\n $@"); + } + # Parse namelist input from the next file + my $nl_infile = Build::Namelist->new($infile); + + # Validate input namelist -- trap exceptions + my $nl_infile_valid; + eval { $nl_infile_valid = $definition->validate($nl_infile); }; + if ($@) { + $log->fatal_error("Invalid namelist variable in '-infile' $infile.\n $@"); + } + # Go through all variables and expand any XML env settings in them + expand_xml_variables_in_namelist( $nl_infile_valid, $envxml_ref ); + + # Merge input values into namelist. Previously specified values have higher precedence + # and are not overwritten. + $nl->merge_nl($nl_infile_valid); +} + #------------------------------------------------------------------------------- sub process_namelist_commandline_infile { @@ -1479,27 +1505,7 @@ sub process_namelist_commandline_infile { if (defined $opts->{'infile'}) { my @infiles = split( /,/, $opts->{'infile'} ); foreach my $infile ( @infiles ) { - # Make sure a valid file was found - if ( -f "$infile" ) { - # Otherwise abort as a valid file doesn't exist - } else { - $log->fatal_error("input namelist file does NOT exist $infile.\n $@"); - } - # Parse namelist input from the next file - my $nl_infile = Build::Namelist->new($infile); - - # Validate input namelist -- trap exceptions - my $nl_infile_valid; - eval { $nl_infile_valid = $definition->validate($nl_infile); }; - if ($@) { - $log->fatal_error("Invalid namelist variable in '-infile' $infile.\n $@"); - } - # Go through all variables and expand any XML env settings in them - expand_xml_variables_in_namelist( $nl_infile_valid, $envxml_ref ); - - # Merge input values into namelist. Previously specified values have higher precedence - # and are not overwritten. - $nl->merge_nl($nl_infile_valid); + process_namelist_infile( $definition, $nl, $envxml_ref, $infile ); } } } @@ -4086,6 +4092,9 @@ sub setup_logic_dust_emis { " connected to CAM as CAM should set them"); } } + # Now process the CAM drv_flds_in to get the dust settings + my $infile = $opts->{'envxml_dir'} . "/Buildconf/camconf/drv_flds_in"; + process_namelist_infile( $definition, $nl, $envxml_ref, $infile ); } } diff --git a/bld/unit_testers/build-namelist_test.pl b/bld/unit_testers/build-namelist_test.pl index 28e6084f0e..1b54f29d92 100755 --- a/bld/unit_testers/build-namelist_test.pl +++ b/bld/unit_testers/build-namelist_test.pl @@ -454,8 +454,8 @@ sub cat_and_create_namelistinfile { $mode = "-phys $phys CAM_SETS_DRV_FLDS"; &make_config_cache($phys); foreach my $options ( - "--res 1.9x2.5 --mask gx1v7 --bgc sp --no-megan --use_case 20thC_transient --namelist '&a start_ymd=19790101/' --lnd_tuning_mode ${phys}_cam6.0", - "--res 1.9x2.5 --mask gx1v7 --bgc sp --no-megan --use_case 20thC_transient --namelist '&a start_ymd=19790101/' --lnd_tuning_mode ${phys}_cam7.0", + "--res 1.9x2.5 --mask gx1v7 --bgc sp --no-megan --use_case 20thC_transient --namelist '&a start_ymd=19790101/' --lnd_tuning_mode ${phys}_cam6.0 --infile empty_user_nl_clm", + "--res 1.9x2.5 --mask gx1v7 --bgc sp --no-megan --use_case 20thC_transient --namelist '&a start_ymd=19790101/' --lnd_tuning_mode ${phys}_cam7.0 --infile empty_user_nl_clm", ) { &make_env_run( 'LND_SETS_DUST_EMIS_DRV_FLDS'=>"FALSE" ); eval{ system( "$bldnml --envxml_dir . $options > $tempfile 2>&1 " ); }; diff --git a/bld/unit_testers/empty_user_nl_clm b/bld/unit_testers/empty_user_nl_clm new file mode 100644 index 0000000000..45fda13d2c --- /dev/null +++ b/bld/unit_testers/empty_user_nl_clm @@ -0,0 +1 @@ +! empty user_nl_clm file From 85e3124813c808a75390faf6e0be3339c1bb37ff Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Thu, 15 Aug 2024 08:28:38 -0600 Subject: [PATCH 0891/1248] updating fates default parameter file to api 36.1 --- bld/namelist_files/namelist_defaults_ctsm.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index c4c056195d..ad39edc69e 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -513,7 +513,8 @@ attributes from the config_cache.xml file (with keys converted to upper-case). -lnd/clm2/paramdata/fates_params_api.36.0.0_12pft_c240517.nc +lnd/clm2/paramdata/fates_params_api.36.1.0_12pft_c240814.nc + From 648d0c4d2b607e7e470a7083a51662325045dc2b Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Thu, 15 Aug 2024 10:09:36 -0600 Subject: [PATCH 0892/1248] One-line fix for build to complete --- src/biogeochem/CNPhenologyMod.F90 | 1 - 1 file changed, 1 deletion(-) diff --git a/src/biogeochem/CNPhenologyMod.F90 b/src/biogeochem/CNPhenologyMod.F90 index d8789eb30f..8108876586 100644 --- a/src/biogeochem/CNPhenologyMod.F90 +++ b/src/biogeochem/CNPhenologyMod.F90 @@ -274,7 +274,6 @@ subroutine CNPhenologySetParams( ) params_inst%crit_dayl = 39200._r8 ! Seconds params_inst%crit_dayl_at_high_lat = 54000._r8 ! Seconds params_inst%crit_dayl_lat_slope = 720._r8 ! Seconds / degree - params_inst%ndays_on = 15._r8 ! Days params_inst%ndays_off = 30._r8 ! Days params_inst%fstor2tran = 0.5 ! Fraction params_inst%crit_onset_fdd = 15._r8 ! Days From 2ee88b8f8cc618c1f75d7fc3a1cc05be3e2bfbd0 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Thu, 15 Aug 2024 10:12:14 -0600 Subject: [PATCH 0893/1248] Update default param file names in namelists --- bld/namelist_files/namelist_defaults_ctsm.xml | 8 ++++---- .../clm/clm60_monthly_matrixcn_soilCN30/user_nl_clm | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index 97620c770d..7f6305087c 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -504,10 +504,10 @@ attributes from the config_cache.xml file (with keys converted to upper-case). -lnd/clm2/paramdata/ctsm60_params.c240208.nc -lnd/clm2/paramdata/ctsm51_params.c240208.nc -lnd/clm2/paramdata/clm50_params.c240208.nc -lnd/clm2/paramdata/clm45_params.c240208.nc +lnd/clm2/paramdata/ctsm60_params.c240814.nc +lnd/clm2/paramdata/ctsm51_params.c240814.nc +lnd/clm2/paramdata/clm50_params.c240814.nc +lnd/clm2/paramdata/clm45_params.c240814.nc diff --git a/cime_config/testdefs/testmods_dirs/clm/clm60_monthly_matrixcn_soilCN30/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/clm60_monthly_matrixcn_soilCN30/user_nl_clm index df20ced9e8..4bfc0520f8 100644 --- a/cime_config/testdefs/testmods_dirs/clm/clm60_monthly_matrixcn_soilCN30/user_nl_clm +++ b/cime_config/testdefs/testmods_dirs/clm/clm60_monthly_matrixcn_soilCN30/user_nl_clm @@ -1,2 +1,2 @@ use_soil_matrixcn = .true. -paramfile = '$DIN_LOC_ROOT/lnd/clm2/paramdata/ctsm60_params_cn30.c240625.nc' +paramfile = '$DIN_LOC_ROOT/lnd/clm2/paramdata/ctsm60_params_cn30.c240814.nc' From 733cf9918178fc89a1c6ee2c34447160e5e944fb Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Thu, 15 Aug 2024 15:20:33 -0600 Subject: [PATCH 0894/1248] Add missing cmeps drv_flds_in variables fixing #2170 --- .../namelist_definition_drv_flds.xml | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/bld/namelist_files/namelist_definition_drv_flds.xml b/bld/namelist_files/namelist_definition_drv_flds.xml index 89bab07f4f..9bb1a3e3b0 100644 --- a/bld/namelist_files/namelist_definition_drv_flds.xml +++ b/bld/namelist_files/namelist_definition_drv_flds.xml @@ -123,6 +123,10 @@ List of fluxes needed by the CARMA model, from CLM to CAM. + + + + Which dust emission method is going to be used. Either the Zender 2003 scheme or the Leung 2023 scheme. @@ -136,4 +140,27 @@ (only used when dust_emis_method is Zender_2003) + + + + + + Frequency of surface ozone field passed from CAM to surface components. + Surface ozone is passed every coupling interval, but this namelist flag + indicates whether the timestep-level values are interpolated from a + coarser temporal resolution. + Default: set by CAM + + + + + + + + If TRUE atmosphere model will provide prognosed lightning flash frequency. + (NOTE: NOT CONNECTED INTO CTSM YET) + + From 25a0c7a8b0ebbc191d9645b3235867401863be9a Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Thu, 15 Aug 2024 15:24:34 -0600 Subject: [PATCH 0895/1248] New GlacierRegion dataset Same as mksrf_GlacierRegion_10x10min_nomask_cd5_c220131.nc but with GLACIER_REGION=1 (Points outside Greenland itself but which might become ice-covered in an evolving Greenland simulation) merged into GLACIER_REGION 0, then 2 changed to 1 and 3 changed to 2. We are removing the old GLACIER_REGION=1 even though this means we cannot generate SMB in areas outside the initial CISM Greenland ice mask, because it created problematic non-physical behavior. See https://github.com/ESCOMP/CTSM/issues/423 for details. --- 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 dde824e02c..3cb168e8fb 100644 --- a/tools/mksurfdata_esmf/gen_mksurfdata_namelist.xml +++ b/tools/mksurfdata_esmf/gen_mksurfdata_namelist.xml @@ -140,7 +140,7 @@ version of the raw dataset will probably go away. - lnd/clm2/rawdata/mksrf_GlacierRegion_10x10min_nomask_cd5_c220131.nc + lnd/clm2/rawdata/mksrf_GlacierRegion_10x10min_nomask_cd5_c240815.nc lnd/clm2/mappingdata/grids/UNSTRUCTgrid_10x10min_nomask_cdf5_c200129.nc From 3f3541b37b7ff9abe37050c98575b61b3702e688 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Thu, 15 Aug 2024 15:41:00 -0600 Subject: [PATCH 0896/1248] Current drv_flds_in file from CAM for a FHIST case, including some fields that weren't being set in CLM --- bld/unit_testers/Buildconf/camconf/drv_flds_in | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 bld/unit_testers/Buildconf/camconf/drv_flds_in diff --git a/bld/unit_testers/Buildconf/camconf/drv_flds_in b/bld/unit_testers/Buildconf/camconf/drv_flds_in new file mode 100644 index 0000000000..e8e95ad369 --- /dev/null +++ b/bld/unit_testers/Buildconf/camconf/drv_flds_in @@ -0,0 +1,13 @@ +&drydep_inparm + dep_data_file = '/glade/campaign/cesm/cesmdata/inputdata/atm/cam/chem/trop_mozart/dvel/dep_data_c20221208.nc' +/ +&dust_emis_inparm + dust_emis_method = 'Zender_2003' + zender_soil_erod_source = 'atm' +/ +&lightning_coupling_nl + atm_provides_lightning = .true. +/ +&ozone_coupling_nl + atm_ozone_frequency = 'multiday_average' +/ From 6268e5907d7563d350fba6f7bb79b0bae3e6344d Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Fri, 16 Aug 2024 09:55:02 -0600 Subject: [PATCH 0897/1248] Add megan and drydep settings as per a cam6_4_015 SMS_Ln9.f19_f19_mg17.FHIST.derecho_intel.cam-outfrq9s test --- bld/unit_testers/Buildconf/camconf/drv_flds_in | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/bld/unit_testers/Buildconf/camconf/drv_flds_in b/bld/unit_testers/Buildconf/camconf/drv_flds_in index e8e95ad369..c551ccacf5 100644 --- a/bld/unit_testers/Buildconf/camconf/drv_flds_in +++ b/bld/unit_testers/Buildconf/camconf/drv_flds_in @@ -1,5 +1,16 @@ &drydep_inparm - dep_data_file = '/glade/campaign/cesm/cesmdata/inputdata/atm/cam/chem/trop_mozart/dvel/dep_data_c20221208.nc' + dep_data_file = '/glade/campaign/cesm/cesmdata/inputdata/atm/cam/chem/trop_mozart/dvel/dep_data_c20221208.nc' + drydep_list = 'DMS','H2O2','H2SO4','SO2','SOAG' +/ +&megan_emis_nl + megan_factors_file = '/glade/campaign/cesm/cesmdata/inputdata/atm/cam/chem/trop_mozart/emis/megan21_emis_factors_78pft_c20161108.nc' + megan_mapped_emisfctrs = .false. + megan_specifier = 'SOAE = 0.5954*isoprene + 5.1004*(carene_3 + pinene_a + thujene_a + bornene +', ' terpineol_4 + terpineol_a + terpinyl_ACT_a + myrtenal + sabinene + pinene_b + camphene +', + ' fenchene_a + limonene + phellandrene_a + terpinene_a + terpinene_g + terpinolene +', ' phellandrene_b + linalool + ionone_b + geranyl_acetone + neryl_acetone + jasmone +', + ' verbenene + ipsenol + myrcene + ocimene_t_b + ocimene_al + ocimene_c_b + 2met_nonatriene) + ', ' 12.3942*(farnescene_a + caryophyllene_b + acoradiene + aromadendrene + bergamotene_a +', + ' bergamotene_b + bisabolene_a + bisabolene_b + bourbonene_b + cadinene_d + cadinene_g +', ' cedrene_a + copaene_a + cubebene_a + cubebene_b + elemene_b + farnescene_b +', + ' germacrene_B + germacrene_D + gurjunene_b + humulene_a + humulene_g + isolongifolene +', ' longifolene + longipinene + muurolene_a + muurolene_g + selinene_b + selinene_d +', + ' nerolidol_c + nerolidol_t)' / &dust_emis_inparm dust_emis_method = 'Zender_2003' From 4f56ffcbbdd1d841de9edf5f67e625428282073d Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Fri, 16 Aug 2024 11:09:17 -0600 Subject: [PATCH 0898/1248] Update ChangeLog and ChangeSum. --- doc/ChangeLog | 75 +++++++++++++++++++++++++++++++++++++++++++++++++++ doc/ChangeSum | 1 + 2 files changed, 76 insertions(+) diff --git a/doc/ChangeLog b/doc/ChangeLog index 5850069532..7a6d764c14 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,4 +1,79 @@ =============================================================== +Tag name: ctsm5.2.023 +Originator(s): samrabin (Sam Rabin, UCAR/TSS, samrabin@ucar.edu) +Date: Fri Aug 16 11:00:32 MDT 2024 +One-line Summary: Merge b4b-dev + +Purpose and description of changes +---------------------------------- + +Brings in 3 PRs from b4b-dev to master: +- Always check finidat_interp_dest.status (ESCOMP/CTSM#2679; Sam Rabin) +- Remove broken assign-to-project Github workflow (ESCOMP/CTSM#2683; Sam Rabin) +- [Fang summer '24 PR 1.1] Fix bugs and develop crop fire modeling (ESCOMP/CTSM#2684; Fang Li and Sam Rabin) + + +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.) + +[ ] clm6_0 + +[ ] clm5_1 + +[ ] clm5_0 + +[ ] ctsm5_0-nwp + +[ ] clm4_5 + + +Bugs fixed +---------- + +List of CTSM issues fixed: +- Resolves ESCOMP/CTSM#2562: Fix or disable "Assign to High Priority project" workflow +- Resolves ESCOMP/CTSM#2566: bug in crop fire modeling +- Resolves ESCOMP/CTSM#2596: Check of finidat_interp_dest.status isn't reached + +Notes of particular relevance for users +--------------------------------------- + +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): +- Adds new fire_method option li2024gswpfrc; default hasn't changed. + + +Notes of particular relevance for developers: +--------------------------------------------- +NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide + +Changes to tests or testing: Adds 4 tests: +- SMS_D_Ld65.f10_f10_mg37.I2000Clm50BgcCru.derecho_gnu.clm-FireLi2016Cru +- SMS_D_Ld65.f10_f10_mg37.I2000Clm45BgcCropQianRs.derecho_intel.clm-FireLi2014Qian +- SMS_D_Ld65.f10_f10_mg37.I2000Clm50BgcCrop.izumi_intel.clm-FireLi2021GSWP +- SMS_D_Ld65.f10_f10_mg37.I2000Clm60BgcCrop.izumi_nag.clm-FireLi2024GSWP + +Testing summary: +---------------- + + regular tests (aux_clm: https://github.com/ESCOMP/CTSM/wiki/System-Testing-Guide#pre-merge-system-testing): + + derecho ----- OK + izumi ------- OK + +Other details +------------- + +Pull Requests that document the changes: +- Always check finidat_interp_dest.status (ESCOMP/CTSM#2679; Sam Rabin): https://github.com/ESCOMP/CTSM/pull/2679 +- Remove broken assign-to-project Github workflow (ESCOMP/CTSM#2683; Sam Rabin): https://github.com/ESCOMP/CTSM/pull/2683 +- [Fang summer '24 PR 1.1] Fix bugs and develop crop fire modeling (ESCOMP/CTSM#2684; Fang Li and Sam Rabin): https://github.com/ESCOMP/CTSM/pull/2684 + + +=============================================================== +=============================================================== Tag name: ctsm5.2.022 Originator(s): samrabin (Sam Rabin, UCAR/TSS, samrabin@ucar.edu) Date: Wed Aug 14 12:24:27 MDT 2024 diff --git a/doc/ChangeSum b/doc/ChangeSum index 61bf4985de..176ac066d2 100644 --- a/doc/ChangeSum +++ b/doc/ChangeSum @@ -1,5 +1,6 @@ Tag Who Date Summary ============================================================================================================================ + ctsm5.2.023 samrabin 08/16/2024 Merge b4b-dev ctsm5.2.022 samrabin 08/14/2024 Rework crop_calendars suite and cropMonthOutput ctsm5.2.021 rgknox 08/13/2024 Adding on-the-fly parameter settings for prescribed N and P in FATES ctsm5.2.020 slevis 08/12/2024 MEGAN updates (MEGAN-CLM6) From 6b0b655c7fe46ad73d61e1f1acf6cbd4581f1483 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Fri, 16 Aug 2024 14:01:49 -0600 Subject: [PATCH 0899/1248] Improve peat burning dependence on climate. --- src/biogeochem/CNFireLi2024Mod.F90 | 26 +++++++++++-------------- src/biogeophys/Wateratm2lndBulkType.F90 | 20 +++++++++++++++++++ 2 files changed, 31 insertions(+), 15 deletions(-) diff --git a/src/biogeochem/CNFireLi2024Mod.F90 b/src/biogeochem/CNFireLi2024Mod.F90 index 503ed28488..5f1c88811f 100644 --- a/src/biogeochem/CNFireLi2024Mod.F90 +++ b/src/biogeochem/CNFireLi2024Mod.F90 @@ -151,11 +151,9 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ real(r8) :: afuel !weight for arh and arh30 real(r8) :: btran_col(bounds%begc:bounds%endc) logical :: transient_landcover ! whether this run has any prescribed transient landcover - real(r8), target :: prec60_col_target(bounds%begc:bounds%endc) - real(r8), target :: prec10_col_target(bounds%begc:bounds%endc) + real(r8), target :: prec30_col_target(bounds%begc:bounds%endc) real(r8), target :: rh30_col_target(bounds%begc:bounds%endc) - real(r8), pointer :: prec60_col(:) - real(r8), pointer :: prec10_col(:) + real(r8), pointer :: prec30_col(:) real(r8), pointer :: rh30_col(:) !----------------------------------------------------------------------- @@ -194,8 +192,7 @@ 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 - prec60 => wateratm2lndbulk_inst%prec60_patch , & ! Input: [real(r8) (:) ] 60-day running mean of tot. precipitation - prec10 => wateratm2lndbulk_inst%prec10_patch , & ! Input: [real(r8) (:) ] 10-day running mean of tot. precipitation + prec30 => wateratm2lndbulk_inst%prec30_patch , & rh30 => wateratm2lndbulk_inst%rh30_patch , & ! Input: [real(r8) (:) ] 10-day running mean of tot. precipitation 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 @@ -246,15 +243,11 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ transient_landcover = run_has_transient_landcover() !pft to column average - prec10_col =>prec10_col_target + prec30_col =>prec30_col_target call p2c(bounds, num_soilc, filter_soilc, & - prec10(bounds%begp:bounds%endp), & - prec10_col(bounds%begc:bounds%endc)) + prec30(bounds%begp:bounds%endp), & + prec30_col(bounds%begc:bounds%endc)) - prec60_col =>prec60_col_target - call p2c(bounds, num_soilc, filter_soilc, & - prec60(bounds%begp:bounds%endp), & - prec60_col(bounds%begc:bounds%endc)) rh30_col =>rh30_col_target call p2c(bounds, num_soilc, filter_soilc, & @@ -545,9 +538,12 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ c = filter_soilc(fc) g= col%gridcell(c) if(grc%latdeg(g) < cnfire_const%borealat )then + if((trotr1_col(c)+trotr2_col(c))*col%wtgcell(c)<=0.8_r8.and.trotr1_col(c)+trotr2_col(c)>0.0_r8) then baf_peatf(c) = non_boreal_peatfire_c/secsphr*max(0._r8, & - min(1._r8,(4.0_r8-prec60_col(c)*secspday)/ & - 4.0_r8))**2*peatf_lf(c)*(1._r8-fsat(c)) + min(1._r8,(1._r8-prec30_col(c)*secspday/6._r8)))*peatf_lf(c) + else + baf_peatf(c)=0._r8 + end if else baf_peatf(c) = boreal_peatfire_c/secsphr*exp(-SHR_CONST_PI*(max(wf2(c),0._r8)/0.3_r8))* & max(0._r8,min(1._r8,(tsoi17(c)-SHR_CONST_TKFRZ)/10._r8))*peatf_lf(c)* & diff --git a/src/biogeophys/Wateratm2lndBulkType.F90 b/src/biogeophys/Wateratm2lndBulkType.F90 index 4aacbe11c2..bcc0e6b0d9 100644 --- a/src/biogeophys/Wateratm2lndBulkType.F90 +++ b/src/biogeophys/Wateratm2lndBulkType.F90 @@ -35,6 +35,7 @@ module Wateratm2lndBulkType real(r8), pointer :: forc_rh_grc (:) ! atmospheric relative humidity (%) real(r8) , pointer :: prec365_col (:) ! col 365-day running mean of tot. precipitation (see comment in UpdateAccVars regarding why this is col-level despite other prec accumulators being patch-level) real(r8) , pointer :: prec60_patch (:) ! patch 60-day running mean of tot. precipitation (mm/s) + real(r8) , pointer :: prec30_patch (:) real(r8) , pointer :: prec10_patch (:) ! patch 10-day running mean of tot. precipitation (mm/s) real(r8) , pointer :: rh30_patch (:) ! patch 30-day running mean of relative humidity real(r8) , pointer :: prec24_patch (:) ! patch 24-hour running mean of tot. precipitation (mm/s) @@ -126,6 +127,7 @@ subroutine InitBulkAllocate(this, bounds) allocate(this%forc_rh_grc (begg:endg)) ; this%forc_rh_grc (:) = ival allocate(this%prec365_col (begc:endc)) ; this%prec365_col (:) = nan allocate(this%prec60_patch (begp:endp)) ; this%prec60_patch(:) = nan + allocate(this%prec30_patch (begp:endp)) ; this%prec30_patch(:) = nan allocate(this%prec10_patch (begp:endp)) ; this%prec10_patch(:) = nan allocate(this%rh30_patch (begp:endp)) ; this%rh30_patch (:) = nan if (use_fates) then @@ -198,6 +200,12 @@ subroutine InitBulkHistory(this, bounds) call hist_addfld1d (fname=this%info%fname('PREC60'), units='MM H2O/S', & avgflag='A', long_name=this%info%lname('60-day running mean of PREC'), & ptr_patch=this%prec60_patch, default='inactive') + + this%prec30_patch(begp:endp) = spval + call hist_addfld1d (fname=this%info%fname('PREC30'), units='MM H2O/S', & + avgflag='A', long_name=this%info%lname('30-day running mean of PREC'), & + ptr_patch=this%prec30_patch, default='inactive') + end if end subroutine InitBulkHistory @@ -245,6 +253,11 @@ subroutine InitAccBuffer (this, bounds) desc='60-day running mean of total precipitation', accum_type='runmean', accum_period=-60, & subgrid_type='pft', numlev=1, init_value=0._r8) + call init_accum_field (name='PREC30', units='MM H2O/S', & + desc='30-day running mean of total precipitation', accum_type='runmean', accum_period=-30, & + subgrid_type='pft', numlev=1, init_value=0._r8) + + call init_accum_field (name='RH30', units='%', & desc='30-day running mean of relative humidity', accum_type='runmean', accum_period=-30, & subgrid_type='pft', numlev=1, init_value=100._r8) @@ -324,6 +337,9 @@ subroutine InitAccVars(this, bounds) call extract_accum_field ('PREC60', rbufslp, nstep) this%prec60_patch(begp:endp) = rbufslp(begp:endp) + call extract_accum_field ('PREC30', rbufslp, nstep) + this%prec30_patch(begp:endp) = rbufslp(begp:endp) + call extract_accum_field ('RH30', rbufslp, nstep) this%rh30_patch(begp:endp) = rbufslp(begp:endp) end if @@ -404,6 +420,9 @@ subroutine UpdateAccVars (this, bounds) call update_accum_field ('PREC60', rbufslp, nstep) call extract_accum_field ('PREC60', this%prec60_patch, nstep) + call update_accum_field ('PREC30', rbufslp, nstep) + call extract_accum_field ('PREC30', this%prec30_patch, nstep) + ! Accumulate and extract PREC10 (accumulates total precipitation as 10-day running mean) call update_accum_field ('PREC10', rbufslp, nstep) call extract_accum_field ('PREC10', this%prec10_patch, nstep) @@ -483,6 +502,7 @@ subroutine Clean(this) ! anomaly forcing deallocate(this%prec365_col) deallocate(this%prec60_patch) + deallocate(this%prec30_patch) deallocate(this%prec10_patch) if (use_fates) then deallocate(this%prec24_patch) From 617f88b2e6ea00f16371d83dc5392b844202df64 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Fri, 16 Aug 2024 14:02:17 -0600 Subject: [PATCH 0900/1248] Improve dependence of deforestation burning on climate. --- src/biogeochem/CNFireLi2024Mod.F90 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/biogeochem/CNFireLi2024Mod.F90 b/src/biogeochem/CNFireLi2024Mod.F90 index 5f1c88811f..7495438d9b 100644 --- a/src/biogeochem/CNFireLi2024Mod.F90 +++ b/src/biogeochem/CNFireLi2024Mod.F90 @@ -625,17 +625,17 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ fbac1(c) = 0._r8 farea_burned(c) = baf_crop(c)+baf_peatf(c) else - cri = (4.0_r8*trotr1_col(c)+1.8_r8*trotr2_col(c))/(trotr1_col(c)+trotr2_col(c)) - cli = (max(0._r8,min(1._r8,(cri-prec60_col(c)*secspday)/cri))**0.5)* & - (max(0._r8,min(1._r8,(cri-prec10_col(c)*secspday)/cri))**0.5)* & + cri = (1.4_r8*trotr1_col(c)+0.5_r8*trotr2_col(c))/(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)* & max(0._r8,min(1._r8,(0.25_r8-(forc_rain(c)+forc_snow(c))*secsphr)/0.25_r8)) - farea_burned(c) = fb*cli*(cli_scale/secspday)+baf_crop(c)+baf_peatf(c) + + farea_burned(c) = farea_burned(c)+fb*cli*(0.01_r8/secspday) ! burned area out of conversion region due to land use fire fbac1(c) = max(0._r8,fb*cli*(cli_scale/secspday) - 2.0_r8*lfc(c)/dt) end if ! total burned area out of conversion - fbac(c) = fbac1(c)+baf_crop(c)+baf_peatf(c) + fbac(c) = farea_burned(c) + fbac1(c) else fbac(c) = farea_burned(c) end if From 97405d769255605cc26b2a5cc96d31a039e68ed0 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Fri, 16 Aug 2024 14:03:23 -0600 Subject: [PATCH 0901/1248] Add (1) lightning igns in trop. closed forests, (2) landscape frag suppression. - Previously, neither lightning nor human ignitions (other than deforestation fire) were allowed there. - Landscape fragmentation suppression effect has to do with lfwt. --- src/biogeochem/CNFireLi2024Mod.F90 | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/src/biogeochem/CNFireLi2024Mod.F90 b/src/biogeochem/CNFireLi2024Mod.F90 index 7495438d9b..0dc12d4df9 100644 --- a/src/biogeochem/CNFireLi2024Mod.F90 +++ b/src/biogeochem/CNFireLi2024Mod.F90 @@ -297,9 +297,9 @@ 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 (non-crop and non-bare-soil) - if( patch%itype(p) >= ndllf_evr_tmp_tree .and. patch%itype(p) <= nc4_grass )then - lfwt(c) = lfwt(c) + patch%wtcol(p) + ! For natural vegetation + if(patch%itype(p) <= nc4_grass )then + lfwt(c) = lfwt(c) + patch%wtgcell(p) end if end do ! @@ -589,7 +589,6 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ end if fuelc(c) = fuelc(c)/(1._r8-cropf_col(c)) fb = max(0.0_r8,min(1.0_r8,(fuelc(c)-lfuel)/(ufuel-lfuel))) - if (trotr1_col(c)+trotr2_col(c)<=0.6_r8) then afuel =min(1._r8,max(0._r8,(fuelc(c)-2500._r8)/(5000._r8-2500._r8))) arh=1._r8-max(0._r8, min(1._r8,(forc_rh(g)-rh_low)/(rh_hgh-rh_low))) arh30=1._r8-max(cnfire_params%prh30, min(1._r8,rh30_col(c)/90._r8)) @@ -601,19 +600,24 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ end if lh = pot_hmn_ign_counts_alpha*6.8_r8*hdmlf**(0.43_r8)/30._r8/24._r8 fs = 1._r8-(0.01_r8+0.98_r8*exp(-0.025_r8*hdmlf)) + if (trotr1_col(c)+trotr2_col(c)<=0.6_r8) then ig = (lh+this%forc_lnfm(g)/(5.16_r8+2.16_r8* & cos(SHR_CONST_PI/180._r8*3*min(60._r8,abs(grc%latdeg(g)))))* & - cnfire_params%ignition_efficiency)*(1._r8-fs)*(1._r8-cropf_col(c)) + cnfire_params%ignition_efficiency)*(1._r8-fs)* & + (lfwt(c)**0.5) + else + ig = this%forc_lnfm(g)/(5.16_r8+2.16_r8* & + cos(SHR_CONST_PI/180._r8*3*min(60._r8,abs(grc%latdeg(g)))))* & + 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 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) farea_burned(c) = min(1._r8,(cnfire_const%g0*spread_m*fsr_col(c)* & - fd_col(c)/1000._r8)**2*lgdp1_col(c)* & - lpop_col(c)*nfire(c)*SHR_CONST_PI*Lb_lf+ & + fd_col(c)/1000._r8)**2*nfire(c)*SHR_CONST_PI*Lb_lf+ & baf_crop(c)+baf_peatf(c)) ! fraction (0-1) per sec - else - farea_burned(c)=min(1._r8,baf_crop(c)+baf_peatf(c)) - end if ! ! if landuse change data is used, calculate deforestation fires and ! add it in the total of burned area fraction From 8418ec491f1dba682708b433805ae20b46be7b10 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Fri, 16 Aug 2024 14:04:54 -0600 Subject: [PATCH 0902/1248] Recalibrate li2024gswpfrc (namelist parameters only). --- bld/namelist_files/namelist_defaults_ctsm.xml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index 674effd165..1d60fa9adc 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -355,14 +355,14 @@ attributes from the config_cache.xml file (with keys converted to upper-case). 80.0d00 0.85d00 0.98d00 -0.025d00 -0.09d-4 +0.01d00 +0.28d-4 0.010d00 -0.17d-3 -0.21d00 +0.71d-4 +0.3d00 0.33d00 75.d00 -1050.d00 +825.d00 0.5d00 0.28d00 From 8de658065a6d94427052cffe0867acc280a37bb2 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Fri, 16 Aug 2024 14:12:32 -0600 Subject: [PATCH 0903/1248] Add fire_method li2024crujra. Same as li2024gswpfrc except rh_hgh now 85 (was 80). --- bld/namelist_files/namelist_defaults_ctsm.xml | 16 ++++++++++++++++ bld/namelist_files/namelist_definition_ctsm.xml | 3 ++- cime_config/testdefs/testlist_clm.xml | 10 ++++++++++ .../clm/FireLi2024CruJra/include_user_mods | 1 + .../clm/FireLi2024CruJra/user_nl_clm | 1 + src/biogeochem/CNFireFactoryMod.F90 | 2 +- 6 files changed, 31 insertions(+), 2 deletions(-) create mode 100644 cime_config/testdefs/testmods_dirs/clm/FireLi2024CruJra/include_user_mods create mode 100644 cime_config/testdefs/testmods_dirs/clm/FireLi2024CruJra/user_nl_clm diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index 1d60fa9adc..777b7c4cff 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -366,6 +366,22 @@ attributes from the config_cache.xml file (with keys converted to upper-case). 0.5d00 0.28d00 +30.0d00 +85.0d00 +0.85d00 +0.98d00 +0.01d00 +0.28d-4 +0.010d00 +0.71d-4 +0.3d00 +0.33d00 +75.d00 +825.d00 +0.5d00 +0.28d00 + + .false. .true. diff --git a/bld/namelist_files/namelist_definition_ctsm.xml b/bld/namelist_files/namelist_definition_ctsm.xml index 4cc50da391..134f0c41c7 100644 --- a/bld/namelist_files/namelist_definition_ctsm.xml +++ b/bld/namelist_files/namelist_definition_ctsm.xml @@ -252,7 +252,7 @@ formulation (1). + group="cnfire_inparm" valid_values="nofire,li2014qianfrc,li2016crufrc,li2021gswpfrc,li2024gswpfrc,li2024crujra" > The method type to use for CNFire nofire: Turn fire effects off @@ -260,6 +260,7 @@ li2014qianfrc: Reference paper Li, et. al.(2014) tuned with QIAN atmospheric for li2016crufrc: Reference paper Li, et. al.(2016) tuned with CRU-NCEP atmospheric forcing li2021gswpfrc: Reference paper Li, et. al.(2021?) tuned with GSWP3 atmospheric forcing li2024gswpfrc: No reference paper yet +li2024crujra: No reference paper yet, tuned with CRU-JRA forcing + + + + + + + + + + diff --git a/cime_config/testdefs/testmods_dirs/clm/FireLi2024CruJra/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/FireLi2024CruJra/include_user_mods new file mode 100644 index 0000000000..fe0e18cf88 --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/FireLi2024CruJra/include_user_mods @@ -0,0 +1 @@ +../default diff --git a/cime_config/testdefs/testmods_dirs/clm/FireLi2024CruJra/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/FireLi2024CruJra/user_nl_clm new file mode 100644 index 0000000000..437e4ef86e --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/FireLi2024CruJra/user_nl_clm @@ -0,0 +1 @@ +fire_method = 'li2024crujra' diff --git a/src/biogeochem/CNFireFactoryMod.F90 b/src/biogeochem/CNFireFactoryMod.F90 index 876e28a5e3..27a1085336 100644 --- a/src/biogeochem/CNFireFactoryMod.F90 +++ b/src/biogeochem/CNFireFactoryMod.F90 @@ -116,7 +116,7 @@ subroutine create_cnfire_method( NLFilename, cnfire_method ) allocate(cnfire_li2016_type :: cnfire_method) case ("li2021gswpfrc") allocate(cnfire_li2021_type :: cnfire_method) - case ("li2024gswpfrc") + case ("li2024gswpfrc", "li2024crujra") allocate(cnfire_li2024_type :: cnfire_method) case default From 5e82825e8b5da4f5170181d764924872b958ec81 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Fri, 16 Aug 2024 14:16:00 -0600 Subject: [PATCH 0904/1248] Whitespace and comment fixes. --- src/biogeochem/CNFireLi2024Mod.F90 | 36 ++++++++++++------------- src/biogeophys/Wateratm2lndBulkType.F90 | 4 +-- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/biogeochem/CNFireLi2024Mod.F90 b/src/biogeochem/CNFireLi2024Mod.F90 index 0dc12d4df9..d749e8000c 100644 --- a/src/biogeochem/CNFireLi2024Mod.F90 +++ b/src/biogeochem/CNFireLi2024Mod.F90 @@ -192,8 +192,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 , & - rh30 => wateratm2lndbulk_inst%rh30_patch , & ! Input: [real(r8) (:) ] 10-day running mean of tot. precipitation + 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 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 @@ -298,7 +298,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 ) then lfwt(c) = lfwt(c) + patch%wtgcell(p) end if end do @@ -538,12 +538,12 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ c = filter_soilc(fc) g= col%gridcell(c) if(grc%latdeg(g) < cnfire_const%borealat )then - if((trotr1_col(c)+trotr2_col(c))*col%wtgcell(c)<=0.8_r8.and.trotr1_col(c)+trotr2_col(c)>0.0_r8) then - baf_peatf(c) = non_boreal_peatfire_c/secsphr*max(0._r8, & - min(1._r8,(1._r8-prec30_col(c)*secspday/6._r8)))*peatf_lf(c) - else - baf_peatf(c)=0._r8 - end if + if ((trotr1_col(c)+trotr2_col(c))*col%wtgcell(c)<=0.8_r8.and.trotr1_col(c)+trotr2_col(c)>0.0_r8) then + baf_peatf(c) = non_boreal_peatfire_c/secsphr*max(0._r8, & + min(1._r8,(1._r8-prec30_col(c)*secspday/6._r8)))*peatf_lf(c) + else + baf_peatf(c) = 0._r8 + end if else baf_peatf(c) = boreal_peatfire_c/secsphr*exp(-SHR_CONST_PI*(max(wf2(c),0._r8)/0.3_r8))* & max(0._r8,min(1._r8,(tsoi17(c)-SHR_CONST_TKFRZ)/10._r8))*peatf_lf(c)* & @@ -601,15 +601,15 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ lh = pot_hmn_ign_counts_alpha*6.8_r8*hdmlf**(0.43_r8)/30._r8/24._r8 fs = 1._r8-(0.01_r8+0.98_r8*exp(-0.025_r8*hdmlf)) if (trotr1_col(c)+trotr2_col(c)<=0.6_r8) then - ig = (lh+this%forc_lnfm(g)/(5.16_r8+2.16_r8* & - cos(SHR_CONST_PI/180._r8*3*min(60._r8,abs(grc%latdeg(g)))))* & - cnfire_params%ignition_efficiency)*(1._r8-fs)* & - (lfwt(c)**0.5) + ig = (lh+this%forc_lnfm(g)/(5.16_r8+2.16_r8* & + cos(SHR_CONST_PI/180._r8*3*min(60._r8,abs(grc%latdeg(g)))))* & + cnfire_params%ignition_efficiency)*(1._r8-fs)* & + (lfwt(c)**0.5) else - ig = this%forc_lnfm(g)/(5.16_r8+2.16_r8* & - cos(SHR_CONST_PI/180._r8*3*min(60._r8,abs(grc%latdeg(g)))))* & - cnfire_params%ignition_efficiency*(1._r8-fs)* & - (lfwt(c)**0.5) + ig = this%forc_lnfm(g)/(5.16_r8+2.16_r8* & + cos(SHR_CONST_PI/180._r8*3*min(60._r8,abs(grc%latdeg(g)))))* & + 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 Lb_lf = 1._r8+10._r8*(1._r8-EXP(-0.06_r8*forc_wind(g))) @@ -633,7 +633,7 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ 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)* & 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*(0.01_r8/secspday) ! burned area out of conversion region due to land use fire fbac1(c) = max(0._r8,fb*cli*(cli_scale/secspday) - 2.0_r8*lfc(c)/dt) diff --git a/src/biogeophys/Wateratm2lndBulkType.F90 b/src/biogeophys/Wateratm2lndBulkType.F90 index bcc0e6b0d9..b3a28196f1 100644 --- a/src/biogeophys/Wateratm2lndBulkType.F90 +++ b/src/biogeophys/Wateratm2lndBulkType.F90 @@ -35,7 +35,7 @@ module Wateratm2lndBulkType real(r8), pointer :: forc_rh_grc (:) ! atmospheric relative humidity (%) real(r8) , pointer :: prec365_col (:) ! col 365-day running mean of tot. precipitation (see comment in UpdateAccVars regarding why this is col-level despite other prec accumulators being patch-level) real(r8) , pointer :: prec60_patch (:) ! patch 60-day running mean of tot. precipitation (mm/s) - real(r8) , pointer :: prec30_patch (:) + real(r8) , pointer :: prec30_patch (:) real(r8) , pointer :: prec10_patch (:) ! patch 10-day running mean of tot. precipitation (mm/s) real(r8) , pointer :: rh30_patch (:) ! patch 30-day running mean of relative humidity real(r8) , pointer :: prec24_patch (:) ! patch 24-hour running mean of tot. precipitation (mm/s) @@ -337,7 +337,7 @@ subroutine InitAccVars(this, bounds) call extract_accum_field ('PREC60', rbufslp, nstep) this%prec60_patch(begp:endp) = rbufslp(begp:endp) - call extract_accum_field ('PREC30', rbufslp, nstep) + call extract_accum_field ('PREC30', rbufslp, nstep) this%prec30_patch(begp:endp) = rbufslp(begp:endp) call extract_accum_field ('RH30', rbufslp, nstep) From 34839868c3b96149f619bd750e387da37d23e152 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Fri, 16 Aug 2024 15:20:53 -0600 Subject: [PATCH 0905/1248] Update another param file for aux_clm test to pass --- cime_config/testdefs/testmods_dirs/clm/ciso_cwd_hr/user_nl_clm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cime_config/testdefs/testmods_dirs/clm/ciso_cwd_hr/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/ciso_cwd_hr/user_nl_clm index 3c686f08b9..3462b802c7 100644 --- a/cime_config/testdefs/testmods_dirs/clm/ciso_cwd_hr/user_nl_clm +++ b/cime_config/testdefs/testmods_dirs/clm/ciso_cwd_hr/user_nl_clm @@ -1,2 +1,2 @@ -paramfile = '$DIN_LOC_ROOT/lnd/clm2/paramdata/ctsm51_ciso_cwd_hr_params.c240208.nc' +paramfile = '$DIN_LOC_ROOT/lnd/clm2/paramdata/ctsm51_ciso_cwd_hr_params.c240814.nc' hist_fincl1 = 'CWDC_HR','C13_CWDC_HR','C14_CWDC_HR','CWD_HR_L2','CWD_HR_L2_vr','CWD_HR_L3','CWD_HR_L3_vr' From 4045128f70293d187c97e7fc2ed73b2e5189397e Mon Sep 17 00:00:00 2001 From: wwieder Date: Mon, 22 Apr 2024 16:08:48 -0600 Subject: [PATCH 0906/1248] update PLUMBER2 usermods to 5.2 datasets --- cime_config/usermods_dirs/PLUMBER2/AR-SLu/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/AT-Neu/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/AU-ASM/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/AU-Cow/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/AU-Cpr/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/AU-Ctr/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/AU-Cum/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/AU-DaP/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/AU-DaS/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/AU-Dry/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/AU-Emr/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/AU-GWW/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/AU-Gin/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/AU-How/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/AU-Lit/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/AU-Otw/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/AU-Rig/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/AU-Rob/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/AU-Sam/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/AU-Stp/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/AU-TTE/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/AU-Tum/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/AU-Whr/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/AU-Wrr/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/AU-Ync/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/BE-Bra/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/BE-Lon/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/BE-Vie/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/BR-Sa3/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/BW-Ma1/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/CA-NS1/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/CA-NS2/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/CA-NS4/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/CA-NS5/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/CA-NS6/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/CA-NS7/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/CA-Qcu/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/CA-Qfo/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/CA-SF1/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/CA-SF2/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/CA-SF3/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/CH-Cha/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/CH-Dav/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/CH-Fru/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/CH-Oe1/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/CN-Cha/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/CN-Cng/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/CN-Dan/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/CN-Din/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/CN-Du2/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/CN-HaM/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/CN-Qia/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/CZ-wet/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/DE-Bay/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/DE-Geb/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/DE-Gri/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/DE-Hai/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/DE-Kli/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/DE-Meh/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/DE-Obe/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/DE-Seh/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/DE-SfN/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/DE-Tha/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/DE-Wet/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/DK-Fou/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/DK-Lva/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/DK-Ris/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/DK-Sor/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/DK-ZaH/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/ES-ES1/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/ES-ES2/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/ES-LMa/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/ES-LgS/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/ES-VDA/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/FI-Hyy/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/FI-Kaa/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/FI-Lom/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/FI-Sod/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/FR-Fon/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/FR-Gri/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/FR-Hes/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/FR-LBr/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/FR-Lq1/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/FR-Lq2/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/FR-Pue/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/GF-Guy/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/HU-Bug/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/ID-Pag/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/IE-Ca1/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/IE-Dri/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/IT-Amp/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/IT-BCi/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/IT-CA1/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/IT-CA2/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/IT-CA3/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/IT-Col/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/IT-Cpz/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/IT-Isp/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/IT-LMa/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/IT-Lav/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/IT-MBo/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/IT-Mal/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/IT-Noe/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/IT-Non/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/IT-PT1/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/IT-Ren/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/IT-Ro1/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/IT-Ro2/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/IT-SR2/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/IT-SRo/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/JP-SMF/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/NL-Ca1/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/NL-Hor/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/NL-Loo/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/PL-wet/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/PT-Esp/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/PT-Mi1/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/PT-Mi2/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/RU-Che/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/RU-Fyo/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/RU-Zot/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/SD-Dem/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/SE-Deg/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/UK-Gri/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/UK-Ham/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/UK-PL3/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/US-AR1/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/US-AR2/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/US-ARM/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/US-Aud/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/US-Bar/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/US-Bkg/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/US-Blo/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/US-Bo1/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/US-Cop/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/US-FPe/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/US-GLE/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/US-Goo/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/US-Ha1/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/US-Ho1/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/US-KS2/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/US-Los/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/US-MMS/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/US-MOz/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/US-Me2/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/US-Me4/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/US-Me6/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/US-Myb/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/US-NR1/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/US-Ne1/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/US-Ne2/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/US-Ne3/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/US-PFa/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/US-Prr/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/US-SP1/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/US-SP2/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/US-SP3/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/US-SRG/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/US-SRM/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/US-Syv/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/US-Ton/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/US-Tw4/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/US-Twt/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/US-UMB/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/US-Var/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/US-WCr/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/US-Whs/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/US-Wkg/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/ZA-Kru/shell_commands | 1 - cime_config/usermods_dirs/PLUMBER2/ZM-Mon/shell_commands | 1 - 170 files changed, 170 deletions(-) diff --git a/cime_config/usermods_dirs/PLUMBER2/AR-SLu/shell_commands b/cime_config/usermods_dirs/PLUMBER2/AR-SLu/shell_commands index f64d8759a2..67baebcf55 100644 --- a/cime_config/usermods_dirs/PLUMBER2/AR-SLu/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/AR-SLu/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=10800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_AR-SLu_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/AR-SLu/CLM1PT_data/CTSM_DATM_AR-SLu_2010-2010.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2010" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2010" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/AT-Neu/shell_commands b/cime_config/usermods_dirs/PLUMBER2/AT-Neu/shell_commands index b8a54e5644..0efd0fad67 100644 --- a/cime_config/usermods_dirs/PLUMBER2/AT-Neu/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/AT-Neu/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_AT-Neu_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/AT-Neu/CLM1PT_data/CTSM_DATM_AT-Neu_2002-2012.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2002" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2012" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/AU-ASM/shell_commands b/cime_config/usermods_dirs/PLUMBER2/AU-ASM/shell_commands index 2d5e0d85fd..bbb56c040d 100644 --- a/cime_config/usermods_dirs/PLUMBER2/AU-ASM/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/AU-ASM/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=54000 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_AU-ASM_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/AU-ASM/CLM1PT_data/CTSM_DATM_AU-ASM_2011-2017.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2011" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2017" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/AU-Cow/shell_commands b/cime_config/usermods_dirs/PLUMBER2/AU-Cow/shell_commands index fe84b1e129..1d7734330f 100644 --- a/cime_config/usermods_dirs/PLUMBER2/AU-Cow/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/AU-Cow/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=50400 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_AU-Cow_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/AU-Cow/CLM1PT_data/CTSM_DATM_AU-Cow_2010-2015.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2010" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2015" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/AU-Cpr/shell_commands b/cime_config/usermods_dirs/PLUMBER2/AU-Cpr/shell_commands index fcb7375d71..fcf027b8c2 100644 --- a/cime_config/usermods_dirs/PLUMBER2/AU-Cpr/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/AU-Cpr/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=46800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_AU-Cpr_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/AU-Cpr/CLM1PT_data/CTSM_DATM_AU-Cpr_2011-2017.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2011" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2017" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/AU-Ctr/shell_commands b/cime_config/usermods_dirs/PLUMBER2/AU-Ctr/shell_commands index 8d42bed60a..6ce2fe74b1 100644 --- a/cime_config/usermods_dirs/PLUMBER2/AU-Ctr/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/AU-Ctr/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=50400 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_AU-Ctr_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/AU-Ctr/CLM1PT_data/CTSM_DATM_AU-Ctr_2010-2017.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2010" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2017" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/AU-Cum/shell_commands b/cime_config/usermods_dirs/PLUMBER2/AU-Cum/shell_commands index 17aed3a1dd..090c330641 100644 --- a/cime_config/usermods_dirs/PLUMBER2/AU-Cum/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/AU-Cum/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=46800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_AU-Cum_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/AU-Cum/CLM1PT_data/CTSM_DATM_AU-Cum_2013-2018.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2013" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2018" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/AU-DaP/shell_commands b/cime_config/usermods_dirs/PLUMBER2/AU-DaP/shell_commands index 816e4c78dc..27ebc931ee 100644 --- a/cime_config/usermods_dirs/PLUMBER2/AU-DaP/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/AU-DaP/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=54000 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_AU-DaP_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/AU-DaP/CLM1PT_data/CTSM_DATM_AU-DaP_2009-2012.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2009" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2012" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/AU-DaS/shell_commands b/cime_config/usermods_dirs/PLUMBER2/AU-DaS/shell_commands index 0ea37fd95a..4fd48d214d 100644 --- a/cime_config/usermods_dirs/PLUMBER2/AU-DaS/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/AU-DaS/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=54000 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_AU-DaS_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/AU-DaS/CLM1PT_data/CTSM_DATM_AU-DaS_2010-2017.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2010" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2017" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/AU-Dry/shell_commands b/cime_config/usermods_dirs/PLUMBER2/AU-Dry/shell_commands index 3cd8faecd9..b0b16bfa84 100644 --- a/cime_config/usermods_dirs/PLUMBER2/AU-Dry/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/AU-Dry/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=54000 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_AU-Dry_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/AU-Dry/CLM1PT_data/CTSM_DATM_AU-Dry_2011-2015.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2011" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2015" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/AU-Emr/shell_commands b/cime_config/usermods_dirs/PLUMBER2/AU-Emr/shell_commands index 7822948582..2c84ebbe46 100644 --- a/cime_config/usermods_dirs/PLUMBER2/AU-Emr/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/AU-Emr/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=50400 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_AU-Emr_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/AU-Emr/CLM1PT_data/CTSM_DATM_AU-Emr_2012-2013.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2012" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2013" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/AU-GWW/shell_commands b/cime_config/usermods_dirs/PLUMBER2/AU-GWW/shell_commands index 258ee5f12a..5d07cef0a1 100644 --- a/cime_config/usermods_dirs/PLUMBER2/AU-GWW/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/AU-GWW/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=57600 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_AU-GWW_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/AU-GWW/CLM1PT_data/CTSM_DATM_AU-GWW_2013-2017.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2013" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2017" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/AU-Gin/shell_commands b/cime_config/usermods_dirs/PLUMBER2/AU-Gin/shell_commands index 31071a2ebb..0a193b5299 100644 --- a/cime_config/usermods_dirs/PLUMBER2/AU-Gin/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/AU-Gin/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=57600 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_AU-Gin_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/AU-Gin/CLM1PT_data/CTSM_DATM_AU-Gin_2012-2017.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2012" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2017" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/AU-How/shell_commands b/cime_config/usermods_dirs/PLUMBER2/AU-How/shell_commands index 411cec6d9c..fb933852a1 100644 --- a/cime_config/usermods_dirs/PLUMBER2/AU-How/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/AU-How/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=54000 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_AU-How_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/AU-How/CLM1PT_data/CTSM_DATM_AU-How_2003-2017.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2003" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2017" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/AU-Lit/shell_commands b/cime_config/usermods_dirs/PLUMBER2/AU-Lit/shell_commands index 7fc59ce824..07b31e742c 100644 --- a/cime_config/usermods_dirs/PLUMBER2/AU-Lit/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/AU-Lit/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=54000 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_AU-Lit_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/AU-Lit/CLM1PT_data/CTSM_DATM_AU-Lit_2016-2017.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2016" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2017" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/AU-Otw/shell_commands b/cime_config/usermods_dirs/PLUMBER2/AU-Otw/shell_commands index 6671c26040..9cdc2603e3 100644 --- a/cime_config/usermods_dirs/PLUMBER2/AU-Otw/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/AU-Otw/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=46800 ./xmlchange ATM_NCPL=24 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_AU-Otw_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/AU-Otw/CLM1PT_data/CTSM_DATM_AU-Otw_2009-2010.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2009" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2010" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/AU-Rig/shell_commands b/cime_config/usermods_dirs/PLUMBER2/AU-Rig/shell_commands index db70e72c89..a1f5c227c7 100644 --- a/cime_config/usermods_dirs/PLUMBER2/AU-Rig/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/AU-Rig/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=46800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_AU-Rig_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/AU-Rig/CLM1PT_data/CTSM_DATM_AU-Rig_2011-2016.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2011" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2016" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/AU-Rob/shell_commands b/cime_config/usermods_dirs/PLUMBER2/AU-Rob/shell_commands index 33e2084f14..491c105b41 100644 --- a/cime_config/usermods_dirs/PLUMBER2/AU-Rob/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/AU-Rob/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=50400 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_AU-Rob_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/AU-Rob/CLM1PT_data/CTSM_DATM_AU-Rob_2014-2017.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2014" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2017" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/AU-Sam/shell_commands b/cime_config/usermods_dirs/PLUMBER2/AU-Sam/shell_commands index 561ba257fa..cc4780d142 100644 --- a/cime_config/usermods_dirs/PLUMBER2/AU-Sam/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/AU-Sam/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=50400 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_AU-Sam_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/AU-Sam/CLM1PT_data/CTSM_DATM_AU-Sam_2011-2017.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2011" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2017" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/AU-Stp/shell_commands b/cime_config/usermods_dirs/PLUMBER2/AU-Stp/shell_commands index 97db87c821..b47b5d5247 100644 --- a/cime_config/usermods_dirs/PLUMBER2/AU-Stp/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/AU-Stp/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=54000 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_AU-Stp_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/AU-Stp/CLM1PT_data/CTSM_DATM_AU-Stp_2010-2017.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2010" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2017" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/AU-TTE/shell_commands b/cime_config/usermods_dirs/PLUMBER2/AU-TTE/shell_commands index dee6244ef7..4078dbed33 100644 --- a/cime_config/usermods_dirs/PLUMBER2/AU-TTE/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/AU-TTE/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=54000 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_AU-TTE_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/AU-TTE/CLM1PT_data/CTSM_DATM_AU-TTE_2013-2017.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2013" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2017" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/AU-Tum/shell_commands b/cime_config/usermods_dirs/PLUMBER2/AU-Tum/shell_commands index 36cd89bc73..b22b411eec 100644 --- a/cime_config/usermods_dirs/PLUMBER2/AU-Tum/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/AU-Tum/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=46800 ./xmlchange ATM_NCPL=24 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_AU-Tum_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/AU-Tum/CLM1PT_data/CTSM_DATM_AU-Tum_2002-2017.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2002" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2017" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/AU-Whr/shell_commands b/cime_config/usermods_dirs/PLUMBER2/AU-Whr/shell_commands index 6b5d9415fe..87c5957833 100644 --- a/cime_config/usermods_dirs/PLUMBER2/AU-Whr/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/AU-Whr/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=46800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_AU-Whr_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/AU-Whr/CLM1PT_data/CTSM_DATM_AU-Whr_2015-2016.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2015" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2016" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/AU-Wrr/shell_commands b/cime_config/usermods_dirs/PLUMBER2/AU-Wrr/shell_commands index e1751b8439..8f0303fe30 100644 --- a/cime_config/usermods_dirs/PLUMBER2/AU-Wrr/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/AU-Wrr/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=46800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_AU-Wrr_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/AU-Wrr/CLM1PT_data/CTSM_DATM_AU-Wrr_2016-2017.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2016" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2017" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/AU-Ync/shell_commands b/cime_config/usermods_dirs/PLUMBER2/AU-Ync/shell_commands index 861c844b14..7606fa4a96 100644 --- a/cime_config/usermods_dirs/PLUMBER2/AU-Ync/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/AU-Ync/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=46800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_AU-Ync_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/AU-Ync/CLM1PT_data/CTSM_DATM_AU-Ync_2011-2017.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2011" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2017" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/BE-Bra/shell_commands b/cime_config/usermods_dirs/PLUMBER2/BE-Bra/shell_commands index 5aeefbc792..876260dcc3 100644 --- a/cime_config/usermods_dirs/PLUMBER2/BE-Bra/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/BE-Bra/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_BE-Bra_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/BE-Bra/CLM1PT_data/CTSM_DATM_BE-Bra_2004-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2004" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/BE-Lon/shell_commands b/cime_config/usermods_dirs/PLUMBER2/BE-Lon/shell_commands index 959a9e88fa..2ebc59db53 100644 --- a/cime_config/usermods_dirs/PLUMBER2/BE-Lon/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/BE-Lon/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_BE-Lon_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/BE-Lon/CLM1PT_data/CTSM_DATM_BE-Lon_2005-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2005" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/BE-Vie/shell_commands b/cime_config/usermods_dirs/PLUMBER2/BE-Vie/shell_commands index 008d71407c..21bf22d74c 100644 --- a/cime_config/usermods_dirs/PLUMBER2/BE-Vie/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/BE-Vie/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_BE-Vie_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/BE-Vie/CLM1PT_data/CTSM_DATM_BE-Vie_1997-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=1997" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/BR-Sa3/shell_commands b/cime_config/usermods_dirs/PLUMBER2/BR-Sa3/shell_commands index c1277c1198..741ea74d27 100644 --- a/cime_config/usermods_dirs/PLUMBER2/BR-Sa3/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/BR-Sa3/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=14400 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_BR-Sa3_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/BR-Sa3/CLM1PT_data/CTSM_DATM_BR-Sa3_2001-2003.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2001" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2003" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/BW-Ma1/shell_commands b/cime_config/usermods_dirs/PLUMBER2/BW-Ma1/shell_commands index b2e5f88222..77944502cf 100644 --- a/cime_config/usermods_dirs/PLUMBER2/BW-Ma1/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/BW-Ma1/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=79200 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_BW-Ma1_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/BW-Ma1/CLM1PT_data/CTSM_DATM_BW-Ma1_2000-2000.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2000" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2000" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/CA-NS1/shell_commands b/cime_config/usermods_dirs/PLUMBER2/CA-NS1/shell_commands index adb752cea8..88ef538521 100644 --- a/cime_config/usermods_dirs/PLUMBER2/CA-NS1/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/CA-NS1/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=21600 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_CA-NS1_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/CA-NS1/CLM1PT_data/CTSM_DATM_CA-NS1_2003-2003.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2003" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2003" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/CA-NS2/shell_commands b/cime_config/usermods_dirs/PLUMBER2/CA-NS2/shell_commands index bb25a4ad93..9b89720f4a 100644 --- a/cime_config/usermods_dirs/PLUMBER2/CA-NS2/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/CA-NS2/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=21600 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_CA-NS2_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/CA-NS2/CLM1PT_data/CTSM_DATM_CA-NS2_2002-2004.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2002" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2004" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/CA-NS4/shell_commands b/cime_config/usermods_dirs/PLUMBER2/CA-NS4/shell_commands index 733537f009..d5f16eac57 100644 --- a/cime_config/usermods_dirs/PLUMBER2/CA-NS4/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/CA-NS4/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=21600 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_CA-NS4_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/CA-NS4/CLM1PT_data/CTSM_DATM_CA-NS4_2003-2004.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2003" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2004" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/CA-NS5/shell_commands b/cime_config/usermods_dirs/PLUMBER2/CA-NS5/shell_commands index 491bc27b99..aca396c31d 100644 --- a/cime_config/usermods_dirs/PLUMBER2/CA-NS5/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/CA-NS5/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=21600 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_CA-NS5_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/CA-NS5/CLM1PT_data/CTSM_DATM_CA-NS5_2003-2004.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2003" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2004" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/CA-NS6/shell_commands b/cime_config/usermods_dirs/PLUMBER2/CA-NS6/shell_commands index 3a1b6a7b0f..d9bd413c42 100644 --- a/cime_config/usermods_dirs/PLUMBER2/CA-NS6/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/CA-NS6/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=21600 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_CA-NS6_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/CA-NS6/CLM1PT_data/CTSM_DATM_CA-NS6_2002-2004.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2002" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2004" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/CA-NS7/shell_commands b/cime_config/usermods_dirs/PLUMBER2/CA-NS7/shell_commands index 735c947bfe..1614d09505 100644 --- a/cime_config/usermods_dirs/PLUMBER2/CA-NS7/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/CA-NS7/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=21600 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_CA-NS7_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/CA-NS7/CLM1PT_data/CTSM_DATM_CA-NS7_2003-2004.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2003" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2004" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/CA-Qcu/shell_commands b/cime_config/usermods_dirs/PLUMBER2/CA-Qcu/shell_commands index c7123ae573..0d3cd7e1a0 100644 --- a/cime_config/usermods_dirs/PLUMBER2/CA-Qcu/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/CA-Qcu/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=18000 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_CA-Qcu_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/CA-Qcu/CLM1PT_data/CTSM_DATM_CA-Qcu_2002-2006.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2002" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2006" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/CA-Qfo/shell_commands b/cime_config/usermods_dirs/PLUMBER2/CA-Qfo/shell_commands index fb7fc215c9..8e80f8e897 100644 --- a/cime_config/usermods_dirs/PLUMBER2/CA-Qfo/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/CA-Qfo/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=18000 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_CA-Qfo_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/CA-Qfo/CLM1PT_data/CTSM_DATM_CA-Qfo_2004-2010.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2004" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2010" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/CA-SF1/shell_commands b/cime_config/usermods_dirs/PLUMBER2/CA-SF1/shell_commands index ed6c584b7c..f479028097 100644 --- a/cime_config/usermods_dirs/PLUMBER2/CA-SF1/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/CA-SF1/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=21600 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_CA-SF1_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/CA-SF1/CLM1PT_data/CTSM_DATM_CA-SF1_2004-2006.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2004" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2006" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/CA-SF2/shell_commands b/cime_config/usermods_dirs/PLUMBER2/CA-SF2/shell_commands index 1fffcfdac9..d83a6c2bf1 100644 --- a/cime_config/usermods_dirs/PLUMBER2/CA-SF2/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/CA-SF2/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=21600 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_CA-SF2_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/CA-SF2/CLM1PT_data/CTSM_DATM_CA-SF2_2003-2005.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2003" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2005" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/CA-SF3/shell_commands b/cime_config/usermods_dirs/PLUMBER2/CA-SF3/shell_commands index 03096c96fa..17fcb052ba 100644 --- a/cime_config/usermods_dirs/PLUMBER2/CA-SF3/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/CA-SF3/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=21600 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_CA-SF3_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/CA-SF3/CLM1PT_data/CTSM_DATM_CA-SF3_2003-2005.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2003" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2005" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/CH-Cha/shell_commands b/cime_config/usermods_dirs/PLUMBER2/CH-Cha/shell_commands index 1e2590a7ae..156ccfd380 100644 --- a/cime_config/usermods_dirs/PLUMBER2/CH-Cha/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/CH-Cha/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_CH-Cha_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/CH-Cha/CLM1PT_data/CTSM_DATM_CH-Cha_2006-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2006" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/CH-Dav/shell_commands b/cime_config/usermods_dirs/PLUMBER2/CH-Dav/shell_commands index c170c8b840..3ad08c65f5 100644 --- a/cime_config/usermods_dirs/PLUMBER2/CH-Dav/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/CH-Dav/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_CH-Dav_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/CH-Dav/CLM1PT_data/CTSM_DATM_CH-Dav_1997-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=1997" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/CH-Fru/shell_commands b/cime_config/usermods_dirs/PLUMBER2/CH-Fru/shell_commands index 31e5163045..44bdb94425 100644 --- a/cime_config/usermods_dirs/PLUMBER2/CH-Fru/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/CH-Fru/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_CH-Fru_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/CH-Fru/CLM1PT_data/CTSM_DATM_CH-Fru_2007-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2007" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/CH-Oe1/shell_commands b/cime_config/usermods_dirs/PLUMBER2/CH-Oe1/shell_commands index ee091e134e..58b583af12 100644 --- a/cime_config/usermods_dirs/PLUMBER2/CH-Oe1/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/CH-Oe1/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_CH-Oe1_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/CH-Oe1/CLM1PT_data/CTSM_DATM_CH-Oe1_2002-2008.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2002" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2008" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/CN-Cha/shell_commands b/cime_config/usermods_dirs/PLUMBER2/CN-Cha/shell_commands index cde3fed3be..e257bff2eb 100644 --- a/cime_config/usermods_dirs/PLUMBER2/CN-Cha/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/CN-Cha/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=57600 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_CN-Cha_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/CN-Cha/CLM1PT_data/CTSM_DATM_CN-Cha_2003-2005.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2003" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2005" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/CN-Cng/shell_commands b/cime_config/usermods_dirs/PLUMBER2/CN-Cng/shell_commands index d5ec208a05..709e3f12ab 100644 --- a/cime_config/usermods_dirs/PLUMBER2/CN-Cng/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/CN-Cng/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=57600 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_CN-Cng_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/CN-Cng/CLM1PT_data/CTSM_DATM_CN-Cng_2008-2009.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2008" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2009" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/CN-Dan/shell_commands b/cime_config/usermods_dirs/PLUMBER2/CN-Dan/shell_commands index 674ce4dda4..5597e04781 100644 --- a/cime_config/usermods_dirs/PLUMBER2/CN-Dan/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/CN-Dan/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=57600 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_CN-Dan_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/CN-Dan/CLM1PT_data/CTSM_DATM_CN-Dan_2004-2005.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2004" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2005" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/CN-Din/shell_commands b/cime_config/usermods_dirs/PLUMBER2/CN-Din/shell_commands index b9149c7d8a..6d0898e50d 100644 --- a/cime_config/usermods_dirs/PLUMBER2/CN-Din/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/CN-Din/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=57600 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_CN-Din_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/CN-Din/CLM1PT_data/CTSM_DATM_CN-Din_2003-2005.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2003" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2005" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/CN-Du2/shell_commands b/cime_config/usermods_dirs/PLUMBER2/CN-Du2/shell_commands index 42502b41ce..ecb62c468d 100644 --- a/cime_config/usermods_dirs/PLUMBER2/CN-Du2/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/CN-Du2/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=57600 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_CN-Du2_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/CN-Du2/CLM1PT_data/CTSM_DATM_CN-Du2_2007-2008.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2007" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2008" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/CN-HaM/shell_commands b/cime_config/usermods_dirs/PLUMBER2/CN-HaM/shell_commands index 95c4167bf0..95c2c4625e 100644 --- a/cime_config/usermods_dirs/PLUMBER2/CN-HaM/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/CN-HaM/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=57600 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_CN-HaM_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/CN-HaM/CLM1PT_data/CTSM_DATM_CN-HaM_2002-2003.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2002" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2003" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/CN-Qia/shell_commands b/cime_config/usermods_dirs/PLUMBER2/CN-Qia/shell_commands index 401534e487..4fd2927af6 100644 --- a/cime_config/usermods_dirs/PLUMBER2/CN-Qia/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/CN-Qia/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=57600 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_CN-Qia_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/CN-Qia/CLM1PT_data/CTSM_DATM_CN-Qia_2003-2005.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2003" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2005" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/CZ-wet/shell_commands b/cime_config/usermods_dirs/PLUMBER2/CZ-wet/shell_commands index 20309cdcb3..e72e38b648 100644 --- a/cime_config/usermods_dirs/PLUMBER2/CZ-wet/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/CZ-wet/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_CZ-wet_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/CZ-wet/CLM1PT_data/CTSM_DATM_CZ-wet_2007-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2007" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/DE-Bay/shell_commands b/cime_config/usermods_dirs/PLUMBER2/DE-Bay/shell_commands index 6495d46b57..766eb3880f 100644 --- a/cime_config/usermods_dirs/PLUMBER2/DE-Bay/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/DE-Bay/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_DE-Bay_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/DE-Bay/CLM1PT_data/CTSM_DATM_DE-Bay_1997-1999.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=1997" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=1999" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/DE-Geb/shell_commands b/cime_config/usermods_dirs/PLUMBER2/DE-Geb/shell_commands index d43c3bd94d..73c61a9d79 100644 --- a/cime_config/usermods_dirs/PLUMBER2/DE-Geb/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/DE-Geb/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_DE-Geb_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/DE-Geb/CLM1PT_data/CTSM_DATM_DE-Geb_2001-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2001" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/DE-Gri/shell_commands b/cime_config/usermods_dirs/PLUMBER2/DE-Gri/shell_commands index fe165d2bf3..6bb17ac6a7 100644 --- a/cime_config/usermods_dirs/PLUMBER2/DE-Gri/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/DE-Gri/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_DE-Gri_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/DE-Gri/CLM1PT_data/CTSM_DATM_DE-Gri_2004-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2004" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/DE-Hai/shell_commands b/cime_config/usermods_dirs/PLUMBER2/DE-Hai/shell_commands index fa5671c663..74f37b2314 100644 --- a/cime_config/usermods_dirs/PLUMBER2/DE-Hai/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/DE-Hai/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_DE-Hai_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/DE-Hai/CLM1PT_data/CTSM_DATM_DE-Hai_2000-2012.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2000" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2012" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/DE-Kli/shell_commands b/cime_config/usermods_dirs/PLUMBER2/DE-Kli/shell_commands index 28fb89a2d0..ee09f48b7d 100644 --- a/cime_config/usermods_dirs/PLUMBER2/DE-Kli/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/DE-Kli/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_DE-Kli_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/DE-Kli/CLM1PT_data/CTSM_DATM_DE-Kli_2005-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2005" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/DE-Meh/shell_commands b/cime_config/usermods_dirs/PLUMBER2/DE-Meh/shell_commands index 250432bd9f..66eca33f28 100644 --- a/cime_config/usermods_dirs/PLUMBER2/DE-Meh/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/DE-Meh/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_DE-Meh_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/DE-Meh/CLM1PT_data/CTSM_DATM_DE-Meh_2004-2006.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2004" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2006" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/DE-Obe/shell_commands b/cime_config/usermods_dirs/PLUMBER2/DE-Obe/shell_commands index ef17febde0..b23d6d2b21 100644 --- a/cime_config/usermods_dirs/PLUMBER2/DE-Obe/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/DE-Obe/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_DE-Obe_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/DE-Obe/CLM1PT_data/CTSM_DATM_DE-Obe_2008-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2008" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/DE-Seh/shell_commands b/cime_config/usermods_dirs/PLUMBER2/DE-Seh/shell_commands index db837ac070..590e3b5812 100644 --- a/cime_config/usermods_dirs/PLUMBER2/DE-Seh/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/DE-Seh/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_DE-Seh_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/DE-Seh/CLM1PT_data/CTSM_DATM_DE-Seh_2008-2010.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2008" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2010" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/DE-SfN/shell_commands b/cime_config/usermods_dirs/PLUMBER2/DE-SfN/shell_commands index bcff32c36a..a8532e908c 100644 --- a/cime_config/usermods_dirs/PLUMBER2/DE-SfN/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/DE-SfN/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_DE-SfN_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/DE-SfN/CLM1PT_data/CTSM_DATM_DE-SfN_2013-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2013" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/DE-Tha/shell_commands b/cime_config/usermods_dirs/PLUMBER2/DE-Tha/shell_commands index aa6beb5913..3b9af13173 100644 --- a/cime_config/usermods_dirs/PLUMBER2/DE-Tha/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/DE-Tha/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_DE-Tha_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/DE-Tha/CLM1PT_data/CTSM_DATM_DE-Tha_1998-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=1998" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/DE-Wet/shell_commands b/cime_config/usermods_dirs/PLUMBER2/DE-Wet/shell_commands index 12d6f2024d..f39a379185 100644 --- a/cime_config/usermods_dirs/PLUMBER2/DE-Wet/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/DE-Wet/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_DE-Wet_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/DE-Wet/CLM1PT_data/CTSM_DATM_DE-Wet_2002-2006.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2002" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2006" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/DK-Fou/shell_commands b/cime_config/usermods_dirs/PLUMBER2/DK-Fou/shell_commands index a4a472424e..fbc465b915 100644 --- a/cime_config/usermods_dirs/PLUMBER2/DK-Fou/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/DK-Fou/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_DK-Fou_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/DK-Fou/CLM1PT_data/CTSM_DATM_DK-Fou_2005-2005.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2005" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2005" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/DK-Lva/shell_commands b/cime_config/usermods_dirs/PLUMBER2/DK-Lva/shell_commands index 962775613e..644cc92e00 100644 --- a/cime_config/usermods_dirs/PLUMBER2/DK-Lva/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/DK-Lva/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_DK-Lva_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/DK-Lva/CLM1PT_data/CTSM_DATM_DK-Lva_2005-2006.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2005" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2006" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/DK-Ris/shell_commands b/cime_config/usermods_dirs/PLUMBER2/DK-Ris/shell_commands index 4c806cea45..f54b4647b1 100644 --- a/cime_config/usermods_dirs/PLUMBER2/DK-Ris/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/DK-Ris/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_DK-Ris_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/DK-Ris/CLM1PT_data/CTSM_DATM_DK-Ris_2004-2005.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2004" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2005" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/DK-Sor/shell_commands b/cime_config/usermods_dirs/PLUMBER2/DK-Sor/shell_commands index 1748d52204..4868bd8135 100644 --- a/cime_config/usermods_dirs/PLUMBER2/DK-Sor/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/DK-Sor/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_DK-Sor_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/DK-Sor/CLM1PT_data/CTSM_DATM_DK-Sor_1997-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=1997" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/DK-ZaH/shell_commands b/cime_config/usermods_dirs/PLUMBER2/DK-ZaH/shell_commands index ea72cc14c4..5d9e5c6e54 100644 --- a/cime_config/usermods_dirs/PLUMBER2/DK-ZaH/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/DK-ZaH/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=0 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_DK-ZaH_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/DK-ZaH/CLM1PT_data/CTSM_DATM_DK-ZaH_2000-2013.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2000" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2013" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/ES-ES1/shell_commands b/cime_config/usermods_dirs/PLUMBER2/ES-ES1/shell_commands index 38e841b51c..7d7da13008 100644 --- a/cime_config/usermods_dirs/PLUMBER2/ES-ES1/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/ES-ES1/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_ES-ES1_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/ES-ES1/CLM1PT_data/CTSM_DATM_ES-ES1_1999-2006.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=1999" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2006" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/ES-ES2/shell_commands b/cime_config/usermods_dirs/PLUMBER2/ES-ES2/shell_commands index 47fae079e6..83905f3813 100644 --- a/cime_config/usermods_dirs/PLUMBER2/ES-ES2/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/ES-ES2/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_ES-ES2_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/ES-ES2/CLM1PT_data/CTSM_DATM_ES-ES2_2005-2006.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2005" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2006" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/ES-LMa/shell_commands b/cime_config/usermods_dirs/PLUMBER2/ES-LMa/shell_commands index f8a0283232..5b33bf0cca 100644 --- a/cime_config/usermods_dirs/PLUMBER2/ES-LMa/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/ES-LMa/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_ES-LMa_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/ES-LMa/CLM1PT_data/CTSM_DATM_ES-LMa_2004-2006.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2004" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2006" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/ES-LgS/shell_commands b/cime_config/usermods_dirs/PLUMBER2/ES-LgS/shell_commands index 8590e61f79..163fa43b1a 100644 --- a/cime_config/usermods_dirs/PLUMBER2/ES-LgS/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/ES-LgS/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_ES-LgS_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/ES-LgS/CLM1PT_data/CTSM_DATM_ES-LgS_2007-2007.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2007" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2007" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/ES-VDA/shell_commands b/cime_config/usermods_dirs/PLUMBER2/ES-VDA/shell_commands index bec50968d6..055e4df543 100644 --- a/cime_config/usermods_dirs/PLUMBER2/ES-VDA/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/ES-VDA/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_ES-VDA_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/ES-VDA/CLM1PT_data/CTSM_DATM_ES-VDA_2004-2004.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2004" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2004" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/FI-Hyy/shell_commands b/cime_config/usermods_dirs/PLUMBER2/FI-Hyy/shell_commands index 46cd461773..f4dad2be34 100644 --- a/cime_config/usermods_dirs/PLUMBER2/FI-Hyy/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/FI-Hyy/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=79200 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_FI-Hyy_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/FI-Hyy/CLM1PT_data/CTSM_DATM_FI-Hyy_1996-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=1996" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/FI-Kaa/shell_commands b/cime_config/usermods_dirs/PLUMBER2/FI-Kaa/shell_commands index db4e320ca0..fcf3a3b6a0 100644 --- a/cime_config/usermods_dirs/PLUMBER2/FI-Kaa/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/FI-Kaa/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=79200 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_FI-Kaa_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/FI-Kaa/CLM1PT_data/CTSM_DATM_FI-Kaa_2000-2002.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2000" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2002" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/FI-Lom/shell_commands b/cime_config/usermods_dirs/PLUMBER2/FI-Lom/shell_commands index 844403dfc4..4e3f36e65f 100644 --- a/cime_config/usermods_dirs/PLUMBER2/FI-Lom/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/FI-Lom/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=79200 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_FI-Lom_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/FI-Lom/CLM1PT_data/CTSM_DATM_FI-Lom_2007-2009.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2007" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2009" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/FI-Sod/shell_commands b/cime_config/usermods_dirs/PLUMBER2/FI-Sod/shell_commands index be6e3a2eba..c716a66993 100644 --- a/cime_config/usermods_dirs/PLUMBER2/FI-Sod/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/FI-Sod/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=79200 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_FI-Sod_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/FI-Sod/CLM1PT_data/CTSM_DATM_FI-Sod_2008-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2008" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/FR-Fon/shell_commands b/cime_config/usermods_dirs/PLUMBER2/FR-Fon/shell_commands index 946c9b84fc..4ced43e5ff 100644 --- a/cime_config/usermods_dirs/PLUMBER2/FR-Fon/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/FR-Fon/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_FR-Fon_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/FR-Fon/CLM1PT_data/CTSM_DATM_FR-Fon_2005-2013.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2005" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2013" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/FR-Gri/shell_commands b/cime_config/usermods_dirs/PLUMBER2/FR-Gri/shell_commands index fd29463244..6821e30d5a 100644 --- a/cime_config/usermods_dirs/PLUMBER2/FR-Gri/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/FR-Gri/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_FR-Gri_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/FR-Gri/CLM1PT_data/CTSM_DATM_FR-Gri_2005-2013.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2005" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2013" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/FR-Hes/shell_commands b/cime_config/usermods_dirs/PLUMBER2/FR-Hes/shell_commands index 88900143b1..ba56b6dfd4 100644 --- a/cime_config/usermods_dirs/PLUMBER2/FR-Hes/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/FR-Hes/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_FR-Hes_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/FR-Hes/CLM1PT_data/CTSM_DATM_FR-Hes_1997-2006.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=1997" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2006" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/FR-LBr/shell_commands b/cime_config/usermods_dirs/PLUMBER2/FR-LBr/shell_commands index 29c9c95ab7..491b472fda 100644 --- a/cime_config/usermods_dirs/PLUMBER2/FR-LBr/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/FR-LBr/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_FR-LBr_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/FR-LBr/CLM1PT_data/CTSM_DATM_FR-LBr_2003-2008.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2003" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2008" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/FR-Lq1/shell_commands b/cime_config/usermods_dirs/PLUMBER2/FR-Lq1/shell_commands index 676f8af611..bcda561678 100644 --- a/cime_config/usermods_dirs/PLUMBER2/FR-Lq1/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/FR-Lq1/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_FR-Lq1_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/FR-Lq1/CLM1PT_data/CTSM_DATM_FR-Lq1_2004-2006.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2004" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2006" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/FR-Lq2/shell_commands b/cime_config/usermods_dirs/PLUMBER2/FR-Lq2/shell_commands index b407160bb9..24847656fb 100644 --- a/cime_config/usermods_dirs/PLUMBER2/FR-Lq2/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/FR-Lq2/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_FR-Lq2_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/FR-Lq2/CLM1PT_data/CTSM_DATM_FR-Lq2_2004-2006.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2004" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2006" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/FR-Pue/shell_commands b/cime_config/usermods_dirs/PLUMBER2/FR-Pue/shell_commands index b226175943..781321d36a 100644 --- a/cime_config/usermods_dirs/PLUMBER2/FR-Pue/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/FR-Pue/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_FR-Pue_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/FR-Pue/CLM1PT_data/CTSM_DATM_FR-Pue_2000-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2000" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/GF-Guy/shell_commands b/cime_config/usermods_dirs/PLUMBER2/GF-Guy/shell_commands index 1fef6cf769..25d9b73407 100644 --- a/cime_config/usermods_dirs/PLUMBER2/GF-Guy/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/GF-Guy/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=10800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_GF-Guy_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/GF-Guy/CLM1PT_data/CTSM_DATM_GF-Guy_2004-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2004" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/HU-Bug/shell_commands b/cime_config/usermods_dirs/PLUMBER2/HU-Bug/shell_commands index a4cf969235..188f13bb21 100644 --- a/cime_config/usermods_dirs/PLUMBER2/HU-Bug/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/HU-Bug/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_HU-Bug_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/HU-Bug/CLM1PT_data/CTSM_DATM_HU-Bug_2003-2006.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2003" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2006" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/ID-Pag/shell_commands b/cime_config/usermods_dirs/PLUMBER2/ID-Pag/shell_commands index 794fdabba3..43ba6c29ba 100644 --- a/cime_config/usermods_dirs/PLUMBER2/ID-Pag/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/ID-Pag/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=61200 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_ID-Pag_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/ID-Pag/CLM1PT_data/CTSM_DATM_ID-Pag_2002-2003.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2002" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2003" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/IE-Ca1/shell_commands b/cime_config/usermods_dirs/PLUMBER2/IE-Ca1/shell_commands index 376f21bf88..f202a45e45 100644 --- a/cime_config/usermods_dirs/PLUMBER2/IE-Ca1/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/IE-Ca1/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=0 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_IE-Ca1_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/IE-Ca1/CLM1PT_data/CTSM_DATM_IE-Ca1_2004-2006.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2004" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2006" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/IE-Dri/shell_commands b/cime_config/usermods_dirs/PLUMBER2/IE-Dri/shell_commands index 34bf806e19..2cbf857d0a 100644 --- a/cime_config/usermods_dirs/PLUMBER2/IE-Dri/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/IE-Dri/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=0 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_IE-Dri_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/IE-Dri/CLM1PT_data/CTSM_DATM_IE-Dri_2003-2005.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2003" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2005" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/IT-Amp/shell_commands b/cime_config/usermods_dirs/PLUMBER2/IT-Amp/shell_commands index d0f80bd240..b52c8d408d 100644 --- a/cime_config/usermods_dirs/PLUMBER2/IT-Amp/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/IT-Amp/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_IT-Amp_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/IT-Amp/CLM1PT_data/CTSM_DATM_IT-Amp_2003-2006.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2003" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2006" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/IT-BCi/shell_commands b/cime_config/usermods_dirs/PLUMBER2/IT-BCi/shell_commands index 5c95ebd5cb..8399009a3c 100644 --- a/cime_config/usermods_dirs/PLUMBER2/IT-BCi/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/IT-BCi/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_IT-BCi_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/IT-BCi/CLM1PT_data/CTSM_DATM_IT-BCi_2005-2010.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2005" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2010" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/IT-CA1/shell_commands b/cime_config/usermods_dirs/PLUMBER2/IT-CA1/shell_commands index 4218939b8e..6358580049 100644 --- a/cime_config/usermods_dirs/PLUMBER2/IT-CA1/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/IT-CA1/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_IT-CA1_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/IT-CA1/CLM1PT_data/CTSM_DATM_IT-CA1_2012-2013.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2012" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2013" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/IT-CA2/shell_commands b/cime_config/usermods_dirs/PLUMBER2/IT-CA2/shell_commands index f3e82597af..57eb7da218 100644 --- a/cime_config/usermods_dirs/PLUMBER2/IT-CA2/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/IT-CA2/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_IT-CA2_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/IT-CA2/CLM1PT_data/CTSM_DATM_IT-CA2_2012-2013.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2012" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2013" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/IT-CA3/shell_commands b/cime_config/usermods_dirs/PLUMBER2/IT-CA3/shell_commands index de8970f1e3..b1e2439541 100644 --- a/cime_config/usermods_dirs/PLUMBER2/IT-CA3/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/IT-CA3/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_IT-CA3_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/IT-CA3/CLM1PT_data/CTSM_DATM_IT-CA3_2012-2013.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2012" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2013" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/IT-Col/shell_commands b/cime_config/usermods_dirs/PLUMBER2/IT-Col/shell_commands index 37ab868476..a842fcbe02 100644 --- a/cime_config/usermods_dirs/PLUMBER2/IT-Col/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/IT-Col/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_IT-Col_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/IT-Col/CLM1PT_data/CTSM_DATM_IT-Col_2007-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2007" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/IT-Cpz/shell_commands b/cime_config/usermods_dirs/PLUMBER2/IT-Cpz/shell_commands index e7bc47b3b0..7a6db3d102 100644 --- a/cime_config/usermods_dirs/PLUMBER2/IT-Cpz/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/IT-Cpz/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_IT-Cpz_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/IT-Cpz/CLM1PT_data/CTSM_DATM_IT-Cpz_2001-2008.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2001" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2008" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/IT-Isp/shell_commands b/cime_config/usermods_dirs/PLUMBER2/IT-Isp/shell_commands index 6cf225d172..e82c5cfa8f 100644 --- a/cime_config/usermods_dirs/PLUMBER2/IT-Isp/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/IT-Isp/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_IT-Isp_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/IT-Isp/CLM1PT_data/CTSM_DATM_IT-Isp_2013-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2013" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/IT-LMa/shell_commands b/cime_config/usermods_dirs/PLUMBER2/IT-LMa/shell_commands index 8b388aedb4..c1f95210e6 100644 --- a/cime_config/usermods_dirs/PLUMBER2/IT-LMa/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/IT-LMa/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_IT-LMa_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/IT-LMa/CLM1PT_data/CTSM_DATM_IT-LMa_2003-2004.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2003" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2004" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/IT-Lav/shell_commands b/cime_config/usermods_dirs/PLUMBER2/IT-Lav/shell_commands index 1f7f728803..33c3d49053 100644 --- a/cime_config/usermods_dirs/PLUMBER2/IT-Lav/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/IT-Lav/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_IT-Lav_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/IT-Lav/CLM1PT_data/CTSM_DATM_IT-Lav_2005-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2005" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/IT-MBo/shell_commands b/cime_config/usermods_dirs/PLUMBER2/IT-MBo/shell_commands index 26ffc80458..02952affac 100644 --- a/cime_config/usermods_dirs/PLUMBER2/IT-MBo/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/IT-MBo/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_IT-MBo_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/IT-MBo/CLM1PT_data/CTSM_DATM_IT-MBo_2003-2012.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2003" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2012" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/IT-Mal/shell_commands b/cime_config/usermods_dirs/PLUMBER2/IT-Mal/shell_commands index 6559976180..91f623aab1 100644 --- a/cime_config/usermods_dirs/PLUMBER2/IT-Mal/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/IT-Mal/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_IT-Mal_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/IT-Mal/CLM1PT_data/CTSM_DATM_IT-Mal_2003-2003.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2003" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2003" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/IT-Noe/shell_commands b/cime_config/usermods_dirs/PLUMBER2/IT-Noe/shell_commands index 58be23bcd1..f75f23d917 100644 --- a/cime_config/usermods_dirs/PLUMBER2/IT-Noe/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/IT-Noe/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_IT-Noe_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/IT-Noe/CLM1PT_data/CTSM_DATM_IT-Noe_2004-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2004" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/IT-Non/shell_commands b/cime_config/usermods_dirs/PLUMBER2/IT-Non/shell_commands index 785443e0f1..af53f49fb9 100644 --- a/cime_config/usermods_dirs/PLUMBER2/IT-Non/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/IT-Non/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_IT-Non_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/IT-Non/CLM1PT_data/CTSM_DATM_IT-Non_2002-2002.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2002" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2002" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/IT-PT1/shell_commands b/cime_config/usermods_dirs/PLUMBER2/IT-PT1/shell_commands index e7c30a4e36..e6af3c6a16 100644 --- a/cime_config/usermods_dirs/PLUMBER2/IT-PT1/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/IT-PT1/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_IT-PT1_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/IT-PT1/CLM1PT_data/CTSM_DATM_IT-PT1_2003-2004.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2003" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2004" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/IT-Ren/shell_commands b/cime_config/usermods_dirs/PLUMBER2/IT-Ren/shell_commands index dc1b5630d0..1793711024 100644 --- a/cime_config/usermods_dirs/PLUMBER2/IT-Ren/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/IT-Ren/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_IT-Ren_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/IT-Ren/CLM1PT_data/CTSM_DATM_IT-Ren_2010-2013.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2010" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2013" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/IT-Ro1/shell_commands b/cime_config/usermods_dirs/PLUMBER2/IT-Ro1/shell_commands index 865f76ae9b..ddc9c0868e 100644 --- a/cime_config/usermods_dirs/PLUMBER2/IT-Ro1/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/IT-Ro1/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_IT-Ro1_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/IT-Ro1/CLM1PT_data/CTSM_DATM_IT-Ro1_2002-2006.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2002" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2006" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/IT-Ro2/shell_commands b/cime_config/usermods_dirs/PLUMBER2/IT-Ro2/shell_commands index 401cfcf30b..4e87a351a6 100644 --- a/cime_config/usermods_dirs/PLUMBER2/IT-Ro2/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/IT-Ro2/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_IT-Ro2_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/IT-Ro2/CLM1PT_data/CTSM_DATM_IT-Ro2_2002-2008.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2002" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2008" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/IT-SR2/shell_commands b/cime_config/usermods_dirs/PLUMBER2/IT-SR2/shell_commands index 7926235386..1604053cce 100644 --- a/cime_config/usermods_dirs/PLUMBER2/IT-SR2/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/IT-SR2/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_IT-SR2_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/IT-SR2/CLM1PT_data/CTSM_DATM_IT-SR2_2013-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2013" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/IT-SRo/shell_commands b/cime_config/usermods_dirs/PLUMBER2/IT-SRo/shell_commands index 8dbeedc751..5b89dbff9e 100644 --- a/cime_config/usermods_dirs/PLUMBER2/IT-SRo/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/IT-SRo/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_IT-SRo_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/IT-SRo/CLM1PT_data/CTSM_DATM_IT-SRo_2003-2012.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2003" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2012" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/JP-SMF/shell_commands b/cime_config/usermods_dirs/PLUMBER2/JP-SMF/shell_commands index 6af519cf5d..b9c962fafc 100644 --- a/cime_config/usermods_dirs/PLUMBER2/JP-SMF/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/JP-SMF/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=54000 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_JP-SMF_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/JP-SMF/CLM1PT_data/CTSM_DATM_JP-SMF_2003-2006.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2003" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2006" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/NL-Ca1/shell_commands b/cime_config/usermods_dirs/PLUMBER2/NL-Ca1/shell_commands index 26b6fda5a4..4b46b3c6f0 100644 --- a/cime_config/usermods_dirs/PLUMBER2/NL-Ca1/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/NL-Ca1/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_NL-Ca1_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/NL-Ca1/CLM1PT_data/CTSM_DATM_NL-Ca1_2003-2006.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2003" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2006" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/NL-Hor/shell_commands b/cime_config/usermods_dirs/PLUMBER2/NL-Hor/shell_commands index ec509840af..dc5e4e1741 100644 --- a/cime_config/usermods_dirs/PLUMBER2/NL-Hor/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/NL-Hor/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_NL-Hor_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/NL-Hor/CLM1PT_data/CTSM_DATM_NL-Hor_2008-2011.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2008" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2011" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/NL-Loo/shell_commands b/cime_config/usermods_dirs/PLUMBER2/NL-Loo/shell_commands index 3bcbfbbc35..a7d5784572 100644 --- a/cime_config/usermods_dirs/PLUMBER2/NL-Loo/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/NL-Loo/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_NL-Loo_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/NL-Loo/CLM1PT_data/CTSM_DATM_NL-Loo_1997-2013.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=1997" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2013" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/PL-wet/shell_commands b/cime_config/usermods_dirs/PLUMBER2/PL-wet/shell_commands index 4eb88c995a..e68c1a7aa0 100644 --- a/cime_config/usermods_dirs/PLUMBER2/PL-wet/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/PL-wet/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_PL-wet_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/PL-wet/CLM1PT_data/CTSM_DATM_PL-wet_2004-2005.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2004" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2005" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/PT-Esp/shell_commands b/cime_config/usermods_dirs/PLUMBER2/PT-Esp/shell_commands index 224920cbf7..5dd7ac93cf 100644 --- a/cime_config/usermods_dirs/PLUMBER2/PT-Esp/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/PT-Esp/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=0 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_PT-Esp_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/PT-Esp/CLM1PT_data/CTSM_DATM_PT-Esp_2002-2004.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2002" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2004" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/PT-Mi1/shell_commands b/cime_config/usermods_dirs/PLUMBER2/PT-Mi1/shell_commands index 74413f5f5e..dcb9da9c25 100644 --- a/cime_config/usermods_dirs/PLUMBER2/PT-Mi1/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/PT-Mi1/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=0 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_PT-Mi1_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/PT-Mi1/CLM1PT_data/CTSM_DATM_PT-Mi1_2005-2005.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2005" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2005" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/PT-Mi2/shell_commands b/cime_config/usermods_dirs/PLUMBER2/PT-Mi2/shell_commands index f9aa12224c..40e570aa82 100644 --- a/cime_config/usermods_dirs/PLUMBER2/PT-Mi2/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/PT-Mi2/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=0 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_PT-Mi2_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/PT-Mi2/CLM1PT_data/CTSM_DATM_PT-Mi2_2005-2006.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2005" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2006" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/RU-Che/shell_commands b/cime_config/usermods_dirs/PLUMBER2/RU-Che/shell_commands index 4abca52cae..6737ea4985 100644 --- a/cime_config/usermods_dirs/PLUMBER2/RU-Che/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/RU-Che/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=46800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_RU-Che_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/RU-Che/CLM1PT_data/CTSM_DATM_RU-Che_2003-2004.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2003" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2004" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/RU-Fyo/shell_commands b/cime_config/usermods_dirs/PLUMBER2/RU-Fyo/shell_commands index 74c3693f71..ce11407552 100644 --- a/cime_config/usermods_dirs/PLUMBER2/RU-Fyo/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/RU-Fyo/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=75600 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_RU-Fyo_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/RU-Fyo/CLM1PT_data/CTSM_DATM_RU-Fyo_2003-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2003" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/RU-Zot/shell_commands b/cime_config/usermods_dirs/PLUMBER2/RU-Zot/shell_commands index b68d328625..a51ddc4edd 100644 --- a/cime_config/usermods_dirs/PLUMBER2/RU-Zot/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/RU-Zot/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=61200 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_RU-Zot_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/RU-Zot/CLM1PT_data/CTSM_DATM_RU-Zot_2003-2003.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2003" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2003" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/SD-Dem/shell_commands b/cime_config/usermods_dirs/PLUMBER2/SD-Dem/shell_commands index b2e63de838..de45fdf737 100644 --- a/cime_config/usermods_dirs/PLUMBER2/SD-Dem/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/SD-Dem/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=75600 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_SD-Dem_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/SD-Dem/CLM1PT_data/CTSM_DATM_SD-Dem_2005-2009.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2005" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2009" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/SE-Deg/shell_commands b/cime_config/usermods_dirs/PLUMBER2/SE-Deg/shell_commands index dfc8e4b83f..4d7588829f 100644 --- a/cime_config/usermods_dirs/PLUMBER2/SE-Deg/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/SE-Deg/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_SE-Deg_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/SE-Deg/CLM1PT_data/CTSM_DATM_SE-Deg_2002-2005.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2002" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2005" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/UK-Gri/shell_commands b/cime_config/usermods_dirs/PLUMBER2/UK-Gri/shell_commands index efa3a6f1ae..da714e6178 100644 --- a/cime_config/usermods_dirs/PLUMBER2/UK-Gri/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/UK-Gri/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=0 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_UK-Gri_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/UK-Gri/CLM1PT_data/CTSM_DATM_UK-Gri_2000-2001.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2000" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2001" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/UK-Ham/shell_commands b/cime_config/usermods_dirs/PLUMBER2/UK-Ham/shell_commands index 47143973d4..22aa28cd0b 100644 --- a/cime_config/usermods_dirs/PLUMBER2/UK-Ham/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/UK-Ham/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=0 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_UK-Ham_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/UK-Ham/CLM1PT_data/CTSM_DATM_UK-Ham_2004-2004.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2004" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2004" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/UK-PL3/shell_commands b/cime_config/usermods_dirs/PLUMBER2/UK-PL3/shell_commands index 161de2a08e..c772c6ff8e 100644 --- a/cime_config/usermods_dirs/PLUMBER2/UK-PL3/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/UK-PL3/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=0 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_UK-PL3_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/UK-PL3/CLM1PT_data/CTSM_DATM_UK-PL3_2005-2006.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2005" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2006" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-AR1/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-AR1/shell_commands index 727e21a389..3f9e11af10 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-AR1/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-AR1/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=21600 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_US-AR1_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-AR1/CLM1PT_data/CTSM_DATM_US-AR1_2010-2012.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2010" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2012" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-AR2/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-AR2/shell_commands index 5de187cd7a..6e9befc1c3 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-AR2/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-AR2/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=21600 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_US-AR2_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-AR2/CLM1PT_data/CTSM_DATM_US-AR2_2010-2011.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2010" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2011" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-ARM/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-ARM/shell_commands index da1de52a6e..7ff3c302f2 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-ARM/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-ARM/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=21600 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_US-ARM_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-ARM/CLM1PT_data/CTSM_DATM_US-ARM_2003-2012.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2003" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2012" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-Aud/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-Aud/shell_commands index 47ae3dd4d9..d044d71d9c 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-Aud/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-Aud/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=25200 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_US-Aud_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-Aud/CLM1PT_data/CTSM_DATM_US-Aud_2003-2005.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2003" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2005" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-Bar/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-Bar/shell_commands index 2d24f07e53..ca97f023f7 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-Bar/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-Bar/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=18000 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_US-Bar_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-Bar/CLM1PT_data/CTSM_DATM_US-Bar_2005-2005.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2005" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2005" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-Bkg/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-Bkg/shell_commands index 9fb49876da..1341c5ed9a 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-Bkg/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-Bkg/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=21600 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_US-Bkg_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-Bkg/CLM1PT_data/CTSM_DATM_US-Bkg_2005-2006.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2005" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2006" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-Blo/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-Blo/shell_commands index c208c920f7..40fd33b704 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-Blo/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-Blo/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=28800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_US-Blo_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-Blo/CLM1PT_data/CTSM_DATM_US-Blo_2000-2006.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2000" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2006" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-Bo1/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-Bo1/shell_commands index c802acf23c..be837ab2d1 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-Bo1/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-Bo1/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=21600 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_US-Bo1_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-Bo1/CLM1PT_data/CTSM_DATM_US-Bo1_1997-2006.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=1997" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2006" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-Cop/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-Cop/shell_commands index d66d11a697..3fbe5a7442 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-Cop/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-Cop/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=25200 ./xmlchange ATM_NCPL=24 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_US-Cop_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-Cop/CLM1PT_data/CTSM_DATM_US-Cop_2002-2003.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2002" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2003" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-FPe/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-FPe/shell_commands index 621e4156ed..980fe40609 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-FPe/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-FPe/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=25200 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_US-FPe_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-FPe/CLM1PT_data/CTSM_DATM_US-FPe_2000-2006.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2000" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2006" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-GLE/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-GLE/shell_commands index a7548fbb53..b79cbbde03 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-GLE/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-GLE/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=25200 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_US-GLE_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-GLE/CLM1PT_data/CTSM_DATM_US-GLE_2009-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2009" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-Goo/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-Goo/shell_commands index ee1cf13767..a59dded80f 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-Goo/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-Goo/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=21600 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_US-Goo_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-Goo/CLM1PT_data/CTSM_DATM_US-Goo_2004-2006.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2004" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2006" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-Ha1/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-Ha1/shell_commands index 43d55bdbd1..863fe24c3d 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-Ha1/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-Ha1/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=18000 ./xmlchange ATM_NCPL=24 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_US-Ha1_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-Ha1/CLM1PT_data/CTSM_DATM_US-Ha1_1992-2012.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=1992" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2012" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-Ho1/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-Ho1/shell_commands index 7e9bda46b2..87a2d1d4f8 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-Ho1/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-Ho1/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=18000 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_US-Ho1_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-Ho1/CLM1PT_data/CTSM_DATM_US-Ho1_1996-2004.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=1996" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2004" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-KS2/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-KS2/shell_commands index 161a377821..a6d6ce7048 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-KS2/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-KS2/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=18000 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_US-KS2_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-KS2/CLM1PT_data/CTSM_DATM_US-KS2_2003-2006.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2003" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2006" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-Los/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-Los/shell_commands index b606ac7e9e..9c85ce58af 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-Los/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-Los/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=21600 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_US-Los_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-Los/CLM1PT_data/CTSM_DATM_US-Los_2000-2008.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2000" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2008" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-MMS/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-MMS/shell_commands index b817bac303..6ebdc0f52c 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-MMS/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-MMS/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=18000 ./xmlchange ATM_NCPL=24 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_US-MMS_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-MMS/CLM1PT_data/CTSM_DATM_US-MMS_1999-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=1999" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-MOz/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-MOz/shell_commands index a666ccbaf0..7ef79f2ac6 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-MOz/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-MOz/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=21600 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_US-MOz_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-MOz/CLM1PT_data/CTSM_DATM_US-MOz_2005-2006.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2005" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2006" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-Me2/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-Me2/shell_commands index e07240f14f..19325ead49 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-Me2/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-Me2/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=28800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_US-Me2_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-Me2/CLM1PT_data/CTSM_DATM_US-Me2_2002-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2002" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-Me4/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-Me4/shell_commands index 6b26c589d9..43b2a75513 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-Me4/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-Me4/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=28800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_US-Me4_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-Me4/CLM1PT_data/CTSM_DATM_US-Me4_1996-2000.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=1996" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2000" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-Me6/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-Me6/shell_commands index 6056ec6552..ffb7538463 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-Me6/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-Me6/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=28800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_US-Me6_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-Me6/CLM1PT_data/CTSM_DATM_US-Me6_2011-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2011" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-Myb/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-Myb/shell_commands index 89c79b88bc..c1d6553e90 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-Myb/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-Myb/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=28800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_US-Myb_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-Myb/CLM1PT_data/CTSM_DATM_US-Myb_2011-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2011" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-NR1/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-NR1/shell_commands index 7185333ba0..a859ca34d6 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-NR1/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-NR1/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=25200 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_US-NR1_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-NR1/CLM1PT_data/CTSM_DATM_US-NR1_1999-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=1999" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-Ne1/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-Ne1/shell_commands index 5ec7590921..150a7109e9 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-Ne1/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-Ne1/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=21600 ./xmlchange ATM_NCPL=24 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_US-Ne1_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-Ne1/CLM1PT_data/CTSM_DATM_US-Ne1_2002-2012.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2002" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2012" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-Ne2/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-Ne2/shell_commands index 75d2215e6c..a43a4f0523 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-Ne2/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-Ne2/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=21600 ./xmlchange ATM_NCPL=24 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_US-Ne2_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-Ne2/CLM1PT_data/CTSM_DATM_US-Ne2_2002-2012.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2002" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2012" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-Ne3/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-Ne3/shell_commands index ceb48a35c0..cf8a20d653 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-Ne3/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-Ne3/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=21600 ./xmlchange ATM_NCPL=24 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_US-Ne3_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-Ne3/CLM1PT_data/CTSM_DATM_US-Ne3_2002-2012.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2002" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2012" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-PFa/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-PFa/shell_commands index e214fa5d26..a8c15c035c 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-PFa/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-PFa/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=21600 ./xmlchange ATM_NCPL=24 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_US-PFa_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-PFa/CLM1PT_data/CTSM_DATM_US-PFa_1995-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=1995" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-Prr/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-Prr/shell_commands index 0be161a3f5..6d34756259 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-Prr/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-Prr/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=32400 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_US-Prr_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-Prr/CLM1PT_data/CTSM_DATM_US-Prr_2011-2013.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2011" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2013" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-SP1/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-SP1/shell_commands index b1944933fe..ef3192eac3 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-SP1/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-SP1/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=18000 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_US-SP1_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-SP1/CLM1PT_data/CTSM_DATM_US-SP1_2005-2005.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2005" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2005" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-SP2/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-SP2/shell_commands index 9ec9b25681..b070c1123b 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-SP2/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-SP2/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=18000 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_US-SP2_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-SP2/CLM1PT_data/CTSM_DATM_US-SP2_2000-2004.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2000" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2004" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-SP3/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-SP3/shell_commands index 72c94ad6a5..fbf338ca93 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-SP3/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-SP3/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=18000 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_US-SP3_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-SP3/CLM1PT_data/CTSM_DATM_US-SP3_1999-2004.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=1999" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2004" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-SRG/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-SRG/shell_commands index 53c07383d3..2f102954ef 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-SRG/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-SRG/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=25200 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_US-SRG_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-SRG/CLM1PT_data/CTSM_DATM_US-SRG_2009-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2009" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-SRM/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-SRM/shell_commands index f8ab5b5b89..a930aeb922 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-SRM/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-SRM/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=25200 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_US-SRM_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-SRM/CLM1PT_data/CTSM_DATM_US-SRM_2004-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2004" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-Syv/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-Syv/shell_commands index 7bd8324a6d..8b95474d55 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-Syv/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-Syv/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=21600 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_US-Syv_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-Syv/CLM1PT_data/CTSM_DATM_US-Syv_2002-2008.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2002" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2008" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-Ton/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-Ton/shell_commands index 2ac988eb2f..8fc48db2e3 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-Ton/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-Ton/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=28800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_US-Ton_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-Ton/CLM1PT_data/CTSM_DATM_US-Ton_2001-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2001" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-Tw4/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-Tw4/shell_commands index 0895943d1c..e9b5fb0a4d 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-Tw4/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-Tw4/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=28800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_US-Tw4_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-Tw4/CLM1PT_data/CTSM_DATM_US-Tw4_2014-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2014" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-Twt/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-Twt/shell_commands index 77649de143..d49419e72f 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-Twt/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-Twt/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=28800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_US-Twt_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-Twt/CLM1PT_data/CTSM_DATM_US-Twt_2010-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2010" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-UMB/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-UMB/shell_commands index 511e7e05c3..54b64467c3 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-UMB/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-UMB/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=18000 ./xmlchange ATM_NCPL=24 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_US-UMB_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-UMB/CLM1PT_data/CTSM_DATM_US-UMB_2000-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2000" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-Var/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-Var/shell_commands index 8cbb483737..84c0fb82a0 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-Var/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-Var/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=28800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_US-Var_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-Var/CLM1PT_data/CTSM_DATM_US-Var_2001-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2001" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-WCr/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-WCr/shell_commands index adcfb2eec4..e5aa83d4a4 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-WCr/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-WCr/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=21600 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_US-WCr_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-WCr/CLM1PT_data/CTSM_DATM_US-WCr_1999-2006.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=1999" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2006" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-Whs/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-Whs/shell_commands index 0f091925f1..5e81cc5524 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-Whs/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-Whs/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=25200 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_US-Whs_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-Whs/CLM1PT_data/CTSM_DATM_US-Whs_2008-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2008" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-Wkg/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-Wkg/shell_commands index da4a18b3f9..324cf4860f 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-Wkg/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-Wkg/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=25200 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_US-Wkg_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-Wkg/CLM1PT_data/CTSM_DATM_US-Wkg_2005-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2005" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/ZA-Kru/shell_commands b/cime_config/usermods_dirs/PLUMBER2/ZA-Kru/shell_commands index 016f4e4038..138996eda2 100644 --- a/cime_config/usermods_dirs/PLUMBER2/ZA-Kru/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/ZA-Kru/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=79200 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_ZA-Kru_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/ZA-Kru/CLM1PT_data/CTSM_DATM_ZA-Kru_2000-2002.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2000" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2002" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/ZM-Mon/shell_commands b/cime_config/usermods_dirs/PLUMBER2/ZM-Mon/shell_commands index 2729227ecc..8443f0a13b 100644 --- a/cime_config/usermods_dirs/PLUMBER2/ZM-Mon/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/ZM-Mon/shell_commands @@ -4,7 +4,6 @@ ./xmlchange START_TOD=79200 ./xmlchange ATM_NCPL=48 -echo "fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_ZM-Mon_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/ZM-Mon/CLM1PT_data/CTSM_DATM_ZM-Mon_2008-2008.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2008" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2008" >> user_nl_datm_streams From 932d07e217d917df70c44b03183d5ba4151b2290 Mon Sep 17 00:00:00 2001 From: wwieder Date: Mon, 22 Apr 2024 17:49:22 -0600 Subject: [PATCH 0907/1248] keep hack to point to 5.2 surface data files --- cime_config/usermods_dirs/PLUMBER2/AR-SLu/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/AT-Neu/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/AU-ASM/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/AU-Cow/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/AU-Cpr/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/AU-Ctr/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/AU-Cum/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/AU-DaP/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/AU-DaS/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/AU-Dry/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/AU-Emr/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/AU-GWW/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/AU-Gin/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/AU-How/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/AU-Lit/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/AU-Otw/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/AU-Rig/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/AU-Rob/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/AU-Sam/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/AU-Stp/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/AU-TTE/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/AU-Tum/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/AU-Whr/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/AU-Wrr/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/AU-Ync/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/BE-Bra/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/BE-Lon/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/BE-Vie/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/BR-Sa3/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/BW-Ma1/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/CA-NS1/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/CA-NS2/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/CA-NS4/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/CA-NS5/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/CA-NS6/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/CA-NS7/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/CA-Qcu/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/CA-Qfo/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/CA-SF1/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/CA-SF2/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/CA-SF3/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/CH-Cha/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/CH-Dav/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/CH-Fru/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/CH-Oe1/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/CN-Cha/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/CN-Cng/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/CN-Dan/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/CN-Din/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/CN-Du2/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/CN-HaM/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/CN-Qia/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/CZ-wet/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/DE-Bay/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/DE-Geb/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/DE-Gri/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/DE-Hai/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/DE-Kli/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/DE-Meh/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/DE-Obe/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/DE-Seh/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/DE-SfN/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/DE-Tha/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/DE-Wet/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/DK-Fou/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/DK-Lva/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/DK-Ris/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/DK-Sor/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/DK-ZaH/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/ES-ES1/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/ES-ES2/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/ES-LMa/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/ES-LgS/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/ES-VDA/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/FI-Hyy/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/FI-Kaa/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/FI-Lom/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/FI-Sod/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/FR-Fon/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/FR-Gri/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/FR-Hes/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/FR-LBr/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/FR-Lq1/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/FR-Lq2/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/FR-Pue/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/GF-Guy/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/HU-Bug/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/ID-Pag/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/IE-Ca1/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/IE-Dri/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/IT-Amp/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/IT-BCi/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/IT-CA1/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/IT-CA2/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/IT-CA3/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/IT-Col/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/IT-Cpz/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/IT-Isp/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/IT-LMa/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/IT-Lav/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/IT-MBo/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/IT-Mal/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/IT-Noe/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/IT-Non/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/IT-PT1/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/IT-Ren/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/IT-Ro1/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/IT-Ro2/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/IT-SR2/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/IT-SRo/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/JP-SMF/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/NL-Ca1/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/NL-Hor/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/NL-Loo/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/PL-wet/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/PT-Esp/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/PT-Mi1/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/PT-Mi2/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/RU-Che/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/RU-Fyo/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/RU-Zot/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/SD-Dem/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/SE-Deg/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/UK-Gri/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/UK-Ham/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/UK-PL3/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/US-AR1/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/US-AR2/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/US-ARM/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/US-Aud/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/US-Bar/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/US-Bkg/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/US-Blo/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/US-Bo1/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/US-Cop/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/US-FPe/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/US-GLE/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/US-Goo/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/US-Ha1/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/US-Ho1/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/US-KS2/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/US-Los/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/US-MMS/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/US-MOz/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/US-Me2/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/US-Me4/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/US-Me6/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/US-Myb/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/US-NR1/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/US-Ne1/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/US-Ne2/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/US-Ne3/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/US-PFa/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/US-Prr/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/US-SP1/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/US-SP2/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/US-SP3/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/US-SRG/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/US-SRM/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/US-Syv/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/US-Ton/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/US-Tw4/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/US-Twt/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/US-UMB/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/US-Var/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/US-WCr/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/US-Whs/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/US-Wkg/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/ZA-Kru/shell_commands | 1 + cime_config/usermods_dirs/PLUMBER2/ZM-Mon/shell_commands | 1 + 170 files changed, 170 insertions(+) diff --git a/cime_config/usermods_dirs/PLUMBER2/AR-SLu/shell_commands b/cime_config/usermods_dirs/PLUMBER2/AR-SLu/shell_commands index 67baebcf55..44e145ec9c 100644 --- a/cime_config/usermods_dirs/PLUMBER2/AR-SLu/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/AR-SLu/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=10800 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_AR-SLu_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/AR-SLu/CLM1PT_data/CTSM_DATM_AR-SLu_2010-2010.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2010" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2010" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/AT-Neu/shell_commands b/cime_config/usermods_dirs/PLUMBER2/AT-Neu/shell_commands index 0efd0fad67..8ea324b8a0 100644 --- a/cime_config/usermods_dirs/PLUMBER2/AT-Neu/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/AT-Neu/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_AT-Neu_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/AT-Neu/CLM1PT_data/CTSM_DATM_AT-Neu_2002-2012.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2002" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2012" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/AU-ASM/shell_commands b/cime_config/usermods_dirs/PLUMBER2/AU-ASM/shell_commands index bbb56c040d..301f741e84 100644 --- a/cime_config/usermods_dirs/PLUMBER2/AU-ASM/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/AU-ASM/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=54000 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_AU-ASM_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/AU-ASM/CLM1PT_data/CTSM_DATM_AU-ASM_2011-2017.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2011" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2017" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/AU-Cow/shell_commands b/cime_config/usermods_dirs/PLUMBER2/AU-Cow/shell_commands index 1d7734330f..ed9e62746f 100644 --- a/cime_config/usermods_dirs/PLUMBER2/AU-Cow/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/AU-Cow/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=50400 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_AU-Cow_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/AU-Cow/CLM1PT_data/CTSM_DATM_AU-Cow_2010-2015.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2010" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2015" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/AU-Cpr/shell_commands b/cime_config/usermods_dirs/PLUMBER2/AU-Cpr/shell_commands index fcf027b8c2..49a0df7f70 100644 --- a/cime_config/usermods_dirs/PLUMBER2/AU-Cpr/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/AU-Cpr/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=46800 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_AU-Cpr_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/AU-Cpr/CLM1PT_data/CTSM_DATM_AU-Cpr_2011-2017.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2011" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2017" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/AU-Ctr/shell_commands b/cime_config/usermods_dirs/PLUMBER2/AU-Ctr/shell_commands index 6ce2fe74b1..2a6fd56772 100644 --- a/cime_config/usermods_dirs/PLUMBER2/AU-Ctr/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/AU-Ctr/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=50400 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_AU-Ctr_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/AU-Ctr/CLM1PT_data/CTSM_DATM_AU-Ctr_2010-2017.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2010" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2017" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/AU-Cum/shell_commands b/cime_config/usermods_dirs/PLUMBER2/AU-Cum/shell_commands index 090c330641..210e549fa2 100644 --- a/cime_config/usermods_dirs/PLUMBER2/AU-Cum/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/AU-Cum/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=46800 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_AU-Cum_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/AU-Cum/CLM1PT_data/CTSM_DATM_AU-Cum_2013-2018.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2013" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2018" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/AU-DaP/shell_commands b/cime_config/usermods_dirs/PLUMBER2/AU-DaP/shell_commands index 27ebc931ee..f7692c9dfd 100644 --- a/cime_config/usermods_dirs/PLUMBER2/AU-DaP/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/AU-DaP/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=54000 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_AU-DaP_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/AU-DaP/CLM1PT_data/CTSM_DATM_AU-DaP_2009-2012.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2009" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2012" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/AU-DaS/shell_commands b/cime_config/usermods_dirs/PLUMBER2/AU-DaS/shell_commands index 4fd48d214d..194ca882da 100644 --- a/cime_config/usermods_dirs/PLUMBER2/AU-DaS/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/AU-DaS/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=54000 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_AU-DaS_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/AU-DaS/CLM1PT_data/CTSM_DATM_AU-DaS_2010-2017.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2010" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2017" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/AU-Dry/shell_commands b/cime_config/usermods_dirs/PLUMBER2/AU-Dry/shell_commands index b0b16bfa84..e1fa9be489 100644 --- a/cime_config/usermods_dirs/PLUMBER2/AU-Dry/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/AU-Dry/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=54000 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_AU-Dry_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/AU-Dry/CLM1PT_data/CTSM_DATM_AU-Dry_2011-2015.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2011" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2015" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/AU-Emr/shell_commands b/cime_config/usermods_dirs/PLUMBER2/AU-Emr/shell_commands index 2c84ebbe46..43d63b2b46 100644 --- a/cime_config/usermods_dirs/PLUMBER2/AU-Emr/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/AU-Emr/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=50400 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_AU-Emr_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/AU-Emr/CLM1PT_data/CTSM_DATM_AU-Emr_2012-2013.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2012" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2013" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/AU-GWW/shell_commands b/cime_config/usermods_dirs/PLUMBER2/AU-GWW/shell_commands index 5d07cef0a1..8eef1e7770 100644 --- a/cime_config/usermods_dirs/PLUMBER2/AU-GWW/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/AU-GWW/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=57600 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_AU-GWW_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/AU-GWW/CLM1PT_data/CTSM_DATM_AU-GWW_2013-2017.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2013" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2017" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/AU-Gin/shell_commands b/cime_config/usermods_dirs/PLUMBER2/AU-Gin/shell_commands index 0a193b5299..43a7ec4705 100644 --- a/cime_config/usermods_dirs/PLUMBER2/AU-Gin/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/AU-Gin/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=57600 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_AU-Gin_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/AU-Gin/CLM1PT_data/CTSM_DATM_AU-Gin_2012-2017.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2012" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2017" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/AU-How/shell_commands b/cime_config/usermods_dirs/PLUMBER2/AU-How/shell_commands index fb933852a1..3a0cc4f882 100644 --- a/cime_config/usermods_dirs/PLUMBER2/AU-How/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/AU-How/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=54000 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_AU-How_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/AU-How/CLM1PT_data/CTSM_DATM_AU-How_2003-2017.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2003" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2017" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/AU-Lit/shell_commands b/cime_config/usermods_dirs/PLUMBER2/AU-Lit/shell_commands index 07b31e742c..45d132bee8 100644 --- a/cime_config/usermods_dirs/PLUMBER2/AU-Lit/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/AU-Lit/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=54000 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_AU-Lit_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/AU-Lit/CLM1PT_data/CTSM_DATM_AU-Lit_2016-2017.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2016" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2017" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/AU-Otw/shell_commands b/cime_config/usermods_dirs/PLUMBER2/AU-Otw/shell_commands index 9cdc2603e3..7e63474531 100644 --- a/cime_config/usermods_dirs/PLUMBER2/AU-Otw/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/AU-Otw/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=46800 ./xmlchange ATM_NCPL=24 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_AU-Otw_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/AU-Otw/CLM1PT_data/CTSM_DATM_AU-Otw_2009-2010.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2009" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2010" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/AU-Rig/shell_commands b/cime_config/usermods_dirs/PLUMBER2/AU-Rig/shell_commands index a1f5c227c7..42bd3aac0c 100644 --- a/cime_config/usermods_dirs/PLUMBER2/AU-Rig/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/AU-Rig/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=46800 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_AU-Rig_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/AU-Rig/CLM1PT_data/CTSM_DATM_AU-Rig_2011-2016.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2011" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2016" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/AU-Rob/shell_commands b/cime_config/usermods_dirs/PLUMBER2/AU-Rob/shell_commands index 491c105b41..e51b36d89e 100644 --- a/cime_config/usermods_dirs/PLUMBER2/AU-Rob/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/AU-Rob/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=50400 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_AU-Rob_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/AU-Rob/CLM1PT_data/CTSM_DATM_AU-Rob_2014-2017.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2014" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2017" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/AU-Sam/shell_commands b/cime_config/usermods_dirs/PLUMBER2/AU-Sam/shell_commands index cc4780d142..919e322e8c 100644 --- a/cime_config/usermods_dirs/PLUMBER2/AU-Sam/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/AU-Sam/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=50400 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_AU-Sam_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/AU-Sam/CLM1PT_data/CTSM_DATM_AU-Sam_2011-2017.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2011" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2017" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/AU-Stp/shell_commands b/cime_config/usermods_dirs/PLUMBER2/AU-Stp/shell_commands index b47b5d5247..94cc191e2f 100644 --- a/cime_config/usermods_dirs/PLUMBER2/AU-Stp/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/AU-Stp/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=54000 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_AU-Stp_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/AU-Stp/CLM1PT_data/CTSM_DATM_AU-Stp_2010-2017.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2010" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2017" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/AU-TTE/shell_commands b/cime_config/usermods_dirs/PLUMBER2/AU-TTE/shell_commands index 4078dbed33..3204d39d22 100644 --- a/cime_config/usermods_dirs/PLUMBER2/AU-TTE/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/AU-TTE/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=54000 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_AU-TTE_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/AU-TTE/CLM1PT_data/CTSM_DATM_AU-TTE_2013-2017.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2013" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2017" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/AU-Tum/shell_commands b/cime_config/usermods_dirs/PLUMBER2/AU-Tum/shell_commands index b22b411eec..51b0770e12 100644 --- a/cime_config/usermods_dirs/PLUMBER2/AU-Tum/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/AU-Tum/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=46800 ./xmlchange ATM_NCPL=24 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_AU-Tum_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/AU-Tum/CLM1PT_data/CTSM_DATM_AU-Tum_2002-2017.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2002" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2017" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/AU-Whr/shell_commands b/cime_config/usermods_dirs/PLUMBER2/AU-Whr/shell_commands index 87c5957833..193218e604 100644 --- a/cime_config/usermods_dirs/PLUMBER2/AU-Whr/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/AU-Whr/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=46800 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_AU-Whr_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/AU-Whr/CLM1PT_data/CTSM_DATM_AU-Whr_2015-2016.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2015" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2016" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/AU-Wrr/shell_commands b/cime_config/usermods_dirs/PLUMBER2/AU-Wrr/shell_commands index 8f0303fe30..c5b6609661 100644 --- a/cime_config/usermods_dirs/PLUMBER2/AU-Wrr/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/AU-Wrr/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=46800 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_AU-Wrr_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/AU-Wrr/CLM1PT_data/CTSM_DATM_AU-Wrr_2016-2017.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2016" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2017" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/AU-Ync/shell_commands b/cime_config/usermods_dirs/PLUMBER2/AU-Ync/shell_commands index 7606fa4a96..57fb25a4cf 100644 --- a/cime_config/usermods_dirs/PLUMBER2/AU-Ync/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/AU-Ync/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=46800 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_AU-Ync_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/AU-Ync/CLM1PT_data/CTSM_DATM_AU-Ync_2011-2017.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2011" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2017" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/BE-Bra/shell_commands b/cime_config/usermods_dirs/PLUMBER2/BE-Bra/shell_commands index 876260dcc3..28beca48b1 100644 --- a/cime_config/usermods_dirs/PLUMBER2/BE-Bra/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/BE-Bra/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_BE-Bra_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/BE-Bra/CLM1PT_data/CTSM_DATM_BE-Bra_2004-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2004" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/BE-Lon/shell_commands b/cime_config/usermods_dirs/PLUMBER2/BE-Lon/shell_commands index 2ebc59db53..3833429771 100644 --- a/cime_config/usermods_dirs/PLUMBER2/BE-Lon/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/BE-Lon/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_BE-Lon_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/BE-Lon/CLM1PT_data/CTSM_DATM_BE-Lon_2005-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2005" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/BE-Vie/shell_commands b/cime_config/usermods_dirs/PLUMBER2/BE-Vie/shell_commands index 21bf22d74c..6936b7bb27 100644 --- a/cime_config/usermods_dirs/PLUMBER2/BE-Vie/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/BE-Vie/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_BE-Vie_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/BE-Vie/CLM1PT_data/CTSM_DATM_BE-Vie_1997-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=1997" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/BR-Sa3/shell_commands b/cime_config/usermods_dirs/PLUMBER2/BR-Sa3/shell_commands index 741ea74d27..58a839b51c 100644 --- a/cime_config/usermods_dirs/PLUMBER2/BR-Sa3/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/BR-Sa3/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=14400 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_BR-Sa3_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/BR-Sa3/CLM1PT_data/CTSM_DATM_BR-Sa3_2001-2003.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2001" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2003" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/BW-Ma1/shell_commands b/cime_config/usermods_dirs/PLUMBER2/BW-Ma1/shell_commands index 77944502cf..88851105c0 100644 --- a/cime_config/usermods_dirs/PLUMBER2/BW-Ma1/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/BW-Ma1/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=79200 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_BW-Ma1_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/BW-Ma1/CLM1PT_data/CTSM_DATM_BW-Ma1_2000-2000.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2000" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2000" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/CA-NS1/shell_commands b/cime_config/usermods_dirs/PLUMBER2/CA-NS1/shell_commands index 88ef538521..962411e90b 100644 --- a/cime_config/usermods_dirs/PLUMBER2/CA-NS1/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/CA-NS1/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=21600 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_CA-NS1_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/CA-NS1/CLM1PT_data/CTSM_DATM_CA-NS1_2003-2003.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2003" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2003" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/CA-NS2/shell_commands b/cime_config/usermods_dirs/PLUMBER2/CA-NS2/shell_commands index 9b89720f4a..897cf765df 100644 --- a/cime_config/usermods_dirs/PLUMBER2/CA-NS2/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/CA-NS2/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=21600 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_CA-NS2_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/CA-NS2/CLM1PT_data/CTSM_DATM_CA-NS2_2002-2004.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2002" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2004" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/CA-NS4/shell_commands b/cime_config/usermods_dirs/PLUMBER2/CA-NS4/shell_commands index d5f16eac57..d1d7315b2c 100644 --- a/cime_config/usermods_dirs/PLUMBER2/CA-NS4/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/CA-NS4/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=21600 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_CA-NS4_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/CA-NS4/CLM1PT_data/CTSM_DATM_CA-NS4_2003-2004.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2003" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2004" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/CA-NS5/shell_commands b/cime_config/usermods_dirs/PLUMBER2/CA-NS5/shell_commands index aca396c31d..b73f17e9f6 100644 --- a/cime_config/usermods_dirs/PLUMBER2/CA-NS5/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/CA-NS5/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=21600 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_CA-NS5_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/CA-NS5/CLM1PT_data/CTSM_DATM_CA-NS5_2003-2004.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2003" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2004" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/CA-NS6/shell_commands b/cime_config/usermods_dirs/PLUMBER2/CA-NS6/shell_commands index d9bd413c42..a785233c1f 100644 --- a/cime_config/usermods_dirs/PLUMBER2/CA-NS6/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/CA-NS6/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=21600 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_CA-NS6_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/CA-NS6/CLM1PT_data/CTSM_DATM_CA-NS6_2002-2004.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2002" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2004" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/CA-NS7/shell_commands b/cime_config/usermods_dirs/PLUMBER2/CA-NS7/shell_commands index 1614d09505..f97c5c5141 100644 --- a/cime_config/usermods_dirs/PLUMBER2/CA-NS7/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/CA-NS7/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=21600 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_CA-NS7_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/CA-NS7/CLM1PT_data/CTSM_DATM_CA-NS7_2003-2004.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2003" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2004" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/CA-Qcu/shell_commands b/cime_config/usermods_dirs/PLUMBER2/CA-Qcu/shell_commands index 0d3cd7e1a0..878c28ddf6 100644 --- a/cime_config/usermods_dirs/PLUMBER2/CA-Qcu/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/CA-Qcu/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=18000 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_CA-Qcu_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/CA-Qcu/CLM1PT_data/CTSM_DATM_CA-Qcu_2002-2006.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2002" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2006" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/CA-Qfo/shell_commands b/cime_config/usermods_dirs/PLUMBER2/CA-Qfo/shell_commands index 8e80f8e897..bde28704c5 100644 --- a/cime_config/usermods_dirs/PLUMBER2/CA-Qfo/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/CA-Qfo/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=18000 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_CA-Qfo_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/CA-Qfo/CLM1PT_data/CTSM_DATM_CA-Qfo_2004-2010.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2004" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2010" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/CA-SF1/shell_commands b/cime_config/usermods_dirs/PLUMBER2/CA-SF1/shell_commands index f479028097..c529507b7e 100644 --- a/cime_config/usermods_dirs/PLUMBER2/CA-SF1/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/CA-SF1/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=21600 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_CA-SF1_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/CA-SF1/CLM1PT_data/CTSM_DATM_CA-SF1_2004-2006.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2004" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2006" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/CA-SF2/shell_commands b/cime_config/usermods_dirs/PLUMBER2/CA-SF2/shell_commands index d83a6c2bf1..aebfd10bbe 100644 --- a/cime_config/usermods_dirs/PLUMBER2/CA-SF2/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/CA-SF2/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=21600 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_CA-SF2_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/CA-SF2/CLM1PT_data/CTSM_DATM_CA-SF2_2003-2005.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2003" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2005" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/CA-SF3/shell_commands b/cime_config/usermods_dirs/PLUMBER2/CA-SF3/shell_commands index 17fcb052ba..bd68572dca 100644 --- a/cime_config/usermods_dirs/PLUMBER2/CA-SF3/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/CA-SF3/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=21600 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_CA-SF3_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/CA-SF3/CLM1PT_data/CTSM_DATM_CA-SF3_2003-2005.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2003" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2005" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/CH-Cha/shell_commands b/cime_config/usermods_dirs/PLUMBER2/CH-Cha/shell_commands index 156ccfd380..d8a0aa59c1 100644 --- a/cime_config/usermods_dirs/PLUMBER2/CH-Cha/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/CH-Cha/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_CH-Cha_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/CH-Cha/CLM1PT_data/CTSM_DATM_CH-Cha_2006-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2006" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/CH-Dav/shell_commands b/cime_config/usermods_dirs/PLUMBER2/CH-Dav/shell_commands index 3ad08c65f5..19f4cc5ba0 100644 --- a/cime_config/usermods_dirs/PLUMBER2/CH-Dav/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/CH-Dav/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_CH-Dav_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/CH-Dav/CLM1PT_data/CTSM_DATM_CH-Dav_1997-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=1997" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/CH-Fru/shell_commands b/cime_config/usermods_dirs/PLUMBER2/CH-Fru/shell_commands index 44bdb94425..291458c54b 100644 --- a/cime_config/usermods_dirs/PLUMBER2/CH-Fru/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/CH-Fru/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_CH-Fru_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/CH-Fru/CLM1PT_data/CTSM_DATM_CH-Fru_2007-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2007" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/CH-Oe1/shell_commands b/cime_config/usermods_dirs/PLUMBER2/CH-Oe1/shell_commands index 58b583af12..964e24d852 100644 --- a/cime_config/usermods_dirs/PLUMBER2/CH-Oe1/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/CH-Oe1/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_CH-Oe1_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/CH-Oe1/CLM1PT_data/CTSM_DATM_CH-Oe1_2002-2008.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2002" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2008" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/CN-Cha/shell_commands b/cime_config/usermods_dirs/PLUMBER2/CN-Cha/shell_commands index e257bff2eb..8322f1f733 100644 --- a/cime_config/usermods_dirs/PLUMBER2/CN-Cha/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/CN-Cha/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=57600 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_CN-Cha_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/CN-Cha/CLM1PT_data/CTSM_DATM_CN-Cha_2003-2005.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2003" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2005" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/CN-Cng/shell_commands b/cime_config/usermods_dirs/PLUMBER2/CN-Cng/shell_commands index 709e3f12ab..dda99e3c4a 100644 --- a/cime_config/usermods_dirs/PLUMBER2/CN-Cng/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/CN-Cng/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=57600 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_CN-Cng_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/CN-Cng/CLM1PT_data/CTSM_DATM_CN-Cng_2008-2009.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2008" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2009" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/CN-Dan/shell_commands b/cime_config/usermods_dirs/PLUMBER2/CN-Dan/shell_commands index 5597e04781..cdca7d7472 100644 --- a/cime_config/usermods_dirs/PLUMBER2/CN-Dan/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/CN-Dan/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=57600 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_CN-Dan_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/CN-Dan/CLM1PT_data/CTSM_DATM_CN-Dan_2004-2005.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2004" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2005" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/CN-Din/shell_commands b/cime_config/usermods_dirs/PLUMBER2/CN-Din/shell_commands index 6d0898e50d..19f9baa8eb 100644 --- a/cime_config/usermods_dirs/PLUMBER2/CN-Din/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/CN-Din/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=57600 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_CN-Din_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/CN-Din/CLM1PT_data/CTSM_DATM_CN-Din_2003-2005.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2003" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2005" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/CN-Du2/shell_commands b/cime_config/usermods_dirs/PLUMBER2/CN-Du2/shell_commands index ecb62c468d..5f83542f35 100644 --- a/cime_config/usermods_dirs/PLUMBER2/CN-Du2/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/CN-Du2/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=57600 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_CN-Du2_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/CN-Du2/CLM1PT_data/CTSM_DATM_CN-Du2_2007-2008.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2007" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2008" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/CN-HaM/shell_commands b/cime_config/usermods_dirs/PLUMBER2/CN-HaM/shell_commands index 95c2c4625e..e7a814451d 100644 --- a/cime_config/usermods_dirs/PLUMBER2/CN-HaM/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/CN-HaM/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=57600 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_CN-HaM_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/CN-HaM/CLM1PT_data/CTSM_DATM_CN-HaM_2002-2003.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2002" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2003" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/CN-Qia/shell_commands b/cime_config/usermods_dirs/PLUMBER2/CN-Qia/shell_commands index 4fd2927af6..a44ff612b4 100644 --- a/cime_config/usermods_dirs/PLUMBER2/CN-Qia/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/CN-Qia/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=57600 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_CN-Qia_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/CN-Qia/CLM1PT_data/CTSM_DATM_CN-Qia_2003-2005.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2003" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2005" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/CZ-wet/shell_commands b/cime_config/usermods_dirs/PLUMBER2/CZ-wet/shell_commands index e72e38b648..d01359e568 100644 --- a/cime_config/usermods_dirs/PLUMBER2/CZ-wet/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/CZ-wet/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_CZ-wet_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/CZ-wet/CLM1PT_data/CTSM_DATM_CZ-wet_2007-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2007" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/DE-Bay/shell_commands b/cime_config/usermods_dirs/PLUMBER2/DE-Bay/shell_commands index 766eb3880f..cfde80c1de 100644 --- a/cime_config/usermods_dirs/PLUMBER2/DE-Bay/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/DE-Bay/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_DE-Bay_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/DE-Bay/CLM1PT_data/CTSM_DATM_DE-Bay_1997-1999.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=1997" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=1999" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/DE-Geb/shell_commands b/cime_config/usermods_dirs/PLUMBER2/DE-Geb/shell_commands index 73c61a9d79..834a2b3f96 100644 --- a/cime_config/usermods_dirs/PLUMBER2/DE-Geb/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/DE-Geb/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_DE-Geb_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/DE-Geb/CLM1PT_data/CTSM_DATM_DE-Geb_2001-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2001" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/DE-Gri/shell_commands b/cime_config/usermods_dirs/PLUMBER2/DE-Gri/shell_commands index 6bb17ac6a7..9fe2f16680 100644 --- a/cime_config/usermods_dirs/PLUMBER2/DE-Gri/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/DE-Gri/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_DE-Gri_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/DE-Gri/CLM1PT_data/CTSM_DATM_DE-Gri_2004-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2004" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/DE-Hai/shell_commands b/cime_config/usermods_dirs/PLUMBER2/DE-Hai/shell_commands index 74f37b2314..83bb6beb10 100644 --- a/cime_config/usermods_dirs/PLUMBER2/DE-Hai/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/DE-Hai/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_DE-Hai_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/DE-Hai/CLM1PT_data/CTSM_DATM_DE-Hai_2000-2012.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2000" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2012" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/DE-Kli/shell_commands b/cime_config/usermods_dirs/PLUMBER2/DE-Kli/shell_commands index ee09f48b7d..d8a15d9a53 100644 --- a/cime_config/usermods_dirs/PLUMBER2/DE-Kli/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/DE-Kli/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_DE-Kli_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/DE-Kli/CLM1PT_data/CTSM_DATM_DE-Kli_2005-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2005" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/DE-Meh/shell_commands b/cime_config/usermods_dirs/PLUMBER2/DE-Meh/shell_commands index 66eca33f28..9ffbaf9c34 100644 --- a/cime_config/usermods_dirs/PLUMBER2/DE-Meh/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/DE-Meh/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_DE-Meh_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/DE-Meh/CLM1PT_data/CTSM_DATM_DE-Meh_2004-2006.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2004" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2006" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/DE-Obe/shell_commands b/cime_config/usermods_dirs/PLUMBER2/DE-Obe/shell_commands index b23d6d2b21..94afe08f04 100644 --- a/cime_config/usermods_dirs/PLUMBER2/DE-Obe/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/DE-Obe/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_DE-Obe_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/DE-Obe/CLM1PT_data/CTSM_DATM_DE-Obe_2008-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2008" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/DE-Seh/shell_commands b/cime_config/usermods_dirs/PLUMBER2/DE-Seh/shell_commands index 590e3b5812..2daca0a2c1 100644 --- a/cime_config/usermods_dirs/PLUMBER2/DE-Seh/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/DE-Seh/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_DE-Seh_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/DE-Seh/CLM1PT_data/CTSM_DATM_DE-Seh_2008-2010.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2008" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2010" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/DE-SfN/shell_commands b/cime_config/usermods_dirs/PLUMBER2/DE-SfN/shell_commands index a8532e908c..9bdef7293f 100644 --- a/cime_config/usermods_dirs/PLUMBER2/DE-SfN/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/DE-SfN/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_DE-SfN_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/DE-SfN/CLM1PT_data/CTSM_DATM_DE-SfN_2013-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2013" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/DE-Tha/shell_commands b/cime_config/usermods_dirs/PLUMBER2/DE-Tha/shell_commands index 3b9af13173..e77813eec9 100644 --- a/cime_config/usermods_dirs/PLUMBER2/DE-Tha/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/DE-Tha/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_DE-Tha_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/DE-Tha/CLM1PT_data/CTSM_DATM_DE-Tha_1998-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=1998" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/DE-Wet/shell_commands b/cime_config/usermods_dirs/PLUMBER2/DE-Wet/shell_commands index f39a379185..7563e5ff7e 100644 --- a/cime_config/usermods_dirs/PLUMBER2/DE-Wet/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/DE-Wet/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_DE-Wet_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/DE-Wet/CLM1PT_data/CTSM_DATM_DE-Wet_2002-2006.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2002" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2006" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/DK-Fou/shell_commands b/cime_config/usermods_dirs/PLUMBER2/DK-Fou/shell_commands index fbc465b915..06a43e6df6 100644 --- a/cime_config/usermods_dirs/PLUMBER2/DK-Fou/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/DK-Fou/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_DK-Fou_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/DK-Fou/CLM1PT_data/CTSM_DATM_DK-Fou_2005-2005.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2005" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2005" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/DK-Lva/shell_commands b/cime_config/usermods_dirs/PLUMBER2/DK-Lva/shell_commands index 644cc92e00..bda3c08df5 100644 --- a/cime_config/usermods_dirs/PLUMBER2/DK-Lva/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/DK-Lva/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_DK-Lva_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/DK-Lva/CLM1PT_data/CTSM_DATM_DK-Lva_2005-2006.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2005" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2006" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/DK-Ris/shell_commands b/cime_config/usermods_dirs/PLUMBER2/DK-Ris/shell_commands index f54b4647b1..189e9b0ee7 100644 --- a/cime_config/usermods_dirs/PLUMBER2/DK-Ris/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/DK-Ris/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_DK-Ris_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/DK-Ris/CLM1PT_data/CTSM_DATM_DK-Ris_2004-2005.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2004" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2005" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/DK-Sor/shell_commands b/cime_config/usermods_dirs/PLUMBER2/DK-Sor/shell_commands index 4868bd8135..2aa6510cd4 100644 --- a/cime_config/usermods_dirs/PLUMBER2/DK-Sor/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/DK-Sor/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_DK-Sor_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/DK-Sor/CLM1PT_data/CTSM_DATM_DK-Sor_1997-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=1997" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/DK-ZaH/shell_commands b/cime_config/usermods_dirs/PLUMBER2/DK-ZaH/shell_commands index 5d9e5c6e54..99a0558d7d 100644 --- a/cime_config/usermods_dirs/PLUMBER2/DK-ZaH/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/DK-ZaH/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=0 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_DK-ZaH_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/DK-ZaH/CLM1PT_data/CTSM_DATM_DK-ZaH_2000-2013.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2000" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2013" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/ES-ES1/shell_commands b/cime_config/usermods_dirs/PLUMBER2/ES-ES1/shell_commands index 7d7da13008..10d4e4399d 100644 --- a/cime_config/usermods_dirs/PLUMBER2/ES-ES1/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/ES-ES1/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_ES-ES1_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/ES-ES1/CLM1PT_data/CTSM_DATM_ES-ES1_1999-2006.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=1999" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2006" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/ES-ES2/shell_commands b/cime_config/usermods_dirs/PLUMBER2/ES-ES2/shell_commands index 83905f3813..b72ddf79db 100644 --- a/cime_config/usermods_dirs/PLUMBER2/ES-ES2/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/ES-ES2/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_ES-ES2_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/ES-ES2/CLM1PT_data/CTSM_DATM_ES-ES2_2005-2006.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2005" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2006" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/ES-LMa/shell_commands b/cime_config/usermods_dirs/PLUMBER2/ES-LMa/shell_commands index 5b33bf0cca..6d69cfc70b 100644 --- a/cime_config/usermods_dirs/PLUMBER2/ES-LMa/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/ES-LMa/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_ES-LMa_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/ES-LMa/CLM1PT_data/CTSM_DATM_ES-LMa_2004-2006.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2004" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2006" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/ES-LgS/shell_commands b/cime_config/usermods_dirs/PLUMBER2/ES-LgS/shell_commands index 163fa43b1a..2efa0f5a04 100644 --- a/cime_config/usermods_dirs/PLUMBER2/ES-LgS/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/ES-LgS/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_ES-LgS_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/ES-LgS/CLM1PT_data/CTSM_DATM_ES-LgS_2007-2007.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2007" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2007" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/ES-VDA/shell_commands b/cime_config/usermods_dirs/PLUMBER2/ES-VDA/shell_commands index 055e4df543..83d071a6f8 100644 --- a/cime_config/usermods_dirs/PLUMBER2/ES-VDA/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/ES-VDA/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_ES-VDA_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/ES-VDA/CLM1PT_data/CTSM_DATM_ES-VDA_2004-2004.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2004" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2004" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/FI-Hyy/shell_commands b/cime_config/usermods_dirs/PLUMBER2/FI-Hyy/shell_commands index f4dad2be34..68d5a9739f 100644 --- a/cime_config/usermods_dirs/PLUMBER2/FI-Hyy/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/FI-Hyy/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=79200 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_FI-Hyy_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/FI-Hyy/CLM1PT_data/CTSM_DATM_FI-Hyy_1996-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=1996" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/FI-Kaa/shell_commands b/cime_config/usermods_dirs/PLUMBER2/FI-Kaa/shell_commands index fcf3a3b6a0..43852577b1 100644 --- a/cime_config/usermods_dirs/PLUMBER2/FI-Kaa/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/FI-Kaa/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=79200 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_FI-Kaa_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/FI-Kaa/CLM1PT_data/CTSM_DATM_FI-Kaa_2000-2002.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2000" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2002" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/FI-Lom/shell_commands b/cime_config/usermods_dirs/PLUMBER2/FI-Lom/shell_commands index 4e3f36e65f..c7e01ee357 100644 --- a/cime_config/usermods_dirs/PLUMBER2/FI-Lom/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/FI-Lom/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=79200 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_FI-Lom_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/FI-Lom/CLM1PT_data/CTSM_DATM_FI-Lom_2007-2009.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2007" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2009" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/FI-Sod/shell_commands b/cime_config/usermods_dirs/PLUMBER2/FI-Sod/shell_commands index c716a66993..ccf011b0e0 100644 --- a/cime_config/usermods_dirs/PLUMBER2/FI-Sod/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/FI-Sod/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=79200 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_FI-Sod_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/FI-Sod/CLM1PT_data/CTSM_DATM_FI-Sod_2008-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2008" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/FR-Fon/shell_commands b/cime_config/usermods_dirs/PLUMBER2/FR-Fon/shell_commands index 4ced43e5ff..4af5380bee 100644 --- a/cime_config/usermods_dirs/PLUMBER2/FR-Fon/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/FR-Fon/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_FR-Fon_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/FR-Fon/CLM1PT_data/CTSM_DATM_FR-Fon_2005-2013.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2005" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2013" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/FR-Gri/shell_commands b/cime_config/usermods_dirs/PLUMBER2/FR-Gri/shell_commands index 6821e30d5a..dae1f22807 100644 --- a/cime_config/usermods_dirs/PLUMBER2/FR-Gri/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/FR-Gri/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_FR-Gri_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/FR-Gri/CLM1PT_data/CTSM_DATM_FR-Gri_2005-2013.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2005" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2013" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/FR-Hes/shell_commands b/cime_config/usermods_dirs/PLUMBER2/FR-Hes/shell_commands index ba56b6dfd4..00dd5c6771 100644 --- a/cime_config/usermods_dirs/PLUMBER2/FR-Hes/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/FR-Hes/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_FR-Hes_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/FR-Hes/CLM1PT_data/CTSM_DATM_FR-Hes_1997-2006.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=1997" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2006" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/FR-LBr/shell_commands b/cime_config/usermods_dirs/PLUMBER2/FR-LBr/shell_commands index 491b472fda..21f28c8839 100644 --- a/cime_config/usermods_dirs/PLUMBER2/FR-LBr/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/FR-LBr/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_FR-LBr_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/FR-LBr/CLM1PT_data/CTSM_DATM_FR-LBr_2003-2008.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2003" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2008" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/FR-Lq1/shell_commands b/cime_config/usermods_dirs/PLUMBER2/FR-Lq1/shell_commands index bcda561678..4b8ae400d7 100644 --- a/cime_config/usermods_dirs/PLUMBER2/FR-Lq1/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/FR-Lq1/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_FR-Lq1_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/FR-Lq1/CLM1PT_data/CTSM_DATM_FR-Lq1_2004-2006.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2004" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2006" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/FR-Lq2/shell_commands b/cime_config/usermods_dirs/PLUMBER2/FR-Lq2/shell_commands index 24847656fb..3e56a08786 100644 --- a/cime_config/usermods_dirs/PLUMBER2/FR-Lq2/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/FR-Lq2/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_FR-Lq2_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/FR-Lq2/CLM1PT_data/CTSM_DATM_FR-Lq2_2004-2006.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2004" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2006" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/FR-Pue/shell_commands b/cime_config/usermods_dirs/PLUMBER2/FR-Pue/shell_commands index 781321d36a..4e4ddac3d5 100644 --- a/cime_config/usermods_dirs/PLUMBER2/FR-Pue/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/FR-Pue/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_FR-Pue_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/FR-Pue/CLM1PT_data/CTSM_DATM_FR-Pue_2000-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2000" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/GF-Guy/shell_commands b/cime_config/usermods_dirs/PLUMBER2/GF-Guy/shell_commands index 25d9b73407..6a2a814f69 100644 --- a/cime_config/usermods_dirs/PLUMBER2/GF-Guy/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/GF-Guy/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=10800 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_GF-Guy_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/GF-Guy/CLM1PT_data/CTSM_DATM_GF-Guy_2004-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2004" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/HU-Bug/shell_commands b/cime_config/usermods_dirs/PLUMBER2/HU-Bug/shell_commands index 188f13bb21..739810dd52 100644 --- a/cime_config/usermods_dirs/PLUMBER2/HU-Bug/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/HU-Bug/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_HU-Bug_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/HU-Bug/CLM1PT_data/CTSM_DATM_HU-Bug_2003-2006.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2003" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2006" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/ID-Pag/shell_commands b/cime_config/usermods_dirs/PLUMBER2/ID-Pag/shell_commands index 43ba6c29ba..e5e190ad1e 100644 --- a/cime_config/usermods_dirs/PLUMBER2/ID-Pag/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/ID-Pag/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=61200 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_ID-Pag_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/ID-Pag/CLM1PT_data/CTSM_DATM_ID-Pag_2002-2003.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2002" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2003" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/IE-Ca1/shell_commands b/cime_config/usermods_dirs/PLUMBER2/IE-Ca1/shell_commands index f202a45e45..e9caca8f04 100644 --- a/cime_config/usermods_dirs/PLUMBER2/IE-Ca1/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/IE-Ca1/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=0 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_IE-Ca1_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/IE-Ca1/CLM1PT_data/CTSM_DATM_IE-Ca1_2004-2006.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2004" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2006" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/IE-Dri/shell_commands b/cime_config/usermods_dirs/PLUMBER2/IE-Dri/shell_commands index 2cbf857d0a..bdd48c2331 100644 --- a/cime_config/usermods_dirs/PLUMBER2/IE-Dri/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/IE-Dri/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=0 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_IE-Dri_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/IE-Dri/CLM1PT_data/CTSM_DATM_IE-Dri_2003-2005.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2003" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2005" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/IT-Amp/shell_commands b/cime_config/usermods_dirs/PLUMBER2/IT-Amp/shell_commands index b52c8d408d..290836ff22 100644 --- a/cime_config/usermods_dirs/PLUMBER2/IT-Amp/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/IT-Amp/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_IT-Amp_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/IT-Amp/CLM1PT_data/CTSM_DATM_IT-Amp_2003-2006.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2003" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2006" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/IT-BCi/shell_commands b/cime_config/usermods_dirs/PLUMBER2/IT-BCi/shell_commands index 8399009a3c..ae21e12b51 100644 --- a/cime_config/usermods_dirs/PLUMBER2/IT-BCi/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/IT-BCi/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_IT-BCi_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/IT-BCi/CLM1PT_data/CTSM_DATM_IT-BCi_2005-2010.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2005" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2010" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/IT-CA1/shell_commands b/cime_config/usermods_dirs/PLUMBER2/IT-CA1/shell_commands index 6358580049..3fbb828981 100644 --- a/cime_config/usermods_dirs/PLUMBER2/IT-CA1/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/IT-CA1/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_IT-CA1_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/IT-CA1/CLM1PT_data/CTSM_DATM_IT-CA1_2012-2013.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2012" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2013" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/IT-CA2/shell_commands b/cime_config/usermods_dirs/PLUMBER2/IT-CA2/shell_commands index 57eb7da218..18be6fbd02 100644 --- a/cime_config/usermods_dirs/PLUMBER2/IT-CA2/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/IT-CA2/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_IT-CA2_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/IT-CA2/CLM1PT_data/CTSM_DATM_IT-CA2_2012-2013.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2012" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2013" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/IT-CA3/shell_commands b/cime_config/usermods_dirs/PLUMBER2/IT-CA3/shell_commands index b1e2439541..46bff2a9e3 100644 --- a/cime_config/usermods_dirs/PLUMBER2/IT-CA3/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/IT-CA3/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_IT-CA3_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/IT-CA3/CLM1PT_data/CTSM_DATM_IT-CA3_2012-2013.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2012" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2013" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/IT-Col/shell_commands b/cime_config/usermods_dirs/PLUMBER2/IT-Col/shell_commands index a842fcbe02..a62cad7d87 100644 --- a/cime_config/usermods_dirs/PLUMBER2/IT-Col/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/IT-Col/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_IT-Col_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/IT-Col/CLM1PT_data/CTSM_DATM_IT-Col_2007-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2007" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/IT-Cpz/shell_commands b/cime_config/usermods_dirs/PLUMBER2/IT-Cpz/shell_commands index 7a6db3d102..6063242085 100644 --- a/cime_config/usermods_dirs/PLUMBER2/IT-Cpz/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/IT-Cpz/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_IT-Cpz_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/IT-Cpz/CLM1PT_data/CTSM_DATM_IT-Cpz_2001-2008.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2001" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2008" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/IT-Isp/shell_commands b/cime_config/usermods_dirs/PLUMBER2/IT-Isp/shell_commands index e82c5cfa8f..0ae339dba1 100644 --- a/cime_config/usermods_dirs/PLUMBER2/IT-Isp/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/IT-Isp/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_IT-Isp_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/IT-Isp/CLM1PT_data/CTSM_DATM_IT-Isp_2013-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2013" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/IT-LMa/shell_commands b/cime_config/usermods_dirs/PLUMBER2/IT-LMa/shell_commands index c1f95210e6..9f683c2101 100644 --- a/cime_config/usermods_dirs/PLUMBER2/IT-LMa/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/IT-LMa/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_IT-LMa_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/IT-LMa/CLM1PT_data/CTSM_DATM_IT-LMa_2003-2004.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2003" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2004" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/IT-Lav/shell_commands b/cime_config/usermods_dirs/PLUMBER2/IT-Lav/shell_commands index 33c3d49053..d1a8669b3e 100644 --- a/cime_config/usermods_dirs/PLUMBER2/IT-Lav/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/IT-Lav/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_IT-Lav_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/IT-Lav/CLM1PT_data/CTSM_DATM_IT-Lav_2005-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2005" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/IT-MBo/shell_commands b/cime_config/usermods_dirs/PLUMBER2/IT-MBo/shell_commands index 02952affac..6b2e4b2651 100644 --- a/cime_config/usermods_dirs/PLUMBER2/IT-MBo/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/IT-MBo/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_IT-MBo_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/IT-MBo/CLM1PT_data/CTSM_DATM_IT-MBo_2003-2012.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2003" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2012" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/IT-Mal/shell_commands b/cime_config/usermods_dirs/PLUMBER2/IT-Mal/shell_commands index 91f623aab1..e6f9ad1c51 100644 --- a/cime_config/usermods_dirs/PLUMBER2/IT-Mal/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/IT-Mal/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_IT-Mal_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/IT-Mal/CLM1PT_data/CTSM_DATM_IT-Mal_2003-2003.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2003" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2003" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/IT-Noe/shell_commands b/cime_config/usermods_dirs/PLUMBER2/IT-Noe/shell_commands index f75f23d917..eacfbce81e 100644 --- a/cime_config/usermods_dirs/PLUMBER2/IT-Noe/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/IT-Noe/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_IT-Noe_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/IT-Noe/CLM1PT_data/CTSM_DATM_IT-Noe_2004-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2004" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/IT-Non/shell_commands b/cime_config/usermods_dirs/PLUMBER2/IT-Non/shell_commands index af53f49fb9..543dc97221 100644 --- a/cime_config/usermods_dirs/PLUMBER2/IT-Non/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/IT-Non/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_IT-Non_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/IT-Non/CLM1PT_data/CTSM_DATM_IT-Non_2002-2002.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2002" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2002" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/IT-PT1/shell_commands b/cime_config/usermods_dirs/PLUMBER2/IT-PT1/shell_commands index e6af3c6a16..23afcb9469 100644 --- a/cime_config/usermods_dirs/PLUMBER2/IT-PT1/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/IT-PT1/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_IT-PT1_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/IT-PT1/CLM1PT_data/CTSM_DATM_IT-PT1_2003-2004.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2003" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2004" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/IT-Ren/shell_commands b/cime_config/usermods_dirs/PLUMBER2/IT-Ren/shell_commands index 1793711024..5b6afef969 100644 --- a/cime_config/usermods_dirs/PLUMBER2/IT-Ren/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/IT-Ren/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_IT-Ren_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/IT-Ren/CLM1PT_data/CTSM_DATM_IT-Ren_2010-2013.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2010" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2013" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/IT-Ro1/shell_commands b/cime_config/usermods_dirs/PLUMBER2/IT-Ro1/shell_commands index ddc9c0868e..f74dd07bab 100644 --- a/cime_config/usermods_dirs/PLUMBER2/IT-Ro1/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/IT-Ro1/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_IT-Ro1_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/IT-Ro1/CLM1PT_data/CTSM_DATM_IT-Ro1_2002-2006.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2002" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2006" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/IT-Ro2/shell_commands b/cime_config/usermods_dirs/PLUMBER2/IT-Ro2/shell_commands index 4e87a351a6..5d3a64aefb 100644 --- a/cime_config/usermods_dirs/PLUMBER2/IT-Ro2/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/IT-Ro2/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_IT-Ro2_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/IT-Ro2/CLM1PT_data/CTSM_DATM_IT-Ro2_2002-2008.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2002" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2008" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/IT-SR2/shell_commands b/cime_config/usermods_dirs/PLUMBER2/IT-SR2/shell_commands index 1604053cce..4cce0bb915 100644 --- a/cime_config/usermods_dirs/PLUMBER2/IT-SR2/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/IT-SR2/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_IT-SR2_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/IT-SR2/CLM1PT_data/CTSM_DATM_IT-SR2_2013-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2013" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/IT-SRo/shell_commands b/cime_config/usermods_dirs/PLUMBER2/IT-SRo/shell_commands index 5b89dbff9e..2f89c5830f 100644 --- a/cime_config/usermods_dirs/PLUMBER2/IT-SRo/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/IT-SRo/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_IT-SRo_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/IT-SRo/CLM1PT_data/CTSM_DATM_IT-SRo_2003-2012.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2003" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2012" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/JP-SMF/shell_commands b/cime_config/usermods_dirs/PLUMBER2/JP-SMF/shell_commands index b9c962fafc..287a41b541 100644 --- a/cime_config/usermods_dirs/PLUMBER2/JP-SMF/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/JP-SMF/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=54000 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_JP-SMF_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/JP-SMF/CLM1PT_data/CTSM_DATM_JP-SMF_2003-2006.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2003" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2006" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/NL-Ca1/shell_commands b/cime_config/usermods_dirs/PLUMBER2/NL-Ca1/shell_commands index 4b46b3c6f0..7f88121b9b 100644 --- a/cime_config/usermods_dirs/PLUMBER2/NL-Ca1/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/NL-Ca1/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_NL-Ca1_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/NL-Ca1/CLM1PT_data/CTSM_DATM_NL-Ca1_2003-2006.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2003" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2006" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/NL-Hor/shell_commands b/cime_config/usermods_dirs/PLUMBER2/NL-Hor/shell_commands index dc5e4e1741..6134ec5fd6 100644 --- a/cime_config/usermods_dirs/PLUMBER2/NL-Hor/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/NL-Hor/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_NL-Hor_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/NL-Hor/CLM1PT_data/CTSM_DATM_NL-Hor_2008-2011.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2008" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2011" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/NL-Loo/shell_commands b/cime_config/usermods_dirs/PLUMBER2/NL-Loo/shell_commands index a7d5784572..82a7f2458c 100644 --- a/cime_config/usermods_dirs/PLUMBER2/NL-Loo/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/NL-Loo/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_NL-Loo_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/NL-Loo/CLM1PT_data/CTSM_DATM_NL-Loo_1997-2013.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=1997" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2013" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/PL-wet/shell_commands b/cime_config/usermods_dirs/PLUMBER2/PL-wet/shell_commands index e68c1a7aa0..394e350a18 100644 --- a/cime_config/usermods_dirs/PLUMBER2/PL-wet/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/PL-wet/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_PL-wet_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/PL-wet/CLM1PT_data/CTSM_DATM_PL-wet_2004-2005.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2004" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2005" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/PT-Esp/shell_commands b/cime_config/usermods_dirs/PLUMBER2/PT-Esp/shell_commands index 5dd7ac93cf..1552bd40e8 100644 --- a/cime_config/usermods_dirs/PLUMBER2/PT-Esp/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/PT-Esp/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=0 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_PT-Esp_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/PT-Esp/CLM1PT_data/CTSM_DATM_PT-Esp_2002-2004.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2002" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2004" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/PT-Mi1/shell_commands b/cime_config/usermods_dirs/PLUMBER2/PT-Mi1/shell_commands index dcb9da9c25..b8cf3bc26d 100644 --- a/cime_config/usermods_dirs/PLUMBER2/PT-Mi1/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/PT-Mi1/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=0 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_PT-Mi1_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/PT-Mi1/CLM1PT_data/CTSM_DATM_PT-Mi1_2005-2005.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2005" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2005" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/PT-Mi2/shell_commands b/cime_config/usermods_dirs/PLUMBER2/PT-Mi2/shell_commands index 40e570aa82..404492a444 100644 --- a/cime_config/usermods_dirs/PLUMBER2/PT-Mi2/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/PT-Mi2/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=0 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_PT-Mi2_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/PT-Mi2/CLM1PT_data/CTSM_DATM_PT-Mi2_2005-2006.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2005" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2006" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/RU-Che/shell_commands b/cime_config/usermods_dirs/PLUMBER2/RU-Che/shell_commands index 6737ea4985..6d92902d1f 100644 --- a/cime_config/usermods_dirs/PLUMBER2/RU-Che/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/RU-Che/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=46800 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_RU-Che_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/RU-Che/CLM1PT_data/CTSM_DATM_RU-Che_2003-2004.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2003" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2004" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/RU-Fyo/shell_commands b/cime_config/usermods_dirs/PLUMBER2/RU-Fyo/shell_commands index ce11407552..ca0223e1cf 100644 --- a/cime_config/usermods_dirs/PLUMBER2/RU-Fyo/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/RU-Fyo/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=75600 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_RU-Fyo_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/RU-Fyo/CLM1PT_data/CTSM_DATM_RU-Fyo_2003-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2003" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/RU-Zot/shell_commands b/cime_config/usermods_dirs/PLUMBER2/RU-Zot/shell_commands index a51ddc4edd..60778a180c 100644 --- a/cime_config/usermods_dirs/PLUMBER2/RU-Zot/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/RU-Zot/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=61200 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_RU-Zot_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/RU-Zot/CLM1PT_data/CTSM_DATM_RU-Zot_2003-2003.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2003" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2003" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/SD-Dem/shell_commands b/cime_config/usermods_dirs/PLUMBER2/SD-Dem/shell_commands index de45fdf737..985c3a010b 100644 --- a/cime_config/usermods_dirs/PLUMBER2/SD-Dem/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/SD-Dem/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=75600 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_SD-Dem_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/SD-Dem/CLM1PT_data/CTSM_DATM_SD-Dem_2005-2009.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2005" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2009" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/SE-Deg/shell_commands b/cime_config/usermods_dirs/PLUMBER2/SE-Deg/shell_commands index 4d7588829f..1c0165e925 100644 --- a/cime_config/usermods_dirs/PLUMBER2/SE-Deg/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/SE-Deg/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_SE-Deg_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/SE-Deg/CLM1PT_data/CTSM_DATM_SE-Deg_2002-2005.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2002" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2005" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/UK-Gri/shell_commands b/cime_config/usermods_dirs/PLUMBER2/UK-Gri/shell_commands index da714e6178..a29eeb03dc 100644 --- a/cime_config/usermods_dirs/PLUMBER2/UK-Gri/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/UK-Gri/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=0 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_UK-Gri_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/UK-Gri/CLM1PT_data/CTSM_DATM_UK-Gri_2000-2001.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2000" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2001" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/UK-Ham/shell_commands b/cime_config/usermods_dirs/PLUMBER2/UK-Ham/shell_commands index 22aa28cd0b..178ff627b9 100644 --- a/cime_config/usermods_dirs/PLUMBER2/UK-Ham/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/UK-Ham/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=0 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_UK-Ham_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/UK-Ham/CLM1PT_data/CTSM_DATM_UK-Ham_2004-2004.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2004" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2004" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/UK-PL3/shell_commands b/cime_config/usermods_dirs/PLUMBER2/UK-PL3/shell_commands index c772c6ff8e..d0f256f358 100644 --- a/cime_config/usermods_dirs/PLUMBER2/UK-PL3/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/UK-PL3/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=0 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_UK-PL3_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/UK-PL3/CLM1PT_data/CTSM_DATM_UK-PL3_2005-2006.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2005" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2006" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-AR1/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-AR1/shell_commands index 3f9e11af10..0bf6cf3313 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-AR1/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-AR1/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=21600 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_US-AR1_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-AR1/CLM1PT_data/CTSM_DATM_US-AR1_2010-2012.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2010" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2012" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-AR2/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-AR2/shell_commands index 6e9befc1c3..9751d08038 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-AR2/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-AR2/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=21600 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_US-AR2_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-AR2/CLM1PT_data/CTSM_DATM_US-AR2_2010-2011.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2010" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2011" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-ARM/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-ARM/shell_commands index 7ff3c302f2..3e4a6933bc 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-ARM/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-ARM/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=21600 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_US-ARM_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-ARM/CLM1PT_data/CTSM_DATM_US-ARM_2003-2012.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2003" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2012" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-Aud/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-Aud/shell_commands index d044d71d9c..1c193249b3 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-Aud/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-Aud/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=25200 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_US-Aud_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-Aud/CLM1PT_data/CTSM_DATM_US-Aud_2003-2005.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2003" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2005" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-Bar/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-Bar/shell_commands index ca97f023f7..b681aac49d 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-Bar/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-Bar/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=18000 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_US-Bar_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-Bar/CLM1PT_data/CTSM_DATM_US-Bar_2005-2005.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2005" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2005" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-Bkg/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-Bkg/shell_commands index 1341c5ed9a..a81ec9e93f 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-Bkg/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-Bkg/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=21600 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_US-Bkg_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-Bkg/CLM1PT_data/CTSM_DATM_US-Bkg_2005-2006.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2005" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2006" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-Blo/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-Blo/shell_commands index 40fd33b704..0d914e4416 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-Blo/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-Blo/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=28800 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_US-Blo_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-Blo/CLM1PT_data/CTSM_DATM_US-Blo_2000-2006.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2000" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2006" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-Bo1/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-Bo1/shell_commands index be837ab2d1..f45ebc7076 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-Bo1/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-Bo1/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=21600 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_US-Bo1_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-Bo1/CLM1PT_data/CTSM_DATM_US-Bo1_1997-2006.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=1997" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2006" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-Cop/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-Cop/shell_commands index 3fbe5a7442..0ce199dd44 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-Cop/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-Cop/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=25200 ./xmlchange ATM_NCPL=24 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_US-Cop_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-Cop/CLM1PT_data/CTSM_DATM_US-Cop_2002-2003.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2002" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2003" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-FPe/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-FPe/shell_commands index 980fe40609..1f6c1a2438 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-FPe/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-FPe/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=25200 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_US-FPe_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-FPe/CLM1PT_data/CTSM_DATM_US-FPe_2000-2006.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2000" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2006" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-GLE/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-GLE/shell_commands index b79cbbde03..59ae899a7e 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-GLE/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-GLE/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=25200 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_US-GLE_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-GLE/CLM1PT_data/CTSM_DATM_US-GLE_2009-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2009" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-Goo/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-Goo/shell_commands index a59dded80f..9a0d84e815 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-Goo/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-Goo/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=21600 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_US-Goo_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-Goo/CLM1PT_data/CTSM_DATM_US-Goo_2004-2006.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2004" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2006" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-Ha1/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-Ha1/shell_commands index 863fe24c3d..0687c4cd3d 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-Ha1/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-Ha1/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=18000 ./xmlchange ATM_NCPL=24 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_US-Ha1_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-Ha1/CLM1PT_data/CTSM_DATM_US-Ha1_1992-2012.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=1992" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2012" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-Ho1/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-Ho1/shell_commands index 87a2d1d4f8..a0d98032eb 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-Ho1/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-Ho1/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=18000 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_US-Ho1_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-Ho1/CLM1PT_data/CTSM_DATM_US-Ho1_1996-2004.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=1996" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2004" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-KS2/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-KS2/shell_commands index a6d6ce7048..02d26509c2 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-KS2/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-KS2/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=18000 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_US-KS2_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-KS2/CLM1PT_data/CTSM_DATM_US-KS2_2003-2006.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2003" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2006" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-Los/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-Los/shell_commands index 9c85ce58af..13ef4e69b4 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-Los/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-Los/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=21600 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_US-Los_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-Los/CLM1PT_data/CTSM_DATM_US-Los_2000-2008.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2000" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2008" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-MMS/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-MMS/shell_commands index 6ebdc0f52c..8a271026dd 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-MMS/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-MMS/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=18000 ./xmlchange ATM_NCPL=24 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_US-MMS_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-MMS/CLM1PT_data/CTSM_DATM_US-MMS_1999-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=1999" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-MOz/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-MOz/shell_commands index 7ef79f2ac6..a98dae73c4 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-MOz/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-MOz/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=21600 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_US-MOz_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-MOz/CLM1PT_data/CTSM_DATM_US-MOz_2005-2006.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2005" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2006" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-Me2/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-Me2/shell_commands index 19325ead49..dc020bf1d1 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-Me2/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-Me2/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=28800 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_US-Me2_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-Me2/CLM1PT_data/CTSM_DATM_US-Me2_2002-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2002" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-Me4/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-Me4/shell_commands index 43b2a75513..77d787c3d4 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-Me4/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-Me4/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=28800 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_US-Me4_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-Me4/CLM1PT_data/CTSM_DATM_US-Me4_1996-2000.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=1996" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2000" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-Me6/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-Me6/shell_commands index ffb7538463..389ef600e5 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-Me6/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-Me6/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=28800 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_US-Me6_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-Me6/CLM1PT_data/CTSM_DATM_US-Me6_2011-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2011" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-Myb/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-Myb/shell_commands index c1d6553e90..6cc05da64f 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-Myb/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-Myb/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=28800 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_US-Myb_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-Myb/CLM1PT_data/CTSM_DATM_US-Myb_2011-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2011" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-NR1/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-NR1/shell_commands index a859ca34d6..773ca669b1 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-NR1/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-NR1/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=25200 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_US-NR1_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-NR1/CLM1PT_data/CTSM_DATM_US-NR1_1999-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=1999" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-Ne1/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-Ne1/shell_commands index 150a7109e9..f2adadd3ac 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-Ne1/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-Ne1/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=21600 ./xmlchange ATM_NCPL=24 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_US-Ne1_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-Ne1/CLM1PT_data/CTSM_DATM_US-Ne1_2002-2012.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2002" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2012" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-Ne2/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-Ne2/shell_commands index a43a4f0523..15ed24bdee 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-Ne2/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-Ne2/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=21600 ./xmlchange ATM_NCPL=24 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_US-Ne2_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-Ne2/CLM1PT_data/CTSM_DATM_US-Ne2_2002-2012.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2002" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2012" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-Ne3/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-Ne3/shell_commands index cf8a20d653..631bf243e4 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-Ne3/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-Ne3/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=21600 ./xmlchange ATM_NCPL=24 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_US-Ne3_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-Ne3/CLM1PT_data/CTSM_DATM_US-Ne3_2002-2012.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2002" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2012" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-PFa/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-PFa/shell_commands index a8c15c035c..dd400a9257 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-PFa/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-PFa/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=21600 ./xmlchange ATM_NCPL=24 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_US-PFa_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-PFa/CLM1PT_data/CTSM_DATM_US-PFa_1995-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=1995" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-Prr/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-Prr/shell_commands index 6d34756259..28acc5f402 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-Prr/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-Prr/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=32400 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_US-Prr_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-Prr/CLM1PT_data/CTSM_DATM_US-Prr_2011-2013.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2011" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2013" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-SP1/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-SP1/shell_commands index ef3192eac3..37e05304a8 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-SP1/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-SP1/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=18000 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_US-SP1_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-SP1/CLM1PT_data/CTSM_DATM_US-SP1_2005-2005.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2005" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2005" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-SP2/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-SP2/shell_commands index b070c1123b..a4ea7a35ac 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-SP2/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-SP2/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=18000 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_US-SP2_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-SP2/CLM1PT_data/CTSM_DATM_US-SP2_2000-2004.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2000" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2004" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-SP3/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-SP3/shell_commands index fbf338ca93..76c00c8a36 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-SP3/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-SP3/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=18000 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_US-SP3_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-SP3/CLM1PT_data/CTSM_DATM_US-SP3_1999-2004.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=1999" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2004" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-SRG/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-SRG/shell_commands index 2f102954ef..804a5f9884 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-SRG/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-SRG/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=25200 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_US-SRG_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-SRG/CLM1PT_data/CTSM_DATM_US-SRG_2009-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2009" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-SRM/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-SRM/shell_commands index a930aeb922..9b379b1edb 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-SRM/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-SRM/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=25200 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_US-SRM_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-SRM/CLM1PT_data/CTSM_DATM_US-SRM_2004-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2004" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-Syv/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-Syv/shell_commands index 8b95474d55..0fe6c91305 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-Syv/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-Syv/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=21600 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_US-Syv_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-Syv/CLM1PT_data/CTSM_DATM_US-Syv_2002-2008.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2002" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2008" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-Ton/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-Ton/shell_commands index 8fc48db2e3..e97bac9028 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-Ton/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-Ton/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=28800 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_US-Ton_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-Ton/CLM1PT_data/CTSM_DATM_US-Ton_2001-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2001" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-Tw4/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-Tw4/shell_commands index e9b5fb0a4d..49ad7cddd2 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-Tw4/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-Tw4/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=28800 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_US-Tw4_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-Tw4/CLM1PT_data/CTSM_DATM_US-Tw4_2014-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2014" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-Twt/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-Twt/shell_commands index d49419e72f..447906c4fc 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-Twt/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-Twt/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=28800 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_US-Twt_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-Twt/CLM1PT_data/CTSM_DATM_US-Twt_2010-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2010" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-UMB/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-UMB/shell_commands index 54b64467c3..1b3ee51b17 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-UMB/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-UMB/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=18000 ./xmlchange ATM_NCPL=24 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_US-UMB_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-UMB/CLM1PT_data/CTSM_DATM_US-UMB_2000-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2000" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-Var/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-Var/shell_commands index 84c0fb82a0..099e07e301 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-Var/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-Var/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=28800 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_US-Var_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-Var/CLM1PT_data/CTSM_DATM_US-Var_2001-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2001" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-WCr/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-WCr/shell_commands index e5aa83d4a4..de5a646543 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-WCr/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-WCr/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=21600 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_US-WCr_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-WCr/CLM1PT_data/CTSM_DATM_US-WCr_1999-2006.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=1999" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2006" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-Whs/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-Whs/shell_commands index 5e81cc5524..f706a2e79a 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-Whs/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-Whs/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=25200 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_US-Whs_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-Whs/CLM1PT_data/CTSM_DATM_US-Whs_2008-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2008" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-Wkg/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-Wkg/shell_commands index 324cf4860f..0fc65819c2 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-Wkg/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-Wkg/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=25200 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_US-Wkg_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-Wkg/CLM1PT_data/CTSM_DATM_US-Wkg_2005-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2005" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/ZA-Kru/shell_commands b/cime_config/usermods_dirs/PLUMBER2/ZA-Kru/shell_commands index 138996eda2..7c2dfed5c9 100644 --- a/cime_config/usermods_dirs/PLUMBER2/ZA-Kru/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/ZA-Kru/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=79200 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_ZA-Kru_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/ZA-Kru/CLM1PT_data/CTSM_DATM_ZA-Kru_2000-2002.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2000" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2002" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/ZM-Mon/shell_commands b/cime_config/usermods_dirs/PLUMBER2/ZM-Mon/shell_commands index 8443f0a13b..825675dc9b 100644 --- a/cime_config/usermods_dirs/PLUMBER2/ZM-Mon/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/ZM-Mon/shell_commands @@ -4,6 +4,7 @@ ./xmlchange START_TOD=79200 ./xmlchange ATM_NCPL=48 +echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_ZM-Mon_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/ZM-Mon/CLM1PT_data/CTSM_DATM_ZM-Mon_2008-2008.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2008" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2008" >> user_nl_datm_streams From 0197db68574455c5c786f355f2cca00c374b25c6 Mon Sep 17 00:00:00 2001 From: Teagan King Date: Tue, 23 Apr 2024 14:17:39 -0600 Subject: [PATCH 0908/1248] include plumber in cime_config --- cime_config/buildnml | 2 +- cime_config/config_component.xml | 25 ++++++++++++++++++++++++- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/cime_config/buildnml b/cime_config/buildnml index 3eb45dff31..554010576e 100755 --- a/cime_config/buildnml +++ b/cime_config/buildnml @@ -224,7 +224,7 @@ def buildnml(case, caseroot, compname): clm_usrdat_name = case.get_value("CLM_USRDAT_NAME") clmusr = " -clm_usr_name %s " % clm_usrdat_name # Write warning about initial condition data - if "NEON" in clm_usrdat_name and clm_force_coldstart == "off": + if (("NEON" in clm_usrdat_name) or ("PLUMBER" in clm_usrdat_name)) and clm_force_coldstart == "off": if ("_transient" in clm_nml_use_case) and ( re.fullmatch(r"\w\w\w\w\.transient", casename) is None or clm_usrdat_name is "NEON.PRISM" diff --git a/cime_config/config_component.xml b/cime_config/config_component.xml index 3c48e16651..1fc7a3a3a1 100644 --- a/cime_config/config_component.xml +++ b/cime_config/config_component.xml @@ -330,7 +330,8 @@ to create_newcase. The default value is UNSET. For NEON cases, this can be set to either NEON or NEON.PRISM, the latter of which would use PRISM precipitation instead of the default NEON precipitation. NEON cases then also - use the variable NEONSITE to specify the exact site. + use the variable NEONSITE to specify the exact site. PLUMBER cases use the variable + PLUMBER2SITE to specify the exact site. @@ -418,6 +419,28 @@ Version id of Neon data + + char + + + AR-SLu,AT-Neu,AU-ASM,AU-Cow,AU-Cpr,AU-Ctr,AU-Cum,AU-DaP,AU-DaS,AU-Dry,AU-Emr,AU-Gin,AU-GWW,AU-How,AU-Lit, + AU-Otw,AU-Rig,AU-Rob,AU-Sam,AU-Stp,AU-TTE,AU-Tum,AU-Whr,AU-Wrr,AU-Ync,BE-Bra,BE-Lon,BE-Vie,BR-Sa3,BW-Ma1,CA-NS1, + CA-NS2,CA-NS4,CA-NS5,CA-NS6,CA-NS7,CA-Qcu,CA-Qfo,CA-SF1,CA-SF2,CA-SF3,CH-Cha,CH-Dav,CH-Fru,CH-Oe1,CN-Cha,CN-Cng, + CN-Dan,CN-Din,CN-Du2,CN-HaM,CN-Qia,CZ-wet,DE-Bay,DE-Geb,DE-Gri,DE-Hai,DE-Kli,DE-Meh,DE-Obe,DE-Seh,DE-SfN,DE-Tha, + DE-Wet,DK-Fou,DK-Lva,DK-Ris,DK-Sor,DK-ZaH,ES-ES1,ES-ES2,ES-LgS,ES-LMa,ES-VDA,FI-Hyy,FI-Kaa,FI-Lom,FI-Sod,FR-Fon, + FR-Gri,FR-Hes,FR-LBr,FR-Lq1,FR-Lq2,FR-Pue,GF-Guy,HU-Bug,ID-Pag,IE-Ca1,IE-Dri,IT-Amp,IT-BCi,IT-CA1,IT-CA2,IT-CA3, + IT-Col,IT-Cpz,IT-Isp,IT-Lav,IT-LMa,IT-Mal,IT-MBo,IT-Noe,IT-Non,IT-PT1,IT-Ren,IT-Ro1,IT-Ro2,IT-SR2,IT-SRo,JP-SMF, + NL-Ca1,NL-Hor,NL-Loo,PL-wet,PT-Esp,PT-Mi1,PT-Mi2,RU-Che,RU-Fyo,RU-Zot,SD-Dem,SE-Deg,UK-Gri,UK-Ham,UK-PL3,US-AR1, + US-AR2,US-ARM,US-Aud,US-Bar,US-Bkg,US-Blo,US-Bo1,US-Cop,US-FPe,US-GLE,US-Goo,US-Ha1,US-Ho1,US-KS2,US-Los,US-Me2, + US-Me4,US-Me6,US-MMS,US-MOz,US-Myb,US-Ne1,US-Ne2,US-Ne3,US-NR1,US-PFa,US-Prr,US-SP1,US-SP2,US-SP3,US-SRG,US-SRM, + US-Syv,US-Ton,US-Tw4,US-Twt,US-UMB,US-Var,US-WCr,US-Whs,US-Wkg,ZA-Kru,ZM-Mon, + + + run_component_ctsm + env_run.xml + Name of site for PLUMBER tower data + + ========================================= CLM naming conventions From 8d5a3108e9aba322740ce8598b13a9154cfda0fa Mon Sep 17 00:00:00 2001 From: Teagan King Date: Tue, 23 Apr 2024 14:20:26 -0600 Subject: [PATCH 0909/1248] black changes due to previous commit causing issues --- cime_config/buildnml | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/cime_config/buildnml b/cime_config/buildnml index 554010576e..8449ecadb2 100755 --- a/cime_config/buildnml +++ b/cime_config/buildnml @@ -182,7 +182,9 @@ def buildnml(case, caseroot, compname): clm_phys = case.get_value("CLM_PHYSICS_VERSION") config_cache_text = _config_cache_template.format(clm_phys=clm_phys) - config_cache_path = os.path.join(caseroot, "Buildconf", compname + "conf", "config_cache.xml") + config_cache_path = os.path.join( + caseroot, "Buildconf", compname + "conf", "config_cache.xml" + ) with open(config_cache_path, "w") as config_cache_file: config_cache_file.write(config_cache_text) @@ -224,7 +226,9 @@ def buildnml(case, caseroot, compname): clm_usrdat_name = case.get_value("CLM_USRDAT_NAME") clmusr = " -clm_usr_name %s " % clm_usrdat_name # Write warning about initial condition data - if (("NEON" in clm_usrdat_name) or ("PLUMBER" in clm_usrdat_name)) and clm_force_coldstart == "off": + if ( + ("NEON" in clm_usrdat_name) or ("PLUMBER" in clm_usrdat_name) + ) and clm_force_coldstart == "off": if ("_transient" in clm_nml_use_case) and ( re.fullmatch(r"\w\w\w\w\.transient", casename) is None or clm_usrdat_name is "NEON.PRISM" @@ -301,7 +305,9 @@ def buildnml(case, caseroot, compname): lndfrac_file = os.path.join(lnd_domain_path, lnd_domain_file) lndfrac_setting = "-lnd_frac " + lndfrac_file - config_cache_file = os.path.join(caseroot, "Buildconf", compname + "conf", "config_cache.xml") + config_cache_file = os.path.join( + caseroot, "Buildconf", compname + "conf", "config_cache.xml" + ) # ----------------------------------------------------- # Clear out old data @@ -364,7 +370,9 @@ def buildnml(case, caseroot, compname): break if not os.path.exists(os.path.join(rundir, clm_startfile)): - logger.warning("WARNING: Could NOT find a start file to use using" + clm_startfile) + logger.warning( + "WARNING: Could NOT find a start file to use using" + clm_startfile + ) clm_icfile = "%s = '%s'" % (startfile_type, clm_startfile) else: clm_icfile = "" @@ -375,7 +383,9 @@ def buildnml(case, caseroot, compname): user_nl_file = os.path.join(caseroot, "user_nl_clm" + inst_string) namelist_infile = os.path.join(ctsmconf, "namelist") - create_namelist_infile(case, user_nl_file, namelist_infile, "\n".join(infile_lines)) + create_namelist_infile( + case, user_nl_file, namelist_infile, "\n".join(infile_lines) + ) cmd = os.path.join(lnd_root, "bld", "build-namelist") From 64df032bf39102c66528db274ae0c26cf661915d Mon Sep 17 00:00:00 2001 From: Teagan King Date: Wed, 1 May 2024 16:18:30 -0600 Subject: [PATCH 0910/1248] line too long update --- cime_config/buildnml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cime_config/buildnml b/cime_config/buildnml index 8449ecadb2..8dc075c347 100755 --- a/cime_config/buildnml +++ b/cime_config/buildnml @@ -204,8 +204,9 @@ def buildnml(case, caseroot, compname): if clm_force_coldstart == "on": clm_force_coldstart = "off" logger.warning( - "WARNING: You've turned on CLM_FORCE_COLDSTART for a branch run_type, which is a contradiction, the coldstart will be ignored\n" - + " turn off CLM_FORCE_COLDSTART, or set RUN_TYPE=hybrid to get rid of this warning" + "WARNING: You've turned on CLM_FORCE_COLDSTART for a branch run_type,\n" + + "which is a contradiction, the coldstart will be ignored\n" + + "turn off CLM_FORCE_COLDSTART or set RUN_TYPE=hybrid to get rid of this warning" ) if clm_force_coldstart == "on": From 24c8d7c75e41e09c431fc3868cee6b11e33169d5 Mon Sep 17 00:00:00 2001 From: Teagan King Date: Wed, 1 May 2024 16:55:15 -0600 Subject: [PATCH 0911/1248] revert buildnml --- cime_config/buildnml | 25 +++++++------------------ 1 file changed, 7 insertions(+), 18 deletions(-) mode change 100755 => 100644 cime_config/buildnml diff --git a/cime_config/buildnml b/cime_config/buildnml old mode 100755 new mode 100644 index 8dc075c347..3eb45dff31 --- a/cime_config/buildnml +++ b/cime_config/buildnml @@ -182,9 +182,7 @@ def buildnml(case, caseroot, compname): clm_phys = case.get_value("CLM_PHYSICS_VERSION") config_cache_text = _config_cache_template.format(clm_phys=clm_phys) - config_cache_path = os.path.join( - caseroot, "Buildconf", compname + "conf", "config_cache.xml" - ) + config_cache_path = os.path.join(caseroot, "Buildconf", compname + "conf", "config_cache.xml") with open(config_cache_path, "w") as config_cache_file: config_cache_file.write(config_cache_text) @@ -204,9 +202,8 @@ def buildnml(case, caseroot, compname): if clm_force_coldstart == "on": clm_force_coldstart = "off" logger.warning( - "WARNING: You've turned on CLM_FORCE_COLDSTART for a branch run_type,\n" - + "which is a contradiction, the coldstart will be ignored\n" - + "turn off CLM_FORCE_COLDSTART or set RUN_TYPE=hybrid to get rid of this warning" + "WARNING: You've turned on CLM_FORCE_COLDSTART for a branch run_type, which is a contradiction, the coldstart will be ignored\n" + + " turn off CLM_FORCE_COLDSTART, or set RUN_TYPE=hybrid to get rid of this warning" ) if clm_force_coldstart == "on": @@ -227,9 +224,7 @@ def buildnml(case, caseroot, compname): clm_usrdat_name = case.get_value("CLM_USRDAT_NAME") clmusr = " -clm_usr_name %s " % clm_usrdat_name # Write warning about initial condition data - if ( - ("NEON" in clm_usrdat_name) or ("PLUMBER" in clm_usrdat_name) - ) and clm_force_coldstart == "off": + if "NEON" in clm_usrdat_name and clm_force_coldstart == "off": if ("_transient" in clm_nml_use_case) and ( re.fullmatch(r"\w\w\w\w\.transient", casename) is None or clm_usrdat_name is "NEON.PRISM" @@ -306,9 +301,7 @@ def buildnml(case, caseroot, compname): lndfrac_file = os.path.join(lnd_domain_path, lnd_domain_file) lndfrac_setting = "-lnd_frac " + lndfrac_file - config_cache_file = os.path.join( - caseroot, "Buildconf", compname + "conf", "config_cache.xml" - ) + config_cache_file = os.path.join(caseroot, "Buildconf", compname + "conf", "config_cache.xml") # ----------------------------------------------------- # Clear out old data @@ -371,9 +364,7 @@ def buildnml(case, caseroot, compname): break if not os.path.exists(os.path.join(rundir, clm_startfile)): - logger.warning( - "WARNING: Could NOT find a start file to use using" + clm_startfile - ) + logger.warning("WARNING: Could NOT find a start file to use using" + clm_startfile) clm_icfile = "%s = '%s'" % (startfile_type, clm_startfile) else: clm_icfile = "" @@ -384,9 +375,7 @@ def buildnml(case, caseroot, compname): user_nl_file = os.path.join(caseroot, "user_nl_clm" + inst_string) namelist_infile = os.path.join(ctsmconf, "namelist") - create_namelist_infile( - case, user_nl_file, namelist_infile, "\n".join(infile_lines) - ) + create_namelist_infile(case, user_nl_file, namelist_infile, "\n".join(infile_lines)) cmd = os.path.join(lnd_root, "bld", "build-namelist") From 7054bfa513620c2925052efdc06f6f577a1b2eb6 Mon Sep 17 00:00:00 2001 From: Teagan King Date: Wed, 1 May 2024 16:56:35 -0600 Subject: [PATCH 0912/1248] ran black locally --- cime_config/buildnml | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/cime_config/buildnml b/cime_config/buildnml index 3eb45dff31..a013a23162 100644 --- a/cime_config/buildnml +++ b/cime_config/buildnml @@ -182,7 +182,9 @@ def buildnml(case, caseroot, compname): clm_phys = case.get_value("CLM_PHYSICS_VERSION") config_cache_text = _config_cache_template.format(clm_phys=clm_phys) - config_cache_path = os.path.join(caseroot, "Buildconf", compname + "conf", "config_cache.xml") + config_cache_path = os.path.join( + caseroot, "Buildconf", compname + "conf", "config_cache.xml" + ) with open(config_cache_path, "w") as config_cache_file: config_cache_file.write(config_cache_text) @@ -301,7 +303,9 @@ def buildnml(case, caseroot, compname): lndfrac_file = os.path.join(lnd_domain_path, lnd_domain_file) lndfrac_setting = "-lnd_frac " + lndfrac_file - config_cache_file = os.path.join(caseroot, "Buildconf", compname + "conf", "config_cache.xml") + config_cache_file = os.path.join( + caseroot, "Buildconf", compname + "conf", "config_cache.xml" + ) # ----------------------------------------------------- # Clear out old data @@ -364,7 +368,9 @@ def buildnml(case, caseroot, compname): break if not os.path.exists(os.path.join(rundir, clm_startfile)): - logger.warning("WARNING: Could NOT find a start file to use using" + clm_startfile) + logger.warning( + "WARNING: Could NOT find a start file to use using" + clm_startfile + ) clm_icfile = "%s = '%s'" % (startfile_type, clm_startfile) else: clm_icfile = "" @@ -375,7 +381,9 @@ def buildnml(case, caseroot, compname): user_nl_file = os.path.join(caseroot, "user_nl_clm" + inst_string) namelist_infile = os.path.join(ctsmconf, "namelist") - create_namelist_infile(case, user_nl_file, namelist_infile, "\n".join(infile_lines)) + create_namelist_infile( + case, user_nl_file, namelist_infile, "\n".join(infile_lines) + ) cmd = os.path.join(lnd_root, "bld", "build-namelist") From ad83d13cf10673340c2b3473b6677a3a1e8c2391 Mon Sep 17 00:00:00 2001 From: Teagan King Date: Wed, 1 May 2024 16:58:12 -0600 Subject: [PATCH 0913/1248] undo local black run --- cime_config/buildnml | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/cime_config/buildnml b/cime_config/buildnml index a013a23162..3eb45dff31 100644 --- a/cime_config/buildnml +++ b/cime_config/buildnml @@ -182,9 +182,7 @@ def buildnml(case, caseroot, compname): clm_phys = case.get_value("CLM_PHYSICS_VERSION") config_cache_text = _config_cache_template.format(clm_phys=clm_phys) - config_cache_path = os.path.join( - caseroot, "Buildconf", compname + "conf", "config_cache.xml" - ) + config_cache_path = os.path.join(caseroot, "Buildconf", compname + "conf", "config_cache.xml") with open(config_cache_path, "w") as config_cache_file: config_cache_file.write(config_cache_text) @@ -303,9 +301,7 @@ def buildnml(case, caseroot, compname): lndfrac_file = os.path.join(lnd_domain_path, lnd_domain_file) lndfrac_setting = "-lnd_frac " + lndfrac_file - config_cache_file = os.path.join( - caseroot, "Buildconf", compname + "conf", "config_cache.xml" - ) + config_cache_file = os.path.join(caseroot, "Buildconf", compname + "conf", "config_cache.xml") # ----------------------------------------------------- # Clear out old data @@ -368,9 +364,7 @@ def buildnml(case, caseroot, compname): break if not os.path.exists(os.path.join(rundir, clm_startfile)): - logger.warning( - "WARNING: Could NOT find a start file to use using" + clm_startfile - ) + logger.warning("WARNING: Could NOT find a start file to use using" + clm_startfile) clm_icfile = "%s = '%s'" % (startfile_type, clm_startfile) else: clm_icfile = "" @@ -381,9 +375,7 @@ def buildnml(case, caseroot, compname): user_nl_file = os.path.join(caseroot, "user_nl_clm" + inst_string) namelist_infile = os.path.join(ctsmconf, "namelist") - create_namelist_infile( - case, user_nl_file, namelist_infile, "\n".join(infile_lines) - ) + create_namelist_infile(case, user_nl_file, namelist_infile, "\n".join(infile_lines)) cmd = os.path.join(lnd_root, "bld", "build-namelist") From d0c6d4cf4c34435a40fdf2862db62bbd3475021d Mon Sep 17 00:00:00 2001 From: Teagan King Date: Wed, 1 May 2024 17:01:53 -0600 Subject: [PATCH 0914/1248] include plumber in cime_config #2 --- cime_config/buildnml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cime_config/buildnml b/cime_config/buildnml index 3eb45dff31..554010576e 100644 --- a/cime_config/buildnml +++ b/cime_config/buildnml @@ -224,7 +224,7 @@ def buildnml(case, caseroot, compname): clm_usrdat_name = case.get_value("CLM_USRDAT_NAME") clmusr = " -clm_usr_name %s " % clm_usrdat_name # Write warning about initial condition data - if "NEON" in clm_usrdat_name and clm_force_coldstart == "off": + if (("NEON" in clm_usrdat_name) or ("PLUMBER" in clm_usrdat_name)) and clm_force_coldstart == "off": if ("_transient" in clm_nml_use_case) and ( re.fullmatch(r"\w\w\w\w\.transient", casename) is None or clm_usrdat_name is "NEON.PRISM" From bf6044d67cb8e62c0c849815559a8200df41b0bd Mon Sep 17 00:00:00 2001 From: Teagan King Date: Wed, 1 May 2024 17:04:21 -0600 Subject: [PATCH 0915/1248] manual black attempt at fix --- cime_config/buildnml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cime_config/buildnml b/cime_config/buildnml index 554010576e..23a4fe9bc7 100644 --- a/cime_config/buildnml +++ b/cime_config/buildnml @@ -224,7 +224,7 @@ def buildnml(case, caseroot, compname): clm_usrdat_name = case.get_value("CLM_USRDAT_NAME") clmusr = " -clm_usr_name %s " % clm_usrdat_name # Write warning about initial condition data - if (("NEON" in clm_usrdat_name) or ("PLUMBER" in clm_usrdat_name)) and clm_force_coldstart == "off": + if ("NEON" in clm_usrdat_name or "PLUMBER" in clm_usrdat_name) and clm_force_coldstart == "off": if ("_transient" in clm_nml_use_case) and ( re.fullmatch(r"\w\w\w\w\.transient", casename) is None or clm_usrdat_name is "NEON.PRISM" From e02dfa93d883d72f1a2c0a28e34ee26e9ef57cf8 Mon Sep 17 00:00:00 2001 From: Teagan King Date: Wed, 1 May 2024 17:09:06 -0600 Subject: [PATCH 0916/1248] trying a workaround --- cime_config/buildnml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cime_config/buildnml b/cime_config/buildnml index 23a4fe9bc7..eea28d38fd 100644 --- a/cime_config/buildnml +++ b/cime_config/buildnml @@ -224,7 +224,9 @@ def buildnml(case, caseroot, compname): clm_usrdat_name = case.get_value("CLM_USRDAT_NAME") clmusr = " -clm_usr_name %s " % clm_usrdat_name # Write warning about initial condition data + # fmt: off if ("NEON" in clm_usrdat_name or "PLUMBER" in clm_usrdat_name) and clm_force_coldstart == "off": + # fmt: on if ("_transient" in clm_nml_use_case) and ( re.fullmatch(r"\w\w\w\w\.transient", casename) is None or clm_usrdat_name is "NEON.PRISM" From 2bb58d634b57cd3eff3aaa0c330dd4a48b991833 Mon Sep 17 00:00:00 2001 From: Teagan King Date: Thu, 2 May 2024 08:39:04 -0600 Subject: [PATCH 0917/1248] removed parantheses --- cime_config/buildnml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cime_config/buildnml b/cime_config/buildnml index eea28d38fd..c0e4fbb7f2 100644 --- a/cime_config/buildnml +++ b/cime_config/buildnml @@ -225,7 +225,7 @@ def buildnml(case, caseroot, compname): clmusr = " -clm_usr_name %s " % clm_usrdat_name # Write warning about initial condition data # fmt: off - if ("NEON" in clm_usrdat_name or "PLUMBER" in clm_usrdat_name) and clm_force_coldstart == "off": + if "NEON" in clm_usrdat_name or "PLUMBER" in clm_usrdat_name and clm_force_coldstart == "off": # fmt: on if ("_transient" in clm_nml_use_case) and ( re.fullmatch(r"\w\w\w\w\.transient", casename) is None From ee6b01f052f4905e0db5dcb1cd4d796e1e8f7034 Mon Sep 17 00:00:00 2001 From: Teagan King Date: Thu, 2 May 2024 08:46:49 -0600 Subject: [PATCH 0918/1248] this should pass --- cime_config/buildnml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cime_config/buildnml b/cime_config/buildnml index c0e4fbb7f2..c965c4f0d1 100644 --- a/cime_config/buildnml +++ b/cime_config/buildnml @@ -225,7 +225,7 @@ def buildnml(case, caseroot, compname): clmusr = " -clm_usr_name %s " % clm_usrdat_name # Write warning about initial condition data # fmt: off - if "NEON" in clm_usrdat_name or "PLUMBER" in clm_usrdat_name and clm_force_coldstart == "off": + if "NEON" in clm_usrdat_name and clm_force_coldstart == "off": # fmt: on if ("_transient" in clm_nml_use_case) and ( re.fullmatch(r"\w\w\w\w\.transient", casename) is None From 4e6dbfbb31c91d293231cc13e65eb34795b995ff Mon Sep 17 00:00:00 2001 From: Teagan King Date: Thu, 2 May 2024 08:48:48 -0600 Subject: [PATCH 0919/1248] added parantheses --- cime_config/buildnml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cime_config/buildnml b/cime_config/buildnml index c965c4f0d1..2461f37dac 100644 --- a/cime_config/buildnml +++ b/cime_config/buildnml @@ -225,7 +225,7 @@ def buildnml(case, caseroot, compname): clmusr = " -clm_usr_name %s " % clm_usrdat_name # Write warning about initial condition data # fmt: off - if "NEON" in clm_usrdat_name and clm_force_coldstart == "off": + if ("NEON" in clm_usrdat_name) and clm_force_coldstart == "off": # fmt: on if ("_transient" in clm_nml_use_case) and ( re.fullmatch(r"\w\w\w\w\.transient", casename) is None From f6a09fba8fd71a52bfe88578c685cfcedf344602 Mon Sep 17 00:00:00 2001 From: Teagan King Date: Thu, 2 May 2024 08:51:22 -0600 Subject: [PATCH 0920/1248] undo buildnml changes --- cime_config/buildnml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/cime_config/buildnml b/cime_config/buildnml index 2461f37dac..3eb45dff31 100644 --- a/cime_config/buildnml +++ b/cime_config/buildnml @@ -224,9 +224,7 @@ def buildnml(case, caseroot, compname): clm_usrdat_name = case.get_value("CLM_USRDAT_NAME") clmusr = " -clm_usr_name %s " % clm_usrdat_name # Write warning about initial condition data - # fmt: off - if ("NEON" in clm_usrdat_name) and clm_force_coldstart == "off": - # fmt: on + if "NEON" in clm_usrdat_name and clm_force_coldstart == "off": if ("_transient" in clm_nml_use_case) and ( re.fullmatch(r"\w\w\w\w\.transient", casename) is None or clm_usrdat_name is "NEON.PRISM" From b9de93343ea87ee11d4ed85b3fe0117932fc076e Mon Sep 17 00:00:00 2001 From: Teagan King Date: Thu, 2 May 2024 08:54:39 -0600 Subject: [PATCH 0921/1248] parantheses --- cime_config/buildnml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cime_config/buildnml b/cime_config/buildnml index 3eb45dff31..9bf6766693 100644 --- a/cime_config/buildnml +++ b/cime_config/buildnml @@ -224,7 +224,7 @@ def buildnml(case, caseroot, compname): clm_usrdat_name = case.get_value("CLM_USRDAT_NAME") clmusr = " -clm_usr_name %s " % clm_usrdat_name # Write warning about initial condition data - if "NEON" in clm_usrdat_name and clm_force_coldstart == "off": + if ("NEON" in clm_usrdat_name) and clm_force_coldstart == "off": if ("_transient" in clm_nml_use_case) and ( re.fullmatch(r"\w\w\w\w\.transient", casename) is None or clm_usrdat_name is "NEON.PRISM" From 0c2cc0689f988b8301819dce77d5179b0ba110b0 Mon Sep 17 00:00:00 2001 From: Teagan King Date: Thu, 2 May 2024 08:56:40 -0600 Subject: [PATCH 0922/1248] test additional argument --- cime_config/buildnml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cime_config/buildnml b/cime_config/buildnml index 9bf6766693..e446b20a74 100644 --- a/cime_config/buildnml +++ b/cime_config/buildnml @@ -224,7 +224,7 @@ def buildnml(case, caseroot, compname): clm_usrdat_name = case.get_value("CLM_USRDAT_NAME") clmusr = " -clm_usr_name %s " % clm_usrdat_name # Write warning about initial condition data - if ("NEON" in clm_usrdat_name) and clm_force_coldstart == "off": + if (("NEON" in clm_usrdat_name) or False) and clm_force_coldstart == "off": if ("_transient" in clm_nml_use_case) and ( re.fullmatch(r"\w\w\w\w\.transient", casename) is None or clm_usrdat_name is "NEON.PRISM" From 2f65ab89fbbcb98d8d06ea2cc2ed080e002b0fea Mon Sep 17 00:00:00 2001 From: Teagan King Date: Thu, 2 May 2024 09:08:06 -0600 Subject: [PATCH 0923/1248] use any --- cime_config/buildnml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cime_config/buildnml b/cime_config/buildnml index e446b20a74..a25a513219 100644 --- a/cime_config/buildnml +++ b/cime_config/buildnml @@ -224,7 +224,7 @@ def buildnml(case, caseroot, compname): clm_usrdat_name = case.get_value("CLM_USRDAT_NAME") clmusr = " -clm_usr_name %s " % clm_usrdat_name # Write warning about initial condition data - if (("NEON" in clm_usrdat_name) or False) and clm_force_coldstart == "off": + if (any(item in clm_usrdat_name for item in ["NEON", "PLUMBER"]) and clm_force_coldstart == "off": if ("_transient" in clm_nml_use_case) and ( re.fullmatch(r"\w\w\w\w\.transient", casename) is None or clm_usrdat_name is "NEON.PRISM" From 02b20378bb1095300f7af721a790c32526b4c1cd Mon Sep 17 00:00:00 2001 From: Teagan King Date: Thu, 2 May 2024 09:10:14 -0600 Subject: [PATCH 0924/1248] remove any and add additional statement --- cime_config/buildnml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cime_config/buildnml b/cime_config/buildnml index a25a513219..554010576e 100644 --- a/cime_config/buildnml +++ b/cime_config/buildnml @@ -224,7 +224,7 @@ def buildnml(case, caseroot, compname): clm_usrdat_name = case.get_value("CLM_USRDAT_NAME") clmusr = " -clm_usr_name %s " % clm_usrdat_name # Write warning about initial condition data - if (any(item in clm_usrdat_name for item in ["NEON", "PLUMBER"]) and clm_force_coldstart == "off": + if (("NEON" in clm_usrdat_name) or ("PLUMBER" in clm_usrdat_name)) and clm_force_coldstart == "off": if ("_transient" in clm_nml_use_case) and ( re.fullmatch(r"\w\w\w\w\.transient", casename) is None or clm_usrdat_name is "NEON.PRISM" From 1d7ed405c065e0fdbb0778a3b9769cf1049115f6 Mon Sep 17 00:00:00 2001 From: Teagan King Date: Thu, 2 May 2024 09:11:38 -0600 Subject: [PATCH 0925/1248] dummy argument test --- cime_config/buildnml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cime_config/buildnml b/cime_config/buildnml index 554010576e..b298bfab4b 100644 --- a/cime_config/buildnml +++ b/cime_config/buildnml @@ -224,7 +224,7 @@ def buildnml(case, caseroot, compname): clm_usrdat_name = case.get_value("CLM_USRDAT_NAME") clmusr = " -clm_usr_name %s " % clm_usrdat_name # Write warning about initial condition data - if (("NEON" in clm_usrdat_name) or ("PLUMBER" in clm_usrdat_name)) and clm_force_coldstart == "off": + if (("NEON" in clm_usrdat_name) or (False)) and clm_force_coldstart == "off": if ("_transient" in clm_nml_use_case) and ( re.fullmatch(r"\w\w\w\w\.transient", casename) is None or clm_usrdat_name is "NEON.PRISM" From 8aa0286ab3e15676f72484a94c5007eee682bd6d Mon Sep 17 00:00:00 2001 From: Teagan King Date: Thu, 2 May 2024 09:12:55 -0600 Subject: [PATCH 0926/1248] dummy argument test --- cime_config/buildnml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cime_config/buildnml b/cime_config/buildnml index b298bfab4b..e275e746f3 100644 --- a/cime_config/buildnml +++ b/cime_config/buildnml @@ -224,7 +224,7 @@ def buildnml(case, caseroot, compname): clm_usrdat_name = case.get_value("CLM_USRDAT_NAME") clmusr = " -clm_usr_name %s " % clm_usrdat_name # Write warning about initial condition data - if (("NEON" in clm_usrdat_name) or (False)) and clm_force_coldstart == "off": + if (("NEON" in clm_usrdat_name) or ("PLUMBER" in ['PLUMBER'])) and clm_force_coldstart == "off": if ("_transient" in clm_nml_use_case) and ( re.fullmatch(r"\w\w\w\w\.transient", casename) is None or clm_usrdat_name is "NEON.PRISM" From e6c1e2a37ed9926e0bbbce877c8ecb1b769f11e5 Mon Sep 17 00:00:00 2001 From: Teagan King Date: Thu, 2 May 2024 09:14:46 -0600 Subject: [PATCH 0927/1248] dummy argument test --- cime_config/buildnml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cime_config/buildnml b/cime_config/buildnml index e275e746f3..2d502a74a3 100644 --- a/cime_config/buildnml +++ b/cime_config/buildnml @@ -224,7 +224,7 @@ def buildnml(case, caseroot, compname): clm_usrdat_name = case.get_value("CLM_USRDAT_NAME") clmusr = " -clm_usr_name %s " % clm_usrdat_name # Write warning about initial condition data - if (("NEON" in clm_usrdat_name) or ("PLUMBER" in ['PLUMBER'])) and clm_force_coldstart == "off": + if (("NEON" in clm_usrdat_name) or ("PLUMBER" in lnd_grid)) and clm_force_coldstart == "off": if ("_transient" in clm_nml_use_case) and ( re.fullmatch(r"\w\w\w\w\.transient", casename) is None or clm_usrdat_name is "NEON.PRISM" From ff05906c822d10bb223d3a493c7765f66e95cce6 Mon Sep 17 00:00:00 2001 From: Teagan King Date: Thu, 2 May 2024 09:18:02 -0600 Subject: [PATCH 0928/1248] try to separate lines --- cime_config/buildnml | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/cime_config/buildnml b/cime_config/buildnml index 2d502a74a3..3f14a41250 100644 --- a/cime_config/buildnml +++ b/cime_config/buildnml @@ -224,15 +224,16 @@ def buildnml(case, caseroot, compname): clm_usrdat_name = case.get_value("CLM_USRDAT_NAME") clmusr = " -clm_usr_name %s " % clm_usrdat_name # Write warning about initial condition data - if (("NEON" in clm_usrdat_name) or ("PLUMBER" in lnd_grid)) and clm_force_coldstart == "off": - if ("_transient" in clm_nml_use_case) and ( - re.fullmatch(r"\w\w\w\w\.transient", casename) is None - or clm_usrdat_name is "NEON.PRISM" - ): - logger.warning( - "WARNING: Do you have appropriate initial conditions for this simulation?" - + " Check that the finidat file used in the lnd_in namelist is appropriately spunup for your case" - ) + if (("NEON" in clm_usrdat_name) or ("PLUMBER" in clm_usrdat_name)): + if clm_force_coldstart == "off": + if ("_transient" in clm_nml_use_case) and ( + re.fullmatch(r"\w\w\w\w\.transient", casename) is None + or clm_usrdat_name is "NEON.PRISM" + ): + logger.warning( + "WARNING: Do you have appropriate initial conditions for this simulation?" + + " Check that the finidat file used in the lnd_in namelist is appropriately spunup for your case" + ) if comp_atm != "datm": nomeg = "-no-megan" From 09b62d3a7a491f21c56fe859a815763b2a5394d7 Mon Sep 17 00:00:00 2001 From: Teagan King Date: Thu, 2 May 2024 09:19:58 -0600 Subject: [PATCH 0929/1248] remove external parentheses --- cime_config/buildnml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cime_config/buildnml b/cime_config/buildnml index 3f14a41250..acc74868e0 100644 --- a/cime_config/buildnml +++ b/cime_config/buildnml @@ -224,7 +224,7 @@ def buildnml(case, caseroot, compname): clm_usrdat_name = case.get_value("CLM_USRDAT_NAME") clmusr = " -clm_usr_name %s " % clm_usrdat_name # Write warning about initial condition data - if (("NEON" in clm_usrdat_name) or ("PLUMBER" in clm_usrdat_name)): + if ("NEON" in clm_usrdat_name) or ("PLUMBER" in clm_usrdat_name): if clm_force_coldstart == "off": if ("_transient" in clm_nml_use_case) and ( re.fullmatch(r"\w\w\w\w\.transient", casename) is None From af992361d81d0158ab653c87d25b3a06b7c0e3ff Mon Sep 17 00:00:00 2001 From: Teagan King Date: Fri, 28 Jun 2024 10:56:12 -0600 Subject: [PATCH 0930/1248] update usermods script and shell commands for fsurdat --- cime_config/usermods_dirs/PLUMBER2/AR-SLu/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/AT-Neu/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/AU-ASM/shell_commands | 6 +++--- cime_config/usermods_dirs/PLUMBER2/AU-Cow/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/AU-Cpr/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/AU-Ctr/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/AU-Cum/shell_commands | 4 ++-- cime_config/usermods_dirs/PLUMBER2/AU-DaP/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/AU-DaS/shell_commands | 4 ++-- cime_config/usermods_dirs/PLUMBER2/AU-Dry/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/AU-Emr/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/AU-GWW/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/AU-Gin/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/AU-How/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/AU-Lit/shell_commands | 6 +++--- cime_config/usermods_dirs/PLUMBER2/AU-Otw/shell_commands | 4 ++-- cime_config/usermods_dirs/PLUMBER2/AU-Rig/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/AU-Rob/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/AU-Sam/shell_commands | 4 ++-- cime_config/usermods_dirs/PLUMBER2/AU-Stp/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/AU-TTE/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/AU-Tum/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/AU-Whr/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/AU-Wrr/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/AU-Ync/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/BE-Bra/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/BE-Lon/shell_commands | 4 ++-- cime_config/usermods_dirs/PLUMBER2/BE-Vie/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/BR-Sa3/shell_commands | 4 ++-- cime_config/usermods_dirs/PLUMBER2/BW-Ma1/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/CA-NS1/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/CA-NS2/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/CA-NS4/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/CA-NS5/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/CA-NS6/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/CA-NS7/shell_commands | 4 ++-- cime_config/usermods_dirs/PLUMBER2/CA-Qcu/shell_commands | 4 ++-- cime_config/usermods_dirs/PLUMBER2/CA-Qfo/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/CA-SF1/shell_commands | 4 ++-- cime_config/usermods_dirs/PLUMBER2/CA-SF2/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/CA-SF3/shell_commands | 4 ++-- cime_config/usermods_dirs/PLUMBER2/CH-Cha/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/CH-Dav/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/CH-Fru/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/CH-Oe1/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/CN-Cha/shell_commands | 4 ++-- cime_config/usermods_dirs/PLUMBER2/CN-Cng/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/CN-Dan/shell_commands | 4 ++-- cime_config/usermods_dirs/PLUMBER2/CN-Din/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/CN-Du2/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/CN-HaM/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/CN-Qia/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/CZ-wet/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/DE-Bay/shell_commands | 4 ++-- cime_config/usermods_dirs/PLUMBER2/DE-Geb/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/DE-Gri/shell_commands | 4 ++-- cime_config/usermods_dirs/PLUMBER2/DE-Hai/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/DE-Kli/shell_commands | 4 ++-- cime_config/usermods_dirs/PLUMBER2/DE-Meh/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/DE-Obe/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/DE-Seh/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/DE-SfN/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/DE-Tha/shell_commands | 4 ++-- cime_config/usermods_dirs/PLUMBER2/DE-Wet/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/DK-Fou/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/DK-Lva/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/DK-Ris/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/DK-Sor/shell_commands | 4 ++-- cime_config/usermods_dirs/PLUMBER2/DK-ZaH/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/ES-ES1/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/ES-ES2/shell_commands | 4 ++-- cime_config/usermods_dirs/PLUMBER2/ES-LMa/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/ES-LgS/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/ES-VDA/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/FI-Hyy/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/FI-Kaa/shell_commands | 4 ++-- cime_config/usermods_dirs/PLUMBER2/FI-Lom/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/FI-Sod/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/FR-Fon/shell_commands | 6 +++--- cime_config/usermods_dirs/PLUMBER2/FR-Gri/shell_commands | 4 ++-- cime_config/usermods_dirs/PLUMBER2/FR-Hes/shell_commands | 4 ++-- cime_config/usermods_dirs/PLUMBER2/FR-LBr/shell_commands | 4 ++-- cime_config/usermods_dirs/PLUMBER2/FR-Lq1/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/FR-Lq2/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/FR-Pue/shell_commands | 4 ++-- cime_config/usermods_dirs/PLUMBER2/GF-Guy/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/HU-Bug/shell_commands | 4 ++-- cime_config/usermods_dirs/PLUMBER2/ID-Pag/shell_commands | 4 ++-- cime_config/usermods_dirs/PLUMBER2/IE-Ca1/shell_commands | 4 ++-- cime_config/usermods_dirs/PLUMBER2/IE-Dri/shell_commands | 4 ++-- cime_config/usermods_dirs/PLUMBER2/IT-Amp/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/IT-BCi/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/IT-CA1/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/IT-CA2/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/IT-CA3/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/IT-Col/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/IT-Cpz/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/IT-Isp/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/IT-LMa/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/IT-Lav/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/IT-MBo/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/IT-Mal/shell_commands | 4 ++-- cime_config/usermods_dirs/PLUMBER2/IT-Noe/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/IT-Non/shell_commands | 4 ++-- cime_config/usermods_dirs/PLUMBER2/IT-PT1/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/IT-Ren/shell_commands | 4 ++-- cime_config/usermods_dirs/PLUMBER2/IT-Ro1/shell_commands | 4 ++-- cime_config/usermods_dirs/PLUMBER2/IT-Ro2/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/IT-SR2/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/IT-SRo/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/JP-SMF/shell_commands | 4 ++-- cime_config/usermods_dirs/PLUMBER2/NL-Ca1/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/NL-Hor/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/NL-Loo/shell_commands | 6 +++--- cime_config/usermods_dirs/PLUMBER2/PL-wet/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/PT-Esp/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/PT-Mi1/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/PT-Mi2/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/RU-Che/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/RU-Fyo/shell_commands | 4 ++-- cime_config/usermods_dirs/PLUMBER2/RU-Zot/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/SD-Dem/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/SE-Deg/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/UK-Gri/shell_commands | 4 ++-- cime_config/usermods_dirs/PLUMBER2/UK-Ham/shell_commands | 6 +++--- cime_config/usermods_dirs/PLUMBER2/UK-PL3/shell_commands | 4 ++-- cime_config/usermods_dirs/PLUMBER2/US-AR1/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/US-AR2/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/US-ARM/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/US-Aud/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/US-Bar/shell_commands | 6 +++--- cime_config/usermods_dirs/PLUMBER2/US-Bkg/shell_commands | 4 ++-- cime_config/usermods_dirs/PLUMBER2/US-Blo/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/US-Bo1/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/US-Cop/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/US-FPe/shell_commands | 4 ++-- cime_config/usermods_dirs/PLUMBER2/US-GLE/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/US-Goo/shell_commands | 4 ++-- cime_config/usermods_dirs/PLUMBER2/US-Ha1/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/US-Ho1/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/US-KS2/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/US-Los/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/US-MMS/shell_commands | 4 ++-- cime_config/usermods_dirs/PLUMBER2/US-MOz/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/US-Me2/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/US-Me4/shell_commands | 4 ++-- cime_config/usermods_dirs/PLUMBER2/US-Me6/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/US-Myb/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/US-NR1/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/US-Ne1/shell_commands | 4 ++-- cime_config/usermods_dirs/PLUMBER2/US-Ne2/shell_commands | 4 ++-- cime_config/usermods_dirs/PLUMBER2/US-Ne3/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/US-PFa/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/US-Prr/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/US-SP1/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/US-SP2/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/US-SP3/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/US-SRG/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/US-SRM/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/US-Syv/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/US-Ton/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/US-Tw4/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/US-Twt/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/US-UMB/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/US-Var/shell_commands | 4 ++-- cime_config/usermods_dirs/PLUMBER2/US-WCr/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/US-Whs/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/US-Wkg/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/ZA-Kru/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/ZM-Mon/shell_commands | 2 +- 170 files changed, 225 insertions(+), 225 deletions(-) diff --git a/cime_config/usermods_dirs/PLUMBER2/AR-SLu/shell_commands b/cime_config/usermods_dirs/PLUMBER2/AR-SLu/shell_commands index 44e145ec9c..d7f8707812 100644 --- a/cime_config/usermods_dirs/PLUMBER2/AR-SLu/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/AR-SLu/shell_commands @@ -1,10 +1,10 @@ +./xmlchange PLUMBER2SITE=AR-SLu ./xmlchange PTS_LON=-66.459808 ./xmlchange PTS_LAT=-33.464802 ./xmlchange DATM_YR_END=2010 ./xmlchange START_TOD=10800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_AR-SLu_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/AR-SLu/CLM1PT_data/CTSM_DATM_AR-SLu_2010-2010.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2010" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2010" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/AT-Neu/shell_commands b/cime_config/usermods_dirs/PLUMBER2/AT-Neu/shell_commands index 8ea324b8a0..dc0750224f 100644 --- a/cime_config/usermods_dirs/PLUMBER2/AT-Neu/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/AT-Neu/shell_commands @@ -1,10 +1,10 @@ +./xmlchange PLUMBER2SITE=AT-Neu ./xmlchange PTS_LON=11.3175 ./xmlchange PTS_LAT=47.116669 ./xmlchange DATM_YR_END=2012 ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_AT-Neu_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/AT-Neu/CLM1PT_data/CTSM_DATM_AT-Neu_2002-2012.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2002" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2012" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/AU-ASM/shell_commands b/cime_config/usermods_dirs/PLUMBER2/AU-ASM/shell_commands index 301f741e84..f3eae9a24e 100644 --- a/cime_config/usermods_dirs/PLUMBER2/AU-ASM/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/AU-ASM/shell_commands @@ -1,10 +1,10 @@ -./xmlchange PTS_LON=133.24899299999998 -./xmlchange PTS_LAT=-22.283001000000002 +./xmlchange PLUMBER2SITE=AU-ASM +./xmlchange PTS_LON=133.248993 +./xmlchange PTS_LAT=-22.283001 ./xmlchange DATM_YR_END=2017 ./xmlchange START_TOD=54000 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_AU-ASM_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/AU-ASM/CLM1PT_data/CTSM_DATM_AU-ASM_2011-2017.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2011" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2017" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/AU-Cow/shell_commands b/cime_config/usermods_dirs/PLUMBER2/AU-Cow/shell_commands index ed9e62746f..9e44c8232c 100644 --- a/cime_config/usermods_dirs/PLUMBER2/AU-Cow/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/AU-Cow/shell_commands @@ -1,10 +1,10 @@ +./xmlchange PLUMBER2SITE=AU-Cow ./xmlchange PTS_LON=145.427155 ./xmlchange PTS_LAT=-16.23819 ./xmlchange DATM_YR_END=2015 ./xmlchange START_TOD=50400 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_AU-Cow_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/AU-Cow/CLM1PT_data/CTSM_DATM_AU-Cow_2010-2015.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2010" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2015" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/AU-Cpr/shell_commands b/cime_config/usermods_dirs/PLUMBER2/AU-Cpr/shell_commands index 49a0df7f70..114544e9b5 100644 --- a/cime_config/usermods_dirs/PLUMBER2/AU-Cpr/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/AU-Cpr/shell_commands @@ -1,10 +1,10 @@ +./xmlchange PLUMBER2SITE=AU-Cpr ./xmlchange PTS_LON=140.589127 ./xmlchange PTS_LAT=-34.00206 ./xmlchange DATM_YR_END=2017 ./xmlchange START_TOD=46800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_AU-Cpr_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/AU-Cpr/CLM1PT_data/CTSM_DATM_AU-Cpr_2011-2017.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2011" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2017" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/AU-Ctr/shell_commands b/cime_config/usermods_dirs/PLUMBER2/AU-Ctr/shell_commands index 2a6fd56772..7af2976c83 100644 --- a/cime_config/usermods_dirs/PLUMBER2/AU-Ctr/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/AU-Ctr/shell_commands @@ -1,10 +1,10 @@ +./xmlchange PLUMBER2SITE=AU-Ctr ./xmlchange PTS_LON=145.446854 ./xmlchange PTS_LAT=-16.103279 ./xmlchange DATM_YR_END=2017 ./xmlchange START_TOD=50400 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_AU-Ctr_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/AU-Ctr/CLM1PT_data/CTSM_DATM_AU-Ctr_2010-2017.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2010" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2017" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/AU-Cum/shell_commands b/cime_config/usermods_dirs/PLUMBER2/AU-Cum/shell_commands index 210e549fa2..8c75b3de45 100644 --- a/cime_config/usermods_dirs/PLUMBER2/AU-Cum/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/AU-Cum/shell_commands @@ -1,10 +1,10 @@ +./xmlchange PLUMBER2SITE=AU-Cum ./xmlchange PTS_LON=150.722473 -./xmlchange PTS_LAT=-33.613296999999996 +./xmlchange PTS_LAT=-33.613297 ./xmlchange DATM_YR_END=2018 ./xmlchange START_TOD=46800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_AU-Cum_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/AU-Cum/CLM1PT_data/CTSM_DATM_AU-Cum_2013-2018.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2013" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2018" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/AU-DaP/shell_commands b/cime_config/usermods_dirs/PLUMBER2/AU-DaP/shell_commands index f7692c9dfd..44171b3425 100644 --- a/cime_config/usermods_dirs/PLUMBER2/AU-DaP/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/AU-DaP/shell_commands @@ -1,10 +1,10 @@ +./xmlchange PLUMBER2SITE=AU-DaP ./xmlchange PTS_LON=131.3181 ./xmlchange PTS_LAT=-14.0633 ./xmlchange DATM_YR_END=2012 ./xmlchange START_TOD=54000 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_AU-DaP_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/AU-DaP/CLM1PT_data/CTSM_DATM_AU-DaP_2009-2012.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2009" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2012" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/AU-DaS/shell_commands b/cime_config/usermods_dirs/PLUMBER2/AU-DaS/shell_commands index 194ca882da..699b74900a 100644 --- a/cime_config/usermods_dirs/PLUMBER2/AU-DaS/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/AU-DaS/shell_commands @@ -1,10 +1,10 @@ +./xmlchange PLUMBER2SITE=AU-DaS ./xmlchange PTS_LON=131.388 -./xmlchange PTS_LAT=-14.159282999999999 +./xmlchange PTS_LAT=-14.159283 ./xmlchange DATM_YR_END=2017 ./xmlchange START_TOD=54000 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_AU-DaS_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/AU-DaS/CLM1PT_data/CTSM_DATM_AU-DaS_2010-2017.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2010" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2017" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/AU-Dry/shell_commands b/cime_config/usermods_dirs/PLUMBER2/AU-Dry/shell_commands index e1fa9be489..a2a4686230 100644 --- a/cime_config/usermods_dirs/PLUMBER2/AU-Dry/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/AU-Dry/shell_commands @@ -1,10 +1,10 @@ +./xmlchange PLUMBER2SITE=AU-Dry ./xmlchange PTS_LON=132.370605 ./xmlchange PTS_LAT=-15.2588 ./xmlchange DATM_YR_END=2015 ./xmlchange START_TOD=54000 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_AU-Dry_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/AU-Dry/CLM1PT_data/CTSM_DATM_AU-Dry_2011-2015.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2011" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2015" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/AU-Emr/shell_commands b/cime_config/usermods_dirs/PLUMBER2/AU-Emr/shell_commands index 43d63b2b46..7d9d557087 100644 --- a/cime_config/usermods_dirs/PLUMBER2/AU-Emr/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/AU-Emr/shell_commands @@ -1,10 +1,10 @@ +./xmlchange PLUMBER2SITE=AU-Emr ./xmlchange PTS_LON=148.474594 ./xmlchange PTS_LAT=-23.8587 ./xmlchange DATM_YR_END=2013 ./xmlchange START_TOD=50400 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_AU-Emr_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/AU-Emr/CLM1PT_data/CTSM_DATM_AU-Emr_2012-2013.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2012" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2013" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/AU-GWW/shell_commands b/cime_config/usermods_dirs/PLUMBER2/AU-GWW/shell_commands index 8eef1e7770..26bd398dc1 100644 --- a/cime_config/usermods_dirs/PLUMBER2/AU-GWW/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/AU-GWW/shell_commands @@ -1,10 +1,10 @@ +./xmlchange PLUMBER2SITE=AU-GWW ./xmlchange PTS_LON=120.654099 ./xmlchange PTS_LAT=-30.191299 ./xmlchange DATM_YR_END=2017 ./xmlchange START_TOD=57600 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_AU-GWW_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/AU-GWW/CLM1PT_data/CTSM_DATM_AU-GWW_2013-2017.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2013" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2017" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/AU-Gin/shell_commands b/cime_config/usermods_dirs/PLUMBER2/AU-Gin/shell_commands index 43a7ec4705..61d3c3eb01 100644 --- a/cime_config/usermods_dirs/PLUMBER2/AU-Gin/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/AU-Gin/shell_commands @@ -1,10 +1,10 @@ +./xmlchange PLUMBER2SITE=AU-Gin ./xmlchange PTS_LON=115.650002 ./xmlchange PTS_LAT=-31.375 ./xmlchange DATM_YR_END=2017 ./xmlchange START_TOD=57600 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_AU-Gin_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/AU-Gin/CLM1PT_data/CTSM_DATM_AU-Gin_2012-2017.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2012" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2017" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/AU-How/shell_commands b/cime_config/usermods_dirs/PLUMBER2/AU-How/shell_commands index 3a0cc4f882..7cac687aa3 100644 --- a/cime_config/usermods_dirs/PLUMBER2/AU-How/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/AU-How/shell_commands @@ -1,10 +1,10 @@ +./xmlchange PLUMBER2SITE=AU-How ./xmlchange PTS_LON=131.149994 ./xmlchange PTS_LAT=-12.4952 ./xmlchange DATM_YR_END=2017 ./xmlchange START_TOD=54000 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_AU-How_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/AU-How/CLM1PT_data/CTSM_DATM_AU-How_2003-2017.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2003" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2017" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/AU-Lit/shell_commands b/cime_config/usermods_dirs/PLUMBER2/AU-Lit/shell_commands index 45d132bee8..7f1a885344 100644 --- a/cime_config/usermods_dirs/PLUMBER2/AU-Lit/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/AU-Lit/shell_commands @@ -1,10 +1,10 @@ -./xmlchange PTS_LON=130.79449499999998 -./xmlchange PTS_LAT=-13.179039999999999 +./xmlchange PLUMBER2SITE=AU-Lit +./xmlchange PTS_LON=130.794495 +./xmlchange PTS_LAT=-13.17904 ./xmlchange DATM_YR_END=2017 ./xmlchange START_TOD=54000 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_AU-Lit_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/AU-Lit/CLM1PT_data/CTSM_DATM_AU-Lit_2016-2017.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2016" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2017" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/AU-Otw/shell_commands b/cime_config/usermods_dirs/PLUMBER2/AU-Otw/shell_commands index 7e63474531..4016a12e52 100644 --- a/cime_config/usermods_dirs/PLUMBER2/AU-Otw/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/AU-Otw/shell_commands @@ -1,10 +1,10 @@ +./xmlchange PLUMBER2SITE=AU-Otw ./xmlchange PTS_LON=142.816803 -./xmlchange PTS_LAT=-38.532340999999995 +./xmlchange PTS_LAT=-38.532341 ./xmlchange DATM_YR_END=2010 ./xmlchange START_TOD=46800 ./xmlchange ATM_NCPL=24 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_AU-Otw_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/AU-Otw/CLM1PT_data/CTSM_DATM_AU-Otw_2009-2010.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2009" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2010" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/AU-Rig/shell_commands b/cime_config/usermods_dirs/PLUMBER2/AU-Rig/shell_commands index 42bd3aac0c..193f3cc5dd 100644 --- a/cime_config/usermods_dirs/PLUMBER2/AU-Rig/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/AU-Rig/shell_commands @@ -1,10 +1,10 @@ +./xmlchange PLUMBER2SITE=AU-Rig ./xmlchange PTS_LON=145.575897 ./xmlchange PTS_LAT=-36.649899 ./xmlchange DATM_YR_END=2016 ./xmlchange START_TOD=46800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_AU-Rig_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/AU-Rig/CLM1PT_data/CTSM_DATM_AU-Rig_2011-2016.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2011" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2016" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/AU-Rob/shell_commands b/cime_config/usermods_dirs/PLUMBER2/AU-Rob/shell_commands index e51b36d89e..f7f4921746 100644 --- a/cime_config/usermods_dirs/PLUMBER2/AU-Rob/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/AU-Rob/shell_commands @@ -1,10 +1,10 @@ +./xmlchange PLUMBER2SITE=AU-Rob ./xmlchange PTS_LON=145.630096 ./xmlchange PTS_LAT=-17.1175 ./xmlchange DATM_YR_END=2017 ./xmlchange START_TOD=50400 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_AU-Rob_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/AU-Rob/CLM1PT_data/CTSM_DATM_AU-Rob_2014-2017.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2014" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2017" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/AU-Sam/shell_commands b/cime_config/usermods_dirs/PLUMBER2/AU-Sam/shell_commands index 919e322e8c..d1dae3a306 100644 --- a/cime_config/usermods_dirs/PLUMBER2/AU-Sam/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/AU-Sam/shell_commands @@ -1,10 +1,10 @@ -./xmlchange PTS_LON=152.87780800000002 +./xmlchange PLUMBER2SITE=AU-Sam +./xmlchange PTS_LON=152.877808 ./xmlchange PTS_LAT=-27.3881 ./xmlchange DATM_YR_END=2017 ./xmlchange START_TOD=50400 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_AU-Sam_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/AU-Sam/CLM1PT_data/CTSM_DATM_AU-Sam_2011-2017.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2011" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2017" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/AU-Stp/shell_commands b/cime_config/usermods_dirs/PLUMBER2/AU-Stp/shell_commands index 94cc191e2f..d0e4cdf638 100644 --- a/cime_config/usermods_dirs/PLUMBER2/AU-Stp/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/AU-Stp/shell_commands @@ -1,10 +1,10 @@ +./xmlchange PLUMBER2SITE=AU-Stp ./xmlchange PTS_LON=133.350204 ./xmlchange PTS_LAT=-17.1507 ./xmlchange DATM_YR_END=2017 ./xmlchange START_TOD=54000 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_AU-Stp_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/AU-Stp/CLM1PT_data/CTSM_DATM_AU-Stp_2010-2017.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2010" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2017" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/AU-TTE/shell_commands b/cime_config/usermods_dirs/PLUMBER2/AU-TTE/shell_commands index 3204d39d22..3c878a3ae9 100644 --- a/cime_config/usermods_dirs/PLUMBER2/AU-TTE/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/AU-TTE/shell_commands @@ -1,10 +1,10 @@ +./xmlchange PLUMBER2SITE=AU-TTE ./xmlchange PTS_LON=133.639999 ./xmlchange PTS_LAT=-22.287001 ./xmlchange DATM_YR_END=2017 ./xmlchange START_TOD=54000 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_AU-TTE_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/AU-TTE/CLM1PT_data/CTSM_DATM_AU-TTE_2013-2017.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2013" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2017" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/AU-Tum/shell_commands b/cime_config/usermods_dirs/PLUMBER2/AU-Tum/shell_commands index 51b0770e12..8e01ca6869 100644 --- a/cime_config/usermods_dirs/PLUMBER2/AU-Tum/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/AU-Tum/shell_commands @@ -1,10 +1,10 @@ +./xmlchange PLUMBER2SITE=AU-Tum ./xmlchange PTS_LON=148.151703 ./xmlchange PTS_LAT=-35.656601 ./xmlchange DATM_YR_END=2017 ./xmlchange START_TOD=46800 ./xmlchange ATM_NCPL=24 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_AU-Tum_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/AU-Tum/CLM1PT_data/CTSM_DATM_AU-Tum_2002-2017.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2002" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2017" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/AU-Whr/shell_commands b/cime_config/usermods_dirs/PLUMBER2/AU-Whr/shell_commands index 193218e604..5bde37cdc7 100644 --- a/cime_config/usermods_dirs/PLUMBER2/AU-Whr/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/AU-Whr/shell_commands @@ -1,10 +1,10 @@ +./xmlchange PLUMBER2SITE=AU-Whr ./xmlchange PTS_LON=145.029404 ./xmlchange PTS_LAT=-36.673199 ./xmlchange DATM_YR_END=2016 ./xmlchange START_TOD=46800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_AU-Whr_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/AU-Whr/CLM1PT_data/CTSM_DATM_AU-Whr_2015-2016.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2015" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2016" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/AU-Wrr/shell_commands b/cime_config/usermods_dirs/PLUMBER2/AU-Wrr/shell_commands index c5b6609661..76311551ed 100644 --- a/cime_config/usermods_dirs/PLUMBER2/AU-Wrr/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/AU-Wrr/shell_commands @@ -1,10 +1,10 @@ +./xmlchange PLUMBER2SITE=AU-Wrr ./xmlchange PTS_LON=146.654495 ./xmlchange PTS_LAT=-43.09502 ./xmlchange DATM_YR_END=2017 ./xmlchange START_TOD=46800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_AU-Wrr_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/AU-Wrr/CLM1PT_data/CTSM_DATM_AU-Wrr_2016-2017.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2016" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2017" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/AU-Ync/shell_commands b/cime_config/usermods_dirs/PLUMBER2/AU-Ync/shell_commands index 57fb25a4cf..e7c1c495fc 100644 --- a/cime_config/usermods_dirs/PLUMBER2/AU-Ync/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/AU-Ync/shell_commands @@ -1,10 +1,10 @@ +./xmlchange PLUMBER2SITE=AU-Ync ./xmlchange PTS_LON=146.290695 ./xmlchange PTS_LAT=-34.9893 ./xmlchange DATM_YR_END=2017 ./xmlchange START_TOD=46800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_AU-Ync_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/AU-Ync/CLM1PT_data/CTSM_DATM_AU-Ync_2011-2017.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2011" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2017" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/BE-Bra/shell_commands b/cime_config/usermods_dirs/PLUMBER2/BE-Bra/shell_commands index 28beca48b1..4cb0c5af5c 100644 --- a/cime_config/usermods_dirs/PLUMBER2/BE-Bra/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/BE-Bra/shell_commands @@ -1,10 +1,10 @@ +./xmlchange PLUMBER2SITE=BE-Bra ./xmlchange PTS_LON=4.52056 ./xmlchange PTS_LAT=51.309166 ./xmlchange DATM_YR_END=2014 ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_BE-Bra_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/BE-Bra/CLM1PT_data/CTSM_DATM_BE-Bra_2004-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2004" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/BE-Lon/shell_commands b/cime_config/usermods_dirs/PLUMBER2/BE-Lon/shell_commands index 3833429771..5ce5a904f5 100644 --- a/cime_config/usermods_dirs/PLUMBER2/BE-Lon/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/BE-Lon/shell_commands @@ -1,10 +1,10 @@ +./xmlchange PLUMBER2SITE=BE-Lon ./xmlchange PTS_LON=4.74613 -./xmlchange PTS_LAT=50.551590000000004 +./xmlchange PTS_LAT=50.55159 ./xmlchange DATM_YR_END=2014 ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_BE-Lon_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/BE-Lon/CLM1PT_data/CTSM_DATM_BE-Lon_2005-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2005" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/BE-Vie/shell_commands b/cime_config/usermods_dirs/PLUMBER2/BE-Vie/shell_commands index 6936b7bb27..0e4e802d91 100644 --- a/cime_config/usermods_dirs/PLUMBER2/BE-Vie/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/BE-Vie/shell_commands @@ -1,10 +1,10 @@ +./xmlchange PLUMBER2SITE=BE-Vie ./xmlchange PTS_LON=5.99805 ./xmlchange PTS_LAT=50.305069 ./xmlchange DATM_YR_END=2014 ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_BE-Vie_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/BE-Vie/CLM1PT_data/CTSM_DATM_BE-Vie_1997-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=1997" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/BR-Sa3/shell_commands b/cime_config/usermods_dirs/PLUMBER2/BR-Sa3/shell_commands index 58a839b51c..114becfc06 100644 --- a/cime_config/usermods_dirs/PLUMBER2/BR-Sa3/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/BR-Sa3/shell_commands @@ -1,10 +1,10 @@ +./xmlchange PLUMBER2SITE=BR-Sa3 ./xmlchange PTS_LON=-54.971436 -./xmlchange PTS_LAT=-3.0180290000000003 +./xmlchange PTS_LAT=-3.018029 ./xmlchange DATM_YR_END=2003 ./xmlchange START_TOD=14400 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_BR-Sa3_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/BR-Sa3/CLM1PT_data/CTSM_DATM_BR-Sa3_2001-2003.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2001" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2003" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/BW-Ma1/shell_commands b/cime_config/usermods_dirs/PLUMBER2/BW-Ma1/shell_commands index 88851105c0..7d0681f988 100644 --- a/cime_config/usermods_dirs/PLUMBER2/BW-Ma1/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/BW-Ma1/shell_commands @@ -1,10 +1,10 @@ +./xmlchange PLUMBER2SITE=BW-Ma1 ./xmlchange PTS_LON=23.560329 ./xmlchange PTS_LAT=-19.9165 ./xmlchange DATM_YR_END=2000 ./xmlchange START_TOD=79200 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_BW-Ma1_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/BW-Ma1/CLM1PT_data/CTSM_DATM_BW-Ma1_2000-2000.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2000" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2000" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/CA-NS1/shell_commands b/cime_config/usermods_dirs/PLUMBER2/CA-NS1/shell_commands index 962411e90b..47f8762dca 100644 --- a/cime_config/usermods_dirs/PLUMBER2/CA-NS1/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/CA-NS1/shell_commands @@ -1,10 +1,10 @@ +./xmlchange PLUMBER2SITE=CA-NS1 ./xmlchange PTS_LON=-98.483887 ./xmlchange PTS_LAT=55.8792 ./xmlchange DATM_YR_END=2003 ./xmlchange START_TOD=21600 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_CA-NS1_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/CA-NS1/CLM1PT_data/CTSM_DATM_CA-NS1_2003-2003.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2003" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2003" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/CA-NS2/shell_commands b/cime_config/usermods_dirs/PLUMBER2/CA-NS2/shell_commands index 897cf765df..c787c85af0 100644 --- a/cime_config/usermods_dirs/PLUMBER2/CA-NS2/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/CA-NS2/shell_commands @@ -1,10 +1,10 @@ +./xmlchange PLUMBER2SITE=CA-NS2 ./xmlchange PTS_LON=-98.524689 ./xmlchange PTS_LAT=55.9058 ./xmlchange DATM_YR_END=2004 ./xmlchange START_TOD=21600 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_CA-NS2_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/CA-NS2/CLM1PT_data/CTSM_DATM_CA-NS2_2002-2004.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2002" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2004" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/CA-NS4/shell_commands b/cime_config/usermods_dirs/PLUMBER2/CA-NS4/shell_commands index d1d7315b2c..5e4247d5ee 100644 --- a/cime_config/usermods_dirs/PLUMBER2/CA-NS4/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/CA-NS4/shell_commands @@ -1,10 +1,10 @@ +./xmlchange PLUMBER2SITE=CA-NS4 ./xmlchange PTS_LON=-98.380615 ./xmlchange PTS_LAT=55.914398 ./xmlchange DATM_YR_END=2004 ./xmlchange START_TOD=21600 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_CA-NS4_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/CA-NS4/CLM1PT_data/CTSM_DATM_CA-NS4_2003-2004.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2003" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2004" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/CA-NS5/shell_commands b/cime_config/usermods_dirs/PLUMBER2/CA-NS5/shell_commands index b73f17e9f6..bddbef5bb3 100644 --- a/cime_config/usermods_dirs/PLUMBER2/CA-NS5/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/CA-NS5/shell_commands @@ -1,10 +1,10 @@ +./xmlchange PLUMBER2SITE=CA-NS5 ./xmlchange PTS_LON=-98.484985 ./xmlchange PTS_LAT=55.863098 ./xmlchange DATM_YR_END=2004 ./xmlchange START_TOD=21600 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_CA-NS5_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/CA-NS5/CLM1PT_data/CTSM_DATM_CA-NS5_2003-2004.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2003" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2004" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/CA-NS6/shell_commands b/cime_config/usermods_dirs/PLUMBER2/CA-NS6/shell_commands index a785233c1f..908a798b98 100644 --- a/cime_config/usermods_dirs/PLUMBER2/CA-NS6/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/CA-NS6/shell_commands @@ -1,10 +1,10 @@ +./xmlchange PLUMBER2SITE=CA-NS6 ./xmlchange PTS_LON=-98.964417 ./xmlchange PTS_LAT=55.916698 ./xmlchange DATM_YR_END=2004 ./xmlchange START_TOD=21600 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_CA-NS6_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/CA-NS6/CLM1PT_data/CTSM_DATM_CA-NS6_2002-2004.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2002" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2004" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/CA-NS7/shell_commands b/cime_config/usermods_dirs/PLUMBER2/CA-NS7/shell_commands index f97c5c5141..5734053c2b 100644 --- a/cime_config/usermods_dirs/PLUMBER2/CA-NS7/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/CA-NS7/shell_commands @@ -1,10 +1,10 @@ -./xmlchange PTS_LON=-99.94830300000001 +./xmlchange PLUMBER2SITE=CA-NS7 +./xmlchange PTS_LON=-99.948303 ./xmlchange PTS_LAT=56.635799 ./xmlchange DATM_YR_END=2004 ./xmlchange START_TOD=21600 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_CA-NS7_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/CA-NS7/CLM1PT_data/CTSM_DATM_CA-NS7_2003-2004.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2003" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2004" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/CA-Qcu/shell_commands b/cime_config/usermods_dirs/PLUMBER2/CA-Qcu/shell_commands index 878c28ddf6..b68de255cb 100644 --- a/cime_config/usermods_dirs/PLUMBER2/CA-Qcu/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/CA-Qcu/shell_commands @@ -1,10 +1,10 @@ +./xmlchange PLUMBER2SITE=CA-Qcu ./xmlchange PTS_LON=-74.03653 -./xmlchange PTS_LAT=49.267078000000005 +./xmlchange PTS_LAT=49.267078 ./xmlchange DATM_YR_END=2006 ./xmlchange START_TOD=18000 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_CA-Qcu_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/CA-Qcu/CLM1PT_data/CTSM_DATM_CA-Qcu_2002-2006.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2002" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2006" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/CA-Qfo/shell_commands b/cime_config/usermods_dirs/PLUMBER2/CA-Qfo/shell_commands index bde28704c5..8829dfb112 100644 --- a/cime_config/usermods_dirs/PLUMBER2/CA-Qfo/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/CA-Qfo/shell_commands @@ -1,10 +1,10 @@ +./xmlchange PLUMBER2SITE=CA-Qfo ./xmlchange PTS_LON=-74.342102 ./xmlchange PTS_LAT=49.692501 ./xmlchange DATM_YR_END=2010 ./xmlchange START_TOD=18000 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_CA-Qfo_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/CA-Qfo/CLM1PT_data/CTSM_DATM_CA-Qfo_2004-2010.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2004" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2010" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/CA-SF1/shell_commands b/cime_config/usermods_dirs/PLUMBER2/CA-SF1/shell_commands index c529507b7e..f227bbb636 100644 --- a/cime_config/usermods_dirs/PLUMBER2/CA-SF1/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/CA-SF1/shell_commands @@ -1,10 +1,10 @@ +./xmlchange PLUMBER2SITE=CA-SF1 ./xmlchange PTS_LON=-105.817596 -./xmlchange PTS_LAT=54.485001000000004 +./xmlchange PTS_LAT=54.485001 ./xmlchange DATM_YR_END=2006 ./xmlchange START_TOD=21600 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_CA-SF1_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/CA-SF1/CLM1PT_data/CTSM_DATM_CA-SF1_2004-2006.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2004" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2006" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/CA-SF2/shell_commands b/cime_config/usermods_dirs/PLUMBER2/CA-SF2/shell_commands index aebfd10bbe..8083656498 100644 --- a/cime_config/usermods_dirs/PLUMBER2/CA-SF2/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/CA-SF2/shell_commands @@ -1,10 +1,10 @@ +./xmlchange PLUMBER2SITE=CA-SF2 ./xmlchange PTS_LON=-105.877502 ./xmlchange PTS_LAT=54.253899 ./xmlchange DATM_YR_END=2005 ./xmlchange START_TOD=21600 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_CA-SF2_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/CA-SF2/CLM1PT_data/CTSM_DATM_CA-SF2_2003-2005.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2003" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2005" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/CA-SF3/shell_commands b/cime_config/usermods_dirs/PLUMBER2/CA-SF3/shell_commands index bd68572dca..0c48e83347 100644 --- a/cime_config/usermods_dirs/PLUMBER2/CA-SF3/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/CA-SF3/shell_commands @@ -1,10 +1,10 @@ -./xmlchange PTS_LON=-106.00531000000001 +./xmlchange PLUMBER2SITE=CA-SF3 +./xmlchange PTS_LON=-106.00531 ./xmlchange PTS_LAT=54.091599 ./xmlchange DATM_YR_END=2005 ./xmlchange START_TOD=21600 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_CA-SF3_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/CA-SF3/CLM1PT_data/CTSM_DATM_CA-SF3_2003-2005.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2003" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2005" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/CH-Cha/shell_commands b/cime_config/usermods_dirs/PLUMBER2/CH-Cha/shell_commands index d8a0aa59c1..8a769f83ff 100644 --- a/cime_config/usermods_dirs/PLUMBER2/CH-Cha/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/CH-Cha/shell_commands @@ -1,10 +1,10 @@ +./xmlchange PLUMBER2SITE=CH-Cha ./xmlchange PTS_LON=8.41044 ./xmlchange PTS_LAT=47.21022 ./xmlchange DATM_YR_END=2014 ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_CH-Cha_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/CH-Cha/CLM1PT_data/CTSM_DATM_CH-Cha_2006-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2006" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/CH-Dav/shell_commands b/cime_config/usermods_dirs/PLUMBER2/CH-Dav/shell_commands index 19f4cc5ba0..4a70829314 100644 --- a/cime_config/usermods_dirs/PLUMBER2/CH-Dav/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/CH-Dav/shell_commands @@ -1,10 +1,10 @@ +./xmlchange PLUMBER2SITE=CH-Dav ./xmlchange PTS_LON=9.85592 ./xmlchange PTS_LAT=46.815334 ./xmlchange DATM_YR_END=2014 ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_CH-Dav_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/CH-Dav/CLM1PT_data/CTSM_DATM_CH-Dav_1997-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=1997" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/CH-Fru/shell_commands b/cime_config/usermods_dirs/PLUMBER2/CH-Fru/shell_commands index 291458c54b..706c335415 100644 --- a/cime_config/usermods_dirs/PLUMBER2/CH-Fru/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/CH-Fru/shell_commands @@ -1,10 +1,10 @@ +./xmlchange PLUMBER2SITE=CH-Fru ./xmlchange PTS_LON=8.53778 ./xmlchange PTS_LAT=47.115833 ./xmlchange DATM_YR_END=2014 ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_CH-Fru_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/CH-Fru/CLM1PT_data/CTSM_DATM_CH-Fru_2007-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2007" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/CH-Oe1/shell_commands b/cime_config/usermods_dirs/PLUMBER2/CH-Oe1/shell_commands index 964e24d852..7dacd7a573 100644 --- a/cime_config/usermods_dirs/PLUMBER2/CH-Oe1/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/CH-Oe1/shell_commands @@ -1,10 +1,10 @@ +./xmlchange PLUMBER2SITE=CH-Oe1 ./xmlchange PTS_LON=7.73194 ./xmlchange PTS_LAT=47.285831 ./xmlchange DATM_YR_END=2008 ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_CH-Oe1_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/CH-Oe1/CLM1PT_data/CTSM_DATM_CH-Oe1_2002-2008.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2002" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2008" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/CN-Cha/shell_commands b/cime_config/usermods_dirs/PLUMBER2/CN-Cha/shell_commands index 8322f1f733..ac02990ed7 100644 --- a/cime_config/usermods_dirs/PLUMBER2/CN-Cha/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/CN-Cha/shell_commands @@ -1,10 +1,10 @@ -./xmlchange PTS_LON=128.09579499999998 +./xmlchange PLUMBER2SITE=CN-Cha +./xmlchange PTS_LON=128.095795 ./xmlchange PTS_LAT=42.4025 ./xmlchange DATM_YR_END=2005 ./xmlchange START_TOD=57600 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_CN-Cha_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/CN-Cha/CLM1PT_data/CTSM_DATM_CN-Cha_2003-2005.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2003" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2005" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/CN-Cng/shell_commands b/cime_config/usermods_dirs/PLUMBER2/CN-Cng/shell_commands index dda99e3c4a..6e2582d175 100644 --- a/cime_config/usermods_dirs/PLUMBER2/CN-Cng/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/CN-Cng/shell_commands @@ -1,10 +1,10 @@ +./xmlchange PLUMBER2SITE=CN-Cng ./xmlchange PTS_LON=123.509201 ./xmlchange PTS_LAT=44.593399 ./xmlchange DATM_YR_END=2009 ./xmlchange START_TOD=57600 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_CN-Cng_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/CN-Cng/CLM1PT_data/CTSM_DATM_CN-Cng_2008-2009.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2008" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2009" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/CN-Dan/shell_commands b/cime_config/usermods_dirs/PLUMBER2/CN-Dan/shell_commands index cdca7d7472..3b9c16a5f4 100644 --- a/cime_config/usermods_dirs/PLUMBER2/CN-Dan/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/CN-Dan/shell_commands @@ -1,10 +1,10 @@ +./xmlchange PLUMBER2SITE=CN-Dan ./xmlchange PTS_LON=91.066399 -./xmlchange PTS_LAT=30.497801000000003 +./xmlchange PTS_LAT=30.497801 ./xmlchange DATM_YR_END=2005 ./xmlchange START_TOD=57600 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_CN-Dan_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/CN-Dan/CLM1PT_data/CTSM_DATM_CN-Dan_2004-2005.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2004" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2005" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/CN-Din/shell_commands b/cime_config/usermods_dirs/PLUMBER2/CN-Din/shell_commands index 19f9baa8eb..f125b585da 100644 --- a/cime_config/usermods_dirs/PLUMBER2/CN-Din/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/CN-Din/shell_commands @@ -1,10 +1,10 @@ +./xmlchange PLUMBER2SITE=CN-Din ./xmlchange PTS_LON=112.536102 ./xmlchange PTS_LAT=23.1733 ./xmlchange DATM_YR_END=2005 ./xmlchange START_TOD=57600 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_CN-Din_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/CN-Din/CLM1PT_data/CTSM_DATM_CN-Din_2003-2005.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2003" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2005" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/CN-Du2/shell_commands b/cime_config/usermods_dirs/PLUMBER2/CN-Du2/shell_commands index 5f83542f35..ca85d11837 100644 --- a/cime_config/usermods_dirs/PLUMBER2/CN-Du2/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/CN-Du2/shell_commands @@ -1,10 +1,10 @@ +./xmlchange PLUMBER2SITE=CN-Du2 ./xmlchange PTS_LON=116.2836 ./xmlchange PTS_LAT=42.0467 ./xmlchange DATM_YR_END=2008 ./xmlchange START_TOD=57600 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_CN-Du2_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/CN-Du2/CLM1PT_data/CTSM_DATM_CN-Du2_2007-2008.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2007" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2008" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/CN-HaM/shell_commands b/cime_config/usermods_dirs/PLUMBER2/CN-HaM/shell_commands index e7a814451d..8c557f6c07 100644 --- a/cime_config/usermods_dirs/PLUMBER2/CN-HaM/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/CN-HaM/shell_commands @@ -1,10 +1,10 @@ +./xmlchange PLUMBER2SITE=CN-HaM ./xmlchange PTS_LON=101.18 ./xmlchange PTS_LAT=37.369999 ./xmlchange DATM_YR_END=2003 ./xmlchange START_TOD=57600 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_CN-HaM_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/CN-HaM/CLM1PT_data/CTSM_DATM_CN-HaM_2002-2003.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2002" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2003" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/CN-Qia/shell_commands b/cime_config/usermods_dirs/PLUMBER2/CN-Qia/shell_commands index a44ff612b4..c0599132ef 100644 --- a/cime_config/usermods_dirs/PLUMBER2/CN-Qia/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/CN-Qia/shell_commands @@ -1,10 +1,10 @@ +./xmlchange PLUMBER2SITE=CN-Qia ./xmlchange PTS_LON=115.058098 ./xmlchange PTS_LAT=26.7414 ./xmlchange DATM_YR_END=2005 ./xmlchange START_TOD=57600 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_CN-Qia_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/CN-Qia/CLM1PT_data/CTSM_DATM_CN-Qia_2003-2005.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2003" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2005" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/CZ-wet/shell_commands b/cime_config/usermods_dirs/PLUMBER2/CZ-wet/shell_commands index d01359e568..d0ee8f1b57 100644 --- a/cime_config/usermods_dirs/PLUMBER2/CZ-wet/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/CZ-wet/shell_commands @@ -1,10 +1,10 @@ +./xmlchange PLUMBER2SITE=CZ-wet ./xmlchange PTS_LON=14.77035 ./xmlchange PTS_LAT=49.024651 ./xmlchange DATM_YR_END=2014 ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_CZ-wet_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/CZ-wet/CLM1PT_data/CTSM_DATM_CZ-wet_2007-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2007" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/DE-Bay/shell_commands b/cime_config/usermods_dirs/PLUMBER2/DE-Bay/shell_commands index cfde80c1de..2a0bb1ed7e 100644 --- a/cime_config/usermods_dirs/PLUMBER2/DE-Bay/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/DE-Bay/shell_commands @@ -1,10 +1,10 @@ +./xmlchange PLUMBER2SITE=DE-Bay ./xmlchange PTS_LON=11.86694 -./xmlchange PTS_LAT=50.141940999999996 +./xmlchange PTS_LAT=50.141941 ./xmlchange DATM_YR_END=1999 ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_DE-Bay_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/DE-Bay/CLM1PT_data/CTSM_DATM_DE-Bay_1997-1999.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=1997" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=1999" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/DE-Geb/shell_commands b/cime_config/usermods_dirs/PLUMBER2/DE-Geb/shell_commands index 834a2b3f96..9e42e4029f 100644 --- a/cime_config/usermods_dirs/PLUMBER2/DE-Geb/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/DE-Geb/shell_commands @@ -1,10 +1,10 @@ +./xmlchange PLUMBER2SITE=DE-Geb ./xmlchange PTS_LON=10.9143 ./xmlchange PTS_LAT=51.100101 ./xmlchange DATM_YR_END=2014 ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_DE-Geb_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/DE-Geb/CLM1PT_data/CTSM_DATM_DE-Geb_2001-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2001" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/DE-Gri/shell_commands b/cime_config/usermods_dirs/PLUMBER2/DE-Gri/shell_commands index 9fe2f16680..5ae694eca6 100644 --- a/cime_config/usermods_dirs/PLUMBER2/DE-Gri/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/DE-Gri/shell_commands @@ -1,10 +1,10 @@ -./xmlchange PTS_LON=13.512529999999998 +./xmlchange PLUMBER2SITE=DE-Gri +./xmlchange PTS_LON=13.51253 ./xmlchange PTS_LAT=50.949471 ./xmlchange DATM_YR_END=2014 ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_DE-Gri_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/DE-Gri/CLM1PT_data/CTSM_DATM_DE-Gri_2004-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2004" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/DE-Hai/shell_commands b/cime_config/usermods_dirs/PLUMBER2/DE-Hai/shell_commands index 83bb6beb10..cfdacd4388 100644 --- a/cime_config/usermods_dirs/PLUMBER2/DE-Hai/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/DE-Hai/shell_commands @@ -1,10 +1,10 @@ +./xmlchange PLUMBER2SITE=DE-Hai ./xmlchange PTS_LON=10.453 ./xmlchange PTS_LAT=51.079166 ./xmlchange DATM_YR_END=2012 ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_DE-Hai_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/DE-Hai/CLM1PT_data/CTSM_DATM_DE-Hai_2000-2012.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2000" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2012" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/DE-Kli/shell_commands b/cime_config/usermods_dirs/PLUMBER2/DE-Kli/shell_commands index d8a15d9a53..2b4760861f 100644 --- a/cime_config/usermods_dirs/PLUMBER2/DE-Kli/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/DE-Kli/shell_commands @@ -1,10 +1,10 @@ -./xmlchange PTS_LON=13.522379999999998 +./xmlchange PLUMBER2SITE=DE-Kli +./xmlchange PTS_LON=13.52238 ./xmlchange PTS_LAT=50.893059 ./xmlchange DATM_YR_END=2014 ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_DE-Kli_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/DE-Kli/CLM1PT_data/CTSM_DATM_DE-Kli_2005-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2005" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/DE-Meh/shell_commands b/cime_config/usermods_dirs/PLUMBER2/DE-Meh/shell_commands index 9ffbaf9c34..ace23c6499 100644 --- a/cime_config/usermods_dirs/PLUMBER2/DE-Meh/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/DE-Meh/shell_commands @@ -1,10 +1,10 @@ +./xmlchange PLUMBER2SITE=DE-Meh ./xmlchange PTS_LON=10.65547 ./xmlchange PTS_LAT=51.275311 ./xmlchange DATM_YR_END=2006 ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_DE-Meh_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/DE-Meh/CLM1PT_data/CTSM_DATM_DE-Meh_2004-2006.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2004" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2006" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/DE-Obe/shell_commands b/cime_config/usermods_dirs/PLUMBER2/DE-Obe/shell_commands index 94afe08f04..81d983ac51 100644 --- a/cime_config/usermods_dirs/PLUMBER2/DE-Obe/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/DE-Obe/shell_commands @@ -1,10 +1,10 @@ +./xmlchange PLUMBER2SITE=DE-Obe ./xmlchange PTS_LON=13.72129 ./xmlchange PTS_LAT=50.786659 ./xmlchange DATM_YR_END=2014 ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_DE-Obe_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/DE-Obe/CLM1PT_data/CTSM_DATM_DE-Obe_2008-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2008" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/DE-Seh/shell_commands b/cime_config/usermods_dirs/PLUMBER2/DE-Seh/shell_commands index 2daca0a2c1..99b14107c6 100644 --- a/cime_config/usermods_dirs/PLUMBER2/DE-Seh/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/DE-Seh/shell_commands @@ -1,10 +1,10 @@ +./xmlchange PLUMBER2SITE=DE-Seh ./xmlchange PTS_LON=6.44965 ./xmlchange PTS_LAT=50.870625 ./xmlchange DATM_YR_END=2010 ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_DE-Seh_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/DE-Seh/CLM1PT_data/CTSM_DATM_DE-Seh_2008-2010.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2008" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2010" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/DE-SfN/shell_commands b/cime_config/usermods_dirs/PLUMBER2/DE-SfN/shell_commands index 9bdef7293f..70c6009607 100644 --- a/cime_config/usermods_dirs/PLUMBER2/DE-SfN/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/DE-SfN/shell_commands @@ -1,10 +1,10 @@ +./xmlchange PLUMBER2SITE=DE-SfN ./xmlchange PTS_LON=11.3275 ./xmlchange PTS_LAT=47.806389 ./xmlchange DATM_YR_END=2014 ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_DE-SfN_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/DE-SfN/CLM1PT_data/CTSM_DATM_DE-SfN_2013-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2013" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/DE-Tha/shell_commands b/cime_config/usermods_dirs/PLUMBER2/DE-Tha/shell_commands index e77813eec9..33b2870a58 100644 --- a/cime_config/usermods_dirs/PLUMBER2/DE-Tha/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/DE-Tha/shell_commands @@ -1,10 +1,10 @@ -./xmlchange PTS_LON=13.566939999999999 +./xmlchange PLUMBER2SITE=DE-Tha +./xmlchange PTS_LON=13.56694 ./xmlchange PTS_LAT=50.963612 ./xmlchange DATM_YR_END=2014 ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_DE-Tha_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/DE-Tha/CLM1PT_data/CTSM_DATM_DE-Tha_1998-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=1998" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/DE-Wet/shell_commands b/cime_config/usermods_dirs/PLUMBER2/DE-Wet/shell_commands index 7563e5ff7e..947d965270 100644 --- a/cime_config/usermods_dirs/PLUMBER2/DE-Wet/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/DE-Wet/shell_commands @@ -1,10 +1,10 @@ +./xmlchange PLUMBER2SITE=DE-Wet ./xmlchange PTS_LON=11.45753 ./xmlchange PTS_LAT=50.453499 ./xmlchange DATM_YR_END=2006 ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_DE-Wet_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/DE-Wet/CLM1PT_data/CTSM_DATM_DE-Wet_2002-2006.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2002" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2006" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/DK-Fou/shell_commands b/cime_config/usermods_dirs/PLUMBER2/DK-Fou/shell_commands index 06a43e6df6..a34d0eb77a 100644 --- a/cime_config/usermods_dirs/PLUMBER2/DK-Fou/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/DK-Fou/shell_commands @@ -1,10 +1,10 @@ +./xmlchange PLUMBER2SITE=DK-Fou ./xmlchange PTS_LON=9.58722 ./xmlchange PTS_LAT=56.4842 ./xmlchange DATM_YR_END=2005 ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_DK-Fou_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/DK-Fou/CLM1PT_data/CTSM_DATM_DK-Fou_2005-2005.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2005" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2005" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/DK-Lva/shell_commands b/cime_config/usermods_dirs/PLUMBER2/DK-Lva/shell_commands index bda3c08df5..06f512c753 100644 --- a/cime_config/usermods_dirs/PLUMBER2/DK-Lva/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/DK-Lva/shell_commands @@ -1,10 +1,10 @@ +./xmlchange PLUMBER2SITE=DK-Lva ./xmlchange PTS_LON=12.0833 ./xmlchange PTS_LAT=55.6833 ./xmlchange DATM_YR_END=2006 ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_DK-Lva_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/DK-Lva/CLM1PT_data/CTSM_DATM_DK-Lva_2005-2006.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2005" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2006" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/DK-Ris/shell_commands b/cime_config/usermods_dirs/PLUMBER2/DK-Ris/shell_commands index 189e9b0ee7..bb2be42089 100644 --- a/cime_config/usermods_dirs/PLUMBER2/DK-Ris/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/DK-Ris/shell_commands @@ -1,10 +1,10 @@ +./xmlchange PLUMBER2SITE=DK-Ris ./xmlchange PTS_LON=12.09722 ./xmlchange PTS_LAT=55.530281 ./xmlchange DATM_YR_END=2005 ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_DK-Ris_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/DK-Ris/CLM1PT_data/CTSM_DATM_DK-Ris_2004-2005.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2004" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2005" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/DK-Sor/shell_commands b/cime_config/usermods_dirs/PLUMBER2/DK-Sor/shell_commands index 2aa6510cd4..efe8c0ad42 100644 --- a/cime_config/usermods_dirs/PLUMBER2/DK-Sor/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/DK-Sor/shell_commands @@ -1,10 +1,10 @@ -./xmlchange PTS_LON=11.644639999999999 +./xmlchange PLUMBER2SITE=DK-Sor +./xmlchange PTS_LON=11.64464 ./xmlchange PTS_LAT=55.48587 ./xmlchange DATM_YR_END=2014 ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_DK-Sor_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/DK-Sor/CLM1PT_data/CTSM_DATM_DK-Sor_1997-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=1997" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/DK-ZaH/shell_commands b/cime_config/usermods_dirs/PLUMBER2/DK-ZaH/shell_commands index 99a0558d7d..cca198c906 100644 --- a/cime_config/usermods_dirs/PLUMBER2/DK-ZaH/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/DK-ZaH/shell_commands @@ -1,10 +1,10 @@ +./xmlchange PLUMBER2SITE=DK-ZaH ./xmlchange PTS_LON=-20.550293 ./xmlchange PTS_LAT=74.473282 ./xmlchange DATM_YR_END=2013 ./xmlchange START_TOD=0 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_DK-ZaH_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/DK-ZaH/CLM1PT_data/CTSM_DATM_DK-ZaH_2000-2013.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2000" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2013" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/ES-ES1/shell_commands b/cime_config/usermods_dirs/PLUMBER2/ES-ES1/shell_commands index 10d4e4399d..9cc4725f98 100644 --- a/cime_config/usermods_dirs/PLUMBER2/ES-ES1/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/ES-ES1/shell_commands @@ -1,10 +1,10 @@ +./xmlchange PLUMBER2SITE=ES-ES1 ./xmlchange PTS_LON=-0.318817 ./xmlchange PTS_LAT=39.34597 ./xmlchange DATM_YR_END=2006 ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_ES-ES1_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/ES-ES1/CLM1PT_data/CTSM_DATM_ES-ES1_1999-2006.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=1999" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2006" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/ES-ES2/shell_commands b/cime_config/usermods_dirs/PLUMBER2/ES-ES2/shell_commands index b72ddf79db..03a6ccf482 100644 --- a/cime_config/usermods_dirs/PLUMBER2/ES-ES2/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/ES-ES2/shell_commands @@ -1,10 +1,10 @@ +./xmlchange PLUMBER2SITE=ES-ES2 ./xmlchange PTS_LON=-0.315277 -./xmlchange PTS_LAT=39.275558000000004 +./xmlchange PTS_LAT=39.275558 ./xmlchange DATM_YR_END=2006 ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_ES-ES2_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/ES-ES2/CLM1PT_data/CTSM_DATM_ES-ES2_2005-2006.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2005" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2006" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/ES-LMa/shell_commands b/cime_config/usermods_dirs/PLUMBER2/ES-LMa/shell_commands index 6d69cfc70b..f36c6be9fc 100644 --- a/cime_config/usermods_dirs/PLUMBER2/ES-LMa/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/ES-LMa/shell_commands @@ -1,10 +1,10 @@ +./xmlchange PLUMBER2SITE=ES-LMa ./xmlchange PTS_LON=-5.773346 ./xmlchange PTS_LAT=39.941502 ./xmlchange DATM_YR_END=2006 ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_ES-LMa_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/ES-LMa/CLM1PT_data/CTSM_DATM_ES-LMa_2004-2006.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2004" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2006" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/ES-LgS/shell_commands b/cime_config/usermods_dirs/PLUMBER2/ES-LgS/shell_commands index 2efa0f5a04..2a701bb99f 100644 --- a/cime_config/usermods_dirs/PLUMBER2/ES-LgS/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/ES-LgS/shell_commands @@ -1,10 +1,10 @@ +./xmlchange PLUMBER2SITE=ES-LgS ./xmlchange PTS_LON=-2.96582 ./xmlchange PTS_LAT=37.097935 ./xmlchange DATM_YR_END=2007 ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_ES-LgS_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/ES-LgS/CLM1PT_data/CTSM_DATM_ES-LgS_2007-2007.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2007" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2007" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/ES-VDA/shell_commands b/cime_config/usermods_dirs/PLUMBER2/ES-VDA/shell_commands index 83d071a6f8..e7971529d9 100644 --- a/cime_config/usermods_dirs/PLUMBER2/ES-VDA/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/ES-VDA/shell_commands @@ -1,10 +1,10 @@ +./xmlchange PLUMBER2SITE=ES-VDA ./xmlchange PTS_LON=1.4485 ./xmlchange PTS_LAT=42.15218 ./xmlchange DATM_YR_END=2004 ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_ES-VDA_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/ES-VDA/CLM1PT_data/CTSM_DATM_ES-VDA_2004-2004.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2004" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2004" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/FI-Hyy/shell_commands b/cime_config/usermods_dirs/PLUMBER2/FI-Hyy/shell_commands index 68d5a9739f..7ac714599a 100644 --- a/cime_config/usermods_dirs/PLUMBER2/FI-Hyy/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/FI-Hyy/shell_commands @@ -1,10 +1,10 @@ +./xmlchange PLUMBER2SITE=FI-Hyy ./xmlchange PTS_LON=24.295 ./xmlchange PTS_LAT=61.8475 ./xmlchange DATM_YR_END=2014 ./xmlchange START_TOD=79200 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_FI-Hyy_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/FI-Hyy/CLM1PT_data/CTSM_DATM_FI-Hyy_1996-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=1996" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/FI-Kaa/shell_commands b/cime_config/usermods_dirs/PLUMBER2/FI-Kaa/shell_commands index 43852577b1..339a244afa 100644 --- a/cime_config/usermods_dirs/PLUMBER2/FI-Kaa/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/FI-Kaa/shell_commands @@ -1,10 +1,10 @@ -./xmlchange PTS_LON=27.295030999999998 +./xmlchange PLUMBER2SITE=FI-Kaa +./xmlchange PTS_LON=27.295031 ./xmlchange PTS_LAT=69.140694 ./xmlchange DATM_YR_END=2002 ./xmlchange START_TOD=79200 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_FI-Kaa_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/FI-Kaa/CLM1PT_data/CTSM_DATM_FI-Kaa_2000-2002.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2000" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2002" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/FI-Lom/shell_commands b/cime_config/usermods_dirs/PLUMBER2/FI-Lom/shell_commands index c7e01ee357..dea60aca09 100644 --- a/cime_config/usermods_dirs/PLUMBER2/FI-Lom/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/FI-Lom/shell_commands @@ -1,10 +1,10 @@ +./xmlchange PLUMBER2SITE=FI-Lom ./xmlchange PTS_LON=24.209181 ./xmlchange PTS_LAT=67.9972 ./xmlchange DATM_YR_END=2009 ./xmlchange START_TOD=79200 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_FI-Lom_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/FI-Lom/CLM1PT_data/CTSM_DATM_FI-Lom_2007-2009.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2007" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2009" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/FI-Sod/shell_commands b/cime_config/usermods_dirs/PLUMBER2/FI-Sod/shell_commands index ccf011b0e0..08773c8443 100644 --- a/cime_config/usermods_dirs/PLUMBER2/FI-Sod/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/FI-Sod/shell_commands @@ -1,10 +1,10 @@ +./xmlchange PLUMBER2SITE=FI-Sod ./xmlchange PTS_LON=26.637831 ./xmlchange PTS_LAT=67.361862 ./xmlchange DATM_YR_END=2014 ./xmlchange START_TOD=79200 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_FI-Sod_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/FI-Sod/CLM1PT_data/CTSM_DATM_FI-Sod_2008-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2008" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/FR-Fon/shell_commands b/cime_config/usermods_dirs/PLUMBER2/FR-Fon/shell_commands index 4af5380bee..550ce300cd 100644 --- a/cime_config/usermods_dirs/PLUMBER2/FR-Fon/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/FR-Fon/shell_commands @@ -1,10 +1,10 @@ -./xmlchange PTS_LON=2.7801400000000003 -./xmlchange PTS_LAT=48.476397999999996 +./xmlchange PLUMBER2SITE=FR-Fon +./xmlchange PTS_LON=2.78014 +./xmlchange PTS_LAT=48.476398 ./xmlchange DATM_YR_END=2013 ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_FR-Fon_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/FR-Fon/CLM1PT_data/CTSM_DATM_FR-Fon_2005-2013.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2005" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2013" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/FR-Gri/shell_commands b/cime_config/usermods_dirs/PLUMBER2/FR-Gri/shell_commands index dae1f22807..169e85a270 100644 --- a/cime_config/usermods_dirs/PLUMBER2/FR-Gri/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/FR-Gri/shell_commands @@ -1,10 +1,10 @@ -./xmlchange PTS_LON=1.9519099999999998 +./xmlchange PLUMBER2SITE=FR-Gri +./xmlchange PTS_LON=1.95191 ./xmlchange PTS_LAT=48.844219 ./xmlchange DATM_YR_END=2013 ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_FR-Gri_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/FR-Gri/CLM1PT_data/CTSM_DATM_FR-Gri_2005-2013.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2005" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2013" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/FR-Hes/shell_commands b/cime_config/usermods_dirs/PLUMBER2/FR-Hes/shell_commands index 00dd5c6771..18a9e57b29 100644 --- a/cime_config/usermods_dirs/PLUMBER2/FR-Hes/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/FR-Hes/shell_commands @@ -1,10 +1,10 @@ -./xmlchange PTS_LON=7.0655600000000005 +./xmlchange PLUMBER2SITE=FR-Hes +./xmlchange PTS_LON=7.06556 ./xmlchange PTS_LAT=48.67416 ./xmlchange DATM_YR_END=2006 ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_FR-Hes_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/FR-Hes/CLM1PT_data/CTSM_DATM_FR-Hes_1997-2006.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=1997" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2006" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/FR-LBr/shell_commands b/cime_config/usermods_dirs/PLUMBER2/FR-LBr/shell_commands index 21f28c8839..ee89868fa1 100644 --- a/cime_config/usermods_dirs/PLUMBER2/FR-LBr/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/FR-LBr/shell_commands @@ -1,10 +1,10 @@ -./xmlchange PTS_LON=-0.7692869999999999 +./xmlchange PLUMBER2SITE=FR-LBr +./xmlchange PTS_LON=-0.769287 ./xmlchange PTS_LAT=44.71711 ./xmlchange DATM_YR_END=2008 ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_FR-LBr_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/FR-LBr/CLM1PT_data/CTSM_DATM_FR-LBr_2003-2008.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2003" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2008" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/FR-Lq1/shell_commands b/cime_config/usermods_dirs/PLUMBER2/FR-Lq1/shell_commands index 4b8ae400d7..c5025aba8b 100644 --- a/cime_config/usermods_dirs/PLUMBER2/FR-Lq1/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/FR-Lq1/shell_commands @@ -1,10 +1,10 @@ +./xmlchange PLUMBER2SITE=FR-Lq1 ./xmlchange PTS_LON=2.73583 ./xmlchange PTS_LAT=45.643059 ./xmlchange DATM_YR_END=2006 ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_FR-Lq1_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/FR-Lq1/CLM1PT_data/CTSM_DATM_FR-Lq1_2004-2006.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2004" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2006" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/FR-Lq2/shell_commands b/cime_config/usermods_dirs/PLUMBER2/FR-Lq2/shell_commands index 3e56a08786..26581437b9 100644 --- a/cime_config/usermods_dirs/PLUMBER2/FR-Lq2/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/FR-Lq2/shell_commands @@ -1,10 +1,10 @@ +./xmlchange PLUMBER2SITE=FR-Lq2 ./xmlchange PTS_LON=2.73703 ./xmlchange PTS_LAT=45.639191 ./xmlchange DATM_YR_END=2006 ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_FR-Lq2_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/FR-Lq2/CLM1PT_data/CTSM_DATM_FR-Lq2_2004-2006.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2004" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2006" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/FR-Pue/shell_commands b/cime_config/usermods_dirs/PLUMBER2/FR-Pue/shell_commands index 4e4ddac3d5..13fab2f770 100644 --- a/cime_config/usermods_dirs/PLUMBER2/FR-Pue/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/FR-Pue/shell_commands @@ -1,10 +1,10 @@ -./xmlchange PTS_LON=3.5958300000000003 +./xmlchange PLUMBER2SITE=FR-Pue +./xmlchange PTS_LON=3.59583 ./xmlchange PTS_LAT=43.74139 ./xmlchange DATM_YR_END=2014 ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_FR-Pue_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/FR-Pue/CLM1PT_data/CTSM_DATM_FR-Pue_2000-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2000" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/GF-Guy/shell_commands b/cime_config/usermods_dirs/PLUMBER2/GF-Guy/shell_commands index 6a2a814f69..bafc0737b8 100644 --- a/cime_config/usermods_dirs/PLUMBER2/GF-Guy/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/GF-Guy/shell_commands @@ -1,10 +1,10 @@ +./xmlchange PLUMBER2SITE=GF-Guy ./xmlchange PTS_LON=-52.924866 ./xmlchange PTS_LAT=5.278772 ./xmlchange DATM_YR_END=2014 ./xmlchange START_TOD=10800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_GF-Guy_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/GF-Guy/CLM1PT_data/CTSM_DATM_GF-Guy_2004-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2004" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/HU-Bug/shell_commands b/cime_config/usermods_dirs/PLUMBER2/HU-Bug/shell_commands index 739810dd52..98e5672dc2 100644 --- a/cime_config/usermods_dirs/PLUMBER2/HU-Bug/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/HU-Bug/shell_commands @@ -1,10 +1,10 @@ -./xmlchange PTS_LON=19.601298999999997 +./xmlchange PLUMBER2SITE=HU-Bug +./xmlchange PTS_LON=19.601299 ./xmlchange PTS_LAT=46.691101 ./xmlchange DATM_YR_END=2006 ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_HU-Bug_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/HU-Bug/CLM1PT_data/CTSM_DATM_HU-Bug_2003-2006.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2003" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2006" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/ID-Pag/shell_commands b/cime_config/usermods_dirs/PLUMBER2/ID-Pag/shell_commands index e5e190ad1e..a71ecdf659 100644 --- a/cime_config/usermods_dirs/PLUMBER2/ID-Pag/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/ID-Pag/shell_commands @@ -1,10 +1,10 @@ -./xmlchange PTS_LON=114.03639199999999 +./xmlchange PLUMBER2SITE=ID-Pag +./xmlchange PTS_LON=114.036392 ./xmlchange PTS_LAT=-2.345 ./xmlchange DATM_YR_END=2003 ./xmlchange START_TOD=61200 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_ID-Pag_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/ID-Pag/CLM1PT_data/CTSM_DATM_ID-Pag_2002-2003.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2002" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2003" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/IE-Ca1/shell_commands b/cime_config/usermods_dirs/PLUMBER2/IE-Ca1/shell_commands index e9caca8f04..98d668df9e 100644 --- a/cime_config/usermods_dirs/PLUMBER2/IE-Ca1/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/IE-Ca1/shell_commands @@ -1,10 +1,10 @@ +./xmlchange PLUMBER2SITE=IE-Ca1 ./xmlchange PTS_LON=-6.918152 -./xmlchange PTS_LAT=52.858791000000004 +./xmlchange PTS_LAT=52.858791 ./xmlchange DATM_YR_END=2006 ./xmlchange START_TOD=0 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_IE-Ca1_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/IE-Ca1/CLM1PT_data/CTSM_DATM_IE-Ca1_2004-2006.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2004" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2006" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/IE-Dri/shell_commands b/cime_config/usermods_dirs/PLUMBER2/IE-Dri/shell_commands index bdd48c2331..edb036e775 100644 --- a/cime_config/usermods_dirs/PLUMBER2/IE-Dri/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/IE-Dri/shell_commands @@ -1,10 +1,10 @@ -./xmlchange PTS_LON=-8.751800999999999 +./xmlchange PLUMBER2SITE=IE-Dri +./xmlchange PTS_LON=-8.751801 ./xmlchange PTS_LAT=51.986691 ./xmlchange DATM_YR_END=2005 ./xmlchange START_TOD=0 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_IE-Dri_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/IE-Dri/CLM1PT_data/CTSM_DATM_IE-Dri_2003-2005.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2003" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2005" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/IT-Amp/shell_commands b/cime_config/usermods_dirs/PLUMBER2/IT-Amp/shell_commands index 290836ff22..3a4195c030 100644 --- a/cime_config/usermods_dirs/PLUMBER2/IT-Amp/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/IT-Amp/shell_commands @@ -1,10 +1,10 @@ +./xmlchange PLUMBER2SITE=IT-Amp ./xmlchange PTS_LON=13.60516 ./xmlchange PTS_LAT=41.904099 ./xmlchange DATM_YR_END=2006 ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_IT-Amp_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/IT-Amp/CLM1PT_data/CTSM_DATM_IT-Amp_2003-2006.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2003" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2006" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/IT-BCi/shell_commands b/cime_config/usermods_dirs/PLUMBER2/IT-BCi/shell_commands index ae21e12b51..ada711ab6e 100644 --- a/cime_config/usermods_dirs/PLUMBER2/IT-BCi/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/IT-BCi/shell_commands @@ -1,10 +1,10 @@ +./xmlchange PLUMBER2SITE=IT-BCi ./xmlchange PTS_LON=14.95744 ./xmlchange PTS_LAT=40.5238 ./xmlchange DATM_YR_END=2010 ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_IT-BCi_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/IT-BCi/CLM1PT_data/CTSM_DATM_IT-BCi_2005-2010.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2005" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2010" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/IT-CA1/shell_commands b/cime_config/usermods_dirs/PLUMBER2/IT-CA1/shell_commands index 3fbb828981..9ff3031f4d 100644 --- a/cime_config/usermods_dirs/PLUMBER2/IT-CA1/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/IT-CA1/shell_commands @@ -1,10 +1,10 @@ +./xmlchange PLUMBER2SITE=IT-CA1 ./xmlchange PTS_LON=12.02656 ./xmlchange PTS_LAT=42.380409 ./xmlchange DATM_YR_END=2013 ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_IT-CA1_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/IT-CA1/CLM1PT_data/CTSM_DATM_IT-CA1_2012-2013.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2012" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2013" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/IT-CA2/shell_commands b/cime_config/usermods_dirs/PLUMBER2/IT-CA2/shell_commands index 18be6fbd02..2041d6983d 100644 --- a/cime_config/usermods_dirs/PLUMBER2/IT-CA2/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/IT-CA2/shell_commands @@ -1,10 +1,10 @@ +./xmlchange PLUMBER2SITE=IT-CA2 ./xmlchange PTS_LON=12.02604 ./xmlchange PTS_LAT=42.37722 ./xmlchange DATM_YR_END=2013 ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_IT-CA2_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/IT-CA2/CLM1PT_data/CTSM_DATM_IT-CA2_2012-2013.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2012" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2013" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/IT-CA3/shell_commands b/cime_config/usermods_dirs/PLUMBER2/IT-CA3/shell_commands index 46bff2a9e3..50253ccc6b 100644 --- a/cime_config/usermods_dirs/PLUMBER2/IT-CA3/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/IT-CA3/shell_commands @@ -1,10 +1,10 @@ +./xmlchange PLUMBER2SITE=IT-CA3 ./xmlchange PTS_LON=12.0222 ./xmlchange PTS_LAT=42.380001 ./xmlchange DATM_YR_END=2013 ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_IT-CA3_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/IT-CA3/CLM1PT_data/CTSM_DATM_IT-CA3_2012-2013.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2012" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2013" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/IT-Col/shell_commands b/cime_config/usermods_dirs/PLUMBER2/IT-Col/shell_commands index a62cad7d87..06e653c0b9 100644 --- a/cime_config/usermods_dirs/PLUMBER2/IT-Col/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/IT-Col/shell_commands @@ -1,10 +1,10 @@ +./xmlchange PLUMBER2SITE=IT-Col ./xmlchange PTS_LON=13.58814 ./xmlchange PTS_LAT=41.849361 ./xmlchange DATM_YR_END=2014 ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_IT-Col_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/IT-Col/CLM1PT_data/CTSM_DATM_IT-Col_2007-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2007" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/IT-Cpz/shell_commands b/cime_config/usermods_dirs/PLUMBER2/IT-Cpz/shell_commands index 6063242085..b7b1ae449d 100644 --- a/cime_config/usermods_dirs/PLUMBER2/IT-Cpz/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/IT-Cpz/shell_commands @@ -1,10 +1,10 @@ +./xmlchange PLUMBER2SITE=IT-Cpz ./xmlchange PTS_LON=12.37611 ./xmlchange PTS_LAT=41.70525 ./xmlchange DATM_YR_END=2008 ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_IT-Cpz_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/IT-Cpz/CLM1PT_data/CTSM_DATM_IT-Cpz_2001-2008.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2001" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2008" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/IT-Isp/shell_commands b/cime_config/usermods_dirs/PLUMBER2/IT-Isp/shell_commands index 0ae339dba1..873293a7aa 100644 --- a/cime_config/usermods_dirs/PLUMBER2/IT-Isp/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/IT-Isp/shell_commands @@ -1,10 +1,10 @@ +./xmlchange PLUMBER2SITE=IT-Isp ./xmlchange PTS_LON=8.63358 ./xmlchange PTS_LAT=45.812641 ./xmlchange DATM_YR_END=2014 ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_IT-Isp_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/IT-Isp/CLM1PT_data/CTSM_DATM_IT-Isp_2013-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2013" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/IT-LMa/shell_commands b/cime_config/usermods_dirs/PLUMBER2/IT-LMa/shell_commands index 9f683c2101..b8efb6955e 100644 --- a/cime_config/usermods_dirs/PLUMBER2/IT-LMa/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/IT-LMa/shell_commands @@ -1,10 +1,10 @@ +./xmlchange PLUMBER2SITE=IT-LMa ./xmlchange PTS_LON=7.58259 ./xmlchange PTS_LAT=45.15258 ./xmlchange DATM_YR_END=2004 ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_IT-LMa_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/IT-LMa/CLM1PT_data/CTSM_DATM_IT-LMa_2003-2004.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2003" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2004" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/IT-Lav/shell_commands b/cime_config/usermods_dirs/PLUMBER2/IT-Lav/shell_commands index d1a8669b3e..a50e9dc664 100644 --- a/cime_config/usermods_dirs/PLUMBER2/IT-Lav/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/IT-Lav/shell_commands @@ -1,10 +1,10 @@ +./xmlchange PLUMBER2SITE=IT-Lav ./xmlchange PTS_LON=11.28132 ./xmlchange PTS_LAT=45.9562 ./xmlchange DATM_YR_END=2014 ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_IT-Lav_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/IT-Lav/CLM1PT_data/CTSM_DATM_IT-Lav_2005-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2005" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/IT-MBo/shell_commands b/cime_config/usermods_dirs/PLUMBER2/IT-MBo/shell_commands index 6b2e4b2651..0c60de60ba 100644 --- a/cime_config/usermods_dirs/PLUMBER2/IT-MBo/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/IT-MBo/shell_commands @@ -1,10 +1,10 @@ +./xmlchange PLUMBER2SITE=IT-MBo ./xmlchange PTS_LON=11.04583 ./xmlchange PTS_LAT=46.014679 ./xmlchange DATM_YR_END=2012 ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_IT-MBo_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/IT-MBo/CLM1PT_data/CTSM_DATM_IT-MBo_2003-2012.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2003" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2012" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/IT-Mal/shell_commands b/cime_config/usermods_dirs/PLUMBER2/IT-Mal/shell_commands index e6f9ad1c51..34c3d12aa2 100644 --- a/cime_config/usermods_dirs/PLUMBER2/IT-Mal/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/IT-Mal/shell_commands @@ -1,10 +1,10 @@ -./xmlchange PTS_LON=11.703339999999999 +./xmlchange PLUMBER2SITE=IT-Mal +./xmlchange PTS_LON=11.70334 ./xmlchange PTS_LAT=46.114021 ./xmlchange DATM_YR_END=2003 ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_IT-Mal_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/IT-Mal/CLM1PT_data/CTSM_DATM_IT-Mal_2003-2003.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2003" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2003" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/IT-Noe/shell_commands b/cime_config/usermods_dirs/PLUMBER2/IT-Noe/shell_commands index eacfbce81e..bd8d0e486c 100644 --- a/cime_config/usermods_dirs/PLUMBER2/IT-Noe/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/IT-Noe/shell_commands @@ -1,10 +1,10 @@ +./xmlchange PLUMBER2SITE=IT-Noe ./xmlchange PTS_LON=8.15117 ./xmlchange PTS_LAT=40.606178 ./xmlchange DATM_YR_END=2014 ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_IT-Noe_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/IT-Noe/CLM1PT_data/CTSM_DATM_IT-Noe_2004-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2004" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/IT-Non/shell_commands b/cime_config/usermods_dirs/PLUMBER2/IT-Non/shell_commands index 543dc97221..3084a49d8a 100644 --- a/cime_config/usermods_dirs/PLUMBER2/IT-Non/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/IT-Non/shell_commands @@ -1,10 +1,10 @@ +./xmlchange PLUMBER2SITE=IT-Non ./xmlchange PTS_LON=11.09109 -./xmlchange PTS_LAT=44.690189000000004 +./xmlchange PTS_LAT=44.690189 ./xmlchange DATM_YR_END=2002 ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_IT-Non_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/IT-Non/CLM1PT_data/CTSM_DATM_IT-Non_2002-2002.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2002" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2002" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/IT-PT1/shell_commands b/cime_config/usermods_dirs/PLUMBER2/IT-PT1/shell_commands index 23afcb9469..f82e0b8eb9 100644 --- a/cime_config/usermods_dirs/PLUMBER2/IT-PT1/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/IT-PT1/shell_commands @@ -1,10 +1,10 @@ +./xmlchange PLUMBER2SITE=IT-PT1 ./xmlchange PTS_LON=9.06104 ./xmlchange PTS_LAT=45.200871 ./xmlchange DATM_YR_END=2004 ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_IT-PT1_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/IT-PT1/CLM1PT_data/CTSM_DATM_IT-PT1_2003-2004.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2003" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2004" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/IT-Ren/shell_commands b/cime_config/usermods_dirs/PLUMBER2/IT-Ren/shell_commands index 5b6afef969..80927456e8 100644 --- a/cime_config/usermods_dirs/PLUMBER2/IT-Ren/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/IT-Ren/shell_commands @@ -1,10 +1,10 @@ -./xmlchange PTS_LON=11.433689999999999 +./xmlchange PLUMBER2SITE=IT-Ren +./xmlchange PTS_LON=11.43369 ./xmlchange PTS_LAT=46.586861 ./xmlchange DATM_YR_END=2013 ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_IT-Ren_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/IT-Ren/CLM1PT_data/CTSM_DATM_IT-Ren_2010-2013.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2010" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2013" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/IT-Ro1/shell_commands b/cime_config/usermods_dirs/PLUMBER2/IT-Ro1/shell_commands index f74dd07bab..209a0c032d 100644 --- a/cime_config/usermods_dirs/PLUMBER2/IT-Ro1/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/IT-Ro1/shell_commands @@ -1,10 +1,10 @@ -./xmlchange PTS_LON=11.930010000000001 +./xmlchange PLUMBER2SITE=IT-Ro1 +./xmlchange PTS_LON=11.93001 ./xmlchange PTS_LAT=42.408119 ./xmlchange DATM_YR_END=2006 ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_IT-Ro1_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/IT-Ro1/CLM1PT_data/CTSM_DATM_IT-Ro1_2002-2006.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2002" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2006" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/IT-Ro2/shell_commands b/cime_config/usermods_dirs/PLUMBER2/IT-Ro2/shell_commands index 5d3a64aefb..55e5f4f128 100644 --- a/cime_config/usermods_dirs/PLUMBER2/IT-Ro2/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/IT-Ro2/shell_commands @@ -1,10 +1,10 @@ +./xmlchange PLUMBER2SITE=IT-Ro2 ./xmlchange PTS_LON=11.92093 ./xmlchange PTS_LAT=42.390259 ./xmlchange DATM_YR_END=2008 ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_IT-Ro2_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/IT-Ro2/CLM1PT_data/CTSM_DATM_IT-Ro2_2002-2008.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2002" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2008" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/IT-SR2/shell_commands b/cime_config/usermods_dirs/PLUMBER2/IT-SR2/shell_commands index 4cce0bb915..bd1211a9c7 100644 --- a/cime_config/usermods_dirs/PLUMBER2/IT-SR2/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/IT-SR2/shell_commands @@ -1,10 +1,10 @@ +./xmlchange PLUMBER2SITE=IT-SR2 ./xmlchange PTS_LON=10.29095 ./xmlchange PTS_LAT=43.732029 ./xmlchange DATM_YR_END=2014 ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_IT-SR2_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/IT-SR2/CLM1PT_data/CTSM_DATM_IT-SR2_2013-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2013" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/IT-SRo/shell_commands b/cime_config/usermods_dirs/PLUMBER2/IT-SRo/shell_commands index 2f89c5830f..a0aa3f3aa5 100644 --- a/cime_config/usermods_dirs/PLUMBER2/IT-SRo/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/IT-SRo/shell_commands @@ -1,10 +1,10 @@ +./xmlchange PLUMBER2SITE=IT-SRo ./xmlchange PTS_LON=10.28444 ./xmlchange PTS_LAT=43.727859 ./xmlchange DATM_YR_END=2012 ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_IT-SRo_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/IT-SRo/CLM1PT_data/CTSM_DATM_IT-SRo_2003-2012.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2003" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2012" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/JP-SMF/shell_commands b/cime_config/usermods_dirs/PLUMBER2/JP-SMF/shell_commands index 287a41b541..17be0e9534 100644 --- a/cime_config/usermods_dirs/PLUMBER2/JP-SMF/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/JP-SMF/shell_commands @@ -1,10 +1,10 @@ -./xmlchange PTS_LON=137.07879599999998 +./xmlchange PLUMBER2SITE=JP-SMF +./xmlchange PTS_LON=137.078796 ./xmlchange PTS_LAT=35.2617 ./xmlchange DATM_YR_END=2006 ./xmlchange START_TOD=54000 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_JP-SMF_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/JP-SMF/CLM1PT_data/CTSM_DATM_JP-SMF_2003-2006.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2003" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2006" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/NL-Ca1/shell_commands b/cime_config/usermods_dirs/PLUMBER2/NL-Ca1/shell_commands index 7f88121b9b..fd82f6a049 100644 --- a/cime_config/usermods_dirs/PLUMBER2/NL-Ca1/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/NL-Ca1/shell_commands @@ -1,10 +1,10 @@ +./xmlchange PLUMBER2SITE=NL-Ca1 ./xmlchange PTS_LON=4.927 ./xmlchange PTS_LAT=51.971001 ./xmlchange DATM_YR_END=2006 ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_NL-Ca1_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/NL-Ca1/CLM1PT_data/CTSM_DATM_NL-Ca1_2003-2006.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2003" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2006" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/NL-Hor/shell_commands b/cime_config/usermods_dirs/PLUMBER2/NL-Hor/shell_commands index 6134ec5fd6..e4712093fa 100644 --- a/cime_config/usermods_dirs/PLUMBER2/NL-Hor/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/NL-Hor/shell_commands @@ -1,10 +1,10 @@ +./xmlchange PLUMBER2SITE=NL-Hor ./xmlchange PTS_LON=5.0713 ./xmlchange PTS_LAT=52.240349 ./xmlchange DATM_YR_END=2011 ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_NL-Hor_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/NL-Hor/CLM1PT_data/CTSM_DATM_NL-Hor_2008-2011.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2008" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2011" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/NL-Loo/shell_commands b/cime_config/usermods_dirs/PLUMBER2/NL-Loo/shell_commands index 82a7f2458c..d825ace2ba 100644 --- a/cime_config/usermods_dirs/PLUMBER2/NL-Loo/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/NL-Loo/shell_commands @@ -1,10 +1,10 @@ -./xmlchange PTS_LON=5.7435599999999996 -./xmlchange PTS_LAT=52.166579999999996 +./xmlchange PLUMBER2SITE=NL-Loo +./xmlchange PTS_LON=5.74356 +./xmlchange PTS_LAT=52.16658 ./xmlchange DATM_YR_END=2013 ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_NL-Loo_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/NL-Loo/CLM1PT_data/CTSM_DATM_NL-Loo_1997-2013.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=1997" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2013" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/PL-wet/shell_commands b/cime_config/usermods_dirs/PLUMBER2/PL-wet/shell_commands index 394e350a18..80bb1b37c5 100644 --- a/cime_config/usermods_dirs/PLUMBER2/PL-wet/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/PL-wet/shell_commands @@ -1,10 +1,10 @@ +./xmlchange PLUMBER2SITE=PL-wet ./xmlchange PTS_LON=16.309401 ./xmlchange PTS_LAT=52.762199 ./xmlchange DATM_YR_END=2005 ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_PL-wet_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/PL-wet/CLM1PT_data/CTSM_DATM_PL-wet_2004-2005.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2004" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2005" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/PT-Esp/shell_commands b/cime_config/usermods_dirs/PLUMBER2/PT-Esp/shell_commands index 1552bd40e8..b56b6968f1 100644 --- a/cime_config/usermods_dirs/PLUMBER2/PT-Esp/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/PT-Esp/shell_commands @@ -1,10 +1,10 @@ +./xmlchange PLUMBER2SITE=PT-Esp ./xmlchange PTS_LON=-8.601807 ./xmlchange PTS_LAT=38.6394 ./xmlchange DATM_YR_END=2004 ./xmlchange START_TOD=0 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_PT-Esp_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/PT-Esp/CLM1PT_data/CTSM_DATM_PT-Esp_2002-2004.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2002" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2004" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/PT-Mi1/shell_commands b/cime_config/usermods_dirs/PLUMBER2/PT-Mi1/shell_commands index b8cf3bc26d..2d35f26a06 100644 --- a/cime_config/usermods_dirs/PLUMBER2/PT-Mi1/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/PT-Mi1/shell_commands @@ -1,10 +1,10 @@ +./xmlchange PLUMBER2SITE=PT-Mi1 ./xmlchange PTS_LON=-8.000061 ./xmlchange PTS_LAT=38.540642 ./xmlchange DATM_YR_END=2005 ./xmlchange START_TOD=0 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_PT-Mi1_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/PT-Mi1/CLM1PT_data/CTSM_DATM_PT-Mi1_2005-2005.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2005" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2005" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/PT-Mi2/shell_commands b/cime_config/usermods_dirs/PLUMBER2/PT-Mi2/shell_commands index 404492a444..b02616ee02 100644 --- a/cime_config/usermods_dirs/PLUMBER2/PT-Mi2/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/PT-Mi2/shell_commands @@ -1,10 +1,10 @@ +./xmlchange PLUMBER2SITE=PT-Mi2 ./xmlchange PTS_LON=-8.024536 ./xmlchange PTS_LAT=38.476501 ./xmlchange DATM_YR_END=2006 ./xmlchange START_TOD=0 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_PT-Mi2_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/PT-Mi2/CLM1PT_data/CTSM_DATM_PT-Mi2_2005-2006.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2005" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2006" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/RU-Che/shell_commands b/cime_config/usermods_dirs/PLUMBER2/RU-Che/shell_commands index 6d92902d1f..dff0478e08 100644 --- a/cime_config/usermods_dirs/PLUMBER2/RU-Che/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/RU-Che/shell_commands @@ -1,10 +1,10 @@ +./xmlchange PLUMBER2SITE=RU-Che ./xmlchange PTS_LON=161.341431 ./xmlchange PTS_LAT=68.613037 ./xmlchange DATM_YR_END=2004 ./xmlchange START_TOD=46800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_RU-Che_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/RU-Che/CLM1PT_data/CTSM_DATM_RU-Che_2003-2004.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2003" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2004" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/RU-Fyo/shell_commands b/cime_config/usermods_dirs/PLUMBER2/RU-Fyo/shell_commands index ca0223e1cf..d90a4af0bc 100644 --- a/cime_config/usermods_dirs/PLUMBER2/RU-Fyo/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/RU-Fyo/shell_commands @@ -1,10 +1,10 @@ +./xmlchange PLUMBER2SITE=RU-Fyo ./xmlchange PTS_LON=32.922081 -./xmlchange PTS_LAT=56.461529000000006 +./xmlchange PTS_LAT=56.461529 ./xmlchange DATM_YR_END=2014 ./xmlchange START_TOD=75600 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_RU-Fyo_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/RU-Fyo/CLM1PT_data/CTSM_DATM_RU-Fyo_2003-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2003" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/RU-Zot/shell_commands b/cime_config/usermods_dirs/PLUMBER2/RU-Zot/shell_commands index 60778a180c..1d42ea947f 100644 --- a/cime_config/usermods_dirs/PLUMBER2/RU-Zot/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/RU-Zot/shell_commands @@ -1,10 +1,10 @@ +./xmlchange PLUMBER2SITE=RU-Zot ./xmlchange PTS_LON=89.3508 ./xmlchange PTS_LAT=60.8008 ./xmlchange DATM_YR_END=2003 ./xmlchange START_TOD=61200 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_RU-Zot_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/RU-Zot/CLM1PT_data/CTSM_DATM_RU-Zot_2003-2003.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2003" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2003" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/SD-Dem/shell_commands b/cime_config/usermods_dirs/PLUMBER2/SD-Dem/shell_commands index 985c3a010b..2b471ebc27 100644 --- a/cime_config/usermods_dirs/PLUMBER2/SD-Dem/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/SD-Dem/shell_commands @@ -1,10 +1,10 @@ +./xmlchange PLUMBER2SITE=SD-Dem ./xmlchange PTS_LON=30.4783 ./xmlchange PTS_LAT=13.2829 ./xmlchange DATM_YR_END=2009 ./xmlchange START_TOD=75600 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_SD-Dem_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/SD-Dem/CLM1PT_data/CTSM_DATM_SD-Dem_2005-2009.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2005" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2009" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/SE-Deg/shell_commands b/cime_config/usermods_dirs/PLUMBER2/SE-Deg/shell_commands index 1c0165e925..34a53f5533 100644 --- a/cime_config/usermods_dirs/PLUMBER2/SE-Deg/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/SE-Deg/shell_commands @@ -1,10 +1,10 @@ +./xmlchange PLUMBER2SITE=SE-Deg ./xmlchange PTS_LON=19.55669 ./xmlchange PTS_LAT=64.181969 ./xmlchange DATM_YR_END=2005 ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_SE-Deg_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/SE-Deg/CLM1PT_data/CTSM_DATM_SE-Deg_2002-2005.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2002" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2005" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/UK-Gri/shell_commands b/cime_config/usermods_dirs/PLUMBER2/UK-Gri/shell_commands index a29eeb03dc..6cd7cb38f4 100644 --- a/cime_config/usermods_dirs/PLUMBER2/UK-Gri/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/UK-Gri/shell_commands @@ -1,10 +1,10 @@ -./xmlchange PTS_LON=-3.7980650000000002 +./xmlchange PLUMBER2SITE=UK-Gri +./xmlchange PTS_LON=-3.798065 ./xmlchange PTS_LAT=56.60722 ./xmlchange DATM_YR_END=2001 ./xmlchange START_TOD=0 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_UK-Gri_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/UK-Gri/CLM1PT_data/CTSM_DATM_UK-Gri_2000-2001.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2000" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2001" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/UK-Ham/shell_commands b/cime_config/usermods_dirs/PLUMBER2/UK-Ham/shell_commands index 178ff627b9..6d83e07c57 100644 --- a/cime_config/usermods_dirs/PLUMBER2/UK-Ham/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/UK-Ham/shell_commands @@ -1,10 +1,10 @@ -./xmlchange PTS_LON=-0.8583069999999999 -./xmlchange PTS_LAT=51.153529999999996 +./xmlchange PLUMBER2SITE=UK-Ham +./xmlchange PTS_LON=-0.858307 +./xmlchange PTS_LAT=51.15353 ./xmlchange DATM_YR_END=2004 ./xmlchange START_TOD=0 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_UK-Ham_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/UK-Ham/CLM1PT_data/CTSM_DATM_UK-Ham_2004-2004.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2004" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2004" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/UK-PL3/shell_commands b/cime_config/usermods_dirs/PLUMBER2/UK-PL3/shell_commands index d0f256f358..4237f25d27 100644 --- a/cime_config/usermods_dirs/PLUMBER2/UK-PL3/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/UK-PL3/shell_commands @@ -1,10 +1,10 @@ -./xmlchange PTS_LON=-1.2666629999999999 +./xmlchange PLUMBER2SITE=UK-PL3 +./xmlchange PTS_LON=-1.266663 ./xmlchange PTS_LAT=51.450001 ./xmlchange DATM_YR_END=2006 ./xmlchange START_TOD=0 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_UK-PL3_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/UK-PL3/CLM1PT_data/CTSM_DATM_UK-PL3_2005-2006.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2005" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2006" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-AR1/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-AR1/shell_commands index 0bf6cf3313..1f32b6d98c 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-AR1/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-AR1/shell_commands @@ -1,10 +1,10 @@ +./xmlchange PLUMBER2SITE=US-AR1 ./xmlchange PTS_LON=-99.419983 ./xmlchange PTS_LAT=36.426701 ./xmlchange DATM_YR_END=2012 ./xmlchange START_TOD=21600 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_US-AR1_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-AR1/CLM1PT_data/CTSM_DATM_US-AR1_2010-2012.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2010" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2012" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-AR2/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-AR2/shell_commands index 9751d08038..7e436a547c 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-AR2/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-AR2/shell_commands @@ -1,10 +1,10 @@ +./xmlchange PLUMBER2SITE=US-AR2 ./xmlchange PTS_LON=-99.597504 ./xmlchange PTS_LAT=36.635799 ./xmlchange DATM_YR_END=2011 ./xmlchange START_TOD=21600 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_US-AR2_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-AR2/CLM1PT_data/CTSM_DATM_US-AR2_2010-2011.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2010" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2011" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-ARM/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-ARM/shell_commands index 3e4a6933bc..1a0fd06c8b 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-ARM/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-ARM/shell_commands @@ -1,10 +1,10 @@ +./xmlchange PLUMBER2SITE=US-ARM ./xmlchange PTS_LON=-97.4888 ./xmlchange PTS_LAT=36.605801 ./xmlchange DATM_YR_END=2012 ./xmlchange START_TOD=21600 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_US-ARM_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-ARM/CLM1PT_data/CTSM_DATM_US-ARM_2003-2012.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2003" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2012" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-Aud/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-Aud/shell_commands index 1c193249b3..9ab42347b2 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-Aud/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-Aud/shell_commands @@ -1,10 +1,10 @@ +./xmlchange PLUMBER2SITE=US-Aud ./xmlchange PTS_LON=-110.509201 ./xmlchange PTS_LAT=31.5907 ./xmlchange DATM_YR_END=2005 ./xmlchange START_TOD=25200 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_US-Aud_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-Aud/CLM1PT_data/CTSM_DATM_US-Aud_2003-2005.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2003" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2005" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-Bar/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-Bar/shell_commands index b681aac49d..81591a2454 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-Bar/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-Bar/shell_commands @@ -1,10 +1,10 @@ -./xmlchange PTS_LON=-71.28808599999999 -./xmlchange PTS_LAT=44.064640000000004 +./xmlchange PLUMBER2SITE=US-Bar +./xmlchange PTS_LON=-71.288086 +./xmlchange PTS_LAT=44.06464 ./xmlchange DATM_YR_END=2005 ./xmlchange START_TOD=18000 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_US-Bar_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-Bar/CLM1PT_data/CTSM_DATM_US-Bar_2005-2005.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2005" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2005" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-Bkg/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-Bkg/shell_commands index a81ec9e93f..91e1976a9f 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-Bkg/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-Bkg/shell_commands @@ -1,10 +1,10 @@ +./xmlchange PLUMBER2SITE=US-Bkg ./xmlchange PTS_LON=-96.836182 -./xmlchange PTS_LAT=44.345290999999996 +./xmlchange PTS_LAT=44.345291 ./xmlchange DATM_YR_END=2006 ./xmlchange START_TOD=21600 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_US-Bkg_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-Bkg/CLM1PT_data/CTSM_DATM_US-Bkg_2005-2006.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2005" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2006" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-Blo/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-Blo/shell_commands index 0d914e4416..5c09021706 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-Blo/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-Blo/shell_commands @@ -1,10 +1,10 @@ +./xmlchange PLUMBER2SITE=US-Blo ./xmlchange PTS_LON=-120.632751 ./xmlchange PTS_LAT=38.895302 ./xmlchange DATM_YR_END=2006 ./xmlchange START_TOD=28800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_US-Blo_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-Blo/CLM1PT_data/CTSM_DATM_US-Blo_2000-2006.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2000" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2006" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-Bo1/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-Bo1/shell_commands index f45ebc7076..49c70e98da 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-Bo1/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-Bo1/shell_commands @@ -1,10 +1,10 @@ +./xmlchange PLUMBER2SITE=US-Bo1 ./xmlchange PTS_LON=-88.290405 ./xmlchange PTS_LAT=40.006199 ./xmlchange DATM_YR_END=2006 ./xmlchange START_TOD=21600 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_US-Bo1_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-Bo1/CLM1PT_data/CTSM_DATM_US-Bo1_1997-2006.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=1997" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2006" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-Cop/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-Cop/shell_commands index 0ce199dd44..fc6a4841a9 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-Cop/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-Cop/shell_commands @@ -1,10 +1,10 @@ +./xmlchange PLUMBER2SITE=US-Cop ./xmlchange PTS_LON=-109.389999 ./xmlchange PTS_LAT=38.09 ./xmlchange DATM_YR_END=2003 ./xmlchange START_TOD=25200 ./xmlchange ATM_NCPL=24 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_US-Cop_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-Cop/CLM1PT_data/CTSM_DATM_US-Cop_2002-2003.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2002" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2003" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-FPe/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-FPe/shell_commands index 1f6c1a2438..2299cbf103 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-FPe/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-FPe/shell_commands @@ -1,10 +1,10 @@ -./xmlchange PTS_LON=-105.10189799999999 +./xmlchange PLUMBER2SITE=US-FPe +./xmlchange PTS_LON=-105.101898 ./xmlchange PTS_LAT=48.307701 ./xmlchange DATM_YR_END=2006 ./xmlchange START_TOD=25200 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_US-FPe_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-FPe/CLM1PT_data/CTSM_DATM_US-FPe_2000-2006.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2000" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2006" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-GLE/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-GLE/shell_commands index 59ae899a7e..794d0584a2 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-GLE/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-GLE/shell_commands @@ -1,10 +1,10 @@ +./xmlchange PLUMBER2SITE=US-GLE ./xmlchange PTS_LON=-106.239899 ./xmlchange PTS_LAT=41.366501 ./xmlchange DATM_YR_END=2014 ./xmlchange START_TOD=25200 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_US-GLE_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-GLE/CLM1PT_data/CTSM_DATM_US-GLE_2009-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2009" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-Goo/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-Goo/shell_commands index 9a0d84e815..6cc34f40c2 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-Goo/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-Goo/shell_commands @@ -1,10 +1,10 @@ -./xmlchange PTS_LON=-89.87350500000001 +./xmlchange PLUMBER2SITE=US-Goo +./xmlchange PTS_LON=-89.873505 ./xmlchange PTS_LAT=34.2547 ./xmlchange DATM_YR_END=2006 ./xmlchange START_TOD=21600 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_US-Goo_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-Goo/CLM1PT_data/CTSM_DATM_US-Goo_2004-2006.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2004" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2006" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-Ha1/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-Ha1/shell_commands index 0687c4cd3d..a016985d76 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-Ha1/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-Ha1/shell_commands @@ -1,10 +1,10 @@ +./xmlchange PLUMBER2SITE=US-Ha1 ./xmlchange PTS_LON=-72.171509 ./xmlchange PTS_LAT=42.5378 ./xmlchange DATM_YR_END=2012 ./xmlchange START_TOD=18000 ./xmlchange ATM_NCPL=24 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_US-Ha1_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-Ha1/CLM1PT_data/CTSM_DATM_US-Ha1_1992-2012.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=1992" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2012" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-Ho1/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-Ho1/shell_commands index a0d98032eb..c36889758d 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-Ho1/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-Ho1/shell_commands @@ -1,10 +1,10 @@ +./xmlchange PLUMBER2SITE=US-Ho1 ./xmlchange PTS_LON=-68.740204 ./xmlchange PTS_LAT=45.204102 ./xmlchange DATM_YR_END=2004 ./xmlchange START_TOD=18000 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_US-Ho1_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-Ho1/CLM1PT_data/CTSM_DATM_US-Ho1_1996-2004.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=1996" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2004" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-KS2/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-KS2/shell_commands index 02d26509c2..fc3ab78d4f 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-KS2/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-KS2/shell_commands @@ -1,10 +1,10 @@ +./xmlchange PLUMBER2SITE=US-KS2 ./xmlchange PTS_LON=-80.671539 ./xmlchange PTS_LAT=28.608578 ./xmlchange DATM_YR_END=2006 ./xmlchange START_TOD=18000 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_US-KS2_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-KS2/CLM1PT_data/CTSM_DATM_US-KS2_2003-2006.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2003" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2006" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-Los/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-Los/shell_commands index 13ef4e69b4..d0ee0a8b7d 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-Los/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-Los/shell_commands @@ -1,10 +1,10 @@ +./xmlchange PLUMBER2SITE=US-Los ./xmlchange PTS_LON=-89.979187 ./xmlchange PTS_LAT=46.082699 ./xmlchange DATM_YR_END=2008 ./xmlchange START_TOD=21600 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_US-Los_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-Los/CLM1PT_data/CTSM_DATM_US-Los_2000-2008.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2000" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2008" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-MMS/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-MMS/shell_commands index 8a271026dd..12362f6d77 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-MMS/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-MMS/shell_commands @@ -1,10 +1,10 @@ -./xmlchange PTS_LON=-86.41308599999999 +./xmlchange PLUMBER2SITE=US-MMS +./xmlchange PTS_LON=-86.413086 ./xmlchange PTS_LAT=39.3232 ./xmlchange DATM_YR_END=2014 ./xmlchange START_TOD=18000 ./xmlchange ATM_NCPL=24 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_US-MMS_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-MMS/CLM1PT_data/CTSM_DATM_US-MMS_1999-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=1999" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-MOz/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-MOz/shell_commands index a98dae73c4..a332c04808 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-MOz/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-MOz/shell_commands @@ -1,10 +1,10 @@ +./xmlchange PLUMBER2SITE=US-MOz ./xmlchange PTS_LON=-92.200012 ./xmlchange PTS_LAT=38.74411 ./xmlchange DATM_YR_END=2006 ./xmlchange START_TOD=21600 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_US-MOz_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-MOz/CLM1PT_data/CTSM_DATM_US-MOz_2005-2006.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2005" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2006" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-Me2/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-Me2/shell_commands index dc020bf1d1..97c8a61316 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-Me2/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-Me2/shell_commands @@ -1,10 +1,10 @@ +./xmlchange PLUMBER2SITE=US-Me2 ./xmlchange PTS_LON=-121.557404 ./xmlchange PTS_LAT=44.452301 ./xmlchange DATM_YR_END=2014 ./xmlchange START_TOD=28800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_US-Me2_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-Me2/CLM1PT_data/CTSM_DATM_US-Me2_2002-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2002" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-Me4/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-Me4/shell_commands index 77d787c3d4..eef9074dfe 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-Me4/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-Me4/shell_commands @@ -1,10 +1,10 @@ -./xmlchange PTS_LON=-121.62240600000001 +./xmlchange PLUMBER2SITE=US-Me4 +./xmlchange PTS_LON=-121.622406 ./xmlchange PTS_LAT=44.499199 ./xmlchange DATM_YR_END=2000 ./xmlchange START_TOD=28800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_US-Me4_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-Me4/CLM1PT_data/CTSM_DATM_US-Me4_1996-2000.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=1996" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2000" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-Me6/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-Me6/shell_commands index 389ef600e5..7591643f86 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-Me6/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-Me6/shell_commands @@ -1,10 +1,10 @@ +./xmlchange PLUMBER2SITE=US-Me6 ./xmlchange PTS_LON=-121.607803 ./xmlchange PTS_LAT=44.323299 ./xmlchange DATM_YR_END=2014 ./xmlchange START_TOD=28800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_US-Me6_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-Me6/CLM1PT_data/CTSM_DATM_US-Me6_2011-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2011" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-Myb/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-Myb/shell_commands index 6cc05da64f..66e97faf89 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-Myb/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-Myb/shell_commands @@ -1,10 +1,10 @@ +./xmlchange PLUMBER2SITE=US-Myb ./xmlchange PTS_LON=-121.765106 ./xmlchange PTS_LAT=38.049801 ./xmlchange DATM_YR_END=2014 ./xmlchange START_TOD=28800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_US-Myb_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-Myb/CLM1PT_data/CTSM_DATM_US-Myb_2011-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2011" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-NR1/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-NR1/shell_commands index 773ca669b1..6ccba5ae4e 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-NR1/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-NR1/shell_commands @@ -1,10 +1,10 @@ +./xmlchange PLUMBER2SITE=US-NR1 ./xmlchange PTS_LON=-105.546402 ./xmlchange PTS_LAT=40.032902 ./xmlchange DATM_YR_END=2014 ./xmlchange START_TOD=25200 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_US-NR1_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-NR1/CLM1PT_data/CTSM_DATM_US-NR1_1999-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=1999" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-Ne1/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-Ne1/shell_commands index f2adadd3ac..54bbcbe8de 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-Ne1/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-Ne1/shell_commands @@ -1,10 +1,10 @@ -./xmlchange PTS_LON=-96.47659300000001 +./xmlchange PLUMBER2SITE=US-Ne1 +./xmlchange PTS_LON=-96.476593 ./xmlchange PTS_LAT=41.1651 ./xmlchange DATM_YR_END=2012 ./xmlchange START_TOD=21600 ./xmlchange ATM_NCPL=24 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_US-Ne1_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-Ne1/CLM1PT_data/CTSM_DATM_US-Ne1_2002-2012.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2002" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2012" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-Ne2/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-Ne2/shell_commands index 15ed24bdee..0587fd1932 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-Ne2/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-Ne2/shell_commands @@ -1,10 +1,10 @@ +./xmlchange PLUMBER2SITE=US-Ne2 ./xmlchange PTS_LON=-96.470093 -./xmlchange PTS_LAT=41.164902000000005 +./xmlchange PTS_LAT=41.164902 ./xmlchange DATM_YR_END=2012 ./xmlchange START_TOD=21600 ./xmlchange ATM_NCPL=24 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_US-Ne2_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-Ne2/CLM1PT_data/CTSM_DATM_US-Ne2_2002-2012.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2002" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2012" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-Ne3/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-Ne3/shell_commands index 631bf243e4..66bcf6d25d 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-Ne3/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-Ne3/shell_commands @@ -1,10 +1,10 @@ +./xmlchange PLUMBER2SITE=US-Ne3 ./xmlchange PTS_LON=-96.439697 ./xmlchange PTS_LAT=41.179699 ./xmlchange DATM_YR_END=2012 ./xmlchange START_TOD=21600 ./xmlchange ATM_NCPL=24 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_US-Ne3_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-Ne3/CLM1PT_data/CTSM_DATM_US-Ne3_2002-2012.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2002" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2012" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-PFa/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-PFa/shell_commands index dd400a9257..76bfb84b9f 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-PFa/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-PFa/shell_commands @@ -1,10 +1,10 @@ +./xmlchange PLUMBER2SITE=US-PFa ./xmlchange PTS_LON=-90.272308 ./xmlchange PTS_LAT=45.9459 ./xmlchange DATM_YR_END=2014 ./xmlchange START_TOD=21600 ./xmlchange ATM_NCPL=24 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_US-PFa_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-PFa/CLM1PT_data/CTSM_DATM_US-PFa_1995-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=1995" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-Prr/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-Prr/shell_commands index 28acc5f402..f3c9e49740 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-Prr/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-Prr/shell_commands @@ -1,10 +1,10 @@ +./xmlchange PLUMBER2SITE=US-Prr ./xmlchange PTS_LON=-147.487595 ./xmlchange PTS_LAT=65.123703 ./xmlchange DATM_YR_END=2013 ./xmlchange START_TOD=32400 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_US-Prr_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-Prr/CLM1PT_data/CTSM_DATM_US-Prr_2011-2013.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2011" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2013" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-SP1/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-SP1/shell_commands index 37e05304a8..a10cb0956a 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-SP1/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-SP1/shell_commands @@ -1,10 +1,10 @@ +./xmlchange PLUMBER2SITE=US-SP1 ./xmlchange PTS_LON=-82.218781 ./xmlchange PTS_LAT=29.73807 ./xmlchange DATM_YR_END=2005 ./xmlchange START_TOD=18000 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_US-SP1_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-SP1/CLM1PT_data/CTSM_DATM_US-SP1_2005-2005.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2005" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2005" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-SP2/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-SP2/shell_commands index a4ea7a35ac..7b7a589af4 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-SP2/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-SP2/shell_commands @@ -1,10 +1,10 @@ +./xmlchange PLUMBER2SITE=US-SP2 ./xmlchange PTS_LON=-82.244812 ./xmlchange PTS_LAT=29.764799 ./xmlchange DATM_YR_END=2004 ./xmlchange START_TOD=18000 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_US-SP2_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-SP2/CLM1PT_data/CTSM_DATM_US-SP2_2000-2004.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2000" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2004" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-SP3/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-SP3/shell_commands index 76c00c8a36..882c94c80f 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-SP3/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-SP3/shell_commands @@ -1,10 +1,10 @@ +./xmlchange PLUMBER2SITE=US-SP3 ./xmlchange PTS_LON=-82.163269 ./xmlchange PTS_LAT=29.75477 ./xmlchange DATM_YR_END=2004 ./xmlchange START_TOD=18000 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_US-SP3_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-SP3/CLM1PT_data/CTSM_DATM_US-SP3_1999-2004.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=1999" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2004" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-SRG/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-SRG/shell_commands index 804a5f9884..7fea8792e6 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-SRG/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-SRG/shell_commands @@ -1,10 +1,10 @@ +./xmlchange PLUMBER2SITE=US-SRG ./xmlchange PTS_LON=-110.827698 ./xmlchange PTS_LAT=31.7894 ./xmlchange DATM_YR_END=2014 ./xmlchange START_TOD=25200 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_US-SRG_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-SRG/CLM1PT_data/CTSM_DATM_US-SRG_2009-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2009" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-SRM/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-SRM/shell_commands index 9b379b1edb..3ba018a2b1 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-SRM/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-SRM/shell_commands @@ -1,10 +1,10 @@ +./xmlchange PLUMBER2SITE=US-SRM ./xmlchange PTS_LON=-110.865997 ./xmlchange PTS_LAT=31.8214 ./xmlchange DATM_YR_END=2014 ./xmlchange START_TOD=25200 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_US-SRM_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-SRM/CLM1PT_data/CTSM_DATM_US-SRM_2004-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2004" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-Syv/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-Syv/shell_commands index 0fe6c91305..636e532f38 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-Syv/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-Syv/shell_commands @@ -1,10 +1,10 @@ +./xmlchange PLUMBER2SITE=US-Syv ./xmlchange PTS_LON=-89.347717 ./xmlchange PTS_LAT=46.242001 ./xmlchange DATM_YR_END=2008 ./xmlchange START_TOD=21600 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_US-Syv_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-Syv/CLM1PT_data/CTSM_DATM_US-Syv_2002-2008.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2002" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2008" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-Ton/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-Ton/shell_commands index e97bac9028..497385372e 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-Ton/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-Ton/shell_commands @@ -1,10 +1,10 @@ +./xmlchange PLUMBER2SITE=US-Ton ./xmlchange PTS_LON=-120.966003 ./xmlchange PTS_LAT=38.431599 ./xmlchange DATM_YR_END=2014 ./xmlchange START_TOD=28800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_US-Ton_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-Ton/CLM1PT_data/CTSM_DATM_US-Ton_2001-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2001" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-Tw4/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-Tw4/shell_commands index 49ad7cddd2..f212f4bc0f 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-Tw4/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-Tw4/shell_commands @@ -1,10 +1,10 @@ +./xmlchange PLUMBER2SITE=US-Tw4 ./xmlchange PTS_LON=-121.641403 ./xmlchange PTS_LAT=38.103001 ./xmlchange DATM_YR_END=2014 ./xmlchange START_TOD=28800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_US-Tw4_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-Tw4/CLM1PT_data/CTSM_DATM_US-Tw4_2014-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2014" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-Twt/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-Twt/shell_commands index 447906c4fc..74035ea108 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-Twt/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-Twt/shell_commands @@ -1,10 +1,10 @@ +./xmlchange PLUMBER2SITE=US-Twt ./xmlchange PTS_LON=-121.653107 ./xmlchange PTS_LAT=38.1087 ./xmlchange DATM_YR_END=2014 ./xmlchange START_TOD=28800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_US-Twt_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-Twt/CLM1PT_data/CTSM_DATM_US-Twt_2010-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2010" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-UMB/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-UMB/shell_commands index 1b3ee51b17..08f9f17a5a 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-UMB/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-UMB/shell_commands @@ -1,10 +1,10 @@ +./xmlchange PLUMBER2SITE=US-UMB ./xmlchange PTS_LON=-84.713806 ./xmlchange PTS_LAT=45.559799 ./xmlchange DATM_YR_END=2014 ./xmlchange START_TOD=18000 ./xmlchange ATM_NCPL=24 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_US-UMB_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-UMB/CLM1PT_data/CTSM_DATM_US-UMB_2000-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2000" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-Var/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-Var/shell_commands index 099e07e301..e997931652 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-Var/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-Var/shell_commands @@ -1,10 +1,10 @@ -./xmlchange PTS_LON=-120.95072900000001 +./xmlchange PLUMBER2SITE=US-Var +./xmlchange PTS_LON=-120.950729 ./xmlchange PTS_LAT=38.4133 ./xmlchange DATM_YR_END=2014 ./xmlchange START_TOD=28800 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_US-Var_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-Var/CLM1PT_data/CTSM_DATM_US-Var_2001-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2001" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-WCr/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-WCr/shell_commands index de5a646543..55647b78c0 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-WCr/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-WCr/shell_commands @@ -1,10 +1,10 @@ +./xmlchange PLUMBER2SITE=US-WCr ./xmlchange PTS_LON=-90.079895 ./xmlchange PTS_LAT=45.805901 ./xmlchange DATM_YR_END=2006 ./xmlchange START_TOD=21600 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_US-WCr_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-WCr/CLM1PT_data/CTSM_DATM_US-WCr_1999-2006.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=1999" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2006" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-Whs/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-Whs/shell_commands index f706a2e79a..51fadcc9f6 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-Whs/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-Whs/shell_commands @@ -1,10 +1,10 @@ +./xmlchange PLUMBER2SITE=US-Whs ./xmlchange PTS_LON=-110.0522 ./xmlchange PTS_LAT=31.743799 ./xmlchange DATM_YR_END=2014 ./xmlchange START_TOD=25200 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_US-Whs_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-Whs/CLM1PT_data/CTSM_DATM_US-Whs_2008-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2008" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-Wkg/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-Wkg/shell_commands index 0fc65819c2..5d95ef3e36 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-Wkg/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-Wkg/shell_commands @@ -1,10 +1,10 @@ +./xmlchange PLUMBER2SITE=US-Wkg ./xmlchange PTS_LON=-109.941895 ./xmlchange PTS_LAT=31.7365 ./xmlchange DATM_YR_END=2014 ./xmlchange START_TOD=25200 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_US-Wkg_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-Wkg/CLM1PT_data/CTSM_DATM_US-Wkg_2005-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2005" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/ZA-Kru/shell_commands b/cime_config/usermods_dirs/PLUMBER2/ZA-Kru/shell_commands index 7c2dfed5c9..6fe9e9c989 100644 --- a/cime_config/usermods_dirs/PLUMBER2/ZA-Kru/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/ZA-Kru/shell_commands @@ -1,10 +1,10 @@ +./xmlchange PLUMBER2SITE=ZA-Kru ./xmlchange PTS_LON=31.496901 ./xmlchange PTS_LAT=-25.019699 ./xmlchange DATM_YR_END=2002 ./xmlchange START_TOD=79200 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_ZA-Kru_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/ZA-Kru/CLM1PT_data/CTSM_DATM_ZA-Kru_2000-2002.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2000" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2002" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/ZM-Mon/shell_commands b/cime_config/usermods_dirs/PLUMBER2/ZM-Mon/shell_commands index 825675dc9b..ff19816490 100644 --- a/cime_config/usermods_dirs/PLUMBER2/ZM-Mon/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/ZM-Mon/shell_commands @@ -1,10 +1,10 @@ +./xmlchange PLUMBER2SITE=ZM-Mon ./xmlchange PTS_LON=23.252781 ./xmlchange PTS_LAT=-15.437778 ./xmlchange DATM_YR_END=2008 ./xmlchange START_TOD=79200 ./xmlchange ATM_NCPL=48 -echo "fsurdat='\$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/surfdata_1x1_PLUMBER2_ZM-Mon_hist_2000_16pfts_c240326.nc' " >> user_nl_clm echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/ZM-Mon/CLM1PT_data/CTSM_DATM_ZM-Mon_2008-2008.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2008" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2008" >> user_nl_datm_streams From 6f8c4d779fd320cdf06df9c337e8e1125d544049 Mon Sep 17 00:00:00 2001 From: Teagan King Date: Fri, 28 Jun 2024 16:13:27 -0600 Subject: [PATCH 0931/1248] reformatting pt2 --- python/ctsm/site_and_regional/plumber2_usermods.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/python/ctsm/site_and_regional/plumber2_usermods.py b/python/ctsm/site_and_regional/plumber2_usermods.py index 2fe183fb77..0a083e1dd7 100644 --- a/python/ctsm/site_and_regional/plumber2_usermods.py +++ b/python/ctsm/site_and_regional/plumber2_usermods.py @@ -58,13 +58,7 @@ def write_usermods( "./xmlchange DATM_YR_END=" + str(end_year) + "\n" "./xmlchange START_TOD=" + str(start_tod) + "\n" "./xmlchange ATM_NCPL=" + str(atm_ncpl) + "\n" - "\n" # TODO, get working for CTSM5.1: - # remove the above line as it's redundant after PLUMBER2SITE is added - # Alternatively, we can take this out of default/user_nl_clm - # since doing it this way is works fine TODO for 5.2 - "echo \"fsurdat='/glade/u/home/wwieder/CTSM/tools/site_and_regional/subset_data_single_point/surfdata_1x1_PLUMBER2_" - + site - + "_hist_16pfts_Irrig_CMIP6_simyr2000_c231005.nc ' \" >> user_nl_clm \n" + "\n" 'echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/' + site + "/CLM1PT_data/CTSM_DATM_" From da6e20615435ee4108f9cab6803bf7161afcf6a0 Mon Sep 17 00:00:00 2001 From: Teagan King Date: Tue, 2 Jul 2024 12:05:33 -0600 Subject: [PATCH 0932/1248] fix for plumber file formats --- cime_config/buildnml | 44 ++++++++++++++++++++++++++++---------------- 1 file changed, 28 insertions(+), 16 deletions(-) diff --git a/cime_config/buildnml b/cime_config/buildnml index acc74868e0..7d3e2b4770 100644 --- a/cime_config/buildnml +++ b/cime_config/buildnml @@ -182,7 +182,9 @@ def buildnml(case, caseroot, compname): clm_phys = case.get_value("CLM_PHYSICS_VERSION") config_cache_text = _config_cache_template.format(clm_phys=clm_phys) - config_cache_path = os.path.join(caseroot, "Buildconf", compname + "conf", "config_cache.xml") + config_cache_path = os.path.join( + caseroot, "Buildconf", compname + "conf", "config_cache.xml" + ) with open(config_cache_path, "w") as config_cache_file: config_cache_file.write(config_cache_text) @@ -224,16 +226,22 @@ def buildnml(case, caseroot, compname): clm_usrdat_name = case.get_value("CLM_USRDAT_NAME") clmusr = " -clm_usr_name %s " % clm_usrdat_name # Write warning about initial condition data - if ("NEON" in clm_usrdat_name) or ("PLUMBER" in clm_usrdat_name): - if clm_force_coldstart == "off": - if ("_transient" in clm_nml_use_case) and ( - re.fullmatch(r"\w\w\w\w\.transient", casename) is None - or clm_usrdat_name is "NEON.PRISM" - ): - logger.warning( - "WARNING: Do you have appropriate initial conditions for this simulation?" - + " Check that the finidat file used in the lnd_in namelist is appropriately spunup for your case" - ) + if "NEON" in clm_usrdat_name and clm_force_coldstart == "off": + if ("_transient" in clm_nml_use_case) and ( + re.fullmatch(r"\w\w\w\w\.transient", casename) is None + ): + logger.warning( + "WARNING: Do you have appropriate initial conditions for this simulation?" + + " Check that the finidat file used in the lnd_in namelist is appropriately spunup for your case" + ) + if "PLUMBER" in clm_usrdat_name and clm_force_coldstart == "off": + if ("_transient" in clm_nml_use_case) and ( + re.fullmatch(r"\w\w-\w\w\w\.transient", casename) is None + ): + logger.warning( + "WARNING: Do you have appropriate initial conditions for this simulation?" + + " Check that the finidat file used in the lnd_in namelist is appropriately spunup for your case" + ) if comp_atm != "datm": nomeg = "-no-megan" @@ -302,7 +310,9 @@ def buildnml(case, caseroot, compname): lndfrac_file = os.path.join(lnd_domain_path, lnd_domain_file) lndfrac_setting = "-lnd_frac " + lndfrac_file - config_cache_file = os.path.join(caseroot, "Buildconf", compname + "conf", "config_cache.xml") + config_cache_file = os.path.join( + caseroot, "Buildconf", compname + "conf", "config_cache.xml" + ) # ----------------------------------------------------- # Clear out old data @@ -317,7 +327,6 @@ def buildnml(case, caseroot, compname): ninst = int(ninst_lnd) for inst_counter in range(1, ninst + 1): - # determine instance string inst_string = "" if ninst > 1: @@ -365,7 +374,9 @@ def buildnml(case, caseroot, compname): break if not os.path.exists(os.path.join(rundir, clm_startfile)): - logger.warning("WARNING: Could NOT find a start file to use using" + clm_startfile) + logger.warning( + "WARNING: Could NOT find a start file to use using" + clm_startfile + ) clm_icfile = "%s = '%s'" % (startfile_type, clm_startfile) else: clm_icfile = "" @@ -376,7 +387,9 @@ def buildnml(case, caseroot, compname): user_nl_file = os.path.join(caseroot, "user_nl_clm" + inst_string) namelist_infile = os.path.join(ctsmconf, "namelist") - create_namelist_infile(case, user_nl_file, namelist_infile, "\n".join(infile_lines)) + create_namelist_infile( + case, user_nl_file, namelist_infile, "\n".join(infile_lines) + ) cmd = os.path.join(lnd_root, "bld", "build-namelist") @@ -439,7 +452,6 @@ def buildnml(case, caseroot, compname): ############################################################################### def _main_func(): - caseroot = parse_input(sys.argv) with Case(caseroot) as case: compname = case.get_value("COMP_LND") From 926299cf96270f17175c6649165a9d1985f755f6 Mon Sep 17 00:00:00 2001 From: Teagan King Date: Tue, 2 Jul 2024 12:09:37 -0600 Subject: [PATCH 0933/1248] fix black issue and neon.prism clm_usrdat_name --- cime_config/buildnml | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/cime_config/buildnml b/cime_config/buildnml index 7d3e2b4770..370291fa70 100644 --- a/cime_config/buildnml +++ b/cime_config/buildnml @@ -182,9 +182,7 @@ def buildnml(case, caseroot, compname): clm_phys = case.get_value("CLM_PHYSICS_VERSION") config_cache_text = _config_cache_template.format(clm_phys=clm_phys) - config_cache_path = os.path.join( - caseroot, "Buildconf", compname + "conf", "config_cache.xml" - ) + config_cache_path = os.path.join(caseroot, "Buildconf", compname + "conf", "config_cache.xml" ) with open(config_cache_path, "w") as config_cache_file: config_cache_file.write(config_cache_text) @@ -229,6 +227,7 @@ def buildnml(case, caseroot, compname): if "NEON" in clm_usrdat_name and clm_force_coldstart == "off": if ("_transient" in clm_nml_use_case) and ( re.fullmatch(r"\w\w\w\w\.transient", casename) is None + or clm_usrdat_name is "NEON.PRISM" ): logger.warning( "WARNING: Do you have appropriate initial conditions for this simulation?" @@ -310,9 +309,7 @@ def buildnml(case, caseroot, compname): lndfrac_file = os.path.join(lnd_domain_path, lnd_domain_file) lndfrac_setting = "-lnd_frac " + lndfrac_file - config_cache_file = os.path.join( - caseroot, "Buildconf", compname + "conf", "config_cache.xml" - ) + config_cache_file = os.path.join(caseroot, "Buildconf", compname + "conf", "config_cache.xml") # ----------------------------------------------------- # Clear out old data @@ -374,9 +371,7 @@ def buildnml(case, caseroot, compname): break if not os.path.exists(os.path.join(rundir, clm_startfile)): - logger.warning( - "WARNING: Could NOT find a start file to use using" + clm_startfile - ) + logger.warning("WARNING: Could NOT find a start file to use using" + clm_startfile) clm_icfile = "%s = '%s'" % (startfile_type, clm_startfile) else: clm_icfile = "" @@ -387,9 +382,7 @@ def buildnml(case, caseroot, compname): user_nl_file = os.path.join(caseroot, "user_nl_clm" + inst_string) namelist_infile = os.path.join(ctsmconf, "namelist") - create_namelist_infile( - case, user_nl_file, namelist_infile, "\n".join(infile_lines) - ) + create_namelist_infile(case, user_nl_file, namelist_infile, "\n".join(infile_lines)) cmd = os.path.join(lnd_root, "bld", "build-namelist") From f6a0749845f612b55301ecdc93dc0823d506a929 Mon Sep 17 00:00:00 2001 From: Teagan King Date: Tue, 2 Jul 2024 12:49:50 -0600 Subject: [PATCH 0934/1248] revert everything else to pre-black-fail --- cime_config/buildnml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cime_config/buildnml b/cime_config/buildnml index 370291fa70..539be911e6 100644 --- a/cime_config/buildnml +++ b/cime_config/buildnml @@ -182,7 +182,7 @@ def buildnml(case, caseroot, compname): clm_phys = case.get_value("CLM_PHYSICS_VERSION") config_cache_text = _config_cache_template.format(clm_phys=clm_phys) - config_cache_path = os.path.join(caseroot, "Buildconf", compname + "conf", "config_cache.xml" ) + config_cache_path = os.path.join(caseroot, "Buildconf", compname + "conf", "config_cache.xml") with open(config_cache_path, "w") as config_cache_file: config_cache_file.write(config_cache_text) @@ -324,6 +324,7 @@ def buildnml(case, caseroot, compname): ninst = int(ninst_lnd) for inst_counter in range(1, ninst + 1): + # determine instance string inst_string = "" if ninst > 1: @@ -445,6 +446,7 @@ def buildnml(case, caseroot, compname): ############################################################################### def _main_func(): + caseroot = parse_input(sys.argv) with Case(caseroot) as case: compname = case.get_value("COMP_LND") From 1548af3bdca0e23de641feffbed59b6094737e37 Mon Sep 17 00:00:00 2001 From: Teagan King <98482480+TeaganKing@users.noreply.github.com> Date: Tue, 30 Jul 2024 14:25:11 -0600 Subject: [PATCH 0935/1248] Update buildnml PLUMBER --> PLUMBER2 --- cime_config/buildnml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cime_config/buildnml b/cime_config/buildnml index 539be911e6..46812602df 100644 --- a/cime_config/buildnml +++ b/cime_config/buildnml @@ -233,7 +233,7 @@ def buildnml(case, caseroot, compname): "WARNING: Do you have appropriate initial conditions for this simulation?" + " Check that the finidat file used in the lnd_in namelist is appropriately spunup for your case" ) - if "PLUMBER" in clm_usrdat_name and clm_force_coldstart == "off": + if "PLUMBER2" in clm_usrdat_name and clm_force_coldstart == "off": if ("_transient" in clm_nml_use_case) and ( re.fullmatch(r"\w\w-\w\w\w\.transient", casename) is None ): From e9e7eaf37582cf10dee394f4dbd3a7e1ba592883 Mon Sep 17 00:00:00 2001 From: Teagan King <98482480+TeaganKing@users.noreply.github.com> Date: Wed, 7 Aug 2024 10:53:15 -0600 Subject: [PATCH 0936/1248] typo fix in config_component.xml --- cime_config/config_component.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cime_config/config_component.xml b/cime_config/config_component.xml index 1fc7a3a3a1..3951356df9 100644 --- a/cime_config/config_component.xml +++ b/cime_config/config_component.xml @@ -356,7 +356,7 @@ cold start (finidat will be set to blanks). A value of on forces the model to spin up from a cold-start (arbitrary initial conditions). Setting this value in the xml file will take - precedence over any settings for finidat in the $CASEROOT/user_nl_ctsm file. + precedence over any settings for finidat in the $CASEROOT/user_nl_clm file. From c8447b8acb8c13472f49d46aae8d07133cc3496f Mon Sep 17 00:00:00 2001 From: Teagan King <98482480+TeaganKing@users.noreply.github.com> Date: Thu, 8 Aug 2024 12:04:49 -0600 Subject: [PATCH 0937/1248] Update plumber2_usermods.py to include new xml var and remove additional stream that is now in cdeps --- python/ctsm/site_and_regional/plumber2_usermods.py | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/python/ctsm/site_and_regional/plumber2_usermods.py b/python/ctsm/site_and_regional/plumber2_usermods.py index 0a083e1dd7..d98899771b 100644 --- a/python/ctsm/site_and_regional/plumber2_usermods.py +++ b/python/ctsm/site_and_regional/plumber2_usermods.py @@ -56,18 +56,10 @@ def write_usermods( "./xmlchange PTS_LON=" + str(lon) + "\n" "./xmlchange PTS_LAT=" + str(lat) + "\n" "./xmlchange DATM_YR_END=" + str(end_year) + "\n" + "./xmlchange DATM_YR_START_FILENAME=" + str(start_year) + "\n" "./xmlchange START_TOD=" + str(start_tod) + "\n" "./xmlchange ATM_NCPL=" + str(atm_ncpl) + "\n" "\n" - 'echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/' - + site - + "/CLM1PT_data/CTSM_DATM_" - + site - + "_" - + str(start_year) - + "-" - + str(end_year) - + '.nc " >> user_nl_datm_streams \n' 'echo "presaero.SSP3-7.0:year_first=' + str(start_year) + '" >> user_nl_datm_streams \n' 'echo "presaero.SSP3-7.0:year_last=' + str(end_year) + '" >> user_nl_datm_streams \n' 'echo "presaero.SSP3-7.0:year_align=' + str(start_year) + '" >> user_nl_datm_streams \n' From 43f8aeefc0bff8e4cae2ac0a58f510f48fd50bf6 Mon Sep 17 00:00:00 2001 From: Teagan King <98482480+TeaganKing@users.noreply.github.com> Date: Thu, 8 Aug 2024 12:05:54 -0600 Subject: [PATCH 0938/1248] fix typo in buildnml --- cime_config/buildnml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cime_config/buildnml b/cime_config/buildnml index 46812602df..893f0933c7 100644 --- a/cime_config/buildnml +++ b/cime_config/buildnml @@ -372,7 +372,7 @@ def buildnml(case, caseroot, compname): break if not os.path.exists(os.path.join(rundir, clm_startfile)): - logger.warning("WARNING: Could NOT find a start file to use using" + clm_startfile) + logger.warning("WARNING: Could NOT find a start file named" + clm_startfile) clm_icfile = "%s = '%s'" % (startfile_type, clm_startfile) else: clm_icfile = "" From dc6773742b7f0ca30ecf90478fd98e7419d06730 Mon Sep 17 00:00:00 2001 From: Teagan King Date: Thu, 8 Aug 2024 12:15:41 -0600 Subject: [PATCH 0939/1248] updated shell commands with new xml var and file moved to cdeps --- cime_config/usermods_dirs/PLUMBER2/AR-SLu/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/AT-Neu/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/AU-ASM/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/AU-Cow/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/AU-Cpr/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/AU-Ctr/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/AU-Cum/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/AU-DaP/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/AU-DaS/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/AU-Dry/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/AU-Emr/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/AU-GWW/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/AU-Gin/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/AU-How/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/AU-Lit/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/AU-Otw/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/AU-Rig/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/AU-Rob/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/AU-Sam/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/AU-Stp/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/AU-TTE/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/AU-Tum/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/AU-Whr/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/AU-Wrr/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/AU-Ync/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/BE-Bra/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/BE-Lon/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/BE-Vie/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/BR-Sa3/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/BW-Ma1/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/CA-NS1/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/CA-NS2/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/CA-NS4/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/CA-NS5/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/CA-NS6/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/CA-NS7/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/CA-Qcu/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/CA-Qfo/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/CA-SF1/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/CA-SF2/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/CA-SF3/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/CH-Cha/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/CH-Dav/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/CH-Fru/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/CH-Oe1/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/CN-Cha/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/CN-Cng/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/CN-Dan/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/CN-Din/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/CN-Du2/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/CN-HaM/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/CN-Qia/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/CZ-wet/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/DE-Bay/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/DE-Geb/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/DE-Gri/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/DE-Hai/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/DE-Kli/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/DE-Meh/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/DE-Obe/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/DE-Seh/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/DE-SfN/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/DE-Tha/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/DE-Wet/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/DK-Fou/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/DK-Lva/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/DK-Ris/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/DK-Sor/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/DK-ZaH/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/ES-ES1/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/ES-ES2/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/ES-LMa/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/ES-LgS/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/ES-VDA/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/FI-Hyy/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/FI-Kaa/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/FI-Lom/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/FI-Sod/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/FR-Fon/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/FR-Gri/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/FR-Hes/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/FR-LBr/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/FR-Lq1/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/FR-Lq2/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/FR-Pue/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/GF-Guy/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/HU-Bug/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/ID-Pag/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/IE-Ca1/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/IE-Dri/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/IT-Amp/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/IT-BCi/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/IT-CA1/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/IT-CA2/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/IT-CA3/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/IT-Col/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/IT-Cpz/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/IT-Isp/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/IT-LMa/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/IT-Lav/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/IT-MBo/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/IT-Mal/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/IT-Noe/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/IT-Non/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/IT-PT1/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/IT-Ren/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/IT-Ro1/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/IT-Ro2/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/IT-SR2/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/IT-SRo/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/JP-SMF/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/NL-Ca1/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/NL-Hor/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/NL-Loo/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/PL-wet/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/PT-Esp/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/PT-Mi1/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/PT-Mi2/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/RU-Che/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/RU-Fyo/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/RU-Zot/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/SD-Dem/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/SE-Deg/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/UK-Gri/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/UK-Ham/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/UK-PL3/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/US-AR1/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/US-AR2/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/US-ARM/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/US-Aud/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/US-Bar/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/US-Bkg/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/US-Blo/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/US-Bo1/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/US-Cop/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/US-FPe/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/US-GLE/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/US-Goo/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/US-Ha1/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/US-Ho1/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/US-KS2/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/US-Los/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/US-MMS/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/US-MOz/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/US-Me2/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/US-Me4/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/US-Me6/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/US-Myb/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/US-NR1/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/US-Ne1/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/US-Ne2/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/US-Ne3/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/US-PFa/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/US-Prr/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/US-SP1/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/US-SP2/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/US-SP3/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/US-SRG/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/US-SRM/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/US-Syv/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/US-Ton/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/US-Tw4/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/US-Twt/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/US-UMB/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/US-Var/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/US-WCr/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/US-Whs/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/US-Wkg/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/ZA-Kru/shell_commands | 2 +- cime_config/usermods_dirs/PLUMBER2/ZM-Mon/shell_commands | 2 +- 170 files changed, 170 insertions(+), 170 deletions(-) diff --git a/cime_config/usermods_dirs/PLUMBER2/AR-SLu/shell_commands b/cime_config/usermods_dirs/PLUMBER2/AR-SLu/shell_commands index d7f8707812..f297937768 100644 --- a/cime_config/usermods_dirs/PLUMBER2/AR-SLu/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/AR-SLu/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=-66.459808 ./xmlchange PTS_LAT=-33.464802 ./xmlchange DATM_YR_END=2010 +./xmlchange DATM_YR_START_FILENAME=2010 ./xmlchange START_TOD=10800 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/AR-SLu/CLM1PT_data/CTSM_DATM_AR-SLu_2010-2010.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2010" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2010" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2010" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/AT-Neu/shell_commands b/cime_config/usermods_dirs/PLUMBER2/AT-Neu/shell_commands index dc0750224f..319c52a95d 100644 --- a/cime_config/usermods_dirs/PLUMBER2/AT-Neu/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/AT-Neu/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=11.3175 ./xmlchange PTS_LAT=47.116669 ./xmlchange DATM_YR_END=2012 +./xmlchange DATM_YR_START_FILENAME=2002 ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/AT-Neu/CLM1PT_data/CTSM_DATM_AT-Neu_2002-2012.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2002" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2012" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2002" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/AU-ASM/shell_commands b/cime_config/usermods_dirs/PLUMBER2/AU-ASM/shell_commands index f3eae9a24e..afadee1c1e 100644 --- a/cime_config/usermods_dirs/PLUMBER2/AU-ASM/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/AU-ASM/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=133.248993 ./xmlchange PTS_LAT=-22.283001 ./xmlchange DATM_YR_END=2017 +./xmlchange DATM_YR_START_FILENAME=2011 ./xmlchange START_TOD=54000 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/AU-ASM/CLM1PT_data/CTSM_DATM_AU-ASM_2011-2017.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2011" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2017" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2011" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/AU-Cow/shell_commands b/cime_config/usermods_dirs/PLUMBER2/AU-Cow/shell_commands index 9e44c8232c..40187f1b46 100644 --- a/cime_config/usermods_dirs/PLUMBER2/AU-Cow/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/AU-Cow/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=145.427155 ./xmlchange PTS_LAT=-16.23819 ./xmlchange DATM_YR_END=2015 +./xmlchange DATM_YR_START_FILENAME=2010 ./xmlchange START_TOD=50400 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/AU-Cow/CLM1PT_data/CTSM_DATM_AU-Cow_2010-2015.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2010" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2015" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2010" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/AU-Cpr/shell_commands b/cime_config/usermods_dirs/PLUMBER2/AU-Cpr/shell_commands index 114544e9b5..fc3b037ecc 100644 --- a/cime_config/usermods_dirs/PLUMBER2/AU-Cpr/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/AU-Cpr/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=140.589127 ./xmlchange PTS_LAT=-34.00206 ./xmlchange DATM_YR_END=2017 +./xmlchange DATM_YR_START_FILENAME=2011 ./xmlchange START_TOD=46800 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/AU-Cpr/CLM1PT_data/CTSM_DATM_AU-Cpr_2011-2017.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2011" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2017" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2011" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/AU-Ctr/shell_commands b/cime_config/usermods_dirs/PLUMBER2/AU-Ctr/shell_commands index 7af2976c83..6710134c78 100644 --- a/cime_config/usermods_dirs/PLUMBER2/AU-Ctr/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/AU-Ctr/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=145.446854 ./xmlchange PTS_LAT=-16.103279 ./xmlchange DATM_YR_END=2017 +./xmlchange DATM_YR_START_FILENAME=2010 ./xmlchange START_TOD=50400 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/AU-Ctr/CLM1PT_data/CTSM_DATM_AU-Ctr_2010-2017.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2010" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2017" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2010" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/AU-Cum/shell_commands b/cime_config/usermods_dirs/PLUMBER2/AU-Cum/shell_commands index 8c75b3de45..a2022818c6 100644 --- a/cime_config/usermods_dirs/PLUMBER2/AU-Cum/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/AU-Cum/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=150.722473 ./xmlchange PTS_LAT=-33.613297 ./xmlchange DATM_YR_END=2018 +./xmlchange DATM_YR_START_FILENAME=2013 ./xmlchange START_TOD=46800 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/AU-Cum/CLM1PT_data/CTSM_DATM_AU-Cum_2013-2018.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2013" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2018" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2013" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/AU-DaP/shell_commands b/cime_config/usermods_dirs/PLUMBER2/AU-DaP/shell_commands index 44171b3425..28b5b4b446 100644 --- a/cime_config/usermods_dirs/PLUMBER2/AU-DaP/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/AU-DaP/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=131.3181 ./xmlchange PTS_LAT=-14.0633 ./xmlchange DATM_YR_END=2012 +./xmlchange DATM_YR_START_FILENAME=2009 ./xmlchange START_TOD=54000 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/AU-DaP/CLM1PT_data/CTSM_DATM_AU-DaP_2009-2012.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2009" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2012" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2009" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/AU-DaS/shell_commands b/cime_config/usermods_dirs/PLUMBER2/AU-DaS/shell_commands index 699b74900a..96acb7b7cf 100644 --- a/cime_config/usermods_dirs/PLUMBER2/AU-DaS/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/AU-DaS/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=131.388 ./xmlchange PTS_LAT=-14.159283 ./xmlchange DATM_YR_END=2017 +./xmlchange DATM_YR_START_FILENAME=2010 ./xmlchange START_TOD=54000 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/AU-DaS/CLM1PT_data/CTSM_DATM_AU-DaS_2010-2017.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2010" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2017" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2010" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/AU-Dry/shell_commands b/cime_config/usermods_dirs/PLUMBER2/AU-Dry/shell_commands index a2a4686230..da520bb88e 100644 --- a/cime_config/usermods_dirs/PLUMBER2/AU-Dry/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/AU-Dry/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=132.370605 ./xmlchange PTS_LAT=-15.2588 ./xmlchange DATM_YR_END=2015 +./xmlchange DATM_YR_START_FILENAME=2011 ./xmlchange START_TOD=54000 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/AU-Dry/CLM1PT_data/CTSM_DATM_AU-Dry_2011-2015.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2011" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2015" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2011" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/AU-Emr/shell_commands b/cime_config/usermods_dirs/PLUMBER2/AU-Emr/shell_commands index 7d9d557087..a5ccf45884 100644 --- a/cime_config/usermods_dirs/PLUMBER2/AU-Emr/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/AU-Emr/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=148.474594 ./xmlchange PTS_LAT=-23.8587 ./xmlchange DATM_YR_END=2013 +./xmlchange DATM_YR_START_FILENAME=2012 ./xmlchange START_TOD=50400 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/AU-Emr/CLM1PT_data/CTSM_DATM_AU-Emr_2012-2013.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2012" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2013" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2012" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/AU-GWW/shell_commands b/cime_config/usermods_dirs/PLUMBER2/AU-GWW/shell_commands index 26bd398dc1..637c921fae 100644 --- a/cime_config/usermods_dirs/PLUMBER2/AU-GWW/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/AU-GWW/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=120.654099 ./xmlchange PTS_LAT=-30.191299 ./xmlchange DATM_YR_END=2017 +./xmlchange DATM_YR_START_FILENAME=2013 ./xmlchange START_TOD=57600 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/AU-GWW/CLM1PT_data/CTSM_DATM_AU-GWW_2013-2017.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2013" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2017" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2013" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/AU-Gin/shell_commands b/cime_config/usermods_dirs/PLUMBER2/AU-Gin/shell_commands index 61d3c3eb01..e02f3482ed 100644 --- a/cime_config/usermods_dirs/PLUMBER2/AU-Gin/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/AU-Gin/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=115.650002 ./xmlchange PTS_LAT=-31.375 ./xmlchange DATM_YR_END=2017 +./xmlchange DATM_YR_START_FILENAME=2012 ./xmlchange START_TOD=57600 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/AU-Gin/CLM1PT_data/CTSM_DATM_AU-Gin_2012-2017.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2012" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2017" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2012" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/AU-How/shell_commands b/cime_config/usermods_dirs/PLUMBER2/AU-How/shell_commands index 7cac687aa3..448f24cc4f 100644 --- a/cime_config/usermods_dirs/PLUMBER2/AU-How/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/AU-How/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=131.149994 ./xmlchange PTS_LAT=-12.4952 ./xmlchange DATM_YR_END=2017 +./xmlchange DATM_YR_START_FILENAME=2003 ./xmlchange START_TOD=54000 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/AU-How/CLM1PT_data/CTSM_DATM_AU-How_2003-2017.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2003" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2017" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2003" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/AU-Lit/shell_commands b/cime_config/usermods_dirs/PLUMBER2/AU-Lit/shell_commands index 7f1a885344..6e69bbc5d2 100644 --- a/cime_config/usermods_dirs/PLUMBER2/AU-Lit/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/AU-Lit/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=130.794495 ./xmlchange PTS_LAT=-13.17904 ./xmlchange DATM_YR_END=2017 +./xmlchange DATM_YR_START_FILENAME=2016 ./xmlchange START_TOD=54000 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/AU-Lit/CLM1PT_data/CTSM_DATM_AU-Lit_2016-2017.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2016" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2017" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2016" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/AU-Otw/shell_commands b/cime_config/usermods_dirs/PLUMBER2/AU-Otw/shell_commands index 4016a12e52..c3962c1b33 100644 --- a/cime_config/usermods_dirs/PLUMBER2/AU-Otw/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/AU-Otw/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=142.816803 ./xmlchange PTS_LAT=-38.532341 ./xmlchange DATM_YR_END=2010 +./xmlchange DATM_YR_START_FILENAME=2009 ./xmlchange START_TOD=46800 ./xmlchange ATM_NCPL=24 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/AU-Otw/CLM1PT_data/CTSM_DATM_AU-Otw_2009-2010.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2009" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2010" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2009" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/AU-Rig/shell_commands b/cime_config/usermods_dirs/PLUMBER2/AU-Rig/shell_commands index 193f3cc5dd..fc5ecba950 100644 --- a/cime_config/usermods_dirs/PLUMBER2/AU-Rig/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/AU-Rig/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=145.575897 ./xmlchange PTS_LAT=-36.649899 ./xmlchange DATM_YR_END=2016 +./xmlchange DATM_YR_START_FILENAME=2011 ./xmlchange START_TOD=46800 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/AU-Rig/CLM1PT_data/CTSM_DATM_AU-Rig_2011-2016.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2011" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2016" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2011" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/AU-Rob/shell_commands b/cime_config/usermods_dirs/PLUMBER2/AU-Rob/shell_commands index f7f4921746..6e640a50fa 100644 --- a/cime_config/usermods_dirs/PLUMBER2/AU-Rob/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/AU-Rob/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=145.630096 ./xmlchange PTS_LAT=-17.1175 ./xmlchange DATM_YR_END=2017 +./xmlchange DATM_YR_START_FILENAME=2014 ./xmlchange START_TOD=50400 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/AU-Rob/CLM1PT_data/CTSM_DATM_AU-Rob_2014-2017.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2014" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2017" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2014" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/AU-Sam/shell_commands b/cime_config/usermods_dirs/PLUMBER2/AU-Sam/shell_commands index d1dae3a306..1f48d3060f 100644 --- a/cime_config/usermods_dirs/PLUMBER2/AU-Sam/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/AU-Sam/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=152.877808 ./xmlchange PTS_LAT=-27.3881 ./xmlchange DATM_YR_END=2017 +./xmlchange DATM_YR_START_FILENAME=2011 ./xmlchange START_TOD=50400 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/AU-Sam/CLM1PT_data/CTSM_DATM_AU-Sam_2011-2017.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2011" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2017" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2011" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/AU-Stp/shell_commands b/cime_config/usermods_dirs/PLUMBER2/AU-Stp/shell_commands index d0e4cdf638..949257e09f 100644 --- a/cime_config/usermods_dirs/PLUMBER2/AU-Stp/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/AU-Stp/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=133.350204 ./xmlchange PTS_LAT=-17.1507 ./xmlchange DATM_YR_END=2017 +./xmlchange DATM_YR_START_FILENAME=2010 ./xmlchange START_TOD=54000 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/AU-Stp/CLM1PT_data/CTSM_DATM_AU-Stp_2010-2017.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2010" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2017" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2010" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/AU-TTE/shell_commands b/cime_config/usermods_dirs/PLUMBER2/AU-TTE/shell_commands index 3c878a3ae9..ca7b84c598 100644 --- a/cime_config/usermods_dirs/PLUMBER2/AU-TTE/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/AU-TTE/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=133.639999 ./xmlchange PTS_LAT=-22.287001 ./xmlchange DATM_YR_END=2017 +./xmlchange DATM_YR_START_FILENAME=2013 ./xmlchange START_TOD=54000 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/AU-TTE/CLM1PT_data/CTSM_DATM_AU-TTE_2013-2017.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2013" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2017" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2013" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/AU-Tum/shell_commands b/cime_config/usermods_dirs/PLUMBER2/AU-Tum/shell_commands index 8e01ca6869..5ad2d9dce2 100644 --- a/cime_config/usermods_dirs/PLUMBER2/AU-Tum/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/AU-Tum/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=148.151703 ./xmlchange PTS_LAT=-35.656601 ./xmlchange DATM_YR_END=2017 +./xmlchange DATM_YR_START_FILENAME=2002 ./xmlchange START_TOD=46800 ./xmlchange ATM_NCPL=24 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/AU-Tum/CLM1PT_data/CTSM_DATM_AU-Tum_2002-2017.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2002" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2017" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2002" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/AU-Whr/shell_commands b/cime_config/usermods_dirs/PLUMBER2/AU-Whr/shell_commands index 5bde37cdc7..250e8f049e 100644 --- a/cime_config/usermods_dirs/PLUMBER2/AU-Whr/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/AU-Whr/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=145.029404 ./xmlchange PTS_LAT=-36.673199 ./xmlchange DATM_YR_END=2016 +./xmlchange DATM_YR_START_FILENAME=2015 ./xmlchange START_TOD=46800 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/AU-Whr/CLM1PT_data/CTSM_DATM_AU-Whr_2015-2016.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2015" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2016" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2015" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/AU-Wrr/shell_commands b/cime_config/usermods_dirs/PLUMBER2/AU-Wrr/shell_commands index 76311551ed..c96c57a93f 100644 --- a/cime_config/usermods_dirs/PLUMBER2/AU-Wrr/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/AU-Wrr/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=146.654495 ./xmlchange PTS_LAT=-43.09502 ./xmlchange DATM_YR_END=2017 +./xmlchange DATM_YR_START_FILENAME=2016 ./xmlchange START_TOD=46800 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/AU-Wrr/CLM1PT_data/CTSM_DATM_AU-Wrr_2016-2017.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2016" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2017" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2016" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/AU-Ync/shell_commands b/cime_config/usermods_dirs/PLUMBER2/AU-Ync/shell_commands index e7c1c495fc..cc5b8909d7 100644 --- a/cime_config/usermods_dirs/PLUMBER2/AU-Ync/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/AU-Ync/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=146.290695 ./xmlchange PTS_LAT=-34.9893 ./xmlchange DATM_YR_END=2017 +./xmlchange DATM_YR_START_FILENAME=2011 ./xmlchange START_TOD=46800 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/AU-Ync/CLM1PT_data/CTSM_DATM_AU-Ync_2011-2017.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2011" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2017" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2011" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/BE-Bra/shell_commands b/cime_config/usermods_dirs/PLUMBER2/BE-Bra/shell_commands index 4cb0c5af5c..93bf56051e 100644 --- a/cime_config/usermods_dirs/PLUMBER2/BE-Bra/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/BE-Bra/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=4.52056 ./xmlchange PTS_LAT=51.309166 ./xmlchange DATM_YR_END=2014 +./xmlchange DATM_YR_START_FILENAME=2004 ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/BE-Bra/CLM1PT_data/CTSM_DATM_BE-Bra_2004-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2004" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2004" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/BE-Lon/shell_commands b/cime_config/usermods_dirs/PLUMBER2/BE-Lon/shell_commands index 5ce5a904f5..597961e426 100644 --- a/cime_config/usermods_dirs/PLUMBER2/BE-Lon/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/BE-Lon/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=4.74613 ./xmlchange PTS_LAT=50.55159 ./xmlchange DATM_YR_END=2014 +./xmlchange DATM_YR_START_FILENAME=2005 ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/BE-Lon/CLM1PT_data/CTSM_DATM_BE-Lon_2005-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2005" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2005" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/BE-Vie/shell_commands b/cime_config/usermods_dirs/PLUMBER2/BE-Vie/shell_commands index 0e4e802d91..2a97262b87 100644 --- a/cime_config/usermods_dirs/PLUMBER2/BE-Vie/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/BE-Vie/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=5.99805 ./xmlchange PTS_LAT=50.305069 ./xmlchange DATM_YR_END=2014 +./xmlchange DATM_YR_START_FILENAME=1997 ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/BE-Vie/CLM1PT_data/CTSM_DATM_BE-Vie_1997-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=1997" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=1997" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/BR-Sa3/shell_commands b/cime_config/usermods_dirs/PLUMBER2/BR-Sa3/shell_commands index 114becfc06..ec8d9bc33a 100644 --- a/cime_config/usermods_dirs/PLUMBER2/BR-Sa3/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/BR-Sa3/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=-54.971436 ./xmlchange PTS_LAT=-3.018029 ./xmlchange DATM_YR_END=2003 +./xmlchange DATM_YR_START_FILENAME=2001 ./xmlchange START_TOD=14400 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/BR-Sa3/CLM1PT_data/CTSM_DATM_BR-Sa3_2001-2003.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2001" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2003" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2001" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/BW-Ma1/shell_commands b/cime_config/usermods_dirs/PLUMBER2/BW-Ma1/shell_commands index 7d0681f988..64af7dc90f 100644 --- a/cime_config/usermods_dirs/PLUMBER2/BW-Ma1/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/BW-Ma1/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=23.560329 ./xmlchange PTS_LAT=-19.9165 ./xmlchange DATM_YR_END=2000 +./xmlchange DATM_YR_START_FILENAME=2000 ./xmlchange START_TOD=79200 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/BW-Ma1/CLM1PT_data/CTSM_DATM_BW-Ma1_2000-2000.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2000" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2000" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2000" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/CA-NS1/shell_commands b/cime_config/usermods_dirs/PLUMBER2/CA-NS1/shell_commands index 47f8762dca..9b4f8d74ec 100644 --- a/cime_config/usermods_dirs/PLUMBER2/CA-NS1/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/CA-NS1/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=-98.483887 ./xmlchange PTS_LAT=55.8792 ./xmlchange DATM_YR_END=2003 +./xmlchange DATM_YR_START_FILENAME=2003 ./xmlchange START_TOD=21600 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/CA-NS1/CLM1PT_data/CTSM_DATM_CA-NS1_2003-2003.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2003" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2003" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2003" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/CA-NS2/shell_commands b/cime_config/usermods_dirs/PLUMBER2/CA-NS2/shell_commands index c787c85af0..5563971afc 100644 --- a/cime_config/usermods_dirs/PLUMBER2/CA-NS2/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/CA-NS2/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=-98.524689 ./xmlchange PTS_LAT=55.9058 ./xmlchange DATM_YR_END=2004 +./xmlchange DATM_YR_START_FILENAME=2002 ./xmlchange START_TOD=21600 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/CA-NS2/CLM1PT_data/CTSM_DATM_CA-NS2_2002-2004.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2002" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2004" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2002" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/CA-NS4/shell_commands b/cime_config/usermods_dirs/PLUMBER2/CA-NS4/shell_commands index 5e4247d5ee..d6ddd551af 100644 --- a/cime_config/usermods_dirs/PLUMBER2/CA-NS4/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/CA-NS4/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=-98.380615 ./xmlchange PTS_LAT=55.914398 ./xmlchange DATM_YR_END=2004 +./xmlchange DATM_YR_START_FILENAME=2003 ./xmlchange START_TOD=21600 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/CA-NS4/CLM1PT_data/CTSM_DATM_CA-NS4_2003-2004.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2003" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2004" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2003" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/CA-NS5/shell_commands b/cime_config/usermods_dirs/PLUMBER2/CA-NS5/shell_commands index bddbef5bb3..49a320a37d 100644 --- a/cime_config/usermods_dirs/PLUMBER2/CA-NS5/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/CA-NS5/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=-98.484985 ./xmlchange PTS_LAT=55.863098 ./xmlchange DATM_YR_END=2004 +./xmlchange DATM_YR_START_FILENAME=2003 ./xmlchange START_TOD=21600 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/CA-NS5/CLM1PT_data/CTSM_DATM_CA-NS5_2003-2004.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2003" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2004" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2003" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/CA-NS6/shell_commands b/cime_config/usermods_dirs/PLUMBER2/CA-NS6/shell_commands index 908a798b98..c5097e87ec 100644 --- a/cime_config/usermods_dirs/PLUMBER2/CA-NS6/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/CA-NS6/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=-98.964417 ./xmlchange PTS_LAT=55.916698 ./xmlchange DATM_YR_END=2004 +./xmlchange DATM_YR_START_FILENAME=2002 ./xmlchange START_TOD=21600 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/CA-NS6/CLM1PT_data/CTSM_DATM_CA-NS6_2002-2004.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2002" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2004" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2002" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/CA-NS7/shell_commands b/cime_config/usermods_dirs/PLUMBER2/CA-NS7/shell_commands index 5734053c2b..583c102ae0 100644 --- a/cime_config/usermods_dirs/PLUMBER2/CA-NS7/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/CA-NS7/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=-99.948303 ./xmlchange PTS_LAT=56.635799 ./xmlchange DATM_YR_END=2004 +./xmlchange DATM_YR_START_FILENAME=2003 ./xmlchange START_TOD=21600 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/CA-NS7/CLM1PT_data/CTSM_DATM_CA-NS7_2003-2004.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2003" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2004" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2003" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/CA-Qcu/shell_commands b/cime_config/usermods_dirs/PLUMBER2/CA-Qcu/shell_commands index b68de255cb..892029da56 100644 --- a/cime_config/usermods_dirs/PLUMBER2/CA-Qcu/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/CA-Qcu/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=-74.03653 ./xmlchange PTS_LAT=49.267078 ./xmlchange DATM_YR_END=2006 +./xmlchange DATM_YR_START_FILENAME=2002 ./xmlchange START_TOD=18000 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/CA-Qcu/CLM1PT_data/CTSM_DATM_CA-Qcu_2002-2006.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2002" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2006" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2002" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/CA-Qfo/shell_commands b/cime_config/usermods_dirs/PLUMBER2/CA-Qfo/shell_commands index 8829dfb112..3f61fbd901 100644 --- a/cime_config/usermods_dirs/PLUMBER2/CA-Qfo/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/CA-Qfo/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=-74.342102 ./xmlchange PTS_LAT=49.692501 ./xmlchange DATM_YR_END=2010 +./xmlchange DATM_YR_START_FILENAME=2004 ./xmlchange START_TOD=18000 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/CA-Qfo/CLM1PT_data/CTSM_DATM_CA-Qfo_2004-2010.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2004" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2010" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2004" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/CA-SF1/shell_commands b/cime_config/usermods_dirs/PLUMBER2/CA-SF1/shell_commands index f227bbb636..49de04986c 100644 --- a/cime_config/usermods_dirs/PLUMBER2/CA-SF1/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/CA-SF1/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=-105.817596 ./xmlchange PTS_LAT=54.485001 ./xmlchange DATM_YR_END=2006 +./xmlchange DATM_YR_START_FILENAME=2004 ./xmlchange START_TOD=21600 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/CA-SF1/CLM1PT_data/CTSM_DATM_CA-SF1_2004-2006.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2004" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2006" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2004" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/CA-SF2/shell_commands b/cime_config/usermods_dirs/PLUMBER2/CA-SF2/shell_commands index 8083656498..5cc0da8be1 100644 --- a/cime_config/usermods_dirs/PLUMBER2/CA-SF2/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/CA-SF2/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=-105.877502 ./xmlchange PTS_LAT=54.253899 ./xmlchange DATM_YR_END=2005 +./xmlchange DATM_YR_START_FILENAME=2003 ./xmlchange START_TOD=21600 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/CA-SF2/CLM1PT_data/CTSM_DATM_CA-SF2_2003-2005.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2003" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2005" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2003" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/CA-SF3/shell_commands b/cime_config/usermods_dirs/PLUMBER2/CA-SF3/shell_commands index 0c48e83347..3f94c02ca9 100644 --- a/cime_config/usermods_dirs/PLUMBER2/CA-SF3/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/CA-SF3/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=-106.00531 ./xmlchange PTS_LAT=54.091599 ./xmlchange DATM_YR_END=2005 +./xmlchange DATM_YR_START_FILENAME=2003 ./xmlchange START_TOD=21600 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/CA-SF3/CLM1PT_data/CTSM_DATM_CA-SF3_2003-2005.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2003" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2005" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2003" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/CH-Cha/shell_commands b/cime_config/usermods_dirs/PLUMBER2/CH-Cha/shell_commands index 8a769f83ff..ca0ad87518 100644 --- a/cime_config/usermods_dirs/PLUMBER2/CH-Cha/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/CH-Cha/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=8.41044 ./xmlchange PTS_LAT=47.21022 ./xmlchange DATM_YR_END=2014 +./xmlchange DATM_YR_START_FILENAME=2006 ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/CH-Cha/CLM1PT_data/CTSM_DATM_CH-Cha_2006-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2006" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2006" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/CH-Dav/shell_commands b/cime_config/usermods_dirs/PLUMBER2/CH-Dav/shell_commands index 4a70829314..254c30865a 100644 --- a/cime_config/usermods_dirs/PLUMBER2/CH-Dav/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/CH-Dav/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=9.85592 ./xmlchange PTS_LAT=46.815334 ./xmlchange DATM_YR_END=2014 +./xmlchange DATM_YR_START_FILENAME=1997 ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/CH-Dav/CLM1PT_data/CTSM_DATM_CH-Dav_1997-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=1997" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=1997" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/CH-Fru/shell_commands b/cime_config/usermods_dirs/PLUMBER2/CH-Fru/shell_commands index 706c335415..617ed84d7c 100644 --- a/cime_config/usermods_dirs/PLUMBER2/CH-Fru/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/CH-Fru/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=8.53778 ./xmlchange PTS_LAT=47.115833 ./xmlchange DATM_YR_END=2014 +./xmlchange DATM_YR_START_FILENAME=2007 ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/CH-Fru/CLM1PT_data/CTSM_DATM_CH-Fru_2007-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2007" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2007" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/CH-Oe1/shell_commands b/cime_config/usermods_dirs/PLUMBER2/CH-Oe1/shell_commands index 7dacd7a573..6fb4f3a844 100644 --- a/cime_config/usermods_dirs/PLUMBER2/CH-Oe1/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/CH-Oe1/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=7.73194 ./xmlchange PTS_LAT=47.285831 ./xmlchange DATM_YR_END=2008 +./xmlchange DATM_YR_START_FILENAME=2002 ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/CH-Oe1/CLM1PT_data/CTSM_DATM_CH-Oe1_2002-2008.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2002" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2008" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2002" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/CN-Cha/shell_commands b/cime_config/usermods_dirs/PLUMBER2/CN-Cha/shell_commands index ac02990ed7..f6da50bde1 100644 --- a/cime_config/usermods_dirs/PLUMBER2/CN-Cha/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/CN-Cha/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=128.095795 ./xmlchange PTS_LAT=42.4025 ./xmlchange DATM_YR_END=2005 +./xmlchange DATM_YR_START_FILENAME=2003 ./xmlchange START_TOD=57600 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/CN-Cha/CLM1PT_data/CTSM_DATM_CN-Cha_2003-2005.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2003" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2005" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2003" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/CN-Cng/shell_commands b/cime_config/usermods_dirs/PLUMBER2/CN-Cng/shell_commands index 6e2582d175..648c844408 100644 --- a/cime_config/usermods_dirs/PLUMBER2/CN-Cng/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/CN-Cng/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=123.509201 ./xmlchange PTS_LAT=44.593399 ./xmlchange DATM_YR_END=2009 +./xmlchange DATM_YR_START_FILENAME=2008 ./xmlchange START_TOD=57600 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/CN-Cng/CLM1PT_data/CTSM_DATM_CN-Cng_2008-2009.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2008" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2009" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2008" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/CN-Dan/shell_commands b/cime_config/usermods_dirs/PLUMBER2/CN-Dan/shell_commands index 3b9c16a5f4..9616c9d792 100644 --- a/cime_config/usermods_dirs/PLUMBER2/CN-Dan/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/CN-Dan/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=91.066399 ./xmlchange PTS_LAT=30.497801 ./xmlchange DATM_YR_END=2005 +./xmlchange DATM_YR_START_FILENAME=2004 ./xmlchange START_TOD=57600 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/CN-Dan/CLM1PT_data/CTSM_DATM_CN-Dan_2004-2005.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2004" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2005" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2004" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/CN-Din/shell_commands b/cime_config/usermods_dirs/PLUMBER2/CN-Din/shell_commands index f125b585da..c30e651178 100644 --- a/cime_config/usermods_dirs/PLUMBER2/CN-Din/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/CN-Din/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=112.536102 ./xmlchange PTS_LAT=23.1733 ./xmlchange DATM_YR_END=2005 +./xmlchange DATM_YR_START_FILENAME=2003 ./xmlchange START_TOD=57600 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/CN-Din/CLM1PT_data/CTSM_DATM_CN-Din_2003-2005.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2003" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2005" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2003" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/CN-Du2/shell_commands b/cime_config/usermods_dirs/PLUMBER2/CN-Du2/shell_commands index ca85d11837..d46dec7f7d 100644 --- a/cime_config/usermods_dirs/PLUMBER2/CN-Du2/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/CN-Du2/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=116.2836 ./xmlchange PTS_LAT=42.0467 ./xmlchange DATM_YR_END=2008 +./xmlchange DATM_YR_START_FILENAME=2007 ./xmlchange START_TOD=57600 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/CN-Du2/CLM1PT_data/CTSM_DATM_CN-Du2_2007-2008.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2007" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2008" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2007" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/CN-HaM/shell_commands b/cime_config/usermods_dirs/PLUMBER2/CN-HaM/shell_commands index 8c557f6c07..91d489b75b 100644 --- a/cime_config/usermods_dirs/PLUMBER2/CN-HaM/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/CN-HaM/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=101.18 ./xmlchange PTS_LAT=37.369999 ./xmlchange DATM_YR_END=2003 +./xmlchange DATM_YR_START_FILENAME=2002 ./xmlchange START_TOD=57600 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/CN-HaM/CLM1PT_data/CTSM_DATM_CN-HaM_2002-2003.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2002" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2003" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2002" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/CN-Qia/shell_commands b/cime_config/usermods_dirs/PLUMBER2/CN-Qia/shell_commands index c0599132ef..484175aa93 100644 --- a/cime_config/usermods_dirs/PLUMBER2/CN-Qia/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/CN-Qia/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=115.058098 ./xmlchange PTS_LAT=26.7414 ./xmlchange DATM_YR_END=2005 +./xmlchange DATM_YR_START_FILENAME=2003 ./xmlchange START_TOD=57600 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/CN-Qia/CLM1PT_data/CTSM_DATM_CN-Qia_2003-2005.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2003" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2005" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2003" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/CZ-wet/shell_commands b/cime_config/usermods_dirs/PLUMBER2/CZ-wet/shell_commands index d0ee8f1b57..7c753c4183 100644 --- a/cime_config/usermods_dirs/PLUMBER2/CZ-wet/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/CZ-wet/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=14.77035 ./xmlchange PTS_LAT=49.024651 ./xmlchange DATM_YR_END=2014 +./xmlchange DATM_YR_START_FILENAME=2007 ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/CZ-wet/CLM1PT_data/CTSM_DATM_CZ-wet_2007-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2007" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2007" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/DE-Bay/shell_commands b/cime_config/usermods_dirs/PLUMBER2/DE-Bay/shell_commands index 2a0bb1ed7e..55c14aac5f 100644 --- a/cime_config/usermods_dirs/PLUMBER2/DE-Bay/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/DE-Bay/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=11.86694 ./xmlchange PTS_LAT=50.141941 ./xmlchange DATM_YR_END=1999 +./xmlchange DATM_YR_START_FILENAME=1997 ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/DE-Bay/CLM1PT_data/CTSM_DATM_DE-Bay_1997-1999.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=1997" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=1999" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=1997" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/DE-Geb/shell_commands b/cime_config/usermods_dirs/PLUMBER2/DE-Geb/shell_commands index 9e42e4029f..d57138be71 100644 --- a/cime_config/usermods_dirs/PLUMBER2/DE-Geb/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/DE-Geb/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=10.9143 ./xmlchange PTS_LAT=51.100101 ./xmlchange DATM_YR_END=2014 +./xmlchange DATM_YR_START_FILENAME=2001 ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/DE-Geb/CLM1PT_data/CTSM_DATM_DE-Geb_2001-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2001" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2001" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/DE-Gri/shell_commands b/cime_config/usermods_dirs/PLUMBER2/DE-Gri/shell_commands index 5ae694eca6..5a27ee5e20 100644 --- a/cime_config/usermods_dirs/PLUMBER2/DE-Gri/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/DE-Gri/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=13.51253 ./xmlchange PTS_LAT=50.949471 ./xmlchange DATM_YR_END=2014 +./xmlchange DATM_YR_START_FILENAME=2004 ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/DE-Gri/CLM1PT_data/CTSM_DATM_DE-Gri_2004-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2004" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2004" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/DE-Hai/shell_commands b/cime_config/usermods_dirs/PLUMBER2/DE-Hai/shell_commands index cfdacd4388..55124b7900 100644 --- a/cime_config/usermods_dirs/PLUMBER2/DE-Hai/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/DE-Hai/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=10.453 ./xmlchange PTS_LAT=51.079166 ./xmlchange DATM_YR_END=2012 +./xmlchange DATM_YR_START_FILENAME=2000 ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/DE-Hai/CLM1PT_data/CTSM_DATM_DE-Hai_2000-2012.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2000" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2012" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2000" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/DE-Kli/shell_commands b/cime_config/usermods_dirs/PLUMBER2/DE-Kli/shell_commands index 2b4760861f..860b100586 100644 --- a/cime_config/usermods_dirs/PLUMBER2/DE-Kli/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/DE-Kli/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=13.52238 ./xmlchange PTS_LAT=50.893059 ./xmlchange DATM_YR_END=2014 +./xmlchange DATM_YR_START_FILENAME=2005 ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/DE-Kli/CLM1PT_data/CTSM_DATM_DE-Kli_2005-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2005" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2005" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/DE-Meh/shell_commands b/cime_config/usermods_dirs/PLUMBER2/DE-Meh/shell_commands index ace23c6499..b94a90e206 100644 --- a/cime_config/usermods_dirs/PLUMBER2/DE-Meh/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/DE-Meh/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=10.65547 ./xmlchange PTS_LAT=51.275311 ./xmlchange DATM_YR_END=2006 +./xmlchange DATM_YR_START_FILENAME=2004 ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/DE-Meh/CLM1PT_data/CTSM_DATM_DE-Meh_2004-2006.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2004" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2006" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2004" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/DE-Obe/shell_commands b/cime_config/usermods_dirs/PLUMBER2/DE-Obe/shell_commands index 81d983ac51..e633f65987 100644 --- a/cime_config/usermods_dirs/PLUMBER2/DE-Obe/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/DE-Obe/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=13.72129 ./xmlchange PTS_LAT=50.786659 ./xmlchange DATM_YR_END=2014 +./xmlchange DATM_YR_START_FILENAME=2008 ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/DE-Obe/CLM1PT_data/CTSM_DATM_DE-Obe_2008-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2008" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2008" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/DE-Seh/shell_commands b/cime_config/usermods_dirs/PLUMBER2/DE-Seh/shell_commands index 99b14107c6..c6808b0bf1 100644 --- a/cime_config/usermods_dirs/PLUMBER2/DE-Seh/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/DE-Seh/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=6.44965 ./xmlchange PTS_LAT=50.870625 ./xmlchange DATM_YR_END=2010 +./xmlchange DATM_YR_START_FILENAME=2008 ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/DE-Seh/CLM1PT_data/CTSM_DATM_DE-Seh_2008-2010.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2008" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2010" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2008" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/DE-SfN/shell_commands b/cime_config/usermods_dirs/PLUMBER2/DE-SfN/shell_commands index 70c6009607..639a2c5195 100644 --- a/cime_config/usermods_dirs/PLUMBER2/DE-SfN/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/DE-SfN/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=11.3275 ./xmlchange PTS_LAT=47.806389 ./xmlchange DATM_YR_END=2014 +./xmlchange DATM_YR_START_FILENAME=2013 ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/DE-SfN/CLM1PT_data/CTSM_DATM_DE-SfN_2013-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2013" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2013" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/DE-Tha/shell_commands b/cime_config/usermods_dirs/PLUMBER2/DE-Tha/shell_commands index 33b2870a58..66055b2ee2 100644 --- a/cime_config/usermods_dirs/PLUMBER2/DE-Tha/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/DE-Tha/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=13.56694 ./xmlchange PTS_LAT=50.963612 ./xmlchange DATM_YR_END=2014 +./xmlchange DATM_YR_START_FILENAME=1998 ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/DE-Tha/CLM1PT_data/CTSM_DATM_DE-Tha_1998-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=1998" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=1998" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/DE-Wet/shell_commands b/cime_config/usermods_dirs/PLUMBER2/DE-Wet/shell_commands index 947d965270..de0ad17a95 100644 --- a/cime_config/usermods_dirs/PLUMBER2/DE-Wet/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/DE-Wet/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=11.45753 ./xmlchange PTS_LAT=50.453499 ./xmlchange DATM_YR_END=2006 +./xmlchange DATM_YR_START_FILENAME=2002 ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/DE-Wet/CLM1PT_data/CTSM_DATM_DE-Wet_2002-2006.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2002" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2006" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2002" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/DK-Fou/shell_commands b/cime_config/usermods_dirs/PLUMBER2/DK-Fou/shell_commands index a34d0eb77a..581fd31324 100644 --- a/cime_config/usermods_dirs/PLUMBER2/DK-Fou/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/DK-Fou/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=9.58722 ./xmlchange PTS_LAT=56.4842 ./xmlchange DATM_YR_END=2005 +./xmlchange DATM_YR_START_FILENAME=2005 ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/DK-Fou/CLM1PT_data/CTSM_DATM_DK-Fou_2005-2005.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2005" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2005" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2005" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/DK-Lva/shell_commands b/cime_config/usermods_dirs/PLUMBER2/DK-Lva/shell_commands index 06f512c753..b1a1955519 100644 --- a/cime_config/usermods_dirs/PLUMBER2/DK-Lva/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/DK-Lva/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=12.0833 ./xmlchange PTS_LAT=55.6833 ./xmlchange DATM_YR_END=2006 +./xmlchange DATM_YR_START_FILENAME=2005 ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/DK-Lva/CLM1PT_data/CTSM_DATM_DK-Lva_2005-2006.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2005" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2006" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2005" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/DK-Ris/shell_commands b/cime_config/usermods_dirs/PLUMBER2/DK-Ris/shell_commands index bb2be42089..86fcb0ba10 100644 --- a/cime_config/usermods_dirs/PLUMBER2/DK-Ris/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/DK-Ris/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=12.09722 ./xmlchange PTS_LAT=55.530281 ./xmlchange DATM_YR_END=2005 +./xmlchange DATM_YR_START_FILENAME=2004 ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/DK-Ris/CLM1PT_data/CTSM_DATM_DK-Ris_2004-2005.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2004" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2005" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2004" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/DK-Sor/shell_commands b/cime_config/usermods_dirs/PLUMBER2/DK-Sor/shell_commands index efe8c0ad42..046e9559d2 100644 --- a/cime_config/usermods_dirs/PLUMBER2/DK-Sor/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/DK-Sor/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=11.64464 ./xmlchange PTS_LAT=55.48587 ./xmlchange DATM_YR_END=2014 +./xmlchange DATM_YR_START_FILENAME=1997 ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/DK-Sor/CLM1PT_data/CTSM_DATM_DK-Sor_1997-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=1997" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=1997" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/DK-ZaH/shell_commands b/cime_config/usermods_dirs/PLUMBER2/DK-ZaH/shell_commands index cca198c906..234c5e8ba7 100644 --- a/cime_config/usermods_dirs/PLUMBER2/DK-ZaH/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/DK-ZaH/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=-20.550293 ./xmlchange PTS_LAT=74.473282 ./xmlchange DATM_YR_END=2013 +./xmlchange DATM_YR_START_FILENAME=2000 ./xmlchange START_TOD=0 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/DK-ZaH/CLM1PT_data/CTSM_DATM_DK-ZaH_2000-2013.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2000" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2013" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2000" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/ES-ES1/shell_commands b/cime_config/usermods_dirs/PLUMBER2/ES-ES1/shell_commands index 9cc4725f98..9947bb0014 100644 --- a/cime_config/usermods_dirs/PLUMBER2/ES-ES1/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/ES-ES1/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=-0.318817 ./xmlchange PTS_LAT=39.34597 ./xmlchange DATM_YR_END=2006 +./xmlchange DATM_YR_START_FILENAME=1999 ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/ES-ES1/CLM1PT_data/CTSM_DATM_ES-ES1_1999-2006.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=1999" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2006" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=1999" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/ES-ES2/shell_commands b/cime_config/usermods_dirs/PLUMBER2/ES-ES2/shell_commands index 03a6ccf482..235ddfbb32 100644 --- a/cime_config/usermods_dirs/PLUMBER2/ES-ES2/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/ES-ES2/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=-0.315277 ./xmlchange PTS_LAT=39.275558 ./xmlchange DATM_YR_END=2006 +./xmlchange DATM_YR_START_FILENAME=2005 ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/ES-ES2/CLM1PT_data/CTSM_DATM_ES-ES2_2005-2006.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2005" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2006" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2005" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/ES-LMa/shell_commands b/cime_config/usermods_dirs/PLUMBER2/ES-LMa/shell_commands index f36c6be9fc..c0c83dbbd2 100644 --- a/cime_config/usermods_dirs/PLUMBER2/ES-LMa/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/ES-LMa/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=-5.773346 ./xmlchange PTS_LAT=39.941502 ./xmlchange DATM_YR_END=2006 +./xmlchange DATM_YR_START_FILENAME=2004 ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/ES-LMa/CLM1PT_data/CTSM_DATM_ES-LMa_2004-2006.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2004" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2006" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2004" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/ES-LgS/shell_commands b/cime_config/usermods_dirs/PLUMBER2/ES-LgS/shell_commands index 2a701bb99f..454de1a378 100644 --- a/cime_config/usermods_dirs/PLUMBER2/ES-LgS/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/ES-LgS/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=-2.96582 ./xmlchange PTS_LAT=37.097935 ./xmlchange DATM_YR_END=2007 +./xmlchange DATM_YR_START_FILENAME=2007 ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/ES-LgS/CLM1PT_data/CTSM_DATM_ES-LgS_2007-2007.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2007" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2007" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2007" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/ES-VDA/shell_commands b/cime_config/usermods_dirs/PLUMBER2/ES-VDA/shell_commands index e7971529d9..0de3a761a7 100644 --- a/cime_config/usermods_dirs/PLUMBER2/ES-VDA/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/ES-VDA/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=1.4485 ./xmlchange PTS_LAT=42.15218 ./xmlchange DATM_YR_END=2004 +./xmlchange DATM_YR_START_FILENAME=2004 ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/ES-VDA/CLM1PT_data/CTSM_DATM_ES-VDA_2004-2004.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2004" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2004" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2004" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/FI-Hyy/shell_commands b/cime_config/usermods_dirs/PLUMBER2/FI-Hyy/shell_commands index 7ac714599a..1861c4a0b6 100644 --- a/cime_config/usermods_dirs/PLUMBER2/FI-Hyy/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/FI-Hyy/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=24.295 ./xmlchange PTS_LAT=61.8475 ./xmlchange DATM_YR_END=2014 +./xmlchange DATM_YR_START_FILENAME=1996 ./xmlchange START_TOD=79200 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/FI-Hyy/CLM1PT_data/CTSM_DATM_FI-Hyy_1996-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=1996" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=1996" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/FI-Kaa/shell_commands b/cime_config/usermods_dirs/PLUMBER2/FI-Kaa/shell_commands index 339a244afa..9f7b8a0763 100644 --- a/cime_config/usermods_dirs/PLUMBER2/FI-Kaa/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/FI-Kaa/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=27.295031 ./xmlchange PTS_LAT=69.140694 ./xmlchange DATM_YR_END=2002 +./xmlchange DATM_YR_START_FILENAME=2000 ./xmlchange START_TOD=79200 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/FI-Kaa/CLM1PT_data/CTSM_DATM_FI-Kaa_2000-2002.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2000" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2002" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2000" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/FI-Lom/shell_commands b/cime_config/usermods_dirs/PLUMBER2/FI-Lom/shell_commands index dea60aca09..14c28c1475 100644 --- a/cime_config/usermods_dirs/PLUMBER2/FI-Lom/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/FI-Lom/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=24.209181 ./xmlchange PTS_LAT=67.9972 ./xmlchange DATM_YR_END=2009 +./xmlchange DATM_YR_START_FILENAME=2007 ./xmlchange START_TOD=79200 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/FI-Lom/CLM1PT_data/CTSM_DATM_FI-Lom_2007-2009.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2007" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2009" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2007" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/FI-Sod/shell_commands b/cime_config/usermods_dirs/PLUMBER2/FI-Sod/shell_commands index 08773c8443..7eccb754fb 100644 --- a/cime_config/usermods_dirs/PLUMBER2/FI-Sod/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/FI-Sod/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=26.637831 ./xmlchange PTS_LAT=67.361862 ./xmlchange DATM_YR_END=2014 +./xmlchange DATM_YR_START_FILENAME=2008 ./xmlchange START_TOD=79200 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/FI-Sod/CLM1PT_data/CTSM_DATM_FI-Sod_2008-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2008" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2008" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/FR-Fon/shell_commands b/cime_config/usermods_dirs/PLUMBER2/FR-Fon/shell_commands index 550ce300cd..76a71ab3b2 100644 --- a/cime_config/usermods_dirs/PLUMBER2/FR-Fon/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/FR-Fon/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=2.78014 ./xmlchange PTS_LAT=48.476398 ./xmlchange DATM_YR_END=2013 +./xmlchange DATM_YR_START_FILENAME=2005 ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/FR-Fon/CLM1PT_data/CTSM_DATM_FR-Fon_2005-2013.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2005" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2013" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2005" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/FR-Gri/shell_commands b/cime_config/usermods_dirs/PLUMBER2/FR-Gri/shell_commands index 169e85a270..5c575b0e97 100644 --- a/cime_config/usermods_dirs/PLUMBER2/FR-Gri/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/FR-Gri/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=1.95191 ./xmlchange PTS_LAT=48.844219 ./xmlchange DATM_YR_END=2013 +./xmlchange DATM_YR_START_FILENAME=2005 ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/FR-Gri/CLM1PT_data/CTSM_DATM_FR-Gri_2005-2013.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2005" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2013" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2005" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/FR-Hes/shell_commands b/cime_config/usermods_dirs/PLUMBER2/FR-Hes/shell_commands index 18a9e57b29..1d8ab25532 100644 --- a/cime_config/usermods_dirs/PLUMBER2/FR-Hes/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/FR-Hes/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=7.06556 ./xmlchange PTS_LAT=48.67416 ./xmlchange DATM_YR_END=2006 +./xmlchange DATM_YR_START_FILENAME=1997 ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/FR-Hes/CLM1PT_data/CTSM_DATM_FR-Hes_1997-2006.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=1997" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2006" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=1997" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/FR-LBr/shell_commands b/cime_config/usermods_dirs/PLUMBER2/FR-LBr/shell_commands index ee89868fa1..6b9eb48062 100644 --- a/cime_config/usermods_dirs/PLUMBER2/FR-LBr/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/FR-LBr/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=-0.769287 ./xmlchange PTS_LAT=44.71711 ./xmlchange DATM_YR_END=2008 +./xmlchange DATM_YR_START_FILENAME=2003 ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/FR-LBr/CLM1PT_data/CTSM_DATM_FR-LBr_2003-2008.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2003" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2008" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2003" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/FR-Lq1/shell_commands b/cime_config/usermods_dirs/PLUMBER2/FR-Lq1/shell_commands index c5025aba8b..000fc6d746 100644 --- a/cime_config/usermods_dirs/PLUMBER2/FR-Lq1/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/FR-Lq1/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=2.73583 ./xmlchange PTS_LAT=45.643059 ./xmlchange DATM_YR_END=2006 +./xmlchange DATM_YR_START_FILENAME=2004 ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/FR-Lq1/CLM1PT_data/CTSM_DATM_FR-Lq1_2004-2006.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2004" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2006" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2004" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/FR-Lq2/shell_commands b/cime_config/usermods_dirs/PLUMBER2/FR-Lq2/shell_commands index 26581437b9..a851919f73 100644 --- a/cime_config/usermods_dirs/PLUMBER2/FR-Lq2/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/FR-Lq2/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=2.73703 ./xmlchange PTS_LAT=45.639191 ./xmlchange DATM_YR_END=2006 +./xmlchange DATM_YR_START_FILENAME=2004 ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/FR-Lq2/CLM1PT_data/CTSM_DATM_FR-Lq2_2004-2006.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2004" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2006" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2004" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/FR-Pue/shell_commands b/cime_config/usermods_dirs/PLUMBER2/FR-Pue/shell_commands index 13fab2f770..1981d675fc 100644 --- a/cime_config/usermods_dirs/PLUMBER2/FR-Pue/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/FR-Pue/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=3.59583 ./xmlchange PTS_LAT=43.74139 ./xmlchange DATM_YR_END=2014 +./xmlchange DATM_YR_START_FILENAME=2000 ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/FR-Pue/CLM1PT_data/CTSM_DATM_FR-Pue_2000-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2000" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2000" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/GF-Guy/shell_commands b/cime_config/usermods_dirs/PLUMBER2/GF-Guy/shell_commands index bafc0737b8..1f10f4a2e1 100644 --- a/cime_config/usermods_dirs/PLUMBER2/GF-Guy/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/GF-Guy/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=-52.924866 ./xmlchange PTS_LAT=5.278772 ./xmlchange DATM_YR_END=2014 +./xmlchange DATM_YR_START_FILENAME=2004 ./xmlchange START_TOD=10800 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/GF-Guy/CLM1PT_data/CTSM_DATM_GF-Guy_2004-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2004" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2004" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/HU-Bug/shell_commands b/cime_config/usermods_dirs/PLUMBER2/HU-Bug/shell_commands index 98e5672dc2..54b635a2a2 100644 --- a/cime_config/usermods_dirs/PLUMBER2/HU-Bug/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/HU-Bug/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=19.601299 ./xmlchange PTS_LAT=46.691101 ./xmlchange DATM_YR_END=2006 +./xmlchange DATM_YR_START_FILENAME=2003 ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/HU-Bug/CLM1PT_data/CTSM_DATM_HU-Bug_2003-2006.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2003" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2006" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2003" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/ID-Pag/shell_commands b/cime_config/usermods_dirs/PLUMBER2/ID-Pag/shell_commands index a71ecdf659..13ac0e386f 100644 --- a/cime_config/usermods_dirs/PLUMBER2/ID-Pag/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/ID-Pag/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=114.036392 ./xmlchange PTS_LAT=-2.345 ./xmlchange DATM_YR_END=2003 +./xmlchange DATM_YR_START_FILENAME=2002 ./xmlchange START_TOD=61200 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/ID-Pag/CLM1PT_data/CTSM_DATM_ID-Pag_2002-2003.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2002" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2003" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2002" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/IE-Ca1/shell_commands b/cime_config/usermods_dirs/PLUMBER2/IE-Ca1/shell_commands index 98d668df9e..2bd80343c3 100644 --- a/cime_config/usermods_dirs/PLUMBER2/IE-Ca1/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/IE-Ca1/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=-6.918152 ./xmlchange PTS_LAT=52.858791 ./xmlchange DATM_YR_END=2006 +./xmlchange DATM_YR_START_FILENAME=2004 ./xmlchange START_TOD=0 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/IE-Ca1/CLM1PT_data/CTSM_DATM_IE-Ca1_2004-2006.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2004" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2006" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2004" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/IE-Dri/shell_commands b/cime_config/usermods_dirs/PLUMBER2/IE-Dri/shell_commands index edb036e775..4f27411509 100644 --- a/cime_config/usermods_dirs/PLUMBER2/IE-Dri/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/IE-Dri/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=-8.751801 ./xmlchange PTS_LAT=51.986691 ./xmlchange DATM_YR_END=2005 +./xmlchange DATM_YR_START_FILENAME=2003 ./xmlchange START_TOD=0 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/IE-Dri/CLM1PT_data/CTSM_DATM_IE-Dri_2003-2005.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2003" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2005" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2003" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/IT-Amp/shell_commands b/cime_config/usermods_dirs/PLUMBER2/IT-Amp/shell_commands index 3a4195c030..aa7fef51ae 100644 --- a/cime_config/usermods_dirs/PLUMBER2/IT-Amp/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/IT-Amp/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=13.60516 ./xmlchange PTS_LAT=41.904099 ./xmlchange DATM_YR_END=2006 +./xmlchange DATM_YR_START_FILENAME=2003 ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/IT-Amp/CLM1PT_data/CTSM_DATM_IT-Amp_2003-2006.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2003" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2006" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2003" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/IT-BCi/shell_commands b/cime_config/usermods_dirs/PLUMBER2/IT-BCi/shell_commands index ada711ab6e..0c620a348c 100644 --- a/cime_config/usermods_dirs/PLUMBER2/IT-BCi/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/IT-BCi/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=14.95744 ./xmlchange PTS_LAT=40.5238 ./xmlchange DATM_YR_END=2010 +./xmlchange DATM_YR_START_FILENAME=2005 ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/IT-BCi/CLM1PT_data/CTSM_DATM_IT-BCi_2005-2010.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2005" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2010" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2005" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/IT-CA1/shell_commands b/cime_config/usermods_dirs/PLUMBER2/IT-CA1/shell_commands index 9ff3031f4d..831b7897c0 100644 --- a/cime_config/usermods_dirs/PLUMBER2/IT-CA1/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/IT-CA1/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=12.02656 ./xmlchange PTS_LAT=42.380409 ./xmlchange DATM_YR_END=2013 +./xmlchange DATM_YR_START_FILENAME=2012 ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/IT-CA1/CLM1PT_data/CTSM_DATM_IT-CA1_2012-2013.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2012" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2013" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2012" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/IT-CA2/shell_commands b/cime_config/usermods_dirs/PLUMBER2/IT-CA2/shell_commands index 2041d6983d..dfae27f215 100644 --- a/cime_config/usermods_dirs/PLUMBER2/IT-CA2/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/IT-CA2/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=12.02604 ./xmlchange PTS_LAT=42.37722 ./xmlchange DATM_YR_END=2013 +./xmlchange DATM_YR_START_FILENAME=2012 ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/IT-CA2/CLM1PT_data/CTSM_DATM_IT-CA2_2012-2013.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2012" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2013" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2012" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/IT-CA3/shell_commands b/cime_config/usermods_dirs/PLUMBER2/IT-CA3/shell_commands index 50253ccc6b..a3a2ab6c25 100644 --- a/cime_config/usermods_dirs/PLUMBER2/IT-CA3/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/IT-CA3/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=12.0222 ./xmlchange PTS_LAT=42.380001 ./xmlchange DATM_YR_END=2013 +./xmlchange DATM_YR_START_FILENAME=2012 ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/IT-CA3/CLM1PT_data/CTSM_DATM_IT-CA3_2012-2013.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2012" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2013" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2012" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/IT-Col/shell_commands b/cime_config/usermods_dirs/PLUMBER2/IT-Col/shell_commands index 06e653c0b9..eb817ab43c 100644 --- a/cime_config/usermods_dirs/PLUMBER2/IT-Col/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/IT-Col/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=13.58814 ./xmlchange PTS_LAT=41.849361 ./xmlchange DATM_YR_END=2014 +./xmlchange DATM_YR_START_FILENAME=2007 ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/IT-Col/CLM1PT_data/CTSM_DATM_IT-Col_2007-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2007" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2007" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/IT-Cpz/shell_commands b/cime_config/usermods_dirs/PLUMBER2/IT-Cpz/shell_commands index b7b1ae449d..cfad8adb35 100644 --- a/cime_config/usermods_dirs/PLUMBER2/IT-Cpz/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/IT-Cpz/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=12.37611 ./xmlchange PTS_LAT=41.70525 ./xmlchange DATM_YR_END=2008 +./xmlchange DATM_YR_START_FILENAME=2001 ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/IT-Cpz/CLM1PT_data/CTSM_DATM_IT-Cpz_2001-2008.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2001" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2008" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2001" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/IT-Isp/shell_commands b/cime_config/usermods_dirs/PLUMBER2/IT-Isp/shell_commands index 873293a7aa..125257acd7 100644 --- a/cime_config/usermods_dirs/PLUMBER2/IT-Isp/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/IT-Isp/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=8.63358 ./xmlchange PTS_LAT=45.812641 ./xmlchange DATM_YR_END=2014 +./xmlchange DATM_YR_START_FILENAME=2013 ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/IT-Isp/CLM1PT_data/CTSM_DATM_IT-Isp_2013-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2013" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2013" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/IT-LMa/shell_commands b/cime_config/usermods_dirs/PLUMBER2/IT-LMa/shell_commands index b8efb6955e..bca26018b9 100644 --- a/cime_config/usermods_dirs/PLUMBER2/IT-LMa/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/IT-LMa/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=7.58259 ./xmlchange PTS_LAT=45.15258 ./xmlchange DATM_YR_END=2004 +./xmlchange DATM_YR_START_FILENAME=2003 ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/IT-LMa/CLM1PT_data/CTSM_DATM_IT-LMa_2003-2004.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2003" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2004" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2003" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/IT-Lav/shell_commands b/cime_config/usermods_dirs/PLUMBER2/IT-Lav/shell_commands index a50e9dc664..87f8e9d947 100644 --- a/cime_config/usermods_dirs/PLUMBER2/IT-Lav/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/IT-Lav/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=11.28132 ./xmlchange PTS_LAT=45.9562 ./xmlchange DATM_YR_END=2014 +./xmlchange DATM_YR_START_FILENAME=2005 ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/IT-Lav/CLM1PT_data/CTSM_DATM_IT-Lav_2005-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2005" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2005" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/IT-MBo/shell_commands b/cime_config/usermods_dirs/PLUMBER2/IT-MBo/shell_commands index 0c60de60ba..ab42d7a3d8 100644 --- a/cime_config/usermods_dirs/PLUMBER2/IT-MBo/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/IT-MBo/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=11.04583 ./xmlchange PTS_LAT=46.014679 ./xmlchange DATM_YR_END=2012 +./xmlchange DATM_YR_START_FILENAME=2003 ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/IT-MBo/CLM1PT_data/CTSM_DATM_IT-MBo_2003-2012.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2003" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2012" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2003" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/IT-Mal/shell_commands b/cime_config/usermods_dirs/PLUMBER2/IT-Mal/shell_commands index 34c3d12aa2..8cf5fdd6d0 100644 --- a/cime_config/usermods_dirs/PLUMBER2/IT-Mal/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/IT-Mal/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=11.70334 ./xmlchange PTS_LAT=46.114021 ./xmlchange DATM_YR_END=2003 +./xmlchange DATM_YR_START_FILENAME=2003 ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/IT-Mal/CLM1PT_data/CTSM_DATM_IT-Mal_2003-2003.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2003" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2003" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2003" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/IT-Noe/shell_commands b/cime_config/usermods_dirs/PLUMBER2/IT-Noe/shell_commands index bd8d0e486c..8b12cb84db 100644 --- a/cime_config/usermods_dirs/PLUMBER2/IT-Noe/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/IT-Noe/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=8.15117 ./xmlchange PTS_LAT=40.606178 ./xmlchange DATM_YR_END=2014 +./xmlchange DATM_YR_START_FILENAME=2004 ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/IT-Noe/CLM1PT_data/CTSM_DATM_IT-Noe_2004-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2004" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2004" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/IT-Non/shell_commands b/cime_config/usermods_dirs/PLUMBER2/IT-Non/shell_commands index 3084a49d8a..c8b4f77f4d 100644 --- a/cime_config/usermods_dirs/PLUMBER2/IT-Non/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/IT-Non/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=11.09109 ./xmlchange PTS_LAT=44.690189 ./xmlchange DATM_YR_END=2002 +./xmlchange DATM_YR_START_FILENAME=2002 ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/IT-Non/CLM1PT_data/CTSM_DATM_IT-Non_2002-2002.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2002" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2002" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2002" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/IT-PT1/shell_commands b/cime_config/usermods_dirs/PLUMBER2/IT-PT1/shell_commands index f82e0b8eb9..629382cea8 100644 --- a/cime_config/usermods_dirs/PLUMBER2/IT-PT1/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/IT-PT1/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=9.06104 ./xmlchange PTS_LAT=45.200871 ./xmlchange DATM_YR_END=2004 +./xmlchange DATM_YR_START_FILENAME=2003 ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/IT-PT1/CLM1PT_data/CTSM_DATM_IT-PT1_2003-2004.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2003" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2004" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2003" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/IT-Ren/shell_commands b/cime_config/usermods_dirs/PLUMBER2/IT-Ren/shell_commands index 80927456e8..ebf7cdb500 100644 --- a/cime_config/usermods_dirs/PLUMBER2/IT-Ren/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/IT-Ren/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=11.43369 ./xmlchange PTS_LAT=46.586861 ./xmlchange DATM_YR_END=2013 +./xmlchange DATM_YR_START_FILENAME=2010 ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/IT-Ren/CLM1PT_data/CTSM_DATM_IT-Ren_2010-2013.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2010" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2013" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2010" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/IT-Ro1/shell_commands b/cime_config/usermods_dirs/PLUMBER2/IT-Ro1/shell_commands index 209a0c032d..b400216f9b 100644 --- a/cime_config/usermods_dirs/PLUMBER2/IT-Ro1/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/IT-Ro1/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=11.93001 ./xmlchange PTS_LAT=42.408119 ./xmlchange DATM_YR_END=2006 +./xmlchange DATM_YR_START_FILENAME=2002 ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/IT-Ro1/CLM1PT_data/CTSM_DATM_IT-Ro1_2002-2006.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2002" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2006" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2002" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/IT-Ro2/shell_commands b/cime_config/usermods_dirs/PLUMBER2/IT-Ro2/shell_commands index 55e5f4f128..195c0fdbc9 100644 --- a/cime_config/usermods_dirs/PLUMBER2/IT-Ro2/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/IT-Ro2/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=11.92093 ./xmlchange PTS_LAT=42.390259 ./xmlchange DATM_YR_END=2008 +./xmlchange DATM_YR_START_FILENAME=2002 ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/IT-Ro2/CLM1PT_data/CTSM_DATM_IT-Ro2_2002-2008.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2002" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2008" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2002" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/IT-SR2/shell_commands b/cime_config/usermods_dirs/PLUMBER2/IT-SR2/shell_commands index bd1211a9c7..d981029a77 100644 --- a/cime_config/usermods_dirs/PLUMBER2/IT-SR2/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/IT-SR2/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=10.29095 ./xmlchange PTS_LAT=43.732029 ./xmlchange DATM_YR_END=2014 +./xmlchange DATM_YR_START_FILENAME=2013 ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/IT-SR2/CLM1PT_data/CTSM_DATM_IT-SR2_2013-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2013" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2013" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/IT-SRo/shell_commands b/cime_config/usermods_dirs/PLUMBER2/IT-SRo/shell_commands index a0aa3f3aa5..c40b2d8f71 100644 --- a/cime_config/usermods_dirs/PLUMBER2/IT-SRo/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/IT-SRo/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=10.28444 ./xmlchange PTS_LAT=43.727859 ./xmlchange DATM_YR_END=2012 +./xmlchange DATM_YR_START_FILENAME=2003 ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/IT-SRo/CLM1PT_data/CTSM_DATM_IT-SRo_2003-2012.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2003" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2012" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2003" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/JP-SMF/shell_commands b/cime_config/usermods_dirs/PLUMBER2/JP-SMF/shell_commands index 17be0e9534..c93dfef557 100644 --- a/cime_config/usermods_dirs/PLUMBER2/JP-SMF/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/JP-SMF/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=137.078796 ./xmlchange PTS_LAT=35.2617 ./xmlchange DATM_YR_END=2006 +./xmlchange DATM_YR_START_FILENAME=2003 ./xmlchange START_TOD=54000 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/JP-SMF/CLM1PT_data/CTSM_DATM_JP-SMF_2003-2006.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2003" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2006" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2003" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/NL-Ca1/shell_commands b/cime_config/usermods_dirs/PLUMBER2/NL-Ca1/shell_commands index fd82f6a049..ccb1290e78 100644 --- a/cime_config/usermods_dirs/PLUMBER2/NL-Ca1/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/NL-Ca1/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=4.927 ./xmlchange PTS_LAT=51.971001 ./xmlchange DATM_YR_END=2006 +./xmlchange DATM_YR_START_FILENAME=2003 ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/NL-Ca1/CLM1PT_data/CTSM_DATM_NL-Ca1_2003-2006.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2003" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2006" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2003" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/NL-Hor/shell_commands b/cime_config/usermods_dirs/PLUMBER2/NL-Hor/shell_commands index e4712093fa..08eb58d8a1 100644 --- a/cime_config/usermods_dirs/PLUMBER2/NL-Hor/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/NL-Hor/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=5.0713 ./xmlchange PTS_LAT=52.240349 ./xmlchange DATM_YR_END=2011 +./xmlchange DATM_YR_START_FILENAME=2008 ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/NL-Hor/CLM1PT_data/CTSM_DATM_NL-Hor_2008-2011.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2008" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2011" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2008" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/NL-Loo/shell_commands b/cime_config/usermods_dirs/PLUMBER2/NL-Loo/shell_commands index d825ace2ba..a09cf39408 100644 --- a/cime_config/usermods_dirs/PLUMBER2/NL-Loo/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/NL-Loo/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=5.74356 ./xmlchange PTS_LAT=52.16658 ./xmlchange DATM_YR_END=2013 +./xmlchange DATM_YR_START_FILENAME=1997 ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/NL-Loo/CLM1PT_data/CTSM_DATM_NL-Loo_1997-2013.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=1997" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2013" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=1997" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/PL-wet/shell_commands b/cime_config/usermods_dirs/PLUMBER2/PL-wet/shell_commands index 80bb1b37c5..eb79334eeb 100644 --- a/cime_config/usermods_dirs/PLUMBER2/PL-wet/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/PL-wet/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=16.309401 ./xmlchange PTS_LAT=52.762199 ./xmlchange DATM_YR_END=2005 +./xmlchange DATM_YR_START_FILENAME=2004 ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/PL-wet/CLM1PT_data/CTSM_DATM_PL-wet_2004-2005.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2004" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2005" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2004" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/PT-Esp/shell_commands b/cime_config/usermods_dirs/PLUMBER2/PT-Esp/shell_commands index b56b6968f1..4186dea491 100644 --- a/cime_config/usermods_dirs/PLUMBER2/PT-Esp/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/PT-Esp/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=-8.601807 ./xmlchange PTS_LAT=38.6394 ./xmlchange DATM_YR_END=2004 +./xmlchange DATM_YR_START_FILENAME=2002 ./xmlchange START_TOD=0 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/PT-Esp/CLM1PT_data/CTSM_DATM_PT-Esp_2002-2004.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2002" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2004" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2002" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/PT-Mi1/shell_commands b/cime_config/usermods_dirs/PLUMBER2/PT-Mi1/shell_commands index 2d35f26a06..36a1899bfc 100644 --- a/cime_config/usermods_dirs/PLUMBER2/PT-Mi1/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/PT-Mi1/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=-8.000061 ./xmlchange PTS_LAT=38.540642 ./xmlchange DATM_YR_END=2005 +./xmlchange DATM_YR_START_FILENAME=2005 ./xmlchange START_TOD=0 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/PT-Mi1/CLM1PT_data/CTSM_DATM_PT-Mi1_2005-2005.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2005" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2005" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2005" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/PT-Mi2/shell_commands b/cime_config/usermods_dirs/PLUMBER2/PT-Mi2/shell_commands index b02616ee02..e2986dfac8 100644 --- a/cime_config/usermods_dirs/PLUMBER2/PT-Mi2/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/PT-Mi2/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=-8.024536 ./xmlchange PTS_LAT=38.476501 ./xmlchange DATM_YR_END=2006 +./xmlchange DATM_YR_START_FILENAME=2005 ./xmlchange START_TOD=0 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/PT-Mi2/CLM1PT_data/CTSM_DATM_PT-Mi2_2005-2006.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2005" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2006" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2005" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/RU-Che/shell_commands b/cime_config/usermods_dirs/PLUMBER2/RU-Che/shell_commands index dff0478e08..f5172ddb53 100644 --- a/cime_config/usermods_dirs/PLUMBER2/RU-Che/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/RU-Che/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=161.341431 ./xmlchange PTS_LAT=68.613037 ./xmlchange DATM_YR_END=2004 +./xmlchange DATM_YR_START_FILENAME=2003 ./xmlchange START_TOD=46800 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/RU-Che/CLM1PT_data/CTSM_DATM_RU-Che_2003-2004.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2003" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2004" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2003" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/RU-Fyo/shell_commands b/cime_config/usermods_dirs/PLUMBER2/RU-Fyo/shell_commands index d90a4af0bc..69bab319bc 100644 --- a/cime_config/usermods_dirs/PLUMBER2/RU-Fyo/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/RU-Fyo/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=32.922081 ./xmlchange PTS_LAT=56.461529 ./xmlchange DATM_YR_END=2014 +./xmlchange DATM_YR_START_FILENAME=2003 ./xmlchange START_TOD=75600 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/RU-Fyo/CLM1PT_data/CTSM_DATM_RU-Fyo_2003-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2003" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2003" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/RU-Zot/shell_commands b/cime_config/usermods_dirs/PLUMBER2/RU-Zot/shell_commands index 1d42ea947f..27144db3cb 100644 --- a/cime_config/usermods_dirs/PLUMBER2/RU-Zot/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/RU-Zot/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=89.3508 ./xmlchange PTS_LAT=60.8008 ./xmlchange DATM_YR_END=2003 +./xmlchange DATM_YR_START_FILENAME=2003 ./xmlchange START_TOD=61200 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/RU-Zot/CLM1PT_data/CTSM_DATM_RU-Zot_2003-2003.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2003" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2003" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2003" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/SD-Dem/shell_commands b/cime_config/usermods_dirs/PLUMBER2/SD-Dem/shell_commands index 2b471ebc27..6d245703d6 100644 --- a/cime_config/usermods_dirs/PLUMBER2/SD-Dem/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/SD-Dem/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=30.4783 ./xmlchange PTS_LAT=13.2829 ./xmlchange DATM_YR_END=2009 +./xmlchange DATM_YR_START_FILENAME=2005 ./xmlchange START_TOD=75600 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/SD-Dem/CLM1PT_data/CTSM_DATM_SD-Dem_2005-2009.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2005" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2009" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2005" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/SE-Deg/shell_commands b/cime_config/usermods_dirs/PLUMBER2/SE-Deg/shell_commands index 34a53f5533..0a426dee38 100644 --- a/cime_config/usermods_dirs/PLUMBER2/SE-Deg/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/SE-Deg/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=19.55669 ./xmlchange PTS_LAT=64.181969 ./xmlchange DATM_YR_END=2005 +./xmlchange DATM_YR_START_FILENAME=2002 ./xmlchange START_TOD=82800 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/SE-Deg/CLM1PT_data/CTSM_DATM_SE-Deg_2002-2005.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2002" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2005" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2002" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/UK-Gri/shell_commands b/cime_config/usermods_dirs/PLUMBER2/UK-Gri/shell_commands index 6cd7cb38f4..c016bf89a7 100644 --- a/cime_config/usermods_dirs/PLUMBER2/UK-Gri/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/UK-Gri/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=-3.798065 ./xmlchange PTS_LAT=56.60722 ./xmlchange DATM_YR_END=2001 +./xmlchange DATM_YR_START_FILENAME=2000 ./xmlchange START_TOD=0 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/UK-Gri/CLM1PT_data/CTSM_DATM_UK-Gri_2000-2001.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2000" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2001" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2000" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/UK-Ham/shell_commands b/cime_config/usermods_dirs/PLUMBER2/UK-Ham/shell_commands index 6d83e07c57..f92b9a6d69 100644 --- a/cime_config/usermods_dirs/PLUMBER2/UK-Ham/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/UK-Ham/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=-0.858307 ./xmlchange PTS_LAT=51.15353 ./xmlchange DATM_YR_END=2004 +./xmlchange DATM_YR_START_FILENAME=2004 ./xmlchange START_TOD=0 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/UK-Ham/CLM1PT_data/CTSM_DATM_UK-Ham_2004-2004.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2004" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2004" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2004" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/UK-PL3/shell_commands b/cime_config/usermods_dirs/PLUMBER2/UK-PL3/shell_commands index 4237f25d27..10b82dee40 100644 --- a/cime_config/usermods_dirs/PLUMBER2/UK-PL3/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/UK-PL3/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=-1.266663 ./xmlchange PTS_LAT=51.450001 ./xmlchange DATM_YR_END=2006 +./xmlchange DATM_YR_START_FILENAME=2005 ./xmlchange START_TOD=0 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/UK-PL3/CLM1PT_data/CTSM_DATM_UK-PL3_2005-2006.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2005" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2006" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2005" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-AR1/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-AR1/shell_commands index 1f32b6d98c..8b3bb18871 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-AR1/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-AR1/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=-99.419983 ./xmlchange PTS_LAT=36.426701 ./xmlchange DATM_YR_END=2012 +./xmlchange DATM_YR_START_FILENAME=2010 ./xmlchange START_TOD=21600 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-AR1/CLM1PT_data/CTSM_DATM_US-AR1_2010-2012.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2010" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2012" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2010" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-AR2/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-AR2/shell_commands index 7e436a547c..0eeaef4fe2 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-AR2/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-AR2/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=-99.597504 ./xmlchange PTS_LAT=36.635799 ./xmlchange DATM_YR_END=2011 +./xmlchange DATM_YR_START_FILENAME=2010 ./xmlchange START_TOD=21600 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-AR2/CLM1PT_data/CTSM_DATM_US-AR2_2010-2011.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2010" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2011" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2010" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-ARM/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-ARM/shell_commands index 1a0fd06c8b..4045912f3c 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-ARM/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-ARM/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=-97.4888 ./xmlchange PTS_LAT=36.605801 ./xmlchange DATM_YR_END=2012 +./xmlchange DATM_YR_START_FILENAME=2003 ./xmlchange START_TOD=21600 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-ARM/CLM1PT_data/CTSM_DATM_US-ARM_2003-2012.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2003" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2012" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2003" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-Aud/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-Aud/shell_commands index 9ab42347b2..043730b19e 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-Aud/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-Aud/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=-110.509201 ./xmlchange PTS_LAT=31.5907 ./xmlchange DATM_YR_END=2005 +./xmlchange DATM_YR_START_FILENAME=2003 ./xmlchange START_TOD=25200 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-Aud/CLM1PT_data/CTSM_DATM_US-Aud_2003-2005.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2003" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2005" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2003" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-Bar/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-Bar/shell_commands index 81591a2454..4fb0562433 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-Bar/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-Bar/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=-71.288086 ./xmlchange PTS_LAT=44.06464 ./xmlchange DATM_YR_END=2005 +./xmlchange DATM_YR_START_FILENAME=2005 ./xmlchange START_TOD=18000 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-Bar/CLM1PT_data/CTSM_DATM_US-Bar_2005-2005.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2005" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2005" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2005" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-Bkg/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-Bkg/shell_commands index 91e1976a9f..a05f46e871 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-Bkg/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-Bkg/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=-96.836182 ./xmlchange PTS_LAT=44.345291 ./xmlchange DATM_YR_END=2006 +./xmlchange DATM_YR_START_FILENAME=2005 ./xmlchange START_TOD=21600 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-Bkg/CLM1PT_data/CTSM_DATM_US-Bkg_2005-2006.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2005" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2006" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2005" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-Blo/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-Blo/shell_commands index 5c09021706..fb79abb36e 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-Blo/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-Blo/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=-120.632751 ./xmlchange PTS_LAT=38.895302 ./xmlchange DATM_YR_END=2006 +./xmlchange DATM_YR_START_FILENAME=2000 ./xmlchange START_TOD=28800 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-Blo/CLM1PT_data/CTSM_DATM_US-Blo_2000-2006.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2000" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2006" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2000" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-Bo1/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-Bo1/shell_commands index 49c70e98da..b6e243115f 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-Bo1/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-Bo1/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=-88.290405 ./xmlchange PTS_LAT=40.006199 ./xmlchange DATM_YR_END=2006 +./xmlchange DATM_YR_START_FILENAME=1997 ./xmlchange START_TOD=21600 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-Bo1/CLM1PT_data/CTSM_DATM_US-Bo1_1997-2006.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=1997" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2006" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=1997" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-Cop/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-Cop/shell_commands index fc6a4841a9..0957a02037 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-Cop/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-Cop/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=-109.389999 ./xmlchange PTS_LAT=38.09 ./xmlchange DATM_YR_END=2003 +./xmlchange DATM_YR_START_FILENAME=2002 ./xmlchange START_TOD=25200 ./xmlchange ATM_NCPL=24 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-Cop/CLM1PT_data/CTSM_DATM_US-Cop_2002-2003.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2002" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2003" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2002" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-FPe/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-FPe/shell_commands index 2299cbf103..bd5760bfc0 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-FPe/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-FPe/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=-105.101898 ./xmlchange PTS_LAT=48.307701 ./xmlchange DATM_YR_END=2006 +./xmlchange DATM_YR_START_FILENAME=2000 ./xmlchange START_TOD=25200 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-FPe/CLM1PT_data/CTSM_DATM_US-FPe_2000-2006.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2000" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2006" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2000" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-GLE/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-GLE/shell_commands index 794d0584a2..fc1b2c4fba 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-GLE/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-GLE/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=-106.239899 ./xmlchange PTS_LAT=41.366501 ./xmlchange DATM_YR_END=2014 +./xmlchange DATM_YR_START_FILENAME=2009 ./xmlchange START_TOD=25200 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-GLE/CLM1PT_data/CTSM_DATM_US-GLE_2009-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2009" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2009" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-Goo/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-Goo/shell_commands index 6cc34f40c2..be9ff715aa 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-Goo/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-Goo/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=-89.873505 ./xmlchange PTS_LAT=34.2547 ./xmlchange DATM_YR_END=2006 +./xmlchange DATM_YR_START_FILENAME=2004 ./xmlchange START_TOD=21600 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-Goo/CLM1PT_data/CTSM_DATM_US-Goo_2004-2006.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2004" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2006" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2004" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-Ha1/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-Ha1/shell_commands index a016985d76..bb97980e53 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-Ha1/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-Ha1/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=-72.171509 ./xmlchange PTS_LAT=42.5378 ./xmlchange DATM_YR_END=2012 +./xmlchange DATM_YR_START_FILENAME=1992 ./xmlchange START_TOD=18000 ./xmlchange ATM_NCPL=24 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-Ha1/CLM1PT_data/CTSM_DATM_US-Ha1_1992-2012.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=1992" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2012" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=1992" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-Ho1/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-Ho1/shell_commands index c36889758d..803711f8af 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-Ho1/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-Ho1/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=-68.740204 ./xmlchange PTS_LAT=45.204102 ./xmlchange DATM_YR_END=2004 +./xmlchange DATM_YR_START_FILENAME=1996 ./xmlchange START_TOD=18000 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-Ho1/CLM1PT_data/CTSM_DATM_US-Ho1_1996-2004.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=1996" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2004" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=1996" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-KS2/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-KS2/shell_commands index fc3ab78d4f..74ad2113d9 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-KS2/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-KS2/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=-80.671539 ./xmlchange PTS_LAT=28.608578 ./xmlchange DATM_YR_END=2006 +./xmlchange DATM_YR_START_FILENAME=2003 ./xmlchange START_TOD=18000 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-KS2/CLM1PT_data/CTSM_DATM_US-KS2_2003-2006.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2003" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2006" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2003" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-Los/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-Los/shell_commands index d0ee0a8b7d..dbc8d3b004 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-Los/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-Los/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=-89.979187 ./xmlchange PTS_LAT=46.082699 ./xmlchange DATM_YR_END=2008 +./xmlchange DATM_YR_START_FILENAME=2000 ./xmlchange START_TOD=21600 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-Los/CLM1PT_data/CTSM_DATM_US-Los_2000-2008.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2000" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2008" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2000" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-MMS/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-MMS/shell_commands index 12362f6d77..8e8804a887 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-MMS/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-MMS/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=-86.413086 ./xmlchange PTS_LAT=39.3232 ./xmlchange DATM_YR_END=2014 +./xmlchange DATM_YR_START_FILENAME=1999 ./xmlchange START_TOD=18000 ./xmlchange ATM_NCPL=24 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-MMS/CLM1PT_data/CTSM_DATM_US-MMS_1999-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=1999" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=1999" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-MOz/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-MOz/shell_commands index a332c04808..223e43a3d6 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-MOz/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-MOz/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=-92.200012 ./xmlchange PTS_LAT=38.74411 ./xmlchange DATM_YR_END=2006 +./xmlchange DATM_YR_START_FILENAME=2005 ./xmlchange START_TOD=21600 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-MOz/CLM1PT_data/CTSM_DATM_US-MOz_2005-2006.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2005" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2006" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2005" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-Me2/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-Me2/shell_commands index 97c8a61316..8555ceb993 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-Me2/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-Me2/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=-121.557404 ./xmlchange PTS_LAT=44.452301 ./xmlchange DATM_YR_END=2014 +./xmlchange DATM_YR_START_FILENAME=2002 ./xmlchange START_TOD=28800 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-Me2/CLM1PT_data/CTSM_DATM_US-Me2_2002-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2002" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2002" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-Me4/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-Me4/shell_commands index eef9074dfe..b191f984a5 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-Me4/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-Me4/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=-121.622406 ./xmlchange PTS_LAT=44.499199 ./xmlchange DATM_YR_END=2000 +./xmlchange DATM_YR_START_FILENAME=1996 ./xmlchange START_TOD=28800 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-Me4/CLM1PT_data/CTSM_DATM_US-Me4_1996-2000.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=1996" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2000" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=1996" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-Me6/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-Me6/shell_commands index 7591643f86..8ffbbe4855 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-Me6/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-Me6/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=-121.607803 ./xmlchange PTS_LAT=44.323299 ./xmlchange DATM_YR_END=2014 +./xmlchange DATM_YR_START_FILENAME=2011 ./xmlchange START_TOD=28800 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-Me6/CLM1PT_data/CTSM_DATM_US-Me6_2011-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2011" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2011" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-Myb/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-Myb/shell_commands index 66e97faf89..2d3103546a 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-Myb/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-Myb/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=-121.765106 ./xmlchange PTS_LAT=38.049801 ./xmlchange DATM_YR_END=2014 +./xmlchange DATM_YR_START_FILENAME=2011 ./xmlchange START_TOD=28800 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-Myb/CLM1PT_data/CTSM_DATM_US-Myb_2011-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2011" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2011" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-NR1/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-NR1/shell_commands index 6ccba5ae4e..cd795160d0 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-NR1/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-NR1/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=-105.546402 ./xmlchange PTS_LAT=40.032902 ./xmlchange DATM_YR_END=2014 +./xmlchange DATM_YR_START_FILENAME=1999 ./xmlchange START_TOD=25200 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-NR1/CLM1PT_data/CTSM_DATM_US-NR1_1999-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=1999" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=1999" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-Ne1/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-Ne1/shell_commands index 54bbcbe8de..4b205b471d 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-Ne1/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-Ne1/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=-96.476593 ./xmlchange PTS_LAT=41.1651 ./xmlchange DATM_YR_END=2012 +./xmlchange DATM_YR_START_FILENAME=2002 ./xmlchange START_TOD=21600 ./xmlchange ATM_NCPL=24 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-Ne1/CLM1PT_data/CTSM_DATM_US-Ne1_2002-2012.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2002" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2012" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2002" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-Ne2/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-Ne2/shell_commands index 0587fd1932..beca45f248 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-Ne2/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-Ne2/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=-96.470093 ./xmlchange PTS_LAT=41.164902 ./xmlchange DATM_YR_END=2012 +./xmlchange DATM_YR_START_FILENAME=2002 ./xmlchange START_TOD=21600 ./xmlchange ATM_NCPL=24 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-Ne2/CLM1PT_data/CTSM_DATM_US-Ne2_2002-2012.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2002" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2012" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2002" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-Ne3/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-Ne3/shell_commands index 66bcf6d25d..59644ec285 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-Ne3/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-Ne3/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=-96.439697 ./xmlchange PTS_LAT=41.179699 ./xmlchange DATM_YR_END=2012 +./xmlchange DATM_YR_START_FILENAME=2002 ./xmlchange START_TOD=21600 ./xmlchange ATM_NCPL=24 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-Ne3/CLM1PT_data/CTSM_DATM_US-Ne3_2002-2012.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2002" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2012" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2002" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-PFa/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-PFa/shell_commands index 76bfb84b9f..979dd2adbe 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-PFa/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-PFa/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=-90.272308 ./xmlchange PTS_LAT=45.9459 ./xmlchange DATM_YR_END=2014 +./xmlchange DATM_YR_START_FILENAME=1995 ./xmlchange START_TOD=21600 ./xmlchange ATM_NCPL=24 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-PFa/CLM1PT_data/CTSM_DATM_US-PFa_1995-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=1995" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=1995" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-Prr/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-Prr/shell_commands index f3c9e49740..34949905d4 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-Prr/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-Prr/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=-147.487595 ./xmlchange PTS_LAT=65.123703 ./xmlchange DATM_YR_END=2013 +./xmlchange DATM_YR_START_FILENAME=2011 ./xmlchange START_TOD=32400 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-Prr/CLM1PT_data/CTSM_DATM_US-Prr_2011-2013.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2011" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2013" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2011" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-SP1/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-SP1/shell_commands index a10cb0956a..07c1611661 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-SP1/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-SP1/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=-82.218781 ./xmlchange PTS_LAT=29.73807 ./xmlchange DATM_YR_END=2005 +./xmlchange DATM_YR_START_FILENAME=2005 ./xmlchange START_TOD=18000 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-SP1/CLM1PT_data/CTSM_DATM_US-SP1_2005-2005.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2005" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2005" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2005" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-SP2/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-SP2/shell_commands index 7b7a589af4..0640843357 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-SP2/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-SP2/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=-82.244812 ./xmlchange PTS_LAT=29.764799 ./xmlchange DATM_YR_END=2004 +./xmlchange DATM_YR_START_FILENAME=2000 ./xmlchange START_TOD=18000 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-SP2/CLM1PT_data/CTSM_DATM_US-SP2_2000-2004.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2000" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2004" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2000" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-SP3/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-SP3/shell_commands index 882c94c80f..559f2e9282 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-SP3/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-SP3/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=-82.163269 ./xmlchange PTS_LAT=29.75477 ./xmlchange DATM_YR_END=2004 +./xmlchange DATM_YR_START_FILENAME=1999 ./xmlchange START_TOD=18000 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-SP3/CLM1PT_data/CTSM_DATM_US-SP3_1999-2004.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=1999" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2004" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=1999" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-SRG/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-SRG/shell_commands index 7fea8792e6..25269ecc91 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-SRG/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-SRG/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=-110.827698 ./xmlchange PTS_LAT=31.7894 ./xmlchange DATM_YR_END=2014 +./xmlchange DATM_YR_START_FILENAME=2009 ./xmlchange START_TOD=25200 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-SRG/CLM1PT_data/CTSM_DATM_US-SRG_2009-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2009" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2009" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-SRM/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-SRM/shell_commands index 3ba018a2b1..97c155f639 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-SRM/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-SRM/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=-110.865997 ./xmlchange PTS_LAT=31.8214 ./xmlchange DATM_YR_END=2014 +./xmlchange DATM_YR_START_FILENAME=2004 ./xmlchange START_TOD=25200 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-SRM/CLM1PT_data/CTSM_DATM_US-SRM_2004-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2004" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2004" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-Syv/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-Syv/shell_commands index 636e532f38..f78805c4d8 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-Syv/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-Syv/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=-89.347717 ./xmlchange PTS_LAT=46.242001 ./xmlchange DATM_YR_END=2008 +./xmlchange DATM_YR_START_FILENAME=2002 ./xmlchange START_TOD=21600 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-Syv/CLM1PT_data/CTSM_DATM_US-Syv_2002-2008.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2002" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2008" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2002" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-Ton/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-Ton/shell_commands index 497385372e..81a47579f4 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-Ton/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-Ton/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=-120.966003 ./xmlchange PTS_LAT=38.431599 ./xmlchange DATM_YR_END=2014 +./xmlchange DATM_YR_START_FILENAME=2001 ./xmlchange START_TOD=28800 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-Ton/CLM1PT_data/CTSM_DATM_US-Ton_2001-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2001" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2001" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-Tw4/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-Tw4/shell_commands index f212f4bc0f..6a76794659 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-Tw4/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-Tw4/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=-121.641403 ./xmlchange PTS_LAT=38.103001 ./xmlchange DATM_YR_END=2014 +./xmlchange DATM_YR_START_FILENAME=2014 ./xmlchange START_TOD=28800 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-Tw4/CLM1PT_data/CTSM_DATM_US-Tw4_2014-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2014" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2014" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-Twt/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-Twt/shell_commands index 74035ea108..0a36252097 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-Twt/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-Twt/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=-121.653107 ./xmlchange PTS_LAT=38.1087 ./xmlchange DATM_YR_END=2014 +./xmlchange DATM_YR_START_FILENAME=2010 ./xmlchange START_TOD=28800 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-Twt/CLM1PT_data/CTSM_DATM_US-Twt_2010-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2010" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2010" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-UMB/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-UMB/shell_commands index 08f9f17a5a..6587b7967c 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-UMB/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-UMB/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=-84.713806 ./xmlchange PTS_LAT=45.559799 ./xmlchange DATM_YR_END=2014 +./xmlchange DATM_YR_START_FILENAME=2000 ./xmlchange START_TOD=18000 ./xmlchange ATM_NCPL=24 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-UMB/CLM1PT_data/CTSM_DATM_US-UMB_2000-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2000" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2000" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-Var/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-Var/shell_commands index e997931652..ecdf5c95e3 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-Var/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-Var/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=-120.950729 ./xmlchange PTS_LAT=38.4133 ./xmlchange DATM_YR_END=2014 +./xmlchange DATM_YR_START_FILENAME=2001 ./xmlchange START_TOD=28800 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-Var/CLM1PT_data/CTSM_DATM_US-Var_2001-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2001" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2001" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-WCr/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-WCr/shell_commands index 55647b78c0..4f2ca3a65e 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-WCr/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-WCr/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=-90.079895 ./xmlchange PTS_LAT=45.805901 ./xmlchange DATM_YR_END=2006 +./xmlchange DATM_YR_START_FILENAME=1999 ./xmlchange START_TOD=21600 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-WCr/CLM1PT_data/CTSM_DATM_US-WCr_1999-2006.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=1999" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2006" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=1999" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-Whs/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-Whs/shell_commands index 51fadcc9f6..458db116f3 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-Whs/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-Whs/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=-110.0522 ./xmlchange PTS_LAT=31.743799 ./xmlchange DATM_YR_END=2014 +./xmlchange DATM_YR_START_FILENAME=2008 ./xmlchange START_TOD=25200 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-Whs/CLM1PT_data/CTSM_DATM_US-Whs_2008-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2008" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2008" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/US-Wkg/shell_commands b/cime_config/usermods_dirs/PLUMBER2/US-Wkg/shell_commands index 5d95ef3e36..0870b9233d 100644 --- a/cime_config/usermods_dirs/PLUMBER2/US-Wkg/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/US-Wkg/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=-109.941895 ./xmlchange PTS_LAT=31.7365 ./xmlchange DATM_YR_END=2014 +./xmlchange DATM_YR_START_FILENAME=2005 ./xmlchange START_TOD=25200 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/US-Wkg/CLM1PT_data/CTSM_DATM_US-Wkg_2005-2014.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2005" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2014" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2005" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/ZA-Kru/shell_commands b/cime_config/usermods_dirs/PLUMBER2/ZA-Kru/shell_commands index 6fe9e9c989..8c3463a936 100644 --- a/cime_config/usermods_dirs/PLUMBER2/ZA-Kru/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/ZA-Kru/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=31.496901 ./xmlchange PTS_LAT=-25.019699 ./xmlchange DATM_YR_END=2002 +./xmlchange DATM_YR_START_FILENAME=2000 ./xmlchange START_TOD=79200 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/ZA-Kru/CLM1PT_data/CTSM_DATM_ZA-Kru_2000-2002.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2000" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2002" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2000" >> user_nl_datm_streams diff --git a/cime_config/usermods_dirs/PLUMBER2/ZM-Mon/shell_commands b/cime_config/usermods_dirs/PLUMBER2/ZM-Mon/shell_commands index ff19816490..448a26c040 100644 --- a/cime_config/usermods_dirs/PLUMBER2/ZM-Mon/shell_commands +++ b/cime_config/usermods_dirs/PLUMBER2/ZM-Mon/shell_commands @@ -2,10 +2,10 @@ ./xmlchange PTS_LON=23.252781 ./xmlchange PTS_LAT=-15.437778 ./xmlchange DATM_YR_END=2008 +./xmlchange DATM_YR_START_FILENAME=2008 ./xmlchange START_TOD=79200 ./xmlchange ATM_NCPL=48 -echo "CLM_USRDAT.PLUMBER2:datafiles= \$DIN_LOC_ROOT/atm/datm7/CLM1PT_data/PLUMBER2/ZM-Mon/CLM1PT_data/CTSM_DATM_ZM-Mon_2008-2008.nc " >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_first=2008" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_last=2008" >> user_nl_datm_streams echo "presaero.SSP3-7.0:year_align=2008" >> user_nl_datm_streams From ba1de86775efaed74f9dba24f9be52b230bf3263 Mon Sep 17 00:00:00 2001 From: Teagan King Date: Thu, 8 Aug 2024 12:17:44 -0600 Subject: [PATCH 0940/1248] minor typo fix --- tools/site_and_regional/create_PLUMBER2_sites_csv.ncl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/site_and_regional/create_PLUMBER2_sites_csv.ncl b/tools/site_and_regional/create_PLUMBER2_sites_csv.ncl index 2bcf9915ca..b83e3ef3a7 100644 --- a/tools/site_and_regional/create_PLUMBER2_sites_csv.ncl +++ b/tools/site_and_regional/create_PLUMBER2_sites_csv.ncl @@ -163,7 +163,7 @@ begin fname = "/glade/work/oleson/ctsm_PLUMBERcsv/tools/site_and_regional/PLUMBER2_sites.csv" header = (/"#pftX-cth and pftX-cbh are the site=specific canopy top and bottom heights", \ - "#start_year and end_year will be used to define DATM_YR_ALIGH, DATM_YR_START and DATM_YR_END, and STOP_N in units of nyears.", \ + "#start_year and end_year will be used to define DATM_YR_ALIGN, DATM_YR_START and DATM_YR_END, and STOP_N in units of nyears.", \ "#RUN_STARTDATE and START_TOD are specified because we are starting at GMT corresponding to local midnight.", \ "#ATM_NCPL is specified so that the time step of the model matches the time interval specified by the atm forcing data.", \ ",Site,Lat,Lon,pft1,pft1-%,pft1-cth,pft1-cbh,pft2,pft2-%,pft2-cth,pft2-cbh,start_year,end_year,RUN_STARTDATE,START_TOD,ATM_NCPL"/) From 2b265ca9c874ce4e8c25290078d4f1ff19fb8a7d Mon Sep 17 00:00:00 2001 From: Teagan King <98482480+TeaganKing@users.noreply.github.com> Date: Thu, 8 Aug 2024 13:42:18 -0600 Subject: [PATCH 0941/1248] Update buildnml for accurate restart file time of day --- cime_config/buildnml | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/cime_config/buildnml b/cime_config/buildnml index 893f0933c7..06a447e443 100644 --- a/cime_config/buildnml +++ b/cime_config/buildnml @@ -71,6 +71,7 @@ def buildnml(case, caseroot, compname): yr_start = int(yr_start) yr_end = int(yr_end) + clm_usrdat_name = case.get_value("CLM_USRDAT_NAME") comp_atm = case.get_value("COMP_ATM") lnd_grid = case.get_value("LND_GRID") ninst_lnd = case.get_value("NINST_LND") @@ -80,6 +81,7 @@ def buildnml(case, caseroot, compname): run_refcase = case.get_value("RUN_REFCASE") run_refdate = case.get_value("RUN_REFDATE") run_reftod = case.get_value("RUN_REFTOD") + start_tod = case.get_value("START_TOD") glc_nec = case.get_value("GLC_NEC") glc_use_antarctica = case.get_value("GLC_USE_ANTARCTICA") mask = case.get_value("MASK_GRID") @@ -348,13 +350,22 @@ def buildnml(case, caseroot, compname): if run_type == "hybrid" or run_type == "branch": compnames = ["clm4", "clm5", "clm2"] for comp in compnames: - clm_startfile = "%s.%s%s.r.%s-%s.nc" % ( - run_refcase, - comp, - inst_string, - run_refdate, - run_reftod, - ) + if "PLUMBER2" in clm_usrdat_name: + clm_startfile = "%s.%s%s.r.%s-%s.nc" % ( + run_refcase, + comp, + inst_string, + run_refdate, + start_tod, + ) + else: + clm_startfile = "%s.%s%s.r.%s-%s.nc" % ( + run_refcase, + comp, + inst_string, + run_refdate, + run_reftod, + ) if os.path.exists(os.path.join(rundir, clm_startfile)): break else: @@ -372,7 +383,7 @@ def buildnml(case, caseroot, compname): break if not os.path.exists(os.path.join(rundir, clm_startfile)): - logger.warning("WARNING: Could NOT find a start file named" + clm_startfile) + logger.warning("WARNING: Could NOT find a start file named " + clm_startfile) clm_icfile = "%s = '%s'" % (startfile_type, clm_startfile) else: clm_icfile = "" From 5f6d49608409fedb3c22ca1f65076ec175020cf0 Mon Sep 17 00:00:00 2001 From: Teagan King Date: Fri, 16 Aug 2024 16:15:16 -0600 Subject: [PATCH 0942/1248] update cdeps tag in gitmodules for plumber2 implementation --- .gitmodules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitmodules b/.gitmodules index 4e9f5b51fb..80c1640e72 100644 --- a/.gitmodules +++ b/.gitmodules @@ -92,7 +92,7 @@ fxDONOTUSEurl = https://github.com/ESCOMP/CMEPS.git [submodule "cdeps"] path = components/cdeps url = https://github.com/ESCOMP/CDEPS.git -fxtag = cdeps1.0.34 +fxtag = cdeps1.0.47 fxrequired = ToplevelRequired # Standard Fork to compare to with "git fleximod test" to ensure personal forks aren't committed fxDONOTUSEurl = https://github.com/ESCOMP/CDEPS.git From e9b629db2cc57ac52e4ff691b4762968d364e80d Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Fri, 16 Aug 2024 16:22:53 -0600 Subject: [PATCH 0943/1248] Simplify the validation checking for megan specifier as the expressions allowed are much more complex now, this resolves #2709 --- bld/CLMBuildNamelist.pm | 24 ++++-------------------- 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index daf4320c18..e4cc50614c 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -5652,26 +5652,10 @@ sub check_megan_spec { my $megan_spec = $nl->get_value('megan_specifier'); my @megan_spec_list = split( /\s*,\s*/, $megan_spec ); - foreach $megan_spec ( @megan_spec_list ) { - if ( $megan_spec =~ /^['"]+[A-Za-z0-9]+\s*\=\s*([\sA-Za-z0-9+_-]+)["']+$/ ) { - my $megan_list = $1; - my @megan_cmpds = split( /\s*\+\s*/, $megan_list ); - my $var = "megan_cmpds"; - my $warn = 0; - foreach my $megan_cmpd ( @megan_cmpds ) { - if ( ! $definition->is_valid_value( $var, $megan_cmpd, 'noquotes'=>1 ) ) { - $log->warning("megan_compound $megan_cmpd NOT found in list" ); - $warn++; - } - } - if ( $warn > 0 ) { - my @valid_values = $definition->get_valid_values( $var, 'noquotes'=>1 ); - $log->warning("list of megan compounds includes:\n" . - "@valid_values\n" . - "Does your megan_factors_file include more compounds?\n" . - "If NOT your simulation will fail." ); - } - } else { + foreach my $spec ( @megan_spec_list ) { + $megan_spec = remove_leading_and_trailing_quotes($spec); + # Do simple validation of the expressions to just check for valid characters + if ( ! $megan_spec =~ /[\s=A-Za-z0-9_\+\.\*\(\)-]+/ ) { $log->fatal_error("Bad format for megan_specifier = $megan_spec"); } } From e8b91fe3dd833007a666a6ed5495eb8372ed7bb3 Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Fri, 16 Aug 2024 17:04:09 -0600 Subject: [PATCH 0944/1248] Update glacier_region namelist items for new GLACIER_REGIONS We are removing the old second region (in CISM's Greenland domain but outside Greenland itself). So updating the namelist defaults to align with this removal. --- bld/namelist_files/namelist_defaults_ctsm.xml | 17 +++++++---------- cime_config/SystemTests/lvg.py | 4 ++-- .../user_nl_clm | 2 +- 3 files changed, 10 insertions(+), 13 deletions(-) diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index 97620c770d..cd5e723baa 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -466,30 +466,27 @@ attributes from the config_cache.xml file (with keys converted to upper-case). -'single_at_atm_topo','virtual','virtual','multiple' -'single_at_atm_topo','virtual','virtual','virtual' +'single_at_atm_topo','virtual','multiple' +'single_at_atm_topo','virtual','virtual' -'remains_in_place','replaced_by_ice','replaced_by_ice','replaced_by_ice' +'remains_in_place','replaced_by_ice','replaced_by_ice' -'melted','melted','remains_ice','remains_ice' +'melted','remains_ice','remains_ice' diff --git a/bld/namelist_files/namelist_definition_ctsm.xml b/bld/namelist_files/namelist_definition_ctsm.xml index 8f39a4e9dd..3e9a0b6b0b 100644 --- a/bld/namelist_files/namelist_definition_ctsm.xml +++ b/bld/namelist_files/namelist_definition_ctsm.xml @@ -333,6 +333,11 @@ Combustion completeness factor for litter (unitless) Combustion completeness factor for CWD[Course Woody Debris] (unitless) + +Value above which 30-day running relative humidity has no effect on fuel combustibility + + Critical threshold for truncation of Nitrogen (truncate Nitrogen states to zero below this value) diff --git a/src/biogeochem/CNFireBaseMod.F90 b/src/biogeochem/CNFireBaseMod.F90 index 7cc7750809..b66e44f8fb 100644 --- a/src/biogeochem/CNFireBaseMod.F90 +++ b/src/biogeochem/CNFireBaseMod.F90 @@ -68,6 +68,7 @@ module CNFireBaseMod real(r8) :: cmb_cmplt_fact_litter = 0.5_r8 ! combustion completion factor for litter (unitless) real(r8) :: cmb_cmplt_fact_cwd = 0.25_r8 ! combustion completion factor for CWD (unitless) + real(r8) :: max_rh30_affecting_fuel = 90._r8 ! Value above which 30-day running relative humidity has no effect on fuel combustibility (%) end type type, public :: params_type @@ -343,11 +344,13 @@ subroutine FireReadNML( this, NLFilename ) real(r8) :: non_boreal_peatfire_c, cropfire_a1 real(r8) :: rh_low, rh_hgh, bt_min, bt_max, occur_hi_gdp_tree real(r8) :: lfuel, ufuel, cmb_cmplt_fact_litter, cmb_cmplt_fact_cwd + real(r8) :: max_rh30_affecting_fuel namelist /lifire_inparm/ cli_scale, boreal_peatfire_c, pot_hmn_ign_counts_alpha, & non_boreal_peatfire_c, cropfire_a1, & rh_low, rh_hgh, bt_min, bt_max, occur_hi_gdp_tree, & - lfuel, ufuel, cmb_cmplt_fact_litter, cmb_cmplt_fact_cwd + lfuel, ufuel, cmb_cmplt_fact_litter, cmb_cmplt_fact_cwd, & + max_rh30_affecting_fuel if ( this%need_lightning_and_popdens() ) then cli_scale = cnfire_const%cli_scale @@ -364,6 +367,7 @@ subroutine FireReadNML( this, NLFilename ) occur_hi_gdp_tree = cnfire_const%occur_hi_gdp_tree cmb_cmplt_fact_litter = cnfire_const%cmb_cmplt_fact_litter cmb_cmplt_fact_cwd = cnfire_const%cmb_cmplt_fact_cwd + max_rh30_affecting_fuel = cnfire_const%max_rh30_affecting_fuel ! Initialize options to default values, in case they are not specified in ! the namelist @@ -397,6 +401,7 @@ subroutine FireReadNML( this, NLFilename ) call shr_mpi_bcast (occur_hi_gdp_tree , mpicom) call shr_mpi_bcast (cmb_cmplt_fact_litter , mpicom) call shr_mpi_bcast (cmb_cmplt_fact_cwd , mpicom) + call shr_mpi_bcast (max_rh30_affecting_fuel , mpicom) cnfire_const%cli_scale = cli_scale cnfire_const%boreal_peatfire_c = boreal_peatfire_c @@ -412,6 +417,7 @@ subroutine FireReadNML( this, NLFilename ) cnfire_const%occur_hi_gdp_tree = occur_hi_gdp_tree cnfire_const%cmb_cmplt_fact_litter = cmb_cmplt_fact_litter cnfire_const%cmb_cmplt_fact_cwd = cmb_cmplt_fact_cwd + cnfire_const%max_rh30_affecting_fuel = max_rh30_affecting_fuel if (masterproc) then write(iulog,*) ' ' diff --git a/src/biogeochem/CNFireLi2016Mod.F90 b/src/biogeochem/CNFireLi2016Mod.F90 index 955d7fe398..44e33edafc 100644 --- a/src/biogeochem/CNFireLi2016Mod.F90 +++ b/src/biogeochem/CNFireLi2016Mod.F90 @@ -179,6 +179,7 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ non_boreal_peatfire_c => cnfire_const%non_boreal_peatfire_c , & ! Input: [real(r8) ] (/hr) c parameter for non-boreal peatland fire pot_hmn_ign_counts_alpha => cnfire_const%pot_hmn_ign_counts_alpha , & ! Input: [real(r8) ] (/person/month) Potential human ignition counts boreal_peatfire_c => cnfire_const%boreal_peatfire_c , & ! Input: [real(r8) ] (/hr) c parameter for boreal peatland fire + max_rh30_affecting_fuel => cnfire_const%max_rh30_affecting_fuel , & ! Input: [real(r8) ] (%) Value above which 30-day running relative humidity has no effect on fuel combustibility fsr_pft => pftcon%fsr_pft , & ! Input: fd_pft => pftcon%fd_pft , & ! Input: @@ -597,7 +598,7 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ if (trotr1_col(c)+trotr2_col(c)<=0.6_r8) then afuel =min(1._r8,max(0._r8,(fuelc(c)-2500._r8)/(5000._r8-2500._r8))) arh=1._r8-max(0._r8, min(1._r8,(forc_rh(g)-rh_low)/(rh_hgh-rh_low))) - arh30=1._r8-max(cnfire_params%prh30, min(1._r8,rh30_col(c)/90._r8)) + arh30=1._r8-max(cnfire_params%prh30, min(1._r8,rh30_col(c)/max_rh30_affecting_fuel)) if (forc_rh(g) < rh_hgh.and. wtlf(c) > 0._r8 .and. tsoi17(c)> SHR_CONST_TKFRZ)then fire_m = ((afuel*arh30+(1._r8-afuel)*arh)**1.5_r8)*((1._r8 -max(0._r8,& min(1._r8,(btran_col(c)/wtlf(c)-bt_min)/(bt_max-bt_min))))**0.5_r8) diff --git a/src/biogeochem/CNFireLi2021Mod.F90 b/src/biogeochem/CNFireLi2021Mod.F90 index 6d504a1e26..93c384f65a 100644 --- a/src/biogeochem/CNFireLi2021Mod.F90 +++ b/src/biogeochem/CNFireLi2021Mod.F90 @@ -177,6 +177,7 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ non_boreal_peatfire_c => cnfire_const%non_boreal_peatfire_c , & ! Input: [real(r8) ] (/hr) c parameter for non-boreal peatland fire pot_hmn_ign_counts_alpha => cnfire_const%pot_hmn_ign_counts_alpha , & ! Input: [real(r8) ] (/person/month) Potential human ignition counts boreal_peatfire_c => cnfire_const%boreal_peatfire_c , & ! Input: [real(r8) ] (/hr) c parameter for boreal peatland fire + max_rh30_affecting_fuel => cnfire_const%max_rh30_affecting_fuel , & ! Input: [real(r8) ] (%) Value above which 30-day running relative humidity has no effect on fuel combustibility fsr_pft => pftcon%fsr_pft , & ! Input: fd_pft => pftcon%fd_pft , & ! Input: @@ -598,7 +599,7 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ if (trotr1_col(c)+trotr2_col(c)<=0.6_r8) then afuel =min(1._r8,max(0._r8,(fuelc(c)-2500._r8)/(5000._r8-2500._r8))) arh=1._r8-max(0._r8, min(1._r8,(forc_rh(g)-rh_low)/(rh_hgh-rh_low))) - arh30=1._r8-max(cnfire_params%prh30, min(1._r8,rh30_col(c)/90._r8)) + arh30=1._r8-max(cnfire_params%prh30, min(1._r8,rh30_col(c)/max_rh30_affecting_fuel)) if (forc_rh(g) < rh_hgh.and. wtlf(c) > 0._r8 .and. tsoi17(c)> SHR_CONST_TKFRZ)then fire_m = ((afuel*arh30+(1._r8-afuel)*arh)**1.5_r8) & *((1._r8-btran_col(c)/wtlf(c))**0.5_r8) diff --git a/src/biogeochem/CNFireLi2024Mod.F90 b/src/biogeochem/CNFireLi2024Mod.F90 index b9158d9a17..8602ff4e46 100644 --- a/src/biogeochem/CNFireLi2024Mod.F90 +++ b/src/biogeochem/CNFireLi2024Mod.F90 @@ -175,6 +175,7 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ non_boreal_peatfire_c => cnfire_const%non_boreal_peatfire_c , & ! Input: [real(r8) ] (/hr) c parameter for non-boreal peatland fire pot_hmn_ign_counts_alpha => cnfire_const%pot_hmn_ign_counts_alpha , & ! Input: [real(r8) ] (/person/month) Potential human ignition counts boreal_peatfire_c => cnfire_const%boreal_peatfire_c , & ! Input: [real(r8) ] (/hr) c parameter for boreal peatland fire + max_rh30_affecting_fuel => cnfire_const%max_rh30_affecting_fuel , & ! Input: [real(r8) ] (%) Value above which 30-day running relative humidity has no effect on fuel combustibility fsr_pft => pftcon%fsr_pft , & ! Input: fd_pft => pftcon%fd_pft , & ! Input: @@ -591,7 +592,7 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ fb = max(0.0_r8,min(1.0_r8,(fuelc(c)-lfuel)/(ufuel-lfuel))) afuel = min(1._r8,max(0._r8,(fuelc(c)-2500._r8)/(5000._r8-2500._r8))) arh = 1._r8-max(0._r8, min(1._r8,(forc_rh(g)-rh_low)/(rh_hgh-rh_low))) - arh30 = 1._r8-max(cnfire_params%prh30, min(1._r8,rh30_col(c)/90._r8)) + arh30 = 1._r8-max(cnfire_params%prh30, min(1._r8,rh30_col(c)/max_rh30_affecting_fuel)) if (forc_rh(g) < rh_hgh.and. wtlf(c) > 0._r8 .and. tsoi17(c)> SHR_CONST_TKFRZ)then fire_m = ((afuel*arh30+(1._r8-afuel)*arh)**1.5_r8) & *((1._r8-btran_col(c)/wtlf(c))**0.5_r8) From 2d2e093671c922df10222243fde06cee1bf6fbe0 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Tue, 20 Aug 2024 21:49:20 -0600 Subject: [PATCH 0947/1248] Add parameters for thresholds of precip for deforestation fire: "PFT-dependent thresholds of P60d and P10d" in Li et al. (2013, doi:10.5194/bg-10-2293-2013): - defo_fire_precip_thresh_bet: Value (mm/d) above which running mean daily precipitation (10 or 60 days) does not allow deforestation fire for a column with broadleaf evergreen tropical trees but no broadleaf deciduous tropical trees. - defo_fire_precip_thresh_bdt: Vice versa --- bld/CLMBuildNamelist.pm | 3 ++- bld/namelist_files/namelist_defaults_ctsm.xml | 8 ++++++++ bld/namelist_files/namelist_definition_ctsm.xml | 10 ++++++++++ src/biogeochem/CNFireBaseMod.F90 | 12 +++++++++++- src/biogeochem/CNFireLi2014Mod.F90 | 8 +++++++- src/biogeochem/CNFireLi2016Mod.F90 | 8 +++++++- src/biogeochem/CNFireLi2021Mod.F90 | 8 +++++++- src/biogeochem/CNFireLi2024Mod.F90 | 8 +++++++- 8 files changed, 59 insertions(+), 6 deletions(-) diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index d09f79afe1..155d4bb4bb 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -2266,7 +2266,8 @@ sub setup_logic_cnfire { my @fire_consts = ( "rh_low", "rh_hgh", "bt_min", "bt_max", "cli_scale", "boreal_peatfire_c", "non_boreal_peatfire_c", "pot_hmn_ign_counts_alpha", "cropfire_a1", "occur_hi_gdp_tree", "lfuel", "ufuel", - "cmb_cmplt_fact_litter", "cmb_cmplt_fact_cwd", "max_rh30_affecting_fuel" ); + "cmb_cmplt_fact_litter", "cmb_cmplt_fact_cwd", "max_rh30_affecting_fuel", + "defo_fire_precip_thresh_bet", "defo_fire_precip_thresh_bdt" ); if ( &value_is_true($nl->get_value('use_cn')) ) { foreach my $item ( @fire_consts ) { if ( ! &value_is_true($nl_flags->{'cnfireson'} ) ) { diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index ef797f567a..246efe04bb 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -245,6 +245,8 @@ attributes from the config_cache.xml file (with keys converted to upper-case). li2014qianfrc 90. +4.0 +1.8 30.0d00 80.0d00 @@ -353,6 +355,8 @@ attributes from the config_cache.xml file (with keys converted to upper-case). 0.5d00 0.28d00 90. +4.0 +1.8 30.0d00 80.0d00 @@ -369,6 +373,8 @@ attributes from the config_cache.xml file (with keys converted to upper-case). 0.5d00 0.28d00 90. +1.4 +0.5 30.0d00 85.0d00 @@ -385,6 +391,8 @@ attributes from the config_cache.xml file (with keys converted to upper-case). 0.5d00 0.28d00 95. +1.8 +0.6 diff --git a/bld/namelist_files/namelist_definition_ctsm.xml b/bld/namelist_files/namelist_definition_ctsm.xml index 3e9a0b6b0b..92a08ab1a7 100644 --- a/bld/namelist_files/namelist_definition_ctsm.xml +++ b/bld/namelist_files/namelist_definition_ctsm.xml @@ -338,6 +338,16 @@ Combustion completeness factor for CWD[Course Woody Debris] (unitless) Value above which 30-day running relative humidity has no effect on fuel combustibility + +Value (mm/d) above which running mean daily precipitation (10 or 60 days) does not allow deforestation fire for a column with broadleaf evergreen tropical trees but no broadleaf deciduous tropical trees. "PFT-dependent thresholds of P60d and P10d" in Li et al. (2013, doi:10.5194/bg-10-2293-2013). + + + +Value (mm/d) above which running mean daily precipitation (10 or 60 days) does not allow deforestation fire for a column with broadleaf deciduous tropical trees but no broadleaf evergreen tropical trees. "PFT-dependent thresholds of P60d and P10d" in Li et al. (2013, doi:10.5194/bg-10-2293-2013). + + Critical threshold for truncation of Nitrogen (truncate Nitrogen states to zero below this value) diff --git a/src/biogeochem/CNFireBaseMod.F90 b/src/biogeochem/CNFireBaseMod.F90 index b66e44f8fb..4f590ce701 100644 --- a/src/biogeochem/CNFireBaseMod.F90 +++ b/src/biogeochem/CNFireBaseMod.F90 @@ -69,6 +69,8 @@ module CNFireBaseMod real(r8) :: cmb_cmplt_fact_litter = 0.5_r8 ! combustion completion factor for litter (unitless) real(r8) :: cmb_cmplt_fact_cwd = 0.25_r8 ! combustion completion factor for CWD (unitless) real(r8) :: max_rh30_affecting_fuel = 90._r8 ! Value above which 30-day running relative humidity has no effect on fuel combustibility (%) + real(r8) :: defo_fire_precip_thresh_bet = 4.0_r8 ! Max running mean daily precip (mm/d) allowing deforestation fire for broadleaf evergreen trees + real(r8) :: defo_fire_precip_thresh_bdt = 1.8_r8 ! Max running mean daily precip (mm/d) allowing deforestation fire for broadleaf deciduous trees end type type, public :: params_type @@ -345,12 +347,14 @@ subroutine FireReadNML( this, NLFilename ) real(r8) :: rh_low, rh_hgh, bt_min, bt_max, occur_hi_gdp_tree real(r8) :: lfuel, ufuel, cmb_cmplt_fact_litter, cmb_cmplt_fact_cwd real(r8) :: max_rh30_affecting_fuel + real(r8) :: defo_fire_precip_thresh_bet, defo_fire_precip_thresh_bdt namelist /lifire_inparm/ cli_scale, boreal_peatfire_c, pot_hmn_ign_counts_alpha, & non_boreal_peatfire_c, cropfire_a1, & rh_low, rh_hgh, bt_min, bt_max, occur_hi_gdp_tree, & lfuel, ufuel, cmb_cmplt_fact_litter, cmb_cmplt_fact_cwd, & - max_rh30_affecting_fuel + max_rh30_affecting_fuel, & + defo_fire_precip_thresh_bet, defo_fire_precip_thresh_bdt if ( this%need_lightning_and_popdens() ) then cli_scale = cnfire_const%cli_scale @@ -368,6 +372,8 @@ subroutine FireReadNML( this, NLFilename ) cmb_cmplt_fact_litter = cnfire_const%cmb_cmplt_fact_litter cmb_cmplt_fact_cwd = cnfire_const%cmb_cmplt_fact_cwd max_rh30_affecting_fuel = cnfire_const%max_rh30_affecting_fuel + defo_fire_precip_thresh_bet = cnfire_const%defo_fire_precip_thresh_bet + defo_fire_precip_thresh_bdt = cnfire_const%defo_fire_precip_thresh_bdt ! Initialize options to default values, in case they are not specified in ! the namelist @@ -402,6 +408,8 @@ subroutine FireReadNML( this, NLFilename ) call shr_mpi_bcast (cmb_cmplt_fact_litter , mpicom) call shr_mpi_bcast (cmb_cmplt_fact_cwd , mpicom) call shr_mpi_bcast (max_rh30_affecting_fuel , mpicom) + call shr_mpi_bcast (defo_fire_precip_thresh_bet, mpicom) + call shr_mpi_bcast (defo_fire_precip_thresh_bdt, mpicom) cnfire_const%cli_scale = cli_scale cnfire_const%boreal_peatfire_c = boreal_peatfire_c @@ -418,6 +426,8 @@ subroutine FireReadNML( this, NLFilename ) cnfire_const%cmb_cmplt_fact_litter = cmb_cmplt_fact_litter cnfire_const%cmb_cmplt_fact_cwd = cmb_cmplt_fact_cwd cnfire_const%max_rh30_affecting_fuel = max_rh30_affecting_fuel + cnfire_const%defo_fire_precip_thresh_bet = defo_fire_precip_thresh_bet + cnfire_const%defo_fire_precip_thresh_bdt = defo_fire_precip_thresh_bdt if (masterproc) then write(iulog,*) ' ' diff --git a/src/biogeochem/CNFireLi2014Mod.F90 b/src/biogeochem/CNFireLi2014Mod.F90 index fcd27a7951..11b0e79655 100644 --- a/src/biogeochem/CNFireLi2014Mod.F90 +++ b/src/biogeochem/CNFireLi2014Mod.F90 @@ -172,6 +172,8 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ non_boreal_peatfire_c => cnfire_const%non_boreal_peatfire_c , & ! Input: [real(r8) ] (/hr) c parameter for non-boreal peatland fire pot_hmn_ign_counts_alpha => cnfire_const%pot_hmn_ign_counts_alpha , & ! Input: [real(r8) ] (/person/month) Potential human ignition counts boreal_peatfire_c => cnfire_const%boreal_peatfire_c , & ! Input: [real(r8) ] (/hr) c parameter for boreal peatland fire + defo_fire_precip_thresh_bet => cnfire_const%defo_fire_precip_thresh_bet, & ! Input: [real(r8) ] (mm/day) Max running mean daily precip allowing deforestation fire for broadleaf evergreen trees + 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 fsr_pft => pftcon%fsr_pft , & ! Input: fd_pft => pftcon%fd_pft , & ! Input: @@ -607,7 +609,11 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ fbac1(c) = 0._r8 farea_burned(c) = baf_crop(c)+baf_peatf(c) else - cri = (4.0_r8*trotr1_col(c)+1.8_r8*trotr2_col(c))/(trotr1_col(c)+trotr2_col(c)) + ! Calculate the precip threshold as the area-weighted mean of that for BET and BDT + cri = (defo_fire_precip_thresh_bet * trotr1_col(c) & + + defo_fire_precip_thresh_bdt * trotr2_col(c)) & + / (trotr1_col(c) + trotr2_col(c)) + cli = (max(0._r8,min(1._r8,(cri-prec60_col(c)*secspday)/cri))**0.5)* & (max(0._r8,min(1._r8,(cri-prec10_col(c)*secspday)/cri))**0.5)* & max(0.0005_r8,min(1._r8,19._r8*dtrotr_col(c)*dayspyr*secspday/dt-0.001_r8))* & diff --git a/src/biogeochem/CNFireLi2016Mod.F90 b/src/biogeochem/CNFireLi2016Mod.F90 index 44e33edafc..5396158221 100644 --- a/src/biogeochem/CNFireLi2016Mod.F90 +++ b/src/biogeochem/CNFireLi2016Mod.F90 @@ -180,6 +180,8 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ pot_hmn_ign_counts_alpha => cnfire_const%pot_hmn_ign_counts_alpha , & ! Input: [real(r8) ] (/person/month) Potential human ignition counts boreal_peatfire_c => cnfire_const%boreal_peatfire_c , & ! Input: [real(r8) ] (/hr) c parameter for boreal peatland fire max_rh30_affecting_fuel => cnfire_const%max_rh30_affecting_fuel , & ! Input: [real(r8) ] (%) Value above which 30-day running relative humidity has no effect on fuel combustibility + defo_fire_precip_thresh_bet => cnfire_const%defo_fire_precip_thresh_bet , & ! Input: [real(r8) ] (mm/day) Max running mean daily precip allowing deforestation fire for broadleaf evergreen trees + 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 fsr_pft => pftcon%fsr_pft , & ! Input: fd_pft => pftcon%fd_pft , & ! Input: @@ -630,7 +632,11 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ fbac1(c) = 0._r8 farea_burned(c) = baf_crop(c)+baf_peatf(c) else - cri = (4.0_r8*trotr1_col(c)+1.8_r8*trotr2_col(c))/(trotr1_col(c)+trotr2_col(c)) + ! Calculate the precip threshold as the area-weighted mean of that for BET and BDT + cri = (defo_fire_precip_thresh_bet * trotr1_col(c) & + + defo_fire_precip_thresh_bdt * trotr2_col(c)) & + / (trotr1_col(c) + trotr2_col(c)) + cli = (max(0._r8,min(1._r8,(cri-prec60_col(c)*secspday)/cri))**0.5)* & (max(0._r8,min(1._r8,(cri-prec10_col(c)*secspday)/cri))**0.5)* & max(0.0005_r8,min(1._r8,19._r8*dtrotr_col(c)*dayspyr*secspday/dt-0.001_r8))* & diff --git a/src/biogeochem/CNFireLi2021Mod.F90 b/src/biogeochem/CNFireLi2021Mod.F90 index 93c384f65a..1eecee70d8 100644 --- a/src/biogeochem/CNFireLi2021Mod.F90 +++ b/src/biogeochem/CNFireLi2021Mod.F90 @@ -178,6 +178,8 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ pot_hmn_ign_counts_alpha => cnfire_const%pot_hmn_ign_counts_alpha , & ! Input: [real(r8) ] (/person/month) Potential human ignition counts boreal_peatfire_c => cnfire_const%boreal_peatfire_c , & ! Input: [real(r8) ] (/hr) c parameter for boreal peatland fire max_rh30_affecting_fuel => cnfire_const%max_rh30_affecting_fuel , & ! Input: [real(r8) ] (%) Value above which 30-day running relative humidity has no effect on fuel combustibility + defo_fire_precip_thresh_bet => cnfire_const%defo_fire_precip_thresh_bet, & ! Input: [real(r8) ] (mm/day) Max running mean daily precip allowing deforestation fire for broadleaf evergreen trees + 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 fsr_pft => pftcon%fsr_pft , & ! Input: fd_pft => pftcon%fd_pft , & ! Input: @@ -632,7 +634,11 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ fbac1(c) = 0._r8 farea_burned(c) = baf_crop(c)+baf_peatf(c) else - cri = (4.0_r8*trotr1_col(c)+1.8_r8*trotr2_col(c))/(trotr1_col(c)+trotr2_col(c)) + ! Calculate the precip threshold as the area-weighted mean of that for BET and BDT + cri = (defo_fire_precip_thresh_bet * trotr1_col(c) & + + defo_fire_precip_thresh_bdt * trotr2_col(c)) & + / (trotr1_col(c) + trotr2_col(c)) + cli = (max(0._r8,min(1._r8,(cri-prec60_col(c)*secspday)/cri))**0.5)* & (max(0._r8,min(1._r8,(cri-prec10_col(c)*secspday)/cri))**0.5)* & (15._r8*min(0.0016_r8,dtrotr_col(c)/dt*dayspyr*secspday)+0.009_r8)* & diff --git a/src/biogeochem/CNFireLi2024Mod.F90 b/src/biogeochem/CNFireLi2024Mod.F90 index 8602ff4e46..7e46a35198 100644 --- a/src/biogeochem/CNFireLi2024Mod.F90 +++ b/src/biogeochem/CNFireLi2024Mod.F90 @@ -176,6 +176,8 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ pot_hmn_ign_counts_alpha => cnfire_const%pot_hmn_ign_counts_alpha , & ! Input: [real(r8) ] (/person/month) Potential human ignition counts boreal_peatfire_c => cnfire_const%boreal_peatfire_c , & ! Input: [real(r8) ] (/hr) c parameter for boreal peatland fire max_rh30_affecting_fuel => cnfire_const%max_rh30_affecting_fuel , & ! Input: [real(r8) ] (%) Value above which 30-day running relative humidity has no effect on fuel combustibility + defo_fire_precip_thresh_bet => cnfire_const%defo_fire_precip_thresh_bet, & ! Input: [real(r8) ] (mm/day) Max running mean daily precip allowing deforestation fire for broadleaf evergreen trees + 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 fsr_pft => pftcon%fsr_pft , & ! Input: fd_pft => pftcon%fd_pft , & ! Input: @@ -630,7 +632,11 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ fbac1(c) = 0._r8 farea_burned(c) = baf_crop(c)+baf_peatf(c) else - cri = (1.4_r8*trotr1_col(c)+0.5_r8*trotr2_col(c))/(trotr1_col(c)+trotr2_col(c)) + ! Calculate the precip threshold as the area-weighted mean of that for BET and BDT + cri = (defo_fire_precip_thresh_bet * trotr1_col(c) & + + defo_fire_precip_thresh_bdt * trotr2_col(c)) & + / (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)* & max(0._r8,min(1._r8,(0.25_r8-(forc_rain(c)+forc_snow(c))*secsphr)/0.25_r8)) From fbb2d89b531d9f1ccf73ba4bf23cf99f456a341d Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Wed, 21 Aug 2024 08:01:04 -0600 Subject: [PATCH 0948/1248] Add parameters relating to peat fire. - nonborpeat_fire_precip_denom: Denominator of precipitation in equation relating that to non-boreal peat fire (unitless). Eq. 9 in Li et al. (2013, doi:10.5194/bg-10-2293-2013). - borpeat_fire_soilmoist_denom: Denominator of exponential in soil moisture term of equation relating that and temperature to boreal peat fire (unitless). Eq. 10 in Li et al. (2013, doi:10.5194/bg-10-2293-2013). --- bld/CLMBuildNamelist.pm | 3 ++- bld/namelist_files/namelist_defaults_ctsm.xml | 5 +++++ bld/namelist_files/namelist_definition_ctsm.xml | 10 ++++++++++ src/biogeochem/CNFireBaseMod.F90 | 14 ++++++++++++-- src/biogeochem/CNFireLi2014Mod.F90 | 7 +++++-- src/biogeochem/CNFireLi2016Mod.F90 | 6 ++++-- src/biogeochem/CNFireLi2021Mod.F90 | 6 ++++-- src/biogeochem/CNFireLi2024Mod.F90 | 6 ++++-- 8 files changed, 46 insertions(+), 11 deletions(-) diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index 155d4bb4bb..bd710066b6 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -2267,7 +2267,8 @@ sub setup_logic_cnfire { my @fire_consts = ( "rh_low", "rh_hgh", "bt_min", "bt_max", "cli_scale", "boreal_peatfire_c", "non_boreal_peatfire_c", "pot_hmn_ign_counts_alpha", "cropfire_a1", "occur_hi_gdp_tree", "lfuel", "ufuel", "cmb_cmplt_fact_litter", "cmb_cmplt_fact_cwd", "max_rh30_affecting_fuel", - "defo_fire_precip_thresh_bet", "defo_fire_precip_thresh_bdt" ); + "defo_fire_precip_thresh_bet", "defo_fire_precip_thresh_bdt", + "borpeat_fire_soilmoist_denom", "nonborpeat_fire_precip_denom" ); if ( &value_is_true($nl->get_value('use_cn')) ) { foreach my $item ( @fire_consts ) { if ( ! &value_is_true($nl_flags->{'cnfireson'} ) ) { diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index 246efe04bb..faf7877302 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -247,6 +247,8 @@ attributes from the config_cache.xml file (with keys converted to upper-case). 90. 4.0 1.8 +0.3 +1.0 30.0d00 80.0d00 @@ -375,6 +377,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). 90. 1.4 0.5 +6.0 30.0d00 85.0d00 @@ -393,6 +396,8 @@ attributes from the config_cache.xml file (with keys converted to upper-case). 95. 1.8 0.6 + 0.35 +6.5 diff --git a/bld/namelist_files/namelist_definition_ctsm.xml b/bld/namelist_files/namelist_definition_ctsm.xml index 92a08ab1a7..d2347121c1 100644 --- a/bld/namelist_files/namelist_definition_ctsm.xml +++ b/bld/namelist_files/namelist_definition_ctsm.xml @@ -348,6 +348,16 @@ Value (mm/d) above which running mean daily precipitation (10 or 60 days) does n Value (mm/d) above which running mean daily precipitation (10 or 60 days) does not allow deforestation fire for a column with broadleaf deciduous tropical trees but no broadleaf evergreen tropical trees. "PFT-dependent thresholds of P60d and P10d" in Li et al. (2013, doi:10.5194/bg-10-2293-2013). + +Denominator of precipitation in equation relating that to non-boreal peat fire (unitless). Eq. 9 in Li et al. (2013, doi:10.5194/bg-10-2293-2013). + + + +Denominator of exponential in soil moisture term of equation relating that and temperature to boreal peat fire (unitless). Eq. 10 in Li et al. (2013, doi:10.5194/bg-10-2293-2013). + + Critical threshold for truncation of Nitrogen (truncate Nitrogen states to zero below this value) diff --git a/src/biogeochem/CNFireBaseMod.F90 b/src/biogeochem/CNFireBaseMod.F90 index 4f590ce701..5e4fd2caef 100644 --- a/src/biogeochem/CNFireBaseMod.F90 +++ b/src/biogeochem/CNFireBaseMod.F90 @@ -71,7 +71,9 @@ module CNFireBaseMod real(r8) :: max_rh30_affecting_fuel = 90._r8 ! Value above which 30-day running relative humidity has no effect on fuel combustibility (%) real(r8) :: defo_fire_precip_thresh_bet = 4.0_r8 ! Max running mean daily precip (mm/d) allowing deforestation fire for broadleaf evergreen trees real(r8) :: defo_fire_precip_thresh_bdt = 1.8_r8 ! Max running mean daily precip (mm/d) allowing deforestation fire for broadleaf deciduous trees - end type + real(r8) :: borpeat_fire_soilmoist_denom = 0.3 ! Denominator of exponential in soil moisture term of equation relating that and temperature to boreal peat fire (unitless) + real(r8) :: nonborpeat_fire_precip_denom = 1.0 ! Denominator of precipitation in equation relating that to non-boreal peat fire (unitless) + end type type, public :: params_type real(r8) :: prh30 ! Factor related to dependence of fuel combustibility on 30-day running mean of relative humidity (unitless) @@ -348,13 +350,15 @@ subroutine FireReadNML( this, NLFilename ) real(r8) :: lfuel, ufuel, cmb_cmplt_fact_litter, cmb_cmplt_fact_cwd real(r8) :: max_rh30_affecting_fuel real(r8) :: defo_fire_precip_thresh_bet, defo_fire_precip_thresh_bdt + real(r8) :: borpeat_fire_soilmoist_denom, nonborpeat_fire_precip_denom namelist /lifire_inparm/ cli_scale, boreal_peatfire_c, pot_hmn_ign_counts_alpha, & non_boreal_peatfire_c, cropfire_a1, & rh_low, rh_hgh, bt_min, bt_max, occur_hi_gdp_tree, & lfuel, ufuel, cmb_cmplt_fact_litter, cmb_cmplt_fact_cwd, & max_rh30_affecting_fuel, & - defo_fire_precip_thresh_bet, defo_fire_precip_thresh_bdt + defo_fire_precip_thresh_bet, defo_fire_precip_thresh_bdt, & + borpeat_fire_soilmoist_denom, nonborpeat_fire_precip_denom if ( this%need_lightning_and_popdens() ) then cli_scale = cnfire_const%cli_scale @@ -374,6 +378,8 @@ subroutine FireReadNML( this, NLFilename ) max_rh30_affecting_fuel = cnfire_const%max_rh30_affecting_fuel defo_fire_precip_thresh_bet = cnfire_const%defo_fire_precip_thresh_bet defo_fire_precip_thresh_bdt = cnfire_const%defo_fire_precip_thresh_bdt + borpeat_fire_soilmoist_denom = cnfire_const%borpeat_fire_soilmoist_denom + nonborpeat_fire_precip_denom = cnfire_const%nonborpeat_fire_precip_denom ! Initialize options to default values, in case they are not specified in ! the namelist @@ -410,6 +416,8 @@ subroutine FireReadNML( this, NLFilename ) call shr_mpi_bcast (max_rh30_affecting_fuel , mpicom) call shr_mpi_bcast (defo_fire_precip_thresh_bet, mpicom) call shr_mpi_bcast (defo_fire_precip_thresh_bdt, mpicom) + call shr_mpi_bcast (borpeat_fire_soilmoist_denom, mpicom) + call shr_mpi_bcast (nonborpeat_fire_precip_denom, mpicom) cnfire_const%cli_scale = cli_scale cnfire_const%boreal_peatfire_c = boreal_peatfire_c @@ -428,6 +436,8 @@ subroutine FireReadNML( this, NLFilename ) cnfire_const%max_rh30_affecting_fuel = max_rh30_affecting_fuel cnfire_const%defo_fire_precip_thresh_bet = defo_fire_precip_thresh_bet cnfire_const%defo_fire_precip_thresh_bdt = defo_fire_precip_thresh_bdt + cnfire_const%borpeat_fire_soilmoist_denom = borpeat_fire_soilmoist_denom + cnfire_const%nonborpeat_fire_precip_denom = nonborpeat_fire_precip_denom if (masterproc) then write(iulog,*) ' ' diff --git a/src/biogeochem/CNFireLi2014Mod.F90 b/src/biogeochem/CNFireLi2014Mod.F90 index 11b0e79655..4078da740b 100644 --- a/src/biogeochem/CNFireLi2014Mod.F90 +++ b/src/biogeochem/CNFireLi2014Mod.F90 @@ -174,6 +174,9 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ boreal_peatfire_c => cnfire_const%boreal_peatfire_c , & ! Input: [real(r8) ] (/hr) c parameter for boreal peatland fire defo_fire_precip_thresh_bet => cnfire_const%defo_fire_precip_thresh_bet, & ! Input: [real(r8) ] (mm/day) Max running mean daily precip allowing deforestation fire for broadleaf evergreen trees 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) + fsr_pft => pftcon%fsr_pft , & ! Input: fd_pft => pftcon%fd_pft , & ! Input: @@ -534,10 +537,10 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ g= col%gridcell(c) if(grc%latdeg(g) < cnfire_const%borealat )then baf_peatf(c) = non_boreal_peatfire_c/secsphr*max(0._r8, & - min(1._r8,(4.0_r8-prec60_col(c)*secspday)/ & + min(1._r8,(4.0_r8-prec60_col(c)*secspday/nonborpeat_fire_precip_denom)/ & 4.0_r8))**2*peatf_lf(c)*(1._r8-fsat(c)) else - baf_peatf(c) = boreal_peatfire_c/secsphr*exp(-SHR_CONST_PI*(max(wf2(c),0._r8)/0.3_r8))* & + baf_peatf(c) = boreal_peatfire_c/secsphr*exp(-SHR_CONST_PI*(max(wf2(c),0._r8)/borpeat_fire_soilmoist_denom))* & max(0._r8,min(1._r8,(tsoi17(c)-SHR_CONST_TKFRZ)/10._r8))*peatf_lf(c)* & (1._r8-fsat(c)) end if diff --git a/src/biogeochem/CNFireLi2016Mod.F90 b/src/biogeochem/CNFireLi2016Mod.F90 index 5396158221..b7c14938f7 100644 --- a/src/biogeochem/CNFireLi2016Mod.F90 +++ b/src/biogeochem/CNFireLi2016Mod.F90 @@ -182,6 +182,8 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ max_rh30_affecting_fuel => cnfire_const%max_rh30_affecting_fuel , & ! Input: [real(r8) ] (%) Value above which 30-day running relative humidity has no effect on fuel combustibility defo_fire_precip_thresh_bet => cnfire_const%defo_fire_precip_thresh_bet , & ! Input: [real(r8) ] (mm/day) Max running mean daily precip allowing deforestation fire for broadleaf evergreen trees 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) fsr_pft => pftcon%fsr_pft , & ! Input: fd_pft => pftcon%fd_pft , & ! Input: @@ -550,10 +552,10 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ g= col%gridcell(c) if(grc%latdeg(g) < cnfire_const%borealat )then baf_peatf(c) = non_boreal_peatfire_c/secsphr*max(0._r8, & - min(1._r8,(4.0_r8-prec60_col(c)*secspday)/ & + min(1._r8,(4.0_r8-prec60_col(c)*secspday/nonborpeat_fire_precip_denom)/ & 4.0_r8))**2*peatf_lf(c)*(1._r8-fsat(c)) else - baf_peatf(c) = boreal_peatfire_c/secsphr*exp(-SHR_CONST_PI*(max(wf2(c),0._r8)/0.3_r8))* & + baf_peatf(c) = boreal_peatfire_c/secsphr*exp(-SHR_CONST_PI*(max(wf2(c),0._r8)/borpeat_fire_soilmoist_denom))* & max(0._r8,min(1._r8,(tsoi17(c)-SHR_CONST_TKFRZ)/10._r8))*peatf_lf(c)* & (1._r8-fsat(c)) end if diff --git a/src/biogeochem/CNFireLi2021Mod.F90 b/src/biogeochem/CNFireLi2021Mod.F90 index 1eecee70d8..d1fd9338b8 100644 --- a/src/biogeochem/CNFireLi2021Mod.F90 +++ b/src/biogeochem/CNFireLi2021Mod.F90 @@ -180,6 +180,8 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ max_rh30_affecting_fuel => cnfire_const%max_rh30_affecting_fuel , & ! Input: [real(r8) ] (%) Value above which 30-day running relative humidity has no effect on fuel combustibility defo_fire_precip_thresh_bet => cnfire_const%defo_fire_precip_thresh_bet, & ! Input: [real(r8) ] (mm/day) Max running mean daily precip allowing deforestation fire for broadleaf evergreen trees 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) fsr_pft => pftcon%fsr_pft , & ! Input: fd_pft => pftcon%fd_pft , & ! Input: @@ -551,10 +553,10 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ g= col%gridcell(c) if(grc%latdeg(g) < cnfire_const%borealat )then baf_peatf(c) = non_boreal_peatfire_c/secsphr*max(0._r8, & - min(1._r8,(4.0_r8-prec60_col(c)*secspday)/ & + min(1._r8,(4.0_r8-prec60_col(c)*secspday/nonborpeat_fire_precip_denom)/ & 4.0_r8))**2*peatf_lf(c)*(1._r8-fsat(c)) else - baf_peatf(c) = boreal_peatfire_c/secsphr*exp(-SHR_CONST_PI*(max(wf2(c),0._r8)/0.3_r8))* & + baf_peatf(c) = boreal_peatfire_c/secsphr*exp(-SHR_CONST_PI*(max(wf2(c),0._r8)/borpeat_fire_soilmoist_denom))* & max(0._r8,min(1._r8,(tsoi17(c)-SHR_CONST_TKFRZ)/10._r8))*peatf_lf(c)* & (1._r8-fsat(c)) end if diff --git a/src/biogeochem/CNFireLi2024Mod.F90 b/src/biogeochem/CNFireLi2024Mod.F90 index 7e46a35198..4b7182f252 100644 --- a/src/biogeochem/CNFireLi2024Mod.F90 +++ b/src/biogeochem/CNFireLi2024Mod.F90 @@ -178,6 +178,8 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ max_rh30_affecting_fuel => cnfire_const%max_rh30_affecting_fuel , & ! Input: [real(r8) ] (%) Value above which 30-day running relative humidity has no effect on fuel combustibility defo_fire_precip_thresh_bet => cnfire_const%defo_fire_precip_thresh_bet, & ! Input: [real(r8) ] (mm/day) Max running mean daily precip allowing deforestation fire for broadleaf evergreen trees 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) fsr_pft => pftcon%fsr_pft , & ! Input: fd_pft => pftcon%fd_pft , & ! Input: @@ -543,12 +545,12 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ if(grc%latdeg(g) < cnfire_const%borealat )then if ((trotr1_col(c)+trotr2_col(c))*col%wtgcell(c)<=0.8_r8.and.trotr1_col(c)+trotr2_col(c)>0.0_r8) then baf_peatf(c) = non_boreal_peatfire_c/secsphr*max(0._r8, & - min(1._r8,(1._r8-prec30_col(c)*secspday/6._r8)))*peatf_lf(c) + min(1._r8,(1._r8-prec30_col(c)*secspday/nonborpeat_fire_precip_denom)))*peatf_lf(c) else baf_peatf(c) = 0._r8 end if else - baf_peatf(c) = boreal_peatfire_c/secsphr*exp(-SHR_CONST_PI*(max(wf2(c),0._r8)/0.3_r8))* & + baf_peatf(c) = boreal_peatfire_c/secsphr*exp(-SHR_CONST_PI*(max(wf2(c),0._r8)/borpeat_fire_soilmoist_denom))* & max(0._r8,min(1._r8,(tsoi17(c)-SHR_CONST_TKFRZ)/10._r8))*peatf_lf(c)* & (1._r8-fsat(c)) end if From 0f5819f240a258558b3b2161d7a89676b8a07a91 Mon Sep 17 00:00:00 2001 From: Teagan King Date: Wed, 21 Aug 2024 10:56:59 -0600 Subject: [PATCH 0949/1248] black and clarified tod reference --- cime_config/buildnml | 50 ++++++++++++++++++++++++++------------------ 1 file changed, 30 insertions(+), 20 deletions(-) diff --git a/cime_config/buildnml b/cime_config/buildnml index 06a447e443..cbefd4f155 100644 --- a/cime_config/buildnml +++ b/cime_config/buildnml @@ -184,7 +184,9 @@ def buildnml(case, caseroot, compname): clm_phys = case.get_value("CLM_PHYSICS_VERSION") config_cache_text = _config_cache_template.format(clm_phys=clm_phys) - config_cache_path = os.path.join(caseroot, "Buildconf", compname + "conf", "config_cache.xml") + config_cache_path = os.path.join( + caseroot, "Buildconf", compname + "conf", "config_cache.xml" + ) with open(config_cache_path, "w") as config_cache_file: config_cache_file.write(config_cache_text) @@ -291,13 +293,17 @@ def buildnml(case, caseroot, compname): if (yr_start != None) and (yr_end != None): nyr = yr_end - yr_start + 1 if (yr_end <= 0) or (yr_start <= 0): - logger.error("ERROR: Year start and end are both negative and should not be") + logger.error( + "ERROR: Year start and end are both negative and should not be" + ) clm_namelist_opts = "nyr_forcing={} {}".format(nyr, clm_namelist_opts) else: logger.warning( "WARNING: It does not make sense to do a SASU spinup with a prognostic atmosphere model" ) - logger.warning(" as it expects regular atmosphere forcing that is cycled over") + logger.warning( + " as it expects regular atmosphere forcing that is cycled over" + ) infile = os.path.join(ctsmconf, "namelist") @@ -311,7 +317,9 @@ def buildnml(case, caseroot, compname): lndfrac_file = os.path.join(lnd_domain_path, lnd_domain_file) lndfrac_setting = "-lnd_frac " + lndfrac_file - config_cache_file = os.path.join(caseroot, "Buildconf", compname + "conf", "config_cache.xml") + config_cache_file = os.path.join( + caseroot, "Buildconf", compname + "conf", "config_cache.xml" + ) # ----------------------------------------------------- # Clear out old data @@ -351,21 +359,19 @@ def buildnml(case, caseroot, compname): compnames = ["clm4", "clm5", "clm2"] for comp in compnames: if "PLUMBER2" in clm_usrdat_name: - clm_startfile = "%s.%s%s.r.%s-%s.nc" % ( - run_refcase, - comp, - inst_string, - run_refdate, - start_tod, - ) + # start_tod is supplied for PLUMBER cases + tod = start_tod else: - clm_startfile = "%s.%s%s.r.%s-%s.nc" % ( - run_refcase, - comp, - inst_string, - run_refdate, - run_reftod, - ) + # run_reftod is supplied for other cases + tod = run_reftod + + clm_startfile = "%s.%s%s.r.%s-%s.nc" % ( + run_refcase, + comp, + inst_string, + run_refdate, + tod, + ) if os.path.exists(os.path.join(rundir, clm_startfile)): break else: @@ -383,7 +389,9 @@ def buildnml(case, caseroot, compname): break if not os.path.exists(os.path.join(rundir, clm_startfile)): - logger.warning("WARNING: Could NOT find a start file named " + clm_startfile) + logger.warning( + "WARNING: Could NOT find a start file named " + clm_startfile + ) clm_icfile = "%s = '%s'" % (startfile_type, clm_startfile) else: clm_icfile = "" @@ -394,7 +402,9 @@ def buildnml(case, caseroot, compname): user_nl_file = os.path.join(caseroot, "user_nl_clm" + inst_string) namelist_infile = os.path.join(ctsmconf, "namelist") - create_namelist_infile(case, user_nl_file, namelist_infile, "\n".join(infile_lines)) + create_namelist_infile( + case, user_nl_file, namelist_infile, "\n".join(infile_lines) + ) cmd = os.path.join(lnd_root, "bld", "build-namelist") From b6fc52f6cfdb72c4334b4e035bb9cc0f66774587 Mon Sep 17 00:00:00 2001 From: Teagan King Date: Wed, 21 Aug 2024 11:00:53 -0600 Subject: [PATCH 0950/1248] undo black changes --- cime_config/buildnml | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/cime_config/buildnml b/cime_config/buildnml index cbefd4f155..2c4a320046 100644 --- a/cime_config/buildnml +++ b/cime_config/buildnml @@ -184,9 +184,7 @@ def buildnml(case, caseroot, compname): clm_phys = case.get_value("CLM_PHYSICS_VERSION") config_cache_text = _config_cache_template.format(clm_phys=clm_phys) - config_cache_path = os.path.join( - caseroot, "Buildconf", compname + "conf", "config_cache.xml" - ) + config_cache_path = os.path.join(caseroot, "Buildconf", compname + "conf", "config_cache.xml") with open(config_cache_path, "w") as config_cache_file: config_cache_file.write(config_cache_text) @@ -293,17 +291,13 @@ def buildnml(case, caseroot, compname): if (yr_start != None) and (yr_end != None): nyr = yr_end - yr_start + 1 if (yr_end <= 0) or (yr_start <= 0): - logger.error( - "ERROR: Year start and end are both negative and should not be" - ) + logger.error("ERROR: Year start and end are both negative and should not be") clm_namelist_opts = "nyr_forcing={} {}".format(nyr, clm_namelist_opts) else: logger.warning( "WARNING: It does not make sense to do a SASU spinup with a prognostic atmosphere model" ) - logger.warning( - " as it expects regular atmosphere forcing that is cycled over" - ) + logger.warning(" as it expects regular atmosphere forcing that is cycled over") infile = os.path.join(ctsmconf, "namelist") @@ -317,9 +311,7 @@ def buildnml(case, caseroot, compname): lndfrac_file = os.path.join(lnd_domain_path, lnd_domain_file) lndfrac_setting = "-lnd_frac " + lndfrac_file - config_cache_file = os.path.join( - caseroot, "Buildconf", compname + "conf", "config_cache.xml" - ) + config_cache_file = os.path.join(caseroot, "Buildconf", compname + "conf", "config_cache.xml") # ----------------------------------------------------- # Clear out old data @@ -389,9 +381,7 @@ def buildnml(case, caseroot, compname): break if not os.path.exists(os.path.join(rundir, clm_startfile)): - logger.warning( - "WARNING: Could NOT find a start file named " + clm_startfile - ) + logger.warning("WARNING: Could NOT find a start file named " + clm_startfile) clm_icfile = "%s = '%s'" % (startfile_type, clm_startfile) else: clm_icfile = "" @@ -402,9 +392,7 @@ def buildnml(case, caseroot, compname): user_nl_file = os.path.join(caseroot, "user_nl_clm" + inst_string) namelist_infile = os.path.join(ctsmconf, "namelist") - create_namelist_infile( - case, user_nl_file, namelist_infile, "\n".join(infile_lines) - ) + create_namelist_infile(case, user_nl_file, namelist_infile, "\n".join(infile_lines)) cmd = os.path.join(lnd_root, "bld", "build-namelist") From a3edb472cff1078bc702b4f9666c33d5d458590b Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Wed, 21 Aug 2024 11:32:20 -0600 Subject: [PATCH 0951/1248] Ensure new parameters are double-precision. --- bld/namelist_files/namelist_defaults_ctsm.xml | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index faf7877302..e18066848e 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -244,11 +244,11 @@ attributes from the config_cache.xml file (with keys converted to upper-case). li2016crufrc li2014qianfrc -90. -4.0 -1.8 -0.3 -1.0 +90.d00 +4.0d00 +1.8d00 +0.3d00 +1.0d00 30.0d00 80.0d00 @@ -357,8 +357,8 @@ attributes from the config_cache.xml file (with keys converted to upper-case). 0.5d00 0.28d00 90. -4.0 -1.8 +4.0d00 +1.8d00 30.0d00 80.0d00 @@ -374,10 +374,10 @@ attributes from the config_cache.xml file (with keys converted to upper-case). 825.d00 0.5d00 0.28d00 -90. -1.4 -0.5 -6.0 +90.d00 +1.4d00 +0.5d00 +6.0d00 30.0d00 85.0d00 @@ -394,10 +394,10 @@ attributes from the config_cache.xml file (with keys converted to upper-case). 0.5d00 0.28d00 95. -1.8 -0.6 - 0.35 -6.5 +1.8d00 +0.6d00 + 0.35d00 +6.5d00 From 53a1874b48c82591f45212ba7df5c29254e61a4c Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 21 Aug 2024 12:01:57 -0600 Subject: [PATCH 0952/1248] CAM_SETS_DRV_FLDS tests don't need to have drv_flds_in settings to be explicit --- bld/unit_testers/build-namelist_test.pl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bld/unit_testers/build-namelist_test.pl b/bld/unit_testers/build-namelist_test.pl index 1b54f29d92..de5a9b0e13 100755 --- a/bld/unit_testers/build-namelist_test.pl +++ b/bld/unit_testers/build-namelist_test.pl @@ -454,8 +454,8 @@ sub cat_and_create_namelistinfile { $mode = "-phys $phys CAM_SETS_DRV_FLDS"; &make_config_cache($phys); foreach my $options ( - "--res 1.9x2.5 --mask gx1v7 --bgc sp --no-megan --use_case 20thC_transient --namelist '&a start_ymd=19790101/' --lnd_tuning_mode ${phys}_cam6.0 --infile empty_user_nl_clm", - "--res 1.9x2.5 --mask gx1v7 --bgc sp --no-megan --use_case 20thC_transient --namelist '&a start_ymd=19790101/' --lnd_tuning_mode ${phys}_cam7.0 --infile empty_user_nl_clm", + "--res 1.9x2.5 --mask gx1v7 --bgc sp --use_case 20thC_transient --namelist '&a start_ymd=19790101/' --lnd_tuning_mode ${phys}_cam6.0 --infile empty_user_nl_clm", + "--res 1.9x2.5 --mask gx1v7 --bgc sp --use_case 20thC_transient --namelist '&a start_ymd=19790101/' --lnd_tuning_mode ${phys}_cam7.0 --infile empty_user_nl_clm", ) { &make_env_run( 'LND_SETS_DUST_EMIS_DRV_FLDS'=>"FALSE" ); eval{ system( "$bldnml --envxml_dir . $options > $tempfile 2>&1 " ); }; @@ -1286,7 +1286,7 @@ sub cat_and_create_namelistinfile { phys=>"clm5_0", }, "bad_megan_spec" =>{ options=>"-envxml_dir . -bgc bgc -megan", - namelst=>"megan_specifier='ZZTOP=zztop'", + namelst=>"megan_specifier='ZZTOP=zztop%'", phys=>"clm4_5", }, "FUN_wo_flexCN" =>{ options=>"-envxml_dir . -bgc bgc", From 717f957123f1b10dd2676438f7dcb7b95aa31c59 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 21 Aug 2024 12:10:19 -0600 Subject: [PATCH 0953/1248] Get working with bringing in CAM drv_flds_in Get it working with bringing in the CAM drv_flds_in file. And make it not matter on the --megan --drydep --fire_emis options. Also do dust_emis before the other drv_flds_in namelists, so the CAM namelist is loaded. --- bld/CLMBuildNamelist.pm | 72 ++++++++++++++++++++--------------------- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index e4cc50614c..1fad577c51 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -1449,7 +1449,7 @@ sub setup_cmdl_vichydro { sub process_namelist_commandline_namelist { # Process the commandline '-namelist' arg. - my ($opts, $definition, $nl, $envxml_ref) = @_; + my ($opts, $definition, $nl, $envxml_ref, %settings) = @_; if (defined $opts->{'namelist'}) { # Parse commandline namelist @@ -1471,7 +1471,7 @@ sub process_namelist_commandline_namelist { } sub process_namelist_infile { - my ($definition, $nl, $envxml_ref, $infile) = @_; + my ($definition, $nl, $envxml_ref, $infile, %settings) = @_; # Make sure a valid file was found if ( -f "$infile" ) { @@ -1493,7 +1493,7 @@ sub process_namelist_infile { # Merge input values into namelist. Previously specified values have higher precedence # and are not overwritten. - $nl->merge_nl($nl_infile_valid); + $nl->merge_nl($nl_infile_valid, %settings); } #------------------------------------------------------------------------------- @@ -1756,6 +1756,12 @@ sub process_namelist_inline_logic { ################################## setup_logic_lightning_streams($opts, $nl_flags, $definition, $defaults, $nl); + ###################################### + # namelist options for dust emissions + ###################################### + setup_logic_dust_emis($opts, $nl_flags, $definition, $defaults, $nl, $envxml_ref); + setup_logic_prigent_roughness($opts, $nl_flags, $definition, $defaults, $nl); + ################################# # namelist group: drydep_inparm # ################################# @@ -1766,12 +1772,6 @@ sub process_namelist_inline_logic { ################################# setup_logic_fire_emis($opts, $nl_flags, $definition, $defaults, $nl); - ###################################### - # namelist options for dust emissions - ###################################### - setup_logic_dust_emis($opts, $nl_flags, $definition, $defaults, $nl, $envxml_ref); - setup_logic_prigent_roughness($opts, $nl_flags, $definition, $defaults, $nl); - ################################# # namelist group: megan_emis_nl # ################################# @@ -3998,17 +3998,18 @@ sub setup_logic_lightning_streams { sub setup_logic_dry_deposition { my ($opts, $nl_flags, $definition, $defaults, $nl) = @_; + my @list = ( "drydep_list", "dep_data_file"); if ($opts->{'drydep'} ) { - if ( &value_is_true( $nl_flags->{'use_fates'}) && not &value_is_true( $nl_flags->{'use_fates_sp'}) ) { - $log->warning("DryDeposition can NOT be on when FATES is also on unless FATES-SP mode is on.\n" . - " Use the '--no-drydep' option when '-bgc fates' is activated"); - } add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'drydep_list'); add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'dep_data_file'); - } else { - if ( defined($nl->get_value('drydep_list')) ) { - $log->fatal_error("drydep_list defined, but drydep option NOT set"); - } + } + if ( &value_is_true( $nl_flags->{'use_fates'}) && not &value_is_true( $nl_flags->{'use_fates_sp'}) ) { + foreach my $var ( @list ) { + if ( defined($nl->get_value($var)) ) { + $log->warning("DryDeposition $var is being set and can NOT be on when FATES is also on unless FATES-SP mode is on.\n" . + " Use the '--no-drydep' option when '-bgc fates' is activated"); + } + } } } @@ -4017,20 +4018,20 @@ sub setup_logic_dry_deposition { sub setup_logic_fire_emis { my ($opts, $nl_flags, $definition, $defaults, $nl) = @_; + my @list = ( "fire_emis_eleveated", "fire_emis_factors_file", "fire_emis_specifier"); + if ($opts->{'fire_emis'} ) { - if ( &value_is_true( $nl_flags->{'use_fates'} ) ) { - $log->warning("Fire emission can NOT be on when FATES is also on.\n" . - " DON'T use the '-fire_emis' option when '-bgc fates' is activated"); - } add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'fire_emis_factors_file'); add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'fire_emis_specifier'); - } else { - if ( defined($nl->get_value('fire_emis_elevated')) || - defined($nl->get_value('fire_emis_factors_file')) || - defined($nl->get_value('fire_emis_specifier')) ) { - $log->fatal_error("fire_emission setting defined: fire_emis_elevated, fire_emis_factors_file, or fire_emis_specifier, but fire_emis option NOT set"); - } } + foreach my $var ( @list ) { + if ( defined($nl->get_value($var)) ) { + if ( &value_is_true( $nl_flags->{'use_fates'} ) ) { + $log->warning("Fire emission option $var can NOT be on when FATES is also on.\n" . + " DON'T use the '--fire_emis' option when '--bgc fates' is activated"); + } + } + } } #------------------------------------------------------------------------------- @@ -4094,7 +4095,8 @@ sub setup_logic_dust_emis { } # Now process the CAM drv_flds_in to get the dust settings my $infile = $opts->{'envxml_dir'} . "/Buildconf/camconf/drv_flds_in"; - process_namelist_infile( $definition, $nl, $envxml_ref, $infile ); + $log->verbose_message("Read in the drv_flds_in file generated by CAM's build-namelist"); + process_namelist_infile( $definition, $nl, $envxml_ref, $infile, 'die_on_conflict'=>1 ); } } @@ -4115,17 +4117,15 @@ sub setup_logic_megan { } if ($nl_flags->{'megan'} ) { - if ( &value_is_true( $nl_flags->{'use_fates'} ) ) { - $log->warning("MEGAN can NOT be on when FATES is also on.\n" . - " Use the '-no-megan' option when '-bgc fates' is activated"); - } add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'megan_specifier'); - check_megan_spec( $opts, $nl, $definition ); add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'megan_factors_file'); - } else { - if ( defined($nl->get_value('megan_specifier')) || + } + if ( defined($nl->get_value('megan_specifier')) || defined($nl->get_value('megan_factors_file')) ) { - $log->fatal_error("megan_specifier or megan_factors_file defined, but megan option NOT set"); + check_megan_spec( $opts, $nl, $definition ); + if ( &value_is_true( $nl_flags->{'use_fates'} ) ) { + $log->warning("MEGAN can NOT be on when FATES is also on.\n" . + " Use the '-no-megan' option when '-bgc fates' is activated"); } } } From 973f5e7bbcf1f6d9ac1867a7c6cc85e352373828 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Wed, 21 Aug 2024 13:21:52 -0600 Subject: [PATCH 0954/1248] Make one more constant double-precision. --- 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 e18066848e..8aacd3a64d 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -356,7 +356,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). 1050.d00 0.5d00 0.28d00 -90. +90.d00 4.0d00 1.8d00 From 45eae6057294a73e8a0b05df725615f6525eaaaf Mon Sep 17 00:00:00 2001 From: Teagan King <98482480+TeaganKing@users.noreply.github.com> Date: Wed, 21 Aug 2024 15:24:04 -0600 Subject: [PATCH 0955/1248] Update buildnml to minimize duplication --- cime_config/buildnml | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/cime_config/buildnml b/cime_config/buildnml index 2c4a320046..e9849a9e50 100644 --- a/cime_config/buildnml +++ b/cime_config/buildnml @@ -226,23 +226,19 @@ def buildnml(case, caseroot, compname): clm_usrdat_name = case.get_value("CLM_USRDAT_NAME") clmusr = " -clm_usr_name %s " % clm_usrdat_name # Write warning about initial condition data - if "NEON" in clm_usrdat_name and clm_force_coldstart == "off": + if ("NEON" in clm_usrdat_name) or ("PLUMBER2" in clm_usrdat_name) and clm_force_coldstart == "off": + if "NEON" in clm_usrdat_name: + match = "\w\w\w\w\" + if "PLUMBER2" in clm_usrdat_name: + match = "\w\w-\w\w\w\" if ("_transient" in clm_nml_use_case) and ( - re.fullmatch(r"\w\w\w\w\.transient", casename) is None + re.fullmatch(r"{}.transient".format(match), casename) is None or clm_usrdat_name is "NEON.PRISM" ): logger.warning( "WARNING: Do you have appropriate initial conditions for this simulation?" + " Check that the finidat file used in the lnd_in namelist is appropriately spunup for your case" ) - if "PLUMBER2" in clm_usrdat_name and clm_force_coldstart == "off": - if ("_transient" in clm_nml_use_case) and ( - re.fullmatch(r"\w\w-\w\w\w\.transient", casename) is None - ): - logger.warning( - "WARNING: Do you have appropriate initial conditions for this simulation?" - + " Check that the finidat file used in the lnd_in namelist is appropriately spunup for your case" - ) if comp_atm != "datm": nomeg = "-no-megan" From 7cf865d9e9f5ebf2a0966c7d2c2a931acf0b9caf Mon Sep 17 00:00:00 2001 From: Teagan King <98482480+TeaganKing@users.noreply.github.com> Date: Wed, 21 Aug 2024 15:26:32 -0600 Subject: [PATCH 0956/1248] Update match --- cime_config/buildnml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cime_config/buildnml b/cime_config/buildnml index e9849a9e50..19574b0ba6 100644 --- a/cime_config/buildnml +++ b/cime_config/buildnml @@ -228,9 +228,9 @@ def buildnml(case, caseroot, compname): # Write warning about initial condition data if ("NEON" in clm_usrdat_name) or ("PLUMBER2" in clm_usrdat_name) and clm_force_coldstart == "off": if "NEON" in clm_usrdat_name: - match = "\w\w\w\w\" + match = '\w\w\w\w\' if "PLUMBER2" in clm_usrdat_name: - match = "\w\w-\w\w\w\" + match = '\w\w-\w\w\w\' if ("_transient" in clm_nml_use_case) and ( re.fullmatch(r"{}.transient".format(match), casename) is None or clm_usrdat_name is "NEON.PRISM" From 82556be443579e6235bda4f39a0009520705e763 Mon Sep 17 00:00:00 2001 From: Teagan King <98482480+TeaganKing@users.noreply.github.com> Date: Wed, 21 Aug 2024 15:32:39 -0600 Subject: [PATCH 0957/1248] Update buildnml for fullmatch failure --- cime_config/buildnml | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/cime_config/buildnml b/cime_config/buildnml index 19574b0ba6..2525624c0e 100644 --- a/cime_config/buildnml +++ b/cime_config/buildnml @@ -227,14 +227,19 @@ def buildnml(case, caseroot, compname): clmusr = " -clm_usr_name %s " % clm_usrdat_name # Write warning about initial condition data if ("NEON" in clm_usrdat_name) or ("PLUMBER2" in clm_usrdat_name) and clm_force_coldstart == "off": + warning_init_conditions = False if "NEON" in clm_usrdat_name: - match = '\w\w\w\w\' + if ("_transient" in clm_nml_use_case) and ( + re.fullmatch(r"\w\w\w\w\.transient", casename) is None + or clm_usrdat_name is "NEON.PRISM" + ): + warning_init_conditions = True if "PLUMBER2" in clm_usrdat_name: - match = '\w\w-\w\w\w\' - if ("_transient" in clm_nml_use_case) and ( - re.fullmatch(r"{}.transient".format(match), casename) is None - or clm_usrdat_name is "NEON.PRISM" - ): + if ("_transient" in clm_nml_use_case) and ( + re.fullmatch(r"\w\w-\w\w\w\.transient", casename) is None + ): + warning_init_conditions = True + if warning_init_conditions == True: logger.warning( "WARNING: Do you have appropriate initial conditions for this simulation?" + " Check that the finidat file used in the lnd_in namelist is appropriately spunup for your case" From 07f66fde3e2ff5000f7986b600a98bf3eb8f9908 Mon Sep 17 00:00:00 2001 From: Teagan King <98482480+TeaganKing@users.noreply.github.com> Date: Wed, 21 Aug 2024 15:37:43 -0600 Subject: [PATCH 0958/1248] Update buildnml - attempt at black fix --- cime_config/buildnml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cime_config/buildnml b/cime_config/buildnml index 2525624c0e..11ac16cf9a 100644 --- a/cime_config/buildnml +++ b/cime_config/buildnml @@ -226,7 +226,7 @@ def buildnml(case, caseroot, compname): clm_usrdat_name = case.get_value("CLM_USRDAT_NAME") clmusr = " -clm_usr_name %s " % clm_usrdat_name # Write warning about initial condition data - if ("NEON" in clm_usrdat_name) or ("PLUMBER2" in clm_usrdat_name) and clm_force_coldstart == "off": + if "NEON" in clm_usrdat_name or "PLUMBER2" in clm_usrdat_name and clm_force_coldstart == "off": warning_init_conditions = False if "NEON" in clm_usrdat_name: if ("_transient" in clm_nml_use_case) and ( From d18b369830dc2f5e6f4945d7a765110a91f5c567 Mon Sep 17 00:00:00 2001 From: Teagan King <98482480+TeaganKing@users.noreply.github.com> Date: Wed, 21 Aug 2024 15:44:18 -0600 Subject: [PATCH 0959/1248] Update buildnml based on subset of local black changes --- cime_config/buildnml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cime_config/buildnml b/cime_config/buildnml index 11ac16cf9a..900f36131d 100644 --- a/cime_config/buildnml +++ b/cime_config/buildnml @@ -226,7 +226,11 @@ def buildnml(case, caseroot, compname): clm_usrdat_name = case.get_value("CLM_USRDAT_NAME") clmusr = " -clm_usr_name %s " % clm_usrdat_name # Write warning about initial condition data - if "NEON" in clm_usrdat_name or "PLUMBER2" in clm_usrdat_name and clm_force_coldstart == "off": + if ( + "NEON" in clm_usrdat_name + or "PLUMBER2" in clm_usrdat_name + and clm_force_coldstart == "off": + ): warning_init_conditions = False if "NEON" in clm_usrdat_name: if ("_transient" in clm_nml_use_case) and ( From 8b72bb5f27a971880d8e5bf41bb93a08c31f90e7 Mon Sep 17 00:00:00 2001 From: Teagan King <98482480+TeaganKing@users.noreply.github.com> Date: Wed, 21 Aug 2024 15:46:50 -0600 Subject: [PATCH 0960/1248] Update buildnml local black changes remove colon --- cime_config/buildnml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cime_config/buildnml b/cime_config/buildnml index 900f36131d..e9b7a610cd 100644 --- a/cime_config/buildnml +++ b/cime_config/buildnml @@ -229,7 +229,7 @@ def buildnml(case, caseroot, compname): if ( "NEON" in clm_usrdat_name or "PLUMBER2" in clm_usrdat_name - and clm_force_coldstart == "off": + and clm_force_coldstart == "off" ): warning_init_conditions = False if "NEON" in clm_usrdat_name: From 0b5888d61ea83a0895f4b2381383c1d9adf6ca7e Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Wed, 21 Aug 2024 19:45:35 -0600 Subject: [PATCH 0961/1248] Update abm and peatf rawdata file names in gen_mksurfdata_namelist.xml --- 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 3cb168e8fb..f9bb6a3a02 100644 --- a/tools/mksurfdata_esmf/gen_mksurfdata_namelist.xml +++ b/tools/mksurfdata_esmf/gen_mksurfdata_namelist.xml @@ -162,7 +162,7 @@ version of the raw dataset will probably go away. - lnd/clm2/rawdata/mksrf_peatf_0.5x0.5_AVHRR_simyr2000.c130228.nc + lnd/clm2/rawdata/mksrf_peatf_0.5x0.5_simyr2000.c240821.nc lnd/clm2/mappingdata/grids/UNSTRUCTgrid_0.5x0.5_nomask_cdf5_c200129.nc @@ -176,7 +176,7 @@ version of the raw dataset will probably go away. - lnd/clm2/rawdata/mksrf_abm_0.5x0.5_AVHRR_simyr2000.c130201.nc + lnd/clm2/rawdata/mksrf_abm_0.5x0.5_simyr2000.c240821.nc lnd/clm2/mappingdata/grids/UNSTRUCTgrid_0.5x0.5_nomask_cdf5_c200129.nc From 822618e669f08af5e4338f4d29e4a9d0ac54a74a Mon Sep 17 00:00:00 2001 From: mvdebolskiy Date: Thu, 15 Aug 2024 13:10:57 -0600 Subject: [PATCH 0962/1248] add test, add warning --- bld/CLMBuildNamelist.pm | 7 +++++++ bld/unit_testers/build-namelist_test.pl | 4 ++++ 2 files changed, 11 insertions(+) diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index b99be288e7..b5e74af000 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -2725,6 +2725,13 @@ SIMYR: foreach my $sim_yr ( @sim_years ) { $log->fatal_error("$useinitvar is being set for you but a $var was not found, so $useinitvar, init_interp_attributes, and finidat must not be set correctly for this configuration in the namelist_default file" ); } } + + # this check has to be here and not earlier since use_init_interp is set here and hillslope is already set above in setup_logic_hillslope + if ( &value_is_true($nl->get_value($useinitvar)) && value_is_true($nl->get_value("use_hillslope")) ) { + $log->warning("WARNING: You have set use_hillslope while $useinitvar is TRUE.\n This means all hillslope columns in a gridcell will read identical values" . + " from initial conditions. If you are sure you want this behaviour:") + } + } # end initial conditions #------------------------------------------------------------------------------- diff --git a/bld/unit_testers/build-namelist_test.pl b/bld/unit_testers/build-namelist_test.pl index c51b0b0cb3..074fdec814 100755 --- a/bld/unit_testers/build-namelist_test.pl +++ b/bld/unit_testers/build-namelist_test.pl @@ -1284,6 +1284,10 @@ sub cat_and_create_namelistinfile { namelst=>"fsurdat='build-namelist_test.pl'", phys=>"clm6_0", }, + "hillslope with init_interp"=>{ options=>"-bgc bgc -envxml_dir .", + namelst=>"use_init_interp=.true.,use_hillslope=.true.", + phys=>"clm6_0", + }, ); foreach my $key ( keys(%warntest) ) { print( "$key\n" ); From e271432f7ea3b01026a5c6edc023ed1665ba92c5 Mon Sep 17 00:00:00 2001 From: mvdebolskiy Date: Thu, 8 Aug 2024 10:33:31 -0600 Subject: [PATCH 0963/1248] add spellcheck in bld-nml-tester --- bld/unit_testers/build-namelist_test.pl | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/bld/unit_testers/build-namelist_test.pl b/bld/unit_testers/build-namelist_test.pl index c51b0b0cb3..a9381d0eae 100755 --- a/bld/unit_testers/build-namelist_test.pl +++ b/bld/unit_testers/build-namelist_test.pl @@ -1212,6 +1212,13 @@ sub cat_and_create_namelistinfile { ); foreach my $key ( keys(%failtest) ) { print( "$key\n" ); + my $var; + foreach $var ( "phys" , "options", "namelst" ) { + if ( not exists $failtest{$key}{$var} ) { + die "ERROR: Subkey $var does not exist for failtest $key\nERROR:Check if you spelled $var correctly\n" + } + } + &make_config_cache($failtest{$key}{"phys"}); my $options = $failtest{$key}{"options"}; my $namelist = $failtest{$key}{"namelst"}; @@ -1287,6 +1294,14 @@ sub cat_and_create_namelistinfile { ); foreach my $key ( keys(%warntest) ) { print( "$key\n" ); + + my $var; + foreach $var ( "phys" , "options", "namelst" ) { + if ( not exists $failtest{$key}{$var} ) { + die "ERROR: Subkey $var does not exist for warntest $key\nERROR:Check if you spelled $var correctly\n" + } + } + &make_config_cache($warntest{$key}{"phys"}); my $options = $warntest{$key}{"options"}; my $namelist = $warntest{$key}{"namelst"}; @@ -1516,6 +1531,14 @@ sub cat_and_create_namelistinfile { foreach my $key ( keys(%finidat_files) ) { print( "$key\n" ); + + my $var; + foreach $var ( "phys" , "atm_forc", "res", "bgc", "crop", "use_case", "start_ymd", "namelist" ) { + if ( not exists $failtest{$key}{$var} ) { + die "ERROR: Subkey $var does not exist for finidat_file $key\nERROR:Check if you spelled $var correctly\n" + } + } + my $phys = $finidat_files{$key}{'phys'}; print "physics = $phys\n"; &make_config_cache($phys); From 89e56cebdb35def494c63334310137b24a38e0cf Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Thu, 22 Aug 2024 11:15:29 -0600 Subject: [PATCH 0964/1248] Update ChangeLog/ChangeSum. --- doc/ChangeLog | 67 +++++++++++++++++++++++++++++++++++++++++++++++++++ doc/ChangeSum | 1 + 2 files changed, 68 insertions(+) diff --git a/doc/ChangeLog b/doc/ChangeLog index 7a6d764c14..42907da404 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,4 +1,71 @@ =============================================================== +Tag name: ctsm5.2.024 +Originator(s): samrabin (Sam Rabin, UCAR/TSS, samrabin@ucar.edu) +Date: Thu Aug 22 11:07:11 MDT 2024 +One-line Summary: Improve li2024 fire methods + +Purpose and description of changes +---------------------------------- + +For fire methods li2024gswpfrc and (new) li2024crujra: +- Improves peat burning dependence on climate +- Improves dependence of deforestation burning on climate. +- Allows lightning ignitions in tropical closed forest. (Human ignitions, other than deforestation, still not allowed.) +- Adds effect of landscape fragmentation on ignitions and fire duration. +- Recalibrates some parameters. + + +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.) + +[ ] clm6_0 + +[ ] clm5_1 + +[ ] clm5_0 + +[ ] ctsm5_0-nwp + +[ ] clm4_5 + + +Notes of particular relevance for users +--------------------------------------- +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): +- Adds optional fire_method li2024crujra. + + +Testing summary: +---------------- + + regular tests (aux_clm: https://github.com/ESCOMP/CTSM/wiki/System-Testing-Guide#pre-merge-system-testing): + + derecho ----- OK + izumi ------- DIFF + + +Answer changes +-------------- + +Changes answers relative to baseline: Yes + + Summarize any changes to answers, i.e., + - what code configurations: Only with optional fire_method li2024gswpfrc + - what platforms/compilers: All + - nature of change (roundoff; larger than roundoff/same climate; new climate): new climate, probably + + +Other details +------------- + +Pull Requests that document the changes (include PR ids): +- ESCOMP/CTSM#2711: [Fang summer '24 PR 2.1] More improvements to fire model (https://github.com/ESCOMP/CTSM/pull/2711) + +=============================================================== +=============================================================== Tag name: ctsm5.2.023 Originator(s): samrabin (Sam Rabin, UCAR/TSS, samrabin@ucar.edu) Date: Fri Aug 16 11:00:32 MDT 2024 diff --git a/doc/ChangeSum b/doc/ChangeSum index 176ac066d2..f4b14775b2 100644 --- a/doc/ChangeSum +++ b/doc/ChangeSum @@ -1,5 +1,6 @@ Tag Who Date Summary ============================================================================================================================ + ctsm5.2.024 samrabin 08/22/2024 Improve li2024 fire methods ctsm5.2.023 samrabin 08/16/2024 Merge b4b-dev ctsm5.2.022 samrabin 08/14/2024 Rework crop_calendars suite and cropMonthOutput ctsm5.2.021 rgknox 08/13/2024 Adding on-the-fly parameter settings for prescribed N and P in FATES From 9bcfcffe27bb46c6ee230fb6c29e5bd9c1c6f16d Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Thu, 22 Aug 2024 11:48:48 -0600 Subject: [PATCH 0965/1248] Keep GLACIER_REGION=1 unused We realized that the renumbering of regions could cause silent wrong behavior if a user was using an old user_nl_clm file that specified behaviors for the old 4 regions. So instead, we're keeping the old numbering for the Greenland and Antarctica regions and keeping GLACIER_REGION=1 unused for now. --- bld/namelist_files/namelist_defaults_ctsm.xml | 11 +++++++---- bld/namelist_files/namelist_definition_ctsm.xml | 14 ++++++++------ cime_config/SystemTests/lvg.py | 4 ++-- .../cmip6_glaciers_virtual_antarctica/user_nl_clm | 2 +- src/main/glcBehaviorMod.F90 | 9 ++++++--- tools/mksurfdata_esmf/gen_mksurfdata_namelist.xml | 2 +- 6 files changed, 25 insertions(+), 17 deletions(-) diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index cd5e723baa..ae40b99d0c 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -466,6 +466,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). -'single_at_atm_topo','virtual','multiple' -'single_at_atm_topo','virtual','virtual' +'single_at_atm_topo','UNSET','virtual','multiple' +'single_at_atm_topo','UNSET','virtual','virtual' -'remains_in_place','replaced_by_ice','replaced_by_ice' +'remains_in_place','UNSET','replaced_by_ice','replaced_by_ice' -'melted','remains_ice','remains_ice' +'melted','UNSET','remains_ice','remains_ice' logical TRUE,FALSE TRUE From 980bc1649a85c955369c456cd770b54ea1ac3965 Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Thu, 22 Aug 2024 14:48:45 -0600 Subject: [PATCH 0969/1248] Improve documentation of glacier region namelist options --- .../namelist_definition_ctsm.xml | 28 ++++++++++++++----- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/bld/namelist_files/namelist_definition_ctsm.xml b/bld/namelist_files/namelist_definition_ctsm.xml index 63525f7ab3..e6eadaae2c 100644 --- a/bld/namelist_files/namelist_definition_ctsm.xml +++ b/bld/namelist_files/namelist_definition_ctsm.xml @@ -564,7 +564,15 @@ Allowed values are: whose elevation matches the atmosphere's topographic height (so that there is no adjustment due to downscaling) 'UNSET': place-holder for non-existent regions -Behavior of 'virtual' is required in the region(s) where SMB is being sent to an ice sheet model +Most (if not all) of the region where there is an ice sheet model should have a behavior +of 'virtual': This behavior is needed to compute surface mass balance (SMB) in all +elevation classes for the sake of vertical downscaling, and is needed to allow two-way +feedbacks of glacier areas. You are allowed to have gridcells with non-virtual behavior in +this domain, but this should be minimized: SMB cannot be computed there, and CLM subgrid +areas will not remain in sync with the GLC model. (Within the icemask - i.e., the active +glc domain - you are NOT allowed to have gridcells with non-virtual behavior that also +have glacier_region_melt_behavior='replaced_by_ice': within the icemask, you're only +allowed to have non-virtual behavior in places where you are not computing SMB). From fa7f8f5928609f67cd710149802db30bf886428b Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Thu, 22 Aug 2024 15:22:19 -0600 Subject: [PATCH 0970/1248] Fix bug in setting of init_interp_attributes that should have been for clm6_0_cam6.0, that came about due to XML code duplication --- 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 167ded8c62..668ea1e05f 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -1193,12 +1193,12 @@ attributes from the config_cache.xml file (with keys converted to upper-case). -hgrid=0.9x1.25 maxpft=17 mask=gx1v7 use_cn=.false. use_crop=.false. irrigate=.true. glc_nec=10 do_transient_pfts=.false. -hgrid=1.9x2.5 maxpft=17 mask=gx1v7 use_cn=.false. use_crop=.false. irrigate=.true. glc_nec=10 do_transient_pfts=.false. From 796bd834fb575153d681992cc3641ee0636333bd Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Thu, 22 Aug 2024 15:35:14 -0600 Subject: [PATCH 0971/1248] Get the megan_spec checker working for identifying bad characters in a string --- bld/CLMBuildNamelist.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index 52ac4c1d6f..37eedff6e5 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -5665,7 +5665,7 @@ sub check_megan_spec { foreach my $spec ( @megan_spec_list ) { $megan_spec = remove_leading_and_trailing_quotes($spec); # Do simple validation of the expressions to just check for valid characters - if ( ! $megan_spec =~ /[\s=A-Za-z0-9_\+\.\*\(\)-]+/ ) { + if ( $megan_spec !~ /^([\s=A-Za-z0-9_\+\.\*\(\)-]+)$/ ) { $log->fatal_error("Bad format for megan_specifier = $megan_spec"); } } From 5cf4216f279ad55739b17570a97b8555fa50a8fc Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Thu, 22 Aug 2024 16:28:26 -0600 Subject: [PATCH 0972/1248] Turn on explicit AC, Leung_2023, and excess ice by default --- bld/namelist_files/namelist_defaults_ctsm.xml | 10 +++++----- bld/namelist_files/namelist_defaults_dust_emis.xml | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index 8aacd3a64d..70ba56e69b 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -161,7 +161,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). NONE -.false. +.true. .false. .false. .false. @@ -2449,15 +2449,15 @@ lnd/clm2/surfdata_esmf/NEON/surfdata_1x1_NEON_TOOL_hist_78pfts_CMIP6_simyr2000_c lnd/clm2/urbandata/CTSM52_tbuildmax_OlesonFeddema_2020_0.9x1.25_simyr1849-2106_c200605.nc /glade/work/xinchang/02_Explicit_AC_Adoption/02_data_present_day/CTSM52_urbantv_Li_2024_0.9x1.25_simyr1849-2106_c20230621.nc +>lnd/clm2/urbandata/CTSM52_urbantv_Li_2024_0.9x1.25_simyr1849-2106_c20230621.nc lnd/clm2/urbandata/CTSM52_tbuildmax_OlesonFeddema_2020_0.9x1.25_simyr1849-2106_c200605.nc /glade/work/xinchang/02_Explicit_AC_Adoption/02_data_present_day/CTSM52_urbantv_Li_2024_0.9x1.25_simyr1849-2106_c20230621.nc +>lnd/clm2/urbandata/CTSM52_urbantv_Li_2024_0.9x1.25_simyr1849-2106_c20230621.nc lnd/clm2/urbandata/CLM50_tbuildmax_Oleson_2016_0.9x1.25_simyr1849-2106_c160923.nc /glade/work/xinchang/02_Explicit_AC_Adoption/02_data_present_day/CTSM52_urbantv_Li_2024_0.9x1.25_simyr1849-2106_c20230621.nc +>lnd/clm2/urbandata/CTSM52_urbantv_Li_2024_0.9x1.25_simyr1849-2106_c20230621.nc lnd/clm2/urbandata/CLM45_tbuildmax_Oleson_2016_0.9x1.25_simyr1849-2106_c160923.nc @@ -2694,7 +2694,7 @@ lnd/clm2/surfdata_esmf/NEON/surfdata_1x1_NEON_TOOL_hist_78pfts_CMIP6_simyr2000_c -.false. +.true. -1.0 0.5 -3.15 diff --git a/bld/namelist_files/namelist_defaults_dust_emis.xml b/bld/namelist_files/namelist_defaults_dust_emis.xml index 40bf3d9078..319110cc55 100644 --- a/bld/namelist_files/namelist_defaults_dust_emis.xml +++ b/bld/namelist_files/namelist_defaults_dust_emis.xml @@ -14,7 +14,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). --> -Zender_2003 +Leung_2023 atm From e4a3c18c03deaa40df15bbff42f03204a3a93d4b Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Thu, 22 Aug 2024 16:59:10 -0600 Subject: [PATCH 0973/1248] Add finidat entries for f09/1850/clm6 cases --- bld/namelist_files/namelist_defaults_ctsm.xml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index 70ba56e69b..e94863b32e 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -1345,6 +1345,18 @@ attributes from the config_cache.xml file (with keys converted to upper-case). lnd_tuning_mode="clm6_0_GSWP3v1" use_init_interp=".true." >lnd/clm2/initdata_esmf/ctsm5.2/clmi.I1850Clm60BgcCrop-ciso.1361-01-01.ne30pg3_mg17_c240317.nc +lnd/clm2/initdata_esmf/ctsm5.3/ctsm52018_f09_xsiceON_acON_pSASU.clm2.r.0201-01-01-00000.nc + +lnd/clm2/initdata_esmf/ctsm5.3/ctsm52018_f09_xsiceON_acON_pSASU.clm2.r.0201-01-01-00000.nc + +.false. .true. -.false. -.false. -.false. .false. @@ -2706,7 +2704,9 @@ lnd/clm2/surfdata_esmf/NEON/surfdata_1x1_NEON_TOOL_hist_78pfts_CMIP6_simyr2000_c -.true. +.false. +.true. + -1.0 0.5 -3.15 diff --git a/bld/namelist_files/namelist_defaults_dust_emis.xml b/bld/namelist_files/namelist_defaults_dust_emis.xml index 319110cc55..a13a23d14b 100644 --- a/bld/namelist_files/namelist_defaults_dust_emis.xml +++ b/bld/namelist_files/namelist_defaults_dust_emis.xml @@ -14,7 +14,8 @@ attributes from the config_cache.xml file (with keys converted to upper-case). --> -Leung_2023 +Zender_2003 +Leung_2023 atm From b2d7edf8f629406b01ec0044ea8655de9d670da5 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Thu, 22 Aug 2024 17:14:44 -0600 Subject: [PATCH 0976/1248] Duplicate a bunch of XML so that the namelist unit tester works for all the tests --- bld/namelist_files/namelist_defaults_ctsm.xml | 44 ++++++++++++++++++- 1 file changed, 42 insertions(+), 2 deletions(-) diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index 668ea1e05f..394f72a62e 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -1059,12 +1059,12 @@ attributes from the config_cache.xml file (with keys converted to upper-case). >hgrid=1.9x2.5 maxpft=17 mask=gx1v7 use_cn=.false. use_crop=.false. irrigate=.true. glc_nec=10 do_transient_pfts=.false. -hgrid=ne0np4.ARCTIC.ne30x4 maxpft=17 mask=tx0.1v2 use_cn=.false. use_crop=.false. irrigate=.true. glc_nec=10 do_transient_pfts=.false. -hgrid=ne0np4.ARCTICGRIS.ne30x8 maxpft=17 mask=tx0.1v2 use_cn=.false. use_crop=.false. irrigate=.true. glc_nec=10 do_transient_pfts=.false. @@ -1144,6 +1144,26 @@ 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. +hgrid=0.9x1.25 maxpft=17 mask=gx1v7 use_cn=.false. use_crop=.false. irrigate=.true. glc_nec=10 do_transient_pfts=.false. + + +hgrid=1.9x2.5 maxpft=17 mask=gx1v7 use_cn=.false. use_crop=.false. irrigate=.true. glc_nec=10 do_transient_pfts=.false. + + +hgrid=ne0np4.ARCTIC.ne30x4 maxpft=17 mask=tx0.1v2 use_cn=.false. use_crop=.false. irrigate=.true. glc_nec=10 do_transient_pfts=.false. + + +hgrid=ne0np4.ARCTICGRIS.ne30x8 maxpft=17 mask=tx0.1v2 use_cn=.false. use_crop=.false. irrigate=.true. glc_nec=10 do_transient_pfts=.false. + + hgrid=0.9x1.25 maxpft=79 mask=gx1v7 use_cn=.true. use_crop=.true. irrigate=.true. glc_nec=10 do_transient_pfts=.false. @@ -1213,6 +1233,26 @@ attributes from the config_cache.xml file (with keys converted to upper-case). >hgrid=ne0np4.ARCTICGRIS.ne30x8 maxpft=17 mask=tx0.1v2 use_cn=.false. use_crop=.false. irrigate=.true. glc_nec=10 do_transient_pfts=.false. +hgrid=0.9x1.25 maxpft=17 mask=gx1v7 use_cn=.false. use_crop=.false. irrigate=.true. glc_nec=10 do_transient_pfts=.false. + + +hgrid=1.9x2.5 maxpft=17 mask=gx1v7 use_cn=.false. use_crop=.false. irrigate=.true. glc_nec=10 do_transient_pfts=.false. + + +hgrid=ne0np4.ARCTIC.ne30x4 maxpft=17 mask=tx0.1v2 use_cn=.false. use_crop=.false. irrigate=.true. glc_nec=10 do_transient_pfts=.false. + + +hgrid=ne0np4.ARCTICGRIS.ne30x8 maxpft=17 mask=tx0.1v2 use_cn=.false. use_crop=.false. irrigate=.true. glc_nec=10 do_transient_pfts=.false. + + Date: Thu, 22 Aug 2024 17:15:17 -0600 Subject: [PATCH 0977/1248] Change fatal error to warning for megan_specifier --- bld/CLMBuildNamelist.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index 37eedff6e5..94f6bf7e38 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -5666,7 +5666,7 @@ sub check_megan_spec { $megan_spec = remove_leading_and_trailing_quotes($spec); # Do simple validation of the expressions to just check for valid characters if ( $megan_spec !~ /^([\s=A-Za-z0-9_\+\.\*\(\)-]+)$/ ) { - $log->fatal_error("Bad format for megan_specifier = $megan_spec"); + $log->warning("Bad format for megan_specifier = $megan_spec"); } } } From a5a15ed19bd7517e3abfd9994353c3f42bd49e8d Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Thu, 22 Aug 2024 17:17:11 -0600 Subject: [PATCH 0978/1248] Correct test number and remove fail tests that are now allowed to happen because you can set drv_flds_in settings without using the CLM_BLDNML_OPTS options for it --- bld/unit_testers/build-namelist_test.pl | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/bld/unit_testers/build-namelist_test.pl b/bld/unit_testers/build-namelist_test.pl index de5a9b0e13..8b2827b069 100755 --- a/bld/unit_testers/build-namelist_test.pl +++ b/bld/unit_testers/build-namelist_test.pl @@ -163,10 +163,10 @@ sub cat_and_create_namelistinfile { # # Figure out number of tests that will run # -my $ntests = 3339; +my $ntests = 3349; if ( defined($opts{'compare'}) ) { - $ntests += 1999; + $ntests += 2007; } plan( tests=>$ntests ); @@ -1093,14 +1093,6 @@ sub cat_and_create_namelistinfile { namelst=>"use_hydrstress=.true.", phys=>"clm5_0", }, - "specWOfireemis" =>{ options=>"-envxml_dir . -no-fire_emis", - namelst=>"fire_emis_specifier='bc_a1 = BC'", - phys=>"clm5_0", - }, - "elevWOfireemis" =>{ options=>"-envxml_dir . -no-fire_emis", - namelst=>"fire_emis_elevated=.false.", - phys=>"clm5_0", - }, "noanthro_w_crop" =>{ options=>"-envxml_dir . -res 0.9x1.25 -bgc bgc -crop -use_case 1850_noanthro_control", namelst=>"", phys=>"clm5_0", From c61aca3708a8908639a884a3bd5926b23b8b5aa5 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Fri, 23 Aug 2024 02:07:57 -0600 Subject: [PATCH 0979/1248] Update to use the new ctsm5.3 finidat file for f09 1850 --- bld/namelist_files/namelist_defaults_ctsm.xml | 21 +++++++------------ 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index 20f6d4702a..8e6b9b5d51 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -928,13 +928,14 @@ attributes from the config_cache.xml file (with keys converted to upper-case). hgrid=ne30np4.pg3 maxpft=79 mask=gx1v7 use_cn=.true. use_crop=.true. irrigate=.false. glc_nex=10 do_transient_pfts=.false. lnd_tuning_mode=clm6_0_GSWP3v1 +>hgrid=0.9x1.25 maxpft=79 mask=gx1v7 use_cn=.true. use_crop=.true. irrigate=.false. glc_nex=10 do_transient_pfts=.false. lnd_tuning_mode=clm5_1_GSWP3v1 hgrid=ne30np4.pg3 maxpft=79 mask=gx1v7 use_cn=.true. use_crop=.true. irrigate=.false. glc_nex=10 do_transient_pfts=.false. lnd_tuning_mode=clm6_0_GSWP3v1 +>hgrid=0.9x1.25 maxpft=79 mask=gx1v7 use_cn=.true. use_crop=.true. irrigate=.false. glc_nex=10 do_transient_pfts=.false. lnd_tuning_mode=clm6_0_GSWP3v1 + hgrid=1.9x2.5 maxpft=79 mask=gx1v7 use_cn=.true. use_crop=.true. irrigate=.true. glc_nec=10 do_transient_pfts=.false. @@ -1335,23 +1336,17 @@ attributes from the config_cache.xml file (with keys converted to upper-case). >lnd/clm2/initdata_map/clmi.I1850Clm50SpCru.1706-01-01.0.9x1.25_gx1v7_simyr1850_c200806.nc - - -lnd/clm2/initdata_esmf/ctsm5.2/clmi.I1850Clm60BgcCrop-ciso.1361-01-01.ne30pg3_mg17_c240317.nc - + + lnd/clm2/initdata_esmf/ctsm5.3/ctsm52018_f09_xsiceON_acON_pSASU.clm2.r.0201-01-01-00000.nc lnd/clm2/initdata_esmf/ctsm5.3/ctsm52018_f09_xsiceON_acON_pSASU.clm2.r.0201-01-01-00000.nc From 86a8db9acb0574de9f126b86013ee9f040e3651a Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Fri, 23 Aug 2024 08:55:29 -0600 Subject: [PATCH 0980/1248] Allow non-agri fire in trop. forests in last timestep of month. --- src/biogeochem/CNFireLi2024Mod.F90 | 1 - 1 file changed, 1 deletion(-) diff --git a/src/biogeochem/CNFireLi2024Mod.F90 b/src/biogeochem/CNFireLi2024Mod.F90 index 4b7182f252..1332cfb773 100644 --- a/src/biogeochem/CNFireLi2024Mod.F90 +++ b/src/biogeochem/CNFireLi2024Mod.F90 @@ -632,7 +632,6 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ if(( kmo == 1 .and. kda == 1 .and. mcsec == 0) .or. & dtrotr_col(c) <=0._r8 )then fbac1(c) = 0._r8 - farea_burned(c) = baf_crop(c)+baf_peatf(c) else ! Calculate the precip threshold as the area-weighted mean of that for BET and BDT cri = (defo_fire_precip_thresh_bet * trotr1_col(c) & From bb08dbf2793cd5ab3f20c9a31d32e36486dfcb9b Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Fri, 23 Aug 2024 09:00:31 -0600 Subject: [PATCH 0981/1248] li2024 fire now fully obeys cli_scale. --- 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 1332cfb773..e1530c9717 100644 --- a/src/biogeochem/CNFireLi2024Mod.F90 +++ b/src/biogeochem/CNFireLi2024Mod.F90 @@ -642,7 +642,7 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ (15._r8*min(0.0016_r8,dtrotr_col(c)/dt*dayspyr*secspday)+0.009_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*(0.01_r8/secspday) + farea_burned(c) = farea_burned(c)+fb*cli*(cli_scale/secspday) ! burned area out of conversion region due to land use fire fbac1(c) = max(0._r8,fb*cli*(cli_scale/secspday) - 2.0_r8*lfc(c)/dt) end if From 5645313482fc3337325ff537bf8792b285d109db Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Fri, 23 Aug 2024 09:09:51 -0600 Subject: [PATCH 0982/1248] Add a comment to guide future refactoring. --- 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 e1530c9717..5f7c0019f6 100644 --- a/src/biogeochem/CNFireLi2024Mod.F90 +++ b/src/biogeochem/CNFireLi2024Mod.F90 @@ -632,7 +632,7 @@ subroutine CNFireArea (this, bounds, num_soilc, filter_soilc, num_soilp, filter_ if(( kmo == 1 .and. kda == 1 .and. mcsec == 0) .or. & dtrotr_col(c) <=0._r8 )then fbac1(c) = 0._r8 - else + else ! SSR: Why are the code blocks above and below this else mutually exclusive? ! Calculate the precip threshold as the area-weighted mean of that for BET and BDT cri = (defo_fire_precip_thresh_bet * trotr1_col(c) & + defo_fire_precip_thresh_bdt * trotr2_col(c)) & From 00d288b297be5806e7abdbb16f42ba37f4e0d54c Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Wed, 21 Aug 2024 15:24:09 -0600 Subject: [PATCH 0983/1248] Change CTSM machine default for Derecho to develop queue w/ 32 cpus. --- python/ctsm/machine_defaults.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/ctsm/machine_defaults.py b/python/ctsm/machine_defaults.py index a17f063a4b..f07a313dcb 100644 --- a/python/ctsm/machine_defaults.py +++ b/python/ctsm/machine_defaults.py @@ -77,13 +77,13 @@ create_test_queue=CREATE_TEST_QUEUE_UNSPECIFIED, job_launcher_defaults={ JOB_LAUNCHER_QSUB: QsubDefaults( - queue="main", + queue="develop", walltime="03:50:00", extra_args="", # The following assumes a single node, with a single mpi proc; we may want # to add more flexibility in the future, making the node / proc counts # individually selectable - required_args="-l select=1:ncpus=128:mpiprocs=1 -V -r n -k oed", + required_args="-l select=1:ncpus=32:mpiprocs=1 -V -r n -k oed", ) }, ), From add600b14f1a7ddaea6b163a501bb61fb824905f Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Fri, 23 Aug 2024 09:43:49 -0600 Subject: [PATCH 0984/1248] Change to 16 to match GMAKE_J. --- python/ctsm/machine_defaults.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/ctsm/machine_defaults.py b/python/ctsm/machine_defaults.py index f07a313dcb..16742da47e 100644 --- a/python/ctsm/machine_defaults.py +++ b/python/ctsm/machine_defaults.py @@ -83,7 +83,7 @@ # The following assumes a single node, with a single mpi proc; we may want # to add more flexibility in the future, making the node / proc counts # individually selectable - required_args="-l select=1:ncpus=32:mpiprocs=1 -V -r n -k oed", + required_args="-l select=1:ncpus=16:mpiprocs=1 -V -r n -k oed", ) }, ), From d4042ee5074e57bce27d11394264f4c786212ba5 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Fri, 23 Aug 2024 10:47:32 -0600 Subject: [PATCH 0985/1248] This may be the finidat fix (based on the aux_clm failures on izumi) --- bld/namelist_files/namelist_defaults_ctsm.xml | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index 20f6d4702a..cee86cdbd2 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -1341,18 +1341,6 @@ attributes from the config_cache.xml file (with keys converted to upper-case). ic_ymd="18500101" sim_year="1850" do_transient_pfts=".false." ic_tod="0" glc_nec="10" use_crop=".true." irrigate=".false." lnd_tuning_mode="clm6_0_GSWP3v1" use_init_interp=".true." ->lnd/clm2/initdata_esmf/ctsm5.2/clmi.I1850Clm60BgcCrop-ciso.1361-01-01.ne30pg3_mg17_c240317.nc - -lnd/clm2/initdata_esmf/ctsm5.3/ctsm52018_f09_xsiceON_acON_pSASU.clm2.r.0201-01-01-00000.nc - -lnd/clm2/initdata_esmf/ctsm5.3/ctsm52018_f09_xsiceON_acON_pSASU.clm2.r.0201-01-01-00000.nc @@ -1394,7 +1382,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). ic_ymd="20110101" sim_year="2000" do_transient_pfts=".false." ic_tod="0" glc_nec="10" use_crop=".true." irrigate=".true." lnd_tuning_mode="clm6_0_GSWP3v1" ->lnd/clm2/initdata_esmf/ctsm5.2/clmi.I2000Clm52BgcCrop.2000-01-01.1.9x2.5_gx1v7_gl4_simyr2000_c240515.nc +>lnd/clm2/initdata_esmf/ctsm5.3/ctsm52018_f09_xsiceON_acON_pSASU.clm2.r.0201-01-01-00000.nc From 585935a94cc16397fb16b7df1ad3d1da43981f31 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Fri, 23 Aug 2024 12:32:17 -0600 Subject: [PATCH 0986/1248] Update ChangeLog and ChangeSum. --- doc/ChangeLog | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++ doc/ChangeSum | 1 + 2 files changed, 62 insertions(+) diff --git a/doc/ChangeLog b/doc/ChangeLog index 42907da404..f283f8a20c 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,4 +1,65 @@ =============================================================== +Tag name: ctsm5.2.025 +Originator(s): samrabin (Sam Rabin, UCAR/TSS, samrabin@ucar.edu) +Date: Fri Aug 23 12:27:51 MDT 2024 +One-line Summary: Minor fixes to li2024 fire methods + +Purpose and description of changes +---------------------------------- + +- Allow non-agricultural fire in tropical closed forests in the last timestep of the month +- li2024 fire now fully obeys cli_scale (b4b change because default parameter matched the magic number) + +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.) + +[ ] clm6_0 + +[ ] clm5_1 + +[ ] clm5_0 + +[ ] ctsm5_0-nwp + +[ ] clm4_5 + + +Bugs fixed +---------- + +List of CTSM issues fixed (include CTSM Issue # and description): +- Resolves ESCOMP/CTSM#2725: Minor bugs in li2024 fire (https://github.com/ESCOMP/CTSM/issues/2725) + + +Testing summary: +---------------- + + regular tests (aux_clm: https://github.com/ESCOMP/CTSM/wiki/System-Testing-Guide#pre-merge-system-testing): + + derecho ----- OK + izumi ------- OK + + Note that some Derecho tests did not complete. However, all the fire tests did, and none + of the other tests use the code that was modified here. + + +Answer changes +-------------- + +Changes answers relative to baseline: No + + +Other details +------------- + +Pull Requests that document the changes (include PR ids): +- ESCOMP/CTSM#2726: Bug fixes to li2024 fire (https://github.com/ESCOMP/CTSM/pull/2726) + +=============================================================== +=============================================================== Tag name: ctsm5.2.024 Originator(s): samrabin (Sam Rabin, UCAR/TSS, samrabin@ucar.edu) Date: Thu Aug 22 11:07:11 MDT 2024 diff --git a/doc/ChangeSum b/doc/ChangeSum index f4b14775b2..ce290045fa 100644 --- a/doc/ChangeSum +++ b/doc/ChangeSum @@ -1,5 +1,6 @@ Tag Who Date Summary ============================================================================================================================ + ctsm5.2.025 samrabin 08/23/2024 Minor fixes to li2024 fire methods ctsm5.2.024 samrabin 08/22/2024 Improve li2024 fire methods ctsm5.2.023 samrabin 08/16/2024 Merge b4b-dev ctsm5.2.022 samrabin 08/14/2024 Rework crop_calendars suite and cropMonthOutput From 5d6987ed5bce252961f0ca011f9762019ef20dc2 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Fri, 23 Aug 2024 12:44:58 -0600 Subject: [PATCH 0987/1248] More finidat changes based on aux_clm failure on derecho --- bld/namelist_files/namelist_defaults_ctsm.xml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index c6afee6f90..fdaee2bcaa 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -1473,7 +1473,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). ic_ymd="20000101" sim_year="2000" do_transient_pfts=".false." ic_tod="0" glc_nec="10" use_crop=".true." irrigate=".true." lnd_tuning_mode="clm5_1_cam7.0" use_init_interp=".true." ->lnd/clm2/initdata_map/clmi.BHIST.2000-01-01.0.9x1.25_gx1v7_simyr2000_c200728.nc +>lnd/clm2/initdata_esmf/ctsm5.3/ctsm52018_f09_xsiceON_acON_pSASU.clm2.r.0201-01-01-00000.nc @@ -1481,7 +1481,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). ic_ymd="20000101" sim_year="2000" do_transient_pfts=".false." ic_tod="0" glc_nec="10" use_crop=".true." irrigate=".true." lnd_tuning_mode="clm6_0_cam7.0" use_init_interp=".true." ->lnd/clm2/initdata_map/clmi.BHIST.2000-01-01.0.9x1.25_gx1v7_simyr2000_c200728.nc +>lnd/clm2/initdata_esmf/ctsm5.3/ctsm52018_f09_xsiceON_acON_pSASU.clm2.r.0201-01-01-00000.nc @@ -1545,7 +1545,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). ic_ymd="20000101" sim_year="2000" do_transient_pfts=".false." ic_tod="0" glc_nec="10" use_crop=".true." irrigate=".true." lnd_tuning_mode="clm5_1_cam7.0" use_init_interp=".true." ->lnd/clm2/initdata_map/clmi.BHIST.2000-01-01.0.9x1.25_gx1v7_simyr2000_c200728.nc +>lnd/clm2/initdata_esmf/ctsm5.3/ctsm52018_f09_xsiceON_acON_pSASU.clm2.r.0201-01-01-00000.nc @@ -1608,7 +1608,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). ic_ymd="20000101" sim_year="2000" do_transient_pfts=".false." ic_tod="0" glc_nec="10" use_crop=".true." irrigate=".true." lnd_tuning_mode="clm6_0_cam7.0" use_init_interp=".true." ->lnd/clm2/initdata_map/clmi.BHIST.2000-01-01.0.9x1.25_gx1v7_simyr2000_c200728.nc +>lnd/clm2/initdata_esmf/ctsm5.3/ctsm52018_f09_xsiceON_acON_pSASU.clm2.r.0201-01-01-00000.nc @@ -1682,14 +1682,14 @@ attributes from the config_cache.xml file (with keys converted to upper-case). ic_ymd="20000101" sim_year="2000" do_transient_pfts=".false." ic_tod="0" glc_nec="10" use_crop=".true." irrigate=".true." lnd_tuning_mode="clm5_1_cam6.0" use_init_interp=".true." ->lnd/clm2/initdata_map/clmi.BHIST.2000-01-01.0.9x1.25_gx1v7_simyr2000_c200728.nc +>lnd/clm2/initdata_esmf/ctsm5.3/ctsm52018_f09_xsiceON_acON_pSASU.clm2.r.0201-01-01-00000.nc lnd/clm2/initdata_map/clmi.BHIST.2000-01-01.0.9x1.25_gx1v7_simyr2000_c200728.nc +>lnd/clm2/initdata_esmf/ctsm5.3/ctsm52018_f09_xsiceON_acON_pSASU.clm2.r.0201-01-01-00000.nc @@ -1753,7 +1753,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). ic_ymd="20000101" sim_year="2000" do_transient_pfts=".false." ic_tod="0" glc_nec="10" use_crop=".true." irrigate=".true." lnd_tuning_mode="clm5_1_cam6.0" use_init_interp=".true." ->lnd/clm2/initdata_map/clmi.BHIST.2000-01-01.0.9x1.25_gx1v7_simyr2000_c200728.nc +>lnd/clm2/initdata_esmf/ctsm5.3/ctsm52018_f09_xsiceON_acON_pSASU.clm2.r.0201-01-01-00000.nc @@ -1817,7 +1817,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). ic_ymd="20000101" sim_year="2000" do_transient_pfts=".false." ic_tod="0" glc_nec="10" use_crop=".true." irrigate=".true." lnd_tuning_mode="clm6_0_cam6.0" use_init_interp=".true." ->lnd/clm2/initdata_map/clmi.BHIST.2000-01-01.0.9x1.25_gx1v7_simyr2000_c200728.nc +>lnd/clm2/initdata_esmf/ctsm5.3/ctsm52018_f09_xsiceON_acON_pSASU.clm2.r.0201-01-01-00000.nc From 8594b7d9c2b3e8a07c8d383d4218fc231a0e64ab Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Fri, 23 Aug 2024 14:49:09 -0600 Subject: [PATCH 0988/1248] Add comments about the new finidat file --- bld/namelist_files/namelist_defaults_ctsm.xml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index fdaee2bcaa..dacf75be02 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -1385,6 +1385,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). lnd_tuning_mode="clm5_1_GSWP3v1" >lnd/clm2/initdata_esmf/ctsm5.2/clmi.I2000Clm50BgcCrop.2011-01-01.1.9x2.5_gx1v7_gl4_simyr2000_c240223.nc + + + + + lnd/clm2/initdata_map/clmi.BHIST.2000-01-01.0.9x1.25_gx1v7_simyr2000_c200728.nc + lnd/clm2/initdata_esmf/ctsm5.3/ctsm52018_f09_xsiceON_acON_pSASU.clm2.r.0201-01-01-00000.nc + + + Date: Fri, 23 Aug 2024 14:49:39 -0600 Subject: [PATCH 0989/1248] Draft ChangeLog/ChangeSum --- doc/ChangeLog | 84 +++++++++++++++++++++++++++++++++++++++++++++++++++ doc/ChangeSum | 1 + 2 files changed, 85 insertions(+) diff --git a/doc/ChangeLog b/doc/ChangeLog index f283f8a20c..d3fd86e6ac 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,4 +1,88 @@ =============================================================== +Tag name: ctsm5.2.026 +Originator(s): slevis (Samuel Levis,UCAR/TSS,303-665-1310) +Date: Fri 23 Aug 2024 01:23:43 PM MDT +One-line Summary: Turn on excess ice, explicit AC, Leung_2023 for clm6 + +Purpose and description of changes +---------------------------------- + + Turn on excess ice, explicit AC, Leung_2023 for clm6. + + +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 + +[X] clm5_1 + +[ ] clm5_0 + +[ ] ctsm5_0-nwp + +[ ] clm4_5 + + +Bugs fixed +---------- +List of CTSM issues fixed (include CTSM Issue # and description) [one per line]: +Fixes #2466 Turn excess ice on by default in CESM3 +Fixes #2568 Turn on explicit AC, Leung_2023, and excess ice by default + +Notes of particular relevance for users +--------------------------------------- +Changes made to namelist defaults (e.g., changed parameter values): + Namelist defaults changed to turn on excess ice, explicit AC, Leung_2023 + in clm6; also to pick up new finidat files for clm6. + +Changes to the datasets (e.g., parameter, surface or initial files): + CLM6 cases need new finidat files. We use 1850 finidat files for + all clm6 cases because that's all that we have generated for now. + +Notes of particular relevance for developers: +--------------------------------------------- +Caveats for developers (e.g., code that is duplicated that requires double maintenance): + CLM6 cases need new finidat files. We use 1850 finidat files for + all clm6 cases because that's all that we have generated for now. + +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, expected FAIL> Date: Fri, 23 Aug 2024 15:52:29 -0600 Subject: [PATCH 0990/1248] Add use_init_interp to an f19 test using the new f09 finidat --- 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 dacf75be02..df3927fd0e 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -1389,7 +1389,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). lnd/clm2/initdata_esmf/ctsm5.3/ctsm52018_f09_xsiceON_acON_pSASU.clm2.r.0201-01-01-00000.nc From 7f76dc031638b399546d15c07effa25522c52422 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Fri, 23 Aug 2024 17:28:15 -0600 Subject: [PATCH 0991/1248] Updated ChangeLog --- doc/ChangeLog | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index d3fd86e6ac..96c0d6735b 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,7 +1,7 @@ =============================================================== Tag name: ctsm5.2.026 Originator(s): slevis (Samuel Levis,UCAR/TSS,303-665-1310) -Date: Fri 23 Aug 2024 01:23:43 PM MDT +Date: Fri 23 Aug 2024 05:17:56 PM MDT One-line Summary: Turn on excess ice, explicit AC, Leung_2023 for clm6 Purpose and description of changes @@ -38,17 +38,17 @@ Fixes #2568 Turn on explicit AC, Leung_2023, and excess ice by default Notes of particular relevance for users --------------------------------------- Changes made to namelist defaults (e.g., changed parameter values): - Namelist defaults changed to turn on excess ice, explicit AC, Leung_2023 - in clm6; also to pick up new finidat files for clm6. + Namelist defaults now turn on excess ice, explicit AC, Leung_2023 + in clm6; they also pick up new finidat files for clm6. Changes to the datasets (e.g., parameter, surface or initial files): - CLM6 cases need new finidat files. We use 1850 finidat files for + CLM6 cases need new finidat files. We use a f09 1850 finidat for all clm6 cases because that's all that we have generated for now. Notes of particular relevance for developers: --------------------------------------------- Caveats for developers (e.g., code that is duplicated that requires double maintenance): - CLM6 cases need new finidat files. We use 1850 finidat files for + CLM6 cases need new finidat files. We use a f09 1850 finidat for all clm6 cases because that's all that we have generated for now. Testing summary: @@ -62,8 +62,8 @@ Testing summary: regular tests (aux_clm: https://github.com/ESCOMP/CTSM/wiki/System-Testing-Guide#pre-merge-system-testing): - derecho ----- IN PROG - izumi ------- IN PROG + derecho ----- OK + izumi ------- OK Answer changes -------------- @@ -75,6 +75,8 @@ Changes answers relative to baseline: Yes - what platforms/compilers: all - nature of change: more than roundoff + Details about the diffs from excess ice and explicit AC may be found in + the earlier entries of this ChangeLog for ctsm5.2.018 and ctsm5.2.010. Other details ------------- From 1e803f2619ef3f3486ba5aba90496879f1eeb832 Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Sat, 24 Aug 2024 08:24:15 -0600 Subject: [PATCH 0992/1248] Fix regridding of glacier region We should use the maximum existing index, without regards for the relative coverage of the different indices. --- .../src/mkglacierregionMod.F90 | 24 ++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/tools/mksurfdata_esmf/src/mkglacierregionMod.F90 b/tools/mksurfdata_esmf/src/mkglacierregionMod.F90 index 267e46ddfa..4f6563b753 100644 --- a/tools/mksurfdata_esmf/src/mkglacierregionMod.F90 +++ b/tools/mksurfdata_esmf/src/mkglacierregionMod.F90 @@ -56,7 +56,6 @@ subroutine mkglacierregion(file_mesh_i, file_data_i, mesh_o, pioid_o, rc) integer , allocatable :: glacier_region_i(:) ! glacier region on input grid integer , allocatable :: glacier_region_o(:) ! glacier region on output grid integer :: ier, rcode ! error status - integer :: max_index(1) character(len=*), parameter :: subname = 'mkglacierregion' !----------------------------------------------------------------------- @@ -141,10 +140,29 @@ subroutine mkglacierregion(file_mesh_i, file_data_i, mesh_o, pioid_o, rc) if (ChkErr(rc,__LINE__,u_FILE_u)) return ! Determine glacier_region_o + ! + ! We take the maximum glacier region index that has > 0 coverage in the output grid + ! cell. The frequency of occurrence of the different glacier regions is irrelevant. + ! For example, if the value 1 appears in 99% of source cells overlapping a given + ! destination cell and the value 2 appears in just 1%, we'll put 2 in the destination + ! cell because it is the maximum value. (This treatment is important so that we give + ! priority to non-zero indices, and more generally allow setting up the glacier region + ! indices so that higher values take precedence - i.e., if a CTSM grid cell has any + ! overlap with a higher-valued region, we use that region.) glacier_region_o(:) = 0 do no = 1,ns_o - max_index = maxloc(data_o(:,no)) - glacier_region_o(no) = max_index(1) - 1 + ! Note that we loop starting at the highest index so we give priority to higher + ! indices. Also note that we stop looking at index 1 (i.e., we don't explicitly + ! look at index 0): if we haven't found a region with greater than 0 coverage from + ! looking at the indices greater than 0, then we'll default to assigning this to + ! glacier region 0, regardless of the coverage of glacier region 0 (though, in + ! practice, glacier region 0 should have 100% coverage in this case). + do l = nglacier_regions, 1, -1 + if (data_o(l,no) > 0._r8) then + glacier_region_o(no) = l + exit + end if + end do end do ! Write output data From 37d0e8f3ab6378d3eb3fc1b41a1ed0164633ff16 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Mon, 26 Aug 2024 12:19:26 -0600 Subject: [PATCH 0993/1248] Update clm6 param file to new one from Sam R. --- 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 384785b804..1cc58a30b6 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -551,7 +551,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). -lnd/clm2/paramdata/ctsm60_params.c240814.nc +/glade/work/samrabin/ctsm_fire-li2024-pr2_paramfiles/ctsm60_params.c240822.li2024crujra.nc lnd/clm2/paramdata/ctsm51_params.c240814.nc lnd/clm2/paramdata/clm50_params.c240814.nc lnd/clm2/paramdata/clm45_params.c240814.nc From b35320a2c452dcb99e82a183bffda126c1206eb1 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 8 Dec 2021 13:54:28 -0700 Subject: [PATCH 0994/1248] Also include the mizuRoute expected fails list --- parse_cime.cs.status | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/parse_cime.cs.status b/parse_cime.cs.status index 08bb1bfc86..269878d0bd 100755 --- a/parse_cime.cs.status +++ b/parse_cime.cs.status @@ -302,6 +302,7 @@ sub print_categories { if ( ! -f $expectedfailfile ) { $expectedfailfile = "$scrdir/cime_config/testdefs/ExpectedTestFails.xml"; } + my @failfiles = ( $expectedfailfile, "$scrdir/components/mizuRoute/cime_config/testdefs/ExpectedTestFails.xml" ); my @passes; my @fails; my @pendings; @@ -341,8 +342,10 @@ sub print_categories { print( "================================================================================\n" ); foreach my $key ( @passes ) { my $expect = ""; - `grep $key $expectedfailfile > /dev/null`; - if ( $? == 0 ) { $expect = "FAILED PREVIOUSLY"; } + foreach my $expectedfailfile ( @failfiles ) { + `grep $key $expectedfailfile > /dev/null`; + if ( $? == 0 ) { $expect = "FAILED PREVIOUSLY"; } + } print( "$key\t\t\t$expect\n" ); } } @@ -368,8 +371,10 @@ sub print_categories { print( "================================================================================\n" ); foreach my $key ( @pendings ) { my $expect = ""; - `grep $key $expectedfailfile > /dev/null`; - if ( $? == 0 ) { $expect = "EXPECTED"; } + foreach my $expectedfailfile ( @failfiles ) { + `grep $key $expectedfailfile > /dev/null`; + if ( $? == 0 ) { $expect = "EXPECTED"; } + } print( "$key\t\t$expect\n" ); } } @@ -379,8 +384,10 @@ sub print_categories { print( "================================================================================\n" ); foreach my $key ( @fails ) { my $expect = ""; - `grep $key $expectedfailfile > /dev/null`; - if ( $? == 0 ) { $expect = "EXPECTED"; } + foreach my $expectedfailfile ( @failfiles ) { + `grep $key $expectedfailfile > /dev/null`; + if ( $? == 0 ) { $expect = "EXPECTED"; } + } print( "$key\t\t$expect\n" ); } } From 463e85d8f624fb8f8b64592f4a6824b80683bdd9 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 19 Jan 2022 22:45:47 -0700 Subject: [PATCH 0995/1248] Add bit from SLIM that includes what parts FAIL when reporting summary of fails --- parse_cime.cs.status | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/parse_cime.cs.status b/parse_cime.cs.status index 269878d0bd..8ef8ef2bf6 100755 --- a/parse_cime.cs.status +++ b/parse_cime.cs.status @@ -384,11 +384,12 @@ sub print_categories { print( "================================================================================\n" ); foreach my $key ( @fails ) { my $expect = ""; + my $fails = $csstatus{$key}{'FAIL'}; foreach my $expectedfailfile ( @failfiles ) { `grep $key $expectedfailfile > /dev/null`; if ( $? == 0 ) { $expect = "EXPECTED"; } } - print( "$key\t\t$expect\n" ); + print( "$key\t$fails\t$expect\n" ); } } } From 8fbfcc009c26459e5c76c03309d1d58c678583c8 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Tue, 25 Jan 2022 14:32:09 -0700 Subject: [PATCH 0996/1248] Add an extra tab --- parse_cime.cs.status | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/parse_cime.cs.status b/parse_cime.cs.status index 8ef8ef2bf6..fb2d8e4283 100755 --- a/parse_cime.cs.status +++ b/parse_cime.cs.status @@ -389,7 +389,7 @@ sub print_categories { `grep $key $expectedfailfile > /dev/null`; if ( $? == 0 ) { $expect = "EXPECTED"; } } - print( "$key\t$fails\t$expect\n" ); + print( "$key\t$fails\t\t$expect\n" ); } } } From 0d1a867beb91d1e8a1aacd57a3165dd297c33a1b Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Mon, 26 Aug 2024 16:06:00 -0600 Subject: [PATCH 0997/1248] Make a little subroutine to check the expected fails --- parse_cime.cs.status | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/parse_cime.cs.status b/parse_cime.cs.status index fb2d8e4283..885b53c6c4 100755 --- a/parse_cime.cs.status +++ b/parse_cime.cs.status @@ -290,7 +290,15 @@ sub print_sumperline { } } - +sub expectedFails { + my ($key, $message, @failfiles) = @_; + my $expect = ""; + foreach my $expectedfailfile ( @failfiles ) { + `grep $key $expectedfailfile > /dev/null`; + if ( $? == 0 ) { $expect = $message; } + } + return( $expect ); +} sub print_categories { # Seperate tests into categories @@ -341,11 +349,7 @@ sub print_categories { print( "These tests passed\n" ); print( "================================================================================\n" ); foreach my $key ( @passes ) { - my $expect = ""; - foreach my $expectedfailfile ( @failfiles ) { - `grep $key $expectedfailfile > /dev/null`; - if ( $? == 0 ) { $expect = "FAILED PREVIOUSLY"; } - } + my $expect = &expectedFails( $key, "FAILED PREVIOUSLY", @failfiles ); print( "$key\t\t\t$expect\n" ); } } @@ -370,26 +374,19 @@ sub print_categories { print( "These tests are pending (some tests may fail in the pending state)\n" ); print( "================================================================================\n" ); foreach my $key ( @pendings ) { - my $expect = ""; - foreach my $expectedfailfile ( @failfiles ) { - `grep $key $expectedfailfile > /dev/null`; - if ( $? == 0 ) { $expect = "EXPECTED"; } - } + my $expect = &expectedFails( $key, "EXPECTED", @failfiles ); print( "$key\t\t$expect\n" ); } } if ( $#fails >= 0 ) { print( "================================================================================\n" ); print( "These tests failed\n" ); + print( "Test (what Failed) If expected\n" ); print( "================================================================================\n" ); foreach my $key ( @fails ) { - my $expect = ""; + my $expect = &expectedFails( $key, "EXPECTED", @failfiles ); my $fails = $csstatus{$key}{'FAIL'}; - foreach my $expectedfailfile ( @failfiles ) { - `grep $key $expectedfailfile > /dev/null`; - if ( $? == 0 ) { $expect = "EXPECTED"; } - } - print( "$key\t$fails\t\t$expect\n" ); + print( "$key\t($fails)\t\t$expect\n" ); } } } From cd6a94b3512bf9d4def7b7db1af85e77fb3e1690 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Mon, 26 Aug 2024 17:03:09 -0600 Subject: [PATCH 0998/1248] Report on the expected fails for tests --- parse_cime.cs.status | 46 +++++++++++++++++++++++++++++++++++--------- 1 file changed, 37 insertions(+), 9 deletions(-) diff --git a/parse_cime.cs.status b/parse_cime.cs.status index 885b53c6c4..264ba0708f 100755 --- a/parse_cime.cs.status +++ b/parse_cime.cs.status @@ -204,7 +204,11 @@ sub run_csstatus { do { $newline = shift(@lines); if ( $newline =~ /FAIL[ ]+$test ([^ ]+)/ ) { - $fails .= " $1"; + if ( $fails eq "" ) { + $fails = $1; + } else { + $fails .= " $1"; + } chomp( $fails ); if ( $1 eq "BASELINE" ) { if ( $newline =~ /ERROR BFAIL baseline directory/ ) { @@ -291,13 +295,31 @@ sub print_sumperline { } sub expectedFails { + # Query expected fail file for the input testname key my ($key, $message, @failfiles) = @_; my $expect = ""; + my $expectedfails = ""; foreach my $expectedfailfile ( @failfiles ) { - `grep $key $expectedfailfile > /dev/null`; - if ( $? == 0 ) { $expect = $message; } + my $fh = IO::File->new($expectedfailfile, '<') or die "ERROR:: failure opening $expectedfailfile\n"; + while( my $line = <$fh> ) { + if ( $line =~ /$key/ ) { + $expect = $message; + # Read past the testname until the test end is found... + # Keep track of all of the expected fails and return it at the end + while( my $testline = <$fh> ) { + if ( $testline =~ /phase\s+name\s*=\s*\"([a-zA-Z0-9_]+)/ ) { + if ( $expectedfails eq "" ) { + $expectedfails = $1; + } else { + $expectedfails = "$expectedfails $1"; + } + } + if ( $testline =~ /\<\/test\>/ ) { last; } + } + } + } } - return( $expect ); + return( $expect, $expectedfails ); } sub print_categories { @@ -349,7 +371,9 @@ sub print_categories { print( "These tests passed\n" ); print( "================================================================================\n" ); foreach my $key ( @passes ) { - my $expect = &expectedFails( $key, "FAILED PREVIOUSLY", @failfiles ); + my ($expect, $expectFails) = &expectedFails( $key, "FAILED PREVIOUSLY", @failfiles ); + if ( $expect ne "" ) { $expect = "$expect ($expectFails)"; } + if ($expectFails =~ /BASELINE/ ) { $expect = ""; } print( "$key\t\t\t$expect\n" ); } } @@ -358,7 +382,9 @@ sub print_categories { print( "These tests compare different to the baseline\n" ); print( "================================================================================\n" ); foreach my $key ( @compares_diff ) { - print( "$key\n" ); + my ($expect, $expectFails) = &expectedFails( $key, "EXPECTED POSSIBILITY", @failfiles ); + if ($expectFails !~ /BASELINE/ ) { $expect = ""; } + print( "$key\t\t$expect\n" ); } } if ( $#compares_diff_nobase >= 0 ) { @@ -374,17 +400,19 @@ sub print_categories { print( "These tests are pending (some tests may fail in the pending state)\n" ); print( "================================================================================\n" ); foreach my $key ( @pendings ) { - my $expect = &expectedFails( $key, "EXPECTED", @failfiles ); + my ($expect, $expectFails) = &expectedFails( $key, "EXPECTED", @failfiles ); + if ( $expect ne "" ) { $expect = "$expect ($expectFails)"; } print( "$key\t\t$expect\n" ); } } if ( $#fails >= 0 ) { print( "================================================================================\n" ); print( "These tests failed\n" ); - print( "Test (what Failed) If expected\n" ); + print( "Test (what Failed) EXPECTED (what expected to fail)\n" ); print( "================================================================================\n" ); foreach my $key ( @fails ) { - my $expect = &expectedFails( $key, "EXPECTED", @failfiles ); + my ($expect, $expectFails) = &expectedFails( $key, "EXPECTED", @failfiles ); + if ( $expect ne "" ) { $expect = "$expect ($expectFails)"; } my $fails = $csstatus{$key}{'FAIL'}; print( "$key\t($fails)\t\t$expect\n" ); } From c5aeec66333b37050bd426c678ac36f9ec3f0c62 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Mon, 26 Aug 2024 21:43:31 -0600 Subject: [PATCH 0999/1248] Add some more notes about -drydep, -fire_emis, -no-megan options options that they add testing namelists, but you can always add the fields to user_nl_clm even when they are turned off --- bld/CLMBuildNamelist.pm | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index 94f6bf7e38..15d51ccfcb 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -159,16 +159,20 @@ OPTIONS This turns on the namelist variable: use_crop -csmdata "dir" Root directory of CESM input data. Can also be set by using the CSMDATA environment variable. - -drydep Produce a drydep_inparm namelist that will go into the + -drydep Produce a drydep_inparm namelist for testing that will go into the "drv_flds_in" file for the driver to pass dry-deposition to the atm. + This populates the namelist with valid drydep settings for testing. Default: -no-drydep + Note: Can always add drydep fields to user_nl_clm even with --no-drydep (Note: buildnml copies the file for use by the driver) -dynamic_vegetation Toggle for dynamic vegetation model. (default is off) (can ONLY be turned on when BGC type is 'bgc') This turns on the namelist variable: use_cndv (Deprecated, this will be removed) - -fire_emis Produce a fire_emis_nl namelist that will go into the + -fire_emis Produce a fire_emis_nl namelist for testing that will go into the "drv_flds_in" file for the driver to pass fire emissions to the atm. + This populates the namelist with valid fire-emiss settings for testing. + Note: Can always add fire_emis fields to user_nl_clm even with --no-fire_emis (Note: buildnml copies the file for use by the driver) -glc_nec Glacier number of elevation classes [0 | 3 | 5 | 10 | 36] (default is 0) (standard option with land-ice model is 10) @@ -204,9 +208,11 @@ OPTIONS -namelist "namelist" Specify namelist settings directly on the commandline by supplying a string containing FORTRAN namelist syntax, e.g., -namelist "&clm_inparm dt=1800 /" - -no-megan DO NOT PRODUCE a megan_emis_nl namelist that will go into the + -no-megan DO NOT PRODUCE a megan_emis_nl namelist for testing that will go into the "drv_flds_in" file for the driver to pass VOCs to the atm. MEGAN (Model of Emissions of Gases and Aerosols from Nature) + This removes setting default values for testing MEGAN fields + Note: Can always add megan fields to user_nl_clm even with --no-megan (Note: buildnml copies the file for use by the driver) -[no-]note Add note to output namelist [do NOT add note] about the arguments to build-namelist. From 46a09d91c08cf39a5352f9b2e78e7622f3376503 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Mon, 26 Aug 2024 22:10:27 -0600 Subject: [PATCH 1000/1248] Update some of the documentation around the -drydep, -fire_emis and --no-megan build-namelist options --- bld/namelist_files/namelist_defaults_drydep.xml | 6 +++--- bld/namelist_files/namelist_defaults_fire_emis.xml | 4 ++-- bld/namelist_files/namelist_definition_drv_flds.xml | 6 +++++- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/bld/namelist_files/namelist_defaults_drydep.xml b/bld/namelist_files/namelist_defaults_drydep.xml index 08bb5adaef..fb73ab6646 100644 --- a/bld/namelist_files/namelist_defaults_drydep.xml +++ b/bld/namelist_files/namelist_defaults_drydep.xml @@ -5,7 +5,7 @@ - + 'O3','NO2','HNO3','NO','HO2NO2','CH3OOH','CH2O','CO','H2O2','CH3COOOH','PAN','MPAN','C2H5OOH','ONIT','POOH','C3H7OOH','ROOH','CH3COCHO','CH3COCH3','Pb','ONITR','MACROOH','XOOH','ISOPOOH','CH3OH','C2H5OH','CH3CHO','GLYALD','HYAC','HYDRALD','ALKOOH','MEKOOH','TOLOOH','TERPOOH','CH3COOH','CB1','CB2','OC1','OC2','SOA','SO2','SO4','NH3','NH4NO3' @@ -21,7 +21,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). atm/cam/chem/trop_mozart/dvel/dep_data_c201019.nc - + 'ISOP = isoprene', 'C10H16 = pinene_a + carene_3 + thujene_a', 'CH3OH = methanol', 'C2H5OH = ethanol', 'CH2O = formaldehyde', 'CH3CHO = acetaldehyde', 'CH3COOH = acetic_acid', 'CH3COCH3 = acetone' diff --git a/bld/namelist_files/namelist_defaults_fire_emis.xml b/bld/namelist_files/namelist_defaults_fire_emis.xml index b7536ba66b..54e67424d5 100644 --- a/bld/namelist_files/namelist_defaults_fire_emis.xml +++ b/bld/namelist_files/namelist_defaults_fire_emis.xml @@ -5,7 +5,7 @@ - + 'bc_a1 = BC','pom_a1 = 1.4*OC','SO2 = SO2' diff --git a/bld/namelist_files/namelist_definition_drv_flds.xml b/bld/namelist_files/namelist_definition_drv_flds.xml index 9bb1a3e3b0..f440a9a678 100644 --- a/bld/namelist_files/namelist_definition_drv_flds.xml +++ b/bld/namelist_files/namelist_definition_drv_flds.xml @@ -35,10 +35,14 @@ group="megan_emis_nl" valid_values="" > MEGAN specifier. This is in the form of: Chem-compound = megan_compound(s) - where megan_compound(s) can be the sum of megan compounds with a "+" between them. + where megan_compound(s) can be an equation with megan compounds added or subtracted together with multiplication In each equation, the item to the left of the equal sign is a CAM chemistry compound, the items to the right are compounds known to the MEGAN model (single or combinations). + Long lines for equations can be split into multiple specifiers For example: megan_specifier = 'ISOP = isoprene', 'C10H16 = pinene_a + carene_3 + thujene_a' + or... megan_specifier = 'SOAE = 0.5954*isoprene + 5.1004*(carene_3 + pinene_a + thujene_a + bornene +', + ' terpineol_4 + terpineol_a + terpinyl_ACT_a + myrtenal + sabinene + pinene_b + camphene +', + and etcetera... Date: Mon, 26 Aug 2024 23:11:11 -0600 Subject: [PATCH 1001/1248] Update documentation around the drv_flds_in testing namelists and command line options to build-namelist -drydep, -fire_emis and -no-megan --- .../customizing-the-clm-configuration.rst | 39 ++++++++++++------- 1 file changed, 26 insertions(+), 13 deletions(-) diff --git a/doc/source/users_guide/setting-up-and-running-a-case/customizing-the-clm-configuration.rst b/doc/source/users_guide/setting-up-and-running-a-case/customizing-the-clm-configuration.rst index e76a9cc6f0..a1efac897e 100644 --- a/doc/source/users_guide/setting-up-and-running-a-case/customizing-the-clm-configuration.rst +++ b/doc/source/users_guide/setting-up-and-running-a-case/customizing-the-clm-configuration.rst @@ -140,10 +140,17 @@ CLM_BLDNML_OPTS Can also be set by using the CSMDATA environment variable. -d "directory" Directory where output namelist file will be written Default: current working directory. - -drydep Produce a drydep_inparm namelist that will go into the + -drydep Produce a drydep_inparm namelist for testing that will go into the "drv_flds_in" file for the driver to pass dry-deposition to the atm. + This populates the namelist with valid drydep settings for testing. Default: -no-drydep - (Note: buildnml.csh copies the file for use by the driver) + Note: Can always add drydep fields to user_nl_clm even with --no-drydep + (Note: buildnml copies the file for use by the driver) + -fire_emis Produce a fire_emis_nl namelist for testing that will go into the + "drv_flds_in" file for the driver to pass fire emissions to the atm. + This populates the namelist with valid fire-emiss settings for testing. + Note: Can always add fire_emis fields to user_nl_clm even with --no-fire_emis + (Note: buildnml copies the file for use by the driver) -glc_grid "grid" Glacier model grid and resolution when glacier model, Only used if glc_nec > 0 for determining fglcmask Default: gland5UM @@ -185,10 +192,12 @@ CLM_BLDNML_OPTS -namelist "namelist" Specify namelist settings directly on the commandline by supplying a string containing FORTRAN namelist syntax, e.g., -namelist "&clm_inparm dt=1800 /" - -no-megan DO NOT PRODUCE a megan_emis_nl namelist that will go into the + -no-megan DO NOT PRODUCE a megan_emis_nl namelist for testing that will go into the "drv_flds_in" file for the driver to pass VOCs to the atm. MEGAN (Model of Emissions of Gases and Aerosols from Nature) - (Note: buildnml.csh copies the file for use by the driver) + This removes setting default values for testing MEGAN fields + Note: Can always add megan fields to user_nl_clm even with --no-megan + (Note: buildnml copies the file for use by the driver) -[no-]note Add note to output namelist [do NOT add note] about the arguments to build-namelist. -rcp "value" Representative concentration pathway (rcp) to use for @@ -258,6 +267,8 @@ The **$CTSMROOT/cime_config/buildnml** script already sets the resolution and ma #. -drydep +#. -fire_emis + #. -ignore_ic_date #. -ignore_ic_year @@ -291,7 +302,7 @@ To see a list of valid variables that you could set do this: .. note:: Using a 20th-Century transient compset or the ``20thC_transient`` use-case using ``CLM_NML_USE_CASE`` would set this as well, but would also use dynamic nitrogen and aerosol deposition files, so using ``-clm_demand`` would be a way to get *just* dynamic vegetation types and NOT the other files as well. -"-drydep" adds the dry-deposition namelist to the driver. This is a driver namelist, but adding the option here has CLM **build-namelist** create the ``drv_flds_in`` file that the driver will copy over and use. Invoking this option does have an impact on performance even for I compsets and will slow the model down. It's also only useful when running with an active atmosphere model that makes use of this information. +"-drydep" adds a dry-deposition namelist for testing to the driver. This is a driver namelist, but adding the option here has CLM **build-namelist** create the ``drv_flds_in`` file that the driver will copy over and use. Invoking this option does have an impact on performance even for I compsets and will slow the model down. It's also only useful when running with an active atmosphere model that makes use of this information. "-ignore_ic_date" ignores the Initial Conditions (IC) date completely for finding initial condition files to startup from. Without this option or the "-ignore_ic_year" option below, the date of the file comes into play. @@ -299,7 +310,7 @@ To see a list of valid variables that you could set do this: When "-irrig on" is used **build-namelist** will try to find surface datasets that have the irrigation model enabled (when running with Sattellitte Phenology). When running with the prognostic crop model on, "-irrig on" will turn irrigate crops on, while "-irrig off" will manage all crop areas as rain-fed without irrigation. -"no-megan" means do NOT add the MEGAN model Biogenic Volatile Organic Compounds (BVOC) namelist to the driver. This namelist is created by default, so normally this WILL be done. This is a driver namelist, so unless "no-megan" is specified the CLM **build-namelist** will create the ``drv_flds_in`` file that the driver will copy over and use (if you are running with CAM and CAM produces this file as well, it's file will have precedence). +"no-megan" means do NOT add a MEGAN model Biogenic Volatile Organic Compounds (BVOC) testing namelist to the driver. This namelist is created by default, so normally this WILL be done. This is a driver namelist, so unless "no-megan" is specified the CLM **build-namelist** will create the ``drv_flds_in`` file that the driver will copy over and use (if you are running with CAM and CAM produces this file as well, it's file will have precedence). "-note" adds a note to the bottom of the namelist file, that gives the details of how **build-namelist** was called, giving the specific command-line options given to it. @@ -363,18 +374,20 @@ Example: user_nl_clm namelist file ! Users should add all user specific namelist changes below in the form of ! namelist_var = new_namelist_value ! - ! Include namelist variables for drv_flds_in ONLY if -megan and/or -drydep options - ! are set in the CLM_NAMELIST_OPTS env variable. - ! ! EXCEPTIONS: + ! Set use_cndv by the compset you use and the CLM_BLDNML_OPTS -dynamic_vegetation setting + ! Set use_vichydro by the compset you use and the CLM_BLDNML_OPTS -vichydro setting + ! Set use_cn by the compset you use and CLM_BLDNML_OPTS -bgc setting + ! Set use_crop by the compset you use and CLM_BLDNML_OPTS -crop setting + ! Set spinup_state by the CLM_BLDNML_OPTS -bgc_spinup setting ! Set co2_ppmv with CCSM_CO2_PPMV option - ! Set dtime with L_NCPL option ! Set fatmlndfrc with LND_DOMAIN_PATH/LND_DOMAIN_FILE options ! Set finidat with RUN_REFCASE/RUN_REFDATE/RUN_REFTOD options for hybrid or branch cases ! (includes $inst_string for multi-ensemble cases) - ! Set glc_grid with GLC_GRID option - ! Set glc_smb with GLC_SMB option - ! Set maxpatch_glc with GLC_NEC option + ! or with CLM_FORCE_COLDSTART to do a cold start + ! or set it with an explicit filename here. + ! Set maxpatch_glc with GLC_NEC option + ! Set glc_do_dynglacier with GLC_TWO_WAY_COUPLING env variable !---------------------------------------------------------------------------------- hist_fincl2 = 'TG','TBOT','FIRE','FIRA','FLDS','FSDS', 'FSR','FSA','FGEV','FSH','FGR','TSOI', From f1ad74d8ee0e081f1c1448a9c3b19a8710cdbed0 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Tue, 27 Aug 2024 10:43:20 -0600 Subject: [PATCH 1002/1248] Update change log for new b4b-dev tag, make standard for python testing to be run on derecho --- doc/.ChangeLog_template | 2 +- doc/ChangeLog | 86 +++++++++++++++++++++++++++++++++++++++++ doc/ChangeSum | 1 + 3 files changed, 88 insertions(+), 1 deletion(-) diff --git a/doc/.ChangeLog_template b/doc/.ChangeLog_template index 60a7f49288..c95ea482e3 100644 --- a/doc/.ChangeLog_template +++ b/doc/.ChangeLog_template @@ -98,7 +98,7 @@ infrastructure should be run when appropriate, as described below. python testing (if python code has changed; see instructions in python/README.md; document testing done): - (any machine) - + derecho - [If python code has changed and you are NOT running aux_clm (e.g., because the only changes are in python code) then also run the clm_pymods test suite; this is a small subset of aux_clm that runs the system diff --git a/doc/ChangeLog b/doc/ChangeLog index 96c0d6735b..c77ec2204f 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,4 +1,90 @@ =============================================================== +Tag name: ctsm5.2.027 +Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326) +Date: Tue 27 Aug 2024 10:39:39 AM MDT +One-line Summary: Merge b4b-dev + +Purpose and description of changes +---------------------------------- + + +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_1 + +[ ] clm5_0 + +[ ] ctsm5_0-nwp + +[ ] clm4_5 + + +Bugs fixed +---------- + +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): + +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): + +Changes made to namelist defaults (e.g., changed parameter values): + +Changes to the datasets (e.g., parameter, surface or initial files): + +Changes to documentation: + +Notes of particular relevance for developers: +--------------------------------------------- + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): + +Changes to tests or testing: + + +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 - PASS + + 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 bit-for-bit + +Other details +------------- + +List any git submodules updated (cime, rtm, mosart, cism, fates, etc.): cdeps + +Pull Requests that document the changes (include PR ids): +(https://github.com/ESCOMP/ctsm/pull) + +=============================================================== +=============================================================== Tag name: ctsm5.2.026 Originator(s): slevis (Samuel Levis,UCAR/TSS,303-665-1310) Date: Fri 23 Aug 2024 05:17:56 PM MDT diff --git a/doc/ChangeSum b/doc/ChangeSum index 6071278954..468cbe0077 100644 --- a/doc/ChangeSum +++ b/doc/ChangeSum @@ -1,5 +1,6 @@ Tag Who Date Summary ============================================================================================================================ + ctsm5.2.027 erik 08/27/2024 Merge b4b-dev ctsm5.2.026 slevis 08/23/2024 Turn on excess ice, explicit AC, Leung_2023 for clm6 ctsm5.2.025 samrabin 08/23/2024 Minor fixes to li2024 fire methods ctsm5.2.024 samrabin 08/22/2024 Improve li2024 fire methods From ddec5536cd6ae2e040315f550c71d464302ae09f Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Tue, 27 Aug 2024 13:13:51 -0600 Subject: [PATCH 1003/1248] Update change files --- doc/ChangeLog | 48 +++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 43 insertions(+), 5 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index c77ec2204f..e481310125 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -7,6 +7,17 @@ One-line Summary: Merge b4b-dev Purpose and description of changes ---------------------------------- +Bring b4b-dev branch to main CTSM development. + +- PLUMBER2 for ctsm5.2 datasets +- Last bit of PPE changes for namelist and parameter file settings +- Update run_sys_tests on Derecho for compiler jobs to run using 16 tasks +- Bring in a fix for dust emissions for coupling with CAM + +Update cs.status parsing script to make expected BASELINE fails more obvious + +Fix some issues with finding IC files for certain lnd_tuning_modes: all for cam7, + clm5_0_cam6.0, and clm6_0_cam6.0 Significant changes to scientifically-supported configurations -------------------------------------------------------------- @@ -31,27 +42,52 @@ Bugs fixed ---------- List of CTSM issues fixed (include CTSM Issue # and description) [one per line]: + Fixes #2687 -- Error in Prigent streams setting when coupled to CAM + Fixes #2709 -- Problem in megan_specifier checking in namelist due to update in CMEPS + Fixes #2712 -- Allow user to change drydep, fire_emiss, megan namelists in user_nl_clm + even when those CLM_BLDNML_OPTS are off + Fixes #2567 -- PPE prep work + Fixes #1652 -- c3psn is wrong for some PFT's not currently used + Fixes #2484 -- update PLUMBER2 user-mods to ctsm5.2 surface datasets Notes of particular relevance for users --------------------------------------- Caveats for users (e.g., need to interpolate initial conditions): + atm_provides_lightning can be set in drv_flds_in now, but doesn't do anything Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): + Changed behavior for CLM_BLDNML_OPTS command line options: -drydep, -megan, and -fire_emis + Turning them on now only adds test namelists to use, you can add custom settings for them + in user_nl_clm with or without them on -Changes made to namelist defaults (e.g., changed parameter values): + atm_provides_lightning and atm_ozone_frequency can be set in user_nl_clm for drv_flds_in + The first is not active, and the second you should probably have CAM set -Changes to the datasets (e.g., parameter, surface or initial files): + New XML variable: PLUMBER2SITE to set the site name for PLUMBER2 cases -Changes to documentation: +Changes made to namelist defaults (e.g., changed parameter values): PLUMBER2 datasets + + Using PLUMBER2 user-mods now gives you ctsm5.2 surface datasets + +Changes to the datasets (e.g., parameter, surface or initial files): parameter files + New parameter file with c3psn corrected and ndays_on changed to PFT + new parameters: crit_onset_gdd_sf, zbedrock, zbedrock_sf + +Changes to documentation: Yes regarding build-namelist command line options listed above Notes of particular relevance for developers: --------------------------------------------- Caveats for developers (e.g., code that is duplicated that requires double maintenance): + When LND_SETS_DUST_EMIS_DRV_FLD==FALSE (so coupled to CAM) -- The CAM $CASEDIR/Buildconf/camconf/drv_flds_in namelist is read in to get the CAM drv_flds_in settings. For this to work correctly + the drydep, and fire-emiss subroutines need to be after the dust_emis subroutine which reads in + the CAM drv_flds_in. + See plan to phase out LND_SETS_DUST_EMIS_DRV_FLD here: + https://github.com/ESCOMP/CTSM/issues/2713 Changes to tests or testing: - + Updated parameter files for some specific test mods Testing summary: regular ---------------- @@ -59,7 +95,7 @@ Testing summary: regular build-namelist tests (if CLMBuildNamelist.pm has changed): - derecho - PASS + derecho - PASS (1005 different because of new parameter files) python testing (if python code has changed; see instructions in python/README.md; document testing done): @@ -79,9 +115,11 @@ Other details ------------- List any git submodules updated (cime, rtm, mosart, cism, fates, etc.): cdeps + cdeps to cdeps1.0.47 Pull Requests that document the changes (include PR ids): (https://github.com/ESCOMP/ctsm/pull) + https://github.com/ESCOMP/CTSM/pull/2731 -- merge b4b-dev =============================================================== =============================================================== From bae5c8c9553d4ea9cb986a98187720478f524281 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Tue, 27 Aug 2024 22:10:38 -0600 Subject: [PATCH 1004/1248] Update ChangeLog with more details --- doc/ChangeLog | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index e481310125..cf160fce82 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,7 +1,7 @@ =============================================================== Tag name: ctsm5.2.027 Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326) -Date: Tue 27 Aug 2024 10:39:39 AM MDT +Date: Tue 27 Aug 2024 10:09:39 PM MDT One-line Summary: Merge b4b-dev Purpose and description of changes @@ -56,6 +56,13 @@ Notes of particular relevance for users Caveats for users (e.g., need to interpolate initial conditions): atm_provides_lightning can be set in drv_flds_in now, but doesn't do anything + When LND_SETS_DUST_EMIS_DRV_FLD==FALSE and you are coupled to CAM + and there is a conflict between CAM and CTSM settings, a message like this happens: + + Using clm5_0_cam6.0 for lnd_tuning_mode +Read in the drv_flds_in file generated by CAM's build-namelist +Build::Namelist::_merge_nl:ERROR: A variable was already set, so we are terminating on the conflict variable name is =dep_data_file + Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): Changed behavior for CLM_BLDNML_OPTS command line options: -drydep, -megan, and -fire_emis Turning them on now only adds test namelists to use, you can add custom settings for them From 9fd631ac427e4db07244eb88d583bd3ecc0c1821 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 28 Aug 2024 14:33:19 -0600 Subject: [PATCH 1005/1248] Update CDEPS to hopefully resolve the CDEPS build issue I ran into --- .gitmodules | 2 +- components/cdeps | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitmodules b/.gitmodules index 80c1640e72..d16396da55 100644 --- a/.gitmodules +++ b/.gitmodules @@ -92,7 +92,7 @@ fxDONOTUSEurl = https://github.com/ESCOMP/CMEPS.git [submodule "cdeps"] path = components/cdeps url = https://github.com/ESCOMP/CDEPS.git -fxtag = cdeps1.0.47 +fxtag = cdeps1.0.48 fxrequired = ToplevelRequired # Standard Fork to compare to with "git fleximod test" to ensure personal forks aren't committed fxDONOTUSEurl = https://github.com/ESCOMP/CDEPS.git diff --git a/components/cdeps b/components/cdeps index 7476950699..7b0b3a8272 160000 --- a/components/cdeps +++ b/components/cdeps @@ -1 +1 @@ -Subproject commit 7476950699909813d1938a34bd8d71bf5bfbf1e9 +Subproject commit 7b0b3a827241c53d296ec877cb1f59966bf5e5bf From 4bc95457011259127b8c509c48c221c6ff19a8f4 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 28 Aug 2024 16:30:12 -0600 Subject: [PATCH 1006/1248] Increase wall limit for test --- cime_config/testdefs/testlist_clm.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index de9cd0b1be..d1c3171c98 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -152,7 +152,7 @@ - + From 41c3e092b53a749f2002d7b50b0e0965ca19a19e Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 28 Aug 2024 17:08:08 -0600 Subject: [PATCH 1007/1248] Remove tests that now pass from expected fails --- cime_config/testdefs/ExpectedTestFails.xml | 23 +--------------------- 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/cime_config/testdefs/ExpectedTestFails.xml b/cime_config/testdefs/ExpectedTestFails.xml index d1e0a1a8b8..6f4d9ac2dc 100644 --- a/cime_config/testdefs/ExpectedTestFails.xml +++ b/cime_config/testdefs/ExpectedTestFails.xml @@ -8,7 +8,7 @@ - ... + ... @@ -52,13 +52,6 @@ - - - FAIL - #2444 - - - FAIL @@ -113,20 +106,6 @@ - - - FAIL - #2373 - - - - - - FAIL - #2373 - - - FAIL From 729b688b262bd305d83a1e6ebee8bd29a2d76646 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 28 Aug 2024 18:52:21 -0600 Subject: [PATCH 1008/1248] Another test no longer failing, and fix accidental addition --- cime_config/testdefs/ExpectedTestFails.xml | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/cime_config/testdefs/ExpectedTestFails.xml b/cime_config/testdefs/ExpectedTestFails.xml index 6f4d9ac2dc..e18b15a26e 100644 --- a/cime_config/testdefs/ExpectedTestFails.xml +++ b/cime_config/testdefs/ExpectedTestFails.xml @@ -8,7 +8,7 @@ - ... + ... @@ -165,17 +165,6 @@ - - - FAIL - #2373 - - - FAIL - FATES#701 - - - FAIL From 4a62d0dc1edda9ee96fada2b4280f05f8d4c2b9b Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 28 Aug 2024 21:14:20 -0600 Subject: [PATCH 1009/1248] Update date for change files --- doc/ChangeLog | 2 +- doc/ChangeSum | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index cf160fce82..3499c7d720 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,7 +1,7 @@ =============================================================== Tag name: ctsm5.2.027 Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326) -Date: Tue 27 Aug 2024 10:09:39 PM MDT +Date: Wed 28 Aug 2024 09:13:22 PM MDT One-line Summary: Merge b4b-dev Purpose and description of changes diff --git a/doc/ChangeSum b/doc/ChangeSum index 468cbe0077..fdf253760f 100644 --- a/doc/ChangeSum +++ b/doc/ChangeSum @@ -1,6 +1,6 @@ Tag Who Date Summary ============================================================================================================================ - ctsm5.2.027 erik 08/27/2024 Merge b4b-dev + ctsm5.2.027 erik 08/28/2024 Merge b4b-dev ctsm5.2.026 slevis 08/23/2024 Turn on excess ice, explicit AC, Leung_2023 for clm6 ctsm5.2.025 samrabin 08/23/2024 Minor fixes to li2024 fire methods ctsm5.2.024 samrabin 08/22/2024 Improve li2024 fire methods From 9afb92152bb65d005022db52c0d586c6737f795c Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Thu, 29 Aug 2024 09:41:24 -0700 Subject: [PATCH 1010/1248] update fates tag to latest This brings fates up to the latest tag (fire weather refactor) --- .gitmodules | 2 +- src/fates | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitmodules b/.gitmodules index d16396da55..7274b9acd2 100644 --- a/.gitmodules +++ b/.gitmodules @@ -28,7 +28,7 @@ [submodule "fates"] path = src/fates url = https://github.com/NGEET/fates -fxtag = sci.1.77.2_api.36.0.0 +fxtag = sci.1.78.2_api.36.0.0 fxrequired = AlwaysRequired # Standard Fork to compare to with "git fleximod test" to ensure personal forks aren't committed fxDONOTUSEurl = https://github.com/NCAR/fates-release diff --git a/src/fates b/src/fates index e372f0b6cd..e06e0dfcaf 160000 --- a/src/fates +++ b/src/fates @@ -1 +1 @@ -Subproject commit e372f0b6cdf46f76f888ee6ac92d9a3572464e8b +Subproject commit e06e0dfcaf6347993d47dc29944e952d3e4412f7 From 44a7e34fe24eb1ca658fc1632b56f53801308901 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Thu, 29 Aug 2024 11:28:49 -0600 Subject: [PATCH 1011/1248] Update new ctsm60_params file and ./rimport --- 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 1cc58a30b6..b4bfbfdc26 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -551,7 +551,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). -/glade/work/samrabin/ctsm_fire-li2024-pr2_paramfiles/ctsm60_params.c240822.li2024crujra.nc +lnd/clm2/paramdata/ctsm60_params.c240822.nc lnd/clm2/paramdata/ctsm51_params.c240814.nc lnd/clm2/paramdata/clm50_params.c240814.nc lnd/clm2/paramdata/clm45_params.c240814.nc From 61fa7179b61bd2afd2d728d5cdd6ccdc354eab83 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Thu, 29 Aug 2024 12:51:43 -0600 Subject: [PATCH 1012/1248] Update default fire_emis_factors_file. --- bld/namelist_files/namelist_defaults_fire_emis.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bld/namelist_files/namelist_defaults_fire_emis.xml b/bld/namelist_files/namelist_defaults_fire_emis.xml index b7536ba66b..37fc85d721 100644 --- a/bld/namelist_files/namelist_defaults_fire_emis.xml +++ b/bld/namelist_files/namelist_defaults_fire_emis.xml @@ -17,6 +17,6 @@ attributes from the config_cache.xml file (with keys converted to upper-case). 'bc_a1 = BC','pom_a1 = 1.4*OC','SO2 = SO2' -lnd/clm2/firedata/fire_emis_factors_c140116.nc +lnd/clm2/firedata/fire_emission_factors_78PFTs_c20240624.nc From 6be8c556c995352217b54a641c013ca6d6f8ee09 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Thu, 29 Aug 2024 14:47:53 -0600 Subject: [PATCH 1013/1248] Add global attribute write of dataset compatability as a floating point number to surface datasets --- tools/mksurfdata_esmf/src/mkfileMod.F90 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/mksurfdata_esmf/src/mkfileMod.F90 b/tools/mksurfdata_esmf/src/mkfileMod.F90 index e22394e1e1..a3423e0c7b 100644 --- a/tools/mksurfdata_esmf/src/mkfileMod.F90 +++ b/tools/mksurfdata_esmf/src/mkfileMod.F90 @@ -105,6 +105,7 @@ subroutine mkfile_define_atts(pioid, dynlanduse) character(len= 10) :: time ! temporary character(len= 5) :: zone ! temporary integer :: rcode + real(r4), parameter :: data_version = 5.3 ! Compatibility version number of the datasets to create character(len=*), parameter :: subname = 'mkfile_define_atts' !----------------------------------------------------------------------- @@ -126,6 +127,7 @@ subroutine mkfile_define_atts(pioid, dynlanduse) str = 'Community Land Model: CLM5' rcode = pio_put_att (pioid, pio_global, 'Source', trim(str)) rcode = pio_put_att (pioid, pio_global, 'Version', trim(gitdescribe)) + rcode = pio_put_att (pioid, pio_global, 'Dataset_Version', data_version) rcode = pio_put_att (pioid, pio_global, 'Logname', trim(logname)) rcode = pio_put_att (pioid, pio_global, 'Host', trim(hostname)) rcode = pio_put_att (pioid, pio_global, 'Number-of-tasks', npes) From 92510bbcbf4e142fdf746a218390cc6372209262 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Thu, 29 Aug 2024 16:29:10 -0600 Subject: [PATCH 1014/1248] Update new raw dataset paths to /inputdata --- .../gen_mksurfdata_namelist.xml | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/tools/mksurfdata_esmf/gen_mksurfdata_namelist.xml b/tools/mksurfdata_esmf/gen_mksurfdata_namelist.xml index 683ea14058..e6cbdcf426 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/CTSM53RawData/globalctsm53histMKSRFDeg025_240709/mksrf_landuse_ctsm53_pftlai_CLIM.c240709.nc + /glade/campaign/cesm/cesmdata/inputdata/lnd/clm2/rawdata/CTSM53RawData/globalctsm53histMKSRFDeg025_240709/mksrf_landuse_ctsm53_pftlai_CLIM.c240709.nc lnd/clm2/mappingdata/grids/UNSTRUCTgrid_0.25x0.25_nomask_cdf5_c200129.nc @@ -25,7 +25,7 @@ - /glade/campaign/cesm/development/lmwg/landuse_source_data/CTSM53RawData/globalctsm53histMKSRFDeg025_240709/mksrf_landuse_ctsm53_soilcolor_CLIM.c240709.nc + /glade/campaign/cesm/cesmdata/inputdata/lnd/clm2/rawdata/CTSM53RawData/globalctsm53histMKSRFDeg025_240709/mksrf_landuse_ctsm53_soilcolor_CLIM.c240709.nc lnd/clm2/mappingdata/grids/UNSTRUCTgrid_0.25x0.25_nomask_cdf5_c200129.nc @@ -221,28 +221,28 @@ version of the raw dataset will probably go away. - /glade/campaign/cesm/development/lmwg/landuse_source_data/CTSM53RawData/globalctsm53histTRENDY2024Deg025_240728/mksrf_landuse_ctsm53_histTRENDY2024_1700.c240728.nc + /glade/campaign/cesm/cesmdata/inputdata/lnd/clm2/rawdata/CTSM53RawData/globalctsm53histTRENDY2024Deg025_240728/mksrf_landuse_ctsm53_histTRENDY2024_1700.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_1850.cdf5.c20220325.nc lnd/clm2/rawdata/gao_oneill_urban/historical/urban_properties_GaoOneil_05deg_ThreeClass_1850_cdf5_c20220910.nc - /glade/campaign/cesm/development/lmwg/landuse_source_data/CTSM53RawData/globalctsm53histTRENDY2023Deg025_240709/mksrf_landuse_ctsm53_histTRENDY2023_1850.c240709.nc + /glade/campaign/cesm/cesmdata/inputdata/lnd/clm2/rawdata/CTSM53RawData/globalctsm53histTRENDY2024Deg025_240728/mksrf_landuse_ctsm53_histTRENDY2024_1850.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_1850.cdf5.c20220325.nc lnd/clm2/rawdata/gao_oneill_urban/historical/urban_properties_GaoOneil_05deg_ThreeClass_1850_cdf5_c20220910.nc - /glade/campaign/cesm/development/lmwg/landuse_source_data/CTSM53RawData/globalctsm53histTRENDY2023Deg025_240709/mksrf_landuse_ctsm53_histTRENDY2023_2000.c240709.nc + /glade/campaign/cesm/cesmdata/inputdata/lnd/clm2/rawdata/CTSM53RawData/globalctsm53histTRENDY2024Deg025_240728/mksrf_landuse_ctsm53_histTRENDY2024_2000.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_2000.cdf5.c20220325.nc lnd/clm2/rawdata/gao_oneill_urban/historical/urban_properties_GaoOneil_05deg_ThreeClass_2000_cdf5_c20220910.nc - /glade/campaign/cesm/development/lmwg/landuse_source_data/CTSM53RawData/globalctsm53histTRENDY2023Deg025_240709/mksrf_landuse_ctsm53_histTRENDY2023_2005.c240709.nc + /glade/campaign/cesm/cesmdata/inputdata/lnd/clm2/rawdata/CTSM53RawData/globalctsm53histTRENDY2024Deg025_240728/mksrf_landuse_ctsm53_histTRENDY2024_2005.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_2005.cdf5.c20220325.nc lnd/clm2/rawdata/gao_oneill_urban/historical/urban_properties_GaoOneil_05deg_ThreeClass_2005_cdf5_c20220910.nc @@ -268,7 +268,7 @@ version of the raw dataset will probably go away. - /glade/campaign/cesm/development/lmwg/landuse_source_data/CTSM53RawData/globalctsm53histTRENDY2024Deg025_240728/mksrf_landuse_ctsm53_histTRENDY2024_%y.c240728.nc + /glade/campaign/cesm/cesmdata/inputdata/lnd/clm2/rawdata/CTSM53RawData/globalctsm53histTRENDY2024Deg025_240728/mksrf_landuse_ctsm53_histTRENDY2024_%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/historical/urban_properties_GaoOneil_05deg_ThreeClass_%y_cdf5_c20220910.nc @@ -283,7 +283,7 @@ version of the raw dataset will probably go away. - /glade/campaign/cesm/development/lmwg/landuse_source_data/CTSM53RawData/globalctsm53TRSSP126Deg025_240728/mksrf_landuse_ctsm53_TRSSP126_%y.c240728.nc + /glade/campaign/cesm/cesmdata/inputdata/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 @@ -296,21 +296,21 @@ version of the raw dataset will probably go away. - /glade/campaign/cesm/development/lmwg/landuse_source_data/CTSM53RawData/globalctsm53TRSSP119Deg025_240728/mksrf_landuse_ctsm53_TRSSP119_%y.c240728.nc + /glade/campaign/cesm/cesmdata/inputdata/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/development/lmwg/landuse_source_data/CTSM53RawData/globalctsm53TRSSP245Deg025_240728/mksrf_landuse_ctsm53_TRSSP245_%y.c240728.nc + /glade/campaign/cesm/cesmdata/inputdata/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/development/lmwg/landuse_source_data/CTSM53RawData/globalctsm53TRSSP370Deg025_240728/mksrf_landuse_ctsm53_TRSSP370_%y.c240728.nc + /glade/campaign/cesm/cesmdata/inputdata/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 @@ -324,14 +324,14 @@ version of the raw dataset will probably go away. - /glade/campaign/cesm/development/lmwg/landuse_source_data/CTSM53RawData/globalctsm53TRSSP460Deg025_240728/mksrf_landuse_ctsm53_TRSSP460_%y.c240728.nc + /glade/campaign/cesm/cesmdata/inputdata/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/development/lmwg/landuse_source_data/CTSM53RawData/globalctsm53TRSSP585Deg025_240728/mksrf_landuse_ctsm53_TRSSP585_%y.c240728.nc + /glade/campaign/cesm/cesmdata/inputdata/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 From cc86114e31743b33b748cffd82cb1f260bf58f9b Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Thu, 29 Aug 2024 17:12:29 -0600 Subject: [PATCH 1015/1248] Update user_nl_clm to ctsm60_params_cn30.c240822.nc in ...CN30 testmod --- .../clm/clm60_monthly_matrixcn_soilCN30/user_nl_clm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cime_config/testdefs/testmods_dirs/clm/clm60_monthly_matrixcn_soilCN30/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/clm60_monthly_matrixcn_soilCN30/user_nl_clm index 4bfc0520f8..d51360c82b 100644 --- a/cime_config/testdefs/testmods_dirs/clm/clm60_monthly_matrixcn_soilCN30/user_nl_clm +++ b/cime_config/testdefs/testmods_dirs/clm/clm60_monthly_matrixcn_soilCN30/user_nl_clm @@ -1,2 +1,2 @@ use_soil_matrixcn = .true. -paramfile = '$DIN_LOC_ROOT/lnd/clm2/paramdata/ctsm60_params_cn30.c240814.nc' +paramfile = '$DIN_LOC_ROOT/lnd/clm2/paramdata/ctsm60_params_cn30.c240822.nc' From e908083e6e67a2cb777383baaa5c55b388369b7b Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Fri, 30 Aug 2024 14:19:30 -0600 Subject: [PATCH 1016/1248] Remove --vic option from mksurfdata_esmf and from testlist_clm --- cime_config/testdefs/testlist_clm.xml | 41 ------------------- .../gen_mksurfdata_jobscript_multi.py | 4 +- .../ctsm/toolchain/gen_mksurfdata_namelist.py | 24 +---------- 3 files changed, 3 insertions(+), 66 deletions(-) diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index d1c3171c98..1a4f331aa0 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -914,22 +914,6 @@ - - - - - - - - - - - - - - - - @@ -1263,22 +1247,6 @@ - - - - - - - - - - - - - - - - @@ -2416,15 +2384,6 @@ - - - - - - - - - diff --git a/python/ctsm/toolchain/gen_mksurfdata_jobscript_multi.py b/python/ctsm/toolchain/gen_mksurfdata_jobscript_multi.py index 6c38efdd0d..0d5ca9c376 100755 --- a/python/ctsm/toolchain/gen_mksurfdata_jobscript_multi.py +++ b/python/ctsm/toolchain/gen_mksurfdata_jobscript_multi.py @@ -243,11 +243,11 @@ def main(): "5x5_amazon", ), "crop-global-present": ( - "--start-year 2000 --end-year 2000 --vic --res", + "--start-year 2000 --end-year 2000 --res", "standard_res", ), "crop-global-present-low-res": ( - "--start-year 2000 --end-year 2000 --vic --res", + "--start-year 2000 --end-year 2000 --res", "low_res", ), "crop-global-present-ne16": ( diff --git a/python/ctsm/toolchain/gen_mksurfdata_namelist.py b/python/ctsm/toolchain/gen_mksurfdata_namelist.py index 662e58bc8b..fa16f8ae6a 100755 --- a/python/ctsm/toolchain/gen_mksurfdata_namelist.py +++ b/python/ctsm/toolchain/gen_mksurfdata_namelist.py @@ -166,16 +166,6 @@ def get_parser(): dest="input_path", default="/glade/campaign/cesm/cesmdata/inputdata/", ) - parser.add_argument( - "--vic", - help=""" - Flag for adding the fields required for the VIC model. - [default: %(default)s] - """, - action="store_true", - dest="vic_flag", - default=False, - ) parser.add_argument( "--inlandwet", help=""" @@ -273,7 +263,6 @@ def main(): input_path = args.input_path nocrop_flag = args.crop_flag nosurfdata_flag = args.surfdata_flag - vic_flag = args.vic_flag inlandwet = args.inlandwet glc_flag = args.glc_flag potveg = args.potveg_flag @@ -400,7 +389,6 @@ def main(): force_model_mesh_file, force_model_mesh_nx, force_model_mesh_ny, - vic_flag, rawdata_files, landuse_fname, mksrf_ftopostats_override, @@ -413,7 +401,6 @@ def main(): # ------------------- write_nml_outdata( nosurfdata_flag, - vic_flag, inlandwet, glc_flag, hostname, @@ -573,7 +560,6 @@ def determine_pft_years(start_year, end_year, potveg): def write_nml_outdata( nosurfdata_flag, - vic_flag, inlandwet, glc_flag, hostname, @@ -604,7 +590,6 @@ def write_nml_outdata( nlfile.write(f" numpft = {num_pft} \n") nlfile.write(f" no_inlandwet = .{str(not inlandwet).lower()}. \n") nlfile.write(f" outnc_3dglc = .{str(glc_flag).lower()}. \n") - nlfile.write(f" outnc_vic = .{str(vic_flag).lower()}. \n") nlfile.write(" outnc_large_files = .false. \n") nlfile.write(" outnc_double = .true. \n") nlfile.write(f" logname = '{logname}' \n") @@ -617,7 +602,6 @@ def write_nml_rawinput( force_model_mesh_file, force_model_mesh_nx, force_model_mesh_ny, - vic_flag, rawdata_files, landuse_fname, mksrf_ftopostats_override, @@ -643,7 +627,7 @@ def write_nml_rawinput( for key, value in rawdata_files.items(): if key == "mksrf_ftopostats" and mksrf_ftopostats_override != "": nlfile.write(f" mksrf_ftopostats_override = '{mksrf_ftopostats_override}' \n") - elif "_fvic" not in key and "mksrf_fvegtyp" not in key and "mksrf_fgrid" not in key: + elif "mksrf_fvegtyp" not in key and "mksrf_fgrid" not in key: # write everything else nlfile.write(f" {key} = '{value}' \n") @@ -692,12 +676,6 @@ def write_nml_rawinput( nlfile.write(f" mksrf_fpctlak = '{mksrf_fpctlak}' \n") nlfile.write(f" mksrf_furban = '{mksrf_furban}' \n") - if vic_flag: - mksrf_fvic = rawdata_files["mksrf_fvic"] - nlfile.write(f" mksrf_fvic = '{mksrf_fvic}' \n") - mksrf_fvic_mesh = rawdata_files["mksrf_fvic_mesh"] - nlfile.write(f" mksrf_fvic_mesh = '{mksrf_fvic_mesh}' \n") - nlfile.write(f" mksrf_fdynuse = '{landuse_fname} ' \n") return must_run_download_input_data From 1d87ee5d1b427a24f2a423d596031d96f7bc81b3 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Fri, 30 Aug 2024 14:28:51 -0600 Subject: [PATCH 1017/1248] Rm the --hires_pft option while the corresponding raw data need updating --- .../test/test_sys_gen_mksurfdata_namelist.py | 1 - .../gen_mksurfdata_jobscript_multi.py | 1 - .../ctsm/toolchain/gen_mksurfdata_namelist.py | 30 ++----------------- .../gen_mksurfdata_namelist.xml | 15 ---------- 4 files changed, 2 insertions(+), 45 deletions(-) diff --git a/python/ctsm/test/test_sys_gen_mksurfdata_namelist.py b/python/ctsm/test/test_sys_gen_mksurfdata_namelist.py index 29745e9d80..db8581ef24 100755 --- a/python/ctsm/test/test_sys_gen_mksurfdata_namelist.py +++ b/python/ctsm/test/test_sys_gen_mksurfdata_namelist.py @@ -99,7 +99,6 @@ def test_hires_namelist(self): "mpasa15", "--glc-nec", "10", - "--hires_pft", "--hires_soitex", ] ) diff --git a/python/ctsm/toolchain/gen_mksurfdata_jobscript_multi.py b/python/ctsm/toolchain/gen_mksurfdata_jobscript_multi.py index 0d5ca9c376..1afb9e86cb 100755 --- a/python/ctsm/toolchain/gen_mksurfdata_jobscript_multi.py +++ b/python/ctsm/toolchain/gen_mksurfdata_jobscript_multi.py @@ -267,7 +267,6 @@ def main(): "mpasa480", ), "crop-global-present-nldas": ( - # TODO slevis: --hirespft uses old data for now, so keep out "--start-year 2000 --end-year 2000 --res", "nldas_res", ), diff --git a/python/ctsm/toolchain/gen_mksurfdata_namelist.py b/python/ctsm/toolchain/gen_mksurfdata_namelist.py index fa16f8ae6a..20bd7f7f44 100755 --- a/python/ctsm/toolchain/gen_mksurfdata_namelist.py +++ b/python/ctsm/toolchain/gen_mksurfdata_namelist.py @@ -186,19 +186,6 @@ def get_parser(): dest="glc_flag", default=False, ) - parser.add_argument( - "--hires_pft", - help=""" - If you want to use the high-resolution pft dataset rather - than the default lower resolution dataset. - (Low resolution is at quarter-degree, high resolution at 3-minute) - [Note: hires only available for 1850 and 2005.] - [default: %(default)s] - """, - action="store_true", - dest="hres_pft", - default=False, - ) parser.add_argument( "--hires_soitex", help=""" @@ -268,7 +255,7 @@ def main(): potveg = args.potveg_flag glc_nec = args.glc_nec - hires_pft, hires_soitex = process_hires_options(args, start_year, end_year) + hires_soitex = process_hires_options(args, start_year, end_year) if force_model_mesh_file is not None: open_mesh_file(force_model_mesh_file, force_model_mesh_nx, force_model_mesh_ny) @@ -299,7 +286,6 @@ def main(): # create attribute list for parsing xml file attribute_list = { - "hires_pft": hires_pft, "hires_soitex": hires_soitex, "pft_years": pft_years, "pft_years_ssp": pft_years_ssp, @@ -427,23 +413,11 @@ def process_hires_options(args, start_year, end_year): """ Process options related to hi-res """ - if args.hres_pft: - if (start_year == 1850 and end_year == 1850) or (start_year == 2005 and end_year == 2005): - hires_pft = "on" - else: - error_msg = ( - "ERROR: for --hires_pft you must set both start-year " - "and end-year to 1850 or to 2005" - ) - sys.exit(error_msg) - else: - hires_pft = "off" - if args.hres_soitex: hires_soitex = "on" else: hires_soitex = "off" - return hires_pft, hires_soitex + return hires_soitex def check_ssp_years(start_year, end_year): diff --git a/tools/mksurfdata_esmf/gen_mksurfdata_namelist.xml b/tools/mksurfdata_esmf/gen_mksurfdata_namelist.xml index e6cbdcf426..1e050a295f 100644 --- a/tools/mksurfdata_esmf/gen_mksurfdata_namelist.xml +++ b/tools/mksurfdata_esmf/gen_mksurfdata_namelist.xml @@ -13,10 +13,6 @@ /glade/campaign/cesm/cesmdata/inputdata/lnd/clm2/rawdata/CTSM53RawData/globalctsm53histMKSRFDeg025_240709/mksrf_landuse_ctsm53_pftlai_CLIM.c240709.nc lnd/clm2/mappingdata/grids/UNSTRUCTgrid_0.25x0.25_nomask_cdf5_c200129.nc - - lnd/clm2/rawdata/pftcftdynharv.0.05x0.05.LUH2.histsimyr2005.c190116/mksrf_lai_histclm52deg005_earthstatmirca_2005.cdf5.c220228.nc - lnd/clm2/mappingdata/grids/UNSTRUCTgrid_3x3min_nomask_cdf5_c200129.nc - @@ -28,10 +24,6 @@ /glade/campaign/cesm/cesmdata/inputdata/lnd/clm2/rawdata/CTSM53RawData/globalctsm53histMKSRFDeg025_240709/mksrf_landuse_ctsm53_soilcolor_CLIM.c240709.nc lnd/clm2/mappingdata/grids/UNSTRUCTgrid_0.25x0.25_nomask_cdf5_c200129.nc - - lnd/clm2/rawdata/pftcftdynharv.0.05x0.05.LUH2.histsimyr2005.c190116/mksrf_soilcolor_histclm52deg005_earthstatmirca_2005.cdf5.c220228.nc - lnd/clm2/mappingdata/grids/UNSTRUCTgrid_3x3min_nomask_cdf5_c200129.nc - @@ -248,13 +240,6 @@ version of the raw dataset will probably go away. lnd/clm2/rawdata/gao_oneill_urban/historical/urban_properties_GaoOneil_05deg_ThreeClass_2005_cdf5_c20220910.nc - - lnd/clm2/rawdata/pftcftdynharv.0.05x0.05.LUH2.histsimyr2005.c190116/mksrf_landuse_clm52deg005_histLUH2_2005.cdf5.c190119.nc - lnd/clm2/mappingdata/grids/UNSTRUCTgrid_3x3min_nomask_cdf5_c200129.nc - lnd/clm2/rawdata/lake_area/mksurf_lake_0.05x0.05_hist_clm5_hydrolakes_2005.cdf5.c20220325.nc - lnd/clm2/rawdata/gao_oneill_urban/historical/urban_properties_GaoOneil_05deg_ThreeClass_2005_cdf5_c20220910.nc - - lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.histsimyr0850-1850.c20230226/mksrf_landuse_ctsm52_histLUH2_%y.c20230226.nc From b6a98620203fe59b5cf78b659ee3acd79080ac96 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Fri, 30 Aug 2024 14:41:40 -0600 Subject: [PATCH 1018/1248] Updates and cleanup for make all to work --- python/ctsm/subset_data.py | 8 -------- tools/mksurfdata_esmf/Makefile | 4 ++-- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/python/ctsm/subset_data.py b/python/ctsm/subset_data.py index bc9ce97962..d38aee1308 100644 --- a/python/ctsm/subset_data.py +++ b/python/ctsm/subset_data.py @@ -597,10 +597,6 @@ def setup_files(args, defaults, cesmroot): clmforcingindir, os.path.join(defaults.get("surfdat", "dir")), ), - "mesh_dir": os.path.join( - clmforcingindir, - os.path.join(defaults.get("surfdat", "mesh_dir")), - ), "fluse_dir": os.path.join( clmforcingindir, os.path.join(defaults.get("landuse", "dir")), @@ -608,7 +604,6 @@ def setup_files(args, defaults, cesmroot): "fsurf_in": fsurf_in, "fsurf_out": fsurf_out, "fluse_in": fluse_in, - "mesh_surf": defaults.get("surfdat", "mesh_surf"), "datm_tuple": DatmFiles( dir_input_datm, dir_output_datm, @@ -736,9 +731,6 @@ def subset_region(args, file_dict: dict): specify_fsurf_out=file_dict["fsurf_out"], ) - # if region.create_mesh: - # region.create_mesh_at_reg (file_dict["mesh_dir"], file_dict["mesh_surf"]) - # -- Create CTSM transient landuse data file if region.create_landuse: region.create_landuse_at_reg( diff --git a/tools/mksurfdata_esmf/Makefile b/tools/mksurfdata_esmf/Makefile index c344843d06..73da3f240e 100644 --- a/tools/mksurfdata_esmf/Makefile +++ b/tools/mksurfdata_esmf/Makefile @@ -164,7 +164,7 @@ crop-tropics-present : FORCE $(SUBSETDATA_POINT_ALLLU) --create-surface $(SUBSETDATA_1X1_BRAZIL) 1x1_brazil-transient : FORCE - $(SUBSETDATA_POINT_ALLLU) --create-surface --create-landuse $(SUBSETDATA_1X1_BRAZIL) --cfg-file ../site_and_regional/default_data_1850.cfg + $(SUBSETDATA_POINT_ALLLU) --create-surface --create-landuse --surf-year 1850 $(SUBSETDATA_1X1_BRAZIL) --cfg-file ../site_and_regional/default_data_1850.cfg # # crop @@ -255,7 +255,7 @@ crop-global-hist-ne30 : FORCE # Note (slevis): The next line makes the landuse.timeseries from 1850 to 2015, so also run # modify_smallville.sh to generate three modified landuse.timeseries files needed for testing. 1x1-smallville-transient : FORCE - $(SUBSETDATA_POINT) --create-landuse $(SUBSETDATA_1X1_SMALLTRANSIENT) + $(SUBSETDATA_POINT) --create-surface --create-landuse --surf-year 1850 $(SUBSETDATA_1X1_SMALLTRANSIENT) ../modify_input_files/modify_smallville.sh 1x1-cidadinho-present : FORCE From df36ab3bcc17d2f54168aa48ee4eaabaa1ace194 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Fri, 30 Aug 2024 15:08:22 -0600 Subject: [PATCH 1019/1248] Small corrections for all python tests to pass --- python/ctsm/test/test_sys_gen_mksurfdata_namelist.py | 3 +-- python/ctsm/toolchain/gen_mksurfdata_namelist.py | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/python/ctsm/test/test_sys_gen_mksurfdata_namelist.py b/python/ctsm/test/test_sys_gen_mksurfdata_namelist.py index db8581ef24..c9741daf5c 100755 --- a/python/ctsm/test/test_sys_gen_mksurfdata_namelist.py +++ b/python/ctsm/test/test_sys_gen_mksurfdata_namelist.py @@ -62,7 +62,7 @@ def test_simple_namelist(self): main() self.assertTrue(os.path.exists(self.outfile), "Output surface dataset file should exist") - def test_vic_nocrop_inlandwet_glc_namelist(self): + def test_nocrop_inlandwet_glc_namelist(self): """ Test a namelist with several options on """ @@ -75,7 +75,6 @@ def test_vic_nocrop_inlandwet_glc_namelist(self): "1850", "--res", "1.9x2.5", - "--vic", "--nocrop", "--inlandwet", "--glc", diff --git a/python/ctsm/toolchain/gen_mksurfdata_namelist.py b/python/ctsm/toolchain/gen_mksurfdata_namelist.py index 20bd7f7f44..da9420871b 100755 --- a/python/ctsm/toolchain/gen_mksurfdata_namelist.py +++ b/python/ctsm/toolchain/gen_mksurfdata_namelist.py @@ -255,7 +255,7 @@ def main(): potveg = args.potveg_flag glc_nec = args.glc_nec - hires_soitex = process_hires_options(args, start_year, end_year) + hires_soitex = process_hires_options(args) if force_model_mesh_file is not None: open_mesh_file(force_model_mesh_file, force_model_mesh_nx, force_model_mesh_ny) @@ -409,7 +409,7 @@ def main(): print(f"Successfully created input namelist file {nlfname}") -def process_hires_options(args, start_year, end_year): +def process_hires_options(args): """ Process options related to hi-res """ From 615dff4a0d27304ba917af40df77b8e286f45408 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Fri, 30 Aug 2024 17:41:11 -0600 Subject: [PATCH 1020/1248] Updates to the datasets generated by make all --- .../gen_mksurfdata_jobscript_multi.py | 18 +++++++++++++----- tools/mksurfdata_esmf/Makefile | 5 +++++ 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/python/ctsm/toolchain/gen_mksurfdata_jobscript_multi.py b/python/ctsm/toolchain/gen_mksurfdata_jobscript_multi.py index 1afb9e86cb..5de67adb12 100755 --- a/python/ctsm/toolchain/gen_mksurfdata_jobscript_multi.py +++ b/python/ctsm/toolchain/gen_mksurfdata_jobscript_multi.py @@ -42,6 +42,7 @@ "crop-global-hist-low-res", "crop-global-hist-ne16", "crop-global-hist-ne30", + "crop-global-hist-f09", "crop-global-SSP1-1.9-f09", "crop-global-SSP1-2.6-f09", "crop-global-SSP2-4.5-f09", @@ -198,6 +199,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"], "mpasa480": ["mpasa480"], "nldas_res": ["0.125nldas2"], @@ -209,11 +211,13 @@ def main(): "ne0np4.ARCTICGRIS.ne30x8", "ne0np4.ARCTIC.ne30x4", "ne0np4CONUS.ne30x8", + "ne0np4.POLARCAP.ne30x4", ], "ne120": [ "ne0np4.ARCTICGRIS.ne30x8", "ne0np4.ARCTIC.ne30x4", "ne0np4CONUS.ne30x8", + "ne0np4.POLARCAP.ne30x4", "ne120np4.pg3", ], } @@ -295,21 +299,25 @@ def main(): "mpasa480", ), "crop-global-hist": ( - "--start-year 1850 --end-year 2015 --nosurfdata --res", - "standard_res", + "--start-year 1850 --end-year 2023 --nosurfdata --res", + "standard_res_no_f09", ), "crop-global-hist-low-res": ( - "--start-year 1850 --end-year 2015 --nosurfdata --res", + "--start-year 1850 --end-year 2023 --nosurfdata --res", "low_res", ), "crop-global-hist-ne16": ( - "--start-year 1850 --end-year 2015 --nosurfdata --res", + "--start-year 1850 --end-year 2023 --nosurfdata --res", "ne16", ), "crop-global-hist-ne30": ( - "--start-year 1850 --end-year 2015 --nosurfdata --res", + "--start-year 1850 --end-year 2023 --nosurfdata --res", "ne30", ), + "crop-global-hist-f09": ( + "--start-year 1700 --end-year 2023 --res", + "f09", + ), "crop-global-SSP1-1.9-f09": ( "--start-year 1850 --end-year 2100 --nosurfdata --ssp-rcp SSP1-1.9 --res", "f09", diff --git a/tools/mksurfdata_esmf/Makefile b/tools/mksurfdata_esmf/Makefile index 73da3f240e..a46ca6850a 100644 --- a/tools/mksurfdata_esmf/Makefile +++ b/tools/mksurfdata_esmf/Makefile @@ -92,6 +92,7 @@ CROP = \ crop-global-present-ne120 \ crop-global-present-mpasa480 \ crop-global-present-nldas \ + crop-global-hist-f09 \ crop-global-1850 \ crop-global-1850-low-res \ crop-global-1850-ne16 \ @@ -227,6 +228,10 @@ crop-global-hist : FORCE $(MKSURFDATA) --number-of-nodes 72 --scenario $@ --jobscript-file $@.sh --walltime 12:00:00 $(BATCHJOBS) $@.sh +crop-global-hist-f09 : FORCE + $(MKSURFDATA) --number-of-nodes 9 --scenario $@ --jobscript-file $@.sh --walltime 12:00:00 + $(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 $(BATCHJOBS) $@.sh From 7118d709485113294c4c6f90ca64853d7d3b3862 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Sat, 31 Aug 2024 14:48:16 -0600 Subject: [PATCH 1021/1248] Add a check for compatibility based on the version in the surface dataset --- src/main/clm_initializeMod.F90 | 3 +- src/main/surfrdMod.F90 | 67 +++++++++++++++++++++++++++++++++- 2 files changed, 68 insertions(+), 2 deletions(-) diff --git a/src/main/clm_initializeMod.F90 b/src/main/clm_initializeMod.F90 index 340a799908..c91090f6cb 100644 --- a/src/main/clm_initializeMod.F90 +++ b/src/main/clm_initializeMod.F90 @@ -58,7 +58,7 @@ subroutine initialize1(dtime) use clm_varcon , only: clm_varcon_init use landunit_varcon , only: landunit_varcon_init use clm_varctl , only: fsurdat, version - use surfrdMod , only: surfrd_get_num_patches, surfrd_get_nlevurb + use surfrdMod , only: surfrd_get_num_patches, surfrd_get_nlevurb, surfrd_check_file use controlMod , only: control_init, control_print, NLFilename use ncdio_pio , only: ncd_pio_init use initGridCellsMod , only: initGridCells @@ -100,6 +100,7 @@ subroutine initialize1(dtime) call control_init(dtime) call ncd_pio_init() + call surfrd_check_file(fsurdat) call surfrd_get_num_patches(fsurdat, actual_maxsoil_patches, actual_numpft, actual_numcft) call surfrd_get_nlevurb(fsurdat, actual_nlevurb) diff --git a/src/main/surfrdMod.F90 b/src/main/surfrdMod.F90 index 12212e2160..36399c3905 100644 --- a/src/main/surfrdMod.F90 +++ b/src/main/surfrdMod.F90 @@ -7,7 +7,7 @@ module surfrdMod ! ! !USES: #include "shr_assert.h" - use shr_kind_mod , only : r8 => shr_kind_r8 + use shr_kind_mod , only : r8 => shr_kind_r8, r4 => shr_kind_r4 use shr_log_mod , only : errMsg => shr_log_errMsg use abortutils , only : endrun use clm_varpar , only : nlevsoifl @@ -27,6 +27,7 @@ module surfrdMod save ! ! !PUBLIC MEMBER FUNCTIONS: + public :: surfrd_check_file ! Check that this surface dataset is compatible public :: surfrd_get_data ! Read surface dataset and determine subgrid weights public :: surfrd_get_num_patches ! Read surface dataset to determine maxsoil_patches and numcft public :: surfrd_get_nlevurb ! Read surface dataset to determine nlevurb @@ -45,6 +46,70 @@ module surfrdMod contains + !----------------------------------------------------------------------- + subroutine surfrd_check_file ( lfsurdat ) + ! + ! !DESCRIPTION: + ! Check compatability for this surface dataset and abort with an error if it's not + ! + ! !USES: + use ncdio_pio, only : check_att + ! !ARGUMENTS: + character(len=*), intent(in) :: lfsurdat ! surface dataset filename + ! !LOCAL VARIABLES: + type(file_desc_t) :: ncid ! netcdf id + logical :: exists ! If attribute or variable was found on the file + integer :: status ! Status return code + real(r4) :: version ! Version number on the dataset + ! NOTE: Only increment the expected_version when surface datasets are incompatible with the previous version + ! If datasets are just updated data and backwards compatble leave the expected version alone + real(r4), parameter :: expected_version = 5.3_r4 + character(len=50) :: description + character(len=*), parameter :: version_name = 'Dataset_Version' + + call ncd_pio_openfile (ncid, trim(lfsurdat), 0) + call check_att(ncid, pio_global, version_name, exists) + if (exists) then + status = pio_get_att(ncid, pio_global, version_name, version) + else + ! For a few previous versions guess on the compatability version based on existence of variables + call check_var( ncid, 'PCT_OCEAN', exists) + if (exists) then + version = 5.2_r4 + else + call check_var( ncid, 'PCT_CFT', exists) + if (exists) then + version = 5.0_r4 + else + call check_var( ncid, 'PCT_GLC_MEC_GIC', exists) + if (exists) then + version = 4.5_r4 + else + ! This is a version before the main clm4_5 dataseta so marking it as 0 for unknown + version = 0.0_r4 + end if + end if + end if + end if + call ncd_pio_closefile(ncid) + if ( (version /= expected_version) )then + if ( version < expected_version )then + description = 'older' + if ( version == 0.0_r4 ) description = trim(description)//' than 4.5' + else if ( version > expected_version )then + description = 'newer' + end if + if ( masterproc )then + write(iulog,*) 'Input surface dataset is: ', trim(lfsurdat) + write(iulog,'(3a)') 'This surface dataset is ', trim(description), ' and incompatable with this version of CTSM' + write(iulog,'(a,f3.1,a,f3.1)') 'Dataset version = ', version, ' Version expected = ', expected_version + write(iulog,*) errMsg(sourcefile, __LINE__) + end if + call endrun(msg="ERROR: Incompatble surface dataset") + end if + + end subroutine surfrd_check_file + !----------------------------------------------------------------------- subroutine surfrd_get_data (begg, endg, ldomain, lfsurdat, actual_numcft) ! From 744830efada6699b9ee4975e30b6a73bedd3d283 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Tue, 3 Sep 2024 10:50:14 -0600 Subject: [PATCH 1022/1248] Update from ctsm52 to ctsm53 NOANTHRO raw dataset --- 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 1e050a295f..d617fe1c49 100644 --- a/tools/mksurfdata_esmf/gen_mksurfdata_namelist.xml +++ b/tools/mksurfdata_esmf/gen_mksurfdata_namelist.xml @@ -206,7 +206,7 @@ version of the raw dataset will probably go away. - lnd/clm2/rawdata/pftcftdynharv.0.25x0.25.LUH2.noanthro.c20230226/mksrf_landuse_ctsm52_noanthroLUH2_1.c20230226.nc + lnd/clm2/rawdata/CTSM53RawData/globalctsm53histTRNOANTHRODeg025_240831/mksrf_landuse_ctsm53_histTRNOANTHRO_1.c240831.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 From 852462c507f1bab5457a80685bfb1f933edc4f4c Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Tue, 3 Sep 2024 11:52:26 -0600 Subject: [PATCH 1023/1248] Remove obsolete comment from namelist_defaults_ctsm --- bld/namelist_files/namelist_defaults_ctsm.xml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index 60abb3501e..238f14c893 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -1902,10 +1902,6 @@ lnd/clm2/surfdata_esmf/ctsm5.2.0/surfdata_4x5_hist_2000_16pfts_c240216.nc lnd/clm2/surfdata_esmf/ctsm5.2.0/surfdata_mpasa15_hist_2000_16pfts_c240216.nc - lnd/clm2/surfdata_esmf/ctsm5.2.0/surfdata_mpasa3p75_hist_2000_16pfts_c240216.nc From 4161a020d3d2945ea2d9e6cd1c83b98cca4d20a7 Mon Sep 17 00:00:00 2001 From: Adrianna Foster Date: Wed, 4 Sep 2024 10:54:29 -0600 Subject: [PATCH 1024/1248] update fuel classes --- src/fates | 2 +- src/main/histFileMod.F90 | 2 +- src/utils/clmfates_interfaceMod.F90 | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/fates b/src/fates index e372f0b6cd..2263e6f829 160000 --- a/src/fates +++ b/src/fates @@ -1 +1 @@ -Subproject commit e372f0b6cdf46f76f888ee6ac92d9a3572464e8b +Subproject commit 2263e6f8292792a9a05575023eec1f8265ef7bf2 diff --git a/src/main/histFileMod.F90 b/src/main/histFileMod.F90 index 8ae4ace7e3..2461a60c92 100644 --- a/src/main/histFileMod.F90 +++ b/src/main/histFileMod.F90 @@ -28,7 +28,7 @@ module histFileMod use FatesInterfaceTypesMod , only : nlevheight use FatesInterfaceTypesMod , only : nlevdamage use FatesConstantsMod , only : n_landuse_cats - use FatesLitterMod , only : nfsc + use FatesFuelClassesMod , only : nfsc use FatesLitterMod , only : ncwd use PRTGenericMod , only : num_elements_fates => num_elements use FatesInterfaceTypesMod , only : numpft_fates => numpft diff --git a/src/utils/clmfates_interfaceMod.F90 b/src/utils/clmfates_interfaceMod.F90 index e3e7644b90..c01787217d 100644 --- a/src/utils/clmfates_interfaceMod.F90 +++ b/src/utils/clmfates_interfaceMod.F90 @@ -3648,7 +3648,7 @@ subroutine hlm_bounds_to_fates_bounds(hlm, fates) use FatesInterfaceTypesMod, only : nlevsclass, nlevage, nlevcoage use FatesInterfaceTypesMod, only : nlevheight use FatesInterfaceTypesMod, only : nlevdamage - use FatesLitterMod, only : nfsc + use FatesFuelClassesMod, only : nfsc use FatesLitterMod, only : ncwd use EDParamsMod, only : nlevleaf, nclmax use FatesInterfaceTypesMod, only : numpft_fates => numpft From fff23bd2b6c96394cf9a25505c48a2c1d1fee808 Mon Sep 17 00:00:00 2001 From: Adrianna Foster Date: Wed, 4 Sep 2024 11:50:10 -0600 Subject: [PATCH 1025/1248] change parmeter file --- cime_config/testdefs/testmods_dirs/clm/Fates/user_nl_clm | 1 + src/fates | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/cime_config/testdefs/testmods_dirs/clm/Fates/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/Fates/user_nl_clm index 91df3e2e61..a8ffe59412 100644 --- a/cime_config/testdefs/testmods_dirs/clm/Fates/user_nl_clm +++ b/cime_config/testdefs/testmods_dirs/clm/Fates/user_nl_clm @@ -28,3 +28,4 @@ hist_fincl1 = 'FATES_NCOHORTS', 'FATES_TRIMMING', 'FATES_AREA_PLANTS', 'FATES_SEED_ALLOC', 'FATES_STEM_ALLOC', 'FATES_FROOT_ALLOC', 'FATES_CROOT_ALLOC', 'FATES_STORE_ALLOC', 'FATES_PATCHAREA_LU', 'FATES_DISTURBANCE_RATE_MATRIX_LULU' +fates_paramfile = '/glade/work/afoster/CTSM/src/fates/parameter_files/fates_param_fuel.nc' diff --git a/src/fates b/src/fates index 2263e6f829..3cfb2b1bd9 160000 --- a/src/fates +++ b/src/fates @@ -1 +1 @@ -Subproject commit 2263e6f8292792a9a05575023eec1f8265ef7bf2 +Subproject commit 3cfb2b1bd9bcde627e4b3364cfdf2144feaa7ded From 90a5cf009906bf12b37472c42b89857b2b28c93e Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 4 Sep 2024 16:01:45 -0600 Subject: [PATCH 1026/1248] Remove error about surface datasets Remove the error messaging that talks about old/incompatible surface dataset because we now are checking for the surface dataset compatability. --- src/main/glcBehaviorMod.F90 | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/main/glcBehaviorMod.F90 b/src/main/glcBehaviorMod.F90 index 315aa88c67..8076f8fcaf 100644 --- a/src/main/glcBehaviorMod.F90 +++ b/src/main/glcBehaviorMod.F90 @@ -407,8 +407,7 @@ subroutine translate_glacier_region_behavior glacier_region_behavior(i) = BEHAVIOR_SINGLE_AT_ATM_TOPO case (behavior_str_unset) write(iulog,*) ' ERROR: glacier_region_behavior not specified for ID ', i - write(iulog,*) 'You may need to extend the glacier_region_behavior namelist array,' - write(iulog,*) 'or you may be running with an old/incompatible surface dataset.' + write(iulog,*) 'You may need to extend the glacier_region_behavior namelist array.' call endrun(msg=' ERROR: glacier_region_behavior not specified for ID '// & errMsg(sourcefile, __LINE__)) case default @@ -439,8 +438,7 @@ subroutine translate_glacier_region_melt_behavior glacier_region_melt_behavior(i) = MELT_BEHAVIOR_REMAINS_IN_PLACE case (behavior_str_unset) write(iulog,*) ' ERROR: glacier_region_melt_behavior not specified for ID ', i - write(iulog,*) 'You may need to extend the glacier_region_melt_behavior namelist array,' - write(iulog,*) 'or you may be running with an old/incompatible surface dataset.' + write(iulog,*) 'You may need to extend the glacier_region_melt_behavior namelist array.' call endrun(msg=' ERROR: glacier_region_melt_behavior not specified for ID '// & errMsg(sourcefile, __LINE__)) case default @@ -471,8 +469,7 @@ subroutine translate_glacier_region_ice_runoff_behavior glacier_region_ice_runoff_behavior(i) = ICE_RUNOFF_BEHAVIOR_MELTED case (behavior_str_unset) write(iulog,*) ' ERROR: glacier_region_ice_runoff_behavior not specified for ID ', i - write(iulog,*) 'You may need to extend the glacier_region_ice_runoff_behavior namelist array,' - write(iulog,*) 'or you may be running with an old/incompatible surface dataset.' + write(iulog,*) 'You may need to extend the glacier_region_ice_runoff_behavior namelist array.' call endrun(msg=' ERROR: glacier_region_ice_runoff_behavior not specified for ID '// & errMsg(sourcefile, __LINE__)) case default From 703c2913ec974bf6f536329eb92a4ec175ea2f2b Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 4 Sep 2024 16:19:24 -0600 Subject: [PATCH 1027/1248] Add comments about dataset verison Add some notes that dataset version is only updated when the new datasets will NOT be backwards compatible with the previous version. --- tools/mksurfdata_esmf/src/mkfileMod.F90 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/mksurfdata_esmf/src/mkfileMod.F90 b/tools/mksurfdata_esmf/src/mkfileMod.F90 index a3423e0c7b..997020292b 100644 --- a/tools/mksurfdata_esmf/src/mkfileMod.F90 +++ b/tools/mksurfdata_esmf/src/mkfileMod.F90 @@ -105,6 +105,10 @@ subroutine mkfile_define_atts(pioid, dynlanduse) character(len= 10) :: time ! temporary character(len= 5) :: zone ! temporary integer :: rcode + ! Surface dataset version these datasets are compatible with: + ! - Only update this when the new surface datasets will be incompatible with the previous verison + ! - Since whenever we update surface datasets we update to a new minor version this always corresponds + ! to a CTSM minor version: 5.3, i6.1, 6.5 etcetera real(r4), parameter :: data_version = 5.3 ! Compatibility version number of the datasets to create character(len=*), parameter :: subname = 'mkfile_define_atts' !----------------------------------------------------------------------- From a0a2dfa450566a005d820679b7dab157530bce76 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Wed, 4 Sep 2024 16:43:36 -0600 Subject: [PATCH 1028/1248] Makefile updates in preparation for running make all for ctsm5.3 --- tools/mksurfdata_esmf/Makefile | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tools/mksurfdata_esmf/Makefile b/tools/mksurfdata_esmf/Makefile index a46ca6850a..0359b7dc72 100644 --- a/tools/mksurfdata_esmf/Makefile +++ b/tools/mksurfdata_esmf/Makefile @@ -85,27 +85,27 @@ STANDARD = \ global-present-low-res \ CROP = \ + crop-global-future \ + crop-global-hist-f09 \ + crop-global-1850-ne120 \ + crop-global-present-ne120 \ + crop-global-present-nldas \ + crop-global-present-ne30 \ crop-global-present \ crop-global-present-low-res \ crop-global-present-ne16 \ - crop-global-present-ne30 \ - crop-global-present-ne120 \ crop-global-present-mpasa480 \ - crop-global-present-nldas \ - crop-global-hist-f09 \ crop-global-1850 \ crop-global-1850-low-res \ crop-global-1850-ne16 \ crop-global-1850-ne30 \ - crop-global-1850-ne120 \ crop-global-1850-mpasa480 \ - crop-global-future \ # Start all with all-subset because user is bound to forget to first run # module load nco # Usually, include global-present-ultra-hi-res temporarily while # generating datasets for a new release -all : all-subset standard crop crop-tropics-present +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 From 46b891ac4ac481fe38ed1d539d61c8d9057b8735 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Wed, 4 Sep 2024 18:00:32 -0600 Subject: [PATCH 1029/1248] Update to new finidats from latest ctsm5.3 spin-up Same list of finidats that I updated in this PR: https://github.com/ESCOMP/CTSM/pull/2724/files --- bld/namelist_files/namelist_defaults_ctsm.xml | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index 238f14c893..b4df3e008f 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -1382,13 +1382,13 @@ attributes from the config_cache.xml file (with keys converted to upper-case). ic_ymd="18500101" sim_year="1850" do_transient_pfts=".false." ic_tod="0" glc_nec="10" use_crop=".true." irrigate=".false." lnd_tuning_mode="clm5_1_GSWP3v1" use_init_interp=".true." ->lnd/clm2/initdata_esmf/ctsm5.3/ctsm52018_f09_xsiceON_acON_pSASU.clm2.r.0201-01-01-00000.nc +>lnd/clm2/initdata_esmf/ctsm5.3/ctsm52026_f09_pSASU.clm2.r.0421-01-01-00000.nc lnd/clm2/initdata_esmf/ctsm5.3/ctsm52018_f09_xsiceON_acON_pSASU.clm2.r.0201-01-01-00000.nc +>lnd/clm2/initdata_esmf/ctsm5.3/ctsm52026_f09_pSASU.clm2.r.0421-01-01-00000.nc @@ -1524,7 +1524,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). ic_ymd="20000101" sim_year="2000" do_transient_pfts=".false." ic_tod="0" glc_nec="10" use_crop=".true." irrigate=".true." lnd_tuning_mode="clm6_0_cam7.0" use_init_interp=".true." ->lnd/clm2/initdata_esmf/ctsm5.3/ctsm52018_f09_xsiceON_acON_pSASU.clm2.r.0201-01-01-00000.nc +>lnd/clm2/initdata_esmf/ctsm5.3/ctsm52026_f09_pSASU.clm2.r.0421-01-01-00000.nc @@ -1589,7 +1589,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). ic_ymd="20000101" sim_year="2000" do_transient_pfts=".false." ic_tod="0" glc_nec="10" use_crop=".true." irrigate=".true." lnd_tuning_mode="clm5_1_cam7.0" use_init_interp=".true." ->lnd/clm2/initdata_esmf/ctsm5.3/ctsm52018_f09_xsiceON_acON_pSASU.clm2.r.0201-01-01-00000.nc +>lnd/clm2/initdata_esmf/ctsm5.3/ctsm52026_f09_pSASU.clm2.r.0421-01-01-00000.nc @@ -1653,7 +1653,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). ic_ymd="20000101" sim_year="2000" do_transient_pfts=".false." ic_tod="0" glc_nec="10" use_crop=".true." irrigate=".true." lnd_tuning_mode="clm6_0_cam7.0" use_init_interp=".true." ->lnd/clm2/initdata_esmf/ctsm5.3/ctsm52018_f09_xsiceON_acON_pSASU.clm2.r.0201-01-01-00000.nc +>lnd/clm2/initdata_esmf/ctsm5.3/ctsm52026_f09_pSASU.clm2.r.0421-01-01-00000.nc @@ -1728,7 +1728,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). ic_ymd="20000101" sim_year="2000" do_transient_pfts=".false." ic_tod="0" glc_nec="10" use_crop=".true." irrigate=".true." lnd_tuning_mode="clm5_1_cam6.0" use_init_interp=".true." ->lnd/clm2/initdata_esmf/ctsm5.3/ctsm52018_f09_xsiceON_acON_pSASU.clm2.r.0201-01-01-00000.nc +>lnd/clm2/initdata_esmf/ctsm5.3/ctsm52026_f09_pSASU.clm2.r.0421-01-01-00000.nc @@ -1736,7 +1736,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). ic_ymd="20000101" sim_year="2000" do_transient_pfts=".false." ic_tod="0" glc_nec="10" use_crop=".true." irrigate=".true." lnd_tuning_mode="clm6_0_cam6.0" use_init_interp=".true." ->lnd/clm2/initdata_esmf/ctsm5.3/ctsm52018_f09_xsiceON_acON_pSASU.clm2.r.0201-01-01-00000.nc +>lnd/clm2/initdata_esmf/ctsm5.3/ctsm52026_f09_pSASU.clm2.r.0421-01-01-00000.nc @@ -1801,7 +1801,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). ic_ymd="20000101" sim_year="2000" do_transient_pfts=".false." ic_tod="0" glc_nec="10" use_crop=".true." irrigate=".true." lnd_tuning_mode="clm5_1_cam6.0" use_init_interp=".true." ->lnd/clm2/initdata_esmf/ctsm5.3/ctsm52018_f09_xsiceON_acON_pSASU.clm2.r.0201-01-01-00000.nc +>lnd/clm2/initdata_esmf/ctsm5.3/ctsm52026_f09_pSASU.clm2.r.0421-01-01-00000.nc @@ -1866,7 +1866,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). ic_ymd="20000101" sim_year="2000" do_transient_pfts=".false." ic_tod="0" glc_nec="10" use_crop=".true." irrigate=".true." lnd_tuning_mode="clm6_0_cam6.0" use_init_interp=".true." ->lnd/clm2/initdata_esmf/ctsm5.3/ctsm52018_f09_xsiceON_acON_pSASU.clm2.r.0201-01-01-00000.nc +>lnd/clm2/initdata_esmf/ctsm5.3/ctsm52026_f09_pSASU.clm2.r.0421-01-01-00000.nc From d59dd24f03791366d3b8f1a87c8cf47c0cbc6ce9 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Wed, 4 Sep 2024 19:05:52 -0600 Subject: [PATCH 1030/1248] Add placeholder for making fsurdat files for tower sites --- tools/mksurfdata_esmf/Makefile | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tools/mksurfdata_esmf/Makefile b/tools/mksurfdata_esmf/Makefile index 0359b7dc72..7ad8e1aa77 100644 --- a/tools/mksurfdata_esmf/Makefile +++ b/tools/mksurfdata_esmf/Makefile @@ -105,6 +105,9 @@ CROP = \ # module load nco # Usually, include global-present-ultra-hi-res temporarily while # generating datasets for a new release +# Eventually, include tower, when we get the corresponding scripts to +# use absolute paths for their input files; error message posted here: +# https://github.com/ESCOMP/CTSM/pull/2500 under "PLUMBER2" all : all-subset global-present-ultra-hi-res crop standard crop-tropics-present # These are all the surface datasets generated by subset_data @@ -119,6 +122,10 @@ all-subset : \ 1x1-cidadinho-present \ urban +# These are all the tower site surface datasets +tower : neon plumber2 + + DEBUG: @echo "HOST := $(HOST)" @echo "PROJECT := $(PROJECT)" @@ -364,6 +371,15 @@ crop-global-SSP5-8.5-f09 : FORCE $(MKSURFDATA) --number-of-nodes 9 --scenario $@ --jobscript-file $@.sh --walltime 12:00:00 $(BATCHJOBS) $@.sh +# +# tower sites: NEON, PLUMBER2 +# +neon : FORCE + ../site_and_regional/neon_surf_wrapper + +plumber2 : FORCE + ../site_and_regional/plumber2_surf_wrapper + # # urban # From 04d45c77ed8c50a490ee022f058592ef79a94515 Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Wed, 4 Sep 2024 22:47:39 -0700 Subject: [PATCH 1031/1248] add changelog --- doc/ChangeLog | 78 +++++++++++++++++++++++++++++++++++++++++++++++++++ doc/ChangeSum | 1 + 2 files changed, 79 insertions(+) diff --git a/doc/ChangeLog b/doc/ChangeLog index 3499c7d720..79526be61c 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,4 +1,82 @@ =============================================================== +Tag name: ctsm5.2.028 +Originator(s): glemieux (Gregory Lemieux, LBNL, glemieux@lbl.gov) +Date: Wed Sep 4 23:21:30 MDT 2024 +One-line Summary: FATES history flushing update + +Purpose and description of changes +---------------------------------- + +This updates the way in which FATES history output is flushed during model initialization +utilizing a new FATES-side subroutine, flush_all_hvars. This update also makes corrections +to a subset of FATES testmods as well as expands the FATES test list by duplicating two +existing tests to run on different compilers for better coverage. The FATES submodule tag +has been updated to the latest scientific tag as well. + + +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_1 + +[ ] clm5_0 + +[ ] ctsm5_0-nwp + +[ ] clm4_5 + + +Bugs fixed +---------- +List of CTSM issues fixed (include CTSM Issue # and description) [one per line]: +Fixes #2657 Add FATES_TRANSITIONS_MATRIX_LULU to FatesColdLUH2 testmods + +Notes of particular relevance for developers: +--------------------------------------------- +Changes to tests or testing: + +Adds nvhpc and gnu FatesSatColdPhen smoke tests to the fates list to expand compiler +coverage. + +Testing summary: +---------------- + + [PASS means all tests PASS; OK means tests PASS other than expected fails.] + + 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: Yes, for FATES tests only + +Changes are consistent with differences in FATES_EFFECT_WSPEED due to NGEET/fates#1215 + +Other details +------------- +List any git submodules updated (cime, rtm, mosart, cism, fates, etc.): + + FATES: sci.1.77.2_api.36.0.0 -> sci.1.78.2_api.36.0.0 + +Pull Requests that document the changes (include PR ids): + https://github.com/ESCOMP/ctsm/pull/2594 + +=============================================================== +=============================================================== Tag name: ctsm5.2.027 Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326) Date: Wed 28 Aug 2024 09:13:22 PM MDT diff --git a/doc/ChangeSum b/doc/ChangeSum index fdf253760f..f8adaa60eb 100644 --- a/doc/ChangeSum +++ b/doc/ChangeSum @@ -1,5 +1,6 @@ Tag Who Date Summary ============================================================================================================================ + ctsm5.2.028 glemieux 09/04/2024 FATES history flushing update ctsm5.2.027 erik 08/28/2024 Merge b4b-dev ctsm5.2.026 slevis 08/23/2024 Turn on excess ice, explicit AC, Leung_2023 for clm6 ctsm5.2.025 samrabin 08/23/2024 Minor fixes to li2024 fire methods From 9a6cd4417d24ddaf775e0aa5f13481cbe15b4322 Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Wed, 4 Sep 2024 22:49:32 -0700 Subject: [PATCH 1032/1248] correct changelog and sum author --- doc/ChangeLog | 3 ++- doc/ChangeSum | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index 79526be61c..0e6db9823e 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,6 +1,7 @@ =============================================================== Tag name: ctsm5.2.028 -Originator(s): glemieux (Gregory Lemieux, LBNL, glemieux@lbl.gov) +Originator(s): rgknox (Ryan Knox, LBNL, rgknox@lbl.gov) + glemieux (Gregory Lemieux, LBNL, glemieux@lbl.gov) Date: Wed Sep 4 23:21:30 MDT 2024 One-line Summary: FATES history flushing update diff --git a/doc/ChangeSum b/doc/ChangeSum index f8adaa60eb..82c7a2a6ef 100644 --- a/doc/ChangeSum +++ b/doc/ChangeSum @@ -1,6 +1,6 @@ Tag Who Date Summary ============================================================================================================================ - ctsm5.2.028 glemieux 09/04/2024 FATES history flushing update + ctsm5.2.028 rgknox 09/04/2024 FATES history flushing update ctsm5.2.027 erik 08/28/2024 Merge b4b-dev ctsm5.2.026 slevis 08/23/2024 Turn on excess ice, explicit AC, Leung_2023 for clm6 ctsm5.2.025 samrabin 08/23/2024 Minor fixes to li2024 fire methods From 0fd3d41e58f6ec992aa78dac42bef707fea14be5 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Thu, 5 Sep 2024 01:40:10 -0600 Subject: [PATCH 1033/1248] Change name of the subroutine for the surface dataset compatibility check, fix version guessing inside it, fix spelling error, respond to rest of the review conversations --- src/main/clm_initializeMod.F90 | 4 ++-- src/main/surfrdMod.F90 | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/main/clm_initializeMod.F90 b/src/main/clm_initializeMod.F90 index c91090f6cb..bf9a97ae58 100644 --- a/src/main/clm_initializeMod.F90 +++ b/src/main/clm_initializeMod.F90 @@ -58,7 +58,7 @@ subroutine initialize1(dtime) use clm_varcon , only: clm_varcon_init use landunit_varcon , only: landunit_varcon_init use clm_varctl , only: fsurdat, version - use surfrdMod , only: surfrd_get_num_patches, surfrd_get_nlevurb, surfrd_check_file + use surfrdMod , only: surfrd_get_num_patches, surfrd_get_nlevurb, surfrd_compat_check use controlMod , only: control_init, control_print, NLFilename use ncdio_pio , only: ncd_pio_init use initGridCellsMod , only: initGridCells @@ -100,7 +100,7 @@ subroutine initialize1(dtime) call control_init(dtime) call ncd_pio_init() - call surfrd_check_file(fsurdat) + call surfrd_compat_check(fsurdat) call surfrd_get_num_patches(fsurdat, actual_maxsoil_patches, actual_numpft, actual_numcft) call surfrd_get_nlevurb(fsurdat, actual_nlevurb) diff --git a/src/main/surfrdMod.F90 b/src/main/surfrdMod.F90 index 36399c3905..88d43a09cc 100644 --- a/src/main/surfrdMod.F90 +++ b/src/main/surfrdMod.F90 @@ -27,7 +27,7 @@ module surfrdMod save ! ! !PUBLIC MEMBER FUNCTIONS: - public :: surfrd_check_file ! Check that this surface dataset is compatible + public :: surfrd_compat_check ! Check that this surface dataset is compatible public :: surfrd_get_data ! Read surface dataset and determine subgrid weights public :: surfrd_get_num_patches ! Read surface dataset to determine maxsoil_patches and numcft public :: surfrd_get_nlevurb ! Read surface dataset to determine nlevurb @@ -47,7 +47,7 @@ module surfrdMod contains !----------------------------------------------------------------------- - subroutine surfrd_check_file ( lfsurdat ) + subroutine surfrd_compat_check ( lfsurdat ) ! ! !DESCRIPTION: ! Check compatability for this surface dataset and abort with an error if it's not @@ -77,11 +77,11 @@ subroutine surfrd_check_file ( lfsurdat ) if (exists) then version = 5.2_r4 else - call check_var( ncid, 'PCT_CFT', exists) + call check_var( ncid, 'CONST_HARVEST_SH1', exists) if (exists) then version = 5.0_r4 else - call check_var( ncid, 'PCT_GLC_MEC_GIC', exists) + call check_var( ncid, 'GLACIER_REGION', exists) if (exists) then version = 4.5_r4 else @@ -101,14 +101,14 @@ subroutine surfrd_check_file ( lfsurdat ) end if if ( masterproc )then write(iulog,*) 'Input surface dataset is: ', trim(lfsurdat) - write(iulog,'(3a)') 'This surface dataset is ', trim(description), ' and incompatable with this version of CTSM' + write(iulog,'(3a)') 'This surface dataset is ', trim(description), ' and incompatible with this version of CTSM' write(iulog,'(a,f3.1,a,f3.1)') 'Dataset version = ', version, ' Version expected = ', expected_version write(iulog,*) errMsg(sourcefile, __LINE__) end if - call endrun(msg="ERROR: Incompatble surface dataset") + call endrun(msg="ERROR: Incompatible surface dataset") end if - end subroutine surfrd_check_file + end subroutine surfrd_compat_check !----------------------------------------------------------------------- subroutine surfrd_get_data (begg, endg, ldomain, lfsurdat, actual_numcft) From 249f850f8108ddc5aa05e0069fb60ff4a7db3561 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Thu, 5 Sep 2024 14:50:07 -0600 Subject: [PATCH 1034/1248] Update date in change files --- doc/ChangeLog | 2 +- doc/ChangeSum | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index 0e6db9823e..e553a59730 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -2,7 +2,7 @@ Tag name: ctsm5.2.028 Originator(s): rgknox (Ryan Knox, LBNL, rgknox@lbl.gov) glemieux (Gregory Lemieux, LBNL, glemieux@lbl.gov) -Date: Wed Sep 4 23:21:30 MDT 2024 +Date: Thu 05 Sep 2024 02:47:14 PM MDT One-line Summary: FATES history flushing update Purpose and description of changes diff --git a/doc/ChangeSum b/doc/ChangeSum index 82c7a2a6ef..45bab07440 100644 --- a/doc/ChangeSum +++ b/doc/ChangeSum @@ -1,6 +1,6 @@ Tag Who Date Summary ============================================================================================================================ - ctsm5.2.028 rgknox 09/04/2024 FATES history flushing update + ctsm5.2.028 rgknox 09/05/2024 FATES history flushing update ctsm5.2.027 erik 08/28/2024 Merge b4b-dev ctsm5.2.026 slevis 08/23/2024 Turn on excess ice, explicit AC, Leung_2023 for clm6 ctsm5.2.025 samrabin 08/23/2024 Minor fixes to li2024 fire methods From 10241e7691eee234ac02cc676fb58205155e3779 Mon Sep 17 00:00:00 2001 From: Adrianna Foster Date: Fri, 6 Sep 2024 11:27:38 -0600 Subject: [PATCH 1035/1248] fix issues --- cime_config/testdefs/testmods_dirs/clm/Fates/user_nl_clm | 3 ++- src/fates | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/cime_config/testdefs/testmods_dirs/clm/Fates/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/Fates/user_nl_clm index a8ffe59412..055a0d1530 100644 --- a/cime_config/testdefs/testmods_dirs/clm/Fates/user_nl_clm +++ b/cime_config/testdefs/testmods_dirs/clm/Fates/user_nl_clm @@ -28,4 +28,5 @@ hist_fincl1 = 'FATES_NCOHORTS', 'FATES_TRIMMING', 'FATES_AREA_PLANTS', 'FATES_SEED_ALLOC', 'FATES_STEM_ALLOC', 'FATES_FROOT_ALLOC', 'FATES_CROOT_ALLOC', 'FATES_STORE_ALLOC', 'FATES_PATCHAREA_LU', 'FATES_DISTURBANCE_RATE_MATRIX_LULU' -fates_paramfile = '/glade/work/afoster/CTSM/src/fates/parameter_files/fates_param_fuel.nc' + +! fates_paramfile = '/glade/work/afoster/CTSM/src/fates/parameter_files/fates_param_fuel.nc' diff --git a/src/fates b/src/fates index 3cfb2b1bd9..e06e0dfcaf 160000 --- a/src/fates +++ b/src/fates @@ -1 +1 @@ -Subproject commit 3cfb2b1bd9bcde627e4b3364cfdf2144feaa7ded +Subproject commit e06e0dfcaf6347993d47dc29944e952d3e4412f7 From 6baba6f96fbb178ef5827d98bd28347fd782ad5a Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Fri, 6 Sep 2024 12:05:21 -0600 Subject: [PATCH 1036/1248] Start getting the template for the ctsm5.3.0 ChangeLog --- doc/ChangeLog | 138 ++++++++++++++++++++++++++++++++++++++++++++++++++ doc/ChangeSum | 1 + 2 files changed, 139 insertions(+) diff --git a/doc/ChangeLog b/doc/ChangeLog index e553a59730..fd46741fec 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,4 +1,142 @@ =============================================================== +Tag name: ctsm5.3.0 +Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326) +Date: Fri 06 Sep 2024 02:21:22 AM MDT +One-line Summary: Update surface datasets, CN Matrix, CLM60: excess ice on, explicit A/C on, crop calendars, Sturm snow, Leung dust emissions, prigent roughness data + +Purpose and description of changes +---------------------------------- + +Changes to CTSM: +================ + + +New surface datasets: +===================== + + +New input datasets to mksurfdata_esmf: +====================================== + + +Contributors +------------ + + +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 + +[X] clm5_1 + +[X] clm5_0 + +[X] ctsm5_0-nwp + +[X] clm4_5 + + +Bugs fixed +---------- + +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): + +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): + +Changes made to namelist defaults (e.g., changed parameter values): + +Changes to the datasets (e.g., parameter, surface or initial files): + +Changes to documentation: + +Things being deprecated (which will be removed): + +Notes of particular relevance for developers: +--------------------------------------------- + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): + +Changes to tests or testing: + + +Testing summary: release testing (regular ctsm_sci fates mosart rtm mksurfdata_esmf python) +---------------- + [PASS means all tests PASS; OK means tests PASS other than expected fails.] + + build-namelist tests (if CLMBuildNamelist.pm has changed): + + derecho - + + python testing (if python code has changed; see instructions in python/README.md; document testing done): + + derecho - + + regular tests (aux_clm: https://github.com/ESCOMP/CTSM/wiki/System-Testing-Guide#pre-merge-system-testing): + + derecho ----- + izumi ------- + + fates tests: (give name of baseline if different from CTSM tagname, normally fates baselines are fates--) + derecho ----- + izumi ------- + + any other testing (give details below): + + mksurfdata_esmf + derecho ---- run "make all" to create all datasets (completes in XXX hours) + (crop-global-SSP2-4.5-ne30 was longest at 6 hr, most completed in XXX hours) + + ctsm_sci + derecho ---- + + mosart + derecho ---- + izumi ------ + + rtm + derecho ---- + + +Answer changes +-------------- + +Changes answers relative to baseline: Yes! New surface datasets so answers change for ALL simulations! + + Summarize any changes to answers, i.e., + - what code configurations: ALL + - what platforms/compilers: ALL + - nature of change (roundoff; larger than roundoff/same climate; new climate): + new climate + + If this tag changes climate describe the run(s) done to evaluate the new + climate (put details of the simulations in the experiment database) + - casename: + + URL for LMWG diagnostics output used to validate new climate: + + +Other details +------------- +[Remove any lines that don't apply. Remove entire section if nothing applies.] + +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) + +=============================================================== +=============================================================== Tag name: ctsm5.2.028 Originator(s): rgknox (Ryan Knox, LBNL, rgknox@lbl.gov) glemieux (Gregory Lemieux, LBNL, glemieux@lbl.gov) diff --git a/doc/ChangeSum b/doc/ChangeSum index 45bab07440..c592a29382 100644 --- a/doc/ChangeSum +++ b/doc/ChangeSum @@ -1,5 +1,6 @@ Tag Who Date Summary ============================================================================================================================ + ctsm5.3.0 erik 09/06/2024 Update surface datasets, CN Matrix, CLM60: excess ice on, explicit A/C on, crop calendars, Sturm snow, Leung dust emissions, prigent roughness data ctsm5.2.028 rgknox 09/05/2024 FATES history flushing update ctsm5.2.027 erik 08/28/2024 Merge b4b-dev ctsm5.2.026 slevis 08/23/2024 Turn on excess ice, explicit AC, Leung_2023 for clm6 From d6b2d8fa0678abd9c89fe4dec76441d245fd9424 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Fri, 6 Sep 2024 13:04:10 -0600 Subject: [PATCH 1037/1248] Update datasets to ctsm5.3.0 directory and change _c240216 to _c240905 --- bld/namelist_files/namelist_defaults_ctsm.xml | 178 +++++++++--------- 1 file changed, 89 insertions(+), 89 deletions(-) diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index b4df3e008f..5ca3030259 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -1891,150 +1891,150 @@ attributes from the config_cache.xml file (with keys converted to upper-case). -lnd/clm2/surfdata_esmf/ctsm5.2.0/surfdata_0.9x1.25_hist_2000_16pfts_c240216.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_0.9x1.25_hist_2000_16pfts_c240216.nc -lnd/clm2/surfdata_esmf/ctsm5.2.0/surfdata_1.9x2.5_hist_2000_16pfts_c240216.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_1.9x2.5_hist_2000_16pfts_c240216.nc -lnd/clm2/surfdata_esmf/ctsm5.2.0/surfdata_10x15_hist_2000_16pfts_c240216.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_10x15_hist_2000_16pfts_c240216.nc -lnd/clm2/surfdata_esmf/ctsm5.2.0/surfdata_4x5_hist_2000_16pfts_c240216.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_4x5_hist_2000_16pfts_c240216.nc -lnd/clm2/surfdata_esmf/ctsm5.2.0/surfdata_mpasa60_hist_2000_16pfts_c240216.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_mpasa60_hist_2000_16pfts_c240216.nc -lnd/clm2/surfdata_esmf/ctsm5.2.0/surfdata_mpasa15_hist_2000_16pfts_c240216.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_mpasa15_hist_2000_16pfts_c240216.nc -lnd/clm2/surfdata_esmf/ctsm5.2.0/surfdata_mpasa3p75_hist_2000_16pfts_c240216.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_mpasa3p75_hist_2000_16pfts_c240216.nc -lnd/clm2/surfdata_esmf/ctsm5.2.0/surfdata_0.9x1.25_hist_2000_78pfts_c240216.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_0.9x1.25_hist_2000_78pfts_c240216.nc -lnd/clm2/surfdata_esmf/ctsm5.2.0/surfdata_0.9x1.25_hist_2000_78pfts_c240216.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_0.9x1.25_hist_2000_78pfts_c240216.nc -lnd/clm2/surfdata_esmf/ctsm5.2.0/surfdata_1.9x2.5_hist_2000_78pfts_c240216.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_1.9x2.5_hist_2000_78pfts_c240216.nc -lnd/clm2/surfdata_esmf/ctsm5.2.0/surfdata_1.9x2.5_hist_2000_78pfts_c240216.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_1.9x2.5_hist_2000_78pfts_c240216.nc -lnd/clm2/surfdata_esmf/ctsm5.2.0/surfdata_10x15_hist_2000_78pfts_c240216.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_10x15_hist_2000_78pfts_c240216.nc -lnd/clm2/surfdata_esmf/ctsm5.2.0/surfdata_10x15_hist_2000_78pfts_c240216.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_10x15_hist_2000_78pfts_c240216.nc -lnd/clm2/surfdata_esmf/ctsm5.2.0/surfdata_4x5_hist_2000_78pfts_c240216.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_4x5_hist_2000_78pfts_c240216.nc -lnd/clm2/surfdata_esmf/ctsm5.2.0/surfdata_4x5_hist_2000_78pfts_c240216.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_4x5_hist_2000_78pfts_c240216.nc -lnd/clm2/surfdata_esmf/ctsm5.2.0/surfdata_1x1_brazil_hist_2000_78pfts_c240221.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_1x1_brazil_hist_2000_78pfts_c240221.nc -lnd/clm2/surfdata_esmf/ctsm5.2.0/surfdata_5x5_amazon_hist_2000_78pfts_c240216.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_5x5_amazon_hist_2000_78pfts_c240216.nc -lnd/clm2/surfdata_esmf/ctsm5.2.0/surfdata_ne30np4_hist_2000_78pfts_c240216.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_ne30np4_hist_2000_78pfts_c240216.nc -lnd/clm2/surfdata_esmf/ctsm5.2.0/surfdata_ne30np4.pg2_hist_2000_78pfts_c240216.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_ne30np4.pg2_hist_2000_78pfts_c240216.nc -lnd/clm2/surfdata_esmf/ctsm5.2.0/surfdata_ne30np4.pg3_hist_2000_78pfts_c240216.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_ne30np4.pg3_hist_2000_78pfts_c240216.nc -lnd/clm2/surfdata_esmf/ctsm5.2.0/surfdata_ne16np4.pg3_hist_2000_78pfts_c240216.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_ne16np4.pg3_hist_2000_78pfts_c240216.nc -lnd/clm2/surfdata_esmf/ctsm5.2.0/surfdata_0.125nldas2_hist_2000_78pfts_c240216.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_0.125nldas2_hist_2000_78pfts_c240216.nc -lnd/clm2/surfdata_esmf/ctsm5.2.0/surfdata_T42_hist_2000_78pfts_c240425.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_T42_hist_2000_78pfts_c240425.nc -lnd/clm2/surfdata_esmf/ctsm5.2.0/surfdata_360x720cru_hist_2000_78pfts_c240216.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_360x720cru_hist_2000_78pfts_c240216.nc -lnd/clm2/surfdata_esmf/ctsm5.2.0/surfdata_C96_hist_2000_78pfts_c240216.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_C96_hist_2000_78pfts_c240216.nc -lnd/clm2/surfdata_esmf/ctsm5.2.0/surfdata_1x1_numaIA_hist_2000_78pfts_c240221.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_1x1_numaIA_hist_2000_78pfts_c240221.nc -lnd/clm2/surfdata_esmf/ctsm5.2.0/surfdata_mpasa480_hist_2000_78pfts_c240216.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_mpasa480_hist_2000_78pfts_c240216.nc -lnd/clm2/surfdata_esmf/ctsm5.2.0/surfdata_mpasa120_hist_2000_78pfts_c240216.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_mpasa120_hist_2000_78pfts_c240216.nc -lnd/clm2/surfdata_esmf/ctsm5.2.0/surfdata_ne3np4.pg3_hist_2000_78pfts_c240216.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_ne3np4.pg3_hist_2000_78pfts_c240216.nc -lnd/clm2/surfdata_esmf/ctsm5.2.0/surfdata_ne120np4.pg3_hist_2000_78pfts_c240216.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_ne120np4.pg3_hist_2000_78pfts_c240216.nc -lnd/clm2/surfdata_esmf/ctsm5.2.0/surfdata_ne0np4.ARCTICGRIS.ne30x8_hist_2000_78pfts_c240216.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_ne0np4.ARCTICGRIS.ne30x8_hist_2000_78pfts_c240216.nc -lnd/clm2/surfdata_esmf/ctsm5.2.0/surfdata_ne0np4.ARCTIC.ne30x4_hist_2000_78pfts_c240216.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_ne0np4.ARCTIC.ne30x4_hist_2000_78pfts_c240216.nc -lnd/clm2/surfdata_esmf/ctsm5.2.0/surfdata_ne0np4CONUS.ne30x8_hist_2000_78pfts_c240216.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_ne0np4CONUS.ne30x8_hist_2000_78pfts_c240216.nc -lnd/clm2/surfdata_esmf/ctsm5.2.0/surfdata_1x1_vancouverCAN_hist_2000_78pfts_c240221.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_1x1_vancouverCAN_hist_2000_78pfts_c240221.nc -lnd/clm2/surfdata_esmf/ctsm5.2.0/surfdata_1x1_mexicocityMEX_hist_2000_78pfts_c240221.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_1x1_mexicocityMEX_hist_2000_78pfts_c240221.nc -lnd/clm2/surfdata_esmf/ctsm5.2.0/surfdata_1x1_urbanc_alpha_hist_2000_78pfts_c240221.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_1x1_urbanc_alpha_hist_2000_78pfts_c240221.nc -lnd/clm2/surfdata_esmf/ctsm5.2.0/surfdata_360x720cru_hist_1850_78pfts_c240216.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_360x720cru_hist_1850_78pfts_c240216.nc -lnd/clm2/surfdata_esmf/ctsm5.2.0/surfdata_0.9x1.25_hist_1850_78pfts_c240216.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_0.9x1.25_hist_1850_78pfts_c240216.nc -lnd/clm2/surfdata_esmf/ctsm5.2.0/surfdata_1.9x2.5_hist_1850_78pfts_c240216.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_1.9x2.5_hist_1850_78pfts_c240216.nc -lnd/clm2/surfdata_esmf/ctsm5.2.0/surfdata_10x15_hist_1850_78pfts_c240216.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_10x15_hist_1850_78pfts_c240216.nc -lnd/clm2/surfdata_esmf/ctsm5.2.0/surfdata_4x5_hist_1850_78pfts_c240216.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_4x5_hist_1850_78pfts_c240216.nc -lnd/clm2/surfdata_esmf/ctsm5.2.0/surfdata_mpasa480_hist_1850_78pfts_c240216.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_mpasa480_hist_1850_78pfts_c240216.nc -lnd/clm2/surfdata_esmf/ctsm5.2.0/surfdata_mpasa120_hist_1850_78pfts_c240216.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_mpasa120_hist_1850_78pfts_c240216.nc -lnd/clm2/surfdata_esmf/ctsm5.2.0/surfdata_ne30np4_hist_1850_78pfts_c240216.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_ne30np4_hist_1850_78pfts_c240216.nc -lnd/clm2/surfdata_esmf/ctsm5.2.0/surfdata_ne30np4.pg2_hist_1850_78pfts_c240216.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_ne30np4.pg2_hist_1850_78pfts_c240216.nc -lnd/clm2/surfdata_esmf/ctsm5.2.0/surfdata_ne30np4.pg3_hist_1850_78pfts_c240216.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_ne30np4.pg3_hist_1850_78pfts_c240216.nc -lnd/clm2/surfdata_esmf/ctsm5.2.0/surfdata_ne3np4.pg3_hist_1850_78pfts_c240216.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_ne3np4.pg3_hist_1850_78pfts_c240216.nc -lnd/clm2/surfdata_esmf/ctsm5.2.0/surfdata_C96_hist_1850_78pfts_c240216.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_C96_hist_1850_78pfts_c240216.nc -lnd/clm2/surfdata_esmf/ctsm5.2.0/surfdata_1x1_smallvilleIA_hist_1850_78pfts_c240221.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_1x1_smallvilleIA_hist_1850_78pfts_c240221.nc lnd/clm2/surfdata_esmf/surfdata_1x1_cidadinhoBR_hist_2000_78pfts_c240613.nc -lnd/clm2/surfdata_esmf/ctsm5.2.0/surfdata_1x1_brazil_hist_1850_78pfts_c240221.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_1x1_brazil_hist_1850_78pfts_c240221.nc -lnd/clm2/surfdata_esmf/ctsm5.2.0/surfdata_ne3np4.pg3_hist_1850_78pfts_c240216.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_ne3np4.pg3_hist_1850_78pfts_c240216.nc -lnd/clm2/surfdata_esmf/ctsm5.2.0/surfdata_ne16np4.pg3_hist_1850_78pfts_c240216.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_ne16np4.pg3_hist_1850_78pfts_c240216.nc -lnd/clm2/surfdata_esmf/ctsm5.2.0/surfdata_ne120np4.pg3_hist_1850_78pfts_c240216.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_ne120np4.pg3_hist_1850_78pfts_c240216.nc -lnd/clm2/surfdata_esmf/ctsm5.2.0/surfdata_ne0np4.ARCTICGRIS.ne30x8_hist_1979_78pfts_c240425.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_ne0np4.ARCTICGRIS.ne30x8_hist_1979_78pfts_c240425.nc -lnd/clm2/surfdata_esmf/ctsm5.2.0/surfdata_ne0np4.ARCTIC.ne30x4_hist_1979_78pfts_c240425.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_ne0np4.ARCTIC.ne30x4_hist_1979_78pfts_c240425.nc -lnd/clm2/surfdata_esmf/ctsm5.2.0/surfdata_ne0np4CONUS.ne30x8_hist_1979_78pfts_c240425.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_ne0np4CONUS.ne30x8_hist_1979_78pfts_c240425.nc lnd/clm2/surfdata_esmf/ctsm5.2.0/surfdata_0.9x1.25_PtVeg_nourb_1850_16pfts_c240216.nc +>lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_0.9x1.25_PtVeg_nourb_1850_16pfts_c240216.nc -lnd/clm2/surfdata_esmf/NEON/16PFT_mixed/surfdata_1x1_NEON_${NEONSITE}_hist_2000_16pfts_c240206.nc +lnd/clm2/surfdata_esmf/NEON/16PFT_mixed/surfdata_1x1_NEON_${NEONSITE}_hist_2000_16pfts_c240905.nc -lnd/clm2/surfdata_esmf/NEON/surfdata_1x1_NEON_${NEONSITE}_hist_2000_78pfts_c240206.nc +lnd/clm2/surfdata_esmf/NEON/surfdata_1x1_NEON_${NEONSITE}_hist_2000_78pfts_c240905.nc lnd/clm2/surfdata_esmf/ctsm5.2.0/landuse.timeseries_0.9x1.25_SSP2-4.5_1850-2100_78pfts_c240216.nc + >lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_0.9x1.25_SSP2-4.5_1850-2100_78pfts_c240216.nc lnd/clm2/surfdata_esmf/ctsm5.2.0/landuse.timeseries_1.9x2.5_SSP2-4.5_1850-2100_78pfts_c240216.nc + >lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_1.9x2.5_SSP2-4.5_1850-2100_78pfts_c240216.nc lnd/clm2/surfdata_esmf/ctsm5.2.0/landuse.timeseries_4x5_SSP2-4.5_1850-2100_78pfts_c240216.nc + >lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_4x5_SSP2-4.5_1850-2100_78pfts_c240216.nc lnd/clm2/surfdata_esmf/ctsm5.2.0/landuse.timeseries_10x15_SSP2-4.5_1850-2100_78pfts_c240216.nc + >lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_10x15_SSP2-4.5_1850-2100_78pfts_c240216.nc lnd/clm2/surfdata_esmf/ctsm5.2.0/landuse.timeseries_360x720cru_SSP2-4.5_1850-2100_78pfts_c240216.nc +>lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_360x720cru_SSP2-4.5_1850-2100_78pfts_c240216.nc lnd/clm2/surfdata_esmf/ctsm5.2.0/landuse.timeseries_1x1_brazil_SSP2-4.5_1850-2100_78pfts_c240221.nc +>lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_1x1_brazil_SSP2-4.5_1850-2100_78pfts_c240221.nc lnd/clm2/surfdata_esmf/ctsm5.2.0/landuse.timeseries_mpasa120_SSP2-4.5_1850-2100_78pfts_c240216.nc +>lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_mpasa120_SSP2-4.5_1850-2100_78pfts_c240216.nc lnd/clm2/surfdata_esmf/ctsm5.2.0/landuse.timeseries_ne3np4.pg3_SSP2-4.5_1850-2100_78pfts_c240216.nc +>lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_ne3np4.pg3_SSP2-4.5_1850-2100_78pfts_c240216.nc lnd/clm2/surfdata_esmf/ctsm5.2.0/landuse.timeseries_ne16np4.pg3_SSP2-4.5_1850-2100_78pfts_c240216.nc +>lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_ne16np4.pg3_SSP2-4.5_1850-2100_78pfts_c240216.nc lnd/clm2/surfdata_esmf/ctsm5.2.0/landuse.timeseries_ne30np4.pg3_SSP2-4.5_1850-2100_78pfts_c240216.nc +>lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_ne30np4.pg3_SSP2-4.5_1850-2100_78pfts_c240216.nc lnd/clm2/surfdata_esmf/ctsm5.2.0/landuse.timeseries_C96_SSP2-4.5_1850-2100_78pfts_c240216.nc +>lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_C96_SSP2-4.5_1850-2100_78pfts_c240216.nc lnd/clm2/surfdata_esmf/ctsm5.2.0/landuse.timeseries_1x1_smallvilleIA_SSP2-4.5_1850-1855_78pfts_c240221.nc +>lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_1x1_smallvilleIA_SSP2-4.5_1850-1855_78pfts_c240221.nc @@ -2093,57 +2093,57 @@ lnd/clm2/surfdata_esmf/NEON/surfdata_1x1_NEON_TOOL_hist_78pfts_CMIP6_simyr2000_c lnd/clm2/surfdata_esmf/ctsm5.2.0/landuse.timeseries_0.9x1.25_SSP1-2.6_1850-2100_78pfts_c240216.nc + >lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_0.9x1.25_SSP1-2.6_1850-2100_78pfts_c240216.nc lnd/clm2/surfdata_esmf/ctsm5.2.0/landuse.timeseries_0.9x1.25_SSP2-4.5_1850-2100_78pfts_c240216.nc + >lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_0.9x1.25_SSP2-4.5_1850-2100_78pfts_c240216.nc lnd/clm2/surfdata_esmf/ctsm5.2.0/landuse.timeseries_1.9x2.5_SSP2-4.5_1850-2100_78pfts_c240216.nc + >lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_1.9x2.5_SSP2-4.5_1850-2100_78pfts_c240216.nc lnd/clm2/surfdata_esmf/ctsm5.2.0/landuse.timeseries_4x5_SSP2-4.5_1850-2100_78pfts_c240216.nc + >lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_4x5_SSP2-4.5_1850-2100_78pfts_c240216.nc lnd/clm2/surfdata_esmf/ctsm5.2.0/landuse.timeseries_10x15_SSP2-4.5_1850-2100_78pfts_c240216.nc + >lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_10x15_SSP2-4.5_1850-2100_78pfts_c240216.nc lnd/clm2/surfdata_esmf/ctsm5.2.0/landuse.timeseries_360x720cru_SSP2-4.5_1850-2100_78pfts_c240216.nc +>lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_360x720cru_SSP2-4.5_1850-2100_78pfts_c240216.nc lnd/clm2/surfdata_esmf/ctsm5.2.0/landuse.timeseries_1x1_brazil_SSP2-4.5_1850-2100_78pfts_c240221.nc +>lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_1x1_brazil_SSP2-4.5_1850-2100_78pfts_c240221.nc lnd/clm2/surfdata_esmf/ctsm5.2.0/landuse.timeseries_mpasa120_SSP2-4.5_1850-2100_78pfts_c240216.nc +>lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_mpasa120_SSP2-4.5_1850-2100_78pfts_c240216.nc lnd/clm2/surfdata_esmf/ctsm5.2.0/landuse.timeseries_ne3np4.pg3_SSP2-4.5_1850-2100_78pfts_c240216.nc +>lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_ne3np4.pg3_SSP2-4.5_1850-2100_78pfts_c240216.nc lnd/clm2/surfdata_esmf/ctsm5.2.0/landuse.timeseries_ne16np4.pg3_SSP2-4.5_1850-2100_78pfts_c240216.nc +>lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_ne16np4.pg3_SSP2-4.5_1850-2100_78pfts_c240216.nc lnd/clm2/surfdata_esmf/ctsm5.2.0/landuse.timeseries_ne30np4.pg3_SSP2-4.5_1850-2100_78pfts_c240216.nc +>lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_ne30np4.pg3_SSP2-4.5_1850-2100_78pfts_c240216.nc lnd/clm2/surfdata_esmf/ctsm5.2.0/landuse.timeseries_C96_SSP2-4.5_1850-2100_78pfts_c240216.nc +>lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_C96_SSP2-4.5_1850-2100_78pfts_c240216.nc lnd/clm2/surfdata_esmf/ctsm5.2.0/landuse.timeseries_ne0np4.ARCTICGRIS.ne30x8_SSP2-4.5_1979-2026_78pfts_c240425.nc +>lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_ne0np4.ARCTICGRIS.ne30x8_SSP2-4.5_1979-2026_78pfts_c240425.nc lnd/clm2/surfdata_esmf/ctsm5.2.0/landuse.timeseries_ne0np4.ARCTIC.ne30x4_SSP2-4.5_1979-2026_78pfts_c240425.nc +>lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_ne0np4.ARCTIC.ne30x4_SSP2-4.5_1979-2026_78pfts_c240425.nc lnd/clm2/surfdata_esmf/ctsm5.2.0/landuse.timeseries_ne0np4CONUS.ne30x8_SSP2-4.5_1979-2026_78pfts_c240425.nc +>lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_ne0np4CONUS.ne30x8_SSP2-4.5_1979-2026_78pfts_c240425.nc lnd/clm2/surfdata_esmf/ctsm5.2.0/landuse.timeseries_0.9x1.25_SSP3-7.0_1850-2100_78pfts_c240216.nc +>lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_0.9x1.25_SSP3-7.0_1850-2100_78pfts_c240216.nc lnd/clm2/surfdata_esmf/ctsm5.2.0/landuse.timeseries_0.9x1.25_SSP4-6.0_1850-2100_78pfts_c240216.nc +>lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_0.9x1.25_SSP4-6.0_1850-2100_78pfts_c240216.nc lnd/clm2/surfdata_esmf/ctsm5.2.0/landuse.timeseries_0.9x1.25_SSP5-8.5_1850-2100_78pfts_c240216.nc +>lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_0.9x1.25_SSP5-8.5_1850-2100_78pfts_c240216.nc From fa3fb4d2ee126cca8c13df09637259a738b5b45c Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Fri, 6 Sep 2024 13:07:59 -0600 Subject: [PATCH 1038/1248] Update _c240221 to _c240905 --- bld/namelist_files/namelist_defaults_ctsm.xml | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index 5ca3030259..e6a6741893 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -1925,7 +1925,7 @@ lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_4x5_hist_2000_78pfts_c240216.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_1x1_brazil_hist_2000_78pfts_c240221.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_1x1_brazil_hist_2000_78pfts_c240905.nc lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_5x5_amazon_hist_2000_78pfts_c240216.nc @@ -1950,7 +1950,7 @@ lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_360x720cru_hist_2000_78pfts_c240216.nc lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_C96_hist_2000_78pfts_c240216.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_1x1_numaIA_hist_2000_78pfts_c240221.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_1x1_numaIA_hist_2000_78pfts_c240905.nc @@ -1971,11 +1971,11 @@ lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_ne0np4CONUS.ne30x8_hist_2000_78pfts_c2 -lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_1x1_vancouverCAN_hist_2000_78pfts_c240221.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_1x1_vancouverCAN_hist_2000_78pfts_c240905.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_1x1_mexicocityMEX_hist_2000_78pfts_c240221.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_1x1_mexicocityMEX_hist_2000_78pfts_c240905.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_1x1_urbanc_alpha_hist_2000_78pfts_c240221.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_1x1_urbanc_alpha_hist_2000_78pfts_c240905.nc @@ -2007,11 +2007,11 @@ lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_ne3np4.pg3_hist_1850_78pfts_c240216.nc lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_C96_hist_1850_78pfts_c240216.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_1x1_smallvilleIA_hist_1850_78pfts_c240221.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_1x1_smallvilleIA_hist_1850_78pfts_c240905.nc lnd/clm2/surfdata_esmf/surfdata_1x1_cidadinhoBR_hist_2000_78pfts_c240613.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_1x1_brazil_hist_1850_78pfts_c240221.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_1x1_brazil_hist_1850_78pfts_c240905.nc lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_ne3np4.pg3_hist_1850_78pfts_c240216.nc @@ -2065,7 +2065,7 @@ lnd/clm2/surfdata_esmf/NEON/surfdata_1x1_NEON_TOOL_hist_78pfts_CMIP6_simyr2000_c >lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_360x720cru_SSP2-4.5_1850-2100_78pfts_c240216.nc lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_1x1_brazil_SSP2-4.5_1850-2100_78pfts_c240221.nc +>lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_1x1_brazil_SSP2-4.5_1850-2100_78pfts_c240905.nc lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_mpasa120_SSP2-4.5_1850-2100_78pfts_c240216.nc @@ -2084,7 +2084,7 @@ lnd/clm2/surfdata_esmf/NEON/surfdata_1x1_NEON_TOOL_hist_78pfts_CMIP6_simyr2000_c lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_1x1_smallvilleIA_SSP2-4.5_1850-1855_78pfts_c240221.nc +>lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_1x1_smallvilleIA_SSP2-4.5_1850-1855_78pfts_c240905.nc @@ -2111,7 +2111,7 @@ lnd/clm2/surfdata_esmf/NEON/surfdata_1x1_NEON_TOOL_hist_78pfts_CMIP6_simyr2000_c >lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_360x720cru_SSP2-4.5_1850-2100_78pfts_c240216.nc lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_1x1_brazil_SSP2-4.5_1850-2100_78pfts_c240221.nc +>lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_1x1_brazil_SSP2-4.5_1850-2100_78pfts_c240905.nc lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_mpasa120_SSP2-4.5_1850-2100_78pfts_c240216.nc From ffdd332ba446364a5f3ffe04a7cdc470601d553b Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Fri, 6 Sep 2024 11:12:59 -0600 Subject: [PATCH 1039/1248] Fix uninitialized mask values --- tools/mksurfdata_esmf/src/mksoiltexMod.F90 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/mksurfdata_esmf/src/mksoiltexMod.F90 b/tools/mksurfdata_esmf/src/mksoiltexMod.F90 index fb8396f344..398bbaf51d 100644 --- a/tools/mksurfdata_esmf/src/mksoiltexMod.F90 +++ b/tools/mksurfdata_esmf/src/mksoiltexMod.F90 @@ -165,6 +165,8 @@ subroutine mksoiltex(file_mesh_i, file_mapunit_i, file_lookup_i, mesh_o, pioid_o do ni = 1,ns_i if (mapunit_i(ni) == 0.) then mask_i(ni) = 0 + else + mask_i(ni) = 1 end if end do call ESMF_MeshSet(mesh_i, elementMask=mask_i, rc=rc) From 10319de7db53b0560f85166ef240d051dc440b6a Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Fri, 6 Sep 2024 13:15:45 -0600 Subject: [PATCH 1040/1248] Get mapunit_value_max across all processors Resolves ESCOMP/CTSM#2744 --- tools/mksurfdata_esmf/src/mksoiltexMod.F90 | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tools/mksurfdata_esmf/src/mksoiltexMod.F90 b/tools/mksurfdata_esmf/src/mksoiltexMod.F90 index 398bbaf51d..4d24372729 100644 --- a/tools/mksurfdata_esmf/src/mksoiltexMod.F90 +++ b/tools/mksurfdata_esmf/src/mksoiltexMod.F90 @@ -13,13 +13,15 @@ module mksoiltexMod use mkutilsMod , only : chkerr use mkdiagnosticsMod , only : output_diagnostics_index use mkfileMod , only : mkfile_output - use mkvarctl , only : root_task, ndiag, spval + use mkvarctl , only : root_task, ndiag, spval, mpicom use mkvarctl , only : unsetsoil use mkvarpar , only : nlevsoi implicit none private ! By default make data private +#include + public :: mksoiltex ! Set soil texture integer :: mapunit_value_max @@ -61,6 +63,7 @@ subroutine mksoiltex(file_mesh_i, file_mapunit_i, file_lookup_i, mesh_o, pioid_o integer :: k,l,m,n integer :: nlay ! number of soil layers integer :: n_scid + integer :: mapunit_value_max_local integer , allocatable :: mask_i(:) real(r4), pointer :: dataptr(:) integer :: mapunit ! temporary igbp soil mapunit @@ -202,7 +205,8 @@ subroutine mksoiltex(file_mesh_i, file_mapunit_i, file_lookup_i, mesh_o, pioid_o ! Determine mapunit_value_max (set it as a module variable so that it can be ! accessible to gen_dominant_mapunit) - this is needed in the dynamic mask routine - mapunit_value_max = maxval(dataptr) + mapunit_value_max_local = maxval(dataptr) + call mpi_allreduce(mapunit_value_max_local, mapunit_value_max, 1, MPI_INTEGER, MPI_MAX, mpicom, rcode) ! Determine values in field_o call ESMF_FieldGet(field_o, farrayptr=dataptr, rc=rc) From ec134068506d99b7d34053e29b830c787520d6eb Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Fri, 6 Sep 2024 16:09:34 -0600 Subject: [PATCH 1041/1248] Change _c240425 and _c240613 to _c240905 --- bld/namelist_files/namelist_defaults_ctsm.xml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index e6a6741893..06e3008491 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -1943,7 +1943,7 @@ lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_ne16np4.pg3_hist_2000_78pfts_c240216.n lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_0.125nldas2_hist_2000_78pfts_c240216.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_T42_hist_2000_78pfts_c240425.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_T42_hist_2000_78pfts_c240905.nc lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_360x720cru_hist_2000_78pfts_c240216.nc @@ -2009,7 +2009,7 @@ lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_C96_hist_1850_78pfts_c240216.nc lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_1x1_smallvilleIA_hist_1850_78pfts_c240905.nc -lnd/clm2/surfdata_esmf/surfdata_1x1_cidadinhoBR_hist_2000_78pfts_c240613.nc +lnd/clm2/surfdata_esmf/surfdata_1x1_cidadinhoBR_hist_2000_78pfts_c240905.nc lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_1x1_brazil_hist_1850_78pfts_c240905.nc @@ -2020,11 +2020,11 @@ lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_ne16np4.pg3_hist_1850_78pfts_c240216.n lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_ne120np4.pg3_hist_1850_78pfts_c240216.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_ne0np4.ARCTICGRIS.ne30x8_hist_1979_78pfts_c240425.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_ne0np4.ARCTICGRIS.ne30x8_hist_1979_78pfts_c240905.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_ne0np4.ARCTIC.ne30x4_hist_1979_78pfts_c240425.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_ne0np4.ARCTIC.ne30x4_hist_1979_78pfts_c240905.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_ne0np4CONUS.ne30x8_hist_1979_78pfts_c240425.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_ne0np4CONUS.ne30x8_hist_1979_78pfts_c240905.nc lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_C96_SSP2-4.5_1850-2100_78pfts_c240216.nc lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_ne0np4.ARCTICGRIS.ne30x8_SSP2-4.5_1979-2026_78pfts_c240425.nc +>lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_ne0np4.ARCTICGRIS.ne30x8_SSP2-4.5_1979-2026_78pfts_c240905.nc lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_ne0np4.ARCTIC.ne30x4_SSP2-4.5_1979-2026_78pfts_c240425.nc +>lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_ne0np4.ARCTIC.ne30x4_SSP2-4.5_1979-2026_78pfts_c240905.nc lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_ne0np4CONUS.ne30x8_SSP2-4.5_1979-2026_78pfts_c240425.nc +>lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_ne0np4CONUS.ne30x8_SSP2-4.5_1979-2026_78pfts_c240905.nc Date: Sat, 7 Sep 2024 08:35:21 -0600 Subject: [PATCH 1042/1248] Add a comment --- tools/mksurfdata_esmf/src/mksoiltexMod.F90 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/mksurfdata_esmf/src/mksoiltexMod.F90 b/tools/mksurfdata_esmf/src/mksoiltexMod.F90 index 4d24372729..c7655bbc26 100644 --- a/tools/mksurfdata_esmf/src/mksoiltexMod.F90 +++ b/tools/mksurfdata_esmf/src/mksoiltexMod.F90 @@ -205,6 +205,10 @@ subroutine mksoiltex(file_mesh_i, file_mapunit_i, file_lookup_i, mesh_o, pioid_o ! Determine mapunit_value_max (set it as a module variable so that it can be ! accessible to gen_dominant_mapunit) - this is needed in the dynamic mask routine + ! + ! Note that dataptr (obtained from the input field) contains just a subset of the + ! source data, based on the source data decomposition. So we need an mpi_allreduce to + ! determine the global maximum value of mapunit. mapunit_value_max_local = maxval(dataptr) call mpi_allreduce(mapunit_value_max_local, mapunit_value_max, 1, MPI_INTEGER, MPI_MAX, mpicom, rcode) From 724c7c36282480a7ae4d6768752331391499689d Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Mon, 9 Sep 2024 14:02:30 -0600 Subject: [PATCH 1043/1248] Update fsurdat in Hillslope testmod. --- cime_config/testdefs/testmods_dirs/clm/Hillslope/user_nl_clm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cime_config/testdefs/testmods_dirs/clm/Hillslope/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/Hillslope/user_nl_clm index 4fc6fc2373..6cca61d21d 100644 --- a/cime_config/testdefs/testmods_dirs/clm/Hillslope/user_nl_clm +++ b/cime_config/testdefs/testmods_dirs/clm/Hillslope/user_nl_clm @@ -6,6 +6,6 @@ hillslope_transmissivity_method = 'LayerSum' hillslope_pft_distribution_method = 'PftLowlandUpland' hillslope_soil_profile_method = 'Uniform' -fsurdat = '$DIN_LOC_ROOT/lnd/clm2/testdata/surfdata_10x15_hist_2000_78pfts_c240216.synthetic_hillslopes.nc' +fsurdat = '$DIN_LOC_ROOT/lnd/clm2/testdata/surfdata_10x15_hist_2000_78pfts_c240905.synthetic_hillslopes.nc' use_ssre = .false. From df3b6a5df38b845025218f4c03a479317641c21c Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Mon, 9 Sep 2024 14:39:00 -0600 Subject: [PATCH 1044/1248] Update fsurdat in Hillslope testmod w/ Dataset_Version. --- cime_config/testdefs/testmods_dirs/clm/Hillslope/user_nl_clm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cime_config/testdefs/testmods_dirs/clm/Hillslope/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/Hillslope/user_nl_clm index 6cca61d21d..7b343f8ec8 100644 --- a/cime_config/testdefs/testmods_dirs/clm/Hillslope/user_nl_clm +++ b/cime_config/testdefs/testmods_dirs/clm/Hillslope/user_nl_clm @@ -6,6 +6,6 @@ hillslope_transmissivity_method = 'LayerSum' hillslope_pft_distribution_method = 'PftLowlandUpland' hillslope_soil_profile_method = 'Uniform' -fsurdat = '$DIN_LOC_ROOT/lnd/clm2/testdata/surfdata_10x15_hist_2000_78pfts_c240905.synthetic_hillslopes.nc' +fsurdat = '$DIN_LOC_ROOT/lnd/clm2/testdata/surfdata_10x15_hist_2000_78pfts_c240905.synthetic_hillslopes2.nc' use_ssre = .false. From 7dc1cd9a38e3aa2788c59ab2c2b4071bac50db4a Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Mon, 9 Sep 2024 15:29:39 -0600 Subject: [PATCH 1045/1248] Update fsurdat in Hillslope testmod w/ real fsurdat. --- cime_config/testdefs/testmods_dirs/clm/Hillslope/user_nl_clm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cime_config/testdefs/testmods_dirs/clm/Hillslope/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/Hillslope/user_nl_clm index 7b343f8ec8..9a132d5d6a 100644 --- a/cime_config/testdefs/testmods_dirs/clm/Hillslope/user_nl_clm +++ b/cime_config/testdefs/testmods_dirs/clm/Hillslope/user_nl_clm @@ -6,6 +6,6 @@ hillslope_transmissivity_method = 'LayerSum' hillslope_pft_distribution_method = 'PftLowlandUpland' hillslope_soil_profile_method = 'Uniform' -fsurdat = '$DIN_LOC_ROOT/lnd/clm2/testdata/surfdata_10x15_hist_2000_78pfts_c240905.synthetic_hillslopes2.nc' +fsurdat = '$DIN_LOC_ROOT/lnd/clm2/testdata/surfdata_10x15_hist_2000_78pfts_c240905.synthetic_hillslopes3.nc' use_ssre = .false. From 61e98207e691e62084b5f2bc26c95b379cec8bb3 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Tue, 10 Sep 2024 01:18:36 -0600 Subject: [PATCH 1046/1248] Update surface datasets to latest date, verify that the build-namelist unit testter works --- bld/namelist_files/namelist_defaults_ctsm.xml | 180 +++++++++--------- 1 file changed, 90 insertions(+), 90 deletions(-) diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index 06e3008491..3efbe5795f 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -1891,150 +1891,150 @@ 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_c240216.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_0.9x1.25_hist_2000_16pfts_c240908.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_1.9x2.5_hist_2000_16pfts_c240216.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_1.9x2.5_hist_2000_16pfts_c240908.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_10x15_hist_2000_16pfts_c240216.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_10x15_hist_2000_16pfts_c240908.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_4x5_hist_2000_16pfts_c240216.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_4x5_hist_2000_16pfts_c240908.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_mpasa60_hist_2000_16pfts_c240216.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_mpasa60_hist_2000_16pfts_c240908.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_mpasa15_hist_2000_16pfts_c240216.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_mpasa15_hist_2000_16pfts_c240908.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_mpasa3p75_hist_2000_16pfts_c240216.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_mpasa3p75_hist_2000_16pfts_c240908.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_0.9x1.25_hist_2000_78pfts_c240216.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_0.9x1.25_hist_2000_78pfts_c240216.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_c240216.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_1.9x2.5_hist_2000_78pfts_c240908.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_1.9x2.5_hist_2000_78pfts_c240216.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_1.9x2.5_hist_2000_78pfts_c240908.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_10x15_hist_2000_78pfts_c240216.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_10x15_hist_2000_78pfts_c240908.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_10x15_hist_2000_78pfts_c240216.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_10x15_hist_2000_78pfts_c240908.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_4x5_hist_2000_78pfts_c240216.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_4x5_hist_2000_78pfts_c240908.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_4x5_hist_2000_78pfts_c240216.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_4x5_hist_2000_78pfts_c240908.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_1x1_brazil_hist_2000_78pfts_c240905.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_1x1_brazil_hist_2000_78pfts_c240908.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_5x5_amazon_hist_2000_78pfts_c240216.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_5x5_amazon_hist_2000_78pfts_c240908.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_ne30np4_hist_2000_78pfts_c240216.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_ne30np4_hist_2000_78pfts_c240908.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_ne30np4.pg2_hist_2000_78pfts_c240216.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_ne30np4.pg2_hist_2000_78pfts_c240908.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_ne30np4.pg3_hist_2000_78pfts_c240216.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_ne30np4.pg3_hist_2000_78pfts_c240908.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_ne16np4.pg3_hist_2000_78pfts_c240216.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_ne16np4.pg3_hist_2000_78pfts_c240908.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_0.125nldas2_hist_2000_78pfts_c240216.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_0.125nldas2_hist_2000_78pfts_c240908.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_T42_hist_2000_78pfts_c240905.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_c240216.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_360x720cru_hist_2000_78pfts_c240908.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_C96_hist_2000_78pfts_c240216.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_C96_hist_2000_78pfts_c240908.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_1x1_numaIA_hist_2000_78pfts_c240905.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_1x1_numaIA_hist_2000_78pfts_c240908.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_mpasa480_hist_2000_78pfts_c240216.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_mpasa480_hist_2000_78pfts_c240908.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_mpasa120_hist_2000_78pfts_c240216.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_mpasa120_hist_2000_78pfts_c240908.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_ne3np4.pg3_hist_2000_78pfts_c240216.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_ne3np4.pg3_hist_2000_78pfts_c240908.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_ne120np4.pg3_hist_2000_78pfts_c240216.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_ne120np4.pg3_hist_2000_78pfts_c240908.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_ne0np4.ARCTICGRIS.ne30x8_hist_2000_78pfts_c240216.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_ne0np4.ARCTICGRIS.ne30x8_hist_2000_78pfts_c240908.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_ne0np4.ARCTIC.ne30x4_hist_2000_78pfts_c240216.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_ne0np4.ARCTIC.ne30x4_hist_2000_78pfts_c240908.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_ne0np4CONUS.ne30x8_hist_2000_78pfts_c240216.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_ne0np4CONUS.ne30x8_hist_2000_78pfts_c240908.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_1x1_vancouverCAN_hist_2000_78pfts_c240905.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_1x1_vancouverCAN_hist_2000_78pfts_c240908.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_1x1_mexicocityMEX_hist_2000_78pfts_c240905.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_1x1_mexicocityMEX_hist_2000_78pfts_c240908.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_1x1_urbanc_alpha_hist_2000_78pfts_c240905.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/synthetic/surfdata_1x1_urbanc_alpha_hist_2000_78pfts_c240908.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_360x720cru_hist_1850_78pfts_c240216.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_c240216.nc +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_c240216.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_c240216.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_10x15_hist_1850_78pfts_c240908.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_4x5_hist_1850_78pfts_c240216.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_4x5_hist_1850_78pfts_c240908.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_mpasa480_hist_1850_78pfts_c240216.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_mpasa480_hist_1850_78pfts_c240908.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_mpasa120_hist_1850_78pfts_c240216.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_mpasa120_hist_1850_78pfts_c240908.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_ne30np4_hist_1850_78pfts_c240216.nc +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_c240216.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_c240216.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_c240216.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_ne3np4.pg3_hist_1850_78pfts_c240908.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_C96_hist_1850_78pfts_c240216.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_C96_hist_1850_78pfts_c240908.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_1x1_smallvilleIA_hist_1850_78pfts_c240905.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/synthetic/surfdata_1x1_smallvilleIA_hist_1850_78pfts_c240908.nc -lnd/clm2/surfdata_esmf/surfdata_1x1_cidadinhoBR_hist_2000_78pfts_c240905.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/synthetic/surfdata_1x1_cidadinhoBR_hist_2000_78pfts_c240908.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_1x1_brazil_hist_1850_78pfts_c240905.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_1x1_brazil_hist_1850_78pfts_c240908.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_ne3np4.pg3_hist_1850_78pfts_c240216.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_ne3np4.pg3_hist_1850_78pfts_c240908.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_ne16np4.pg3_hist_1850_78pfts_c240216.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_ne16np4.pg3_hist_1850_78pfts_c240908.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_ne120np4.pg3_hist_1850_78pfts_c240216.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_ne120np4.pg3_hist_1850_78pfts_c240908.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_ne0np4.ARCTICGRIS.ne30x8_hist_1979_78pfts_c240905.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_ne0np4.ARCTICGRIS.ne30x8_hist_1979_78pfts_c240908.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_ne0np4.ARCTIC.ne30x4_hist_1979_78pfts_c240905.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_ne0np4.ARCTIC.ne30x4_hist_1979_78pfts_c240908.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_ne0np4CONUS.ne30x8_hist_1979_78pfts_c240905.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_ne0np4CONUS.ne30x8_hist_1979_78pfts_c240908.nc lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_0.9x1.25_PtVeg_nourb_1850_16pfts_c240216.nc +>lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_0.9x1.25_PtVeg_nourb_1850_16pfts_c240908.nc -lnd/clm2/surfdata_esmf/NEON/16PFT_mixed/surfdata_1x1_NEON_${NEONSITE}_hist_2000_16pfts_c240905.nc +lnd/clm2/surfdata_esmf/NEON/16PFT_mixed/surfdata_1x1_NEON_${NEONSITE}_hist_2000_16pfts_c240908.nc -lnd/clm2/surfdata_esmf/NEON/surfdata_1x1_NEON_${NEONSITE}_hist_2000_78pfts_c240905.nc +lnd/clm2/surfdata_esmf/NEON/surfdata_1x1_NEON_${NEONSITE}_hist_2000_78pfts_c240908.nc lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_0.9x1.25_SSP2-4.5_1850-2100_78pfts_c240216.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_c240216.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_c240216.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_c240216.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_c240216.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_c240905.nc +>lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_1x1_brazil_SSP2-4.5_1850-2100_78pfts_c240908.nc lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_mpasa120_SSP2-4.5_1850-2100_78pfts_c240216.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.pg3_SSP2-4.5_1850-2100_78pfts_c240216.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_c240216.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_c240216.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_c240216.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_1x1_smallvilleIA_SSP2-4.5_1850-1855_78pfts_c240905.nc +>lnd/clm2/surfdata_esmf/ctsm5.3.0/synthetic/landuse.timeseries_1x1_smallvilleIA_synth_1850-1855_78pfts_c240908.nc @@ -2093,57 +2093,57 @@ lnd/clm2/surfdata_esmf/NEON/surfdata_1x1_NEON_TOOL_hist_78pfts_CMIP6_simyr2000_c lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_0.9x1.25_SSP1-2.6_1850-2100_78pfts_c240216.nc + >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_c240216.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_c240216.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_c240216.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_c240216.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_c240216.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_c240905.nc +>lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_1x1_brazil_SSP2-4.5_1850-2100_78pfts_c240908.nc lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_mpasa120_SSP2-4.5_1850-2100_78pfts_c240216.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.pg3_SSP2-4.5_1850-2100_78pfts_c240216.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_c240216.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_c240216.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_c240216.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_c240905.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_c240905.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_ne0np4CONUS.ne30x8_SSP2-4.5_1979-2026_78pfts_c240905.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_c240216.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_c240216.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_c240216.nc +>lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_0.9x1.25_SSP5-8.5_1850-2100_78pfts_c240908.nc From c06e816fbee23fbed1b8f2e4229f159c55b59c0c Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Tue, 10 Sep 2024 08:34:08 -0600 Subject: [PATCH 1047/1248] Update path to synthetic hillslope fsurdat. --- cime_config/testdefs/testmods_dirs/clm/Hillslope/user_nl_clm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cime_config/testdefs/testmods_dirs/clm/Hillslope/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/Hillslope/user_nl_clm index 9a132d5d6a..d27565d98f 100644 --- a/cime_config/testdefs/testmods_dirs/clm/Hillslope/user_nl_clm +++ b/cime_config/testdefs/testmods_dirs/clm/Hillslope/user_nl_clm @@ -6,6 +6,6 @@ hillslope_transmissivity_method = 'LayerSum' hillslope_pft_distribution_method = 'PftLowlandUpland' hillslope_soil_profile_method = 'Uniform' -fsurdat = '$DIN_LOC_ROOT/lnd/clm2/testdata/surfdata_10x15_hist_2000_78pfts_c240905.synthetic_hillslopes3.nc' +fsurdat = '$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/ctsm5.3.0/synthetic/surfdata_10x15_hist_2000_78pfts_c240905.synthetic_hillslopes3.nc' use_ssre = .false. From 65dc3ce44b65ed6e62c40ee276db968b9e6de74c Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 11 Sep 2024 01:35:25 -0600 Subject: [PATCH 1048/1248] Update NEON datasets, remove double setting of NEON sites in namelist defaults and user-mods fixing #2752 --- bld/CLMBuildNamelist.pm | 13 +++++++++++-- bld/namelist_files/namelist_defaults_ctsm.xml | 8 ++++---- .../usermods_dirs/NEON/FATES/defaults/user_nl_clm | 3 --- cime_config/usermods_dirs/NEON/defaults/user_nl_clm | 3 --- 4 files changed, 15 insertions(+), 12 deletions(-) diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index a5b19dd62b..c18b72ac15 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -2506,8 +2506,9 @@ sub setup_logic_surface_dataset { # consistent with it # MUST BE AFTER: setup_logic_demand which is where flanduse_timeseries is set # - my ($opts, $nl_flags, $definition, $defaults, $nl, $xmlvar_ref) = @_; + my ($opts_in, $nl_flags, $definition, $defaults, $nl, $xmlvar_ref) = @_; + my $opts = $opts_in; $nl_flags->{'flanduse_timeseries'} = "null"; my $flanduse_timeseries = $nl->get_value('flanduse_timeseries'); if (defined($flanduse_timeseries)) { @@ -2523,6 +2524,11 @@ sub setup_logic_surface_dataset { if ($flanduse_timeseries ne "null" && &value_is_true($nl_flags->{'use_cndv'}) ) { $log->fatal_error( "dynamic PFT's (setting flanduse_timeseries) are incompatible with dynamic vegetation (use_cndv=.true)." ); } + # Turn test option off for NEON until after XML is interpreted + my $test_files = $opts->{'test'}; + if ( &value_is_true($nl_flags->{'neon'})) { + $opts->{'test'} = 0; + } # # Always get the crop version of the datasets now and let the code turn it into the form desired # Provided this isn't with FATES on @@ -2548,7 +2554,7 @@ sub setup_logic_surface_dataset { 'use_crop'=>$nl_flags->{'use_crop'} ); } # - # Expand the XML variables for NEON cases so that NEONSITE will be used + # Expand the XML variables for NEON cases so that NEONSITE will be used and test for existence # if ( &value_is_true($nl_flags->{'neon'}) ) { my $fsurdat = $nl->get_value($var); @@ -2557,6 +2563,9 @@ sub setup_logic_surface_dataset { my $group = $definition->get_group_name($var); $nl->set_variable_value($group, $var, $newval); $log->verbose_message( "This is a NEON site and the fsurdat file selected is: $newval" ); + if ( $test_files and ($newval !~ /null|none/) and (! -f remove_leading_and_trailing_quotes($newval) ) ) { + $log->fatal_error("file not found: $var = $newval"); + } } } } diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index 3efbe5795f..0188f91faa 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -2032,13 +2032,13 @@ lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_ne0np4CONUS.ne30x8_hist_1979_78pfts_c2 -lnd/clm2/surfdata_esmf/NEON/16PFT_mixed/surfdata_1x1_NEON_${NEONSITE}_hist_2000_16pfts_c240908.nc +lnd/clm2/surfdata_esmf/NEON/ctsm5.3.0/16PFT_mixed/surfdata_1x1_NEON_${NEONSITE}_hist_2000_16pfts_c240910.nc -lnd/clm2/surfdata_esmf/NEON/surfdata_1x1_NEON_${NEONSITE}_hist_2000_78pfts_c240908.nc +lnd/clm2/surfdata_esmf/NEON/ctsm5.3.0/surfdata_1x1_NEON_${NEONSITE}_hist_2000_78pfts_c240908.nc @@ -2046,7 +2046,7 @@ lnd/clm2/surfdata_esmf/NEON/surfdata_1x1_NEON_TOOL_hist_78pfts_CMIP6_simyr2000_c diff --git a/cime_config/usermods_dirs/NEON/FATES/defaults/user_nl_clm b/cime_config/usermods_dirs/NEON/FATES/defaults/user_nl_clm index 1a9847a69b..e49d110d51 100644 --- a/cime_config/usermods_dirs/NEON/FATES/defaults/user_nl_clm +++ b/cime_config/usermods_dirs/NEON/FATES/defaults/user_nl_clm @@ -18,9 +18,6 @@ ! Set glc_do_dynglacier with GLC_TWO_WAY_COUPLING env variable !---------------------------------------------------------------------------------- -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/NEON/16PFT_mixed/surfdata_1x1_NEON_${NEONSITE}_hist_2000_16pfts_c240206.nc" - ! h1 output stream hist_fincl2 = 'FATES_AUTORESP','FCEV','FCTR','FGEV','FIRA','FSA','FSH','FATES_GPP','FATES_GPP_PF','H2OSOI', 'SNOW_DEPTH','TBOT','TSOI','SOILC_vr','FATES_NPP','FATES_NPP_PF','FATES_VEGC','FATES_VEGC_PF' diff --git a/cime_config/usermods_dirs/NEON/defaults/user_nl_clm b/cime_config/usermods_dirs/NEON/defaults/user_nl_clm index b73da1f33e..f0e7142990 100644 --- a/cime_config/usermods_dirs/NEON/defaults/user_nl_clm +++ b/cime_config/usermods_dirs/NEON/defaults/user_nl_clm @@ -18,9 +18,6 @@ ! Set glc_do_dynglacier with GLC_TWO_WAY_COUPLING env variable !---------------------------------------------------------------------------------- -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/NEON/surfdata_1x1_NEON_${NEONSITE}_hist_2000_78pfts_c240206.nc" - ! h1 output stream hist_fincl2 = 'AR','ELAI','FCEV','FCTR','FGEV','FIRA','FSA','FSH','GPP','H2OSOI', 'HR','SNOW_DEPTH','TBOT','TSOI','SOILC_vr','FV','NET_NMIN_vr' From 42ec043dfe01d86483b147298a58ed19594ec489 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 11 Sep 2024 03:10:49 -0600 Subject: [PATCH 1049/1248] Add tests for the PLUMBER2 sites --- bld/unit_testers/build-namelist_test.pl | 60 +++++++++++++++++++++++-- 1 file changed, 57 insertions(+), 3 deletions(-) diff --git a/bld/unit_testers/build-namelist_test.pl b/bld/unit_testers/build-namelist_test.pl index 8b2827b069..5ea47ad1fa 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=>"" ); + my %env_vars = ( DIN_LOC_ROOT=>"MYDINLOCROOT", GLC_TWO_WAY_COUPLING=>"FALSE", LND_SETS_DUST_EMIS_DRV_FLDS=>"TRUE", NEONSITE=>"", PLUMBER2SITE=>"" ); # Set any settings that came in from function call foreach my $item ( keys(%settings) ) { $env_vars{$item} = $settings{$item}; @@ -163,10 +163,10 @@ sub cat_and_create_namelistinfile { # # Figure out number of tests that will run # -my $ntests = 3349; +my $ntests = 3859; if ( defined($opts{'compare'}) ) { - $ntests += 2007; + $ntests += 2347; } plan( tests=>$ntests ); @@ -411,6 +411,60 @@ sub cat_and_create_namelistinfile { system( "/bin/rm $namelistfile" ); &cleanup(); } +print "\n===============================================================================\n"; +print "Test the PLUMBER2 sites\n"; +print "=================================================================================\n"; +my $phys = "clm6_0"; +$mode = "-phys $phys"; +&make_config_cache($phys); +my $plumdir = "../../cime_config/usermods_dirs/PLUMBER2"; +foreach my $site ( + "AR-SLu", "AU-Emr", "AU-TTE", "CA-NS1", "CA-SF3", "CN-HaM", "DE-Obe", "ES-ES1", "FR-Gri", "IE-Dri", "IT-LMa", "IT-SRo", "RU-Fyo", "US-Aud", "US-Ho1", "US-Ne2", "US-Syv", "ZM-Mon", + "AT-Neu", "AU-Gin", "AU-Tum", "CA-NS2", "CH-Cha", "CN-Qia", "DE-Seh", "ES-ES2", "FR-Hes", "IT-Amp", "IT-Mal", "JP-SMF", "RU-Zot", "US-Bar", "US-KS2", "US-Ne3", "US-Ton", + "AU-ASM", "AU-GWW", "AU-Whr", "CA-NS4", "CH-Dav", "CZ-wet", "DE-SfN", "ES-LgS", "FR-LBr", "IT-BCi", "IT-MBo", "NL-Ca1", "SD-Dem", "US-Bkg", "US-Los", "US-NR1", "US-Tw4", + "AU-Cow", "AU-How", "AU-Wrr", "CA-NS5", "CH-Fru", "DE-Bay", "DE-Tha", "ES-LMa", "FR-Lq1", "IT-CA1", "IT-Noe", "NL-Hor", "SE-Deg", "US-Blo", "US-Me2", "US-PFa", "US-Twt", + "AU-Cpr", "AU-Lit", "AU-Ync", "CA-NS6", "CH-Oe1", "DE-Wet", "ES-VDA", "FR-Lq2", "IT-CA2", "IT-Non", "NL-Loo", "UK-Gri", "US-Bo1", "US-Me4", "US-Prr", "US-UMB", + "AU-Ctr", "AU-Otw", "BE-Bra", "CA-NS7", "CN-Cha", "DE-Geb", "DK-Fou", "FI-Hyy", "FR-Pue", "IT-CA3", "IT-PT1", "PL-wet", "UK-Ham", "US-Cop", "US-Me6", "US-SP1", "US-Var", + "AU-Cum", "AU-Rig", "BE-Lon", "CA-Qcu", "CN-Cng", "DE-Gri", "DK-Lva", "FI-Kaa", "GF-Guy", "IT-Col", "IT-Ren", "PT-Esp", "UK-PL3", "US-FPe", "US-MMS", "US-SP2", "US-WCr", + "AU-DaP", "AU-Rob", "BE-Vie", "CA-Qfo", "CN-Dan", "DE-Hai", "DK-Ris", "FI-Lom", "HU-Bug", "IT-Cpz", "IT-Ro1", "PT-Mi1", "US-AR1", "US-GLE", "US-MOz", "US-SP3", "US-Whs", + "AU-DaS", "AU-Sam", "BR-Sa3", "CA-SF1", "CN-Din", "DE-Kli", "DK-Sor", "FI-Sod", "ID-Pag", "IT-Isp", "IT-Ro2", "PT-Mi2", "US-AR2", "US-Goo", "US-Myb", "US-SRG", "US-Wkg", + "AU-Dry", "AU-Stp", "BW-Ma1", "CA-SF2", "CN-Du2", "DE-Meh", "DK-ZaH", "FR-Fon", "IE-Ca1", "IT-Lav", "IT-SR2", "RU-Che", "US-ARM", "US-Ha1", "US-Ne1", "US-SRM", "ZA-Kru" + ) { + &make_env_run( PLUMBER2SITE=>"$site" ); + # + # Concatonate default usermods and specific sitetogether expanding env variables while doing that + # + if ( ! -d "$plumdir/$site" ) { + print "PLUMBER2 directory is not there: $plumdir/$site\n"; + die "ERROR:: PLUMBER2 site does not exist: $site\n"; + } + my $plumdefaultfile = "$plumdir/defaults/user_nl_clm"; + my $plumsitefile = "$plumdir/$site/user_nl_clm"; + if ( ! -f $plumsitefile ) { + $plumsitefile = undef; + } + $ENV{'PLUMBER2'} = $site; + my $namelistfile = "temp.namelistinfile_$site"; + &cat_and_create_namelistinfile( $plumdefaultfile, $plumsitefile, $namelistfile ); + # + # Now run the site + # + my $options = "--res CLM_USRDAT --clm_usr_name PLUMBER2 --no-megan --bgc sp --infile $namelistfile"; + 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 ); + } + system( "/bin/rm $namelistfile" ); + &cleanup(); +} print "\n===============================================================================\n"; print "Test some CAM specific setups for special grids \n"; From 9c4e66a519511d30e7508fd6a228249ed8bd2f6c Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 11 Sep 2024 10:22:05 -0600 Subject: [PATCH 1050/1248] Update the PLUMBER2 datasets to ctsm5.3.0 --- cime_config/usermods_dirs/PLUMBER2/defaults/user_nl_clm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cime_config/usermods_dirs/PLUMBER2/defaults/user_nl_clm b/cime_config/usermods_dirs/PLUMBER2/defaults/user_nl_clm index fe23065798..fd719fe8eb 100644 --- a/cime_config/usermods_dirs/PLUMBER2/defaults/user_nl_clm +++ b/cime_config/usermods_dirs/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/surfdata_1x1_PLUMBER2_${PLUMBER2SITE}_hist_2000_16pfts_c240326.nc" +fsurdat = "$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/ctsm5.3.0/surfdata_1x1_PLUMBER2_${PLUMBER2SITE}_hist_2000_16pfts_c240908.nc" ! custom namelist changes for each site / case From 10ffe8ab2d06ea0b64e1256be91594bd7839ed27 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 11 Sep 2024 10:24:34 -0600 Subject: [PATCH 1051/1248] Also run FATES for the NEON sites --- bld/unit_testers/build-namelist_test.pl | 34 ++++++++++++++----------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/bld/unit_testers/build-namelist_test.pl b/bld/unit_testers/build-namelist_test.pl index 5ea47ad1fa..540c83c289 100755 --- a/bld/unit_testers/build-namelist_test.pl +++ b/bld/unit_testers/build-namelist_test.pl @@ -163,10 +163,10 @@ sub cat_and_create_namelistinfile { # # Figure out number of tests that will run # -my $ntests = 3859; +my $ntests = 3994; if ( defined($opts{'compare'}) ) { - $ntests += 2347; + $ntests += 2437; } plan( tests=>$ntests ); @@ -393,20 +393,24 @@ sub cat_and_create_namelistinfile { my $namelistfile = "temp.namelistinfile_$site"; &cat_and_create_namelistinfile( $neondefaultfile, $neonsitefile, $namelistfile ); # - # Now run the site + # Now run the site for both bgc and non-FATES # - my $options = "--res CLM_USRDAT --clm_usr_name NEON --no-megan --bgc bgc --use_case 2018_control --infile $namelistfile"; - 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 ); + foreach my $bgc ( "bgc", "fates") { + if ( ($bgc eq "bgc") or ($site ne "STER" and $site ne "KONA")) { + my $options = "--res CLM_USRDAT --clm_usr_name NEON --no-megan --bgc $bgc --use_case 2018_control --infile $namelistfile"; + 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 ); + } + } } system( "/bin/rm $namelistfile" ); &cleanup(); From aa469b160288dc6aad0bfb795d4456c00adf7478 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 11 Sep 2024 11:07:49 -0600 Subject: [PATCH 1052/1248] More updates, add in another double tag ctsm5.2.029 to document just the part that changes from ctsm5.2.028 --- README | 22 +++--- README.md | 4 +- README_GITFLEXIMOD.rst | 4 +- bld/README | 16 ++--- doc/ChangeLog | 149 ++++++++++++++++++++++++++++++++--------- doc/ChangeSum | 3 +- 6 files changed, 143 insertions(+), 55 deletions(-) diff --git a/README b/README index 8b4e15e557..d3dcbce19f 100644 --- a/README +++ b/README @@ -1,6 +1,6 @@ -$CTSMROOT/README 04/19/2023 +$CTSMROOT/README 09/05/2024 -Community Terrestrial Systems Model (CTSM) science version 5.2 series -- source code, tools, +Community Terrestrial Systems Model (CTSM) science version 5.3 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 CRU NCEP or GSWP3 forcing data in place of a modeled atmosphere. @@ -51,7 +51,7 @@ tools ------------- CTSM Offline tools to prepare input datasets and process out cime_config ------- Configuration files of cime for compsets and CTSM settings bin/git-fleximod -- Script to manage the needed sub-component source directories (handled with git submodule) py_env_create ----- Script to setup the python environment for CTSM python tools using conda -python ------------ Python modules used in tools and testing and automated checking of ALL CTSM python scirpts +python ------------ Python modules used in tools and testing and automated checking of ALL CTSM python scripts Directory structure only for a CTSM checkout: @@ -66,6 +66,8 @@ components/cmeps -------------------- CESM top level driver (for NUOPC driver [w components/cdeps -------------------- CESM top level data model shared code (for NUOPC driver). components/cism --------------------- CESM Community land Ice Sheet Model. components/mosart ------------------- Model for Scale Adaptive River Transport +components/mizuRoute ---------------- Reached based river transport model for water routing + (allows both gridded river and Hydrologic Responce Unit river grids) components/rtm ---------------------- CESM River Transport Model. Top level documentation ($CTSMROOT): @@ -74,6 +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 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 @@ -104,17 +107,16 @@ run_sys_tests --------------- Python script to send the standard CTSM testing of parse_cime.cs.status -------- Script to parse test status files cs.status.* created by create_test (can be used along with run_sys_tests) doc/Quickstart.GUIDE -------- Quick guide to using NUOPC scripts. -doc/IMPORTANT_NOTES --------- Some important notes about this version of - CTSM, configuration modes and namelist items - that are not validated or functional. +doc/IMPORTANT_NOTES.md ------ Some important notes about this version of + CTSM, configuration modes and namelist items + that are not validated or functional. doc/ChangeLog --------------- Detailed list of changes for each model version. doc/ChangeSum --------------- Summary one-line list of changes for each model version. doc/UsersGuide -------------- CTSM Users Guide -doc/IMPORTANT_NOTES --------- Some important notes on caveats for some configurations/namelist items bld/README ------------------ Description of how to use the build-namelist scripts. -bld/build-namelist ---------- Script to build CTSM namelists. +bld/build-namelist ---------- Lower level script to build CTSM namelists. cime_config/buildnml ------------- Build the CTSM namelist for CIME cime_config/buildlib ------------- Build the CTSM library @@ -155,9 +157,9 @@ src/dyn_subgrid --- Dynamic land unit change src/init_interp --- Online interpolation scr/fates --------- FATES model and sub-directories Functionally Assembled Terrestrial Ecosystem Simulator (FATES) - Experimental Ecosystem Demography model + Ecosystem Demography model src/utils --------- Utility codes -src/self_tests ---- Internal testing (unit tests run as a part of a CTSM simulation) +src/self_tests ---- Internal testing (unit tests run as a part of a CTSM system test) src/unit_test_shr - Unit test shared modules for unit testing src/unit_test_stubs Unit test stubs that replicate CTSM code simpler diff --git a/README.md b/README.md index 045af9f6a1..5e800a0b77 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ The Community Terrestrial Systems Model. -This includes the Community Land Model (CLM5.0 and CLM4.5) of the Community Earth System Model. +This includes the Community Land Model of the Community Earth System Model. For documentation, quick start, diagnostics, model output and references, see @@ -43,7 +43,7 @@ CTSM code management is provided primarily by: Software engineering team: - [Erik Kluzek](https://github.com/ekluzek) - [Bill Sacks](https://github.com/billsacks) -- [Sam Levis](https://github.com/slevisconsulting) +- [Sam Levis](https://github.com/slevis-lmwg) - [Adrianna Foster](https://github.com/adrifoster) - [Sam Rabin](https://github.com/samsrabin) - [Greg Lemieux](https://github.com/glemieux) diff --git a/README_GITFLEXIMOD.rst b/README_GITFLEXIMOD.rst index de6bbf392f..d1ab767645 100644 --- a/README_GITFLEXIMOD.rst +++ b/README_GITFLEXIMOD.rst @@ -67,10 +67,10 @@ Switching to a different CTSM branch or tag If you have already checked out a branch or tag and **HAVE NOT MADE ANY MODIFICATIONS** it is simple to change your sandbox. Say that you -checked out ctsm1.0.0 but really wanted to have ctsm1.1.0; +checked out ctsm5.2.0 but really wanted to have ctsm5.3.0; you would simply do the following:: - git checkout ctsm1.1.0 + git checkout ctsm5.3.0 ./bin/git-fleximod update You should **not** use this method if you have made any source code diff --git a/bld/README b/bld/README index 1e9517b189..feb0b8495c 100644 --- a/bld/README +++ b/bld/README @@ -4,16 +4,16 @@ CLM build and configure directory and scripts. Scripts to help you prepare to build CLM as a component within CESM, and setup a namelist for it. +This is a lower level script called from with CESM/CIME. + Important files/directories: ---------- Configure and build scripts ---------- (These scripts are also used by the cesm/cime scripts) +--------- Namelist build scripts config_files/clm_phys_vers.pm ------------- Perl module to handle different CLM versions -config_files/config_definition_ctsm.xml --- XML file defining all CTSM configuration items +config_files/config_definition_ctsm.xml --- XML file defining CTSM configuration items (mainly physics version) --------- Scripts to build the namelists ---------- (These scripts are also used by the cesm/cime scripts) build-namelist --- Build the namelists needed @@ -26,17 +26,17 @@ unit_testers --- Directory of scripts to test scipts in this directory ---------- XML Files describing namelists in namelist_files namelist_files/namelist_defaults_ctsm.xml --------- List of default values for the ctsm namelist namelist_files/namelist_defaults_overall.xml ------ List of default values for overall settings -namelist_files/namelist_defaults_usr_files.xml ---- List of default values for the user-files -namelist_files/namelist_definition_ctsm.xml -------- Definition of all namelist items for ctsm +namelist_files/namelist_defaults_usr_files.xml ---- List of default values for the user-files (deprecated) +namelist_files/namelist_definition_ctsm.xml ------- Definition of all namelist items for ctsm namelist_files/namelist_definition.xsl ------------ Describes how to view the xml file as html -namelist_files/namelist_defaults_drydep.xml ------- List of default values for the dry deposition module. namelist_files/use_cases -------------------------- Specific configurations that build-namelist uses namelist_files/use_cases/README ------------------- File explaining the naming convention for use_cases ---------- Driver namelist files, duplicated information from cime/driver/cime_config namelist_files/namelist_defaults_drv.xml ---------- List of default values for driver namelist defaults -namelist_files/namelist_defaults_drydep.xml ------- List of default values for dry deposition fields +namelist_files/namelist_defaults_drydep.xml ------- List of default values for dry deposition and MEGAN fields namelist_files/namelist_defaults_fire_emis.xml ---- List of default values for fire emission fields +namelist_files/namelist_defaults_dust_emis.xml ---- List of default values for the dust emissions module. namelist_files/namelist_definition_drv.xml -------- Definition of all driver namelist items namelist_files/namelist_definition_drv_flds.xml --- Definition of add driver fieldsnamelist items diff --git a/doc/ChangeLog b/doc/ChangeLog index fd46741fec..c5559f7f12 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -4,8 +4,8 @@ Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326) Date: Fri 06 Sep 2024 02:21:22 AM MDT One-line Summary: Update surface datasets, CN Matrix, CLM60: excess ice on, explicit A/C on, crop calendars, Sturm snow, Leung dust emissions, prigent roughness data -Purpose and description of changes ----------------------------------- +Purpose and description of changes since ctsm5.2.0 +-------------------------------------------------- Changes to CTSM: ================ @@ -23,32 +23,11 @@ Contributors ------------ -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 - -[X] clm5_1 - -[X] clm5_0 - -[X] ctsm5_0-nwp - -[X] clm4_5 - +Significant changes to scientifically-supported configurations since ctsm5.2.0 +------------------------------------------------------------------------------ -Bugs fixed ----------- - -List of CTSM issues fixed (include CTSM Issue # and description) [one per line]: - -Notes of particular relevance for users ---------------------------------------- +Notes of particular relevance for users for ctsm5.2.0 to ctsm5.3.0 +------------------------------------------------------------------ Caveats for users (e.g., need to interpolate initial conditions): @@ -62,8 +41,8 @@ Changes to documentation: Things being deprecated (which will be removed): -Notes of particular relevance for developers: ---------------------------------------------- +Notes of particular relevance for developers for ctsm5.2.0 to ctsm5.3.0: +------------------------------------------------------------------------ Caveats for developers (e.g., code that is duplicated that requires double maintenance): @@ -108,8 +87,8 @@ Testing summary: release testing (regular ctsm_sci fates mosart rtm mksurfdata_e derecho ---- -Answer changes --------------- +Answer changes ctsm5.2.0 to ctsm5.3.0 +------------------------------------- Changes answers relative to baseline: Yes! New surface datasets so answers change for ALL simulations! @@ -128,12 +107,118 @@ Changes answers relative to baseline: Yes! New surface datasets so answers chang Other details ------------- -[Remove any lines that don't apply. Remove entire section if nothing applies.] List any git submodules updated (cime, rtm, mosart, cism, fates, etc.): +=============================================================== +=============================================================== +Tag name: ctsm5.2.029 +Originator(s): multiple +Date: 10 Sep 2024 +One-line Summary: Update surface datasets: double tag of ctsm5.3.0 + +Purpose and description of changes +---------------------------------- + +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 + +[X] clm5_1 + +[X] clm5_0 + +[X] ctsm5_0-nwp + +[X] clm4_5 + + +Bugs fixed +---------- + +List of CTSM issues fixed (include CTSM Issue # and description) [one per line]: + Fixes #2723 + Partly addresses #2720 + Fixes #2452 + Fixes #2570 + Fixes #2618 + Fixes #423 + Fixes #2734 + Fixes #2744 + Fixes #2502 + +Notes of particular relevance for users +--------------------------------------- + +Caveats for users (e.g., need to interpolate initial conditions): + +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): + +Changes made to namelist defaults (e.g., changed parameter values): + glacier_region_behavior updated so that region ID 1 is UNSET + +Changes to the datasets (e.g., parameter, surface or initial files): + parameter file updated + surface datasets updatd + f09 1850 finidat file updated + fire emissions factor file updated + +Changes to documentation: + +Notes of particular relevance for developers: +--------------------------------------------- + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): + +Changes to tests or testing: + VIC tests removed + +Testing summary: release testing (regular ctsm_sci fates mosart rtm mksurfdata_esmf python) +---------------- + [PASS means all tests PASS; OK means tests PASS other than expected fails.] + + build-namelist tests (if CLMBuildNamelist.pm has changed): + + derecho - PASS + + 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: Yes! New surface datasets so answers change for ALL simulations! + + Summarize any changes to answers, i.e., + - what code configurations: ALL + - what platforms/compilers: ALL + - nature of change (roundoff; larger than roundoff/same climate; new climate): + new climate + + If this tag changes climate describe the run(s) done to evaluate the new + climate (put details of the simulations in the experiment database) + - casename: + + URL for LMWG diagnostics output used to validate new climate: + + +Other details +------------- Pull Requests that document the changes (include PR ids): (https://github.com/ESCOMP/ctsm/pull) + #2500 -- ctsm5.3.0: New pft/lai/glc-behavior/soilcolor/fire datasets =============================================================== =============================================================== diff --git a/doc/ChangeSum b/doc/ChangeSum index c592a29382..31642a7378 100644 --- a/doc/ChangeSum +++ b/doc/ChangeSum @@ -1,6 +1,7 @@ Tag Who Date Summary ============================================================================================================================ - ctsm5.3.0 erik 09/06/2024 Update surface datasets, CN Matrix, CLM60: excess ice on, explicit A/C on, crop calendars, Sturm snow, Leung dust emissions, prigent roughness data + ctsm5.3.0 multiple 09/11/2024 Update surface datasets, CN Matrix, CLM60: excess ice on, explicit A/C on, crop calendars, Sturm snow, Leung dust emissions, prigent roughness data + ctsm5.2.029 multiple 09/11/2024 New surface datasets: double tag of ctsm5.3.0 ctsm5.2.028 rgknox 09/05/2024 FATES history flushing update ctsm5.2.027 erik 08/28/2024 Merge b4b-dev ctsm5.2.026 slevis 08/23/2024 Turn on excess ice, explicit AC, Leung_2023 for clm6 From a4d105d1da4248a7988b642799d7330d328fe5b1 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Thu, 12 Sep 2024 10:04:01 -0600 Subject: [PATCH 1053/1248] Update README.md about generating NEON and PLUMBER2 fsurdat files --- tools/mksurfdata_esmf/README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/mksurfdata_esmf/README.md b/tools/mksurfdata_esmf/README.md index a9c0b80de6..f49d23fb61 100644 --- a/tools/mksurfdata_esmf/README.md +++ b/tools/mksurfdata_esmf/README.md @@ -179,6 +179,10 @@ for example try --res 1.9x2.5 --start-year 1850 --end-year 1850: make all-subset ``` + As of 2024/9/12 one needs to generate NEON and PLUMBER2 fsurdat files by + running ./neon_surf_wrapper and ./plumber2_surf_wrapper manually in the + /tools/site_and_regional directory. + ## NOTES From 2f5bd73c2e1f3a6dba959e38db4f63c11d9f180e Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Thu, 12 Sep 2024 15:01:28 -0600 Subject: [PATCH 1054/1248] Finish the ctsm5.2.029 section --- doc/ChangeLog | 36 +++++++++++++++++++++++++----------- 1 file changed, 25 insertions(+), 11 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index c5559f7f12..988fe4f504 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -120,6 +120,10 @@ One-line Summary: Update surface datasets: double tag of ctsm5.3.0 Purpose and description of changes ---------------------------------- +New surface datasets because of updates in PFT/LAI/soil-color datasets, as well as two fire datasets (AG fire, pearland and the glacier behavior dataset. Also bring in an updated "PPE informed, hand-tuned" parameter file. And turn on Li2024 fire method. Also updates to allow creating transient landuse timeseries files going back to 1700. Fix an important bug on soil fields that was there since ctsm5.2.0. This results in mkaurfdata_esmf giving identical answers with a change in number of processors. Add in creation of ne0np4.POLARCAP.ne30x4 surface datasets. + +Asides: Remove VIC fields from surface datasets and testing. Add version to the surface datasets. Update the fire emissions factor dataset for the fire emissions testing in CTSM. Remove the --hires_pft option from mksurfdata_esmf as we don't have the datasets for it. + Significant changes to scientifically-supported configurations -------------------------------------------------------------- @@ -143,22 +147,29 @@ Bugs fixed ---------- List of CTSM issues fixed (include CTSM Issue # and description) [one per line]: - Fixes #2723 - Partly addresses #2720 - Fixes #2452 - Fixes #2570 - Fixes #2618 - Fixes #423 - Fixes #2734 - Fixes #2744 - Fixes #2502 + Fixes #2723 -- Version string on CTSM surface datasets to check for compatability + Partly addressed #2752 -- NEON surface datasets are defined in two places -- should just be one in namelist_defaults_ctsm.xml + Partly addresses #2720 -- Make polarcap surface datasets in ctsm5.3.0, remove VR 1850 datasets + Fixes #2452 -- Run mksurfdata_esmf with the new vegetation raw data + Fixes #2570 -- Historical configuration for CLM6 + Fixes #2618 -- Update fire variables on surface dataset + Fixes #423 -- Update fire variables on surface dataset + Fixes #2734 -- Update fire emissions factors + Fixes #2744 -- Soil level clm surface input data for clm5.2.0 have missing values in large domains + Fixes #2502 -- fsurdat: PCT_SAND, PCT_CLAY, ORGANIC differ with different PE layouts on derecho + Fixes #2748 -- Update hillslope datasets for 5.3 Notes of particular relevance for users --------------------------------------- Caveats for users (e.g., need to interpolate initial conditions): + New surface datasets means initial condition files created without ctsm5.3.0 surface + datasets will need to be interpolated Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): + With new surface datasets the following GLC fields have region "1" set to UNSET: + glacier_region_behavior, glacier_region_melt_behavior, glacier_region_ice_runoff_behavior + For mksurfdata_esmf, the --vic and --hires_pft options were removed Changes made to namelist defaults (e.g., changed parameter values): glacier_region_behavior updated so that region ID 1 is UNSET @@ -166,15 +177,17 @@ Changes made to namelist defaults (e.g., changed parameter values): Changes to the datasets (e.g., parameter, surface or initial files): parameter file updated surface datasets updatd - f09 1850 finidat file updated + f09 1850 finidat file updated (also used for 2000) fire emissions factor file updated Changes to documentation: + Technical Note documentation on glacier region updated Notes of particular relevance for developers: --------------------------------------------- Caveats for developers (e.g., code that is duplicated that requires double maintenance): + Region 1 for glacier region is now undefined on purpose Changes to tests or testing: VIC tests removed @@ -209,9 +222,10 @@ Changes answers relative to baseline: Yes! New surface datasets so answers chang If this tag changes climate describe the run(s) done to evaluate the new climate (put details of the simulations in the experiment database) - - casename: + - casename: slevis ctsm52026_f09_pSASU URL for LMWG diagnostics output used to validate new climate: + https://github.com/NCAR/LMWG_dev/issues/65 Other details From dc3317db21998538cfc3862ca274ff6cc3dd1bae Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Thu, 12 Sep 2024 15:56:15 -0600 Subject: [PATCH 1055/1248] Replace default fire_method li2021gswpfrc with 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 0188f91faa..e4617c3b94 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -238,7 +238,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). .false. -li2021gswpfrc +li2024crujra li2016crufrc li2014qianfrc From 92b76e78ab654c9e659f894c13fa6a88386f8899 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Thu, 12 Sep 2024 15:58:07 -0600 Subject: [PATCH 1056/1248] Remove FireLi2024CruJra test from aux_clm, since it's now default. --- cime_config/testdefs/testlist_clm.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index 57e798b963..5bf3909210 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -3562,7 +3562,6 @@ - From 317dc11d0af402fd77746865112e8c5caebfa004 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Thu, 12 Sep 2024 18:07:15 -0600 Subject: [PATCH 1057/1248] Updates from troubleshooting failing tests --- bld/namelist_files/namelist_defaults_ctsm.xml | 28 +++++++++---------- .../smallville_dynlakes_monthly/user_nl_clm | 2 +- .../smallville_dynurban_monthly/user_nl_clm | 2 +- .../PLUMBER2/defaults/user_nl_clm | 2 +- python/ctsm/test/test_unit_subset_data.py | 2 +- python/ctsm/test/testinputs/default_data.cfg | 12 ++++---- tools/site_and_regional/default_data_1850.cfg | 8 +++--- tools/site_and_regional/default_data_2000.cfg | 12 ++++---- 8 files changed, 34 insertions(+), 34 deletions(-) diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index e4617c3b94..10de83236a 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -1925,7 +1925,7 @@ lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_4x5_hist_2000_78pfts_c240908.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_1x1_brazil_hist_2000_78pfts_c240908.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_1x1_brazil_hist_2000_78pfts_c240912.nc lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_5x5_amazon_hist_2000_78pfts_c240908.nc @@ -1950,7 +1950,7 @@ lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_360x720cru_hist_2000_78pfts_c240908.nc lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_C96_hist_2000_78pfts_c240908.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_1x1_numaIA_hist_2000_78pfts_c240908.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_1x1_numaIA_hist_2000_78pfts_c240912.nc @@ -1971,11 +1971,11 @@ lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_ne0np4CONUS.ne30x8_hist_2000_78pfts_c2 -lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_1x1_vancouverCAN_hist_2000_78pfts_c240908.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_1x1_vancouverCAN_hist_2000_78pfts_c240912.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_1x1_mexicocityMEX_hist_2000_78pfts_c240908.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_1x1_mexicocityMEX_hist_2000_78pfts_c240912.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/synthetic/surfdata_1x1_urbanc_alpha_hist_2000_78pfts_c240908.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/synthetic/surfdata_1x1_urbanc_alpha_synth_hist_2000_78pfts_c240912.nc @@ -2007,11 +2007,11 @@ lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_ne3np4.pg3_hist_1850_78pfts_c240908.nc lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_C96_hist_1850_78pfts_c240908.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/synthetic/surfdata_1x1_smallvilleIA_hist_1850_78pfts_c240908.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/synthetic/surfdata_1x1_smallvilleIA_synth_hist_1850_78pfts_c240912.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/synthetic/surfdata_1x1_cidadinhoBR_hist_2000_78pfts_c240908.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/synthetic/surfdata_1x1_cidadinhoBR_synth_hist_2000_78pfts_c240912.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_1x1_brazil_hist_1850_78pfts_c240908.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_1x1_brazil_hist_1850_78pfts_c240912.nc lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_ne3np4.pg3_hist_1850_78pfts_c240908.nc @@ -2032,13 +2032,13 @@ lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_ne0np4CONUS.ne30x8_hist_1979_78pfts_c2 -lnd/clm2/surfdata_esmf/NEON/ctsm5.3.0/16PFT_mixed/surfdata_1x1_NEON_${NEONSITE}_hist_2000_16pfts_c240910.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.3.0/surfdata_1x1_NEON_${NEONSITE}_hist_2000_78pfts_c240908.nc +lnd/clm2/surfdata_esmf/NEON/ctsm5.3.0/surfdata_1x1_NEON_${NEONSITE}_hist_2000_78pfts_c240912.nc @@ -2065,7 +2065,7 @@ lnd/clm2/surfdata_esmf/NEON/ctsm5.3.0/surfdata_1x1_NEON_TOOL_hist_78pfts_CMIP6_s >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_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 @@ -2084,7 +2084,7 @@ lnd/clm2/surfdata_esmf/NEON/ctsm5.3.0/surfdata_1x1_NEON_TOOL_hist_78pfts_CMIP6_s lnd/clm2/surfdata_esmf/ctsm5.3.0/synthetic/landuse.timeseries_1x1_smallvilleIA_synth_1850-1855_78pfts_c240908.nc +>lnd/clm2/surfdata_esmf/ctsm5.3.0/synthetic/landuse.timeseries_1x1_smallvilleIA_synth_1850-1855_78pfts_c240912.nc @@ -2111,7 +2111,7 @@ lnd/clm2/surfdata_esmf/NEON/ctsm5.3.0/surfdata_1x1_NEON_TOOL_hist_78pfts_CMIP6_s >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_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 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 c86418dabd..6223cc203f 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.2.0/landuse.timeseries_1x1_smallvilleIA_SSP2-4.5_1850-1855_78pfts_dynLakes_c240221.nc' +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' ! 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 a5bdb76ac3..958265cffc 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.2.0/landuse.timeseries_1x1_smallvilleIA_SSP2-4.5_1850-1855_78pfts_dynUrban_c240221.nc' +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' ! 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/PLUMBER2/defaults/user_nl_clm b/cime_config/usermods_dirs/PLUMBER2/defaults/user_nl_clm index fd719fe8eb..5216afb381 100644 --- a/cime_config/usermods_dirs/PLUMBER2/defaults/user_nl_clm +++ b/cime_config/usermods_dirs/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_c240908.nc" +fsurdat = "$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/PLUMBER2/ctsm5.3.0/surfdata_1x1_PLUMBER2_${PLUMBER2SITE}_hist_2000_16pfts_c240912.nc" ! custom namelist changes for each site / case diff --git a/python/ctsm/test/test_unit_subset_data.py b/python/ctsm/test/test_unit_subset_data.py index 143b632e8c..a918fb35f0 100755 --- a/python/ctsm/test/test_unit_subset_data.py +++ b/python/ctsm/test/test_unit_subset_data.py @@ -48,7 +48,7 @@ def test_inputdata_setup_files_basic(self): files = setup_files(self.args, self.defaults, self.cesmroot) self.assertEqual( files["fsurf_in"], - "surfdata_0.9x1.25_hist_2000_16pfts_c240216.nc", + "surfdata_0.9x1.25_hist_2000_16pfts_c240908.nc", "fsurf_in filename not whats expected", ) self.assertEqual( diff --git a/python/ctsm/test/testinputs/default_data.cfg b/python/ctsm/test/testinputs/default_data.cfg index d736f2e933..24aa811fee 100644 --- a/python/ctsm/test/testinputs/default_data.cfg +++ b/python/ctsm/test/testinputs/default_data.cfg @@ -15,16 +15,16 @@ precname = CLMGSWP3v1.Precip tpqwname = CLMGSWP3v1.TPQW [surfdat] -dir = lnd/clm2/surfdata_esmf/ctsm5.2.0 -surfdat_16pft = surfdata_0.9x1.25_hist_2000_16pfts_c240216.nc -surfdat_78pft = surfdata_0.9x1.25_hist_2000_78pfts_c240216.nc +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.2.0 -landuse_16pft = landuse.timeseries_0.9x1.25_SSP2-4.5_1850-2100_78pfts_c240216.nc -landuse_78pft = landuse.timeseries_0.9x1.25_SSP2-4.5_1850-2100_78pfts_c240216.nc +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 [domain] file = share/domains/domain.lnd.fv0.9x1.25_gx1v7.151020.nc diff --git a/tools/site_and_regional/default_data_1850.cfg b/tools/site_and_regional/default_data_1850.cfg index 47cb71ee87..0f3cdab60f 100644 --- a/tools/site_and_regional/default_data_1850.cfg +++ b/tools/site_and_regional/default_data_1850.cfg @@ -15,12 +15,12 @@ precname = CLMGSWP3v1.Precip tpqwname = CLMGSWP3v1.TPQW [surfdat] -dir = lnd/clm2/surfdata_esmf/ctsm5.2.0 -surfdat_78pft = surfdata_0.9x1.25_hist_1850_78pfts_c240216.nc +dir = lnd/clm2/surfdata_esmf/ctsm5.3.0 +surfdat_78pft = surfdata_0.9x1.25_hist_1850_78pfts_c240908.nc [landuse] -dir = lnd/clm2/surfdata_esmf/ctsm5.2.0 -landuse_78pft = landuse.timeseries_0.9x1.25_SSP2-4.5_1850-2100_78pfts_c240216.nc +dir = lnd/clm2/surfdata_esmf/ctsm5.3.0 +landuse_78pft = landuse.timeseries_0.9x1.25_SSP2-4.5_1850-2100_78pfts_c240908.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 d736f2e933..24aa811fee 100644 --- a/tools/site_and_regional/default_data_2000.cfg +++ b/tools/site_and_regional/default_data_2000.cfg @@ -15,16 +15,16 @@ precname = CLMGSWP3v1.Precip tpqwname = CLMGSWP3v1.TPQW [surfdat] -dir = lnd/clm2/surfdata_esmf/ctsm5.2.0 -surfdat_16pft = surfdata_0.9x1.25_hist_2000_16pfts_c240216.nc -surfdat_78pft = surfdata_0.9x1.25_hist_2000_78pfts_c240216.nc +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.2.0 -landuse_16pft = landuse.timeseries_0.9x1.25_SSP2-4.5_1850-2100_78pfts_c240216.nc -landuse_78pft = landuse.timeseries_0.9x1.25_SSP2-4.5_1850-2100_78pfts_c240216.nc +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 [domain] file = share/domains/domain.lnd.fv0.9x1.25_gx1v7.151020.nc From e205e2ef8ed005aa3bb7743ba5ea8061bbd22498 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Fri, 13 Sep 2024 11:38:56 -0600 Subject: [PATCH 1058/1248] Ignore warnings in Hillslope tests. --- .../testdefs/testmods_dirs/clm/Hillslope/shell_commands | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cime_config/testdefs/testmods_dirs/clm/Hillslope/shell_commands b/cime_config/testdefs/testmods_dirs/clm/Hillslope/shell_commands index 6f3602d2e6..a2759b51b4 100644 --- a/cime_config/testdefs/testmods_dirs/clm/Hillslope/shell_commands +++ b/cime_config/testdefs/testmods_dirs/clm/Hillslope/shell_commands @@ -2,3 +2,6 @@ DIN_LOC_ROOT=$(./xmlquery --value DIN_LOC_ROOT) meshfile=$DIN_LOC_ROOT/lnd/clm2/testdata/ESMFmesh_10x15_synthetic_cosphill_1.0.nc ./xmlchange ATM_DOMAIN_MESH=${meshfile},LND_DOMAIN_MESH=${meshfile} + +# -ignore_warnings is needed as long as we don't allow use_hillslope and use_init_interp together +./xmlchange --append CLM_BLDNML_OPTS=-ignore_warnings From 90a5ae904e3a1fde12c53d23f47baf45bf95ab10 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Sat, 14 Sep 2024 10:15:09 -0600 Subject: [PATCH 1059/1248] All IC files need to have use_init_interp set to TRUE --- 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 b4df3e008f..705888bd17 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -1343,7 +1343,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). lnd/clm2/initdata_esmf/ctsm5.2/clmi.I1850Clm50BgcCrop-ciso.1366-01-01.0.9x1.25_gx1v7_simyr1850_c240223.nc @@ -1351,7 +1351,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). lnd/clm2/initdata_esmf/ctsm5.2/clmi.I1850Clm50BgcCropCru-ciso.1526-01-01.0.9x1.25_gx1v7_simyr1850_c240223.nc @@ -1400,7 +1400,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). lnd/clm2/initdata_esmf/ctsm5.2/clmi.I2000Clm50BgcCrop.2011-01-01.1.9x2.5_gx1v7_gl4_simyr2000_c240223.nc @@ -1408,7 +1408,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). lnd/clm2/initdata_esmf/ctsm5.2/clmi.I2000Clm50BgcCrop.2011-01-01.1.9x2.5_gx1v7_gl4_simyr2000_c240223.nc @@ -1416,13 +1416,13 @@ attributes from the config_cache.xml file (with keys converted to upper-case). lnd/clm2/initdata_esmf/ctsm5.2/clmi.I2000Clm50BgcCrop.2011-01-01.1.9x2.5_gx1v7_gl4_simyr2000_c240223.nc lnd/clm2/initdata_esmf/ctsm5.2/clmi.I2000Clm50BgcCrop.2011-01-01.1.9x2.5_gx1v7_gl4_simyr2000_c240223.nc @@ -1438,7 +1438,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). lnd/clm2/initdata_esmf/ctsm5.2/clmi.I2000Clm50BgcCrop.2011-01-01.1.9x2.5_gx1v7_gl4_simyr2000_c240223.nc From 2b0e886d8959745f95a7aa863a2ef683764cdd9c Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Sat, 14 Sep 2024 10:24:22 -0600 Subject: [PATCH 1060/1248] Remove or update surface datasets that were for ctsm5.2.0, and for testmods for Sp compsets turn fire-emissions off by pointing to nofireemis testmod --- .../clm/ExcessIceStreams/include_user_mods | 1 + .../clm/FatesColdLandUse/shell_commands | 3 +++ .../clm/FatesColdLandUse/user_nl_clm | 1 - .../clm/SNICARFRC/include_user_mods | 1 + .../collapse_pfts_78_to_16_decStart_f10/README | 16 ---------------- .../user_nl_clm | 2 -- .../clm/f09_dec1990Start_GU_LULCC/user_nl_clm | 5 +---- .../testmods_dirs/clm/nofire/include_user_mods | 1 + .../testmods_dirs/clm/nofire/shell_commands | 1 - .../testmods_dirs/clm/nofireemis/shell_commands | 3 +++ .../clm/o3lombardozzi2015/include_user_mods | 1 + .../clm/pauseResume/include_user_mods | 1 + .../clm/prescribed/include_user_mods | 1 + .../testmods_dirs/clm/pts/include_user_mods | 1 + .../clm/smallville_dynlakes_monthly/user_nl_clm | 2 +- .../clm/smallville_dynurban_monthly/user_nl_clm | 2 +- .../clm/waccmx_offline/include_user_mods | 1 + 17 files changed, 17 insertions(+), 26 deletions(-) create mode 100644 cime_config/testdefs/testmods_dirs/clm/FatesColdLandUse/shell_commands delete mode 100644 cime_config/testdefs/testmods_dirs/clm/collapse_pfts_78_to_16_decStart_f10/user_nl_clm create mode 100644 cime_config/testdefs/testmods_dirs/clm/nofire/include_user_mods create mode 100644 cime_config/testdefs/testmods_dirs/clm/nofireemis/shell_commands diff --git a/cime_config/testdefs/testmods_dirs/clm/ExcessIceStreams/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/ExcessIceStreams/include_user_mods index fe0e18cf88..1e4ddf5337 100644 --- a/cime_config/testdefs/testmods_dirs/clm/ExcessIceStreams/include_user_mods +++ b/cime_config/testdefs/testmods_dirs/clm/ExcessIceStreams/include_user_mods @@ -1 +1,2 @@ ../default +../nofireemis diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesColdLandUse/shell_commands b/cime_config/testdefs/testmods_dirs/clm/FatesColdLandUse/shell_commands new file mode 100644 index 0000000000..c97c0dfea7 --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/FatesColdLandUse/shell_commands @@ -0,0 +1,3 @@ +#!/bin/bash + +./xmlchange CLM_BLDNML_OPTS="-i-clm_demand -flanduse_timeseries" --append diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesColdLandUse/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/FatesColdLandUse/user_nl_clm index b27a74031c..f718010b07 100644 --- a/cime_config/testdefs/testmods_dirs/clm/FatesColdLandUse/user_nl_clm +++ b/cime_config/testdefs/testmods_dirs/clm/FatesColdLandUse/user_nl_clm @@ -1,2 +1 @@ -flanduse_timeseries = '$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/ctsm5.2.0/landuse.timeseries_4x5_hist_16_CMIP6_1850-2015_c230620.nc' fates_harvest_mode = 'landuse_timeseries' diff --git a/cime_config/testdefs/testmods_dirs/clm/SNICARFRC/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/SNICARFRC/include_user_mods index fe0e18cf88..1e4ddf5337 100644 --- a/cime_config/testdefs/testmods_dirs/clm/SNICARFRC/include_user_mods +++ b/cime_config/testdefs/testmods_dirs/clm/SNICARFRC/include_user_mods @@ -1 +1,2 @@ ../default +../nofireemis diff --git a/cime_config/testdefs/testmods_dirs/clm/collapse_pfts_78_to_16_decStart_f10/README b/cime_config/testdefs/testmods_dirs/clm/collapse_pfts_78_to_16_decStart_f10/README index dbd0696317..f19dd1893e 100644 --- a/cime_config/testdefs/testmods_dirs/clm/collapse_pfts_78_to_16_decStart_f10/README +++ b/cime_config/testdefs/testmods_dirs/clm/collapse_pfts_78_to_16_decStart_f10/README @@ -4,22 +4,6 @@ new combination do_transient_crops = .true. and use_crop = .false. while exercising the collapse2gencrop branch ability to collapse the full crop data to clm's generic crops. -According to the file -bld/namelist_files/namelist_defaults_ctsm.xml -the following two files used in this test -are default files for the following options: - -fsurdat = '$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/ctsm5.2.0/surfdata_10x15_hist_1850_78pfts_c240216.nc' -hgrid="10x15" sim_year="1850" use_crop=".false." irrigate=".true." -hgrid="10x15" sim_year="1850" use_crop=".true." - -flanduse_timeseries = '$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/ctsm5.2.0/landuse.timeseries_10x15_SSP2-4.5_1850-2100_78pfts_c240216.nc' --hgrid="10x15" sim_year_range="1850-2000" use_crop=".true." --hgrid="10x15" rcp="8.5" sim_year_range="1850-2100" use_crop=".true." --hgrid="10x15" rcp="6" sim_year_range="1850-2100" use_crop=".true." --hgrid="10x15" rcp="4.5" sim_year_range="1850-2100" use_crop=".true." --hgrid="10x15" rcp="2.6" sim_year_range="1850-2100" use_crop=".true." - This test includes the settings of the decStart test so as to also test the end-of-year transition since it's an IHist case and transient vegetation gets updated every new year. diff --git a/cime_config/testdefs/testmods_dirs/clm/collapse_pfts_78_to_16_decStart_f10/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/collapse_pfts_78_to_16_decStart_f10/user_nl_clm deleted file mode 100644 index d7be01280b..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/collapse_pfts_78_to_16_decStart_f10/user_nl_clm +++ /dev/null @@ -1,2 +0,0 @@ -fsurdat = '$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/ctsm5.2.0/surfdata_10x15_hist_1850_78pfts_c240216.nc' -flanduse_timeseries = '$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/ctsm5.2.0/landuse.timeseries_10x15_SSP2-4.5_1850-2100_78pfts_c240216.nc' diff --git a/cime_config/testdefs/testmods_dirs/clm/f09_dec1990Start_GU_LULCC/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/f09_dec1990Start_GU_LULCC/user_nl_clm index 0dbc0b4942..e9040ca841 100644 --- a/cime_config/testdefs/testmods_dirs/clm/f09_dec1990Start_GU_LULCC/user_nl_clm +++ b/cime_config/testdefs/testmods_dirs/clm/f09_dec1990Start_GU_LULCC/user_nl_clm @@ -1,5 +1,2 @@ - ! Specify a dataset that has non-zero Gross Unrepresented Land Use change fields on it - ! And turn it on - flanduse_timeseries = '$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/ctsm5.2.0/landuse.timeseries_0.9x1.25_SSP2-4.5_1850-2100_78pfts_c240216.nc' - fsurdat = '$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/ctsm5.2.0/surfdata_0.9x1.25_hist_1850_78pfts_c240216.nc' + ! Turn on Gross Unrepresented Land Use do_grossunrep = .true. diff --git a/cime_config/testdefs/testmods_dirs/clm/nofire/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/nofire/include_user_mods new file mode 100644 index 0000000000..dbad2e75e6 --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/nofire/include_user_mods @@ -0,0 +1 @@ +../nofireemis diff --git a/cime_config/testdefs/testmods_dirs/clm/nofire/shell_commands b/cime_config/testdefs/testmods_dirs/clm/nofire/shell_commands index fe06fd1042..bbe1216f7d 100644 --- a/cime_config/testdefs/testmods_dirs/clm/nofire/shell_commands +++ b/cime_config/testdefs/testmods_dirs/clm/nofire/shell_commands @@ -1,5 +1,4 @@ -./xmlchange CLM_BLDNML_OPTS="-no-fire_emis" --append ./xmlchange BFBFLAG="TRUE" diff --git a/cime_config/testdefs/testmods_dirs/clm/nofireemis/shell_commands b/cime_config/testdefs/testmods_dirs/clm/nofireemis/shell_commands new file mode 100644 index 0000000000..2cef76cc58 --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/nofireemis/shell_commands @@ -0,0 +1,3 @@ +./xmlchange CLM_BLDNML_OPTS="-no-fire_emis" --append + + diff --git a/cime_config/testdefs/testmods_dirs/clm/o3lombardozzi2015/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/o3lombardozzi2015/include_user_mods index fe0e18cf88..1e4ddf5337 100644 --- a/cime_config/testdefs/testmods_dirs/clm/o3lombardozzi2015/include_user_mods +++ b/cime_config/testdefs/testmods_dirs/clm/o3lombardozzi2015/include_user_mods @@ -1 +1,2 @@ ../default +../nofireemis diff --git a/cime_config/testdefs/testmods_dirs/clm/pauseResume/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/pauseResume/include_user_mods index fe0e18cf88..1e4ddf5337 100644 --- a/cime_config/testdefs/testmods_dirs/clm/pauseResume/include_user_mods +++ b/cime_config/testdefs/testmods_dirs/clm/pauseResume/include_user_mods @@ -1 +1,2 @@ ../default +../nofireemis diff --git a/cime_config/testdefs/testmods_dirs/clm/prescribed/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/prescribed/include_user_mods index fe0e18cf88..1e4ddf5337 100644 --- a/cime_config/testdefs/testmods_dirs/clm/prescribed/include_user_mods +++ b/cime_config/testdefs/testmods_dirs/clm/prescribed/include_user_mods @@ -1 +1,2 @@ ../default +../nofireemis diff --git a/cime_config/testdefs/testmods_dirs/clm/pts/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/pts/include_user_mods index fe0e18cf88..1e4ddf5337 100644 --- a/cime_config/testdefs/testmods_dirs/clm/pts/include_user_mods +++ b/cime_config/testdefs/testmods_dirs/clm/pts/include_user_mods @@ -1 +1,2 @@ ../default +../nofireemis 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 c86418dabd..c2f51e29ab 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.2.0/landuse.timeseries_1x1_smallvilleIA_SSP2-4.5_1850-1855_78pfts_dynLakes_c240221.nc' +flanduse_timeseries = '$DIN_LOC_ROOT//lnd/clm2/surfdata_esmf/ctsm5.3.0/synthetic/landuse.timeseries_1x1_smallvilleIA_synth_1850-1855_78pfts_dynLakes_c240908.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 a5bdb76ac3..c4b9709438 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.2.0/landuse.timeseries_1x1_smallvilleIA_SSP2-4.5_1850-1855_78pfts_dynUrban_c240221.nc' +flanduse_timeseries = '$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/ctsm5.3.0/synthetic/landuse.timeseries_1x1_smallvilleIA_synth_1850-1855_78pfts_dynUrban_c240908.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/waccmx_offline/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/waccmx_offline/include_user_mods index fe0e18cf88..1e4ddf5337 100644 --- a/cime_config/testdefs/testmods_dirs/clm/waccmx_offline/include_user_mods +++ b/cime_config/testdefs/testmods_dirs/clm/waccmx_offline/include_user_mods @@ -1 +1,2 @@ ../default +../nofireemis From 010b10de2e481519e2ca04dee5d496438663984b Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Sat, 14 Sep 2024 10:26:19 -0600 Subject: [PATCH 1061/1248] Add --nofireemis to tests with Sp compsets, and remove the mpas15-3 resolution tests as we aren't going to do that --- cime_config/testdefs/testlist_clm.xml | 117 +++++++++++++++----------- 1 file changed, 69 insertions(+), 48 deletions(-) diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index 57e798b963..1a4df42194 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -31,7 +31,7 @@ - + @@ -40,6 +40,7 @@ + @@ -90,7 +91,7 @@ - + @@ -98,6 +99,7 @@ + @@ -193,80 +195,76 @@ - + + - + + - + + - + + - + + - + + - + + - @@ -349,22 +347,24 @@ - + + - + + @@ -623,112 +623,124 @@ - + + - + + - + + - + + - + + - + + - + + - + + - + + - + + - + + - + + @@ -914,13 +926,14 @@ - + + @@ -1546,13 +1559,14 @@ - + + @@ -1992,33 +2006,36 @@ - + + - + + - + + - + @@ -2027,17 +2044,18 @@ - + + - + @@ -2046,7 +2064,7 @@ - + @@ -2056,7 +2074,7 @@ - + @@ -2065,7 +2083,7 @@ - + @@ -2074,13 +2092,14 @@ - + + @@ -2101,13 +2120,14 @@ - + + @@ -2510,7 +2530,7 @@ - + @@ -2518,6 +2538,7 @@ + From d3c692625ed24349b0f17c1f550b550bd03335af Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Sat, 14 Sep 2024 17:38:48 -0600 Subject: [PATCH 1062/1248] Correct date for file --- 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 11e63758ba..31274228f8 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -2084,7 +2084,7 @@ lnd/clm2/surfdata_esmf/NEON/ctsm5.3.0/surfdata_1x1_NEON_TOOL_hist_2000_78pfts_c2 lnd/clm2/surfdata_esmf/ctsm5.3.0/synthetic/landuse.timeseries_1x1_smallvilleIA_synth_1850-1855_78pfts_c240912.nc +>lnd/clm2/surfdata_esmf/ctsm5.3.0/synthetic/landuse.timeseries_1x1_smallvilleIA_synth_1850-1855_78pfts_c240908.nc From 47178e7db33e49adba0b9560bf69e5683079db32 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Sun, 15 Sep 2024 02:34:29 -0600 Subject: [PATCH 1063/1248] Add handling of excess_ice to the picking of initial condition files --- bld/CLMBuildNamelist.pm | 33 +- bld/namelist_files/namelist_defaults_ctsm.xml | 310 +++++++++--------- 2 files changed, 184 insertions(+), 159 deletions(-) diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index c18b72ac15..d2974e8f2e 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -1665,6 +1665,7 @@ sub process_namelist_inline_logic { setup_logic_demand($opts, $nl_flags, $definition, $defaults, $nl); setup_logic_surface_dataset($opts, $nl_flags, $definition, $defaults, $nl, $envxml_ref); setup_logic_dynamic_subgrid($opts, $nl_flags, $definition, $defaults, $nl); + setup_logic_exice($opts, $nl_flags, $definition, $defaults, $nl, $physv); if ( remove_leading_and_trailing_quotes($nl_flags->{'clm_start_type'}) ne "branch" ) { setup_logic_initial_conditions($opts, $nl_flags, $definition, $defaults, $nl, $physv); } @@ -1894,7 +1895,7 @@ sub process_namelist_inline_logic { ################################# # namelist group: exice_streams # ################################# - setup_logic_exice($opts, $nl_flags, $definition, $defaults, $nl, $physv); + setup_logic_exice_streams($opts, $nl_flags, $definition, $defaults, $nl, $physv); ########################################## # namelist group: clm_temperature_inparm # @@ -2580,10 +2581,12 @@ sub setup_logic_initial_conditions { # # MUST BE AFTER: setup_logic_demand which is where flanduse_timeseries is set # AFTER: setup_logic_irrigate which is where irrigate is set + # AFTER: setup_logic_exice which is where use_excess_ice is set my ($opts, $nl_flags, $definition, $defaults, $nl, $physv) = @_; my $var = "finidat"; my $finidat = $nl->get_value($var); + $nl_flags->{'excess_ice_on_finidat'} = "unknown"; if ( $nl_flags->{'clm_start_type'} =~ /cold/ ) { if (defined $finidat ) { $log->warning("setting $var (either explicitly in your user_nl_clm or by doing a hybrid or branch RUN_TYPE)\n is incomptable with using a cold start" . @@ -2632,7 +2635,7 @@ sub setup_logic_initial_conditions { $settings{'sim_year'} = $st_year; } foreach my $item ( "mask", "maxpft", "irrigate", "glc_nec", "use_crop", "use_cn", "use_cndv", - "use_fates", + "use_fates", "use_excess_ice", "lnd_tuning_mode", ) { $settings{$item} = $nl_flags->{$item}; @@ -2653,6 +2656,7 @@ sub setup_logic_initial_conditions { my $done = 2; do { $try++; + $nl_flags->{'excess_ice_on_finidat'} = $settings{'use_excess_ice'}; add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, $var, %settings ); # If couldn't find a matching finidat file, check if can turn on interpolation and try to find one again $finidat = $nl->get_value($var); @@ -4966,18 +4970,39 @@ sub setup_logic_cnmatrix { #------------------------------------------------------------------------------- sub setup_logic_exice { # - # excess ice streams + # excess ice streams, must be set before initial conditions # my ($opts, $nl_flags, $definition, $defaults, $nl, $physv) = @_; add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'use_excess_ice', 'phys'=>$physv->as_string()); my $use_exice = $nl->get_value( 'use_excess_ice' ); + # Put use_exice into nl_flags so can be referenced later + if ( value_is_true($use_exice) ) { + $nl_flags->{'use_excess_ice'} = ".true."; + } else { + $nl_flags->{'use_excess_ice'} = ".false."; + } +} + +#------------------------------------------------------------------------------- +sub setup_logic_exice_streams { + # + # excess ice streams + # Run after initial conditions found as well as after setup_logic_exice + # + my ($opts, $nl_flags, $definition, $defaults, $nl, $physv) = @_; + my $use_exice = $nl_flags->{'use_excess_ice'}; + my $excess_ice_on_finidat = $nl_flags->{'excess_ice_on_finidat'}; my $use_exice_streams = $nl->get_value( 'use_excess_ice_streams' ); my $finidat = $nl->get_value('finidat'); # If coldstart and use_excess_ice is on: if ( ( (not defined($use_exice_streams)) && value_is_true($use_exice) ) && string_is_undef_or_empty($finidat) ) { $nl->set_variable_value('exice_streams', 'use_excess_ice_streams' , '.true.'); $use_exice_streams = '.true.'; - # if excess ice is turned off + # If an finidat file was selected and use_excess_ice is on: + } elsif ( (not defined($use_exice_streams)) && value_is_true($use_exice) && (not value_is_true($excess_ice_on_finidat)) ) { + $nl->set_variable_value('exice_streams', 'use_excess_ice_streams' , '.true.'); + $use_exice_streams = '.true.'; + # if excess ice is turned off } elsif ( (not defined($use_exice_streams)) && (not value_is_true($use_exice)) ) { $use_exice_streams = '.false.'; # Checking for cold clm_start_type and not finidat here since finidat can be not set set in branch/hybrid runs and diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index 31274228f8..67348d8ca2 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -886,232 +886,232 @@ attributes from the config_cache.xml file (with keys converted to upper-case). --> hgrid=0.9x1.25 maxpft=17 mask=gx1v7 use_cn=.true. use_crop=.false. irrigate=.true. glc_nec=10 do_transient_pfts=.false. +>hgrid=0.9x1.25 maxpft=17 mask=gx1v7 use_cn=.true. use_crop=.false. irrigate=.true. glc_nec=10 do_transient_pfts=.false. use_excess_ice=.false. hgrid=0.9x1.25 maxpft=17 mask=gx1v7 use_cn=.true. use_crop=.false. irrigate=.true. glc_nec=10 do_transient_pfts=.false. +>hgrid=0.9x1.25 maxpft=17 mask=gx1v7 use_cn=.true. use_crop=.false. 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=.false. glc_nec=10 do_transient_pfts=.false. +>hgrid=0.9x1.25 maxpft=79 mask=gx1v7 use_cn=.true. use_crop=.true. irrigate=.false. 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=.false. glc_nec=10 do_transient_pfts=.false. +>hgrid=0.9x1.25 maxpft=79 mask=gx1v7 use_cn=.true. use_crop=.true. irrigate=.false. glc_nec=10 do_transient_pfts=.false. use_excess_ice=.false. hgrid=0.9x1.25 maxpft=17 mask=gx1v7 use_cn=.false. use_crop=.false. irrigate=.true. glc_nec=10 do_transient_pfts=.false. +>hgrid=0.9x1.25 maxpft=17 mask=gx1v7 use_cn=.false. use_crop=.false. 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=.false. glc_nec=10 do_transient_pfts=.false. +>hgrid=0.9x1.25 maxpft=79 mask=gx1v7 use_cn=.true. use_crop=.true. irrigate=.false. 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=.false. glc_nec=10 do_transient_pfts=.false. +>hgrid=0.9x1.25 maxpft=79 mask=gx1v7 use_cn=.true. use_crop=.true. irrigate=.false. glc_nec=10 do_transient_pfts=.false. use_excess_ice=.false. hgrid=0.9x1.25 maxpft=17 mask=gx1v7 use_cn=.false. use_crop=.false. irrigate=.true. glc_nec=10 do_transient_pfts=.false. +>hgrid=0.9x1.25 maxpft=17 mask=gx1v7 use_cn=.false. use_crop=.false. 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=.false. glc_nec=10 do_transient_pfts=.false. +>hgrid=0.9x1.25 maxpft=79 mask=gx1v7 use_cn=.true. use_crop=.true. irrigate=.false. 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=.false. glc_nec=10 do_transient_pfts=.false. +>hgrid=0.9x1.25 maxpft=79 mask=gx1v7 use_cn=.true. use_crop=.true. irrigate=.false. 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=.false. glc_nex=10 do_transient_pfts=.false. lnd_tuning_mode=clm5_1_GSWP3v1 +>hgrid=0.9x1.25 maxpft=79 mask=gx1v7 use_cn=.true. use_crop=.true. irrigate=.false. glc_nex=10 do_transient_pfts=.false. lnd_tuning_mode=clm5_1_GSWP3v1 use_excess_ice=.true. hgrid=0.9x1.25 maxpft=79 mask=gx1v7 use_cn=.true. use_crop=.true. irrigate=.false. glc_nex=10 do_transient_pfts=.false. lnd_tuning_mode=clm6_0_GSWP3v1 +>hgrid=0.9x1.25 maxpft=79 mask=gx1v7 use_cn=.true. use_crop=.true. irrigate=.false. glc_nex=10 do_transient_pfts=.false. lnd_tuning_mode=clm6_0_GSWP3v1 use_excess_ice=.true. hgrid=1.9x2.5 maxpft=79 mask=gx1v7 use_cn=.true. use_crop=.true. irrigate=.true. glc_nec=10 do_transient_pfts=.false. +>hgrid=1.9x2.5 maxpft=79 mask=gx1v7 use_cn=.true. use_crop=.true. irrigate=.true. glc_nec=10 do_transient_pfts=.false. use_excess_ice=.false. hgrid=1.9x2.5 maxpft=79 mask=gx1v7 use_cn=.true. use_crop=.true. irrigate=.true. glc_nec=10 do_transient_pfts=.false. +>hgrid=1.9x2.5 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=17 mask=gx1v7 use_cn=.false. use_crop=.false. irrigate=.true. glc_nec=10 do_transient_pfts=.false. +>hgrid=0.9x1.25 maxpft=17 mask=gx1v7 use_cn=.false. use_crop=.false. irrigate=.true. glc_nec=10 do_transient_pfts=.false. use_excess_ice=.false. hgrid=0.9x1.25 maxpft=17 mask=gx1v7 use_cn=.false. use_crop=.false. irrigate=.true. glc_nec=10 do_transient_pfts=.false. +>hgrid=0.9x1.25 maxpft=17 mask=gx1v7 use_cn=.false. use_crop=.false. irrigate=.true. glc_nec=10 do_transient_pfts=.false. use_excess_ice=.false. hgrid=1.9x2.5 maxpft=79 mask=gx1v7 use_cn=.true. use_crop=.true. irrigate=.true. glc_nec=10 do_transient_pfts=.false. +>hgrid=1.9x2.5 maxpft=79 mask=gx1v7 use_cn=.true. use_crop=.true. irrigate=.true. glc_nec=10 do_transient_pfts=.false. use_excess_ice=.false. hgrid=1.9x2.5 maxpft=79 mask=gx1v7 use_cn=.true. use_crop=.true. irrigate=.true. glc_nec=10 do_transient_pfts=.false. +>hgrid=1.9x2.5 maxpft=79 mask=gx1v7 use_cn=.true. use_crop=.true. irrigate=.true. glc_nec=10 do_transient_pfts=.false. use_excess_ice=.false. hgrid=1.9x2.5 maxpft=79 mask=gx1v7 use_cn=.true. use_crop=.true. irrigate=.true. glc_nec=10 do_transient_pfts=.false. +>hgrid=1.9x2.5 maxpft=79 mask=gx1v7 use_cn=.true. use_crop=.true. irrigate=.true. glc_nec=10 do_transient_pfts=.false. use_excess_ice=.false. hgrid=1.9x2.5 maxpft=79 mask=gx1v7 use_cn=.true. use_crop=.true. irrigate=.true. glc_nec=10 do_transient_pfts=.false. +>hgrid=1.9x2.5 maxpft=79 mask=gx1v7 use_cn=.true. use_crop=.true. irrigate=.true. glc_nec=10 do_transient_pfts=.false. use_excess_ice=.false. hgrid=1.9x2.5 maxpft=79 mask=gx1v7 use_cn=.true. use_crop=.true. irrigate=.true. glc_nec=10 do_transient_pfts=.false. +>hgrid=1.9x2.5 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. +>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. +>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. +>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. +>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. +>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. +>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. +>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. +>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. +>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. +>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. +>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. +>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. +>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=.true. hgrid=0.9x1.25 maxpft=79 mask=gx1v7 use_cn=.true. use_crop=.true. irrigate=.true. glc_nec=10 do_transient_pfts=.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=.true. hgrid=0.9x1.25 maxpft=79 mask=gx1v7 use_cn=.true. use_crop=.true. irrigate=.true. glc_nec=10 do_transient_pfts=.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. +>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. +>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. +>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. +>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. +>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. +>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=0.9x1.25 maxpft=17 mask=gx1v7 use_cn=.false. use_crop=.false. irrigate=.true. glc_nec=10 do_transient_pfts=.false. +>hgrid=0.9x1.25 maxpft=17 mask=gx1v7 use_cn=.false. use_crop=.false. irrigate=.true. glc_nec=10 do_transient_pfts=.false. use_excess_ice=.false. hgrid=1.9x2.5 maxpft=17 mask=gx1v7 use_cn=.false. use_crop=.false. irrigate=.true. glc_nec=10 do_transient_pfts=.false. +>hgrid=1.9x2.5 maxpft=17 mask=gx1v7 use_cn=.false. use_crop=.false. irrigate=.true. glc_nec=10 do_transient_pfts=.false. use_excess_ice=.false. hgrid=ne0np4.ARCTIC.ne30x4 maxpft=17 mask=tx0.1v2 use_cn=.false. use_crop=.false. irrigate=.true. glc_nec=10 do_transient_pfts=.false. +>hgrid=ne0np4.ARCTIC.ne30x4 maxpft=17 mask=tx0.1v2 use_cn=.false. use_crop=.false. irrigate=.true. glc_nec=10 do_transient_pfts=.false. use_excess_ice=.false. hgrid=ne0np4.ARCTICGRIS.ne30x8 maxpft=17 mask=tx0.1v2 use_cn=.false. use_crop=.false. irrigate=.true. glc_nec=10 do_transient_pfts=.false. +>hgrid=ne0np4.ARCTICGRIS.ne30x8 maxpft=17 mask=tx0.1v2 use_cn=.false. use_crop=.false. irrigate=.true. glc_nec=10 do_transient_pfts=.false. use_excess_ice=.false. hgrid=1.9x2.5 maxpft=17 mask=gx1v7 use_cn=.false. use_crop=.false. irrigate=.true. glc_nec=10 do_transient_pfts=.false. +>hgrid=1.9x2.5 maxpft=17 mask=gx1v7 use_cn=.false. use_crop=.false. irrigate=.true. glc_nec=10 do_transient_pfts=.false. use_excess_ice=.false. hgrid=ne0np4CONUS.ne30x8 maxpft=17 mask=tx0.1v2 use_cn=.false. use_crop=.false. irrigate=.true. glc_nec=10 do_transient_pfts=.false. +>hgrid=ne0np4CONUS.ne30x8 maxpft=17 mask=tx0.1v2 use_cn=.false. use_crop=.false. irrigate=.true. glc_nec=10 do_transient_pfts=.false. use_excess_ice=.false. @@ -1119,183 +1119,183 @@ 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. +>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. +>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. +>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. +>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. +>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. +>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. +>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. +>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. +>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. +>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. +>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. +>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=17 mask=gx1v7 use_cn=.false. use_crop=.false. irrigate=.true. glc_nec=10 do_transient_pfts=.false. +>hgrid=0.9x1.25 maxpft=17 mask=gx1v7 use_cn=.false. use_crop=.false. irrigate=.true. glc_nec=10 do_transient_pfts=.false. use_excess_ice=.false. hgrid=1.9x2.5 maxpft=17 mask=gx1v7 use_cn=.false. use_crop=.false. irrigate=.true. glc_nec=10 do_transient_pfts=.false. +>hgrid=1.9x2.5 maxpft=17 mask=gx1v7 use_cn=.false. use_crop=.false. irrigate=.true. glc_nec=10 do_transient_pfts=.false. use_excess_ice=.false. hgrid=ne0np4.ARCTIC.ne30x4 maxpft=17 mask=tx0.1v2 use_cn=.false. use_crop=.false. irrigate=.true. glc_nec=10 do_transient_pfts=.false. +>hgrid=ne0np4.ARCTIC.ne30x4 maxpft=17 mask=tx0.1v2 use_cn=.false. use_crop=.false. irrigate=.true. glc_nec=10 do_transient_pfts=.false. use_excess_ice=.false. hgrid=ne0np4.ARCTICGRIS.ne30x8 maxpft=17 mask=tx0.1v2 use_cn=.false. use_crop=.false. irrigate=.true. glc_nec=10 do_transient_pfts=.false. +>hgrid=ne0np4.ARCTICGRIS.ne30x8 maxpft=17 mask=tx0.1v2 use_cn=.false. use_crop=.false. 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. +>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=.true. hgrid=0.9x1.25 maxpft=79 mask=gx1v7 use_cn=.true. use_crop=.true. irrigate=.true. glc_nec=10 do_transient_pfts=.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=.true. hgrid=0.9x1.25 maxpft=79 mask=gx1v7 use_cn=.true. use_crop=.true. irrigate=.true. glc_nec=10 do_transient_pfts=.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. +>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. +>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. +>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. +>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. +>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. +>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=0.9x1.25 maxpft=17 mask=gx1v7 use_cn=.false. use_crop=.false. irrigate=.true. glc_nec=10 do_transient_pfts=.false. +>hgrid=0.9x1.25 maxpft=17 mask=gx1v7 use_cn=.false. use_crop=.false. irrigate=.true. glc_nec=10 do_transient_pfts=.false. use_excess_ice=.true. hgrid=1.9x2.5 maxpft=17 mask=gx1v7 use_cn=.false. use_crop=.false. irrigate=.true. glc_nec=10 do_transient_pfts=.false. +>hgrid=1.9x2.5 maxpft=17 mask=gx1v7 use_cn=.false. use_crop=.false. irrigate=.true. glc_nec=10 do_transient_pfts=.false. use_excess_ice=.true. hgrid=ne0np4.ARCTIC.ne30x4 maxpft=17 mask=tx0.1v2 use_cn=.false. use_crop=.false. irrigate=.true. glc_nec=10 do_transient_pfts=.false. +>hgrid=ne0np4.ARCTIC.ne30x4 maxpft=17 mask=tx0.1v2 use_cn=.false. use_crop=.false. irrigate=.true. glc_nec=10 do_transient_pfts=.false. use_excess_ice=.false. hgrid=ne0np4.ARCTICGRIS.ne30x8 maxpft=17 mask=tx0.1v2 use_cn=.false. use_crop=.false. irrigate=.true. glc_nec=10 do_transient_pfts=.false. +>hgrid=ne0np4.ARCTICGRIS.ne30x8 maxpft=17 mask=tx0.1v2 use_cn=.false. use_crop=.false. irrigate=.true. glc_nec=10 do_transient_pfts=.false. use_excess_ice=.false. hgrid=0.9x1.25 maxpft=17 mask=gx1v7 use_cn=.false. use_crop=.false. irrigate=.true. glc_nec=10 do_transient_pfts=.false. +>hgrid=0.9x1.25 maxpft=17 mask=gx1v7 use_cn=.false. use_crop=.false. irrigate=.true. glc_nec=10 do_transient_pfts=.false. use_excess_ice=.true. hgrid=1.9x2.5 maxpft=17 mask=gx1v7 use_cn=.false. use_crop=.false. irrigate=.true. glc_nec=10 do_transient_pfts=.false. +>hgrid=1.9x2.5 maxpft=17 mask=gx1v7 use_cn=.false. use_crop=.false. irrigate=.true. glc_nec=10 do_transient_pfts=.false. use_excess_ice=.false. hgrid=ne0np4.ARCTIC.ne30x4 maxpft=17 mask=tx0.1v2 use_cn=.false. use_crop=.false. irrigate=.true. glc_nec=10 do_transient_pfts=.false. +>hgrid=ne0np4.ARCTIC.ne30x4 maxpft=17 mask=tx0.1v2 use_cn=.false. use_crop=.false. irrigate=.true. glc_nec=10 do_transient_pfts=.false. use_excess_ice=.false. hgrid=ne0np4.ARCTICGRIS.ne30x8 maxpft=17 mask=tx0.1v2 use_cn=.false. use_crop=.false. irrigate=.true. glc_nec=10 do_transient_pfts=.false. +>hgrid=ne0np4.ARCTICGRIS.ne30x8 maxpft=17 mask=tx0.1v2 use_cn=.false. use_crop=.false. irrigate=.true. glc_nec=10 do_transient_pfts=.false. use_excess_ice=.false. hgrid=1.9x2.5 maxpft=17 mask=gx1v7 use_cn=.false. use_crop=.false. irrigate=.true. glc_nec=10 do_transient_pfts=.false. +>hgrid=1.9x2.5 maxpft=17 mask=gx1v7 use_cn=.false. use_crop=.false. irrigate=.true. glc_nec=10 do_transient_pfts=.false. use_excess_ice=.false. hgrid=ne0np4CONUS.ne30x8 maxpft=17 mask=tx0.1v2 use_cn=.false. use_crop=.false. irrigate=.true. glc_nec=10 do_transient_pfts=.false. +>hgrid=ne0np4CONUS.ne30x8 maxpft=17 mask=tx0.1v2 use_cn=.false. use_crop=.false. irrigate=.true. glc_nec=10 do_transient_pfts=.false. use_excess_ice=.false. lnd/clm2/initdata_map/clmi.I1850Clm45BgcGs.0901-01-01.0.9x1.25_gx1v7_simyr1850_c200806.nc lnd/clm2/initdata_map/clmi.I1850Clm45BgcCruGs.1101-01-01.0.9x1.25_gx1v7_simyr1850_c200806.nc lnd/clm2/initdata_map/clmi.B1850Clm45BgcGs.0161-01-01.0.9x1.25_gx1v7_simyr1850_c200806.nc lnd/clm2/initdata_map/clmi.B1850Clm45BgcGs.0161-01-01.0.9x1.25_gx1v7_simyr1850_c200806.nc @@ -1333,7 +1333,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). lnd/clm2/initdata_map/clmi.I1850Clm50Sp.0181-01-01.0.9x1.25_gx1v7_simyr1850_c200806.nc @@ -1341,7 +1341,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). lnd/clm2/initdata_esmf/ctsm5.2/clmi.I1850Clm50BgcCrop-ciso.1366-01-01.0.9x1.25_gx1v7_simyr1850_c240223.nc @@ -1349,28 +1349,28 @@ attributes from the config_cache.xml file (with keys converted to upper-case). lnd/clm2/initdata_esmf/ctsm5.2/clmi.I1850Clm50BgcCropCru-ciso.1526-01-01.0.9x1.25_gx1v7_simyr1850_c240223.nc lnd/clm2/initdata_map/clmi.B1850Clm50BgcCrop.0161-01-01.0.9x1.25_gx1v7_simyr1850_c200729.nc lnd/clm2/initdata_map/clmi.B1850Clm50BgcCrop.0161-01-01.0.9x1.25_gx1v7_simyr1850_c200729.nc lnd/clm2/initdata_map/clmi.I1850Clm50SpCru.1706-01-01.0.9x1.25_gx1v7_simyr1850_c200806.nc @@ -1379,13 +1379,13 @@ attributes from the config_cache.xml file (with keys converted to upper-case). lnd/clm2/initdata_esmf/ctsm5.3/ctsm52026_f09_pSASU.clm2.r.0421-01-01-00000.nc lnd/clm2/initdata_esmf/ctsm5.3/ctsm52026_f09_pSASU.clm2.r.0421-01-01-00000.nc @@ -1398,7 +1398,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). lnd/clm2/initdata_esmf/ctsm5.2/clmi.I2000Clm50BgcCrop.2011-01-01.1.9x2.5_gx1v7_gl4_simyr2000_c240223.nc @@ -1406,7 +1406,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). lnd/clm2/initdata_esmf/ctsm5.2/clmi.I2000Clm50BgcCrop.2011-01-01.1.9x2.5_gx1v7_gl4_simyr2000_c240223.nc @@ -1414,20 +1414,20 @@ attributes from the config_cache.xml file (with keys converted to upper-case). lnd/clm2/initdata_esmf/ctsm5.2/clmi.I2000Clm50BgcCrop.2011-01-01.1.9x2.5_gx1v7_gl4_simyr2000_c240223.nc lnd/clm2/initdata_esmf/ctsm5.2/clmi.I2000Clm50BgcCrop.2011-01-01.1.9x2.5_gx1v7_gl4_simyr2000_c240223.nc lnd/clm2/initdata_esmf/ctsm5.3/ctsm52026_f09_pSASU.clm2.r.0421-01-01-00000.nc @@ -1436,7 +1436,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). lnd/clm2/initdata_esmf/ctsm5.2/clmi.I2000Clm50BgcCrop.2011-01-01.1.9x2.5_gx1v7_gl4_simyr2000_c240223.nc @@ -1444,7 +1444,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). lnd/clm2/initdata_map/clmi.BHIST.2000-01-01.0.9x1.25_gx1v7_simyr1979_c200806.nc @@ -1452,7 +1452,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). lnd/clm2/initdata_map/clmi.BHIST.2000-01-01.0.9x1.25_gx1v7_simyr1979_c200806.nc @@ -1463,14 +1463,14 @@ attributes from the config_cache.xml file (with keys converted to upper-case). --> lnd/clm2/initdata_map/clmi.BHIST.2000-01-01.0.9x1.25_gx1v7_simyr1979_c200806.nc lnd/clm2/initdata_map/clmi.BHIST.2000-01-01.1.9x2.5_gx1v7_simyr1979_c200806.nc @@ -1478,7 +1478,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). lnd/clm2/initdata_map/clmi.FHISTSp.1979-01-01.ARCTIC_ne30x4_mt12_simyr1979_c200806.nc @@ -1486,7 +1486,7 @@ 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 @@ -1494,7 +1494,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). lnd/clm2/initdata_map/clmi.F2000.2000-01-01.ne120pg3_mt13_simyr2000_c200728.nc @@ -1502,7 +1502,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). lnd/clm2/initdata_map/clmi.BHIST.2000-01-01.0.9x1.25_gx1v7_simyr2000_c200728.nc @@ -1512,7 +1512,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). lnd/clm2/initdata_esmf/ctsm5.3/ctsm52026_f09_pSASU.clm2.r.0421-01-01-00000.nc @@ -1521,7 +1521,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). lnd/clm2/initdata_esmf/ctsm5.3/ctsm52026_f09_pSASU.clm2.r.0421-01-01-00000.nc @@ -1530,7 +1530,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). lnd/clm2/initdata_map/clmi.BHISTSp.2000-01-01.1.9x2.5_gx1v7_simyr2003_c200807.nc @@ -1539,21 +1539,21 @@ attributes from the config_cache.xml file (with keys converted to upper-case). lnd/clm2/initdata_map/clmi.FHISTSp.2013-01-01.ne0CONUSne30x8_mt12_simyr2013_c200806.nc lnd/clm2/initdata_map/clmi.BHIST.2000-01-01.0.9x1.25_gx1v7_simyr1979_c200806.nc lnd/clm2/initdata_map/clmi.BHIST.2000-01-01.1.9x2.5_gx1v7_simyr1979_c200806.nc @@ -1561,7 +1561,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). lnd/clm2/initdata_map/clmi.FHISTSp.1979-01-01.ARCTIC_ne30x4_mt12_simyr1979_c200806.nc @@ -1569,7 +1569,7 @@ 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 @@ -1577,7 +1577,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). lnd/clm2/initdata_map/clmi.F2000.2000-01-01.ne120pg3_mt13_simyr2000_c200728.nc @@ -1586,7 +1586,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). lnd/clm2/initdata_esmf/ctsm5.3/ctsm52026_f09_pSASU.clm2.r.0421-01-01-00000.nc @@ -1594,7 +1594,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). lnd/clm2/initdata_map/clmi.BHISTSp.2000-01-01.1.9x2.5_gx1v7_simyr2003_c200807.nc @@ -1603,21 +1603,21 @@ attributes from the config_cache.xml file (with keys converted to upper-case). lnd/clm2/initdata_map/clmi.FHISTSp.2013-01-01.ne0CONUSne30x8_mt12_simyr2013_c200806.nc lnd/clm2/initdata_map/clmi.BHIST.2000-01-01.0.9x1.25_gx1v7_simyr1979_c200806.nc lnd/clm2/initdata_map/clmi.BHIST.2000-01-01.1.9x2.5_gx1v7_simyr1979_c200806.nc @@ -1625,7 +1625,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). lnd/clm2/initdata_map/clmi.FHISTSp.1979-01-01.ARCTIC_ne30x4_mt12_simyr1979_c200806.nc @@ -1633,7 +1633,7 @@ 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 @@ -1641,7 +1641,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). lnd/clm2/initdata_map/clmi.F2000.2000-01-01.ne120pg3_mt13_simyr2000_c200728.nc @@ -1650,7 +1650,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). lnd/clm2/initdata_esmf/ctsm5.3/ctsm52026_f09_pSASU.clm2.r.0421-01-01-00000.nc @@ -1658,7 +1658,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). lnd/clm2/initdata_map/clmi.BHISTSp.2000-01-01.1.9x2.5_gx1v7_simyr2003_c200807.nc @@ -1667,7 +1667,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). lnd/clm2/initdata_map/clmi.FHISTSp.2013-01-01.ne0CONUSne30x8_mt12_simyr2013_c200806.nc @@ -1678,14 +1678,14 @@ attributes from the config_cache.xml file (with keys converted to upper-case). --> lnd/clm2/initdata_map/clmi.BHIST.2000-01-01.0.9x1.25_gx1v7_simyr1979_c200806.nc lnd/clm2/initdata_map/clmi.BHIST.2000-01-01.1.9x2.5_gx1v7_simyr1979_c200806.nc @@ -1693,7 +1693,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). lnd/clm2/initdata_map/clmi.FHISTSp.1979-01-01.ARCTIC_ne30x4_mt12_simyr1979_c200806.nc @@ -1701,7 +1701,7 @@ 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 @@ -1709,7 +1709,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). lnd/clm2/initdata_map/clmi.F2000.2000-01-01.ne120pg3_mt13_simyr2000_c200728.nc @@ -1717,7 +1717,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). lnd/clm2/initdata_map/clmi.BHIST.2000-01-01.0.9x1.25_gx1v7_simyr2000_c200728.nc @@ -1725,7 +1725,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). lnd/clm2/initdata_esmf/ctsm5.3/ctsm52026_f09_pSASU.clm2.r.0421-01-01-00000.nc @@ -1733,7 +1733,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). lnd/clm2/initdata_esmf/ctsm5.3/ctsm52026_f09_pSASU.clm2.r.0421-01-01-00000.nc @@ -1741,7 +1741,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). lnd/clm2/initdata_map/clmi.BHISTSp.2000-01-01.1.9x2.5_gx1v7_simyr2003_c200807.nc @@ -1750,7 +1750,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). lnd/clm2/initdata_map/clmi.FHISTSp.2013-01-01.ne0CONUSne30x8_mt12_simyr2013_c200806.nc @@ -1758,14 +1758,14 @@ attributes from the config_cache.xml file (with keys converted to upper-case). lnd/clm2/initdata_map/clmi.BHIST.2000-01-01.0.9x1.25_gx1v7_simyr1979_c200806.nc lnd/clm2/initdata_map/clmi.BHIST.2000-01-01.1.9x2.5_gx1v7_simyr1979_c200806.nc @@ -1773,7 +1773,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). lnd/clm2/initdata_map/clmi.FHISTSp.1979-01-01.ARCTIC_ne30x4_mt12_simyr1979_c200806.nc @@ -1781,7 +1781,7 @@ 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 @@ -1789,7 +1789,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). lnd/clm2/initdata_map/clmi.F2000.2000-01-01.ne120pg3_mt13_simyr2000_c200728.nc @@ -1798,7 +1798,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). lnd/clm2/initdata_esmf/ctsm5.3/ctsm52026_f09_pSASU.clm2.r.0421-01-01-00000.nc @@ -1806,7 +1806,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). lnd/clm2/initdata_map/clmi.BHISTSp.2000-01-01.1.9x2.5_gx1v7_simyr2003_c200807.nc @@ -1815,7 +1815,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). lnd/clm2/initdata_map/clmi.FHISTSp.2013-01-01.ne0CONUSne30x8_mt12_simyr2013_c200806.nc @@ -1823,14 +1823,14 @@ attributes from the config_cache.xml file (with keys converted to upper-case). lnd/clm2/initdata_map/clmi.BHIST.2000-01-01.0.9x1.25_gx1v7_simyr1979_c200806.nc lnd/clm2/initdata_map/clmi.BHIST.2000-01-01.1.9x2.5_gx1v7_simyr1979_c200806.nc @@ -1838,7 +1838,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). lnd/clm2/initdata_map/clmi.FHISTSp.1979-01-01.ARCTIC_ne30x4_mt12_simyr1979_c200806.nc @@ -1846,7 +1846,7 @@ 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 @@ -1854,7 +1854,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). lnd/clm2/initdata_map/clmi.F2000.2000-01-01.ne120pg3_mt13_simyr2000_c200728.nc @@ -1863,7 +1863,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). lnd/clm2/initdata_esmf/ctsm5.3/ctsm52026_f09_pSASU.clm2.r.0421-01-01-00000.nc @@ -1871,7 +1871,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). lnd/clm2/initdata_map/clmi.BHISTSp.2000-01-01.1.9x2.5_gx1v7_simyr2003_c200807.nc @@ -1880,7 +1880,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). lnd/clm2/initdata_map/clmi.FHISTSp.2013-01-01.ne0CONUSne30x8_mt12_simyr2013_c200806.nc From 77105148dc35bf0767b8ae717c2fca8a5b4c53d7 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Mon, 16 Sep 2024 01:53:20 -0600 Subject: [PATCH 1064/1248] update description --- doc/ChangeLog | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index 988fe4f504..695323904a 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -7,8 +7,34 @@ One-line Summary: Update surface datasets, CN Matrix, CLM60: excess ice on, expl Purpose and description of changes since ctsm5.2.0 -------------------------------------------------- -Changes to CTSM: -================ + +Changes to CTSM Infrastructure: +=============================== + + - manage_externals removed and replaced by git-fleximod + - Ability to handle CAM7 in LND_TUNING_MODE + +Changes to CTSM Answers: +======================== + + Changes to defaults for clm6_0 physics: + - Urban explicit A/C turned on + - Snow thermal conductivity is now Sturm_1997 + - New IC file for f09 1850 + - New crop calendars + - Dust emissions is now Leung_2023 + - Excess ice is turned on + - Updates to MEGAN for BVOC's + - Updates to BGC fire method + + Changes for all physics versions: + + - Parameter files updated + - FATES parameter file updated + - Glacier region 1 is now undefined + - Update in FATES transient Land use + - Pass active glacier (CISM) runoff directly to river model (MOSART) + - Add the option for using matrix for Carbon/Nitrogen BGC spinup New surface datasets: From 32897dc5ccec66e0f0382b570a0bb4af144e3045 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Tue, 17 Sep 2024 09:50:09 -0600 Subject: [PATCH 1065/1248] Changes suggested by @samrabin to get 16pft surface datasets to work with 78 pft fire emission files in #2759 --- src/biogeochem/FireEmisFactorsMod.F90 | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/biogeochem/FireEmisFactorsMod.F90 b/src/biogeochem/FireEmisFactorsMod.F90 index e97082c0b8..31aba66fb2 100644 --- a/src/biogeochem/FireEmisFactorsMod.F90 +++ b/src/biogeochem/FireEmisFactorsMod.F90 @@ -11,6 +11,7 @@ module FireEmisFactorsMod use shr_kind_mod, only : r8 => shr_kind_r8 use abortutils, only : endrun use clm_varctl, only : iulog + use clm_varpar, only : maxveg ! implicit none private @@ -21,7 +22,7 @@ module FireEmisFactorsMod public :: fire_emis_factors_get ! !PRIVATE MEMBERS: - integer :: npfts ! number of plant function types + integer :: npfts ! number of plant function types on the fire emission factors dataset ! type emis_eff_t real(r8), pointer :: eff(:) ! emissions efficiency factor @@ -73,7 +74,9 @@ subroutine fire_emis_factors_get( comp_name, factors, molecwght ) call endrun(errmes) endif - factors(:npfts) = comp_factors_table( ndx )%eff(:npfts) + factors(:maxveg) = comp_factors_table( ndx )%eff(:maxveg) + ! If fire emissions factor file only includes natural PFT's, but this is a crop case + ! Copy the generic crop factors to the crop CFT's from generic crop if ( size(factors) > npfts )then factors(npfts+1:) = comp_factors_table( ndx )%eff(nc3crop) end if @@ -96,7 +99,6 @@ subroutine fire_emis_factors_init( filename ) use ncdio_pio, only : ncd_pio_openfile,ncd_inqdlen use pio, only : pio_inq_varid,pio_get_var,file_desc_t,pio_closefile use fileutils , only : getfil - use clm_varpar , only : mxpft ! ! !ARGUMENTS: character(len=*),intent(in) :: filename ! FireEmis factors input file @@ -127,8 +129,9 @@ subroutine fire_emis_factors_init( filename ) call ncd_inqdlen( ncid, dimid, n_pfts, name='PFT_Num') npfts = n_pfts - if ( npfts /= mxpft .and. npfts /= 16 )then - call endrun('Number of PFTs on fire emissions file is NOT correct. Its neither the total number of PFTS nor 16') + if ( npfts < maxveg )then + write(iulog,*) ' npfts = ', npfts, ' maxveg = ', maxveg + call endrun('Number of PFTs on the fire emissions file is less than the number of PFTs from the surface dataset') end if ierr = pio_inq_varid(ncid,'Comp_EF', comp_ef_vid) From 5f91d5c54e46c7ab2d29c6f65db4b5e637a54da2 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Tue, 17 Sep 2024 13:26:18 -0600 Subject: [PATCH 1066/1248] Fix syntax error in testlist and corect nofireemis testmod --- cime_config/testdefs/testlist_clm.xml | 36 +++++++++++++-------------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index 1dbfb36567..0eb3d5012d 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -31,7 +31,7 @@ - + @@ -91,7 +91,7 @@ - + @@ -195,7 +195,7 @@ - + @@ -205,7 +205,7 @@ - + @@ -215,7 +215,7 @@ - + @@ -225,7 +225,7 @@ - + @@ -235,7 +235,7 @@ - + @@ -245,7 +245,7 @@ - + @@ -255,7 +255,7 @@ - + @@ -347,7 +347,7 @@ - + @@ -357,7 +357,7 @@ - + @@ -623,7 +623,7 @@ - + @@ -633,7 +633,7 @@ - + @@ -643,7 +643,7 @@ - + @@ -653,7 +653,7 @@ - + @@ -663,7 +663,7 @@ - + @@ -673,7 +673,7 @@ - + @@ -683,7 +683,7 @@ - + From d753457b0fa44784b6ba46734a8a42f0a23f9577 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Tue, 17 Sep 2024 16:55:43 -0600 Subject: [PATCH 1067/1248] Remove references to PTCLM/PTCLMmkdata. Resolves ESCOMP/CTSM#2769. --- doc/source/users_guide/index.rst | 1 - .../users_guide/overview/getting-help.rst | 3 - .../users_guide/overview/introduction.rst | 4 +- .../running-PTCLM/adding-ptclm-site-data.rst | 88 ------------ .../users_guide/running-PTCLM/index.rst | 20 --- .../running-PTCLM/introduction-to-ptclm.rst | 135 ------------------ .../running-PTCLM/ptclm-examples.rst | 33 ----- .../users_guide/running-PTCLM/using-ptclm.rst | 114 --------------- ...point-and-regional-grid-configurations.rst | 11 +- doc/source/users_guide/testing/testing.rst | 11 -- .../observational-sites-datasets.rst | 4 +- 11 files changed, 5 insertions(+), 419 deletions(-) delete mode 100644 doc/source/users_guide/running-PTCLM/adding-ptclm-site-data.rst delete mode 100644 doc/source/users_guide/running-PTCLM/index.rst delete mode 100644 doc/source/users_guide/running-PTCLM/introduction-to-ptclm.rst delete mode 100644 doc/source/users_guide/running-PTCLM/ptclm-examples.rst delete mode 100644 doc/source/users_guide/running-PTCLM/using-ptclm.rst diff --git a/doc/source/users_guide/index.rst b/doc/source/users_guide/index.rst index 75a2949bec..8c675c79db 100644 --- a/doc/source/users_guide/index.rst +++ b/doc/source/users_guide/index.rst @@ -24,7 +24,6 @@ adding-new-resolutions/index.rst running-special-cases/index.rst running-single-points/index.rst - running-PTCLM/index.rst trouble-shooting/index.rst testing/index.rst diff --git a/doc/source/users_guide/overview/getting-help.rst b/doc/source/users_guide/overview/getting-help.rst index 74765d1ad0..7c33071db9 100644 --- a/doc/source/users_guide/overview/getting-help.rst +++ b/doc/source/users_guide/overview/getting-help.rst @@ -146,9 +146,6 @@ MOSART PFT Plant Function Type (PFT). A type of vegetation that CLM parameterizes. -PTCLM - PoinT CLM (PTCLM) a python script that operates on top of CLM for |version| to run single point simulations for CLM. - ROF River runOff Model to route flow of surface water over land out to the ocean. |cesmrelease| has two components options for this the new model MOSART and previous model RTM. diff --git a/doc/source/users_guide/overview/introduction.rst b/doc/source/users_guide/overview/introduction.rst index bc7c1fd82c..e02fa3e422 100644 --- a/doc/source/users_guide/overview/introduction.rst +++ b/doc/source/users_guide/overview/introduction.rst @@ -60,9 +60,7 @@ As a followup to the tools chapter, :ref:`adding-new-resolutions-section` tells In :ref:`running-special-cases-section`, again for the expert user, we give details on how to do some particularly difficult special cases. For example, we give the protocol for spinning up the |version|-BGC and CLMCN models as well as CLM with dynamic vegetation active (CNDV). We give instructions to do a spinup case from a previous case with Coupler history output for atmospheric forcing. We also give instructions on running both the prognostic crop and irrigation models. Lastly we tell the user how to use the DATM model to send historical CO2 data to CLM. -:ref:`running-single-points` outlines how to do single-point or regional simulations using |version|. This is useful to either compare |version| simulations with point observational stations, such as tower sites (which might include your own atmospheric forcing), or to do quick simulations with CLM for example to test a new parameterization. There are several different ways given on how to perform single-point simulations which range from simple PTS_MODE to more complex where you create all your own datasets, tying into :ref:`using-clm-tools-section` and also :ref:`adding-new-resolutions-section` to add the files into the build-namelist XML database. The PTCLM python script to run single-point simulations was added back in for this release (but it has bugs that don't allow it to work out of the box). CLM4 in CESM1.0.5 has a fully working versions of PTCLM. - -Need :ref:`running-PTCLM` blurb... +:ref:`running-single-points` outlines how to do single-point or regional simulations using |version|. This is useful to either compare |version| simulations with point observational stations, such as tower sites (which might include your own atmospheric forcing), or to do quick simulations with CLM for example to test a new parameterization. There are several different ways given on how to perform single-point simulations which range from simple PTS_MODE to more complex where you create all your own datasets, tying into :ref:`using-clm-tools-section` and also :ref:`adding-new-resolutions-section` to add the files into the build-namelist XML database. :ref:`troubleshooting-index` gives some guidance on trouble-shooting problems when using |version|. It doesn't cover all possible problems with CLM, but gives you some guidelines for things that can be done for some common problems. diff --git a/doc/source/users_guide/running-PTCLM/adding-ptclm-site-data.rst b/doc/source/users_guide/running-PTCLM/adding-ptclm-site-data.rst deleted file mode 100644 index b95831427f..0000000000 --- a/doc/source/users_guide/running-PTCLM/adding-ptclm-site-data.rst +++ /dev/null @@ -1,88 +0,0 @@ -.. include:: ../substitutions.rst - -.. _adding-ptclm-site-data: - -============================ -Adding PTCLMmkdata Site Data -============================ - -The "sitegroupname" option to PTCLMmkdata looks for groups of sites in the files in the ``PTCLM_sitedata`` directory under the PTCLMmkdata directory. You can add new names available for this option including your own lists of sites, by adding more files in this directory. There are three files for each "sitegroupname": ``$SITEGROUP_sitedata.txt``, ``$SITEGROUP_soildata.txt`` and ``$SITEGROUP_pftdata.txt`` (where ``$SITEGROUP`` is the name that would be entered as "sitegroupname" to PTCLMmkdata). Each file needs to have the same list of sites, but gives different information: site data, PFT data, and soil data respectively. Although the site codes need to be the same between the three files, the files do NOT have to be in the same order. Each file has a one-line header that lists the contents of each column which are separated by commas. The first column for each of the files is the "site_code" which must be consistent between the three files. The site code can be any unique character string, but in general we use the AmeriFlux site code. - -Site data file:`` $SITEGROUP_sitedata.txt``): The header for this file is: -:: - - site_code,name,state,lon,lat,elev,startyear,endyear,alignyear - -The columns: name, state, and elevation are informational only. Name is a longer descriptive name of the site, and state is the state for U.S. sites or country for non U.S. sites. The columns: lon and lat are the longitude and latitude of the location in decimal degrees. The last three columns are the start and ending year for the data and the align year for an 1850 case for the data. The align year is currently unused. - -Soil data file: ``$SITEGROUP_soildata.txt``): The header for this file is: -:: - - site_code,soil_depth,n_layers,layer_depth,layer_sand%,layer_clay% - -The first three fields after "site_code" are currently unused. The only two that are used are the percent sand and clay columns to set the soil texture. - -PFT data file: ``$SITEGROUP_pftdata.txt```): The header for this file is: -:: - - site_code,pft_f1,pft_c1,pft_f2,pft_c2,pft_f3,pft_c3,pft_f4,pft_c4,pft_f5,pft_c5 - -This file gives the vegetation coverage for the different vegetation types for the site. The file only supports up to five PFT's at the same time. The columns with "pft_f" are the fractions for each PFT, and the columns with "pft_c" is the integer index of the given PFT. Look at the pft-physiology file to see what the PFT index for each PFT type is. - ----------------------------------------------------- -Dynamic Land-Use Change Files for use by PTCLMmkdata ----------------------------------------------------- - -There is a mechanism for giving site-specific land-use change in PTCLMmkdata. Adding site specific files to the ``PTCLM_sitedata`` directory under PTCLMmkdata allows you to specify the change in vegetation and change in harvesting (for the CN model) for that site. Files are named: ``$SITE_dynpftdata.txt``. There is a sample file for the US-Ha1 site called: ``US-Ha1_dynpftdata.txt``. The file has a one-line header with the information that the file has, and then one-line for each year with a transition. The header line is as follows: -:: - - trans_year,pft_f1,pft_c1,pft_f2,pft_c2,pft_f3,pft_c3,pft_f4,pft_c4,pft_f5,pft_c5,har_vh1,har_vh2,har_sh1,har_sh2,har_sh3,graze,hold_harv,hold_graze - -This file only requires a line for each year where a transition or harvest happens. As in the "pftdata" file above "pft_f" refers to the fraction and "pft_c" refers to the PFT index, and only up to five vegetation types are allowed to co-exist. The last eight columns have to do with harvesting and grazing. The last two columns are whether to hold harvesting and/or grazing constant until the next transition year and will just be either 1 or 0. This file will be converted by the **PTCLM_sitedata/cnvrt_trnsyrs2_pftdyntxtfile.pl** script in the PTCLMmkdata directory to a format that **mksurfdata_esmf** can read that has an entry for each year for the range of years valid for the compset in question. - -.. _converting-ameriflux-for-ptclmmkdata: - ------------------------------------------------- -Converting AmeriFlux Data for use by PTCLMmkdata ------------------------------------------------- - -AmeriFlux data comes in comma separated format and is available from: `http://public.ornl.gov/ameriflux/dataproducts.shtml `_. Before you download the data you need to agree to the usage terms. - -Here is a copy of the usage terms from the web-site on June/13/2011. - -"The AmeriFlux data provided on this site are freely available and were furnished by individual AmeriFlux scientists who encourage their use. Please kindly inform the appropriate AmeriFlux scientist(s) of how you are using the data and of any publication plans. Please acknowledge the data source as a citation or in the acknowledgments if the data are not yet published. If the AmeriFlux Principal Investigators (PIs) feel that they should be acknowledged or offered participation as authors, they will let you know and we assume that an agreement on such matters will be reached before publishing and/or use of the data for publication. If your work directly competes with the PI's analysis they may ask that they have the opportunity to submit a manuscript before you submit one that uses unpublished data. In addition, when publishing, please acknowledge the agency that supported the research. Lastly, we kindly request that those publishing papers using AmeriFlux data provide preprints to the PIs providing the data and to the data archive at the Carbon Dioxide Information Analysis Center (CDIAC)." - -The above agreement applies to the "US-UMB" dataset imported into our repository as well, and Gil Bohrer is the PI on record for that dataset. - -The CESM can NOT handle missing data, so we recommend using the "Level 4" Gap filled datasets. The fields will also need to be renamed. The "WS" column becomes "WIND", "PREC" becomes "PRECmms", "RH" stays as "RH", "TA" becomes "TBOT", "Rg" becomes "FSDS", "Rgl" becomes "FLDS", "PRESS" becomes "PSRF". "ZBOT" can just be set to the constant of "30" (m). The units of Temperature need to be converted from "Celsius" to "Kelvin" (use the value in ``SHR_CONST_TKFRZ`` in the file ``models/csm_share/shr/shr_const.F90`` of ``273.15``. The units of Pressure also need to be converted from "kPa" to "Pa". LATIXY, and LONGXY should also be set to the latitude and longitude of the site. - ------------------------------------------------------------------ -Example: PTCLMmkdata transient example over a shorter time period ------------------------------------------------------------------ - -This is an example of using PTCLMmkdata for Harvard Forest (AmeriFlux site code US-Ha1) for transient land use 1991-2006. In order to do this we would've needed to have converted the AmeriFlux data into NetCDF format as shown in :ref:`converting-ameriflux-for-ptclmmkdata` section above. Also note that this site has a site-specific dynamic land-use change file for it ``PTCLM_sitedata/US-Ha1_dynpftdata.txt`` in the PTCLMmkdata directory and this file will be used for land-use change and harvesting rather than the global dataset. - -:: - - > cd $CTSMROOT/tools/PTCLM - # We are going to use forcing data over 1991 to 2006, but we need to start with - # a transient compset to do so, so we use the 20th Century transient: 1850-2000 - # Note: When creating the fpftdyn dataset for this site it will use the - # PTCLM_sitedata/US-Ha1_dynpftdata.txt - # file for land-use change and harvesting - > ./PTCLMmkdata -s US-Ha1 -d $MYCSMDATA --sitegroupname AmeriFlux - > mkdir $MYCSMDATA/atm/datm7/CLM1PT_data/1x1pt_US-Ha1 - > cd $MYCSMDATA/atm/datm7/CLM1PT_data/1x1pt_US-Ha1 - # Copy data in NetCDF format to this directory, filenames should be YYYY-MM.nc - # The fieldnames on the file should be: - # FLDS,FSDS,LATIXY, LONGXY, PRECTmms,PSRF,RH,TBOT,WIND,ZBOT - # With units - # W/m2,W/m2,degrees_N,degrees_E,mm/s, Pa, %, K, m/s, m - # The time coordinate units should be: days since YYYY-MM-DD 00:00:00 - > cd ../../../../../US-Ha1_I20TRCRUCLM45BGC - # Now we need to set the start date to 1991, and make sure the align year is for 1991 - > ./xmlchange RUN_STARTDATE=1991-01-01,DATM_CLMNCEP_YR_ALIGN=1991 - # Similarly for Nitrogen deposition data we cycle over: 1991 to 2006 - > cat << EOF >> user_nl_clm - model_year_align_ndep=1991,stream_year_first_ndep=1991,stream_year_last_ndep=2006 - EOF diff --git a/doc/source/users_guide/running-PTCLM/index.rst b/doc/source/users_guide/running-PTCLM/index.rst deleted file mode 100644 index 0b44c01b49..0000000000 --- a/doc/source/users_guide/running-PTCLM/index.rst +++ /dev/null @@ -1,20 +0,0 @@ -.. on documentation master file, created by - sphinx-quickstart on Tue Jan 31 19:46:36 2017. - You can adapt this file completely to your liking, but it should at least - contain the root `toctree` directive. - -.. include:: ../substitutions.rst - -.. _running-PTCLM: - -##################################### -Running PTCLM -##################################### - -.. toctree:: - :maxdepth: 2 - - introduction-to-ptclm.rst - using-ptclm.rst - ptclm-examples.rst - adding-ptclm-site-data.rst diff --git a/doc/source/users_guide/running-PTCLM/introduction-to-ptclm.rst b/doc/source/users_guide/running-PTCLM/introduction-to-ptclm.rst deleted file mode 100644 index 9ae4186d2c..0000000000 --- a/doc/source/users_guide/running-PTCLM/introduction-to-ptclm.rst +++ /dev/null @@ -1,135 +0,0 @@ -.. _introduction-to-ptclm.rst: - -.. include:: ../substitutions.rst - -.. _what-is-ptclm: - -===================== - What is PTCLMmkdata? -===================== - -PTCLMmkdata (pronounced Pee-Tee Cee-L-M make data is a Python script to help you set up PoinT CLM simulations. - -It runs the CLM tools for you to get datasets set up, and copies them to a location you can use them including the changes needed for a case to use the dataset with namelist and XML changes. - -Then you run **create_newcase** and point to the directory so that the namelist and XML changes are automatically applied. - -PTCLMmkdata has a simple ASCII text file for storing basic information for your sites. - -We also have complete lists for AmeriFlux and Fluxnet-Canada sites, although we only have the meteorology data for one site. - -For other sites you will need to obtain the meteorology data and translate it to a format that the CESM datm model can use. - -But, even without meteorology data PTCLMmkdata is useful to setup datasets to run with standard ``CLM_QIAN`` data. - -The original authors of PTCLMmkdata are: Daniel M. Ricciuto, Dali Wang, Peter E. Thornton, Wilfred M. Post all at Environmental Sciences Division, Oak Ridge National Laboratory (ORNL) and R. Quinn Thomas at Cornell University. It was then modified fairly extensively by Erik Kluzek at NCAR. We want to thank all of these individuals for this contribution to the CESM effort. We also want to thank the folks at University of Michigan Biological Stations (US-UMB) who allowed us to use their Fluxnet station data and import it into our inputdata repository, especially Gil Bohrer the PI on record for this site. - -.. _details-of-ptclm: - -======================= - Details of PTCLMmkdata -======================= - -To get help on PTCLM2_180611 use the "--help" option as follows. -:: - - > cd $CTSMROOT/tools/PTCLM - > ./PTCLMmkdata --help - -The output to the above command is as follows: -:: - - Usage: PTCLM.py [options] -d inputdatadir -m machine -s sitename - - Python script to create cases to run single point simulations with tower site data. - - Options: - --version show program's version number and exit - -h, --help show this help message and exit - - Required Options: - -d CCSM_INPUT, --csmdata=CCSM_INPUT - Location of CCSM input data - -m MYMACHINE, --machine=MYMACHINE - Machine, valid CESM script machine (-m list to list valid - machines) - -s MYSITE, --site=MYSITE - Site-code to run, FLUXNET code or CLM1PT name (-s list to list - valid names) - - Configure and Run Options: - -c MYCOMPSET, --compset=MYCOMPSET - Compset for CCSM simulation (Must be a valid 'I' compset [other - than IG compsets], use -c list to list valid compsets) - --coldstart Do a coldstart with arbitrary initial conditions - --caseidprefix=MYCASEID - Unique identifier to include as a prefix to the case name - --cesm_root=BASE_CESM - Root CESM directory (top level directory with models and scripts - subdirs) - --debug Flag to turn on debug mode so won't run, but display what would - happen - --finidat=FINIDAT Name of finidat initial conditions file to start CLM from - --list List all valid: sites, compsets, and machines - --namelist=NAMELIST - List of namelist items to add to CLM namelist (example: - --namelist="hist_fincl1='TG',hist_nhtfrq=-1" - --QIAN_tower_yrs Use the QIAN forcing data year that correspond to the tower - years - --rmold Remove the old case directory before starting - --run_n=MYRUN_N Number of time units to run simulation - --run_units=MYRUN_UNITS - Time units to run simulation (steps,days,years, etc.) - --quiet Print minimul information on what the script is doing - --sitegroupname=SITEGROUP - Name of the group of sites to search for you selected site in - (look for prefix group names in the PTCLM_sitedata directory) - --stdurbpt If you want to setup for standard urban namelist settings - --useQIAN use QIAN input forcing data instead of tower site meterology data - --verbose Print out extra information on what the script is doing - - Input data generation options: - These are options having to do with generation of input datasets. Note: When - running for supported CLM1PT single-point datasets you can NOT generate new - datasets. For supported CLM1PT single-point datasets, you MUST run with the - following settings: --nopointdata And you must NOT set any of these: --soilgrid - --pftgrid --owritesrf - - --nopointdata Do NOT make point data (use data already created) - --owritesrf Overwrite the existing surface datasets if they exist (normally - do NOT recreate them) - --pftgrid Use pft information from global gridded file (rather than site - data) - --soilgrid Use soil information from global gridded file (rather than site - data) - - Main Script Version Id: $Id: PTCLM.py 47576 2013-05-29 19:11:16Z erik $ Scripts URL: $HeadURL: https://svn-ccsm-models.cgd.ucar.edu/PTCLM/trunk_tags/PTCLM1_130529/PTCLM.py $: - -Here we give a simple example of using PTCLMmkdata for a straightforward case of running at the US-UMB Fluxnet site on cheyenne where we already have the meteorology data on the machine. Note, see :ref:`converting-ameriflux-for-ptclmmkdata` for permission information to use this data. - -Example 6-1. Example of running PTCLMmkdata for US-UMB on cheyenne ------------------------------------------------------------------- -:: - - > setenv CSMDATA $CESMDATAROOT/inputdata - > setenv MYDATAFILES `pwd`/mydatafiles - > setenv SITE US-UMB - > setenv MYCASE testPTCLM - - # Next build all of the clm tools you will need - > cd $CTSMROOT/tools/PTCLM - > buildtools - # next run PTCLM (NOTE -- MAKE SURE python IS IN YOUR PATH) - > cd $CTSMROOT/tools/PTCLM - # Here we run it using qcmd so that it will be run on a batch node - > qcmd -- ./PTCLMmkdata --site=$SITE --csmdata=$CSMDATA --mydatadir=$MYDATAFILES >& ptclmrun.log & - > cd $CIMEROOT/scripts - > ./create_newcase --user-mods-dir $MYDATAFILES/1x1pt_$SITE --case $MYCASE --res CLM_USRDAT --compset I1PtClm50SpGs - # Next setup, build and run as normal - > cd $MYCASE - > ./case.setup - -PTCLMmkdata includes a README file that gives some extra details and a simple example. - -.. include:: ../../../../tools/PTCLM/README - :literal: diff --git a/doc/source/users_guide/running-PTCLM/ptclm-examples.rst b/doc/source/users_guide/running-PTCLM/ptclm-examples.rst deleted file mode 100644 index 6801c5f3d8..0000000000 --- a/doc/source/users_guide/running-PTCLM/ptclm-examples.rst +++ /dev/null @@ -1,33 +0,0 @@ -.. include:: ../substitutions.rst - -.. _ptclm-examples: - -============================== - Examples of using PTCLMmkdata -============================== - -Now let's give a few more complex examples using some of the options we have discussed above. - -Now, let's demonstrate using a different group list, doing a spinup, running with Qian global forcing data, but using tower years to set the years to run over. This uses the options: sitegroupname, useQIAN, and QIANtower_years. - -Example: Running PTCLMmkdata without tower years ------------------------------------------------- -:: - - > cd $CTSMROOT/tools/PTCLM - > ./PTCLMmkdata -s US-Ha1 -d $CSMDATA --sitegroupname AmeriFlux --donot_use_tower_yrs - > cd ../../../../../US-Ha1_ICRUCLM45BGC_QIAN - # Now build and run normally - ``` - -Finally, let's demonstrate using a generic machine (which then requires the scratchroot option), using the global grid for PFT and soil types, and setting the run length to two months. - -Example: Running PTCLMmkdata with global PFT and soil types dataset -------------------------------------------------------------------- -:: - - > cd $CTSMROOT/tools/PTCLM - # Note, see the the Section called Converting AmeriFlux Data for use by PTCLMmkdata with permission information - # to use the US-UMB data. - > ./PTCLMmkdata -s US-UMB -d $CSMDATA --pftgrid --soilgrid - > cd ../../../../../US-UMB_ICRUCLM45BGC diff --git a/doc/source/users_guide/running-PTCLM/using-ptclm.rst b/doc/source/users_guide/running-PTCLM/using-ptclm.rst deleted file mode 100644 index e7be79bee6..0000000000 --- a/doc/source/users_guide/running-PTCLM/using-ptclm.rst +++ /dev/null @@ -1,114 +0,0 @@ -.. include:: ../substitutions.rst - -.. _using-ptclm.rst: - -************************** -Using PTCLMmkdata -************************** - -There are two types of options to PTCLMmkdata: required and optional. The three required options are the three settings that MUST be specified for PTCLMmkdata to work at all. The other settings have default values that will default to something useful. Most options use a double dash "--" "longname" such as "--list", but the most common options also have a short-name with a single dash. - -The required options to PTCLMmkdata are: inputdata directory (-d) and site-name (-s). Inputdata directory is the directory where you have the CESM inputdata files. Finally site-name is the name of the site that you want to run for. Site-name is a Fluxnet site name from the list of sites you are running on (see the --sitegroupname for more information about the site lists). - -After PTCLMmkdata is run you can run **create_newcase** to setup a case to use the datasets created. It also creates a ``README.PTCLM`` in that directory that documents the commandline options to PTCLMmkdata that were used to create it. - -After "help" the "list" option is one of the most useful options for getting help on using PTCLMmkdata. This option gives you information about some of the other options to PTCLMmkdata. To get a list of the sites that can be used for PTCLMmkdata use the "--list" option as follows. -:: - - > cd $CTSMROOT/tools/PTCLM - > ./PTCLMmkdata --list - -The output to the above command is as follows: -:: - - /bin/sh: line 1: PTCLMmkdata: command not found - -Steps in running PTCLMmkdata -============================ - -1. Build the CLM tools Next you need to make sure all the CLM FORTRAN tools are built. - :: - - > cd $CTSMROOT/tools/PTCLM - > ./buildtools - > gmake clean - -2. Run PTCLMmkdata Next you actually run PTCLMmkdata which does the different things listed below: - - a. PTCLMmkdata names your output file directory based on your input - :: - - [Prefix_]SiteCode - - Where: - ``Prefix`` is from the caseidprefix option (or blank if not used). - - ``SiteCode`` is the site name you entered with the -s option. - - For example, the casename for the following will be: - :: - - > cd scripts - > ./PTCLMmkdata -s US-UMB -d $MYCSMDATA - - b. PTCLMmkdata creates datasets for you It will populate $MYCSMDATA with new datasets it creates using the CLM tools. - - c. If a transient compset and PTCLMmkdata finds a _dynpftdata.txt file If you are running a transient compset (such as the "I_1850-2000_CN" compset) AND you there is a file in the PTCLM_sitedata directory under the PTCLMmkdata directory called $SITE_dynpftdata.txt it will use this file for the land-use changes. Otherwise it will leave land-use constant, unless you use the pftgrid option so it uses the global dataset for landuse changes. See the Section called Dynamic Land-Use Change Files for use by PTCLMmkdata for more information on this. There is a sample transient dataset called US-Ha1_dynpftdata.txt. Transient compsets, are compsets that create transient land-use change and forcing conditions such as: 'I_1850-2000', 'I_1850-2000_CN', 'I_RCP8.5_CN', 'I_RCP6.0_CN', 'I_RCP4.5_CN', or 'I_RCP2.6_CN'. - - d. PTCLMmkdata creates a pft-physiology for you PTCLMmkdata will create a local copy of the pft-physiology specific for your site that you could then customize with changes specific for that site. - - e. PTCLMmkdata creates a README.PTCLM for you PTCLMmkdata will create a simple text file with the command line for it in a file called README.PTCLM in the case directory it creates for you. - -3. Run create_newcase pointing to the directory created - -4. Customize, setup, build and run case as normal You then customize your case as you would normally. See the Chapter 1 chapter for more information on doing this. - -PTCLMmkdata options -========================= - -Next we discuss the setup and run-time options, dividing them up into setup, initial condition (IC), and run-time options. - -Configure options include: - -- --cesm_root=BASE_CESM -- --sitegroupname=SITEGROUP -- --donot_use_tower_yrs - -``--cesm_root`` - This option is for running PTCLMmkdata with a different root directory to CESM than the version PTCLMmkdata exists in. Normally you do NOT need to use this option. - -``--sitegroupname`` - In the PTCLMmkdata directory there is a subdirectory "PTCLM_sitedata" that contains files with the site, PFT and soil data information for groups of sites. These site groups are all separate ASCII files with the same prefix followed by a "_*data.txt" name. See :ref:`adding-ptclm-site-data` for more information on these files. By default we have provided three different valid group names: - -EXAMPLE -------- -AmeriFlux - -Fluxnet-Canada - -The EXAMPLE is the group used by default and ONLY includes the US-UMB site as that is the only site we have data provided for. The other two site groups include the site information for all of both the AmeriFlux and Fluxnet-Canada sites. You can use the "sitegroupname" option to use one of the other lists, or you can create your own lists using the EXAMPLE file as an example. Your list of sites could be real world locations or could be theoretical "virtual" sites given to exercise CLM on differing biomes for example. Note, see :ref:`converting-ameriflux-for-ptclmmkdata` with permission information to use the US-UMB data. - -``--donot_use_tower_yrs`` - This option is used with the "useQIAN" option to set the years to cycle over for the Qian data. In this case Qian atmospheric forcing will be used, but the simulation will run over the same years that tower site is available for this site. - -**Run-time options include:** - -- --debug - -This option tells PTCLMmkdata to echo what it would do if it were run, but NOT actually run anything. So it will show you the dataset creation commands it would use. It does however, run **create_newcase**, but then it only displays the **xmlchange** commands and changes that it would do. Also note that if you give the "--rmold" option it won't delete the case directory beforehand. Primarily this is intended for debugging the operation of PTCLMmkdata. - -**The dataset generation options are:** - -- --pftgrid -- --soilgrid - -The options that with a "grid" suffix all mean to create datasets using the global gridded information rather than using the site specific point data. By default the site specific point data is used. The "nopointdata" and "owritesrfaer" options have to do with file creation. - -Because supported single-point datasets already have the data created for them, you MUST use the "nopointdata" and "ndepgrid" options when you are using a supported single-point site. You must use "ndepgrid" even for a compset without CN. You also can NOT use the options: "soilgrid", "pftgrid", "aerdepgrid", or "owritesrfaer". - -``--pftgrid`` - This option says to use the PFT values provided on the global dataset rather than using the specific site based values from the PTCLM_sitedata/\*_pftdata.txt file when creating the surface dataset. This option must NOT be used when you you are using a site that is a supported single point dataset. - -``--soilgrid`` - This option says to use the soil values provided on the global dataset rather than using the specific site based values from the PTCLM_sitedata/\*_soildata.txt file when creating the surface dataset. This option must NOT be used when you you are using a site that is a supported single point dataset. - diff --git a/doc/source/users_guide/running-single-points/single-point-and-regional-grid-configurations.rst b/doc/source/users_guide/running-single-points/single-point-and-regional-grid-configurations.rst index 34a199ebe8..ab7e923669 100644 --- a/doc/source/users_guide/running-single-points/single-point-and-regional-grid-configurations.rst +++ b/doc/source/users_guide/running-single-points/single-point-and-regional-grid-configurations.rst @@ -8,7 +8,7 @@ Single and Regional Grid Configurations CLM allows you to set up and run cases with a single-point or a local region as well as global resolutions. This is often useful for running quick cases for testing, evaluating specific vegetation types, or land-units, or running with observed data for a specific site. -There are three different ways to do this for normal-supported site +There are two different ways to do this for normal-supported site ``PTS_MODE`` runs for a single point using global datasets. @@ -16,11 +16,6 @@ There are three different ways to do this for normal-supported site ``CLM_USRDAT_NAME`` runs using your own datasets (single-point or regional). -``PTCLMmkdata`` - easily setup simulations to run for tower sites.. - -.. note:: ``PTS_MODE`` and ``PTCLMmkdata`` only works for a single point, while the other two options can also work for regional datasets as well. - .. _options-for-single-points: ========================================= @@ -33,7 +28,5 @@ In general :ref:`pts_mode` is the quick and dirty method that gets you started w Next, ``CLM_USRDAT_NAME`` is the best way to setup cases quickly where you have to create your own datasets (see :ref:`running-single-point-datasets`). With this method you don't have to change DATM or add files to the XML database -- but you have to follow a strict naming convention for files. However, once the files are named and in the proper location, you can easily setup new cases that use these datasets. This is good for treating all the required datasets as a "group" and for a particular model version. For advanced CLM developers who need to track dataset changes with different model versions you would be best off adding these datasets as supported datasets with the "normal supported datasets" method. -Lastly *PTCLMmkdata* is a great way to easily create datasets, setup simulations and run simulations for tower sites. It takes advantage of both normal supported site functionality and CLM_USRDAT_NAME internally. A big advantage to it, is that it's one-stop shopping, it runs tools to create datasets, and runs **create_newcase** and sets the appropriate env variables for you. So you only have to learn how to run one tool, rather than work with many different ones. PTCLMmkdata is described in the next chapter, :ref:`running-PTCLM`. - -Finally, if you also have meteorology data that you want to force your CLM simulations with you'll need to setup cases as described in :ref:`creating-your-own-singlepoint-dataset`. You'll need to create CLM datasets either according to ``CLM_USRDAT_NAME``. You may also need to modify DATM to use your forcing data. And you'll need to change your forcing data to be in a format that DATM can use. :ref:`converting-ameriflux-for-ptclmmkdata` tells you how to use AmeriFlux data for atmospheric forcing. +Finally, if you also have meteorology data that you want to force your CLM simulations with you'll need to setup cases as described in :ref:`creating-your-own-singlepoint-dataset`. You'll need to create CLM datasets either according to ``CLM_USRDAT_NAME``. You may also need to modify DATM to use your forcing data. And you'll need to change your forcing data to be in a format that DATM can use. diff --git a/doc/source/users_guide/testing/testing.rst b/doc/source/users_guide/testing/testing.rst index 69ca1f7263..ec959d4b82 100644 --- a/doc/source/users_guide/testing/testing.rst +++ b/doc/source/users_guide/testing/testing.rst @@ -36,14 +36,3 @@ If something went wrong, you can find the failing tests like so: :: > grep -E "^[0-9]+/[0-9]+ < [a-zA-Z]+" namelist_test.log | grep -v "PASS" - -Testing PTCLM -============= - -.. include:: ../../../../tools/PTCLM/README - :literal: - -To run on cheyenne, you do the following: - -.. include:: ../../../../tools/PTCLM/test/README.run_cheyenne - :literal: diff --git a/doc/source/users_guide/using-clm-tools/observational-sites-datasets.rst b/doc/source/users_guide/using-clm-tools/observational-sites-datasets.rst index 50a7969281..05fe461db2 100644 --- a/doc/source/users_guide/using-clm-tools/observational-sites-datasets.rst +++ b/doc/source/users_guide/using-clm-tools/observational-sites-datasets.rst @@ -6,6 +6,6 @@ Observational Sites Datasets ******************************* -There are two ways to customize datasets for a particular observational site. The first is to customize the input to the tools that create the dataset, and the second is to overwrite the default data after you've created a given dataset. Depending on the tool it might be easier to do it one way or the other. In Table :numref:`reqd-files-table` we list the files that are most likely to be customized and the way they might be customized. Of those files, the ones you are most likely to customize are: ``fatmlndfrc``, ``fsurdat``, ``faerdep`` (for DATM), and ``stream_fldfilename_ndep``. Note ``mksurfdata_esmf`` as documented previously has options to overwrite the vegetation and soil types. For more information on this also see :ref:`creating-your-own-singlepoint-dataset`. ``PTCLM`` uses these methods to customize datasets; see Chapter :numref:`running-PTCLM`. +There are two ways to customize datasets for a particular observational site. The first is to customize the input to the tools that create the dataset, and the second is to overwrite the default data after you've created a given dataset. Depending on the tool it might be easier to do it one way or the other. In Table :numref:`reqd-files-table` we list the files that are most likely to be customized and the way they might be customized. Of those files, the ones you are most likely to customize are: ``fatmlndfrc``, ``fsurdat``, ``faerdep`` (for DATM), and ``stream_fldfilename_ndep``. Note ``mksurfdata_esmf`` as documented previously has options to overwrite the vegetation and soil types. For more information on this also see :ref:`creating-your-own-singlepoint-dataset`. -Another aspect of customizing your input datasets is customizing the input atmospheric forcing datasets; see :ref:`creating-your-own-singlepoint-dataset` for more information on this. :ref:`converting-ameriflux-for-ptclmmkdata` has information on using the AmeriFlux tower site data as atmospheric forcing. +Another aspect of customizing your input datasets is customizing the input atmospheric forcing datasets; see :ref:`creating-your-own-singlepoint-dataset` for more information on this. From c26ac543735047be12592e6b683e845563eca78d Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Tue, 17 Sep 2024 17:06:27 -0600 Subject: [PATCH 1068/1248] Use double-backticks instead of double-hyphens in one instance. --- doc/source/users_guide/trouble-shooting/trouble-shooting.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/source/users_guide/trouble-shooting/trouble-shooting.rst b/doc/source/users_guide/trouble-shooting/trouble-shooting.rst index e139796f71..93798c3c57 100644 --- a/doc/source/users_guide/trouble-shooting/trouble-shooting.rst +++ b/doc/source/users_guide/trouble-shooting/trouble-shooting.rst @@ -152,7 +152,7 @@ Here are some other suggestions on how to track down a problem encountered while Run with a smaller set of processors ------------------------------------ -One way to simplify the system is to run with a smaller set of processors. You will need to clean the setup and edit the --env_mach_pes.xml--. For example, to run with four processors: +One way to simplify the system is to run with a smaller set of processors. You will need to clean the setup and edit ``env_mach_pes.xml``. For example, to run with four processors: :: > ./case.setup -clean From fbce6564046b2f72352d3078a7704ec9d38f6fc0 Mon Sep 17 00:00:00 2001 From: Keith Oleson Date: Tue, 17 Sep 2024 11:10:07 -0600 Subject: [PATCH 1069/1248] Fix comments on urban thermal variables --- src/biogeophys/SoilTemperatureMod.F90 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/biogeophys/SoilTemperatureMod.F90 b/src/biogeophys/SoilTemperatureMod.F90 index 0dc8876d24..d6c9660b96 100644 --- a/src/biogeophys/SoilTemperatureMod.F90 +++ b/src/biogeophys/SoilTemperatureMod.F90 @@ -671,9 +671,9 @@ subroutine SoilThermProp (bounds, num_urbanc, filter_urbanc, num_nolakec, filter tk_wall => urbanparams_inst%tk_wall , & ! Input: [real(r8) (:,:) ] thermal conductivity of urban wall tk_roof => urbanparams_inst%tk_roof , & ! Input: [real(r8) (:,:) ] thermal conductivity of urban roof tk_improad => urbanparams_inst%tk_improad , & ! Input: [real(r8) (:,:) ] thermal conductivity of urban impervious road - cv_wall => urbanparams_inst%cv_wall , & ! Input: [real(r8) (:,:) ] thermal conductivity of urban wall - cv_roof => urbanparams_inst%cv_roof , & ! Input: [real(r8) (:,:) ] thermal conductivity of urban roof - cv_improad => urbanparams_inst%cv_improad , & ! Input: [real(r8) (:,:) ] thermal conductivity of urban impervious road + cv_wall => urbanparams_inst%cv_wall , & ! Input: [real(r8) (:,:) ] heat capacity of urban wall + cv_roof => urbanparams_inst%cv_roof , & ! Input: [real(r8) (:,:) ] heat capacity of urban roof + cv_improad => urbanparams_inst%cv_improad , & ! Input: [real(r8) (:,:) ] heat capacity of urban impervious road t_soisno => temperature_inst%t_soisno_col , & ! Input: [real(r8) (:,:) ] soil temperature [K] From f25a251e58f06bc39484c4687f9daeeef14ba1c1 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Fri, 22 Mar 2024 11:24:28 -0600 Subject: [PATCH 1070/1248] Fix two hillslope error messages. --- src/biogeophys/HillslopeHydrologyMod.F90 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/biogeophys/HillslopeHydrologyMod.F90 b/src/biogeophys/HillslopeHydrologyMod.F90 index b2866df679..1fed9b28bb 100644 --- a/src/biogeophys/HillslopeHydrologyMod.F90 +++ b/src/biogeophys/HillslopeHydrologyMod.F90 @@ -335,7 +335,7 @@ subroutine InitHillslope(bounds,fsurdat) enddo call ncd_io(ncid=ncid, varname='hillslope_distance', flag='read', data=fhillslope_in, dim1name=grlnd, readvar=readvar) if (masterproc .and. .not. readvar) then - call endrun( 'ERROR:: hillslope_length not found on surface data set.'//errmsg(sourcefile, __LINE__) ) + call endrun( 'ERROR:: hillslope_distance not found on surface data set.'//errmsg(sourcefile, __LINE__) ) end if do l = bounds%begl,bounds%endl @@ -354,7 +354,7 @@ subroutine InitHillslope(bounds,fsurdat) call ncd_io(ncid=ncid, varname='hillslope_elevation', flag='read', data=fhillslope_in, dim1name=grlnd, readvar=readvar) if (masterproc .and. .not. readvar) then - call endrun( 'ERROR:: hillslope_height not found on surface data set.'//errmsg(sourcefile, __LINE__) ) + call endrun( 'ERROR:: hillslope_elevation not found on surface data set.'//errmsg(sourcefile, __LINE__) ) end if do l = bounds%begl,bounds%endl g = lun%gridcell(l) From b6dd9f986a212c142a609e04986e6978f901136c Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Fri, 22 Mar 2024 12:12:58 -0600 Subject: [PATCH 1071/1248] Move hillslope variables from fsurdat to hillslope_file. --- bld/CLMBuildNamelist.pm | 4 ++ .../namelist_definition_ctsm.xml | 5 ++ .../testmods_dirs/clm/Hillslope/user_nl_clm | 2 +- src/biogeophys/HillslopeHydrologyMod.F90 | 52 +++++++++---------- src/main/clm_initializeMod.F90 | 8 +-- src/main/clm_instMod.F90 | 4 +- src/main/clm_varctl.F90 | 1 + src/main/controlMod.F90 | 8 ++- src/main/histFileMod.F90 | 3 ++ src/main/restFileMod.F90 | 2 + src/main/surfrdMod.F90 | 26 +++++++--- 11 files changed, 74 insertions(+), 41 deletions(-) diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index 86b9943f34..dc89e932ca 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -3624,6 +3624,10 @@ sub setup_logic_hillslope { if ( (! &value_is_true($use_hillslope)) && &value_is_true($use_hillslope_routing) ) { $log->fatal_error("Cannot turn on use_hillslope_routing when use_hillslope is off\n" ); } + my $hillslope_file = $nl->get_value('hillslope_file'); + if ( &value_is_true($use_hillslope) && ( ! defined($hillslope_file) ) ) { + $log->fatal_error("You must provide hillslope_file if use_hillslope is .true.\n" ); + } } #------------------------------------------------------------------------------- diff --git a/bld/namelist_files/namelist_definition_ctsm.xml b/bld/namelist_files/namelist_definition_ctsm.xml index d2347121c1..d8cb2586cd 100644 --- a/bld/namelist_files/namelist_definition_ctsm.xml +++ b/bld/namelist_files/namelist_definition_ctsm.xml @@ -946,6 +946,11 @@ Full pathname datafile with fates parameters Full pathname of surface data file. + +Full pathname of hillslope data file. + + SNICAR (SNow, ICe, and Aerosol Radiative model) optical data file name diff --git a/cime_config/testdefs/testmods_dirs/clm/Hillslope/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/Hillslope/user_nl_clm index 4fc6fc2373..c750400672 100644 --- a/cime_config/testdefs/testmods_dirs/clm/Hillslope/user_nl_clm +++ b/cime_config/testdefs/testmods_dirs/clm/Hillslope/user_nl_clm @@ -6,6 +6,6 @@ hillslope_transmissivity_method = 'LayerSum' hillslope_pft_distribution_method = 'PftLowlandUpland' hillslope_soil_profile_method = 'Uniform' -fsurdat = '$DIN_LOC_ROOT/lnd/clm2/testdata/surfdata_10x15_hist_2000_78pfts_c240216.synthetic_hillslopes.nc' +hillslope_file = '$DIN_LOC_ROOT/lnd/clm2/testdata/synthetic_cosphill_1.3.nc' use_ssre = .false. diff --git a/src/biogeophys/HillslopeHydrologyMod.F90 b/src/biogeophys/HillslopeHydrologyMod.F90 index 1fed9b28bb..8fccd762f0 100644 --- a/src/biogeophys/HillslopeHydrologyMod.F90 +++ b/src/biogeophys/HillslopeHydrologyMod.F90 @@ -168,7 +168,7 @@ end subroutine check_aquifer_layer !----------------------------------------------------------------------- - subroutine InitHillslope(bounds,fsurdat) + subroutine InitHillslope(bounds, hillslope_file) ! ! !DESCRIPTION: ! Initialize hillslope geomorphology from input dataset @@ -187,7 +187,7 @@ subroutine InitHillslope(bounds,fsurdat) ! ! !ARGUMENTS: type(bounds_type), intent(in) :: bounds - character(len=*) , intent(in) :: fsurdat ! surface data file name + character(len=*) , intent(in) :: hillslope_file ! hillslope data file name integer, pointer :: ihillslope_in(:,:) ! read in - integer integer, pointer :: ncolumns_hillslope_in(:) ! read in number of columns integer, allocatable :: ncolumns_hillslope(:) ! number of hillslope columns @@ -224,9 +224,9 @@ subroutine InitHillslope(bounds,fsurdat) ! consistency check call check_aquifer_layer() - ! Open surface dataset to read in data below + ! Open hillslope dataset to read in data below - call getfil (fsurdat, locfn, 0) + call getfil (hillslope_file, locfn, 0) call ncd_pio_openfile (ncid, locfn, 0) allocate( & @@ -248,7 +248,7 @@ subroutine InitHillslope(bounds,fsurdat) call ncd_io(ncid=ncid, varname='nhillcolumns', flag='read', data=ncolumns_hillslope_in, dim1name=grlnd, readvar=readvar) if (masterproc .and. .not. readvar) then - call endrun( 'ERROR:: nhillcolumns not found on surface data set.'//errmsg(sourcefile, __LINE__) ) + call endrun( 'ERROR:: nhillcolumns not found on hillslope data set.'//errmsg(sourcefile, __LINE__) ) end if do l = bounds%begl,bounds%endl g = lun%gridcell(l) @@ -266,7 +266,7 @@ subroutine InitHillslope(bounds,fsurdat) call ncd_io(ncid=ncid, varname='pct_hillslope', flag='read', data=fhillslope_in, dim1name=grlnd, readvar=readvar) if (masterproc .and. .not. readvar) then - call endrun( 'ERROR:: pct_hillslope not found on surface data set.'//errmsg(sourcefile, __LINE__) ) + call endrun( 'ERROR:: pct_hillslope not found on hillslope data set.'//errmsg(sourcefile, __LINE__) ) end if do l = bounds%begl,bounds%endl g = lun%gridcell(l) @@ -278,7 +278,7 @@ subroutine InitHillslope(bounds,fsurdat) call ncd_io(ncid=ncid, varname='hillslope_index', flag='read', data=ihillslope_in, dim1name=grlnd, readvar=readvar) if (masterproc .and. .not. readvar) then - call endrun( 'ERROR:: hillslope_index not found on surface data set.'//errmsg(sourcefile, __LINE__) ) + call endrun( 'ERROR:: hillslope_index not found on hillslope data set.'//errmsg(sourcefile, __LINE__) ) end if do l = bounds%begl,bounds%endl g = lun%gridcell(l) @@ -287,7 +287,7 @@ subroutine InitHillslope(bounds,fsurdat) call ncd_io(ncid=ncid, varname='column_index', flag='read', data=ihillslope_in, dim1name=grlnd, readvar=readvar) if (masterproc .and. .not. readvar) then - call endrun( 'ERROR:: column_index not found on surface data set.'//errmsg(sourcefile, __LINE__) ) + call endrun( 'ERROR:: column_index not found on hillslope data set.'//errmsg(sourcefile, __LINE__) ) end if do l = bounds%begl,bounds%endl g = lun%gridcell(l) @@ -296,7 +296,7 @@ subroutine InitHillslope(bounds,fsurdat) call ncd_io(ncid=ncid, varname='downhill_column_index', flag='read', data=ihillslope_in, dim1name=grlnd, readvar=readvar) if (masterproc .and. .not. readvar) then - call endrun( 'ERROR:: downhill_column_index not found on surface data set.'//errmsg(sourcefile, __LINE__) ) + call endrun( 'ERROR:: downhill_column_index not found on hillslope data set.'//errmsg(sourcefile, __LINE__) ) end if do l = bounds%begl,bounds%endl g = lun%gridcell(l) @@ -307,7 +307,7 @@ subroutine InitHillslope(bounds,fsurdat) allocate(fhillslope_in(bounds%begg:bounds%endg,max_columns_hillslope)) call ncd_io(ncid=ncid, varname='hillslope_slope', flag='read', data=fhillslope_in, dim1name=grlnd, readvar=readvar) if (masterproc .and. .not. readvar) then - call endrun( 'ERROR:: hillslope_slope not found on surface data set.'//errmsg(sourcefile, __LINE__) ) + call endrun( 'ERROR:: hillslope_slope not found on hillslope data set.'//errmsg(sourcefile, __LINE__) ) end if do l = bounds%begl,bounds%endl @@ -317,7 +317,7 @@ subroutine InitHillslope(bounds,fsurdat) call ncd_io(ncid=ncid, varname='hillslope_aspect', flag='read', data=fhillslope_in, dim1name=grlnd, readvar=readvar) if (masterproc .and. .not. readvar) then - call endrun( 'ERROR:: hillslope_aspect not found on surface data set.'//errmsg(sourcefile, __LINE__) ) + call endrun( 'ERROR:: hillslope_aspect not found on hillslope data set.'//errmsg(sourcefile, __LINE__) ) end if do l = bounds%begl,bounds%endl @@ -327,7 +327,7 @@ subroutine InitHillslope(bounds,fsurdat) call ncd_io(ncid=ncid, varname='hillslope_area', flag='read', data=fhillslope_in, dim1name=grlnd, readvar=readvar) if (masterproc .and. .not. readvar) then - call endrun( 'ERROR:: hillslope_area not found on surface data set.'//errmsg(sourcefile, __LINE__) ) + call endrun( 'ERROR:: hillslope_area not found on hillslope data set.'//errmsg(sourcefile, __LINE__) ) end if do l = bounds%begl,bounds%endl g = lun%gridcell(l) @@ -335,7 +335,7 @@ subroutine InitHillslope(bounds,fsurdat) enddo call ncd_io(ncid=ncid, varname='hillslope_distance', flag='read', data=fhillslope_in, dim1name=grlnd, readvar=readvar) if (masterproc .and. .not. readvar) then - call endrun( 'ERROR:: hillslope_distance not found on surface data set.'//errmsg(sourcefile, __LINE__) ) + call endrun( 'ERROR:: hillslope_distance not found on hillslope data set.'//errmsg(sourcefile, __LINE__) ) end if do l = bounds%begl,bounds%endl @@ -345,7 +345,7 @@ subroutine InitHillslope(bounds,fsurdat) call ncd_io(ncid=ncid, varname='hillslope_width', flag='read', data=fhillslope_in, dim1name=grlnd, readvar=readvar) if (masterproc .and. .not. readvar) then - call endrun( 'ERROR:: hillslope_width not found on surface data set.'//errmsg(sourcefile, __LINE__) ) + call endrun( 'ERROR:: hillslope_width not found on hillslope data set.'//errmsg(sourcefile, __LINE__) ) end if do l = bounds%begl,bounds%endl g = lun%gridcell(l) @@ -354,7 +354,7 @@ subroutine InitHillslope(bounds,fsurdat) call ncd_io(ncid=ncid, varname='hillslope_elevation', flag='read', data=fhillslope_in, dim1name=grlnd, readvar=readvar) if (masterproc .and. .not. readvar) then - call endrun( 'ERROR:: hillslope_elevation not found on surface data set.'//errmsg(sourcefile, __LINE__) ) + call endrun( 'ERROR:: hillslope_elevation not found on hillslope data set.'//errmsg(sourcefile, __LINE__) ) end if do l = bounds%begl,bounds%endl g = lun%gridcell(l) @@ -380,7 +380,7 @@ subroutine InitHillslope(bounds,fsurdat) call ncd_io(ncid=ncid, varname='hillslope_stream_depth', flag='read', data=fstream_in, dim1name=grlnd, readvar=readvar) if (masterproc .and. .not. readvar) then - call endrun( 'ERROR:: hillslope_stream_depth not found on surface data set.'//errmsg(sourcefile, __LINE__) ) + call endrun( 'ERROR:: hillslope_stream_depth not found on hillslope data set.'//errmsg(sourcefile, __LINE__) ) end if do l = bounds%begl,bounds%endl g = lun%gridcell(l) @@ -389,7 +389,7 @@ subroutine InitHillslope(bounds,fsurdat) call ncd_io(ncid=ncid, varname='hillslope_stream_width', flag='read', data=fstream_in, dim1name=grlnd, readvar=readvar) if (masterproc .and. .not. readvar) then - call endrun( 'ERROR:: hillslope_stream_width not found on surface data set.'//errmsg(sourcefile, __LINE__) ) + call endrun( 'ERROR:: hillslope_stream_width not found on hillslope data set.'//errmsg(sourcefile, __LINE__) ) end if do l = bounds%begl,bounds%endl g = lun%gridcell(l) @@ -398,7 +398,7 @@ subroutine InitHillslope(bounds,fsurdat) call ncd_io(ncid=ncid, varname='hillslope_stream_slope', flag='read', data=fstream_in, dim1name=grlnd, readvar=readvar) if (masterproc .and. .not. readvar) then - call endrun( 'ERROR:: hillslope_stream_slope not found on surface data set.'//errmsg(sourcefile, __LINE__) ) + call endrun( 'ERROR:: hillslope_stream_slope not found on hillslope data set.'//errmsg(sourcefile, __LINE__) ) end if do l = bounds%begl,bounds%endl g = lun%gridcell(l) @@ -504,11 +504,11 @@ subroutine InitHillslope(bounds,fsurdat) enddo end if - ! if missing hillslope information on surface dataset, + ! if missing hillslope information on dataset, ! call endrun if (ncolumns_hillslope(l) > 0 .and. sum(hillslope_area) == 0._r8 .and. masterproc) then write(iulog,*) 'Problem with input data: nhillcolumns is non-zero, but hillslope area is zero' - write(iulog,*) 'Check surface data for gridcell at (lon/lat): ', grc%londeg(g),grc%latdeg(g) + write(iulog,*) 'Check hillslope data for gridcell at (lon/lat): ', grc%londeg(g),grc%latdeg(g) call endrun( 'ERROR:: sum of hillslope areas is zero.'//errmsg(sourcefile, __LINE__) ) end if @@ -559,7 +559,7 @@ end subroutine InitHillslope !----------------------------------------------------------------------- - subroutine SetHillslopeSoilThickness(bounds,fsurdat,soil_depth_lowland_in,soil_depth_upland_in) + subroutine SetHillslopeSoilThickness(bounds, hillslope_file, soil_depth_lowland_in, soil_depth_upland_in) ! ! !DESCRIPTION: ! Set hillslope column nbedrock values @@ -578,7 +578,7 @@ subroutine SetHillslopeSoilThickness(bounds,fsurdat,soil_depth_lowland_in,soil_d ! ! !ARGUMENTS: type(bounds_type), intent(in) :: bounds - character(len=*) , intent(in) :: fsurdat ! surface data file name + character(len=*) , intent(in) :: hillslope_file ! hillslope data file name real(r8), intent(in), optional :: soil_depth_lowland_in real(r8), intent(in), optional :: soil_depth_upland_in real(r8), pointer :: fhillslope_in(:,:) ! read in - float @@ -599,14 +599,14 @@ subroutine SetHillslopeSoilThickness(bounds,fsurdat,soil_depth_lowland_in,soil_d if (soil_profile_method==soil_profile_from_file) then - ! Open surface dataset to read in data below - call getfil (fsurdat, locfn, 0) + ! Open hillslope dataset to read in data below + call getfil (hillslope_file, locfn, 0) call ncd_pio_openfile (ncid, locfn, 0) allocate(fhillslope_in(bounds%begg:bounds%endg,max_columns_hillslope)) call ncd_io(ncid=ncid, varname='hillslope_bedrock_depth', flag='read', data=fhillslope_in, dim1name=grlnd, readvar=readvar) if (masterproc .and. .not. readvar) then - call endrun( 'ERROR:: soil_profile_method = "FromFile", but hillslope_bedrock not found on surface data set.'//errmsg(sourcefile, __LINE__) ) + call endrun( 'ERROR:: soil_profile_method = "FromFile", but hillslope_bedrock not found on hillslope data set.'//errmsg(sourcefile, __LINE__) ) end if do l = bounds%begl,bounds%endl g = lun%gridcell(l) @@ -896,7 +896,7 @@ end subroutine HillslopeDominantLowlandPft subroutine HillslopePftFromFile(bounds,col_pftndx) ! ! !DESCRIPTION: - ! Reassign patch type using indices from surface data file + ! Reassign patch type using indices from data file ! Assumes one patch per hillslope column ! In preparation for this reassignment of patch type, only the ! first patch was given a non-zero weight in surfrd_hillslope. diff --git a/src/main/clm_initializeMod.F90 b/src/main/clm_initializeMod.F90 index 340a799908..e827419aba 100644 --- a/src/main/clm_initializeMod.F90 +++ b/src/main/clm_initializeMod.F90 @@ -135,8 +135,8 @@ subroutine initialize2(ni,nj) use clm_varpar , only : surfpft_lb, surfpft_ub use clm_varpar , only : nlevsno use clm_varpar , only : natpft_size,cft_size - use clm_varctl , only : fsurdat - use clm_varctl , only : finidat, finidat_interp_source, finidat_interp_dest, fsurdat + use clm_varctl , only : fsurdat, hillslope_file + use clm_varctl , only : finidat, finidat_interp_source, finidat_interp_dest use clm_varctl , only : use_cn, use_fates, use_fates_luh use clm_varctl , only : use_crop, ndep_from_cpl, fates_spitfire_mode use clm_varctl , only : use_hillslope @@ -253,7 +253,7 @@ subroutine initialize2(ni,nj) call pftcon%Init() ! Read surface dataset and set up subgrid weight arrays - call surfrd_get_data(begg, endg, ldomain, fsurdat, actual_numcft) + call surfrd_get_data(begg, endg, ldomain, fsurdat, hillslope_file, actual_numcft) if(use_fates) then @@ -304,7 +304,7 @@ subroutine initialize2(ni,nj) if (use_hillslope) then ! Initialize hillslope properties - call InitHillslope(bounds_proc, fsurdat) + call InitHillslope(bounds_proc, hillslope_file) endif ! Set filters diff --git a/src/main/clm_instMod.F90 b/src/main/clm_instMod.F90 index ae83a1b31f..210cff2c2e 100644 --- a/src/main/clm_instMod.F90 +++ b/src/main/clm_instMod.F90 @@ -188,7 +188,7 @@ subroutine clm_instInit(bounds) ! ! !USES: use clm_varpar , only : nlevsno - use controlMod , only : nlfilename, fsurdat + use controlMod , only : nlfilename, fsurdat, hillslope_file use domainMod , only : ldomain use SoilBiogeochemDecompCascadeMIMICSMod, only : init_decompcascade_mimics use SoilBiogeochemDecompCascadeBGCMod , only : init_decompcascade_bgc @@ -280,7 +280,7 @@ subroutine clm_instInit(bounds) ! Set hillslope column bedrock values if (use_hillslope) then - call SetHillslopeSoilThickness(bounds,fsurdat, & + call SetHillslopeSoilThickness(bounds, hillslope_file, & soil_depth_lowland_in=8.5_r8,& soil_depth_upland_in =2.0_r8) call setSoilLayerClass(bounds) diff --git a/src/main/clm_varctl.F90 b/src/main/clm_varctl.F90 index cb7e2e3931..5fa2602e5a 100644 --- a/src/main/clm_varctl.F90 +++ b/src/main/clm_varctl.F90 @@ -109,6 +109,7 @@ module clm_varctl character(len=fname_len), public :: finidat = ' ' ! initial conditions file name character(len=fname_len), public :: fsurdat = ' ' ! surface data file name + character(len=fname_len), public :: hillslope_file = ' ' ! hillslope data file name character(len=fname_len), public :: paramfile = ' ' ! ASCII data file with PFT physiological constants character(len=fname_len), public :: nrevsn = ' ' ! restart data file name for branch run character(len=fname_len), public :: fsnowoptics = ' ' ! snow optical properties file name diff --git a/src/main/controlMod.F90 b/src/main/controlMod.F90 index f65c8c7f47..eedb678ca3 100644 --- a/src/main/controlMod.F90 +++ b/src/main/controlMod.F90 @@ -148,7 +148,7 @@ subroutine control_init(dtime) ! Input datasets namelist /clm_inparm/ & - fsurdat, & + fsurdat, hillslope_file, & paramfile, fsnowoptics, fsnowaging ! History, restart options @@ -736,6 +736,7 @@ subroutine control_spmd() call mpi_bcast (finidat_interp_source, len(finidat_interp_source), MPI_CHARACTER, 0, mpicom, ier) call mpi_bcast (finidat_interp_dest, len(finidat_interp_dest), MPI_CHARACTER, 0, mpicom, ier) call mpi_bcast (fsurdat, len(fsurdat), MPI_CHARACTER, 0, mpicom, ier) + call mpi_bcast (hillslope_file, len(hillslope_file), MPI_CHARACTER, 0, mpicom, ier) call mpi_bcast (fatmlndfrc,len(fatmlndfrc),MPI_CHARACTER, 0, mpicom, ier) call mpi_bcast (paramfile, len(paramfile) , MPI_CHARACTER, 0, mpicom, ier) call mpi_bcast (fsnowoptics, len(fsnowoptics), MPI_CHARACTER, 0, mpicom, ier) @@ -1021,6 +1022,11 @@ subroutine control_print () else write(iulog,*) ' surface data = ',trim(fsurdat) end if + if (hillslope_file == ' ') then + write(iulog,*) ' hillslope_file, hillslope dataset not set' + else + write(iulog,*) ' hillslope data = ',trim(hillslope_file) + end if if (fatmlndfrc == ' ') then write(iulog,*) ' fatmlndfrc not set, setting frac/mask to 1' else diff --git a/src/main/histFileMod.F90 b/src/main/histFileMod.F90 index 8ae4ace7e3..b2df9abfab 100644 --- a/src/main/histFileMod.F90 +++ b/src/main/histFileMod.F90 @@ -2328,6 +2328,7 @@ subroutine htape_create (t, histrest) use clm_varpar , only : natpft_size, cft_size, maxpatch_glc, nlevdecomp_full, mxsowings, mxharvests use landunit_varcon , only : max_lunit use clm_varctl , only : caseid, ctitle, fsurdat, finidat, paramfile + use clm_varctl , only : hillslope_file use clm_varctl , only : version, hostname, username, conventions, source use clm_varctl , only : use_hillslope,nhillslope,max_columns_hillslope use domainMod , only : ldomain @@ -2428,6 +2429,8 @@ subroutine htape_create (t, histrest) call ncd_putatt(lnfid, ncd_global, 'case_id', trim(caseid)) str = get_filename(fsurdat) call ncd_putatt(lnfid, ncd_global, 'Surface_dataset', trim(str)) + str = get_filename(hillslope_file) + call ncd_putatt(lnfid, ncd_global, 'Hillslope_dataset', trim(str)) if (finidat == ' ') then str = 'arbitrary initialization' else diff --git a/src/main/restFileMod.F90 b/src/main/restFileMod.F90 index 6a574406fd..c7dbf0da72 100644 --- a/src/main/restFileMod.F90 +++ b/src/main/restFileMod.F90 @@ -503,6 +503,7 @@ subroutine restFile_dimset( ncid ) ! !USES: use clm_time_manager , only : get_nstep use clm_varctl , only : caseid, ctitle, version, username, hostname, fsurdat + use clm_varctl , only : hillslope_file use clm_varctl , only : conventions, source use dynSubgridControlMod , only : get_flanduse_timeseries use clm_varpar , only : numrad, nlevlak, nlevsno, nlevgrnd, nlevmaxurbgrnd, nlevcan @@ -569,6 +570,7 @@ subroutine restFile_dimset( ncid ) call ncd_putatt(ncid, NCD_GLOBAL, 'case_title' , trim(ctitle)) call ncd_putatt(ncid, NCD_GLOBAL, 'case_id' , trim(caseid)) call ncd_putatt(ncid, NCD_GLOBAL, 'surface_dataset', trim(fsurdat)) + call ncd_putatt(ncid, NCD_GLOBAL, 'hillslope_dataset', trim(hillslope_file)) call ncd_putatt(ncid, NCD_GLOBAL, 'flanduse_timeseries', trim(get_flanduse_timeseries())) call ncd_putatt(ncid, NCD_GLOBAL, 'title', 'CLM Restart information') diff --git a/src/main/surfrdMod.F90 b/src/main/surfrdMod.F90 index 12212e2160..88a4dbd30b 100644 --- a/src/main/surfrdMod.F90 +++ b/src/main/surfrdMod.F90 @@ -46,7 +46,7 @@ module surfrdMod contains !----------------------------------------------------------------------- - subroutine surfrd_get_data (begg, endg, ldomain, lfsurdat, actual_numcft) + subroutine surfrd_get_data (begg, endg, ldomain, lfsurdat, lhillslope_file, actual_numcft) ! ! !DESCRIPTION: ! Read the surface dataset and create subgrid weights. @@ -73,7 +73,8 @@ subroutine surfrd_get_data (begg, endg, ldomain, lfsurdat, actual_numcft) use clm_varctl , only : create_crop_landunit, convert_ocean_to_land, collapse_urban, & toosmall_soil, toosmall_crop, toosmall_glacier, & toosmall_lake, toosmall_wetland, toosmall_urban, & - n_dom_landunits + n_dom_landunits, & + use_hillslope use fileutils , only : getfil use domainMod , only : domain_type, domain_init, domain_clean use clm_instur , only : wt_lunit, topo_glc_mec, pct_urban_max @@ -87,6 +88,7 @@ subroutine surfrd_get_data (begg, endg, ldomain, lfsurdat, actual_numcft) integer, intent(in) :: begg, endg, actual_numcft type(domain_type),intent(in) :: ldomain ! land domain character(len=*), intent(in) :: lfsurdat ! surface dataset filename + character(len=*), intent(in) :: lhillslope_file ! hillslope dataset filename ! ! !LOCAL VARIABLES: type(domain_type) :: surfdata_domain ! local domain associated with surface dataset @@ -97,7 +99,8 @@ subroutine surfrd_get_data (begg, endg, ldomain, lfsurdat, actual_numcft) character(len=16) :: lon_var, lat_var ! names of lat/lon on dataset logical :: readvar ! true => variable is on dataset real(r8) :: rmaxlon,rmaxlat ! local min/max vars - type(file_desc_t) :: ncid ! netcdf id + type(file_desc_t) :: ncid ! netcdf id for lfsurdat + type(file_desc_t) :: ncid_hillslope ! netcdf id for lhillslope_file logical :: istype_domain ! true => input file is of type domain logical :: isgrid2d ! true => intut grid is 2d @@ -110,6 +113,10 @@ subroutine surfrd_get_data (begg, endg, ldomain, lfsurdat, actual_numcft) write(iulog,*)'lfsurdat must be specified' call endrun(msg=errMsg(sourcefile, __LINE__)) endif + if (use_hillslope .and. lhillslope_file == ' ') then + write(iulog,*)'lhillslope_file must be specified' + call endrun(msg=errMsg(sourcefile, __LINE__)) + endif endif wt_lunit(:,:) = 0._r8 @@ -119,6 +126,10 @@ subroutine surfrd_get_data (begg, endg, ldomain, lfsurdat, actual_numcft) call getfil( lfsurdat, locfn, 0 ) call ncd_pio_openfile (ncid, trim(locfn), 0) + if (use_hillslope) then + call getfil( lhillslope_file, locfn, 0 ) + call ncd_pio_openfile (ncid_hillslope, trim(locfn), 0) + end if ! Cmopare surfdat_domain attributes to ldomain attributes @@ -183,7 +194,7 @@ subroutine surfrd_get_data (begg, endg, ldomain, lfsurdat, actual_numcft) ! Obtain vegetated landunit info - call surfrd_veg_all(begg, endg, ncid, ldomain%ns, actual_numcft) + call surfrd_veg_all(begg, endg, ncid, ncid_hillslope, ldomain%ns, actual_numcft) if (use_cndv) then call surfrd_veg_dgvm(begg, endg) @@ -766,7 +777,7 @@ subroutine surfrd_pftformat( begg, endg, ncid ) end subroutine surfrd_pftformat !----------------------------------------------------------------------- - subroutine surfrd_veg_all(begg, endg, ncid, ns, actual_numcft) + subroutine surfrd_veg_all(begg, endg, ncid, ncid_hillslope, ns, actual_numcft) ! ! !DESCRIPTION: ! Determine weight arrays for non-dynamic landuse mode @@ -783,7 +794,8 @@ subroutine surfrd_veg_all(begg, endg, ncid, ns, actual_numcft) ! !ARGUMENTS: implicit none integer, intent(in) :: begg, endg, actual_numcft - type(file_desc_t),intent(inout) :: ncid ! netcdf id + type(file_desc_t),intent(inout) :: ncid ! netcdf id for fsurdat + type(file_desc_t),intent(inout) :: ncid_hillslope ! netcdf id for hillslope_file integer ,intent(in) :: ns ! domain size ! ! !LOCAL VARIABLES: @@ -869,7 +881,7 @@ subroutine surfrd_veg_all(begg, endg, ncid, ns, actual_numcft) ! Obtain hillslope hydrology information and modify pft weights if (use_hillslope) then - call surfrd_hillslope(begg, endg, ncid, ns) + call surfrd_hillslope(begg, endg, ncid_hillslope, ns) endif ! Convert from percent to fraction From aa3bda9abd35712a9528afffd7c120769e712d16 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 18 Sep 2024 14:28:43 -0600 Subject: [PATCH 1072/1248] Update bassed on ctsm5.3.0 --- tools/README.filecopies | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/tools/README.filecopies b/tools/README.filecopies index a96dff1ab7..44c9ef6918 100644 --- a/tools/README.filecopies +++ b/tools/README.filecopies @@ -1,4 +1,4 @@ -tools/README.filecopies May/26/2011 +tools/README.filecopies Sep/18/2024 There are several files that are copies of the original files from either CTSM src/utils or src/main, or share/src. @@ -8,7 +8,7 @@ directories as well. I. Files that are IDENTICAL: - 1. csm_share files copied that should be identical to share/src: + 1. cesm_share files copied that should be identical to share/src: shr_kind_mod.F90 shr_const_mod.F90 @@ -17,15 +17,11 @@ I. Files that are IDENTICAL: II. Files with differences - 1. csm_share files copied with differences: + 1. cesm_share files copied with differences: shr_sys_mod.F90 - Remove mpi abort and reference to shr_mpi_mod.F90. - 2. CTSM src/utils files with differences: - - fileutils.F90 --- Remove use of masterproc and spmdMod and endrun in abortutils. - - 3. Files in mksurfdata_esmf + 2. Files in mksurfdata_esmf mkvarpar.F90 nanMod.F90 From eb8816e7eed76aa983f415860fc8284c59441cf4 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 18 Sep 2024 14:35:48 -0600 Subject: [PATCH 1073/1248] Remove mkprocdata, rename README.filecopies to just under mksurfdata_esmf --- tools/README.testing | 58 -- tools/mkprocdata_map/README | 151 ----- tools/mkprocdata_map/README.filedescriptions | 25 - tools/mkprocdata_map/mkprocdata_map_all | 202 ------- .../mkprocdata_map_functions.bash | 57 -- tools/mkprocdata_map/mkprocdata_map_wrap | 250 --------- tools/mkprocdata_map/src/Filepath | 1 - tools/mkprocdata_map/src/Makefile | 10 - tools/mkprocdata_map/src/Makefile.common | 360 ------------ tools/mkprocdata_map/src/Mkdepends | 327 ----------- tools/mkprocdata_map/src/Srcfiles | 8 - tools/mkprocdata_map/src/constMod.F90 | 11 - tools/mkprocdata_map/src/fileutils.F90 | 282 ---------- tools/mkprocdata_map/src/fmain.F90 | 78 --- tools/mkprocdata_map/src/gridmapMod.F90 | 289 ---------- tools/mkprocdata_map/src/mkprocdata_map.F90 | 525 ------------------ tools/mkprocdata_map/src/nanMod.F90 | 41 -- tools/mkprocdata_map/src/shr_file_mod.F90 | 164 ------ tools/mkprocdata_map/src/shr_kind_mod.F90 | 19 - tools/{ => mksurfdata_esmf}/README.filecopies | 0 20 files changed, 2858 deletions(-) delete mode 100644 tools/README.testing delete mode 100644 tools/mkprocdata_map/README delete mode 100644 tools/mkprocdata_map/README.filedescriptions delete mode 100755 tools/mkprocdata_map/mkprocdata_map_all delete mode 100644 tools/mkprocdata_map/mkprocdata_map_functions.bash delete mode 100755 tools/mkprocdata_map/mkprocdata_map_wrap delete mode 100644 tools/mkprocdata_map/src/Filepath delete mode 100644 tools/mkprocdata_map/src/Makefile delete mode 100644 tools/mkprocdata_map/src/Makefile.common delete mode 100755 tools/mkprocdata_map/src/Mkdepends delete mode 100644 tools/mkprocdata_map/src/Srcfiles delete mode 100644 tools/mkprocdata_map/src/constMod.F90 delete mode 100644 tools/mkprocdata_map/src/fileutils.F90 delete mode 100644 tools/mkprocdata_map/src/fmain.F90 delete mode 100644 tools/mkprocdata_map/src/gridmapMod.F90 delete mode 100644 tools/mkprocdata_map/src/mkprocdata_map.F90 delete mode 100644 tools/mkprocdata_map/src/nanMod.F90 delete mode 100644 tools/mkprocdata_map/src/shr_file_mod.F90 delete mode 100644 tools/mkprocdata_map/src/shr_kind_mod.F90 rename tools/{ => mksurfdata_esmf}/README.filecopies (100%) diff --git a/tools/README.testing b/tools/README.testing deleted file mode 100644 index 9c386a3b26..0000000000 --- a/tools/README.testing +++ /dev/null @@ -1,58 +0,0 @@ -tools/README.testing May/23/2011 - -There is automated testing for all of the tools and scripts under this tools directory. -The tests are in the test/tools directory and are any of the scripts -that have "tools" in the name. There are several assumptions made in order for the -testing to work. - - -1.) Executable name is the same as the directory name - -The name of the executable program is the same as the directory name of the tool. - -2.) Build works the same for any Fortran tools - -The build for any Fortran tools should work the same way, with the same options -and required files for it. The files: Makefile, Mkdepends, Filepath and Srcfile -are expected to exist in the tool "src" sub-directory. To make maintaining these files easier -in general the Makefile and Mkdepends files should be kept identical other than -default settings for OPT and SMP and the output executable name. - -Options to the Makefile: - - LIB_NETCDF --- Library directory location of NetCDF. (defaults to /usr/local/lib) - INC_NETCDF --- Include directory location of NetCDF. (defaults to /usr/local/include) - MOD_NETCDF --- Module directory location of NetCDF. (defaults to $LIB_NETCDF) - USER_FC ------ Allow user to override the default Fortran compiler specified in Makefile. - USER_FCTYP --- Allow user to override the default type of Fortran compiler - (Linux and USER_FC=ftn only). - USER_CC ------ Allow user to override the default C compiler specified in Makefile - (Linux only). - USER_LINKER -- Allow user to override the default linker specified in Makefile. - SMP ---------- Shared memory Multi-processing (TRUE or FALSE) [default is FALSE] - OPT ---------- Use optimized options. (TRUE or FALSE) - -3.) Successful completion of the tool ends with "Successfully ..." - -After the tool completes it should have an unique string telling of the -successful completion of the file that is searchable in the log file starting -with "Successfully ". If this string isn't found in the log file, it -will be assumed by the test setup that the test failed. - -4.) NetCDF files are created or modified - -It is assumed that NetCDF files are created and/or modified by the process. And if -NetCDF files are NOT created -- something went wrong. For some scripts that copy files -to other locations this means an "-nomv" option needs to be invoked (and one provided) -so that it leaves the files created in the current directory. - -5.) Namelist examples exist .* namelist files - -To specify options for the running of the tool, sample namelist files -are provided or a sample run options file. These files can EITHER be in the -tool directory OR the ../../test/tools/nl_files directory. - -6.) Specific tests for run scripts - -For tools that have scripts to create namelists and run the tool for you, there -are customized tests to run these tools. diff --git a/tools/mkprocdata_map/README b/tools/mkprocdata_map/README deleted file mode 100644 index 92ffb4856c..0000000000 --- a/tools/mkprocdata_map/README +++ /dev/null @@ -1,151 +0,0 @@ -$CTSMROOT/tools/mkprocdata_map/clm/README Oct 30, 2012 - -This directory contains scripts for regridding CLM output from an -unstructured grid (1-d output using the lndgrid dimension) to a 2-d -(lat/lon) grid. The regridding method is area-conservative. - -The following steps provide a method to create the necessary inputs to -this script, produce an executable, and regrid output: - -In the following instructions, the "original" resolution is the -resolution of the run on an unstructured grid, and the "target" -resolution is the regular lat/lon resolution to which you will regrid -the output. - -(0) Install prerequisites: - - (a) If you do not already have a mapping file from the original - resolution to the target resolution, you will need the - ESMF_RegridWeightGen tool installed on your system. - - (b) The wrapper scripts describe below require the netCDF operators - (NCO). These nco tools (ncks, ncap2, etc.) must be in your path. - -(1) Determine the target resolution. This resolution must be a regular - lat/lon resolution. Generally, this should be a resolution close - to the resolution of the CLM run. For example, when running CLM at - ne30_np4 resolution, a good target resolution is 0.9x1.25 (i.e., - finite volume 1 degree: f09); when running CLM at ne120_np4 - resolution, a good target resolution is 0.23x0.31 (i.e., finitev - volume 1/4 degree: f02). - -(2) Perform a short CLM run at the target resolution, producing at - least one history file. After this run completes, set the - environment variable $TEMPLATE_FILE to point to one of the history - files created by this run. - -(3) Create a conservative mapping file from the original resolution to - the target resolution using the ESMF regrid weight generator. The - basic method for doing this is: - - $ESMF_PATH/bin/ESMF_RegridWeightGen -s $INGRID -d $OUTGRID -m conserve -w $MAP_FILE -i - - where $INGRID gives the path to a SCRIP grid file at the original - resolution, $OUTGRID gives the path to a SCRIP grid file at the - template resolution, and $MAP_FILE gives the name of the mapping - file that will be generated. - - However, you may want to wrap this in a job script to run it on - multiple processors (using mpirun), and you may have to set other - machine-specific environment variables. - -(4) Build the mkprocdata_map tool. From the current directory, do the - following: - - > cd src - > gmake - > cd .. - - By default code compiles optimized so it's reasonably fast. If you want - to use the debugger, with bounds-checking, and float trapping on do the - following: - gmake OPT=FALSE - See Also: See the components/clm/tools/README file for notes about setting - the path for NetCDF. - - This builds the mkprocdata_map executable. However, you generally - will not want to run this executable directly: instead, you should - use one of the wrapper scripts described below. - -(5) Do the regridding using one of the wrapper scripts in this - directory. To determine which script is most appropriate: Do you - need to regrid just one or a few output files, or most/all of the - output files in a directory? - - (a) If you are regridding just one or a few output files, you can - use mkprocdata_map_wrap. Its usage is: - - > mkprocdata_map_wrap -i input_file -o output_file -m $MAP_FILE -t $TEMPLATE_FILE - - where: - - input_file is the CLM history file you want to regrid - - output_file is the name of the regridded file that will be - created - - $MAP_FILE is the ESMF conservative mapping file created in - step (3) - - $TEMPLATE_FILE is a CLM history file at the target resolution, - created in step (2) - - You may also specify the '-l' option to this script. This option - determines whether to determine landfrac and related variables - by regridding the input file (when you don't give the '-l' - option), or by copying these variables from the template file - (when you give the '-l' option). These variables are important - for computing regional and global averages, e.g., as is done in - the land diagnostics package. Each method may be reasonable, - depending on the purposes of the regridding. For example, if you - want regional/global integrals to be as true as possible to the - original run, you should run withOUT the '-l' option; but if you - want to compare regional/global integrals between the original - run and a run at the target resolution, then you may want to run - WITH the '-l' option. - - Run 'mkprocdata_map_wrap -h' for full usage - - (b) If you need to regrid most or all of the output files in a - directory, you can use the convenience script - mkprocdata_map_all. This script runs mkprocdata_map_wrap on all - files matching a given pattern within a directory. Its basic - usage is the following, done from a directory containing many - CLM history files: - - > /path/to/mkprocdata_map_all -p $CASE -m $MAP_FILE -t $TEMPLATE_FILE - - where: - - $CASE is the case name of the original run (this -p argument - is actually more general: it provides the prefix of files on - which mkprocdata_map_wrap should be run; run - 'mkprocdata_map_all -h' for details) - - $MAP_FILE is the ESMF conservative mapping file created in - step (3) - - $TEMPLATE_FILE is a CLM history file at the target resolution, - created in step (2) - - There are a number of additional optional arguments to this - script, including the '-l' option described in (a), above. Run - 'mkprocdata_map_all -h' for full usage. - - ------------------------------------------------------------------------- -Some miscellaneous notes on the scripts contained here ------------------------------------------------------------------------- - -- area vs. area_regridded in the output of mkprocdata_map_wrap and - mkprocdata_map_all: The 'area' variable gives the actual grid cell - area on the destination grid. The 'area_regridded' variable is the - result of performing the regridding procedure on the 'area' variable - in the original source data. This seems to be the wrong way to - regrid areas (e.g., it leads to global totals that do not make - sense). However, area_regridded is left in the regridded files as a - diagnostic. BUT PLEASE USE CAUTION IF USING THIS AREA_REGRIDDED - VALUE, UNLESS YOU KNOW WHAT IT REALLY REPRESENTS! - -- At least as of this writing (Oct 29, 2012), there is insufficient - metadata on the CLM history files to regrid all variables - perfectly. In particular, note that many CLM history variables apply - only over a subset of the grid cell (e.g., over the non-lake portion - of the grid cell). Thus, to regrid these variables appropriately, we - would need to weight each grid cell's value by the portion of the - grid cell over which the field applies. However, doing this would - require metadata about each field that is not currently - available. diff --git a/tools/mkprocdata_map/README.filedescriptions b/tools/mkprocdata_map/README.filedescriptions deleted file mode 100644 index e657e7c7d9..0000000000 --- a/tools/mkprocdata_map/README.filedescriptions +++ /dev/null @@ -1,25 +0,0 @@ -$CTSMROOT/tools/mkprocdata_map/README.filedescriptions Erik Kluzek - 06/08/2018 - -mkprocdata_map_all ------------ Script to run over a list of files -mkprocdata_map_wrap ----------- Main script to actually use -mkprocdata_map_functions.bash - Bash shell functions to use in other scripts -README ------------------------ Description and how to run -src --------------------------- Directory with FORTRAN source code - -Also there are some sample files that can be used for testing under inputdata in - -$DIN_LOC_ROOT/lnd/clm2/test_mkprocdata_map - -See how this is done by looking at the file for testing mkprocdata_map: - -../../test/tools/nl_files/mkprocdata_ne30_to_f19_I2000 - -Which does something like the following: - -./mkprocdata_map_wrap \ --i $DIN_LOC_ROOT/lnd/clm2/test_mkprocdata_map/clm4054_ne30g16_I2000.clm2.h0.2000-01_c170430.nc \ --o ne30output_onf19grid.nc \ --m $DIN_LOC_ROOT/lnd/clm2/test_mkprocdata_map/map_ne30np4_nomask_to_fv1.9x2.5_nomask_aave_da_c121107.nc \ --t $DIN_LOC_ROOT/lnd/clm2/test_mkprocdata_map/clm4054_f19g16_I2000.clm2.h0.2000-01_c170430.nc - diff --git a/tools/mkprocdata_map/mkprocdata_map_all b/tools/mkprocdata_map/mkprocdata_map_all deleted file mode 100755 index 73e8abedf1..0000000000 --- a/tools/mkprocdata_map/mkprocdata_map_all +++ /dev/null @@ -1,202 +0,0 @@ -#!/bin/bash - -# This script runs mkprocdata_map_wrap on all files matching a given -# pattern within a directory. - -# Created by Bill Sacks, 5-26-11 - -# ---------------------------------------------------------------------- -# LOCAL FUNCTIONS DEFINED HERE -# ---------------------------------------------------------------------- - -function Usage { - script_name=`basename $0` - echo "Usage: $script_name -p prefix -m map_file -t template_file [-d] [-e executable-path] [-h] [-i] [-l] [-o output_suffix] [-r diRectory] [-s suffix]" - echo "" - echo "This script runs mkprocdata_map_wrap on all files matching a" - echo "given pattern within a directory." - echo "" - echo "'prefix' gives the prefix of the files on which" - echo "mkprocdata_map_wrap should be run; 'prefix' should NOT contain" - echo "wildcard characters. The prefix is also used to translate" - echo "from input to output file names (see examples below)" - echo "" - echo "'map_file' gives the name (and full path if not in the current" - echo "directory) of the mapping file" - echo "" - echo "'template_file' gives the name (and full path if not in the" - echo "current directory) of the template file, from which we read" - echo "lats, lons and some other variables" - echo "" - echo "The following are optional arguments:" - echo "" - echo "[-d]: Do a test (Dry run): do all error-checking on" - echo " arguments and print commands that would be run, but" - echo " don't actually run commands" - echo "" - echo "[-e executable-path]: Gives the path of the mkprocdata_map executable." - echo " If not specified, the path is determined by the" - echo " default value in mkprocdata_map_wrap." - echo "" - echo "[-h]: Print this help message and exit" - echo "" - echo "[-i]: Ignore (skip) existing output files; if this option is" - echo " not specified, then the script dies with an error if" - echo " any of the desired output files already exist" - echo "" - echo "[-l]: Option passed to mkprocdata_map_wrap: rather than computing" - echo " landfrac and related variables by regridding the input file," - echo " instead copy these variables directly from the template file." - echo "" - echo "[-o output_suffix]: suffix to append to the end of the prefix" - echo " on the output files" - echo " If not specified, '_2d' is used" - echo "" - echo "[-r diRectory]: Do the processing in the given directory." - echo " If not specified, processing is done in the" - echo " current working directory." - echo "" - echo "[-s suffix]: Run mkprocdata_map_wrap on all files matching the" - echo " pattern '\${prefix}\${suffix}'. The suffix can -" - echo " and often will - contain wildcards; but" - echo " remember to enclose 'suffix' in quotes to" - echo " prevent shell expansion." - echo " If not specified, run mkprocdata_map_wrap on all" - echo " files matching '\${prefix}*'" - echo "" - echo "" - echo "Example: $script_name -p Ib14_ne30np4_gx1v6 -m map_ne30np4_to_fv1.9x2.5_aave_da_091230.nc -t Ib19_1.9x2.5_gx1v6.clm2.h0.0001-01.nc" - echo "This will run mkprocdata_map_wrap on all files whose names begin" - echo "with 'Ib14_ne30np4_gx1v6' in the current directory, using the" - echo "mapping file named 'map_ne30np4_to_fv1.9x2.5_aave_da_091230.nc'" - echo "and the template file named 'Ib19_1.9x2.5_gx1v6.clm2.h0.0001-01.nc'" - echo "For an input file named:" - echo " Ib14_ne30np4_gx1v6.clm2.h0.0001-01-06-00000.nc" - echo "The output file will be named:" - echo " Ib14_ne30np4_gx1v6_2d.clm2.h0.0001-01-06-00000.nc" - echo "" - echo "Example: $script_name -o '_remap' -s '*.h0.0001*.nc' -p Ib14_ne30np4_gx1v6 -m map_ne30np4_to_fv1.9x2.5_aave_da_091230.nc -t Ib19_1.9x2.5_gx1v6.clm2.h0.0001-01.nc" - echo "This will run mkprocdata_map_wrap on all files whose names match" - echo "the pattern 'Ib14_ne30np4_gx1v6*.h0.0001*.nc', in the" - echo "current directory, using the mapping file named" - echo "'map_ne30np4_to_fv1.9x2.5_aave_da_091230.nc' and the" - echo "template file named Ib19_1.9x2.5_gx1v6.clm2.h0.0001-01.nc" - echo "For an input file named:" - echo " Ib14_ne30np4_gx1v6.clm2.h0.0001-01-06-00000.nc" - echo "The output file will be named:" - echo " Ib14_ne30np4_gx1v6_remap.clm2.h0.0001-01-06-00000.nc" - echo "" -} - -# ---------------------------------------------------------------------- -# BEGIN MAIN SCRIPT -# ---------------------------------------------------------------------- - -script_dir=`dirname $0` -source $script_dir/mkprocdata_map_functions.bash - -# ---------------------------------------------------------------------- -# Handle command-line arguments -# ---------------------------------------------------------------------- - -# define default values: -# required arguments: -prefix="" -map_file="" -template_file="" -# optional arguments: -directory="." -ignore_existing=0 -output_suffix="_2d" -suffix="*" -dryrun=0 -extra_args="" - -while getopts de:hilm:o:p:r:s:t: opt; do - case $opt in - d) dryrun=1;; - e) extra_args="$extra_args -e $OPTARG";; - h) Usage; exit;; - i) ignore_existing=1;; - l) extra_args="$extra_args -l";; - m) map_file=$OPTARG;; - o) output_suffix=$OPTARG;; - p) prefix=$OPTARG;; - r) directory=$OPTARG;; - s) suffix=$OPTARG;; - t) template_file=$OPTARG;; - \?) Usage; exit 1 - esac -done - -# ---------------------------------------------------------------------- -# Error checking on arguments -# ---------------------------------------------------------------------- - -if [ -z "$prefix" ]; then - echo "Must specify a prefix" - Usage - exit 1 -fi - -check_file_arg "$map_file" "map" -check_file_arg "$template_file" "template" - -# Make sure directory is really a directory -if [ ! -d $directory ]; then - echo "ERROR: $directory is not a directory" - echo "" - Usage - exit 1 -fi - - -# ---------------------------------------------------------------------- -# Change to desired directory -# ---------------------------------------------------------------------- - -olddir=`pwd` -cd $directory - -# ---------------------------------------------------------------------- -# Get list of files matching the given pattern; make sure there really -# are some matching files -# ---------------------------------------------------------------------- - -files=`ls ${prefix}${suffix}` -if [ $? -ne 0 ]; then - echo "ERROR trying to find files matching: ${prefix}${suffix}" - echo "" - Usage - exit 1 -fi - -# ---------------------------------------------------------------------- -# Loop through files matching the given pattern; run mkprocdata_map_wrap for each -# ---------------------------------------------------------------------- - -for infile in $files; do - outfile=${infile/$prefix/${prefix}${output_suffix}} - if [ -e $outfile ]; then - if [ $ignore_existing -eq 0 ]; then - echo "" - echo "ERROR: output file $outfile already exists" - exit 1 - else - echo "" - echo "WARNING: output file $outfile already exists: skipping" - echo "" - fi - - else # outfile does not exist - echo "" - do_cmd "${script_dir}/mkprocdata_map_wrap -i $infile -o $outfile -m $map_file -t $template_file $extra_args" $dryrun - fi -done - -# ---------------------------------------------------------------------- -# Clean up -# ---------------------------------------------------------------------- - -cd $olddir - diff --git a/tools/mkprocdata_map/mkprocdata_map_functions.bash b/tools/mkprocdata_map/mkprocdata_map_functions.bash deleted file mode 100644 index bbc359fb89..0000000000 --- a/tools/mkprocdata_map/mkprocdata_map_functions.bash +++ /dev/null @@ -1,57 +0,0 @@ -#!/bin/bash - -# This file contains functions used by other bash scripts in this directory. - -# This function echoes the command given by $1 (cmd), then executes it. -# However, if $2 (dryrun) is non-zero, then it only does the echo, not the execution. -# Usage: do_cmd cmd dryrun -# Returns 0 on success, non-zero on failure; if there is an error, the error string is echoed. -function do_cmd { - if [[ $# -ne 2 ]]; then - echo "ERROR in do_cmd: wrong number of arguments: expected 2, received $#" - exit 1 - fi - - local cmd=$1 - local dryrun=$2 - - echo $cmd - if [ $dryrun -eq 0 ]; then - # We use 'eval $cmd' rather than just '$cmd', because the - # latter doesn't work right if the command contains any quoted - # strings (e.g., svn ci -m "this is my message") - eval $cmd - if [ $? -ne 0 ]; then - echo "ERROR in do_cmd: error executing command" - exit 2 - fi - fi - - return 0 -} - -# make sure that the given file name argument was provided, and that -# the file exists; exit the script with a usage message if either of -# these is not true -# -# Usage: check_file_arg filename_arg description -# (description is echoed if there is an error) -# Example: check_file_arg "$input_file" "input" -# (note that $input_file must be in quotes) -function check_file_arg { - local filename=$1 - local description=$2 - - if [ -z "$filename" ]; then - echo "ERROR: Must specify $description file" - Usage - exit 1 - fi - - if [ ! -f $filename ]; then - echo "ERROR: Can't find $description file: $filename" - Usage - exit 1 - fi -} - diff --git a/tools/mkprocdata_map/mkprocdata_map_wrap b/tools/mkprocdata_map/mkprocdata_map_wrap deleted file mode 100755 index 4744b0eacc..0000000000 --- a/tools/mkprocdata_map/mkprocdata_map_wrap +++ /dev/null @@ -1,250 +0,0 @@ -#!/bin/bash - -# This script is a wrapper around mkprocdata_map that runs that -# program and then copies some additional variables from the template -# file to the output file. It also does some additional pre and -# post-processing in order to create some additional variables. - -# Created by Bill Sacks, 5-25-11 - -# ---------------------------------------------------------------------- -# SET PARAMETERS HERE -# ---------------------------------------------------------------------- - -# comma-delimited list of extra variables to copy directly from -# template file; note that these variables should not be written out -# by mkprocdata_map (i.e., everything in this list should be listed in -# the 'ignore_var' function in mkprocdata_map.F90); however, there may -# be some variables in the 'ignore_var' function that are not listed -# here - e.g., variables that we treat specially. -copy_vars="lon,lat" - -# comma-delimited list of extra variables to copy from the template -# file if the -l option is specified -- this option says to copy -# landfrac and related variables. Note that some of these variables -# may be written out by mkprocdata_map, in which case they will be -# overwritten afterwards (slighly less efficient, but that keeps -# things simpler). -landfrac_copy_vars="landfrac,landmask,pftmask" - -# name of the executable; -# expected to be in the same directory as this script unless -e option is given -executable="mkprocdata_map" - -# minimum value for regridded pftmask variable for the output variable to be 1 -pftmask_min="1.e-6" - -# fill value for landmask -landmask_fill=-9999 - -# ---------------------------------------------------------------------- -# LOCAL FUNCTIONS DEFINED HERE -# ---------------------------------------------------------------------- - -function Usage { - script_name=`basename $0` - echo "Usage: $script_name -i input_file -o output_file -m map_file -t template_file [-e executable-path] [-h] [-l]" - echo "" - echo "This script runs mkprocdata_map with the given arguments (-i, -o, -m and -t)," - echo "then copies some additional variables from the template file" - echo "to the output file. It also does some additional pre and" - echo "post-processing in order to create some additional variables." - echo "" - echo "Additional optional arguments:" - echo "" - echo "[-e executable-path]: Gives the path of the mkprocdata_map executable." - echo " If not specified, the executable is assumed to be" - echo " in the same directory as this script." - echo "" - echo "[-h]: Print this help message and exit" - echo "" - echo "[-l]: Rather than computing landfrac and related variables" - echo "by regridding the input file, instead copy these variables" - echo "directly from the template file. The variables this pertains" - echo "to are:" - echo $landfrac_copy_vars -} - -# This function operates on a single variable in a file, changing all -# places where that variable is missing to some new (non-missing) -# value. The _FillValue attribute remains unchanged. -# Usage: change_missing_to_value varname newval infile outfile -# - varname: the name of the variable to change -# - newval: all instances of the missing value will be replaced with -# this new value -# - infile: input file name -# - outfile: output file name (can be the same as infile) -function change_missing_to_value { - if [[ $# -ne 4 ]]; then - echo "ERROR in change_missing_to_value: wrong number of arguments: expected 2, received $#" - exit 1 - fi - - varname=$1 - newval=$2 - infile=$3 - outfile=$4 - - varname_tmp=${varname}_tmp_$$ - - cat > cmds.nco.tmp.$$ <= $pftmask_min)' $output_file $output_file" 0 - do_cmd "ncks -O -x -v pftmask_float $output_file $output_file" 0 - - # --- Calculate landmask from landfrac --- - echo "" - - cat > cmds.nco.tmp.$$ < 0); -landmask_float.change_miss($landmask_fill); -landmask=int(landmask_float); -EOF - - do_cmd "ncap2 -O -S cmds.nco.tmp.$$ $output_file $output_file" 0 - rm cmds.nco.tmp.$$ - - change_missing_to_value landmask 0 $output_file $output_file - - # in the following, note that we need to manually set missing_value, because it doesn't get changed through the .set_miss call in nco: - do_cmd "ncatted -a long_name,landmask,o,c,'land/ocean mask (0.=ocean and 1.=land)' -a missing_value,landmask,o,i,$landmask_fill $output_file" 0 -fi - -echo "Successfully regridded data" diff --git a/tools/mkprocdata_map/src/Filepath b/tools/mkprocdata_map/src/Filepath deleted file mode 100644 index 9c558e357c..0000000000 --- a/tools/mkprocdata_map/src/Filepath +++ /dev/null @@ -1 +0,0 @@ -. diff --git a/tools/mkprocdata_map/src/Makefile b/tools/mkprocdata_map/src/Makefile deleted file mode 100644 index 42f797b3c2..0000000000 --- a/tools/mkprocdata_map/src/Makefile +++ /dev/null @@ -1,10 +0,0 @@ -# Makefile for mkprocdata_map - -EXENAME = ../mkprocdata_map - -# Set optimization on by default -ifeq ($(OPT),$(null)) - OPT := TRUE -endif - -include Makefile.common diff --git a/tools/mkprocdata_map/src/Makefile.common b/tools/mkprocdata_map/src/Makefile.common deleted file mode 100644 index ab79f94144..0000000000 --- a/tools/mkprocdata_map/src/Makefile.common +++ /dev/null @@ -1,360 +0,0 @@ -#----------------------------------------------------------------------- -# This Makefile is for building clm tools on AIX, Linux (with pgf90 or -# lf95 compiler), Darwin or IRIX platforms. -# -# These macros can be changed by setting environment variables: -# -# LIB_NETCDF --- Library directory location of netcdf. (defaults to /usr/local/lib) -# INC_NETCDF --- Include directory location of netcdf. (defaults to /usr/local/include) -# MOD_NETCDF --- Module directory location of netcdf. (defaults to $LIB_NETCDF) -# USER_FC ------ Allow user to override the default Fortran compiler specified in Makefile. -# USER_FCTYP --- Allow user to override the default type of Fortran compiler (linux and USER_FC=ftn only). -# USER_CC ------ Allow user to override the default C compiler specified in Makefile (linux only). -# USER_LINKER -- Allow user to override the default linker specified in Makefile. -# USER_CPPDEFS - Additional CPP defines. -# USER_CFLAGS -- Additional C compiler flags that the user wishes to set. -# USER_FFLAGS -- Additional Fortran compiler flags that the user wishes to set. -# USER_LDLAGS -- Additional load flags that the user wishes to set. -# SMP ---------- Shared memory Multi-processing (TRUE or FALSE) [default is FALSE] -# OPT ---------- Use optimized options. -# -#------------------------------------------------------------------------ - -# Set up special characters -null := - -# Newer makes set the CURDIR variable. -CURDIR := $(shell pwd) - -RM = rm - -# Check for the netcdf library and include directories -ifeq ($(LIB_NETCDF),$(null)) - LIB_NETCDF := /usr/local/lib -endif - -ifeq ($(INC_NETCDF),$(null)) - INC_NETCDF := /usr/local/include -endif - -ifeq ($(MOD_NETCDF),$(null)) - MOD_NETCDF := $(LIB_NETCDF) -endif - -# Set user specified Fortran compiler -ifneq ($(USER_FC),$(null)) - FC := $(USER_FC) -endif - -# Set user specified C compiler -ifneq ($(USER_CC),$(null)) - CC := $(USER_CC) -endif - -# Set if Shared memory multi-processing will be used -ifeq ($(SMP),$(null)) - SMP := FALSE -endif - -CPPDEF := $(USER_CPPDEFS) - -# Set optimization on by default -ifeq ($(OPT),$(null)) - OPT := TRUE -endif - -ifeq ($(OPT),TRUE) - CPPDEF := -DOPT -endif - -# Determine platform -UNAMES := $(shell uname -s) - -# Load dependency search path. -dirs := . $(shell cat Filepath) - -# Set cpp search path, include netcdf -cpp_dirs := $(dirs) $(INC_NETCDF) $(MOD_NETCDF) -cpp_path := $(foreach dir,$(cpp_dirs),-I$(dir)) # format for command line - -# Expand any tildes in directory names. Change spaces to colons. -# (the vpath itself is set elsewhere, based on this variable) -vpath_dirs := $(foreach dir,$(cpp_dirs),$(wildcard $(dir))) -vpath_dirs := $(subst $(space),:,$(vpath_dirs)) - -#Primary Target: build the tool -all: $(EXENAME) - -# Get list of files and build dependency file for all .o files -# using perl scripts mkSrcfiles and mkDepends - -SOURCES := $(shell cat Srcfiles) - -OBJS := $(addsuffix .o, $(basename $(SOURCES))) - -# Set path to Mkdepends script; assumes that any Makefile including -# this file is in a sibling of the src directory, in which Mkdepends -# resides -Mkdepends := ../src/Mkdepends - -$(CURDIR)/Depends: $(CURDIR)/Srcfiles $(CURDIR)/Filepath - $(Mkdepends) Filepath Srcfiles > $@ - - -# Architecture-specific flags and rules -#------------------------------------------------------------------------ -# AIX -#------------------------------------------------------------------------ - -ifeq ($(UNAMES),AIX) -CPPDEF += -DAIX -cpre = $(null)-WF,-D$(null) -FPPFLAGS := $(patsubst -D%,$(cpre)%,$(CPPDEF)) -FFLAGS = -c -I$(INC_NETCDF) -q64 -qsuffix=f=f90 -qsuffix=f=f90:cpp=F90 \ - $(FPPFLAGS) -g -qfullpath -qarch=auto -qtune=auto -qsigtrap=xl__trcedump -qsclk=micro - -LDFLAGS = -L$(LIB_NETCDF) -q64 -lnetcdff -lnetcdf -ifneq ($(OPT),TRUE) - FFLAGS += -qinitauto=7FF7FFFF -qflttrap=ov:zero:inv:en -qspillsize=4000 -C -else - FFLAGS += -O2 -qmaxmem=-1 -Q - LDFLAGS += -Q -endif -CFLAGS := -q64 -g $(CPPDEF) -O2 -FFLAGS += $(cpp_path) -CFLAGS += $(cpp_path) - -ifeq ($(SMP),TRUE) - FC = xlf90_r - FFLAGS += -qsmp=omp - LDFLAGS += -qsmp=omp -else - FC = xlf90 -endif - -endif - -#------------------------------------------------------------------------ -# Darwin -#------------------------------------------------------------------------ - -ifeq ($(UNAMES),Darwin) - -# Set the default Fortran compiler -ifeq ($(USER_FC),$(null)) - FC := g95 -endif -ifeq ($(USER_CC),$(null)) - CC := gcc -endif - -CFLAGS := -g -O2 -CPPDEF += -DSYSDARWIN -DDarwin -DLINUX -LDFLAGS := - -ifeq ($(FC),g95) - - CPPDEF += -DG95 - FFLAGS := -c -fno-second-underscore $(CPPDEF) $(cpp_path) -I$(MOD_NETCDF) - ifeq ($(OPT),TRUE) - FFLAGS += -O2 - else - FFLAGS += -g -fbounds-check - endif - -endif - -ifeq ($(FC),gfortran) - - CPPDEF += -DG95 - FFLAGS := -c -fno-second-underscore $(CPPDEF) $(cpp_path) -I$(MOD_NETCDF) \ - -fno-range-check - ifeq ($(OPT),TRUE) - FFLAGS += -O2 - else - FFLAGS += -g -fbounds-check - endif - -endif - -ifeq ($(FC),ifort) - - CPPDEF += -DFORTRANUNDERSCORE - FFLAGS += -c -ftz -g -fp-model precise $(CPPDEF) $(cpp_path) \ - -convert big_endian -assume byterecl -traceback -FR - LDFLAGS += -m64 - - ifneq ($(OPT),TRUE) - FFLAGS += -CB -O0 - else - FFLAGS += -O2 - endif - ifeq ($(SMP),TRUE) - FFLAGS += -qopenmp - LDFLAGS += -qopenmp - endif -endif - -ifeq ($(FC),pgf90) - - CPPDEF += -DFORTRANUNDERSCORE - FFLAGS += -c $(CPPDEF) $(cpp_path) - ifneq ($(OPT),TRUE) - FFLAGS += -g -Ktrap=fp -Mbounds -Kieee - else - FFLAGS += -fast -Kieee - endif - - ifeq ($(SMP),TRUE) - FFLAGS += -mp - LDFLAGS += -mp - endif - -endif - -ifeq ($(CC),icc) - CFLAGS += -m64 -g - ifeq ($(SMP),TRUE) - CFLAGS += -qopenmp - endif -endif -ifeq ($(CC),pgcc) - CFLAGS += -g -fast -endif - -CFLAGS += $(CPPDEF) $(cpp_path) -LDFLAGS += -L$(LIB_NETCDF) -lnetcdf -lnetcdff - -endif - -#------------------------------------------------------------------------ -# Linux -#------------------------------------------------------------------------ - -ifeq ($(UNAMES),Linux) - ifeq ($(USER_FC),$(null)) - FC := ifort - FCTYP := ifort - else - ifeq ($(USER_FC),ftn) - ifneq ($(USER_FCTYP),$(null)) - FCTYP := $(USER_FCTYP) - else - FCTYP := pgf90 - endif - else - FCTYP := $(USER_FC) - endif - endif - CPPDEF += -DLINUX -DFORTRANUNDERSCORE - CFLAGS := $(CPPDEF) - LDFLAGS := $(shell $(LIB_NETCDF)/../bin/nf-config --flibs) - FFLAGS = - - ifeq ($(FCTYP),pgf90) - CC := pgcc - ifneq ($(OPT),TRUE) - FFLAGS += -g -Ktrap=fp -Mbounds -Kieee - else - FFLAGS += -fast -Kieee - CFLAGS += -fast - endif - - ifeq ($(SMP),TRUE) - FFLAGS += -mp - LDFLAGS += -mp - endif - - endif - - ifeq ($(FCTYP),lf95) - ifneq ($(OPT),TRUE) - FFLAGS += -g --chk a,e,s,u -O0 - else - FFLAGS += -O - endif - # Threading only works by putting thread memory on the heap rather than the stack - # (--threadheap). - # As of lf95 version 6.2 the thread stacksize limits are (still) too small to run - # even small - # resolution problems (FV at 10x15 res fails). - ifeq ($(SMP),TRUE) - FFLAGS += --openmp --threadheap 4096 - LDFLAGS += --openmp --threadheap 4096 - endif - endif - ifeq ($(FCTYP),pathf90) - FFLAGS += -extend_source -ftpp -fno-second-underscore - ifneq ($(OPT),TRUE) - FFLAGS += -g -O0 - else - FFLAGS += -O - endif - ifeq ($(SMP),TRUE) - FFLAGS += -mp - LDFLAGS += -mp - endif - endif - ifeq ($(FCTYP),ifort) - - FFLAGS += -ftz -g -fp-model precise -convert big_endian -assume byterecl -traceback -FR - CFLAGS += -m64 -g - LDFLAGS += -m64 - - ifneq ($(OPT),TRUE) - FFLAGS += -CB -O0 - else - FFLAGS += -O2 - endif - ifeq ($(SMP),TRUE) - FFLAGS += -qopenmp - CFLAGS += -qopenmp - LDFLAGS += -qopenmp - endif - endif - FFLAGS += -c -I$(INC_NETCDF) $(CPPDEF) $(cpp_path) - CFLAGS += $(cpp_path) -endif - -#------------------------------------------------------------------------ -# Default rules and macros -#------------------------------------------------------------------------ - -.SUFFIXES: -.SUFFIXES: .F90 .c .o - -# Set the vpath for all file types EXCEPT .o -# We do this for individual file types rather than generally using -# VPATH, because for .o files, we don't want to use files from a -# different build (e.g., in building the unit tester, we don't want to -# use .o files from the main build) -vpath %.F90 $(vpath_dirs) -vpath %.c $(vpath_dirs) -vpath %.h $(vpath_dirs) - -# Append user defined compiler and load flags to Makefile defaults -CFLAGS += $(USER_CFLAGS) -FFLAGS += $(USER_FFLAGS) -LDFLAGS += $(USER_LDFLAGS) - -# Set user specified linker -ifneq ($(USER_LINKER),$(null)) - LINKER := $(USER_LINKER) -else - LINKER := $(FC) -endif - -.F90.o: - $(FC) $(FFLAGS) $< - -.c.o: - $(CC) -c $(CFLAGS) $< - - -$(EXENAME): $(OBJS) - $(LINKER) -o $@ $(OBJS) $(LDFLAGS) - -clean: - $(RM) -f $(OBJS) *.mod Depends - -include $(CURDIR)/Depends diff --git a/tools/mkprocdata_map/src/Mkdepends b/tools/mkprocdata_map/src/Mkdepends deleted file mode 100755 index a75e8fdde0..0000000000 --- a/tools/mkprocdata_map/src/Mkdepends +++ /dev/null @@ -1,327 +0,0 @@ -#!/usr/bin/env perl - -# Generate dependencies in a form suitable for inclusion into a Makefile. -# The source filenames are provided in a file, one per line. Directories -# to be searched for the source files and for their dependencies are provided -# in another file, one per line. Output is written to STDOUT. -# -# For CPP type dependencies (lines beginning with #include) the dependency -# search is recursive. Only dependencies that are found in the specified -# directories are included. So, for example, the standard include file -# stdio.h would not be included as a dependency unless /usr/include were -# one of the specified directories to be searched. -# -# For Fortran module USE dependencies (lines beginning with a case -# insensitive "USE", possibly preceded by whitespace) the Fortran compiler -# must be able to access the .mod file associated with the .o file that -# contains the module. In order to correctly generate these dependencies -# two restrictions must be observed. -# 1) All modules must be contained in files that have the same base name as -# the module, in a case insensitive sense. This restriction implies that -# there can only be one module per file. -# 2) All modules that are to be contained in the dependency list must be -# contained in one of the source files in the list provided on the command -# line. -# The reason for the second restriction is that since the makefile doesn't -# contain rules to build .mod files the dependency takes the form of the .o -# file that contains the module. If a module is being used for which the -# source code is not available (e.g., a module from a library), then adding -# a .o dependency for that module is a mistake because make will attempt to -# build that .o file, and will fail if the source code is not available. -# -# Author: B. Eaton -# Climate Modelling Section, NCAR -# Feb 2001 - -use Getopt::Std; -use File::Basename; - -# Check for usage request. -@ARGV >= 2 or usage(); - -# Process command line. -my %opt = (); -getopts( "t:w", \%opt ) or usage(); -my $filepath_arg = shift() or usage(); -my $srcfile_arg = shift() or usage(); -@ARGV == 0 or usage(); # Check that all args were processed. - -my $obj_dir; -if ( defined $opt{'t'} ) { $obj_dir = $opt{'t'}; } - -open(FILEPATH, $filepath_arg) or die "Can't open $filepath_arg: $!\n"; -open(SRCFILES, $srcfile_arg) or die "Can't open $srcfile_arg: $!\n"; - -# Make list of paths to use when looking for files. -# Prepend "." so search starts in current directory. This default is for -# consistency with the way GNU Make searches for dependencies. -my @file_paths = ; -close(FILEPATH); -chomp @file_paths; -unshift(@file_paths,'.'); -foreach $dir (@file_paths) { # (could check that directories exist here) - $dir =~ s!/?\s*$!!; # remove / and any whitespace at end of directory name - ($dir) = glob $dir; # Expand tildes in path names. -} - -# Make list of files containing source code. -my @src = ; -close(SRCFILES); -chomp @src; - -# For each file that may contain a Fortran module (*.[fF]90 *.[fF]) convert the -# file's basename to uppercase and use it as a hash key whose value is the file's -# basename. This allows fast identification of the files that contain modules. -# The only restriction is that the file's basename and the module name must match -# in a case insensitive way. -my %module_files = (); -my ($f, $name, $path, $suffix, $mod); -my @suffixes = ('\.[fF]90', '\.[fF]' ); -foreach $f (@src) { - ($name, $path, $suffix) = fileparse($f, @suffixes); - ($mod = $name) =~ tr/a-z/A-Z/; - $module_files{$mod} = $name; -} - -# Now make a list of .mod files in the file_paths. If a .o source dependency -# can't be found based on the module_files list above, then maybe a .mod -# module dependency can if the mod file is visible. -my %trumod_files = (); -my ($dir); -my ($f, $name, $path, $suffix, $mod); -my @suffixes = ('\.mod' ); -foreach $dir (@file_paths) { - @filenames = (glob("$dir/*.mod")); - foreach $f (@filenames) { - ($name, $path, $suffix) = fileparse($f, @suffixes); - ($mod = $name) =~ tr/a-z/A-Z/; - $trumod_files{$mod} = $name; - } -} - -#print STDERR "\%module_files\n"; -#while ( ($k,$v) = each %module_files ) { -# print STDERR "$k => $v\n"; -#} - -# Find module and include dependencies of the source files. -my ($file_path, $rmods, $rincs); -my %file_modules = (); -my %file_includes = (); -my @check_includes = (); -foreach $f ( @src ) { - - # Find the file in the seach path (@file_paths). - unless ($file_path = find_file($f)) { - if (defined $opt{'w'}) {print STDERR "$f not found\n";} - next; - } - - # Find the module and include dependencies. - ($rmods, $rincs) = find_dependencies( $file_path ); - - # Remove redundancies (a file can contain multiple procedures that have - # the same dependencies). - $file_modules{$f} = rm_duplicates($rmods); - $file_includes{$f} = rm_duplicates($rincs); - - # Make a list of all include files. - push @check_includes, @{$file_includes{$f}}; -} - -#print STDERR "\%file_modules\n"; -#while ( ($k,$v) = each %file_modules ) { -# print STDERR "$k => @$v\n"; -#} -#print STDERR "\%file_includes\n"; -#while ( ($k,$v) = each %file_includes ) { -# print STDERR "$k => @$v\n"; -#} -#print STDERR "\@check_includes\n"; -#print STDERR "@check_includes\n"; - -# Find include file dependencies. -my %include_depends = (); -while (@check_includes) { - $f = shift @check_includes; - if (defined($include_depends{$f})) { next; } - - # Mark files not in path so they can be removed from the dependency list. - unless ($file_path = find_file($f)) { - $include_depends{$f} = -1; - next; - } - - # Find include file dependencies. - ($rmods, $include_depends{$f}) = find_dependencies($file_path); - - # Add included include files to the back of the check_includes list so - # that their dependencies can be found. - push @check_includes, @{$include_depends{$f}}; - - # Add included modules to the include_depends list. - if ( @$rmods ) { push @{$include_depends{$f}}, @$rmods; } -} - -#print STDERR "\%include_depends\n"; -#while ( ($k,$v) = each %include_depends ) { -# print STDERR (ref $v ? "$k => @$v\n" : "$k => $v\n"); -#} - -# Remove include file dependencies that are not in the Filepath. -my $i, $ii; -foreach $f (keys %include_depends) { - - unless (ref $include_depends{$f}) { next; } - $rincs = $include_depends{$f}; - unless (@$rincs) { next; } - $ii = 0; - $num_incs = @$rincs; - for ($i = 0; $i < $num_incs; ++$i) { - if ($include_depends{$$rincs[$ii]} == -1) { - splice @$rincs, $ii, 1; - next; - } - ++$ii; - } -} - -# Substitute the include file dependencies into the %file_includes lists. -foreach $f (keys %file_includes) { - my @expand_incs = (); - - # Initialize the expanded %file_includes list. - my $i; - unless (@{$file_includes{$f}}) { next; } - foreach $i (@{$file_includes{$f}}) { - push @expand_incs, $i unless ($include_depends{$i} == -1); - } - unless (@expand_incs) { - $file_includes{$f} = []; - next; - } - - # Expand - for ($i = 0; $i <= $#expand_incs; ++$i) { - push @expand_incs, @{ $include_depends{$expand_incs[$i]} }; - } - - $file_includes{$f} = rm_duplicates(\@expand_incs); -} - -#print STDERR "expanded \%file_includes\n"; -#while ( ($k,$v) = each %file_includes ) { -# print STDERR "$k => @$v\n"; -#} - -# Print dependencies to STDOUT. -foreach $f (sort keys %file_modules) { - $f =~ /(.+)\./; - $target = "$1.o"; - if ( defined $opt{'t'} ) { $target = "$opt{'t'}/$1.o"; } - print "$target : $f @{$file_modules{$f}} @{$file_includes{$f}}\n"; -} - -#-------------------------------------------------------------------------------------- - -sub find_dependencies { - - # Find dependencies of input file. - # Use'd Fortran 90 modules are returned in \@mods. - # Files that are "#include"d by the cpp preprocessor are returned in \@incs. - - my( $file ) = @_; - my( @mods, @incs ); - - open(FH, $file) or die "Can't open $file: $!\n"; - - while ( ) { - # Search for "#include" and strip filename when found. - if ( /^#include\s+[<"](.*)[>"]/ ) { - push @incs, $1; - } - # Search for Fortran include dependencies. - elsif ( /^\s*include\s+['"](.*)['"]/ ) { #" for emacs fontlock - push @incs, $1; - } - # Search for module dependencies. - elsif ( /^\s*USE\s+(\w+)/i ) { - ($module = $1) =~ tr/a-z/A-Z/; - # Return dependency in the form of a .o version of the file that contains - # the module. this is from the source list. - if ( defined $module_files{$module} ) { - if ( defined $obj_dir ) { - push @mods, "$obj_dir/$module_files{$module}.o"; - } else { - push @mods, "$module_files{$module}.o"; - } - } - # Return dependency in the form of a .mod version of the file that contains - # the module. this is from the .mod list. only if .o version not found - elsif ( defined $trumod_files{$module} ) { - if ( defined $obj_dir ) { - push @mods, "$obj_dir/$trumod_files{$module}.mod"; - } else { - push @mods, "$trumod_files{$module}.mod"; - } - } - } - } - close( FH ); - return (\@mods, \@incs); -} - -#-------------------------------------------------------------------------------------- - -sub find_file { - -# Search for the specified file in the list of directories in the global -# array @file_paths. Return the first occurance found, or the null string if -# the file is not found. - - my($file) = @_; - my($dir, $fname); - - foreach $dir (@file_paths) { - $fname = "$dir/$file"; - if ( -f $fname ) { return $fname; } - } - return ''; # file not found -} - -#-------------------------------------------------------------------------------------- - -sub rm_duplicates { - -# Return a list with duplicates removed. - - my ($in) = @_; # input arrary reference - my @out = (); - my $i; - my %h = (); - foreach $i (@$in) { - $h{$i} = ''; - } - @out = keys %h; - return \@out; -} - -#-------------------------------------------------------------------------------------- - -sub usage { - ($ProgName = $0) =~ s!.*/!!; # name of program - die < shr_kind_r8 - implicit none - save - - real(R8),parameter :: SHR_CONST_REARTH = 6.37122e6_R8 ! radius of earth ~ m - real(r8),parameter :: re_km = SHR_CONST_REARTH*0.001 ! radius of earth (km) - -end module constMod diff --git a/tools/mkprocdata_map/src/fileutils.F90 b/tools/mkprocdata_map/src/fileutils.F90 deleted file mode 100644 index e1f8e633da..0000000000 --- a/tools/mkprocdata_map/src/fileutils.F90 +++ /dev/null @@ -1,282 +0,0 @@ -module fileutils - -!----------------------------------------------------------------------- -!BOP -! -! !MODULE: fileutils -! -! !DESCRIPTION: -! Module containing file I/O utilities -! -! !USES: -! -! !PUBLIC TYPES: - implicit none - save -! -! !PUBLIC MEMBER FUNCTIONS: - public :: get_filename !Returns filename given full pathname - public :: opnfil !Open local unformatted or formatted file - public :: getfil !Obtain local copy of file - public :: relavu !Close and release Fortran unit no longer in use - public :: getavu !Get next available Fortran unit number -! -! !REVISION HISTORY: -! Created by Mariana Vertenstein -! -! -! !PRIVATE MEMBER FUNCTIONS: None -!EOP -!----------------------------------------------------------------------- - -contains - -!----------------------------------------------------------------------- -!BOP -! -! !IROUTINE: get_filename -! -! !INTERFACE: - character(len=256) function get_filename (fulpath) -! -! !DESCRIPTION: -! Returns filename given full pathname -! -! !ARGUMENTS: - implicit none - character(len=*), intent(in) :: fulpath !full pathname -! -! !REVISION HISTORY: -! Created by Mariana Vertenstein -! -! -! !LOCAL VARIABLES: -!EOP - integer i !loop index - integer klen !length of fulpath character string -!------------------------------------------------------------------------ - - klen = len_trim(fulpath) - do i = klen, 1, -1 - if (fulpath(i:i) == '/') go to 10 - end do - i = 0 -10 get_filename = fulpath(i+1:klen) - - end function get_filename - -!------------------------------------------------------------------------ -!BOP -! -! !IROUTINE: set_filename -! -! !INTERFACE: - character(len=256) function set_filename (rem_dir, loc_fn) -! -! !DESCRIPTION: -! -! !ARGUMENTS: -! - implicit none - character(len=*), intent(in) :: rem_dir !remote directory - character(len=*), intent(in) :: loc_fn !local full path filename -! -! !REVISION HISTORY: -! Created by Mariana Vertenstein -! -! -! !LOCAL VARIABLES: -!EOP - integer :: i !integer -!------------------------------------------------------------------------ - - set_filename = ' ' - do i = len_trim(loc_fn), 1, -1 - if (loc_fn(i:i)=='/') go to 10 - end do - i = 0 -10 set_filename = trim(rem_dir) // loc_fn(i+1:len_trim(loc_fn)) - - end function set_filename - -!------------------------------------------------------------------------ -!BOP -! -! !IROUTINE: getfil -! -! !INTERFACE: - subroutine getfil (fulpath, locfn, iflag) -! -! !DESCRIPTION: -! Obtain local copy of file -! First check current working directory -! Next check full pathname[fulpath] on disk -! Finally check full pathname[fulpath] on archival system -! -! !USES: -! -! !ARGUMENTS: - implicit none - character(len=*), intent(in) :: fulpath !Archival or permanent disk full pathname - character(len=*), intent(out) :: locfn !output local file name - integer, optional, intent(in) :: iflag !0=>abort if file not found 1=>do not abort -! -! !REVISION HISTORY: -! Created by Mariana Vertenstein -! -! -! !LOCAL VARIABLES: -!EOP - integer i !loop index - integer klen !length of fulpath character string - integer ierr !error status - logical lexist !true if local file exists - character(len=len(fulpath)+5) :: fulpath2 !Archival full pathname -!------------------------------------------------------------------------ - - ! get local file name from full name: start at end. look for first "/" - - klen = len_trim(fulpath) - do i = klen, 1, -1 - if (fulpath(i:i).eq.'/') go to 100 - end do - i = 0 -100 locfn = fulpath(i+1:klen) - if (len_trim(locfn) == 0) then - write(6,*)'(GETFIL): local filename has zero length' - stop 1 - else - write(6,*)'(GETFIL): attempting to find local file ',trim(locfn) - endif - - ! first check if file is in current working directory. - - inquire (file=locfn,exist=lexist) - if (lexist) then - write(6,*) '(GETFIL): using ',trim(locfn),' in current working directory' - RETURN - endif - - ! second check for full pathname on disk - - inquire(file=fulpath, exist=lexist) - if (lexist) then - locfn = trim(fulpath) - write(6,*) '(GETFIL): using ',trim(fulpath) - RETURN - else - write(6,*) 'GETFIL: FAILED to get '//trim(fulpath) - stop 1 - end if - - end subroutine getfil - -!------------------------------------------------------------------------ -!BOP -! -! !IROUTINE: opnfil -! -! !INTERFACE: - subroutine opnfil (locfn, iun, form) -! -! !DESCRIPTION: -! Open file locfn in unformatted or formatted form on unit iun -! -! !ARGUMENTS: -! - implicit none - character(len=*), intent(in):: locfn !file name - integer, intent(in):: iun !fortran unit number - character(len=1), intent(in):: form !file format: u = unformatted, - !f = formatted -! -! !REVISION HISTORY: -! Created by Mariana Vertenstein -! -! -! !LOCAL VARIABLES: -!EOP - integer ioe !error return from fortran open - character(len=11) ft !format type: formatted. unformatted -!------------------------------------------------------------------------ - - if (len_trim(locfn) == 0) then - write(6,*)'OPNFIL: local filename has zero length' - stop 1 - endif - if (form=='u' .or. form=='U') then - ft = 'unformatted' - else - ft = 'formatted ' - end if - open (unit=iun,file=locfn,status='unknown',form=ft,iostat=ioe) - if (ioe /= 0) then - write(6,*)'(OPNFIL): failed to open file ',trim(locfn), & - & ' on unit ',iun,' ierr=',ioe - stop 1 - else - write(6,*)'(OPNFIL): Successfully opened file ',trim(locfn),' on unit= ',iun - end if - - end subroutine opnfil - -!------------------------------------------------------------------------ -!BOP -! -! !IROUTINE: getavu -! -! !INTERFACE: - integer function getavu() -! -! !DESCRIPTION: -! Get next available Fortran unit number. -! -! !USES: - use shr_file_mod, only : shr_file_getUnit -! -! !ARGUMENTS: - implicit none -! -! !REVISION HISTORY: -! Created by Gordon Bonan -! Modified for clm2 by Mariana Vertenstein -! -! -! !LOCAL VARIABLES: -!EOP -!------------------------------------------------------------------------ - - getavu = shr_file_getunit() - - end function getavu - -!------------------------------------------------------------------------ -!BOP -! -! !IROUTINE: relavu -! -! !INTERFACE: - subroutine relavu (iunit) -! -! !DESCRIPTION: -! Close and release Fortran unit no longer in use! -! -! !USES: - use shr_file_mod, only : shr_file_freeUnit -! -! !ARGUMENTS: - implicit none - integer, intent(in) :: iunit !Fortran unit number -! -! !REVISION HISTORY: -! Created by Gordon Bonan -! -!EOP -!------------------------------------------------------------------------ - - close(iunit) - call shr_file_freeUnit(iunit) - - end subroutine relavu - -end module fileutils diff --git a/tools/mkprocdata_map/src/fmain.F90 b/tools/mkprocdata_map/src/fmain.F90 deleted file mode 100644 index ba9e593c1d..0000000000 --- a/tools/mkprocdata_map/src/fmain.F90 +++ /dev/null @@ -1,78 +0,0 @@ -program fmain - - use mkprocdata_map, only : mkmap - implicit none - - character(len= 256) :: arg - integer :: n !index - integer :: nargs !number of arguments - integer, external :: iargc !number of arguments function - character(len=256) :: filei !input file - character(len=256) :: fileo !output mapped file - character(len=256) :: fmap !maping file - character(len=256) :: ftemplate !template file, containing lat & lon arrays desired in output file - character(len=256) :: cmdline !input command line - integer, parameter :: inival = -999 !initial value for command-line integers - !---------------------------------------------------- - - filei = ' ' - fileo = ' ' - fmap = ' ' - ftemplate = ' ' - - cmdline = 'mkprocdata_map' - nargs = iargc() - n = 1 - do while (n <= nargs) - arg = ' ' - call getarg (n, arg) - n = n + 1 - - select case (arg) - case ('-i') - call getarg (n, arg) - n = n + 1 - filei = trim(arg) - cmdline = trim(cmdline) // ' -i ' // trim(arg) - case ('-o') - call getarg (n, arg) - n = n + 1 - fileo = trim(arg) - cmdline = trim(cmdline) // ' -o ' // trim(arg) - case ('-m') - call getarg (n, arg) - n = n + 1 - fmap = trim(arg) - cmdline = trim(cmdline) // ' -m ' // trim(arg) - case ('-t') - call getarg (n, arg) - n = n + 1 - ftemplate = trim(arg) - cmdline = trim(cmdline) // ' -t ' // trim(arg) - case default - write (6,*) 'Argument ', arg,' is not known' - call usage_exit (' ') - cmdline = trim(cmdline) // ' ' // trim(arg) - end select - end do - - if (filei == ' ' .or. fileo == ' ' .or. fmap == ' ' & - .or. ftemplate == ' ') then - call usage_exit ('Must specify all the following arguments') - end if - - call mkmap (filei, fileo, fmap, ftemplate) - -end program fmain - - -subroutine usage_exit (arg) - implicit none - character(len=*) :: arg - if (arg /= ' ') write (6,*) arg - write (6,*) 'Usage: mkprocdata_map -i -o -m -t