Skip to content

Commit

Permalink
Change defaults for use_lch4 and use_nitrif_denitrif to be false if s…
Browse files Browse the repository at this point in the history
…oil_decomp_method is None, and otherwise TRUE which means it will normally be true when FATES is on fixing ESCOMP#1465
  • Loading branch information
ekluzek committed Sep 20, 2021
1 parent b02907c commit 1e2729f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
11 changes: 6 additions & 5 deletions bld/CLMBuildNamelist.pm
Original file line number Diff line number Diff line change
Expand Up @@ -870,12 +870,13 @@ sub setup_cmdl_bgc {
my $var = "soil_decomp_method";
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, $var,
'phys'=>$nl_flags->{'phys'}, 'use_cn'=>$nl_flags->{'use_cn'}, 'use_fates'=>$nl_flags->{'use_fates'} );
my $soil_decomp_method = remove_leading_and_trailing_quotes( $nl->get_value( $var ) );

if ( &value_is_true($nl_flags->{'use_cn'}) || &value_is_true($nl_flags->{'use_fates'})) {
if ( remove_leading_and_trailing_quotes( $nl->get_value($var)) eq "None" ) {
if ( $soil_decomp_method eq "None" ) {
$log->fatal_error("$var must NOT be None if use_cn or use_fates are on");
}
} elsif ( remove_leading_and_trailing_quotes($nl->get_value($var)) ne "None" ) {
} elsif ( $soil_decomp_method ne "None" ) {
$log->fatal_error("$var must be None if use_cn or use_fates are not");
}
#
Expand All @@ -885,13 +886,13 @@ sub setup_cmdl_bgc {
my %settings = ( 'bgc_mode'=>$nl_flags->{'bgc_mode'} );
foreach my $var ( @list ) {
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, $var,
'phys'=>$nl_flags->{'phys'}, 'use_cn'=>$nl_flags->{'use_cn'}, 'use_fates'=>$nl_flags->{'use_fates'} );
'phys'=>$nl_flags->{'phys'}, 'soil_decomp_method'=>$soil_decomp_method );
$nl_flags->{$var} = $nl->get_value($var);
}
if ( remove_leading_and_trailing_quotes( $nl->get_value($var)) eq "None" ) {
if ( $soil_decomp_method eq "None" ) {
foreach my $var ( @list ) {
if ( &value_is_true($nl_flags->{$var}) ) {
$log->fatal_error("When soil_decomp_method is NONE $var can NOT be TRUE");
$log->fatal_error("When soil_decomp_method is None $var can NOT be TRUE");
}
}
} else {
Expand Down
11 changes: 5 additions & 6 deletions bld/namelist_files/namelist_defaults_ctsm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2527,15 +2527,14 @@ lnd/clm2/surfdata_map/release-clm5.0.30/surfdata_ne0np4.CONUS.ne30x8_hist_78pfts
<!-- Defaults for different BGC modes -->
<!-- ========================================= -->

<use_lch4 >.false.</use_lch4>
<use_lch4 use_cn=".true." >.true.</use_lch4>
<use_lch4 use_fates=".true." >.false.</use_lch4>
<soil_decomp_method use_cn=".true." >CENTURYKoven2013</soil_decomp_method>
<soil_decomp_method use_fates=".true." >CENTURYKoven2013</soil_decomp_method>
<soil_decomp_method >None</soil_decomp_method>
<use_nitrif_denitrif >.false.</use_nitrif_denitrif>
<use_nitrif_denitrif use_cn=".true." >.true.</use_nitrif_denitrif>
<use_nitrif_denitrif use_fates=".true.">.false.</use_nitrif_denitrif>

<use_lch4 soil_decomp_method="None" >.false.</use_lch4>
<use_lch4 >.true.</use_lch4>
<use_nitrif_denitrif soil_decomp_method="None" >.false.</use_nitrif_denitrif>
<use_nitrif_denitrif >.true.</use_nitrif_denitrif>

<!-- ===== FATES DEFAULTS =========== -->
<fates_spitfire_mode use_fates=".true.">0</fates_spitfire_mode>
Expand Down

0 comments on commit 1e2729f

Please sign in to comment.