Skip to content

Commit

Permalink
Merge remote-tracking branch 'escomp/master' into ctsm5.2_to_5.1.dev166
Browse files Browse the repository at this point in the history
  • Loading branch information
ekluzek committed Feb 2, 2024
2 parents 1e0bca4 + e611238 commit e4b769f
Show file tree
Hide file tree
Showing 32 changed files with 1,353 additions and 685 deletions.
1 change: 1 addition & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ e4d38681df23ccca0ae29581a45f8362574e0630
025d5e7c2e80263717fb029101d65cbbf261c3c4
a9d96219902cf609636886c7073a84407f450d9a
d866510188d26d51bcd6d37239283db690af7e82
0dcd0a3c1abcaffe5529f8d79a6bc34734b195c7
# Ran SystemTests and python/ctsm through black python formatter
5364ad66eaceb55dde2d3d598fe4ce37ac83a93c
8056ae649c1b37f5e10aaaac79005d6e3a8b2380
Expand Down
23 changes: 23 additions & 0 deletions .github/workflows/assign-to-project.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Auto Assign to Project(s)

on:
issues:
types: [opened, labeled]
pull_request:
types: [opened, labeled]
issue_comment:
types: [created]

jobs:
assign_high_priority:
runs-on: ubuntu-latest
name: Assign to High Priority project
steps:
- name: Assign issues and pull requests with priority-high label to project 25
uses: srggrs/[email protected]
if: |
contains(github.event.issue.labels.*.name, 'priority: high') ||
contains(github.event.pull_request.labels.*.name, 'priority: high')
with:
project: 'https://github.com/ESCOMP/CTSM/projects/25'
column_name: 'Needs triage'
2 changes: 1 addition & 1 deletion Externals_CLM.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
local_path = src/fates
protocol = git
repo_url = https://github.com/NGEET/fates
tag = sci.1.70.0_api.32.0.0
tag = sci.1.71.0_api.33.0.0
required = True

[externals_description]
Expand Down
30 changes: 27 additions & 3 deletions bld/CLMBuildNamelist.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1571,6 +1571,7 @@ sub process_namelist_inline_logic {
setup_logic_irrigate($opts, $nl_flags, $definition, $defaults, $nl);
setup_logic_start_type($opts, $nl_flags, $nl);
setup_logic_decomp_performance($opts, $nl_flags, $definition, $defaults, $nl);
setup_logic_roughness_methods($opts, $nl_flags, $definition, $defaults, $nl, $physv);
setup_logic_snicar_methods($opts, $nl_flags, $definition, $defaults, $nl);
setup_logic_snow($opts, $nl_flags, $definition, $defaults, $nl);
setup_logic_glacier($opts, $nl_flags, $definition, $defaults, $nl, $envxml_ref);
Expand Down Expand Up @@ -1636,7 +1637,7 @@ sub process_namelist_inline_logic {
###############################
# namelist group: tillage #
###############################
setup_logic_tillage($opts, $nl_flags, $definition, $defaults, $nl);
setup_logic_tillage($opts, $nl_flags, $definition, $defaults, $nl, $physv);

###############################
# namelist group: ch4par_in #
Expand Down Expand Up @@ -2005,6 +2006,25 @@ sub setup_logic_decomp_performance {

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

sub setup_logic_roughness_methods {
my ($opts, $nl_flags, $definition, $defaults, $nl, $physv) = @_;

add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'z0param_method',
'phys'=>$nl_flags->{'phys'} );

my $var = remove_leading_and_trailing_quotes( $nl->get_value("z0param_method") );
if ( $var ne "Meier2022" && $var ne "ZengWang2007" ) {
$log->fatal_error("$var is incorrect entry for the namelist variable z0param_method; expected Meier2022 or ZengWang2007");
}
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");
}
}
}
#-------------------------------------------------------------------------------

sub setup_logic_snicar_methods {
my ($opts, $nl_flags, $definition, $defaults, $nl) = @_;

Expand Down Expand Up @@ -2246,6 +2266,7 @@ sub setup_logic_crop_inparm {
'use_crop'=>$nl->get_value('use_crop') );

my $crop_residue_removal_frac = $nl->get_value('crop_residue_removal_frac');
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'crop_residue_removal_frac' );
if ( $crop_residue_removal_frac < 0.0 or $crop_residue_removal_frac > 1.0 ) {
$log->fatal_error("crop_residue_removal_frac must be in range [0, 1]");
}
Expand All @@ -2258,10 +2279,13 @@ sub setup_logic_crop_inparm {
#-------------------------------------------------------------------------------

sub setup_logic_tillage {
my ($opts, $nl_flags, $definition, $defaults, $nl) = @_;
my ($opts, $nl_flags, $definition, $defaults, $nl, $physv) = @_;

add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'tillage_mode',
'use_crop'=>$nl_flags->{'use_crop'}, 'phys'=>$physv->as_string() );

my $tillage_mode = remove_leading_and_trailing_quotes( $nl->get_value( "tillage_mode" ) );
if ( $tillage_mode ne "off" && $tillage_mode ne "" && not &value_is_true($nl->get_value('use_crop')) ) {
if ( $tillage_mode ne "off" && $tillage_mode ne "" && not &value_is_true($nl_flags->{'use_crop'}) ) {
$log->fatal_error( "Tillage only works on crop columns, so use_crop must be true if tillage is enabled." );
}
}
Expand Down
4 changes: 4 additions & 0 deletions bld/namelist_files/namelist_defaults_ctsm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -503,6 +503,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case).
<!-- ================================================================== -->

<z0param_method>ZengWang2007</z0param_method>
<z0param_method phys="clm5_1">Meier2022</z0param_method>

<use_z0m_snowmelt z0param_method="Meier2022" >.true.</use_z0m_snowmelt>
<use_z0m_snowmelt >.false.</use_z0m_snowmelt>
Expand Down Expand Up @@ -558,6 +559,7 @@ attributes from the config_cache.xml file (with keys converted to upper-case).
<use_grainproduct use_crop=".true." phys="clm5_1" >.true.</use_grainproduct> <!-- 1-year grain product pool default to on for clm50 if crop is turned on -->

<crop_residue_removal_frac>0.d+0</crop_residue_removal_frac>
<crop_residue_removal_frac phys="clm5_1">0.5d00</crop_residue_removal_frac>

<!-- Crop model options -->
<baset_mapping use_crop=".true." phys="clm4_5" >constant</baset_mapping>
Expand Down Expand Up @@ -2037,6 +2039,8 @@ lnd/clm2/surfdata_esmf/NEON/surfdata_1x1_NEON_TOOL_hist_78pfts_CMIP6_simyr2000_c
<!-- ========================================= -->

<tillage_mode>off</tillage_mode>
<tillage_mode use_crop=".true." phys="clm5_1">low</tillage_mode>

<use_original_tillage_phases>.false.</use_original_tillage_phases>
<max_tillage_depth>0.26d00</max_tillage_depth>

Expand Down
1 change: 1 addition & 0 deletions cime_config/buildlib
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ def _main_func():
os.path.join(lnd_root, "src", "fates", "biogeochem"),
os.path.join(lnd_root, "src", "fates", "fire"),
os.path.join(lnd_root, "src", "fates", "parteh"),
os.path.join(lnd_root, "src", "fates", "radiation"),
os.path.join(lnd_root, "src", "utils"),
os.path.join(lnd_root, "src", "cpl"),
os.path.join(lnd_root, "src", "cpl", "utils"),
Expand Down
28 changes: 28 additions & 0 deletions cime_config/testdefs/ExpectedTestFails.xml
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,13 @@

<!-- fates test suite failures -->

<test name="SMS_D_Ld3.f09_g17.I2000Clm51FatesSpCruRsGs.derecho_gnu.clm-FatesColdSatPhen_prescribed">
<phase name="RUN">
<status>FAIL</status>
<issue>#2321</issue>
</phase>
</test>

<test name="ERS_D_Ld5.1x1_brazil.I2000Clm50FatesCruRsGs.izumi_nag.clm-FatesColdHydro">
<phase name="COMPARE_base_rest">
<status>FAIL</status>
Expand Down Expand Up @@ -221,4 +228,25 @@
</phase>
</test>

<test name="ERS_D_Ld15.f45_f45_mg37.I2000Clm50FatesRs.derecho_intel.clm-FatesColdTwoStream">
<phase name="COMPARE_base_rest">
<status>FAIL</status>
<issue>#2325</issue>
</phase>
</test>

<test name="ERS_D_Ld15.f45_f45_mg37.I2000Clm50FatesRs.izumi_nag.clm-FatesColdTwoStream">
<phase name="COMPARE_base_rest">
<status>FAIL</status>
<issue>#2325</issue>
</phase>
</test>

<test name="ERS_D_Ld15.f45_f45_mg37.I2000Clm50FatesRs.derecho_gnu.clm-FatesColdTwoStreamNoCompFixedBioGeo">
<phase name="COMPARE_base_rest">
<status>FAIL</status>
<issue>#2325</issue>
</phase>
</test>

</expectedFails>
29 changes: 25 additions & 4 deletions cime_config/testdefs/testlist_clm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2792,6 +2792,26 @@
<option name="comment" >Ensure functionality of the tree damage option in FATES</option>
</options>
</test>
<test name="ERS_D_Ld15" grid="f45_f45_mg37" compset="I2000Clm50FatesRs" testmods="clm/FatesColdTwoStream">
<machines>
<machine name="derecho" compiler="intel" category="fates"/>
<machine name="derecho" compiler="intel" category="aux_clm"/>
<machine name="izumi" compiler="nag" category="aux_clm"/>
</machines>
<options>
<option name="wallclock">00:30:00</option>
<option name="comment" >Ensure functionality of two-stream radiation option in FATES</option>
</options>
</test>
<test name="ERS_D_Ld15" grid="f45_f45_mg37" compset="I2000Clm50FatesRs" testmods="clm/FatesColdTwoStreamNoCompFixedBioGeo">
<machines>
<machine name="derecho" compiler="gnu" category="fates"/>
</machines>
<options>
<option name="wallclock">00:30:00</option>
<option name="comment" >Ensure functionality of two-stream radiation option with nocomp-fixedbiogeo in FATES</option>
</options>
</test>
<test name="ERS_D_Ld3_PS" grid="f09_g17" compset="I2000Clm50FatesRs" testmods="clm/FatesCold">
<machines>
<machine name="cheyenne" compiler="intel" category="aux_clm"/>
Expand Down Expand Up @@ -3384,13 +3404,13 @@
</options>
</test>

<test name="SMS_Ld3" grid="f09_g17" compset="I2000Clm51FatesSpCruRsGs" testmods="clm/FatesColdSatPhen_prescribed">
<test name="SMS_D_Ld3" grid="f09_g17" compset="I2000Clm51FatesSpCruRsGs" testmods="clm/FatesColdSatPhen_prescribed">
<machines>
<machine name="cheyenne" compiler="intel" category="fates"/>
<machine name="derecho" compiler="intel" category="fates"/>
<machine name="cheyenne" compiler="gnu" category="fates"/>
<machine name="derecho" compiler="gnu" category="fates"/>
</machines>
<options>
<option name="wallclock">00:20:00</option>
<option name="wallclock">00:30:00</option>
<option name="comment">Test with prescribed LAI and soil moisture with FatesSP mode</option>
</options>
</test>
Expand Down Expand Up @@ -3713,6 +3733,7 @@
<machines>
<machine name="cheyenne" compiler="intel" category="aux_clm"/>
<machine name="derecho" compiler="intel" category="aux_clm"/>
<machine name="izumi" compiler="intel" category="aux_clm"/>
</machines>
<options>
<option name="wallclock">00:30:00</option>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ hist_fincl1 = 'FATES_CROWNAREA_PF', 'FATES_CANOPYCROWNAREA_PF',
'FATES_FABI_SUN_CLLLPF', 'FATES_FABI_SHA_CLLLPF', 'FATES_FABD_SUN_CLLL',
'FATES_FABD_SHA_CLLL', 'FATES_FABI_SUN_CLLL', 'FATES_FABI_SHA_CLLL',
'FATES_PARPROF_DIR_CLLLPF', 'FATES_PARPROF_DIF_CLLLPF',
'FATES_PARPROF_DIR_CLLL', 'FATES_PARPROF_DIF_CLLL', 'FATES_FABD_SUN_TOPLF_CL',
'FATES_FABD_SUN_TOPLF_CL',
'FATES_FABD_SHA_TOPLF_CL', 'FATES_FABI_SUN_TOPLF_CL', 'FATES_FABI_SHA_TOPLF_CL',
'FATES_NET_C_UPTAKE_CLLL', 'FATES_CROWNAREA_CLLL', 'FATES_NPLANT_CANOPY_SZAP',
'FATES_NPLANT_USTORY_SZAP', 'FATES_DDBH_CANOPY_SZAP', 'FATES_DDBH_USTORY_SZAP',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
SRCDIR=`./xmlquery SRCROOT --value`
CASEDIR=`./xmlquery CASEROOT --value`
FATESROOT=$SRCDIR/src/fates/
FATESPARAMFILE=$FATESROOT/parameter_files/fates_params_seeddisp_4x5.nc
FATESDIR=$SRCDIR/src/fates/
FATESPARAMFILE=$SRCDIR/fates_params_seeddisp_4x5.nc

ncgen -o $FATESPARAMFILE $FATESROOT/parameter_files/fates_params_default.cdl
ncgen -o $FATESPARAMFILE $FATESDIR/parameter_files/fates_params_default.cdl

$FATESROOT/tools/modify_fates_paramfile.py --O --fin $FATESPARAMFILE --fout $FATESPARAMFILE --var fates_seed_dispersal_fraction --val 0.2 --allpfts
$FATESROOT/tools/modify_fates_paramfile.py --O --fin $FATESPARAMFILE --fout $FATESPARAMFILE --var fates_seed_dispersal_max_dist --val 2500000 --allpfts
$FATESROOT/tools/modify_fates_paramfile.py --O --fin $FATESPARAMFILE --fout $FATESPARAMFILE --var fates_seed_dispersal_pdf_scale --val 1e-05 --allpfts
$FATESROOT/tools/modify_fates_paramfile.py --O --fin $FATESPARAMFILE --fout $FATESPARAMFILE --var fates_seed_dispersal_pdf_shape --val 0.1 --allpfts
$FATESDIR/tools/modify_fates_paramfile.py --O --fin $FATESPARAMFILE --fout $FATESPARAMFILE --var fates_seed_dispersal_fraction --val 0.2 --allpfts
$FATESDIR/tools/modify_fates_paramfile.py --O --fin $FATESPARAMFILE --fout $FATESPARAMFILE --var fates_seed_dispersal_max_dist --val 2500000 --allpfts
$FATESDIR/tools/modify_fates_paramfile.py --O --fin $FATESPARAMFILE --fout $FATESPARAMFILE --var fates_seed_dispersal_pdf_scale --val 1e-05 --allpfts
$FATESDIR/tools/modify_fates_paramfile.py --O --fin $FATESPARAMFILE --fout $FATESPARAMFILE --var fates_seed_dispersal_pdf_shape --val 0.1 --allpfts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
fates_paramfile = '$SRCROOT/src/fates/parameter_files/fates_params_seeddisp_4x5.nc'
fates_paramfile = '$SRCROOT/fates_params_seeddisp_4x5.nc'
fates_seeddisp_cadence = 1
hist_fincl1 = 'FATES_SEEDS_IN_GRIDCELL_PF', 'FATES_SEEDS_OUT_GRIDCELL_PF'
15 changes: 15 additions & 0 deletions cime_config/testdefs/testmods_dirs/clm/FatesColdTwoStream/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Testing FATES two-stream radiation scheme is activated by switching the fates_rad_model
parameter from 1 to 2. This is all that is needed, both radiation schemes
1) Norman and 2) two-stream use the same optical parameters.

fates_rad_model

Note that to avoid exceeding the filename string length maximum, the parameter
file generated on the fly is placed in the $SRCROOT/src/fates/parameter_files
directory. This may still run into problems is the $SRCROOT string is too long.

Like the test with seed dispersal activation, the main downside of this method is
that this file will require a custom update for every fates parameter file API update.
Addressing CTSM issue #2126 will alleviate
this issue as it will provide the capability to build the fates parameter file on
the fly which with the appropriate values for this test.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
../FatesCold
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
SRCDIR=`./xmlquery SRCROOT --value`
CASEDIR=`./xmlquery CASEROOT --value`
FATESDIR=$SRCDIR/src/fates
FATESPARAMFILE=$CASEDIR/fates_params_twostream.nc

ncgen -o $FATESPARAMFILE $FATESDIR/parameter_files/fates_params_default.cdl

$FATESDIR/tools/modify_fates_paramfile.py --O --fin $FATESPARAMFILE --fout $FATESPARAMFILE --var fates_rad_model --val 2 --allpfts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
fates_paramfile = '$CASEROOT/fates_params_twostream.nc'
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
This tests two-stream radiation crossed with fixed biogeography and nocomp, for
a description of how two-stream is turned on for tests see
FatesColdTwoStream/README
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
../FatesColdNoComp
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
SRCDIR=`./xmlquery SRCROOT --value`
CASEDIR=`./xmlquery CASEROOT --value`
FATESDIR=$SRCDIR/src/fates
FATESPARAMFILE=$CASEDIR/fates_params_twostream.nc

ncgen -o $FATESPARAMFILE $FATESDIR/parameter_files/fates_params_default.cdl

$FATESDIR/tools/modify_fates_paramfile.py --O --fin $FATESPARAMFILE --fout $FATESPARAMFILE --var fates_rad_model --val 2 --allpfts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
fates_paramfile = '$CASEROOT/fates_params_twostream.nc'
use_fates_fixed_biogeog=.true.
Loading

0 comments on commit e4b769f

Please sign in to comment.