diff --git a/.github/workflows/docs-omnibus.yml b/.github/workflows/docs-omnibus.yml index 655813c366..1636150fae 100644 --- a/.github/workflows/docs-omnibus.yml +++ b/.github/workflows/docs-omnibus.yml @@ -51,4 +51,4 @@ jobs: # TODO: Split testing.sh tests into their own steps in this job - name: Text Sphinx builds with omnibus script run: | - cd doc && conda run -n ctsm_pylib ./testing.sh + cd doc && ./testing.sh diff --git a/.github/workflows/fleximod_test.yaml b/.github/workflows/fleximod_test.yaml index 8680541676..d85958f972 100644 --- a/.github/workflows/fleximod_test.yaml +++ b/.github/workflows/fleximod_test.yaml @@ -22,7 +22,7 @@ jobs: uses: actions/checkout@v4 - id: run-fleximod run: | - $GITHUB_WORKSPACE/bin/git-fleximod update + $GITHUB_WORKSPACE/bin/git-fleximod update -o echo echo "Update complete, checking status" echo @@ -32,4 +32,4 @@ jobs: echo echo "Checking if git fleximod matches expected externals" echo - git diff --exit-code + git add . && git diff --exit-code && git diff --cached --exit-code diff --git a/.github/workflows/validate_xml.py b/.github/workflows/validate_xml.py new file mode 100644 index 0000000000..c854bf916b --- /dev/null +++ b/.github/workflows/validate_xml.py @@ -0,0 +1,67 @@ +""" +Check that all XML files in our repo (except for those in submodules) are well-formed. Error if not. +""" +import sys +import glob +import os +import subprocess +import xml.etree.ElementTree as ET + + +def get_submodule_paths(): + """ + Get list of submodules + """ + cmd = "git config --file .gitmodules --get-regexp path | awk '{ print $2 }'" + result = subprocess.run(cmd, capture_output=True, text=True, shell=True, check=True) + result_list = result.stdout.split("\n")[:-1] + result_list = [x for x in result_list if x] + return result_list + + +def is_in_submodule(file_path, submodule): + """ + Return True if file is in given submodule, False otherwise + """ + return os.path.commonpath([file_path, submodule]) == os.path.commonpath([submodule]) + + +def is_in_any_submodule(file_path, submodule_paths): + """ + Return True if file is in any submodule, False otherwise + """ + file_path = os.path.abspath(file_path) + submodule_paths = map(os.path.abspath, submodule_paths) + return any(is_in_submodule(file_path, submodule) for submodule in submodule_paths) + + +def validate_xml(file_path): + """ + Return True if XML file is well-formed, False otherwise + """ + try: + ET.parse(file_path) + except ET.ParseError: + print(f"❌ {file_path} is NOT well-formed") + return False + print(f"✅ {file_path} is well-formed") + return True + + +def main(): + # pylint: disable=missing-function-docstring + submodule_paths = get_submodule_paths() + all_valid = True + for xml_file in glob.glob("**/*.xml", recursive=True): + if is_in_any_submodule(xml_file, submodule_paths): + continue + if not validate_xml(xml_file): + all_valid = False + + if not all_valid: + print("\nUse xmllint to show problems in malformed files") + + return all_valid + + +sys.exit(0 if main() else 1) diff --git a/.github/workflows/xml-check.yml b/.github/workflows/xml-check.yml new file mode 100644 index 0000000000..18cc6b4079 --- /dev/null +++ b/.github/workflows/xml-check.yml @@ -0,0 +1,20 @@ +name: Check that XML files are well-formed +# Only check files in our repo that AREN'T in submodules +# Use a Python command to check each file because xmllint isn't available on GH runners + +on: [push, pull_request] # Trigger on push or pull request + +jobs: + check-xml: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.x' + + - name: Check XML files + run: python .github/workflows/validate_xml.py diff --git a/.gitmodules b/.gitmodules index d6c16471a0..48bc074b92 100644 --- a/.gitmodules +++ b/.gitmodules @@ -92,7 +92,7 @@ fxDONOTUSEurl = https://github.com/ESCOMP/CMEPS.git [submodule "cdeps"] path = components/cdeps url = https://github.com/ESCOMP/CDEPS.git -fxtag = cdeps1.0.73 +fxtag = cdeps1.0.75 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 @@ -128,13 +128,3 @@ fxtag = v2.2.6 fxrequired = ToplevelOptional # Standard Fork to compare to with "git fleximod test" to ensure personal forks aren't committed fxDONOTUSEurl = https://github.com/ESMCI/doc-builder - -# FTorch is an optional library useful for AI and Machine Learning -# In order to use it -- it must be checked out with git-fleximod -[submodule "FTorch"] -path = libraries/FTorch -url = https://github.com/ESCOMP/FTorch_interface -fxtag = v0.0.5 -fxrequired = ToplevelOptional -# Standard Fork to compare to with "git fleximod test" to ensure personal forks aren't committed -fxDONOTUSEurl = https://github.com/ESCOMP/FTorch_interface diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index 408ff9b573..e498f275e6 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -1688,6 +1688,7 @@ sub process_namelist_inline_logic { setup_logic_cnmatrix($opts, $nl_flags, $definition, $defaults, $nl, $envxml_ref); setup_logic_spinup($opts, $nl_flags, $definition, $defaults, $nl); setup_logic_supplemental_nitrogen($opts, $nl_flags, $definition, $defaults, $nl); + setup_logic_c_isotope($opts, $nl_flags, $definition, $defaults, $nl); setup_logic_snowpack($opts, $nl_flags, $definition, $defaults, $nl); setup_logic_fates($opts, $nl_flags, $definition, $defaults, $nl); setup_logic_z0param($opts, $nl_flags, $definition, $defaults, $nl); @@ -1737,7 +1738,6 @@ sub process_namelist_inline_logic { # namelist group: ch4par_in # ############################### setup_logic_methane($opts, $nl_flags, $definition, $defaults, $nl); - setup_logic_c_isotope($opts, $nl_flags, $definition, $defaults, $nl); ############################### # namelist group: ndepdyn_nml # @@ -3175,10 +3175,11 @@ sub setup_logic_do_grossunrep { my $var = 'do_grossunrep'; - # Start by assuming a default value of '.true.'. Then check a number of + # Start by assuming a default value of '.false.'. Then check a number of # conditions under which do_grossunrep cannot be true. Under these - # conditions: (1) set default value to '.false.'; (2) make sure that the + # conditions: (1) set default value to '.false.' again; (2) make sure that the # value is indeed false (e.g., that the user didn't try to set it to true). + # Ideally the default value would be set in namelist_defaults my $default_val = ".false."; @@ -3703,63 +3704,53 @@ sub setup_logic_c_isotope { # my ($opts, $nl_flags, $definition, $defaults, $nl) = @_; + add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'use_c13', 'bgc_mode'=>$nl_flags->{'bgc_mode'}, 'phys'=>$nl_flags->{'phys'}); + add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'use_c14', 'bgc_mode'=>$nl_flags->{'bgc_mode'}, 'phys'=>$nl_flags->{'phys'}); my $use_c13 = $nl->get_value('use_c13'); my $use_c14 = $nl->get_value('use_c14'); if ( $nl_flags->{'bgc_mode'} ne "sp" && $nl_flags->{'bgc_mode'} ne "fates" ) { if ( $nl_flags->{'bgc_mode'} ne "bgc" ) { - if ( defined($use_c13) && &value_is_true($use_c13) ) { + if ( &value_is_true($use_c13) ) { $log->warning("use_c13 is ONLY scientifically validated with the bgc=BGC configuration" ); } - if ( defined($use_c14) && &value_is_true($use_c14) ) { + if ( &value_is_true($use_c14) ) { $log->warning("use_c14 is ONLY scientifically validated with the bgc=BGC configuration" ); } } - if ( defined($use_c14) ) { - if ( &value_is_true($use_c14) ) { - my $use_c14_bombspike = $nl->get_value('use_c14_bombspike'); - if ( defined($use_c14_bombspike) && &value_is_true($use_c14_bombspike) ) { - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'atm_c14_filename', - 'use_c14'=>$use_c14, 'use_cn'=>$nl_flags->{'use_cn'}, 'use_c14_bombspike'=>$nl->get_value('use_c14_bombspike'), - 'ssp_rcp'=>$nl_flags->{'ssp_rcp'} ); - } - } else { - if ( defined($nl->get_value('use_c14_bombspike')) || - defined($nl->get_value('atm_c14_filename')) ) { - $log->fatal_error("use_c14 is FALSE and use_c14_bombspike or atm_c14_filename set"); - } + if ( &value_is_true($use_c14) ) { + add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'use_c14_bombspike', 'bgc_mode'=>$nl_flags->{'bgc_mode'}, 'phys'=>$nl_flags->{'phys'}); + my $use_c14_bombspike = $nl->get_value('use_c14_bombspike'); + if ( &value_is_true($use_c14_bombspike) ) { + add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'atm_c14_filename', + 'use_c14'=>$use_c14, 'use_cn'=>$nl_flags->{'use_cn'}, 'use_c14_bombspike'=>$nl->get_value('use_c14_bombspike'), + 'ssp_rcp'=>$nl_flags->{'ssp_rcp'} ); } } else { if ( defined($nl->get_value('use_c14_bombspike')) || defined($nl->get_value('atm_c14_filename')) ) { - $log->fatal_error("use_c14 NOT set to .true., but use_c14_bompspike/atm_c14_filename defined."); + $log->fatal_error("use_c14 is FALSE and use_c14_bombspike or atm_c14_filename set"); } } - if ( defined($use_c13) ) { - if ( &value_is_true($use_c13) ) { - my $use_c13_timeseries = $nl->get_value('use_c13_timeseries'); - if ( defined($use_c13_timeseries) && &value_is_true($use_c13_timeseries) ) { - add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'atm_c13_filename', - 'use_c13'=>$use_c13, 'use_cn'=>$nl_flags->{'use_cn'}, 'use_c13_timeseries'=>$nl->get_value('use_c13_timeseries'), - 'ssp_rcp'=>$nl_flags->{'ssp_rcp'} ); - } - } else { - if ( defined($nl->get_value('use_c13_timeseries')) || - defined($nl->get_value('atm_c13_filename')) ) { - $log->fatal_error("use_c13 is FALSE and use_c13_timeseries or atm_c13_filename set"); - } + if ( &value_is_true($use_c13) ) { + add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'use_c13_timeseries', 'bgc_mode'=>$nl_flags->{'bgc_mode'}, 'phys'=>$nl_flags->{'phys'}); + my $use_c13_timeseries = $nl->get_value('use_c13_timeseries'); + if ( &value_is_true($use_c13_timeseries) ) { + add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'atm_c13_filename', + 'use_c13'=>$use_c13, 'use_cn'=>$nl_flags->{'use_cn'}, 'use_c13_timeseries'=>$nl->get_value('use_c13_timeseries'), + 'ssp_rcp'=>$nl_flags->{'ssp_rcp'} ); } } else { if ( defined($nl->get_value('use_c13_timeseries')) || defined($nl->get_value('atm_c13_filename')) ) { - $log->fatal_error("use_c13 NOT set to .true., but use_c13_bompspike/atm_c13_filename defined."); + $log->fatal_error("use_c13 is FALSE and use_c13_timeseries or atm_c13_filename set"); } } } else { - if ( defined($use_c13) || - defined($use_c14) || - defined($nl->get_value('use_c14_bombspike')) || + if ( &value_is_true($use_c13) || + &value_is_true($use_c14) || + &value_is_true($nl->get_value('use_c14_bombspike')) || defined($nl->get_value('atm_c14_filename')) || - defined($nl->get_value('use_c13_timeseries')) || + &value_is_true($nl->get_value('use_c13_timeseries')) || defined($nl->get_value('atm_c13_filename')) ) { $log->fatal_error("bgc=sp and C isotope namelist variables were set, both can't be used at the same time"); } diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index fedfca8020..59fc9e42dd 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -110,6 +110,17 @@ attributes from the config_cache.xml file (with keys converted to upper-case). Medlyn2011 Ball-Berry1987 + +.false. +.false. +.false. +.false. + +.true. +.true. +.true. +.true. + lnd/clm2/isotopes/atm_delta_C13_CMIP6_1850-2015_yearly_v2.0_c190528.nc lnd/clm2/isotopes/atm_delta_C13_CMIP6_SSP119_1850-2100_yearly_c181209.nc @@ -484,13 +495,11 @@ attributes from the config_cache.xml file (with keys converted to upper-case). Jordan1991 Sturm1997 - Jordan1991 -Sturm1997 +Jordan1991 - Jordan1991 -Jordan1991 +Sturm1997 -lnd/clm2/paramdata/ctsm60_params.c250311.nc +lnd/clm2/paramdata/ctsm5.3.041.Nfix_params.v13.c250221_upplim250.nc lnd/clm2/paramdata/clm50_params.c250311.nc lnd/clm2/paramdata/clm45_params.c250311.nc @@ -1283,14 +1292,14 @@ attributes from the config_cache.xml file (with keys converted to upper-case). ic_ymd="18500101" sim_year="1850" do_transient_pfts=".false." use_excess_ice=".true." ic_tod="0" glc_nec="10" use_crop=".true." irrigate=".false." phys="clm6_0" ->lnd/clm2/initdata_esmf/ctsm5.3/ctsm53019_f09_BNF_pSASU.clm2.r.0161-01-01-00000.nc +>lnd/clm2/initdata_esmf/ctsm5.4/ctsm53041_54surfdata_snowTherm_100_pSASU.clm2.r.0161-01-01-00000_64bitoffset.nc lnd/clm2/initdata_esmf/ctsm5.3/ctsm53019_f09_BNF_pSASU.clm2.r.0161-01-01-00000.nc +>lnd/clm2/initdata_esmf/ctsm5.4/ctsm53041_54surfdata_ne30_102_pSASU.clm2.r.0081-01-01-00000_64bitoffset.nc lnd/clm2/initdata_esmf/ctsm5.3/ctsm53019_f09_BNF_hist.clm2.r.2000-01-01-00000.nc +>lnd/clm2/initdata_esmf/ctsm5.4/ctsm53041_54surfdata_ne30_102_HIST.clm2.r.2000-01-01-00000.nc lnd/clm2/initdata_esmf/ctsm5.3/ctsm53019_f09_BNF_hist.clm2.r.2000-01-01-00000.nc +>lnd/clm2/initdata_esmf/ctsm5.4/ctsm53041_54surfdata_ne30_102_HIST.clm2.r.2000-01-01-00000.nc @@ -1700,7 +1709,7 @@ lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_4x5_hist_1850_16pfts_c241007.nc lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_360x720cru_hist_1850_78pfts_c240908.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_0.9x1.25_hist_1850_78pfts_c240908.nc +lnd/clm2/surfdata_esmf/ctsm5.4.0/surfdata_0.9x1.25_hist_1850_78pfts_c250428.nc lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_1.9x2.5_hist_1850_78pfts_c240908.nc @@ -1718,7 +1727,7 @@ lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_ne30np4_hist_1850_78pfts_c240908.nc lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_ne30np4.pg2_hist_1850_78pfts_c240908.nc -lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_ne30np4.pg3_hist_1850_78pfts_c240908.nc +lnd/clm2/surfdata_esmf/ctsm5.4.0/surfdata_ne30np4.pg3_hist_1850_78pfts_c250428.nc lnd/clm2/surfdata_esmf/ctsm5.3.0/surfdata_ne3np4.pg3_hist_1850_78pfts_c240908.nc @@ -1778,7 +1787,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_0.9x1.25_SSP2-4.5_1850-2100_78pfts_c240908.nc + >lnd/clm2/surfdata_esmf/ctsm5.4.0/landuse.timeseries_0.9x1.25_hist_1850-2023_78pfts_c250428.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_ne16np4.pg3_SSP2-4.5_1850-2100_78pfts_c240908.nc lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_ne30np4.pg3_SSP2-4.5_1850-2100_78pfts_c240908.nc +>lnd/clm2/surfdata_esmf/ctsm5.4.0/landuse.timeseries_ne30np4.pg3_hist_1850-2023_78pfts_c250428.nc lnd/clm2/surfdata_esmf/ctsm5.3.0/landuse.timeseries_C96_SSP2-4.5_1850-2100_78pfts_c240908.nc diff --git a/cime_config/testdefs/ExpectedTestFails.xml b/cime_config/testdefs/ExpectedTestFails.xml index 77083c778d..a9fbebcdf8 100644 --- a/cime_config/testdefs/ExpectedTestFails.xml +++ b/cime_config/testdefs/ExpectedTestFails.xml @@ -36,27 +36,6 @@ - - - FAIL - #2686 - - - - - - FAIL - #2686 - - - - - - FAIL - #2686 - - - FAIL @@ -83,6 +62,27 @@ + + + FAIL + #3252 + Works with finidat = 'ctsm53041_54surfdata_snowTherm_100_pSASU.clm2.r.0161-01-01-00000.nc' and fails with finidat = 'ctsm53041_54surfdata_snowTherm_100_pSASU.clm2.r.0161-01-01-00000_64bitoffset.nc'. + + + + + FAIL + #3252 + Works with finidat = 'ctsm53041_54surfdata_snowTherm_100_pSASU.clm2.r.0161-01-01-00000.nc' and fails with finidat = 'ctsm53041_54surfdata_snowTherm_100_pSASU.clm2.r.0161-01-01-00000_64bitoffset.nc'. + + + + + FAIL + #3250 + SSP landuse files not available for ctsm54, yet. + + FAIL @@ -159,11 +159,15 @@ - FAIL #3182 + + FAIL + #3182 + diff --git a/cime_config/testdefs/testlist_clm.xml b/cime_config/testdefs/testlist_clm.xml index 9b97da53fe..c67955b16e 100644 --- a/cime_config/testdefs/testlist_clm.xml +++ b/cime_config/testdefs/testlist_clm.xml @@ -150,7 +150,7 @@ - + @@ -551,7 +551,7 @@ - + @@ -559,7 +559,7 @@ - + @@ -567,7 +567,7 @@ - + @@ -1339,7 +1339,7 @@ - + @@ -1593,7 +1593,7 @@ - + @@ -2269,7 +2269,7 @@ - + @@ -2278,7 +2278,7 @@ - + @@ -2700,7 +2700,7 @@ - + @@ -2830,7 +2830,7 @@ - + @@ -2872,7 +2872,7 @@ - + @@ -2887,7 +2887,7 @@ - + @@ -3073,6 +3073,65 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -3252,7 +3311,7 @@ - + @@ -3301,7 +3360,7 @@ - + @@ -4266,7 +4325,7 @@ - + diff --git a/cime_config/testdefs/testmods_dirs/clm/datm_ssp126_anom_forc/include_user_mods b/cime_config/testdefs/testmods_dirs/clm/datm_rcp45_anom_forc/include_user_mods similarity index 100% rename from cime_config/testdefs/testmods_dirs/clm/datm_ssp126_anom_forc/include_user_mods rename to cime_config/testdefs/testmods_dirs/clm/datm_rcp45_anom_forc/include_user_mods diff --git a/cime_config/testdefs/testmods_dirs/clm/datm_rcp45_anom_forc/user_nl_datm b/cime_config/testdefs/testmods_dirs/clm/datm_rcp45_anom_forc/user_nl_datm new file mode 100644 index 0000000000..a1e2523cca --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/datm_rcp45_anom_forc/user_nl_datm @@ -0,0 +1 @@ +anomaly_forcing = 'Anomaly.Forcing.cmip5.rcp45' diff --git a/cime_config/testdefs/testmods_dirs/clm/datm_ssp126_anom_forc/user_nl_datm b/cime_config/testdefs/testmods_dirs/clm/datm_ssp126_anom_forc/user_nl_datm deleted file mode 100644 index d8ee13a339..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/datm_ssp126_anom_forc/user_nl_datm +++ /dev/null @@ -1 +0,0 @@ -anomaly_forcing = 'Anomaly.Forcing.Temperature' diff --git a/cime_config/testdefs/testmods_dirs/clm/datm_ssp126_anom_forc/user_nl_datm_streams b/cime_config/testdefs/testmods_dirs/clm/datm_ssp126_anom_forc/user_nl_datm_streams deleted file mode 100644 index 34ca8a96ae..0000000000 --- a/cime_config/testdefs/testmods_dirs/clm/datm_ssp126_anom_forc/user_nl_datm_streams +++ /dev/null @@ -1,22 +0,0 @@ -Anomaly.Forcing.Temperature:year_first=2015 -Anomaly.Forcing.Temperature:year_last=2100 -Anomaly.Forcing.Temperature:year_align=2015 -Anomaly.Forcing.Temperature:meshfile =$DIN_LOC_ROOT/share/meshes/fv0.9x1.25_141008_polemod_ESMFmesh.nc -! List of Data types to use -! Remove the variables you do NOT want to include in the Anomaly forcing: -! pr is preciptiation -! tas is temperature -! huss is humidity -! uas and vas are U and V winds -! rsds is solare -! rlds is LW down -Anomaly.Forcing.Temperature:datavars = pr Faxa_prec_af, \ - tas Sa_tbot_af, \ - ps Sa_pbot_af, \ - huss Sa_shum_af, \ - uas Sa_u_af, \ - vas Sa_v_af, \ - rsds Faxa_swdn_af, \ - rlds Faxa_lwdn_af -Anomaly.Forcing.Temperature:datafiles =$DIN_LOC_ROOT/atm/datm7/anomaly_forcing/CMIP6-SSP1-2.6/af.allvars.CESM.SSP1-2.6.2015-2100_c20220628.nc - diff --git a/cime_config/testdefs/testmods_dirs/clm/noAnomalyForcing/user_nl_datm b/cime_config/testdefs/testmods_dirs/clm/noAnomalyForcing/user_nl_datm new file mode 100644 index 0000000000..e609bf1b7a --- /dev/null +++ b/cime_config/testdefs/testmods_dirs/clm/noAnomalyForcing/user_nl_datm @@ -0,0 +1,2 @@ +anomaly_forcing = 'none' + diff --git a/cime_config/usermods_dirs/clm/NEON/FATES/defaults/user_nl_datm b/cime_config/usermods_dirs/clm/NEON/FATES/defaults/user_nl_datm new file mode 100644 index 0000000000..ec9f6cbcc7 --- /dev/null +++ b/cime_config/usermods_dirs/clm/NEON/FATES/defaults/user_nl_datm @@ -0,0 +1 @@ +anomaly_forcing = 'none' diff --git a/cime_config/usermods_dirs/clm/NEON/defaults/user_nl_datm b/cime_config/usermods_dirs/clm/NEON/defaults/user_nl_datm new file mode 100644 index 0000000000..ec9f6cbcc7 --- /dev/null +++ b/cime_config/usermods_dirs/clm/NEON/defaults/user_nl_datm @@ -0,0 +1 @@ +anomaly_forcing = 'none' diff --git a/cime_config/usermods_dirs/clm/NEON/defaults/user_nl_datm_streams b/cime_config/usermods_dirs/clm/NEON/defaults/user_nl_datm_streams index bae77db6b5..36f1e72b3a 100644 --- a/cime_config/usermods_dirs/clm/NEON/defaults/user_nl_datm_streams +++ b/cime_config/usermods_dirs/clm/NEON/defaults/user_nl_datm_streams @@ -37,4 +37,3 @@ preso3.SSP3-7.0:year_first=2018 preso3.SSP3-7.0:year_last=2022 preso3.SSP3-7.0:year_align=2018 preso3.SSP3-7.0:dtlimit=30 - diff --git a/cime_config/usermods_dirs/clm/PLUMBER2/defaults/user_nl_datm b/cime_config/usermods_dirs/clm/PLUMBER2/defaults/user_nl_datm new file mode 100644 index 0000000000..ec9f6cbcc7 --- /dev/null +++ b/cime_config/usermods_dirs/clm/PLUMBER2/defaults/user_nl_datm @@ -0,0 +1 @@ +anomaly_forcing = 'none' diff --git a/cime_config/usermods_dirs/clm/PLUMBER2/defaults/user_nl_datm_streams b/cime_config/usermods_dirs/clm/PLUMBER2/defaults/user_nl_datm_streams index 29a8c675ac..cacc92f688 100644 --- a/cime_config/usermods_dirs/clm/PLUMBER2/defaults/user_nl_datm_streams +++ b/cime_config/usermods_dirs/clm/PLUMBER2/defaults/user_nl_datm_streams @@ -38,4 +38,3 @@ presndep.SSP3-7.0:datafiles = $DIN_LOC_ROOT/lnd/clm2/ndepdata/fndep_clm_SSP370_b presndep.SSP3-7.0:dtlimit=30 co2tseries.SSP3-7.0:datafiles = $DIN_LOC_ROOT/atm/datm7/CO2/fco2_datm_globalSSP3-7.0_simyr_1750-2501_CMIP6_c201101.nc - diff --git a/components/cdeps b/components/cdeps index 9e57b278de..472264c96a 160000 --- a/components/cdeps +++ b/components/cdeps @@ -1 +1 @@ -Subproject commit 9e57b278de18cf69351bc693fe1988143e859fa7 +Subproject commit 472264c96a14f9f97cbb087df2c2357c1dcea826 diff --git a/doc/ChangeLog b/doc/ChangeLog index be7b37dc81..793b324524 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,4 +1,213 @@ =============================================================== +Tag name: ctsm5.3.055 +Originator(s): samrabin (Sam Rabin, UCAR/TSS) +Date: Thu Jun 5 13:59:20 MDT 2025 +One-line Summary: Remove FTorch + +Purpose and description of changes +---------------------------------- + +Incorrect CMEPS version causes a build failure. + + +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): +- [Issue #3210: build-and-deploy failure at ctsm5.3.053](https://github.com/ESCOMP/CTSM/issues/3210) +- [Issue #3214: Build fails with FTorch checked out](https://github.com/ESCOMP/CTSM/issues/3214) + + +Testing summary: +---------------- + +Model now builds successfully on Izumi with all optional submodules checked out. + + +Other details +------------- +[Remove any lines that don't apply. Remove entire section if nothing applies.] + +List any git submodules updated (cime, rtm, mosart, cism, fates, etc.): +- FTorch removed + +Pull Requests that document the changes (include PR ids): +- [Pull Request #3211: ctsm5.3.055: Remove broken FTorch submodule by samsrabin](https://github.com/ESCOMP/CTSM/pull/3211) + +=============================================================== +=============================================================== +Tag name: ctsm5.3.054 +Originator(s): samrabin (Sam Rabin, UCAR/TSS) +Date: Mon Jun 2 11:39:50 MDT 2025 +One-line Summary: CDEPS: Allow anomaly forcings with any DATM + +Purpose and description of changes +---------------------------------- + +Updates CDEPS to version cdeps1.0.75, allowing anomaly forcings with any datm_mode. CRU-JRA thus now works with anomalies. + +Also brings in cdeps1.0.74: "In DATM with cplhist mode, make 1st timestep same as cam7 when using the cam7 option." + + + +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): +- [Issue #3209: [CDEPS] Allow anomaly forcings with any datm](https://github.com/ESCOMP/CTSM/issues/3209) + + +Testing summary: +---------------- + + regular tests (aux_clm: https://github.com/ESCOMP/CTSM/wiki/System-Testing-Guide#pre-merge-system-testing): + + derecho ----- OK + izumi ------- OK + + ctsm_sci (just three tests that were failing before) + derecho ---- PASS + + +Answer changes +-------------- + +Changes answers relative to baseline: Yes (although not in tests) + + Summarize any changes to answers, i.e., + - what code configurations: CPLHIST + - what platforms/compilers: All + - nature of change (roundoff; larger than roundoff/same climate; new climate): Roundoff + + Only affects first timestep under lnd_tuning_mode clm6_0_cam7.0. + + +Other details +------------- + +List any git submodules updated (cime, rtm, mosart, cism, fates, etc.): +- cdeps updated from cdeps1.0.73 to cdeps1.0.75 + +Pull Requests that document the changes (include PR ids): +- [Pull Request #3212: ctsm5.3.054: CDEPS: Allow anomaly forcings with any DATM by samsrabin](https://github.com/ESCOMP/CTSM/pull/3212) + +=============================================================== +=============================================================== +Tag name: ctsm5.3.053 +Originator(s): samrabin (Sam Rabin, UCAR/TSS) +Date: Fri May 30 14:56:48 MDT 2025 +One-line Summary: Fix and improve anomaly forcings for ISSP cases + +Purpose and description of changes +---------------------------------- + +Fixes a bug where all SSP cases would get RCP45 anomalies. Also makes it much simpler to run land-only SSP cases. + + +Significant changes to scientifically-supported configurations +-------------------------------------------------------------- + +Does this tag change answers significantly for any of the following physics configurations? +(Details of any changes will be given in the "Answer changes" section below.) + +[X] clm6_0 + +[X] clm5_0 + +[X] ctsm5_0-nwp + +[X] clm4_5 + + +Bugs fixed +---------- + +List of CTSM issues fixed (include CTSM Issue # and description): +- Fixes [Issue #2301: SSP cases get rcp45 anomalies](https://github.com/ESCOMP/CTSM/issues/2301) +- Resolves [Issue #922: Turn on anomaly forcing for ISSP compsets](https://github.com/ESCOMP/CTSM/issues/922) +- Resolves [Issue #1730: Example, user_nl_datm_streams file for anomaly forcing for NUOPC coupler](https://github.com/ESCOMP/CTSM/issues/1730) + + +Notes of particular relevance for users +--------------------------------------- + +Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables): +- Greatly simplifies the setup of ISSP cases where you want to use the CESM2 anomaly forcings. See updated documentation in User's Guide + +Changes to documentation: +- User's Guide section on running with anomaly forcings + + +Testing summary: +---------------- + + [PASS means all tests PASS; OK means tests PASS other than expected fails.] + + regular tests (aux_clm: https://github.com/ESCOMP/CTSM/wiki/System-Testing-Guide#pre-merge-system-testing): + + derecho ----- OK + izumi ------- OK + + any other testing (give details below): + ssp test suite ---- PASS + +Answer changes +-------------- + +Changes answers relative to baseline: + + Summarize any changes to answers, i.e., + - what code configurations: ISSP cases other than ssp245 with anomaly forcings, if the user didn't manually specify all the anomaly forcing files + - what platforms/compilers: all + - nature of change (roundoff; larger than roundoff/same climate; new climate): larger than roundoff/same 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) + - n/a: This only affects ISSP cases + + +Other details +------------- + +Pull Requests that document the changes (include PR ids): +- [Pull Request #2686: ctsm5.3.053: Fix and improve anomaly forcings for ISSP cases by samsrabin](https://github.com/ESCOMP/CTSM/pull/2686) + +=============================================================== +=============================================================== Tag name: ctsm5.3.052 Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326) Date: Fri 30 May 2025 12:44:17 AM MDT diff --git a/doc/ChangeSum b/doc/ChangeSum index 62bfb3262b..3b5c59acfe 100644 --- a/doc/ChangeSum +++ b/doc/ChangeSum @@ -1,5 +1,8 @@ Tag Who Date Summary ============================================================================================================================ + ctsm5.3.055 samrabin 06/05/2025 Remove FTorch + ctsm5.3.054 samrabin 06/02/2025 CDEPS: Allow anomaly forcings with any DATM + ctsm5.3.053 samrabin 05/30/2025 Fix and improve anomaly forcings for ISSP cases ctsm5.3.052 erik 05/30/2025 Changes to MEGAN needed for coupled cases ctsm5.3.051 erik 05/28/2025 Update submodules to cesm3_0_beta06 versions and update MEGAN/drydep test namelist ctsm5.3.050 samrabin 05/29/2025 Fix Linux Podman; prefer Linux Docker; update docs docs. 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 2efa65893d..a8197d836c 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 @@ -5,41 +5,60 @@ ============================== Running with anomaly forcing ============================== -Because performing fully coupled climate simulations is computationally expensive, an alternate method of running land-only simulations forced by future climate projections was developed for CTSM called 'anomaly forcing'. The anomaly forcing method uses a previously completed fully coupled simulation to create monthly anomalies, relative to the present day, of near-surface atmospheric states and fluxes. These anomalies, representing the evolution of future climate projections, are applied to a repeating cycle of present day atmospheric forcing data, either as an additive (for states) or multiplicative (for fluxes) quantity. Thus, high-frequency variability is obtained from the present day atmospheric forcing data, while the long-term evolution of the climate is determined by the anomaly forcing dataset. - -To enable anomaly forcing in a CTSM simulation, the following namelist variable can be added to the user\_nl\_datm file: - - anomaly\_forcing = 'Anomaly.Forcing.Precip','Anomaly.Forcing.Temperature','Anomaly.Forcing.Pressure','Anomaly.Forcing.Humidity','Anomaly.Forcing.Uwind','Anomaly.Forcing.Vwind','Anomaly.Forcing.Shortwave','Anomaly.Forcing.Longwave' - -Any combination or subset of forcing variables can be used, e.g. to modify only a single atmospheric forcing variable, one could use: - - anomaly\_forcing = 'Anomaly.Forcing.Temperature' - -which will only adjust the temperature (TBOT). - -After the namelist has been created, the run directory will be populated with files such as these: - - datm.streams.txt.Anomaly.Forcing.Temperature - -which will contain the location of the default anomaly forcing datasets. To use alternative data, copy these files to the case directory with the 'user\_' prefix, and modify the 'user\_*' files accordingly, e.g.: - - user\_datm.streams.txt.Anomaly.Forcing.Temperature - - For example, one could use the user\_datm.streams.txt.Anomaly.Forcing.* files to point to these SSP-derived anomaly forcing datasets: - - /glade/p/cesmdata/cseg/inputdata/atm/datm7/anomaly\_forcing/CMIP6-SSP3-7.0 - - af.huss.cesm2.SSP3-7.0.2015-2100\_c20200329.nc - af.pr.cesm2.SSP3-7.0.2015-2100\_c20200329.nc - af.ps.cesm2.SSP3-7.0.2015-2100\_c20200329.nc - af.rlds.cesm2.SSP3-7.0.2015-2100\_c20200329.nc - af.rsds.cesm2.SSP3-7.0.2015-2100\_c20200329.nc - af.tas.cesm2.SSP3-7.0.2015-2100\_c20200329.nc - -Users may wish to also update files such as the landuse\_timeseries and aerosol and Ndepostion files to correspond to the appropriate SSP. - -For single point simulations, the global anomaly forcing files can be used, but the map_algo namelist variable should be appended with nearest neighbor values for each of the anomaly forcing fields, e.g. - - 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\_YR\_START and DATM\_YR\_END variables in env\_run.xml. +Because performing fully coupled climate simulations is computationally expensive, an alternate method of running land-only simulations forced by future climate projections was developed for CTSM called "anomaly forcing." The anomaly forcing method uses a previously-completed, fully-coupled simulation to create monthly anomalies, relative to the present day, of near-surface atmospheric states and fluxes. These anomalies, representing the evolution of future climate projections, are applied to a repeating cycle of present day atmospheric forcing data, either as an additive (for states) or multiplicative (for fluxes) quantity. Thus, high-frequency variability is obtained from the present day atmospheric forcing data, while the long-term evolution of the climate is determined by the anomaly forcing dataset. + +Anomaly climate forcings are automatically enabled for ``ISSP`` compsets (e.g., ``ISSP585``). After the namelist has been created, ``CaseDocs/datm.streams.xml`` will have an entry like this pointing to the anomaly forcing file being used: + +:: + + + ... + + /glade/campaign/cesm/cesmdata/inputdata/atm/datm7/anomaly_forcing/CMIP6-SSP5-8.5/af.allvars.CESM.SSP5-8.5.2015-2100_c20220628.nc + + + huss Sa_shum_af + pr Faxa_prec_af + ps Sa_pbot_af + rlds Faxa_lwdn_af + rsds Faxa_swdn_af + tas Sa_tbot_af + uas Sa_u_af + vas Sa_v_af + + ... + + +To use alternative data, add a ``user_nl_datm_streams`` namelist file to your case with contents like so: + +:: + + Anomaly.Forcing.cmip6.ssp585:datafiles = /path/to/your/datafile + Anomaly.Forcing.cmip6.ssp585:meshfile = /path/to/meshfile/for/your/datafile + + ! List of Data types to use + ! Remove the variables you do NOT want to include in the anomaly forcing: + ! pr is precipitation + ! tas is temperature + ! huss is humidity + ! uas and vas are U and V winds + ! rsds is solare + ! rlds is LW down + Anomaly.Forcing.cmip6.ssp585:datavars = pr Faxa_prec_af, \ + tas Sa_tbot_af, \ + ps Sa_pbot_af, \ + huss Sa_shum_af, \ + uas Sa_u_af, \ + vas Sa_v_af, \ + rsds Faxa_swdn_af, \ + rlds Faxa_lwdn_af + +To instead disable anomaly forcing in ``ISSP`` compsets, the following can be added to the ``user_nl_datm`` file: + +:: + + anomaly_forcing = 'none' + +Note that other inputs are also set automatically for ``ISSP`` compsets, including CO2 (``co2tseries``), ozone (``preso3``), N deposition (``presndep``), and aerosols (``presaero``). + +The first and last years over which the present-day (base) climate should cycle are set through the ``DATM_YR_START`` and ``DATM_YR_END`` XML variables. diff --git a/doc/testing.sh b/doc/testing.sh index a44b6ad18a..9253df848c 100755 --- a/doc/testing.sh +++ b/doc/testing.sh @@ -2,6 +2,10 @@ set -e set -x +SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) +cd "${SCRIPT_DIR}" + +../bin/git-fleximod update -o rm -rf _publish* # Build all docs using container @@ -34,7 +38,7 @@ rm -rf _build_container # Check that Makefile method works echo "~~~~~ Check that Makefile method works" rm -rf _build -make SPHINXOPTS="-W --keep-going" BUILDDIR=${PWD}/_build html +conda run -n ctsm_pylib make SPHINXOPTS="-W --keep-going" BUILDDIR=${PWD}/_build html # Check that -b works echo "~~~~~ Check that -b works (Podman)"