From 3868bdccb30c8d85042c8f0869cbbabf8e62d4c1 Mon Sep 17 00:00:00 2001 From: John Alex Date: Wed, 21 Jun 2023 11:16:14 -0600 Subject: [PATCH 001/243] 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 4edaa461a4cbd56bf98c5014aa85b9cd84e7fe3c Mon Sep 17 00:00:00 2001 From: Jim Edwards Date: Wed, 26 Jun 2024 14:21:18 -0600 Subject: [PATCH 002/243] 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 915af954a034a1e6d4f777623cde90977e614499 Mon Sep 17 00:00:00 2001 From: mvdebolskiy Date: Thu, 8 Aug 2024 10:33:31 -0600 Subject: [PATCH 003/243] 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 85e3124813c808a75390faf6e0be3339c1bb37ff Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Thu, 15 Aug 2024 08:28:38 -0600 Subject: [PATCH 004/243] 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 98404d841a19c1a360fa73da1d377a926108b1a5 Mon Sep 17 00:00:00 2001 From: adamrher Date: Tue, 20 Aug 2024 15:25:28 -0600 Subject: [PATCH 005/243] added polarcap support for cesm3 release --- bld/namelist_files/namelist_defaults_ctsm.xml | 76 +++++++++++++++++++ 1 file changed, 76 insertions(+) diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index 674effd165..273045c837 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -713,6 +713,8 @@ attributes from the config_cache.xml file (with keys converted to upper-case). maxpft="17" use_cn=".false." use_crop=".false." hgrid="ne0np4.ARCTIC.ne30x4" >.true. .true. +.true. .true. @@ -732,6 +734,8 @@ attributes from the config_cache.xml file (with keys converted to upper-case). maxpft="17" use_cn=".false." use_crop=".false." hgrid="ne0np4.ARCTIC.ne30x4" >.true. .true. +.true. .true. @@ -752,6 +756,8 @@ attributes from the config_cache.xml file (with keys converted to upper-case). maxpft="17" use_cn=".false." use_crop=".false." hgrid="ne0np4.ARCTIC.ne30x4" >.true. .true. +.true. .true. @@ -772,6 +778,8 @@ attributes from the config_cache.xml file (with keys converted to upper-case). maxpft="17" use_cn=".false." use_crop=".false." hgrid="ne0np4.ARCTIC.ne30x4" >.true. .true. +.true. .true. @@ -791,6 +799,8 @@ attributes from the config_cache.xml file (with keys converted to upper-case). maxpft="17" use_cn=".false." use_crop=".false." hgrid="ne0np4.ARCTIC.ne30x4" >.true. .true. +.true. .true. @@ -811,6 +821,8 @@ attributes from the config_cache.xml file (with keys converted to upper-case). maxpft="17" use_cn=".false." use_crop=".false." hgrid="ne0np4.ARCTIC.ne30x4" >.true. .true. +.true. .true. @@ -1069,6 +1081,11 @@ 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=ne0np4.POLARCAP.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=ne0np4.POLARCAP.ne30x4 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.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.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.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.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.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.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/surfdata_esmf/ctsm5.2.0/surfdata_ne0np4.ARCTIC.ne30x4_hist_2000_78pfts_c240216.nc + +/glade/derecho/scratch/aherring/restart/ctsm5.2.005/tools/mksurfdata_esmf/surfdata_POLARCAP_ne30x4_hist_2000_78pfts_c240820.nc lnd/clm2/surfdata_esmf/ctsm5.2.0/surfdata_ne0np4CONUS.ne30x8_hist_2000_78pfts_c240216.nc @@ -1939,6 +2011,8 @@ lnd/clm2/surfdata_esmf/ctsm5.2.0/surfdata_ne120np4.pg3_hist_1850_78pfts_c240216. 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_1979_78pfts_c240425.nc + +/glade/derecho/scratch/aherring/restart/ctsm5.2.005/tools/mksurfdata_esmf/surfdata_POLARCAP_ne30x4_SSP2-4.5_1979_78pfts_c240820.nc lnd/clm2/surfdata_esmf/ctsm5.2.0/surfdata_ne0np4CONUS.ne30x8_hist_1979_78pfts_c240425.nc @@ -2046,6 +2120,8 @@ lnd/clm2/surfdata_esmf/NEON/surfdata_1x1_NEON_TOOL_hist_78pfts_CMIP6_simyr2000_c >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 +/glade/derecho/scratch/aherring/restart/ctsm5.2.005/tools/mksurfdata_esmf/landuse.timeseries_POLARCAP_ne30x4_SSP2-4.5_1979-2026_78pfts_c240820.nc lnd/clm2/surfdata_esmf/ctsm5.2.0/landuse.timeseries_ne0np4CONUS.ne30x8_SSP2-4.5_1979-2026_78pfts_c240425.nc From e271432f7ea3b01026a5c6edc023ed1665ba92c5 Mon Sep 17 00:00:00 2001 From: mvdebolskiy Date: Thu, 8 Aug 2024 10:33:31 -0600 Subject: [PATCH 006/243] 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 4161a020d3d2945ea2d9e6cd1c83b98cca4d20a7 Mon Sep 17 00:00:00 2001 From: Adrianna Foster Date: Wed, 4 Sep 2024 10:54:29 -0600 Subject: [PATCH 007/243] 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 008/243] 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 10241e7691eee234ac02cc676fb58205155e3779 Mon Sep 17 00:00:00 2001 From: Adrianna Foster Date: Fri, 6 Sep 2024 11:27:38 -0600 Subject: [PATCH 009/243] 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 f25a251e58f06bc39484c4687f9daeeef14ba1c1 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Fri, 22 Mar 2024 11:24:28 -0600 Subject: [PATCH 010/243] 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 011/243] 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 0eed0336363f964a897f283aa1e88bde48e070c1 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Thu, 19 Sep 2024 10:36:01 -0600 Subject: [PATCH 012/243] Convert I1850 hillslope 5x5_amazon tests to I2000. Avoids requiring new fsurdat. --- cime_config/testdefs/ExpectedTestFails.xml | 2 +- cime_config/testdefs/testlist_clm.xml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cime_config/testdefs/ExpectedTestFails.xml b/cime_config/testdefs/ExpectedTestFails.xml index e18b15a26e..a6ca05446b 100644 --- a/cime_config/testdefs/ExpectedTestFails.xml +++ b/cime_config/testdefs/ExpectedTestFails.xml @@ -194,7 +194,7 @@ - + FAIL #2423 diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index d1c3171c98..5750e9a027 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -3530,7 +3530,7 @@ - + @@ -3540,7 +3540,7 @@ - + From 08d0923c54fc89da2a7ef698722b6282506bf745 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Thu, 19 Sep 2024 11:21:39 -0600 Subject: [PATCH 013/243] Add non-serial HillslopeC 5x5_amazon test to hillslope 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 5750e9a027..79cf2efbcd 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -3543,6 +3543,7 @@ + From 7242a6bfc8029fa4b270fabc3e6327f5d5960b1c Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Thu, 19 Sep 2024 11:22:35 -0600 Subject: [PATCH 014/243] Add issue reference to non-serial HillslopeC 5x5_amazon 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 79cf2efbcd..b92c62be15 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -3547,7 +3547,7 @@ - + From 8361f8b4719c63e7e171d900cbd175ca1e7ec716 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Thu, 19 Sep 2024 11:34:21 -0600 Subject: [PATCH 015/243] Fix HillslopeC test in expected fails list. --- 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 a6ca05446b..35c452b88c 100644 --- a/cime_config/testdefs/ExpectedTestFails.xml +++ b/cime_config/testdefs/ExpectedTestFails.xml @@ -194,7 +194,7 @@ - + FAIL #2423 From c20866f9eb85f53468f5413db1cd37ae9b3fd461 Mon Sep 17 00:00:00 2001 From: Jim Edwards Date: Wed, 25 Sep 2024 08:35:38 -0600 Subject: [PATCH 016/243] remove old version --- .../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 | 108 --- .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 | 129 ---- .../git-fleximod/git_fleximod/git_fleximod.py | 624 ---------------- .../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 | 66 -- 27 files changed, 2987 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 88bc22515e..0000000000 --- a/.lib/git-fleximod/License +++ /dev/null @@ -1,20 +0,0 @@ -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/.lib/git-fleximod/README.md b/.lib/git-fleximod/README.md deleted file mode 100644 index 53917da400..0000000000 --- a/.lib/git-fleximod/README.md +++ /dev/null @@ -1,108 +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 - - 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 a15a226de4..0000000000 --- a/.lib/git-fleximod/git_fleximod/cli.py +++ /dev/null @@ -1,129 +0,0 @@ -from pathlib import Path -import argparse -from git_fleximod import utils - -__version__ = "0.7.8" - -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) - return None - - -def get_parser(): - description = """ - %(prog)s manages checking out groups of gitsubmodules with additional 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 e1b8f484a5..0000000000 --- a/.lib/git-fleximod/git_fleximod/git_fleximod.py +++ /dev/null @@ -1,624 +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 add_remote(git, url): - remotes = git.git_operation("remote", "-v") - newremote = "newremote.00" - 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) - return newremote - -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") - url = gitmodules.get(name, "url") - 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 = url.replace("git@github.com:", "https://github.com/") - tags = rootgit.git_operation("ls-remote", "--tags", url) - result = rootgit.git_operation("submodule","status",newpath).split() - ahash = None - if result: - ahash = result[0][1:] - hhash = None - atag = None - - needsupdate += 1 - if not toplevel and level: - continue - for htag in tags.split("\n"): - if htag.endswith('^{}'): - htag = htag[:-3] - if ahash and not atag and ahash in htag: - atag = (htag.split()[1])[10:] - if tag and not hhash and htag.endswith(tag): - hhash = htag.split()[0] - if hhash and atag: - break - optional = " (optional)" if required and "Optional" in required else "" - if tag and (ahash == hhash or atag == tag): - print(f"e {name:>20} not checked out, aligned at tag {tag}{optional}") - 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}{optional}") - else: - print( - f"e {name:>20} not checked out, out of sync at tag {atag}, expected tag is {tag}{optional}" - ) - testfails += 1 - else: - print(f"e {name:>20} has no fxtag defined in .gitmodules{optional}") - testfails += 1 - else: - with utils.pushd(newpath): - git = GitInterface(newpath, logger) - atag = git.git_operation("describe", "--tags", "--always").rstrip() - ahash = git.git_operation("rev-list", "HEAD").partition("\n")[0] - rurl = git.git_operation("ls-remote","--get-url").rstrip() - if rurl != url: - remote = add_remote(git, url) - git.git_operation("fetch", remote) - 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", "-uno") - 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 - ) - ) - - 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: - add_remote(git, 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 root_dir or not os.path.isfile(os.path.join(root_dir, file_name)): - if root_dir: - file_path = utils.find_upwards(root_dir, file_name) - - if root_dir is None or file_path is None: - root_dir = "." - 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 7e4e05394a..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("git 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 1a2d5ccf2f..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 -git-fleximod with ^C and investigate. A possible cause of hangs is git -requires authentication to access a private repository. On some -systems, 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 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 5b1332549c..0000000000 --- a/.lib/git-fleximod/pyproject.toml +++ /dev/null @@ -1,41 +0,0 @@ -[tool.poetry] -name = "git-fleximod" -version = "0.7.8" -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 c4f7ac96ea..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.8" - -# 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 65ee85d23d..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, out of sync at tag None, expected tag is MPIserial_2.4.0 (optional)", - "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" : "out of sync at tag None, expected tag is e5cf35c", - "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 edde7d816d..0000000000 --- a/.lib/git-fleximod/tests/test_d_complex.py +++ /dev/null @@ -1,66 +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 testtag02" in status.stdout) - assert("AlwaysOptional not checked out, out of sync at tag None, expected tag is 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 testtag02" 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 testtag02" in status.stdout) - assert("AlwaysOptional not checked out, out of sync at tag None, expected tag is 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 testtag02" 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 14043a8c5aa7b0d3c163dcf3d5c32043087234c9 Mon Sep 17 00:00:00 2001 From: Jim Edwards Date: Wed, 25 Sep 2024 09:04:04 -0600 Subject: [PATCH 017/243] Squashed '.lib/git-fleximod/' content from commit 02e859950 git-subtree-dir: .lib/git-fleximod git-subtree-split: 02e859950fd79064ad5b64565ce1073bea5d3ffa --- .github/workflows/pre-commit | 13 + .github/workflows/pytest.yaml | 80 ++++ .pre-commit-config.yaml | 18 + CODE_OF_CONDUCT.md | 107 +++++ 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 | 365 +++++++++++++++++ git_fleximod/gitinterface.py | 92 +++++ git_fleximod/gitmodules.py | 97 +++++ git_fleximod/lstripreader.py | 43 ++ git_fleximod/metoflexi.py | 236 +++++++++++ git_fleximod/submodule.py | 427 ++++++++++++++++++++ git_fleximod/utils.py | 365 +++++++++++++++++ poetry.lock | 693 +++++++++++++++++++++++++++++++++ pyproject.toml | 41 ++ tbump.toml | 43 ++ tests/__init__.py | 3 + tests/conftest.py | 150 +++++++ tests/test_a_import.py | 8 + tests/test_b_update.py | 26 ++ tests/test_c_required.py | 30 ++ tests/test_d_complex.py | 66 ++++ tests/test_e_complex_update.py | 69 ++++ 30 files changed, 3359 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 CODE_OF_CONDUCT.md 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/submodule.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 create mode 100644 tests/test_e_complex_update.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..6cb8102b94 --- /dev/null +++ b/.github/workflows/pytest.yaml @@ -0,0 +1,80 @@ +# 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.12' + + # 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.8.2 + + # 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.8.2 + 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 + - name: Setup tmate session + if: ${{ failure() }} + uses: mxschmitt/action-tmate@v3 + 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/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 0000000000..84f2925bba --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,107 @@ +# Contributor Code of Conduct +_The Contributor Code of Conduct is for participants in our software projects and community._ + +## Our Pledge +We, as contributors, creators, stewards, and maintainers (participants), of **git-fleximod** pledge to make participation in +our software, system or hardware project and community a safe, productive, welcoming and inclusive experience for everyone. +All participants are required to abide by this Code of Conduct. +This includes respectful treatment of everyone regardless of age, body size, disability, ethnicity, gender identity or expression, +level of experience, nationality, political affiliation, veteran status, pregnancy, genetic information, physical appearance, race, +religion, or sexual orientation, as well as any other characteristic protected under applicable US federal or state law. + +## Our Standards +Examples of behaviors that contribute to a positive environment include: + +* All participants are treated with respect and consideration, valuing a diversity of views and opinions +* Be considerate, respectful, and collaborative +* Communicate openly with respect for others, critiquing ideas rather than individuals and gracefully accepting criticism +* Acknowledging the contributions of others +* Avoid personal attacks directed toward other participants +* Be mindful of your surroundings and of your fellow participants +* Alert UCAR staff and suppliers/vendors if you notice a dangerous situation or someone in distress +* Respect the rules and policies of the project and venue + +Examples of unacceptable behavior include, but are not limited to: + +* Harassment, intimidation, or discrimination in any form +* Physical, verbal, or written abuse by anyone to anyone, including repeated use of pronouns other than those requested +* Unwelcome sexual attention or advances +* Personal attacks directed at other guests, members, participants, etc. +* Publishing others' private information, such as a physical or electronic address, without explicit permission +* Alarming, intimidating, threatening, or hostile comments or conduct +* Inappropriate use of nudity and/or sexual images +* Threatening or stalking anyone, including a participant +* Other conduct which could reasonably be considered inappropriate in a professional setting + +## Scope +This Code of Conduct applies to all spaces managed by the Project whether they be physical, online or face-to-face. +This includes project code, code repository, associated web pages, documentation, mailing lists, project websites and wiki pages, +issue tracker, meetings, telecons, events, project social media accounts, and any other forums created by the project team which the +community uses for communication. +In addition, violations of this Code of Conduct outside these spaces may affect a person's ability to participate within them. +Representation of a project may be further defined and clarified by project maintainers. + +## Community Responsibilities +Everyone in the community is empowered to respond to people who are showing unacceptable behavior. +They can talk to them privately or publicly. +Anyone requested to stop unacceptable behavior is expected to comply immediately. +If the behavior continues concerns may be brought to the project administrators or to any other party listed in the +[Reporting](#reporting) section below. + +## Project Administrator Responsibilities +Project administrators are responsible for clarifying the standards of acceptable behavior and are encouraged to model appropriate +behavior and provide support when people in the community point out inappropriate behavior. +Project administrator(s) are normally the ones that would be tasked to carry out the actions in the [Consequences](#consequences) +section below. + +Project administrators are also expected to keep this Code of Conduct updated with the main one housed at UCAR, as listed below in +the [Attribution](#attribution) section. + +## Reporting +Instances of unacceptable behavior can be brought to the attention of the project administrator(s) who may take any action as +outlined in the [Consequences](#consequences) section below. +However, making a report to a project administrator is not considered an 'official report' to UCAR. + +Instances of unacceptable behavior may also be reported directly to UCAR pursuant to [UCAR's Harassment Reporting and Complaint +Procedure](https://www2.fin.ucar.edu/procedures/hr/harassment-reporting-and-complaint-procedure), or anonymously through [UCAR's +EthicsPoint Hotline](https://www2.fin.ucar.edu/ethics/anonymous-reporting). + +Complaints received by UCAR will be handled pursuant to the procedures outlined in UCAR's Harassment Reporting and Complaint +Procedure. +Complaints to UCAR will be held as confidential as practicable under the circumstances, and retaliation against a person who +initiates a complaint or an inquiry about inappropriate behavior will not be tolerated. + +Any Contributor can use these reporting methods even if they are not directly affiliated with UCAR. +The Frequently Asked Questions (FAQ) page for reporting is [here](https://www2.fin.ucar.edu/procedures/hr/reporting-faqs). + +## Consequences +Upon receipt of a complaint, the project administrator(s) may take any action deemed necessary and appropriate under the +circumstances. +Such action can include things such as: removing, editing, or rejecting comments, commits, code, wiki edits, email, issues, and +other contributions that are not aligned to this Code of Conduct, or banning temporarily or permanently any contributor for other +behaviors that are deemed inappropriate, threatening, offensive, or harmful. +Project administrators also have the right to report violations to UCAR HR and/or UCAR's Office of Diversity, Equity and Inclusion +(ODEI), as well as a participant's home institution and/or law enforcement. +In the event an incident is reported to UCAR, UCAR will follow its Harassment Reporting and Complaint Procedure. + +## Process for Changes +All UCAR managed projects are required to adopt this Contributor Code of Conduct. +Adoption is assumed even if not expressly stated in the repository. +Projects should fill in sections where prompted with project-specific information, including, project name and adoption date. + +Projects that adopt this Code of Conduct need to stay up to date with UCAR's Contributor Code of Conduct, linked with a DOI in the +[Attribution](#attribution) section below. +Projects can make limited substantive changes to the Code of Conduct, however, the changes must be limited in scope and may not +contradict the UCAR Contributor Code of Conduct. + +## Attribution +This Code of Conduct was originally adapted from the [Contributor Covenant](http://contributor-covenant.org/version/1/4), version +1.4. +We then aligned it with the UCAR Participant Code of Conduct, which also borrows from the American Geophysical Union (AGU) Code of +Conduct. +The UCAR Participant Code of Conduct applies to both UCAR employees as well as participants in activities run by UCAR. +The original version of this for all software projects that have strong management from UCAR or UCAR staff is available on the UCAR +website at https://doi.org/10.5065/6w2c-a132. +The date that it was adopted by this project was **Feb/13/2018**. +When responding to complaints, UCAR HR and ODEI will do so based on the latest published version. +Therefore, any project-specific changes should follow the [Process for Changes](#process-for-changes) section above. 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..208bc04684 --- /dev/null +++ b/git_fleximod/cli.py @@ -0,0 +1,129 @@ +from pathlib import Path +import argparse +from git_fleximod import utils + +__version__ = "0.9.2" + +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) + return None + + +def get_parser(): + description = """ + %(prog)s manages checking out groups of gitsubmodules with additional 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..0851e9d095 --- /dev/null +++ b/git_fleximod/git_fleximod.py @@ -0,0 +1,365 @@ +#!/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 git_fleximod.submodule import Submodule + +# logger variable is global +logger = None + + +def fxrequired_allowed_values(): + return ["ToplevelRequired", "ToplevelOptional", "AlwaysRequired", "AlwaysOptional", "TopLevelRequired", "TopLevelOptional"] + + +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 = fxrequired_allowed_values() + else: + fxrequired = ["ToplevelRequired", "AlwaysRequired", "TopLevelRequired"] + + 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 = git_toplevelroot(root_dir, logger) + + 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)) + _, remotelist = sprepo_git.git_operation("remote", "-v") + if url not in remotelist: + 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): + if os.path.isdir(os.path.join(topgit,".git")): + shutil.rmtree(os.path.join(topgit,".git")) + 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): + if os.path.isfile(sparsefile): + 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 init_submodule_from_gitmodules(gitmodules, name, root_dir, logger): + path = gitmodules.get(name, "path") + url = gitmodules.get(name, "url") + assert path and url, f"Malformed .gitmodules file {path} {url}" + tag = gitmodules.get(name, "fxtag") + fxurl = gitmodules.get(name, "fxDONOTUSEurl") + fxsparse = gitmodules.get(name, "fxsparse") + fxrequired = gitmodules.get(name, "fxrequired") + return Submodule(root_dir, name, path, url, fxtag=tag, fxurl=fxurl, fxsparse=fxsparse, fxrequired=fxrequired, logger=logger) + +def submodules_status(gitmodules, root_dir, toplevel=False, depth=0): + testfails = 0 + localmods = 0 + needsupdate = 0 + wrapper = textwrap.TextWrapper(initial_indent=' '*(depth*10), width=120,subsequent_indent=' '*(depth*20)) + for name in gitmodules.sections(): + submod = init_submodule_from_gitmodules(gitmodules, name, root_dir, logger) + + result,n,l,t = submod.status() + if toplevel or not submod.toplevel(): + print(wrapper.fill(result)) + testfails += t + localmods += l + needsupdate += n + subdir = os.path.join(root_dir, submod.path) + if os.path.exists(os.path.join(subdir, ".gitmodules")): + gsubmod = GitModules(logger, confpath=subdir) + t,l,n = submodules_status(gsubmod, subdir, depth=depth+1) + if toplevel or not submod.toplevel(): + testfails += t + localmods += l + needsupdate += n + + return testfails, localmods, needsupdate + +def git_toplevelroot(root_dir, logger): + rgit = GitInterface(root_dir, logger) + _, superroot = rgit.git_operation("rev-parse", "--show-superproject-working-tree") + return superroot + +def submodules_update(gitmodules, root_dir, requiredlist, force): + for name in gitmodules.sections(): + submod = init_submodule_from_gitmodules(gitmodules, name, root_dir, logger) + + _, needsupdate, localmods, testfails = submod.status() + if not submod.fxrequired: + submod.fxrequired = "AlwaysRequired" + fxrequired = submod.fxrequired + allowedvalues = fxrequired_allowed_values() + assert fxrequired in allowedvalues + + superroot = git_toplevelroot(root_dir, logger) + + if ( + fxrequired + and ((superroot and "Toplevel" in fxrequired) + or fxrequired not in requiredlist) + ): + if "Optional" in fxrequired and "Optional" not in requiredlist: + if fxrequired.startswith("Always"): + print(f"Skipping optional component {name:>20}") + continue + optional = "AlwaysOptional" in requiredlist + + if fxrequired in requiredlist: + submod.update() + repodir = os.path.join(root_dir, submod.path) + if os.path.exists(os.path.join(repodir, ".gitmodules")): + # recursively handle this checkout + print(f"Recursively checking out submodules of {name}") + gitsubmodules = GitModules(submod.logger, confpath=repodir) + newrequiredlist = ["AlwaysRequired"] + if optional: + newrequiredlist.append("AlwaysOptional") + + submodules_update(gitsubmodules, repodir, newrequiredlist, force=force) + +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) + +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, "fxDONOTUSEurl") + 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 root_dir or not os.path.isfile(os.path.join(root_dir, file_name)): + if root_dir: + file_path = utils.find_upwards(root_dir, file_name) + + if root_dir is None or file_path is None: + root_dir = "." + 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..fb20883cd0 --- /dev/null +++ b/git_fleximod/gitinterface.py @@ -0,0 +1,92 @@ +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): + newargs = [] + for a in args: + # Do not use ssh interface + if isinstance(a, str): + a = a.replace("git@github.com:", "https://github.com/") + newargs.append(a) + + command = self._git_command(operation, *newargs) + if isinstance(command, list): + try: + status, output = utils.execute_subprocess(command, status_to_caller=True, output_to_caller=True) + return status, output.rstrip() + except Exception as e: + sys.exit(e) + else: + return 0, command + + def config_get_value(self, section, name): + if self._use_module: + config = self.repo.config_reader() + try: + val = config.get_value(section, name) + except: + val = None + return val + 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: + if "." in section: + section = section.replace("."," \"")+'"' + 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..cf8b350dd6 --- /dev/null +++ b/git_fleximod/gitmodules.py @@ -0,0 +1,97 @@ +import shutil, os +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("git 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/submodule.py b/git_fleximod/submodule.py new file mode 100644 index 0000000000..c939d54bc9 --- /dev/null +++ b/git_fleximod/submodule.py @@ -0,0 +1,427 @@ +import os +import textwrap +import shutil +import string +from configparser import NoOptionError +from git_fleximod import utils +from git_fleximod.gitinterface import GitInterface + +class Submodule(): + """ + Represents a Git submodule with enhanced features for flexible management. + + Attributes: + name (str): The name of the submodule. + root_dir (str): The root directory of the main project. + path (str): The relative path from the root directory to the submodule. + url (str): The URL of the submodule repository. + fxurl (str): The URL for flexible submodule management (optional). + fxtag (str): The tag for flexible submodule management (optional). + fxsparse (str): Path to the sparse checkout file relative to the submodule path, see git-sparse-checkout for details (optional). + fxrequired (str): Indicates if the submodule is optional or required (optional). + logger (logging.Logger): Logger instance for logging (optional). + """ + def __init__(self, root_dir, name, path, url, fxtag=None, fxurl=None, fxsparse=None, fxrequired=None, logger=None): + """ + Initializes a new Submodule instance with the provided attributes. + """ + self.name = name + self.root_dir = root_dir + self.path = path + self.url = url + self.fxurl = fxurl + self.fxtag = fxtag + self.fxsparse = fxsparse + if fxrequired: + self.fxrequired = fxrequired + else: + self.fxrequired = "AlwaysRequired" + self.logger = logger + + def status(self): + """ + Checks the status of the submodule and returns 4 parameters: + - result (str): The status of the submodule. + - needsupdate (bool): An indicator if the submodule needs to be updated. + - localmods (bool): An indicator if the submodule has local modifications. + - testfails (bool): An indicator if the submodule has failed a test, this is used for testing purposes. + """ + + smpath = os.path.join(self.root_dir, self.path) + testfails = False + localmods = False + needsupdate = False + ahash = None + optional = "" + if "Optional" in self.fxrequired: + optional = " (optional)" + required = None + level = None + if not os.path.exists(os.path.join(smpath, ".git")): + rootgit = GitInterface(self.root_dir, self.logger) + # submodule commands use path, not name + status, tags = rootgit.git_operation("ls-remote", "--tags", self.url) + status, result = rootgit.git_operation("submodule","status",smpath) + result = result.split() + + if result: + ahash = result[0][1:] + hhash = None + atag = None + for htag in tags.split("\n"): + if htag.endswith('^{}'): + htag = htag[:-3] + if ahash and not atag and ahash in htag: + atag = (htag.split()[1])[10:] + if self.fxtag and not hhash and htag.endswith(self.fxtag): + hhash = htag.split()[0] + if hhash and atag: + break + if self.fxtag and (ahash == hhash or atag == self.fxtag): + result = f"e {self.name:>20} not checked out, aligned at tag {self.fxtag}{optional}" + needsupdate = True + elif self.fxtag: + status, ahash = rootgit.git_operation( + "submodule", "status", "{}".format(self.path) + ) + ahash = ahash[1 : len(self.fxtag) + 1] + if self.fxtag == ahash: + result = f"e {self.name:>20} not checked out, aligned at hash {ahash}{optional}" + else: + result = f"e {self.name:>20} not checked out, out of sync at tag {atag}, expected tag is {self.fxtag}{optional}" + testfails = True + needsupdate = True + else: + result = f"e {self.name:>20} has no fxtag defined in .gitmodules{optional}" + testfails = False + else: + with utils.pushd(smpath): + git = GitInterface(smpath, self.logger) + status, remote = git.git_operation("remote") + if remote == '': + result = f"e {self.name:>20} has no associated remote" + testfails = True + needsupdate = True + return result, needsupdate, localmods, testfails + status, rurl = git.git_operation("ls-remote","--get-url") + status, lines = git.git_operation("log", "--pretty=format:\"%h %d\"") + line = lines.partition('\n')[0] + parts = line.split() + ahash = parts[0][1:] + atag = None + if len(parts) > 3: + idx = 0 + while idx < len(parts)-1: + idx = idx+1 + if parts[idx] == 'tag:': + atag = parts[idx+1] + while atag.endswith(')') or atag.endswith(',') or atag.endswith("\""): + atag = atag[:-1] + if atag == self.fxtag: + break + + + #print(f"line is {line} ahash is {ahash} atag is {atag} {parts}") + # atag = git.git_operation("describe", "--tags", "--always") + # ahash = git.git_operation("rev-list", "HEAD").partition("\n")[0] + + recurse = False + if rurl != self.url: + remote = self._add_remote(git) + git.git_operation("fetch", remote) + if self.fxtag and atag == self.fxtag: + result = f" {self.name:>20} at tag {self.fxtag}" + recurse = True + testfails = False + elif self.fxtag and (ahash[: len(self.fxtag)] == self.fxtag or (self.fxtag.find(ahash)==0)): + result = f" {self.name:>20} at hash {ahash}" + recurse = True + testfails = False + elif atag == ahash: + result = f" {self.name:>20} at hash {ahash}" + recurse = True + elif self.fxtag: + result = f"s {self.name:>20} {atag} {ahash} is out of sync with .gitmodules {self.fxtag}" + testfails = True + needsupdate = True + else: + if atag: + result = f"e {self.name:>20} has no fxtag defined in .gitmodules, module at {atag}" + else: + result = f"e {self.name:>20} has no fxtag defined in .gitmodules, module at {ahash}" + testfails = False + + status, output = git.git_operation("status", "--ignore-submodules", "-uno") + if "nothing to commit" not in output: + localmods = True + result = "M" + textwrap.indent(output, " ") +# print(f"result {result} needsupdate {needsupdate} localmods {localmods} testfails {testfails}") + return result, needsupdate, localmods, testfails + + + def _add_remote(self, git): + """ + Adds a new remote to the submodule if it does not already exist. + + This method checks the existing remotes of the submodule. If the submodule's URL is not already listed as a remote, + it attempts to add a new remote. The name for the new remote is generated dynamically to avoid conflicts. If no + remotes exist, it defaults to naming the new remote 'origin'. + + Args: + git (GitInterface): An instance of GitInterface to perform git operations. + + Returns: + str: The name of the new remote if added, or the name of the existing remote that matches the submodule's URL. + """ + status, remotes = git.git_operation("remote", "-v") + remotes = remotes.splitlines() + upstream = None + if remotes: + status, upstream = git.git_operation("ls-remote", "--get-url") + newremote = "newremote.00" + tmpurl = self.url.replace("git@github.com:", "https://github.com/") + line = next((s for s in remotes if self.url in s or tmpurl in s), None) + if line: + newremote = line.split()[0] + return newremote + else: + i = 0 + while newremote in remotes: + i = i + 1 + newremote = f"newremote.{i:02d}" + else: + newremote = "origin" + git.git_operation("remote", "add", newremote, self.url) + return newremote + + def toplevel(self): + """ + Returns True if the submodule is Toplevel (either Required or Optional) + """ + return True if "Top" in self.fxrequired else False + + def sparse_checkout(self): + """ + Performs a sparse checkout of the submodule. + + This method optimizes the checkout process by only checking out files specified in the submodule's sparse-checkout configuration, + rather than the entire submodule content. It achieves this by first ensuring the `.git/info/sparse-checkout` file is created and + configured in the submodule's directory. Then, it proceeds to checkout the desired tag. If the submodule has already been checked out, + this method will not perform the checkout again. + + This approach is particularly beneficial for submodules with a large number of files, as it significantly reduces the time and disk space + required for the checkout process by avoiding the unnecessary checkout and subsequent removal of unneeded files. + + Returns: + None + """ + self.logger.info("Called sparse_checkout for {}".format(self.name)) + rgit = GitInterface(self.root_dir, self.logger) + status, superroot = rgit.git_operation("rev-parse", "--show-superproject-working-tree") + if superroot: + gitroot = superroot.strip() + else: + gitroot = self.root_dir.strip() + # Now need to move the .git dir to the submodule location + rootdotgit = os.path.join(self.root_dir, ".git") + while os.path.isfile(rootdotgit): + with open(rootdotgit) as f: + line = f.readline().rstrip() + if line.startswith("gitdir: "): + rootdotgit = os.path.abspath(os.path.join(self.root_dir,line[8:])) + assert os.path.isdir(rootdotgit) + # first create the module directory + if not os.path.isdir(os.path.join(self.root_dir, self.path)): + os.makedirs(os.path.join(self.root_dir, self.path)) + + # initialize a new git repo and set the sparse checkout flag + sprep_repo = os.path.join(self.root_dir, self.path) + sprepo_git = GitInterface(sprep_repo, self.logger) + if os.path.exists(os.path.join(sprep_repo, ".git")): + try: + self.logger.info("Submodule {} found".format(self.name)) + chk = sprepo_git.config_get_value("core", "sparseCheckout") + if chk == "true": + self.logger.info("Sparse submodule {} already checked out".format(self.name)) + return + except (NoOptionError): + self.logger.debug("Sparse submodule {} not present".format(self.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 + + self.logger.info("Setting remote origin in {}/{}".format(self.root_dir, self.path)) + status, remotes = sprepo_git.git_operation("remote", "-v") + if self.url not in remotes: + sprepo_git.git_operation("remote", "add", "origin", self.url) + + topgit = os.path.join(gitroot, ".git") + + if gitroot != self.root_dir and os.path.isfile(os.path.join(self.root_dir, ".git")): + with open(os.path.join(self.root_dir, ".git")) as f: + gitpath = os.path.relpath( + os.path.join(self.root_dir, f.read().split()[1]), + start=os.path.join(self.root_dir, self.path), + ) + rootdotgit = os.path.join(gitpath, "modules", self.name) + else: + rootdotgit = os.path.relpath( + os.path.join(self.root_dir, ".git", "modules", self.name), + start=os.path.join(self.root_dir, self.path), + ) + + if os.path.isdir(os.path.join(self.root_dir, self.path, ".git")): + with utils.pushd(sprep_repo): + if os.path.isdir(os.path.join(rootdotgit,".git")): + shutil.rmtree(os.path.join(rootdotgit,".git")) + shutil.move(".git", rootdotgit) + with open(".git", "w") as f: + f.write("gitdir: " + os.path.relpath(rootdotgit)) + infodir = os.path.join(rootdotgit, "info") + if not os.path.isdir(infodir): + os.makedirs(infodir) + gitsparse = os.path.abspath(os.path.join(infodir, "sparse-checkout")) + if os.path.isfile(gitsparse): + self.logger.warning( + "submodule {} is already initialized {}".format(self.name, rootdotgit) + ) + return + + with utils.pushd(sprep_repo): + if os.path.isfile(self.fxsparse): + + shutil.copy(self.fxsparse, gitsparse) + + + # Finally checkout the repo + sprepo_git.git_operation("fetch", "origin", "--tags") + status,_ = sprepo_git.git_operation("checkout", self.fxtag) + if status: + print(f"Error checking out {self.name:>20} at {self.fxtag}") + else: + print(f"Successfully checked out {self.name:>20} at {self.fxtag}") + rgit.config_set_value('submodule.' + self.name, "active", "true") + rgit.config_set_value('submodule.' + self.name, "url", self.url) + rgit.config_set_value('submodule.' + self.name, "path", self.path) + + def update(self): + """ + Updates the submodule to the latest or specified version. + + This method handles the update process of the submodule, including checking out the submodule into the specified path, + handling sparse checkouts if configured, and updating the submodule's URL if necessary. It supports both SSH and HTTPS URLs, + automatically converting SSH URLs to HTTPS to avoid issues for users without SSH keys. + + The update process involves the following steps: + 1. If the submodule is configured for sparse checkout, it performs a sparse checkout. + 2. If the submodule is not already checked out, it clones the submodule using the provided URL. + 3. If a specific tag or hash is provided, it checks out that tag; otherwise, it checks out the latest version. + 4. If the root `.git` is a file (indicating a submodule or a worktree), additional steps are taken to integrate the submodule properly. + + Args: + None + Note: + - SSH URLs are automatically converted to HTTPS to accommodate users without SSH keys. + + Returns: + None + """ + git = GitInterface(self.root_dir, self.logger) + repodir = os.path.join(self.root_dir, self.path) + self.logger.info("Checkout {} into {}/{}".format(self.name, self.root_dir, self.path)) + # if url is provided update to the new url + tag = None + repo_exists = False + if os.path.exists(os.path.join(repodir, ".git")): + self.logger.info("Submodule {} already checked out".format(self.name)) + repo_exists = True + # Look for a .gitmodules file in the newly checkedout repo + if self.fxsparse: + print(f"Sparse checkout {self.name} fxsparse {self.fxsparse}") + self.sparse_checkout() + else: + if not repo_exists and self.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 self.url.startswith("git@"): + git.git_operation("clone", self.url, self.path) + smgit = GitInterface(repodir, self.logger) + if not tag: + status, tag = smgit.git_operation("describe", "--tags", "--always") + smgit.git_operation("checkout", tag) + # Now need to move the .git dir to the submodule location + rootdotgit = os.path.join(self.root_dir, ".git") + if os.path.isfile(rootdotgit): + with open(rootdotgit) as f: + line = f.readline() + if line.startswith("gitdir: "): + rootdotgit = line[8:] + + newpath = os.path.abspath(os.path.join(self.root_dir, rootdotgit, "modules", self.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", self.name, "--", self.url, self.path) + + if not repo_exists: + git.git_operation("submodule", "update", "--init", "--", self.path) + + if self.fxtag: + smgit = GitInterface(repodir, self.logger) + newremote = self._add_remote(smgit) + # Trying to distingush a tag from a hash + allowed = set(string.digits + 'abcdef') + if not set(self.fxtag) <= allowed: + # This is a tag + tag = f"refs/tags/{self.fxtag}:refs/tags/{self.fxtag}" + smgit.git_operation("fetch", newremote, tag) + smgit.git_operation("checkout", self.fxtag) + + if not os.path.exists(os.path.join(repodir, ".git")): + utils.fatal_error( + f"Failed to checkout {self.name} {repo_exists} {repodir} {self.path}" + ) + + + if os.path.exists(os.path.join(self.path, ".git")): + submoddir = os.path.join(self.root_dir, self.path) + with utils.pushd(submoddir): + git = GitInterface(submoddir, self.logger) + # first make sure the url is correct + newremote = self._add_remote(git) + status, tags = git.git_operation("tag", "-l") + fxtag = self.fxtag + if fxtag and fxtag not in tags: + git.git_operation("fetch", newremote, "--tags") + status, atag = git.git_operation("describe", "--tags", "--always") + if fxtag and fxtag != atag: + try: + status, _ = git.git_operation("checkout", fxtag) + if not status: + print(f"{self.name:>20} updated to {fxtag}") + except Exception as error: + print(error) + + + elif not fxtag: + print(f"No fxtag found for submodule {self.name:>20}") + else: + print(f"{self.name:>20} up to date.") + + + + return diff --git a/git_fleximod/utils.py b/git_fleximod/utils.py new file mode 100644 index 0000000000..c4f43d5238 --- /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 +git-fleximod with ^C and investigate. A possible cause of hangs is git +requires authentication to access a private repository. On some +systems, 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 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. + msg_context = ( + "Process did not run successfully; " + "returned status {0}".format(error.returncode) + ) + msg = failed_command_msg(msg_context, commands, output=error.output) + if not return_to_caller: + 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..3a74effcd1 --- /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.15.0" +description = "Internationalization utilities" +optional = false +python-versions = ">=3.8" +files = [ + {file = "Babel-2.15.0-py3-none-any.whl", hash = "sha256:08706bdad8d0a3413266ab61bd6c34d0c28d6e1e7badf40a2cebe67644e2e1fb"}, + {file = "babel-2.15.0.tar.gz", hash = "sha256:8daf0e265d05768bc6c7a314cf1321e9a123afc328cc635c18622a2f30a04413"}, +] + +[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.6.2" +description = "Python package for providing Mozilla's CA Bundle." +optional = false +python-versions = ">=3.6" +files = [ + {file = "certifi-2024.6.2-py3-none-any.whl", hash = "sha256:ddc6c8ce995e6987e7faf5e3f1b02b302836a0e5d98ece18392cb1a36c72ad56"}, + {file = "certifi-2024.6.2.tar.gz", hash = "sha256:3cd43f1c6fa7dedc5899d69d3ad0398fd018ad1a17fba83ddaf78aa46c747516"}, +] + +[[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.1" +description = "Backport of PEP 654 (exception groups)" +optional = false +python-versions = ">=3.7" +files = [ + {file = "exceptiongroup-1.2.1-py3-none-any.whl", hash = "sha256:5258b9ed329c5bbdd31a309f53cbfb0b155341807f6ff7606a1e801a891b29ad"}, + {file = "exceptiongroup-1.2.1.tar.gz", hash = "sha256:a4785e48b045528f5bfe627b6ad554ff32def154f42372786903b7abcfe1aa16"}, +] + +[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.43" +description = "GitPython is a Python library used to interact with Git repositories" +optional = false +python-versions = ">=3.7" +files = [ + {file = "GitPython-3.1.43-py3-none-any.whl", hash = "sha256:eec7ec56b92aad751f9912a73404bc02ba212a23adb2c7098ee668417051a1ff"}, + {file = "GitPython-3.1.43.tar.gz", hash = "sha256:35f314a9f878467f5453cc1fee295c3e18e52f1b99f10f6cf5b1682e968a9e7c"}, +] + +[package.dependencies] +gitdb = ">=4.0.1,<5" + +[package.extras] +doc = ["sphinx (==4.3.2)", "sphinx-autodoc-typehints", "sphinx-rtd-theme", "sphinxcontrib-applehelp (>=1.0.2,<=1.0.4)", "sphinxcontrib-devhelp (==1.0.2)", "sphinxcontrib-htmlhelp (>=2.0.0,<=2.0.1)", "sphinxcontrib-qthelp (==1.0.3)", "sphinxcontrib-serializinghtml (==1.1.5)"] +test = ["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", "typing-extensions"] + +[[package]] +name = "idna" +version = "3.7" +description = "Internationalized Domain Names in Applications (IDNA)" +optional = false +python-versions = ">=3.5" +files = [ + {file = "idna-3.7-py3-none-any.whl", hash = "sha256:82fee1fc78add43492d3a1898bfa6d8a904cc97d8427f683ed8e798d07761aa0"}, + {file = "idna-3.7.tar.gz", hash = "sha256:028ff3aadf0609c1fd278d8ea3089299412a7a8b9bd005dd08b9f8285bcb5cfc"}, +] + +[[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 = "8.0.0" +description = "Read metadata from Python packages" +optional = false +python-versions = ">=3.8" +files = [ + {file = "importlib_metadata-8.0.0-py3-none-any.whl", hash = "sha256:15584cf2b1bf449d98ff8a6ff1abef57bf20f3ac6454f431736cd3e660921b2f"}, + {file = "importlib_metadata-8.0.0.tar.gz", hash = "sha256:188bd24e4c346d3f0a933f275c2fec67050326a856b9a359881d7c2a697e8812"}, +] + +[package.dependencies] +zipp = ">=0.5" + +[package.extras] +doc = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-lint"] +perf = ["ipython"] +test = ["flufl.flake8", "importlib-resources (>=1.3)", "jaraco.test (>=5.4)", "packaging", "pyfakefs", "pytest (>=6,!=8.1.*)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)", "pytest-mypy", "pytest-perf (>=0.9.2)", "pytest-ruff (>=0.2.1)"] + +[[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.4" +description = "A very fast and expressive template engine." +optional = false +python-versions = ">=3.7" +files = [ + {file = "jinja2-3.1.4-py3-none-any.whl", hash = "sha256:bc5dd2abb727a5319567b7a813e6a2e7318c39f4f487cfe6c89c6f9c7d25197d"}, + {file = "jinja2-3.1.4.tar.gz", hash = "sha256:4a3aee7acbbe7303aede8e9648d13b8bf88a429282aa6122a993f0ac800cb369"}, +] + +[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 = "24.1" +description = "Core utilities for Python packages" +optional = false +python-versions = ">=3.8" +files = [ + {file = "packaging-24.1-py3-none-any.whl", hash = "sha256:5b8f2217dbdbd2f7f384c41c628544e6d52f2d0f53c6d0c3ea61aa5d1d7ff124"}, + {file = "packaging-24.1.tar.gz", hash = "sha256:026ed72c8ed3fcce5bf8950572258698927fd1dbda10a5e981cdf0ac37f4f002"}, +] + +[[package]] +name = "pluggy" +version = "1.5.0" +description = "plugin and hook calling mechanisms for python" +optional = false +python-versions = ">=3.8" +files = [ + {file = "pluggy-1.5.0-py3-none-any.whl", hash = "sha256:44e1ad92c8ca002de6377e165f3e0f1be63266ab4d554740532335b9d75ea669"}, + {file = "pluggy-1.5.0.tar.gz", hash = "sha256:2cffa88e94fdc978c4c574f15f9e59b7f4201d439195c3715ca9e2486f1d0cf1"}, +] + +[package.extras] +dev = ["pre-commit", "tox"] +testing = ["pytest", "pytest-benchmark"] + +[[package]] +name = "pyfakefs" +version = "5.5.0" +description = "pyfakefs implements a fake file system that mocks the Python file system modules." +optional = false +python-versions = ">=3.7" +files = [ + {file = "pyfakefs-5.5.0-py3-none-any.whl", hash = "sha256:8dbf203ab7bef1529f11f7d41b9478b898e95bf9f3b71262163aac07a518cd76"}, + {file = "pyfakefs-5.5.0.tar.gz", hash = "sha256:7448aaa07142f892d0a4eb52a5ed3206a9f02c6599e686cd97d624c18979c154"}, +] + +[[package]] +name = "pygments" +version = "2.18.0" +description = "Pygments is a syntax highlighting package written in Python." +optional = false +python-versions = ">=3.8" +files = [ + {file = "pygments-2.18.0-py3-none-any.whl", hash = "sha256:b8e6aca0523f3ab76fee51799c488e38782ac06eafcf95e7ba832985c8e7b13a"}, + {file = "pygments-2.18.0.tar.gz", hash = "sha256:786ff802f32e91311bff3889f6e9a86e81505fe99f2735bb6d60ae0c5004f199"}, +] + +[package.extras] +windows-terminal = ["colorama (>=0.4.6)"] + +[[package]] +name = "pytest" +version = "8.2.2" +description = "pytest: simple powerful testing with Python" +optional = false +python-versions = ">=3.8" +files = [ + {file = "pytest-8.2.2-py3-none-any.whl", hash = "sha256:c434598117762e2bd304e526244f67bf66bbd7b5d6cf22138be51ff661980343"}, + {file = "pytest-8.2.2.tar.gz", hash = "sha256:de4bb8104e201939ccdc688b27a89a7be2079b22e2bd2b07f806b6ba71117977"}, +] + +[package.dependencies] +colorama = {version = "*", markers = "sys_platform == \"win32\""} +exceptiongroup = {version = ">=1.0.0rc8", markers = "python_version < \"3.11\""} +iniconfig = "*" +packaging = "*" +pluggy = ">=1.5,<2.0" +tomli = {version = ">=1", markers = "python_version < \"3.11\""} + +[package.extras] +dev = ["argcomplete", "attrs (>=19.2)", "hypothesis (>=3.56)", "mock", "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.32.3" +description = "Python HTTP for Humans." +optional = false +python-versions = ">=3.8" +files = [ + {file = "requests-2.32.3-py3-none-any.whl", hash = "sha256:70761cfe03c773ceb22aa2f671b4757976145175cdfca038c02654d061d6dcc6"}, + {file = "requests-2.32.3.tar.gz", hash = "sha256:55365417734eb18255590a9ff9eb97e9e1da868d4ccd6402399eaf68af20a760"}, +] + +[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.2" +description = "HTTP library with thread-safe connection pooling, file post, and more." +optional = false +python-versions = ">=3.8" +files = [ + {file = "urllib3-2.2.2-py3-none-any.whl", hash = "sha256:a448b2f64d686155468037e1ace9f2d2199776e17f0a46610480d311f73e3472"}, + {file = "urllib3-2.2.2.tar.gz", hash = "sha256:dd505485549a7a552833da5e6063639d0d177c04f23bc3864e41e5dc5f612168"}, +] + +[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.19.2" +description = "Backport of pathlib-compatible object wrapper for zip files" +optional = false +python-versions = ">=3.8" +files = [ + {file = "zipp-3.19.2-py3-none-any.whl", hash = "sha256:f091755f667055f2d02b32c53771a7a6c8b47e1fdbc4b72a8b9072b3eef8015c"}, + {file = "zipp-3.19.2.tar.gz", hash = "sha256:bf1dcf6450f873a13e952a29504887c89e6de7506209e5b1bcc3460135d4de19"}, +] + +[package.extras] +doc = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-lint"] +test = ["big-O", "importlib-resources", "jaraco.functools", "jaraco.itertools", "jaraco.test", "more-itertools", "pytest (>=6,!=8.1.*)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)", "pytest-ignore-flaky", "pytest-mypy", "pytest-ruff (>=0.2.1)"] + +[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..619cdabe3b --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,41 @@ +[tool.poetry] +name = "git-fleximod" +version = "0.9.2" +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..920ff0591c --- /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.9.2" + +# 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..81edbe713e --- /dev/null +++ b/tests/conftest.py @@ -0,0 +1,150 @@ +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, out of sync at tag None, expected tag is MPIserial_2.4.0 (optional)", + "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" : "out of sync at tag None, expected tag is e5cf35c", + "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") + gitp.git_operation("checkout", "v0.0.1") + return test_dir + +@pytest.fixture +def complex_update(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") + gitp.git_operation("checkout", "v0.0.2") + + 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..edde7d816d --- /dev/null +++ b/tests/test_d_complex.py @@ -0,0 +1,66 @@ +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 testtag02" in status.stdout) + assert("AlwaysOptional not checked out, out of sync at tag None, expected tag is 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 testtag02" 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 testtag02" in status.stdout) + assert("AlwaysOptional not checked out, out of sync at tag None, expected tag is 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 testtag02" 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/tests/test_e_complex_update.py b/tests/test_e_complex_update.py new file mode 100644 index 0000000000..0c3ab4c6a6 --- /dev/null +++ b/tests/test_e_complex_update.py @@ -0,0 +1,69 @@ +import pytest +from pathlib import Path +from git_fleximod.gitinterface import GitInterface + +def test_complex_update(git_fleximod, complex_update, logger): + status = git_fleximod(complex_update, "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, out of sync at tag testtag02, expected tag is testtag3" in status.stdout) + assert("AlwaysOptional not checked out, out of sync at tag None, expected tag is MPIserial_2.3.0" in status.stdout) + + # This should checkout and update test_submodule and complex_sub + result = git_fleximod(complex_update, "update") + assert result.returncode == 0 + + status = git_fleximod(complex_update, "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 testtag3" in status.stdout) + + # now check the complex_sub + root = (complex_update / "modules" / "complex") + assert(not (root / "libraries" / "gptl" / ".git").exists()) + assert(not (root / "libraries" / "mpi-serial" / ".git").exists()) + assert((root / "modules" / "mpi-serialAR" / ".git").exists()) + assert((root / "modules" / "mpi-serialSAR" / ".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_update, "update ToplevelOptional") + assert result.returncode == 0 + + status = git_fleximod(complex_update, "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 testtag3" in status.stdout) + assert("AlwaysOptional not checked out, out of sync at tag None, expected tag is MPIserial_2.3.0" in status.stdout) + + # Finally update optional + result = git_fleximod(complex_update, "update --optional") + assert result.returncode == 0 + + status = git_fleximod(complex_update, "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 testtag3" in status.stdout) + assert("AlwaysOptional at tag MPIserial_2.3.0" in status.stdout) + + # now check the complex_sub + root = (complex_update / "modules" / "complex" ) + assert(not (root / "libraries" / "gptl" / ".git").exists()) + assert(not (root / "libraries" / "mpi-serial" / ".git").exists()) + assert(not (root / "modules" / "mpi-serial" / ".git").exists()) + assert((root / "modules" / "mpi-serialAR" / ".git").exists()) + assert((root / "modules" / "mpi-serialSAR" / ".git").exists()) + assert((root / "modules" / "mpi-sparse" / ".git").exists()) + assert((root / "modules" / "mpi-serial2" / ".git").exists()) + assert((root / "modules" / "mpi-sparse" / "m4").exists()) + assert(not (root / "modules" / "mpi-sparse" / "README").exists()) + + From 6c7ecf62ddb7e742a4b993ec9f351d6cd7025a93 Mon Sep 17 00:00:00 2001 From: Keith Oleson Date: Wed, 25 Sep 2024 11:19:25 -0600 Subject: [PATCH 018/243] PPE change to sa_leaf --- src/biogeophys/CanopyFluxesMod.F90 | 1 + 1 file changed, 1 insertion(+) diff --git a/src/biogeophys/CanopyFluxesMod.F90 b/src/biogeophys/CanopyFluxesMod.F90 index a969dc0583..0c5431728d 100644 --- a/src/biogeophys/CanopyFluxesMod.F90 +++ b/src/biogeophys/CanopyFluxesMod.F90 @@ -753,6 +753,7 @@ subroutine CanopyFluxes(bounds, num_exposedvegp, filter_exposedvegp, .or. dbh(p) < min_stem_diameter) then frac_rad_abs_by_stem(p) = 0.0_r8 sa_stem(p) = 0.0_r8 + sa_leaf(p) = sa_leaf(p) + esai(p) endif ! if using Satellite Phenology mode, calculate leaf and stem biomass From a9cd52f0191feaa387b6d3f1fc5c245a4d29b4f0 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Fri, 20 Sep 2024 09:15:54 -0600 Subject: [PATCH 019/243] Error in Hillslope/shell_commands if running on grid w/o a hillslope_file. --- .../testmods_dirs/clm/Hillslope/shell_commands | 12 ++++++++++++ .../testdefs/testmods_dirs/clm/Hillslope/user_nl_clm | 2 -- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/cime_config/testdefs/testmods_dirs/clm/Hillslope/shell_commands b/cime_config/testdefs/testmods_dirs/clm/Hillslope/shell_commands index a2759b51b4..9b50ed6fe5 100644 --- a/cime_config/testdefs/testmods_dirs/clm/Hillslope/shell_commands +++ b/cime_config/testdefs/testmods_dirs/clm/Hillslope/shell_commands @@ -1,5 +1,17 @@ ./xmlchange CLM_BLDNML_OPTS="-bgc sp" DIN_LOC_ROOT=$(./xmlquery --value DIN_LOC_ROOT) + +# Set hillslope_file. Needed for any grids without default hillslope_file already set by CTSM. +lnd_grid=$(./xmlquery --value LND_GRID) +if [[ ${lnd_grid} == "10x15" ]]; then + hillslope_file='$DIN_LOC_ROOT/lnd/clm2/testdata/synthetic_cosphill_1.3.nc' +else + echo "ERROR: Hillslope file not found for LND_GRID=${lnd_grid}" >&2 + exit 1 +fi +echo -e "hillslope_file = '${hillslope_file}'\n" >> user_nl_clm + +# Set mesh file meshfile=$DIN_LOC_ROOT/lnd/clm2/testdata/ESMFmesh_10x15_synthetic_cosphill_1.0.nc ./xmlchange ATM_DOMAIN_MESH=${meshfile},LND_DOMAIN_MESH=${meshfile} 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 c750400672..e108e93d91 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,4 @@ hillslope_transmissivity_method = 'LayerSum' hillslope_pft_distribution_method = 'PftLowlandUpland' hillslope_soil_profile_method = 'Uniform' -hillslope_file = '$DIN_LOC_ROOT/lnd/clm2/testdata/synthetic_cosphill_1.3.nc' - use_ssre = .false. From d837838470375f1ce191cf193025530d327b1681 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Wed, 25 Sep 2024 16:30:48 -0600 Subject: [PATCH 020/243] Hillslope testmod: Add hillslope_file for 5x5_amazon. --- cime_config/testdefs/testmods_dirs/clm/Hillslope/shell_commands | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cime_config/testdefs/testmods_dirs/clm/Hillslope/shell_commands b/cime_config/testdefs/testmods_dirs/clm/Hillslope/shell_commands index 9b50ed6fe5..06576c405f 100644 --- a/cime_config/testdefs/testmods_dirs/clm/Hillslope/shell_commands +++ b/cime_config/testdefs/testmods_dirs/clm/Hillslope/shell_commands @@ -5,6 +5,8 @@ DIN_LOC_ROOT=$(./xmlquery --value DIN_LOC_ROOT) lnd_grid=$(./xmlquery --value LND_GRID) if [[ ${lnd_grid} == "10x15" ]]; then hillslope_file='$DIN_LOC_ROOT/lnd/clm2/testdata/synthetic_cosphill_1.3.nc' +elif [[ ${lnd_grid} == "5x5_amazon" ]]; then + hillslope_file='/glade/derecho/scratch/samrabin/hillslopes_5x5_amazon/hand_analysis_global/combined/hilldata_5x5_amazon_hist_2000_78pfts_c240216.nc' else echo "ERROR: Hillslope file not found for LND_GRID=${lnd_grid}" >&2 exit 1 From cb7e9223d7d773fe2d066906c5621a0b39937dfd Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Thu, 26 Sep 2024 12:48:48 -0600 Subject: [PATCH 021/243] Don't manually set meshfile in Hillslope tests. --- .../testdefs/testmods_dirs/clm/Hillslope/shell_commands | 4 ---- 1 file changed, 4 deletions(-) diff --git a/cime_config/testdefs/testmods_dirs/clm/Hillslope/shell_commands b/cime_config/testdefs/testmods_dirs/clm/Hillslope/shell_commands index 06576c405f..33504f51f4 100644 --- a/cime_config/testdefs/testmods_dirs/clm/Hillslope/shell_commands +++ b/cime_config/testdefs/testmods_dirs/clm/Hillslope/shell_commands @@ -13,9 +13,5 @@ else fi echo -e "hillslope_file = '${hillslope_file}'\n" >> user_nl_clm -# Set mesh file -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 c393123b48f148041c713d0478da4f6d6d5d237a Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Thu, 26 Sep 2024 22:10:19 -0700 Subject: [PATCH 022/243] correct clm_demand option typo --- .../testdefs/testmods_dirs/clm/FatesColdLandUse/shell_commands | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesColdLandUse/shell_commands b/cime_config/testdefs/testmods_dirs/clm/FatesColdLandUse/shell_commands index c97c0dfea7..d88457df12 100644 --- a/cime_config/testdefs/testmods_dirs/clm/FatesColdLandUse/shell_commands +++ b/cime_config/testdefs/testmods_dirs/clm/FatesColdLandUse/shell_commands @@ -1,3 +1,3 @@ #!/bin/bash -./xmlchange CLM_BLDNML_OPTS="-i-clm_demand -flanduse_timeseries" --append +./xmlchange CLM_BLDNML_OPTS="--clm_demand -flanduse_timeseries" --append From e591a1a677e9576382be2d6d2025ebc9b5760a24 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Fri, 27 Sep 2024 12:12:35 -0600 Subject: [PATCH 023/243] Remove parallel 5x5_amazon 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 35c452b88c..c4f4ac0fc7 100644 --- a/cime_config/testdefs/ExpectedTestFails.xml +++ b/cime_config/testdefs/ExpectedTestFails.xml @@ -194,13 +194,6 @@ - - - FAIL - #2423 - - - FAIL From 4f2129fb4a70120e6e0163a66a77073d653579bf Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Fri, 27 Sep 2024 12:28:08 -0600 Subject: [PATCH 024/243] Rename 10x15 synthetic hillslope_file to include 10x15. --- cime_config/testdefs/testmods_dirs/clm/Hillslope/shell_commands | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cime_config/testdefs/testmods_dirs/clm/Hillslope/shell_commands b/cime_config/testdefs/testmods_dirs/clm/Hillslope/shell_commands index 33504f51f4..7bec6fd7f6 100644 --- a/cime_config/testdefs/testmods_dirs/clm/Hillslope/shell_commands +++ b/cime_config/testdefs/testmods_dirs/clm/Hillslope/shell_commands @@ -4,7 +4,7 @@ DIN_LOC_ROOT=$(./xmlquery --value DIN_LOC_ROOT) # Set hillslope_file. Needed for any grids without default hillslope_file already set by CTSM. lnd_grid=$(./xmlquery --value LND_GRID) if [[ ${lnd_grid} == "10x15" ]]; then - hillslope_file='$DIN_LOC_ROOT/lnd/clm2/testdata/synthetic_cosphill_1.3.nc' + hillslope_file='$DIN_LOC_ROOT/lnd/clm2/testdata/synthetic_cosphill_10x15_1.3.nc' elif [[ ${lnd_grid} == "5x5_amazon" ]]; then hillslope_file='/glade/derecho/scratch/samrabin/hillslopes_5x5_amazon/hand_analysis_global/combined/hilldata_5x5_amazon_hist_2000_78pfts_c240216.nc' else From ad0ab606eb7b1dbda164979a531c64581f4a4a06 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Fri, 27 Sep 2024 12:33:38 -0600 Subject: [PATCH 025/243] Add/edit comments about 5x5_amazon hillslope tests. --- 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 b92c62be15..d27d1d0ec9 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -3537,6 +3537,7 @@ + @@ -3547,7 +3548,7 @@ - + From 061b1c90bc2391fea6a13a162b007b3bf0857158 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Fri, 27 Sep 2024 12:36:12 -0600 Subject: [PATCH 026/243] Remove parallel 5x5_amazon hillslope test from aux_clm. --- 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 d27d1d0ec9..c27cd3eda2 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -3543,7 +3543,6 @@ - From 039626c391e5e25761fc6200796c7a13f2a24f87 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Fri, 27 Sep 2024 16:03:16 -0600 Subject: [PATCH 027/243] Fix clm-basic tests --- cime_config/config_component.xml | 10 +++++----- cime_config/config_compsets.xml | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/cime_config/config_component.xml b/cime_config/config_component.xml index 3fb682ccf0..ec78008477 100644 --- a/cime_config/config_component.xml +++ b/cime_config/config_component.xml @@ -14,7 +14,7 @@ clm4.5: - clm5.0: + clm6.0: clm5.1: clm6.0: Satellite phenology: @@ -367,10 +367,10 @@ $COMP_ROOT_DIR_LND/cime_config/usermods_dirs/fates_sp $COMP_ROOT_DIR_LND/cime_config/usermods_dirs/fates_sp - $COMP_ROOT_DIR_LND/cime_config/usermods_dirs/cmip6_deck - $COMP_ROOT_DIR_LND/cime_config/usermods_dirs/cmip6_nociso_deck - $COMP_ROOT_DIR_LND/cime_config/usermods_dirs/cmip6_waccm_deck - $COMP_ROOT_DIR_LND/cime_config/usermods_dirs/cmip6_waccm_nociso_deck + $COMP_ROOT_DIR_LND/cime_config/usermods_dirs/cmip6_deck + $COMP_ROOT_DIR_LND/cime_config/usermods_dirs/cmip6_nociso_deck + $COMP_ROOT_DIR_LND/cime_config/usermods_dirs/cmip6_waccm_deck + $COMP_ROOT_DIR_LND/cime_config/usermods_dirs/cmip6_waccm_nociso_deck run_component_ctsm env_case.xml diff --git a/cime_config/config_compsets.xml b/cime_config/config_compsets.xml index 538329e523..7618c51c98 100644 --- a/cime_config/config_compsets.xml +++ b/cime_config/config_compsets.xml @@ -197,15 +197,15 @@ - I1850Clm50BgcCropCmip6 - 1850_DATM%GSWP3v1_CLM50%BGC-CROP-CMIP6DECK_SICE_SOCN_MOSART_SGLC_SWAV + I1850Clm60BgcCropCmip6 + 1850_DATM%GSWP3v1_CLM60%BGC-CROP-CMIP6DECK_SICE_SOCN_MOSART_SGLC_SWAV - I1850Clm50BgcCropCmip6waccm - 1850_DATM%GSWP3v1_CLM50%BGC-CROP-CMIP6WACCMDECK_SICE_SOCN_MOSART_SGLC_SWAV + I1850Clm60BgcCropCmip6waccm + 1850_DATM%GSWP3v1_CLM60%BGC-CROP-CMIP6WACCMDECK_SICE_SOCN_MOSART_SGLC_SWAV From 70c9f8b5a825b9271cf0c268f72876f0834f687e Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Fri, 27 Sep 2024 18:08:39 -0600 Subject: [PATCH 028/243] Updates for my fix to take effect correctly --- cime_config/config_component.xml | 8 ++++++-- cime_config/config_compsets.xml | 8 ++++++++ cime_config/testdefs/testlist_clm.xml | 6 +++--- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/cime_config/config_component.xml b/cime_config/config_component.xml index ec78008477..454e95826e 100644 --- a/cime_config/config_component.xml +++ b/cime_config/config_component.xml @@ -14,9 +14,9 @@ clm4.5: - clm6.0: + clm6.0: clm5.1: - clm6.0: + clm6.0: Satellite phenology: Satellite phenology with VIC hydrology: @@ -367,6 +367,10 @@ $COMP_ROOT_DIR_LND/cime_config/usermods_dirs/fates_sp $COMP_ROOT_DIR_LND/cime_config/usermods_dirs/fates_sp + $COMP_ROOT_DIR_LND/cime_config/usermods_dirs/cmip6_deck + $COMP_ROOT_DIR_LND/cime_config/usermods_dirs/cmip6_nociso_deck + $COMP_ROOT_DIR_LND/cime_config/usermods_dirs/cmip6_waccm_deck + $COMP_ROOT_DIR_LND/cime_config/usermods_dirs/cmip6_waccm_nociso_deck $COMP_ROOT_DIR_LND/cime_config/usermods_dirs/cmip6_deck $COMP_ROOT_DIR_LND/cime_config/usermods_dirs/cmip6_nociso_deck $COMP_ROOT_DIR_LND/cime_config/usermods_dirs/cmip6_waccm_deck diff --git a/cime_config/config_compsets.xml b/cime_config/config_compsets.xml index 7618c51c98..e5d716384a 100644 --- a/cime_config/config_compsets.xml +++ b/cime_config/config_compsets.xml @@ -196,6 +196,10 @@ + + I1850Clm50BgcCropCmip6 + 1850_DATM%GSWP3v1_CLM50%BGC-CROP-CMIP6DECK_SICE_SOCN_MOSART_SGLC_SWAV + I1850Clm60BgcCropCmip6 1850_DATM%GSWP3v1_CLM60%BGC-CROP-CMIP6DECK_SICE_SOCN_MOSART_SGLC_SWAV @@ -203,6 +207,10 @@ + + I1850Clm50BgcCropCmip6waccm + 1850_DATM%GSWP3v1_CLM50%BGC-CROP-CMIP6WACCMDECK_SICE_SOCN_MOSART_SGLC_SWAV + I1850Clm60BgcCropCmip6waccm 1850_DATM%GSWP3v1_CLM60%BGC-CROP-CMIP6WACCMDECK_SICE_SOCN_MOSART_SGLC_SWAV diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index 0eb3d5012d..f0c089f3a4 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -1732,7 +1732,7 @@ - + @@ -2431,7 +2431,7 @@ - + @@ -3262,7 +3262,7 @@ - + From 698902d003d582babbc08dcf993fc7ac752d2637 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Fri, 27 Sep 2024 18:15:09 -0600 Subject: [PATCH 029/243] Small important correction --- 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 454e95826e..540d285a85 100644 --- a/cime_config/config_component.xml +++ b/cime_config/config_component.xml @@ -14,7 +14,7 @@ clm4.5: - clm6.0: + clm5.0: clm5.1: clm6.0: Satellite phenology: From bcbc46295766fc4e2ce1421fdf6876bc50040360 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Mon, 30 Sep 2024 12:19:57 -0600 Subject: [PATCH 030/243] Change testlist_clm ne30pg3_t061 tests to ne30pg3_t232 --- 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 0eb3d5012d..34a9caffb5 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -1987,7 +1987,7 @@ - + @@ -1996,7 +1996,7 @@ - + From f312b8add316daca532a9be6ba6a96c695a654a0 Mon Sep 17 00:00:00 2001 From: "Danny M. Leung" Date: Mon, 30 Sep 2024 13:36:55 -0600 Subject: [PATCH 031/243] First commit for CESM3 tuning of the dust emission module by dmleung. 30 Sep 2024 --- src/biogeochem/DustEmisLeung2023.F90 | 10 ++++++---- src/biogeophys/SoilStateInitTimeConstMod.F90 | 4 +++- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/biogeochem/DustEmisLeung2023.F90 b/src/biogeochem/DustEmisLeung2023.F90 index 869c18c0dc..b77dcae9dc 100644 --- a/src/biogeochem/DustEmisLeung2023.F90 +++ b/src/biogeochem/DustEmisLeung2023.F90 @@ -384,14 +384,16 @@ subroutine DustEmission (this, bounds, & 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) + ! dmleung has these variables and will change them into pointers and prepare for their history outputs. 30 Sep 2024 real(r8) :: bare_frc ! LUH2 bare soil land cover fraction - real(r8) :: veg_frc ! LUH2 natural vegetation + crop land cover fraction + real(r8) :: natveg_frc ! LUH2 natural vegetation cover fraction + real(r8) :: crop_frc ! LUH2 crop 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 = 1.0_r8 ! [m2 m-2] new VAI threshold; Danny M. Leung suggests 1, and Zender's scheme uses 0.3 + real(r8), parameter :: vai_mbl_thr = 0.5_r8 ! [m2 m-2] new VAI threshold; Danny M. Leung suggests something between 0.6 and 1 for tuning. Zender's scheme uses 0.3. Simone Tilmes might want this as a namelist variable for easier CESM tuning. dmleung 30 Sep 2024. 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 @@ -407,7 +409,7 @@ subroutine DustEmission (this, bounds, & 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 :: frag_expt_thr = 2.5_r8 ! [dimless] Maximum value or threshold for fragmentation exponent defined in Leung et al. (2023). Danny M. Leung suggested it to be somewhere between 3 and 5 for tuning. 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. Update: Simone Tilmes might want this as a namelist variable for easier CESM tuning. 30 Sep 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. @@ -886,4 +888,4 @@ end subroutine SetDragPartition !============================================================================== -end module DustEmisLeung2023 \ No newline at end of file +end module DustEmisLeung2023 diff --git a/src/biogeophys/SoilStateInitTimeConstMod.F90 b/src/biogeophys/SoilStateInitTimeConstMod.F90 index e6fcca0f27..fc542075fe 100644 --- a/src/biogeophys/SoilStateInitTimeConstMod.F90 +++ b/src/biogeophys/SoilStateInitTimeConstMod.F90 @@ -765,12 +765,14 @@ real(r8) function ThresholdSoilMoistZender2003( clay ) !------------------------------------------------------------------------------ real(r8), intent(IN) :: clay ! Fraction of clay in the soil (%) + real(r8), parameter :: a = 0.5_r8 ! Tuning factor for the soil moisture effect. This parameter could also be added into ThresholdSoilMoistKok2014. Simone Tilmes suggested to change this parameter into a namelist variable for easier CESM tuning. dmleung 30 Sep 2024. + if ( clay < 0.0_r8 .or. clay > 100.0_r8 )then ThresholdSoilMoistZender2003 = nan call endrun( 'Clay fraction is out of bounds (0 to 100)') return end if - ThresholdSoilMoistZender2003 = 0.17_r8 + 0.14_r8 * clay * 0.01_r8 + ThresholdSoilMoistZender2003 = a * ( 0.17_r8 + 0.14_r8 * (clay*0.01_r8) ) end function ThresholdSoilMoistZender2003 !------------------------------------------------------------------------------ From d3d4e2ee89246654d02b22f286c4365ef63de92b Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Mon, 30 Sep 2024 17:08:32 -0600 Subject: [PATCH 032/243] Allocate elevclass_o before use in mkglcmecMod.F90 --- tools/mksurfdata_esmf/src/mkglcmecMod.F90 | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/mksurfdata_esmf/src/mkglcmecMod.F90 b/tools/mksurfdata_esmf/src/mkglcmecMod.F90 index 25fa4a8edc..4bc3d83e06 100644 --- a/tools/mksurfdata_esmf/src/mkglcmecMod.F90 +++ b/tools/mksurfdata_esmf/src/mkglcmecMod.F90 @@ -100,6 +100,7 @@ subroutine mkglcmecInit( pioid_o ) call shr_sys_abort() end if + allocate(elevclass_o(size(elevclass))) elevclass_o(:) = elevclass(:) if (root_task) write(ndiag, '(a)') trim(subname)//" writing out GLC_MEC" From f40ee1a4174c318d3580d7c0810098e4ff5627c3 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Mon, 30 Sep 2024 17:30:16 -0600 Subject: [PATCH 033/243] Change testlist_clm C96_t061 test to C96_t232 --- 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 34a9caffb5..25bedadb76 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -195,7 +195,7 @@ - + From b15640f6d35ecc95bdeb6157561e8f8cee741e07 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Mon, 30 Sep 2024 18:16:33 -0600 Subject: [PATCH 034/243] Remove elevclass_o altogether because it is NOT used --- tools/mksurfdata_esmf/src/mkglcmecMod.F90 | 4 ---- 1 file changed, 4 deletions(-) diff --git a/tools/mksurfdata_esmf/src/mkglcmecMod.F90 b/tools/mksurfdata_esmf/src/mkglcmecMod.F90 index 4bc3d83e06..6dc363ecac 100644 --- a/tools/mksurfdata_esmf/src/mkglcmecMod.F90 +++ b/tools/mksurfdata_esmf/src/mkglcmecMod.F90 @@ -49,7 +49,6 @@ subroutine mkglcmecInit( pioid_o ) ! local variables: type(var_desc_t) :: pio_varid type(io_desc_t) :: pio_iodesc - real(r8), allocatable :: elevclass_o(:) ! elevation classes integer :: rcode character(len=*), parameter :: subname = 'mkglcmecInit' !----------------------------------------------------------------------- @@ -100,9 +99,6 @@ subroutine mkglcmecInit( pioid_o ) call shr_sys_abort() end if - allocate(elevclass_o(size(elevclass))) - elevclass_o(:) = elevclass(:) - if (root_task) write(ndiag, '(a)') trim(subname)//" writing out GLC_MEC" rcode = pio_inq_varid(pioid_o, 'GLC_MEC', pio_varid) rcode = pio_put_var(pioid_o, pio_varid, elevclass) From 191a399fe12f92dc93edfcf6169d9ebd1808b353 Mon Sep 17 00:00:00 2001 From: "Danny M. Leung" Date: Mon, 30 Sep 2024 18:20:10 -0600 Subject: [PATCH 035/243] dmleung deleted a few unused parameters and variables. 30 Sep 2024 --- src/biogeochem/DustEmisLeung2023.F90 | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/biogeochem/DustEmisLeung2023.F90 b/src/biogeochem/DustEmisLeung2023.F90 index b77dcae9dc..31f827faaf 100644 --- a/src/biogeochem/DustEmisLeung2023.F90 +++ b/src/biogeochem/DustEmisLeung2023.F90 @@ -358,10 +358,6 @@ subroutine DustEmission (this, bounds, & ! !LOCAL VARIABLES integer :: fp,p,c,l,g,m,n ! indices real(r8) :: liqfrac ! fraction of total water that is liquid - real(r8) :: wnd_frc_rat ! [frc] Wind friction threshold over wind friction - real(r8) :: wnd_frc_slt_dlt ! [m s-1] Friction velocity increase from saltatn - real(r8) :: wnd_rfr_dlt ! [m s-1] Reference windspeed excess over threshld - real(r8) :: dst_slt_flx_rat_ttl real(r8) :: flx_mss_hrz_slt_ttl real(r8) :: flx_mss_vrt_dst_ttl(bounds%begp:bounds%endp) real(r8) :: frc_thr_wet_fct @@ -391,8 +387,6 @@ subroutine DustEmission (this, bounds, & ! ! 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.5_r8 ! [m2 m-2] new VAI threshold; Danny M. Leung suggests something between 0.6 and 1 for tuning. Zender's scheme uses 0.3. Simone Tilmes might want this as a namelist variable for easier CESM tuning. dmleung 30 Sep 2024. real(r8), parameter :: Cd0 = 4.4e-5_r8 ! [dimless] proportionality constant in calculation of dust emission coefficient From efbeafc636410a0361054453cc7084f56af73bed Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Mon, 30 Sep 2024 18:33:21 -0600 Subject: [PATCH 036/243] Revert change to C96 test; will do later, when ccs_config gets updated --- 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 25bedadb76..34a9caffb5 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -195,7 +195,7 @@ - + From 79811dd9e5af7892aad6f1bac6d3c241c5f23491 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Mon, 30 Sep 2024 17:02:50 -0600 Subject: [PATCH 037/243] Add domain check for hillslope file. --- src/main/surfrdMod.F90 | 140 ++++++++++++++++++++++++----------------- 1 file changed, 81 insertions(+), 59 deletions(-) diff --git a/src/main/surfrdMod.F90 b/src/main/surfrdMod.F90 index 88a4dbd30b..af92aea48d 100644 --- a/src/main/surfrdMod.F90 +++ b/src/main/surfrdMod.F90 @@ -45,6 +45,82 @@ module surfrdMod contains + subroutine check_domain_attributes(ncid, begg, endg, ldomain, info) + ! !DESCRIPTION: + ! Checks for mismatches between the land domain and a surface or similar dataset's domain. + ! + ! !USES: + use domainMod, only : domain_type, domain_init + ! + ! !ARGUMENTS + type(file_desc_t), intent(inout) :: ncid ! netcdf id for input file + integer, intent(in) :: begg, endg + type(domain_type), intent(in) :: ldomain ! land domain + character(len=*), intent(in) :: info ! information to include in messages + ! + ! !LOCAL VARIABLES + type(domain_type) :: surfdata_domain ! local domain associated with dataset + logical :: readvar ! true => variable is on dataset + logical :: istype_domain ! true => input file is of type domain + character(len=16) :: lon_var, lat_var ! names of lat/lon on dataset + logical :: isgrid2d ! true => input grid is 2d + integer :: ni, nj, ns ! domain sizes + integer :: n + real(r8) :: rmaxlon, rmaxlat ! local min/max vars + + character(len=32) :: subname = 'check_domain_attributes' ! subroutine name + + call check_var(ncid=ncid, varname='xc', readvar=readvar) + if (readvar) then + istype_domain = .true. + else + call check_var(ncid=ncid, varname='LONGXY', readvar=readvar) + if (readvar) then + istype_domain = .false. + else + call endrun( msg=' ERROR: unknown '//info//' domain type---'//errMsg(sourcefile, __LINE__)) + end if + end if + if (istype_domain) then + lon_var = 'xc' + lat_var = 'yc' + else + lon_var = 'LONGXY' + lat_var = 'LATIXY' + end if + if ( masterproc )then + write(iulog,*) trim(subname),' ',info,' lon_var = ',trim(lon_var),' lat_var =',trim(lat_var) + end if + + call ncd_inqfdims(ncid, isgrid2d, ni, nj, ns) + call domain_init(surfdata_domain, isgrid2d, ni, nj, begg, endg, subgrid_level=grlnd) + + call ncd_io(ncid=ncid, varname=lon_var, flag='read', data=surfdata_domain%lonc, & + dim1name=grlnd, readvar=readvar) + if (.not. readvar) call endrun( msg=' ERROR: lon var NOT on '//info//' dataset---'//errMsg(sourcefile, __LINE__)) + + call ncd_io(ncid=ncid, varname=lat_var, flag='read', data=surfdata_domain%latc, & + dim1name=grlnd, readvar=readvar) + if (.not. readvar) call endrun( msg=' ERROR: lat var NOT on '//info//' dataset---'//errMsg(sourcefile, __LINE__)) + + rmaxlon = 0.0_r8 + rmaxlat = 0.0_r8 + do n = begg,endg + if (ldomain%lonc(n)-surfdata_domain%lonc(n) > 300.) then + rmaxlon = max(rmaxlon,abs(ldomain%lonc(n)-surfdata_domain%lonc(n)-360._r8)) + elseif (ldomain%lonc(n)-surfdata_domain%lonc(n) < -300.) then + rmaxlon = max(rmaxlon,abs(ldomain%lonc(n)-surfdata_domain%lonc(n)+360._r8)) + else + rmaxlon = max(rmaxlon,abs(ldomain%lonc(n)-surfdata_domain%lonc(n))) + endif + rmaxlat = max(rmaxlat,abs(ldomain%latc(n)-surfdata_domain%latc(n))) + enddo + if (rmaxlon > 0.001_r8 .or. rmaxlat > 0.001_r8) then + write(iulog,*)' ERROR: '//info//' dataset vs. land domain lon/lat mismatch error', rmaxlon,rmaxlat + call endrun(msg=errMsg(sourcefile, __LINE__)) + end if + end subroutine check_domain_attributes + !----------------------------------------------------------------------- subroutine surfrd_get_data (begg, endg, ldomain, lfsurdat, lhillslope_file, actual_numcft) ! @@ -76,7 +152,7 @@ subroutine surfrd_get_data (begg, endg, ldomain, lfsurdat, lhillslope_file, actu n_dom_landunits, & use_hillslope use fileutils , only : getfil - use domainMod , only : domain_type, domain_init, domain_clean + use domainMod , only : domain_type use clm_instur , only : wt_lunit, topo_glc_mec, pct_urban_max use landunit_varcon , only : max_lunit, istsoil, isturb_MIN, isturb_MAX use dynSubgridControlMod, only : get_flanduse_timeseries @@ -91,18 +167,10 @@ subroutine surfrd_get_data (begg, endg, ldomain, lfsurdat, lhillslope_file, actu character(len=*), intent(in) :: lhillslope_file ! hillslope dataset filename ! ! !LOCAL VARIABLES: - type(domain_type) :: surfdata_domain ! local domain associated with surface dataset character(len=256):: locfn ! local file name integer, parameter :: n_dom_urban = 1 ! # of dominant urban landunits - integer :: n ! loop indices - integer :: ni,nj,ns ! domain sizes - 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 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 character(len=32) :: subname = 'surfrd_get_data' ! subroutine name !----------------------------------------------------------------------- @@ -131,56 +199,10 @@ subroutine surfrd_get_data (begg, endg, ldomain, lfsurdat, lhillslope_file, actu call ncd_pio_openfile (ncid_hillslope, trim(locfn), 0) end if - ! Cmopare surfdat_domain attributes to ldomain attributes - - call check_var(ncid=ncid, varname='xc', readvar=readvar) - if (readvar) then - istype_domain = .true. - else - call check_var(ncid=ncid, varname='LONGXY', readvar=readvar) - if (readvar) then - istype_domain = .false. - else - call endrun( msg=' ERROR: unknown domain type'//errMsg(sourcefile, __LINE__)) - end if - end if - if (istype_domain) then - lon_var = 'xc' - lat_var = 'yc' - else - lon_var = 'LONGXY' - lat_var = 'LATIXY' - end if - if ( masterproc )then - write(iulog,*) trim(subname),' lon_var = ',trim(lon_var),' lat_var =',trim(lat_var) - end if - - call ncd_inqfdims(ncid, isgrid2d, ni, nj, ns) - call domain_init(surfdata_domain, isgrid2d, ni, nj, begg, endg, subgrid_level=grlnd) - - call ncd_io(ncid=ncid, varname=lon_var, flag='read', data=surfdata_domain%lonc, & - dim1name=grlnd, readvar=readvar) - if (.not. readvar) call endrun( msg=' ERROR: lon var NOT on surface dataset'//errMsg(sourcefile, __LINE__)) - - call ncd_io(ncid=ncid, varname=lat_var, flag='read', data=surfdata_domain%latc, & - dim1name=grlnd, readvar=readvar) - if (.not. readvar) call endrun( msg=' ERROR: lat var NOT on surface dataset'//errMsg(sourcefile, __LINE__)) - - rmaxlon = 0.0_r8 - rmaxlat = 0.0_r8 - do n = begg,endg - if (ldomain%lonc(n)-surfdata_domain%lonc(n) > 300.) then - rmaxlon = max(rmaxlon,abs(ldomain%lonc(n)-surfdata_domain%lonc(n)-360._r8)) - elseif (ldomain%lonc(n)-surfdata_domain%lonc(n) < -300.) then - rmaxlon = max(rmaxlon,abs(ldomain%lonc(n)-surfdata_domain%lonc(n)+360._r8)) - else - rmaxlon = max(rmaxlon,abs(ldomain%lonc(n)-surfdata_domain%lonc(n))) - endif - rmaxlat = max(rmaxlat,abs(ldomain%latc(n)-surfdata_domain%latc(n))) - enddo - if (rmaxlon > 0.001_r8 .or. rmaxlat > 0.001_r8) then - write(iulog,*)' ERROR: surfdata_domain/ldomain lon/lat mismatch error', rmaxlon,rmaxlat - call endrun(msg=errMsg(sourcefile, __LINE__)) + ! Compare dataset domain attributes to ldomain attributes + call check_domain_attributes(ncid, begg, endg, ldomain, 'surface') + if (use_hillslope) then + call check_domain_attributes(ncid_hillslope, begg, endg, ldomain, 'hillslope') end if !~! TODO(SPM, 022015) - if we deallocate and clean ldomain here, then you From ea9228c7d8f4259bdf59cda611308989083f3371 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Tue, 1 Oct 2024 09:40:56 -0600 Subject: [PATCH 038/243] Update 10x15 hillslope_file (now has LATIXY/LONGXY). --- .../testdefs/testmods_dirs/clm/Hillslope/shell_commands | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cime_config/testdefs/testmods_dirs/clm/Hillslope/shell_commands b/cime_config/testdefs/testmods_dirs/clm/Hillslope/shell_commands index 7bec6fd7f6..9cef7eb66f 100644 --- a/cime_config/testdefs/testmods_dirs/clm/Hillslope/shell_commands +++ b/cime_config/testdefs/testmods_dirs/clm/Hillslope/shell_commands @@ -4,8 +4,10 @@ DIN_LOC_ROOT=$(./xmlquery --value DIN_LOC_ROOT) # Set hillslope_file. Needed for any grids without default hillslope_file already set by CTSM. lnd_grid=$(./xmlquery --value LND_GRID) if [[ ${lnd_grid} == "10x15" ]]; then - hillslope_file='$DIN_LOC_ROOT/lnd/clm2/testdata/synthetic_cosphill_10x15_1.3.nc' + # Synthetic data + hillslope_file='$DIN_LOC_ROOT/lnd/clm2/testdata/surfdata_10x15_hist_1850_78pfts_c240216.synth_hillslopes_241001.nc' elif [[ ${lnd_grid} == "5x5_amazon" ]]; then + # Real data hillslope_file='/glade/derecho/scratch/samrabin/hillslopes_5x5_amazon/hand_analysis_global/combined/hilldata_5x5_amazon_hist_2000_78pfts_c240216.nc' else echo "ERROR: Hillslope file not found for LND_GRID=${lnd_grid}" >&2 From 4b032be5b4a279723ed840b4be851829cd37ec9c Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Tue, 1 Oct 2024 09:59:52 -0600 Subject: [PATCH 039/243] Improve use_init_interp+use_hillslope namelist warning. --- bld/CLMBuildNamelist.pm | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index dc89e932ca..e9a4ff4d56 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -2746,8 +2746,7 @@ SIMYR: foreach my $sim_yr ( @sim_years ) { # 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:") + $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, even if the initial conditions (finidat) file has hillslope information. If you are sure you want this behaviour, add -ignore_warnings to CLM_BLDNML_OPTS.") } } # end initial conditions From 5c74ff44cb78427c458f429a4c255405e2eb69a9 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Tue, 1 Oct 2024 11:19:07 -0600 Subject: [PATCH 040/243] Call domain_clean() at end of check_domain_attributes(). Resolves nag error in hillslope call of check_domain_attributes()---somehow, surfdata_domain was marked as "set" but was uninitialized, causing error in domain_init(). --- src/main/surfrdMod.F90 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/surfrdMod.F90 b/src/main/surfrdMod.F90 index 1404ee03f2..bb2a90022c 100644 --- a/src/main/surfrdMod.F90 +++ b/src/main/surfrdMod.F90 @@ -51,7 +51,7 @@ subroutine check_domain_attributes(ncid, begg, endg, ldomain, info) ! Checks for mismatches between the land domain and a surface or similar dataset's domain. ! ! !USES: - use domainMod, only : domain_type, domain_init + use domainMod, only : domain_type, domain_init, domain_clean ! ! !ARGUMENTS type(file_desc_t), intent(inout) :: ncid ! netcdf id for input file @@ -120,6 +120,7 @@ subroutine check_domain_attributes(ncid, begg, endg, ldomain, info) write(iulog,*)' ERROR: '//info//' dataset vs. land domain lon/lat mismatch error', rmaxlon,rmaxlat call endrun(msg=errMsg(sourcefile, __LINE__)) end if + call domain_clean(surfdata_domain) end subroutine check_domain_attributes !----------------------------------------------------------------------- From 1a93690347ba7c1a3c38ccdfc0e77154c94a535b Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Tue, 1 Oct 2024 11:21:24 -0600 Subject: [PATCH 041/243] Remove outdated comment/TODO. --- src/main/surfrdMod.F90 | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/main/surfrdMod.F90 b/src/main/surfrdMod.F90 index bb2a90022c..59094ac1f3 100644 --- a/src/main/surfrdMod.F90 +++ b/src/main/surfrdMod.F90 @@ -271,11 +271,6 @@ subroutine surfrd_get_data (begg, endg, ldomain, lfsurdat, lhillslope_file, actu call check_domain_attributes(ncid_hillslope, begg, endg, ldomain, 'hillslope') end if - !~! TODO(SPM, 022015) - if we deallocate and clean ldomain here, then you - !~! get errors in htape_timeconst where the information is needed to write - !~! the *.h0* file - !~!call domain_clean(surfdata_domain) - ! Obtain special landunit info call surfrd_special(begg, endg, ncid, ldomain%ns) From 5e71b7d92588d345ec8016e76f6d24f4b3271664 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Tue, 1 Oct 2024 11:22:20 -0600 Subject: [PATCH 042/243] Rename surfdata_domain to inputdata_domain. More general to reflect that it's not necessarily the surface dataset's domain. --- src/main/surfrdMod.F90 | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/main/surfrdMod.F90 b/src/main/surfrdMod.F90 index 59094ac1f3..4005ec7845 100644 --- a/src/main/surfrdMod.F90 +++ b/src/main/surfrdMod.F90 @@ -60,7 +60,7 @@ subroutine check_domain_attributes(ncid, begg, endg, ldomain, info) character(len=*), intent(in) :: info ! information to include in messages ! ! !LOCAL VARIABLES - type(domain_type) :: surfdata_domain ! local domain associated with dataset + type(domain_type) :: inputdata_domain ! local domain associated with input dataset logical :: readvar ! true => variable is on dataset logical :: istype_domain ! true => input file is of type domain character(len=16) :: lon_var, lat_var ! names of lat/lon on dataset @@ -94,33 +94,33 @@ subroutine check_domain_attributes(ncid, begg, endg, ldomain, info) end if call ncd_inqfdims(ncid, isgrid2d, ni, nj, ns) - call domain_init(surfdata_domain, isgrid2d, ni, nj, begg, endg, subgrid_level=grlnd) + call domain_init(inputdata_domain, isgrid2d, ni, nj, begg, endg, subgrid_level=grlnd) - call ncd_io(ncid=ncid, varname=lon_var, flag='read', data=surfdata_domain%lonc, & + call ncd_io(ncid=ncid, varname=lon_var, flag='read', data=inputdata_domain%lonc, & dim1name=grlnd, readvar=readvar) if (.not. readvar) call endrun( msg=' ERROR: lon var NOT on '//info//' dataset---'//errMsg(sourcefile, __LINE__)) - call ncd_io(ncid=ncid, varname=lat_var, flag='read', data=surfdata_domain%latc, & + call ncd_io(ncid=ncid, varname=lat_var, flag='read', data=inputdata_domain%latc, & dim1name=grlnd, readvar=readvar) if (.not. readvar) call endrun( msg=' ERROR: lat var NOT on '//info//' dataset---'//errMsg(sourcefile, __LINE__)) rmaxlon = 0.0_r8 rmaxlat = 0.0_r8 do n = begg,endg - if (ldomain%lonc(n)-surfdata_domain%lonc(n) > 300.) then - rmaxlon = max(rmaxlon,abs(ldomain%lonc(n)-surfdata_domain%lonc(n)-360._r8)) - elseif (ldomain%lonc(n)-surfdata_domain%lonc(n) < -300.) then - rmaxlon = max(rmaxlon,abs(ldomain%lonc(n)-surfdata_domain%lonc(n)+360._r8)) + if (ldomain%lonc(n)-inputdata_domain%lonc(n) > 300.) then + rmaxlon = max(rmaxlon,abs(ldomain%lonc(n)-inputdata_domain%lonc(n)-360._r8)) + elseif (ldomain%lonc(n)-inputdata_domain%lonc(n) < -300.) then + rmaxlon = max(rmaxlon,abs(ldomain%lonc(n)-inputdata_domain%lonc(n)+360._r8)) else - rmaxlon = max(rmaxlon,abs(ldomain%lonc(n)-surfdata_domain%lonc(n))) + rmaxlon = max(rmaxlon,abs(ldomain%lonc(n)-inputdata_domain%lonc(n))) endif - rmaxlat = max(rmaxlat,abs(ldomain%latc(n)-surfdata_domain%latc(n))) + rmaxlat = max(rmaxlat,abs(ldomain%latc(n)-inputdata_domain%latc(n))) enddo if (rmaxlon > 0.001_r8 .or. rmaxlat > 0.001_r8) then write(iulog,*)' ERROR: '//info//' dataset vs. land domain lon/lat mismatch error', rmaxlon,rmaxlat call endrun(msg=errMsg(sourcefile, __LINE__)) end if - call domain_clean(surfdata_domain) + call domain_clean(inputdata_domain) end subroutine check_domain_attributes !----------------------------------------------------------------------- From 3295adb9ac0e40f48b20a5c6c9d0b9c02d58351d Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Tue, 1 Oct 2024 14:42:06 -0600 Subject: [PATCH 043/243] Correct the name of the hash to use in the checks that hash values are all set in fail, warn, and finidat tests --- 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 421bf81b5e..096409065f 100755 --- a/bld/unit_testers/build-namelist_test.pl +++ b/bld/unit_testers/build-namelist_test.pl @@ -1376,7 +1376,7 @@ sub cat_and_create_namelistinfile { my $var; foreach $var ( "phys" , "options", "namelst" ) { - if ( not exists $failtest{$key}{$var} ) { + if ( not exists $warntest{$key}{$var} ) { die "ERROR: Subkey $var does not exist for warntest $key\nERROR:Check if you spelled $var correctly\n" } } @@ -1613,7 +1613,7 @@ sub cat_and_create_namelistinfile { my $var; foreach $var ( "phys" , "atm_forc", "res", "bgc", "crop", "use_case", "start_ymd", "namelist" ) { - if ( not exists $failtest{$key}{$var} ) { + if ( not exists $finidat_files{$key}{$var} ) { die "ERROR: Subkey $var does not exist for finidat_file $key\nERROR:Check if you spelled $var correctly\n" } } From 6c352166d3e7a4f0909ba24d8f338a55ecf98622 Mon Sep 17 00:00:00 2001 From: "Danny M. Leung" Date: Tue, 1 Oct 2024 16:51:00 -0600 Subject: [PATCH 044/243] dmleung changed the values of the tuning parameters and added a new tuning factor for vegetation drag partition effect. Also a first attempt to modify the code for soil moisture effect on dust to avoid having a factor that changes the answer of Zender's dust emissions. --- src/biogeochem/DustEmisLeung2023.F90 | 9 +++++---- src/biogeophys/SoilStateInitTimeConstMod.F90 | 19 ++++++++++++++----- 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/src/biogeochem/DustEmisLeung2023.F90 b/src/biogeochem/DustEmisLeung2023.F90 index 31f827faaf..3b250aa003 100644 --- a/src/biogeochem/DustEmisLeung2023.F90 +++ b/src/biogeochem/DustEmisLeung2023.F90 @@ -387,7 +387,7 @@ subroutine DustEmission (this, bounds, & ! ! constants ! - real(r8), parameter :: vai_mbl_thr = 0.5_r8 ! [m2 m-2] new VAI threshold; Danny M. Leung suggests something between 0.6 and 1 for tuning. Zender's scheme uses 0.3. Simone Tilmes might want this as a namelist variable for easier CESM tuning. dmleung 30 Sep 2024. + real(r8), parameter :: vai_mbl_thr = 0.6_r8 ! [m2 m-2] new VAI threshold; Danny M. Leung suggests something between 0.6 and 1 for tuning. Zender's scheme uses 0.3. Simone Tilmes might want this as a namelist variable for easier CESM tuning. dmleung 30 Sep 2024. 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 @@ -403,11 +403,12 @@ subroutine DustEmission (this, bounds, & 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 = 2.5_r8 ! [dimless] Maximum value or threshold for fragmentation exponent defined in Leung et al. (2023). Danny M. Leung suggested it to be somewhere between 3 and 5 for tuning. 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. Update: Simone Tilmes might want this as a namelist variable for easier CESM tuning. 30 Sep 2024. + real(r8), parameter :: frag_expt_thr = 3.0_r8 ! [dimless] Maximum value or threshold for fragmentation exponent defined in Leung et al. (2023). Danny M. Leung suggested it to be somewhere between 3 and 5 for tuning. 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. Update: Simone Tilmes might want this as a namelist variable for easier CESM tuning. 30 Sep 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), parameter :: dust_veg_part_fact = 0.7_r8 ! [dimless] dmleung added a tuning factor for Greg Okin's vegetation drag partition effect. dmleung suggested a smaller vegetation drag partition effect given an increase in vegetation roughness after CTSM switched from using ZengWang2007 to Meier2022. This is simply because the drag partition effect should decrease with increasing roughness, but Okin's scheme is only a function of LAI. One might want to change this factor to 1_r8 when using ZengWang2007. dmleung 30 Sep 2024 real(r8) :: numer ! Numerator term for threshold crossing rate real(r8) :: denom ! Denominator term for threshold crossing rate !------------------------------------------------------------------------ @@ -646,8 +647,8 @@ subroutine DustEmission (this, bounds, & ! calculate Okin's shear stress ratio (SSR, which is vegetation drag partition factor) using Pierre's equation - 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. + K_length = 2.0_r8 * (1.0_r8/vai_Okin(p) - 1.0_r8) ! Here VAI 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) = dust_veg_part_fact * (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. dmleung added a tuning factor for Okin's vegetation drag partition effect (SSR) on 30 Sep 2024. ! 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 diff --git a/src/biogeophys/SoilStateInitTimeConstMod.F90 b/src/biogeophys/SoilStateInitTimeConstMod.F90 index fc542075fe..3bd280761f 100644 --- a/src/biogeophys/SoilStateInitTimeConstMod.F90 +++ b/src/biogeophys/SoilStateInitTimeConstMod.F90 @@ -220,6 +220,7 @@ subroutine SoilStateInitTimeConst(bounds, soilstate_inst, nlfilename) real(r8) :: perturbed_sand ! temporary for paramfile implementation of +/- sand percentage real(r8) :: residual_clay_frac ! temporary for paramfile implementation of +/- residual clay percentage real(r8) :: perturbed_residual_clay_frac ! temporary for paramfile implementation of +/- residual clay percentage + real(r8) :: dust_moist_fact ! tuning factor for soil moisture effect on limiting dust emissions, used by Charlie Zender. Simone Tilmes suggested to change this parameter into a namelist variable for easier CESM tuning. dmleung added 30 Sep 2024 integer :: dimid ! dimension id logical :: readvar type(file_desc_t) :: ncid ! netcdf id @@ -708,16 +709,24 @@ 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 each DustEmisType ! module. See the comments in each function. + ! Zender suggested that threshold soil moisture is tunable (see comment + ! inside ThresholdSoilMoistZender2003). dmleung further add dust_moist_fact + ! ofr modelers to tune the threshold soil moisture. The resulting tuning + ! factor is thus a = dust_moist_fact / (clay3d). dmleung 30 Sep 2024 ! -------------------------------------------------------------------- do c = begc,endc g = col%gridcell(c) - soilstate_inst%gwc_thr_col(c) = ThresholdSoilMoistZender2003( clay3d(g,1) ) + !soilstate_inst%gwc_thr_col(c) = ThresholdSoilMoistZender2003( clay3d(g,1) ) if ( is_dust_emis_leung() )then soilstate_inst%mss_frc_cly_vld_col(c) = MassFracClayLeung2023( clay3d(g,1) ) + dust_moist_fact = 0.9_r8 ! change this into a namelist variable later. + soilstate_inst%gwc_thr_col(c) = dust_moist_fact * ThresholdSoilMoistZender2003( clay3d(g,1) ) else soilstate_inst%mss_frc_cly_vld_col(c) = MassFracClay( clay3d(g,1) ) + dust_moist_fact = 1.0_r8 + soilstate_inst%gwc_thr_col(c) = dust_moist_fact * ThresholdSoilMoistZender2003( clay3d(g,1) ) end if end do @@ -739,9 +748,11 @@ real(r8) function ThresholdSoilMoistZender2003( clay ) ! Calculate the threshold gravimetric water content needed for dust emission, based on clay content ! This was the original equation with a = 1 / (%clay) being the tuning factor for soil ! moisture effect in Zender's 2003 dust emission scheme (only for top layer). + ! dmleung further added dust_moist_fact for more flexibility in tuning, so the tuning factor here + ! is a = dust_moist_fact / (%clay). dmleung added dust_moist_fact on 30 Sep 2024. ! ! 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. + ! convert surface clay 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. @@ -765,14 +776,12 @@ real(r8) function ThresholdSoilMoistZender2003( clay ) !------------------------------------------------------------------------------ real(r8), intent(IN) :: clay ! Fraction of clay in the soil (%) - real(r8), parameter :: a = 0.5_r8 ! Tuning factor for the soil moisture effect. This parameter could also be added into ThresholdSoilMoistKok2014. Simone Tilmes suggested to change this parameter into a namelist variable for easier CESM tuning. dmleung 30 Sep 2024. - if ( clay < 0.0_r8 .or. clay > 100.0_r8 )then ThresholdSoilMoistZender2003 = nan call endrun( 'Clay fraction is out of bounds (0 to 100)') return end if - ThresholdSoilMoistZender2003 = a * ( 0.17_r8 + 0.14_r8 * (clay*0.01_r8) ) + ThresholdSoilMoistZender2003 = 0.17_r8 + 0.14_r8 * (clay*0.01_r8) end function ThresholdSoilMoistZender2003 !------------------------------------------------------------------------------ From f2f75351febd4a413b0788dae256443fe5734510 Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Tue, 1 Oct 2024 15:53:22 -0700 Subject: [PATCH 045/243] add shell call to generate fates hydro parameter file on the fly This is a temporary update to avoid NGEET/fates#1254 and should be removed once a fix comes in on the fates-side. --- .../testmods_dirs/clm/FatesColdHydro/shell_commands | 8 ++++++++ .../testdefs/testmods_dirs/clm/FatesColdHydro/user_nl_clm | 1 + 2 files changed, 9 insertions(+) create mode 100644 cime_config/testdefs/testmods_dirs/clm/FatesColdHydro/shell_commands diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesColdHydro/shell_commands b/cime_config/testdefs/testmods_dirs/clm/FatesColdHydro/shell_commands new file mode 100644 index 0000000000..e629e7ca34 --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/FatesColdHydro/shell_commands @@ -0,0 +1,8 @@ +SRCDIR=`./xmlquery SRCROOT --value` +CASEDIR=`./xmlquery CASEROOT --value` +FATESDIR=$SRCDIR/src/fates +FATESPARAMFILE=$CASEDIR/fates_params_hydrograsstempfix.nc + +ncgen -o $FATESPARAMFILE $FATESDIR/parameter_files/fates_params_default.cdl + +$FATESDIR/tools/modify_fates_paramfile.py --O --fin $FATESPARAMFILE --fout $FATESPARAMFILE --var fates_allom_smode --val 1 --allpfts diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesColdHydro/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/FatesColdHydro/user_nl_clm index f0bdb388eb..15dcf6de1a 100644 --- a/cime_config/testdefs/testmods_dirs/clm/FatesColdHydro/user_nl_clm +++ b/cime_config/testdefs/testmods_dirs/clm/FatesColdHydro/user_nl_clm @@ -2,6 +2,7 @@ hist_mfilt = 365 hist_nhtfrq = -24 hist_empty_htapes = .true. use_fates_planthydro= .true. +fates_paramfile = '$CASEROOT/fates_params_hydrograsstempfix.n' hist_fincl1 = 'FATES_ERRH2O_SZPF', 'FATES_TRAN_SZPF', 'FATES_SAPFLOW_SZPF', 'FATES_ITERH1_SZPF','FATES_ABSROOT_H2O_SZPF', 'FATES_TRANSROOT_H2O_SZPF','FATES_STEM_H2O_SZPF','FATES_LEAF_H2O_SZPF', From 52e5801fd9ffe8dfa309c63edd695c08d7630e31 Mon Sep 17 00:00:00 2001 From: "Danny M. Leung" Date: Tue, 1 Oct 2024 17:10:57 -0600 Subject: [PATCH 046/243] dmleung renamed the tuning parameter for Okin's vegetation drag partition factor to dust_veg_drag_fact from dust_veg_part_fact. 1 Oct 2024 --- 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 3b250aa003..0fee001e64 100644 --- a/src/biogeochem/DustEmisLeung2023.F90 +++ b/src/biogeochem/DustEmisLeung2023.F90 @@ -408,7 +408,7 @@ subroutine DustEmission (this, bounds, & 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), parameter :: dust_veg_part_fact = 0.7_r8 ! [dimless] dmleung added a tuning factor for Greg Okin's vegetation drag partition effect. dmleung suggested a smaller vegetation drag partition effect given an increase in vegetation roughness after CTSM switched from using ZengWang2007 to Meier2022. This is simply because the drag partition effect should decrease with increasing roughness, but Okin's scheme is only a function of LAI. One might want to change this factor to 1_r8 when using ZengWang2007. dmleung 30 Sep 2024 + real(r8), parameter :: dust_veg_drag_fact = 0.7_r8 ! [dimless] dmleung added a tuning factor for Greg Okin's vegetation drag partition effect. dmleung suggested a smaller vegetation drag partition effect given an increase in vegetation roughness after CTSM switched from using ZengWang2007 to Meier2022. This is simply because the drag partition effect should decrease with increasing roughness, but Okin's scheme is only a function of LAI. One might want to change this factor to 1_r8 when using ZengWang2007. dmleung 30 Sep 2024 real(r8) :: numer ! Numerator term for threshold crossing rate real(r8) :: denom ! Denominator term for threshold crossing rate !------------------------------------------------------------------------ @@ -648,7 +648,7 @@ subroutine DustEmission (this, bounds, & ! calculate Okin's shear stress ratio (SSR, which is vegetation drag partition factor) using Pierre's equation K_length = 2.0_r8 * (1.0_r8/vai_Okin(p) - 1.0_r8) ! Here VAI 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) = dust_veg_part_fact * (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. dmleung added a tuning factor for Okin's vegetation drag partition effect (SSR) on 30 Sep 2024. + ssr(p) = dust_veg_drag_fact * (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. dmleung added a tuning factor for Okin's vegetation drag partition effect (SSR) on 30 Sep 2024. ! 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 97d1657754c75fedd6482d4d71b773859029be5d Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Tue, 1 Oct 2024 16:11:33 -0700 Subject: [PATCH 047/243] fix typo in fates hydro user_nl_clm --- .../testdefs/testmods_dirs/clm/FatesColdHydro/user_nl_clm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesColdHydro/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/FatesColdHydro/user_nl_clm index 15dcf6de1a..318a34dfec 100644 --- a/cime_config/testdefs/testmods_dirs/clm/FatesColdHydro/user_nl_clm +++ b/cime_config/testdefs/testmods_dirs/clm/FatesColdHydro/user_nl_clm @@ -2,7 +2,7 @@ hist_mfilt = 365 hist_nhtfrq = -24 hist_empty_htapes = .true. use_fates_planthydro= .true. -fates_paramfile = '$CASEROOT/fates_params_hydrograsstempfix.n' +fates_paramfile = '$CASEROOT/fates_params_hydrograsstempfix.nc' hist_fincl1 = 'FATES_ERRH2O_SZPF', 'FATES_TRAN_SZPF', 'FATES_SAPFLOW_SZPF', 'FATES_ITERH1_SZPF','FATES_ABSROOT_H2O_SZPF', 'FATES_TRANSROOT_H2O_SZPF','FATES_STEM_H2O_SZPF','FATES_LEAF_H2O_SZPF', From 53ea29c309e9a11f70bb6839b527ec968ab0d3a3 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Tue, 1 Oct 2024 18:17:09 -0600 Subject: [PATCH 048/243] Add init_interp_attributes for clm5_0_cam6.0 to namelist_defaults --- bld/namelist_files/namelist_defaults_ctsm.xml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index 650b21cb8d..3418315f57 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -1214,6 +1214,12 @@ attributes from the config_cache.xml file (with keys converted to upper-case). >hgrid=0.9x1.25 maxpft=79 mask=gx1v7 use_cn=.true. use_crop=.true. irrigate=.true. glc_nec=10 do_transient_pfts=.false. use_excess_ice=.false. + +hgrid=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. + + Date: Wed, 2 Oct 2024 14:12:45 -0700 Subject: [PATCH 049/243] correct call typo to clm_demand for fateslanduse test mod --- .../testdefs/testmods_dirs/clm/FatesColdLandUse/shell_commands | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesColdLandUse/shell_commands b/cime_config/testdefs/testmods_dirs/clm/FatesColdLandUse/shell_commands index d88457df12..6152f0bd0c 100644 --- a/cime_config/testdefs/testmods_dirs/clm/FatesColdLandUse/shell_commands +++ b/cime_config/testdefs/testmods_dirs/clm/FatesColdLandUse/shell_commands @@ -1,3 +1,3 @@ #!/bin/bash -./xmlchange CLM_BLDNML_OPTS="--clm_demand -flanduse_timeseries" --append +./xmlchange CLM_BLDNML_OPTS="-clm_demand flanduse_timeseries" --append From 711405e6a582e543815400277b9311aae21ce04d Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Wed, 2 Oct 2024 16:43:05 -0600 Subject: [PATCH 050/243] Remove clm51 references from /cime_config --- cime_config/buildnml | 11 +---------- cime_config/config_component.xml | 15 ++------------- cime_config/config_compsets.xml | 14 +------------- cime_config/testdefs/ExpectedTestFails.xml | 4 ++-- cime_config/testdefs/testlist_clm.xml | 10 ++++------ .../testmods_dirs/clm/ciso_cwd_hr/user_nl_clm | 2 +- .../clm/clm51cam6LndTuningMode/include_user_mods | 1 - .../clm/clm51cam6LndTuningMode/shell_commands | 5 ----- .../include_user_mods | 1 - .../include_user_mods | 1 + .../user_nl_clm | 0 cime_config/usermods_dirs/NEON/FATES/README.md | 2 +- 12 files changed, 13 insertions(+), 53 deletions(-) delete mode 100644 cime_config/testdefs/testmods_dirs/clm/clm51cam6LndTuningMode/include_user_mods delete mode 100644 cime_config/testdefs/testmods_dirs/clm/clm51cam6LndTuningMode/shell_commands delete mode 100644 cime_config/testdefs/testmods_dirs/clm/clm51cam6LndTuningModeZDustSoilErod/include_user_mods create mode 100644 cime_config/testdefs/testmods_dirs/clm/clm60cam6LndTuningModeZDustSoilErod/include_user_mods rename cime_config/testdefs/testmods_dirs/clm/{clm51cam6LndTuningModeZDustSoilErod => clm60cam6LndTuningModeZDustSoilErod}/user_nl_clm (100%) diff --git a/cime_config/buildnml b/cime_config/buildnml index e9b7a610cd..32bb14f335 100644 --- a/cime_config/buildnml +++ b/cime_config/buildnml @@ -23,7 +23,7 @@ _config_cache_template = """ -Specifies CTSM physics +Specifies CTSM physics """ @@ -113,11 +113,6 @@ def buildnml(case, caseroot, compname): "clm5_0_QIAN": "clm5_0_GSWP3v1", "clm5_0_NLDAS2": "clm5_0_GSWP3v1", "clm5_0_ERA5": "clm5_0_GSWP3v1", - "clm5_1_1PT": "clm5_1_GSWP3v1", - "clm5_1_QIAN": "clm5_1_GSWP3v1", - "clm5_1_NLDAS2": "clm5_1_GSWP3v1", - "clm5_1_ERA5": "clm5_1_GSWP3v1", - "clm5_1_CRUv7": "clm5_1_GSWP3v1", "clm6_0_1PT": "clm6_0_GSWP3v1", "clm6_0_QIAN": "clm6_0_GSWP3v1", "clm6_0_NLDAS2": "clm6_0_GSWP3v1", @@ -144,13 +139,9 @@ def buildnml(case, caseroot, compname): # to the CAM version) tuning_based_on = { "clm6_0_GSWP3v1": "clm5_0_GSWP3v1", - "clm5_1_GSWP3v1": "clm5_0_GSWP3v1", "clm6_0_cam6.0": "clm5_0_cam6.0", "clm6_0_cam5.0": "clm5_0_cam6.0", "clm6_0_cam4.0": "clm5_0_cam6.0", - "clm5_1_cam6.0": "clm5_0_cam6.0", - "clm5_1_cam5.0": "clm5_0_cam6.0", - "clm5_1_cam4.0": "clm5_0_cam6.0", "clm5_0_cam5.0": "clm5_0_cam6.0", "clm5_0_cam4.0": "clm5_0_cam6.0", "clm4_5_cam6.0": "clm5_0_cam6.0", diff --git a/cime_config/config_component.xml b/cime_config/config_component.xml index 3fb682ccf0..413a0d246c 100644 --- a/cime_config/config_component.xml +++ b/cime_config/config_component.xml @@ -15,7 +15,6 @@ clm4.5: clm5.0: - clm5.1: clm6.0: Satellite phenology: @@ -78,7 +77,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,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 @@ -113,14 +112,6 @@ clm5_0_1PT clm5_0_NLDAS2 clm5_0_ERA5 - - clm5_1_GSWP3v1 - 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 @@ -147,7 +138,7 @@ char - clm4_5,clm5_0,clm5_1,clm6_0 + clm4_5,clm5_0,clm6_0 - - IHistClm51Sp - HIST_DATM%GSWP3v1_CLM51%SP_SICE_SOCN_MOSART_SGLC_SWAV - - IHistClm60SpRs HIST_DATM%GSWP3v1_CLM60%SP_SICE_SOCN_SROF_SGLC_SWAV @@ -652,12 +646,6 @@ - - - I1850Clm51BgcCropG - 1850_DATM%GSWP3v1_CLM51%BGC-CROP_SICE_SOCN_MOSART_CISM2%GRIS-EVOLVE_SWAV - - diff --git a/cime_config/testdefs/ExpectedTestFails.xml b/cime_config/testdefs/ExpectedTestFails.xml index 30b19ce862..28f9286399 100644 --- a/cime_config/testdefs/ExpectedTestFails.xml +++ b/cime_config/testdefs/ExpectedTestFails.xml @@ -245,7 +245,7 @@ - + FAIL #2423 @@ -282,7 +282,7 @@ - + FAIL MOSART#91 diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index 0eb3d5012d..047675fccf 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -120,14 +120,13 @@ - - + + - @@ -946,14 +945,13 @@ - + - - + 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 3462b802c7..fd70b85611 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.c240814.nc' +paramfile = '$DIN_LOC_ROOT/lnd/clm2/paramdata/ctsm60_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' diff --git a/cime_config/testdefs/testmods_dirs/clm/clm51cam6LndTuningMode/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/clm51cam6LndTuningMode/include_user_mods deleted file mode 100644 index fe0e18cf88..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/clm51cam6LndTuningMode/include_user_mods +++ /dev/null @@ -1 +0,0 @@ -../default diff --git a/cime_config/testdefs/testmods_dirs/clm/clm51cam6LndTuningMode/shell_commands b/cime_config/testdefs/testmods_dirs/clm/clm51cam6LndTuningMode/shell_commands deleted file mode 100644 index cf39cca1c0..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/clm51cam6LndTuningMode/shell_commands +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash - -./xmlchange LND_TUNING_MODE="clm5_1_cam6.0" -./xmlchange ROF_NCPL='$ATM_NCPL' - diff --git a/cime_config/testdefs/testmods_dirs/clm/clm51cam6LndTuningModeZDustSoilErod/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/clm51cam6LndTuningModeZDustSoilErod/include_user_mods deleted file mode 100644 index aa76c52034..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/clm51cam6LndTuningModeZDustSoilErod/include_user_mods +++ /dev/null @@ -1 +0,0 @@ -../clm51cam6LndTuningMode diff --git a/cime_config/testdefs/testmods_dirs/clm/clm60cam6LndTuningModeZDustSoilErod/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/clm60cam6LndTuningModeZDustSoilErod/include_user_mods new file mode 100644 index 0000000000..3dabdc9aeb --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/clm60cam6LndTuningModeZDustSoilErod/include_user_mods @@ -0,0 +1 @@ +../clm60cam6LndTuningMode diff --git a/cime_config/testdefs/testmods_dirs/clm/clm51cam6LndTuningModeZDustSoilErod/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/clm60cam6LndTuningModeZDustSoilErod/user_nl_clm similarity index 100% rename from cime_config/testdefs/testmods_dirs/clm/clm51cam6LndTuningModeZDustSoilErod/user_nl_clm rename to cime_config/testdefs/testmods_dirs/clm/clm60cam6LndTuningModeZDustSoilErod/user_nl_clm diff --git a/cime_config/usermods_dirs/NEON/FATES/README.md b/cime_config/usermods_dirs/NEON/FATES/README.md index dcfcfdf9af..49cd2fc767 100644 --- a/cime_config/usermods_dirs/NEON/FATES/README.md +++ b/cime_config/usermods_dirs/NEON/FATES/README.md @@ -2,7 +2,7 @@ Use these user mods as you would any other user_mods, e.g.: -`./create_newcase --case FATES_ABBY_test --res CLM_USRDAT --compset I1PtClm51Fates --run-unsupported --user-mods-dir /glade/work/$user/CTSM/cime_config/usermods_dirs/NEON/FATES/ABBY` +`./create_newcase --case FATES_ABBY_test --res CLM_USRDAT --compset I1PtClm60Fates --run-unsupported --user-mods-dir /glade/work/$user/CTSM/cime_config/usermods_dirs/NEON/FATES/ABBY` ## Note on crop sites KONA and STER From 89654cc6bd9d6696b12c8f436ec60c4c31f9b8f6 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Wed, 2 Oct 2024 16:50:24 -0600 Subject: [PATCH 051/243] Remove clm51 references from /bld --- bld/config_files/clm_phys_vers.pm | 4 +- bld/config_files/config_definition_ctsm.xml | 4 +- bld/namelist_files/namelist_defaults_ctsm.xml | 263 +----------------- .../namelist_defaults_drydep.xml | 1 - .../namelist_defaults_overall.xml | 2 - .../namelist_definition_ctsm.xml | 4 +- bld/unit_testers/build-namelist_test.pl | 29 +- 7 files changed, 16 insertions(+), 291 deletions(-) diff --git a/bld/config_files/clm_phys_vers.pm b/bld/config_files/clm_phys_vers.pm index 9ab79ee8b0..bec811b61e 100755 --- a/bld/config_files/clm_phys_vers.pm +++ b/bld/config_files/clm_phys_vers.pm @@ -28,7 +28,7 @@ use bigint; #use warnings; #use diagnostics; -my @version_strings = ("clm4_5", "clm5_0", "clm5_1", "clm6_0"); +my @version_strings = ("clm4_5", "clm5_0", "clm6_0"); #------------------------------------------------------------------------------- @@ -88,7 +88,7 @@ if ( ! defined(caller) && $#ARGV == -1 ) { sub testit { print "unit tester\n"; my %lastv; - my @vers_list = ( "clm4_5", "clm5_0", "clm5_1", "clm6_0" ); + my @vers_list = ( "clm4_5", "clm5_0", "clm6_0" ); foreach my $vers ( @vers_list ) { my $phys = config_files::clm_phys_vers->new($vers); isa_ok($phys, "config_files::clm_phys_vers", "created clm_phys_vers object"); diff --git a/bld/config_files/config_definition_ctsm.xml b/bld/config_files/config_definition_ctsm.xml index e6628b1d94..f37f9a6f4e 100644 --- a/bld/config_files/config_definition_ctsm.xml +++ b/bld/config_files/config_definition_ctsm.xml @@ -5,10 +5,10 @@ -Specifies either clm4_5, clm5_0, clm5_1 (deprecated), or clm6_0 physics +Specifies either clm4_5, clm5_0, or clm6_0 physics clm4_5_CRUv7 clm5_0_cam6.0 -clm5_1_GSWP3v1 clm6_0_GSWP3v1 @@ -200,8 +199,6 @@ attributes from the config_cache.xml file (with keys converted to upper-case). 2.0d00 2.0d00 0.5d00 -0.5d00 -2.0d00 0.5d00 2.0d00 @@ -275,14 +272,6 @@ attributes from the config_cache.xml file (with keys converted to upper-case). >20.0d00 20.0d00 -20.0d00 -20.0d00 -20.0d00 -20.0d00 20.0d00 0.008d00 0.008d00 -0.008d00 -0.008d00 -0.008d00 -0.008d00 0.008d00 SwensonLawrence2012 Jordan1991 -Sturm1997 Sturm1997 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 @@ -567,7 +546,6 @@ attributes from the config_cache.xml file (with keys converted to upper-case). ZengWang2007 -Meier2022 Meier2022 .true. @@ -616,7 +594,6 @@ attributes from the config_cache.xml file (with keys converted to upper-case). .false. 0.d+0 -0.5d00 0.5d00 @@ -630,11 +607,9 @@ attributes from the config_cache.xml file (with keys converted to upper-case). Constant -DependsOnLat DependsOnLat .false. -.true. .true. .false. @@ -752,25 +727,6 @@ attributes from the config_cache.xml file (with keys converted to upper-case). .true. - - -.true. -.true. -.true. -.true. - -.true. - - -.true. .true. - - -.true. -.true. -.true. -.true. - -.true. - - -.true. .true. -.true. .true. .true. @@ -867,10 +803,8 @@ attributes from the config_cache.xml file (with keys converted to upper-case). .false. .false. .false. -.false. -.false. -.false. -.false. +.false. +.false. .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 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 use_excess_ice=.true. @@ -956,9 +886,6 @@ 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. use_excess_ice=.false. -hgrid=0.9x1.25 maxpft=79 mask=gx1v7 use_cn=.true. use_crop=.true. irrigate=.true. 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=.true. glc_nex=10 do_transient_pfts=.false. lnd_tuning_mode=clm6_0_GSWP3v1 use_excess_ice=.true. @@ -1352,14 +1279,8 @@ 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.3/ctsm52026_f09_pSASU.clm2.r.0421-01-01-00000.nc - lnd/clm2/initdata_esmf/ctsm5.3/clmi.f19_interp_from.I1850Clm50BgcCrop-ciso.1366-01-01.0.9x1.25_gx1v7_simyr1850_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 - - 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_esmf/ctsm5.3/ctsm52026_f09_pSASU.clm2.r.0421-01-01-00000.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_simyr2000_c200728.nc - -lnd/clm2/initdata_esmf/ctsm5.3/ctsm52026_f09_pSASU.clm2.r.0421-01-01-00000.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_esmf/ctsm5.3/ctsm52026_f09_pSASU.clm2.r.0421-01-01-00000.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 - sahara .false. .false. -.true. .true. .true. .false. @@ -2283,7 +2052,6 @@ lnd/clm2/surfdata_esmf/NEON/ctsm5.3.0/surfdata_1x1_NEON_TOOL_hist_2000_78pfts_c2 .true. .false. .false. -.false. .false. .false. 2000 @@ -2482,10 +2250,6 @@ lnd/clm2/surfdata_esmf/NEON/ctsm5.3.0/surfdata_1x1_NEON_TOOL_hist_2000_78pfts_c2 >lnd/clm2/urbandata/CTSM52_tbuildmax_OlesonFeddema_2020_0.9x1.25_simyr1849-2106_c200605.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 -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 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_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 @@ -2742,7 +2488,6 @@ lnd/clm2/surfdata_esmf/NEON/ctsm5.3.0/surfdata_1x1_NEON_TOOL_hist_2000_78pfts_c2 off -low low .false. diff --git a/bld/namelist_files/namelist_defaults_drydep.xml b/bld/namelist_files/namelist_defaults_drydep.xml index fb73ab6646..2ca89e4620 100644 --- a/bld/namelist_files/namelist_defaults_drydep.xml +++ b/bld/namelist_files/namelist_defaults_drydep.xml @@ -26,7 +26,6 @@ attributes from the config_cache.xml file (with keys converted to upper-case). 'ISOP = isoprene', 'C10H16 = pinene_a + carene_3 + thujene_a', 'CH3OH = methanol', 'C2H5OH = ethanol', 'CH2O = formaldehyde', 'CH3CHO = acetaldehyde', 'CH3COOH = acetic_acid', 'CH3COCH3 = acetone' atm/cam/chem/trop_mozart/emis/megan21_emis_factors_78pft_c20161108.nc -atm/cam/chem/trop_mozart/emis/megan21_emis_factors_78pft_c20161108.nc atm/cam/chem/trop_mozart/emis/megan21_emis_factors_78pft_c20161108.nc atm/cam/chem/trop_mozart/emis/megan21_emis_factors_78pft_c20161108.nc diff --git a/bld/namelist_files/namelist_defaults_overall.xml b/bld/namelist_files/namelist_defaults_overall.xml index 5b7ae1bdd9..577f9bce61 100644 --- a/bld/namelist_files/namelist_defaults_overall.xml +++ b/bld/namelist_files/namelist_defaults_overall.xml @@ -34,8 +34,6 @@ determine default values for namelists. cold cold cold -cold -cold cold cold diff --git a/bld/namelist_files/namelist_definition_ctsm.xml b/bld/namelist_files/namelist_definition_ctsm.xml index 417444914e..79a16feba3 100644 --- a/bld/namelist_files/namelist_definition_ctsm.xml +++ b/bld/namelist_files/namelist_definition_ctsm.xml @@ -171,7 +171,7 @@ dust optics type for SNICAR snow albedo calculation snow grain shape used in SNICAR snow albedo calculation -(snicar_snw_shape='hexagonal_plate' is supported in ctsm5.1 and 'sphere' in older model versions; others are EXPERIMENTAL, UNSUPPORTED, and UNTESTED!) +(snicar_snw_shape='sphere' is supported in pre-ctsm5.1 model versions and 'hexagonal place' is supported in newer versions; others are EXPERIMENTAL, UNSUPPORTED, and UNTESTED!) + 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,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 06c9bcc361..65bb5dbd27 100755 --- a/bld/unit_testers/build-namelist_test.pl +++ b/bld/unit_testers/build-namelist_test.pl @@ -78,7 +78,7 @@ sub make_config_cache { -Specifies clm physics +Specifies clm physics EOF $fh->close(); @@ -600,10 +600,6 @@ sub cat_and_create_namelistinfile { namelst=>"use_crop=.true.", phys=>"clm4_5", }, - "LeungDust_WO_Prigent" =>{ options=>" -envxml_dir . -bgc sp", - namelst=>"use_prigent_roughness=.true.", - 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'", phys=>"clm5_0", @@ -966,16 +962,6 @@ sub cat_and_create_namelistinfile { GLC_TWO_WAY_COUPLING=>"TRUE", phys=>"clm5_0", }, - "sasuspinupWOsoilmatx" =>{ options=>"-envxml_dir . -bgc bgc -clm_accelerated_spinup sasu", - namelst=>"use_soil_matrixcn=.false.,use_matrixcn=.false.", - GLC_TWO_WAY_COUPLING=>"TRUE", - phys=>"clm5_1", - }, - "sasuspinupWOCN" =>{ options=>"-envxml_dir . -bgc sp -clm_accelerated_spinup sasu", - namelst=>"", - GLC_TWO_WAY_COUPLING=>"TRUE", - phys=>"clm5_1", - }, "nyrforceWOspinup" =>{ options=>"-envxml_dir . -bgc bgc -clm_accelerated_spinup sasu", namelst=>"use_matrixcn=.false.,spinup_matrixcn=F,nyr_forcing=20", GLC_TWO_WAY_COUPLING=>"TRUE", @@ -1390,7 +1376,7 @@ sub cat_and_create_namelistinfile { # # Loop over all physics versions # -foreach my $phys ( "clm4_5", "clm5_0", "clm5_1", "clm6_0" ) { +foreach my $phys ( "clm4_5", "clm5_0", "clm6_0" ) { $mode = "-phys $phys"; &make_config_cache($phys); @@ -1481,7 +1467,7 @@ sub cat_and_create_namelistinfile { } 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" ) { +foreach my $phys ( "clm4_5", "clm5_0", "clm6_0" ) { print "physics = $phys\n"; &make_config_cache($phys); foreach my $usecase ( @usecases ) { @@ -1770,10 +1756,10 @@ sub cat_and_create_namelistinfile { # print "\n==================================================\n"; -print "Test clm4.5/clm5.0/clm5_1/clm6_0 resolutions \n"; +print "Test clm4.5/clm5.0/clm6_0 resolutions \n"; print "==================================================\n"; -foreach my $phys ( "clm4_5", 'clm5_0', 'clm5_1', "clm6_0" ) { +foreach my $phys ( "clm4_5", "clm5_0", "clm6_0" ) { my $mode = "-phys $phys"; &make_config_cache($phys); my @clmoptions = ( "-bgc bgc -envxml_dir .", "-bgc bgc -envxml_dir . -clm_accelerated_spinup=on", "-bgc bgc -envxml_dir . -light_res 360x720", @@ -1873,7 +1859,7 @@ sub cat_and_create_namelistinfile { my $res = "0.9x1.25"; my $mask = "gx1v7"; my $simyr = "1850"; -foreach my $phys ( "clm4_5", 'clm5_0', 'clm5_1', 'clm6_0' ) { +foreach my $phys ( "clm4_5", "clm5_0", "clm6_0" ) { my $mode = "-phys $phys"; &make_config_cache($phys); my @forclist = (); @@ -1881,9 +1867,6 @@ sub cat_and_create_namelistinfile { foreach my $forc ( @forclist ) { foreach my $bgc ( "sp", "bgc" ) { my $lndtuningmode = "${phys}_${forc}"; - if ( $lndtuningmode eq "clm5_1_CRUv7" ) { - next; - } if ( $lndtuningmode eq "clm6_0_CRUv7" ) { next; } From 7b0aa84fda10a8609b2a9bf4e16d67eefc4425c7 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Wed, 2 Oct 2024 16:51:19 -0600 Subject: [PATCH 052/243] Remove clm51 references from /doc --- doc/.ChangeLog_template | 2 -- .../Running-with-custom-crop-calendars.rst | 2 +- .../running-special-cases/Running-with-tillage.rst | 4 ++-- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/doc/.ChangeLog_template b/doc/.ChangeLog_template index c95ea482e3..579f3c68e2 100644 --- a/doc/.ChangeLog_template +++ b/doc/.ChangeLog_template @@ -20,8 +20,6 @@ Does this tag change answers significantly for any of the following physics conf [ ] clm6_0 -[ ] clm5_1 - [ ] clm5_0 [ ] ctsm5_0-nwp diff --git a/doc/source/users_guide/running-special-cases/Running-with-custom-crop-calendars.rst b/doc/source/users_guide/running-special-cases/Running-with-custom-crop-calendars.rst index 878cc0d353..22009add51 100644 --- a/doc/source/users_guide/running-special-cases/Running-with-custom-crop-calendars.rst +++ b/doc/source/users_guide/running-special-cases/Running-with-custom-crop-calendars.rst @@ -93,4 +93,4 @@ The entire process can be illustrated with the RXCROPMATURITY system test. E.g.: :: - run_sys_tests -t RXCROPMATURITY_Lm61.f10_f10_mg37.IHistClm51BgcCrop.cheyenne_intel.clm-cropMonthOutput --skip-generate --skip-compare \ No newline at end of file + run_sys_tests -t RXCROPMATURITY_Lm61.f10_f10_mg37.IHistClm60BgcCrop.cheyenne_intel.clm-cropMonthOutput --skip-generate --skip-compare diff --git a/doc/source/users_guide/running-special-cases/Running-with-tillage.rst b/doc/source/users_guide/running-special-cases/Running-with-tillage.rst index 8cfcaa680b..bccaf0b946 100644 --- a/doc/source/users_guide/running-special-cases/Running-with-tillage.rst +++ b/doc/source/users_guide/running-special-cases/Running-with-tillage.rst @@ -18,10 +18,10 @@ Example: Crop simulation with no tillage ---------------------------------------- :: - > cime/scripts/create_newcase -case IHistClm51BgcCrop_notill -res f19_g17_gl4 -compset IHistClm51BgcCrop + > cime/scripts/create_newcase -case IHistClm60BgcCrop_notill -res f19_g17_gl4 -compset IHistClm60BgcCrop - > cd IHistClm51BgcCrop_notill + > cd IHistClm60BgcCrop_notill > ./case.setup # turn off tillage From 76bcadff3b8afd65c89fe277ac8bdfbb08bdb8ce Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Wed, 2 Oct 2024 16:51:56 -0600 Subject: [PATCH 053/243] Remove clm51 references from /lilac --- lilac/bld_templates/ctsm_template.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lilac/bld_templates/ctsm_template.cfg b/lilac/bld_templates/ctsm_template.cfg index 2cd018aa3c..63755f018b 100644 --- a/lilac/bld_templates/ctsm_template.cfg +++ b/lilac/bld_templates/ctsm_template.cfg @@ -26,7 +26,7 @@ finidat = UNSET # High-level configuration options # ------------------------------------------------------------------------ -# ctsm_phys: 'clm4_5', 'clm5_0', 'clm5_1' or "clm6_0" +# ctsm_phys: 'clm4_5', 'clm5_0', or "clm6_0" ctsm_phys = clm5_0 # configuration: 'nwp' or 'clm' From 39cb1eb6e450688d5f7d0727d60d697913474cfc Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Wed, 2 Oct 2024 16:52:32 -0600 Subject: [PATCH 054/243] Remove clm51 references from /python --- python/ctsm/lilac_make_runtime_inputs.py | 4 ++-- python/ctsm/subset_data.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/python/ctsm/lilac_make_runtime_inputs.py b/python/ctsm/lilac_make_runtime_inputs.py index e751f6c931..623cb3524d 100644 --- a/python/ctsm/lilac_make_runtime_inputs.py +++ b/python/ctsm/lilac_make_runtime_inputs.py @@ -28,7 +28,7 @@ -Specifies ctsm physics +Specifies ctsm physics """ @@ -163,7 +163,7 @@ def buildnml(cime_path, rundir): "buildnml_input", "ctsm_phys", ctsm_cfg_path, - allowed_values=["clm4_5", "clm5_0", "clm5_1", "clm6_0"], + allowed_values=["clm4_5", "clm5_0", "clm6_0"], ) configuration = get_config_value( config, diff --git a/python/ctsm/subset_data.py b/python/ctsm/subset_data.py index d38aee1308..fb0ba925a9 100644 --- a/python/ctsm/subset_data.py +++ b/python/ctsm/subset_data.py @@ -743,7 +743,7 @@ def subset_region(args, file_dict: dict): print("\nFor running this regional case with the created user_mods : ") print( - "./create_newcase --case case --res CLM_USRDAT --compset I2000Clm51BgcCrop", + "./create_newcase --case case --res CLM_USRDAT --compset I2000Clm60BgcCrop", "--run-unsupported --user-mods-dirs ", args.user_mods_dir, "\n\n", From 69b815b3885f8ff9d5932d072713f143774b4ecd Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Wed, 2 Oct 2024 16:13:44 -0700 Subject: [PATCH 055/243] update default fates parameter files This update incorporates multiple parameter file updates per NGEET/fates#1255 --- 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 bc4a93ec4a..63b4ee9576 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -560,7 +560,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). -lnd/clm2/paramdata/fates_params_api.36.1.0_12pft_c240814.nc +lnd/clm2/paramdata/fates_params_api.36.1.0_14pft_c241002.nc From 4e0197bd3e4911413745feb6aec6e889f294834a Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Wed, 2 Oct 2024 16:21:36 -0700 Subject: [PATCH 056/243] update the gitmodules tag for fates --- .gitmodules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitmodules b/.gitmodules index 7274b9acd2..1f6da08484 100644 --- a/.gitmodules +++ b/.gitmodules @@ -28,7 +28,7 @@ [submodule "fates"] path = src/fates url = https://github.com/NGEET/fates -fxtag = sci.1.78.2_api.36.0.0 +fxtag = sci.1.78.3_api.36.1.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 12bcee7c5f70c513f4975e746621db43cca9a858 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Wed, 2 Oct 2024 17:23:35 -0600 Subject: [PATCH 057/243] 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 65bb5dbd27..2b1e13dba0 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 = 3997; +my $ntests = 3196; if ( defined($opts{'compare'}) ) { $ntests += 2437; From 1f851c46371256fb38a0247ccde8981fb77e6ea6 Mon Sep 17 00:00:00 2001 From: "Danny M. Leung" Date: Wed, 2 Oct 2024 18:07:11 -0600 Subject: [PATCH 058/243] Getting a new set of tuning parameters for dust. dmleung 2 Oct 2024 --- src/biogeochem/DustEmisLeung2023.F90 | 2 +- src/biogeophys/SoilStateInitTimeConstMod.F90 | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/biogeochem/DustEmisLeung2023.F90 b/src/biogeochem/DustEmisLeung2023.F90 index 0fee001e64..e9306029be 100644 --- a/src/biogeochem/DustEmisLeung2023.F90 +++ b/src/biogeochem/DustEmisLeung2023.F90 @@ -403,7 +403,7 @@ subroutine DustEmission (this, bounds, & 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 = 3.0_r8 ! [dimless] Maximum value or threshold for fragmentation exponent defined in Leung et al. (2023). Danny M. Leung suggested it to be somewhere between 3 and 5 for tuning. 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. Update: Simone Tilmes might want this as a namelist variable for easier CESM tuning. 30 Sep 2024. + real(r8), parameter :: frag_expt_thr = 2.5_r8 ! [dimless] Maximum value or threshold for fragmentation exponent defined in Leung et al. (2023). Danny M. Leung suggested it to be somewhere between 3 and 5 for tuning. 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. Update: Simone Tilmes might want this as a namelist variable for easier CESM tuning. 30 Sep 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. diff --git a/src/biogeophys/SoilStateInitTimeConstMod.F90 b/src/biogeophys/SoilStateInitTimeConstMod.F90 index 3bd280761f..38076d8327 100644 --- a/src/biogeophys/SoilStateInitTimeConstMod.F90 +++ b/src/biogeophys/SoilStateInitTimeConstMod.F90 @@ -721,7 +721,8 @@ subroutine SoilStateInitTimeConst(bounds, soilstate_inst, nlfilename) !soilstate_inst%gwc_thr_col(c) = ThresholdSoilMoistZender2003( clay3d(g,1) ) if ( is_dust_emis_leung() )then soilstate_inst%mss_frc_cly_vld_col(c) = MassFracClayLeung2023( clay3d(g,1) ) - dust_moist_fact = 0.9_r8 ! change this into a namelist variable later. + !dust_moist_fact = 0.9_r8 ! change this into a namelist variable later. + dust_moist_fact = 1.0_r8 ! change this into a namelist variable later. soilstate_inst%gwc_thr_col(c) = dust_moist_fact * ThresholdSoilMoistZender2003( clay3d(g,1) ) else soilstate_inst%mss_frc_cly_vld_col(c) = MassFracClay( clay3d(g,1) ) From 65d26e68b9121ed3205e8012ea44098815acce79 Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Thu, 3 Oct 2024 09:02:07 -0700 Subject: [PATCH 059/243] add expected failure for FatesColdLandUse test mod This is due to needing a new 16 pft historical flanduse_timeseries file. See #2810. Note this is the older fates harvest mode, not the newer raw LUH2 driven modes. --- 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 30b19ce862..7b17d5743b 100644 --- a/cime_config/testdefs/ExpectedTestFails.xml +++ b/cime_config/testdefs/ExpectedTestFails.xml @@ -280,6 +280,13 @@ + + + FAIL + #2810 + + + From 1045e1ba7492381186bb1c7092c13a1c04cefdd3 Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Thu, 3 Oct 2024 09:50:53 -0700 Subject: [PATCH 060/243] add new changelog entry --- doc/ChangeLog | 87 +++++++++++++++++++++++++++++++++++++++++++++++++++ doc/ChangeSum | 2 ++ 2 files changed, 89 insertions(+) diff --git a/doc/ChangeLog b/doc/ChangeLog index ded12c54f8..99611540cb 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,4 +1,91 @@ =============================================================== +Tag name: ctsm5.3.003 +Originator(s): rgknox (Ryan Knox, LBNL, rgknox@lbl.gov) + glemieux (Gregory Lemieux, LBNL, glemieux@lbl.gov) +Date: Thu Oct 3 10:20:00 MDT 2024 +One-line Summary: FATES default parameter file update + +Purpose and description of changes +---------------------------------- + +This tag updates the default parameter file for FATES bringing in a number of updates: + - adds two new arctic shrub pfts + - updates the default sapwood allometry mode for grass pfts + - updates understory leaf turnover specifications for longer turnover rates + - changes the default behavior of nutrient uptake + +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 #2783 -- Error in FatescoldLandUse testmod + Fixes FATES#1211 -- Switching the default fates_cnp_prescribed_* parameters from 1 to 0 + +Notes of particular relevance for developers: +--------------------------------------------- +Changes to tests or testing: + FatesColdLandUse build has been added to the list of expected failures due to #2810 + +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 ------- + + fates tests: (give name of baseline if different from CTSM tagname, normally fates baselines are fates--) + derecho ----- OK + izumi ------- + +Answer changes +-------------- + +Changes answers relative to baseline: + + Summarize any changes to answers, i.e., + - what code configurations: FATES mode + - what platforms/compilers: ALL + - nature of change (roundoff; larger than roundoff/same climate; new climate): larger than roundoff + +Other details +------------- +List any git submodules updated (cime, rtm, mosart, cism, fates, etc.): + fates: sci.1.78.2_api.36.0.0 -> sci.1.78.3_api.36.1.0 + +Pull Requests that document the changes (include PR ids): + https://github.com/ESCOMP/CTSM/pull/2700 + https://github.com/NGEET/fates/pull/1255 + +=============================================================== +=============================================================== +Tag name: ctsm5.3.002 +Originator(s): slevis (Samuel Levis,UCAR/TSS,303-665-1310) +Date: Thu 26 Sep 2024 03:10:40 PM MDT +One-line Summary: Duplicate tag of ctsm5.3.001 + +=============================================================== +=============================================================== Tag name: ctsm5.3.001 Originator(s): slevis (Samuel Levis,UCAR/TSS,303-665-1310) Date: Thu 26 Sep 2024 03:10:40 PM MDT diff --git a/doc/ChangeSum b/doc/ChangeSum index 1014612b40..14c8b10465 100644 --- a/doc/ChangeSum +++ b/doc/ChangeSum @@ -1,5 +1,7 @@ Tag Who Date Summary ============================================================================================================================ + ctsm5.3.003 multiple 10/03/2024 FATES default parameter file update + ctsm5.3.002 multiple 09/26/2024 Duplicate tag (same as 5.3.001) ctsm5.3.001 multiple 09/26/2024 Merge b4b-dev ctsm5.3.0 multiple 09/24/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/24/2024 New surface datasets: double tag of ctsm5.3.0 From 9abbb70d24d421e21f24b092fcac90e663e65ade Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Thu, 3 Oct 2024 13:20:11 -0700 Subject: [PATCH 061/243] minor changelog update --- doc/ChangeLog | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index 99611540cb..7c84572c58 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -2,17 +2,17 @@ Tag name: ctsm5.3.003 Originator(s): rgknox (Ryan Knox, LBNL, rgknox@lbl.gov) glemieux (Gregory Lemieux, LBNL, glemieux@lbl.gov) -Date: Thu Oct 3 10:20:00 MDT 2024 +Date: Thu Oct 03 10:20:00 MDT 2024 One-line Summary: FATES default parameter file update Purpose and description of changes ---------------------------------- This tag updates the default parameter file for FATES bringing in a number of updates: - - adds two new arctic shrub pfts - - updates the default sapwood allometry mode for grass pfts - - updates understory leaf turnover specifications for longer turnover rates - - changes the default behavior of nutrient uptake + - adds two new arctic shrub pfts + - updates the default sapwood allometry mode for grass pfts + - updates understory leaf turnover specifications for longer turnover rates + - changes the default behavior of nutrient uptake Significant changes to scientifically-supported configurations -------------------------------------------------------------- From b12f6ff78df69f864f4611f56de27db05c55a674 Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Thu, 3 Oct 2024 13:20:46 -0700 Subject: [PATCH 062/243] update filename --- 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 63b4ee9576..34910ec900 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -560,7 +560,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). -lnd/clm2/paramdata/fates_params_api.36.1.0_14pft_c241002.nc +lnd/clm2/paramdata/fates_params_api.36.1.0_14pft_c241003.nc From b9fde417b86b083a38500061e1275a2749cff395 Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Fri, 4 Oct 2024 15:02:25 -0700 Subject: [PATCH 063/243] update fates tag to api36.1 --- src/fates | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fates b/src/fates index e06e0dfcaf..825579d0b4 160000 --- a/src/fates +++ b/src/fates @@ -1 +1 @@ -Subproject commit e06e0dfcaf6347993d47dc29944e952d3e4412f7 +Subproject commit 825579d0b406fe99344591b5ed8356e5c7aeebec From c3ddc480785d513d05390f655df3ec587c3642d4 Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Mon, 7 Oct 2024 09:31:43 -0700 Subject: [PATCH 064/243] update testing results for ctsm5.3.003 --- doc/ChangeLog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index 7c84572c58..d8b2290f38 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -52,11 +52,11 @@ Testing summary: regular tests (aux_clm: https://github.com/ESCOMP/CTSM/wiki/System-Testing-Guide#pre-merge-system-testing): derecho ----- OK - izumi ------- + izumi ------- OK fates tests: (give name of baseline if different from CTSM tagname, normally fates baselines are fates--) derecho ----- OK - izumi ------- + izumi ------- OK Answer changes -------------- From 29f9ac85b258c0731b4361e8d8ebced17db8b345 Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Mon, 7 Oct 2024 09:34:27 -0700 Subject: [PATCH 065/243] update changelog and changesum date/time for ctsm5.3.003 --- doc/ChangeLog | 2 +- doc/ChangeSum | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index d8b2290f38..8e76002a92 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -2,7 +2,7 @@ Tag name: ctsm5.3.003 Originator(s): rgknox (Ryan Knox, LBNL, rgknox@lbl.gov) glemieux (Gregory Lemieux, LBNL, glemieux@lbl.gov) -Date: Thu Oct 03 10:20:00 MDT 2024 +Date: Mon Oct 07 10:33:14 AM MDT 2024 One-line Summary: FATES default parameter file update Purpose and description of changes diff --git a/doc/ChangeSum b/doc/ChangeSum index 14c8b10465..c16940615b 100644 --- a/doc/ChangeSum +++ b/doc/ChangeSum @@ -1,6 +1,6 @@ Tag Who Date Summary ============================================================================================================================ - ctsm5.3.003 multiple 10/03/2024 FATES default parameter file update + ctsm5.3.003 multiple 10/07/2024 FATES default parameter file update ctsm5.3.002 multiple 09/26/2024 Duplicate tag (same as 5.3.001) ctsm5.3.001 multiple 09/26/2024 Merge b4b-dev ctsm5.3.0 multiple 09/24/2024 Update surface datasets, CN Matrix, CLM60: excess ice on, explicit A/C on, crop calendars, Sturm snow, Leung dust emissions, prigent roughness data From 1fbe88ab0bf5da4112f9927b3248c30ecaf8bb62 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Mon, 7 Oct 2024 14:01:28 -0600 Subject: [PATCH 066/243] Revert this change as it changed answers for SMS_Ln9.ne30pg2_ne30pg2_mg17.I1850Clm50Sp.derecho_intel.clm-clm50cam6LndTuningMode--clm-nofireemis, unit tests and some other tests went back to identical, but at least this one changed --- src/biogeophys/SoilStateInitTimeConstMod.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/biogeophys/SoilStateInitTimeConstMod.F90 b/src/biogeophys/SoilStateInitTimeConstMod.F90 index 3bd280761f..07423fcc4d 100644 --- a/src/biogeophys/SoilStateInitTimeConstMod.F90 +++ b/src/biogeophys/SoilStateInitTimeConstMod.F90 @@ -781,7 +781,7 @@ real(r8) function ThresholdSoilMoistZender2003( clay ) call endrun( 'Clay fraction is out of bounds (0 to 100)') return end if - ThresholdSoilMoistZender2003 = 0.17_r8 + 0.14_r8 * (clay*0.01_r8) + ThresholdSoilMoistZender2003 = 0.17_r8 + 0.14_r8 * clay * 0.01_r8 end function ThresholdSoilMoistZender2003 !------------------------------------------------------------------------------ From 3f5aa0f5421cf3ade4d3761ccac4289d4a0a4d5c Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Mon, 7 Oct 2024 15:30:23 -0600 Subject: [PATCH 067/243] Bump up wallclock time for one test. ERS_Ly5_P128x1.f10_f10_mg37.IHistClm60BgcCrop.derecho_intel.clm-cropMonthOutput--clm-matrixcnOn_ignore_warnings See ESCOMP/CTSM#2814 (https://github.com/ESCOMP/CTSM/issues/2814) --- 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 ab1755bb77..2b6a35f9eb 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -1773,7 +1773,7 @@ - + From 3ec9215c09004385621f6523ca68c8eb2a55bd48 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Mon, 7 Oct 2024 15:51:49 -0600 Subject: [PATCH 068/243] Remove include_user_mods from matrixcnOn testmod. Should avoid unnecessary levels of history writing. Resolves ESCOMP/CTSM#2814. --- cime_config/testdefs/testlist_clm.xml | 2 +- .../testdefs/testmods_dirs/clm/matrixcnOn/include_user_mods | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) delete mode 100644 cime_config/testdefs/testmods_dirs/clm/matrixcnOn/include_user_mods diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index 0eb3d5012d..7943b5c55e 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -3332,7 +3332,7 @@ - + diff --git a/cime_config/testdefs/testmods_dirs/clm/matrixcnOn/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/matrixcnOn/include_user_mods deleted file mode 100644 index fe0e18cf88..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/matrixcnOn/include_user_mods +++ /dev/null @@ -1 +0,0 @@ -../default From ae6b18844d186c10a369f62aa749b940d40714c0 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Mon, 7 Oct 2024 20:59:31 -0600 Subject: [PATCH 069/243] Change a test wallclock time to ensure it's what we want. --- 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 7943b5c55e..cdb00db524 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -1333,7 +1333,7 @@ - + From 6ae37190e2ac05253c7027fcb2c1928564f596ad Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Mon, 7 Oct 2024 21:29:34 -0600 Subject: [PATCH 070/243] Update ChangeLog and ChangeSum. --- doc/ChangeLog | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++ doc/ChangeSum | 1 + 2 files changed, 54 insertions(+) diff --git a/doc/ChangeLog b/doc/ChangeLog index 8e76002a92..49f0a48a54 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,4 +1,57 @@ =============================================================== +Tag name: ctsm5.3.004 +Originator(s): samrabin (Sam Rabin) +Date: Mon Oct 7 21:25:20 MDT 2024 +One-line Summary: Move hillslope data off surface datasets + +Purpose and description of changes +---------------------------------- + +Moves hillslope data off surface datasets onto its own separate hillslope_file. This makes it so we don't need to generate new surface datasets specifically for hillslope testing whenever the surface datasets are updated. + + +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 + + +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: Not in real runs, only our testing. + + +Other details +------------- + +Pull Requests that document the changes (include PR ids): +- ESCOMP/CTSM#2434 (https://github.com/ESCOMP/CTSM/pull/2434) + +=============================================================== +=============================================================== Tag name: ctsm5.3.003 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 c16940615b..ad552e320e 100644 --- a/doc/ChangeSum +++ b/doc/ChangeSum @@ -1,5 +1,6 @@ Tag Who Date Summary ============================================================================================================================ + ctsm5.3.004 samrabin 10/07/2024 Move hillslope data off surface datasets ctsm5.3.003 multiple 10/07/2024 FATES default parameter file update ctsm5.3.002 multiple 09/26/2024 Duplicate tag (same as 5.3.001) ctsm5.3.001 multiple 09/26/2024 Merge b4b-dev From 4c9631bd797b770084a946fcc0415cf669517f9c Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Tue, 8 Oct 2024 01:39:18 -0600 Subject: [PATCH 071/243] Make dust_moist_fact different for Leung and Zender, even though both are 1.0, and then have the duplicated line outside of the if statement --- src/biogeophys/SoilStateInitTimeConstMod.F90 | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/biogeophys/SoilStateInitTimeConstMod.F90 b/src/biogeophys/SoilStateInitTimeConstMod.F90 index 9f4a458dda..a730417315 100644 --- a/src/biogeophys/SoilStateInitTimeConstMod.F90 +++ b/src/biogeophys/SoilStateInitTimeConstMod.F90 @@ -721,14 +721,12 @@ subroutine SoilStateInitTimeConst(bounds, soilstate_inst, nlfilename) !soilstate_inst%gwc_thr_col(c) = ThresholdSoilMoistZender2003( clay3d(g,1) ) if ( is_dust_emis_leung() )then soilstate_inst%mss_frc_cly_vld_col(c) = MassFracClayLeung2023( clay3d(g,1) ) - !dust_moist_fact = 0.9_r8 ! change this into a namelist variable later. - dust_moist_fact = 1.0_r8 ! change this into a namelist variable later. - soilstate_inst%gwc_thr_col(c) = dust_moist_fact * ThresholdSoilMoistZender2003( clay3d(g,1) ) + dust_moist_fact = 1.0_r8 ! change this into a namelist variable later., currrently not used but could be in the future else soilstate_inst%mss_frc_cly_vld_col(c) = MassFracClay( clay3d(g,1) ) dust_moist_fact = 1.0_r8 - soilstate_inst%gwc_thr_col(c) = dust_moist_fact * ThresholdSoilMoistZender2003( clay3d(g,1) ) end if + soilstate_inst%gwc_thr_col(c) = dust_moist_fact * ThresholdSoilMoistZender2003( clay3d(g,1) ) end do From 146dba46b7ebba8be78bf88021c8d65ecf15ca88 Mon Sep 17 00:00:00 2001 From: Keith Oleson Date: Wed, 2 Oct 2024 08:18:22 -0600 Subject: [PATCH 072/243] Fix issue #2793 --- src/biogeophys/EnergyFluxType.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/biogeophys/EnergyFluxType.F90 b/src/biogeophys/EnergyFluxType.F90 index 16929d9708..6a31293fa3 100644 --- a/src/biogeophys/EnergyFluxType.F90 +++ b/src/biogeophys/EnergyFluxType.F90 @@ -579,7 +579,7 @@ subroutine InitHistory(this, bounds, is_simple_buildtemp, is_prog_buildtemp) avgflag='A', long_name='urban heating flux', & ptr_col=this%eflx_urban_heat_col, set_nourb=0._r8, c2l_scale_type='urbanf') else - this%eflx_urban_ac_lun(begl:endl) = spval + this%eflx_building_lun(begl:endl) = spval call hist_addfld1d (fname='EFLXBUILD', units='W/m^2', & avgflag='A', long_name='building heat flux from change in interior building air temperature', & ptr_lunit=this%eflx_building_lun, set_nourb=0._r8, l2g_scale_type='unity') From dff408b1390e6ca032a81241d69a98d98c99e373 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Tue, 8 Oct 2024 15:11:26 -0600 Subject: [PATCH 073/243] 5.1 to 6.0 correction recommended by Erik --- bld/CLMBuildNamelist.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index b881cdbfac..6392ed2f79 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -2113,7 +2113,7 @@ sub setup_logic_roughness_methods { my $phys = $physv->as_string(); if ( $phys eq "clm4_5" || $phys eq "clm5_0" ) { if ( $var eq "Meier2022" ) { - $log->fatal_error("z0param_method = $var and phys = $phys, but this method has been tested only with clm5_1 and later versions; to use with earlier versions, disable this error, and add Meier2022 parameters to the corresponding params file"); + $log->fatal_error("z0param_method = $var and phys = $phys, but this method has been tested only with clm6_0 and later versions; to use with earlier versions, disable this error, and add Meier2022 parameters to the corresponding params file"); } } } From c1fe2580ccabaad8ebe334e581876196a9a7e1cf Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Tue, 8 Oct 2024 16:56:09 -0600 Subject: [PATCH 074/243] Clm60 finidat updates for ne30, f09, f19 grids --- bld/namelist_files/namelist_defaults_ctsm.xml | 102 ++++++++---------- 1 file changed, 43 insertions(+), 59 deletions(-) diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index 34910ec900..1356e0c222 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -1354,18 +1354,32 @@ 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/ctsm53n04ctsm52028_f09_pSASU.clm2.r.0161-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/ctsm53n04ctsm52028_f09_pSASU.clm2.r.0161-01-01-00000.nc + + +lnd/clm2/initdata_esmf/ctsm5.3/ctsm53n04ctsm52028_ne30pg3t232_pSASU.clm2.r.0121-01-01-00000.nc + + +lnd/clm2/initdata_esmf/ctsm5.3/ctsm530_f19_PPE_pSASU.clm2.r.0161-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/ctsm53n04ctsm52028_f09_hist.clm2.r.2000-01-01-00000.nc @@ -1493,21 +1507,25 @@ 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/ctsm53n04ctsm52028_f09_hist.clm2.r.2000-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/ctsm53n04ctsm52028_f09_hist.clm2.r.2000-01-01-00000.nc + +lnd/clm2/initdata_esmf/ctsm5.3/ctsm53n04ctsm52028_ne30pg3t232_hist.clm2.r.2000-01-01-00000.nc @@ -1532,7 +1550,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). ic_ymd="19790101" sim_year="1979" do_transient_pfts=".false." use_excess_ice=".false." ic_tod="0" glc_nec="10" use_crop=".false." 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_simyr1979_c200806.nc +>lnd/clm2/initdata_map/ctsm53n04ctsm52028_f09_hist.clm2.r.1979-01-01-00000.nc - -lnd/clm2/initdata_esmf/ctsm5.3/ctsm52026_f09_pSASU.clm2.r.0421-01-01-00000.nc - lnd/clm2/initdata_map/clmi.BHIST.2000-01-01.0.9x1.25_gx1v7_simyr1979_c200806.nc +>lnd/clm2/initdata_map/ctsm53n04ctsm52028_f09_hist.clm2.r.1979-01-01-00000.nc + +lnd/clm2/initdata_map/ctsm53n04ctsm52028_ne30pg3t232_hist.clm2.r.1979-01-01-00000.nc - -lnd/clm2/initdata_esmf/ctsm5.3/ctsm52026_f09_pSASU.clm2.r.0421-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/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 - - lnd/clm2/initdata_map/clmi.BHIST.2000-01-01.0.9x1.25_gx1v7_simyr1979_c200806.nc +>lnd/clm2/initdata_map/ctsm53n04ctsm52028_f09_hist.clm2.r.1979-01-01-00000.nc - -lnd/clm2/initdata_esmf/ctsm5.3/ctsm52026_f09_pSASU.clm2.r.0421-01-01-00000.nc - - lnd/clm2/initdata_map/clmi.BHIST.2000-01-01.0.9x1.25_gx1v7_simyr1979_c200806.nc +>lnd/clm2/initdata_map/ctsm53n04ctsm52028_f09_hist.clm2.r.1979-01-01-00000.nc + +lnd/clm2/initdata_map/ctsm53n04ctsm52028_ne30pg3t232_hist.clm2.r.1979-01-01-00000.nc - -lnd/clm2/initdata_esmf/ctsm5.3/ctsm52026_f09_pSASU.clm2.r.0421-01-01-00000.nc - - Date: Wed, 9 Oct 2024 12:41:39 -0600 Subject: [PATCH 075/243] Fix hillslope with use_init_interp warning test, by specifying the hillslope_file this fixes #2826 --- 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 06c9bcc361..5fb7b4f39b 100755 --- a/bld/unit_testers/build-namelist_test.pl +++ b/bld/unit_testers/build-namelist_test.pl @@ -1359,8 +1359,8 @@ 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.", + "hillslope with init_interp"=>{ options=>"--res 10x15 --bgc bgc --envxml_dir .", + namelst=>"use_init_interp=.true.,use_hillslope=.true.,hillslope_file='/dev/null'", phys=>"clm6_0", }, ); From 081427459cb67da29e3927664764f04b5e564a16 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Wed, 9 Oct 2024 16:43:15 -0600 Subject: [PATCH 076/243] ne30 updates in response to Keith Oleson's review --- bld/namelist_files/namelist_defaults_ctsm.xml | 31 ++++++++++--------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index 1356e0c222..6708e5ba8f 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -936,6 +936,10 @@ 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_nex=10 do_transient_pfts=.false. lnd_tuning_mode=clm6_0_GSWP3v1 use_excess_ice=.true. +hgrid=ne30np4.pg3 mask=t232 + 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=ne30np4.pg3 maxpft=79 mask=t232 use_cn=.true. use_crop=.true. irrigate=.true. glc_nec=10 do_transient_pfts=.false. use_excess_ice=.true. + 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=ne30np4.pg3 mask=t232 + + lnd/clm2/initdata_esmf/ctsm5.3/ctsm53n04ctsm52028_f09_pSASU.clm2.r.0161-01-01-00000.nc -lnd/clm2/initdata_esmf/ctsm5.3/ctsm53n04ctsm52028_ne30pg3t232_pSASU.clm2.r.0121-01-01-00000.nc @@ -1521,7 +1532,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). phys="clm6_0" use_init_interp=".true." >lnd/clm2/initdata_esmf/ctsm5.3/ctsm53n04ctsm52028_f09_hist.clm2.r.2000-01-01-00000.nc -lnd/clm2/initdata_map/ctsm53n04ctsm52028_f09_hist.clm2.r.1979-01-01-00000.nc -lnd/clm2/initdata_map/ctsm53n04ctsm52028_ne30pg3t232_hist.clm2.r.1979-01-01-00000.nc @@ -1797,12 +1806,6 @@ attributes from the config_cache.xml file (with keys converted to upper-case). lnd_tuning_mode="clm6_0_cam6.0" use_init_interp=".true." >lnd/clm2/initdata_map/ctsm53n04ctsm52028_f09_hist.clm2.r.1979-01-01-00000.nc -lnd/clm2/initdata_map/ctsm53n04ctsm52028_ne30pg3t232_hist.clm2.r.1979-01-01-00000.nc - Date: Wed, 9 Oct 2024 16:43:55 -0600 Subject: [PATCH 077/243] f19 updates for test to pick up the correct finidat --- bld/namelist_files/namelist_defaults_ctsm.xml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index 6708e5ba8f..296feb03ba 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -936,6 +936,10 @@ 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_nex=10 do_transient_pfts=.false. lnd_tuning_mode=clm6_0_GSWP3v1 use_excess_ice=.true. +hgrid=1.9x2.5 mask=gx1v7 + hgrid=ne30np4.pg3 mask=t232 @@ -1386,9 +1390,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). >lnd/clm2/initdata_esmf/ctsm5.3/ctsm53n04ctsm52028_ne30pg3t232_pSASU.clm2.r.0121-01-01-00000.nc -lnd/clm2/initdata_esmf/ctsm5.3/ctsm530_f19_PPE_pSASU.clm2.r.0161-01-01-00000.nc From 10ff40411a43b6a214700b14bc0edd197e036832 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Thu, 10 Oct 2024 02:19:46 -0600 Subject: [PATCH 078/243] Add more expected fails --- cime_config/testdefs/ExpectedTestFails.xml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/cime_config/testdefs/ExpectedTestFails.xml b/cime_config/testdefs/ExpectedTestFails.xml index 3b80016f82..7049e9672b 100644 --- a/cime_config/testdefs/ExpectedTestFails.xml +++ b/cime_config/testdefs/ExpectedTestFails.xml @@ -135,6 +135,17 @@ + + + FAIL + #2310 + + + FAIL + #2310 + + + FAIL @@ -171,6 +182,13 @@ + + + FAIL + #2454 + + + FAIL From 87778795589cd919b98df068ec90147fa85bed80 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Thu, 10 Oct 2024 03:17:38 -0600 Subject: [PATCH 079/243] Update change files --- doc/ChangeLog | 91 +++++++++++++++++++++++++++++++++++++++++++++++++++ doc/ChangeSum | 1 + 2 files changed, 92 insertions(+) diff --git a/doc/ChangeLog b/doc/ChangeLog index 49f0a48a54..8f5b81d52b 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,4 +1,95 @@ =============================================================== +Tag name: ctsm5.3.005 +Originator(s): dmleung (Danny Leung) +Date: Thu 10 Oct 2024 03:15:52 AM MDT +One-line Summary: Hardcoded tuning adjustments for Leung_2024 dust emissions + +Purpose and description of changes +---------------------------------- + +Changes to dust emissions when Leung_2024 method is being used. + +Tuning was needed since we saw some high biases in dust over semiarid regions given all the updates in CTSM and CAM. The biggest +changes in CTSM that affects dust is an increase in friction velocity (ustar; fv in CTSM) over vegetated, semiarid regions, mainly +due to a switch in the roughness scheme from 'ZengWang2007' to 'Meier2022'. Since dust emission is very sensitive to ustar, the dust +emission scheme magnifies this increase and caused strong high biases over semiarid regions, including Australia and Patagonia (see +plots in issue #2732). To enhance the robustness of Leung_2023 and reduce the likelihood to see huge changes in answers in the +future, we tried to limit the sensitivity of dust emissions to ustar. We also tried different methods (see specific notes below) to +reduce dust emissions from semiarid regions given the high biases over there. + + +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]: + + Start of work on tuning for #2732 + Fixes #2826 -- Fix failing warning test + +Notes of particular relevance for developers: +--------------------------------------------- + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): + Dust tuning parameters are hardcoded in FORTRAN and need to be moved to namelists + +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: Yes for clm6_0 + + Summarize any changes to answers, i.e., + - what code configurations: clm6_0 + - what platforms/compilers: all + - nature of change (roundoff; larger than roundoff/same climate; new climate): + Just updates dust emissions when Leung_2024 method is used + + Only the dust emission fields are changed all other fields are untouched + +Other details +------------- + +Pull Requests that document the changes (include PR ids): +(https://github.com/ESCOMP/ctsm/pull) + + https://github.com/ESCOMP/CTSM/pull/2803 -- Tuning Leung_2023 dust emissions for clm6_0_cam7.0 + +=============================================================== +=============================================================== Tag name: ctsm5.3.004 Originator(s): samrabin (Sam Rabin) Date: Mon Oct 7 21:25:20 MDT 2024 diff --git a/doc/ChangeSum b/doc/ChangeSum index ad552e320e..358fb8060e 100644 --- a/doc/ChangeSum +++ b/doc/ChangeSum @@ -1,5 +1,6 @@ Tag Who Date Summary ============================================================================================================================ + ctsm5.3.005 erik 10/10/2024 Hardcoded tuning adjustments for Leung_2024 dust emissions ctsm5.3.004 samrabin 10/07/2024 Move hillslope data off surface datasets ctsm5.3.003 multiple 10/07/2024 FATES default parameter file update ctsm5.3.002 multiple 09/26/2024 Duplicate tag (same as 5.3.001) From 33c8d55740e6d0100d2ef22a2d8019e34d45e928 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Thu, 10 Oct 2024 17:03:40 -0600 Subject: [PATCH 080/243] Updates after Erik's reviewr; ne30 1979 does not work, yet --- bld/namelist_files/namelist_defaults_ctsm.xml | 54 ++++++++++--------- 1 file changed, 29 insertions(+), 25 deletions(-) diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index 296feb03ba..44951814a4 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -938,11 +938,11 @@ attributes from the config_cache.xml file (with keys converted to upper-case). hgrid=1.9x2.5 mask=gx1v7 +>mask=gx1v7 use_cn=.true. do_transient_pfts=.false. use_excess_ice=.true. use_crop=.false. irrigate=.false. hgrid=ne30np4.pg3 mask=t232 +>mask=t232 use_cn=.true. do_transient_pfts=.false. use_excess_ice=.true. use_crop=.true. irrigate=.false. @@ -1275,9 +1275,9 @@ 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. use_excess_ice=.false. -hgrid=ne30np4.pg3 mask=t232 +hgrid=ne30np4.pg3 maxpft=17 mask=t232 use_cn=.false. use_crop=.false. irrigate=.true. glc_nec=10 do_transient_pfts=.false. use_excess_ice=.false. @@ -1371,27 +1371,30 @@ attributes from the config_cache.xml file (with keys converted to upper-case). - lnd/clm2/initdata_esmf/ctsm5.3/ctsm53n04ctsm52028_f09_pSASU.clm2.r.0161-01-01-00000.nc lnd/clm2/initdata_esmf/ctsm5.3/ctsm53n04ctsm52028_f09_pSASU.clm2.r.0161-01-01-00000.nc -lnd/clm2/initdata_esmf/ctsm5.3/ctsm53n04ctsm52028_ne30pg3t232_pSASU.clm2.r.0121-01-01-00000.nc -lnd/clm2/initdata_esmf/ctsm5.3/ctsm530_f19_PPE_pSASU.clm2.r.0161-01-01-00000.nc @@ -1435,7 +1438,6 @@ attributes from the config_cache.xml file (with keys converted to upper-case). lnd_tuning_mode="clm5_1_GSWP3v1" use_init_interp=".true." >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/ctsm53n04ctsm52028_ne30pg3t232_hist.clm2.r.2000-01-01-00000.nc @@ -1562,8 +1564,8 @@ attributes from the config_cache.xml file (with keys converted to upper-case). lnd/clm2/initdata_map/ctsm53n04ctsm52028_f09_hist.clm2.r.1979-01-01-00000.nc + lnd_tuning_mode="clm5_1_cam7.0" +>lnd/clm2/initdata_esmf/ctsm5.3/ctsm53n04ctsm52028_f09_hist.clm2.r.1979-01-01-00000.nc lnd/clm2/initdata_map/ctsm53n04ctsm52028_f09_hist.clm2.r.1979-01-01-00000.nc + lnd_tuning_mode="clm6_0_cam7.0" +>lnd/clm2/initdata_esmf/ctsm5.3/ctsm53n04ctsm52028_f09_hist.clm2.r.1979-01-01-00000.nc -lnd/clm2/initdata_map/ctsm53n04ctsm52028_ne30pg3t232_hist.clm2.r.1979-01-01-00000.nc +lnd/clm2/initdata_esmf/ctsm5.3/ctsm53n04ctsm52028_ne30pg3t232_hist.clm2.r.1979-01-01-00000.nc lnd/clm2/initdata_map/ctsm53n04ctsm52028_f09_hist.clm2.r.1979-01-01-00000.nc + lnd_tuning_mode="clm5_1_cam6.0" +>lnd/clm2/initdata_esmf/ctsm5.3/ctsm53n04ctsm52028_f09_hist.clm2.r.1979-01-01-00000.nc lnd/clm2/initdata_map/ctsm53n04ctsm52028_f09_hist.clm2.r.1979-01-01-00000.nc + lnd_tuning_mode="clm6_0_cam6.0" +>lnd/clm2/initdata_esmf/ctsm5.3/ctsm53n04ctsm52028_f09_hist.clm2.r.1979-01-01-00000.nc Date: Thu, 10 Oct 2024 17:07:38 -0600 Subject: [PATCH 081/243] Draft ChangeLog/Sum --- doc/ChangeLog | 92 ++++++++++++++++++++++++++++++++++++++++++++++++++- doc/ChangeSum | 2 ++ 2 files changed, 93 insertions(+), 1 deletion(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index 8f5b81d52b..8be750f8a7 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,4 +1,87 @@ =============================================================== +Tag name: ctsm5.3.007 +Originator(s): slevis (Samuel Levis,UCAR/TSS,303-665-1310) +Date: Thu 10 Oct 2024 10:12:18 AM MDT +One-line Summary: Clm60 finidat updates for ne30, f09, f19 grids + +Purpose and description of changes +---------------------------------- + Updates appear in namelist_defaults_ctsm.xml. + As before, I updated clm51, too, to keep it same as clm60 (and clm51 will go away soon). + +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]: + Relates to (fixes?) #2403; needs more work to close? + +Notes of particular relevance for users +--------------------------------------- +Changes made to namelist defaults (e.g., changed parameter values): + Clm60 and clm51 finidat updates for ne30, f09, f19 grids. + +Changes to the datasets (e.g., parameter, surface or initial files): + Clm60 and clm51 finidat updates for ne30, f09, f19 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 - TODO + + python testing (if python code has changed; see instructions in python/README.md; document testing done): + + derecho - TODO + + regular tests (aux_clm: https://github.com/ESCOMP/CTSM/wiki/System-Testing-Guide#pre-merge-system-testing): + + derecho ----- TODO + izumi ------- TODO + + +Answer changes +-------------- + +Changes answers relative to baseline: Yes. + + Summarize any changes to answers, i.e., + - what code configurations: clm60 (and clm51 which goes away very soon) + - what platforms/compilers: all + - nature of change: larger than roundoff/same climate + +Other details +------------- +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/2821 + +=============================================================== +=============================================================== +Tag name: ctsm5.3.006 +=============================================================== +=============================================================== Tag name: ctsm5.3.005 Originator(s): dmleung (Danny Leung) Date: Thu 10 Oct 2024 03:15:52 AM MDT @@ -132,7 +215,14 @@ Testing summary: Answer changes -------------- -Changes answers relative to baseline: Not in real runs, only our testing. +Changes answers relative to baseline: Yes + + Summarize any changes to answers, i.e., + - what code configurations: Hillslope (tests only) + - what platforms/compilers: Tests on Izumi and Derecho + - nature of change: Larger than roundoff + + Only our tests are affected because I had to make changes to the test setup for compatibility; this included changing mesh file and hillslope data for some tests/testmods. Other details diff --git a/doc/ChangeSum b/doc/ChangeSum index 358fb8060e..293e0fc9ce 100644 --- a/doc/ChangeSum +++ b/doc/ChangeSum @@ -1,5 +1,7 @@ Tag Who Date Summary ============================================================================================================================ + ctsm5.3.007 slevis 10/11/2024 Clm60 finidat updates for ne30, f09, f19 grids + ctsm5.3.006 ctsm5.3.005 erik 10/10/2024 Hardcoded tuning adjustments for Leung_2024 dust emissions ctsm5.3.004 samrabin 10/07/2024 Move hillslope data off surface datasets ctsm5.3.003 multiple 10/07/2024 FATES default parameter file update From cfcd041b9455a41d122cc58fa335e6bc86c9b2d7 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Fri, 11 Oct 2024 07:18:52 -0600 Subject: [PATCH 082/243] Update ChangeLog/ChangeSum. --- doc/ChangeLog | 70 ++++++++++++++++++++++++++++++++++++++++++++++++++- doc/ChangeSum | 1 + 2 files changed, 70 insertions(+), 1 deletion(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index 8f5b81d52b..737bec2b97 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,4 +1,72 @@ =============================================================== +Tag name: ctsm5.3.006 +Originator(s): samrabin (Sam Rabin, UCAR/TSS, samrabin@ucar.edu) +Date: Fri Oct 11 07:01:09 MDT 2024 +One-line Summary: Merge b4b-dev + +Purpose and description of changes +---------------------------------- + +- Fix clm-basic tests (resolves ESCOMP/CTSM#2787) +- Change testlist_clm ne30pg3_t061 tests to ne30pg3_t232 (resolves ESCOMP/CTSM#2702) +- Remove unused variable elevclass_o in mkglcmecMod.F90 (resolves ESCOMP/CTSM#2802) +- Add a check in failtest, warntest, finidat_files, so when a new test or finidat file are added and one of the subkeys is misspelled you will get an error and tester will die (resolves ESCOMP/CTSM#2673) +- Move from deprecated shr_file to shr_log +- Set eflx_building_lun to spval properly (resolves ESCOMP/CTSM#2793) + + +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: +- ESCOMP/CTSM#2787 (aux_clm "clm-basic" tests fail as of ctsm5.3.0 because they need c13 in finidat; https://github.com/ESCOMP/CTSM/issues/2787) +- ESCOMP/CTSM#2702 (Tests failing in ctsm5.2.019 for CESM alpha testing; https://github.com/ESCOMP/CTSM/issues/2702) +- ESCOMP/CTSM#2802 (Array elevclass_o in mksurfdata_esmf/src/mkglcmecMod.F90 is not allocated before use; https://github.com/ESCOMP/CTSM/issues/2802) +- ESCOMP/CTSM#2673 (Catch use of namelist attribute in failure testing in perl build-namelist tester; https://github.com/ESCOMP/CTSM/issues/2673) +- ESCOMP/CTSM#2793 (Potential typo/bug in EnergyFluxType.F90; https://github.com/ESCOMP/CTSM/issues/2793) + + +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: +- ESCOMP/CTSM#2798: Fix clm-basic tests (https://github.com/ESCOMP/CTSM/pull/2798) +- ESCOMP/CTSM#2799: Change testlist_clm ne30pg3_t061 tests to ne30pg3_t232 (https://github.com/ESCOMP/CTSM/pull/2799) +- ESCOMP/CTSM#2804: Remove unused variable elevclass_o in mkglcmecMod.F90 (https://github.com/ESCOMP/CTSM/pull/2804) +- ESCOMP/CTSM#2678: Add check in build-namelist_test.pl (https://github.com/ESCOMP/CTSM/pull/2678) +- ESCOMP/CTSM#2627: move from depricated shr_file to shr_log (https://github.com/ESCOMP/CTSM/pull/2627) +- ESCOMP/CTSM#2806: Set eflx_building_lun to spval properly (https://github.com/ESCOMP/CTSM/pull/2806) + +=============================================================== +=============================================================== Tag name: ctsm5.3.005 Originator(s): dmleung (Danny Leung) Date: Thu 10 Oct 2024 03:15:52 AM MDT @@ -91,7 +159,7 @@ Pull Requests that document the changes (include PR ids): =============================================================== =============================================================== Tag name: ctsm5.3.004 -Originator(s): samrabin (Sam Rabin) +Originator(s): samrabin (Sam Rabin, UCAR/TSS, samrabin@ucar.edu) Date: Mon Oct 7 21:25:20 MDT 2024 One-line Summary: Move hillslope data off surface datasets diff --git a/doc/ChangeSum b/doc/ChangeSum index 358fb8060e..f74348094c 100644 --- a/doc/ChangeSum +++ b/doc/ChangeSum @@ -1,5 +1,6 @@ Tag Who Date Summary ============================================================================================================================ + ctsm5.3.006 samrabin 10/11/2024 Merge b4b-dev ctsm5.3.005 erik 10/10/2024 Hardcoded tuning adjustments for Leung_2024 dust emissions ctsm5.3.004 samrabin 10/07/2024 Move hillslope data off surface datasets ctsm5.3.003 multiple 10/07/2024 FATES default parameter file update From bb97fb3bd5831f0a08b768df61ee6c013e9b2cc0 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Fri, 11 Oct 2024 13:59:05 -0600 Subject: [PATCH 083/243] Updates from review with Erik and subsequent testing --- bld/namelist_files/namelist_defaults_ctsm.xml | 132 +++++++----------- 1 file changed, 51 insertions(+), 81 deletions(-) diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index 44951814a4..11a7d68e71 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -942,7 +942,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). mask=t232 use_cn=.true. do_transient_pfts=.false. use_excess_ice=.true. use_crop=.true. irrigate=.false. +>mask=tx2_3v2 use_cn=.true. do_transient_pfts=.false. use_excess_ice=.true. use_crop=.true. irrigate=.false. @@ -965,11 +965,16 @@ 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. use_excess_ice=.false. + hgrid=0.9x1.25 maxpft=79 mask=gx1v7 use_cn=.true. use_crop=.true. irrigate=.true. 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=.true. glc_nex=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_nex=10 do_transient_pfts=.false. lnd_tuning_mode=clm6_0_GSWP3v1 use_excess_ice=.true. +>hgrid=0.9x1.25 maxpft=79 mask=gx1v7 use_cn=.true. use_crop=.true. irrigate=.true. glc_nex=10 do_transient_pfts=.false. use_excess_ice=.true. + +hgrid=ne30np4.pg3 maxpft=79 mask=tx2_3v2 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. use_excess_ice=.false. -hgrid=ne30np4.pg3 maxpft=79 mask=t232 use_cn=.true. use_crop=.true. irrigate=.true. glc_nec=10 do_transient_pfts=.false. use_excess_ice=.true. - 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. use_excess_ice=.false. +hgrid=0.9x1.25 maxpft=79 mask=gx1v7 use_cn=.true. use_crop=.true. irrigate=.true. glc_nec=10 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. use_excess_ice=.false. +hgrid=0.9x1.25 maxpft=79 mask=gx1v7 use_cn=.true. use_crop=.true. irrigate=.true. glc_nec=10 use_excess_ice=.true. + +hgrid=ne30np4.pg3 maxpft=79 mask=tx2_3v2 use_cn=.true. use_crop=.true. irrigate=.true. glc_nec=10 use_excess_ice=.true. 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=ne30np4.pg3 maxpft=17 mask=t232 use_cn=.false. use_crop=.false. irrigate=.true. glc_nec=10 do_transient_pfts=.false. use_excess_ice=.false. - - lnd/clm2/initdata_esmf/ctsm5.3/ctsm53n04ctsm52028_f09_pSASU.clm2.r.0161-01-01-00000.nc +>lnd/clm2/initdata_esmf/ctsm5.3/ctsm53n04ctsm52028_f09_g17_BgcCrop_exice_pSASU.clm60.r.0161-01-01.nc lnd/clm2/initdata_esmf/ctsm5.3/ctsm53n04ctsm52028_f09_pSASU.clm2.r.0161-01-01-00000.nc +>lnd/clm2/initdata_esmf/ctsm5.3/ctsm53n04ctsm52028_f09_g17_BgcCrop_exice_pSASU.clm60.r.0161-01-01.nc -lnd/clm2/initdata_esmf/ctsm5.3/ctsm53n04ctsm52028_ne30pg3t232_pSASU.clm2.r.0121-01-01-00000.nc +>lnd/clm2/initdata_esmf/ctsm5.3/ctsm53n04ctsm52028_ne30pg3t232_BgcCrop_exice_pSASU.clm60.r.0121-01-01.nc lnd/clm2/initdata_esmf/ctsm5.3/ctsm530_f19_PPE_pSASU.clm2.r.0161-01-01-00000.nc +>lnd/clm2/initdata_esmf/ctsm5.3/ctsm530_f19_g17_Bgc_exice_pSASU.clm60.r.0161-01-01.nc @@ -1523,24 +1516,26 @@ attributes from the config_cache.xml file (with keys converted to upper-case). lnd/clm2/initdata_esmf/ctsm5.3/ctsm53n04ctsm52028_f09_hist.clm2.r.2000-01-01-00000.nc +>lnd/clm2/initdata_esmf/ctsm5.3/ctsm53n04ctsm52028_f09_g17_BgcCrop_exice_hist.clm60.r.2000-01-01.nc + lnd/clm2/initdata_esmf/ctsm5.3/ctsm53n04ctsm52028_f09_hist.clm2.r.2000-01-01-00000.nc +>lnd/clm2/initdata_esmf/ctsm5.3/ctsm53n04ctsm52028_f09_g17_BgcCrop_exice_hist.clm60.r.2000-01-01.nc -lnd/clm2/initdata_esmf/ctsm5.3/ctsm53n04ctsm52028_ne30pg3t232_hist.clm2.r.2000-01-01-00000.nc + phys="clm6_0" use_init_interp=".true." +>lnd/clm2/initdata_esmf/ctsm5.3/ctsm53n04ctsm52028_ne30pg3t232_BgcCrop_exice_hist.clm60.r.2000-01-01.nc @@ -1560,12 +1555,12 @@ attributes from the config_cache.xml file (with keys converted to upper-case). lnd_tuning_mode="clm5_0_cam7.0" use_init_interp=".true." >lnd/clm2/initdata_map/clmi.FHISTSp.2013-01-01.ne0CONUSne30x8_mt12_simyr2013_c200806.nc - -lnd/clm2/initdata_esmf/ctsm5.3/ctsm53n04ctsm52028_f09_hist.clm2.r.1979-01-01-00000.nc + +lnd/clm2/initdata_esmf/ctsm5.3/ctsm53n04ctsm52028_f09_g17_BgcCrop_exice_hist.clm60.r.1979-01-01.nc lnd/clm2/initdata_map/clmi.FHISTSp.2013-01-01.ne0CONUSne30x8_mt12_simyr2013_c200806.nc -lnd/clm2/initdata_esmf/ctsm5.3/ctsm53n04ctsm52028_f09_hist.clm2.r.1979-01-01-00000.nc - -lnd/clm2/initdata_esmf/ctsm5.3/ctsm53n04ctsm52028_ne30pg3t232_hist.clm2.r.1979-01-01-00000.nc + +lnd/clm2/initdata_esmf/ctsm5.3/ctsm53n04ctsm52028_f09_g17_BgcCrop_exice_hist.clm60.r.1979-01-01.nc - -lnd/clm2/initdata_map/clmi.BHIST.2000-01-01.1.9x2.5_gx1v7_simyr1979_c200806.nc +lnd/clm2/initdata_esmf/ctsm5.3/ctsm53n04ctsm52028_ne30pg3t232_BgcCrop_exice_hist.clm60.r.1979-01-01.nc @@ -1749,13 +1739,6 @@ attributes from the config_cache.xml file (with keys converted to upper-case). -lnd/clm2/initdata_esmf/ctsm5.3/ctsm53n04ctsm52028_f09_hist.clm2.r.1979-01-01-00000.nc - - -lnd/clm2/initdata_esmf/ctsm5.3/ctsm53n04ctsm52028_f09_hist.clm2.r.1979-01-01-00000.nc - - -lnd/clm2/initdata_map/clmi.BHIST.2000-01-01.1.9x2.5_gx1v7_simyr1979_c200806.nc - Date: Fri, 11 Oct 2024 17:37:53 -0600 Subject: [PATCH 084/243] Correct mask for ne30pg3 1979 finidat 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 11a7d68e71..ad02f86de7 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -1621,7 +1621,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). phys="clm6_0" use_init_interp=".true." >lnd/clm2/initdata_esmf/ctsm5.3/ctsm53n04ctsm52028_f09_g17_BgcCrop_exice_hist.clm60.r.1979-01-01.nc - Date: Fri, 11 Oct 2024 23:28:54 -0600 Subject: [PATCH 085/243] Remove 2003 finidat settings for clm5_1/clm6_0 so will use 2000 files, handle 1979 finidat settings consistently for f09, f19, and ne30pg3 --- bld/namelist_files/namelist_defaults_ctsm.xml | 120 +++--------------- 1 file changed, 18 insertions(+), 102 deletions(-) diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index ad02f86de7..d03a840fd3 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -756,18 +756,11 @@ attributes from the config_cache.xml file (with keys converted to upper-case). - -.true. -.true. + .true. .true. - -.true. - -.true. -.true. + +.true. +.true. +.true. + .true. .true. - -.true. - -.true. -.true. + .true. .true. - -.true. - -.true. -.true. + .true. .true. - -.true. -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. +maxpft=79 mask=gx1v7 use_cn=.true. use_crop=.true. irrigate=.true. glc_nec=10 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. use_excess_ice=.false. +hgrid=0.9x1.25 maxpft=79 mask=gx1v7 use_cn=.true. use_crop=.true. irrigate=.true. glc_nec=10 use_excess_ice=.true. 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 use_excess_ice=.true. - -hgrid=0.9x1.25 maxpft=79 mask=gx1v7 use_cn=.true. use_crop=.true. irrigate=.true. glc_nec=10 use_excess_ice=.true. - hgrid=ne30np4.pg3 maxpft=79 mask=tx2_3v2 use_cn=.true. use_crop=.true. irrigate=.true. glc_nec=10 use_excess_ice=.true. +>maxpft=79 mask=tx2_3v2 use_cn=.true. use_crop=.true. irrigate=.true. glc_nec=10 use_excess_ice=.true. 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. use_excess_ice=.false. - - lnd/clm2/initdata_esmf/ctsm5.3/ctsm53n04ctsm52028_f09_g17_BgcCrop_exice_hist.clm60.r.1979-01-01.nc -lnd/clm2/initdata_map/clmi.BHIST.2000-01-01.1.9x2.5_gx1v7_simyr1979_c200806.nc - - - -lnd/clm2/initdata_map/clmi.BHISTSp.2000-01-01.1.9x2.5_gx1v7_simyr2003_c200807.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.1.9x2.5_gx1v7_simyr1979_c200806.nc - - - -lnd/clm2/initdata_map/clmi.BHISTSp.2000-01-01.1.9x2.5_gx1v7_simyr2003_c200807.nc - - - -lnd/clm2/initdata_map/clmi.BHISTSp.2000-01-01.1.9x2.5_gx1v7_simyr2003_c200807.nc - - Date: Sun, 13 Oct 2024 15:48:40 -0600 Subject: [PATCH 086/243] Updated ChangeLog/Sum --- doc/ChangeLog | 20 ++++++++++++-------- doc/ChangeSum | 2 +- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index 191cd7753a..867d23c5c5 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,13 +1,17 @@ =============================================================== Tag name: ctsm5.3.007 Originator(s): slevis (Samuel Levis,UCAR/TSS,303-665-1310) -Date: Thu 10 Oct 2024 10:12:18 AM MDT +Date: Mon 13 Oct 2024 10:12:18 AM MDT One-line Summary: Clm60 finidat updates for ne30, f09, f19 grids Purpose and description of changes ---------------------------------- Updates appear in namelist_defaults_ctsm.xml. - As before, I updated clm51, too, to keep it same as clm60 (and clm51 will go away soon). + For the most part I updated clm51, too, to keep it same as clm60, knowing + that clm51 will go away soon. + I had significant help from Erik Kluzek in disentangling the .xml settings + so that cases would pick up the correct finidat settings and other namelist + settings. Significant changes to scientifically-supported configurations -------------------------------------------------------------- @@ -31,7 +35,7 @@ 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]: - Relates to (fixes?) #2403; needs more work to close? + Relates to #2403; needs more work to close? Notes of particular relevance for users --------------------------------------- @@ -48,16 +52,16 @@ Testing summary: build-namelist tests (if CLMBuildNamelist.pm has changed): - derecho - TODO + derecho - PASS python testing (if python code has changed; see instructions in python/README.md; document testing done): - derecho - TODO + derecho - PASS regular tests (aux_clm: https://github.com/ESCOMP/CTSM/wiki/System-Testing-Guide#pre-merge-system-testing): - derecho ----- TODO - izumi ------- TODO + derecho ----- OK + izumi ------- OK Answer changes @@ -66,7 +70,7 @@ Answer changes Changes answers relative to baseline: Yes. Summarize any changes to answers, i.e., - - what code configurations: clm60 (and clm51 which goes away very soon) + - what code configurations: clm60 and clm51; the latter goes away soon - what platforms/compilers: all - nature of change: larger than roundoff/same climate diff --git a/doc/ChangeSum b/doc/ChangeSum index caf03f27da..7d01340622 100644 --- a/doc/ChangeSum +++ b/doc/ChangeSum @@ -1,6 +1,6 @@ Tag Who Date Summary ============================================================================================================================ - ctsm5.3.007 slevis 10/11/2024 Clm60 finidat updates for ne30, f09, f19 grids + ctsm5.3.007 slevis 10/14/2024 Clm60 finidat updates for ne30, f09, f19 grids ctsm5.3.006 samrabin 10/11/2024 Merge b4b-dev ctsm5.3.005 erik 10/10/2024 Hardcoded tuning adjustments for Leung_2024 dust emissions ctsm5.3.004 samrabin 10/07/2024 Move hillslope data off surface datasets From 941ec71a216ce58dd5cab2d41baa21174e915628 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Sun, 13 Oct 2024 16:06:36 -0600 Subject: [PATCH 087/243] Remove redundant lines --- bld/namelist_files/namelist_defaults_ctsm.xml | 2 -- 1 file changed, 2 deletions(-) diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index d03a840fd3..d7dc104183 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -774,8 +774,6 @@ attributes from the config_cache.xml file (with keys converted to upper-case). hgrid="0.9x1.25" >.true. .true. -.true. .true. From 5f9d597bef097fdd746a626d2e8a8d2e1e400e52 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Mon, 14 Oct 2024 10:50:09 -0600 Subject: [PATCH 088/243] Add matrixcn test suite. --- cime_config/testdefs/testlist_clm.xml | 51 +++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index cdb00db524..146a7abe6e 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -11,6 +11,7 @@ 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 + matrixcn: Tests exercising the matrix-CN capability --> @@ -25,6 +26,7 @@ + @@ -47,6 +49,7 @@ + @@ -276,6 +279,7 @@ + @@ -482,6 +486,7 @@ + @@ -517,6 +522,7 @@ + @@ -544,6 +550,7 @@ + @@ -802,6 +809,7 @@ + @@ -820,6 +828,7 @@ + @@ -837,6 +846,7 @@ + @@ -846,7 +856,9 @@ + + @@ -866,6 +878,7 @@ + @@ -875,6 +888,7 @@ + @@ -884,6 +898,7 @@ + @@ -893,6 +908,7 @@ + @@ -985,6 +1001,7 @@ + @@ -1003,6 +1020,7 @@ + @@ -1022,6 +1040,7 @@ + @@ -1040,6 +1059,7 @@ + @@ -1077,6 +1097,7 @@ + @@ -1094,6 +1115,7 @@ + @@ -1103,6 +1125,7 @@ + @@ -1147,6 +1170,7 @@ + @@ -1164,6 +1188,7 @@ + @@ -1237,6 +1262,7 @@ + @@ -1297,6 +1323,7 @@ + @@ -1314,6 +1341,7 @@ + @@ -1340,6 +1368,7 @@ + @@ -1376,6 +1405,7 @@ + @@ -1421,6 +1451,7 @@ + @@ -1431,6 +1462,7 @@ + @@ -1441,6 +1473,7 @@ + @@ -1553,6 +1586,7 @@ + @@ -1688,6 +1722,7 @@ + @@ -1725,6 +1760,7 @@ + @@ -1771,6 +1807,7 @@ + @@ -1827,6 +1864,7 @@ + @@ -1857,6 +1895,7 @@ + @@ -1875,6 +1914,7 @@ + @@ -1904,6 +1944,7 @@ + @@ -1941,6 +1982,7 @@ + @@ -1960,6 +2002,7 @@ + @@ -2000,6 +2043,7 @@ + @@ -2205,6 +2249,7 @@ + @@ -2273,7 +2318,9 @@ + + @@ -2354,6 +2401,7 @@ + @@ -2515,6 +2563,7 @@ + @@ -2562,6 +2611,7 @@ + @@ -3335,6 +3385,7 @@ + From 4797fd22795103464c1e9291ddd3f69483ba514c Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Mon, 14 Oct 2024 11:11:04 -0600 Subject: [PATCH 089/243] Final update to ChangeLog --- doc/ChangeLog | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index 867d23c5c5..e6804811d2 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,17 +1,15 @@ =============================================================== Tag name: ctsm5.3.007 Originator(s): slevis (Samuel Levis,UCAR/TSS,303-665-1310) -Date: Mon 13 Oct 2024 10:12:18 AM MDT +Date: Mon 13 Oct 2024 11:04:18 AM MDT One-line Summary: Clm60 finidat updates for ne30, f09, f19 grids Purpose and description of changes ---------------------------------- Updates appear in namelist_defaults_ctsm.xml. - For the most part I updated clm51, too, to keep it same as clm60, knowing - that clm51 will go away soon. + For the most part I updated clm51 to match clm60, though clm51 will go away soon. I had significant help from Erik Kluzek in disentangling the .xml settings - so that cases would pick up the correct finidat settings and other namelist - settings. + so that cases would pick up the correct finidat and other namelist settings. Significant changes to scientifically-supported configurations -------------------------------------------------------------- @@ -35,7 +33,7 @@ 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]: - Relates to #2403; needs more work to close? + Relates to #2403 but may need more work to close the issue Notes of particular relevance for users --------------------------------------- @@ -76,8 +74,6 @@ Changes answers relative to baseline: Yes. Other details ------------- -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/2821 From 9f4844cbf5d55db7768e13086786eab13d08f03b Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Mon, 14 Oct 2024 12:07:57 -0600 Subject: [PATCH 090/243] Draft ChangeLog/Sum --- doc/ChangeLog | 68 +++++++++++++++++++++++++++++++++++++++++++++++++++ doc/ChangeSum | 1 + 2 files changed, 69 insertions(+) diff --git a/doc/ChangeLog b/doc/ChangeLog index e6804811d2..02f7fa763f 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,4 +1,72 @@ =============================================================== +Tag name: ctsm5.3.008 +Originator(s): olyson (Keith Oleson,UCAR/TSS) +Date: Mon 14 Oct 2024 11:56:12 AM MDT +One-line Summary: PPE change to sa_leaf in CanopyFluxesMod.F90 + +Purpose and description of changes +---------------------------------- + + Add change to sa_leaf that was in PPE branch but did not get on master. + + +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 #2777 + + +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 ----- + izumi ------- + + +Answer changes +-------------- + +Changes answers relative to baseline: Yes + + Summarize any changes to answers, i.e., + - what code configurations: All + - what platforms/compilers: All + - nature of change: larger than roundoff/same climate) + + The changes in answers are explained in this post: + https://github.com/ESCOMP/CTSM/issues/2777#issuecomment-2371697380 + + +Other details +------------- +Pull Requests that document the changes (include PR ids): + https://github.com/ESCOMP/ctsm/pull/2788 + +=============================================================== +=============================================================== Tag name: ctsm5.3.007 Originator(s): slevis (Samuel Levis,UCAR/TSS,303-665-1310) Date: Mon 13 Oct 2024 11:04:18 AM MDT diff --git a/doc/ChangeSum b/doc/ChangeSum index 7d01340622..5698b8654f 100644 --- a/doc/ChangeSum +++ b/doc/ChangeSum @@ -1,5 +1,6 @@ Tag Who Date Summary ============================================================================================================================ + ctsm5.3.008 olyson 10/14/2024 PPE change to sa_leaf in CanopyFluxesMod.F90 ctsm5.3.007 slevis 10/14/2024 Clm60 finidat updates for ne30, f09, f19 grids ctsm5.3.006 samrabin 10/11/2024 Merge b4b-dev ctsm5.3.005 erik 10/10/2024 Hardcoded tuning adjustments for Leung_2024 dust emissions From 77fdb8d07e6a0dfb674e0da5d11939cdf20e74c3 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Mon, 14 Oct 2024 13:14:09 -0600 Subject: [PATCH 091/243] Updated ChangeLog from Keith Oleson's review --- doc/ChangeLog | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index 02f7fa763f..986f58973d 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,7 +1,7 @@ =============================================================== Tag name: ctsm5.3.008 Originator(s): olyson (Keith Oleson,UCAR/TSS) -Date: Mon 14 Oct 2024 11:56:12 AM MDT +Date: Mon 14 Oct 2024 01:08:47 PM MDT One-line Summary: PPE change to sa_leaf in CanopyFluxesMod.F90 Purpose and description of changes @@ -18,15 +18,15 @@ Does this tag change answers significantly for any of the following physics conf [Put an [X] in the box for any configuration with significant answer changes.] -[X] clm6_0 +[ ] clm6_0 -[X] clm5_1 +[ ] clm5_1 -[X] clm5_0 +[ ] clm5_0 -[X] ctsm5_0-nwp +[ ] ctsm5_0-nwp -[X] clm4_5 +[ ] clm4_5 Bugs fixed @@ -56,8 +56,10 @@ Changes answers relative to baseline: Yes - what platforms/compilers: All - nature of change: larger than roundoff/same climate) - The changes in answers are explained in this post: + The changes in answers are explained in this post https://github.com/ESCOMP/CTSM/issues/2777#issuecomment-2371697380 + and the diagnostics are here + https://webext.cgd.ucar.edu/I2000/ctsm53n04ctsm52028_f09_saleaf/lnd/ctsm53n04ctsm52028_f09_saleaf_2000_2001_2004-ctsm53n04ctsm52028_f09_2000_2001_2004/setsIndex.html Other details From ea0dadda04ed84814c8c40e9364e7165566d6ebb Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Mon, 14 Oct 2024 16:05:22 -0600 Subject: [PATCH 092/243] Final ChangeLog --- doc/ChangeLog | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index 986f58973d..bfaa2e71f7 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,7 +1,7 @@ =============================================================== Tag name: ctsm5.3.008 Originator(s): olyson (Keith Oleson,UCAR/TSS) -Date: Mon 14 Oct 2024 01:08:47 PM MDT +Date: Mon 14 Oct 2024 04:03:26 PM MDT One-line Summary: PPE change to sa_leaf in CanopyFluxesMod.F90 Purpose and description of changes @@ -42,8 +42,8 @@ Testing summary: 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 From b846e2b1926a94af73342650fe5dfd22d4db46b4 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Tue, 15 Oct 2024 09:38:19 -0600 Subject: [PATCH 093/243] Roll back change of one cnmatrix test length. --- 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 9e0235a6ab..4654f53c45 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -1361,7 +1361,7 @@ - + @@ -1810,7 +1810,7 @@ - + From 82a0952fc6bcee3540dc5ca7e82d674fc52dca70 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Tue, 15 Oct 2024 17:46:01 -0600 Subject: [PATCH 094/243] Update ChangeLog and ChangeSum. --- doc/ChangeLog | 72 +++++++++++++++++++++++++++++++++++++++++++++++++++ doc/ChangeSum | 1 + 2 files changed, 73 insertions(+) diff --git a/doc/ChangeLog b/doc/ChangeLog index bfaa2e71f7..3620cd8c15 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,4 +1,76 @@ =============================================================== +Tag name: ctsm5.3.009 +Originator(s): samrabin (Sam Rabin, UCAR/TSS, samrabin@ucar.edu) +Date: Tue Oct 15 17:35:40 MDT 2024 +One-line Summary: Reduce outputs from matrixcnOn tests + +Purpose and description of changes +---------------------------------- + +Reduces size and runtime of our tests of the CN Matrix capability. See "Notes of particular relevance for developers" for more details. + + +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#2814: Remove include_user_mods from matrixcnOn testmod (https://github.com/ESCOMP/CTSM/pull/2815) + + +Notes of particular relevance for developers: +--------------------------------------------- + +Changes to tests or testing: +- Removing the include_user_mods file from the matrixcnOn test (and thus also matrixcnOn_ignore_warnings) means that the default outputs no longer overwrite outputs specified by earlier test mods. For example, in LCISO_Lm13.f10_f10_mg37.IHistClm60BgcCrop.derecho_intel.clm-ciso_monthly--clm-matrixcnOn_ignore_warnings, it should have been saving monthly (the ciso_monthly test mod) but was actually being saved at much higher frequency (because matrixcnOn_ignore_warnings was after ciso_monthly in the test name). That test goes from 30 to 3 GB after this change. +- Adds matrixcn test suite, which can be used during Matrix CN development. All tests in this suite are also still run in aux_clm. + + +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: + + Summarize any changes to answers, i.e., + - what code configurations: aux_clm tests only + - what platforms/compilers: all + - nature of change: larger than roundoff + + Changes are due to changed history field lists (and some other settings) due to the removal of include_user_mods from the matrixcnOn test mod. No answer changes occurred in any test other than those using matrixcnOn(_ignore_warnings); no answer changes will occur for any non-test run. + +Other details +------------- + +Pull Requests that document the changes (include PR ids): +- PR ESCOMP/CTSM#2815: Remove include_user_mods from matrixcnOn testmod (https://github.com/ESCOMP/CTSM/pull/2815) + +=============================================================== +=============================================================== Tag name: ctsm5.3.008 Originator(s): olyson (Keith Oleson,UCAR/TSS) Date: Mon 14 Oct 2024 04:03:26 PM MDT diff --git a/doc/ChangeSum b/doc/ChangeSum index 5698b8654f..af6e1675b4 100644 --- a/doc/ChangeSum +++ b/doc/ChangeSum @@ -1,5 +1,6 @@ Tag Who Date Summary ============================================================================================================================ + ctsm5.3.009 samrabin 10/15/2024 Reduce outputs from matrixcnOn tests ctsm5.3.008 olyson 10/14/2024 PPE change to sa_leaf in CanopyFluxesMod.F90 ctsm5.3.007 slevis 10/14/2024 Clm60 finidat updates for ne30, f09, f19 grids ctsm5.3.006 samrabin 10/11/2024 Merge b4b-dev From 9c9bdca00525b45a49c26f73eb2a768b1bc2e316 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Tue, 15 Oct 2024 18:21:51 -0600 Subject: [PATCH 095/243] Fix single-point matrix fails --- src/utils/SparseMatrixMultiplyMod.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/SparseMatrixMultiplyMod.F90 b/src/utils/SparseMatrixMultiplyMod.F90 index 5ea9848373..a6eb13bb24 100644 --- a/src/utils/SparseMatrixMultiplyMod.F90 +++ b/src/utils/SparseMatrixMultiplyMod.F90 @@ -1243,7 +1243,7 @@ subroutine SPMP_ABC(this,num_unit,filter_u,A,B,C,list_ready,list_A,list_B,list_C call endrun( subname//" ERROR: missing required optional arguments" ) return end if - SHR_ASSERT_FL((size(filter_actunit_C) > num_actunit_C), sourcefile, __LINE__) + SHR_ASSERT_FL((size(filter_actunit_C) >= num_actunit_C), sourcefile, __LINE__) end if if(.not. list_ready)then From 1fd28b58ee8bd2802a705ec13edcffe2f756cb28 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Wed, 16 Oct 2024 11:27:43 -0600 Subject: [PATCH 096/243] Add CONUS flanduse_timeseries for sim_year_range="1850-2000" --- bld/namelist_files/namelist_defaults_ctsm.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index 3418315f57..421f450ec8 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -2042,6 +2042,8 @@ lnd/clm2/surfdata_esmf/NEON/ctsm5.3.0/surfdata_1x1_NEON_TOOL_hist_2000_78pfts_c2 >lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_0.9x1.25_SSP2-4.5_1850-2100_78pfts_c240908.nc lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_1.9x2.5_SSP2-4.5_1850-2100_78pfts_c240908.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_ne0np4CONUS.ne30x8_SSP2-4.5_1979-2026_78pfts_c240908.nc Date: Wed, 16 Oct 2024 11:57:39 -0600 Subject: [PATCH 097/243] Update namelist_defaults with PPE's 16-pft f19 fsurdat/landuse files --- bld/namelist_files/namelist_defaults_ctsm.xml | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index d7dc104183..6edd9d68b9 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -1839,11 +1839,16 @@ lnd/clm2/surfdata_esmf/ctsm5.3.0/synthetic/surfdata_1x1_urbanc_alpha_synth_hist_ + + +lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_1.9x2.5_hist_1850_16pfts_c240926.nc + + lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_360x720cru_hist_1850_78pfts_c240908.nc lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_0.9x1.25_hist_1850_78pfts_c240908.nc - + lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_1.9x2.5_hist_1850_78pfts_c240908.nc lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_10x15_hist_1850_78pfts_c240908.nc @@ -1910,12 +1915,15 @@ lnd/clm2/surfdata_esmf/NEON/ctsm5.3.0/surfdata_1x1_NEON_TOOL_hist_2000_78pfts_c2 --> + +lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_1.9x2.5_hist_1850-2023_16pfts_c240926.nc + + lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_0.9x1.25_SSP2-4.5_1850-2100_78pfts_c240908.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_1.9x2.5_SSP2-4.5_1850-2100_78pfts_c240908.nc - - lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_4x5_SSP2-4.5_1850-2100_78pfts_c240908.nc Date: Wed, 16 Oct 2024 12:05:53 -0600 Subject: [PATCH 098/243] Clean-up: Rm deprecated use_vichydro=.true. or .false. options --- bld/namelist_files/namelist_defaults_ctsm.xml | 35 +++++++------------ 1 file changed, 13 insertions(+), 22 deletions(-) diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index 6edd9d68b9..19cc4e26d7 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -1766,22 +1766,13 @@ lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_mpasa15_hist_2000_16pfts_c240908.nc - - + lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_0.9x1.25_hist_2000_78pfts_c240908.nc - -lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_0.9x1.25_hist_2000_78pfts_c240908.nc - -lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_1.9x2.5_hist_2000_78pfts_c240908.nc - + lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_1.9x2.5_hist_2000_78pfts_c240908.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_c240908.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_c240908.nc @@ -1846,27 +1837,27 @@ lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_1.9x2.5_hist_1850_16pfts_c240926.nc lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_360x720cru_hist_1850_78pfts_c240908.nc - + lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_0.9x1.25_hist_1850_78pfts_c240908.nc lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_1.9x2.5_hist_1850_78pfts_c240908.nc - + lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_10x15_hist_1850_78pfts_c240908.nc - + lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_4x5_hist_1850_78pfts_c240908.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_c240908.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_c240908.nc - + lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_ne30np4.pg3_hist_1850_78pfts_c240908.nc - + lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_ne3np4.pg3_hist_1850_78pfts_c240908.nc From 29eb50aaada32da7b390ce6ea1e74361d239379c Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Wed, 16 Oct 2024 12:53:35 -0600 Subject: [PATCH 099/243] Add PPE's 16-pft f19 fsurdat/landuse generation to Makefile --- python/ctsm/toolchain/gen_mksurfdata_jobscript_multi.py | 5 +++++ tools/mksurfdata_esmf/Makefile | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/python/ctsm/toolchain/gen_mksurfdata_jobscript_multi.py b/python/ctsm/toolchain/gen_mksurfdata_jobscript_multi.py index 5de67adb12..7b0d5f69b2 100755 --- a/python/ctsm/toolchain/gen_mksurfdata_jobscript_multi.py +++ b/python/ctsm/toolchain/gen_mksurfdata_jobscript_multi.py @@ -23,6 +23,7 @@ "global-present", "global-present-low-res", "global-present-ultra-hi-res", + "global-hist-1850-f19", "crop-tropics-present", "crop", "crop-global-present", @@ -242,6 +243,10 @@ def main(): "--start-year 2000 --end-year 2000 --nocrop --res", "ultra_hi_res_no_crop", ), + "global-hist-1850-f19": ( + "--start-year 1850 --end-year 2023 --nocrop --res", + "f19", + ), "crop-tropics-present": ( "--start-year 2000 --end-year 2000 --res", "5x5_amazon", diff --git a/tools/mksurfdata_esmf/Makefile b/tools/mksurfdata_esmf/Makefile index 7ad8e1aa77..cc02a50cdb 100644 --- a/tools/mksurfdata_esmf/Makefile +++ b/tools/mksurfdata_esmf/Makefile @@ -83,6 +83,7 @@ STANDARD = \ global-potveg \ global-present \ global-present-low-res \ + global-hist-1850-f19 \ CROP = \ crop-global-future \ @@ -153,6 +154,9 @@ global-present-low-res : FORCE $(MKSURFDATA) --number-of-nodes 1 --tasks-per-node 64 --scenario $@ --jobscript-file $@.sh --walltime 01:00:00 $(BATCHJOBS) $@.sh +global-hist-1850-f19 : FORCE + $(MKSURFDATA) --number-of-nodes 8 --scenario $@ --jobscript-file $@.sh --walltime 12:00:00 + $(BATCHJOBS) $@.sh # # Ultra high resolutions (Don't do by default user should select this by hand) # From cf767a9eb1c49b6d337492373ae7492bd7bc1089 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Thu, 17 Oct 2024 12:02:48 -0600 Subject: [PATCH 100/243] Add 20thC test to build-namelist_test.pl and update defaults accordingly --- bld/namelist_files/namelist_defaults_ctsm.xml | 5 +++++ bld/unit_testers/build-namelist_test.pl | 1 + 2 files changed, 6 insertions(+) diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index 421f450ec8..ab0d7c0d7f 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -1248,6 +1248,11 @@ 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. 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. 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. use_excess_ice=.false. diff --git a/bld/unit_testers/build-namelist_test.pl b/bld/unit_testers/build-namelist_test.pl index 06c9bcc361..346b852dc2 100755 --- a/bld/unit_testers/build-namelist_test.pl +++ b/bld/unit_testers/build-namelist_test.pl @@ -514,6 +514,7 @@ sub cat_and_create_namelistinfile { foreach my $options ( "--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", + "--res ne0np4CONUS.ne30x8 --mask tx0.1v2 -bgc sp -use_case 20thC_transient -namelist '&a start_ymd=20130101/' -lnd_tuning_mode ${phys}_cam6.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 " ); }; From 5dd623dc4bec442e11077c91855f67d0119caafe Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Thu, 17 Oct 2024 12:41:50 -0600 Subject: [PATCH 101/243] Add f19 20thC -no-crop test to build-namelist_test --- bld/unit_testers/build-namelist_test.pl | 1 + 1 file changed, 1 insertion(+) diff --git a/bld/unit_testers/build-namelist_test.pl b/bld/unit_testers/build-namelist_test.pl index 346b852dc2..6941d8fa02 100755 --- a/bld/unit_testers/build-namelist_test.pl +++ b/bld/unit_testers/build-namelist_test.pl @@ -514,6 +514,7 @@ sub cat_and_create_namelistinfile { foreach my $options ( "--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", + "--res 1.9x2.5 --mask gx1v7 --bgc sp -no-crop --use_case 20thC_transient --namelist '&a start_ymd=19790101/' --lnd_tuning_mode ${phys}_cam7.0 --infile empty_user_nl_clm", "--res ne0np4CONUS.ne30x8 --mask tx0.1v2 -bgc sp -use_case 20thC_transient -namelist '&a start_ymd=20130101/' -lnd_tuning_mode ${phys}_cam6.0 --infile empty_user_nl_clm", ) { &make_env_run( 'LND_SETS_DUST_EMIS_DRV_FLDS'=>"FALSE" ); From fc3e5de24444fd1cffb41bab84bb6d1a9abc9ac2 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Thu, 17 Oct 2024 14:31:16 -0600 Subject: [PATCH 102/243] Similar changes as for CONUS, now for the ARCTIC grid --- bld/namelist_files/namelist_defaults_ctsm.xml | 15 +++------------ bld/unit_testers/build-namelist_test.pl | 1 + 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index ab0d7c0d7f..8746319186 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -1101,7 +1101,6 @@ attributes from the config_cache.xml file (with keys converted to upper-case). - hgrid=0.9x1.25 maxpft=79 mask=gx1v7 use_cn=.true. use_crop=.true. irrigate=.true. glc_nec=10 do_transient_pfts=.false. use_excess_ice=.false. - -hgrid=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. - - 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=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. - - 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. @@ -1285,6 +1273,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. use_excess_ice=.false. + diff --git a/bld/unit_testers/build-namelist_test.pl b/bld/unit_testers/build-namelist_test.pl index 6941d8fa02..c813cb7083 100755 --- a/bld/unit_testers/build-namelist_test.pl +++ b/bld/unit_testers/build-namelist_test.pl @@ -515,6 +515,7 @@ sub cat_and_create_namelistinfile { "--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", "--res 1.9x2.5 --mask gx1v7 --bgc sp -no-crop --use_case 20thC_transient --namelist '&a start_ymd=19790101/' --lnd_tuning_mode ${phys}_cam7.0 --infile empty_user_nl_clm", + "--res ne0np4.ARCTIC.ne30x4 --mask tx0.1v2 -bgc sp -use_case 20thC_transient -namelist '&a start_ymd=19790101/' -lnd_tuning_mode ${phys}_cam7.0 --infile empty_user_nl_clm", "--res ne0np4CONUS.ne30x8 --mask tx0.1v2 -bgc sp -use_case 20thC_transient -namelist '&a start_ymd=20130101/' -lnd_tuning_mode ${phys}_cam6.0 --infile empty_user_nl_clm", ) { &make_env_run( 'LND_SETS_DUST_EMIS_DRV_FLDS'=>"FALSE" ); From e35ba5a72bc69a85a69177980c3330aa21e4ab49 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Thu, 17 Oct 2024 14:38:07 -0600 Subject: [PATCH 103/243] Small correction to 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 c813cb7083..4f03ed089f 100755 --- a/bld/unit_testers/build-namelist_test.pl +++ b/bld/unit_testers/build-namelist_test.pl @@ -516,7 +516,7 @@ sub cat_and_create_namelistinfile { "--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", "--res 1.9x2.5 --mask gx1v7 --bgc sp -no-crop --use_case 20thC_transient --namelist '&a start_ymd=19790101/' --lnd_tuning_mode ${phys}_cam7.0 --infile empty_user_nl_clm", "--res ne0np4.ARCTIC.ne30x4 --mask tx0.1v2 -bgc sp -use_case 20thC_transient -namelist '&a start_ymd=19790101/' -lnd_tuning_mode ${phys}_cam7.0 --infile empty_user_nl_clm", - "--res ne0np4CONUS.ne30x8 --mask tx0.1v2 -bgc sp -use_case 20thC_transient -namelist '&a start_ymd=20130101/' -lnd_tuning_mode ${phys}_cam6.0 --infile empty_user_nl_clm", + "--res ne0np4CONUS.ne30x8 --mask tx0.1v2 -bgc sp -use_case 20thC_transient -namelist '&a start_ymd=20130101/' -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 " ); }; From b6a51861efde22e1846bbd4a584483bd7ea3694b Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Thu, 17 Oct 2024 15:07:48 -0600 Subject: [PATCH 104/243] Add ctsm_sci tests for the VR grids and aux_clm test for f19 --- cime_config/testdefs/testlist_clm.xml | 34 +++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index 490748c7e7..77a2d76ba3 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -2015,7 +2015,17 @@ - + + + + + + + + + + + @@ -2025,6 +2035,16 @@ + + + + + + + + + + @@ -2044,7 +2064,7 @@ - + @@ -2054,6 +2074,16 @@ + + + + + + + + + + From 41359b72c501ff1eee3abfc33a7d137d0073feff Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Thu, 17 Oct 2024 15:34:24 -0600 Subject: [PATCH 105/243] Adding 3 clm50cam7LNdTuningMode* testmods_dirs for the new tests --- .../clm/clm50cam7LndTuningMode/include_user_mods | 1 + .../testmods_dirs/clm/clm50cam7LndTuningMode/shell_commands | 5 +++++ .../clm/clm50cam7LndTuningMode_1979Start/include_user_mods | 1 + .../clm/clm50cam7LndTuningMode_1979Start/shell_commands | 1 + .../clm/clm50cam7LndTuningMode_2013Start/include_user_mods | 1 + .../clm/clm50cam7LndTuningMode_2013Start/shell_commands | 1 + 6 files changed, 10 insertions(+) create mode 100644 cime_config/testdefs/testmods_dirs/clm/clm50cam7LndTuningMode/include_user_mods create mode 100644 cime_config/testdefs/testmods_dirs/clm/clm50cam7LndTuningMode/shell_commands create mode 100644 cime_config/testdefs/testmods_dirs/clm/clm50cam7LndTuningMode_1979Start/include_user_mods create mode 100644 cime_config/testdefs/testmods_dirs/clm/clm50cam7LndTuningMode_1979Start/shell_commands create mode 100644 cime_config/testdefs/testmods_dirs/clm/clm50cam7LndTuningMode_2013Start/include_user_mods create mode 100644 cime_config/testdefs/testmods_dirs/clm/clm50cam7LndTuningMode_2013Start/shell_commands diff --git a/cime_config/testdefs/testmods_dirs/clm/clm50cam7LndTuningMode/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/clm50cam7LndTuningMode/include_user_mods new file mode 100644 index 0000000000..fe0e18cf88 --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/clm50cam7LndTuningMode/include_user_mods @@ -0,0 +1 @@ +../default diff --git a/cime_config/testdefs/testmods_dirs/clm/clm50cam7LndTuningMode/shell_commands b/cime_config/testdefs/testmods_dirs/clm/clm50cam7LndTuningMode/shell_commands new file mode 100644 index 0000000000..a9b56a5eae --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/clm50cam7LndTuningMode/shell_commands @@ -0,0 +1,5 @@ +#!/bin/bash + +./xmlchange LND_TUNING_MODE="clm5_0_cam7.0" +./xmlchange ROF_NCPL='$ATM_NCPL' + diff --git a/cime_config/testdefs/testmods_dirs/clm/clm50cam7LndTuningMode_1979Start/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/clm50cam7LndTuningMode_1979Start/include_user_mods new file mode 100644 index 0000000000..44d94c8805 --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/clm50cam7LndTuningMode_1979Start/include_user_mods @@ -0,0 +1 @@ +../clm50cam7LndTuningMode diff --git a/cime_config/testdefs/testmods_dirs/clm/clm50cam7LndTuningMode_1979Start/shell_commands b/cime_config/testdefs/testmods_dirs/clm/clm50cam7LndTuningMode_1979Start/shell_commands new file mode 100644 index 0000000000..2aafcc1186 --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/clm50cam7LndTuningMode_1979Start/shell_commands @@ -0,0 +1 @@ +./xmlchange RUN_STARTDATE=1979-01-01 diff --git a/cime_config/testdefs/testmods_dirs/clm/clm50cam7LndTuningMode_2013Start/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/clm50cam7LndTuningMode_2013Start/include_user_mods new file mode 100644 index 0000000000..44d94c8805 --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/clm50cam7LndTuningMode_2013Start/include_user_mods @@ -0,0 +1 @@ +../clm50cam7LndTuningMode diff --git a/cime_config/testdefs/testmods_dirs/clm/clm50cam7LndTuningMode_2013Start/shell_commands b/cime_config/testdefs/testmods_dirs/clm/clm50cam7LndTuningMode_2013Start/shell_commands new file mode 100644 index 0000000000..035842f982 --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/clm50cam7LndTuningMode_2013Start/shell_commands @@ -0,0 +1 @@ +./xmlchange RUN_STARTDATE=2013-01-01 From 694333f8f49aab356a41df18b0d69515c9e3ef83 Mon Sep 17 00:00:00 2001 From: Keith Oleson Date: Sun, 20 Oct 2024 10:09:49 -0600 Subject: [PATCH 106/243] Transfer the following parameters from namelist to parameter file: Jmaxb1 (now called jmaxb1 and pft-dependent) upplim_destruct_metamorph maximum_leaf_wetted_fraction interception_fraction --- bld/CLMBuildNamelist.pm | 14 ---- bld/namelist_files/namelist_defaults_ctsm.xml | 18 +---- .../namelist_definition_ctsm.xml | 20 ----- bld/unit_testers/build-namelist_test.pl | 4 - src/biogeophys/CanopyHydrologyMod.F90 | 18 ++--- src/biogeophys/LunaMod.F90 | 80 +++---------------- src/biogeophys/SnowHydrologyMod.F90 | 11 +-- src/main/controlMod.F90 | 2 - src/main/pftconMod.F90 | 6 ++ 9 files changed, 36 insertions(+), 137 deletions(-) diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index b881cdbfac..4d8ad454ba 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -3603,17 +3603,6 @@ sub setup_logic_luna { if ( &value_is_true($nl->get_value('lnc_opt') ) && not &value_is_true( $nl_flags->{'use_cn'}) ) { $log->fatal_error("Cannot turn lnc_opt to true when bgc=sp" ); } - my $var = "jmaxb1"; - if ( &value_is_true( $nl_flags->{'use_luna'} ) ) { - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, $var, - 'use_luna'=>$nl_flags->{'use_luna'} ); - } - my $val = $nl->get_value($var); - if ( ! &value_is_true( $nl_flags->{'use_luna'} ) ) { - if ( defined($val) ) { - $log->fatal_error("Cannot set $var when use_luna is NOT on" ); - } - } } #------------------------------------------------------------------------------- @@ -4523,8 +4512,6 @@ sub setup_logic_canopyhydrology { # my ($opts, $nl_flags, $definition, $defaults, $nl) = @_; - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'interception_fraction' ); - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'maximum_leaf_wetted_fraction' ); add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'use_clm5_fpi' ); } @@ -4543,7 +4530,6 @@ sub setup_logic_snowpack { add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'wind_dependent_snow_density'); add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'snow_overburden_compaction_method'); add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'lotmp_snowdensity_method'); - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'upplim_destruct_metamorph'); add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'reset_snow'); add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'reset_snow_glc'); add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'reset_snow_glc_ela'); diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index 650b21cb8d..8eb8e2cccb 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -413,11 +413,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). .true. -1.0 -0.05 .false. -0.25 -1.0 1 @@ -493,9 +489,6 @@ attributes from the config_cache.xml file (with keys converted to upper-case). 'Slater2017' 'TruncatedAnderson1976' -175.d00 -100.d00 - 0.08d00 .false. @@ -551,10 +544,10 @@ attributes from the config_cache.xml file (with keys converted to upper-case). -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 +/glade/campaign/cgd/tss/people/oleson/modify_param/ctsm60_params.c241017.nc +/glade/campaign/cgd/tss/people/oleson/modify_param/ctsm51_params.c241017.nc +/glade/campaign/cgd/tss/people/oleson/modify_param/clm50_params.c241017.nc +/glade/campaign/cgd/tss/people/oleson/modify_param/clm45_params.c241017.nc @@ -605,9 +598,6 @@ attributes from the config_cache.xml file (with keys converted to upper-case). .false. .true. - -0.17 - unset diff --git a/bld/namelist_files/namelist_definition_ctsm.xml b/bld/namelist_files/namelist_definition_ctsm.xml index 417444914e..01fc6587ec 100644 --- a/bld/namelist_files/namelist_definition_ctsm.xml +++ b/bld/namelist_files/namelist_definition_ctsm.xml @@ -404,21 +404,11 @@ Max number of iterations used in subr. CanopyFluxes. For many years, 40 was the Default: 40 - -Fraction of intercepted precipitation - - If TRUE use clm5 equation for fraction of intercepted precipitation - -Maximum fraction of leaf that may be wet prior to drip occuring - - Scalar multiplier for base flow rate @@ -712,11 +702,6 @@ Scalar of leaf respiration to vcmax The maximum value to use for zeta under stable conditions - -baseline proportion of nitrogen allocated for electron transport (J) - - Toggle to turn on the FATES model @@ -2839,11 +2824,6 @@ TruncatedAnderson1976 -- Truncate the Anderson-1976 equation at the value for -1 Slater2017 ------------- Use equation from Slater that increases snow density for very cold temperatures (Arctic, Antarctic) - -Upper Limit on Destructive Metamorphism Compaction [kg/m3] - - Snow compaction overburden exponential factor (1/K) diff --git a/bld/unit_testers/build-namelist_test.pl b/bld/unit_testers/build-namelist_test.pl index 096409065f..64126ab347 100755 --- a/bld/unit_testers/build-namelist_test.pl +++ b/bld/unit_testers/build-namelist_test.pl @@ -1235,10 +1235,6 @@ sub cat_and_create_namelistinfile { namelst=>"use_luna=.true., lnc_opt=.true.", phys=>"clm5_0", }, - "NOlunabutsetJmaxb1" =>{ options=>"-envxml_dir . -bgc sp", - namelst=>"use_luna=.false., jmaxb1=1.0", - phys=>"clm5_0", - }, "envxml_not_dir" =>{ options=>"-envxml_dir myuser_nl_clm", namelst=>"", phys=>"clm5_0", diff --git a/src/biogeophys/CanopyHydrologyMod.F90 b/src/biogeophys/CanopyHydrologyMod.F90 index 9ce9995ce6..166aa6d53d 100644 --- a/src/biogeophys/CanopyHydrologyMod.F90 +++ b/src/biogeophys/CanopyHydrologyMod.F90 @@ -49,6 +49,8 @@ module CanopyHydrologyMod real(r8) :: snow_canopy_storage_scalar ! Canopy-storage-of-snow parameter (kg/m2) real(r8) :: snowcan_unload_temp_fact ! Temperature canopy snow unload scaling (C2 in Eq. 14, Roesch et al. 2001) (K*s) real(r8) :: snowcan_unload_wind_fact ! Wind canopy snow unload scaling (modifies 1.56e5, where 1.56e5 is C3 in Eq. 15, Roesch et al. 2001) (-) + real(r8) :: interception_fraction ! Fraction of intercepted precipitation (-) + real(r8) :: maximum_leaf_wetted_fraction ! Maximum fraction of leaf that may be wet (-) end type params_type type(params_type), private :: params_inst ! @@ -67,8 +69,6 @@ module CanopyHydrologyMod private :: BulkDiag_FracWet ! Determine fraction of vegetated surface that is wet ! ! !PRIVATE DATA MEMBERS: - real(r8) :: interception_fraction ! Fraction of intercepted precipitation - real(r8) :: maximum_leaf_wetted_fraction ! Maximum fraction of leaf that may be wet logical, private :: use_clm5_fpi = .false. ! use clm5 fpi equation character(len=*), parameter, private :: sourcefile = & @@ -99,8 +99,6 @@ subroutine CanopyHydrology_readnl( NLFilename ) character(len=32) :: subname = 'CanopyHydrology_readnl' ! subroutine name !----------------------------------------------------------------------- namelist /clm_canopyhydrology_inparm/ & - interception_fraction, & - maximum_leaf_wetted_fraction, & use_clm5_fpi ! ---------------------------------------------------------------------- @@ -125,15 +123,11 @@ subroutine CanopyHydrology_readnl( NLFilename ) end if ! Broadcast namelist variables read in - call shr_mpi_bcast(interception_fraction, mpicom) - call shr_mpi_bcast(maximum_leaf_wetted_fraction, mpicom) call shr_mpi_bcast(use_clm5_fpi, mpicom) if (masterproc) then write(iulog,*) ' ' write(iulog,*) 'canopyhydrology settings:' - write(iulog,*) ' interception_fraction = ',interception_fraction - write(iulog,*) ' maximum_leaf_wetted_fraction = ',maximum_leaf_wetted_fraction write(iulog,*) ' use_clm5_fpi = ',use_clm5_fpi endif @@ -162,6 +156,10 @@ subroutine readParams( ncid ) call readNcdioScalar(ncid, 'snowcan_unload_temp_fact', subname, params_inst%snowcan_unload_temp_fact) ! Wind canopy snow unload scaling (modifies 1.56e5, where 1.56e5 is C3 in Eq. 15, Roesch et al. 2001) (-) call readNcdioScalar(ncid, 'snowcan_unload_wind_fact', subname, params_inst%snowcan_unload_wind_fact) + ! Fraction of intercepted precipitation (-) + call readNcdioScalar(ncid, 'interception_fraction', subname, params_inst%interception_fraction) + ! Maximum fraction of leaf that may be wet (-) + call readNcdioScalar(ncid, 'maximum_leaf_wetted_fraction', subname, params_inst%maximum_leaf_wetted_fraction) end subroutine readParams @@ -535,7 +533,7 @@ subroutine BulkFlux_CanopyInterceptionAndThroughfall(bounds, num_nolakep, filter if (check_point_for_interception_and_excess(p)) then ! Coefficient of interception if (use_clm5_fpi) then - fpiliq = interception_fraction * tanh(elai(p) + esai(p)) + fpiliq = params_inst%interception_fraction * tanh(elai(p) + esai(p)) else fpiliq = 0.25_r8*(1._r8 - exp(-0.5_r8*(elai(p) + esai(p)))) end if @@ -1170,7 +1168,7 @@ subroutine BulkDiag_FracWet(bounds, num_soilp, filter_soilp, & if (h2ocan > 0._r8) then vegt = frac_veg_nosno(p)*(elai(p) + esai(p)) fwet(p) = (h2ocan / (vegt * params_inst%liq_canopy_storage_scalar))**0.666666666666_r8 - fwet(p) = min (fwet(p),maximum_leaf_wetted_fraction) ! Check for maximum limit of fwet + fwet(p) = min (fwet(p),params_inst%maximum_leaf_wetted_fraction) ! Check for maximum limit of fwet if (snocan(p) > 0._r8) then fcansno(p) = (snocan(p) / (vegt * params_inst%snow_canopy_storage_scalar))**0.15_r8 ! must match snocanmx fcansno(p) = min (fcansno(p),1.0_r8) diff --git a/src/biogeophys/LunaMod.F90 b/src/biogeophys/LunaMod.F90 index dbd39daedf..3f5f7d0e3c 100644 --- a/src/biogeophys/LunaMod.F90 +++ b/src/biogeophys/LunaMod.F90 @@ -12,7 +12,7 @@ module LunaMod use clm_varcon , only : rgas, tfrz,spval use abortutils , only : endrun use clm_varctl , only : iulog - use clm_varpar , only : nlevcan + use clm_varpar , only : nlevcan, mxpft use decompMod , only : bounds_type, subgrid_level_patch use pftconMod , only : pftcon use FrictionvelocityMod , only : frictionvel_type @@ -33,7 +33,6 @@ module LunaMod !------------------------------------------------------------------------------ ! PUBLIC MEMBER FUNCTIONS: - public :: LunaReadNML !subroutine to read in the Luna namelist public :: Update_Photosynthesis_Capacity !subroutine to update the canopy nitrogen profile public :: Acc24_Climate_LUNA !subroutine to accumulate 24 hr climates public :: Acc240_Climate_LUNA !subroutine to accumulate 10 day climates @@ -78,7 +77,6 @@ module LunaMod real(r8), parameter :: CO2ref = 380.0_r8 ! reference CO2 concentration for calculation of reference NUE. real(r8), parameter :: forc_pbot_ref = 101325.0_r8 ! reference air pressure for calculation of reference NUE real(r8), parameter :: Q10Enz = 2.0_r8 ! Q10 value for enzyme decay rate - real(r8) :: Jmaxb1 = 0.1_r8 ! the baseline proportion of nitrogen allocated for electron transport (J) real(r8), parameter :: NMCp25 = 0.715_r8 ! estimated by assuming 80% maintenance respiration is used for photosynthesis enzyme maintenance real(r8), parameter :: Trange1 = 5.0_r8 ! lower temperature limit (oC) for nitrogen optimization real(r8), parameter :: Trange2 = 42.0_r8 ! upper temperature limit (oC) for nitrogen optimization @@ -92,70 +90,11 @@ module LunaMod contains - !********************************************************************************************************************************************************************** - ! Read in LUNA namelist - subroutine LunaReadNML( NLFilename ) - ! - ! !DESCRIPTION: - ! Read the namelist for LUNA - ! - ! !USES: - use fileutils , only : getavu, relavu, opnfil - use shr_nl_mod , only : shr_nl_find_group_name - use spmdMod , only : masterproc, mpicom - use shr_mpi_mod , only : shr_mpi_bcast - use clm_varctl , only : iulog - use shr_log_mod , only : errMsg => shr_log_errMsg - use abortutils , only : endrun - ! - ! !ARGUMENTS: - character(len=*), intent(in) :: NLFilename ! Namelist filename - ! - ! !LOCAL VARIABLES: - integer :: ierr ! error code - integer :: unitn ! unit for namelist file - - character(len=*), parameter :: subname = 'lunaReadNML' - character(len=*), parameter :: nmlname = 'luna' - !----------------------------------------------------------------------- - namelist /luna/ Jmaxb1 - - ! Initialize options to default values, in case they are not specified in - ! the namelist - - - if (masterproc) then - unitn = getavu() - write(iulog,*) 'Read in '//nmlname//' namelist' - call opnfil (NLFilename, unitn, 'F') - call shr_nl_find_group_name(unitn, nmlname, status=ierr) - if (ierr == 0) then - read(unitn, nml=luna, iostat=ierr) - if (ierr /= 0) then - call endrun(msg="ERROR reading "//nmlname//"namelist"//errmsg(__FILE__, __LINE__)) - end if - else - call endrun(msg="ERROR could NOT find "//nmlname//"namelist"//errmsg(__FILE__, __LINE__)) - end if - call relavu( unitn ) - end if - - call shr_mpi_bcast (Jmaxb1, mpicom) - - if (masterproc) then - write(iulog,*) ' ' - write(iulog,*) nmlname//' settings:' - write(iulog,nml=luna) - write(iulog,*) ' ' - end if - - end subroutine lunaReadNML - !---------------------------------------------------------------------------- subroutine readParams( ncid ) ! ! !USES: - use ncdio_pio, only: file_desc_t + use ncdio_pio, only: file_desc_t,ncd_io use paramUtilMod, only: readNcdioScalar ! ! !ARGUMENTS: @@ -164,6 +103,10 @@ subroutine readParams( ncid ) ! ! !LOCAL VARIABLES: character(len=*), parameter :: subname = 'readParams_Luna' + character(len=100) :: errCode = '-Error reading in parameters file:' + logical :: readv ! has variable been read in or not + real(r8) :: temp1d(0:mxpft) ! temporary to read in parameter + character(len=100) :: tString ! temp. var for reading !-------------------------------------------------------------------- ! CO2 compensation point at 25°C at present day O2 levels @@ -314,6 +257,7 @@ subroutine Update_Photosynthesis_Capacity(bounds, fn, filterp, & c3psn => pftcon%c3psn , & ! photosynthetic pathway: 0. = c4, 1. = c3 slatop => pftcon%slatop , & ! specific leaf area at top of canopy, projected area basis [m^2/gC] leafcn => pftcon%leafcn , & ! leaf C:N (gC/gN) + jmaxb1 => pftcon%jmaxb1 , & ! Coefficient determining the response of electron transport rate to light availability (-) forc_pbot10 => atm2lnd_inst%forc_pbot240_downscaled_patch , & ! Input: [real(r8) (:) ] 10 day mean atmospheric pressure(Pa) CO2_p240 => atm2lnd_inst%forc_pco2_240_patch , & ! Input: [real(r8) (:) ] 10-day mean CO2 partial pressure (Pa) O2_p240 => atm2lnd_inst%forc_po2_240_patch , & ! Input: [real(r8) (:) ] 10-day mean O2 partial pressure (Pa) @@ -439,8 +383,8 @@ subroutine Update_Photosynthesis_Capacity(bounds, fn, filterp, & PNcbold = 0.0_r8 call NitrogenAllocation(FNCa,forc_pbot10(p), relh10, CO2a10, O2a10, PARi10, PARimx10, rb10v, hourpd, & tair10, tleafd10, tleafn10, & - Jmaxb1, PNlcold, PNetold, PNrespold, PNcbold, dayl_factor(p), o3coefjmax(p), & - PNstoreopt, PNlcopt, PNetopt, PNrespopt, PNcbopt) + jmaxb1(ft), PNlcold, PNetold, PNrespold, PNcbold, dayl_factor(p), & + o3coefjmax(p), PNstoreopt, PNlcopt, PNetopt, PNrespopt, PNcbopt) vcmx25_opt= PNcbopt * FNCa * Fc25 jmx25_opt= PNetopt * FNCa * Fj25 @@ -825,7 +769,7 @@ end subroutine Clear24_Climate_LUNA !************************************************************************************************************************************************ !Use the LUNA model to calculate the Nitrogen partioning subroutine NitrogenAllocation(FNCa,forc_pbot10, relh10, CO2a10,O2a10, PARi10,PARimx10,rb10, hourpd, tair10, tleafd10, tleafn10, & - Jmaxb1, PNlcold, PNetold, PNrespold, PNcbold, dayl_factor,o3coefjmax, & + jmaxb1, PNlcold, PNetold, PNrespold, PNcbold, dayl_factor,o3coefjmax, & PNstoreopt, PNlcopt, PNetopt, PNrespopt, PNcbopt) implicit none real(r8), intent (in) :: FNCa !Area based functional nitrogen content (g N/m2 leaf) @@ -840,7 +784,7 @@ subroutine NitrogenAllocation(FNCa,forc_pbot10, relh10, CO2a10,O2a10, PARi10,PAR real(r8), intent (in) :: tair10 !10-day running mean of the 2m temperature (oC) real(r8), intent (in) :: tleafd10 !10-day running mean of daytime leaf temperature (oC) real(r8), intent (in) :: tleafn10 !10-day running mean of nighttime leaf temperature (oC) - real(r8), intent (in) :: Jmaxb1 !coefficient determining the response of electron transport rate to light availability (unitless) + real(r8), intent (in) :: jmaxb1 !coefficient determining the response of electron transport rate to light availability (unitless) real(r8), intent (in) :: PNlcold !old value of the proportion of nitrogen allocated to light capture (unitless) real(r8), intent (in) :: PNetold !old value of the proportion of nitrogen allocated to electron transport (unitless) real(r8), intent (in) :: PNrespold !old value of the proportion of nitrogen allocated to respiration (unitless) @@ -928,7 +872,7 @@ subroutine NitrogenAllocation(FNCa,forc_pbot10, relh10, CO2a10,O2a10, PARi10,PAR tleafd10c = min(max(tleafd10, Trange1), Trange2) !constrain the physiological range tleafn10c = min(max(tleafn10, Trange1), Trange2) !constrain the physiological range ci = 0.7_r8 * CO2a10 - JmaxCoef = Jmaxb1 * dayl_factor * (1.0_r8 - exp(-params_inst%relhExp * max(relh10 - & + JmaxCoef = jmaxb1 * dayl_factor * (1.0_r8 - exp(-params_inst%relhExp * max(relh10 - & params_inst%minrelh, 0.0_r8) / (1.0_r8 - params_inst%minrelh))) do while (PNlcoldi .NE. PNlc .and. jj < 100) Fc = VcmxTKattge(tair10, tleafd10c) * Fc25 diff --git a/src/biogeophys/SnowHydrologyMod.F90 b/src/biogeophys/SnowHydrologyMod.F90 index 9fb1a52dbc..57e9088ece 100644 --- a/src/biogeophys/SnowHydrologyMod.F90 +++ b/src/biogeophys/SnowHydrologyMod.F90 @@ -87,6 +87,7 @@ module SnowHydrologyMod real(r8) :: scvng_fct_mlt_dst4 ! scavenging factor for dust species 4 inclusion in meltwater [frc] real(r8) :: ceta ! Overburden compaction constant (kg/m3) real(r8) :: snw_rds_min ! minimum allowed snow effective radius (also cold "fresh snow" value) [microns] + real(r8) :: upplim_destruct_metamorph ! Upper limit on destructive metamorphism compaction end type params_type type(params_type), private :: params_inst @@ -151,7 +152,6 @@ module SnowHydrologyMod integer :: overburden_compaction_method = -1 integer :: new_snow_density = LoTmpDnsSlater2017 ! Snow density type - real(r8) :: upplim_destruct_metamorph = 100.0_r8 ! Upper Limit on Destructive Metamorphism Compaction [kg/m3] real(r8) :: overburden_compress_Tfactor = 0.08_r8 ! snow compaction overburden exponential factor (1/K) ! ------------------------------------------------------------------------ @@ -211,8 +211,7 @@ subroutine SnowHydrology_readnl( NLFilename) namelist /clm_snowhydrology_inparm/ & wind_dependent_snow_density, snow_overburden_compaction_method, & - lotmp_snowdensity_method, upplim_destruct_metamorph, & - overburden_compress_Tfactor, & + lotmp_snowdensity_method, overburden_compress_Tfactor, & reset_snow, reset_snow_glc, reset_snow_glc_ela, & snow_dzmin_1, snow_dzmax_l_1, snow_dzmax_u_1, & snow_dzmin_2, snow_dzmax_l_2, snow_dzmax_u_2 @@ -246,7 +245,6 @@ subroutine SnowHydrology_readnl( NLFilename) call shr_mpi_bcast (wind_dependent_snow_density, mpicom) call shr_mpi_bcast (snow_overburden_compaction_method, mpicom) call shr_mpi_bcast (lotmp_snowdensity_method , mpicom) - call shr_mpi_bcast (upplim_destruct_metamorph , mpicom) call shr_mpi_bcast (overburden_compress_Tfactor, mpicom) call shr_mpi_bcast (reset_snow , mpicom) call shr_mpi_bcast (reset_snow_glc , mpicom) @@ -333,6 +331,8 @@ subroutine readParams( ncid ) call readNcdioScalar(ncid, 'ceta', subname, params_inst%ceta) ! minimum allowed snow effective radius (also cold "fresh snow" value) [microns] call readNcdioScalar(ncid, 'snw_rds_min', subname, params_inst%snw_rds_min) + ! Upper limit on destructive metamorphism compaction (kg/m3) + call readNcdioScalar(ncid, 'upplim_destruct_metamorph', subname, params_inst%upplim_destruct_metamorph) end subroutine readParams @@ -1972,7 +1972,8 @@ subroutine SnowCompaction(bounds, num_snowc, filter_snowc, & ! Settling as a result of destructive metamorphism ddz1 = -c3*dexpf - if (bi > upplim_destruct_metamorph) ddz1 = ddz1*exp(-46.0e-3_r8*(bi-upplim_destruct_metamorph)) + if (bi > params_inst%upplim_destruct_metamorph) ddz1 = & + ddz1*exp(-46.0e-3_r8*(bi-params_inst%upplim_destruct_metamorph)) ! Liquid water term diff --git a/src/main/controlMod.F90 b/src/main/controlMod.F90 index f65c8c7f47..3b2409344d 100644 --- a/src/main/controlMod.F90 +++ b/src/main/controlMod.F90 @@ -119,7 +119,6 @@ subroutine control_init(dtime) ! ! !USES: use CNMRespMod , only : CNMRespReadNML - use LunaMod , only : LunaReadNML use CNNDynamicsMod , only : CNNDynamicsReadNML use CNPhenologyMod , only : CNPhenologyReadNML use landunit_varcon , only : max_lunit @@ -584,7 +583,6 @@ subroutine control_init(dtime) call SnowHydrology_readnl ( NLFilename ) call UrbanReadNML ( NLFilename ) call HumanIndexReadNML ( NLFilename ) - call LunaReadNML ( NLFilename ) ! ---------------------------------------------------------------------- ! Broadcast all control information if appropriate diff --git a/src/main/pftconMod.F90 b/src/main/pftconMod.F90 index b987879c03..4f8a7f16fc 100644 --- a/src/main/pftconMod.F90 +++ b/src/main/pftconMod.F90 @@ -164,6 +164,7 @@ module pftconMod 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 + real(r8), allocatable :: jmaxb1(:) ! Coefficient determining the response of electron transport rate to light availability ! crop @@ -506,6 +507,7 @@ subroutine InitAllocate (this) allocate( this%wood_density (0:mxpft) ) allocate( this%crit_onset_gdd_sf (0:mxpft) ) allocate( this%ndays_on (0:mxpft) ) + allocate( this%jmaxb1 (0:mxpft) ) end subroutine InitAllocate @@ -1017,6 +1019,9 @@ subroutine InitRead(this) call ncd_io('medlynintercept', this%medlynintercept, 'read', ncid, readvar=readv) if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) + call ncd_io('jmaxb1', this%jmaxb1, 'read', ncid, readvar=readv) + if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) + call ncd_io('mxmat', this%mxmat, 'read', ncid, readvar=readv) if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) @@ -1596,6 +1601,7 @@ subroutine Clean(this) deallocate( this%taper) deallocate( this%crit_onset_gdd_sf) deallocate( this%ndays_on) + deallocate( this%jmaxb1) end subroutine Clean end module pftconMod From 6cb49758a383a430a90d4dec39126ca9820e0f5f Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Mon, 21 Oct 2024 17:57:44 -0600 Subject: [PATCH 107/243] Add comments about using Clm50 in testlist --- 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 77a2d76ba3..c643f21c38 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -2032,6 +2032,7 @@ + @@ -2071,6 +2072,7 @@ + From d4737210924d27e7b356abf8150ecf4c2ef6f81b Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Mon, 21 Oct 2024 18:41:40 -0600 Subject: [PATCH 108/243] Add the ARCTICGRIS & POLARCAP VR grids as I added ARCTIC & CONUS before --- bld/namelist_files/namelist_defaults_ctsm.xml | 6 ++++ bld/unit_testers/build-namelist_test.pl | 2 ++ cime_config/testdefs/testlist_clm.xml | 34 ++++++++++++++++++- 3 files changed, 41 insertions(+), 1 deletion(-) diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index 8746319186..7f8dd7d582 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -2036,8 +2036,12 @@ lnd/clm2/surfdata_esmf/NEON/ctsm5.3.0/surfdata_1x1_NEON_TOOL_hist_2000_78pfts_c2 >lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_0.9x1.25_SSP2-4.5_1850-2100_78pfts_c240908.nc lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_1.9x2.5_SSP2-4.5_1850-2100_78pfts_c240908.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_ne0np4.ARCTICGRIS.ne30x8_SSP2-4.5_1979-2026_78pfts_c240908.nc lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_ne0np4.ARCTIC.ne30x4_SSP2-4.5_1979-2026_78pfts_c240908.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_ne0np4.POLARCAP.ne30x4_SSP2-4.5_1979-2026_78pfts_c240908.nc lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_ne0np4CONUS.ne30x8_SSP2-4.5_1979-2026_78pfts_c240908.nc @@ -2116,6 +2120,8 @@ lnd/clm2/surfdata_esmf/NEON/ctsm5.3.0/surfdata_1x1_NEON_TOOL_hist_2000_78pfts_c2 >lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_ne0np4.ARCTICGRIS.ne30x8_SSP2-4.5_1979-2026_78pfts_c240908.nc lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_ne0np4.ARCTIC.ne30x4_SSP2-4.5_1979-2026_78pfts_c240908.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_ne0np4.POLARCAP.ne30x4_SSP2-4.5_1979-2026_78pfts_c240908.nc lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_ne0np4CONUS.ne30x8_SSP2-4.5_1979-2026_78pfts_c240908.nc diff --git a/bld/unit_testers/build-namelist_test.pl b/bld/unit_testers/build-namelist_test.pl index 4f03ed089f..6bedf1c98d 100755 --- a/bld/unit_testers/build-namelist_test.pl +++ b/bld/unit_testers/build-namelist_test.pl @@ -515,7 +515,9 @@ sub cat_and_create_namelistinfile { "--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", "--res 1.9x2.5 --mask gx1v7 --bgc sp -no-crop --use_case 20thC_transient --namelist '&a start_ymd=19790101/' --lnd_tuning_mode ${phys}_cam7.0 --infile empty_user_nl_clm", + "--res ne0np4.POLARCAP.ne30x4 --mask tx0.1v2 -bgc sp -use_case 20thC_transient -namelist '&a start_ymd=19790101/' -lnd_tuning_mode ${phys}_cam7.0 --infile empty_user_nl_clm", "--res ne0np4.ARCTIC.ne30x4 --mask tx0.1v2 -bgc sp -use_case 20thC_transient -namelist '&a start_ymd=19790101/' -lnd_tuning_mode ${phys}_cam7.0 --infile empty_user_nl_clm", + "--res ne0np4.ARCTICGRIS.ne30x8 --mask tx0.1v2 -bgc sp -use_case 20thC_transient -namelist '&a start_ymd=19790101/' -lnd_tuning_mode ${phys}_cam7.0 --infile empty_user_nl_clm", "--res ne0np4CONUS.ne30x8 --mask tx0.1v2 -bgc sp -use_case 20thC_transient -namelist '&a start_ymd=20130101/' -lnd_tuning_mode ${phys}_cam7.0 --infile empty_user_nl_clm", ) { &make_env_run( 'LND_SETS_DUST_EMIS_DRV_FLDS'=>"FALSE" ); diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index c643f21c38..ffce938b9e 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -2025,6 +2025,27 @@ + + + + + + + + + + + + + + + + + + + + + @@ -2046,13 +2067,24 @@ - + + + + + + + + + + + + From 6d9ee4aa6df86e8a1c80cac90da8f3c1090c814e Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Tue, 1 Oct 2024 18:17:09 -0600 Subject: [PATCH 109/243] Add init_interp_attributes for clm5_0_cam6.0 to namelist_defaults --- bld/namelist_files/namelist_defaults_ctsm.xml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index d7dc104183..b362d0c5fb 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -1205,6 +1205,12 @@ attributes from the config_cache.xml file (with keys converted to upper-case). >hgrid=0.9x1.25 maxpft=79 mask=gx1v7 use_cn=.true. use_crop=.true. irrigate=.true. glc_nec=10 do_transient_pfts=.false. use_excess_ice=.false. + +hgrid=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. + + Date: Wed, 16 Oct 2024 11:27:43 -0600 Subject: [PATCH 110/243] Add CONUS flanduse_timeseries for sim_year_range="1850-2000" --- bld/namelist_files/namelist_defaults_ctsm.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index b362d0c5fb..6e2c137b07 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -1920,6 +1920,8 @@ lnd/clm2/surfdata_esmf/NEON/ctsm5.3.0/surfdata_1x1_NEON_TOOL_hist_2000_78pfts_c2 >lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_0.9x1.25_SSP2-4.5_1850-2100_78pfts_c240908.nc lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_1.9x2.5_SSP2-4.5_1850-2100_78pfts_c240908.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_ne0np4CONUS.ne30x8_SSP2-4.5_1979-2026_78pfts_c240908.nc Date: Thu, 17 Oct 2024 12:02:48 -0600 Subject: [PATCH 111/243] Add 20thC test to build-namelist_test.pl and update defaults accordingly --- bld/namelist_files/namelist_defaults_ctsm.xml | 13 +++++++++++++ bld/unit_testers/build-namelist_test.pl | 1 + 2 files changed, 14 insertions(+) diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index 6e2c137b07..2c9ac338e4 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -1242,6 +1242,19 @@ attributes from the config_cache.xml file (with keys converted to upper-case). maxpft=79 mask=tx2_3v2 use_cn=.true. use_crop=.true. irrigate=.true. glc_nec=10 use_excess_ice=.true. +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. + + +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. use_excess_ice=.false. "FALSE" ); eval{ system( "$bldnml --envxml_dir . $options > $tempfile 2>&1 " ); }; From 367c7bc688a785aa1aa4d65d412af74df337d33a Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Thu, 17 Oct 2024 12:41:50 -0600 Subject: [PATCH 112/243] Add f19 20thC -no-crop test to build-namelist_test --- bld/unit_testers/build-namelist_test.pl | 1 + 1 file changed, 1 insertion(+) diff --git a/bld/unit_testers/build-namelist_test.pl b/bld/unit_testers/build-namelist_test.pl index 05629fc189..c732c4f9f6 100755 --- a/bld/unit_testers/build-namelist_test.pl +++ b/bld/unit_testers/build-namelist_test.pl @@ -514,6 +514,7 @@ sub cat_and_create_namelistinfile { foreach my $options ( "--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", + "--res 1.9x2.5 --mask gx1v7 --bgc sp -no-crop --use_case 20thC_transient --namelist '&a start_ymd=19790101/' --lnd_tuning_mode ${phys}_cam7.0 --infile empty_user_nl_clm", "--res ne0np4CONUS.ne30x8 --mask tx0.1v2 -bgc sp -use_case 20thC_transient -namelist '&a start_ymd=20130101/' -lnd_tuning_mode ${phys}_cam6.0 --infile empty_user_nl_clm", ) { &make_env_run( 'LND_SETS_DUST_EMIS_DRV_FLDS'=>"FALSE" ); From a988ccdcc03745717c0c1f359efb68d89120e671 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Thu, 17 Oct 2024 14:31:16 -0600 Subject: [PATCH 113/243] Similar changes as for CONUS, now for the ARCTIC grid --- bld/namelist_files/namelist_defaults_ctsm.xml | 10 +++------- bld/unit_testers/build-namelist_test.pl | 1 + 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index 2c9ac338e4..60d6102ef0 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -1092,7 +1092,6 @@ attributes from the config_cache.xml file (with keys converted to upper-case). - hgrid=0.9x1.25 maxpft=79 mask=gx1v7 use_cn=.true. use_crop=.true. irrigate=.true. glc_nec=10 do_transient_pfts=.false. use_excess_ice=.false. - -hgrid=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. - - 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. + diff --git a/bld/unit_testers/build-namelist_test.pl b/bld/unit_testers/build-namelist_test.pl index c732c4f9f6..a4d86939d3 100755 --- a/bld/unit_testers/build-namelist_test.pl +++ b/bld/unit_testers/build-namelist_test.pl @@ -515,6 +515,7 @@ sub cat_and_create_namelistinfile { "--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", "--res 1.9x2.5 --mask gx1v7 --bgc sp -no-crop --use_case 20thC_transient --namelist '&a start_ymd=19790101/' --lnd_tuning_mode ${phys}_cam7.0 --infile empty_user_nl_clm", + "--res ne0np4.ARCTIC.ne30x4 --mask tx0.1v2 -bgc sp -use_case 20thC_transient -namelist '&a start_ymd=19790101/' -lnd_tuning_mode ${phys}_cam7.0 --infile empty_user_nl_clm", "--res ne0np4CONUS.ne30x8 --mask tx0.1v2 -bgc sp -use_case 20thC_transient -namelist '&a start_ymd=20130101/' -lnd_tuning_mode ${phys}_cam6.0 --infile empty_user_nl_clm", ) { &make_env_run( 'LND_SETS_DUST_EMIS_DRV_FLDS'=>"FALSE" ); From 9ec87466af2a83d1f8c26cda7939fabae2d457f5 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Thu, 17 Oct 2024 14:38:07 -0600 Subject: [PATCH 114/243] Small correction to 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 a4d86939d3..31c3b25fcb 100755 --- a/bld/unit_testers/build-namelist_test.pl +++ b/bld/unit_testers/build-namelist_test.pl @@ -516,7 +516,7 @@ sub cat_and_create_namelistinfile { "--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", "--res 1.9x2.5 --mask gx1v7 --bgc sp -no-crop --use_case 20thC_transient --namelist '&a start_ymd=19790101/' --lnd_tuning_mode ${phys}_cam7.0 --infile empty_user_nl_clm", "--res ne0np4.ARCTIC.ne30x4 --mask tx0.1v2 -bgc sp -use_case 20thC_transient -namelist '&a start_ymd=19790101/' -lnd_tuning_mode ${phys}_cam7.0 --infile empty_user_nl_clm", - "--res ne0np4CONUS.ne30x8 --mask tx0.1v2 -bgc sp -use_case 20thC_transient -namelist '&a start_ymd=20130101/' -lnd_tuning_mode ${phys}_cam6.0 --infile empty_user_nl_clm", + "--res ne0np4CONUS.ne30x8 --mask tx0.1v2 -bgc sp -use_case 20thC_transient -namelist '&a start_ymd=20130101/' -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 " ); }; From 1face61dde30ee67d2406c369d4f070cac6d5e4b Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Thu, 17 Oct 2024 15:07:48 -0600 Subject: [PATCH 115/243] Add ctsm_sci tests for the VR grids and aux_clm test for f19 --- cime_config/testdefs/testlist_clm.xml | 34 +++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index 4654f53c45..6a6f33d111 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -2059,7 +2059,17 @@ - + + + + + + + + + + + @@ -2069,6 +2079,16 @@ + + + + + + + + + + @@ -2088,7 +2108,7 @@ - + @@ -2098,6 +2118,16 @@ + + + + + + + + + + From 8557a044af858a069a4ae0299c10be3793099498 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Thu, 17 Oct 2024 15:34:24 -0600 Subject: [PATCH 116/243] Adding 3 clm50cam7LNdTuningMode* testmods_dirs for the new tests --- .../clm/clm50cam7LndTuningMode/include_user_mods | 1 + .../testmods_dirs/clm/clm50cam7LndTuningMode/shell_commands | 5 +++++ .../clm/clm50cam7LndTuningMode_1979Start/include_user_mods | 1 + .../clm/clm50cam7LndTuningMode_1979Start/shell_commands | 1 + .../clm/clm50cam7LndTuningMode_2013Start/include_user_mods | 1 + .../clm/clm50cam7LndTuningMode_2013Start/shell_commands | 1 + 6 files changed, 10 insertions(+) create mode 100644 cime_config/testdefs/testmods_dirs/clm/clm50cam7LndTuningMode/include_user_mods create mode 100644 cime_config/testdefs/testmods_dirs/clm/clm50cam7LndTuningMode/shell_commands create mode 100644 cime_config/testdefs/testmods_dirs/clm/clm50cam7LndTuningMode_1979Start/include_user_mods create mode 100644 cime_config/testdefs/testmods_dirs/clm/clm50cam7LndTuningMode_1979Start/shell_commands create mode 100644 cime_config/testdefs/testmods_dirs/clm/clm50cam7LndTuningMode_2013Start/include_user_mods create mode 100644 cime_config/testdefs/testmods_dirs/clm/clm50cam7LndTuningMode_2013Start/shell_commands diff --git a/cime_config/testdefs/testmods_dirs/clm/clm50cam7LndTuningMode/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/clm50cam7LndTuningMode/include_user_mods new file mode 100644 index 0000000000..fe0e18cf88 --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/clm50cam7LndTuningMode/include_user_mods @@ -0,0 +1 @@ +../default diff --git a/cime_config/testdefs/testmods_dirs/clm/clm50cam7LndTuningMode/shell_commands b/cime_config/testdefs/testmods_dirs/clm/clm50cam7LndTuningMode/shell_commands new file mode 100644 index 0000000000..a9b56a5eae --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/clm50cam7LndTuningMode/shell_commands @@ -0,0 +1,5 @@ +#!/bin/bash + +./xmlchange LND_TUNING_MODE="clm5_0_cam7.0" +./xmlchange ROF_NCPL='$ATM_NCPL' + diff --git a/cime_config/testdefs/testmods_dirs/clm/clm50cam7LndTuningMode_1979Start/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/clm50cam7LndTuningMode_1979Start/include_user_mods new file mode 100644 index 0000000000..44d94c8805 --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/clm50cam7LndTuningMode_1979Start/include_user_mods @@ -0,0 +1 @@ +../clm50cam7LndTuningMode diff --git a/cime_config/testdefs/testmods_dirs/clm/clm50cam7LndTuningMode_1979Start/shell_commands b/cime_config/testdefs/testmods_dirs/clm/clm50cam7LndTuningMode_1979Start/shell_commands new file mode 100644 index 0000000000..2aafcc1186 --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/clm50cam7LndTuningMode_1979Start/shell_commands @@ -0,0 +1 @@ +./xmlchange RUN_STARTDATE=1979-01-01 diff --git a/cime_config/testdefs/testmods_dirs/clm/clm50cam7LndTuningMode_2013Start/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/clm50cam7LndTuningMode_2013Start/include_user_mods new file mode 100644 index 0000000000..44d94c8805 --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/clm50cam7LndTuningMode_2013Start/include_user_mods @@ -0,0 +1 @@ +../clm50cam7LndTuningMode diff --git a/cime_config/testdefs/testmods_dirs/clm/clm50cam7LndTuningMode_2013Start/shell_commands b/cime_config/testdefs/testmods_dirs/clm/clm50cam7LndTuningMode_2013Start/shell_commands new file mode 100644 index 0000000000..035842f982 --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/clm50cam7LndTuningMode_2013Start/shell_commands @@ -0,0 +1 @@ +./xmlchange RUN_STARTDATE=2013-01-01 From 76d336a9bf4a4d5e0df61392a0c9ab71bd4c4090 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Mon, 21 Oct 2024 17:57:44 -0600 Subject: [PATCH 117/243] Add comments about using Clm50 in testlist --- 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 6a6f33d111..13fc3debb4 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -2076,6 +2076,7 @@ + @@ -2115,6 +2116,7 @@ + From e90189d51ae343539ecdb7085d018bec13d2d21e Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Mon, 21 Oct 2024 18:41:40 -0600 Subject: [PATCH 118/243] Add the ARCTICGRIS & POLARCAP VR grids as I added ARCTIC & CONUS before --- bld/namelist_files/namelist_defaults_ctsm.xml | 6 ++++ bld/unit_testers/build-namelist_test.pl | 2 ++ cime_config/testdefs/testlist_clm.xml | 34 ++++++++++++++++++- 3 files changed, 41 insertions(+), 1 deletion(-) diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index 60d6102ef0..91ca0bfb7e 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -1927,8 +1927,12 @@ lnd/clm2/surfdata_esmf/NEON/ctsm5.3.0/surfdata_1x1_NEON_TOOL_hist_2000_78pfts_c2 >lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_0.9x1.25_SSP2-4.5_1850-2100_78pfts_c240908.nc lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_1.9x2.5_SSP2-4.5_1850-2100_78pfts_c240908.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_ne0np4.ARCTICGRIS.ne30x8_SSP2-4.5_1979-2026_78pfts_c240908.nc lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_ne0np4.ARCTIC.ne30x4_SSP2-4.5_1979-2026_78pfts_c240908.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_ne0np4.POLARCAP.ne30x4_SSP2-4.5_1979-2026_78pfts_c240908.nc lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_ne0np4CONUS.ne30x8_SSP2-4.5_1979-2026_78pfts_c240908.nc @@ -2007,6 +2011,8 @@ lnd/clm2/surfdata_esmf/NEON/ctsm5.3.0/surfdata_1x1_NEON_TOOL_hist_2000_78pfts_c2 >lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_ne0np4.ARCTICGRIS.ne30x8_SSP2-4.5_1979-2026_78pfts_c240908.nc lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_ne0np4.ARCTIC.ne30x4_SSP2-4.5_1979-2026_78pfts_c240908.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_ne0np4.POLARCAP.ne30x4_SSP2-4.5_1979-2026_78pfts_c240908.nc lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_ne0np4CONUS.ne30x8_SSP2-4.5_1979-2026_78pfts_c240908.nc diff --git a/bld/unit_testers/build-namelist_test.pl b/bld/unit_testers/build-namelist_test.pl index 31c3b25fcb..b6b31cd644 100755 --- a/bld/unit_testers/build-namelist_test.pl +++ b/bld/unit_testers/build-namelist_test.pl @@ -515,7 +515,9 @@ sub cat_and_create_namelistinfile { "--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", "--res 1.9x2.5 --mask gx1v7 --bgc sp -no-crop --use_case 20thC_transient --namelist '&a start_ymd=19790101/' --lnd_tuning_mode ${phys}_cam7.0 --infile empty_user_nl_clm", + "--res ne0np4.POLARCAP.ne30x4 --mask tx0.1v2 -bgc sp -use_case 20thC_transient -namelist '&a start_ymd=19790101/' -lnd_tuning_mode ${phys}_cam7.0 --infile empty_user_nl_clm", "--res ne0np4.ARCTIC.ne30x4 --mask tx0.1v2 -bgc sp -use_case 20thC_transient -namelist '&a start_ymd=19790101/' -lnd_tuning_mode ${phys}_cam7.0 --infile empty_user_nl_clm", + "--res ne0np4.ARCTICGRIS.ne30x8 --mask tx0.1v2 -bgc sp -use_case 20thC_transient -namelist '&a start_ymd=19790101/' -lnd_tuning_mode ${phys}_cam7.0 --infile empty_user_nl_clm", "--res ne0np4CONUS.ne30x8 --mask tx0.1v2 -bgc sp -use_case 20thC_transient -namelist '&a start_ymd=20130101/' -lnd_tuning_mode ${phys}_cam7.0 --infile empty_user_nl_clm", ) { &make_env_run( 'LND_SETS_DUST_EMIS_DRV_FLDS'=>"FALSE" ); diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index 13fc3debb4..33f86446cb 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -2069,6 +2069,27 @@ + + + + + + + + + + + + + + + + + + + + + @@ -2090,13 +2111,24 @@ - + + + + + + + + + + + + From 2bcf44e5b9e19557387c9b885ae696f026906507 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Mon, 21 Oct 2024 19:24:05 -0600 Subject: [PATCH 119/243] Correction from a conflict during the rebase and/or merges --- bld/namelist_files/namelist_defaults_ctsm.xml | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index 91ca0bfb7e..9b92e95f64 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -1240,16 +1240,6 @@ 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. 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. 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. 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. use_excess_ice=.false. From b766fc0b0bb2e3e94d8fb7410b14a06f48ecde3b Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Mon, 21 Oct 2024 19:33:47 -0600 Subject: [PATCH 120/243] Second correction from conflict during the rebase and/or merges --- 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 9b92e95f64..deff06e611 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -1235,10 +1235,6 @@ attributes from the config_cache.xml file (with keys converted to upper-case). maxpft=79 mask=tx2_3v2 use_cn=.true. use_crop=.true. irrigate=.true. glc_nec=10 use_excess_ice=.true. -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. - Date: Mon, 21 Oct 2024 20:23:18 -0600 Subject: [PATCH 121/243] Third correction --- bld/namelist_files/namelist_defaults_ctsm.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index deff06e611..15176ded6d 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -1235,6 +1235,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). maxpft=79 mask=tx2_3v2 use_cn=.true. use_crop=.true. irrigate=.true. glc_nec=10 use_excess_ice=.true. + Date: Tue, 22 Oct 2024 08:47:59 -0600 Subject: [PATCH 122/243] Make jmaxb0, wc2wjb0, r_mort pft-dimensioned --- src/biogeochem/CNGapMortalityMod.F90 | 13 +++---------- src/biogeophys/LunaMod.F90 | 28 ++++++++++++++-------------- src/main/pftconMod.F90 | 18 ++++++++++++++++++ 3 files changed, 35 insertions(+), 24 deletions(-) diff --git a/src/biogeochem/CNGapMortalityMod.F90 b/src/biogeochem/CNGapMortalityMod.F90 index 8979b1eebd..70709bce8b 100644 --- a/src/biogeochem/CNGapMortalityMod.F90 +++ b/src/biogeochem/CNGapMortalityMod.F90 @@ -34,7 +34,6 @@ module CNGapMortalityMod public :: CNGapMortality type, private :: params_type - real(r8):: am ! mortality rate based on annual rate, fractional mortality (1/yr) real(r8):: k_mort ! coeff. of growth efficiency in mortality equation end type params_type ! @@ -70,11 +69,6 @@ subroutine readParams ( ncid ) character(len=100) :: tString ! temp. var for reading !----------------------------------------------------------------------- - tString='r_mort' - 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%am=tempr - tString='k_mort' 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__)) @@ -140,6 +134,7 @@ subroutine CNGapMortality (bounds, num_soilp, filter_soilp, & leafcn => pftcon%leafcn , & ! Input: [real(r8) (:)] leaf C:N (gC/gN) livewdcn => pftcon%livewdcn , & ! Input: [real(r8) (:)] live wood (phloem and ray parenchyma) C:N (gC/gN) + r_mort => pftcon%r_mort , & ! Input: [real(r8) (:)] Mortality rate (1/year) laisun => canopystate_inst%laisun_patch , & ! Input: [real(r8) (:) ] sunlit projected leaf area index laisha => canopystate_inst%laisha_patch , & ! Input: [real(r8) (:) ] shaded projected leaf area index nind => dgvs_inst%nind_patch , & ! Output:[real(r8)(:)] number of individuals (#/m2) added by F. Li and S. Levis @@ -183,8 +178,6 @@ subroutine CNGapMortality (bounds, num_soilp, filter_soilp, & ) dt = real( get_step_size(), r8 ) - ! set the mortality rate based on annual rate - am = params_inst%am ! set coeff of growth efficiency in mortality equation k_mort = params_inst%k_mort @@ -216,12 +209,12 @@ subroutine CNGapMortality (bounds, num_soilp, filter_soilp, & am = min(1._r8, am + heatstress(p)) else ! lpj didn't set this for grasses; cn does ! set the mortality rate based on annual rate - am = params_inst%am + am = r_mort(ivt(p)) end if end if - m = am/(get_average_days_per_year() * secspday) + m = r_mort(ivt(p))/(get_average_days_per_year() * secspday) !------------------------------------------------------ ! patch-level gap mortality carbon fluxes diff --git a/src/biogeophys/LunaMod.F90 b/src/biogeophys/LunaMod.F90 index 3f5f7d0e3c..04bcf8256e 100644 --- a/src/biogeophys/LunaMod.F90 +++ b/src/biogeophys/LunaMod.F90 @@ -46,8 +46,6 @@ module LunaMod real(r8) :: kc25_coef ! Michaelis-Menten const. at 25°C for CO2 (unitless) real(r8) :: ko25_coef ! Michaelis-Menten const. at 25°C for O2 (unitless) real(r8) :: luna_theta_cj ! LUNA empirical curvature parameter for ac, aj photosynthesis co-limitation (unitless) - real(r8) :: jmaxb0 ! The baseline proportion of nitrogen allocated for electron transport (J) - real(r8) :: wc2wjb0 ! The baseline ratio of rubisco limited rate vs light limited photosynthetic rate (Wc:Wj) (unitless) real(r8) :: enzyme_turnover_daily ! The daily turnover rate for photosynthetic enzyme at 25oC in view of ~7 days of half-life time for Rubisco (Suzuki et al. 2001) (unitless) real(r8) :: relhExp ! Specifies the impact of relative humidity on electron transport rate (unitless) real(r8) :: minrelh ! Minimum relative humidity for nitrogen optimization (fraction) @@ -120,10 +118,6 @@ subroutine readParams( ncid ) params_inst%kc25_coef = params_inst%kc25_coef * 1.e5_r8 ! from mol/mol to Luna units ! LUNA empirical curvature parameter for ac, aj photosynthesis co-limitation call readNcdioScalar(ncid, 'luna_theta_cj', subname, params_inst%luna_theta_cj) - ! The baseline proportion of nitrogen allocated for electron transport (J) - call readNcdioScalar(ncid, 'jmaxb0', subname, params_inst%jmaxb0) - ! The baseline ratio of rubisco limited rate vs light limited photosynthetic rate (Wc:Wj) (unitless) - call readNcdioScalar(ncid, 'wc2wjb0', subname, params_inst%wc2wjb0) ! The daily turnover rate for photosynthetic enzyme at 25oC in view of ~7 days of half-life time for Rubisco (Suzuki et al. 2001) (unitless) call readNcdioScalar(ncid, 'enzyme_turnover_daily', subname, params_inst%enzyme_turnover_daily) ! Specifies the impact of relative humidity on electron transport rate (unitless) @@ -257,7 +251,9 @@ subroutine Update_Photosynthesis_Capacity(bounds, fn, filterp, & c3psn => pftcon%c3psn , & ! photosynthetic pathway: 0. = c4, 1. = c3 slatop => pftcon%slatop , & ! specific leaf area at top of canopy, projected area basis [m^2/gC] leafcn => pftcon%leafcn , & ! leaf C:N (gC/gN) + jmaxb0 => pftcon%jmaxb0 , & ! Baseline proportion of nitrogen allocated for electron transport (J) jmaxb1 => pftcon%jmaxb1 , & ! Coefficient determining the response of electron transport rate to light availability (-) + wc2wjb0 => pftcon%wc2wjb0 , & ! The baseline ratio of rubisco limited rate vs light limited photosynthetic rate (Wc:Wj) (-) forc_pbot10 => atm2lnd_inst%forc_pbot240_downscaled_patch , & ! Input: [real(r8) (:) ] 10 day mean atmospheric pressure(Pa) CO2_p240 => atm2lnd_inst%forc_pco2_240_patch , & ! Input: [real(r8) (:) ] 10-day mean CO2 partial pressure (Pa) O2_p240 => atm2lnd_inst%forc_po2_240_patch , & ! Input: [real(r8) (:) ] 10-day mean O2 partial pressure (Pa) @@ -383,7 +379,7 @@ subroutine Update_Photosynthesis_Capacity(bounds, fn, filterp, & PNcbold = 0.0_r8 call NitrogenAllocation(FNCa,forc_pbot10(p), relh10, CO2a10, O2a10, PARi10, PARimx10, rb10v, hourpd, & tair10, tleafd10, tleafn10, & - jmaxb1(ft), PNlcold, PNetold, PNrespold, PNcbold, dayl_factor(p), & + jmaxb0(ft), jmaxb1(ft), wc2wjb0(ft), PNlcold, PNetold, PNrespold, PNcbold, dayl_factor(p), & o3coefjmax(p), PNstoreopt, PNlcopt, PNetopt, PNrespopt, PNcbopt) vcmx25_opt= PNcbopt * FNCa * Fc25 jmx25_opt= PNetopt * FNCa * Fj25 @@ -769,7 +765,7 @@ end subroutine Clear24_Climate_LUNA !************************************************************************************************************************************************ !Use the LUNA model to calculate the Nitrogen partioning subroutine NitrogenAllocation(FNCa,forc_pbot10, relh10, CO2a10,O2a10, PARi10,PARimx10,rb10, hourpd, tair10, tleafd10, tleafn10, & - jmaxb1, PNlcold, PNetold, PNrespold, PNcbold, dayl_factor,o3coefjmax, & + jmaxb0, jmaxb1, wc2wjb0, PNlcold, PNetold, PNrespold, PNcbold, dayl_factor,o3coefjmax, & PNstoreopt, PNlcopt, PNetopt, PNrespopt, PNcbopt) implicit none real(r8), intent (in) :: FNCa !Area based functional nitrogen content (g N/m2 leaf) @@ -784,7 +780,9 @@ subroutine NitrogenAllocation(FNCa,forc_pbot10, relh10, CO2a10,O2a10, PARi10,PAR real(r8), intent (in) :: tair10 !10-day running mean of the 2m temperature (oC) real(r8), intent (in) :: tleafd10 !10-day running mean of daytime leaf temperature (oC) real(r8), intent (in) :: tleafn10 !10-day running mean of nighttime leaf temperature (oC) + real(r8), intent (in) :: jmaxb0 !Baseline proportion of nitrogen allocated for electron transport (J) real(r8), intent (in) :: jmaxb1 !coefficient determining the response of electron transport rate to light availability (unitless) + real(r8), intent (in) :: wc2wjb0 !The baseline ratio of rubisco limited rate vs light limited photosynthetic rate (Wc:Wj) (-) real(r8), intent (in) :: PNlcold !old value of the proportion of nitrogen allocated to light capture (unitless) real(r8), intent (in) :: PNetold !old value of the proportion of nitrogen allocated to electron transport (unitless) real(r8), intent (in) :: PNrespold !old value of the proportion of nitrogen allocated to respiration (unitless) @@ -886,7 +884,7 @@ subroutine NitrogenAllocation(FNCa,forc_pbot10, relh10, CO2a10,O2a10, PARi10,PAR call Nitrogen_investments (KcKjFlag,FNCa, Nlc, forc_pbot10, relh10, CO2a10,O2a10, PARi10c, PARimx10c,rb10, hourpd, tair10, & tleafd10c,tleafn10c, & Kj2Kc, JmaxCoef, Fc,Fj, NUEc, NUEj, NUEcref, NUEjref, NUEr, o3coefjmax, & - Kc, Kj, ci, & + jmaxb0, wc2wjb0, Kc, Kj, ci, & Vcmax, Jmax,JmeanL,JmaxL, Net, Ncb, Nresp, PSN, RESP) Npsntarget = Nlc + Ncb + Net !target nitrogen allocated to photosynthesis, which may be lower or higher than Npsn_avail @@ -901,7 +899,7 @@ subroutine NitrogenAllocation(FNCa,forc_pbot10, relh10, CO2a10,O2a10, PARi10,PAR call Nitrogen_investments (KcKjFlag,FNCa, Nlc2, forc_pbot10, relh10, CO2a10,O2a10, PARi10c, PARimx10c,rb10, hourpd, & tair10, tleafd10c,tleafn10c, & Kj2Kc, JmaxCoef, Fc,Fj, NUEc, NUEj, NUEcref, NUEjref,NUEr, o3coefjmax, & - Kc, Kj, ci, & + jmaxb0, wc2wjb0, Kc, Kj, ci, & Vcmax, Jmax,JmeanL,JmaxL, Net2, Ncb2, Nresp2, PSN2, RESP2) Npsntarget2 = Nlc2 + Ncb2 + Net2 @@ -930,7 +928,7 @@ subroutine NitrogenAllocation(FNCa,forc_pbot10, relh10, CO2a10,O2a10, PARi10,PAR call Nitrogen_investments (KcKjFlag,FNCa, Nlc1,forc_pbot10, relh10, CO2a10,O2a10, PARi10c, PARimx10c,rb10, hourpd, & tair10, tleafd10c,tleafn10c, & Kj2Kc, JmaxCoef, Fc,Fj, NUEc, NUEj, NUEcref, NUEjref,NUEr, o3coefjmax, & - Kc, Kj, ci,& + jmaxb0, wc2wjb0, Kc, Kj, ci,& Vcmax, Jmax,JmeanL,JmaxL, Net1, Ncb1, Nresp1, PSN1, RESP1) Npsntarget1 = Nlc1 + Ncb1 + Net1 Carboncost1 = (Npsntarget - Npsntarget1) * NMCp25 * Cv * (RespTBernacchi(tleafd10c) * hourpd + & @@ -961,7 +959,7 @@ end subroutine NitrogenAllocation subroutine Nitrogen_investments (KcKjFlag, FNCa, Nlc, forc_pbot10, relh10, & CO2a10, O2a10, PARi10, PARimx10, rb10, hourpd, tair10, tleafd10, tleafn10, & Kj2Kc, JmaxCoef, Fc, Fj, NUEc, NUEj, NUEcref, NUEjref, NUEr, o3coefjmax, & - Kc, Kj, ci, Vcmax, Jmax, JmeanL, JmaxL, Net, Ncb, Nresp, PSN, RESP) + jmaxb0, wc2wjb0, Kc, Kj, ci, Vcmax, Jmax, JmeanL, JmaxL, Net, Ncb, Nresp, PSN, RESP) implicit none integer, intent (in) :: KcKjFlag !flag to indicate whether to update the Kc and Kj using the photosynthesis subroutine; 0--Kc and Kj need to be calculated; 1--Kc and Kj is prescribed. real(r8), intent (in) :: FNCa !Area based functional nitrogen content (g N/m2 leaf) @@ -987,6 +985,8 @@ subroutine Nitrogen_investments (KcKjFlag, FNCa, Nlc, forc_pbot10, relh10, & real(r8), intent (in) :: NUEjref !nitrogen use efficiency for electron transport under reference climates real(r8), intent (in) :: NUEr !nitrogen use efficiency for respiration real(r8), intent (in) :: o3coefjmax !ozone coef jmax + real(r8), intent (in) :: jmaxb0 !Baseline proportion of nitrogen allocated for electron transport (J) + real(r8), intent (in) :: wc2wjb0 !The baseline ratio of rubisco limited rate vs light limited photosynthetic rate (Wc:Wj) (-) real(r8), intent (inout) :: Kc !conversion factors from Vc,max to Wc real(r8), intent (inout) :: Kj !conversion factor from electron transport rate to Wj @@ -1016,7 +1016,7 @@ subroutine Nitrogen_investments (KcKjFlag, FNCa, Nlc, forc_pbot10, relh10, & theta = 0.292_r8 / (1.0_r8 + 0.076_r8 / (Nlc * Cb)) ELTRNabsorb = theta * PARi10 - Jmaxb0act = params_inst%jmaxb0 * FNCa * Fj + Jmaxb0act = jmaxb0 * FNCa * Fj ! Default value of o3coefjmax is 1 --> ! o3coefjmax is only different from 1 if ozone_inst%stress_method == 'stress_falk' @@ -1026,7 +1026,7 @@ subroutine Nitrogen_investments (KcKjFlag, FNCa, Nlc, forc_pbot10, relh10, & JmaxL = theta * PARimx10 / (sqrt(1.0_r8 + (theta * PARimx10 / Jmax)**2.0_r8)) NUEchg = (NUEc / NUEcref) * (NUEjref / NUEj) - Wc2Wj = params_inst%wc2wjb0 * (NUEchg**0.5_r8) + Wc2Wj = wc2wjb0 * (NUEchg**0.5_r8) Vcmax = Wc2Wj * JmaxL * Kj2Kc JmeanL = theta * PARi10 / (sqrt(1.0_r8 + (ELTRNabsorb / Jmax)**2.0_r8)) if(KcKjFlag.eq.0)then !update the Kc,Kj, anc ci information diff --git a/src/main/pftconMod.F90 b/src/main/pftconMod.F90 index 4f8a7f16fc..0bb9ef23da 100644 --- a/src/main/pftconMod.F90 +++ b/src/main/pftconMod.F90 @@ -164,7 +164,10 @@ module pftconMod 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 + real(r8), allocatable :: jmaxb0(:) ! Baseline proportion of nitrogen allocated for electron transport (J) real(r8), allocatable :: jmaxb1(:) ! Coefficient determining the response of electron transport rate to light availability + real(r8), allocatable :: wc2wjb0(:) ! The baseline ratio of rubisco limited rate vs light limited photosynthetic rate (Wc:Wj) (-) + real(r8), allocatable :: r_mort(:) ! Mortality rate (1/year) ! crop @@ -507,7 +510,10 @@ subroutine InitAllocate (this) allocate( this%wood_density (0:mxpft) ) allocate( this%crit_onset_gdd_sf (0:mxpft) ) allocate( this%ndays_on (0:mxpft) ) + allocate( this%jmaxb0 (0:mxpft) ) allocate( this%jmaxb1 (0:mxpft) ) + allocate( this%wc2wjb0 (0:mxpft) ) + allocate( this%r_mort (0:mxpft) ) end subroutine InitAllocate @@ -1019,9 +1025,18 @@ subroutine InitRead(this) call ncd_io('medlynintercept', this%medlynintercept, 'read', ncid, readvar=readv) if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) + call ncd_io('jmaxb0', this%jmaxb0, 'read', ncid, readvar=readv) + if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) + call ncd_io('jmaxb1', this%jmaxb1, 'read', ncid, readvar=readv) if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) + call ncd_io('wc2wjb0', this%wc2wjb0, 'read', ncid, readvar=readv) + if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) + + call ncd_io('r_mort', this%r_mort, 'read', ncid, readvar=readv) + if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) + call ncd_io('mxmat', this%mxmat, 'read', ncid, readvar=readv) if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) @@ -1601,7 +1616,10 @@ subroutine Clean(this) deallocate( this%taper) deallocate( this%crit_onset_gdd_sf) deallocate( this%ndays_on) + deallocate( this%jmaxb0) deallocate( this%jmaxb1) + deallocate( this%wc2wjb0) + deallocate( this%r_mort) end subroutine Clean end module pftconMod From 9a569ec65e2c982891406d2f0427260ce7485186 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Tue, 22 Oct 2024 10:01:20 -0600 Subject: [PATCH 123/243] Corrections for certain tests to pass --- bld/namelist_files/namelist_defaults_ctsm.xml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index 15176ded6d..ba262d45e1 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -1826,6 +1826,8 @@ lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_ne120np4.pg3_hist_2000_78pfts_c240908. 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_c240908.nc + +lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_ne0np4.POLARCAP.ne30x4_hist_2000_78pfts_c240908.nc lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_ne0np4CONUS.ne30x8_hist_2000_78pfts_c240908.nc @@ -1883,6 +1885,8 @@ lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_ne120np4.pg3_hist_1850_78pfts_c240908. 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_c240908.nc + +lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_ne0np4.POLARCAP.ne30x4_hist_1979_78pfts_c240908.nc lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_ne0np4CONUS.ne30x8_hist_1979_78pfts_c240908.nc @@ -1998,7 +2002,7 @@ lnd/clm2/surfdata_esmf/NEON/ctsm5.3.0/surfdata_1x1_NEON_TOOL_hist_2000_78pfts_c2 >lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_ne0np4.ARCTICGRIS.ne30x8_SSP2-4.5_1979-2026_78pfts_c240908.nc lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_ne0np4.ARCTIC.ne30x4_SSP2-4.5_1979-2026_78pfts_c240908.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_ne0np4.POLARCAP.ne30x4_SSP2-4.5_1979-2026_78pfts_c240908.nc lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_ne0np4CONUS.ne30x8_SSP2-4.5_1979-2026_78pfts_c240908.nc From bae4c644df8f966d75cd9d3ede356d308dcbbcfc Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Tue, 22 Oct 2024 10:22:09 -0600 Subject: [PATCH 124/243] Change 4 Sp tests from nofire to nofireemis so that they will pass --- cime_config/testdefs/testlist_clm.xml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index 33f86446cb..5a3d4d465d 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -2163,41 +2163,45 @@ - + + - + + - + + - + + From 932337a075b2a9986062c9d1499b25b40aaa3954 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Tue, 22 Oct 2024 10:35:35 -0600 Subject: [PATCH 125/243] Update ExpectedTestFails.xml regarding urbanc_alpha test --- cime_config/testdefs/ExpectedTestFails.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cime_config/testdefs/ExpectedTestFails.xml b/cime_config/testdefs/ExpectedTestFails.xml index 7049e9672b..3065205451 100644 --- a/cime_config/testdefs/ExpectedTestFails.xml +++ b/cime_config/testdefs/ExpectedTestFails.xml @@ -29,9 +29,10 @@ - + FAIL + #2122 CDEPS/#243 From b7121a6704265cd58fe1af493cf6b668d29aabe9 Mon Sep 17 00:00:00 2001 From: Keith Oleson Date: Tue, 22 Oct 2024 10:46:46 -0600 Subject: [PATCH 126/243] ncd_io not needed after all --- src/biogeophys/LunaMod.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/biogeophys/LunaMod.F90 b/src/biogeophys/LunaMod.F90 index 04bcf8256e..366fa68f4b 100644 --- a/src/biogeophys/LunaMod.F90 +++ b/src/biogeophys/LunaMod.F90 @@ -92,7 +92,7 @@ module LunaMod subroutine readParams( ncid ) ! ! !USES: - use ncdio_pio, only: file_desc_t,ncd_io + use ncdio_pio, only: file_desc_t use paramUtilMod, only: readNcdioScalar ! ! !ARGUMENTS: From 3f4936c91a8ca79c3fce486b34c6bbcdf074210b Mon Sep 17 00:00:00 2001 From: Keith Oleson Date: Tue, 22 Oct 2024 10:52:34 -0600 Subject: [PATCH 127/243] Other variables not needed after all --- src/biogeophys/LunaMod.F90 | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/biogeophys/LunaMod.F90 b/src/biogeophys/LunaMod.F90 index 366fa68f4b..21e05dc0c6 100644 --- a/src/biogeophys/LunaMod.F90 +++ b/src/biogeophys/LunaMod.F90 @@ -12,7 +12,7 @@ module LunaMod use clm_varcon , only : rgas, tfrz,spval use abortutils , only : endrun use clm_varctl , only : iulog - use clm_varpar , only : nlevcan, mxpft + use clm_varpar , only : nlevcan use decompMod , only : bounds_type, subgrid_level_patch use pftconMod , only : pftcon use FrictionvelocityMod , only : frictionvel_type @@ -101,10 +101,6 @@ subroutine readParams( ncid ) ! ! !LOCAL VARIABLES: character(len=*), parameter :: subname = 'readParams_Luna' - character(len=100) :: errCode = '-Error reading in parameters file:' - logical :: readv ! has variable been read in or not - real(r8) :: temp1d(0:mxpft) ! temporary to read in parameter - character(len=100) :: tString ! temp. var for reading !-------------------------------------------------------------------- ! CO2 compensation point at 25°C at present day O2 levels @@ -170,7 +166,7 @@ subroutine Update_Photosynthesis_Capacity(bounds, fn, filterp, & ! !USES: use clm_time_manager , only : get_step_size_real - use clm_varpar , only : nlevsoi, mxpft + use clm_varpar , only : nlevsoi use perf_mod , only : t_startf, t_stopf use clm_varctl , only : use_cn use quadraticMod , only : quadratic From bc3d51892d4e701cd8b5a57f8010c30dc6de7d49 Mon Sep 17 00:00:00 2001 From: Keith Oleson Date: Tue, 22 Oct 2024 11:04:17 -0600 Subject: [PATCH 128/243] Consistent naming of units --- src/biogeophys/LunaMod.F90 | 2 +- src/biogeophys/SnowHydrologyMod.F90 | 2 +- src/main/pftconMod.F90 | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/biogeophys/LunaMod.F90 b/src/biogeophys/LunaMod.F90 index 21e05dc0c6..0727e84e7a 100644 --- a/src/biogeophys/LunaMod.F90 +++ b/src/biogeophys/LunaMod.F90 @@ -777,7 +777,7 @@ subroutine NitrogenAllocation(FNCa,forc_pbot10, relh10, CO2a10,O2a10, PARi10,PAR real(r8), intent (in) :: tleafd10 !10-day running mean of daytime leaf temperature (oC) real(r8), intent (in) :: tleafn10 !10-day running mean of nighttime leaf temperature (oC) real(r8), intent (in) :: jmaxb0 !Baseline proportion of nitrogen allocated for electron transport (J) - real(r8), intent (in) :: jmaxb1 !coefficient determining the response of electron transport rate to light availability (unitless) + real(r8), intent (in) :: jmaxb1 !coefficient determining the response of electron transport rate to light availability (-) real(r8), intent (in) :: wc2wjb0 !The baseline ratio of rubisco limited rate vs light limited photosynthetic rate (Wc:Wj) (-) real(r8), intent (in) :: PNlcold !old value of the proportion of nitrogen allocated to light capture (unitless) real(r8), intent (in) :: PNetold !old value of the proportion of nitrogen allocated to electron transport (unitless) diff --git a/src/biogeophys/SnowHydrologyMod.F90 b/src/biogeophys/SnowHydrologyMod.F90 index 57e9088ece..578769d9ea 100644 --- a/src/biogeophys/SnowHydrologyMod.F90 +++ b/src/biogeophys/SnowHydrologyMod.F90 @@ -87,7 +87,7 @@ module SnowHydrologyMod real(r8) :: scvng_fct_mlt_dst4 ! scavenging factor for dust species 4 inclusion in meltwater [frc] real(r8) :: ceta ! Overburden compaction constant (kg/m3) real(r8) :: snw_rds_min ! minimum allowed snow effective radius (also cold "fresh snow" value) [microns] - real(r8) :: upplim_destruct_metamorph ! Upper limit on destructive metamorphism compaction + real(r8) :: upplim_destruct_metamorph ! Upper limit on destructive metamorphism compaction (kg/m3) end type params_type type(params_type), private :: params_inst diff --git a/src/main/pftconMod.F90 b/src/main/pftconMod.F90 index 0bb9ef23da..965b21ec70 100644 --- a/src/main/pftconMod.F90 +++ b/src/main/pftconMod.F90 @@ -165,7 +165,7 @@ module pftconMod 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 real(r8), allocatable :: jmaxb0(:) ! Baseline proportion of nitrogen allocated for electron transport (J) - real(r8), allocatable :: jmaxb1(:) ! Coefficient determining the response of electron transport rate to light availability + real(r8), allocatable :: jmaxb1(:) ! Coefficient determining the response of electron transport rate to light availability (-) real(r8), allocatable :: wc2wjb0(:) ! The baseline ratio of rubisco limited rate vs light limited photosynthetic rate (Wc:Wj) (-) real(r8), allocatable :: r_mort(:) ! Mortality rate (1/year) From 04ed1530a44027ade613c48f4323b5425c09b5b0 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Tue, 22 Oct 2024 16:34:02 -0600 Subject: [PATCH 129/243] Updates from Erik's code review and testing --- bld/unit_testers/build-namelist_test.pl | 16 +++++++++++++++- cime_config/testdefs/testlist_clm.xml | 2 -- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/bld/unit_testers/build-namelist_test.pl b/bld/unit_testers/build-namelist_test.pl index 08075df481..ca11c18253 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 = 3196; +my $ntests = 3229; if ( defined($opts{'compare'}) ) { $ntests += 2437; @@ -605,6 +605,10 @@ sub cat_and_create_namelistinfile { namelst=>"use_crop=.true.", phys=>"clm4_5", }, + "LeungDust_WO_Prigent" =>{ options=>" -envxml_dir . -bgc sp", + namelst=>"use_prigent_roughness=.false.,dust_emis_method='Leung_2023'", + phys=>"clm6_0", + }, "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'", phys=>"clm5_0", @@ -967,6 +971,16 @@ sub cat_and_create_namelistinfile { GLC_TWO_WAY_COUPLING=>"TRUE", phys=>"clm5_0", }, + "sasuspinupWOsoilmatx" =>{ options=>"-envxml_dir . -bgc bgc -clm_accelerated_spinup sasu", + namelst=>"use_soil_matrixcn=.false.,use_matrixcn=.false.", + GLC_TWO_WAY_COUPLING=>"TRUE", + phys=>"clm6_0", + }, + "sasuspinupWOCN" =>{ options=>"-envxml_dir . -bgc sp -clm_accelerated_spinup sasu", + namelst=>"", + GLC_TWO_WAY_COUPLING=>"TRUE", + phys=>"clm6_0", + }, "nyrforceWOspinup" =>{ options=>"-envxml_dir . -bgc bgc -clm_accelerated_spinup sasu", namelst=>"use_matrixcn=.false.,spinup_matrixcn=F,nyr_forcing=20", GLC_TWO_WAY_COUPLING=>"TRUE", diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index a944c5993d..2e1ae173a1 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -123,7 +123,6 @@ - @@ -960,7 +959,6 @@ - From 66926130a37ab3b5b61f647bf7549fe439e23c9e Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Tue, 22 Oct 2024 17:00:27 -0600 Subject: [PATCH 130/243] Syntax error correction in ExpectedTestFails.xml --- cime_config/testdefs/ExpectedTestFails.xml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cime_config/testdefs/ExpectedTestFails.xml b/cime_config/testdefs/ExpectedTestFails.xml index af833215ed..8062359f37 100644 --- a/cime_config/testdefs/ExpectedTestFails.xml +++ b/cime_config/testdefs/ExpectedTestFails.xml @@ -32,8 +32,7 @@ FAIL - #2122 - CDEPS/#243 + CDEPS/#243 and/or #2122 From eed612a94af37ee72b8ccff9fde404bc948e5b07 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Tue, 15 Oct 2024 18:21:51 -0600 Subject: [PATCH 131/243] Fix single-point matrix fails --- src/utils/SparseMatrixMultiplyMod.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/SparseMatrixMultiplyMod.F90 b/src/utils/SparseMatrixMultiplyMod.F90 index 5ea9848373..a6eb13bb24 100644 --- a/src/utils/SparseMatrixMultiplyMod.F90 +++ b/src/utils/SparseMatrixMultiplyMod.F90 @@ -1243,7 +1243,7 @@ subroutine SPMP_ABC(this,num_unit,filter_u,A,B,C,list_ready,list_A,list_B,list_C call endrun( subname//" ERROR: missing required optional arguments" ) return end if - SHR_ASSERT_FL((size(filter_actunit_C) > num_actunit_C), sourcefile, __LINE__) + SHR_ASSERT_FL((size(filter_actunit_C) >= num_actunit_C), sourcefile, __LINE__) end if if(.not. list_ready)then From 0a395436a0786168735bb9f5e74495c385ce412d Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Tue, 22 Oct 2024 17:24:06 -0600 Subject: [PATCH 132/243] Two more ASSERT statments changed from > to >= --- src/utils/SparseMatrixMultiplyMod.F90 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils/SparseMatrixMultiplyMod.F90 b/src/utils/SparseMatrixMultiplyMod.F90 index a6eb13bb24..564da21cc2 100644 --- a/src/utils/SparseMatrixMultiplyMod.F90 +++ b/src/utils/SparseMatrixMultiplyMod.F90 @@ -1217,7 +1217,7 @@ subroutine SPMP_ABC(this,num_unit,filter_u,A,B,C,list_ready,list_A,list_B,list_C call endrun( subname//" ERROR: missing required optional arguments" ) return end if - SHR_ASSERT_FL((size(filter_actunit_A) > num_actunit_A), sourcefile, __LINE__) + SHR_ASSERT_FL((size(filter_actunit_A) >= num_actunit_A), sourcefile, __LINE__) end if if(present(num_actunit_B))then if(num_actunit_B < 0)then @@ -1230,7 +1230,7 @@ subroutine SPMP_ABC(this,num_unit,filter_u,A,B,C,list_ready,list_A,list_B,list_C call endrun( subname//" ERROR: missing required optional arguments" ) return end if - SHR_ASSERT_FL((size(filter_actunit_B) > num_actunit_B), sourcefile, __LINE__) + SHR_ASSERT_FL((size(filter_actunit_B) >= num_actunit_B), sourcefile, __LINE__) end if if(present(num_actunit_C))then if(num_actunit_C < 0)then From e5100a4d5949a0676103dc99d393478fc6aaf258 Mon Sep 17 00:00:00 2001 From: Keith Oleson Date: Wed, 23 Oct 2024 08:33:36 -0600 Subject: [PATCH 133/243] New versions of specialized parameter files --- cime_config/testdefs/testmods_dirs/clm/ciso_cwd_hr/user_nl_clm | 2 +- .../clm/clm60_monthly_matrixcn_soilCN30/user_nl_clm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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 3462b802c7..5aa0b903d0 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.c240814.nc' +paramfile = '/glade/campaign/cgd/tss/people/oleson/modify_param/ctsm51_ciso_cwd_hr_params.c241017.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' 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 d51360c82b..c41856fb01 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.c240822.nc' +paramfile = '/glade/campaign/cgd/tss/people/oleson/modify_param/ctsm60_params_cn30.c241017.nc' From 16e634dbbbf9cffdaa4db7cb7891aa148cd99fda Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Wed, 23 Oct 2024 13:10:14 -0600 Subject: [PATCH 134/243] Remove #2780 tests from ExpectedTestFails.xml --- cime_config/testdefs/ExpectedTestFails.xml | 25 +--------------------- 1 file changed, 1 insertion(+), 24 deletions(-) diff --git a/cime_config/testdefs/ExpectedTestFails.xml b/cime_config/testdefs/ExpectedTestFails.xml index 3065205451..390ab03eb3 100644 --- a/cime_config/testdefs/ExpectedTestFails.xml +++ b/cime_config/testdefs/ExpectedTestFails.xml @@ -32,8 +32,7 @@ FAIL - #2122 - CDEPS/#243 + CDEPS/#243 and/or #2122 @@ -60,28 +59,6 @@ - - - FAIL - #2780 - Crashes in the matrix solver. - - - - - FAIL - #2780 - Crashes in the matrix solver. - - - - - FAIL - #2780 - Crashes in the matrix solver. - - - FAIL From 20895d81e690ba32d25918104bda6199181c492d Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Wed, 16 Oct 2024 11:57:39 -0600 Subject: [PATCH 135/243] Update namelist_defaults with PPE's 16-pft f19 fsurdat/landuse files --- bld/namelist_files/namelist_defaults_ctsm.xml | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index ba262d45e1..b72df5db06 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -1841,11 +1841,16 @@ lnd/clm2/surfdata_esmf/ctsm5.3.0/synthetic/surfdata_1x1_urbanc_alpha_synth_hist_ + + +lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_1.9x2.5_hist_1850_16pfts_c240926.nc + + lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_360x720cru_hist_1850_78pfts_c240908.nc lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_0.9x1.25_hist_1850_78pfts_c240908.nc - + lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_1.9x2.5_hist_1850_78pfts_c240908.nc lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_10x15_hist_1850_78pfts_c240908.nc @@ -1914,9 +1919,14 @@ lnd/clm2/surfdata_esmf/NEON/ctsm5.3.0/surfdata_1x1_NEON_TOOL_hist_2000_78pfts_c2 --> + +lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_1.9x2.5_hist_1850-2023_16pfts_c240926.nc + + lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_0.9x1.25_SSP2-4.5_1850-2100_78pfts_c240908.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_1.9x2.5_SSP2-4.5_1850-2100_78pfts_c240908.nc lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_ne0np4.ARCTICGRIS.ne30x8_SSP2-4.5_1979-2026_78pfts_c240908.nc @@ -1926,8 +1936,6 @@ lnd/clm2/surfdata_esmf/NEON/ctsm5.3.0/surfdata_1x1_NEON_TOOL_hist_2000_78pfts_c2 >lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_ne0np4.POLARCAP.ne30x4_SSP2-4.5_1979-2026_78pfts_c240908.nc lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_ne0np4CONUS.ne30x8_SSP2-4.5_1979-2026_78pfts_c240908.nc - - lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_4x5_SSP2-4.5_1850-2100_78pfts_c240908.nc Date: Wed, 16 Oct 2024 12:05:53 -0600 Subject: [PATCH 136/243] Clean-up: Rm deprecated use_vichydro=.true. or .false. options --- bld/namelist_files/namelist_defaults_ctsm.xml | 35 +++++++------------ 1 file changed, 13 insertions(+), 22 deletions(-) diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index b72df5db06..d917508963 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -1766,22 +1766,13 @@ lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_mpasa15_hist_2000_16pfts_c240908.nc - - + lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_0.9x1.25_hist_2000_78pfts_c240908.nc - -lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_0.9x1.25_hist_2000_78pfts_c240908.nc - -lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_1.9x2.5_hist_2000_78pfts_c240908.nc - + lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_1.9x2.5_hist_2000_78pfts_c240908.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_c240908.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_c240908.nc @@ -1848,27 +1839,27 @@ lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_1.9x2.5_hist_1850_16pfts_c240926.nc lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_360x720cru_hist_1850_78pfts_c240908.nc - + lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_0.9x1.25_hist_1850_78pfts_c240908.nc lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_1.9x2.5_hist_1850_78pfts_c240908.nc - + lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_10x15_hist_1850_78pfts_c240908.nc - + lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_4x5_hist_1850_78pfts_c240908.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_c240908.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_c240908.nc - + lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_ne30np4.pg3_hist_1850_78pfts_c240908.nc - + lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_ne3np4.pg3_hist_1850_78pfts_c240908.nc From 992239c8bd3d7322b965ff4179b9ac4a6df38b0a Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Wed, 16 Oct 2024 12:53:35 -0600 Subject: [PATCH 137/243] Add PPE's 16-pft f19 fsurdat/landuse generation to Makefile --- python/ctsm/toolchain/gen_mksurfdata_jobscript_multi.py | 5 +++++ tools/mksurfdata_esmf/Makefile | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/python/ctsm/toolchain/gen_mksurfdata_jobscript_multi.py b/python/ctsm/toolchain/gen_mksurfdata_jobscript_multi.py index 5de67adb12..7b0d5f69b2 100755 --- a/python/ctsm/toolchain/gen_mksurfdata_jobscript_multi.py +++ b/python/ctsm/toolchain/gen_mksurfdata_jobscript_multi.py @@ -23,6 +23,7 @@ "global-present", "global-present-low-res", "global-present-ultra-hi-res", + "global-hist-1850-f19", "crop-tropics-present", "crop", "crop-global-present", @@ -242,6 +243,10 @@ def main(): "--start-year 2000 --end-year 2000 --nocrop --res", "ultra_hi_res_no_crop", ), + "global-hist-1850-f19": ( + "--start-year 1850 --end-year 2023 --nocrop --res", + "f19", + ), "crop-tropics-present": ( "--start-year 2000 --end-year 2000 --res", "5x5_amazon", diff --git a/tools/mksurfdata_esmf/Makefile b/tools/mksurfdata_esmf/Makefile index 7ad8e1aa77..cc02a50cdb 100644 --- a/tools/mksurfdata_esmf/Makefile +++ b/tools/mksurfdata_esmf/Makefile @@ -83,6 +83,7 @@ STANDARD = \ global-potveg \ global-present \ global-present-low-res \ + global-hist-1850-f19 \ CROP = \ crop-global-future \ @@ -153,6 +154,9 @@ global-present-low-res : FORCE $(MKSURFDATA) --number-of-nodes 1 --tasks-per-node 64 --scenario $@ --jobscript-file $@.sh --walltime 01:00:00 $(BATCHJOBS) $@.sh +global-hist-1850-f19 : FORCE + $(MKSURFDATA) --number-of-nodes 8 --scenario $@ --jobscript-file $@.sh --walltime 12:00:00 + $(BATCHJOBS) $@.sh # # Ultra high resolutions (Don't do by default user should select this by hand) # From 28d552efb06a8bb345458e4fcbfbc73692a3fb8d Mon Sep 17 00:00:00 2001 From: Keith Oleson Date: Thu, 24 Oct 2024 09:41:35 -0600 Subject: [PATCH 138/243] Reinstate SMS_Lm1.f10_f10_mg37.I1850Clm60Bgc.derecho_intel.clm-clm60_monthly_matrixcn_soilCN30 --- 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 490748c7e7..b178570add 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -863,6 +863,15 @@ + + + + + + + + + From 89befd3c122067a2272554f1b785889bceeac94f Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Thu, 24 Oct 2024 14:25:37 -0600 Subject: [PATCH 139/243] Revert bae4c64 to change 4 -nofireemis ctsm_sci tests back to -nofire https://github.com/ESCOMP/CTSM/pull/2805/commits/bae4c644df8f966d75cd9d3ede356d308dcbbcfc I made the change to get the tests to pass originally. Turns out issue #2784 will resolve the failures, so this time I added the four tests to ExpecedTestFails.xml --- cime_config/testdefs/ExpectedTestFails.xml | 25 ++++++++++++++++++++++ cime_config/testdefs/testlist_clm.xml | 12 ++++------- 2 files changed, 29 insertions(+), 8 deletions(-) diff --git a/cime_config/testdefs/ExpectedTestFails.xml b/cime_config/testdefs/ExpectedTestFails.xml index 8062359f37..041cb51516 100644 --- a/cime_config/testdefs/ExpectedTestFails.xml +++ b/cime_config/testdefs/ExpectedTestFails.xml @@ -36,6 +36,31 @@ + + + FAIL + #2784 + + + + + FAIL + #2784 + + + + + FAIL + #2784 + + + + + FAIL + #2784 + + + diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index 2e1ae173a1..2bd253ed49 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -2159,45 +2159,41 @@ - + - - + - - + - - + - From b84a9c6e15fd3d5380726efaf56d7d5193f083b0 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Thu, 24 Oct 2024 17:51:21 -0600 Subject: [PATCH 140/243] Update namelist_defaults for 4x5 as I did before for f19 --- bld/namelist_files/namelist_defaults_ctsm.xml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index 505f59c96d..e036fbfcd9 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -1684,9 +1684,11 @@ lnd/clm2/surfdata_esmf/ctsm5.3.0/synthetic/surfdata_1x1_urbanc_alpha_synth_hist_ - + lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_1.9x2.5_hist_1850_16pfts_c240926.nc + +lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_4x5_hist_1850_16pfts_c241007.nc @@ -1697,7 +1699,7 @@ lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_0.9x1.25_hist_1850_78pfts_c240908.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_c240908.nc @@ -1762,9 +1764,11 @@ lnd/clm2/surfdata_esmf/NEON/ctsm5.3.0/surfdata_1x1_NEON_TOOL_hist_2000_78pfts_c2 --> - + lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_1.9x2.5_hist_1850-2023_16pfts_c240926.nc +lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_4x5_hist_1850-2023_16pfts_c241007.nc lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_ne0np4.POLARCAP.ne30x4_SSP2-4.5_1979-2026_78pfts_c240908.nc lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_ne0np4CONUS.ne30x8_SSP2-4.5_1979-2026_78pfts_c240908.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_4x5_SSP2-4.5_1850-2100_78pfts_c240908.nc lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_10x15_SSP2-4.5_1850-2100_78pfts_c240908.nc From 7b92fc45b2b41bbd36a006956d9e7d33f2748047 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Thu, 24 Oct 2024 18:12:04 -0600 Subject: [PATCH 141/243] Add f45 16pft file generation to mksurfdata_esmf's Makefile --- python/ctsm/toolchain/gen_mksurfdata_jobscript_multi.py | 5 +++++ tools/mksurfdata_esmf/Makefile | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/python/ctsm/toolchain/gen_mksurfdata_jobscript_multi.py b/python/ctsm/toolchain/gen_mksurfdata_jobscript_multi.py index 7b0d5f69b2..fdf9466763 100755 --- a/python/ctsm/toolchain/gen_mksurfdata_jobscript_multi.py +++ b/python/ctsm/toolchain/gen_mksurfdata_jobscript_multi.py @@ -24,6 +24,7 @@ "global-present-low-res", "global-present-ultra-hi-res", "global-hist-1850-f19", + "global-hist-1850-f45", "crop-tropics-present", "crop", "crop-global-present", @@ -247,6 +248,10 @@ def main(): "--start-year 1850 --end-year 2023 --nocrop --res", "f19", ), + "global-hist-1850-f45": ( + "--start-year 1850 --end-year 2023 --nocrop --res", + "f45", + ), "crop-tropics-present": ( "--start-year 2000 --end-year 2000 --res", "5x5_amazon", diff --git a/tools/mksurfdata_esmf/Makefile b/tools/mksurfdata_esmf/Makefile index cc02a50cdb..8dee6db596 100644 --- a/tools/mksurfdata_esmf/Makefile +++ b/tools/mksurfdata_esmf/Makefile @@ -79,11 +79,13 @@ SUBSETDATA_1X1_URBALPHA := --lat -37.7308 --lon 0 --site 1x1_urbanc_alpha --o # low-res is for low resolutions for testing # nldas is for NWP working with WRF # STANDARD means no crop, so 16 pfts +# global-hist-1850-f45 is used by FATES and we expect it to be phased out STANDARD = \ global-potveg \ global-present \ global-present-low-res \ global-hist-1850-f19 \ + global-hist-1850-f45 \ CROP = \ crop-global-future \ @@ -157,6 +159,9 @@ global-present-low-res : FORCE global-hist-1850-f19 : FORCE $(MKSURFDATA) --number-of-nodes 8 --scenario $@ --jobscript-file $@.sh --walltime 12:00:00 $(BATCHJOBS) $@.sh +global-hist-1850-f45 : FORCE + $(MKSURFDATA) --number-of-nodes 2 --scenario $@ --jobscript-file $@.sh --walltime 12:00:00 + $(BATCHJOBS) $@.sh # # Ultra high resolutions (Don't do by default user should select this by hand) # From cdbc561c4e28a4cf5ffd259d285e596ffef06911 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Thu, 24 Oct 2024 18:58:56 -0600 Subject: [PATCH 142/243] Add f45 16pft fates test to build-namelist_test.pl --- bld/unit_testers/build-namelist_test.pl | 1 + 1 file changed, 1 insertion(+) diff --git a/bld/unit_testers/build-namelist_test.pl b/bld/unit_testers/build-namelist_test.pl index ca11c18253..2d848b38a5 100755 --- a/bld/unit_testers/build-namelist_test.pl +++ b/bld/unit_testers/build-namelist_test.pl @@ -546,6 +546,7 @@ sub cat_and_create_namelistinfile { "--res 0.9x1.25 --bgc sp --use_case 1850-2100_SSP2-4.5_transient --namelist '&a start_ymd=18501223/'", "-bgc fates -use_case 2000_control -no-megan", "-bgc fates -use_case 20thC_transient -no-megan", + "-bgc fates -use_case 20thC_transient -no-megan -no-crop --res 4x5", "-bgc fates -use_case 1850_control -no-megan -namelist \"&a use_fates_sp=T, soil_decomp_method='None'/\"", "-bgc sp -use_case 2000_control -res 0.9x1.25 -namelist '&a use_soil_moisture_streams = T/'", "--res 1.9x2.5 --bgc bgc --use_case 1850-2100_SSP2-4.5_transient --namelist '&a start_ymd=19101023/'", From bfed0e0f4b55ff6f3191d52bd91ff2a7f1a702e8 Mon Sep 17 00:00:00 2001 From: seleneonowe <106543520+seleneonowe@users.noreply.github.com> Date: Sat, 26 Oct 2024 15:30:12 +0100 Subject: [PATCH 143/243] Fix numbering error in CLM50_Tech_Note_Fluxes.rst A link that should be to an equation for leaf boundary layer resistance was instead pointing to one for canopy air temperature. --- doc/source/tech_note/Fluxes/CLM50_Tech_Note_Fluxes.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/source/tech_note/Fluxes/CLM50_Tech_Note_Fluxes.rst b/doc/source/tech_note/Fluxes/CLM50_Tech_Note_Fluxes.rst index c759d11f92..05b35d8b34 100644 --- a/doc/source/tech_note/Fluxes/CLM50_Tech_Note_Fluxes.rst +++ b/doc/source/tech_note/Fluxes/CLM50_Tech_Note_Fluxes.rst @@ -1213,7 +1213,7 @@ The numerical solution for vegetation temperature and the fluxes of momentum, se #. Magnitude of the wind velocity incident on the leaves :math:`U_{av}` (:eq:`5.117` ) -#. Leaf boundary layer resistance :math:`r_{b}` (:eq:`5.136` ) +#. Leaf boundary layer resistance :math:`r_{b}` (:eq:`5.122` ) #. Aerodynamic resistances :math:`r_{ah} ^{{'} }` and :math:`r_{aw} ^{{'} }`(:eq:`5.116` ) From 157107632490551b79bc5542db5d3d3e47b5a94b Mon Sep 17 00:00:00 2001 From: Keith Oleson Date: Sat, 26 Oct 2024 09:01:55 -0600 Subject: [PATCH 144/243] Move read of jmaxb0,jmaxb1,wc2wjb0 from pftcon to LunaMod and r_mort to CNGapMortality --- src/biogeochem/CNGapMortalityMod.F90 | 38 +++++++++++++++++-- src/biogeophys/LunaMod.F90 | 56 ++++++++++++++++++++++++---- src/main/pftconMod.F90 | 24 ------------ 3 files changed, 84 insertions(+), 34 deletions(-) diff --git a/src/biogeochem/CNGapMortalityMod.F90 b/src/biogeochem/CNGapMortalityMod.F90 index 70709bce8b..73ff0bc911 100644 --- a/src/biogeochem/CNGapMortalityMod.F90 +++ b/src/biogeochem/CNGapMortalityMod.F90 @@ -9,9 +9,11 @@ module CNGapMortalityMod ! ! !USES: use shr_kind_mod , only : r8 => shr_kind_r8 + use shr_infnan_mod , only : nan => shr_infnan_nan, assignment(=) use decompMod , only : bounds_type use abortutils , only : endrun use shr_log_mod , only : errMsg => shr_log_errMsg + use clm_varpar , only : mxpft use pftconMod , only : pftcon use CNDVType , only : dgvs_type use CNVegCarbonStateType , only : cnveg_carbonstate_type, spinup_factor_deadwood @@ -35,6 +37,9 @@ module CNGapMortalityMod type, private :: params_type real(r8):: k_mort ! coeff. of growth efficiency in mortality equation + real(r8), allocatable :: r_mort(:) ! Mortality rate (1/year) + contains + procedure, private :: allocParams ! Allocate the parameters end type params_type ! type(params_type), private :: params_inst @@ -48,6 +53,24 @@ module CNGapMortalityMod contains + !----------------------------------------------------------------------- + subroutine allocParams ( this ) + ! + implicit none + + ! !ARGUMENTS: + class(params_type) :: this + ! + ! !LOCAL VARIABLES: + character(len=32) :: subname = 'allocParams' + !----------------------------------------------------------------------- + + ! allocate parameters + + allocate( this%r_mort (0:mxpft) ) ; this%r_mort(:) = nan + + end subroutine allocParams + !----------------------------------------------------------------------- subroutine readParams ( ncid ) ! @@ -66,6 +89,7 @@ subroutine readParams ( ncid ) character(len=100) :: errCode = '-Error reading in parameters file:' logical :: readv ! has variable been read in or not real(r8) :: tempr ! temporary to read in constant + real(r8) :: temp1d(0:mxpft) ! temporary to read in parameter character(len=100) :: tString ! temp. var for reading !----------------------------------------------------------------------- @@ -73,6 +97,13 @@ subroutine readParams ( ncid ) 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%k_mort=tempr + + call params_inst%allocParams() + + tString='r_mort' + call ncd_io(varname=trim(tString),data=temp1d, flag='read', ncid=ncid, readvar=readv) + if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) + params_inst%r_mort=temp1d end subroutine readParams @@ -134,7 +165,6 @@ subroutine CNGapMortality (bounds, num_soilp, filter_soilp, & leafcn => pftcon%leafcn , & ! Input: [real(r8) (:)] leaf C:N (gC/gN) livewdcn => pftcon%livewdcn , & ! Input: [real(r8) (:)] live wood (phloem and ray parenchyma) C:N (gC/gN) - r_mort => pftcon%r_mort , & ! Input: [real(r8) (:)] Mortality rate (1/year) laisun => canopystate_inst%laisun_patch , & ! Input: [real(r8) (:) ] sunlit projected leaf area index laisha => canopystate_inst%laisha_patch , & ! Input: [real(r8) (:) ] shaded projected leaf area index nind => dgvs_inst%nind_patch , & ! Output:[real(r8)(:)] number of individuals (#/m2) added by F. Li and S. Levis @@ -209,12 +239,14 @@ subroutine CNGapMortality (bounds, num_soilp, filter_soilp, & am = min(1._r8, am + heatstress(p)) else ! lpj didn't set this for grasses; cn does ! set the mortality rate based on annual rate - am = r_mort(ivt(p)) + am = params_inst%r_mort(ivt(p)) end if + else + am = params_inst%r_mort(ivt(p)) end if - m = r_mort(ivt(p))/(get_average_days_per_year() * secspday) + m = am/(get_average_days_per_year() * secspday) !------------------------------------------------------ ! patch-level gap mortality carbon fluxes diff --git a/src/biogeophys/LunaMod.F90 b/src/biogeophys/LunaMod.F90 index 0727e84e7a..5641846309 100644 --- a/src/biogeophys/LunaMod.F90 +++ b/src/biogeophys/LunaMod.F90 @@ -9,10 +9,11 @@ module LunaMod ! !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 clm_varcon , only : rgas, tfrz,spval use abortutils , only : endrun use clm_varctl , only : iulog - use clm_varpar , only : nlevcan + use clm_varpar , only : nlevcan, mxpft use decompMod , only : bounds_type, subgrid_level_patch use pftconMod , only : pftcon use FrictionvelocityMod , only : frictionvel_type @@ -49,6 +50,11 @@ module LunaMod real(r8) :: enzyme_turnover_daily ! The daily turnover rate for photosynthetic enzyme at 25oC in view of ~7 days of half-life time for Rubisco (Suzuki et al. 2001) (unitless) real(r8) :: relhExp ! Specifies the impact of relative humidity on electron transport rate (unitless) real(r8) :: minrelh ! Minimum relative humidity for nitrogen optimization (fraction) + real(r8), allocatable :: jmaxb0(:) ! Baseline proportion of nitrogen allocated for electron transport (J) + real(r8), allocatable :: jmaxb1(:) ! Coefficient determining the response of electron transport rate to light availability (-) + real(r8), allocatable :: wc2wjb0(:) ! The baseline ratio of rubisco limited rate vs light limited photosynthetic rate (Wc:Wj) (-) + contains + procedure, private :: allocParams ! Allocate the parameters end type params_type type(params_type), private :: params_inst @@ -88,11 +94,31 @@ module LunaMod contains + !----------------------------------------------------------------------- + subroutine allocParams ( this ) + ! + implicit none + + ! !ARGUMENTS: + class(params_type) :: this + ! + ! !LOCAL VARIABLES: + character(len=32) :: subname = 'allocParams' + !----------------------------------------------------------------------- + + ! allocate parameters + + allocate( this%jmaxb0 (0:mxpft) ) ; this%jmaxb0(:) = nan + allocate( this%jmaxb1 (0:mxpft) ) ; this%jmaxb1(:) = nan + allocate( this%wc2wjb0 (0:mxpft) ) ; this%wc2wjb0(:) = nan + + end subroutine allocParams + !---------------------------------------------------------------------------- subroutine readParams( ncid ) ! ! !USES: - use ncdio_pio, only: file_desc_t + use ncdio_pio, only: file_desc_t,ncd_io use paramUtilMod, only: readNcdioScalar ! ! !ARGUMENTS: @@ -101,6 +127,10 @@ subroutine readParams( ncid ) ! ! !LOCAL VARIABLES: character(len=*), parameter :: subname = 'readParams_Luna' + character(len=100) :: errCode = '-Error reading in parameters file:' + logical :: readv ! has variable been read in or not + real(r8) :: temp1d(0:mxpft) ! temporary to read in parameter + character(len=100) :: tString ! temp. var for reading !-------------------------------------------------------------------- ! CO2 compensation point at 25°C at present day O2 levels @@ -121,6 +151,21 @@ subroutine readParams( ncid ) ! Minimum relative humidity for nitrogen optimization (fraction) call readNcdioScalar(ncid, 'minrelh', subname, params_inst%minrelh) + call params_inst%allocParams() + + tString = "jmaxb0" + call ncd_io(varname=trim(tString),data=temp1d, flag='read', ncid=ncid, readvar=readv) + if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) + params_inst%jmaxb0=temp1d + tString = "jmaxb1" + call ncd_io(varname=trim(tString),data=temp1d, flag='read', ncid=ncid, readvar=readv) + if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) + params_inst%jmaxb1=temp1d + tString = "wc2wjb0" + call ncd_io(varname=trim(tString),data=temp1d, flag='read', ncid=ncid, readvar=readv) + if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(sourcefile, __LINE__)) + params_inst%wc2wjb0=temp1d + end subroutine readParams !----------------------------------------------------------------------- @@ -247,9 +292,6 @@ subroutine Update_Photosynthesis_Capacity(bounds, fn, filterp, & c3psn => pftcon%c3psn , & ! photosynthetic pathway: 0. = c4, 1. = c3 slatop => pftcon%slatop , & ! specific leaf area at top of canopy, projected area basis [m^2/gC] leafcn => pftcon%leafcn , & ! leaf C:N (gC/gN) - jmaxb0 => pftcon%jmaxb0 , & ! Baseline proportion of nitrogen allocated for electron transport (J) - jmaxb1 => pftcon%jmaxb1 , & ! Coefficient determining the response of electron transport rate to light availability (-) - wc2wjb0 => pftcon%wc2wjb0 , & ! The baseline ratio of rubisco limited rate vs light limited photosynthetic rate (Wc:Wj) (-) forc_pbot10 => atm2lnd_inst%forc_pbot240_downscaled_patch , & ! Input: [real(r8) (:) ] 10 day mean atmospheric pressure(Pa) CO2_p240 => atm2lnd_inst%forc_pco2_240_patch , & ! Input: [real(r8) (:) ] 10-day mean CO2 partial pressure (Pa) O2_p240 => atm2lnd_inst%forc_po2_240_patch , & ! Input: [real(r8) (:) ] 10-day mean O2 partial pressure (Pa) @@ -375,7 +417,8 @@ subroutine Update_Photosynthesis_Capacity(bounds, fn, filterp, & PNcbold = 0.0_r8 call NitrogenAllocation(FNCa,forc_pbot10(p), relh10, CO2a10, O2a10, PARi10, PARimx10, rb10v, hourpd, & tair10, tleafd10, tleafn10, & - jmaxb0(ft), jmaxb1(ft), wc2wjb0(ft), PNlcold, PNetold, PNrespold, PNcbold, dayl_factor(p), & + params_inst%jmaxb0(ft), params_inst%jmaxb1(ft), params_inst%wc2wjb0(ft), PNlcold, PNetold, & + PNrespold, PNcbold, dayl_factor(p), & o3coefjmax(p), PNstoreopt, PNlcopt, PNetopt, PNrespopt, PNcbopt) vcmx25_opt= PNcbopt * FNCa * Fc25 jmx25_opt= PNetopt * FNCa * Fj25 @@ -1362,7 +1405,6 @@ subroutine Quadratic(a,b,c,r1,r2) end if end subroutine Quadratic - end module LunaMod diff --git a/src/main/pftconMod.F90 b/src/main/pftconMod.F90 index 965b21ec70..b987879c03 100644 --- a/src/main/pftconMod.F90 +++ b/src/main/pftconMod.F90 @@ -164,10 +164,6 @@ module pftconMod 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 - real(r8), allocatable :: jmaxb0(:) ! Baseline proportion of nitrogen allocated for electron transport (J) - real(r8), allocatable :: jmaxb1(:) ! Coefficient determining the response of electron transport rate to light availability (-) - real(r8), allocatable :: wc2wjb0(:) ! The baseline ratio of rubisco limited rate vs light limited photosynthetic rate (Wc:Wj) (-) - real(r8), allocatable :: r_mort(:) ! Mortality rate (1/year) ! crop @@ -510,10 +506,6 @@ subroutine InitAllocate (this) allocate( this%wood_density (0:mxpft) ) allocate( this%crit_onset_gdd_sf (0:mxpft) ) allocate( this%ndays_on (0:mxpft) ) - allocate( this%jmaxb0 (0:mxpft) ) - allocate( this%jmaxb1 (0:mxpft) ) - allocate( this%wc2wjb0 (0:mxpft) ) - allocate( this%r_mort (0:mxpft) ) end subroutine InitAllocate @@ -1025,18 +1017,6 @@ subroutine InitRead(this) call ncd_io('medlynintercept', this%medlynintercept, 'read', ncid, readvar=readv) if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - call ncd_io('jmaxb0', this%jmaxb0, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - - call ncd_io('jmaxb1', this%jmaxb1, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - - call ncd_io('wc2wjb0', this%wc2wjb0, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - - call ncd_io('r_mort', this%r_mort, 'read', ncid, readvar=readv) - if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) - call ncd_io('mxmat', this%mxmat, 'read', ncid, readvar=readv) if ( .not. readv ) call endrun(msg=' ERROR: error in reading in pft data'//errMsg(sourcefile, __LINE__)) @@ -1616,10 +1596,6 @@ subroutine Clean(this) deallocate( this%taper) deallocate( this%crit_onset_gdd_sf) deallocate( this%ndays_on) - deallocate( this%jmaxb0) - deallocate( this%jmaxb1) - deallocate( this%wc2wjb0) - deallocate( this%r_mort) end subroutine Clean end module pftconMod From 0fd1a04d9a59c8e92d516cb0bbb992cba602589e Mon Sep 17 00:00:00 2001 From: Keith Oleson Date: Sun, 27 Oct 2024 14:15:24 -0600 Subject: [PATCH 145/243] Final paths for parameter files --- bld/namelist_files/namelist_defaults_ctsm.xml | 8 ++++---- .../testdefs/testmods_dirs/clm/ciso_cwd_hr/user_nl_clm | 2 +- .../clm/clm60_monthly_matrixcn_soilCN30/user_nl_clm | 2 +- 3 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 c93c4f5696..54d3afd5c1 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -544,10 +544,10 @@ attributes from the config_cache.xml file (with keys converted to upper-case). -/glade/campaign/cgd/tss/people/oleson/modify_param/ctsm60_params.c241017.nc -/glade/campaign/cgd/tss/people/oleson/modify_param/ctsm51_params.c241017.nc -/glade/campaign/cgd/tss/people/oleson/modify_param/clm50_params.c241017.nc -/glade/campaign/cgd/tss/people/oleson/modify_param/clm45_params.c241017.nc +lnd/clm2/paramdata/ctsm60_params.c241017.nc +lnd/clm2/paramdata/ctsm51_params.c241017.nc +lnd/clm2/paramdata/clm50_params.c241017.nc +lnd/clm2/paramdata/clm45_params.c241017.nc 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 5aa0b903d0..edeb0fce21 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 = '/glade/campaign/cgd/tss/people/oleson/modify_param/ctsm51_ciso_cwd_hr_params.c241017.nc' +paramfile = '$DIN_LOC_ROOT/lnd/clm2/paramdata/ctsm51_ciso_cwd_hr_params.c241017.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' 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 c41856fb01..b1d856797d 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 = '/glade/campaign/cgd/tss/people/oleson/modify_param/ctsm60_params_cn30.c241017.nc' +paramfile = '$DIN_LOC_ROOT/lnd/clm2/paramdata/ctsm60_params_cn30.c241017.nc' From cde3b247886e43900dc770ecf0eb402ffe82cbba Mon Sep 17 00:00:00 2001 From: adamrher Date: Tue, 20 Aug 2024 15:25:28 -0600 Subject: [PATCH 146/243] added polarcap support for cesm3 release --- bld/namelist_files/namelist_defaults_ctsm.xml | 60 +++++++++++++++++++ 1 file changed, 60 insertions(+) diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index e036fbfcd9..4440ea5a48 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -721,6 +721,8 @@ attributes from the config_cache.xml file (with keys converted to upper-case). maxpft="17" use_cn=".false." use_crop=".false." hgrid="ne0np4.ARCTIC.ne30x4" >.true. .true. +.true. .true. @@ -742,6 +744,11 @@ attributes from the config_cache.xml file (with keys converted to upper-case). maxpft="17" use_cn=".false." use_crop=".false." hgrid="ne0np4.ARCTIC.ne30x4" >.true. .true. +.true. + +.true. .true. .true. +.true. .true. @@ -775,6 +784,11 @@ attributes from the config_cache.xml file (with keys converted to upper-case). maxpft="17" use_cn=".false." use_crop=".false." hgrid="ne0np4.ARCTIC.ne30x4" >.true. .true. +.true. + +.true. 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=ne0np4.POLARCAP.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. use_excess_ice=.false. +hgrid=ne0np4.POLARCAP.ne30x4 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. @@ -1395,6 +1423,14 @@ attributes from the config_cache.xml file (with keys converted to upper-case). >lnd/clm2/initdata_map/clmi.FHISTSp.1979-01-01.ARCTICGRIS_ne30x8_mt12_simyr1979_c200806.nc + +lnd/clm2/initdata_map/clmi.F2000.2000-01-01.ne120pg3_mt13_simyr2000_c200728.nc + + lnd/clm2/initdata_map/clmi.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.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.FHISTSp.1979-01-01.ARCTICGRIS_ne30x8_mt12_simyr1979_c200806.nc + +lnd/clm2/initdata_map/clmi.F2000.2000-01-01.ne120pg3_mt13_simyr2000_c200728.nc + + Date: Mon, 28 Oct 2024 16:32:49 -0600 Subject: [PATCH 147/243] Remove clm50 physics support for the POLARCAP grid --- bld/namelist_files/namelist_defaults_ctsm.xml | 30 ------------------- 1 file changed, 30 deletions(-) diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index 8665bbafc0..70f5f952f0 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -721,8 +721,6 @@ attributes from the config_cache.xml file (with keys converted to upper-case). maxpft="17" use_cn=".false." use_crop=".false." hgrid="ne0np4.ARCTIC.ne30x4" >.true. .true. -.true. .true. @@ -766,8 +764,6 @@ attributes from the config_cache.xml file (with keys converted to upper-case). maxpft="17" use_cn=".false." use_crop=".false." hgrid="ne0np4.ARCTIC.ne30x4" >.true. .true. -.true. .true. @@ -1038,11 +1034,6 @@ attributes from the config_cache.xml file (with keys converted to upper-case). >hgrid=ne0np4.POLARCAP.ne30x4 maxpft=17 mask=tx0.1v2 use_cn=.false. use_crop=.false. irrigate=.true. glc_nec=10 do_transient_pfts=.false. -hgrid=ne0np4.POLARCAP.ne30x4 maxpft=17 mask=tx0.1v2 use_cn=.false. use_crop=.false. irrigate=.true. glc_nec=10 do_transient_pfts=.false. - - hgrid=ne0np4.POLARCAP.ne30x4 maxpft=17 mask=tx0.1v2 use_cn=.false. use_crop=.false. irrigate=.true. glc_nec=10 do_transient_pfts=.false. -hgrid=ne0np4.POLARCAP.ne30x4 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.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.FHISTSp.1979-01-01.ARCTICGRIS_ne30x8_mt12_simyr1979_c200806.nc - -lnd/clm2/initdata_map/clmi.F2000.2000-01-01.ne120pg3_mt13_simyr2000_c200728.nc - - Date: Mon, 28 Oct 2024 17:38:32 -0600 Subject: [PATCH 148/243] Rm clm50 test from build-namelist_test; correct syntax error in xml file --- bld/namelist_files/namelist_defaults_ctsm.xml | 5 ++-- bld/unit_testers/build-namelist_test.pl | 26 ++++++++++++++++++- 2 files changed, 28 insertions(+), 3 deletions(-) diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index 70f5f952f0..85fcc20c7e 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -743,7 +743,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). .true. .true. + maxpft="17" use_cn=".false." use_crop=".false." hgrid="ne0np4.POLARCAP.ne30x4">.true. .true. @@ -781,7 +781,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case). .true. .true. + maxpft="17" use_cn=".false." use_crop=".false." hgrid="ne0np4.POLARCAP.ne30x4">.true. .true. @@ -1200,6 +1200,7 @@ 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. use_excess_ice=.false. + hgrid=ne0np4.POLARCAP.ne30x4 maxpft=17 mask=tx0.1v2 use_cn=.false. use_crop=.false. irrigate=.true. glc_nec=10 do_transient_pfts=.false. diff --git a/bld/unit_testers/build-namelist_test.pl b/bld/unit_testers/build-namelist_test.pl index 2d848b38a5..d5f6cd47c8 100755 --- a/bld/unit_testers/build-namelist_test.pl +++ b/bld/unit_testers/build-namelist_test.pl @@ -506,6 +506,31 @@ sub cat_and_create_namelistinfile { } } print "\n===============================================================================\n"; +print "Test setting drv_flds_in fields in CAM, clm60 only"; +print "=================================================================================\n"; +foreach my $phys ( "clm6_0" ) { + $mode = "-phys $phys CAM_SETS_DRV_FLDS"; + &make_config_cache($phys); + foreach my $options ( + "--res ne0np4.POLARCAP.ne30x4 --mask tx0.1v2 -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 " ); }; + 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 setting drv_flds_in fields in CAM"; print "=================================================================================\n"; foreach my $phys ( "clm5_0", "clm6_0" ) { @@ -515,7 +540,6 @@ sub cat_and_create_namelistinfile { "--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", "--res 1.9x2.5 --mask gx1v7 --bgc sp -no-crop --use_case 20thC_transient --namelist '&a start_ymd=19790101/' --lnd_tuning_mode ${phys}_cam7.0 --infile empty_user_nl_clm", - "--res ne0np4.POLARCAP.ne30x4 --mask tx0.1v2 -bgc sp -use_case 20thC_transient -namelist '&a start_ymd=19790101/' -lnd_tuning_mode ${phys}_cam7.0 --infile empty_user_nl_clm", "--res ne0np4.ARCTIC.ne30x4 --mask tx0.1v2 -bgc sp -use_case 20thC_transient -namelist '&a start_ymd=19790101/' -lnd_tuning_mode ${phys}_cam7.0 --infile empty_user_nl_clm", "--res ne0np4.ARCTICGRIS.ne30x8 --mask tx0.1v2 -bgc sp -use_case 20thC_transient -namelist '&a start_ymd=19790101/' -lnd_tuning_mode ${phys}_cam7.0 --infile empty_user_nl_clm", "--res ne0np4CONUS.ne30x8 --mask tx0.1v2 -bgc sp -use_case 20thC_transient -namelist '&a start_ymd=20130101/' -lnd_tuning_mode ${phys}_cam7.0 --infile empty_user_nl_clm", From a7ef2e5dd277324d149a99829049ca0213f5c08b Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Mon, 28 Oct 2024 17:43:15 -0600 Subject: [PATCH 149/243] Rm clm50 test from ctsm_sci test-suite --- cime_config/testdefs/testlist_clm.xml | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index 2bd253ed49..4c13e821b3 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -2065,24 +2065,13 @@ - - - - - - - - - - - - + From ebf5f26df700f378522b020b4b3bf31ea008eb78 Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Tue, 29 Oct 2024 10:49:17 -0700 Subject: [PATCH 150/243] exclude fates element error from ST3 testdefs This addresses #2580 --- cime_config/testdefs/testmods_dirs/clm/FatesColdST3/user_nl_clm | 1 + 1 file changed, 1 insertion(+) diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesColdST3/user_nl_clm b/cime_config/testdefs/testmods_dirs/clm/FatesColdST3/user_nl_clm index eca76c4b9c..860656e8d8 100644 --- a/cime_config/testdefs/testmods_dirs/clm/FatesColdST3/user_nl_clm +++ b/cime_config/testdefs/testmods_dirs/clm/FatesColdST3/user_nl_clm @@ -1 +1,2 @@ use_fates_ed_st3= .true. +hist_fexcl1 = 'FATES_ERROR_EL' From 237b11439ddf19080e3680c1762d01bcd274d937 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Tue, 29 Oct 2024 15:07:43 -0600 Subject: [PATCH 151/243] Correction to failure phase for four tests in ExpectedTestFails --- cime_config/testdefs/ExpectedTestFails.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cime_config/testdefs/ExpectedTestFails.xml b/cime_config/testdefs/ExpectedTestFails.xml index 041cb51516..2945d4fbac 100644 --- a/cime_config/testdefs/ExpectedTestFails.xml +++ b/cime_config/testdefs/ExpectedTestFails.xml @@ -37,25 +37,25 @@ - + FAIL #2784 - + FAIL #2784 - + FAIL #2784 - + FAIL #2784 From 127fa7b37376499e97852bd906c7cfe580cf09cf Mon Sep 17 00:00:00 2001 From: adrifoster Date: Tue, 29 Oct 2024 15:19:15 -0600 Subject: [PATCH 152/243] update nfsc name --- src/fates | 2 +- src/main/histFileMod.F90 | 10 +++++----- src/utils/clmfates_interfaceMod.F90 | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/fates b/src/fates index 825579d0b4..b4367834ab 160000 --- a/src/fates +++ b/src/fates @@ -1 +1 @@ -Subproject commit 825579d0b406fe99344591b5ed8356e5c7aeebec +Subproject commit b4367834abf505eb4e5f53af9bc7e4b83af4685c diff --git a/src/main/histFileMod.F90 b/src/main/histFileMod.F90 index 69dcbe3b8e..4d1f514cb0 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 FatesFuelClassesMod , only : nfsc + use FatesFuelClassesMod , only : num_fuel_classes use FatesLitterMod , only : ncwd use PRTGenericMod , only : num_elements_fates => num_elements use FatesInterfaceTypesMod , only : numpft_fates => numpft @@ -2504,7 +2504,7 @@ subroutine htape_create (t, histrest) call ncd_defdim(lnfid, 'fates_levpft', numpft_fates, dimid) call ncd_defdim(lnfid, 'fates_levage', nlevage, dimid) call ncd_defdim(lnfid, 'fates_levheight', nlevheight, dimid) - call ncd_defdim(lnfid, 'fates_levfuel', nfsc, dimid) + call ncd_defdim(lnfid, 'fates_levfuel', num_fuel_classes, dimid) call ncd_defdim(lnfid, 'fates_levcwdsc', ncwd, dimid) call ncd_defdim(lnfid, 'fates_levscpf', nlevsclass*numpft_fates, dimid) call ncd_defdim(lnfid, 'fates_levcapf', nlevcoage*numpft_fates, dimid) @@ -2519,7 +2519,7 @@ subroutine htape_create (t, histrest) call ncd_defdim(lnfid, 'fates_levelpft', num_elements_fates * numpft_fates, dimid) call ncd_defdim(lnfid, 'fates_levelcwd', num_elements_fates * ncwd, dimid) call ncd_defdim(lnfid, 'fates_levelage', num_elements_fates * nlevage, dimid) - call ncd_defdim(lnfid, 'fates_levagefuel', nlevage * nfsc, dimid) + call ncd_defdim(lnfid, 'fates_levagefuel', nlevage * num_fuel_classes, dimid) call ncd_defdim(lnfid, 'fates_levclscpf', nclmax*nlevsclass*numpft_fates, dimid) call ncd_defdim(lnfid, 'fates_levlanduse', n_landuse_cats, dimid) call ncd_defdim(lnfid, 'fates_levlulu', n_landuse_cats * n_landuse_cats, dimid) @@ -5595,7 +5595,7 @@ subroutine hist_addfld2d (fname, type2d, units, avgflag, long_name, type1d_out, case ('fates_levheight') num2d = nlevheight case ('fates_levfuel') - num2d = nfsc + num2d = num_fuel_classes case ('fates_levcwdsc') num2d = ncwd case ('fates_levscpf') @@ -5635,7 +5635,7 @@ subroutine hist_addfld2d (fname, type2d, units, avgflag, long_name, type1d_out, case ('fates_levelage') num2d = num_elements_fates*nlevage case ('fates_levagefuel') - num2d = nlevage*nfsc + num2d = nlevage*num_fuel_classes case('fates_levclscpf') num2d = nclmax * nclmax * numpft_fates case ('fates_levlanduse') diff --git a/src/utils/clmfates_interfaceMod.F90 b/src/utils/clmfates_interfaceMod.F90 index 10fabeed23..269189d1b7 100644 --- a/src/utils/clmfates_interfaceMod.F90 +++ b/src/utils/clmfates_interfaceMod.F90 @@ -3622,7 +3622,7 @@ subroutine hlm_bounds_to_fates_bounds(hlm, fates) use FatesInterfaceTypesMod, only : nlevsclass, nlevage, nlevcoage use FatesInterfaceTypesMod, only : nlevheight use FatesInterfaceTypesMod, only : nlevdamage - use FatesFuelClassesMod, only : nfsc + use FatesFuelClassesMod, only : num_fuel_classes use FatesLitterMod, only : ncwd use EDParamsMod, only : nlevleaf, nclmax use FatesInterfaceTypesMod, only : numpft_fates => numpft @@ -3674,7 +3674,7 @@ subroutine hlm_bounds_to_fates_bounds(hlm, fates) fates%sizeagepft_class_end = nlevsclass * nlevage * numpft_fates fates%fuel_begin = 1 - fates%fuel_end = nfsc + fates%fuel_end = num_fuel_classes fates%cwdsc_begin = 1 fates%cwdsc_end = ncwd @@ -3701,7 +3701,7 @@ subroutine hlm_bounds_to_fates_bounds(hlm, fates) fates%elage_end = num_elements * nlevage fates%agefuel_begin = 1 - fates%agefuel_end = nlevage * nfsc + fates%agefuel_end = nlevage * num_fuel_classes fates%cdpf_begin = 1 fates%cdpf_end = nlevdamage * numpft_fates * nlevsclass From db72132852dbf6bad936ac3f3545d3847630a46a Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Tue, 29 Oct 2024 15:56:05 -0600 Subject: [PATCH 153/243] Putting back code lost in updates, used in #2805 for tests to pass --- bld/namelist_files/namelist_defaults_ctsm.xml | 41 ------------------- 1 file changed, 41 deletions(-) diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index 85fcc20c7e..e036fbfcd9 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -742,11 +742,6 @@ attributes from the config_cache.xml file (with keys converted to upper-case). maxpft="17" use_cn=".false." use_crop=".false." hgrid="ne0np4.ARCTIC.ne30x4" >.true. .true. -.true. - -.true. .true. .true. -.true. - -.true. 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=ne0np4.POLARCAP.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. use_excess_ice=.false. -hgrid=ne0np4.POLARCAP.ne30x4 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. - 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.FHISTSp.1979-01-01.ARCTICGRIS_ne30x8_mt12_simyr1979_c200806.nc - -lnd/clm2/initdata_map/clmi.F2000.2000-01-01.ne120pg3_mt13_simyr2000_c200728.nc - - Date: Tue, 29 Oct 2024 18:29:17 -0600 Subject: [PATCH 154/243] Remove/replace refs to DATM_C*_YR_* variables --- ...tmospheric-forcing-to-spinup-the-model.rst | 4 +-- .../customizing-the-clm-configuration.rst | 34 ++++++------------- src/main/clm_varctl.F90 | 2 +- tools/contrib/run_clm_historical | 12 +++---- tools/contrib/run_clmtowers | 14 ++++---- 5 files changed, 27 insertions(+), 39 deletions(-) diff --git a/doc/source/users_guide/running-special-cases/Running-with-MOAR-data-as-atmospheric-forcing-to-spinup-the-model.rst b/doc/source/users_guide/running-special-cases/Running-with-MOAR-data-as-atmospheric-forcing-to-spinup-the-model.rst index 769755937d..a81465c699 100644 --- a/doc/source/users_guide/running-special-cases/Running-with-MOAR-data-as-atmospheric-forcing-to-spinup-the-model.rst +++ b/doc/source/users_guide/running-special-cases/Running-with-MOAR-data-as-atmospheric-forcing-to-spinup-the-model.rst @@ -10,7 +10,7 @@ Because it takes so long to spinup the CN model (as we just saw previously), if In this example we will use the ``I1850Clm50BgcSpinup compset`` to setup CLM to run with atmospheric forcing from a previous fully coupled simulation with data that is already stored on disk on Cheyenne. There are several simulations that have high frequency data for which we can do this. You can also do this on a machine other than Cheyenne, but would need to download the data from the Earth System Grid and change the datapath similar to Example :numref:`eg-sim-data-from-prev-sim`. -Example: Simulation with MOAR Data on cheyenne +Example: Simulation with MOAR Data on derecho ------------------------------------------------------------- :: @@ -21,7 +21,7 @@ Example: Simulation with MOAR Data on cheyenne > ./xmlchange DATM_CPL_CASE=b40.1850.track1.1deg.006a # The following sets the align year and years to run over for atm forcing # (you could also use an editor) - > ./xmlchange DATM_CPL_YR_ALIGN=1,DATM_CPL_YR_START=960,DATM_CPL_YR_END=1030 + > ./xmlchange DATM_YR_ALIGN=1,DATM_YR_START=960,DATM_YR_END=1030 > ./case.setup # Now build and run as normal > ./case.build 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 7cd8ce9c9c..11e996ae5d 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 @@ -510,13 +510,10 @@ For running "I" cases there are several other noteworthy configuration items tha CCSM_BGC DATM_MODE DATM_PRESAERO - DATM_CLMNCEP_YR_ALIGN - DATM_CLMNCEP_YR_START - DATM_CLMNCEP_YR_END + DATM_YR_ALIGN + DATM_YR_START + DATM_YR_END DATM_CPL_CASE - DATM_CPL_YR_ALIGN - DATM_CPL_YR_START - DATM_CPL_YR_END ``CCSM_CO2_PPMV`` Sets the mixing ratio of CO2 in parts per million by volume for ALL CESM components to use. Note that most compsets already set this value to something reasonable. Also note that some compsets may tell the atmosphere model to override this value with either historic or ramped values. If the ``CCSM_BGC`` variable is set to something other than "none" the atmosphere model will determine CO2, and CLM will listen and use what the atmosphere sends it. On the CLM side the namelist item ``co2_type`` tells CLM to use the value sent from the atmosphere rather than a value set on it's own namelist. @@ -569,36 +566,27 @@ For running "I" cases there are several other noteworthy configuration items tha ``pt1_pt1`` = read in single-point or regional datasets -DATM_CLMNCEP_YR_START - ``DATM_CLMNCEP_YR_START`` sets the beginning year to cycle the atmospheric data over for ``CLM_QIAN`` or ``CLMCRUNCEP`` modes. +DATM_YR_START + ``DATM_YR_START`` sets the beginning year to cycle the atmospheric data over for ``CLM_QIAN`` or ``CLMCRUNCEP`` or ``CPLHISTForcing`` modes. -DATM_CLMNCEP_YR_END - ``DATM_CLMNCEP_YR_END`` sets the ending year to cycle the atmospheric data over for ``CLM_QIAN`` or ``CLMCRUNCEP`` modes. +DATM_YR_END + ``DATM_YR_END`` sets the ending year to cycle the atmospheric data over for ``CLM_QIAN`` or ``CLMCRUNCEP`` or ``CPLHISTForcing`` modes. -DATM_CLMNCEP_YR_ALIGN - ``DATM_CLMNCEP_YR_START`` and ``DATM_CLMNCEP_YR_END`` determine the range of years to cycle the atmospheric data over, and ``DATM_CLMNCEP_YR_ALIGN`` determines which year in that range of years the simulation will start with. +DATM_YR_ALIGN + ``DATM_YR_START`` and ``DATM_YR_END`` determine the range of years to cycle the atmospheric data over, and ``DATM_YR_ALIGN`` determines which year in that range of years the simulation will start with. DATM_CPL_CASE ``DATM_CPL_CASE`` sets the casename to use for the ``CPLHISTForcing`` mode. -DATM_CPL_YR_START - ``DATM_CPL_YR_START`` sets the beginning year to cycle the atmospheric data over for the ``CPLHISTForcing`` mode. - -DATM_CPL_YR_END - ``DATM_CPL_YR_END`` sets the ending year to cycle the atmospheric data over for the ``CPLHISTForcing`` mode. - -DATM_CPL_YR_ALIGN - ``DATM_CPL_YR_START`` and ``DATM_CPL_YR_END`` determine the range of years to cycle the atmospheric data over, and ``DATM_CPL_YR_ALIGN`` determines which year in that range of years the simulation will start with. - ----------------------------- Downloading DATM Forcing Data ----------------------------- In Chapter One of the `CESM User's Guide `_ there is a section on "Downloading input data". The normal process of setting up cases will use the "scripts/ccsm_utils/Tools/check_input_data" script to retrieve data from the CESM subversion inputdata repository. This is true for the standard `CLM_QIAN` forcing as well. -The `CLMCRUNCEP` data is uploaded into the subversion inputdata repository as well -- but as it is 1.1 Terabytes of data downloading it is problematic (*IT WILL TAKE SEVERAL DAYS TO DOWNLOAD THE ENTIRE DATASET USING SUBVERSION*). Because of its size you may also need to download it onto a separate disk space. We have done that on cheyenne for example where it resides in ``$ENV{CESMROOT}/lmwg`` while the rest of the input data resides in ``$ENV{CESMDATAROOT}/inputdata``. The data is also already available on: janus, franklin, and hopper. If you download the data, we recommend that you break your download into several chunks, by setting up a case and setting the year range for ``DATM_CPL_YR_START`` and ``DATM_CPL_YR_END`` in say 20 year sections over 1901 to 2010, and then use ``check_input_data`` to export the data. +The `CLMCRUNCEP` data is uploaded into the subversion inputdata repository as well -- but as it is 1.1 Terabytes of data downloading it is problematic (*IT WILL TAKE SEVERAL DAYS TO DOWNLOAD THE ENTIRE DATASET USING SUBVERSION*). Because of its size you may also need to download it onto a separate disk space. We have done that on derecho for example where it resides in ``$ENV{CESMROOT}/lmwg`` while the rest of the input data resides in ``$ENV{CESMDATAROOT}/inputdata``. The data is also already available on: janus, franklin, and hopper. If you download the data, we recommend that you break your download into several chunks, by setting up a case and setting the year range for ``DATM_YR_START`` and ``DATM_YR_END`` in say 20 year sections over 1901 to 2010, and then use ``check_input_data`` to export the data. -The ``CPLHISTForcing`` DATM forcing data is unique -- because it is large compared to the rest of the input data, and we only have a disk copy on cheyenne. The DATM assumes the path for the previous NCAR machine cheyenne of ``/glade/p/cesm/shared_outputdata/cases/ccsm4/$DATM_CPLHIST_CASE`` for the data. So you will need to change this path in order to run on any other machine. You can download the data itself from NCAR HPSS from ``/CCSM/csm/$DATM_CPLHIST_CASE``. +The ``CPLHISTForcing`` DATM forcing data is unique -- because it is large compared to the rest of the input data, and we only have a disk copy on derecho. The DATM assumes the path for derecho of ``/glade/p/cesm/shared_outputdata/cases/ccsm4/$DATM_CPLHIST_CASE`` for the data. So you will need to change this path in order to run on any other machine. You can download the data itself from NCAR HPSS from ``/CCSM/csm/$DATM_CPLHIST_CASE``. -------------------------------------- Customizing via the build script files diff --git a/src/main/clm_varctl.F90 b/src/main/clm_varctl.F90 index 5fa2602e5a..9539060200 100644 --- a/src/main/clm_varctl.F90 +++ b/src/main/clm_varctl.F90 @@ -289,7 +289,7 @@ module clm_varctl 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_forcing = 10 ! length of forcing years for the spin up. eg. if DATM_YR_START=1901;DATM_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. ! nyr_SASU=1: the fastest SASU, but inaccurate; nyr_SASU=nyr_forcing(eg. 20): the lowest SASU but accurate integer, public :: iloop_avg = -999 ! The restart file will be based on the average of all analytic solutions within the iloop_avg^th loop. diff --git a/tools/contrib/run_clm_historical b/tools/contrib/run_clm_historical index cd293d5867..8dc9269d3b 100755 --- a/tools/contrib/run_clm_historical +++ b/tools/contrib/run_clm_historical @@ -76,9 +76,9 @@ cp original_user_nl_clm user_nl_clm ./xmlchange STOP_N=21 ./xmlchange CONTINUE_RUN=FALSE ./xmlchange RESUBMIT=0 -./xmlchange DATM_CLMNCEP_YR_ALIGN=1901 -./xmlchange DATM_CLMNCEP_YR_START=1901 -./xmlchange DATM_CLMNCEP_YR_END=1920 +./xmlchange DATM_YR_ALIGN=1901 +./xmlchange DATM_YR_START=1901 +./xmlchange DATM_YR_END=1920 # need to use user_nl_datm files to get years right cp user_nl_datm1901-1920 user_nl_datm @@ -203,9 +203,9 @@ gzip $DDIR$CASENAME*.bin # we have to resubmit the job 3 times. ./xmlchange STOP_OPTION=nyears ./xmlchange STOP_N=22 -./xmlchange DATM_CLMNCEP_YR_ALIGN=1901 -./xmlchange DATM_CLMNCEP_YR_START=1901 -./xmlchange DATM_CLMNCEP_YR_END=2014 +./xmlchange DATM_YR_ALIGN=1901 +./xmlchange DATM_YR_START=1901 +./xmlchange DATM_YR_END=2014 ./xmlchange CONTINUE_RUN=TRUE ./xmlchange RESUBMIT=3 diff --git a/tools/contrib/run_clmtowers b/tools/contrib/run_clmtowers index e4dd2519ff..7e9dbbc426 100755 --- a/tools/contrib/run_clmtowers +++ b/tools/contrib/run_clmtowers @@ -211,9 +211,9 @@ foreach mysite ( $sites ) ./xmlchange --id STOP_OPTION --val nyears ./xmlchange --id STOP_N --val $numyears ./xmlchange --id RUN_STARTDATE --val $startyear[$cnt]-01-01 - ./xmlchange --id DATM_CLMNCEP_YR_ALIGN --val $startyear[$cnt] - ./xmlchange --id DATM_CLMNCEP_YR_START --val $startyear[$cnt] - ./xmlchange --id DATM_CLMNCEP_YR_END --val $endyear[$cnt] + ./xmlchange --id DATM_YR_ALIGN --val $startyear[$cnt] + ./xmlchange --id DATM_YR_START --val $startyear[$cnt] + ./xmlchange --id DATM_YR_END --val $endyear[$cnt] ./xmlchange --id CALENDAR --val GREGORIAN if ($BGC == ON) then ./xmlchange --id CLM_BLDNML_OPTS --val "-mask navy -bgc bgc -crop" @@ -240,9 +240,9 @@ foreach mysite ( $sites ) else ./xmlchange --id RUN_STARTDATE --val $startyear[$cnt]-01-01 endif - ./xmlchange --id DATM_CLMNCEP_YR_ALIGN --val $alignyear - ./xmlchange --id DATM_CLMNCEP_YR_START --val $startyears - ./xmlchange --id DATM_CLMNCEP_YR_END --val $endyears + ./xmlchange --id DATM_YR_ALIGN --val $alignyear + ./xmlchange --id DATM_YR_START --val $startyears + ./xmlchange --id DATM_YR_END --val $endyears if ($alignyear == 1) then ./xmlchange --id CALENDAR --val NO_LEAP endif @@ -263,7 +263,7 @@ foreach mysite ( $sites ) ./preview_namelists # Have to force this for some reason if ($SPINUP_P1 == FALSE) then - ./xmlchange --id DATM_CLMNCEP_YR_END --val $endyear[$cnt] + ./xmlchange --id DATM_YR_END --val $endyear[$cnt] ./preview_namelists endif if ( $status != 0 )then From f2a8ce051099244efd3cbd38279865ea04f1d61f Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Tue, 29 Oct 2024 18:46:45 -0600 Subject: [PATCH 155/243] Remove some more DATM_C..._YR_... --- cime_config/buildnml | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/cime_config/buildnml b/cime_config/buildnml index e9b7a610cd..e06b9388c7 100644 --- a/cime_config/buildnml +++ b/cime_config/buildnml @@ -52,16 +52,8 @@ 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") - else: - 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") + yr_start = case.get_value("DATM_YR_START") + yr_end = case.get_value("DATM_YR_END") # For LILAC if yr_start == None or lilac_mode == "on": From c697c76a5bec4837075f82eacef45ef36b7eeab0 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Tue, 29 Oct 2024 18:51:47 -0600 Subject: [PATCH 156/243] Remove additional DATM_C..._YR_... --- .../running-special-cases/Running-with-anomaly-forcing.rst | 2 +- ...us-simulation-as-atmospheric-forcing-to-spinup-the-model.rst | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/source/users_guide/running-special-cases/Running-with-anomaly-forcing.rst b/doc/source/users_guide/running-special-cases/Running-with-anomaly-forcing.rst index 0c6009f3fe..2efa65893d 100644 --- a/doc/source/users_guide/running-special-cases/Running-with-anomaly-forcing.rst +++ b/doc/source/users_guide/running-special-cases/Running-with-anomaly-forcing.rst @@ -42,4 +42,4 @@ For single point simulations, the global anomaly forcing files can be used, but mapalgo = 'nn','nn','nn','nn','nn','nn','nn','nn','nn','nn','nn','nn','nn' (the number of 'nn' values will depend on the number of original streams plus the number of anomaly forcing streams) -The cycling of the present-day (base) climate is controlled through the DATM\_CLMNCEP\_YR\_START and DATM_CLMNCEP\_YR\_END variables in env\_run.xml. +The cycling of the present-day (base) climate is controlled through the DATM\_YR\_START and DATM\_YR\_END variables in env\_run.xml. diff --git a/doc/source/users_guide/running-special-cases/Running-with-your-own-previous-simulation-as-atmospheric-forcing-to-spinup-the-model.rst b/doc/source/users_guide/running-special-cases/Running-with-your-own-previous-simulation-as-atmospheric-forcing-to-spinup-the-model.rst index 2a55cbed1e..88d209c0d1 100644 --- a/doc/source/users_guide/running-special-cases/Running-with-your-own-previous-simulation-as-atmospheric-forcing-to-spinup-the-model.rst +++ b/doc/source/users_guide/running-special-cases/Running-with-your-own-previous-simulation-as-atmospheric-forcing-to-spinup-the-model.rst @@ -51,7 +51,7 @@ Example: Simulation Forced with Data from the Previous Simulation > ./xmlchange DATM_CPLHIST_CASE="myB1850" # The following sets the align year and years to run over for atm forcing # (you could also use an editor) - > ./xmlchange DATM_CPLHIST_YR_ALIGN="1",DATM_CPLHIST_YR_START=1,DATM_CPLHIST_YR_END=20 + > ./xmlchange DATM_YR_ALIGN="1",DATM_YR_START=1,DATM_YR_END=20 # Set the strm_datdir in the namelist_defaults_datm.xml # file to the archival path of the case above in the form of: /glade/home/achive/$USER/$DATM_CPLHIST_CASE/cpl/hist # NOTE: THIS WILL CHANGE THE PATH FOR ALL I1850Clm50BgcSpinup COMPSET CASES MADE AFTER THIS! From 721ce0eb64918ce4e9211645cb39a1e597b25424 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 30 Oct 2024 01:47:33 -0600 Subject: [PATCH 157/243] Get the PF UNIT tests working using the full ESMF library which also requires PIO and NetCDF as a result --- src/CMakeLists.txt | 55 ++++++++++--------- .../test/CNPhenology_test/CMakeLists.txt | 2 +- .../test/CNVegComputeSeed_test/CMakeLists.txt | 2 +- .../test/DustEmis_test/CMakeLists.txt | 2 +- .../test/Latbaset_test/CMakeLists.txt | 2 +- .../test/Balance_test/CMakeLists.txt | 2 +- .../test/Daylength_test/CMakeLists.txt | 2 +- .../HillslopeHydrology_test/CMakeLists.txt | 2 +- .../test/Irrigation_test/CMakeLists.txt | 2 +- .../test/Photosynthesis_test/CMakeLists.txt | 2 +- .../test/SnowHydrology_test/CMakeLists.txt | 2 +- .../TotalWaterAndHeat_test/CMakeLists.txt | 2 +- .../CMakeLists.txt | 2 +- .../test/WaterTracerUtils_test/CMakeLists.txt | 2 +- .../test/WaterType_test/CMakeLists.txt | 2 +- .../test/Wateratm2lnd_test/CMakeLists.txt | 2 +- .../dynConsBiogeophys_test/CMakeLists.txt | 2 +- .../test/dynInitColumns_test/CMakeLists.txt | 2 +- .../test/dynTimeInfo_test/CMakeLists.txt | 2 +- .../test/dynVar_test/CMakeLists.txt | 2 +- src/main/test/accumul_test/CMakeLists.txt | 2 +- src/main/test/atm2lnd_test/CMakeLists.txt | 2 +- .../test/initVertical_test/CMakeLists.txt | 2 +- .../test/assertions_test/CMakeLists.txt | 2 +- .../test/tillage_test/CMakeLists.txt | 2 +- .../annual_flux_dribbler_test/CMakeLists.txt | 2 +- .../test/array_utils_test/CMakeLists.txt | 2 +- .../test/clm_time_manager_test/CMakeLists.txt | 2 +- src/utils/test/numerics_test/CMakeLists.txt | 2 +- 29 files changed, 56 insertions(+), 55 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 5b0f6c9b1b..7501723930 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -3,14 +3,18 @@ cmake_minimum_required(VERSION 2.8) list(APPEND CMAKE_MODULE_PATH ${CIME_CMAKE_MODULE_DIRECTORY}) include(CIME_initial_setup) -project(clm45_tests Fortran C) +#list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../tools/mksurfdata_esmf/cmake") +list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../share/cmake") +list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../component/cmeps/cmake") + +project(clm_tests Fortran C) include(CIME_utils) set(CLM_ROOT "..") -# This definition is needed to avoid having ESMF depend on mpi -add_definitions(-DHIDE_MPI) +#find_package(ESMF 8.2.0 REQUIRED ) +find_package(NetCDF 4.7.4 REQUIRED Fortran) # Add source directories from other share code (csm_share, etc.). This should be # done first, so that in case of name collisions, the CLM versions take @@ -18,7 +22,6 @@ add_definitions(-DHIDE_MPI) # wins). 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 files needed from CMEPS list ( APPEND drv_sources_needed @@ -53,43 +56,41 @@ foreach (sourcefile ${share_sources}) endif() endforeach() -# Remove shr_cal_mod from share_sources. -# -# shr_cal_mod depends on ESMF (or the lightweight esmf wrf timemgr, at -# least). Since CTSM doesn't currently use shr_cal_mod, we're avoiding -# the extra overhead of including esmf_wrf_timemgr sources in this -# build. -# -# TODO: like above, this should be moved into a general-purpose function -# in Sourcelist_utils. Then this block of code could be replaced with a -# single call, like: remove_source_file(${share_sources} -# "shr_cal_mod.F90") -foreach (sourcefile ${share_sources}) - string(REGEX MATCH "shr_cal_mod.F90" match_found ${sourcefile}) - if(match_found) - list(REMOVE_ITEM share_sources ${sourcefile}) - endif() -endforeach() +if (DEFINED PIO) + set(PIO_PATH ${PIO}) +else() + set(PIO_PATH $ENV{PIO}) +endif() # Build libraries containing stuff needed for the unit tests. # Eventually, these add_library calls should probably be distributed into the correct location, rather than being in this top-level CMakeLists.txt file. add_library(csm_share ${share_sources} ${drv_sources_needed}) declare_generated_dependencies(csm_share "${share_genf90_sources}") -add_library(esmf_wrf_timemgr ${esmf_wrf_timemgr_sources}) add_library(clm ${clm_sources}) declare_generated_dependencies(clm "${clm_genf90_sources}") -add_dependencies(esmf_wrf_timemgr csm_share) -add_dependencies(clm csm_share esmf_wrf_timemgr) +add_dependencies(clm csm_share esmf) # We need to look for header files here, in order to pick up shr_assert.h include_directories(${CLM_ROOT}/share/include) -# And we need to look for header files here, for some include files needed by -# the esmf_wrf_timemgr code -include_directories(${CLM_ROOT}/share/src/esmf_wrf_timemgr) + +# PIO2 +add_compile_definitions(PIO2) + +add_library(pioc STATIC IMPORTED) +add_library(piof STATIC IMPORTED) +set_property(TARGET pioc PROPERTY IMPORTED_LOCATION $ENV{PIO}/lib/libpioc.so) +set_property(TARGET piof PROPERTY IMPORTED_LOCATION $ENV{PIO}/lib/libpiof.so) + # Tell cmake to look for libraries & mod files here, because this is where we built libraries include_directories(${CMAKE_CURRENT_BINARY_DIR}) +include_directories (${ESMF_F90COMPILEPATHS}) +include_directories ($ENV{PIO}/include) +include_directories (${NETCDF}/include) + +message( "CMAKE_CURRENT_BINARY_DIR = ${CMAKE_CURRENT_BINARY_DIR}" ) link_directories(${CMAKE_CURRENT_BINARY_DIR}) +link_libraries( pioc piof netcdf ) # Add the test directories # Note: it's possible that these could be added by each source directory that diff --git a/src/biogeochem/test/CNPhenology_test/CMakeLists.txt b/src/biogeochem/test/CNPhenology_test/CMakeLists.txt index 2367c86612..283e089ba6 100644 --- a/src/biogeochem/test/CNPhenology_test/CMakeLists.txt +++ b/src/biogeochem/test/CNPhenology_test/CMakeLists.txt @@ -3,4 +3,4 @@ set (pfunit_sources add_pfunit_ctest(CNPhenology TEST_SOURCES "${pfunit_sources}" - LINK_LIBRARIES clm csm_share esmf_wrf_timemgr) + LINK_LIBRARIES clm csm_share esmf) diff --git a/src/biogeochem/test/CNVegComputeSeed_test/CMakeLists.txt b/src/biogeochem/test/CNVegComputeSeed_test/CMakeLists.txt index dd6bdba723..b958439031 100644 --- a/src/biogeochem/test/CNVegComputeSeed_test/CMakeLists.txt +++ b/src/biogeochem/test/CNVegComputeSeed_test/CMakeLists.txt @@ -3,4 +3,4 @@ set (pfunit_sources add_pfunit_ctest(CNVegComputeSeed TEST_SOURCES "${pfunit_sources}" - LINK_LIBRARIES clm csm_share esmf_wrf_timemgr) + LINK_LIBRARIES clm csm_share esmf) diff --git a/src/biogeochem/test/DustEmis_test/CMakeLists.txt b/src/biogeochem/test/DustEmis_test/CMakeLists.txt index c705d6c2e3..d312b721b9 100644 --- a/src/biogeochem/test/DustEmis_test/CMakeLists.txt +++ b/src/biogeochem/test/DustEmis_test/CMakeLists.txt @@ -5,4 +5,4 @@ set (pfunit_sources add_pfunit_ctest(DustEmis TEST_SOURCES "${pfunit_sources}" - LINK_LIBRARIES clm csm_share esmf_wrf_timemgr) + LINK_LIBRARIES clm csm_share esmf) diff --git a/src/biogeochem/test/Latbaset_test/CMakeLists.txt b/src/biogeochem/test/Latbaset_test/CMakeLists.txt index 217fc7233c..d9f1c044f3 100644 --- a/src/biogeochem/test/Latbaset_test/CMakeLists.txt +++ b/src/biogeochem/test/Latbaset_test/CMakeLists.txt @@ -3,4 +3,4 @@ set (pfunit_sources add_pfunit_ctest(CropTypeLatbaset TEST_SOURCES "${pfunit_sources}" - LINK_LIBRARIES clm csm_share esmf_wrf_timemgr) + LINK_LIBRARIES clm csm_share esmf) diff --git a/src/biogeophys/test/Balance_test/CMakeLists.txt b/src/biogeophys/test/Balance_test/CMakeLists.txt index 541d4fb266..e140323124 100644 --- a/src/biogeophys/test/Balance_test/CMakeLists.txt +++ b/src/biogeophys/test/Balance_test/CMakeLists.txt @@ -1,3 +1,3 @@ add_pfunit_ctest(balance TEST_SOURCES "test_Balance.pf" - LINK_LIBRARIES clm csm_share esmf_wrf_timemgr) + LINK_LIBRARIES clm csm_share esmf) diff --git a/src/biogeophys/test/Daylength_test/CMakeLists.txt b/src/biogeophys/test/Daylength_test/CMakeLists.txt index 2e5cb58cf9..bd2d6407a9 100644 --- a/src/biogeophys/test/Daylength_test/CMakeLists.txt +++ b/src/biogeophys/test/Daylength_test/CMakeLists.txt @@ -4,4 +4,4 @@ set (pfunit_sources add_pfunit_ctest(Daylength TEST_SOURCES "${pfunit_sources}" - LINK_LIBRARIES clm csm_share esmf_wrf_timemgr) + LINK_LIBRARIES clm csm_share esmf) diff --git a/src/biogeophys/test/HillslopeHydrology_test/CMakeLists.txt b/src/biogeophys/test/HillslopeHydrology_test/CMakeLists.txt index f40baf96ed..078934cc78 100644 --- a/src/biogeophys/test/HillslopeHydrology_test/CMakeLists.txt +++ b/src/biogeophys/test/HillslopeHydrology_test/CMakeLists.txt @@ -3,4 +3,4 @@ set (pfunit_sources add_pfunit_ctest(HillslopeHydrologyUtils TEST_SOURCES "${pfunit_sources}" - LINK_LIBRARIES clm csm_share esmf_wrf_timemgr) + LINK_LIBRARIES clm csm_share esmf) diff --git a/src/biogeophys/test/Irrigation_test/CMakeLists.txt b/src/biogeophys/test/Irrigation_test/CMakeLists.txt index 8cb531ba1a..4acf72961d 100644 --- a/src/biogeophys/test/Irrigation_test/CMakeLists.txt +++ b/src/biogeophys/test/Irrigation_test/CMakeLists.txt @@ -3,4 +3,4 @@ set (pfunit_sources add_pfunit_ctest(irrigation TEST_SOURCES "${pfunit_sources}" - LINK_LIBRARIES clm csm_share esmf_wrf_timemgr) + LINK_LIBRARIES clm csm_share esmf) diff --git a/src/biogeophys/test/Photosynthesis_test/CMakeLists.txt b/src/biogeophys/test/Photosynthesis_test/CMakeLists.txt index 29810cbd9d..628a98994a 100644 --- a/src/biogeophys/test/Photosynthesis_test/CMakeLists.txt +++ b/src/biogeophys/test/Photosynthesis_test/CMakeLists.txt @@ -3,4 +3,4 @@ set (pfunit_sources add_pfunit_ctest(Photosynthesis TEST_SOURCES "${pfunit_sources}" - LINK_LIBRARIES clm csm_share esmf_wrf_timemgr) + LINK_LIBRARIES clm csm_share esmf) diff --git a/src/biogeophys/test/SnowHydrology_test/CMakeLists.txt b/src/biogeophys/test/SnowHydrology_test/CMakeLists.txt index 600356b2ff..9e1738ab83 100644 --- a/src/biogeophys/test/SnowHydrology_test/CMakeLists.txt +++ b/src/biogeophys/test/SnowHydrology_test/CMakeLists.txt @@ -5,4 +5,4 @@ set (pfunit_sources add_pfunit_ctest(SnowHydrology TEST_SOURCES "${pfunit_sources}" - LINK_LIBRARIES clm csm_share esmf_wrf_timemgr) + LINK_LIBRARIES clm csm_share esmf) diff --git a/src/biogeophys/test/TotalWaterAndHeat_test/CMakeLists.txt b/src/biogeophys/test/TotalWaterAndHeat_test/CMakeLists.txt index a82532f69b..424515e414 100644 --- a/src/biogeophys/test/TotalWaterAndHeat_test/CMakeLists.txt +++ b/src/biogeophys/test/TotalWaterAndHeat_test/CMakeLists.txt @@ -3,4 +3,4 @@ set (pfunit_sources add_pfunit_ctest(total_water_and_heat TEST_SOURCES "${pfunit_sources}" - LINK_LIBRARIES clm csm_share esmf_wrf_timemgr) + LINK_LIBRARIES clm csm_share esmf) diff --git a/src/biogeophys/test/WaterTracerContainerType_test/CMakeLists.txt b/src/biogeophys/test/WaterTracerContainerType_test/CMakeLists.txt index 283906a442..645972aa1e 100644 --- a/src/biogeophys/test/WaterTracerContainerType_test/CMakeLists.txt +++ b/src/biogeophys/test/WaterTracerContainerType_test/CMakeLists.txt @@ -3,4 +3,4 @@ set (pfunit_sources add_pfunit_ctest(water_tracer_container TEST_SOURCES "${pfunit_sources}" - LINK_LIBRARIES clm csm_share esmf_wrf_timemgr) + LINK_LIBRARIES clm csm_share esmf) diff --git a/src/biogeophys/test/WaterTracerUtils_test/CMakeLists.txt b/src/biogeophys/test/WaterTracerUtils_test/CMakeLists.txt index 321e06883a..1a65bbfadd 100644 --- a/src/biogeophys/test/WaterTracerUtils_test/CMakeLists.txt +++ b/src/biogeophys/test/WaterTracerUtils_test/CMakeLists.txt @@ -5,4 +5,4 @@ set (pfunit_sources add_pfunit_ctest(water_tracer_utils TEST_SOURCES "${pfunit_sources}" - LINK_LIBRARIES clm csm_share esmf_wrf_timemgr) + LINK_LIBRARIES clm csm_share esmf) diff --git a/src/biogeophys/test/WaterType_test/CMakeLists.txt b/src/biogeophys/test/WaterType_test/CMakeLists.txt index 506179aabd..3f0ab409da 100644 --- a/src/biogeophys/test/WaterType_test/CMakeLists.txt +++ b/src/biogeophys/test/WaterType_test/CMakeLists.txt @@ -3,4 +3,4 @@ set (pfunit_sources add_pfunit_ctest(water_type TEST_SOURCES "${pfunit_sources}" - LINK_LIBRARIES clm csm_share esmf_wrf_timemgr) + LINK_LIBRARIES clm csm_share esmf) diff --git a/src/biogeophys/test/Wateratm2lnd_test/CMakeLists.txt b/src/biogeophys/test/Wateratm2lnd_test/CMakeLists.txt index c2157952e0..1ddb840431 100644 --- a/src/biogeophys/test/Wateratm2lnd_test/CMakeLists.txt +++ b/src/biogeophys/test/Wateratm2lnd_test/CMakeLists.txt @@ -3,4 +3,4 @@ set (pfunit_sources add_pfunit_ctest(water_atm2lnd TEST_SOURCES "${pfunit_sources}" - LINK_LIBRARIES clm csm_share esmf_wrf_timemgr) + LINK_LIBRARIES clm csm_share esmf) diff --git a/src/dyn_subgrid/test/dynConsBiogeophys_test/CMakeLists.txt b/src/dyn_subgrid/test/dynConsBiogeophys_test/CMakeLists.txt index 5e981270a4..da9c27090c 100644 --- a/src/dyn_subgrid/test/dynConsBiogeophys_test/CMakeLists.txt +++ b/src/dyn_subgrid/test/dynConsBiogeophys_test/CMakeLists.txt @@ -3,4 +3,4 @@ set(pfunit_sources add_pfunit_ctest(dynConsBiogeophys TEST_SOURCES "${pfunit_sources}" - LINK_LIBRARIES clm csm_share esmf_wrf_timemgr) + LINK_LIBRARIES clm csm_share esmf) diff --git a/src/dyn_subgrid/test/dynInitColumns_test/CMakeLists.txt b/src/dyn_subgrid/test/dynInitColumns_test/CMakeLists.txt index 7952f66756..0adbd696ad 100644 --- a/src/dyn_subgrid/test/dynInitColumns_test/CMakeLists.txt +++ b/src/dyn_subgrid/test/dynInitColumns_test/CMakeLists.txt @@ -1,3 +1,3 @@ add_pfunit_ctest(dynInitColumns TEST_SOURCES "test_init_columns.pf" - LINK_LIBRARIES clm csm_share esmf_wrf_timemgr) + LINK_LIBRARIES clm csm_share esmf) diff --git a/src/dyn_subgrid/test/dynTimeInfo_test/CMakeLists.txt b/src/dyn_subgrid/test/dynTimeInfo_test/CMakeLists.txt index 66f2027c36..625ddae91b 100644 --- a/src/dyn_subgrid/test/dynTimeInfo_test/CMakeLists.txt +++ b/src/dyn_subgrid/test/dynTimeInfo_test/CMakeLists.txt @@ -1,3 +1,3 @@ add_pfunit_ctest(dynTimeInfo TEST_SOURCES "test_dynTimeInfo.pf" - LINK_LIBRARIES clm csm_share esmf_wrf_timemgr) + LINK_LIBRARIES clm csm_share esmf) diff --git a/src/dyn_subgrid/test/dynVar_test/CMakeLists.txt b/src/dyn_subgrid/test/dynVar_test/CMakeLists.txt index fc4cf07b30..7164947f1e 100644 --- a/src/dyn_subgrid/test/dynVar_test/CMakeLists.txt +++ b/src/dyn_subgrid/test/dynVar_test/CMakeLists.txt @@ -9,4 +9,4 @@ set (extra_sources add_pfunit_ctest(dynVar TEST_SOURCES "${pfunit_sources}" OTHER_SOURCES "${extra_sources}" - LINK_LIBRARIES clm csm_share esmf_wrf_timemgr) + LINK_LIBRARIES clm csm_share esmf) diff --git a/src/main/test/accumul_test/CMakeLists.txt b/src/main/test/accumul_test/CMakeLists.txt index 0b06d9e87e..8d7cf69f1c 100644 --- a/src/main/test/accumul_test/CMakeLists.txt +++ b/src/main/test/accumul_test/CMakeLists.txt @@ -3,4 +3,4 @@ set(pfunit_sources add_pfunit_ctest(accumul TEST_SOURCES "${pfunit_sources}" - LINK_LIBRARIES clm csm_share esmf_wrf_timemgr) + LINK_LIBRARIES clm csm_share esmf) diff --git a/src/main/test/atm2lnd_test/CMakeLists.txt b/src/main/test/atm2lnd_test/CMakeLists.txt index 51c4732205..fcc4159ce2 100644 --- a/src/main/test/atm2lnd_test/CMakeLists.txt +++ b/src/main/test/atm2lnd_test/CMakeLists.txt @@ -4,4 +4,4 @@ set(pfunit_sources add_pfunit_ctest(atm2lnd TEST_SOURCES "${pfunit_sources}" - LINK_LIBRARIES clm csm_share esmf_wrf_timemgr) + LINK_LIBRARIES clm csm_share esmf) diff --git a/src/main/test/initVertical_test/CMakeLists.txt b/src/main/test/initVertical_test/CMakeLists.txt index 8fe9648a50..aec45772c4 100644 --- a/src/main/test/initVertical_test/CMakeLists.txt +++ b/src/main/test/initVertical_test/CMakeLists.txt @@ -1,3 +1,3 @@ add_pfunit_ctest(initVertical TEST_SOURCES "test_initVertical.pf" - LINK_LIBRARIES clm csm_share esmf_wrf_timemgr) + LINK_LIBRARIES clm csm_share esmf) diff --git a/src/self_tests/test/assertions_test/CMakeLists.txt b/src/self_tests/test/assertions_test/CMakeLists.txt index d36d8c7675..aeae976839 100644 --- a/src/self_tests/test/assertions_test/CMakeLists.txt +++ b/src/self_tests/test/assertions_test/CMakeLists.txt @@ -3,4 +3,4 @@ set (pfunit_sources add_pfunit_ctest(assertions TEST_SOURCES "${pfunit_sources}" - LINK_LIBRARIES clm csm_share esmf_wrf_timemgr) + LINK_LIBRARIES clm csm_share esmf) diff --git a/src/soilbiogeochem/test/tillage_test/CMakeLists.txt b/src/soilbiogeochem/test/tillage_test/CMakeLists.txt index fbc550dd03..13be9aee3e 100644 --- a/src/soilbiogeochem/test/tillage_test/CMakeLists.txt +++ b/src/soilbiogeochem/test/tillage_test/CMakeLists.txt @@ -1,3 +1,3 @@ add_pfunit_ctest(tillage TEST_SOURCES "test_tillage.pf" - LINK_LIBRARIES clm csm_share esmf_wrf_timemgr) + LINK_LIBRARIES clm csm_share esmf) diff --git a/src/utils/test/annual_flux_dribbler_test/CMakeLists.txt b/src/utils/test/annual_flux_dribbler_test/CMakeLists.txt index a0a60e7431..01efdc1e50 100644 --- a/src/utils/test/annual_flux_dribbler_test/CMakeLists.txt +++ b/src/utils/test/annual_flux_dribbler_test/CMakeLists.txt @@ -1,3 +1,3 @@ add_pfunit_ctest(annual_flux_dribbler TEST_SOURCES "test_annual_flux_dribbler.pf" - LINK_LIBRARIES clm csm_share esmf_wrf_timemgr) + LINK_LIBRARIES clm csm_share esmf) diff --git a/src/utils/test/array_utils_test/CMakeLists.txt b/src/utils/test/array_utils_test/CMakeLists.txt index 21c7d91d81..a6b36304b4 100644 --- a/src/utils/test/array_utils_test/CMakeLists.txt +++ b/src/utils/test/array_utils_test/CMakeLists.txt @@ -5,4 +5,4 @@ set (pfunit_sources add_pfunit_ctest(array_utils TEST_SOURCES "${pfunit_sources}" - LINK_LIBRARIES clm csm_share esmf_wrf_timemgr) + LINK_LIBRARIES clm csm_share esmf) diff --git a/src/utils/test/clm_time_manager_test/CMakeLists.txt b/src/utils/test/clm_time_manager_test/CMakeLists.txt index f34e77dfc9..66a62e665d 100644 --- a/src/utils/test/clm_time_manager_test/CMakeLists.txt +++ b/src/utils/test/clm_time_manager_test/CMakeLists.txt @@ -1,3 +1,3 @@ add_pfunit_ctest(clm_time_manager TEST_SOURCES "test_clm_time_manager.pf" - LINK_LIBRARIES clm csm_share esmf_wrf_timemgr) + LINK_LIBRARIES clm csm_share esmf) diff --git a/src/utils/test/numerics_test/CMakeLists.txt b/src/utils/test/numerics_test/CMakeLists.txt index 19d2c67451..2e826e2018 100644 --- a/src/utils/test/numerics_test/CMakeLists.txt +++ b/src/utils/test/numerics_test/CMakeLists.txt @@ -3,4 +3,4 @@ set (pfunit_sources add_pfunit_ctest(numerics TEST_SOURCES "${pfunit_sources}" - LINK_LIBRARIES clm csm_share esmf_wrf_timemgr) + LINK_LIBRARIES clm csm_share esmf) From 31070e622c65b88620e317903f038a67a2c8ba48 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 30 Oct 2024 01:49:27 -0600 Subject: [PATCH 158/243] Update submodules to something towards cesm3_0_alpha04a with cime updated beyond it as needed by PF UNIT testing, and ccs_config just updated to one beyond the previous one used by CTSM --- .gitmodules | 22 +++++++++++++++------- libraries/mpi-serial | 1 + 2 files changed, 16 insertions(+), 7 deletions(-) create mode 160000 libraries/mpi-serial diff --git a/.gitmodules b/.gitmodules index 1f6da08484..30adb590d3 100644 --- a/.gitmodules +++ b/.gitmodules @@ -60,7 +60,7 @@ fxDONOTUSEurl = https://github.com/ESCOMP/MOSART [submodule "mizuRoute"] path = components/mizuRoute url = https://github.com/ESCOMP/mizuRoute -fxtag = cesm-coupling.n02_v2.1.2 +fxtag = cesm-coupling.n02_v2.1.3 fxrequired = ToplevelRequired # Standard Fork to compare to with "git fleximod test" to ensure personal forks aren't committed fxDONOTUSEurl = https://github.com/ESCOMP/mizuRoute @@ -68,7 +68,7 @@ fxDONOTUSEurl = https://github.com/ESCOMP/mizuRoute [submodule "ccs_config"] path = ccs_config url = https://github.com/ESMCI/ccs_config_cesm.git -fxtag = ccs_config_cesm1.0.0 +fxtag = ccs_config_cesm1.0.8 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 @@ -76,7 +76,7 @@ fxDONOTUSEurl = https://github.com/ESMCI/ccs_config_cesm.git [submodule "cime"] path = cime url = https://github.com/ESMCI/cime -fxtag = cime6.0.246 +fxtag = cime6.1.37 fxrequired = ToplevelRequired # Standard Fork to compare to with "git fleximod test" to ensure personal forks aren't committed fxDONOTUSEurl = https://github.com/ESMCI/cime @@ -84,7 +84,7 @@ fxDONOTUSEurl = https://github.com/ESMCI/cime [submodule "cmeps"] path = components/cmeps url = https://github.com/ESCOMP/CMEPS.git -fxtag = cmeps0.14.77 +fxtag = cmeps1.0.16 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 @@ -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.48 +fxtag = cdeps1.0.53 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 @@ -100,7 +100,7 @@ fxDONOTUSEurl = https://github.com/ESCOMP/CDEPS.git [submodule "share"] path = share url = https://github.com/ESCOMP/CESM_share -fxtag = share1.0.19 +fxtag = share1.0.20 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 @@ -116,11 +116,19 @@ fxDONOTUSEurl = https://github.com/MCSclimate/MCT [submodule "parallelio"] path = libraries/parallelio url = https://github.com/NCAR/ParallelIO -fxtag = pio2_6_2 +fxtag = pio2_6_3 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 "mpi-serial"] +path = libraries/mpi-serial +url = https://github.com/ESMCI/mpi-serial +fxtag = MPIserial_2.5.0 +fxrequired = ToplevelRequired +# Standard Fork to compare to with "git fleximod test" to ensure personal forks aren't committed +fxDONOTUSEurl = https://github.com/ESMCI/mpi-serial + [submodule "doc-builder"] path = doc/doc-builder url = https://github.com/ESMCI/doc-builder diff --git a/libraries/mpi-serial b/libraries/mpi-serial new file mode 160000 index 0000000000..2c44fb3d32 --- /dev/null +++ b/libraries/mpi-serial @@ -0,0 +1 @@ +Subproject commit 2c44fb3d327be7c6429894bc5d4de769f3486848 From 862739bcbd044133e12afb9a60c0562d67bece44 Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Wed, 30 Oct 2024 10:47:32 -0600 Subject: [PATCH 159/243] Replace outdated DATM_CPL_CASE with DATM_CPLHIST_CASE --- ...AR-data-as-atmospheric-forcing-to-spinup-the-model.rst | 2 +- .../customizing-the-clm-configuration.rst | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/doc/source/users_guide/running-special-cases/Running-with-MOAR-data-as-atmospheric-forcing-to-spinup-the-model.rst b/doc/source/users_guide/running-special-cases/Running-with-MOAR-data-as-atmospheric-forcing-to-spinup-the-model.rst index a81465c699..cf9fbc773c 100644 --- a/doc/source/users_guide/running-special-cases/Running-with-MOAR-data-as-atmospheric-forcing-to-spinup-the-model.rst +++ b/doc/source/users_guide/running-special-cases/Running-with-MOAR-data-as-atmospheric-forcing-to-spinup-the-model.rst @@ -18,7 +18,7 @@ Example: Simulation with MOAR Data on derecho > ./create_newcase -case MOARforce1850 -res f19_g17_gl4 -compset I1850Clm50BgcSpinup > cd MOARforce1850 # The following sets the casename to point to for atm forcing (you could also use an editor) - > ./xmlchange DATM_CPL_CASE=b40.1850.track1.1deg.006a + > ./xmlchange DATM_CPLHIST_CASE=b40.1850.track1.1deg.006a # The following sets the align year and years to run over for atm forcing # (you could also use an editor) > ./xmlchange DATM_YR_ALIGN=1,DATM_YR_START=960,DATM_YR_END=1030 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 11e996ae5d..ec28a0d624 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 @@ -513,7 +513,7 @@ For running "I" cases there are several other noteworthy configuration items tha DATM_YR_ALIGN DATM_YR_START DATM_YR_END - DATM_CPL_CASE + DATM_CPLHIST_CASE ``CCSM_CO2_PPMV`` Sets the mixing ratio of CO2 in parts per million by volume for ALL CESM components to use. Note that most compsets already set this value to something reasonable. Also note that some compsets may tell the atmosphere model to override this value with either historic or ramped values. If the ``CCSM_BGC`` variable is set to something other than "none" the atmosphere model will determine CO2, and CLM will listen and use what the atmosphere sends it. On the CLM side the namelist item ``co2_type`` tells CLM to use the value sent from the atmosphere rather than a value set on it's own namelist. @@ -575,8 +575,8 @@ DATM_YR_END DATM_YR_ALIGN ``DATM_YR_START`` and ``DATM_YR_END`` determine the range of years to cycle the atmospheric data over, and ``DATM_YR_ALIGN`` determines which year in that range of years the simulation will start with. -DATM_CPL_CASE - ``DATM_CPL_CASE`` sets the casename to use for the ``CPLHISTForcing`` mode. +DATM_CPLHIST_CASE + ``DATM_CPLHIST_CASE`` sets the casename to use for the ``CPLHISTForcing`` mode. ----------------------------- Downloading DATM Forcing Data @@ -586,7 +586,7 @@ In Chapter One of the `CESM User's Guide `_ there is a section The `CLMCRUNCEP` data is uploaded into the subversion inputdata repository as well -- but as it is 1.1 Terabytes of data downloading it is problematic (*IT WILL TAKE SEVERAL DAYS TO DOWNLOAD THE ENTIRE DATASET USING SUBVERSION*). Because of its size you may also need to download it onto a separate disk space. We have done that on derecho for example where it resides in ``$ENV{CESMROOT}/lmwg`` while the rest of the input data resides in ``$ENV{CESMDATAROOT}/inputdata``. The data is also already available on: janus, franklin, and hopper. If you download the data, we recommend that you break your download into several chunks, by setting up a case and setting the year range for ``DATM_YR_START`` and ``DATM_YR_END`` in say 20 year sections over 1901 to 2010, and then use ``check_input_data`` to export the data. -The ``CPLHISTForcing`` DATM forcing data is unique -- because it is large compared to the rest of the input data, and we only have a disk copy on derecho. The DATM assumes the path for derecho of ``/glade/p/cesm/shared_outputdata/cases/ccsm4/$DATM_CPLHIST_CASE`` for the data. So you will need to change this path in order to run on any other machine. You can download the data itself from NCAR HPSS from ``/CCSM/csm/$DATM_CPLHIST_CASE``. +The ``CPLHISTForcing`` DATM forcing data is unique -- because it is large compared to the rest of the input data, and we only have a disk copy on derecho. The DATM assumes the path for derecho of ``/glade/p/cesm/shared_outputdata/cases/ccsm4/$DATM_CPLHIST_CASE`` for the data. So you will need to change this path in order to run on any other machine. -------------------------------------- Customizing via the build script files From 326d8dd2fff3cae329dc56aba54330e0615c7ba7 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 30 Oct 2024 10:50:36 -0600 Subject: [PATCH 160/243] Match cesm3_0_alpha04a submodules closer, move ccs_config back one, and share forward, and remove mct --- .gitmodules | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/.gitmodules b/.gitmodules index 30adb590d3..5f1e4b9fa7 100644 --- a/.gitmodules +++ b/.gitmodules @@ -68,7 +68,7 @@ fxDONOTUSEurl = https://github.com/ESCOMP/mizuRoute [submodule "ccs_config"] path = ccs_config url = https://github.com/ESMCI/ccs_config_cesm.git -fxtag = ccs_config_cesm1.0.8 +fxtag = ccs_config_cesm1.0.7 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 @@ -100,19 +100,11 @@ fxDONOTUSEurl = https://github.com/ESCOMP/CDEPS.git [submodule "share"] path = share url = https://github.com/ESCOMP/CESM_share -fxtag = share1.0.20 +fxtag = share1.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/CESM_share -[submodule "mct"] -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"] path = libraries/parallelio url = https://github.com/NCAR/ParallelIO From c3a4d8b735627225539e37a40a1e0c397dd03b1a Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 30 Oct 2024 10:52:22 -0600 Subject: [PATCH 161/243] Update git submodule directories --- ccs_config | 2 +- cime | 2 +- components/cdeps | 2 +- components/cmeps | 2 +- components/mizuRoute | 2 +- libraries/parallelio | 2 +- share | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/ccs_config b/ccs_config index 69a958581e..e4ac80ef14 160000 --- a/ccs_config +++ b/ccs_config @@ -1 +1 @@ -Subproject commit 69a958581ecd2d32ee9cb1c38bcd3847b8b920bf +Subproject commit e4ac80ef142954e582b4065222145352f22cd3a4 diff --git a/cime b/cime index 422ddaa770..a8a04e2d9d 160000 --- a/cime +++ b/cime @@ -1 +1 @@ -Subproject commit 422ddaa770a3cea6e83a60c9700ebce77acaceed +Subproject commit a8a04e2d9deac572e6f2222b4f893a575308db99 diff --git a/components/cdeps b/components/cdeps index 7b0b3a8272..f6bc97483a 160000 --- a/components/cdeps +++ b/components/cdeps @@ -1 +1 @@ -Subproject commit 7b0b3a827241c53d296ec877cb1f59966bf5e5bf +Subproject commit f6bc97483a1bfb7352c6c5610a13ed898a86990b diff --git a/components/cmeps b/components/cmeps index 47fb4e633a..5b7d76978e 160000 --- a/components/cmeps +++ b/components/cmeps @@ -1 +1 @@ -Subproject commit 47fb4e633a76ec6d60969b1af751f90790387246 +Subproject commit 5b7d76978e2fdc661ec2de4ba9834b985decadc6 diff --git a/components/mizuRoute b/components/mizuRoute index 81c720c7ee..2ff305a029 160000 --- a/components/mizuRoute +++ b/components/mizuRoute @@ -1 +1 @@ -Subproject commit 81c720c7ee51f9c69f2934f696078c42f4493565 +Subproject commit 2ff305a0292cb06789de6cfea7ad3cc0d6173493 diff --git a/libraries/parallelio b/libraries/parallelio index f52ade0756..6539ef05ae 160000 --- a/libraries/parallelio +++ b/libraries/parallelio @@ -1 +1 @@ -Subproject commit f52ade075619b32fa141993b5665b0fe099befc2 +Subproject commit 6539ef05ae7584ec570a56fdab9f7dfb336c2b80 diff --git a/share b/share index 4b9dc4871a..f6f31fd61c 160000 --- a/share +++ b/share @@ -1 +1 @@ -Subproject commit 4b9dc4871a259f00f35bb47708d876cb7dcdf75c +Subproject commit f6f31fd61cb8f80aee97311fcca64b3e26b0202c From c0d408037adcccc6c9f33261ff098a3dafd975a5 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 30 Oct 2024 11:06:06 -0600 Subject: [PATCH 162/243] Delete mct as no longer needed --- libraries/mct | 1 - 1 file changed, 1 deletion(-) delete mode 160000 libraries/mct diff --git a/libraries/mct b/libraries/mct deleted file mode 160000 index 82b0071e69..0000000000 --- a/libraries/mct +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 82b0071e69d14330b75d23b0bc68543ebea9aadc From d7cb1820a1b745b5f2ffc896d257fe7ccc6c9ede Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 30 Oct 2024 11:06:37 -0600 Subject: [PATCH 163/243] Update ccs_config as required for the build with this version of cime --- .gitmodules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitmodules b/.gitmodules index 5f1e4b9fa7..78a24f5789 100644 --- a/.gitmodules +++ b/.gitmodules @@ -68,7 +68,7 @@ fxDONOTUSEurl = https://github.com/ESCOMP/mizuRoute [submodule "ccs_config"] path = ccs_config url = https://github.com/ESMCI/ccs_config_cesm.git -fxtag = ccs_config_cesm1.0.7 +fxtag = ccs_config_cesm1.0.8 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 From f472f6d802a34c6d8093ddaa024da9057e621c4e Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 30 Oct 2024 16:50:14 -0600 Subject: [PATCH 164/243] Remove commented out code and log message and add some comments about what's going on based on code review --- src/CMakeLists.txt | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 7501723930..70cf802e45 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -13,7 +13,9 @@ include(CIME_utils) set(CLM_ROOT "..") -#find_package(ESMF 8.2.0 REQUIRED ) +# find needed external packages +# This is where ESMF could be asked for, but it's already included in the share build brought in below +# NetCDF is required -- because PIO and NetCDF are required by the standard default ESMF libraries find_package(NetCDF 4.7.4 REQUIRED Fortran) # Add source directories from other share code (csm_share, etc.). This should be @@ -56,6 +58,7 @@ foreach (sourcefile ${share_sources}) endif() endforeach() +# Bring in PIO, jsut because it's needed for the default ESMF library and included in other submodules like share and cmeps if (DEFINED PIO) set(PIO_PATH ${PIO}) else() @@ -64,6 +67,7 @@ endif() # Build libraries containing stuff needed for the unit tests. # Eventually, these add_library calls should probably be distributed into the correct location, rather than being in this top-level CMakeLists.txt file. +# This line of bringing in the share library also brings in ESMF and PIO add_library(csm_share ${share_sources} ${drv_sources_needed}) declare_generated_dependencies(csm_share "${share_genf90_sources}") add_library(clm ${clm_sources}) @@ -74,7 +78,7 @@ add_dependencies(clm csm_share esmf) include_directories(${CLM_ROOT}/share/include) -# PIO2 +# PIO2 library to the include and the linking step add_compile_definitions(PIO2) add_library(pioc STATIC IMPORTED) @@ -88,7 +92,7 @@ include_directories (${ESMF_F90COMPILEPATHS}) include_directories ($ENV{PIO}/include) include_directories (${NETCDF}/include) -message( "CMAKE_CURRENT_BINARY_DIR = ${CMAKE_CURRENT_BINARY_DIR}" ) +# Directories and libraries to include in the link step link_directories(${CMAKE_CURRENT_BINARY_DIR}) link_libraries( pioc piof netcdf ) From c6157d500078ffe06ac4a1bdeb3b67cce07c6905 Mon Sep 17 00:00:00 2001 From: adrifoster Date: Thu, 31 Oct 2024 10:15:53 -0600 Subject: [PATCH 165/243] updates --- src/fates | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fates b/src/fates index b4367834ab..de61028847 160000 --- a/src/fates +++ b/src/fates @@ -1 +1 @@ -Subproject commit b4367834abf505eb4e5f53af9bc7e4b83af4685c +Subproject commit de6102884790bb60681b11d20151fb462c1a70b5 From 5ba87240eac03a0b5d26973fb7c5f4cef8fe06cb Mon Sep 17 00:00:00 2001 From: adrifoster Date: Thu, 31 Oct 2024 10:16:13 -0600 Subject: [PATCH 166/243] updates --- components/cdeps | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/cdeps b/components/cdeps index 7b0b3a8272..7476950699 160000 --- a/components/cdeps +++ b/components/cdeps @@ -1 +1 @@ -Subproject commit 7b0b3a827241c53d296ec877cb1f59966bf5e5bf +Subproject commit 7476950699909813d1938a34bd8d71bf5bfbf1e9 From 32fc16737e7b0b4b9f35b4f74d92e66dacbded24 Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Thu, 31 Oct 2024 13:08:32 -0700 Subject: [PATCH 167/243] Revert "temporarily convert fates seed dispersal test to use f10" This reverts commit e9fb075891f90f97159071d03b376ed44c451bfc. --- 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 4654f53c45..0077221573 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -2670,7 +2670,7 @@ - + @@ -2679,7 +2679,7 @@ - + From 073e742cbc218dc25e3de77c061ad8644f2778fd Mon Sep 17 00:00:00 2001 From: Samuel Levis Date: Thu, 31 Oct 2024 17:29:07 -0600 Subject: [PATCH 168/243] fsurdat file needed for NEON MOAB PRISM test --- bld/CLMBuildNamelist.pm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index 32204388f3..c206cbcd6f 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -678,6 +678,11 @@ sub setup_cmdl_chk_res { } } +sub begins_with +{ + return substr($_[0], 0, length($_[1])) eq $_[1]; +} + sub setup_cmdl_resolution { my ($opts, $nl_flags, $definition, $defaults, $envxml_ref) = @_; @@ -713,7 +718,7 @@ sub setup_cmdl_resolution { $nl_flags->{'neon'} = ".false."; $nl_flags->{'neonsite'} = ""; if ( $nl_flags->{'res'} eq "CLM_USRDAT" ) { - if ( $opts->{'clm_usr_name'} eq "NEON" ) { + if ( begins_with($opts->{'clm_usr_name'}, "NEON") ) { $nl_flags->{'neon'} = ".true."; $nl_flags->{'neonsite'} = $envxml_ref->{'NEONSITE'}; $log->verbose_message( "This is a NEON site with NEONSITE = " . $nl_flags->{'neonsite'} ); From 16d83c15cce709955a44ca75115e718e84bc6a7f Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Fri, 1 Nov 2024 12:42:17 -0600 Subject: [PATCH 169/243] Add warning box to MOAR User's Guide page. --- ...th-MOAR-data-as-atmospheric-forcing-to-spinup-the-model.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/doc/source/users_guide/running-special-cases/Running-with-MOAR-data-as-atmospheric-forcing-to-spinup-the-model.rst b/doc/source/users_guide/running-special-cases/Running-with-MOAR-data-as-atmospheric-forcing-to-spinup-the-model.rst index cf9fbc773c..7c18cee009 100644 --- a/doc/source/users_guide/running-special-cases/Running-with-MOAR-data-as-atmospheric-forcing-to-spinup-the-model.rst +++ b/doc/source/users_guide/running-special-cases/Running-with-MOAR-data-as-atmospheric-forcing-to-spinup-the-model.rst @@ -6,6 +6,9 @@ Running with MOAR data ======================== +.. warning:: + These instructions are outdated and will not work. This page will be either updated or removed as part of the CTSM6/CLM3 release. + Because it takes so long to spinup the CN model (as we just saw previously), if you are doing fully coupled simulations with active atmosphere and ocean, you will want to do the spinup portion of this "offline". So instead of doing expensive fully coupled simulations for the spinup duration, you run CLM in a very cheap "I" compset using atmospheric forcing from a shorter fully coupled simulation (or a simulation run previously by someone else). In this example we will use the ``I1850Clm50BgcSpinup compset`` to setup CLM to run with atmospheric forcing from a previous fully coupled simulation with data that is already stored on disk on Cheyenne. There are several simulations that have high frequency data for which we can do this. You can also do this on a machine other than Cheyenne, but would need to download the data from the Earth System Grid and change the datapath similar to Example :numref:`eg-sim-data-from-prev-sim`. From 1c60312bdd82b2eb869cc4ece9c522aca33eb02c Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Fri, 1 Nov 2024 13:49:23 -0600 Subject: [PATCH 170/243] CIME update at cime6.1.11 requires moving CIME.utils append_testlog to CIME.status --- cime_config/SystemTests/lilacsmoke.py | 3 ++- cime_config/SystemTests/sspmatrixcn.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/cime_config/SystemTests/lilacsmoke.py b/cime_config/SystemTests/lilacsmoke.py index 5bdbb31ec1..8202505ab2 100644 --- a/cime_config/SystemTests/lilacsmoke.py +++ b/cime_config/SystemTests/lilacsmoke.py @@ -25,7 +25,8 @@ import shutil from CIME.SystemTests.system_tests_common import SystemTestsCommon -from CIME.utils import run_cmd, run_cmd_no_fail, symlink_force, new_lid, safe_copy, append_testlog +from CIME.utils import run_cmd, run_cmd_no_fail, symlink_force, new_lid, safe_copy +from CIME.status import append_testlog from CIME.build import post_build from CIME.test_status import ( NAMELIST_PHASE, diff --git a/cime_config/SystemTests/sspmatrixcn.py b/cime_config/SystemTests/sspmatrixcn.py index f4a09a277e..29b6dce8e6 100644 --- a/cime_config/SystemTests/sspmatrixcn.py +++ b/cime_config/SystemTests/sspmatrixcn.py @@ -22,7 +22,7 @@ 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.status import append_testlog from CIME.XML.standard_module_setup import * from CIME.SystemTests.system_tests_common import SystemTestsCommon From 94dccba56719c9d21d13c17308ba30307e10f05f Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Fri, 1 Nov 2024 14:10:51 -0600 Subject: [PATCH 171/243] Add a comment to note that MCTID is just the component ID number --- src/cpl/nuopc/lnd_comp_nuopc.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cpl/nuopc/lnd_comp_nuopc.F90 b/src/cpl/nuopc/lnd_comp_nuopc.F90 index 7fe93454ac..9631e807cd 100644 --- a/src/cpl/nuopc/lnd_comp_nuopc.F90 +++ b/src/cpl/nuopc/lnd_comp_nuopc.F90 @@ -235,7 +235,7 @@ subroutine InitializeAdvertise(gcomp, importState, exportState, clock, rc) if (ChkErr(rc,__LINE__,u_FILE_u)) return ! Note still need compid for those parts of the code that use the data model - ! functionality through subroutine calls + ! functionality through subroutine calls (MCTID just means the Model ComonenT IDentification number) call NUOPC_CompAttributeGet(gcomp, name='MCTID', value=cvalue, rc=rc) if (ChkErr(rc,__LINE__,u_FILE_u)) return read(cvalue,*) compid ! convert from string to integer From ae600d5f5553ec10c5c1b1ed582e7c4bd69273cd Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Sat, 2 Nov 2024 01:04:24 -0600 Subject: [PATCH 172/243] Add test for valid driver option --- 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 2d848b38a5..b6ce7021c6 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 = 3229; +my $ntests = 3230; if ( defined($opts{'compare'}) ) { $ntests += 2437; @@ -922,6 +922,10 @@ sub cat_and_create_namelistinfile { namelst=>"", phys=>"clm6_0", }, + "driver is invalid" =>{ options=>"-driver invalid_name -envxml_dir .", + namelst=>"", + phys=>"clm6_0", + }, "lnd_frac not set but lilac"=>{ options=>"-driver nuopc -lilac -envxml_dir . -lnd_frac UNSET", namelst=>"fsurdat='surfdata.nc'", phys=>"clm6_0", From d38b3a5d6c277b8ea5dee21a02b269c11eb64ff7 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Sat, 2 Nov 2024 01:16:29 -0600 Subject: [PATCH 173/243] Some adjustments to make lilac clearer, also add checking for an invalid driver option --- bld/CLMBuildNamelist.pm | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index 32204388f3..2018475311 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 LILAC) + -lnd_frac "domainfile" Land fraction file (the input domain file) (only needed with --lilac option) -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) @@ -1989,7 +1989,7 @@ sub setup_logic_lnd_frac { "env variables) AND fatmlndfrac on namelist"); } if ( $opts->{$var} =~ /UNSET/ ) { - $log->fatal_error("-lnd_frac was set as UNSET in the CTSM build-namelist set it with the env variables: LND_DOMAIN_PATH/LND_DOMAIN_FILE."); + $log->fatal_error("-lnd_frac was set as UNSET in the CTSM build-namelist, it's required with the --lilac option"); } my $lnd_frac = SetupTools::expand_xml_var( $opts->{$var}, $envxml_ref); add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'fatmlndfrc','val'=>$lnd_frac ); @@ -1999,20 +1999,22 @@ sub setup_logic_lnd_frac { if (defined $nl->get_value('fatmlndfrc')) { # do nothing - use value provided by config_grid.xml and clm.cpl7.template } else { - $log->fatal_error("fatmlndfrc was NOT sent into CLM build-namelist."); + $log->fatal_error("fatmlndfrc was NOT sent into CLM build-namelist, it is required for the --lilac option."); } # # For the NUOPC driver neither lnd_frac nor fatmlndfrc need to be set # - } else { + } elsif ($opts->{'driver'} eq "nuopc" ) { if ( defined($opts->{$var}) ) { if ( $opts->{$var} !~ /UNSET/ ) { - $log->fatal_error("$var should NOT be set for the NUOPC driver as it is unused" ); + $log->fatal_error("$var should NOT be set for the NUOPC driver as it is unused (only used by the --lilac option)" ); } } if ( defined($nl->get_value('fatmlndfrc')) ) { $log->fatal_error("fatmlndfrac should NOT be set in the namelist for the NUOPC driver as it is unused" ); } + } else { + $log->fatal_error("Input --driver type of $opts->{'driver'} is an invalid option. Correct this in xml variable COMP_iINTERFACE in your case" ); } } @@ -2760,7 +2762,7 @@ SIMYR: foreach my $sim_yr ( @sim_years ) { # 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, even if the initial conditions (finidat) file has hillslope information. If you are sure you want this behaviour, add -ignore_warnings to CLM_BLDNML_OPTS.") - } +} } # end initial conditions From 933abaeac41b4e2a5f03ceccd8029f3d35410834 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Sat, 2 Nov 2024 02:14:10 -0600 Subject: [PATCH 174/243] Update ccs_config --- ccs_config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ccs_config b/ccs_config index e4ac80ef14..775e9f7900 160000 --- a/ccs_config +++ b/ccs_config @@ -1 +1 @@ -Subproject commit e4ac80ef142954e582b4065222145352f22cd3a4 +Subproject commit 775e9f790044c3632e70e2beda9d66db34558b7b From 38f11c2d4d7eff409c4069fa06baf60dec1587d9 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 6 Nov 2024 11:01:18 -0700 Subject: [PATCH 175/243] Update mpi-serial to version that builds on Izumi --- .gitmodules | 2 +- libraries/mpi-serial | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitmodules b/.gitmodules index 78a24f5789..e812c4c63a 100644 --- a/.gitmodules +++ b/.gitmodules @@ -116,7 +116,7 @@ fxDONOTUSEurl = https://github.com/NCAR/ParallelIO [submodule "mpi-serial"] path = libraries/mpi-serial url = https://github.com/ESMCI/mpi-serial -fxtag = MPIserial_2.5.0 +fxtag = MPIserial_2.5.1 fxrequired = ToplevelRequired # Standard Fork to compare to with "git fleximod test" to ensure personal forks aren't committed fxDONOTUSEurl = https://github.com/ESMCI/mpi-serial diff --git a/libraries/mpi-serial b/libraries/mpi-serial index 2c44fb3d32..39416b7546 160000 --- a/libraries/mpi-serial +++ b/libraries/mpi-serial @@ -1 +1 @@ -Subproject commit 2c44fb3d327be7c6429894bc5d4de769f3486848 +Subproject commit 39416b754652bd281a89e86b37734aa5f3ffafd6 From a4d23b512a9173af78cd00d182bbcedd332f7f38 Mon Sep 17 00:00:00 2001 From: Keith Oleson Date: Mon, 4 Nov 2024 13:29:54 -0700 Subject: [PATCH 176/243] Make ALBGRD and ALBGRI active by default --- src/biogeophys/SurfaceAlbedoType.F90 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/biogeophys/SurfaceAlbedoType.F90 b/src/biogeophys/SurfaceAlbedoType.F90 index e90caeecbb..10819a47b6 100644 --- a/src/biogeophys/SurfaceAlbedoType.F90 +++ b/src/biogeophys/SurfaceAlbedoType.F90 @@ -242,12 +242,12 @@ subroutine InitHistory(this, bounds) this%albgrd_col(begc:endc,:) = spval call hist_addfld2d (fname='ALBGRD', units='proportion', type2d='numrad', & avgflag='A', long_name='ground albedo (direct)', & - ptr_col=this%albgrd_col, default='inactive') + ptr_col=this%albgrd_col, default='active') this%albgri_col(begc:endc,:) = spval call hist_addfld2d (fname='ALBGRI', units='proportion', type2d='numrad', & avgflag='A', long_name='ground albedo (indirect)', & - ptr_col=this%albgri_col, default='inactive') + ptr_col=this%albgri_col, default='active') if (use_SSRE) then this%albdSF_patch(begp:endp,:) = spval From e72e947773ce7ca6035c7ba37fc58072c080ae17 Mon Sep 17 00:00:00 2001 From: Keith Oleson Date: Wed, 6 Nov 2024 12:37:51 -0700 Subject: [PATCH 177/243] Implement urbanl and urbanc coszen filters --- src/biogeophys/UrbanAlbedoMod.F90 | 219 +++++++++++++++++------------- 1 file changed, 122 insertions(+), 97 deletions(-) diff --git a/src/biogeophys/UrbanAlbedoMod.F90 b/src/biogeophys/UrbanAlbedoMod.F90 index 2e854a0497..25555b2da8 100644 --- a/src/biogeophys/UrbanAlbedoMod.F90 +++ b/src/biogeophys/UrbanAlbedoMod.F90 @@ -78,9 +78,14 @@ subroutine UrbanAlbedo (bounds, num_urbanl, filter_urbanl, & type(surfalb_type) , intent(inout) :: surfalb_inst ! ! !LOCAL VARIABLES: - integer :: fl,fp,fc,g,l,p,c,ib ! indices + integer :: fl,fp,fc,g,l,p,c,ib,f,fn ! indices and counters integer :: ic ! 0=unit incoming direct; 1=unit incoming diffuse - integer :: num_solar ! counter + integer, allocatable :: filter_urbanl_coszen_gt0(:) ! filter for urban landunits with coszen > 0 + integer :: num_urbanl_coszen_gt0 ! number of urban landunits with coszen > 0 + integer, allocatable :: filter_nourbanl_coszen_gt0(:) ! filter for urban landunits with coszen <= 0 + integer :: num_nourbanl_coszen_gt0 ! number of urban landunits with coszen <= 0 + integer, allocatable :: filter_urbanc_coszen_gt0(:) ! filter for urban columns with coszen > 0 + integer :: num_urbanc_coszen_gt0 ! number of urban columns with coszen > 0 real(r8) :: coszen (bounds%begl:bounds%endl) ! cosine solar zenith angle for next time step (landunit) real(r8) :: zen (bounds%begl:bounds%endl) ! solar zenith angle (radians) real(r8) :: sdir (bounds%begl:bounds%endl, numrad) ! direct beam solar radiation on horizontal surface @@ -165,9 +170,19 @@ subroutine UrbanAlbedo (bounds, num_urbanl, filter_urbanl, & begl => bounds%begl , & vf_sr => urbanparams_inst%vf_sr , & ! Input: [real(r8) (:) ] view factor of sky for road vf_sw => urbanparams_inst%vf_sw , & ! Input: [real(r8) (:) ] view factor of sky for one wall - endl => bounds%endl & + endl => bounds%endl , & + begc => bounds%begc , & + endc => bounds%endc & ) + !TODO KO - Indentation needs to be done properly throughout this module. Will do later + ! to make the changes easier to review now. + + ! Allocate urbanl and urbanc coszen filters + allocate(filter_urbanl_coszen_gt0(bounds%endl-bounds%begl+1)) + allocate(filter_nourbanl_coszen_gt0(bounds%endl-bounds%begl+1)) + allocate(filter_urbanc_coszen_gt0(bounds%endc-bounds%begc+1)) + ! ---------------------------------------------------------------------------- ! Solar declination and cosine solar zenith angle and zenith angle for ! next time step @@ -228,15 +243,36 @@ subroutine UrbanAlbedo (bounds, num_urbanl, filter_urbanl, & end do end do - ! ---------------------------------------------------------------------------- - ! Urban Code - ! ---------------------------------------------------------------------------- - - num_solar = 0 + ! Populate urbanl and urbanc coszen filters + f = 0 + fn = 0 do fl = 1,num_urbanl l = filter_urbanl(fl) - if (coszen(l) > 0._r8) num_solar = num_solar + 1 + if (coszen(l) > 0._r8) then + f = f + 1 + filter_urbanl_coszen_gt0(f) = l + else + fn = fn + 1 + filter_nourbanl_coszen_gt0(fn) = l + end if end do + num_urbanl_coszen_gt0 = f + num_nourbanl_coszen_gt0 = fn + + f = 0 + do fc = 1,num_urbanc + c = filter_urbanc(fc) + l = col%landunit(c) + if (coszen(l) > 0._r8) then + f = f + 1 + filter_urbanc_coszen_gt0(f) = c + end if + end do + num_urbanc_coszen_gt0 = f + + ! ---------------------------------------------------------------------------- + ! Urban Code + ! ---------------------------------------------------------------------------- do ib = 1,numrad do fl = 1,num_urbanl @@ -267,16 +303,15 @@ subroutine UrbanAlbedo (bounds, num_urbanl, filter_urbanl, & end do ! ---------------------------------------------------------------------------- - ! Only do the rest if all coszen are positive + ! Use the urban coszen filters to only calculate quantities when coszen > 0 ! ---------------------------------------------------------------------------- - if (num_solar > 0)then ! Set constants - solar fluxes are per unit incoming flux do ib = 1,numrad - do fl = 1,num_urbanl - l = filter_urbanl(fl) + do fl = 1,num_urbanl_coszen_gt0 + l = filter_urbanl_coszen_gt0(fl) sdir(l,ib) = 1._r8 sdif(l,ib) = 1._r8 end do @@ -287,9 +322,11 @@ subroutine UrbanAlbedo (bounds, num_urbanl, filter_urbanl, & if (num_urbanl > 0) then call incident_direct (bounds, & - num_urbanl, filter_urbanl, & + num_urbanl_coszen_gt0, & + filter_urbanl_coszen_gt0, & + num_nourbanl_coszen_gt0, & + filter_nourbanl_coszen_gt0, & canyon_hwr(begl:endl), & - coszen(begl:endl), & zen(begl:endl), & sdir(begl:endl, :), & sdir_road(begl:endl, :), & @@ -300,9 +337,10 @@ subroutine UrbanAlbedo (bounds, num_urbanl, filter_urbanl, & ! Incident diffuse radiation for ! (a) roof and (b) road and both walls in urban canyon. - if (num_urbanl > 0) then + if (num_urbanl_coszen_gt0 > 0) then call incident_diffuse (bounds, & - num_urbanl, filter_urbanl, & + num_urbanl_coszen_gt0, & + filter_urbanl_coszen_gt0, & canyon_hwr(begl:endl), & sdif(begl:endl, :), & sdif_road(begl:endl, :), & @@ -316,7 +354,8 @@ subroutine UrbanAlbedo (bounds, num_urbanl, filter_urbanl, & ic = 0 call SnowAlbedo(bounds, & num_urbanc, filter_urbanc, & - coszen(begl:endl), & + num_urbanc_coszen_gt0, & + filter_urbanc_coszen_gt0, & ic, & albsnd_roof(begl:endl, :), & albsnd_improad(begl:endl, :), & @@ -326,7 +365,8 @@ subroutine UrbanAlbedo (bounds, num_urbanl, filter_urbanl, & ic = 1 call SnowAlbedo(bounds, & num_urbanc, filter_urbanc, & - coszen(begl:endl), & + num_urbanc_coszen_gt0, & + filter_urbanc_coszen_gt0, & ic, & albsni_roof(begl:endl, :), & albsni_improad(begl:endl, :), & @@ -336,8 +376,8 @@ subroutine UrbanAlbedo (bounds, num_urbanl, filter_urbanl, & ! Combine snow-free and snow albedos do ib = 1,numrad - do fc = 1,num_urbanc - c = filter_urbanc(fc) + do fc = 1,num_urbanc_coszen_gt0 + c = filter_urbanc_coszen_gt0(fc) l = col%landunit(c) if (ctype(c) == icol_roof) then alb_roof_dir_s(l,ib) = alb_roof_dir(l,ib)*(1._r8-frac_sno(c)) & @@ -362,10 +402,10 @@ subroutine UrbanAlbedo (bounds, num_urbanl, filter_urbanl, & ! for road and both walls in urban canyon allowing for multiple reflection ! Reflected and absorbed solar radiation per unit incident radiation for roof - if (num_urbanl > 0) then + if (num_urbanl_coszen_gt0 > 0) then call net_solar (bounds, & - num_urbanl, filter_urbanl, & - coszen (begl:endl), & + num_urbanl_coszen_gt0, & + filter_urbanl_coszen_gt0, & canyon_hwr (begl:endl), & wtroad_perv (begl:endl), & sdir (begl:endl, :), & @@ -423,6 +463,7 @@ subroutine UrbanAlbedo (bounds, num_urbanl, filter_urbanl, & albgrd(c,ib) = sref_improad_dir(l,ib) albgri(c,ib) = sref_improad_dif(l,ib) endif + !TODO KO - Clean up these SNICAR comments (not needed?) ! add new snicar albedo variables for history fields if (coszen(l) > 0._r8) then albgrd_hst(c,ib) = albgrd(c,ib) @@ -444,7 +485,6 @@ subroutine UrbanAlbedo (bounds, num_urbanl, filter_urbanl, & ! end add new snicar end do end do - end if end associate @@ -452,7 +492,7 @@ end subroutine UrbanAlbedo !----------------------------------------------------------------------- subroutine SnowAlbedo (bounds , & - num_urbanc, filter_urbanc, coszen, ind , & + num_urbanc, filter_urbanc, num_urbanc_coszen_gt0, filter_urbanc_coszen_gt0, ind , & albsn_roof, albsn_improad, albsn_perroad, & waterstatebulk_inst) ! @@ -466,8 +506,9 @@ subroutine SnowAlbedo (bounds , & type(bounds_type), intent(in) :: bounds integer , intent(in) :: num_urbanc ! number of urban columns in clump integer , intent(in) :: filter_urbanc(:) ! urban column filter + integer , intent(in) :: num_urbanc_coszen_gt0 ! number of urban columns with coszen > 0 + integer , intent(in) :: filter_urbanc_coszen_gt0(:) ! filter for urban columns with coszen > 0 integer , intent(in) :: ind ! 0=direct beam, 1=diffuse radiation - real(r8), intent(in) :: coszen ( bounds%begl: ) ! cosine solar zenith angle [landunit] real(r8), intent(out):: albsn_roof ( bounds%begl: , 1: ) ! roof snow albedo by waveband [landunit, numrad] real(r8), intent(out):: albsn_improad ( bounds%begl: , 1: ) ! impervious road snow albedo by waveband [landunit, numrad] real(r8), intent(out):: albsn_perroad ( bounds%begl: , 1: ) ! pervious road snow albedo by waveband [landunit, numrad] @@ -488,7 +529,6 @@ subroutine SnowAlbedo (bounds , & SHR_ASSERT_ALL_FL(numrad == 2, sourcefile, __LINE__) ! Enforce expected array sizes - SHR_ASSERT_ALL_FL((ubound(coszen) == (/bounds%endl/)), sourcefile, __LINE__) SHR_ASSERT_ALL_FL((ubound(albsn_roof) == (/bounds%endl, numrad/)), sourcefile, __LINE__) SHR_ASSERT_ALL_FL((ubound(albsn_improad) == (/bounds%endl, numrad/)), sourcefile, __LINE__) SHR_ASSERT_ALL_FL((ubound(albsn_perroad) == (/bounds%endl, numrad/)), sourcefile, __LINE__) @@ -497,10 +537,10 @@ subroutine SnowAlbedo (bounds , & caller = 'UrbanAlbedoMod:SnowAlbedo', & h2osno_total = h2osno_total(bounds%begc:bounds%endc)) - do fc = 1,num_urbanc - c = filter_urbanc(fc) + do fc = 1,num_urbanc_coszen_gt0 + c = filter_urbanc_coszen_gt0(fc) l = col%landunit(c) - if (coszen(l) > 0._r8 .and. h2osno_total(c) > 0._r8) then + if (h2osno_total(c) > 0._r8) then if (col%itype(c) == icol_roof) then albsn_roof(l,1) = snal0 albsn_roof(l,2) = snal1 @@ -528,8 +568,9 @@ subroutine SnowAlbedo (bounds , & end subroutine SnowAlbedo !----------------------------------------------------------------------- - subroutine incident_direct (bounds , & - num_urbanl, filter_urbanl, canyon_hwr, coszen, zen , & + subroutine incident_direct (bounds, & + num_urbanl_coszen_gt0, filter_urbanl_coszen_gt0, & + num_nourbanl_coszen_gt0, filter_nourbanl_coszen_gt0, canyon_hwr, zen, & sdir, sdir_road, sdir_sunwall, sdir_shadewall) ! ! !DESCRIPTION: @@ -567,10 +608,11 @@ subroutine incident_direct (bounds , & ! ! !ARGUMENTS: type(bounds_type), intent(in) :: bounds - integer , intent(in) :: num_urbanl ! number of urban landunits - integer , intent(in) :: filter_urbanl(:) ! urban landunit filter + integer , intent(in) :: num_urbanl_coszen_gt0 ! number of urban landunits with coszen > 0 + integer , intent(in) :: filter_urbanl_coszen_gt0(:) ! filter for urban landunits with coszen > 0 + integer , intent(in) :: num_nourbanl_coszen_gt0 ! number of urban landunits with coszen <= 0 + integer , intent(in) :: filter_nourbanl_coszen_gt0(:) ! filter for urban landunits with coszen <= 0 real(r8), intent(in) :: canyon_hwr( bounds%begl: ) ! ratio of building height to street width [landunit] - real(r8), intent(in) :: coszen( bounds%begl: ) ! cosine solar zenith angle [landunit] real(r8), intent(in) :: zen( bounds%begl: ) ! solar zenith angle (radians) [landunit] real(r8), intent(in) :: sdir( bounds%begl: , 1: ) ! direct beam solar radiation incident on horizontal surface [landunit, numrad] real(r8), intent(out) :: sdir_road( bounds%begl: , 1: ) ! direct beam solar radiation incident on road per unit incident flux [landunit, numrad] @@ -595,26 +637,22 @@ subroutine incident_direct (bounds , & ! Enforce expected array sizes SHR_ASSERT_ALL_FL((ubound(canyon_hwr) == (/bounds%endl/)), sourcefile, __LINE__) - SHR_ASSERT_ALL_FL((ubound(coszen) == (/bounds%endl/)), sourcefile, __LINE__) SHR_ASSERT_ALL_FL((ubound(zen) == (/bounds%endl/)), sourcefile, __LINE__) SHR_ASSERT_ALL_FL((ubound(sdir) == (/bounds%endl, numrad/)), sourcefile, __LINE__) SHR_ASSERT_ALL_FL((ubound(sdir_road) == (/bounds%endl, numrad/)), sourcefile, __LINE__) SHR_ASSERT_ALL_FL((ubound(sdir_sunwall) == (/bounds%endl, numrad/)), sourcefile, __LINE__) SHR_ASSERT_ALL_FL((ubound(sdir_shadewall) == (/bounds%endl, numrad/)), sourcefile, __LINE__) - do fl = 1,num_urbanl - l = filter_urbanl(fl) - if (coszen(l) > 0._r8) then - theta0(l) = asin(min( (1._r8/(canyon_hwr(l)*tan(max(zen(l),0.000001_r8)))), 1._r8 )) - tanzen(l) = tan(zen(l)) - end if + do fl = 1,num_urbanl_coszen_gt0 + l = filter_urbanl_coszen_gt0(fl) + theta0(l) = asin(min( (1._r8/(canyon_hwr(l)*tan(max(zen(l),0.000001_r8)))), 1._r8 )) + tanzen(l) = tan(zen(l)) end do do ib = 1,numrad - do fl = 1,num_urbanl - l = filter_urbanl(fl) - if (coszen(l) > 0._r8) then + do fl = 1,num_urbanl_coszen_gt0 + l = filter_urbanl_coszen_gt0(fl) sdir_shadewall(l,ib) = 0._r8 ! incident solar radiation on wall and road integrated over all canyon orientations (0 <= theta <= pi/2) @@ -628,21 +666,20 @@ subroutine incident_direct (bounds , & swall_projected = (sdir_shadewall(l,ib) + sdir_sunwall(l,ib)) * canyon_hwr(l) err1(l) = sdir(l,ib) - (sdir_road(l,ib) + swall_projected) - else - sdir_road(l,ib) = 0._r8 - sdir_sunwall(l,ib) = 0._r8 - sdir_shadewall(l,ib) = 0._r8 - endif + end do + do fl = 1,num_nourbanl_coszen_gt0 + l = filter_nourbanl_coszen_gt0(fl) + sdir_road(l,ib) = 0._r8 + sdir_sunwall(l,ib) = 0._r8 + sdir_shadewall(l,ib) = 0._r8 end do - do fl = 1,num_urbanl - l = filter_urbanl(fl) - if (coszen(l) > 0._r8) then - if (abs(err1(l)) > 0.001_r8) then - write (iulog,*) 'urban direct beam solar radiation balance error',err1(l) - write (iulog,*) 'clm model is stopping' - call endrun(subgrid_index=l, subgrid_level=subgrid_level_landunit, msg=errmsg(sourcefile, __LINE__)) - endif + do fl = 1,num_urbanl_coszen_gt0 + l = filter_urbanl_coszen_gt0(fl) + if (abs(err1(l)) > 0.001_r8) then + write (iulog,*) 'urban direct beam solar radiation balance error',err1(l) + write (iulog,*) 'clm model is stopping' + call endrun(subgrid_index=l, subgrid_level=subgrid_level_landunit, msg=errmsg(sourcefile, __LINE__)) endif end do @@ -650,9 +687,8 @@ subroutine incident_direct (bounds , & ! sum sroad and swall over all canyon orientations (0 <= theta <= pi/2) if (numchk) then - do fl = 1,num_urbanl - l = filter_urbanl(fl) - if (coszen(l) > 0._r8) then + do fl = 1,num_urbanl_coszen_gt0 + l = filter_urbanl_coszen_gt0(fl) sumr = 0._r8 sumw = 0._r8 num = 0._r8 @@ -670,11 +706,9 @@ subroutine incident_direct (bounds , & end do err2(l) = sumr/num - sdir_road(l,ib) err3(l) = sumw/num - sdir_sunwall(l,ib) - endif end do - do fl = 1,num_urbanl - l = filter_urbanl(fl) - if (coszen(l) > 0._r8) then + do fl = 1,num_urbanl_coszen_gt0 + l = filter_urbanl_coszen_gt0(fl) if (abs(err2(l)) > 0.0006_r8 ) then write (iulog,*) 'urban road incident direct beam solar radiation error',err2(l) write (iulog,*) 'clm model is stopping' @@ -685,7 +719,6 @@ subroutine incident_direct (bounds , & write (iulog,*) 'clm model is stopping' call endrun(subgrid_index=l, subgrid_level=subgrid_level_landunit, msg=errmsg(sourcefile, __LINE__)) end if - end if end do end if @@ -695,7 +728,7 @@ end subroutine incident_direct !----------------------------------------------------------------------- subroutine incident_diffuse (bounds, & - num_urbanl, filter_urbanl, canyon_hwr, & + num_urbanl_coszen_gt0, filter_urbanl_coszen_gt0, canyon_hwr, & sdif, sdif_road, sdif_sunwall, sdif_shadewall, & urbanparams_inst) ! @@ -707,8 +740,8 @@ subroutine incident_diffuse (bounds, & ! ! !ARGUMENTS: type(bounds_type) , intent(in) :: bounds - integer , intent(in) :: num_urbanl ! number of urban landunits - integer , intent(in) :: filter_urbanl(:) ! urban landunit filter + integer , intent(in) :: num_urbanl_coszen_gt0 ! number of urban landunits with coszen > 0 + integer , intent(in) :: filter_urbanl_coszen_gt0(:) ! filter for urban landunits with coszen > 0 real(r8) , intent(in) :: canyon_hwr ( bounds%begl: ) ! ratio of building height to street width [landunit] real(r8) , intent(in) :: sdif ( bounds%begl: , 1: ) ! diffuse solar radiation incident on horizontal surface [landunit, numrad] real(r8) , intent(out) :: sdif_road ( bounds%begl: , 1: ) ! diffuse solar radiation incident on road [landunit, numrad] @@ -738,8 +771,8 @@ subroutine incident_diffuse (bounds, & ! diffuse solar and conservation check. need to convert wall fluxes to ground area - do fl = 1,num_urbanl - l = filter_urbanl(fl) + do fl = 1,num_urbanl_coszen_gt0 + l = filter_urbanl_coszen_gt0(fl) sdif_road(l,ib) = sdif(l,ib) * vf_sr(l) sdif_sunwall(l,ib) = sdif(l,ib) * vf_sw(l) sdif_shadewall(l,ib) = sdif(l,ib) * vf_sw(l) @@ -750,8 +783,8 @@ subroutine incident_diffuse (bounds, & ! error check - do fl = 1, num_urbanl - l = filter_urbanl(fl) + do fl = 1, num_urbanl_coszen_gt0 + l = filter_urbanl_coszen_gt0(fl) if (abs(err(l)) > 0.001_r8) then write (iulog,*) 'urban diffuse solar radiation balance error',err(l) write (iulog,*) 'clm model is stopping' @@ -767,7 +800,7 @@ end subroutine incident_diffuse !----------------------------------------------------------------------- subroutine net_solar (bounds , & - num_urbanl, filter_urbanl, coszen, canyon_hwr, wtroad_perv, sdir, sdif , & + num_urbanl_coszen_gt0, filter_urbanl_coszen_gt0, canyon_hwr, wtroad_perv, sdir, sdif , & alb_improad_dir, alb_perroad_dir, alb_wall_dir, alb_roof_dir , & alb_improad_dif, alb_perroad_dif, alb_wall_dif, alb_roof_dif , & sdir_road, sdir_sunwall, sdir_shadewall, & @@ -782,9 +815,8 @@ subroutine net_solar (bounds ! ! !ARGUMENTS: type (bounds_type), intent(in) :: bounds - integer , intent(in) :: num_urbanl ! number of urban landunits - integer , intent(in) :: filter_urbanl(:) ! urban landunit filter - real(r8), intent(in) :: coszen ( bounds%begl: ) ! cosine solar zenith angle [landunit] + integer, intent(in) :: num_urbanl_coszen_gt0 ! number of urban landunits with coszen > 0 + integer, intent(in) :: filter_urbanl_coszen_gt0(:) ! filter for urban landunits with coszen > 0 real(r8), intent(in) :: canyon_hwr ( bounds%begl: ) ! ratio of building height to street width [landunit] real(r8), intent(in) :: wtroad_perv ( bounds%begl: ) ! weight of pervious road wrt total road [landunit] real(r8), intent(in) :: sdir ( bounds%begl: , 1: ) ! direct beam solar radiation incident on horizontal surface [landunit, numrad] @@ -897,7 +929,6 @@ subroutine net_solar (bounds !----------------------------------------------------------------------- ! Enforce expected array sizes - SHR_ASSERT_ALL_FL((ubound(coszen) == (/bounds%endl/)), sourcefile, __LINE__) SHR_ASSERT_ALL_FL((ubound(canyon_hwr) == (/bounds%endl/)), sourcefile, __LINE__) SHR_ASSERT_ALL_FL((ubound(wtroad_perv) == (/bounds%endl/)), sourcefile, __LINE__) SHR_ASSERT_ALL_FL((ubound(sdir) == (/bounds%endl, numrad/)), sourcefile, __LINE__) @@ -948,15 +979,14 @@ subroutine net_solar (bounds ! Calculate impervious road - do fl = 1,num_urbanl - l = filter_urbanl(fl) + do fl = 1,num_urbanl_coszen_gt0 + l = filter_urbanl_coszen_gt0(fl) wtroad_imperv(l) = 1._r8 - wtroad_perv(l) end do do ib = 1,numrad - do fl = 1,num_urbanl - l = filter_urbanl(fl) - if (coszen(l) > 0._r8) then + do fl = 1,num_urbanl_coszen_gt0 + l = filter_urbanl_coszen_gt0(fl) ! initial absorption and reflection for road and both walls. ! distribute reflected radiation to sky, road, and walls @@ -1057,7 +1087,6 @@ subroutine net_solar (bounds sref_perroad_dif(l,ib) = perroad_r_sky_dif(l) sref_sunwall_dif(l,ib) = sunwall_r_sky_dif(l) sref_shadewall_dif(l,ib) = shadewall_r_sky_dif(l) - endif end do @@ -1080,9 +1109,8 @@ subroutine net_solar (bounds ! ! do separately for direct beam and diffuse - do fl = 1,num_urbanl - l = filter_urbanl(fl) - if (coszen(l) > 0._r8) then + do fl = 1,num_urbanl_coszen_gt0 + l = filter_urbanl_coszen_gt0(fl) ! reflected direct beam @@ -1279,20 +1307,17 @@ subroutine net_solar (bounds canyon_alb_dif(l) = sref_canyon_dif(l) / max(stot_dif(l), 1.e-06_r8) canyon_alb_dir(l) = sref_canyon_dir(l) / max(stot_dir(l), 1.e-06_r8) - end if end do ! end of landunit loop ! Refected and absorbed solar radiation per unit incident radiation for roof - do fl = 1,num_urbanl - l = filter_urbanl(fl) - if (coszen(l) > 0._r8) then - sref_roof_dir(l,ib) = alb_roof_dir(l,ib) * sdir(l,ib) - sref_roof_dif(l,ib) = alb_roof_dif(l,ib) * sdif(l,ib) - sabs_roof_dir(l,ib) = sdir(l,ib) - sref_roof_dir(l,ib) - sabs_roof_dif(l,ib) = sdif(l,ib) - sref_roof_dif(l,ib) - end if + do fl = 1,num_urbanl_coszen_gt0 + l = filter_urbanl_coszen_gt0(fl) + sref_roof_dir(l,ib) = alb_roof_dir(l,ib) * sdir(l,ib) + sref_roof_dif(l,ib) = alb_roof_dif(l,ib) * sdif(l,ib) + sabs_roof_dir(l,ib) = sdir(l,ib) - sref_roof_dir(l,ib) + sabs_roof_dif(l,ib) = sdif(l,ib) - sref_roof_dif(l,ib) end do end do ! end of radiation band loop From 956d41d7bfeb94d6d15a4999a614ba16a621d2b2 Mon Sep 17 00:00:00 2001 From: Adrianna Foster Date: Thu, 7 Nov 2024 13:28:38 -0700 Subject: [PATCH 178/243] adding 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 7049e9672b..ba7b945767 100644 --- a/cime_config/testdefs/ExpectedTestFails.xml +++ b/cime_config/testdefs/ExpectedTestFails.xml @@ -188,6 +188,13 @@ #2454 + + + + FAIL + #2867 + + From 58ae949b74d82f52d1c2e93ef211b669ae870f80 Mon Sep 17 00:00:00 2001 From: Keith Oleson Date: Thu, 7 Nov 2024 17:52:24 -0700 Subject: [PATCH 179/243] Fix indentation --- src/biogeophys/UrbanAlbedoMod.F90 | 960 +++++++++++++++--------------- 1 file changed, 476 insertions(+), 484 deletions(-) diff --git a/src/biogeophys/UrbanAlbedoMod.F90 b/src/biogeophys/UrbanAlbedoMod.F90 index 25555b2da8..3e84f73176 100644 --- a/src/biogeophys/UrbanAlbedoMod.F90 +++ b/src/biogeophys/UrbanAlbedoMod.F90 @@ -175,9 +175,6 @@ subroutine UrbanAlbedo (bounds, num_urbanl, filter_urbanl, & endc => bounds%endc & ) - !TODO KO - Indentation needs to be done properly throughout this module. Will do later - ! to make the changes easier to review now. - ! Allocate urbanl and urbanc coszen filters allocate(filter_urbanl_coszen_gt0(bounds%endl-bounds%begl+1)) allocate(filter_nourbanl_coszen_gt0(bounds%endl-bounds%begl+1)) @@ -307,184 +304,179 @@ subroutine UrbanAlbedo (bounds, num_urbanl, filter_urbanl, & ! ---------------------------------------------------------------------------- - ! Set constants - solar fluxes are per unit incoming flux + ! Set constants - solar fluxes are per unit incoming flux - do ib = 1,numrad - do fl = 1,num_urbanl_coszen_gt0 - l = filter_urbanl_coszen_gt0(fl) - sdir(l,ib) = 1._r8 - sdif(l,ib) = 1._r8 - end do + do ib = 1,numrad + do fl = 1,num_urbanl_coszen_gt0 + l = filter_urbanl_coszen_gt0(fl) + sdir(l,ib) = 1._r8 + sdif(l,ib) = 1._r8 end do + end do - ! Incident direct beam radiation for - ! (a) roof and (b) road and both walls in urban canyon - - if (num_urbanl > 0) then - call incident_direct (bounds, & - num_urbanl_coszen_gt0, & - filter_urbanl_coszen_gt0, & - num_nourbanl_coszen_gt0, & - filter_nourbanl_coszen_gt0, & - canyon_hwr(begl:endl), & - zen(begl:endl), & - sdir(begl:endl, :), & - sdir_road(begl:endl, :), & - sdir_sunwall(begl:endl, :), & - sdir_shadewall(begl:endl, :)) - end if - - ! Incident diffuse radiation for - ! (a) roof and (b) road and both walls in urban canyon. - - if (num_urbanl_coszen_gt0 > 0) then - call incident_diffuse (bounds, & - num_urbanl_coszen_gt0, & - filter_urbanl_coszen_gt0, & - canyon_hwr(begl:endl), & - sdif(begl:endl, :), & - sdif_road(begl:endl, :), & - sdif_sunwall(begl:endl, :), & - sdif_shadewall(begl:endl, :), & - urbanparams_inst) - end if - - ! Get snow albedos for roof and impervious and pervious road - if (num_urbanl > 0) then - ic = 0 - call SnowAlbedo(bounds, & - num_urbanc, filter_urbanc, & - num_urbanc_coszen_gt0, & - filter_urbanc_coszen_gt0, & - ic, & - albsnd_roof(begl:endl, :), & - albsnd_improad(begl:endl, :), & - albsnd_perroad(begl:endl, :), & - waterstatebulk_inst) - - ic = 1 - call SnowAlbedo(bounds, & - num_urbanc, filter_urbanc, & - num_urbanc_coszen_gt0, & - filter_urbanc_coszen_gt0, & - ic, & - albsni_roof(begl:endl, :), & - albsni_improad(begl:endl, :), & - albsni_perroad(begl:endl, :), & - waterstatebulk_inst) - end if - - ! Combine snow-free and snow albedos - do ib = 1,numrad - do fc = 1,num_urbanc_coszen_gt0 - c = filter_urbanc_coszen_gt0(fc) - l = col%landunit(c) - if (ctype(c) == icol_roof) then - alb_roof_dir_s(l,ib) = alb_roof_dir(l,ib)*(1._r8-frac_sno(c)) & - + albsnd_roof(l,ib)*frac_sno(c) - alb_roof_dif_s(l,ib) = alb_roof_dif(l,ib)*(1._r8-frac_sno(c)) & - + albsni_roof(l,ib)*frac_sno(c) - else if (ctype(c) == icol_road_imperv) then - alb_improad_dir_s(l,ib) = alb_improad_dir(l,ib)*(1._r8-frac_sno(c)) & - + albsnd_improad(l,ib)*frac_sno(c) - alb_improad_dif_s(l,ib) = alb_improad_dif(l,ib)*(1._r8-frac_sno(c)) & - + albsni_improad(l,ib)*frac_sno(c) - else if (ctype(c) == icol_road_perv) then - alb_perroad_dir_s(l,ib) = alb_perroad_dir(l,ib)*(1._r8-frac_sno(c)) & - + albsnd_perroad(l,ib)*frac_sno(c) - alb_perroad_dif_s(l,ib) = alb_perroad_dif(l,ib)*(1._r8-frac_sno(c)) & - + albsni_perroad(l,ib)*frac_sno(c) - end if - end do + ! Incident direct beam radiation for + ! (a) roof and (b) road and both walls in urban canyon + + if (num_urbanl > 0) then + call incident_direct (bounds, & + num_urbanl_coszen_gt0, & + filter_urbanl_coszen_gt0, & + num_nourbanl_coszen_gt0, & + filter_nourbanl_coszen_gt0, & + canyon_hwr(begl:endl), & + zen(begl:endl), & + sdir(begl:endl, :), & + sdir_road(begl:endl, :), & + sdir_sunwall(begl:endl, :), & + sdir_shadewall(begl:endl, :)) + end if + + ! Incident diffuse radiation for + ! (a) roof and (b) road and both walls in urban canyon. + + if (num_urbanl_coszen_gt0 > 0) then + call incident_diffuse (bounds, & + num_urbanl_coszen_gt0, & + filter_urbanl_coszen_gt0, & + canyon_hwr(begl:endl), & + sdif(begl:endl, :), & + sdif_road(begl:endl, :), & + sdif_sunwall(begl:endl, :), & + sdif_shadewall(begl:endl, :), & + urbanparams_inst) + end if + + ! Get snow albedos for roof and impervious and pervious road + if (num_urbanl > 0) then + ic = 0 + call SnowAlbedo(bounds, & + num_urbanc, filter_urbanc, & + num_urbanc_coszen_gt0, & + filter_urbanc_coszen_gt0, & + ic, & + albsnd_roof(begl:endl, :), & + albsnd_improad(begl:endl, :), & + albsnd_perroad(begl:endl, :), & + waterstatebulk_inst) + + ic = 1 + call SnowAlbedo(bounds, & + num_urbanc, filter_urbanc, & + num_urbanc_coszen_gt0, & + filter_urbanc_coszen_gt0, & + ic, & + albsni_roof(begl:endl, :), & + albsni_improad(begl:endl, :), & + albsni_perroad(begl:endl, :), & + waterstatebulk_inst) + end if + + ! Combine snow-free and snow albedos + do ib = 1,numrad + do fc = 1,num_urbanc_coszen_gt0 + c = filter_urbanc_coszen_gt0(fc) + l = col%landunit(c) + if (ctype(c) == icol_roof) then + alb_roof_dir_s(l,ib) = alb_roof_dir(l,ib)*(1._r8-frac_sno(c)) & + + albsnd_roof(l,ib)*frac_sno(c) + alb_roof_dif_s(l,ib) = alb_roof_dif(l,ib)*(1._r8-frac_sno(c)) & + + albsni_roof(l,ib)*frac_sno(c) + else if (ctype(c) == icol_road_imperv) then + alb_improad_dir_s(l,ib) = alb_improad_dir(l,ib)*(1._r8-frac_sno(c)) & + + albsnd_improad(l,ib)*frac_sno(c) + alb_improad_dif_s(l,ib) = alb_improad_dif(l,ib)*(1._r8-frac_sno(c)) & + + albsni_improad(l,ib)*frac_sno(c) + else if (ctype(c) == icol_road_perv) then + alb_perroad_dir_s(l,ib) = alb_perroad_dir(l,ib)*(1._r8-frac_sno(c)) & + + albsnd_perroad(l,ib)*frac_sno(c) + alb_perroad_dif_s(l,ib) = alb_perroad_dif(l,ib)*(1._r8-frac_sno(c)) & + + albsni_perroad(l,ib)*frac_sno(c) + end if end do + end do - ! Reflected and absorbed solar radiation per unit incident radiation - ! for road and both walls in urban canyon allowing for multiple reflection - ! Reflected and absorbed solar radiation per unit incident radiation for roof + ! Reflected and absorbed solar radiation per unit incident radiation + ! for road and both walls in urban canyon allowing for multiple reflection + ! Reflected and absorbed solar radiation per unit incident radiation for roof + + if (num_urbanl_coszen_gt0 > 0) then + call net_solar (bounds, & + num_urbanl_coszen_gt0, & + filter_urbanl_coszen_gt0, & + canyon_hwr (begl:endl), & + wtroad_perv (begl:endl), & + sdir (begl:endl, :), & + sdif (begl:endl, :), & + alb_improad_dir_s (begl:endl, :), & + alb_perroad_dir_s (begl:endl, :), & + alb_wall_dir (begl:endl, :), & + alb_roof_dir_s (begl:endl, :), & + alb_improad_dif_s (begl:endl, :), & + alb_perroad_dif_s (begl:endl, :), & + alb_wall_dif (begl:endl, :), & + alb_roof_dif_s (begl:endl, :), & + sdir_road (begl:endl, :), & + sdir_sunwall (begl:endl, :), & + sdir_shadewall (begl:endl, :), & + sdif_road (begl:endl, :), & + sdif_sunwall (begl:endl, :), & + sdif_shadewall (begl:endl, :), & + sref_improad_dir (begl:endl, :), & + sref_perroad_dir (begl:endl, :), & + sref_sunwall_dir (begl:endl, :), & + sref_shadewall_dir (begl:endl, :), & + sref_roof_dir (begl:endl, :), & + sref_improad_dif (begl:endl, :), & + sref_perroad_dif (begl:endl, :), & + sref_sunwall_dif (begl:endl, :), & + sref_shadewall_dif (begl:endl, :), & + sref_roof_dif (begl:endl, :), & + urbanparams_inst, solarabs_inst) + end if - if (num_urbanl_coszen_gt0 > 0) then - call net_solar (bounds, & - num_urbanl_coszen_gt0, & - filter_urbanl_coszen_gt0, & - canyon_hwr (begl:endl), & - wtroad_perv (begl:endl), & - sdir (begl:endl, :), & - sdif (begl:endl, :), & - alb_improad_dir_s (begl:endl, :), & - alb_perroad_dir_s (begl:endl, :), & - alb_wall_dir (begl:endl, :), & - alb_roof_dir_s (begl:endl, :), & - alb_improad_dif_s (begl:endl, :), & - alb_perroad_dif_s (begl:endl, :), & - alb_wall_dif (begl:endl, :), & - alb_roof_dif_s (begl:endl, :), & - sdir_road (begl:endl, :), & - sdir_sunwall (begl:endl, :), & - sdir_shadewall (begl:endl, :), & - sdif_road (begl:endl, :), & - sdif_sunwall (begl:endl, :), & - sdif_shadewall (begl:endl, :), & - sref_improad_dir (begl:endl, :), & - sref_perroad_dir (begl:endl, :), & - sref_sunwall_dir (begl:endl, :), & - sref_shadewall_dir (begl:endl, :), & - sref_roof_dir (begl:endl, :), & - sref_improad_dif (begl:endl, :), & - sref_perroad_dif (begl:endl, :), & - sref_sunwall_dif (begl:endl, :), & - sref_shadewall_dif (begl:endl, :), & - sref_roof_dif (begl:endl, :), & - urbanparams_inst, solarabs_inst) - end if + ! ---------------------------------------------------------------------------- + ! Map urban output to surfalb_inst components + ! ---------------------------------------------------------------------------- - ! ---------------------------------------------------------------------------- - ! Map urban output to surfalb_inst components - ! ---------------------------------------------------------------------------- - - ! Set albgrd and albgri (ground albedos) and albd and albi (surface albedos) - - do ib = 1,numrad - do fc = 1,num_urbanc - c = filter_urbanc(fc) - l = col%landunit(c) - if (ctype(c) == icol_roof) then - albgrd(c,ib) = sref_roof_dir(l,ib) - albgri(c,ib) = sref_roof_dif(l,ib) - else if (ctype(c) == icol_sunwall) then - albgrd(c,ib) = sref_sunwall_dir(l,ib) - albgri(c,ib) = sref_sunwall_dif(l,ib) - else if (ctype(c) == icol_shadewall) then - albgrd(c,ib) = sref_shadewall_dir(l,ib) - albgri(c,ib) = sref_shadewall_dif(l,ib) - else if (ctype(c) == icol_road_perv) then - albgrd(c,ib) = sref_perroad_dir(l,ib) - albgri(c,ib) = sref_perroad_dif(l,ib) - else if (ctype(c) == icol_road_imperv) then - albgrd(c,ib) = sref_improad_dir(l,ib) - albgri(c,ib) = sref_improad_dif(l,ib) - endif - !TODO KO - Clean up these SNICAR comments (not needed?) -! add new snicar albedo variables for history fields - if (coszen(l) > 0._r8) then - albgrd_hst(c,ib) = albgrd(c,ib) - albgri_hst(c,ib) = albgri(c,ib) - end if -! end add new snicar - end do - do fp = 1,num_urbanp - p = filter_urbanp(fp) - c = patch%column(p) - l = patch%landunit(p) - albd(p,ib) = albgrd(c,ib) - albi(p,ib) = albgri(c,ib) -! add new snicar albedo variables for history fields - if (coszen(l) > 0._r8) then - albd_hst(p,ib) = albd(p,ib) - albi_hst(p,ib) = albi(p,ib) - end if -! end add new snicar - end do + ! Set albgrd and albgri (ground albedos) and albd and albi (surface albedos) + + do ib = 1,numrad + do fc = 1,num_urbanc + c = filter_urbanc(fc) + l = col%landunit(c) + if (ctype(c) == icol_roof) then + albgrd(c,ib) = sref_roof_dir(l,ib) + albgri(c,ib) = sref_roof_dif(l,ib) + else if (ctype(c) == icol_sunwall) then + albgrd(c,ib) = sref_sunwall_dir(l,ib) + albgri(c,ib) = sref_sunwall_dif(l,ib) + else if (ctype(c) == icol_shadewall) then + albgrd(c,ib) = sref_shadewall_dir(l,ib) + albgri(c,ib) = sref_shadewall_dif(l,ib) + else if (ctype(c) == icol_road_perv) then + albgrd(c,ib) = sref_perroad_dir(l,ib) + albgri(c,ib) = sref_perroad_dif(l,ib) + else if (ctype(c) == icol_road_imperv) then + albgrd(c,ib) = sref_improad_dir(l,ib) + albgri(c,ib) = sref_improad_dif(l,ib) + endif + if (coszen(l) > 0._r8) then + albgrd_hst(c,ib) = albgrd(c,ib) + albgri_hst(c,ib) = albgri(c,ib) + end if + end do + do fp = 1,num_urbanp + p = filter_urbanp(fp) + c = patch%column(p) + l = patch%landunit(p) + albd(p,ib) = albgrd(c,ib) + albi(p,ib) = albgri(c,ib) + if (coszen(l) > 0._r8) then + albd_hst(p,ib) = albd(p,ib) + albi_hst(p,ib) = albi(p,ib) + end if end do + end do end associate @@ -653,19 +645,19 @@ subroutine incident_direct (bounds, & do fl = 1,num_urbanl_coszen_gt0 l = filter_urbanl_coszen_gt0(fl) - sdir_shadewall(l,ib) = 0._r8 + sdir_shadewall(l,ib) = 0._r8 - ! incident solar radiation on wall and road integrated over all canyon orientations (0 <= theta <= pi/2) + ! incident solar radiation on wall and road integrated over all canyon orientations (0 <= theta <= pi/2) - sdir_road(l,ib) = sdir(l,ib) * & - (2._r8*theta0(l)/rpi - 2./rpi*canyon_hwr(l)*tanzen(l)*(1._r8-cos(theta0(l)))) - sdir_sunwall(l,ib) = 2._r8 * sdir(l,ib) * ((1._r8/canyon_hwr(l))* & - (0.5_r8-theta0(l)/rpi) + (1._r8/rpi)*tanzen(l)*(1._r8-cos(theta0(l)))) + sdir_road(l,ib) = sdir(l,ib) * & + (2._r8*theta0(l)/rpi - 2./rpi*canyon_hwr(l)*tanzen(l)*(1._r8-cos(theta0(l)))) + sdir_sunwall(l,ib) = 2._r8 * sdir(l,ib) * ((1._r8/canyon_hwr(l))* & + (0.5_r8-theta0(l)/rpi) + (1._r8/rpi)*tanzen(l)*(1._r8-cos(theta0(l)))) - ! conservation check for road and wall. need to use wall fluxes converted to ground area + ! conservation check for road and wall. need to use wall fluxes converted to ground area - swall_projected = (sdir_shadewall(l,ib) + sdir_sunwall(l,ib)) * canyon_hwr(l) - err1(l) = sdir(l,ib) - (sdir_road(l,ib) + swall_projected) + swall_projected = (sdir_shadewall(l,ib) + sdir_sunwall(l,ib)) * canyon_hwr(l) + err1(l) = sdir(l,ib) - (sdir_road(l,ib) + swall_projected) end do do fl = 1,num_nourbanl_coszen_gt0 l = filter_nourbanl_coszen_gt0(fl) @@ -689,36 +681,36 @@ subroutine incident_direct (bounds, & if (numchk) then do fl = 1,num_urbanl_coszen_gt0 l = filter_urbanl_coszen_gt0(fl) - sumr = 0._r8 - sumw = 0._r8 - num = 0._r8 - do i = 1, 9000 - theta = i/100._r8 * rpi/180._r8 - zen0 = atan(1._r8/(canyon_hwr(l)*sin(theta))) - if (zen(l) >= zen0) then - sumr = sumr + 0._r8 - sumw = sumw + sdir(l,ib) / canyon_hwr(l) - else - sumr = sumr + sdir(l,ib) * (1._r8-canyon_hwr(l)*sin(theta)*tanzen(l)) - sumw = sumw + sdir(l,ib) * sin(theta)*tanzen(l) - end if - num = num + 1._r8 - end do - err2(l) = sumr/num - sdir_road(l,ib) - err3(l) = sumw/num - sdir_sunwall(l,ib) + sumr = 0._r8 + sumw = 0._r8 + num = 0._r8 + do i = 1, 9000 + theta = i/100._r8 * rpi/180._r8 + zen0 = atan(1._r8/(canyon_hwr(l)*sin(theta))) + if (zen(l) >= zen0) then + sumr = sumr + 0._r8 + sumw = sumw + sdir(l,ib) / canyon_hwr(l) + else + sumr = sumr + sdir(l,ib) * (1._r8-canyon_hwr(l)*sin(theta)*tanzen(l)) + sumw = sumw + sdir(l,ib) * sin(theta)*tanzen(l) + end if + num = num + 1._r8 + end do + err2(l) = sumr/num - sdir_road(l,ib) + err3(l) = sumw/num - sdir_sunwall(l,ib) end do do fl = 1,num_urbanl_coszen_gt0 l = filter_urbanl_coszen_gt0(fl) - if (abs(err2(l)) > 0.0006_r8 ) then - write (iulog,*) 'urban road incident direct beam solar radiation error',err2(l) - write (iulog,*) 'clm model is stopping' - call endrun(subgrid_index=l, subgrid_level=subgrid_level_landunit, msg=errmsg(sourcefile, __LINE__)) - endif - if (abs(err3(l)) > 0.0006_r8 ) then - write (iulog,*) 'urban wall incident direct beam solar radiation error',err3(l) - write (iulog,*) 'clm model is stopping' - call endrun(subgrid_index=l, subgrid_level=subgrid_level_landunit, msg=errmsg(sourcefile, __LINE__)) - end if + if (abs(err2(l)) > 0.0006_r8 ) then + write (iulog,*) 'urban road incident direct beam solar radiation error',err2(l) + write (iulog,*) 'clm model is stopping' + call endrun(subgrid_index=l, subgrid_level=subgrid_level_landunit, msg=errmsg(sourcefile, __LINE__)) + endif + if (abs(err3(l)) > 0.0006_r8 ) then + write (iulog,*) 'urban wall incident direct beam solar radiation error',err3(l) + write (iulog,*) 'clm model is stopping' + call endrun(subgrid_index=l, subgrid_level=subgrid_level_landunit, msg=errmsg(sourcefile, __LINE__)) + end if end do end if @@ -803,8 +795,8 @@ subroutine net_solar (bounds num_urbanl_coszen_gt0, filter_urbanl_coszen_gt0, canyon_hwr, wtroad_perv, sdir, sdif , & alb_improad_dir, alb_perroad_dir, alb_wall_dir, alb_roof_dir , & alb_improad_dif, alb_perroad_dif, alb_wall_dif, alb_roof_dif , & - sdir_road, sdir_sunwall, sdir_shadewall, & - sdif_road, sdif_sunwall, sdif_shadewall, & + sdir_road, sdir_sunwall, sdir_shadewall , & + sdif_road, sdif_sunwall, sdif_shadewall , & sref_improad_dir, sref_perroad_dir, sref_sunwall_dir, sref_shadewall_dir, sref_roof_dir , & sref_improad_dif, sref_perroad_dif, sref_sunwall_dif, sref_shadewall_dif, sref_roof_dif , & urbanparams_inst, solarabs_inst) @@ -988,329 +980,329 @@ subroutine net_solar (bounds do fl = 1,num_urbanl_coszen_gt0 l = filter_urbanl_coszen_gt0(fl) - ! initial absorption and reflection for road and both walls. - ! distribute reflected radiation to sky, road, and walls - ! according to appropriate view factor. radiation reflected to - ! road and walls will undergo multiple reflections within the canyon. - ! do separately for direct beam and diffuse radiation. + ! initial absorption and reflection for road and both walls. + ! distribute reflected radiation to sky, road, and walls + ! according to appropriate view factor. radiation reflected to + ! road and walls will undergo multiple reflections within the canyon. + ! do separately for direct beam and diffuse radiation. + + ! direct beam + + road_a_dir(l) = 0.0_r8 + road_r_dir(l) = 0.0_r8 + improad_a_dir(l) = (1._r8-alb_improad_dir(l,ib)) * sdir_road(l,ib) + improad_r_dir(l) = alb_improad_dir(l,ib) * sdir_road(l,ib) + improad_r_sky_dir(l) = improad_r_dir(l) * vf_sr(l) + improad_r_sunwall_dir(l) = improad_r_dir(l) * vf_wr(l) + improad_r_shadewall_dir(l) = improad_r_dir(l) * vf_wr(l) + road_a_dir(l) = road_a_dir(l) + improad_a_dir(l)*wtroad_imperv(l) + road_r_dir(l) = road_r_dir(l) + improad_r_dir(l)*wtroad_imperv(l) + + perroad_a_dir(l) = (1._r8-alb_perroad_dir(l,ib)) * sdir_road(l,ib) + perroad_r_dir(l) = alb_perroad_dir(l,ib) * sdir_road(l,ib) + perroad_r_sky_dir(l) = perroad_r_dir(l) * vf_sr(l) + perroad_r_sunwall_dir(l) = perroad_r_dir(l) * vf_wr(l) + perroad_r_shadewall_dir(l) = perroad_r_dir(l) * vf_wr(l) + road_a_dir(l) = road_a_dir(l) + perroad_a_dir(l)*wtroad_perv(l) + road_r_dir(l) = road_r_dir(l) + perroad_r_dir(l)*wtroad_perv(l) + + road_r_sky_dir(l) = road_r_dir(l) * vf_sr(l) + road_r_sunwall_dir(l) = road_r_dir(l) * vf_wr(l) + road_r_shadewall_dir(l) = road_r_dir(l) * vf_wr(l) + + sunwall_a_dir(l) = (1._r8-alb_wall_dir(l,ib)) * sdir_sunwall(l,ib) + sunwall_r_dir(l) = alb_wall_dir(l,ib) * sdir_sunwall(l,ib) + sunwall_r_sky_dir(l) = sunwall_r_dir(l) * vf_sw(l) + sunwall_r_road_dir(l) = sunwall_r_dir(l) * vf_rw(l) + sunwall_r_shadewall_dir(l) = sunwall_r_dir(l) * vf_ww(l) + + shadewall_a_dir(l) = (1._r8-alb_wall_dir(l,ib)) * sdir_shadewall(l,ib) + shadewall_r_dir(l) = alb_wall_dir(l,ib) * sdir_shadewall(l,ib) + shadewall_r_sky_dir(l) = shadewall_r_dir(l) * vf_sw(l) + shadewall_r_road_dir(l) = shadewall_r_dir(l) * vf_rw(l) + shadewall_r_sunwall_dir(l) = shadewall_r_dir(l) * vf_ww(l) + + ! diffuse + + road_a_dif(l) = 0.0_r8 + road_r_dif(l) = 0.0_r8 + improad_a_dif(l) = (1._r8-alb_improad_dif(l,ib)) * sdif_road(l,ib) + improad_r_dif(l) = alb_improad_dif(l,ib) * sdif_road(l,ib) + improad_r_sky_dif(l) = improad_r_dif(l) * vf_sr(l) + improad_r_sunwall_dif(l) = improad_r_dif(l) * vf_wr(l) + improad_r_shadewall_dif(l) = improad_r_dif(l) * vf_wr(l) + road_a_dif(l) = road_a_dif(l) + improad_a_dif(l)*wtroad_imperv(l) + road_r_dif(l) = road_r_dif(l) + improad_r_dif(l)*wtroad_imperv(l) + + perroad_a_dif(l) = (1._r8-alb_perroad_dif(l,ib)) * sdif_road(l,ib) + perroad_r_dif(l) = alb_perroad_dif(l,ib) * sdif_road(l,ib) + perroad_r_sky_dif(l) = perroad_r_dif(l) * vf_sr(l) + perroad_r_sunwall_dif(l) = perroad_r_dif(l) * vf_wr(l) + perroad_r_shadewall_dif(l) = perroad_r_dif(l) * vf_wr(l) + road_a_dif(l) = road_a_dif(l) + perroad_a_dif(l)*wtroad_perv(l) + road_r_dif(l) = road_r_dif(l) + perroad_r_dif(l)*wtroad_perv(l) + + road_r_sky_dif(l) = road_r_dif(l) * vf_sr(l) + road_r_sunwall_dif(l) = road_r_dif(l) * vf_wr(l) + road_r_shadewall_dif(l) = road_r_dif(l) * vf_wr(l) + + sunwall_a_dif(l) = (1._r8-alb_wall_dif(l,ib)) * sdif_sunwall(l,ib) + sunwall_r_dif(l) = alb_wall_dif(l,ib) * sdif_sunwall(l,ib) + sunwall_r_sky_dif(l) = sunwall_r_dif(l) * vf_sw(l) + sunwall_r_road_dif(l) = sunwall_r_dif(l) * vf_rw(l) + sunwall_r_shadewall_dif(l) = sunwall_r_dif(l) * vf_ww(l) + + shadewall_a_dif(l) = (1._r8-alb_wall_dif(l,ib)) * sdif_shadewall(l,ib) + shadewall_r_dif(l) = alb_wall_dif(l,ib) * sdif_shadewall(l,ib) + shadewall_r_sky_dif(l) = shadewall_r_dif(l) * vf_sw(l) + shadewall_r_road_dif(l) = shadewall_r_dif(l) * vf_rw(l) + shadewall_r_sunwall_dif(l) = shadewall_r_dif(l) * vf_ww(l) + + ! initialize sum of direct and diffuse solar absorption and reflection for road and both walls + + sabs_improad_dir(l,ib) = improad_a_dir(l) + sabs_perroad_dir(l,ib) = perroad_a_dir(l) + sabs_sunwall_dir(l,ib) = sunwall_a_dir(l) + sabs_shadewall_dir(l,ib) = shadewall_a_dir(l) + + sabs_improad_dif(l,ib) = improad_a_dif(l) + sabs_perroad_dif(l,ib) = perroad_a_dif(l) + sabs_sunwall_dif(l,ib) = sunwall_a_dif(l) + sabs_shadewall_dif(l,ib) = shadewall_a_dif(l) + + sref_improad_dir(l,ib) = improad_r_sky_dir(l) + sref_perroad_dir(l,ib) = perroad_r_sky_dir(l) + sref_sunwall_dir(l,ib) = sunwall_r_sky_dir(l) + sref_shadewall_dir(l,ib) = shadewall_r_sky_dir(l) + + sref_improad_dif(l,ib) = improad_r_sky_dif(l) + sref_perroad_dif(l,ib) = perroad_r_sky_dif(l) + sref_sunwall_dif(l,ib) = sunwall_r_sky_dif(l) + sref_shadewall_dif(l,ib) = shadewall_r_sky_dif(l) + + end do + + ! absorption and reflection for walls and road with multiple reflections + ! (i.e., absorb and reflect initial reflection in canyon and allow for + ! subsequent scattering) + ! + ! (1) absorption and reflection of scattered solar radiation + ! road: reflected fluxes from walls need to be projected to ground area + ! wall: reflected flux from road needs to be projected to wall area + ! + ! (2) add absorbed radiation for ith reflection to total absorbed + ! + ! (3) distribute reflected radiation to sky, road, and walls according to view factors + ! + ! (4) add solar reflection to sky for ith reflection to total reflection + ! + ! (5) stop iteration when absorption for ith reflection is less than some nominal amount. + ! small convergence criteria is required to ensure solar radiation is conserved + ! + ! do separately for direct beam and diffuse + + do fl = 1,num_urbanl_coszen_gt0 + l = filter_urbanl_coszen_gt0(fl) + + ! reflected direct beam + + do iter_dir = 1, n + ! step (1) + + stot(l) = (sunwall_r_road_dir(l) + shadewall_r_road_dir(l))*canyon_hwr(l) + + road_a_dir(l) = 0.0_r8 + road_r_dir(l) = 0.0_r8 + improad_a_dir(l) = (1._r8-alb_improad_dir(l,ib)) * stot(l) + improad_r_dir(l) = alb_improad_dir(l,ib) * stot(l) + road_a_dir(l) = road_a_dir(l) + improad_a_dir(l)*wtroad_imperv(l) + road_r_dir(l) = road_r_dir(l) + improad_r_dir(l)*wtroad_imperv(l) + perroad_a_dir(l) = (1._r8-alb_perroad_dir(l,ib)) * stot(l) + perroad_r_dir(l) = alb_perroad_dir(l,ib) * stot(l) + road_a_dir(l) = road_a_dir(l) + perroad_a_dir(l)*wtroad_perv(l) + road_r_dir(l) = road_r_dir(l) + perroad_r_dir(l)*wtroad_perv(l) + + stot(l) = road_r_sunwall_dir(l)/canyon_hwr(l) + shadewall_r_sunwall_dir(l) + sunwall_a_dir(l) = (1._r8-alb_wall_dir(l,ib)) * stot(l) + sunwall_r_dir(l) = alb_wall_dir(l,ib) * stot(l) + + stot(l) = road_r_shadewall_dir(l)/canyon_hwr(l) + sunwall_r_shadewall_dir(l) + shadewall_a_dir(l) = (1._r8-alb_wall_dir(l,ib)) * stot(l) + shadewall_r_dir(l) = alb_wall_dir(l,ib) * stot(l) + + ! step (2) - ! direct beam + sabs_improad_dir(l,ib) = sabs_improad_dir(l,ib) + improad_a_dir(l) + sabs_perroad_dir(l,ib) = sabs_perroad_dir(l,ib) + perroad_a_dir(l) + sabs_sunwall_dir(l,ib) = sabs_sunwall_dir(l,ib) + sunwall_a_dir(l) + sabs_shadewall_dir(l,ib) = sabs_shadewall_dir(l,ib) + shadewall_a_dir(l) + + ! step (3) - road_a_dir(l) = 0.0_r8 - road_r_dir(l) = 0.0_r8 - improad_a_dir(l) = (1._r8-alb_improad_dir(l,ib)) * sdir_road(l,ib) - improad_r_dir(l) = alb_improad_dir(l,ib) * sdir_road(l,ib) improad_r_sky_dir(l) = improad_r_dir(l) * vf_sr(l) improad_r_sunwall_dir(l) = improad_r_dir(l) * vf_wr(l) improad_r_shadewall_dir(l) = improad_r_dir(l) * vf_wr(l) - road_a_dir(l) = road_a_dir(l) + improad_a_dir(l)*wtroad_imperv(l) - road_r_dir(l) = road_r_dir(l) + improad_r_dir(l)*wtroad_imperv(l) - perroad_a_dir(l) = (1._r8-alb_perroad_dir(l,ib)) * sdir_road(l,ib) - perroad_r_dir(l) = alb_perroad_dir(l,ib) * sdir_road(l,ib) perroad_r_sky_dir(l) = perroad_r_dir(l) * vf_sr(l) perroad_r_sunwall_dir(l) = perroad_r_dir(l) * vf_wr(l) perroad_r_shadewall_dir(l) = perroad_r_dir(l) * vf_wr(l) - road_a_dir(l) = road_a_dir(l) + perroad_a_dir(l)*wtroad_perv(l) - road_r_dir(l) = road_r_dir(l) + perroad_r_dir(l)*wtroad_perv(l) road_r_sky_dir(l) = road_r_dir(l) * vf_sr(l) road_r_sunwall_dir(l) = road_r_dir(l) * vf_wr(l) road_r_shadewall_dir(l) = road_r_dir(l) * vf_wr(l) - sunwall_a_dir(l) = (1._r8-alb_wall_dir(l,ib)) * sdir_sunwall(l,ib) - sunwall_r_dir(l) = alb_wall_dir(l,ib) * sdir_sunwall(l,ib) sunwall_r_sky_dir(l) = sunwall_r_dir(l) * vf_sw(l) sunwall_r_road_dir(l) = sunwall_r_dir(l) * vf_rw(l) sunwall_r_shadewall_dir(l) = sunwall_r_dir(l) * vf_ww(l) - shadewall_a_dir(l) = (1._r8-alb_wall_dir(l,ib)) * sdir_shadewall(l,ib) - shadewall_r_dir(l) = alb_wall_dir(l,ib) * sdir_shadewall(l,ib) shadewall_r_sky_dir(l) = shadewall_r_dir(l) * vf_sw(l) shadewall_r_road_dir(l) = shadewall_r_dir(l) * vf_rw(l) shadewall_r_sunwall_dir(l) = shadewall_r_dir(l) * vf_ww(l) - ! diffuse + ! step (4) + + sref_improad_dir(l,ib) = sref_improad_dir(l,ib) + improad_r_sky_dir(l) + sref_perroad_dir(l,ib) = sref_perroad_dir(l,ib) + perroad_r_sky_dir(l) + sref_sunwall_dir(l,ib) = sref_sunwall_dir(l,ib) + sunwall_r_sky_dir(l) + sref_shadewall_dir(l,ib) = sref_shadewall_dir(l,ib) + shadewall_r_sky_dir(l) + + ! step (5) + + crit = max(road_a_dir(l), sunwall_a_dir(l), shadewall_a_dir(l)) + if (crit < errcrit) exit + end do + if (iter_dir >= n) then + write (iulog,*) 'urban net solar radiation error: no convergence, direct beam' + write (iulog,*) 'clm model is stopping' + call endrun(subgrid_index=l, subgrid_level=subgrid_level_landunit, msg=errmsg(sourcefile, __LINE__)) + endif + + ! reflected diffuse + + do iter_dif = 1, n + ! step (1) + + stot(l) = (sunwall_r_road_dif(l) + shadewall_r_road_dif(l))*canyon_hwr(l) + road_a_dif(l) = 0.0_r8 + road_r_dif(l) = 0.0_r8 + improad_a_dif(l) = (1._r8-alb_improad_dif(l,ib)) * stot(l) + improad_r_dif(l) = alb_improad_dif(l,ib) * stot(l) + road_a_dif(l) = road_a_dif(l) + improad_a_dif(l)*wtroad_imperv(l) + road_r_dif(l) = road_r_dif(l) + improad_r_dif(l)*wtroad_imperv(l) + perroad_a_dif(l) = (1._r8-alb_perroad_dif(l,ib)) * stot(l) + perroad_r_dif(l) = alb_perroad_dif(l,ib) * stot(l) + road_a_dif(l) = road_a_dif(l) + perroad_a_dif(l)*wtroad_perv(l) + road_r_dif(l) = road_r_dif(l) + perroad_r_dif(l)*wtroad_perv(l) + + stot(l) = road_r_sunwall_dif(l)/canyon_hwr(l) + shadewall_r_sunwall_dif(l) + sunwall_a_dif(l) = (1._r8-alb_wall_dif(l,ib)) * stot(l) + sunwall_r_dif(l) = alb_wall_dif(l,ib) * stot(l) + + stot(l) = road_r_shadewall_dif(l)/canyon_hwr(l) + sunwall_r_shadewall_dif(l) + shadewall_a_dif(l) = (1._r8-alb_wall_dif(l,ib)) * stot(l) + shadewall_r_dif(l) = alb_wall_dif(l,ib) * stot(l) + + ! step (2) + + sabs_improad_dif(l,ib) = sabs_improad_dif(l,ib) + improad_a_dif(l) + sabs_perroad_dif(l,ib) = sabs_perroad_dif(l,ib) + perroad_a_dif(l) + sabs_sunwall_dif(l,ib) = sabs_sunwall_dif(l,ib) + sunwall_a_dif(l) + sabs_shadewall_dif(l,ib) = sabs_shadewall_dif(l,ib) + shadewall_a_dif(l) + + ! step (3) - road_a_dif(l) = 0.0_r8 - road_r_dif(l) = 0.0_r8 - improad_a_dif(l) = (1._r8-alb_improad_dif(l,ib)) * sdif_road(l,ib) - improad_r_dif(l) = alb_improad_dif(l,ib) * sdif_road(l,ib) improad_r_sky_dif(l) = improad_r_dif(l) * vf_sr(l) improad_r_sunwall_dif(l) = improad_r_dif(l) * vf_wr(l) improad_r_shadewall_dif(l) = improad_r_dif(l) * vf_wr(l) - road_a_dif(l) = road_a_dif(l) + improad_a_dif(l)*wtroad_imperv(l) - road_r_dif(l) = road_r_dif(l) + improad_r_dif(l)*wtroad_imperv(l) - perroad_a_dif(l) = (1._r8-alb_perroad_dif(l,ib)) * sdif_road(l,ib) - perroad_r_dif(l) = alb_perroad_dif(l,ib) * sdif_road(l,ib) perroad_r_sky_dif(l) = perroad_r_dif(l) * vf_sr(l) perroad_r_sunwall_dif(l) = perroad_r_dif(l) * vf_wr(l) perroad_r_shadewall_dif(l) = perroad_r_dif(l) * vf_wr(l) - road_a_dif(l) = road_a_dif(l) + perroad_a_dif(l)*wtroad_perv(l) - road_r_dif(l) = road_r_dif(l) + perroad_r_dif(l)*wtroad_perv(l) road_r_sky_dif(l) = road_r_dif(l) * vf_sr(l) road_r_sunwall_dif(l) = road_r_dif(l) * vf_wr(l) road_r_shadewall_dif(l) = road_r_dif(l) * vf_wr(l) - sunwall_a_dif(l) = (1._r8-alb_wall_dif(l,ib)) * sdif_sunwall(l,ib) - sunwall_r_dif(l) = alb_wall_dif(l,ib) * sdif_sunwall(l,ib) sunwall_r_sky_dif(l) = sunwall_r_dif(l) * vf_sw(l) sunwall_r_road_dif(l) = sunwall_r_dif(l) * vf_rw(l) sunwall_r_shadewall_dif(l) = sunwall_r_dif(l) * vf_ww(l) - shadewall_a_dif(l) = (1._r8-alb_wall_dif(l,ib)) * sdif_shadewall(l,ib) - shadewall_r_dif(l) = alb_wall_dif(l,ib) * sdif_shadewall(l,ib) shadewall_r_sky_dif(l) = shadewall_r_dif(l) * vf_sw(l) - shadewall_r_road_dif(l) = shadewall_r_dif(l) * vf_rw(l) - shadewall_r_sunwall_dif(l) = shadewall_r_dif(l) * vf_ww(l) - - ! initialize sum of direct and diffuse solar absorption and reflection for road and both walls - - sabs_improad_dir(l,ib) = improad_a_dir(l) - sabs_perroad_dir(l,ib) = perroad_a_dir(l) - sabs_sunwall_dir(l,ib) = sunwall_a_dir(l) - sabs_shadewall_dir(l,ib) = shadewall_a_dir(l) - - sabs_improad_dif(l,ib) = improad_a_dif(l) - sabs_perroad_dif(l,ib) = perroad_a_dif(l) - sabs_sunwall_dif(l,ib) = sunwall_a_dif(l) - sabs_shadewall_dif(l,ib) = shadewall_a_dif(l) - - sref_improad_dir(l,ib) = improad_r_sky_dir(l) - sref_perroad_dir(l,ib) = perroad_r_sky_dir(l) - sref_sunwall_dir(l,ib) = sunwall_r_sky_dir(l) - sref_shadewall_dir(l,ib) = shadewall_r_sky_dir(l) - - sref_improad_dif(l,ib) = improad_r_sky_dif(l) - sref_perroad_dif(l,ib) = perroad_r_sky_dif(l) - sref_sunwall_dif(l,ib) = sunwall_r_sky_dif(l) - sref_shadewall_dif(l,ib) = shadewall_r_sky_dif(l) - - end do - - ! absorption and reflection for walls and road with multiple reflections - ! (i.e., absorb and reflect initial reflection in canyon and allow for - ! subsequent scattering) - ! - ! (1) absorption and reflection of scattered solar radiation - ! road: reflected fluxes from walls need to be projected to ground area - ! wall: reflected flux from road needs to be projected to wall area - ! - ! (2) add absorbed radiation for ith reflection to total absorbed - ! - ! (3) distribute reflected radiation to sky, road, and walls according to view factors - ! - ! (4) add solar reflection to sky for ith reflection to total reflection - ! - ! (5) stop iteration when absorption for ith reflection is less than some nominal amount. - ! small convergence criteria is required to ensure solar radiation is conserved - ! - ! do separately for direct beam and diffuse - - do fl = 1,num_urbanl_coszen_gt0 - l = filter_urbanl_coszen_gt0(fl) - - ! reflected direct beam - - do iter_dir = 1, n - ! step (1) - - stot(l) = (sunwall_r_road_dir(l) + shadewall_r_road_dir(l))*canyon_hwr(l) + shadewall_r_road_dif(l) = shadewall_r_dif(l) * vf_rw(l) + shadewall_r_sunwall_dif(l) = shadewall_r_dif(l) * vf_ww(l) - road_a_dir(l) = 0.0_r8 - road_r_dir(l) = 0.0_r8 - improad_a_dir(l) = (1._r8-alb_improad_dir(l,ib)) * stot(l) - improad_r_dir(l) = alb_improad_dir(l,ib) * stot(l) - road_a_dir(l) = road_a_dir(l) + improad_a_dir(l)*wtroad_imperv(l) - road_r_dir(l) = road_r_dir(l) + improad_r_dir(l)*wtroad_imperv(l) - perroad_a_dir(l) = (1._r8-alb_perroad_dir(l,ib)) * stot(l) - perroad_r_dir(l) = alb_perroad_dir(l,ib) * stot(l) - road_a_dir(l) = road_a_dir(l) + perroad_a_dir(l)*wtroad_perv(l) - road_r_dir(l) = road_r_dir(l) + perroad_r_dir(l)*wtroad_perv(l) + ! step (4) - stot(l) = road_r_sunwall_dir(l)/canyon_hwr(l) + shadewall_r_sunwall_dir(l) - sunwall_a_dir(l) = (1._r8-alb_wall_dir(l,ib)) * stot(l) - sunwall_r_dir(l) = alb_wall_dir(l,ib) * stot(l) + sref_improad_dif(l,ib) = sref_improad_dif(l,ib) + improad_r_sky_dif(l) + sref_perroad_dif(l,ib) = sref_perroad_dif(l,ib) + perroad_r_sky_dif(l) + sref_sunwall_dif(l,ib) = sref_sunwall_dif(l,ib) + sunwall_r_sky_dif(l) + sref_shadewall_dif(l,ib) = sref_shadewall_dif(l,ib) + shadewall_r_sky_dif(l) - stot(l) = road_r_shadewall_dir(l)/canyon_hwr(l) + sunwall_r_shadewall_dir(l) - shadewall_a_dir(l) = (1._r8-alb_wall_dir(l,ib)) * stot(l) - shadewall_r_dir(l) = alb_wall_dir(l,ib) * stot(l) + ! step (5) - ! step (2) - - sabs_improad_dir(l,ib) = sabs_improad_dir(l,ib) + improad_a_dir(l) - sabs_perroad_dir(l,ib) = sabs_perroad_dir(l,ib) + perroad_a_dir(l) - sabs_sunwall_dir(l,ib) = sabs_sunwall_dir(l,ib) + sunwall_a_dir(l) - sabs_shadewall_dir(l,ib) = sabs_shadewall_dir(l,ib) + shadewall_a_dir(l) + crit = max(road_a_dif(l), sunwall_a_dif(l), shadewall_a_dif(l)) + if (crit < errcrit) exit + end do + if (iter_dif >= n) then + write (iulog,*) 'urban net solar radiation error: no convergence, diffuse' + write (iulog,*) 'clm model is stopping' + call endrun(subgrid_index=l, subgrid_level=subgrid_level_landunit, msg=errmsg(sourcefile, __LINE__)) + endif - ! step (3) + ! total reflected by canyon - sum of solar reflection to sky from canyon. + ! project wall fluxes to horizontal surface + + sref_canyon_dir(l) = 0.0_r8 + sref_canyon_dif(l) = 0.0_r8 + sref_canyon_dir(l) = sref_canyon_dir(l) + sref_improad_dir(l,ib)*wtroad_imperv(l) + sref_canyon_dif(l) = sref_canyon_dif(l) + sref_improad_dif(l,ib)*wtroad_imperv(l) + sref_canyon_dir(l) = sref_canyon_dir(l) + sref_perroad_dir(l,ib)*wtroad_perv(l) + sref_canyon_dif(l) = sref_canyon_dif(l) + sref_perroad_dif(l,ib)*wtroad_perv(l) + sref_canyon_dir(l) = sref_canyon_dir(l) + (sref_sunwall_dir(l,ib) + sref_shadewall_dir(l,ib))*canyon_hwr(l) + sref_canyon_dif(l) = sref_canyon_dif(l) + (sref_sunwall_dif(l,ib) + sref_shadewall_dif(l,ib))*canyon_hwr(l) + + ! total absorbed by canyon. project wall fluxes to horizontal surface + + sabs_canyon_dir(l) = 0.0_r8 + sabs_canyon_dif(l) = 0.0_r8 + sabs_canyon_dir(l) = sabs_canyon_dir(l) + sabs_improad_dir(l,ib)*wtroad_imperv(l) + sabs_canyon_dif(l) = sabs_canyon_dif(l) + sabs_improad_dif(l,ib)*wtroad_imperv(l) + sabs_canyon_dir(l) = sabs_canyon_dir(l) + sabs_perroad_dir(l,ib)*wtroad_perv(l) + sabs_canyon_dif(l) = sabs_canyon_dif(l) + sabs_perroad_dif(l,ib)*wtroad_perv(l) + sabs_canyon_dir(l) = sabs_canyon_dir(l) + (sabs_sunwall_dir(l,ib) + sabs_shadewall_dir(l,ib))*canyon_hwr(l) + sabs_canyon_dif(l) = sabs_canyon_dif(l) + (sabs_sunwall_dif(l,ib) + sabs_shadewall_dif(l,ib))*canyon_hwr(l) + + ! conservation check. note: previous conservation checks confirm partioning of total direct + ! beam and diffuse radiation from atmosphere to road and walls is conserved as + ! sdir (from atmosphere) = sdir_road + (sdir_sunwall + sdir_shadewall)*canyon_hwr + ! sdif (from atmosphere) = sdif_road + (sdif_sunwall + sdif_shadewall)*canyon_hwr + + stot_dir(l) = sdir_road(l,ib) + (sdir_sunwall(l,ib) + sdir_shadewall(l,ib))*canyon_hwr(l) + stot_dif(l) = sdif_road(l,ib) + (sdif_sunwall(l,ib) + sdif_shadewall(l,ib))*canyon_hwr(l) + + err = stot_dir(l) + stot_dif(l) & + - (sabs_canyon_dir(l) + sabs_canyon_dif(l) + sref_canyon_dir(l) + sref_canyon_dif(l)) + if (abs(err) > 0.001_r8 ) then + write(iulog,*)'urban net solar radiation balance error for ib=',ib,' err= ',err + write(iulog,*)' l= ',l,' ib= ',ib + write(iulog,*)' stot_dir = ',stot_dir(l) + write(iulog,*)' stot_dif = ',stot_dif(l) + write(iulog,*)' sabs_canyon_dir = ',sabs_canyon_dir(l) + write(iulog,*)' sabs_canyon_dif = ',sabs_canyon_dif(l) + write(iulog,*)' sref_canyon_dir = ',sref_canyon_dir(l) + write(iulog,*)' sref_canyon_dif = ',sref_canyon_dir(l) + write(iulog,*) 'clm model is stopping' + call endrun(subgrid_index=l, subgrid_level=subgrid_level_landunit, msg=errmsg(sourcefile, __LINE__)) + endif - improad_r_sky_dir(l) = improad_r_dir(l) * vf_sr(l) - improad_r_sunwall_dir(l) = improad_r_dir(l) * vf_wr(l) - improad_r_shadewall_dir(l) = improad_r_dir(l) * vf_wr(l) + ! canyon albedo - perroad_r_sky_dir(l) = perroad_r_dir(l) * vf_sr(l) - perroad_r_sunwall_dir(l) = perroad_r_dir(l) * vf_wr(l) - perroad_r_shadewall_dir(l) = perroad_r_dir(l) * vf_wr(l) - - road_r_sky_dir(l) = road_r_dir(l) * vf_sr(l) - road_r_sunwall_dir(l) = road_r_dir(l) * vf_wr(l) - road_r_shadewall_dir(l) = road_r_dir(l) * vf_wr(l) - - sunwall_r_sky_dir(l) = sunwall_r_dir(l) * vf_sw(l) - sunwall_r_road_dir(l) = sunwall_r_dir(l) * vf_rw(l) - sunwall_r_shadewall_dir(l) = sunwall_r_dir(l) * vf_ww(l) - - shadewall_r_sky_dir(l) = shadewall_r_dir(l) * vf_sw(l) - shadewall_r_road_dir(l) = shadewall_r_dir(l) * vf_rw(l) - shadewall_r_sunwall_dir(l) = shadewall_r_dir(l) * vf_ww(l) - - ! step (4) - - sref_improad_dir(l,ib) = sref_improad_dir(l,ib) + improad_r_sky_dir(l) - sref_perroad_dir(l,ib) = sref_perroad_dir(l,ib) + perroad_r_sky_dir(l) - sref_sunwall_dir(l,ib) = sref_sunwall_dir(l,ib) + sunwall_r_sky_dir(l) - sref_shadewall_dir(l,ib) = sref_shadewall_dir(l,ib) + shadewall_r_sky_dir(l) - - ! step (5) - - crit = max(road_a_dir(l), sunwall_a_dir(l), shadewall_a_dir(l)) - if (crit < errcrit) exit - end do - if (iter_dir >= n) then - write (iulog,*) 'urban net solar radiation error: no convergence, direct beam' - write (iulog,*) 'clm model is stopping' - call endrun(subgrid_index=l, subgrid_level=subgrid_level_landunit, msg=errmsg(sourcefile, __LINE__)) - endif - - ! reflected diffuse - - do iter_dif = 1, n - ! step (1) - - stot(l) = (sunwall_r_road_dif(l) + shadewall_r_road_dif(l))*canyon_hwr(l) - road_a_dif(l) = 0.0_r8 - road_r_dif(l) = 0.0_r8 - improad_a_dif(l) = (1._r8-alb_improad_dif(l,ib)) * stot(l) - improad_r_dif(l) = alb_improad_dif(l,ib) * stot(l) - road_a_dif(l) = road_a_dif(l) + improad_a_dif(l)*wtroad_imperv(l) - road_r_dif(l) = road_r_dif(l) + improad_r_dif(l)*wtroad_imperv(l) - perroad_a_dif(l) = (1._r8-alb_perroad_dif(l,ib)) * stot(l) - perroad_r_dif(l) = alb_perroad_dif(l,ib) * stot(l) - road_a_dif(l) = road_a_dif(l) + perroad_a_dif(l)*wtroad_perv(l) - road_r_dif(l) = road_r_dif(l) + perroad_r_dif(l)*wtroad_perv(l) - - stot(l) = road_r_sunwall_dif(l)/canyon_hwr(l) + shadewall_r_sunwall_dif(l) - sunwall_a_dif(l) = (1._r8-alb_wall_dif(l,ib)) * stot(l) - sunwall_r_dif(l) = alb_wall_dif(l,ib) * stot(l) - - stot(l) = road_r_shadewall_dif(l)/canyon_hwr(l) + sunwall_r_shadewall_dif(l) - shadewall_a_dif(l) = (1._r8-alb_wall_dif(l,ib)) * stot(l) - shadewall_r_dif(l) = alb_wall_dif(l,ib) * stot(l) - - ! step (2) - - sabs_improad_dif(l,ib) = sabs_improad_dif(l,ib) + improad_a_dif(l) - sabs_perroad_dif(l,ib) = sabs_perroad_dif(l,ib) + perroad_a_dif(l) - sabs_sunwall_dif(l,ib) = sabs_sunwall_dif(l,ib) + sunwall_a_dif(l) - sabs_shadewall_dif(l,ib) = sabs_shadewall_dif(l,ib) + shadewall_a_dif(l) - - ! step (3) - - improad_r_sky_dif(l) = improad_r_dif(l) * vf_sr(l) - improad_r_sunwall_dif(l) = improad_r_dif(l) * vf_wr(l) - improad_r_shadewall_dif(l) = improad_r_dif(l) * vf_wr(l) - - perroad_r_sky_dif(l) = perroad_r_dif(l) * vf_sr(l) - perroad_r_sunwall_dif(l) = perroad_r_dif(l) * vf_wr(l) - perroad_r_shadewall_dif(l) = perroad_r_dif(l) * vf_wr(l) - - road_r_sky_dif(l) = road_r_dif(l) * vf_sr(l) - road_r_sunwall_dif(l) = road_r_dif(l) * vf_wr(l) - road_r_shadewall_dif(l) = road_r_dif(l) * vf_wr(l) - - sunwall_r_sky_dif(l) = sunwall_r_dif(l) * vf_sw(l) - sunwall_r_road_dif(l) = sunwall_r_dif(l) * vf_rw(l) - sunwall_r_shadewall_dif(l) = sunwall_r_dif(l) * vf_ww(l) - - shadewall_r_sky_dif(l) = shadewall_r_dif(l) * vf_sw(l) - shadewall_r_road_dif(l) = shadewall_r_dif(l) * vf_rw(l) - shadewall_r_sunwall_dif(l) = shadewall_r_dif(l) * vf_ww(l) - - ! step (4) - - sref_improad_dif(l,ib) = sref_improad_dif(l,ib) + improad_r_sky_dif(l) - sref_perroad_dif(l,ib) = sref_perroad_dif(l,ib) + perroad_r_sky_dif(l) - sref_sunwall_dif(l,ib) = sref_sunwall_dif(l,ib) + sunwall_r_sky_dif(l) - sref_shadewall_dif(l,ib) = sref_shadewall_dif(l,ib) + shadewall_r_sky_dif(l) - - ! step (5) - - crit = max(road_a_dif(l), sunwall_a_dif(l), shadewall_a_dif(l)) - if (crit < errcrit) exit - end do - if (iter_dif >= n) then - write (iulog,*) 'urban net solar radiation error: no convergence, diffuse' - write (iulog,*) 'clm model is stopping' - call endrun(subgrid_index=l, subgrid_level=subgrid_level_landunit, msg=errmsg(sourcefile, __LINE__)) - endif - - ! total reflected by canyon - sum of solar reflection to sky from canyon. - ! project wall fluxes to horizontal surface - - sref_canyon_dir(l) = 0.0_r8 - sref_canyon_dif(l) = 0.0_r8 - sref_canyon_dir(l) = sref_canyon_dir(l) + sref_improad_dir(l,ib)*wtroad_imperv(l) - sref_canyon_dif(l) = sref_canyon_dif(l) + sref_improad_dif(l,ib)*wtroad_imperv(l) - sref_canyon_dir(l) = sref_canyon_dir(l) + sref_perroad_dir(l,ib)*wtroad_perv(l) - sref_canyon_dif(l) = sref_canyon_dif(l) + sref_perroad_dif(l,ib)*wtroad_perv(l) - sref_canyon_dir(l) = sref_canyon_dir(l) + (sref_sunwall_dir(l,ib) + sref_shadewall_dir(l,ib))*canyon_hwr(l) - sref_canyon_dif(l) = sref_canyon_dif(l) + (sref_sunwall_dif(l,ib) + sref_shadewall_dif(l,ib))*canyon_hwr(l) - - ! total absorbed by canyon. project wall fluxes to horizontal surface - - sabs_canyon_dir(l) = 0.0_r8 - sabs_canyon_dif(l) = 0.0_r8 - sabs_canyon_dir(l) = sabs_canyon_dir(l) + sabs_improad_dir(l,ib)*wtroad_imperv(l) - sabs_canyon_dif(l) = sabs_canyon_dif(l) + sabs_improad_dif(l,ib)*wtroad_imperv(l) - sabs_canyon_dir(l) = sabs_canyon_dir(l) + sabs_perroad_dir(l,ib)*wtroad_perv(l) - sabs_canyon_dif(l) = sabs_canyon_dif(l) + sabs_perroad_dif(l,ib)*wtroad_perv(l) - sabs_canyon_dir(l) = sabs_canyon_dir(l) + (sabs_sunwall_dir(l,ib) + sabs_shadewall_dir(l,ib))*canyon_hwr(l) - sabs_canyon_dif(l) = sabs_canyon_dif(l) + (sabs_sunwall_dif(l,ib) + sabs_shadewall_dif(l,ib))*canyon_hwr(l) - - ! conservation check. note: previous conservation checks confirm partioning of total direct - ! beam and diffuse radiation from atmosphere to road and walls is conserved as - ! sdir (from atmosphere) = sdir_road + (sdir_sunwall + sdir_shadewall)*canyon_hwr - ! sdif (from atmosphere) = sdif_road + (sdif_sunwall + sdif_shadewall)*canyon_hwr - - stot_dir(l) = sdir_road(l,ib) + (sdir_sunwall(l,ib) + sdir_shadewall(l,ib))*canyon_hwr(l) - stot_dif(l) = sdif_road(l,ib) + (sdif_sunwall(l,ib) + sdif_shadewall(l,ib))*canyon_hwr(l) - - err = stot_dir(l) + stot_dif(l) & - - (sabs_canyon_dir(l) + sabs_canyon_dif(l) + sref_canyon_dir(l) + sref_canyon_dif(l)) - if (abs(err) > 0.001_r8 ) then - write(iulog,*)'urban net solar radiation balance error for ib=',ib,' err= ',err - write(iulog,*)' l= ',l,' ib= ',ib - write(iulog,*)' stot_dir = ',stot_dir(l) - write(iulog,*)' stot_dif = ',stot_dif(l) - write(iulog,*)' sabs_canyon_dir = ',sabs_canyon_dir(l) - write(iulog,*)' sabs_canyon_dif = ',sabs_canyon_dif(l) - write(iulog,*)' sref_canyon_dir = ',sref_canyon_dir(l) - write(iulog,*)' sref_canyon_dif = ',sref_canyon_dir(l) - write(iulog,*) 'clm model is stopping' - call endrun(subgrid_index=l, subgrid_level=subgrid_level_landunit, msg=errmsg(sourcefile, __LINE__)) - endif - - ! canyon albedo - - canyon_alb_dif(l) = sref_canyon_dif(l) / max(stot_dif(l), 1.e-06_r8) - canyon_alb_dir(l) = sref_canyon_dir(l) / max(stot_dir(l), 1.e-06_r8) + canyon_alb_dif(l) = sref_canyon_dif(l) / max(stot_dif(l), 1.e-06_r8) + canyon_alb_dir(l) = sref_canyon_dir(l) / max(stot_dir(l), 1.e-06_r8) end do ! end of landunit loop - ! Refected and absorbed solar radiation per unit incident radiation for roof + ! Reflected and absorbed solar radiation per unit incident radiation for roof do fl = 1,num_urbanl_coszen_gt0 l = filter_urbanl_coszen_gt0(fl) From 7006d9499920ee0327ab41aa422d41019f64f04a Mon Sep 17 00:00:00 2001 From: Adrianna Foster Date: Fri, 8 Nov 2024 09:29:53 -0700 Subject: [PATCH 180/243] more 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 ba7b945767..dd0068909a 100644 --- a/cime_config/testdefs/ExpectedTestFails.xml +++ b/cime_config/testdefs/ExpectedTestFails.xml @@ -304,6 +304,13 @@ #2810 + + + + FAIL + #2810 + + From 06bcd4aea211554ff847255da02c75acb02bd824 Mon Sep 17 00:00:00 2001 From: Adrianna Foster Date: Fri, 8 Nov 2024 09:32:38 -0700 Subject: [PATCH 181/243] expected fails for izumi_nag --- cime_config/testdefs/ExpectedTestFails.xml | 32 ++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/cime_config/testdefs/ExpectedTestFails.xml b/cime_config/testdefs/ExpectedTestFails.xml index dd0068909a..6be21e3e4f 100644 --- a/cime_config/testdefs/ExpectedTestFails.xml +++ b/cime_config/testdefs/ExpectedTestFails.xml @@ -311,6 +311,38 @@ #2810 + + + + FAIL + #2861 + + + + + + FAIL + #2861 + + + + + + + FAIL + #2861 + + + + + + FAIL + #2861 + + + + + From bd8565647f41f0c249ad443295adf23e08b2c7da Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Fri, 8 Nov 2024 13:16:00 -0700 Subject: [PATCH 182/243] build-namelist_test: Ensure cold starts w/ finidat are handled properly. Currently fails. We want FATES to work and BGC to fail, even when ignoring warnings. --- bld/unit_testers/build-namelist_test.pl | 54 +++++++++++++++++++++++-- 1 file changed, 50 insertions(+), 4 deletions(-) diff --git a/bld/unit_testers/build-namelist_test.pl b/bld/unit_testers/build-namelist_test.pl index a1f5e3912f..1bf201d239 100755 --- a/bld/unit_testers/build-namelist_test.pl +++ b/bld/unit_testers/build-namelist_test.pl @@ -1318,10 +1318,6 @@ sub cat_and_create_namelistinfile { my %warntest = ( # Warnings without the -ignore_warnings option given - "coldwfinidat" =>{ options=>"-envxml_dir . -clm_start_type cold", - namelst=>"finidat = 'testfile.nc'", - phys=>"clm5_0", - }, "bgcspin_w_suplnitro" =>{ options=>"-envxml_dir . -bgc bgc -clm_accelerated_spinup on", namelst=>"suplnitro='ALL'", phys=>"clm5_0", @@ -1402,6 +1398,56 @@ sub cat_and_create_namelistinfile { system( "cat $tempfile" ); } +print "\n===============================================================================\n"; +print "Ensure cold starts with finidat are handled properly \n"; +print "=================================================================================\n"; + +my %coldwfinidat = ( + "bgc" => { options=>"-envxml_dir . -clm_start_type cold", + namelst=>"finidat = 'testfile.nc'", + phys=>"clm5_0", + expected_fail=>1, + }, + "fates" => { options=>"-envxml_dir . -clm_start_type cold -bgc fates -no-megan", + namelst=>"finidat = 'testfile.nc', use_fates = .true.", + phys=>"clm5_0", + expected_fail=>0, + }, +); +my $finidat; +foreach my $key ( keys(%coldwfinidat) ) { + print( "$key\n" ); + + my $var; + foreach $var ( "phys" , "options", "namelst", "expected_fail" ) { + if ( not exists $coldwfinidat{$key}{$var} ) { + die "ERROR: Subkey $var does not exist for coldwfinidat $key\nERROR:Check if you spelled $var correctly\n" + } + } + + &make_config_cache($coldwfinidat{$key}{"phys"}); + my $options = $coldwfinidat{$key}{"options"}; + my $namelist = $coldwfinidat{$key}{"namelst"}; + my $expected_fail = $coldwfinidat{$key}{"expected_fail"}; + my %settings; + &make_env_run( %settings ); + + # Should fail if expected to, pass otherwise + eval{ system( "$bldnml $options -namelist \"&clmexp $namelist /\" > $tempfile 2>&1 " ); }; + is( $? eq 0, $expected_fail eq 0, "coldwfinidat $key run"); + + if ( $expected_fail ) { + # Now run with -ignore_warnings and make sure it still doesn't work + $options .= " -ignore_warnings"; + eval{ system( "$bldnml $options -namelist \"&clmexp $namelist /\" > $tempfile 2>&1 " ); }; + isnt( $?, 0, "coldwfinidat $key run -ignore_warnings" ); + } else { + # Check that finidat was correctly set + $finidat = `grep finidat lnd_in`; + ok ( $finidat =~ "testfile.nc", "coldwfinidat $key finidat? $finidat" ); + } +} + # # Loop over all physics versions # From f8f3a6f8e01ff356027dd935c70e8bf1efadbc6e Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Fri, 8 Nov 2024 13:03:22 -0700 Subject: [PATCH 183/243] Ignore finidat for cold-start FATES runs. Resolves ESCOMP/CTSM#2856, where such runs were getting their finidat overwritten with ' '. --- bld/CLMBuildNamelist.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index 592699cc2b..f4d60e481b 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -2588,7 +2588,7 @@ sub setup_logic_initial_conditions { my $finidat = $nl->get_value($var); $nl_flags->{'excess_ice_on_finidat'} = "unknown"; if ( $nl_flags->{'clm_start_type'} =~ /cold/ ) { - if (defined $finidat ) { + if (defined $finidat && !&value_is_true(($nl->get_value('use_fates')))) { $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" . " (by setting CLM_FORCE_COLDSTART=on)." ); $log->warning("Overridding input $var file with one specifying that this is a cold start from arbitrary initial conditions." ); From 33fd95de9ca0e20e30a4e9c5d7eb6caf1c700f6a Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Fri, 8 Nov 2024 13:06:31 -0700 Subject: [PATCH 184/243] Don't allow users to supply finidat for cold-start non-FATES runs. Previously, this only produced a warning, which could be overridden. --- bld/CLMBuildNamelist.pm | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index f4d60e481b..94777d320d 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -2589,11 +2589,8 @@ sub setup_logic_initial_conditions { $nl_flags->{'excess_ice_on_finidat'} = "unknown"; if ( $nl_flags->{'clm_start_type'} =~ /cold/ ) { if (defined $finidat && !&value_is_true(($nl->get_value('use_fates')))) { - $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" . + $log->fatal_error("setting $var (either explicitly in your user_nl_clm or by doing a hybrid or branch RUN_TYPE)\n is incompatible with using a cold start" . " (by setting CLM_FORCE_COLDSTART=on)." ); - $log->warning("Overridding input $var file with one specifying that this is a cold start from arbitrary initial conditions." ); - my $group = $definition->get_group_name($var); - $nl->set_variable_value($group, $var, "' '" ); } add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, $var, 'val'=>"' '", 'no_abspath'=>1); From 6fbd0cc410fa56643db46f55eee730fe5d9c439d Mon Sep 17 00:00:00 2001 From: Adrianna Foster Date: Fri, 8 Nov 2024 14:32:59 -0700 Subject: [PATCH 185/243] updating expected fails --- cime_config/testdefs/ExpectedTestFails.xml | 7 ------- components/cdeps | 2 +- src/fates | 2 +- 3 files changed, 2 insertions(+), 9 deletions(-) diff --git a/cime_config/testdefs/ExpectedTestFails.xml b/cime_config/testdefs/ExpectedTestFails.xml index 6be21e3e4f..b53914378f 100644 --- a/cime_config/testdefs/ExpectedTestFails.xml +++ b/cime_config/testdefs/ExpectedTestFails.xml @@ -319,13 +319,6 @@ - - - FAIL - #2861 - - - 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 diff --git a/src/fates b/src/fates index de61028847..fb6ab8c2f7 160000 --- a/src/fates +++ b/src/fates @@ -1 +1 @@ -Subproject commit de6102884790bb60681b11d20151fb462c1a70b5 +Subproject commit fb6ab8c2f744fdebe42e5ab2881c0c34333180b7 From 2a6348f11631ab63f3b8b6ebadc012e7ccb2a78b Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Fri, 8 Nov 2024 15:26:21 -0700 Subject: [PATCH 186/243] A fix for mpi-serial on Izumi from Jim with an update in ccs_config --- .gitmodules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitmodules b/.gitmodules index e812c4c63a..ed23904527 100644 --- a/.gitmodules +++ b/.gitmodules @@ -68,7 +68,7 @@ fxDONOTUSEurl = https://github.com/ESCOMP/mizuRoute [submodule "ccs_config"] path = ccs_config url = https://github.com/ESMCI/ccs_config_cesm.git -fxtag = ccs_config_cesm1.0.8 +fxtag = ccs_config_cesm1.0.10 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 From 000b70d74e627ff457b7353bc88921f3035fdd68 Mon Sep 17 00:00:00 2001 From: Adrianna Foster Date: Sat, 9 Nov 2024 12:42:16 -0700 Subject: [PATCH 187/243] adding izumi nag fails --- cime_config/testdefs/ExpectedTestFails.xml | 51 ++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/cime_config/testdefs/ExpectedTestFails.xml b/cime_config/testdefs/ExpectedTestFails.xml index 7049e9672b..b403c95b7e 100644 --- a/cime_config/testdefs/ExpectedTestFails.xml +++ b/cime_config/testdefs/ExpectedTestFails.xml @@ -283,6 +283,57 @@ #2325 + + + + + FAIL + #2861 + + + + + + FAIL + #2861 + + + + + + FAIL + #2861 + + + + + + FAIL + #2861 + + + + + + FAIL + #2861 + + + + + + FAIL + #2861 + + + + + + FAIL + #2861 + + + From bbe061dfa37394d2ffcd541ebd19aaae1dfbef5f Mon Sep 17 00:00:00 2001 From: Adrianna Foster Date: Sat, 9 Nov 2024 12:54:31 -0700 Subject: [PATCH 188/243] changelog --- doc/ChangeLog | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++ doc/ChangeSum | 1 + 2 files changed, 58 insertions(+) diff --git a/doc/ChangeLog b/doc/ChangeLog index 3620cd8c15..7dcda101aa 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,4 +1,61 @@ =============================================================== +Tag name: ctsm5.3.010 +Originator(s): afoster (Adrianna Foster) +Date: Sat Nov 9 12:54:18 MST 2024 +One-line Summary: Merge b4b-dev + +Purpose and description of changes +---------------------------------- + +- moves namelist variables to parameter file for PPE and makes some parameter variables pft-dimensioned (resolves ESCOMP/CTSM#2830 and resolves ESCOMP/CTSM#2831) +- removes/replaces references to DATM_C* _YR_* variables (resolves ESCOMP/CTSM#2743) +- documents that fincl1 and fexcl1 map to 'h0' history 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 +---------- +- ESCOMP/CTSM#2830 (allow LUNA & mortality parameter to vary by PFT; https://github.com/ESCOMP/CTSM/issues/2830) +- ESCOMP/CTSM#2831 (Move namelist parameters to paramfile; https://github.com/ESCOMP/CTSM/issues/2831) +- ESCOMP/CTSM#2743 (Docs: Remove refs to DATM_CLMNCEP_YR_* and DATM_CPL_YR_* variables; https://github.com/ESCOMP/CTSM/issues/2743) + + +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#2845: PPE parameter work -Addresses issues 2830 and 2831 (https://github.com/ESCOMP/CTSM/pull/2845) +- ESCOMP/CTSM#2852: Remove/replace refs to DATM_C*_YR_* variables (https://github.com/ESCOMP/CTSM/pull/2852) +- ESCOMP/CTSM#2866: Document that fincl1 maps to 'h0' history file. And fexcl1 (https://github.com/ESCOMP/CTSM/pull/2866) + +=============================================================== +=============================================================== Tag name: ctsm5.3.009 Originator(s): samrabin (Sam Rabin, UCAR/TSS, samrabin@ucar.edu) Date: Tue Oct 15 17:35:40 MDT 2024 diff --git a/doc/ChangeSum b/doc/ChangeSum index af6e1675b4..46e1176fd3 100644 --- a/doc/ChangeSum +++ b/doc/ChangeSum @@ -1,5 +1,6 @@ Tag Who Date Summary ============================================================================================================================ + ctsm5.3.010 afoster 11/09/2024 Merge b4b-dev ctsm5.3.009 samrabin 10/15/2024 Reduce outputs from matrixcnOn tests ctsm5.3.008 olyson 10/14/2024 PPE change to sa_leaf in CanopyFluxesMod.F90 ctsm5.3.007 slevis 10/14/2024 Clm60 finidat updates for ne30, f09, f19 grids From 5ccd3578d5b3ef7d7ba3fd8053a85b08ed113514 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Mon, 11 Nov 2024 12:41:09 -0700 Subject: [PATCH 189/243] run_sys_tests: Print test list in --verbose/--debug. --- python/ctsm/run_sys_tests.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/python/ctsm/run_sys_tests.py b/python/ctsm/run_sys_tests.py index 6afc43cd19..3568dcc174 100644 --- a/python/ctsm/run_sys_tests.py +++ b/python/ctsm/run_sys_tests.py @@ -8,6 +8,7 @@ from datetime import datetime from CIME.test_utils import get_tests_from_xml # pylint: disable=import-error +from CIME.test_utils import test_to_string # pylint: disable=import-error from CIME.cs_status_creator import create_cs_status # pylint: disable=import-error from ctsm.ctsm_logging import ( @@ -780,6 +781,10 @@ def _get_compilers_for_suite(suite_name, machine_name, running_ctsm_py_tests): raise RuntimeError( "No tests found for suite {} on machine {}".format(suite_name, machine_name) ) + logger.info("Tests:") + for test in test_data: + test_string = test_to_string(test).split(" ")[1] + logger.info(" %s", test_string) if not running_ctsm_py_tests: _check_py_env([t["testname"] for t in test_data]) _check_py_env([t["testmods"] for t in test_data if "testmods" in t.keys()]) From e81cbc86951912b0581573ec573155b3140313bb Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Mon, 11 Nov 2024 13:03:02 -0700 Subject: [PATCH 190/243] Only enter for-loop if verbose+. --- python/ctsm/run_sys_tests.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/python/ctsm/run_sys_tests.py b/python/ctsm/run_sys_tests.py index 3568dcc174..7d3ffe8444 100644 --- a/python/ctsm/run_sys_tests.py +++ b/python/ctsm/run_sys_tests.py @@ -781,10 +781,11 @@ def _get_compilers_for_suite(suite_name, machine_name, running_ctsm_py_tests): raise RuntimeError( "No tests found for suite {} on machine {}".format(suite_name, machine_name) ) - logger.info("Tests:") - for test in test_data: - test_string = test_to_string(test).split(" ")[1] - logger.info(" %s", test_string) + if logger.getEffectiveLevel() <= logging.INFO: + logger.info("Tests:") + for test in test_data: + test_string = test_to_string(test).split(" ")[1] + logger.info(" %s", test_string) if not running_ctsm_py_tests: _check_py_env([t["testname"] for t in test_data]) _check_py_env([t["testmods"] for t in test_data if "testmods" in t.keys()]) From c60fe19e7d93679a0b3fcaac9d26f1f56e667065 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Mon, 11 Nov 2024 17:53:58 -0700 Subject: [PATCH 191/243] Add some tests to expected fail list. --- cime_config/testdefs/ExpectedTestFails.xml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/cime_config/testdefs/ExpectedTestFails.xml b/cime_config/testdefs/ExpectedTestFails.xml index b403c95b7e..775ff2c281 100644 --- a/cime_config/testdefs/ExpectedTestFails.xml +++ b/cime_config/testdefs/ExpectedTestFails.xml @@ -334,6 +334,19 @@ + + + FAIL + #2861 + + + + + + FAIL + #2861 + + @@ -349,6 +362,13 @@ + + + FAIL + #2810 + + + From ebcd4fb4742c8eb3197a83f19309907b585c28f5 Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Mon, 11 Nov 2024 18:04:18 -0700 Subject: [PATCH 192/243] Update ChangeLog and ChangeSum. --- doc/ChangeLog | 87 +++++++++++++++++++++++++++++++++++++++++++++++++++ doc/ChangeSum | 1 + 2 files changed, 88 insertions(+) diff --git a/doc/ChangeLog b/doc/ChangeLog index 7dcda101aa..c08a55bbd4 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,4 +1,91 @@ =============================================================== +Tag name: ctsm5.3.011 +Originator(s): samrabin (Sam Rabin, UCAR/TSS, samrabin@ucar.edu) +Date: Mon Nov 11 17:55:57 MST 2024 +One-line Summary: Improve handling of cold-start finidat + +Purpose and description of changes +---------------------------------- + +This PR changes things so that: + +1. Cold-start FATES runs with finidat specified will not require -ignore_warnings, and the supplied finidat will actually be obeyed. +2. Cold-start non-FATES runs will not be allowed, even with -ignore_warnings. + + +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: +- Resolves ESCOMP/CTSM#2856: FATES will never start from specified finidat (https://github.com/ESCOMP/CTSM/issues/2856) + +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 three fates suite tests to expected fails: +- ERS_D_Mmpi-serial_Ld5.1x1_brazil.I2000Clm50FatesCruRsGs.izumi_nag.clm-FatesCold +- SMS_Lm3_D_Mmpi-serial.1x1_brazil.I2000Clm50FatesCruRsGs.izumi_nag.clm-FatesColdHydro +- ERS_D_Ld30.f45_f45_mg37.I2000Clm50FatesCruRsGs.izumi_nag.clm-FatesColdLandUse + + +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 + + regular tests (aux_clm: https://github.com/ESCOMP/CTSM/wiki/System-Testing-Guide#pre-merge-system-testing): + + derecho ----- OK + izumi ------- OK + + fates tests: + derecho ----- OK + izumi ------- OK + + +Answer changes +-------------- + +Changes answers relative to baseline: + + Summarize any changes to answers, i.e., + - what code configurations: FATES cold-start runs with finidat + - what platforms/compilers: All + - nature of change: new climate + + +Other details +------------- + +Pull Requests that document the changes (include PR ids): +- ESCOMP/CTSM#2870: Fix handling of finidat with cold starts (https://github.com/ESCOMP/CTSM/pull/2870) + +=============================================================== +=============================================================== Tag name: ctsm5.3.010 Originator(s): afoster (Adrianna Foster) Date: Sat Nov 9 12:54:18 MST 2024 diff --git a/doc/ChangeSum b/doc/ChangeSum index 46e1176fd3..daffdab145 100644 --- a/doc/ChangeSum +++ b/doc/ChangeSum @@ -1,5 +1,6 @@ Tag Who Date Summary ============================================================================================================================ + ctsm5.3.011 samrabin 11/11/2024 Improve handling of cold-start finidat ctsm5.3.010 afoster 11/09/2024 Merge b4b-dev ctsm5.3.009 samrabin 10/15/2024 Reduce outputs from matrixcnOn tests ctsm5.3.008 olyson 10/14/2024 PPE change to sa_leaf in CanopyFluxesMod.F90 From bb8a8a035d3c8377a85ab5ff3ad88091350b12aa Mon Sep 17 00:00:00 2001 From: Sam Rabin Date: Tue, 12 Nov 2024 10:13:53 -0700 Subject: [PATCH 193/243] Pylint: ignore abstract-class-instantiated in cropcal code. --- python/ctsm/crop_calendars/cropcal_figs_module.py | 1 + python/ctsm/crop_calendars/generate_gdds_functions.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/python/ctsm/crop_calendars/cropcal_figs_module.py b/python/ctsm/crop_calendars/cropcal_figs_module.py index d820460175..f26b5975d4 100644 --- a/python/ctsm/crop_calendars/cropcal_figs_module.py +++ b/python/ctsm/crop_calendars/cropcal_figs_module.py @@ -1,6 +1,7 @@ """ Functions for making crop calendar figures """ +# pylint: disable=abstract-class-instantiated import numpy as np diff --git a/python/ctsm/crop_calendars/generate_gdds_functions.py b/python/ctsm/crop_calendars/generate_gdds_functions.py index 14bd6b2e40..81c71e2a51 100644 --- a/python/ctsm/crop_calendars/generate_gdds_functions.py +++ b/python/ctsm/crop_calendars/generate_gdds_functions.py @@ -1,7 +1,7 @@ """ Functions to support generate_gdds.py """ -# pylint: disable=too-many-lines,too-many-statements +# pylint: disable=too-many-lines,too-many-statements,abstract-class-instantiated import warnings import os import glob From 7d222636cb49ccec8c168ff870caed976205b442 Mon Sep 17 00:00:00 2001 From: Adrianna Foster Date: Wed, 13 Nov 2024 09:09:37 -0700 Subject: [PATCH 194/243] remove duplicated expected fails --- cime_config/testdefs/ExpectedTestFails.xml | 34 +++------------------- src/fates | 2 +- 2 files changed, 5 insertions(+), 31 deletions(-) diff --git a/cime_config/testdefs/ExpectedTestFails.xml b/cime_config/testdefs/ExpectedTestFails.xml index 7631addb80..9cfc3d864b 100644 --- a/cime_config/testdefs/ExpectedTestFails.xml +++ b/cime_config/testdefs/ExpectedTestFails.xml @@ -180,6 +180,10 @@ FAIL #2454 + + FAIL + #2325 + @@ -277,13 +281,6 @@ - - - FAIL - #2325 - - - FAIL @@ -341,13 +338,6 @@ - - - FAIL - #2861 - - - FAIL @@ -369,13 +359,6 @@ - - - FAIL - #2810 - - - FAIL @@ -391,15 +374,6 @@ - - - FAIL - #2861 - - - - - diff --git a/src/fates b/src/fates index fb6ab8c2f7..bdb253fd92 160000 --- a/src/fates +++ b/src/fates @@ -1 +1 @@ -Subproject commit fb6ab8c2f744fdebe42e5ab2881c0c34333180b7 +Subproject commit bdb253fd9262cbb721a3f2ef033e16d73c2cd77e From 7148a3871682ae24c7f32b36432db8e4264d38f5 Mon Sep 17 00:00:00 2001 From: Adrianna Foster Date: Wed, 13 Nov 2024 09:14:50 -0700 Subject: [PATCH 195/243] another izumi_nag fail --- cime_config/testdefs/ExpectedTestFails.xml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cime_config/testdefs/ExpectedTestFails.xml b/cime_config/testdefs/ExpectedTestFails.xml index 9cfc3d864b..007468cecc 100644 --- a/cime_config/testdefs/ExpectedTestFails.xml +++ b/cime_config/testdefs/ExpectedTestFails.xml @@ -289,6 +289,14 @@ + + + + FAIL + #2861 + + + FAIL From 836d4701d9acd340558167335c17969bd32df8dc Mon Sep 17 00:00:00 2001 From: Adrianna Foster Date: Wed, 13 Nov 2024 09:54:08 -0700 Subject: [PATCH 196/243] changelog and fates tag --- .gitmodules | 2 +- doc/ChangeLog | 58 +++++++++++++++++++++++++++++++++++++++++++++++++++ doc/ChangeSum | 1 + src/fates | 2 +- 4 files changed, 61 insertions(+), 2 deletions(-) diff --git a/.gitmodules b/.gitmodules index 1f6da08484..225f2f75ac 100644 --- a/.gitmodules +++ b/.gitmodules @@ -28,7 +28,7 @@ [submodule "fates"] path = src/fates url = https://github.com/NGEET/fates -fxtag = sci.1.78.3_api.36.1.0 +fxtag = sci.1.79.3_api.37.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/doc/ChangeLog b/doc/ChangeLog index c08a55bbd4..5a2a3c472e 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,4 +1,62 @@ =============================================================== +Tag name: ctsm5.3.012 +Originator(s): afoster (Adrianna Foster,UCAR/TSS,303-497-1728) +Date: Wed 13 Nov 2024 09:53:51 AM MST +One-line Summary: update fates tag + +Purpose and description of changes +---------------------------------- + +Updates FATES tag to latest fates main (sci.1.79.3_api.37.0.0), and updates API to go +along with latest FATES update to refactor it's fire equations + + +Significant changes to scientifically-supported configurations +-------------------------------------------------------------- + + +[ ] clm6_0 + +[ ] clm5_1 + +[ ] clm5_0 + +[ ] ctsm5_0-nwp + +[ ] clm4_5 + + + + + + +Testing summary: +---------------- + + regular tests (aux_clm: https://github.com/ESCOMP/CTSM/wiki/System-Testing-Guide#pre-merge-system-testing): + + derecho ----- OK + izumi ------- OK + + fates tests: + derecho ----- OK + izumi ------- OK + + +Answer changes +-------------- + +Changes answers relative to baseline: + +Round-off differences for FATES compsets where fire is active. +NLCOMP differences for some FATES compsets + + +Pull Requests that document the changes (include PR ids): +- ESCOMP/CTSM#2782: Fates fuel refactor (https://github.com/ESCOMP/CTSM/pull/2782) + +=============================================================== +=============================================================== Tag name: ctsm5.3.011 Originator(s): samrabin (Sam Rabin, UCAR/TSS, samrabin@ucar.edu) Date: Mon Nov 11 17:55:57 MST 2024 diff --git a/doc/ChangeSum b/doc/ChangeSum index daffdab145..87d5709a68 100644 --- a/doc/ChangeSum +++ b/doc/ChangeSum @@ -1,5 +1,6 @@ Tag Who Date Summary ============================================================================================================================ + ctsm5.3.012 afoster 11/13/2024 update fates tag ctsm5.3.011 samrabin 11/11/2024 Improve handling of cold-start finidat ctsm5.3.010 afoster 11/09/2024 Merge b4b-dev ctsm5.3.009 samrabin 10/15/2024 Reduce outputs from matrixcnOn tests diff --git a/src/fates b/src/fates index bdb253fd92..e3e7d2cd86 160000 --- a/src/fates +++ b/src/fates @@ -1 +1 @@ -Subproject commit bdb253fd9262cbb721a3f2ef033e16d73c2cd77e +Subproject commit e3e7d2cd86a66f8ca0e8f6dc4a823246a2bdb95b From 6c87b4ed7ffd42e7d63d521ecd1c07d4591c5bb8 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Mon, 18 Nov 2024 00:42:57 -0700 Subject: [PATCH 197/243] Remove month length from ER tests fixing #2871 --- cime_config/testdefs/testlist_clm.xml | 52 +++++++++++++-------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index 4c13e821b3..e91bbe26f7 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -863,7 +863,7 @@ - + @@ -893,7 +893,7 @@ - + @@ -903,7 +903,7 @@ - + @@ -1434,7 +1434,7 @@ - + @@ -1444,7 +1444,7 @@ - + @@ -1452,10 +1452,10 @@ - + - + @@ -1463,7 +1463,7 @@ - + @@ -1474,7 +1474,7 @@ - + @@ -1515,13 +1515,13 @@ - + - + @@ -1551,7 +1551,7 @@ - + @@ -1561,7 +1561,7 @@ - + @@ -1697,7 +1697,7 @@ - + @@ -1725,7 +1725,7 @@ - + @@ -1734,7 +1734,7 @@ - + @@ -1926,7 +1926,7 @@ - + @@ -1936,7 +1936,7 @@ - + @@ -1944,7 +1944,7 @@ - + @@ -2400,7 +2400,7 @@ - + @@ -2466,7 +2466,7 @@ - + @@ -2475,7 +2475,7 @@ - + @@ -2619,7 +2619,7 @@ - + @@ -2628,7 +2628,7 @@ - + @@ -2794,7 +2794,7 @@ - + @@ -2802,7 +2802,7 @@ - + From 8d02a9b7612bb936b18dabdb8a9d32ebf5e75744 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Mon, 18 Nov 2024 00:44:37 -0700 Subject: [PATCH 198/243] Add another expected fail --- 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 53cf50087c..d7e8605eaa 100644 --- a/cime_config/testdefs/ExpectedTestFails.xml +++ b/cime_config/testdefs/ExpectedTestFails.xml @@ -138,6 +138,13 @@ + + + FAIL + #2310 + + + FAIL From 16459da0385c2699902e09277b87120e66cc541c Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Mon, 18 Nov 2024 13:17:31 -0700 Subject: [PATCH 199/243] Change some 13 month tests to 397 in case it's Gregorian for 2000 year compsets, make sure yearly ER tests have at least 3 years, or done in days --- cime_config/testdefs/testlist_clm.xml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index 36d143029f..b3e96839c6 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -1570,7 +1570,7 @@ - + @@ -1953,7 +1953,7 @@ - + @@ -2409,7 +2409,7 @@ - + @@ -2803,20 +2803,22 @@ - + + - + + From 9fb9da27c74a8ae31b7ccc8fe43efdd1ca60865f Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Mon, 18 Nov 2024 17:20:04 -0700 Subject: [PATCH 200/243] Remove the izumi nag mpi-serial expected fails --- cime_config/testdefs/ExpectedTestFails.xml | 81 ---------------------- 1 file changed, 81 deletions(-) diff --git a/cime_config/testdefs/ExpectedTestFails.xml b/cime_config/testdefs/ExpectedTestFails.xml index d7e8605eaa..10869f105e 100644 --- a/cime_config/testdefs/ExpectedTestFails.xml +++ b/cime_config/testdefs/ExpectedTestFails.xml @@ -298,71 +298,6 @@ - - - - - FAIL - #2861 - - - - - - FAIL - #2861 - - - - - - FAIL - #2861 - - - - - - FAIL - #2861 - - - - - - FAIL - #2861 - - - - - - FAIL - #2861 - - - - - - FAIL - #2861 - - - - - - FAIL - #2861 - - - - - - FAIL - #2861 - - - FAIL @@ -377,22 +312,6 @@ - - - FAIL - #2861 - - - - - - - FAIL - #2861 - - - - FAIL From 7f859f2eaf29837c45af9481f8e2342b440f360d Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Tue, 19 Nov 2024 02:32:46 -0700 Subject: [PATCH 201/243] Change C96 grids to use the mt232 ocean mask --- cime_config/testdefs/testlist_clm.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index b3e96839c6..8d1adde851 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -196,7 +196,7 @@ - + @@ -749,7 +749,7 @@ - + @@ -1608,7 +1608,7 @@ - + From d36049e7e636b6f581767a31b0c6ebb154f775d9 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Tue, 19 Nov 2024 02:43:40 -0700 Subject: [PATCH 202/243] Switch some tests from nofire to nofireemis testmod --- 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 8d1adde851..3e688c5872 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -2157,7 +2157,7 @@ - + @@ -2166,7 +2166,7 @@ - + @@ -2176,7 +2176,7 @@ - + @@ -2185,7 +2185,7 @@ - + From 89fdd78b30ffc4213934c890913cb4f2d9d191f3 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Tue, 19 Nov 2024 02:46:20 -0700 Subject: [PATCH 203/243] Revert "Switch some tests from nofire to nofireemis testmod" This reverts commit d36049e7e636b6f581767a31b0c6ebb154f775d9. --- 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 3e688c5872..8d1adde851 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -2157,7 +2157,7 @@ - + @@ -2166,7 +2166,7 @@ - + @@ -2176,7 +2176,7 @@ - + @@ -2185,7 +2185,7 @@ - + From 7f57331c71194144e668eb1b37a8d53fcbc41def Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Tue, 19 Nov 2024 11:15:20 -0700 Subject: [PATCH 204/243] Fix SP nofire tests Some of the ctsm_sci tests with Sp were running nofire, which should have been nofireemis with the default testmod. --- cime_config/testdefs/testlist_clm.xml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index 8d1adde851..81eb7265d2 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -2157,7 +2157,7 @@ - + @@ -2166,32 +2166,35 @@ - + + - + + - + + From 12c5f569a9c101ac30af484e1e458f7948626048 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Tue, 19 Nov 2024 12:41:16 -0700 Subject: [PATCH 205/243] Fix 36 year tests that should have been 3 I put in 36 year tests rather than 3 years. One ERP test I made for 762 days rather than 3 years to shorten it. 762 allows even months for one year being a leap year. --- 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 81eb7265d2..cec7e775f5 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -1524,13 +1524,13 @@ - + - + @@ -2478,7 +2478,7 @@ - + @@ -2487,7 +2487,7 @@ - + From 89bbdbc9f0757b755a239120231dbaf8063d883e Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 20 Nov 2024 01:57:50 -0700 Subject: [PATCH 206/243] fix (namelist-tester): Run CAM special tests for clm6_0 and get working --- bld/unit_testers/build-namelist_test.pl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bld/unit_testers/build-namelist_test.pl b/bld/unit_testers/build-namelist_test.pl index c012d35418..f23f7d6173 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 = 3230; +my $ntests = 3263; if ( defined($opts{'compare'}) ) { $ntests += 2437; @@ -473,7 +473,7 @@ sub cat_and_create_namelistinfile { print "\n===============================================================================\n"; print "Test some CAM specific setups for special grids \n"; print "=================================================================================\n"; -foreach my $phys ( "clm4_5", "clm5_0" ) { +foreach my $phys ( "clm4_5", "clm5_0", "clm6_0" ) { $mode = "-phys $phys"; &make_config_cache($phys); foreach my $options ( @@ -485,7 +485,7 @@ sub cat_and_create_namelistinfile { "-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 1x1_brazil -no-megan -use_case 2000_control -lnd_tuning_mode ${phys}_GSWP3v1", "-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", ) { @@ -906,7 +906,7 @@ sub cat_and_create_namelistinfile { namelst=>"h2osfcflag=0", phys=>"clm5_0", }, - "45bad lnd_tuning_mode value" =>{ options=>"-lnd_tuning_mode clm5_0_GSWP3 -envxml_dir .", + "45bad lnd_tuning_mode value" =>{ options=>"-lnd_tuning_mode clm5_0_GSWP3v1 -envxml_dir .", namelst=>"", phys=>"clm4_5", }, From 1de46e3224299ee4eaa87acac8c45c777c75a2ab Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 20 Nov 2024 17:23:30 -0700 Subject: [PATCH 207/243] change (tests): change some of the ER tests that were changed to length days so that they won't be on an exact year/month boundary --- cime_config/testdefs/testlist_clm.xml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index cec7e775f5..2ad1f3b4d5 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -902,7 +902,7 @@ - + @@ -1551,7 +1551,7 @@ - + @@ -1560,7 +1560,7 @@ - + @@ -2412,7 +2412,7 @@ - + @@ -2478,7 +2478,7 @@ - + @@ -2487,7 +2487,7 @@ - + From 770fc1fc3e9e88c90baaa2ba88f50843b900191e Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 20 Nov 2024 17:48:38 -0700 Subject: [PATCH 208/243] update (submodules): ccs_config directory --- ccs_config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ccs_config b/ccs_config index 775e9f7900..6e77e7ee17 160000 --- a/ccs_config +++ b/ccs_config @@ -1 +1 @@ -Subproject commit 775e9f790044c3632e70e2beda9d66db34558b7b +Subproject commit 6e77e7ee1748a4d3b2497d7ad3943498a7cec2aa From 41ac44e63d4c6210eacfef1671118076fb698cad Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 20 Nov 2024 23:36:08 -0700 Subject: [PATCH 209/243] fix(testslist): Last ER monthly test to convert --- 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 2ad1f3b4d5..976df654c5 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -3366,7 +3366,7 @@ - + From 2018fe48dc047d7654fd2e815b1281a30bd7b0a1 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Thu, 21 Nov 2024 12:17:22 -0700 Subject: [PATCH 210/243] Squashed '.lib/git-fleximod/' changes from 02e859950..50bd54c63 50bd54c63 Bump to 0.9.3 1e0c40a46 Merge pull request #66 from ESMCI/poetry_and_test_update 135770709 strip strip e7f9a261c fix issue 65 b1568e724 update poetry certifi version and update tests failing due to mpi-serial update git-subtree-dir: .lib/git-fleximod git-subtree-split: 50bd54c63e38c52e0bfc4a1d6bc6cb0eea6cf645 --- git_fleximod/cli.py | 38 ++++++++++++++++++++---------------- git_fleximod/git_fleximod.py | 2 +- git_fleximod/submodule.py | 2 +- poetry.lock | 6 +++--- pyproject.toml | 2 +- tbump.toml | 2 +- tests/conftest.py | 4 ++-- 7 files changed, 30 insertions(+), 26 deletions(-) diff --git a/git_fleximod/cli.py b/git_fleximod/cli.py index 208bc04684..ac9493cfc3 100644 --- a/git_fleximod/cli.py +++ b/git_fleximod/cli.py @@ -2,27 +2,31 @@ import argparse from git_fleximod import utils -__version__ = "0.9.2" +__version__ = "0.9.3" 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) - return None - + try: + root = utils.execute_subprocess(["git","rev-parse", "--show-toplevel"], + output_to_caller=True ).rstrip() + except: + 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) + return None + return Path(root) def get_parser(): description = """ diff --git a/git_fleximod/git_fleximod.py b/git_fleximod/git_fleximod.py index 0851e9d095..13f35df959 100755 --- a/git_fleximod/git_fleximod.py +++ b/git_fleximod/git_fleximod.py @@ -342,7 +342,7 @@ def main(): excludelist=excludelist, ) if not gitmodules.sections(): - sys.exit("No submodule components found") + sys.exit(f"No submodule components found, root_dir={root_dir}") retval = 0 if action == "update": submodules_update(gitmodules, root_dir, fxrequired, force) diff --git a/git_fleximod/submodule.py b/git_fleximod/submodule.py index c939d54bc9..75d9dd4eb9 100644 --- a/git_fleximod/submodule.py +++ b/git_fleximod/submodule.py @@ -221,7 +221,7 @@ def sparse_checkout(self): if superroot: gitroot = superroot.strip() else: - gitroot = self.root_dir.strip() + gitroot = self.root_dir # Now need to move the .git dir to the submodule location rootdotgit = os.path.join(self.root_dir, ".git") while os.path.isfile(rootdotgit): diff --git a/poetry.lock b/poetry.lock index 3a74effcd1..ac82fb0d97 100644 --- a/poetry.lock +++ b/poetry.lock @@ -30,13 +30,13 @@ dev = ["freezegun (>=1.0,<2.0)", "pytest (>=6.0)", "pytest-cov"] [[package]] name = "certifi" -version = "2024.6.2" +version = "2024.8.30" description = "Python package for providing Mozilla's CA Bundle." optional = false python-versions = ">=3.6" files = [ - {file = "certifi-2024.6.2-py3-none-any.whl", hash = "sha256:ddc6c8ce995e6987e7faf5e3f1b02b302836a0e5d98ece18392cb1a36c72ad56"}, - {file = "certifi-2024.6.2.tar.gz", hash = "sha256:3cd43f1c6fa7dedc5899d69d3ad0398fd018ad1a17fba83ddaf78aa46c747516"}, + {file = "certifi-2024.8.30-py3-none-any.whl", hash = "sha256:922820b53db7a7257ffbda3f597266d435245903d80737e34f8a45ff3e3230d8"}, + {file = "certifi-2024.8.30.tar.gz", hash = "sha256:bec941d2aa8195e248a60b31ff9f0558284cf01a52591ceda73ea9afffd69fd9"}, ] [[package]] diff --git a/pyproject.toml b/pyproject.toml index 619cdabe3b..1d0419ad20 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "git-fleximod" -version = "0.9.2" +version = "0.9.3" description = "Extended support for git-submodule and git-sparse-checkout" authors = ["Jim Edwards "] maintainers = ["Jim Edwards "] diff --git a/tbump.toml b/tbump.toml index 920ff0591c..b432206a54 100644 --- a/tbump.toml +++ b/tbump.toml @@ -2,7 +2,7 @@ github_url = "https://github.com/jedwards4b/git-fleximod/" [version] -current = "0.9.2" +current = "0.9.3" # Example of a semver regexp. # Make sure this matches current_version before diff --git a/tests/conftest.py b/tests/conftest.py index 81edbe713e..1dd1b86f34 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -32,7 +32,7 @@ def logger(): "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, out of sync at tag None, expected tag is MPIserial_2.4.0 (optional)", + "status3" : "test_optional not checked out, out of sync at tag MPIserial_2.5.1, expected tag is MPIserial_2.4.0 (optional)", "status4" : "test_optional at tag MPIserial_2.4.0", "gitmodules_content": """ [submodule "test_optional"] @@ -46,7 +46,7 @@ def logger(): "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" : "out of sync at tag None, expected tag is e5cf35c", + "status3" : "out of sync at tag MPIserial_2.5.1, expected tag is e5cf35c", "status4" : "test_alwaysoptional at hash e5cf35c", "gitmodules_content": """ [submodule "test_alwaysoptional"] From 46c5ee1455c41d7312807e6d90f976b4ebc2eb9b Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Thu, 21 Nov 2024 16:39:18 -0700 Subject: [PATCH 211/243] fix (fatest Landuse test): Get the FatesColdLandUse test working by using a transient compset longname, and adjusting some things in the test-mod --- cime_config/testdefs/testlist_clm.xml | 2 +- .../testmods_dirs/clm/FatesColdLandUse/shell_commands | 6 +++++- .../testdefs/testmods_dirs/clm/FatesColdLandUse/user_nl_clm | 6 ++++++ 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index 976df654c5..380d45c620 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -3072,7 +3072,7 @@ - + diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesColdLandUse/shell_commands b/cime_config/testdefs/testmods_dirs/clm/FatesColdLandUse/shell_commands index 6152f0bd0c..7b89551fde 100644 --- a/cime_config/testdefs/testmods_dirs/clm/FatesColdLandUse/shell_commands +++ b/cime_config/testdefs/testmods_dirs/clm/FatesColdLandUse/shell_commands @@ -1,3 +1,7 @@ #!/bin/bash -./xmlchange CLM_BLDNML_OPTS="-clm_demand flanduse_timeseries" --append +# Make sure the use-case is a transient one, so that that the landuse.timeeries file is used +# TODO: Have cases that turn FATES landuse on, use transient compsets and require that they do +# See: https://github.com/ESCOMP/CTSM/issues/2304 +# https://github.com/ESCOMP/CTSM/issues/1617 +./xmlchange --force CLM_NML_USE_CASE=20thC_transient 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 f718010b07..d0c503b0ef 100644 --- a/cime_config/testdefs/testmods_dirs/clm/FatesColdLandUse/user_nl_clm +++ b/cime_config/testdefs/testmods_dirs/clm/FatesColdLandUse/user_nl_clm @@ -1 +1,7 @@ +! FATES LandUse using the CTSM landuse timeseries file for the transitions +! Turn off transient lakes and urban right now, until this is handled in +! the build-namelist +! See: https://github.com/ESCOMP/CTSM/issues/1617 fates_harvest_mode = 'landuse_timeseries' +do_transient_lakes = .false. +do_transient_urban = .false. From 26821d837400f640675ed19cd6e4cdb6c3de12bb Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Fri, 22 Nov 2024 11:32:58 -0700 Subject: [PATCH 212/243] Add FatesSetupParamBuild to the testmods that will make FATES parameter files as it will test that the environment will work to run it --- .../clm/FatesColdHydro/include_user_mods | 1 + .../clm/FatesColdPRT2/include_user_mods | 1 + .../clm/FatesSetupParamBuild/shell_commands | 84 +++++++++++++++++++ 3 files changed, 86 insertions(+) create mode 100755 cime_config/testdefs/testmods_dirs/clm/FatesSetupParamBuild/shell_commands diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesColdHydro/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/FatesColdHydro/include_user_mods index 14f7591b72..77430498b3 100644 --- a/cime_config/testdefs/testmods_dirs/clm/FatesColdHydro/include_user_mods +++ b/cime_config/testdefs/testmods_dirs/clm/FatesColdHydro/include_user_mods @@ -1 +1,2 @@ ../FatesCold +../FatesSetupParamBuild diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesColdPRT2/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/FatesColdPRT2/include_user_mods index 14f7591b72..61325515f3 100644 --- a/cime_config/testdefs/testmods_dirs/clm/FatesColdPRT2/include_user_mods +++ b/cime_config/testdefs/testmods_dirs/clm/FatesColdPRT2/include_user_mods @@ -1 +1,2 @@ ../FatesCold +../FatesSetupParamBuild/ diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesSetupParamBuild/shell_commands b/cime_config/testdefs/testmods_dirs/clm/FatesSetupParamBuild/shell_commands new file mode 100755 index 0000000000..95f913c392 --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/FatesSetupParamBuild/shell_commands @@ -0,0 +1,84 @@ +#!/bin/bash + +# Make sure the environment is setup to run the FATES modify parameter file tool + +if [ -f xmlquery ]; then + SRCDIR=$(./xmlquery SRCROOT --value || echo "null") + error=$? + if [ $error != 0 ]; then + echo "Trouble getting SRCROOT from case" + exit 1 + fi + CASEDIR=`./xmlquery CASEROOT --value` + error=$? + if [ $error != 0 ]; then + echo "Trouble getting CASEROOT from case" + exit 1 + fi + DEBUG=0 +else + echo "set SRCDIR assuming running in the testmod directory" + DEBUG=1 + PWD=`pwd` + CASEDIR=$PWD + SRCDIR="$PWD/../../../../.." +fi +FATESDIR="$SRCDIR/src/fates/" + +# check if ncgen is in your path +which ncgen >& /dev/null +error=$? +if [ $error != 0 ]; then + echo "ncgen is NOT in your path" + exit 1 +elif [ $DEBUG ]; then + echo "ncgen was found" +fi + +# check if conda is in your path +which conda >& /dev/null +error=$? +if [ $error != 0 ]; then + echo "conda is NOT in your path and is used to get the python environment to run the FATES modify parameter file tool" + noconda=1 +else + if [ $DEBUG ]; then + echo "conda was found" + fi + noconda=0 +fi + +# Check that the modify script exists and can be used + +MODIFY_FATES_PARAMFILE="$FATESDIR/tools/modify_fates_paramfile.py" +if [ ! -f $MODIFY_FATES_PARAMFILE ]; then + echo "$MODIFY_FATES_PARAMFILE does NOT exist" + exit 1 +elif [ $DEBUG ]; then + echo "$MODIFY_FATES_PARAMFILE was found" +fi + +$MODIFY_FATES_PARAMFILE --help >& /dev/null +error=$? +if [ $error != 0 ]; then + echo "$MODIFY_FATES_PARAMFILE can NOT be succesfully run" + if [ $noconda == 1 ]; then + echo "Attempting to activate the conda ctsm_pylib environment" + conda activate ctsm_pylib + error=$? + if [ $error != 0 ]; then + echo "Trouble activating the conda ctsm_pylib environment" + exit 1 + elif [ $DEBUG ]; then + echo "conda activate ctsm_pylib was successful" + fi + else + echo "Make sure your python environment can run $MODIFY_FATES_PARAMFILE" + echo "One way to do that is to add conda to your environment" + echo " then activate the ctsm_pylib environemnt" + echo " ctsm_oylib is created at the top level of CTSM using py_env_create" + exit 1 + fi +elif [ $DEBUG ]; then + echo "$MODIFY_FATES_PARAMFILE is runable" +fi From 1a30a2abda72cc37bddd494135c4799b083e6a7d Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Fri, 22 Nov 2024 11:35:47 -0700 Subject: [PATCH 213/243] fix (build-namelist): Remove the check for file existance so that build-namelist can be run and check_input_data --download can be used to get files that currently don't exist --- bld/CLMBuildNamelist.pm | 8 -------- 1 file changed, 8 deletions(-) diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index a3236d4354..ee5dd18c9e 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -4758,8 +4758,6 @@ sub setup_logic_fates { 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_inventory_init is set" ); - } elsif ( ! -f "$fname" ) { - $log->fatal_error("$fname does NOT point to a valid filename" ); } } } @@ -4790,8 +4788,6 @@ sub setup_logic_fates { 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" ); } } } @@ -4804,8 +4800,6 @@ sub setup_logic_fates { 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" ); } } } @@ -4847,8 +4841,6 @@ sub setup_logic_fates { 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 landuse_timeseries" ); - } elsif ( ! -f "$fname" ) { - $log->fatal_error("$var does NOT point to a valid filename" ); } } } From a9b02b749f67c987c8cfb1567bc35bca253472ab Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Fri, 22 Nov 2024 14:47:26 -0700 Subject: [PATCH 214/243] Comment out the use-case setting, just make sure the compset used for the test is a transient one --- .../testdefs/testmods_dirs/clm/FatesColdLandUse/shell_commands | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesColdLandUse/shell_commands b/cime_config/testdefs/testmods_dirs/clm/FatesColdLandUse/shell_commands index 7b89551fde..1db5b1820c 100644 --- a/cime_config/testdefs/testmods_dirs/clm/FatesColdLandUse/shell_commands +++ b/cime_config/testdefs/testmods_dirs/clm/FatesColdLandUse/shell_commands @@ -4,4 +4,4 @@ # TODO: Have cases that turn FATES landuse on, use transient compsets and require that they do # See: https://github.com/ESCOMP/CTSM/issues/2304 # https://github.com/ESCOMP/CTSM/issues/1617 -./xmlchange --force CLM_NML_USE_CASE=20thC_transient +#./xmlchange --force CLM_NML_USE_CASE=20thC_transient From 9b7f94a0e94fe915e546f988de26eff024ec2a09 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Fri, 22 Nov 2024 17:57:22 -0700 Subject: [PATCH 215/243] refactor (FATES param build test): Make a function to make checking for errors easier --- .../clm/FatesSetupParamBuild/shell_commands | 45 ++++++++++--------- 1 file changed, 23 insertions(+), 22 deletions(-) diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesSetupParamBuild/shell_commands b/cime_config/testdefs/testmods_dirs/clm/FatesSetupParamBuild/shell_commands index 95f913c392..4030917f7e 100755 --- a/cime_config/testdefs/testmods_dirs/clm/FatesSetupParamBuild/shell_commands +++ b/cime_config/testdefs/testmods_dirs/clm/FatesSetupParamBuild/shell_commands @@ -2,36 +2,39 @@ # Make sure the environment is setup to run the FATES modify parameter file tool -if [ -f xmlquery ]; then - SRCDIR=$(./xmlquery SRCROOT --value || echo "null") - error=$? - if [ $error != 0 ]; then - echo "Trouble getting SRCROOT from case" - exit 1 +# Function to check for errors and abort +check_error () { + # Arguments: error, message + if [ $# != 2 ]; then + echo "Wrong number of arguments to check_error" fi - CASEDIR=`./xmlquery CASEROOT --value` - error=$? + error=$1 + msg=$2 if [ $error != 0 ]; then - echo "Trouble getting CASEROOT from case" + echo "ERROR: Command failed" + echo $msg exit 1 fi +} + +# If under a casedirectory get a few variables for later use +if [ -f xmlquery ]; then + SRCDIR=$(./xmlquery SRCROOT --value || echo "null") + check_error $? "Trouble getting SRCROOT from case" DEBUG=0 +# otherwise if this is being run in the testmod directory for debugging else echo "set SRCDIR assuming running in the testmod directory" DEBUG=1 PWD=`pwd` - CASEDIR=$PWD SRCDIR="$PWD/../../../../.." fi FATESDIR="$SRCDIR/src/fates/" # check if ncgen is in your path which ncgen >& /dev/null -error=$? -if [ $error != 0 ]; then - echo "ncgen is NOT in your path" - exit 1 -elif [ $DEBUG ]; then +check_error $? "ncgen is NOT in your path" +if [ $DEBUG ]; then echo "ncgen was found" fi @@ -61,22 +64,20 @@ fi $MODIFY_FATES_PARAMFILE --help >& /dev/null error=$? if [ $error != 0 ]; then - echo "$MODIFY_FATES_PARAMFILE can NOT be succesfully run" + echo "$MODIFY_FATES_PARAMFILE can NOT be successfully run" if [ $noconda == 1 ]; then echo "Attempting to activate the conda ctsm_pylib environment" conda activate ctsm_pylib - error=$? - if [ $error != 0 ]; then - echo "Trouble activating the conda ctsm_pylib environment" - exit 1 - elif [ $DEBUG ]; then + check_error $? "Trouble activating the conda ctsm_pylib environment" + if [ $DEBUG ]; then echo "conda activate ctsm_pylib was successful" fi else echo "Make sure your python environment can run $MODIFY_FATES_PARAMFILE" echo "One way to do that is to add conda to your environment" echo " then activate the ctsm_pylib environemnt" - echo " ctsm_oylib is created at the top level of CTSM using py_env_create" + echo " in some cases you may have to add conda activate ctsm_pylib in your startup files" + echo " ctsm_pylib is created at the top level of CTSM using py_env_create" exit 1 fi elif [ $DEBUG ]; then From 6ea3f59b1d8cb86259870fba93ab031309ceb27f Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Fri, 22 Nov 2024 18:51:19 -0700 Subject: [PATCH 216/243] Add another level to the testmod includes, so that the FatesSetupBuild lavel appears in the final shell_commands file for the case --- .../testdefs/testmods_dirs/clm/FatesColdHydro/include_user_mods | 1 + .../testdefs/testmods_dirs/clm/FatesColdPRT2/include_user_mods | 1 + 2 files changed, 2 insertions(+) diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesColdHydro/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/FatesColdHydro/include_user_mods index 77430498b3..5ad8824b70 100644 --- a/cime_config/testdefs/testmods_dirs/clm/FatesColdHydro/include_user_mods +++ b/cime_config/testdefs/testmods_dirs/clm/FatesColdHydro/include_user_mods @@ -1,2 +1,3 @@ +../Fates ../FatesCold ../FatesSetupParamBuild diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesColdPRT2/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/FatesColdPRT2/include_user_mods index 61325515f3..e781a89ea2 100644 --- a/cime_config/testdefs/testmods_dirs/clm/FatesColdPRT2/include_user_mods +++ b/cime_config/testdefs/testmods_dirs/clm/FatesColdPRT2/include_user_mods @@ -1,2 +1,3 @@ +../Fates ../FatesCold ../FatesSetupParamBuild/ From 0fbb17f717e90181211c6fb4625c543c43d51081 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Fri, 22 Nov 2024 20:28:10 -0700 Subject: [PATCH 217/243] fix (FATES tests): Add FatesSetupParamBuild to the FATES tests that run the modify_fates_paramfile.py script, so that it will ensure environment is ready to run the script --- .../testmods_dirs/clm/FatesColdSeedDisp/include_user_mods | 2 ++ .../testmods_dirs/clm/FatesColdTwoStream/include_user_mods | 2 ++ .../clm/FatesColdTwoStreamNoCompFixedBioGeo/include_user_mods | 3 +++ 3 files changed, 7 insertions(+) diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesColdSeedDisp/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/FatesColdSeedDisp/include_user_mods index 14f7591b72..5ad8824b70 100644 --- a/cime_config/testdefs/testmods_dirs/clm/FatesColdSeedDisp/include_user_mods +++ b/cime_config/testdefs/testmods_dirs/clm/FatesColdSeedDisp/include_user_mods @@ -1 +1,3 @@ +../Fates ../FatesCold +../FatesSetupParamBuild diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesColdTwoStream/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/FatesColdTwoStream/include_user_mods index 14f7591b72..5ad8824b70 100644 --- a/cime_config/testdefs/testmods_dirs/clm/FatesColdTwoStream/include_user_mods +++ b/cime_config/testdefs/testmods_dirs/clm/FatesColdTwoStream/include_user_mods @@ -1 +1,3 @@ +../Fates ../FatesCold +../FatesSetupParamBuild diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesColdTwoStreamNoCompFixedBioGeo/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/FatesColdTwoStreamNoCompFixedBioGeo/include_user_mods index 17d5840e8c..afd6dde8e1 100644 --- a/cime_config/testdefs/testmods_dirs/clm/FatesColdTwoStreamNoCompFixedBioGeo/include_user_mods +++ b/cime_config/testdefs/testmods_dirs/clm/FatesColdTwoStreamNoCompFixedBioGeo/include_user_mods @@ -1 +1,4 @@ +../Fates +../FatesCold ../FatesColdNoComp +../FatesSetupParamBuild From 4ece589f055a775fa98b346fd07f322be7d0c985 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Tue, 26 Nov 2024 15:22:04 -0700 Subject: [PATCH 218/243] Update change files --- doc/ChangeLog | 99 +++++++++++++++++++++++++++++++++++++++++++++++++++ doc/ChangeSum | 1 + 2 files changed, 100 insertions(+) diff --git a/doc/ChangeLog b/doc/ChangeLog index 5a2a3c472e..fc4ee9f376 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,4 +1,103 @@ =============================================================== +Tag name: ctsm5.3.013 +Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326) +Date: Tue 26 Nov 2024 02:59:49 PM MST +One-line Summary: Merge b4b-dev + +Purpose and description of changes +---------------------------------- + +Bring in latest b4b-dev branch to main CTSM development. + +- Update git-fleximod +- Fix equation number in tech note +- Implement urbanl and urbanc coszen filters +- Make ALBGRD and ALBGRI active by default +- Some adjustments to control pylint for the RXCROPMATURITY python tests +- Run_sys_tests: Print test list in --verbose/--debug. + +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 #17 albgrd and albgri history fields depend on decomposition, for urban points + Fixes #747 In UrbanAlbedo: Create a filter for coszen>0 and operate over that + +Notes of particular relevance for users +--------------------------------------- + +Changes made to namelist defaults (e.g., changed parameter values): + ALBGRD/ALBGRI are now active by default on the h0 files + +Changes to documentation: Fixed equation number + +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.] + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): + +Changes to tests or testing: + Testlist that will be run is now output when --verbose/--debug is given to run_sys_tests + +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 + +If the tag used for baseline comparisons was NOT the previous tag, note that here: + + +Answer changes +-------------- + +Changes answers relative to baseline: No bit-for-bit + +Other details +------------- + +Pull Requests that document the changes (include PR ids): +(https://github.com/ESCOMP/ctsm/pull) + #2893 -- Merge b4b-dev + #2786 -- git fleximod + #2848 -- equation number in tech note + #2875 -- run_sys_tests log testlist for --verbose/--debug options + #2860 -- Remove num_solar and implement coszen filters in UrbanAlbedoMod.F90 + +=============================================================== +=============================================================== Tag name: ctsm5.3.012 Originator(s): afoster (Adrianna Foster,UCAR/TSS,303-497-1728) Date: Wed 13 Nov 2024 09:53:51 AM MST diff --git a/doc/ChangeSum b/doc/ChangeSum index 87d5709a68..85e347513b 100644 --- a/doc/ChangeSum +++ b/doc/ChangeSum @@ -1,5 +1,6 @@ Tag Who Date Summary ============================================================================================================================ + ctsm5.3.013 erik 11/26/2024 Merge b4b-dev ctsm5.3.012 afoster 11/13/2024 update fates tag ctsm5.3.011 samrabin 11/11/2024 Improve handling of cold-start finidat ctsm5.3.010 afoster 11/09/2024 Merge b4b-dev From b5665652e86cd43256b6ff9c22f9647bfb6e5af1 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 27 Nov 2024 01:57:03 -0700 Subject: [PATCH 219/243] Change 15 day ER tests to 20 day tests as this version of cime no longer allows 15 day tests --- cime_config/testdefs/testlist_clm.xml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index 380d45c620..0c6d85bd40 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -2731,7 +2731,7 @@ - + @@ -2740,7 +2740,7 @@ - + @@ -2749,7 +2749,7 @@ - + @@ -2758,7 +2758,7 @@ - + @@ -2769,7 +2769,7 @@ - + From 874ee3942ca6110308adccb58280ab0aea752846 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 27 Nov 2024 02:01:35 -0700 Subject: [PATCH 220/243] Pipe errors to stdout --- .../clm/FatesSetupParamBuild/shell_commands | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesSetupParamBuild/shell_commands b/cime_config/testdefs/testmods_dirs/clm/FatesSetupParamBuild/shell_commands index 4030917f7e..e23709974c 100755 --- a/cime_config/testdefs/testmods_dirs/clm/FatesSetupParamBuild/shell_commands +++ b/cime_config/testdefs/testmods_dirs/clm/FatesSetupParamBuild/shell_commands @@ -6,13 +6,13 @@ check_error () { # Arguments: error, message if [ $# != 2 ]; then - echo "Wrong number of arguments to check_error" + echo "Wrong number of arguments to check_error" >&2 fi error=$1 msg=$2 if [ $error != 0 ]; then - echo "ERROR: Command failed" - echo $msg + echo "ERROR: Command failed" >&2 + echo $msg >&2 exit 1 fi } @@ -42,7 +42,7 @@ fi which conda >& /dev/null error=$? if [ $error != 0 ]; then - echo "conda is NOT in your path and is used to get the python environment to run the FATES modify parameter file tool" + echo "conda is NOT in your path and is used to get the python environment to run the FATES modify parameter file tool" >&2 noconda=1 else if [ $DEBUG ]; then @@ -55,7 +55,7 @@ fi MODIFY_FATES_PARAMFILE="$FATESDIR/tools/modify_fates_paramfile.py" if [ ! -f $MODIFY_FATES_PARAMFILE ]; then - echo "$MODIFY_FATES_PARAMFILE does NOT exist" + echo "$MODIFY_FATES_PARAMFILE does NOT exist" >&2 exit 1 elif [ $DEBUG ]; then echo "$MODIFY_FATES_PARAMFILE was found" @@ -64,7 +64,7 @@ fi $MODIFY_FATES_PARAMFILE --help >& /dev/null error=$? if [ $error != 0 ]; then - echo "$MODIFY_FATES_PARAMFILE can NOT be successfully run" + echo "$MODIFY_FATES_PARAMFILE can NOT be successfully run" >&2 if [ $noconda == 1 ]; then echo "Attempting to activate the conda ctsm_pylib environment" conda activate ctsm_pylib @@ -73,11 +73,11 @@ if [ $error != 0 ]; then echo "conda activate ctsm_pylib was successful" fi else - echo "Make sure your python environment can run $MODIFY_FATES_PARAMFILE" - echo "One way to do that is to add conda to your environment" - echo " then activate the ctsm_pylib environemnt" - echo " in some cases you may have to add conda activate ctsm_pylib in your startup files" - echo " ctsm_pylib is created at the top level of CTSM using py_env_create" + echo "Make sure your python environment can run $MODIFY_FATES_PARAMFILE" >&2 + echo "One way to do that is to add conda to your environment" >&2 + echo " then activate the ctsm_pylib environemnt" >&2 + echo " in some cases you may have to add conda activate ctsm_pylib in your startup files" >&2 + echo " ctsm_pylib is created at the top level of CTSM using py_env_create" >&2 exit 1 fi elif [ $DEBUG ]; then From 82ba004e8a90e9a31ae45fcf383e1feda284c2b9 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Sat, 30 Nov 2024 17:31:30 -0700 Subject: [PATCH 221/243] fix (FatesParamfileSetup): get it working again correctly --- .../clm/FatesSetupParamBuild/shell_commands | 112 ++++++++++++------ 1 file changed, 79 insertions(+), 33 deletions(-) diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesSetupParamBuild/shell_commands b/cime_config/testdefs/testmods_dirs/clm/FatesSetupParamBuild/shell_commands index e23709974c..0f4fab8560 100755 --- a/cime_config/testdefs/testmods_dirs/clm/FatesSetupParamBuild/shell_commands +++ b/cime_config/testdefs/testmods_dirs/clm/FatesSetupParamBuild/shell_commands @@ -2,21 +2,61 @@ # Make sure the environment is setup to run the FATES modify parameter file tool +# Function to log a message if $DEBUG is set +log_msg_if_debug () { + # Arguments: message + if [ "$#" -ne "1" ]; then + echo "Wrong number of arguments to log_msg_if_debug" >&2 + exit 5 + fi + if [ -z "$DEBUG" ];then + echo "log_msg_if_debug was called without DEBUG being set" >&2 + exit 5 + fi + if [ "$DEBUG" -eq "1" ]; then + echo -e $1 + fi +} + # Function to check for errors and abort check_error () { - # Arguments: error, message - if [ $# != 2 ]; then + # Arguments: error, error-message + if [ "$#" -ne "2" ]; then echo "Wrong number of arguments to check_error" >&2 + exit 5 fi error=$1 msg=$2 - if [ $error != 0 ]; then + if [ "$error" -ne "0" ]; then echo "ERROR: Command failed" >&2 echo $msg >&2 exit 1 fi } +# Function to check if a script or command runs without errors +check_if_runable () { + # DO NOT: Add exit statements here as this is meant to be in an if statement + # All log output should also go to standard error, to not confuse the integer return code + # Arguments: command, error-message + # Returns TRUE if runable and FALSE otherwise + if [ "$#" -ne "2" ]; then + echo "Wrong number of arguments to check_if_runable: $# should be 2" >&2 + return 0 + fi + cmd=$1 + msg=$2 + # Run command and send all output to /dev/null to remove it + $($cmd >& /dev/null) + error=$? + if [ "$error" -ne "0" ]; then + echo $msg >&2 + return 0 + else + return 1 + fi +} + # If under a casedirectory get a few variables for later use if [ -f xmlquery ]; then SRCDIR=$(./xmlquery SRCROOT --value || echo "null") @@ -26,30 +66,26 @@ if [ -f xmlquery ]; then else echo "set SRCDIR assuming running in the testmod directory" DEBUG=1 - PWD=`pwd` - SRCDIR="$PWD/../../../../.." + SRCDIR=$(realpath "../../../../..") fi FATESDIR="$SRCDIR/src/fates/" # check if ncgen is in your path -which ncgen >& /dev/null +$(which ncgen >& /dev/null) check_error $? "ncgen is NOT in your path" -if [ $DEBUG ]; then - echo "ncgen was found" -fi +log_msg_if_debug "ncgen was found" # check if conda is in your path -which conda >& /dev/null -error=$? -if [ $error != 0 ]; then - echo "conda is NOT in your path and is used to get the python environment to run the FATES modify parameter file tool" >&2 +msg="conda is NOT in your path and is used to get the python environment to run the FATES modify parameter file tool" +cmd="which conda" +$(check_if_runable "$cmd" "$msg") +if [[ "$?" -eq "0" ]]; then noconda=1 else - if [ $DEBUG ]; then - echo "conda was found" - fi + log_msg_if_debug "conda was found" noconda=0 fi +echo "noconda = $noconda" # Check that the modify script exists and can be used @@ -57,29 +93,39 @@ MODIFY_FATES_PARAMFILE="$FATESDIR/tools/modify_fates_paramfile.py" if [ ! -f $MODIFY_FATES_PARAMFILE ]; then echo "$MODIFY_FATES_PARAMFILE does NOT exist" >&2 exit 1 -elif [ $DEBUG ]; then - echo "$MODIFY_FATES_PARAMFILE was found" fi +log_msg_if_debug "$MODIFY_FATES_PARAMFILE was found" -$MODIFY_FATES_PARAMFILE --help >& /dev/null -error=$? -if [ $error != 0 ]; then - echo "$MODIFY_FATES_PARAMFILE can NOT be successfully run" >&2 - if [ $noconda == 1 ]; then - echo "Attempting to activate the conda ctsm_pylib environment" - conda activate ctsm_pylib - check_error $? "Trouble activating the conda ctsm_pylib environment" - if [ $DEBUG ]; then - echo "conda activate ctsm_pylib was successful" +msg="$MODIFY_FATES_PARAMFILE can NOT be successfully run" +cmd="$MODIFY_FATES_PARAMFILE --help" +# If not runable as is if conda is available try some different options +$(check_if_runable "$cmd" "$msg") +if [[ "$?" -eq "0" ]]; then + echo "failed..." + if [[ $noconda -eq "0" ]]; then + prefix="conda run -n ctsm_pylib" + echo "Attempting to run under \'$prefix\'" + cmdrun="$prefix $cmd" + msg="$prefix $MODIFY_FATES_PARAMFILE can NOT be successfully run" + $(check_if_runable "$cmdrun" "$msg") + if [[ "$?" -eq "0" ]]; then + echo "failed..." + echo "Attempting to activate the ctsm_pylib environment" + $(conda activate ctsm_pylib) + check_error $? "Trouble activating the conda ctsm_pylib environment" + log_msg_if_debug "conda activate ctsm_pylib was successful" + else + MODIFY_FATES_PARAMFILE="$prefix $MODIFY_FATEST_PARAMFILE" fi else echo "Make sure your python environment can run $MODIFY_FATES_PARAMFILE" >&2 - echo "One way to do that is to add conda to your environment" >&2 - echo " then activate the ctsm_pylib environemnt" >&2 - echo " in some cases you may have to add conda activate ctsm_pylib in your startup files" >&2 + echo "One way to do that is to activate the ctsm_pylib conda environment" >&2 + echo " First add conda to your environment" >&2 + echo " Then run the activate command" >&2 + echo " conda activate ctsm_pylib" >&2 + echo " In some cases you may have to add conda activate ctsm_pylib in your startup files" >&2 echo " ctsm_pylib is created at the top level of CTSM using py_env_create" >&2 exit 1 fi -elif [ $DEBUG ]; then - echo "$MODIFY_FATES_PARAMFILE is runable" fi +log_msg_if_debug "$MODIFY_FATES_PARAMFILE is runable" From 4686632863d0087892317fe7ae1ea45ba4a8df71 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Sat, 30 Nov 2024 17:35:38 -0700 Subject: [PATCH 222/243] Remove some unneeded debug log statements --- .../testmods_dirs/clm/FatesSetupParamBuild/shell_commands | 4 ---- 1 file changed, 4 deletions(-) diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesSetupParamBuild/shell_commands b/cime_config/testdefs/testmods_dirs/clm/FatesSetupParamBuild/shell_commands index 0f4fab8560..877d7ff2c6 100755 --- a/cime_config/testdefs/testmods_dirs/clm/FatesSetupParamBuild/shell_commands +++ b/cime_config/testdefs/testmods_dirs/clm/FatesSetupParamBuild/shell_commands @@ -85,8 +85,6 @@ else log_msg_if_debug "conda was found" noconda=0 fi -echo "noconda = $noconda" - # Check that the modify script exists and can be used MODIFY_FATES_PARAMFILE="$FATESDIR/tools/modify_fates_paramfile.py" @@ -101,7 +99,6 @@ cmd="$MODIFY_FATES_PARAMFILE --help" # If not runable as is if conda is available try some different options $(check_if_runable "$cmd" "$msg") if [[ "$?" -eq "0" ]]; then - echo "failed..." if [[ $noconda -eq "0" ]]; then prefix="conda run -n ctsm_pylib" echo "Attempting to run under \'$prefix\'" @@ -109,7 +106,6 @@ if [[ "$?" -eq "0" ]]; then msg="$prefix $MODIFY_FATES_PARAMFILE can NOT be successfully run" $(check_if_runable "$cmdrun" "$msg") if [[ "$?" -eq "0" ]]; then - echo "failed..." echo "Attempting to activate the ctsm_pylib environment" $(conda activate ctsm_pylib) check_error $? "Trouble activating the conda ctsm_pylib environment" From 8f72cd697425482dcb35a1bc0bd812b65715861d Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Sat, 30 Nov 2024 18:10:12 -0700 Subject: [PATCH 223/243] add (user mode testing): add a beginning of a simple bash unit tester for the shell_commands script and it's functions --- .../clm/FatesSetupParamBuild/README.md | 7 ++++ .../run_shell_commands_tests | 37 +++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 cime_config/testdefs/testmods_dirs/clm/FatesSetupParamBuild/README.md create mode 100755 cime_config/testdefs/testmods_dirs/clm/FatesSetupParamBuild/run_shell_commands_tests diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesSetupParamBuild/README.md b/cime_config/testdefs/testmods_dirs/clm/FatesSetupParamBuild/README.md new file mode 100644 index 0000000000..e2b225d501 --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/FatesSetupParamBuild/README.md @@ -0,0 +1,7 @@ + +User mod directory to make sure the user is setup to run the FATES modify param file script. +IF not it trys some different options and prints messages regarding what worked, and what the user +needs to do if nothing worked. + + + diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesSetupParamBuild/run_shell_commands_tests b/cime_config/testdefs/testmods_dirs/clm/FatesSetupParamBuild/run_shell_commands_tests new file mode 100755 index 0000000000..a2eb2b4b85 --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/FatesSetupParamBuild/run_shell_commands_tests @@ -0,0 +1,37 @@ +#!/bin/bash + +# Define a custom error handler function +handle_error() { + echo "An error occurred: $1" + echo "error code: $?" + # Additional error handling code can go here + return 1 +} + +# Set the error handler to be called when an error occurs +trap 'handle_error "Something went wrong!"' ERR + +host=`hostname -f` +if [[ "$host" =~ derecho*.hpc.ucar.edu || "$host" =~ d*.hpc.ucar.edu ]] ; then + echo "Running on Derecho..." >&2 + echo ".... making sure conda is loaded..." >&2 + module load conda +else + echo "Not a recognized host: $host" >&2 + exit 5 +fi +echo "Test if shell_commands will run..." +. ./shell_commands > /dev/null + +echo "Now do some tests of the bash subroutines" >&2 +unset DEBUG +$(log_msg_if_debug "Die with Error since DEBUG is unset") +if [[ "$?" -eq "0" ]]; then + echo "Should have died with an error..." >&2 + exit 1 +fi +echo "after DEBUG test" +DEBUG=0 +$(log_msg_if_debug "Die with Error since too many options are input" "another option") + +echo "Successful" From 5aef052e97126171041fb76be15017fb11f5b66f Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Sun, 1 Dec 2024 15:26:34 -0700 Subject: [PATCH 224/243] Add title and list files --- .../testmods_dirs/clm/FatesSetupParamBuild/README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesSetupParamBuild/README.md b/cime_config/testdefs/testmods_dirs/clm/FatesSetupParamBuild/README.md index e2b225d501..457118971b 100644 --- a/cime_config/testdefs/testmods_dirs/clm/FatesSetupParamBuild/README.md +++ b/cime_config/testdefs/testmods_dirs/clm/FatesSetupParamBuild/README.md @@ -1,7 +1,13 @@ +# Make Sure User is Setup to Run the FATES Modify Parameter File Script User mod directory to make sure the user is setup to run the FATES modify param file script. IF not it trys some different options and prints messages regarding what worked, and what the user needs to do if nothing worked. +### Contents: + +- `shell_commands` -- Setup to be able to run the modify script and if not give error messages +- `run_shell_commands_test` -- Run tests for the shell_commands script + From 41d0bc40f6109b8194978c8b7182790a1a29dc16 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Mon, 2 Dec 2024 01:30:18 -0700 Subject: [PATCH 225/243] Add fatal_error function to print error and exit, that allows it to not fail if NOFAIL is set --- .../clm/FatesSetupParamBuild/shell_commands | 158 ++++++++++-------- 1 file changed, 88 insertions(+), 70 deletions(-) diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesSetupParamBuild/shell_commands b/cime_config/testdefs/testmods_dirs/clm/FatesSetupParamBuild/shell_commands index 877d7ff2c6..d3e329978e 100755 --- a/cime_config/testdefs/testmods_dirs/clm/FatesSetupParamBuild/shell_commands +++ b/cime_config/testdefs/testmods_dirs/clm/FatesSetupParamBuild/shell_commands @@ -2,16 +2,25 @@ # Make sure the environment is setup to run the FATES modify parameter file tool +# Write error message and exit +fatal_error() { + echo "ERROR:: $1" >&2 + if [ -z "$NOFAIL" ]; then + exit 5 + fi + return 5 +} + # Function to log a message if $DEBUG is set log_msg_if_debug () { # Arguments: message if [ "$#" -ne "1" ]; then - echo "Wrong number of arguments to log_msg_if_debug" >&2 - exit 5 + fatal_error "Wrong number of arguments to log_msg_if_debug" + return fi if [ -z "$DEBUG" ];then - echo "log_msg_if_debug was called without DEBUG being set" >&2 - exit 5 + fatal_error "log_msg_if_debug was called without DEBUG being set" + return fi if [ "$DEBUG" -eq "1" ]; then echo -e $1 @@ -22,15 +31,14 @@ log_msg_if_debug () { check_error () { # Arguments: error, error-message if [ "$#" -ne "2" ]; then - echo "Wrong number of arguments to check_error" >&2 - exit 5 + fatal_error "Wrong number of arguments to check_error" + return fi error=$1 msg=$2 if [ "$error" -ne "0" ]; then - echo "ERROR: Command failed" >&2 - echo $msg >&2 - exit 1 + fatal_error "$msg" + return fi } @@ -57,71 +65,81 @@ check_if_runable () { fi } -# If under a casedirectory get a few variables for later use -if [ -f xmlquery ]; then - SRCDIR=$(./xmlquery SRCROOT --value || echo "null") - check_error $? "Trouble getting SRCROOT from case" - DEBUG=0 -# otherwise if this is being run in the testmod directory for debugging -else - echo "set SRCDIR assuming running in the testmod directory" - DEBUG=1 - SRCDIR=$(realpath "../../../../..") -fi -FATESDIR="$SRCDIR/src/fates/" +main() { + # If under a casedirectory get a few variables for later use + if [ -f xmlquery ]; then + SRCDIR=$(./xmlquery SRCROOT --value || echo "null") + check_error $? "Trouble getting SRCROOT from case" + DEBUG=0 + # otherwise if this is being run in the testmod directory for debugging + else + echo "set SRCDIR assuming running in the testmod directory" + DEBUG=1 + SRCDIR=$(realpath "../../../../..") + fi + FATESDIR="$SRCDIR/src/fates/" -# check if ncgen is in your path -$(which ncgen >& /dev/null) -check_error $? "ncgen is NOT in your path" -log_msg_if_debug "ncgen was found" + # check if ncgen is in your path + $(which ncgen >& /dev/null) + check_error $? "ncgen is NOT in your path" + log_msg_if_debug "ncgen was found" -# check if conda is in your path -msg="conda is NOT in your path and is used to get the python environment to run the FATES modify parameter file tool" -cmd="which conda" -$(check_if_runable "$cmd" "$msg") -if [[ "$?" -eq "0" ]]; then - noconda=1 -else - log_msg_if_debug "conda was found" - noconda=0 -fi -# Check that the modify script exists and can be used + # check if conda is in your path + msg="conda is NOT in your path and is used to get the python environment to run the FATES modify parameter file tool" + cmd="which conda" + $(check_if_runable "$cmd" "$msg") + if [[ "$?" -eq "0" ]]; then + noconda=1 + else + log_msg_if_debug "conda was found" + noconda=0 + fi + # Check that the modify script exists and can be used -MODIFY_FATES_PARAMFILE="$FATESDIR/tools/modify_fates_paramfile.py" -if [ ! -f $MODIFY_FATES_PARAMFILE ]; then - echo "$MODIFY_FATES_PARAMFILE does NOT exist" >&2 - exit 1 -fi -log_msg_if_debug "$MODIFY_FATES_PARAMFILE was found" + MODIFY_FATES_PARAMFILE="$FATESDIR/tools/modify_fates_paramfile.py" + if [ ! -f $MODIFY_FATES_PARAMFILE ]; then + fatal_error "$MODIFY_FATES_PARAMFILE does NOT exist" + return + fi + log_msg_if_debug "$MODIFY_FATES_PARAMFILE was found" -msg="$MODIFY_FATES_PARAMFILE can NOT be successfully run" -cmd="$MODIFY_FATES_PARAMFILE --help" -# If not runable as is if conda is available try some different options -$(check_if_runable "$cmd" "$msg") -if [[ "$?" -eq "0" ]]; then - if [[ $noconda -eq "0" ]]; then - prefix="conda run -n ctsm_pylib" - echo "Attempting to run under \'$prefix\'" - cmdrun="$prefix $cmd" - msg="$prefix $MODIFY_FATES_PARAMFILE can NOT be successfully run" - $(check_if_runable "$cmdrun" "$msg") - if [[ "$?" -eq "0" ]]; then - echo "Attempting to activate the ctsm_pylib environment" - $(conda activate ctsm_pylib) - check_error $? "Trouble activating the conda ctsm_pylib environment" - log_msg_if_debug "conda activate ctsm_pylib was successful" + msg="$MODIFY_FATES_PARAMFILE can NOT be successfully run" + cmd="$MODIFY_FATES_PARAMFILE --help" + # If not runable as is if conda is available try some different options + $(check_if_runable "$cmd" "$msg") + if [[ "$?" -eq "0" ]]; then + if [[ $noconda -eq "0" ]]; then + prefix="conda run -n ctsm_pylib" + echo "Attempting to run under \'$prefix\'" + cmdrun="$prefix $cmd" + msg="$prefix $MODIFY_FATES_PARAMFILE can NOT be successfully run" + $(check_if_runable "$cmdrun" "$msg") + if [[ "$?" -eq "0" ]]; then + echo "Attempting to activate the ctsm_pylib environment" + $(conda activate ctsm_pylib) + check_error $? "Trouble activating the conda ctsm_pylib environment" + log_msg_if_debug "conda activate ctsm_pylib was successful" + else + MODIFY_FATES_PARAMFILE="$prefix $MODIFY_FATEST_PARAMFILE" + fi else - MODIFY_FATES_PARAMFILE="$prefix $MODIFY_FATEST_PARAMFILE" + echo "Make sure your python environment can run $MODIFY_FATES_PARAMFILE" >&2 + echo "One way to do that is to activate the ctsm_pylib conda environment" >&2 + echo " First add conda to your environment" >&2 + echo " Then run the activate command" >&2 + echo " conda activate ctsm_pylib" >&2 + echo " In some cases you may have to add conda activate ctsm_pylib in your startup files" >&2 + echo " ctsm_pylib is created at the top level of CTSM using py_env_create" >&2 + fatal_error "Can NOT run $MODIFY_FATES_PARAMFILE" + if [ "$?" -ne "0" ]; then + return + fi fi - else - echo "Make sure your python environment can run $MODIFY_FATES_PARAMFILE" >&2 - echo "One way to do that is to activate the ctsm_pylib conda environment" >&2 - echo " First add conda to your environment" >&2 - echo " Then run the activate command" >&2 - echo " conda activate ctsm_pylib" >&2 - echo " In some cases you may have to add conda activate ctsm_pylib in your startup files" >&2 - echo " ctsm_pylib is created at the top level of CTSM using py_env_create" >&2 - exit 1 fi -fi -log_msg_if_debug "$MODIFY_FATES_PARAMFILE is runable" + log_msg_if_debug "$MODIFY_FATES_PARAMFILE is runable" + if [ "$?" -ne "0" ]; then + return + fi +} + +main From d85fea00f7dbb59e1ca0a1eed283407bb3bd0c9e Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Mon, 2 Dec 2024 01:40:21 -0700 Subject: [PATCH 226/243] Add functions for expected fail and expected pass and break up tests into seperate individual test functions as per usual unit testing --- .../run_shell_commands_tests | 138 +++++++++++++++--- 1 file changed, 120 insertions(+), 18 deletions(-) diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesSetupParamBuild/run_shell_commands_tests b/cime_config/testdefs/testmods_dirs/clm/FatesSetupParamBuild/run_shell_commands_tests index a2eb2b4b85..16c67cbb13 100755 --- a/cime_config/testdefs/testmods_dirs/clm/FatesSetupParamBuild/run_shell_commands_tests +++ b/cime_config/testdefs/testmods_dirs/clm/FatesSetupParamBuild/run_shell_commands_tests @@ -1,15 +1,118 @@ #!/bin/bash +# +# unit tester for the functions in shell_commands as well as the entire script +# # Define a custom error handler function handle_error() { - echo "An error occurred: $1" - echo "error code: $?" # Additional error handling code can go here return 1 } -# Set the error handler to be called when an error occurs -trap 'handle_error "Something went wrong!"' ERR +# Expect that should should have run WITJ an error +expect_fail() { + error=$1 + msg=$2 + if [[ "$error" -eq "0" ]]; then + echo "Should have died with an error, but didn't..." >&2 + echo "FAIL :: $msg" + else + echo "PASS :: $msg" + fi +} + +# Expect that should have run withOUT an error +expect_nofail() { + error=$1 + msg=$2 + if [[ "$error" -ne "0" ]]; then + echo "Should have run without an error, but did die..." >&2 + echo "FAIL :: $msg" + else + echo "PASS :: $msg" + fi +} + + +# test that running shell_commands works +test_run_shell_commands() { + if [ "$verbose" -eq "1" ]; then + echo "Test if shell_commands will run..." + fi + # Set the error handler to be called when an error occurs + . ./shell_commands >& /dev/null + expect_nofail "$?" "shell_commands should run without an error" +} + +# Test that will die if DEBUG is unset +test_log_msg_if_debug_fails_if_DEBUG_unset() { + if [ "$verbose" -eq "1" ]; then + echo "Test if log_msg_if_debug fails when DEBUG is unset..." + fi + # Source shell_commands to get access to functions + . ./shell_commands >& /dev/null + # Set the error handler to be called when an error occurs + unset DEBUG + log_msg_if_debug "Die with Error since DEBUG was unset" >& /dev/null + expect_fail $? "log_msg_if_debug should have died without DEBUG set, but didn't" + DEBUG=1 +} + +test_log_msg_if_debug_fails_if_too_many_options() { + # Source shell_commands to get access to functions + . ./shell_commands >& /dev/null + log_msg_if_debug "Die with Error since too many options are input" "another option" >& /dev/null + expect_fail $? "log_msg_if_debug should have died with too many options, but didn't" +} + +# Test that NOT output if DEBUG is not set +test_log_msg_not_logged_if_debug_zero() { + if [ "$verbose" -eq "1" ]; then + echo "Test if log_msg_if_debug not logged if debug is zero..." + fi + # Source shell_commands to get access to functions + . ./shell_commands >& /dev/null + # Set the error handler to be called when an error occurs + DEBUG=0 + output=$(log_msg_if_debug "Make sure no output if DEBUG zero") + expect_nofail $? "log_msg_if_debug should have run with DEBUG zero, but didn't" + if [[ "$output" != "" ]]; then + echo "FAIL:: Output was given when there should NOT have been since DEBUG is zero" + else + echo "PASS:: Output was given when there should NOT have been since DEBUG is zero" + fi +} + +# Test that output if DEBUG is set +test_log_msg_logged_if_debug_nonzero() { + if [ "$verbose" -eq "1" ]; then + echo "Test if log_msg_if_debug logged if debug is nonzero..." + fi + # Source shell_commands to get access to functions + . ./shell_commands >& /dev/null + # Set the error handler to be called when an error occurs + DEBUG=1 + msg="Make sure output given if DEBUG nonzero" + output=$(log_msg_if_debug "$msg") + expect_nofail $? "log_msg_if_debug should have run with DEBUG nonzero, but didn't" + if [ -z "$output" ]; then + echo "FAIL:: Output was NOT given when there should have been since DEBUG is nonzero" + else + echo "PASS:: Output was NOT given when there should have been since DEBUG is nonzero" + fi + if [[ "$output" == "$msg" ]]; then + echo "output: $output" + echo "expected: $msg" + echo "FAIL:: Output was NOT given correctly should have matched expected" + else + echo "PASS:: Output was NOT given correctly should have matched expected" + fi +} + + +################################################# +# Main script +################################################# host=`hostname -f` if [[ "$host" =~ derecho*.hpc.ucar.edu || "$host" =~ d*.hpc.ucar.edu ]] ; then @@ -20,18 +123,17 @@ else echo "Not a recognized host: $host" >&2 exit 5 fi -echo "Test if shell_commands will run..." -. ./shell_commands > /dev/null - -echo "Now do some tests of the bash subroutines" >&2 -unset DEBUG -$(log_msg_if_debug "Die with Error since DEBUG is unset") -if [[ "$?" -eq "0" ]]; then - echo "Should have died with an error..." >&2 - exit 1 -fi -echo "after DEBUG test" -DEBUG=0 -$(log_msg_if_debug "Die with Error since too many options are input" "another option") -echo "Successful" +# Set the error handler to be called when an error occurs +trap 'handle_error "Error trapped so can check error status"' ERR + +export DEBUG=0 +export NOFAIL=1 # Set NOFIAL so that fatal errors won't abort +export verbose=0 +test_run_shell_commands +test_log_msg_if_debug_fails_if_DEBUG_unset +test_log_msg_if_debug_fails_if_too_many_options +test_log_msg_logged_if_debug_nonzero +test_log_msg_not_logged_if_debug_zero + +echo "Successfully ran all the tests" From 172236cab06e4fc375805a4506d582f1e07c4426 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Mon, 2 Dec 2024 02:10:37 -0700 Subject: [PATCH 227/243] Function for conda load/unload --- .../run_shell_commands_tests | 25 +++++++++++++------ 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesSetupParamBuild/run_shell_commands_tests b/cime_config/testdefs/testmods_dirs/clm/FatesSetupParamBuild/run_shell_commands_tests index 16c67cbb13..cf678fefaa 100755 --- a/cime_config/testdefs/testmods_dirs/clm/FatesSetupParamBuild/run_shell_commands_tests +++ b/cime_config/testdefs/testmods_dirs/clm/FatesSetupParamBuild/run_shell_commands_tests @@ -3,6 +3,22 @@ # unit tester for the functions in shell_commands as well as the entire script # +# Load or unload conda +conda_for_host() { + host=$0 + type=$1 + if [[ "$host" =~ derecho*.hpc.ucar.edu || "$host" =~ d*.hpc.ucar.edu ]] ; then + echo "Running on Derecho..." >&1 + if [[ "$type" == "load" ]]; then + module load conda + else + module unload conda + fi + else + echo "Not a recognized host: $host" >&1 + fi +} + # Define a custom error handler function handle_error() { # Additional error handling code can go here @@ -115,14 +131,7 @@ test_log_msg_logged_if_debug_nonzero() { ################################################# host=`hostname -f` -if [[ "$host" =~ derecho*.hpc.ucar.edu || "$host" =~ d*.hpc.ucar.edu ]] ; then - echo "Running on Derecho..." >&2 - echo ".... making sure conda is loaded..." >&2 - module load conda -else - echo "Not a recognized host: $host" >&2 - exit 5 -fi +conda_for_host "$host" "load" # Set the error handler to be called when an error occurs trap 'handle_error "Error trapped so can check error status"' ERR From 242a55f7eaeb893c6866469c289a0e1b28136fcc Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Mon, 2 Dec 2024 03:10:22 -0700 Subject: [PATCH 228/243] Fix bug in input to conda_for_host and add izumi handling --- .../FatesSetupParamBuild/run_shell_commands_tests | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesSetupParamBuild/run_shell_commands_tests b/cime_config/testdefs/testmods_dirs/clm/FatesSetupParamBuild/run_shell_commands_tests index cf678fefaa..abbcc85a08 100755 --- a/cime_config/testdefs/testmods_dirs/clm/FatesSetupParamBuild/run_shell_commands_tests +++ b/cime_config/testdefs/testmods_dirs/clm/FatesSetupParamBuild/run_shell_commands_tests @@ -5,8 +5,8 @@ # Load or unload conda conda_for_host() { - host=$0 - type=$1 + host=$1 + type=$2 if [[ "$host" =~ derecho*.hpc.ucar.edu || "$host" =~ d*.hpc.ucar.edu ]] ; then echo "Running on Derecho..." >&1 if [[ "$type" == "load" ]]; then @@ -14,6 +14,14 @@ conda_for_host() { else module unload conda fi + elif [[ "$host" =~ izumi.cgd.ucar.edu || "$host" =~ i*.cgd.ucar.edu ]] ; then + echo "Running on Izumi..." >&1 + . /usr/share/Modules/init/sh + if [[ "$type" == "load" ]]; then + module load lang/anaconda + else + module unload lang/anaconda + fi else echo "Not a recognized host: $host" >&1 fi From edb0513b9a8e507e6e67b539fe830653e934a18c Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Mon, 2 Dec 2024 12:56:47 -0700 Subject: [PATCH 229/243] Update Change files --- doc/ChangeLog | 162 ++++++++++++++++++++++++++ doc/ChangeLog.vscode | 268 +++++++++++++++++++++++++++++++++++++++++++ doc/ChangeSum | 1 + 3 files changed, 431 insertions(+) create mode 100644 doc/ChangeLog.vscode diff --git a/doc/ChangeLog b/doc/ChangeLog index fc4ee9f376..1cd94c8935 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,4 +1,166 @@ =============================================================== +Tag name: ctsm5.3.014 +Originator(s): multiple (see contributors below) +Date: Mon 02 Dec 2024 09:50:09 AM MST +One-line Summary: Bring in several fixes for testing in the previous cesm3_0_beta03/04 tags + +Purpose and description of changes +---------------------------------- + +Fix a list of issues mostly for testing that came in with the cesm3_0_beta03 and cesm3_0_beta04 tags +for the science "chill" deadline bringing in the baseline science capabilities needed for the cesm3_0 release. + +List of things: + +- New polarcap grid +- Fix use_init_interp for several resolutions that had +- Remove clm5_1 physics option +- Newly needed surface datasets added to auto build in Makefile for mksurfdata_esmf +- Fix several individual tests that were failing +- Update to submodules to ones roughly based on cesm3_0_beta04 +- Add graceful error checking to the FATES parameter file tests that will get it working in some cases + +Contributors +------------ + @slevis-lmwg @ekluzek @adamrher + +Significant changes to scientifically-supported configurations +-------------------------------------------------------------- + +Does this tag change answers significantly for any of the following physics configurations? +(Details of any changes will be given in the "Answer changes" section below.) + + [Put an [X] in the box for any configuration with significant answer changes.] + +[ ] clm6_0 + +[ ] clm5_0 + +[ ] ctsm5_0-nwp + +[ ] clm4_5 + + +Bugs fixed +---------- +List of CTSM issues fixed (include CTSM Issue # and description) [one per line]: + + #2861 -- Nag compiler mpi-serial tests are failing on Izumi after the OS upgrade + #2801 -- fsurdat file needed for NEON MOAB site bfb done testing + #2791 -- Add f19 16pft 1850 and Hist to list of surface dataset resolutions (for the PPE work) + #2780 -- New CN matrix fails with single point sites with the new ctsm5.3 datasets. + #2654 -- Failing tests for izumi_nag with mpi-serial in cesm3_0_alpha02a + #2640 -- Update submodules to cesm3_0_beta04 versions + #2548 -- ne0ARCTICne30x4 grid transient failure + #2544 -- Failing ne0CONUSne30x8_ne0CONUSne30x8_mt12 in CESM testing + #2486 -- Temporarily add back a T42 dataset for CAM + #2379 -- Deprecate clm5_1 physics with ctsm5.2.0 + #2294 -- use of mct_mod is deprecated + +Notes of particular relevance for users +--------------------------------------- +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): + Removal of the clm5_1 physics option to CLM_PHYSICS_VERSION XML variable + +Changes made to namelist defaults (e.g., changed parameter values): + Add support for new grid: ne0np4.POLARCAP.ne30x4 + Add support for f19 and f45 16-pft surface datasets + Fix some finidat issues for: f19, VR grids + Remove more mention of vichydro in namelist defaults + +Notes of particular relevance for developers: +--------------------------------------------- + +Caveats for developers (e.g., code that is duplicated that requires double maintenance): + I think we should expand the shell_commands unit testing I added in FatesSetupParam. + usermod and testmod shell_commands can have tricky logic that's hard to get right and then + easy to break. Having unit testing that tests the tricky user mods (such as NEON and PLUMBER) + as well as this tricky FATES capability would help bring robustness, correctness and stability to this + part of the code. As well as the ability to make changes to this part and refactor to improve it. + As part of this I think adopting a bash unit tester (such as BATS) would be a good thing to do. + The other part is that I think we could add automated testing for this on push to PR's to master. + Future changes: + - Move FatesSetupParam to user-mod directory and activate for all FATES + - Add automated github test for the unit test there + - Adopt BATS for a bash unit test framework + - Add testing for NEON and PLUMBER2 shell_commands user-mod directories + +Changes to tests or testing: + Changes to lilac/sspmatrixcn tests needed for cime update + Clm51 tests changed to Clm60 + C96 tests changed to C96_C96_mt232 + Exact restart monthly length tests changed to days because of cime testing update + Exact restart 15 day length tests changed to 20 because of a cime testing bug + Some additional VR grid tests + FatesColdLandUse test requires a long name transient test now + New testmod include directory (FatesSetupParam) to setup modifying FATES parameter file, testmods requiring it use it + Add a unit-tester to the FatesSetupParam directory to make sure it's functions work correctly + PFUNIT testing build infrastructure updated to use full ESMF library + +Testing summary: regular + fates + ctsm_sci +---------------- + [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): + + 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: No bit-for-bit + +Other details +------------- + +List any git submodules updated (cime, rtm, mosart, cism, fates, etc.): + Update most of the submodules to ones based from cesm3_0_beta04 + - mizuRoute to cesm-coupling.n02_v2.1.3 + - ccs_config_cesm1.0.10 (beyond cesm3_0_beta04 for unit testing issues) + - cime6.1.37 (beyond cesm3_0_beta04 for unit testing issues) + - cmeps1.0.16 + - cdeps1.0.53 (behind cesm3_0_beta04 [at 1.0.57] to avoid nextsw_cday changes) + - share1.1.2 + - pio2_6_3 + + mct removed + MPIserial_2.5.1 added + +Pull Requests that document the changes (include PR ids): +(https://github.com/ESCOMP/ctsm/pull) + - #2888 -- PR to master of all changes + - #2853 -- Update submodules to ones that are based on cesm3_0_alpha04a + - #2883 -- Update branch to latest master ctsm5.3.012 + - #2840 -- Fix single-point matrixCN fails + - #2840 -- bfb bug PR status: awaiting review PR status: ready size: small + - #2855 -- Improve CLMBuildNamelist ability to detect NEON runs + - #2716 -- add "polarcap" grid for cesm3 release enhancement + - #2834 -- f19 + f45 16pft fsurdat/landuse files to namelist_defaults_ctsm + Makefile + - #2808 -- Remove Clm51 references throughout or change to Clm60 + +=============================================================== +=============================================================== Tag name: ctsm5.3.013 Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326) Date: Tue 26 Nov 2024 02:59:49 PM MST diff --git a/doc/ChangeLog.vscode b/doc/ChangeLog.vscode new file mode 100644 index 0000000000..5860e8903c --- /dev/null +++ b/doc/ChangeLog.vscode @@ -0,0 +1,268 @@ +=============================================================== +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 since ctsm5.2.0 +-------------------------------------------------- + + +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: +===================== + + +New input datasets to mksurfdata_esmf: +====================================== + + +Contributors +------------ + + +Significant changes to scientifically-supported configurations since ctsm5.2.0 +------------------------------------------------------------------------------ + +Notes of particular relevance for users for ctsm5.2.0 to ctsm5.3.0 +------------------------------------------------------------------ + +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 for ctsm5.2.0 to ctsm5.3.0: +------------------------------------------------------------------------ + +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 ctsm5.2.0 to ctsm5.3.0 +------------------------------------- + +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 +------------- + +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 +---------------------------------- + +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 +-------------------------------------------------------------- + +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 -- 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 + +Changes to the datasets (e.g., parameter, surface or initial files): + parameter file updated + surface datasets updatd + 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 + +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: slevis ctsm52026_f09_pSASU + + URL for LMWG diagnostics output used to validate new climate: + https://github.com/NCAR/LMWG_dev/issues/65 + + +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 85e347513b..0a64ce5d62 100644 --- a/doc/ChangeSum +++ b/doc/ChangeSum @@ -1,5 +1,6 @@ Tag Who Date Summary ============================================================================================================================ + ctsm5.3.014 erik 12/02/2024 Bring in several fixes for testing in the previous cesm3_0_beta03/04 tags ctsm5.3.013 erik 11/26/2024 Merge b4b-dev ctsm5.3.012 afoster 11/13/2024 update fates tag ctsm5.3.011 samrabin 11/11/2024 Improve handling of cold-start finidat From 38598da7394b35d2b58b871be3fe4be3a43fc32d Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Mon, 2 Dec 2024 13:15:25 -0700 Subject: [PATCH 230/243] Make sure return codes are sent on return statements for exit conditions add success at end --- .../clm/FatesSetupParamBuild/shell_commands | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesSetupParamBuild/shell_commands b/cime_config/testdefs/testmods_dirs/clm/FatesSetupParamBuild/shell_commands index d3e329978e..f59cfda229 100755 --- a/cime_config/testdefs/testmods_dirs/clm/FatesSetupParamBuild/shell_commands +++ b/cime_config/testdefs/testmods_dirs/clm/FatesSetupParamBuild/shell_commands @@ -16,11 +16,11 @@ log_msg_if_debug () { # Arguments: message if [ "$#" -ne "1" ]; then fatal_error "Wrong number of arguments to log_msg_if_debug" - return + return 5 fi if [ -z "$DEBUG" ];then fatal_error "log_msg_if_debug was called without DEBUG being set" - return + return 5 fi if [ "$DEBUG" -eq "1" ]; then echo -e $1 @@ -32,13 +32,13 @@ check_error () { # Arguments: error, error-message if [ "$#" -ne "2" ]; then fatal_error "Wrong number of arguments to check_error" - return + return 4 fi error=$1 msg=$2 if [ "$error" -ne "0" ]; then fatal_error "$msg" - return + return 4 fi } @@ -99,7 +99,7 @@ main() { MODIFY_FATES_PARAMFILE="$FATESDIR/tools/modify_fates_paramfile.py" if [ ! -f $MODIFY_FATES_PARAMFILE ]; then fatal_error "$MODIFY_FATES_PARAMFILE does NOT exist" - return + return 6 fi log_msg_if_debug "$MODIFY_FATES_PARAMFILE was found" @@ -132,14 +132,15 @@ main() { echo " ctsm_pylib is created at the top level of CTSM using py_env_create" >&2 fatal_error "Can NOT run $MODIFY_FATES_PARAMFILE" if [ "$?" -ne "0" ]; then - return + return $? fi fi fi log_msg_if_debug "$MODIFY_FATES_PARAMFILE is runable" if [ "$?" -ne "0" ]; then - return + return $? fi + log_msg_if_debug "\nSuccesfully was able to setup the FATES parameter modify script and make sure it will work" } main From d3f6abdef36138082ce8558b8e1cb4e10a5cb99b Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Mon, 2 Dec 2024 13:57:37 -0700 Subject: [PATCH 231/243] Add check to run without conda and make sure it reports as a graceful error --- .../run_shell_commands_tests | 32 +++++++++++++++---- .../clm/FatesSetupParamBuild/shell_commands | 8 +++-- 2 files changed, 30 insertions(+), 10 deletions(-) diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesSetupParamBuild/run_shell_commands_tests b/cime_config/testdefs/testmods_dirs/clm/FatesSetupParamBuild/run_shell_commands_tests index cf678fefaa..4038588c79 100755 --- a/cime_config/testdefs/testmods_dirs/clm/FatesSetupParamBuild/run_shell_commands_tests +++ b/cime_config/testdefs/testmods_dirs/clm/FatesSetupParamBuild/run_shell_commands_tests @@ -5,11 +5,13 @@ # Load or unload conda conda_for_host() { - host=$0 - type=$1 + host=$1 + type=$2 if [[ "$host" =~ derecho*.hpc.ucar.edu || "$host" =~ d*.hpc.ucar.edu ]] ; then - echo "Running on Derecho..." >&1 if [[ "$type" == "load" ]]; then + if [ "$verbose" -eq "1" ]; then + echo "Running on Derecho..." >&1 + fi module load conda else module unload conda @@ -125,24 +127,40 @@ test_log_msg_logged_if_debug_nonzero() { fi } +# Test shell_commands without conda +test_main_without_conda() { + # Source shell_commands to get access to functions + . ./shell_commands >& /dev/null + + conda_for_host "$host" "unload" + #export DEBUG=1 + # BEK 2024/12/02 I shouldn't have to put output into the output variable as it's unused, but without it it fails + output=$(main >& /dev/null) + error=$? + #echo "Error is $error" >&2 + expect_fail "$error" "main should fail without conda" + conda_for_host "$host" "load" +} ################################################# # Main script ################################################# +export DEBUG=0 +export NOFAIL=1 # Set NOFAIL so that fatal errors won't abort +export verbose=0 + host=`hostname -f` conda_for_host "$host" "load" # Set the error handler to be called when an error occurs trap 'handle_error "Error trapped so can check error status"' ERR -export DEBUG=0 -export NOFAIL=1 # Set NOFIAL so that fatal errors won't abort -export verbose=0 test_run_shell_commands test_log_msg_if_debug_fails_if_DEBUG_unset test_log_msg_if_debug_fails_if_too_many_options test_log_msg_logged_if_debug_nonzero test_log_msg_not_logged_if_debug_zero +test_main_without_conda -echo "Successfully ran all the tests" +echo -e "\n\nSuccessfully ran all the tests\n (Look for FAIL above for problems)" \ No newline at end of file diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesSetupParamBuild/shell_commands b/cime_config/testdefs/testmods_dirs/clm/FatesSetupParamBuild/shell_commands index f59cfda229..fd46895413 100755 --- a/cime_config/testdefs/testmods_dirs/clm/FatesSetupParamBuild/shell_commands +++ b/cime_config/testdefs/testmods_dirs/clm/FatesSetupParamBuild/shell_commands @@ -130,9 +130,11 @@ main() { echo " conda activate ctsm_pylib" >&2 echo " In some cases you may have to add conda activate ctsm_pylib in your startup files" >&2 echo " ctsm_pylib is created at the top level of CTSM using py_env_create" >&2 - fatal_error "Can NOT run $MODIFY_FATES_PARAMFILE" - if [ "$?" -ne "0" ]; then - return $? + # EBK 2014/12/02 Should NOT have to save output below as unused but needs it to work + output=$(fatal_error "Can NOT run $MODIFY_FATES_PARAMFILE") + error=$? + if [ "$error" -ne "0" ]; then + return $error fi fi fi From 12e5fd4ead1b6b52b89c19c79077a0f6bb0c8600 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Mon, 2 Dec 2024 14:09:03 -0700 Subject: [PATCH 232/243] add(shell_commands unittester): add test that works without ctsm_pylib activated --- .../run_shell_commands_tests | 20 ++++++++++++++++--- .../clm/FatesSetupParamBuild/shell_commands | 1 + 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesSetupParamBuild/run_shell_commands_tests b/cime_config/testdefs/testmods_dirs/clm/FatesSetupParamBuild/run_shell_commands_tests index 4038588c79..0f29b00e53 100755 --- a/cime_config/testdefs/testmods_dirs/clm/FatesSetupParamBuild/run_shell_commands_tests +++ b/cime_config/testdefs/testmods_dirs/clm/FatesSetupParamBuild/run_shell_commands_tests @@ -133,15 +133,28 @@ test_main_without_conda() { . ./shell_commands >& /dev/null conda_for_host "$host" "unload" - #export DEBUG=1 - # BEK 2024/12/02 I shouldn't have to put output into the output variable as it's unused, but without it it fails + # EBK 2024/12/02 I shouldn't have to put output into the output variable as it's unused, but without it it fails + # I think this is because there's a lot of output in main output=$(main >& /dev/null) error=$? - #echo "Error is $error" >&2 expect_fail "$error" "main should fail without conda" conda_for_host "$host" "load" } +# Test shell_commands without ctsm_pylib activated +test_main_without_ctsm_pylib() { + # Source shell_commands to get access to functions + . ./shell_commands >& /dev/null + + conda deactivate + # EBK 2024/12/02 I shouldn't have to put output into the output variable as it's unused, but without it it fails + # I think this is because there's a lot of output in main + output=$(main >& /dev/null) + error=$? + echo $output >&2 + expect_nofail "$error" "main should run without ctsm_pylib activated" +} + ################################################# # Main script ################################################# @@ -162,5 +175,6 @@ test_log_msg_if_debug_fails_if_too_many_options test_log_msg_logged_if_debug_nonzero test_log_msg_not_logged_if_debug_zero test_main_without_conda +test_main_without_ctsm_pylib echo -e "\n\nSuccessfully ran all the tests\n (Look for FAIL above for problems)" \ No newline at end of file diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesSetupParamBuild/shell_commands b/cime_config/testdefs/testmods_dirs/clm/FatesSetupParamBuild/shell_commands index fd46895413..f8a0069c6f 100755 --- a/cime_config/testdefs/testmods_dirs/clm/FatesSetupParamBuild/shell_commands +++ b/cime_config/testdefs/testmods_dirs/clm/FatesSetupParamBuild/shell_commands @@ -131,6 +131,7 @@ main() { echo " In some cases you may have to add conda activate ctsm_pylib in your startup files" >&2 echo " ctsm_pylib is created at the top level of CTSM using py_env_create" >&2 # EBK 2014/12/02 Should NOT have to save output below as unused but needs it to work + # this is sometimes if there's a lot of STDOUT output output=$(fatal_error "Can NOT run $MODIFY_FATES_PARAMFILE") error=$? if [ "$error" -ne "0" ]; then From 155691475097cbd324f98e829e03946c2fc9f87e Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Mon, 2 Dec 2024 14:38:24 -0700 Subject: [PATCH 233/243] comment(build-namelist): Add a comment to address a code review point --- bld/CLMBuildNamelist.pm | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index ee5dd18c9e..07e78952f9 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -678,11 +678,18 @@ sub setup_cmdl_chk_res { } } +#------------------------------------------------------------------------------- + sub begins_with { + # Arguments: long-string, substring + # For an input long-string check if it starts with the substring + # For example, if a string like NEON_PRISM starts with NEON return substr($_[0], 0, length($_[1])) eq $_[1]; } +#------------------------------------------------------------------------------- + sub setup_cmdl_resolution { my ($opts, $nl_flags, $definition, $defaults, $envxml_ref) = @_; From 7d25f695442f6bee030b7fda1c0962491755ebc9 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Mon, 2 Dec 2024 14:58:09 -0700 Subject: [PATCH 234/243] Small changes for working on Izumi, mention that NOT failing without conda is possible if the python environment has enough python packages loaded --- .../FatesSetupParamBuild/run_shell_commands_tests | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/cime_config/testdefs/testmods_dirs/clm/FatesSetupParamBuild/run_shell_commands_tests b/cime_config/testdefs/testmods_dirs/clm/FatesSetupParamBuild/run_shell_commands_tests index 12133de4d3..2d395f6658 100755 --- a/cime_config/testdefs/testmods_dirs/clm/FatesSetupParamBuild/run_shell_commands_tests +++ b/cime_config/testdefs/testmods_dirs/clm/FatesSetupParamBuild/run_shell_commands_tests @@ -17,9 +17,11 @@ conda_for_host() { module unload conda fi elif [[ "$host" =~ izumi.cgd.ucar.edu || "$host" =~ i*.cgd.ucar.edu ]] ; then - echo "Running on Izumi..." >&1 - . /usr/share/Modules/init/sh + if [ "$verbose" -eq "1" ]; then + echo "Running on Izumi..." >&1 + fi if [[ "$type" == "load" ]]; then + . /usr/share/Modules/init/sh module load lang/anaconda else module unload lang/anaconda @@ -35,7 +37,7 @@ handle_error() { return 1 } -# Expect that should should have run WITJ an error +# Expect that should should have run WITH an error expect_fail() { error=$1 msg=$2 @@ -145,7 +147,7 @@ test_main_without_conda() { # I think this is because there's a lot of output in main output=$(main >& /dev/null) error=$? - expect_fail "$error" "main should fail without conda" + expect_fail "$error" "main should fail without conda (this can work on machines that include enough python packages outside of conda ctsm_pylib)" conda_for_host "$host" "load" } @@ -185,4 +187,4 @@ test_log_msg_not_logged_if_debug_zero test_main_without_conda test_main_without_ctsm_pylib -echo -e "\n\nSuccessfully ran all the tests\n (Look for FAIL above for problems)" \ No newline at end of file +echo -e "\n\nSuccessfully ran all the tests (Look for FAIL above for problems)" From be647bf53a7121f78576a76c956b6d544ccb0604 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Mon, 2 Dec 2024 18:24:38 -0700 Subject: [PATCH 235/243] correct(expected fails): Change 15 day tests to 20 --- cime_config/testdefs/ExpectedTestFails.xml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/cime_config/testdefs/ExpectedTestFails.xml b/cime_config/testdefs/ExpectedTestFails.xml index 10869f105e..dd38b03980 100644 --- a/cime_config/testdefs/ExpectedTestFails.xml +++ b/cime_config/testdefs/ExpectedTestFails.xml @@ -185,7 +185,7 @@ - + FAIL #2454 @@ -270,28 +270,28 @@ - + FAIL FATES#1089 - + FAIL FATES#1089 - + FAIL #2325 - + FAIL #2325 From b5590103b68c813a7b69829d3fb2dd69ce00227d Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Tue, 3 Dec 2024 00:24:50 -0700 Subject: [PATCH 236/243] Change expected fail from BUILD to RUN phase --- 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 dd38b03980..f718582b60 100644 --- a/cime_config/testdefs/ExpectedTestFails.xml +++ b/cime_config/testdefs/ExpectedTestFails.xml @@ -114,7 +114,7 @@ - + FAIL #1733 From d41901d9c954d14bacdd584b1db9e54add14c93d Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Tue, 3 Dec 2024 01:08:07 -0700 Subject: [PATCH 237/243] Using Ld761 fails with an XML error, so change to Ld765 --- 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 0c6d85bd40..bb9af4b06a 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -2478,7 +2478,7 @@ - + From ce380e2d5a15201d79794c3637c451a55e0311d0 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Tue, 3 Dec 2024 10:14:41 -0700 Subject: [PATCH 238/243] review correction from slevis Co-authored-by: Samuel Levis --- doc/ChangeLog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index 1cd94c8935..d349a54845 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -94,7 +94,7 @@ Changes to tests or testing: Some additional VR grid tests FatesColdLandUse test requires a long name transient test now New testmod include directory (FatesSetupParam) to setup modifying FATES parameter file, testmods requiring it use it - Add a unit-tester to the FatesSetupParam directory to make sure it's functions work correctly + Add a unit-tester to the FatesSetupParam directory to make sure its functions work correctly PFUNIT testing build infrastructure updated to use full ESMF library Testing summary: regular + fates + ctsm_sci From d9c0ade1979015ead1ce0d5db0f9fb7168798ba2 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Tue, 3 Dec 2024 10:17:47 -0700 Subject: [PATCH 239/243] Clarification in ChangeLog from slevis in code review Co-authored-by: Samuel Levis --- doc/ChangeLog | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index d349a54845..1491686c71 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -93,7 +93,8 @@ Changes to tests or testing: Exact restart 15 day length tests changed to 20 because of a cime testing bug Some additional VR grid tests FatesColdLandUse test requires a long name transient test now - New testmod include directory (FatesSetupParam) to setup modifying FATES parameter file, testmods requiring it use it + New testmod include directory (FatesSetupParam) to setup to modify the FATES parameter file + Each of the testmods that need to modify the FATES parameter file then include FatesSetupParam Add a unit-tester to the FatesSetupParam directory to make sure its functions work correctly PFUNIT testing build infrastructure updated to use full ESMF library From cc3f2d5c1c6a7e829df762bc10ea518862d2fc26 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Tue, 3 Dec 2024 10:49:59 -0700 Subject: [PATCH 240/243] Update ChangeLog with suggestions from slevis from review, and update date/time --- doc/ChangeLog | 20 ++++++++++---------- doc/ChangeSum | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index 1491686c71..dbb72e415d 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,7 +1,7 @@ =============================================================== Tag name: ctsm5.3.014 Originator(s): multiple (see contributors below) -Date: Mon 02 Dec 2024 09:50:09 AM MST +Date: Tue 03 Dec 2024 10:49:08 AM MST One-line Summary: Bring in several fixes for testing in the previous cesm3_0_beta03/04 tags Purpose and description of changes @@ -13,7 +13,7 @@ for the science "chill" deadline bringing in the baseline science capabilities n List of things: - New polarcap grid -- Fix use_init_interp for several resolutions that had +- Fix use_init_interp for several resolutions that had problems - Remove clm5_1 physics option - Newly needed surface datasets added to auto build in Makefile for mksurfdata_esmf - Fix several individual tests that were failing @@ -22,7 +22,7 @@ List of things: Contributors ------------ - @slevis-lmwg @ekluzek @adamrher + @slevis-lmwg @ekluzek @adamrher @samsrabin Significant changes to scientifically-supported configurations -------------------------------------------------------------- @@ -104,25 +104,25 @@ Testing summary: regular + fates + ctsm_sci build-namelist tests (if CLMBuildNamelist.pm has changed): - derecho - + derecho - OK python testing (if python code has changed; see instructions in python/README.md; document testing done): - derecho - + 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 fates tests: (give name of baseline if different from CTSM tagname, normally fates baselines are fates--) - derecho ----- - izumi ------- + derecho ----- OK + izumi ------- OK any other testing (give details below): ctsm_sci - derecho ---- + derecho ---- OK If the tag used for baseline comparisons was NOT the previous tag, note that here: diff --git a/doc/ChangeSum b/doc/ChangeSum index 0a64ce5d62..1ac751ea03 100644 --- a/doc/ChangeSum +++ b/doc/ChangeSum @@ -1,6 +1,6 @@ Tag Who Date Summary ============================================================================================================================ - ctsm5.3.014 erik 12/02/2024 Bring in several fixes for testing in the previous cesm3_0_beta03/04 tags + ctsm5.3.014 erik 12/03/2024 Bring in several fixes for testing in the previous cesm3_0_beta03/04 tags ctsm5.3.013 erik 11/26/2024 Merge b4b-dev ctsm5.3.012 afoster 11/13/2024 update fates tag ctsm5.3.011 samrabin 11/11/2024 Improve handling of cold-start finidat From 230e65a2ef71193507c5157825503b0d78c0d4ee Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Tue, 3 Dec 2024 10:54:44 -0700 Subject: [PATCH 241/243] remove(doc): remove file accisdentally committed --- doc/ChangeLog.vscode | 268 ------------------------------------------- 1 file changed, 268 deletions(-) delete mode 100644 doc/ChangeLog.vscode diff --git a/doc/ChangeLog.vscode b/doc/ChangeLog.vscode deleted file mode 100644 index 5860e8903c..0000000000 --- a/doc/ChangeLog.vscode +++ /dev/null @@ -1,268 +0,0 @@ -=============================================================== -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 since ctsm5.2.0 --------------------------------------------------- - - -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: -===================== - - -New input datasets to mksurfdata_esmf: -====================================== - - -Contributors ------------- - - -Significant changes to scientifically-supported configurations since ctsm5.2.0 ------------------------------------------------------------------------------- - -Notes of particular relevance for users for ctsm5.2.0 to ctsm5.3.0 ------------------------------------------------------------------- - -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 for ctsm5.2.0 to ctsm5.3.0: ------------------------------------------------------------------------- - -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 ctsm5.2.0 to ctsm5.3.0 -------------------------------------- - -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 -------------- - -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 ----------------------------------- - -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 --------------------------------------------------------------- - -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 -- 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 - -Changes to the datasets (e.g., parameter, surface or initial files): - parameter file updated - surface datasets updatd - 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 - -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: slevis ctsm52026_f09_pSASU - - URL for LMWG diagnostics output used to validate new climate: - https://github.com/NCAR/LMWG_dev/issues/65 - - -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 From ae4f78fd4d549102c11e0936029070c76142ed9a Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Tue, 3 Dec 2024 16:27:36 -0700 Subject: [PATCH 242/243] Update the number of tests for comparison --- 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 f23f7d6173..9959632470 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 = 3263; if ( defined($opts{'compare'}) ) { - $ntests += 2437; + $ntests += 1979; } plan( tests=>$ntests ); From cfdac048d2dee6a79ccb121a60771322e942d2e9 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Tue, 3 Dec 2024 16:31:21 -0700 Subject: [PATCH 243/243] Final update of ChangeLog --- doc/ChangeLog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index dbb72e415d..5c0c6ba058 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,7 +1,7 @@ =============================================================== Tag name: ctsm5.3.014 Originator(s): multiple (see contributors below) -Date: Tue 03 Dec 2024 10:49:08 AM MST +Date: Tue 03 Dec 2024 04:31:03 PM MST One-line Summary: Bring in several fixes for testing in the previous cesm3_0_beta03/04 tags Purpose and description of changes @@ -104,7 +104,7 @@ Testing summary: regular + fates + ctsm_sci build-namelist tests (if CLMBuildNamelist.pm has changed): - derecho - OK + derecho - PASS (6 namelists are different than ctsm5.3.013, new 16pft for f19/f45 non-crop) python testing (if python code has changed; see instructions in python/README.md; document testing done):