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

Wrap up v3alpha04 configuration #5973

Merged
merged 5 commits into from
Oct 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 2 additions & 0 deletions components/eam/bld/build-namelist
Original file line number Diff line number Diff line change
Expand Up @@ -791,6 +791,8 @@ if ( (($chem ne 'none') && ($chem ne 'spa')) or ( $prog_species ) ){
add_default($nl, 'clim_soilw_file' );
add_default($nl, 'season_wes_file' );
}

add_default($nl, 'lght_no_prd_factor' );
}

# Initial conditions
Expand Down
8 changes: 5 additions & 3 deletions components/eam/bld/namelist_files/namelist_defaults_eam.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1862,13 +1862,15 @@ with se_tstep, dt_remap_factor, dt_tracer_factor set to -1
<clubb_C14 phys="default"> 2.5D0 </clubb_C14>
<clubb_tk1 phys="default"> 268.15D0 </clubb_tk1>
<dust_emis_fact phys="default"> 12.8D0 </dust_emis_fact>
<linoz_psc_T > 198.0 </linoz_psc_T>
<linoz_psc_T > 198.0D0 </linoz_psc_T>
<lght_no_prd_factor > 5.0D0 </lght_no_prd_factor>
<micro_mincdnc phys="default" microphys="mg2"> 10.D6 </micro_mincdnc>
<nucleate_ice_subgrid phys="default" clubb_sgs="1" microphys="p3" >1.35D0</nucleate_ice_subgrid>
<sscav_tuning phys="default" microphys="p3">.false.</sscav_tuning>
<p3_mincdnc phys="default" microphys="p3"> 20.D6 </p3_mincdnc>
<p3_wbf_coeff phys="default" clubb_sgs="1" microphys="p3"> 1.0 </p3_wbf_coeff>
<p3_nc_autocon_expon phys="default" clubb_sgs="1" microphys="p3"> -1.20D0 </p3_nc_autocon_expon>
<p3_nc_autocon_expon phys="default" clubb_sgs="1" microphys="p3"> -1.10D0 </p3_nc_autocon_expon>
<n_so4_monolayers_pcage phys="default" clubb_sgs="1" microphys="p3"> 3.0D0 </n_so4_monolayers_pcage>
<clubb_C1 phys="default"> 2.4 </clubb_C1>
<clubb_C11 phys="default"> 0.70 </clubb_C11>
<clubb_C11b phys="default"> 0.20 </clubb_C11b>
Expand All @@ -1892,7 +1894,7 @@ with se_tstep, dt_remap_factor, dt_tracer_factor set to -1
<seasalt_emis_scale phys="default" chem="linoz_mam4_resus_mom_soag"> 0.6D0 </seasalt_emis_scale>
<seasalt_emis_scale phys="default" chem="superfast_mam4_resus_mom_soag"> 0.6D0 </seasalt_emis_scale>
<seasalt_emis_scale phys="default" chem="chemuci_linozv3_mam5_vbs"> 0.55D0 </seasalt_emis_scale>
<dms_emis_scale phys="default"> 1.0D0 </dms_emis_scale>
<dms_emis_scale phys="default"> 2.0D0 </dms_emis_scale>
<zmconv_trigdcape_ull phys="default"> .true. </zmconv_trigdcape_ull>
<zmconv_c0_lnd phys="default" clubb_sgs="1" microphys="p3"> 0.0020D0 </zmconv_c0_lnd>
<zmconv_c0_ocn phys="default" clubb_sgs="1" microphys="p3"> 0.0020D0 </zmconv_c0_ocn>
Expand Down
50 changes: 50 additions & 0 deletions components/elm/bld/ELMBuildNamelist.pm
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,9 @@ OPTIONS
-vichydro Toggle to turn on VIC hydrologic parameterizations (default is off)
This turns on the namelist variable: use_vichydro
-betr_mode Turn on betr model for tracer transport in soil. [on|off] default is off.
-solar_rad_scheme "value" Type of solar radiation scheme
pp = Plane-Parallel
top = Subgrid topographic parameterization


Note: The precedence for setting the values of namelist variables is (highest to lowest):
Expand Down Expand Up @@ -305,6 +308,7 @@ sub process_commandline {
nutrient => "default",
nutrient_comp_pathway => "default",
soil_decomp => "default",
solar_rad_scheme => "default",
);

GetOptions(
Expand Down Expand Up @@ -356,6 +360,7 @@ sub process_commandline {
"nutrient=s" => \$opts{'nutrient'},
"nutrient_comp_pathway=s" => \$opts{'nutrient_comp_pathway'},
"soil_decomp=s" => \$opts{'soil_decomp'},
"solar_rad_scheme=s" => \$opts{'solar_rad_scheme'},
) or usage();

# Give usage message.
Expand Down Expand Up @@ -679,6 +684,7 @@ sub process_namelist_commandline_options {
setup_cmdl_bgc_spinup($opts, $nl_flags, $definition, $defaults, $nl, $cfg, $physv);
setup_cmdl_vichydro($opts, $nl_flags, $definition, $defaults, $nl, $physv);
setup_cmdl_betr_mode($opts, $nl_flags, $definition, $defaults, $nl, $physv);
setup_cmdl_solar_rad_scheme($opts, $nl_flags, $definition, $defaults, $nl, $cfg, $physv);
}

#-------------------------------------------------------------------------------
Expand Down Expand Up @@ -1089,6 +1095,50 @@ sub setup_cmdl_methane {

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

sub setup_cmdl_solar_rad_scheme {

my ($opts, $nl_flags, $definition, $defaults, $nl, $cfg, $physv) = @_;

my $var = "solar_rad_scheme";
my $val;

# If "-solar_rad_scheme pp" or "-solar_rad_scheme" is unspecified, then
# we will set "use_top_solar_rad = .false."
if ( $opts->{$var} eq "pp" || $opts->{$var} eq "default" ) {
$val = ".false.";
} else {
# For "-solar_rad_scheme top", set "use_top_solar_rad = .true."
if ( $opts->{$var} eq "top" ) {
$val = ".true.";
} else {
fatal_error("The -solar_rad_scheme $opts->{'solar_rad_scheme'} is unknown");
}
}

my $var='use_top_solar_rad';
# Check if the value of use_top_solar_rad based on above alogrithm does not match the
# value of use_top_solar_rad in user_nl_elm
if (defined($nl->get_value($var)) && $nl->get_value($var) ne $val) {

# If "-solar_rad_scheme <pp|top>" was not specified, then simply use the value
# that was specified in the "user_nl_elm".
if ($opts->{'solar_rad_scheme'} eq "default") {
$val = $nl->get_value($var);
} else {
# Otherwise report an error
my $namelist_value = $nl->get_value('use_top_solar_rad');
fatal_error("$var = $namelist_value, which is inconsistent with the commandline setting of -solar_rad_scheme $opts->{'solar_rad_scheme'}");
}
}

# Lastly, define the value of use_top_solar_rad
my $group = $definition->get_group_name($var);
$nl->set_variable_value($group, $var, $val);

}

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

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

Expand Down
2 changes: 2 additions & 0 deletions components/elm/cime_config/config_component.xml
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,9 @@
<values>
<value compset="%CNCR" >-ignore_ic_year</value> <!-- ERROR: Never matched, see bug 2025 -->
<value compset="_ELM%[^_]*SP" >-bgc sp</value>
<value compset="_ELM%[^_]*TOP" >-solar_rad_scheme top</value>
<value compset="_ELM%[^_]*SPBC" >-bgc sp</value>
<value compset="_EAM%CMIP6_ELM%[^_]*SPBC" >-bgc sp -solar_rad_scheme top</value>
<value compset="_ELM%[^_]*CN" >-bgc cn</value>
<value compset="_ELM%[^_]*BGC" >-bgc bgc</value>
<value compset="_ELM%[^_]*CN-CROP" >-bgc cn -crop</value>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4689,7 +4689,7 @@ subroutine compute_barycenter_coordinates(&
cxxx, cxxy, cxyy, cyyy, &
cxxxx, cxxxy, cxxyy, cxyyy, cyyyy

real(kind=RKIND) :: massTracerProd
real(kind=RKIND) :: reciprocal, massTracerProd

! compute the barycenter coordinates, depending on how many tracer types were passed in
! Note: These formulas become more complex as the tracer hierarchy deepens. See the model documentation for details.
Expand All @@ -4706,18 +4706,18 @@ subroutine compute_barycenter_coordinates(&
c0 = center0
cx = xGrad0
cy = yGrad0

xBarycenter = 0.0_RKIND
yBarycenter = 0.0_RKIND
if (abs(mean0) > 0.0_RKIND) then
xBarycenter = (c0 * geomAvgCell % x (iCell) &
+ cx * geomAvgCell % xx(iCell) + cy * geomAvgCell % xy(iCell)) &
/ mean0
yBarycenter = (c0 * geomAvgCell % y (iCell) &
+ cx * geomAvgCell % xy(iCell) + cy * geomAvgCell % yy(iCell)) &
/ mean0
reciprocal = 1.0_RKIND / mean0
else
reciprocal = 0.0_RKIND
endif

xBarycenter = (c0 * geomAvgCell % x (iCell) &
+ cx * geomAvgCell % xx(iCell) + cy * geomAvgCell % xy(iCell)) &
* reciprocal
yBarycenter = (c0 * geomAvgCell % y (iCell) &
+ cx * geomAvgCell % xy(iCell) + cy * geomAvgCell % yy(iCell)) &
* reciprocal

elseif (.not.present(mean2)) then

Expand All @@ -4730,20 +4730,22 @@ subroutine compute_barycenter_coordinates(&
cxy = xGrad0 * yGrad1 + yGrad0 * xGrad1
cyy = yGrad0 * yGrad1

xBarycenter = 0.0_RKIND
yBarycenter = 0.0_RKIND
massTracerProd = mean0 * mean1
if (abs(massTracerProd) > 0.0_RKIND) then
xBarycenter = (c0 * geomAvgCell % x (iCell) &
+ cx * geomAvgCell % xx (iCell) + cy * geomAvgCell % xy (iCell) &
+ cxx * geomAvgCell % xxx(iCell) + cxy * geomAvgCell % xxy(iCell) + cyy * geomAvgCell % xyy(iCell)) &
/ massTracerProd
yBarycenter = (c0 * geomAvgCell % y (iCell) &
+ cx * geomAvgCell % xy (iCell) + cy * geomAvgCell % yy (iCell) &
+ cxx * geomAvgCell % xxy(iCell) + cxy * geomAvgCell % xyy(iCell) + cyy * geomAvgCell % yyy(iCell)) &
/ massTracerProd
reciprocal = 1.0_RKIND / massTracerProd
else
reciprocal = 0.0_RKIND
endif

xBarycenter = (c0 * geomAvgCell % x (iCell) &
+ cx * geomAvgCell % xx (iCell) + cy * geomAvgCell % xy (iCell) &
+ cxx * geomAvgCell % xxx(iCell) + cxy * geomAvgCell % xxy(iCell) + cyy * geomAvgCell % xyy(iCell)) &
* reciprocal
yBarycenter = (c0 * geomAvgCell % y (iCell) &
+ cx * geomAvgCell % xy (iCell) + cy * geomAvgCell % yy (iCell) &
+ cxx * geomAvgCell % xxy(iCell) + cxy * geomAvgCell % xyy(iCell) + cyy * geomAvgCell % yyy(iCell)) &
* reciprocal

else ! mass field, tracer1 and tracer2 are all present

! barycenter = center of mass*tracer1*tracer2
Expand All @@ -4760,24 +4762,26 @@ subroutine compute_barycenter_coordinates(&
cxyy = yGrad0 * yGrad1 * xGrad2 + yGrad0 * xGrad1 * yGrad2 + xGrad0 * yGrad1 * yGrad2
cyyy = yGrad0 * yGrad1 * yGrad2

xBarycenter = 0.0_RKIND
yBarycenter = 0.0_RKIND
massTracerProd = mean0 * mean1 * mean2
if (abs(massTracerProd) > 0.0_RKIND) then
xBarycenter = (c0 * geomAvgCell % x (iCell) &
+ cx * geomAvgCell % xx (iCell) + cy * geomAvgCell % xy (iCell) &
+ cxx * geomAvgCell % xxx (iCell) + cxy * geomAvgCell % xxy (iCell) + cyy * geomAvgCell % xyy (iCell) &
+ cxxx * geomAvgCell % xxxx(iCell) + cxxy * geomAvgCell % xxxy(iCell) + cxyy * geomAvgCell % xxyy(iCell) &
+ cyyy * geomAvgCell % xyyy(iCell)) &
/ massTracerProd
yBarycenter = (c0 * geomAvgCell % y (iCell) &
+ cx * geomAvgCell % xy (iCell) + cy * geomAvgCell % yy (iCell) &
+ cxx * geomAvgCell % xxy (iCell) + cxy * geomAvgCell % xyy (iCell) + cyy * geomAvgCell % yyy (iCell) &
+ cxxx * geomAvgCell % xxxy(iCell) + cxxy * geomAvgCell % xxyy(iCell) + cxyy * geomAvgCell % xyyy(iCell) &
+ cyyy * geomAvgCell % yyyy(iCell)) &
/ massTracerProd
reciprocal = 1.0_RKIND / massTracerProd
else
reciprocal = 0.0_RKIND
endif

xBarycenter = (c0 * geomAvgCell % x (iCell) &
+ cx * geomAvgCell % xx (iCell) + cy * geomAvgCell % xy (iCell) &
+ cxx * geomAvgCell % xxx (iCell) + cxy * geomAvgCell % xxy (iCell) + cyy * geomAvgCell % xyy (iCell) &
+ cxxx * geomAvgCell % xxxx(iCell) + cxxy * geomAvgCell % xxxy(iCell) + cxyy * geomAvgCell % xxyy(iCell) &
+ cyyy * geomAvgCell % xyyy(iCell)) &
* reciprocal
yBarycenter = (c0 * geomAvgCell % y (iCell) &
+ cx * geomAvgCell % xy (iCell) + cy * geomAvgCell % yy (iCell) &
+ cxx * geomAvgCell % xxy (iCell) + cxy * geomAvgCell % xyy (iCell) + cyy * geomAvgCell % yyy (iCell) &
+ cxxx * geomAvgCell % xxxy(iCell) + cxxy * geomAvgCell % xxyy(iCell) + cxyy * geomAvgCell % xyyy(iCell) &
+ cyyy * geomAvgCell % yyyy(iCell)) &
* reciprocal

endif

end subroutine compute_barycenter_coordinates
Expand Down