Skip to content

Commit

Permalink
Merge pull request ESCOMP#2417 from ekluzek/addclm60
Browse files Browse the repository at this point in the history
Addition of clm6_0 physics option
  • Loading branch information
ekluzek authored Apr 9, 2024
2 parents 6622b68 + b904b5a commit af3c7fb
Show file tree
Hide file tree
Showing 44 changed files with 1,095 additions and 8,640 deletions.
1 change: 1 addition & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,4 @@ cda0cf1412212e6f4363e6e8eb39f74c944b454d
aa04d1f7d86cc2503b98b7e2b2d84dbfff6c316b
6c6f57e948bfa31e60b383536cc21663fedb8b70
9660667b1267dcd4150889f5f39db540158be74a
665cf86102e09b4c4c5a140700676dca23bc55a9
7 changes: 0 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -105,13 +105,6 @@ unit_test_build
# Tools executables
/tools/mkprocdata_map/mkprocdata_map

# mkmapdata output files
/tools/mkmapdata/PET*.RegridWeightGen.Log
/tools/mkmapdata/regrid.*.out
/tools/mkmapdata/regrid.*.err
/tools/mkmapdata/regrid.o*
/tools/mkmapdata/map*.nc

# run_neon output directories
/tools/site_and_regional/listing.csv
/tools/site_and_regional/????/
Expand Down
1 change: 0 additions & 1 deletion bld/CLMBuildNamelist.pm
Original file line number Diff line number Diff line change
Expand Up @@ -4014,7 +4014,6 @@ sub setup_logic_megan {
#-------------------------------------------------------------------------------

sub setup_logic_soilm_streams {
# prescribed soil moisture streams require clm4_5/clm5_0/clm5_1
my ($opts, $nl_flags, $definition, $defaults, $nl, $physv) = @_;

add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'use_soil_moisture_streams');
Expand Down
1 change: 0 additions & 1 deletion bld/README
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ unit_testers --- Directory of scripts to test scipts in this directory

---------- XML Files describing namelists in namelist_files
namelist_files/namelist_defaults_ctsm.xml --------- List of default values for the ctsm namelist
namelist_files/namelist_defaults_ctsm_tools.xml --- List of default values for the ctsm tools
namelist_files/namelist_defaults_overall.xml ------ List of default values for overall settings
namelist_files/namelist_defaults_usr_files.xml ---- List of default values for the user-files
namelist_files/namelist_definition_ctsm.xml -------- Definition of all namelist items for ctsm
Expand Down
4 changes: 2 additions & 2 deletions bld/config_files/clm_phys_vers.pm
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ use bigint;
#use warnings;
#use diagnostics;

my @version_strings = ("clm4_5", "clm5_0", "clm5_1");
my @version_strings = ("clm4_5", "clm5_0", "clm5_1", "clm6_0");

#-------------------------------------------------------------------------------

Expand Down Expand Up @@ -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" );
my @vers_list = ( "clm4_5", "clm5_0", "clm5_1", "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");
Expand Down
4 changes: 2 additions & 2 deletions bld/config_files/config_definition_ctsm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
<config_definition>

<entry id="phys"
valid_values="clm4_5,clm5_0,clm5_1"
valid_values="clm4_5,clm5_0,clm5_1,clm6_0"
value="clm4_5"
category="physics">
Specifies either clm4_5, clm5_0, or clm5_1 physics
Specifies either clm4_5, clm5_0, clm5_1 (deprecated), or clm6_0 physics
</entry>

<entry id="clm_root"
Expand Down
567 changes: 294 additions & 273 deletions bld/namelist_files/namelist_defaults_ctsm.xml

Large diffs are not rendered by default.

7,427 changes: 0 additions & 7,427 deletions bld/namelist_files/namelist_defaults_ctsm_tools.xml

This file was deleted.

1 change: 1 addition & 0 deletions bld/namelist_files/namelist_defaults_drydep.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case).

<megan_specifier>'ISOP = isoprene', 'C10H16 = pinene_a + carene_3 + thujene_a', 'CH3OH = methanol', 'C2H5OH = ethanol', 'CH2O = formaldehyde', 'CH3CHO = acetaldehyde', 'CH3COOH = acetic_acid', 'CH3COCH3 = acetone'</megan_specifier>

<megan_factors_file phys="clm6_0" >atm/cam/chem/trop_mozart/emis/megan21_emis_factors_78pft_c20161108.nc</megan_factors_file>
<megan_factors_file phys="clm5_1" >atm/cam/chem/trop_mozart/emis/megan21_emis_factors_78pft_c20161108.nc</megan_factors_file>
<megan_factors_file phys="clm5_0" >atm/cam/chem/trop_mozart/emis/megan21_emis_factors_78pft_c20161108.nc</megan_factors_file>
<megan_factors_file phys="clm4_5" >atm/cam/chem/trop_mozart/emis/megan21_emis_factors_78pft_c20161108.nc</megan_factors_file>
Expand Down
21 changes: 5 additions & 16 deletions bld/namelist_files/namelist_defaults_overall.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,23 +22,12 @@ determine default values for namelists.
-->

<clm_start_type phys="clm5_1" use_cndv=".true." >arb_ic</clm_start_type>
<clm_start_type phys="clm5_0" use_cndv=".true." >arb_ic</clm_start_type>
<clm_start_type phys="clm4_5" use_cndv=".true." >arb_ic</clm_start_type>
<clm_start_type phys="clm4_5" use_fates=".true.">arb_ic</clm_start_type>
<clm_start_type phys="clm5_1" use_fates=".true.">arb_ic</clm_start_type>
<clm_start_type phys="clm5_0" use_fates=".true.">arb_ic</clm_start_type>
<clm_start_type phys="clm4_5" sim_year="1850" >startup</clm_start_type>
<clm_start_type phys="clm5_1" sim_year="1850" >startup</clm_start_type>
<clm_start_type phys="clm5_0" sim_year="1850" >startup</clm_start_type>
<clm_start_type phys="clm4_5" sim_year="2000" >startup</clm_start_type>
<clm_start_type phys="clm5_1" sim_year="2000" >startup</clm_start_type>
<clm_start_type phys="clm5_0" sim_year="2000" >startup</clm_start_type>
<clm_start_type phys="clm4_5" >arb_ic</clm_start_type>
<clm_start_type phys="clm5_0" >arb_ic</clm_start_type>
<clm_start_type phys="clm5_1" >arb_ic</clm_start_type>
<clm_start_type phys="clm4_5" use_fates=".true.">arb_ic</clm_start_type>
<clm_start_type >arb_ic</clm_start_type>
<clm_start_type bgc_spinup="on" >cold</clm_start_type>
<clm_start_type use_cndv=".true." >cold</clm_start_type>
<clm_start_type use_fates=".true.">cold</clm_start_type>
<clm_start_type sim_year="1850" >startup</clm_start_type>
<clm_start_type sim_year="2000" >startup</clm_start_type>

<clm_start_type sim_year_range="1850-2100">arb_ic</clm_start_type>

Expand Down
31 changes: 1 addition & 30 deletions bld/namelist_files/namelist_definition_ctsm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1374,35 +1374,6 @@ Toggle to turn on the dynamic root model
Toggle to turn on on diagnostic Snow Radiative Effect
</entry>


<!-- -->
<!-- mkmapdata namelist -->
<!-- -->
<entry id="scripgriddata" type="char*256" category="mkmapdata"
input_pathname="abs" group="clmexp" valid_values="" >
SCRIP format grid data file
</entry>

<entry id="scripgriddata_lrgfile_needed" type="char*256" category="mkmapdata"
group="clmexp" valid_values="none,64bit_offset,netcdf4" >
Flag to pass to the ESMF mapping utility, telling it what kind of large
file support is needed for an output file generated with this grid as
either the source or destination ('none', '64bit_offset' or 'netcdf4').
</entry>

<entry id="scripgriddata_type" type="char*256" category="mkmapdata"
group="clmexp" valid_values="SCRIP,UGRID" >
Flag to pass to the ESMF mapping utility, telling it what kind of grid
file this is (SCRIP or UGRID).
</entry>

<entry id="scripgriddata_meshname" type="char*256" category="mkmapdata"
group="clmexp" valid_values="" >
For UGRID files, flag to pass to the ESMF mapping utility, telling it the
name of the dummy variable that has all of the topology information stored
in its attributes. (Only used if scripgriddata_src_type = UGRID.)
</entry>

<!-- -->
<!-- mksurfdata namelist -->
<!-- -->
Expand Down Expand Up @@ -2222,7 +2193,7 @@ Land mask description
<!-- lnd_tuning_mode, there needs to be a setting for: CRUv7, GSWP3v1, and cam6.0 for each valid physics option -->
<entry id="lnd_tuning_mode" type="char*20" category="default_settings"
group="default_settings"
valid_values="clm4_5_CRUv7,clm4_5_GSWP3v1,clm4_5_cam6.0,clm5_0_cam6.0,clm5_0_CRUv7,clm5_0_GSWP3v1,clm5_1_GSWP3v1,clm5_1_cam6.0">
valid_values="clm4_5_CRUv7,clm4_5_GSWP3v1,clm4_5_cam6.0,clm5_0_cam6.0,clm5_0_CRUv7,clm5_0_GSWP3v1,clm5_1_GSWP3v1,clm5_1_cam6.0,clm6_0_GSWP3v1,clm6_0_cam6.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
Expand Down
57 changes: 30 additions & 27 deletions bld/unit_testers/build-namelist_test.pl
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ sub make_config_cache {
<?xml version="1.0"?>
<config_definition>
<commandline></commandline>
<entry id="phys" value="$phys" list="" valid_values="clm4_5,clm5_0,clm5_1">Specifies clm physics</entry>
<entry id="phys" value="$phys" list="" valid_values="clm4_5,clm5_0,clm5_1,clm6_0">Specifies clm physics</entry>
</config_definition>
EOF
$fh->close();
Expand Down Expand Up @@ -163,10 +163,10 @@ sub cat_and_create_namelistinfile {
#
# Figure out number of tests that will run
#
my $ntests = 1990;
my $ntests = 2455;

if ( defined($opts{'compare'}) ) {
$ntests += 1201;
$ntests += 1511;
}
plan( tests=>$ntests );

Expand Down Expand Up @@ -366,7 +366,7 @@ sub cat_and_create_namelistinfile {
print "\n===============================================================================\n";
print "Test the NEON sites\n";
print "=================================================================================\n";
my $phys = "clm5_1";
my $phys = "clm6_0";
$mode = "-phys $phys";
&make_config_cache($phys);
my $neondir = "../../cime_config/usermods_dirs/NEON";
Expand Down Expand Up @@ -575,7 +575,7 @@ sub cat_and_create_namelistinfile {
"onset_threh w SP" =>{ options=>" -envxml_dir . -bgc sp",
namelst=>"onset_thresh_depends_on_veg=.true.",
GLC_TWO_WAY_COUPLING=>"FALSE",
phys=>"clm5_1",
phys=>"clm6_0",
},
"dribble_crphrv w/o CN" =>{ options=>" -envxml_dir . -bgc sp",
namelst=>"dribble_crophrv_xsmrpool_2atm=.true.",
Expand Down Expand Up @@ -715,7 +715,7 @@ sub cat_and_create_namelistinfile {
"NEONlightresButGlobal" =>{ options=>"--res 4x5 --bgc bgc --envxml_dir . --light_res 106x740",
namelst=>"",
GLC_TWO_WAY_COUPLING=>"FALSE",
phys=>"clm5_1",
phys=>"clm6_0",
},
"spno-fire" =>{ options=>"-bgc sp -envxml_dir . -use_case 2000_control",
namelst=>"fire_method='nofire'",
Expand Down Expand Up @@ -905,27 +905,27 @@ sub cat_and_create_namelistinfile {
"lnd_frac set to UNSET" =>{ options=>"-driver mct -lnd_frac UNSET -envxml_dir .",
namelst=>"",
GLC_TWO_WAY_COUPLING=>"FALSE",
phys=>"clm5_1",
phys=>"clm6_0",
},
"lnd_frac set but nuopc" =>{ options=>"-driver nuopc -lnd_frac $DOMFILE -envxml_dir .",
namelst=>"",
GLC_TWO_WAY_COUPLING=>"FALSE",
phys=>"clm5_1",
phys=>"clm6_0",
},
"lnd_frac not set but lilac"=>{ options=>"-driver nuopc -lilac -envxml_dir . -lnd_frac UNSET",
namelst=>"fsurdat='surfdata.nc'",
GLC_TWO_WAY_COUPLING=>"FALSE",
phys=>"clm5_1",
phys=>"clm6_0",
},
"fatmlndfrc set but nuopc" =>{ options=>"-driver nuopc -envxml_dir .",
namelst=>"fatmlndfrc='frac.nc'",
GLC_TWO_WAY_COUPLING=>"FALSE",
phys=>"clm5_1",
phys=>"clm6_0",
},
"force_send but not nuopc" =>{ options=>"-driver mct -lnd_frac $DOMFILE -envxml_dir .",
namelst=>"force_send_to_atm = .false.",
GLC_TWO_WAY_COUPLING=>"FALSE",
phys=>"clm5_1",
phys=>"clm6_0",
},
"branch but NO nrevsn" =>{ options=>"-clm_start_type branch -envxml_dir .",
namelst=>"",
Expand Down Expand Up @@ -965,7 +965,7 @@ sub cat_and_create_namelistinfile {
"useFATESWcrop" =>{ options=>"-bgc fates -envxml_dir . -no-megan -crop",
namelst=>"",
GLC_TWO_WAY_COUPLING=>"FALSE",
phys=>"clm5_1",
phys=>"clm6_0",
},
"useFATESWcreatecrop" =>{ options=>"-bgc fates -envxml_dir . -no-megan",
namelst=>"create_crop_landunit=.true.",
Expand All @@ -980,37 +980,37 @@ sub cat_and_create_namelistinfile {
"useFATESWbMH" =>{ options=>"-bgc fates -envxml_dir . -no-megan",
namelst=>"use_biomass_heat_storage=.true.",
GLC_TWO_WAY_COUPLING=>"FALSE",
phys=>"clm5_1",
phys=>"clm6_0",
},
"FireNoneButFATESfireon" =>{ options=>"-bgc fates -envxml_dir . -no-megan -light_res none",
namelst=>"fates_spitfire_mode=4",
GLC_TWO_WAY_COUPLING=>"FALSE",
phys=>"clm5_1",
phys=>"clm6_0",
},
"FATESwspitfireOffLigtOn" =>{ options=>"-bgc fates -envxml_dir . -no-megan -light_res 360x720",
namelst=>"fates_spitfire_mode=0",
GLC_TWO_WAY_COUPLING=>"FALSE",
phys=>"clm5_1",
phys=>"clm6_0",
},
"useFATESWluna" =>{ options=>"--bgc fates --envxml_dir . --no-megan",
namelst=>"use_luna=TRUE",
GLC_TWO_WAY_COUPLING=>"FALSE",
phys=>"clm5_1",
phys=>"clm6_0",
},
"useFATESWfun" =>{ options=>"--bgc fates --envxml_dir . --no-megan",
namelst=>"use_fun=TRUE",
GLC_TWO_WAY_COUPLING=>"FALSE",
phys=>"clm5_1",
phys=>"clm6_0",
},
"useFATESWOsuplnitro" =>{ options=>"--bgc fates --envxml_dir . --no-megan",
namelst=>"suplnitro='NONE'",
GLC_TWO_WAY_COUPLING=>"FALSE",
phys=>"clm5_1",
phys=>"clm6_0",
},
"FireNoneButBGCfireon" =>{ options=>"-bgc bgc -envxml_dir . -light_res none",
namelst=>"fire_method='li2021gswpfrc'",
GLC_TWO_WAY_COUPLING=>"FALSE",
phys=>"clm5_1",
phys=>"clm6_0",
},
"createcropFalse" =>{ options=>"-bgc bgc -envxml_dir . -no-megan",
namelst=>"create_crop_landunit=.false.",
Expand Down Expand Up @@ -1271,7 +1271,7 @@ sub cat_and_create_namelistinfile {
"methane off W nitrif_denit"=>{ options=>"-bgc bgc -envxml_dir .",
namelst=>"use_nitrif_denitrif=.true.,use_lch4=.false.",
GLC_TWO_WAY_COUPLING=>"FALSE",
phys=>"clm5_1",
phys=>"clm6_0",
},
"soilm_stream w transient" =>{ options=>"-res 0.9x1.25 -envxml_dir . -use_case 20thC_transient",
namelst=>"use_soil_moisture_streams=T,soilm_tintalgo='linear'",
Expand All @@ -1291,12 +1291,12 @@ sub cat_and_create_namelistinfile {
"FUN_wo_flexCN" =>{ options=>"-envxml_dir . -bgc bgc",
namelst=>"use_fun=.true.,use_flexiblecn=.false.",
GLC_TWO_WAY_COUPLING=>"FALSE",
phys=>"clm5_1",
phys=>"clm6_0",
},
"NotNEONbutNEONlightres" =>{ options=>"--res CLM_USRDAT --clm_usr_name regional --envxml_dir . --bgc bgc --light_res 106x174",
namelst=>"fsurdat='build-namelist_test.pl'",
GLC_TWO_WAY_COUPLING=>"FALSE",
phys=>"clm5_1",
phys=>"clm6_0",
},
);
foreach my $key ( keys(%warntest) ) {
Expand All @@ -1319,7 +1319,7 @@ sub cat_and_create_namelistinfile {
#
# Loop over all physics versions
#
foreach my $phys ( "clm4_5", "clm5_0", "clm5_1" ) {
foreach my $phys ( "clm4_5", "clm5_0", "clm5_1", "clm6_0" ) {
$mode = "-phys $phys";
&make_config_cache($phys);

Expand Down Expand Up @@ -1558,7 +1558,7 @@ sub cat_and_create_namelistinfile {
#
# Test ALL SSP's for f09...
#
$phys = "clm5_1";
$phys = "clm6_0";
$mode = "-phys $phys";
&make_config_cache($phys);
my $res = "0.9x1.25";
Expand Down Expand Up @@ -1594,10 +1594,10 @@ sub cat_and_create_namelistinfile {
}

print "\n==================================================\n";
print "Test clm4.5/clm5.0/clm5_1 resolutions \n";
print "Test clm4.5/clm5.0/clm5_1/clm6_0 resolutions \n";
print "==================================================\n";

foreach my $phys ( "clm4_5", 'clm5_0', 'clm5_1' ) {
foreach my $phys ( "clm4_5", 'clm5_0', 'clm5_1', "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",
Expand Down Expand Up @@ -1697,7 +1697,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' ) {
foreach my $phys ( "clm4_5", 'clm5_0', 'clm5_1', 'clm6_0' ) {
my $mode = "-phys $phys";
&make_config_cache($phys);
my @forclist = ();
Expand All @@ -1708,6 +1708,9 @@ sub cat_and_create_namelistinfile {
if ( $lndtuningmode eq "clm5_1_CRUv7" ) {
next;
}
if ( $lndtuningmode eq "clm6_0_CRUv7" ) {
next;
}
my $clmoptions = "-res $res -mask $mask -sim_year $simyr -envxml_dir . -lnd_tuning_mod $lndtuningmode -bgc $bgc";
&make_env_run( );
eval{ system( "$bldnml $clmoptions > $tempfile 2>&1 " ); };
Expand Down
3 changes: 2 additions & 1 deletion cime_config/SystemTests/mksurfdataesmf.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def build_phase(self, sharedlib_only=False, model_only=False):
nml_script_path = os.path.join(self._tool_path, "gen_mksurfdata_namelist")
gen_jobscript_path = os.path.join(self._tool_path, "gen_mksurfdata_jobscript_single")
gen_mksurfdata_namelist = f"{nml_script_path} --res {self._res} --start-year {self._model_yr} --end-year {self._model_yr}"
gen_mksurfdata_jobscript = f"{gen_jobscript_path} --number-of-nodes 1 --tasks-per-node 64 --namelist-file {self._fsurdat_namelist}"
gen_mksurfdata_jobscript = f"{gen_jobscript_path} --number-of-nodes 1 --tasks-per-node 64 --namelist-file {self._fsurdat_namelist} --bld-path {self._tool_bld}"

# Rm tool_bld and build executable that will generate fsurdat
try:
Expand All @@ -76,6 +76,7 @@ def build_phase(self, sharedlib_only=False, model_only=False):
try:
subprocess.check_call(f"{build_script_path} --blddir {self._tool_bld}", shell=True)
except subprocess.CalledProcessError as e:
print(f"build directory = {self._tool_bld}\n")
sys.exit(
f"{e} ERROR RUNNING {build_script_path}. DETAILS IN {self._TestStatus_log_path}"
)
Expand Down
Loading

0 comments on commit af3c7fb

Please sign in to comment.