Skip to content

Commit 4af8cbc

Browse files
committed
Merge tag 'ctsm5.3.060' into merge-b4bdev-20250625
Preliminary update of ctsm54 defaults (answer changing) Allows running coupled without having to adjust clm things manually. In particular, updates namelist defaults, including new IC files, that have been limited to the ctsm5.4 branch so far.
2 parents 2408ba6 + 7788b6b commit 4af8cbc

File tree

59 files changed

+1887
-379
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+1887
-379
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/usr/bin/env bash
2+
set -e
3+
4+
# Check that clm6* compset aliases return CLM6* longnames
5+
6+
# Change to top level of clone
7+
cd "$(git rev-parse --show-toplevel)"
8+
9+
# Check that query_config can run without error
10+
cime/scripts/query_config --compsets 1>/dev/null
11+
12+
# Find bad compsets
13+
OLD_IFS=$IFS
14+
IFS='\n'
15+
set +e
16+
# Relies on case sensitivity here: Alias should have Clm6 and longname should have CLM6
17+
bad_compsets="$(cime/scripts/query_config --compsets | sort | uniq | grep Clm6 | grep -v CLM6)"
18+
set -e
19+
if [[ "${bad_compsets}" != "" ]]; then
20+
echo "One or more compsets with Clm6 alias but not CLM6 longname:" >&2
21+
echo $bad_compsets >&2
22+
exit 1
23+
fi
24+
25+
exit 0
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Check that clm6* compset aliases return CLM6* longnames
2+
# Only check files in our repo that AREN'T in submodules
3+
# Use a Python command to check each file because xmllint isn't available on GH runners
4+
5+
on:
6+
push:
7+
# Run when a change to these files is pushed to any branch. Without the "branches:" line, for some reason this will be run whenever a tag is pushed, even if the listed files aren't changed.
8+
branches: ['*']
9+
paths:
10+
- '.github/workflows/check-clm6-aliases.sh'
11+
- 'cime/**'
12+
- 'cime_config/config_compsets.xml'
13+
14+
pull_request:
15+
# Run on pull requests that change the listed files
16+
paths:
17+
- '.github/workflows/check-clm6-aliases.sh'
18+
- 'cime/**'
19+
- 'cime_config/config_compsets.xml'
20+
21+
workflow_dispatch:
22+
23+
jobs:
24+
check-clm6-aliases:
25+
runs-on: ubuntu-latest
26+
steps:
27+
- name: Checkout repository
28+
uses: actions/checkout@v4
29+
30+
- name: Checkout submodules
31+
run: |
32+
bin/git-fleximod update
33+
34+
- name: Install xmllint for CIME
35+
run: |
36+
sudo apt-get update && sudo apt-get install --no-install-recommends -y libxml2-utils
37+
38+
- name: Check aliases
39+
run: |
40+
.github/workflows/check-clm6-aliases.sh

.gitmodules

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ fxrequired = ToplevelRequired
5858
fxDONOTUSEurl = https://github.com/ESCOMP/MOSART
5959

6060
[submodule "mizuRoute"]
61-
path = components/mizuRoute
62-
url = https://github.com/ESCOMP/mizuRoute
61+
path = components/mizuroute
62+
url = https://github.com/ESCOMP/mizuRoute
6363
fxtag = cesm-coupling.n03_v2.2.0
6464
fxrequired = ToplevelRequired
6565
# Standard Fork to compare to with "git fleximod test" to ensure personal forks aren't committed

README

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ components/cmeps -------------------- CESM top level driver (for NUOPC driver [w
6666
components/cdeps -------------------- CESM top level data model shared code (for NUOPC driver).
6767
components/cism --------------------- CESM Community land Ice Sheet Model.
6868
components/mosart ------------------- Model for Scale Adaptive River Transport
69-
components/mizuRoute ---------------- Reached based river transport model for water routing
69+
components/mizuroute ---------------- Reached based river transport model for water routing
7070
(allows both gridded river and Hydrologic Responce Unit river grids)
7171
components/rtm ---------------------- CESM River Transport Model.
7272

bld/CLMBuildNamelist.pm

Lines changed: 64 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1688,6 +1688,7 @@ sub process_namelist_inline_logic {
16881688
setup_logic_cnmatrix($opts, $nl_flags, $definition, $defaults, $nl, $envxml_ref);
16891689
setup_logic_spinup($opts, $nl_flags, $definition, $defaults, $nl);
16901690
setup_logic_supplemental_nitrogen($opts, $nl_flags, $definition, $defaults, $nl);
1691+
setup_logic_c_isotope($opts, $nl_flags, $definition, $defaults, $nl);
16911692
setup_logic_snowpack($opts, $nl_flags, $definition, $defaults, $nl);
16921693
setup_logic_fates($opts, $nl_flags, $definition, $defaults, $nl);
16931694
setup_logic_z0param($opts, $nl_flags, $definition, $defaults, $nl);
@@ -1737,7 +1738,6 @@ sub process_namelist_inline_logic {
17371738
# namelist group: ch4par_in #
17381739
###############################
17391740
setup_logic_methane($opts, $nl_flags, $definition, $defaults, $nl);
1740-
setup_logic_c_isotope($opts, $nl_flags, $definition, $defaults, $nl);
17411741

17421742
###############################
17431743
# namelist group: ndepdyn_nml #
@@ -3175,10 +3175,11 @@ sub setup_logic_do_grossunrep {
31753175

31763176
my $var = 'do_grossunrep';
31773177

3178-
# Start by assuming a default value of '.true.'. Then check a number of
3178+
# Start by assuming a default value of '.false.'. Then check a number of
31793179
# conditions under which do_grossunrep cannot be true. Under these
3180-
# conditions: (1) set default value to '.false.'; (2) make sure that the
3180+
# conditions: (1) set default value to '.false.' again; (2) make sure that the
31813181
# value is indeed false (e.g., that the user didn't try to set it to true).
3182+
# Ideally the default value would be set in namelist_defaults
31823183

31833184
my $default_val = ".false.";
31843185

@@ -3703,63 +3704,53 @@ sub setup_logic_c_isotope {
37033704
#
37043705
my ($opts, $nl_flags, $definition, $defaults, $nl) = @_;
37053706

3707+
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'use_c13', 'bgc_mode'=>$nl_flags->{'bgc_mode'}, 'phys'=>$nl_flags->{'phys'});
3708+
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'use_c14', 'bgc_mode'=>$nl_flags->{'bgc_mode'}, 'phys'=>$nl_flags->{'phys'});
37063709
my $use_c13 = $nl->get_value('use_c13');
37073710
my $use_c14 = $nl->get_value('use_c14');
37083711
if ( $nl_flags->{'bgc_mode'} ne "sp" && $nl_flags->{'bgc_mode'} ne "fates" ) {
37093712
if ( $nl_flags->{'bgc_mode'} ne "bgc" ) {
3710-
if ( defined($use_c13) && &value_is_true($use_c13) ) {
3713+
if ( &value_is_true($use_c13) ) {
37113714
$log->warning("use_c13 is ONLY scientifically validated with the bgc=BGC configuration" );
37123715
}
3713-
if ( defined($use_c14) && &value_is_true($use_c14) ) {
3716+
if ( &value_is_true($use_c14) ) {
37143717
$log->warning("use_c14 is ONLY scientifically validated with the bgc=BGC configuration" );
37153718
}
37163719
}
3717-
if ( defined($use_c14) ) {
3718-
if ( &value_is_true($use_c14) ) {
3719-
my $use_c14_bombspike = $nl->get_value('use_c14_bombspike');
3720-
if ( defined($use_c14_bombspike) && &value_is_true($use_c14_bombspike) ) {
3721-
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'atm_c14_filename',
3722-
'use_c14'=>$use_c14, 'use_cn'=>$nl_flags->{'use_cn'}, 'use_c14_bombspike'=>$nl->get_value('use_c14_bombspike'),
3723-
'ssp_rcp'=>$nl_flags->{'ssp_rcp'} );
3724-
}
3725-
} else {
3726-
if ( defined($nl->get_value('use_c14_bombspike')) ||
3727-
defined($nl->get_value('atm_c14_filename')) ) {
3728-
$log->fatal_error("use_c14 is FALSE and use_c14_bombspike or atm_c14_filename set");
3729-
}
3720+
if ( &value_is_true($use_c14) ) {
3721+
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'use_c14_bombspike', 'bgc_mode'=>$nl_flags->{'bgc_mode'}, 'phys'=>$nl_flags->{'phys'});
3722+
my $use_c14_bombspike = $nl->get_value('use_c14_bombspike');
3723+
if ( &value_is_true($use_c14_bombspike) ) {
3724+
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'atm_c14_filename',
3725+
'use_c14'=>$use_c14, 'use_cn'=>$nl_flags->{'use_cn'}, 'use_c14_bombspike'=>$nl->get_value('use_c14_bombspike'),
3726+
'ssp_rcp'=>$nl_flags->{'ssp_rcp'} );
37303727
}
37313728
} else {
37323729
if ( defined($nl->get_value('use_c14_bombspike')) ||
37333730
defined($nl->get_value('atm_c14_filename')) ) {
3734-
$log->fatal_error("use_c14 NOT set to .true., but use_c14_bompspike/atm_c14_filename defined.");
3731+
$log->fatal_error("use_c14 is FALSE and use_c14_bombspike or atm_c14_filename set");
37353732
}
37363733
}
3737-
if ( defined($use_c13) ) {
3738-
if ( &value_is_true($use_c13) ) {
3739-
my $use_c13_timeseries = $nl->get_value('use_c13_timeseries');
3740-
if ( defined($use_c13_timeseries) && &value_is_true($use_c13_timeseries) ) {
3741-
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'atm_c13_filename',
3742-
'use_c13'=>$use_c13, 'use_cn'=>$nl_flags->{'use_cn'}, 'use_c13_timeseries'=>$nl->get_value('use_c13_timeseries'),
3743-
'ssp_rcp'=>$nl_flags->{'ssp_rcp'} );
3744-
}
3745-
} else {
3746-
if ( defined($nl->get_value('use_c13_timeseries')) ||
3747-
defined($nl->get_value('atm_c13_filename')) ) {
3748-
$log->fatal_error("use_c13 is FALSE and use_c13_timeseries or atm_c13_filename set");
3749-
}
3734+
if ( &value_is_true($use_c13) ) {
3735+
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'use_c13_timeseries', 'bgc_mode'=>$nl_flags->{'bgc_mode'}, 'phys'=>$nl_flags->{'phys'});
3736+
my $use_c13_timeseries = $nl->get_value('use_c13_timeseries');
3737+
if ( &value_is_true($use_c13_timeseries) ) {
3738+
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'atm_c13_filename',
3739+
'use_c13'=>$use_c13, 'use_cn'=>$nl_flags->{'use_cn'}, 'use_c13_timeseries'=>$nl->get_value('use_c13_timeseries'),
3740+
'ssp_rcp'=>$nl_flags->{'ssp_rcp'} );
37503741
}
37513742
} else {
37523743
if ( defined($nl->get_value('use_c13_timeseries')) ||
37533744
defined($nl->get_value('atm_c13_filename')) ) {
3754-
$log->fatal_error("use_c13 NOT set to .true., but use_c13_bompspike/atm_c13_filename defined.");
3745+
$log->fatal_error("use_c13 is FALSE and use_c13_timeseries or atm_c13_filename set");
37553746
}
37563747
}
37573748
} else {
3758-
if ( defined($use_c13) ||
3759-
defined($use_c14) ||
3760-
defined($nl->get_value('use_c14_bombspike')) ||
3749+
if ( &value_is_true($use_c13) ||
3750+
&value_is_true($use_c14) ||
3751+
&value_is_true($nl->get_value('use_c14_bombspike')) ||
37613752
defined($nl->get_value('atm_c14_filename')) ||
3762-
defined($nl->get_value('use_c13_timeseries')) ||
3753+
&value_is_true($nl->get_value('use_c13_timeseries')) ||
37633754
defined($nl->get_value('atm_c13_filename')) ) {
37643755
$log->fatal_error("bgc=sp and C isotope namelist variables were set, both can't be used at the same time");
37653756
}
@@ -4071,7 +4062,16 @@ sub setup_logic_fire_emis {
40714062
if ( &value_is_true( $nl_flags->{'use_fates'} ) ) {
40724063
$log->warning("Fire emission option $var can NOT be on when FATES is also on.\n" .
40734064
" DON'T use the '--fire_emis' option when '--bgc fates' is activated");
4074-
}
4065+
} elsif ( ! &value_is_true( $nl_flags->{'use_cn'} ) ) {
4066+
$log->fatal_error("Fire emission option $var can NOT be on when BGC SP (i.e. Satellite Phenology) is also on.\n" .
4067+
" DON'T use the '--fire_emis' option when '--bgc sp' is activated");
4068+
} elsif ( &value_is_true( $nl_flags->{'use_cn'}) ) {
4069+
my $fire_method = remove_leading_and_trailing_quotes( $nl->get_value('fire_method') );
4070+
if ( $fire_method eq "nofire" ) {
4071+
$log->fatal_error("Fire emission option $var can NOT be on with BGC and fire_method=='nofire'.\n" .
4072+
" DON'T use the '--fire_emis' option when fire_method is nofire");
4073+
}
4074+
}
40754075
}
40764076
}
40774077
}
@@ -4235,7 +4235,7 @@ sub setup_logic_lai_streams {
42354235
if ( &value_is_true($nl_flags->{'use_crop'}) && &value_is_true($nl->get_value('use_lai_streams')) ) {
42364236
$log->fatal_error("turning use_lai_streams on is incompatable with use_crop set to true.");
42374237
}
4238-
if ( $nl_flags->{'bgc_mode'} eq "sp" || ($nl_flags->{'bgc_mode'} eq "fates" && &value_is_true($nl->get_value('use_fates_sp')) )) {
4238+
if ( $nl_flags->{'bgc_mode'} eq "sp" || ($nl_flags->{'bgc_mode'} eq "fates" && &value_is_true($nl_flags->{'use_fates_sp'}) )) {
42394239
if ( &value_is_true($nl->get_value('use_lai_streams')) ) {
42404240
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'use_lai_streams');
42414241
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'lai_mapalgo',
@@ -4749,29 +4749,26 @@ sub setup_logic_fates {
47494749
# For FATES SP mode make sure no-competetiion, and fixed-biogeography are also set
47504750
# And also check for other settings that can't be trigged on as well
47514751
#
4752-
my $var = "use_fates_sp";
4753-
if ( defined($nl->get_value($var)) ) {
4754-
if ( &value_is_true($nl->get_value($var)) ) {
4755-
my @list = ( "use_fates_nocomp", "use_fates_fixed_biogeog" );
4756-
foreach my $var ( @list ) {
4757-
if ( ! &value_is_true($nl->get_value($var)) ) {
4758-
$log->fatal_error("$var is required when FATES SP is on (use_fates_sp)" );
4759-
}
4760-
}
4761-
# spit-fire can't be on with FATES SP mode is active
4762-
if ( $nl->get_value('fates_spitfire_mode') > 0 ) {
4763-
$log->fatal_error('fates_spitfire_mode can NOT be set to greater than 0 when use_fates_sp is true');
4764-
}
4752+
if ( &value_is_true($nl_flags->{'use_fates_sp'}) ) {
4753+
my @list = ( "use_fates_nocomp", "use_fates_fixed_biogeog" );
4754+
foreach my $var ( @list ) {
4755+
if ( ! &value_is_true($nl->get_value($var)) ) {
4756+
$log->fatal_error("$var is required when FATES SP is on (use_fates_sp)" );
4757+
}
4758+
}
4759+
# spit-fire can't be on with FATES SP mode is active
4760+
if ( $nl->get_value('fates_spitfire_mode') > 0 ) {
4761+
$log->fatal_error('fates_spitfire_mode can NOT be set to greater than 0 when use_fates_sp is true');
4762+
}
47654763

4766-
# fates landuse can't be on with FATES SP mode is active
4767-
if ( &value_is_true($nl->get_value('use_fates_luh')) ) {
4768-
$log->fatal_error('use_fates_luh can NOT be true when use_fates_sp is true');
4769-
}
4764+
# fates landuse can't be on with FATES SP mode is active
4765+
if ( &value_is_true($nl->get_value('use_fates_luh')) ) {
4766+
$log->fatal_error('use_fates_luh can NOT be true when use_fates_sp is true');
4767+
}
47704768

4771-
# hydro isn't currently supported to work when FATES SP mode is active
4772-
if (&value_is_true( $nl->get_value('use_fates_planthydro') )) {
4773-
$log->fatal_error('fates sp mode is currently not supported to work with fates hydro');
4774-
}
4769+
# hydro isn't currently supported to work when FATES SP mode is active
4770+
if (&value_is_true( $nl->get_value('use_fates_planthydro') )) {
4771+
$log->fatal_error('fates sp mode is currently not supported to work with fates hydro');
47754772
}
47764773
}
47774774
my $var = "use_fates_inventory_init";
@@ -4796,6 +4793,13 @@ sub setup_logic_fates {
47964793
}
47974794
}
47984795
}
4796+
# Check that both FaTES-SP and FATES ST3 aren't both on
4797+
my $var = "use_fates_ed_st3";
4798+
if ( defined($nl->get_value($var)) ) {
4799+
if ( &value_is_true($nl->get_value($var)) && &value_is_true($nl_flags->{'use_fates_sp'}) ) {
4800+
$log->fatal_error("$var can NOT also be true with use_fates_sp true" );
4801+
}
4802+
}
47994803
# check that fates landuse change mode has the necessary luh2 landuse timeseries data
48004804
# and add the default if not defined. Do not add default if use_fates_potentialveg is true.
48014805
# If fixed biogeography is on, make sure that flandusepftdat is avilable.

0 commit comments

Comments
 (0)