Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move the dust emission source function soil erodibility for the Zender scheme from CAM to CTSM #1967

Merged
merged 50 commits into from
Mar 27, 2024
Merged
Show file tree
Hide file tree
Changes from 48 commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
8434fbb
An initial commit to enable CLM to read in Zender's soil erodibility …
dmleung Mar 13, 2023
2c9974c
first commit on adding a global tuning factor to tune global total du…
dmleung Mar 21, 2023
4f5dcb9
After discussing with CAM people, I took away the lines relevant to t…
dmleung Apr 5, 2023
7616b5c
Merge tag 'ctsm5.1.dev122' into zendersource_dev
ekluzek Apr 28, 2023
f4dde3d
Remove most of the comments that mention dmleung, changes will be sto…
ekluzek Jun 23, 2023
2a2caf1
Move files into inputdata, and nccopy mesh file from NetCDF4 to CDF5
ekluzek Jul 31, 2023
35b1f4a
Change ESMF Finalize to endrun, add more clarity on what's happening …
ekluzek Jul 31, 2023
a27f6f5
Some updates from the review, this compiles, but fails to run when it…
ekluzek Aug 18, 2023
cb81fdb
Remove dust_emis_fact as that will stay inside of CAM
ekluzek Aug 18, 2023
019282a
Add lnd_tuning modes for CAM4.0 and CAM5.0 for all CLM physics option…
ekluzek Aug 21, 2023
70289af
Get cam4,cam5 options working with coldstarts, add more tests, make s…
ekluzek Sep 9, 2023
a931e74
Add a comment about the ordering to the run_type subroutine
ekluzek Sep 9, 2023
a22b089
Merge tag 'ctsm5.1.dev166' into zendersource_dev
ekluzek Jan 26, 2024
08d3c86
Add two new namelist options to control the dust emission method and …
ekluzek Jan 29, 2024
3553bef
Add dust_emission namelist control items to build-namelist and add te…
ekluzek Jan 30, 2024
8a9f513
Fix bug in tests after running with the error check turned off
ekluzek Jan 30, 2024
dd61c14
Add zendersoilerodmapalgo into the build-namelist
ekluzek Jan 31, 2024
0d19e85
Add new test mods that include using Zender_2003 dust and lnd_tuning_…
ekluzek Jan 31, 2024
c3f2b30
Add in the new dust handling namelist parameters, and some control lo…
ekluzek Jan 31, 2024
15bf184
Get simple case with Zender soil eroditablity off working so SMS_D_Ld…
ekluzek Feb 2, 2024
0b9c979
Fix some issues, get a test using soileroditability file to work
ekluzek Feb 2, 2024
3921fbf
Add tests for Zender dust with soil eroditability file in CTSM for CA…
ekluzek Feb 3, 2024
2ad96ff
Add dust soil eroditability files for all CAM options, which requires…
ekluzek Feb 3, 2024
3011818
Need hgrid for some of the Zender soil eroditability files
ekluzek Feb 3, 2024
7e226ba
Correct year in dust_emis_method
ekluzek Feb 3, 2024
ef7a41a
Correct namelist name
ekluzek Feb 3, 2024
1941d2a
Merge remote-tracking branch 'escomp/master' into zendersource_dev
ekluzek Feb 6, 2024
68a35de
Merge remote-tracking branch 'escomp/b4b-dev' into zendersource_dev
ekluzek Feb 16, 2024
9f8e983
Merge branch 'zendersource_dev' of github.com:dmleung/CTSM into zende…
ekluzek Feb 16, 2024
2d9aacc
Use straight logic rather than a logical not of the straightforward c…
ekluzek Feb 27, 2024
8c42551
Change names with zendersoilerod in them, in some cases removing the …
ekluzek Feb 27, 2024
1421d6d
Fix some issues from comments in the PR, make sure all namelist items…
ekluzek Feb 27, 2024
b66c1f0
Fix issue so will compile
ekluzek Feb 27, 2024
23eb33b
Add comment about dust_emis_method
ekluzek Feb 27, 2024
4de177b
Merge remote-tracking branch 'escomp/master' into zendersource_dev
ekluzek Feb 27, 2024
cd005b3
Add some Zender soil eroditability tests for izumi, and a 1-degree CL…
ekluzek Feb 27, 2024
9dc57da
Change izumi_nag test to izumi_gnu because non-DEBUG tests don't buil…
ekluzek Feb 28, 2024
dd87593
Merge tag 'ctsm5.1.dev174' into zendersource_dev
ekluzek Mar 15, 2024
04d7790
Merge remote-tracking branch 'escomp/b4b-dev' into zendersource_dev
ekluzek Mar 20, 2024
d0537d1
Merge remote-tracking branch 'escomp/b4b-dev' into zendersource_dev
ekluzek Mar 21, 2024
f5168f9
Fix ordering so that array is allocated properly
ekluzek Mar 22, 2024
67bbf59
Add some error checking that would have caught the previous problem
ekluzek Mar 22, 2024
1d64435
Remove uneeded comment, and add a TODO from the code review
ekluzek Mar 25, 2024
d8ae9cd
Merge remote-tracking branch 'escomp/b4b-dev' into zendersource_dev
ekluzek Mar 25, 2024
36bfba6
Remove trailing whitespace
ekluzek Mar 25, 2024
7943f8d
Another trailing blank
ekluzek Mar 25, 2024
20e3fe9
More trailing whitspace
ekluzek Mar 25, 2024
b63459e
Correct number of tests
ekluzek Mar 25, 2024
296a00e
Remove a bunch of uneeded settings for initial conditions and use_ini…
ekluzek Mar 26, 2024
b01fbb5
Change compilers up for ZDustSoilErod tests a bit, and make sure ther…
ekluzek Mar 26, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -3959,6 +3965,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 @@ -4644,6 +4700,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
Loading
Loading