Skip to content

Commit

Permalink
Merge tag 'ctsm5.1.dev176' into updatetodev176
Browse files Browse the repository at this point in the history
Merge b4b-dev

 Conflicts:
	bld/namelist_files/namelist_defaults_ctsm.xml
	bld/namelist_files/namelist_defaults_overall.xml
	bld/namelist_files/namelist_definition_ctsm.xml
	bld/unit_testers/build-namelist_test.pl
	cime_config/config_component.xml
	cime_config/testdefs/testlist_clm.xml
	doc/ChangeLog
	doc/ChangeSum
  • Loading branch information
ekluzek committed Apr 11, 2024
2 parents af3c7fb + a65df14 commit 156fb3a
Show file tree
Hide file tree
Showing 25 changed files with 794 additions and 48 deletions.
2 changes: 1 addition & 1 deletion Externals.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ required = True
local_path = components/cism
protocol = git
repo_url = https://github.com/ESCOMP/CISM-wrapper
tag = cismwrap_2_1_97
tag = cismwrap_2_1_99
externals = Externals_CISM.cfg
required = True

Expand Down
79 changes: 68 additions & 11 deletions bld/CLMBuildNamelist.pm
Original file line number Diff line number Diff line change
Expand Up @@ -651,9 +651,9 @@ sub process_namelist_commandline_options {
setup_cmdl_dynamic_vegetation($opts, $nl_flags, $definition, $defaults, $nl);
setup_cmdl_fates_mode($opts, $nl_flags, $definition, $defaults, $nl);
setup_cmdl_vichydro($opts, $nl_flags, $definition, $defaults, $nl);
setup_logic_lnd_tuning($opts, $nl_flags, $definition, $defaults, $nl, $physv);
setup_cmdl_run_type($opts, $nl_flags, $definition, $defaults, $nl);
setup_cmdl_output_reals($opts, $nl_flags, $definition, $defaults, $nl);
setup_logic_lnd_tuning($opts, $nl_flags, $definition, $defaults, $nl, $physv);
}

#-------------------------------------------------------------------------------
Expand Down Expand Up @@ -1265,6 +1265,8 @@ sub setup_cmdl_simulation_year {

sub setup_cmdl_run_type {
my ($opts, $nl_flags, $definition, $defaults, $nl) = @_;
# Set the clm_start_type and the st_year, start year
# This MUST be done after lnd_tuning_mode is set

my $val;
my $var = "clm_start_type";
Expand All @@ -1279,20 +1281,19 @@ sub setup_cmdl_run_type {
my $group = $definition->get_group_name($date);
$nl->set_variable_value($group, $date, $ic_date );
}
my $set = undef;
if (defined $opts->{$var}) {
if ($opts->{$var} eq "default" ) {
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, $var,
'use_cndv'=>$nl_flags->{'use_cndv'}, 'use_fates'=>$nl_flags->{'use_fates'},
'sim_year'=>$st_year, 'sim_year_range'=>$nl_flags->{'sim_year_range'},
'bgc_spinup'=>$nl_flags->{'bgc_spinup'} );
} else {
if ($opts->{$var} ne "default" ) {
$set = 1;
my $group = $definition->get_group_name($var);
$nl->set_variable_value($group, $var, quote_string( $opts->{$var} ) );
}
} else {
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, $var,
'use_cndv'=>$nl_flags->{'use_cndv'}, 'use_fates'=>$nl_flags->{'use_fates'},
'sim_year'=>$st_year );
}
if ( ! defined $set ) {
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, $var,
'use_cndv'=>$nl_flags->{'use_cndv'}, 'use_fates'=>$nl_flags->{'use_fates'},
'sim_year'=>$st_year, 'sim_year_range'=>$nl_flags->{'sim_year_range'},
'bgc_spinup'=>$nl_flags->{'bgc_spinup'}, 'lnd_tuning_mode'=>$nl_flags->{'lnd_tuning_mode'} );
}
$nl_flags->{'clm_start_type'} = $nl->get_value($var);
$nl_flags->{'st_year'} = $st_year;
Expand Down Expand Up @@ -1697,6 +1698,11 @@ sub process_namelist_inline_logic {
#################################
setup_logic_fire_emis($opts, $nl_flags, $definition, $defaults, $nl);

######################################
# namelist options for dust emissions
######################################
setup_logic_dust_emis($opts, $nl_flags, $definition, $defaults, $nl);

#################################
# namelist group: megan_emis_nl #
#################################
Expand Down Expand Up @@ -3981,6 +3987,56 @@ sub setup_logic_fire_emis {

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

sub setup_logic_dust_emis {
# Logic to handle the dust emissions
my ($opts, $nl_flags, $definition, $defaults, $nl) = @_;

# First get the dust emission method
my $var = "dust_emis_method";
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, $var );

my $dust_emis_method = remove_leading_and_trailing_quotes( $nl->get_value($var) );

my @zender_files_in_lnd_opts = ( "stream_fldfilename_zendersoilerod", "stream_meshfile_zendersoilerod",
"zendersoilerod_mapalgo" );
if ( $dust_emis_method eq "Zender_2003" ) {
# get the zender_soil_erod_source
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl,
"zender_soil_erod_source", 'dust_emis_method'=>$dust_emis_method );

my $zender_source = remove_leading_and_trailing_quotes( $nl->get_value('zender_soil_erod_source') );
if ( $zender_source eq "lnd" ) {
foreach my $option ( @zender_files_in_lnd_opts ) {
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, $option,
'dust_emis_method'=>$dust_emis_method, 'zender_soil_erod_source'=>$zender_source,
'hgrid'=>$nl_flags->{'res'}, 'lnd_tuning_mod'=>$nl_flags->{'lnd_tuning_mode'} );
}
} else {
foreach my $option ( @zender_files_in_lnd_opts ) {
if ( defined($nl->get_value($option)) ) {
$log->fatal_error("zender_soil_erod_source is NOT lnd, but the file option $option is being set" .
" and should NOT be unless you want it handled here in the LAND model, " .
"otherwise the equivalent option is set in CAM" );
}
}
}
} else {
# Verify that NONE of the Zender options are being set if Zender is NOT being used
push @zender_files_in_lnd_opts, "zender_soil_erod_source";
foreach my $option ( @zender_files_in_lnd_opts ) {
if ( defined($nl->get_value($option)) ) {
$log->fatal_error("dust_emis_method is NOT set to Zender_2003, but one of it's options " .
"$option is being set, need to change one or the other" );
}
}
if ( $dust_emis_method eq "Leung_2023" ) {
$log->warning("dust_emis_method is Leung_2023 and that option has NOT been brought into CTSM yet");
}
}
}

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

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

Expand Down Expand Up @@ -4665,6 +4721,7 @@ sub write_output_files {
push @groups, "exice_streams";
push @groups, "soilbgc_decomp";
push @groups, "clm_canopy_inparm";
push @groups, "zendersoilerod";
if (remove_leading_and_trailing_quotes($nl->get_value('snow_cover_fraction_method')) eq 'SwensonLawrence2012') {
push @groups, "scf_swenson_lawrence_2012_inparm";
}
Expand Down
65 changes: 63 additions & 2 deletions bld/namelist_files/namelist_defaults_ctsm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -668,6 +668,14 @@ attributes from the config_cache.xml file (with keys converted to upper-case).
<use_init_interp use_cndv=".false." use_fates=".false." sim_year="2000" lnd_tuning_mode="clm4_5_GSWP3v1" >.true.</use_init_interp>
<use_init_interp use_cndv=".false." use_fates=".false." sim_year="2000" lnd_tuning_mode="clm4_5_CRUv7" >.true.</use_init_interp>
<use_init_interp use_cndv=".false." use_fates=".false." sim_year="1979" lnd_tuning_mode="clm4_5_cam6.0" >.true.</use_init_interp>
<!-- Let CAM4 and CAM5 lnd_tuning mode be FALSE (so do a coldstart) -->
<!-- Yes, the phys setting is essentially duplicated here but it is needed to ensure this is used and isn't matched above -->
<use_init_interp use_cndv=".false." use_fates=".false." phys="clm4_5" lnd_tuning_mode="clm4_5_cam5.0" >.false.</use_init_interp>
<use_init_interp use_cndv=".false." use_fates=".false." phys="clm4_5" lnd_tuning_mode="clm4_5_cam4.0" >.false.</use_init_interp>
<use_init_interp use_cndv=".false." use_fates=".false." phys="clm5_0" lnd_tuning_mode="clm5_0_cam5.0" >.false.</use_init_interp>
<use_init_interp use_cndv=".false." use_fates=".false." phys="clm5_0" lnd_tuning_mode="clm5_0_cam4.0" >.false.</use_init_interp>
<use_init_interp use_cndv=".false." use_fates=".false." phys="clm5_1" lnd_tuning_mode="clm5_1_cam5.0" >.false.</use_init_interp>
<use_init_interp use_cndv=".false." use_fates=".false." phys="clm5_1" lnd_tuning_mode="clm5_1_cam4.0" >.false.</use_init_interp>
<!-- Default to FALSE if couldn't find a match -->
<use_init_interp >.false.</use_init_interp>
<!-- NOTE: if use_init_interp is FALSE that indicates that you can't interpolate from an initial conditions file that's similar
Expand Down Expand Up @@ -698,12 +706,11 @@ attributes from the config_cache.xml file (with keys converted to upper-case).
<init_interp_attributes sim_year="1850" use_cndv=".false." use_fates=".false." lnd_tuning_mode="clm5_0_GSWP3v1" use_cn=".false."
>hgrid=0.9x1.25 maxpft=17 mask=gx1v7 use_cn=.false. use_crop=.false. irrigate=.true. glc_nec=10 do_transient_pfts=.false.
</init_interp_attributes>

<init_interp_attributes sim_year="1850" use_cndv=".false." use_fates=".false." lnd_tuning_mode="clm5_0_GSWP3v1" use_cn=".true."
>hgrid=0.9x1.25 maxpft=79 mask=gx1v7 use_cn=.true. use_crop=.true. irrigate=.false. glc_nec=10 do_transient_pfts=.false.
</init_interp_attributes>

<!-- These two needs to specify use_cn=F/T since there is a version for both, other files just use the BGC version -->
<!-- These first two needs to specify use_cn=F/T since there is a version for both, other files just use the BGC version -->
<init_interp_attributes sim_year="1850" use_cndv=".false." use_fates=".false." lnd_tuning_mode="clm5_0_CRUv7" use_cn=".true."
>hgrid=0.9x1.25 maxpft=79 mask=gx1v7 use_cn=.true. use_crop=.true. irrigate=.false. glc_nec=10 do_transient_pfts=.false.
</init_interp_attributes>
Expand Down Expand Up @@ -1945,6 +1952,60 @@ lnd/clm2/surfdata_esmf/NEON/surfdata_1x1_NEON_TOOL_hist_78pfts_CMIP6_simyr2000_c
<stream_meshfile_ch4finundated finundation_method="ZWT_inversion"
>lnd/clm2/paramdata/finundated_inversiondata_0.9x1_ESMFmesh_cdf5_130621.nc</stream_meshfile_ch4finundated>

<!-- =========================================== -->
<!-- Defaults for dust namelist items -->
<!-- Defaults for Zender's soil erodibility data -->
<!-- =========================================== -->

<dust_emis_method>Zender_2003</dust_emis_method>
<zender_soil_erod_source dust_emis_method="Zender_2003">atm</zender_soil_erod_source>
<zendersoilerod_mapalgo>bilinear</zendersoilerod_mapalgo>
<stream_fldfilename_zendersoilerod dust_emis_method="Zender_2003" zender_soil_erod_source="lnd" lnd_tuning_mode="cam45_cam6.0"
>lnd/clm2/dustemisdata/dst_source2x2tunedcam6-2x2-forCLM_cdf5_c230312.nc</stream_fldfilename_zendersoilerod>
<stream_fldfilename_zendersoilerod dust_emis_method="Zender_2003" zender_soil_erod_source="lnd" lnd_tuning_mode="cam50_cam6.0"
>lnd/clm2/dustemisdata/dst_source2x2tunedcam6-2x2-forCLM_cdf5_c230312.nc</stream_fldfilename_zendersoilerod>
<stream_fldfilename_zendersoilerod dust_emis_method="Zender_2003" zender_soil_erod_source="lnd" lnd_tuning_mode="cam51_cam6.0"
>lnd/clm2/dustemisdata/dst_source2x2tunedcam6-2x2-forCLM_cdf5_c230312.nc</stream_fldfilename_zendersoilerod>
<stream_fldfilename_zendersoilerod dust_emis_method="Zender_2003" zender_soil_erod_source="lnd" lnd_tuning_mode="cam45_cam5.0"
>lnd/clm2/dustemisdata/dst_source2x2_cam5.4-forCLM_cdf5_c240202.nc</stream_fldfilename_zendersoilerod>
<stream_fldfilename_zendersoilerod dust_emis_method="Zender_2003" zender_soil_erod_source="lnd" lnd_tuning_mode="cam50_cam5.0"
>lnd/clm2/dustemisdata/dst_source2x2_cam5.4-forCLM_cdf5_c240202.nc</stream_fldfilename_zendersoilerod>
<stream_fldfilename_zendersoilerod dust_emis_method="Zender_2003" zender_soil_erod_source="lnd" lnd_tuning_mode="cam51_cam5.0"
>lnd/clm2/dustemisdata/dst_source2x2_cam5.4-forCLM_cdf5_c240202.nc</stream_fldfilename_zendersoilerod>
<stream_fldfilename_zendersoilerod dust_emis_method="Zender_2003" zender_soil_erod_source="lnd" lnd_tuning_mode="cam45_cam4.0"
>lnd/clm2/dustemisdata/dst_source2x2tuned-cam4-forCLM_cdf5_c240202.nc</stream_fldfilename_zendersoilerod>
<stream_fldfilename_zendersoilerod dust_emis_method="Zender_2003" zender_soil_erod_source="lnd" lnd_tuning_mode="cam50_cam4.0"
>lnd/clm2/dustemisdata/dst_source2x2tuned-cam4-forCLM_cdf5_c240202.nc</stream_fldfilename_zendersoilerod>
<stream_fldfilename_zendersoilerod dust_emis_method="Zender_2003" zender_soil_erod_source="lnd" lnd_tuning_mode="cam51_cam4.0"
>lnd/clm2/dustemisdata/dst_source2x2tuned-cam4-forCLM_cdf5_c240202.nc</stream_fldfilename_zendersoilerod>
<stream_fldfilename_zendersoilerod dust_emis_method="Zender_2003" zender_soil_erod_source="lnd" lnd_tuning_mode="cam45_cam4.0" hgrid="0.9x1.25"
>lnd/clm2/dustemisdata/dst_source1x1tuned-cam4-forCLM_cdf5_c240202.nc</stream_fldfilename_zendersoilerod>
<stream_fldfilename_zendersoilerod dust_emis_method="Zender_2003" zender_soil_erod_source="lnd" lnd_tuning_mode="cam50_cam4.0" hgrid="0.9x1.25"
>lnd/clm2/dustemisdata/dst_source1x1tuned-cam4-forCLM_cdf5_c240202.nc</stream_fldfilename_zendersoilerod>
<stream_fldfilename_zendersoilerod dust_emis_method="Zender_2003" zender_soil_erod_source="lnd" lnd_tuning_mode="cam51_cam4.0" hgrid="0.9x1.25"
>lnd/clm2/dustemisdata/dst_source1x1tuned-cam4-forCLM_cdf5_c240202.nc</stream_fldfilename_zendersoilerod>
<stream_fldfilename_zendersoilerod dust_emis_method="Zender_2003" zender_soil_erod_source="lnd" lnd_tuning_mode="cam45_cam6.0"
>lnd/clm2/dustemisdata/dst_source2x2tunedcam6-2x2-forCLM_cdf5_c230312.nc</stream_fldfilename_zendersoilerod>
<stream_fldfilename_zendersoilerod dust_emis_method="Zender_2003" zender_soil_erod_source="lnd" lnd_tuning_mode="cam50_cam6.0"
>lnd/clm2/dustemisdata/dst_source2x2tunedcam6-2x2-forCLM_cdf5_c230312.nc</stream_fldfilename_zendersoilerod>
<stream_fldfilename_zendersoilerod dust_emis_method="Zender_2003" zender_soil_erod_source="lnd" lnd_tuning_mode="cam51_cam6.0"
>lnd/clm2/dustemisdata/dst_source2x2tunedcam6-2x2-forCLM_cdf5_c230312.nc</stream_fldfilename_zendersoilerod>
<stream_fldfilename_zendersoilerod dust_emis_method="Zender_2003" zender_soil_erod_source="lnd" lnd_tuning_mode="cam45_CRUv7"
>lnd/clm2/dustemisdata/dst_source2x2tunedcam6-2x2-forCLM_cdf5_c230312.nc</stream_fldfilename_zendersoilerod>
<stream_fldfilename_zendersoilerod dust_emis_method="Zender_2003" zender_soil_erod_source="lnd" lnd_tuning_mode="cam50_CRUv7"
>lnd/clm2/dustemisdata/dst_source2x2tunedcam6-2x2-forCLM_cdf5_c230312.nc</stream_fldfilename_zendersoilerod>
<stream_fldfilename_zendersoilerod dust_emis_method="Zender_2003" zender_soil_erod_source="lnd" lnd_tuning_mode="cam51_CRUv7"
>lnd/clm2/dustemisdata/dst_source2x2tunedcam6-2x2-forCLM_cdf5_c230312.nc</stream_fldfilename_zendersoilerod>
<stream_fldfilename_zendersoilerod dust_emis_method="Zender_2003" zender_soil_erod_source="lnd" lnd_tuning_mode="cam45_GSWP3v1"
>lnd/clm2/dustemisdata/dst_source2x2tunedcam6-2x2-forCLM_cdf5_c230312.nc</stream_fldfilename_zendersoilerod>
<stream_fldfilename_zendersoilerod dust_emis_method="Zender_2003" zender_soil_erod_source="lnd" lnd_tuning_mode="cam50_GSWP3v1"
>lnd/clm2/dustemisdata/dst_source2x2tunedcam6-2x2-forCLM_cdf5_c230312.nc</stream_fldfilename_zendersoilerod>
<stream_fldfilename_zendersoilerod dust_emis_method="Zender_2003" zender_soil_erod_source="lnd" lnd_tuning_mode="cam51_GSWP3v1"
>lnd/clm2/dustemisdata/dst_source2x2tunedcam6-2x2-forCLM_cdf5_c230312.nc</stream_fldfilename_zendersoilerod>

<stream_meshfile_zendersoilerod dust_emis_method="Zender_2003" zender_soil_erod_source="lnd"
>lnd/clm2/dustemisdata/dust_2x2_ESMFmesh_cdf5_c230730.nc</stream_meshfile_zendersoilerod>

<!-- ========================================= -->
<!-- Defaults for different BGC/decomp modes -->
<!-- ========================================= -->
Expand Down
8 changes: 8 additions & 0 deletions bld/namelist_files/namelist_defaults_overall.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,14 @@ determine default values for namelists.
<clm_start_type sim_year="1850" >startup</clm_start_type>
<clm_start_type sim_year="2000" >startup</clm_start_type>

<!-- CAM4 and CAM5 tuning are all cold starts -->
<clm_start_type phys="clm4_5" lnd_tuning_mode="clm4_5_cam5.0" >cold</clm_start_type>
<clm_start_type phys="clm4_5" lnd_tuning_mode="clm4_5_cam4.0" >cold</clm_start_type>
<clm_start_type phys="clm5_0" lnd_tuning_mode="clm5_0_cam5.0" >cold</clm_start_type>
<clm_start_type phys="clm5_0" lnd_tuning_mode="clm5_0_cam4.0" >cold</clm_start_type>
<clm_start_type phys="clm5_1" lnd_tuning_mode="clm5_1_cam5.0" >cold</clm_start_type>
<clm_start_type phys="clm5_1" lnd_tuning_mode="clm5_1_cam4.0" >cold</clm_start_type>

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


Expand Down
45 changes: 44 additions & 1 deletion bld/namelist_files/namelist_definition_ctsm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1811,6 +1811,49 @@ Mapping method from Nitrogen deposition input file to the model resolution
copy = copy using the same indices
</entry>

<!-- ======================================================================================== -->
<!-- Dust namelist and Zender soil erodibility stream -->
<!-- ======================================================================================== -->

<entry id="dust_emis_method" type="char*12" category="physics"
group="clm_inparm" valid_values="Zender_2003,Leung_2023" >
Which dust emission method is going to be used. Either the Zender 2003 scheme or the Leung 2023
scheme.
(NOTE: The Leung 2023 method is NOT currently available)
</entry>

<entry id="zender_soil_erod_source" type="char*3" category="physics"
group="zendersoilerod" valid_values="lnd,atm" >
Option only applying for the Zender_2003 method for whether the soil erodibility file is handled
here in CTSM, or in the ATM model.
(only used when dust_emis_method is Zender_2003)
</entry>

<entry id="zendersoilerod_mapalgo" type="char*256" category="physics"
group="zendersoilerod" valid_values="bilinear,nn,nnoni,nnonj,spval,copy" >
Option only applying for the Zender_2003 method for whether the soil erodibility file is handled
here in CTSM, or in the ATM model.
(only used when dust_emis_method is Zender_2003)
bilinear = bilinear interpolation
nn = nearest neighbor
nnoni = nearest neighbor on the "i" (longitude) axis
nnonj = nearest neighbor on the "j" (latitude) axis
spval = set to special value
copy = copy using the same indices
</entry>

<entry id="stream_fldfilename_zendersoilerod" type="char*256" category="datasets"
input_pathname="abs" group="zendersoilerod" valid_values="" >
Filename of input stream data for Zender's soil erodibility source function
(only used when dust_emis_method is Zender_2003, and zender_soil_erod_source is lnd)
</entry>

<entry id="stream_meshfile_zendersoilerod" type="char*256" category="datasets"
input_pathname="abs" group="zendersoilerod" valid_values="" >
mesh filename of input stream data for Zender's soil erodibility source function
(only used when dust_emis_method is Zender_2003, and zender_soil_erod_source is lnd)
</entry>

<!-- ======================================================================================== -->
<!-- finundated stream -->
<!-- ======================================================================================== -->
Expand Down Expand Up @@ -2193,7 +2236,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,clm6_0_GSWP3v1,clm6_0_cam6.0">
valid_values="clm4_5_CRUv7,clm4_5_GSWP3v1,clm4_5_cam6.0,clm4_5_cam5.0,clm4_5_cam4.0,clm5_0_cam6.0,clm5_0_cam5.0,clm5_0_cam4.0,clm5_0_CRUv7,clm5_0_GSWP3v1,clm5_1_GSWP3v1,clm5_1_CRUv7,clm5_1_cam6.0,clm5_1_cam5.0,clm5_1_cam4.0,clm6_0_GSWP3v1,clm6_0_cam6.0,clm6_0_cam5.0,clm6_0_cam4.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
Loading

0 comments on commit 156fb3a

Please sign in to comment.