Skip to content

Commit

Permalink
Merge tag 'ctsm5.3.008' into matrixcnon-no-include
Browse files Browse the repository at this point in the history
PPE change to sa_leaf in CanopyFluxesMod.F90

Add change to sa_leaf that was in PPE branch but did not get on master.

Larger than roundoff changes in answers are explained in this post
ESCOMP#2777 (comment)
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
  • Loading branch information
samsrabin committed Oct 15, 2024
2 parents 5f9d597 + f726adb commit 207364f
Show file tree
Hide file tree
Showing 26 changed files with 732 additions and 370 deletions.
7 changes: 5 additions & 2 deletions bld/CLMBuildNamelist.pm
Original file line number Diff line number Diff line change
Expand Up @@ -2759,8 +2759,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
Expand Down Expand Up @@ -3637,6 +3636,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" );
}
}

#-------------------------------------------------------------------------------
Expand Down
285 changes: 81 additions & 204 deletions bld/namelist_files/namelist_defaults_ctsm.xml

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions bld/namelist_files/namelist_definition_ctsm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -962,6 +962,11 @@ Full pathname datafile with fates parameters
Full pathname of surface data file.
</entry>

<entry id="hillslope_file" type="char*256" category="datasets"
input_pathname="abs" group="clm_inparm" valid_values="" >
Full pathname of hillslope data file.
</entry>

<entry id="fsnowoptics" type="char*256" category="datasets"
input_pathname="abs" group="clm_inparm" valid_values="" >
SNICAR (SNow, ICe, and Aerosol Radiative model) optical data file name
Expand Down
27 changes: 25 additions & 2 deletions bld/unit_testers/build-namelist_test.pl
Original file line number Diff line number Diff line change
Expand Up @@ -1287,6 +1287,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"};
Expand Down Expand Up @@ -1359,13 +1366,21 @@ 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",
},
);
foreach my $key ( keys(%warntest) ) {
print( "$key\n" );

my $var;
foreach $var ( "phys" , "options", "namelst" ) {
if ( not exists $warntest{$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"};
Expand Down Expand Up @@ -1595,6 +1610,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 $finidat_files{$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);
Expand Down
6 changes: 5 additions & 1 deletion cime_config/config_component.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<desc lnd="CLM45[%SP][%SP-VIC][%BGC][%BGC-CROP][%FATES][%BGCDV][%BGCDV-CROP]" >clm4.5:</desc>
<desc lnd="CLM50[%SP][%SP-VIC][%SP-NOANTHRO][%BGC-NOANTHRO][%BGC][%BGC-CROP][%FATES][%BGCDV][%BGCDV-CROP][%BGC-CROP-CMIP6DECK][%BGC-CROP-CMIP6WACCMDECK][%NWP-SP][%NWP-BGC-CROP]">clm5.0:</desc>
<desc lnd="CLM51[%SP][%SP-NOANTHRO][%BGC-NOANTHRO][%BGC][%BGC-CROP][%FATES][%FATES-SP][%NWP-SP][%NWP-BGC-CROP]">clm5.1:</desc>
<desc lnd="CLM60[%SP][%SP-NOANTHRO][%BGC-NOANTHRO][%BGC][%BGC-CROP][%FATES][%FATES-SP][%NWP-SP][%NWP-BGC-CROP]">clm6.0:</desc>
<desc lnd="CLM60[%SP][%SP-NOANTHRO][%BGC-NOANTHRO][%BGC][%BGC-CROP][%FATES][%FATES-SP][%BGC-CROP-CMIP6DECK][%BGC-CROP-CMIP6WACCMDECK][%NWP-SP][%NWP-BGC-CROP]">clm6.0:</desc>
<desc option="SP" >Satellite phenology:</desc>

<desc option="SP-VIC" >Satellite phenology with VIC hydrology:</desc>
Expand Down Expand Up @@ -371,6 +371,10 @@
<value grid="l%1.9x2.5" compset="_CLM50%[^_]*CMIP6DECK[%_]" >$COMP_ROOT_DIR_LND/cime_config/usermods_dirs/cmip6_nociso_deck</value>
<value compset="_CLM50%[^_]*CMIP6WACCMDECK[%_]">$COMP_ROOT_DIR_LND/cime_config/usermods_dirs/cmip6_waccm_deck</value>
<value grid="l%1.9x2.5" compset="_CLM50%[^_]*CMIP6WACCMDECK[%_]">$COMP_ROOT_DIR_LND/cime_config/usermods_dirs/cmip6_waccm_nociso_deck</value>
<value compset="_CLM60%[^_]*CMIP6DECK[%_]" >$COMP_ROOT_DIR_LND/cime_config/usermods_dirs/cmip6_deck</value>
<value grid="l%1.9x2.5" compset="_CLM60%[^_]*CMIP6DECK[%_]" >$COMP_ROOT_DIR_LND/cime_config/usermods_dirs/cmip6_nociso_deck</value>
<value compset="_CLM60%[^_]*CMIP6WACCMDECK[%_]">$COMP_ROOT_DIR_LND/cime_config/usermods_dirs/cmip6_waccm_deck</value>
<value grid="l%1.9x2.5" compset="_CLM60%[^_]*CMIP6WACCMDECK[%_]">$COMP_ROOT_DIR_LND/cime_config/usermods_dirs/cmip6_waccm_nociso_deck</value>
</values>
<group>run_component_ctsm</group>
<file>env_case.xml</file>
Expand Down
8 changes: 8 additions & 0 deletions cime_config/config_compsets.xml
Original file line number Diff line number Diff line change
Expand Up @@ -200,13 +200,21 @@
<alias>I1850Clm50BgcCropCmip6</alias>
<lname>1850_DATM%GSWP3v1_CLM50%BGC-CROP-CMIP6DECK_SICE_SOCN_MOSART_SGLC_SWAV</lname>
</compset>
<compset>
<alias>I1850Clm60BgcCropCmip6</alias>
<lname>1850_DATM%GSWP3v1_CLM60%BGC-CROP-CMIP6DECK_SICE_SOCN_MOSART_SGLC_SWAV</lname>
</compset>

<!-- Primarily for testing the CMIP6WACCMDECK compset option -->
<!-- Use the CMIP6 version (clm5_0) -->
<compset>
<alias>I1850Clm50BgcCropCmip6waccm</alias>
<lname>1850_DATM%GSWP3v1_CLM50%BGC-CROP-CMIP6WACCMDECK_SICE_SOCN_MOSART_SGLC_SWAV</lname>
</compset>
<compset>
<alias>I1850Clm60BgcCropCmip6waccm</alias>
<lname>1850_DATM%GSWP3v1_CLM60%BGC-CROP-CMIP6WACCMDECK_SICE_SOCN_MOSART_SGLC_SWAV</lname>
</compset>

<!-- clm5_0 (CMIP6) version with BGC-Crop and CRU forcing -->
<compset>
Expand Down
25 changes: 18 additions & 7 deletions cime_config/testdefs/ExpectedTestFails.xml
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,17 @@
</phase>
</test>

<test name="SMS_Ld10_D_Mmpi-serial.CLM_USRDAT.I1PtClm60Bgc.izumi_nag.clm-NEON-MOAB--clm-PRISM">
<phase name="SHAREDLIB_BUILD">
<status>FAIL</status>
<issue>#2310</issue>
</phase>
<phase name="RUN">
<status>FAIL</status>
<issue>#2310</issue>
</phase>
</test>

<test name="SMS_Ld10_D_Mmpi-serial.CLM_USRDAT.I1PtClm60Fates.derecho_gnu.clm-FatesPRISM--clm-NEON-FATES-YELL">
<phase name="SHAREDLIB_BUILD">
<status>FAIL</status>
Expand Down Expand Up @@ -171,6 +182,13 @@
</phase>
</test>

<test name="SMS_Lm3_D_Mmpi-serial.1x1_brazil.I2000Clm50FatesCruRsGs.izumi_intel.clm-FatesColdHydro">
<phase name="CREATE_NEWCASE">
<status>FAIL</status>
<issue>#2454</issue>
</phase>
</test>

<test name="SMS_Ld10_D_Mmpi-serial.CLM_USRDAT.I1PtClm60Fates.izumi_nag.clm-FatesFireLightningPopDens--clm-NEON-FATES-NIWO">
<phase name="SHAREDLIB_BUILD">
<status>FAIL</status>
Expand Down Expand Up @@ -245,13 +263,6 @@
</phase>
</test>

<test name="SMS_D_Ld5.5x5_amazon.I1850Clm51Bgc.derecho_gnu.clm-HillslopeC">
<phase name="RUN">
<status>FAIL</status>
<issue>#2423</issue>
</phase>
</test>

<test name="ERS_D_Ld15.f45_f45_mg37.I2000Clm50FatesRs.derecho_intel.clm-FatesColdTwoStream">
<phase name="COMPARE_base_rest">
<status>FAIL</status>
Expand Down
21 changes: 11 additions & 10 deletions cime_config/testdefs/testlist_clm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1768,7 +1768,7 @@
<option name="comment" >Repeat ERS_Ly20_Mmpi-serial...cropMonthlyNoinitial test with matrixcnOn</option>
</options>
</test>
<test name="ERS_Ly3" grid="f10_f10_mg37" compset="I1850Clm50BgcCropCmip6" testmods="clm/basic">
<test name="ERS_Ly3" grid="f10_f10_mg37" compset="I1850Clm60BgcCropCmip6" testmods="clm/basic">
<machines>
<machine name="derecho" compiler="intel" category="aux_clm"/>
</machines>
Expand Down Expand Up @@ -1810,7 +1810,7 @@
<machine name="derecho" compiler="intel" category="matrixcn"/>
</machines>
<options>
<option name="wallclock">01:40:00</option>
<option name="wallclock">02:30:00</option>
<option name="comment" >Repeat ERS_Ly5_P128x1...cropMonthOutput test with matrixcnOn</option>
</options>
</test>
Expand Down Expand Up @@ -2030,7 +2030,7 @@
<option name="comment" >Simple test to make sure the basic Fates-SP compset works"</option>
</options>
</test>
<test name="SMS_D_Ld1" grid="ne30pg3_t061" compset="I1850Clm50BgcSpinup" testmods="clm/cplhist">
<test name="SMS_D_Ld1" grid="ne30pg3_t232" compset="I1850Clm50BgcSpinup" testmods="clm/cplhist">
<machines>
<machine name="derecho" compiler="intel" category="aux_clm"/>
<machine name="derecho" compiler="intel" category="prealpha"/>
Expand All @@ -2039,7 +2039,7 @@
<option name="wallclock">00:20:00</option>
</options>
</test>
<test name="SMS_D_Ld1" grid="ne30pg3_t061" compset="I1850Clm50BgcSpinup" testmods="clm/cplhist--clm/matrixcnOn">
<test name="SMS_D_Ld1" grid="ne30pg3_t232" compset="I1850Clm50BgcSpinup" testmods="clm/cplhist--clm/matrixcnOn">
<machines>
<machine name="derecho" compiler="intel" category="aux_clm"/>
<machine name="derecho" compiler="intel" category="prealpha"/>
Expand Down Expand Up @@ -2479,7 +2479,7 @@
<option name="comment" >include a production intel test of Clm45</option>
</options>
</test>
<test name="SMS_Ld2_D_PS" grid="f09_g17" compset="I1850Clm50BgcCropCmip6" testmods="clm/basic_interp">
<test name="SMS_Ld2_D_PS" grid="f09_g17" compset="I1850Clm60BgcCropCmip6" testmods="clm/basic_interp">
<machines>
<machine name="derecho" compiler="intel" category="aux_clm"/>
</machines>
Expand Down Expand Up @@ -3312,7 +3312,7 @@
<option name="comment">12 month exact restart FATES single site debug test covering anthropogenic fire ignition mode.</option>
</options>
</test>
<test name="SMS_Lm1" grid="f10_f10_mg37" compset="I1850Clm50BgcCropCmip6waccm" testmods="clm/basic">
<test name="SMS_Lm1" grid="f10_f10_mg37" compset="I1850Clm60BgcCropCmip6waccm" testmods="clm/basic">
<machines>
<machine name="derecho" compiler="gnu" category="aux_clm"/>
<machine name="derecho" compiler="gnu" category="prealpha"/>
Expand Down Expand Up @@ -3562,23 +3562,24 @@
</options>
</test>

<test name="SMS_D_Mmpi-serial_Ld5" grid="5x5_amazon" compset="I1850Clm60Bgc" testmods="clm/HillslopeC">
<test name="SMS_D_Mmpi-serial_Ld5" grid="5x5_amazon" compset="I2000Clm60Bgc" testmods="clm/HillslopeC">
<machines>
<machine name="derecho" compiler="gnu" category="aux_clm"/>
<machine name="derecho" compiler="gnu" category="hillslope"/>
</machines>
<options>
<option name="wallclock">00:20:00</option>
<option name="comment">Serial test of 5x5_amazon hillslopes</option>
</options>
</test>

<test name="SMS_D_Ld5" grid="5x5_amazon" compset="I1850Clm60Bgc" testmods="clm/HillslopeC">
<test name="SMS_D_Ld5" grid="5x5_amazon" compset="I2000Clm60Bgc" testmods="clm/HillslopeC">
<machines>
<machine name="derecho" compiler="gnu" category="aux_clm"/>
<machine name="derecho" compiler="gnu" category="hillslope"/>
</machines>
<options>
<option name="wallclock">00:20:00</option>
<option name="comment">Add a non-FATES test to aux_clm for 5x5_amazon that fails because of the ccs_config issue, can remove once this passes</option>
<option name="comment">Parallel test of 5x5_amazon hillslopes</option>
</options>
</test>

Expand Down
16 changes: 14 additions & 2 deletions cime_config/testdefs/testmods_dirs/clm/Hillslope/shell_commands
Original file line number Diff line number Diff line change
@@ -1,7 +1,19 @@
./xmlchange CLM_BLDNML_OPTS="-bgc sp"
DIN_LOC_ROOT=$(./xmlquery --value DIN_LOC_ROOT)
meshfile=$DIN_LOC_ROOT/lnd/clm2/testdata/ESMFmesh_10x15_synthetic_cosphill_1.0.nc
./xmlchange ATM_DOMAIN_MESH=${meshfile},LND_DOMAIN_MESH=${meshfile}

# 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
# 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
exit 1
fi
echo -e "hillslope_file = '${hillslope_file}'\n" >> user_nl_clm

# -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
2 changes: 0 additions & 2 deletions cime_config/testdefs/testmods_dirs/clm/Hillslope/user_nl_clm
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,4 @@ hillslope_transmissivity_method = 'LayerSum'
hillslope_pft_distribution_method = 'PftLowlandUpland'
hillslope_soil_profile_method = 'Uniform'

fsurdat = '$DIN_LOC_ROOT/lnd/clm2/surfdata_esmf/ctsm5.3.0/synthetic/surfdata_10x15_hist_2000_78pfts_c240905.synthetic_hillslopes3.nc'

use_ssre = .false.
Loading

0 comments on commit 207364f

Please sign in to comment.