Skip to content

Commit

Permalink
Merge tag 'ctsm5.1.dev123' into add_mizuRoute
Browse files Browse the repository at this point in the history
Updates needed for pFUnit 4 and other externals updates

(1) Lots of small changes needed for the update to pFUnit4. Note that
    this is a backwards-incompatible update, so we will require pFUnit 4
    moving forward.

(2) Externals updates: some of these are needed for the update to pFUnit
    4; others are included to update externals to those in a recent CESM
    alpha tag.

 Conflicts:
	Externals.cfg
	bld/unit_testers/build-namelist_test.pl
  • Loading branch information
ekluzek committed Jan 8, 2024
2 parents 3bf9178 + 8df94cb commit e056fdd
Show file tree
Hide file tree
Showing 330 changed files with 7,825 additions and 2,591 deletions.
24 changes: 12 additions & 12 deletions .config_files.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,31 +5,31 @@
<entry_id>

<!-- This is the same as the default entry in
cime/config/cesm/config_files.xml except for the value for CTSM:
In a standalone CTSM checkout, COMP_ROOT_DIR_LND is $SRCROOT
cime/config/cesm/config_files.xml except for the value for CLM:
In a standalone CLM checkout, COMP_ROOT_DIR_LND is $SRCROOT
rather than $SRCROOT/components/clm.
However, because of the way overrides are handled, we need to
re-specify the full information here rather than just overriding
the value for CTSM.
the value for CLM.
-->
<entry id="COMP_ROOT_DIR_LND">
<type>char</type>
<default_value>unset</default_value>
<values>
<value component="clm" >$SRCROOT</value>
<value component="ctsm" >$SRCROOT</value>
<value component="dlnd" comp_interface="mct">$SRCROOT/components/cpl7/components/data_comps_mct/dlnd</value>
<value component="dlnd" comp_interface="nuopc">$SRCROOT/components/cdeps/dlnd</value>
<value component="slnd" comp_interface="mct" >$SRCROOT/components/cpl7/components/stub_comps_mct/slnd</value>
<value component="xlnd" comp_interface="mct" >$SRCROOT/components/cpl7/components/xcpl_comps_mct/xlnd</value>
<value component="slnd" comp_interface="nuopc" >$CIMEROOT/src/components/stub_comps_nuopc/slnd</value>
<value component="xlnd" comp_interface="nuopc" >$CIMEROOT/src/components/xcpl_comps_nuopc/xlnd</value>
<value component="clm" >$SRCROOT</value>
<value component="slim" >$SRCROOT/components/slim/</value>
<value component="dlnd" comp_interface="mct" >$SRCROOT/components/cpl7/components/data_comps_$COMP_INTERFACE/dlnd</value>
<value component="dlnd" comp_interface="nuopc" >$SRCROOT/components/cdeps/dlnd</value>
<value component="slnd" comp_interface="mct" >$SRCROOT/components/cpl7/components/stub_comps_$COMP_INTERFACE/slnd</value>
<value component="slnd" comp_interface="nuopc" >$CIMEROOT/CIME/non_py/src/components/stub_comps_$COMP_INTERFACE/slnd</value>
<value component="xlnd" comp_interface="mct" >$SRCROOT/components/cpl7/components/xcpl_comps_$COMP_INTERFACE/xlnd</value>
<value component="xlnd" comp_interface="nuopc" >$CIMEROOT/CIME/non_py/src/components/xcpl_comps_$COMP_INTERFACE/xlnd</value>
</values>
<group>case_comps</group>
<file>env_case.xml</file>
<desc>Root directory of the case land model component </desc>
<schema>$CIMEROOT/config/xml_schemas/config_compsets.xsd</schema>
<schema>$CIMEROOT/CIME/data/config/xml_schemas/config_compsets.xsd</schema>
</entry>

</entry_id>
2 changes: 1 addition & 1 deletion .github/workflows/black.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ jobs:
# Using pyproject.toml makes sure this testing is consistent with our python directory testing
options: "--check --config python/pyproject.toml"
src: "./python"
# Version should be coordinated with the ctsm_py conda environment under the python directory
# Version should be coordinated with the ctsm_pylib conda environment under the python directory
version: "22.3.0"
25 changes: 12 additions & 13 deletions Externals.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ required = True
local_path = components/mosart
protocol = git
repo_url = https://github.com/ESCOMP/MOSART
tag = mosart1_0_47
tag = mosart1_0_48
required = True

[mizuRoute]
Expand All @@ -34,15 +34,14 @@ repo_url = https://github.com/nmizukami/mizuRoute
# Branch that is being used
#branch = cesm-coupling
# specitic hash or tag along the above branch
hash = 48e65434280b9dc62400cd902fb0c154e410ed1b
#tag = cesm-coupling.n02_v2.1.1
#hash = 48e65434280b9dc62400cd902fb0c154e410ed1b
tag = cesm-coupling.n02_v2.1.2
required = True

[ccs_config]
#hash = 4dcfe92902dc436271e2cec0bba6fc58e8ad4af6 # Naoki
hash = f0cc1b87208fc4279916cc4509719067ba22afa2
hash = 9f2b4e7f5bb8ff09ccfe2dee1de5b61ef0af64f8
#branch = mizuroutelakegrids
#tag = ccs_config_cesm0.0.38
#tag = ccs_config_cesm0.0.64
protocol = git
#repo_url = https://github.com/ESMCI/ccs_config_cesm.git
repo_url = https://github.com/ekluzek/ccs_config_cesm.git
Expand All @@ -53,36 +52,36 @@ required = True
local_path = cime
protocol = git
repo_url = https://github.com/ESMCI/cime
tag = cime6.0.75
tag = cime6.0.108
required = True

[cmeps]
#tag = cmeps0.13.71
#tag = cmeps0.14.21
#branch = lndrofmapfilefix
hash = 0602beb046a5053620f7dcfaf9e792c8d7fd738e
hash = 8f378f7e9a7bcaa265639556f2e60078860d1761
protocol = git
#repo_url = https://github.com/ESCOMP/CMEPS.git
repo_url = https://github.com/ekluzek/CMEPS.git
local_path = components/cmeps
required = True

[cdeps]
tag = cdeps0.12.65
tag = cdeps1.0.9
protocol = git
repo_url = https://github.com/ESCOMP/CDEPS.git
local_path = components/cdeps
externals = Externals_CDEPS.cfg
required = True

[cpl7]
tag = cpl7.0.14
tag = cpl77.0.5
protocol = git
repo_url = https://github.com/ESCOMP/CESM_CPL7andDataComps
local_path = components/cpl7
required = True

[share]
tag = share1.0.13
tag = share1.0.17
protocol = git
repo_url = https://github.com/ESCOMP/CESM_share
local_path = share
Expand All @@ -96,7 +95,7 @@ local_path = libraries/mct
required = True

[parallelio]
tag = pio2_5_7
tag = pio2_5_10
protocol = git
repo_url = https://github.com/NCAR/ParallelIO
local_path = libraries/parallelio
Expand Down
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.59.7_api.24.1.0
tag = sci.1.65.3_api.25.4.0
required = True

[externals_description]
Expand Down
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,19 @@ CTSM code management is provided primarily by:
Software engineering team:
- [Erik Kluzek](https://github.com/ekluzek)
- [Bill Sacks](https://github.com/billsacks)
- [Mariana Vertenstein](https://github.com/mvertens)
- [Negin Sobhani](https://github.com/negin513)
- [Sam Levis](https://github.com/slevisconsulting)
- [Adrianna Foster](https://github.com/adrifoster)
- [Sam Rabin](https://github.com/samsrabin)
- [Greg Lemieux](https://github.com/glemieux)
- [Ryan Knox](https://github.com/rgknox)

Science team:
- [Dave Lawrence](https://github.com/dlawrenncar)
- [Will Wieder](https://github.com/wwieder)
- [Danica Lombardozzi](https://github.com/danicalombardozzi)
- [Keith Oleson](https://github.com/olyson)
- [Sean Swenson](https://github.com/swensosc)
- [Mike Barlage](https://github.com/barlage)
- [Jackie Shuman](https://github.com/jkshuman)
- [Peter Lawrence](https://github.com/lawrencepj1)
- [Rosie Fisher](https://github.com/rosiealice)
- Gordon Bonan
82 changes: 75 additions & 7 deletions bld/CLMBuildNamelist.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1687,11 +1687,6 @@ sub process_namelist_inline_logic {
#############################################
setup_logic_rooting_profile($opts, $nl_flags, $definition, $defaults, $nl);

#############################################
# namelist group: friction_velocity #
#############################################
setup_logic_friction_vel($opts, $nl_flags, $definition, $defaults, $nl);

#############################
# namelist group: cngeneral #
#############################
Expand All @@ -1711,6 +1706,11 @@ sub process_namelist_inline_logic {
#############################################
setup_logic_canopyfluxes($opts, $nl_flags, $definition, $defaults, $nl);

##########################################################
# namelist group: friction_velocity (after canopyfluxes) #
##########################################################
setup_logic_friction_vel($opts, $nl_flags, $definition, $defaults, $nl);

#############################################
# namelist group: canopyhydrology_inparm #
#############################################
Expand Down Expand Up @@ -2491,6 +2491,7 @@ sub setup_logic_dynamic_subgrid {
setup_logic_do_transient_lakes($opts, $nl_flags, $definition, $defaults, $nl);
setup_logic_do_transient_urban($opts, $nl_flags, $definition, $defaults, $nl);
setup_logic_do_harvest($opts, $nl_flags, $definition, $defaults, $nl);
setup_logic_do_grossunrep($opts, $nl_flags, $definition, $defaults, $nl);

add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'reset_dynbal_baselines');
if ( &value_is_true($nl->get_value('reset_dynbal_baselines')) &&
Expand Down Expand Up @@ -2836,6 +2837,63 @@ sub setup_logic_do_harvest {

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

sub setup_logic_do_grossunrep {
#
# Set do_grossunrep default value, and perform error checking on do_grossunrep
#
# Assumes the following are already set in the namelist (although it's okay
# for them to be unset if that will be their final state):
# - flanduse_timeseries
# - use_cn
# - use_fates
#
my ($opts, $nl_flags, $definition, $defaults, $nl) = @_;

my $var = 'do_grossunrep';

# Start by assuming a default value of '.true.'. 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
# value is indeed false (e.g., that the user didn't try to set it to true).

my $default_val = ".false.";

# cannot_be_true will be set to a non-empty string in any case where
# do_grossunrep should not be true; if it turns out that do_grossunrep IS true
# in any of these cases, a fatal error will be generated
my $cannot_be_true = "";

if (string_is_undef_or_empty($nl->get_value('flanduse_timeseries'))) {
$cannot_be_true = "$var can only be set to true when running a transient case (flanduse_timeseries non-blank)";
}
elsif (&value_is_true($nl->get_value('use_fates'))) {
$cannot_be_true = "$var currently doesn't work with FATES";
}
elsif (!&value_is_true($nl->get_value('use_cn'))) {
$cannot_be_true = "$var can only be set to true when running with CN (use_cn = true)";
}

if ($cannot_be_true) {
$default_val = ".false.";
}

if (!$cannot_be_true) {
# Note that, if the variable cannot be true, we don't call add_default
# - so that we don't clutter up the namelist with variables that don't
# matter for this case
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, $var, val=>$default_val);
}

# Make sure the value is false when it needs to be false - i.e., that the
# user hasn't tried to set a true value at an inappropriate time.

if (&value_is_true($nl->get_value($var)) && $cannot_be_true) {
$log->fatal_error($cannot_be_true);
}

}

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

Expand Down Expand Up @@ -3683,6 +3741,10 @@ sub setup_logic_fire_emis {
my ($opts, $nl_flags, $definition, $defaults, $nl) = @_;

if ($opts->{'fire_emis'} ) {
if ( &value_is_true( $nl_flags->{'use_fates'} ) ) {
$log->warning("Fire emission can NOT be on when FATES is also on.\n" .
" DON'T use the '-fire_emis' option when '-bgc fates' is activated");
}
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'fire_emis_factors_file');
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'fire_emis_specifier');
} else {
Expand Down Expand Up @@ -3898,10 +3960,11 @@ sub setup_logic_rooting_profile {
#-------------------------------------------------------------------------------

sub setup_logic_friction_vel {
#
# Must be after canopyfluxes so that use_biomass_heat_storage will be set
my ($opts, $nl_flags, $definition, $defaults, $nl) = @_;

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

#-------------------------------------------------------------------------------
Expand All @@ -3926,6 +3989,11 @@ sub setup_logic_canopyfluxes {
if ( &value_is_true($nl->get_value('use_biomass_heat_storage') ) && &value_is_true( $nl_flags->{'use_fates'}) ) {
$log->fatal_error('use_biomass_heat_storage can NOT be set to true when fates is on');
}
if ( &value_is_true($nl->get_value('use_biomass_heat_storage')) ) {
$nl_flags->{'use_biomass_heat_storage'} = ".true.";
} else {
$nl_flags->{'use_biomass_heat_storage'} = ".false.";
}
}

#-------------------------------------------------------------------------------
Expand Down
Loading

0 comments on commit e056fdd

Please sign in to comment.