Skip to content

Commit

Permalink
Merge pull request #1131 from brian-eaton/misc05
Browse files Browse the repository at this point in the history
cam6_4_031: fix issues #1108, #1106, #1058, #1051, #1050; merge PR#1101
  • Loading branch information
nusbaume authored Sep 9, 2024
2 parents 06d91f7 + 1f213cc commit 9f0cb73
Show file tree
Hide file tree
Showing 33 changed files with 392 additions and 1,691 deletions.
68 changes: 13 additions & 55 deletions bld/build-namelist
Original file line number Diff line number Diff line change
Expand Up @@ -764,7 +764,7 @@ if ($rad_pkg =~ /rrtmg/ or $chem =~ /waccm/) {
elsif (!$simple_phys) {

if ($chem eq 'none' and !($prog_species =~ /SO4/) ) { # Spectral solar data is needed for photolysis
# this preserves the default cam3 and cam4 configurations which do not have chemistry
# this preserves the default cam4 configuration which does not have chemistry
unless (defined $nl->get_value('solar_irrad_data_file')) {
add_default($nl, 'solar_const');
}
Expand Down Expand Up @@ -843,17 +843,8 @@ if ($test_tracer_num > 0) {

if ($cfg->get('age_of_air_trcs')) { add_default($nl, 'aoa_tracers_flag', 'val'=>'.true.'); }

# If phys option is "cam3" then turn on the CAM3 prescribed ozone and aerosols
if ($phys eq 'cam3' and !$aqua_mode) {
add_default($nl, 'cam3_ozone_data_on', 'val'=>'.true.');
add_default($nl, 'cam3_aero_data_on', 'val'=>'.true.');
}

# Defaults for radiatively active constituents

my $cam3_ozone_data = $FALSE;
my $cam3_aero_data = $FALSE;

my $moz_ozone_data = $FALSE;
if (!$rad_prog_ozone) {
$moz_ozone_data = $TRUE;
Expand All @@ -864,24 +855,6 @@ if (!($rad_prog_ocarb) or !($rad_prog_bcarb) or !($rad_prog_sulf) or !($rad_prog
$moz_aero_data = $TRUE;
}

# CAM3 prescribed ozone only by request
if (defined $nl->get_value('cam3_ozone_data_on') and
$nl->get_value('cam3_ozone_data_on') =~ /$TRUE/io) {
add_default($nl, 'bndtvo');
$cam3_ozone_data = $TRUE;
$moz_ozone_data = $FALSE;
}

# CAM3 prescribed aerosols only by request
if (defined $nl->get_value('cam3_aero_data_on') and
$nl->get_value('cam3_aero_data_on') =~ /$TRUE/io) {

# CAM3 aerosol mass climatology dataset (horizontal resolution dependent)
add_default($nl, 'bndtvaer');
$cam3_aero_data = $TRUE;
$moz_aero_data = $FALSE;
}

if ($chem_rad_passive or $aqua_mode) {
add_default($nl, 'atm_dep_flux', 'val'=>'.false.');
}
Expand Down Expand Up @@ -930,8 +903,6 @@ if ($rad_prog_ozone) {
add_default($nl, 'prescribed_ozone_type');
add_default($nl, 'prescribed_ozone_cycle_yr');
}
} elsif ($cam3_ozone_data =~ /$TRUE/io) {
$radval .= ",'N:O3:O3'";
} else {
die "ERROR: can not set ozone rad_climate specification\n";
}
Expand Down Expand Up @@ -1118,9 +1089,6 @@ if ($aer_model eq 'mam' ) {
} elsif ($moz_aero_data =~ /$TRUE/io) {
push(@aero_names, "sulf");
push(@aerosources, "N:" );
} elsif ($cam3_aero_data =~ /$TRUE/io) {
push(@aero_names, "cam3_sul" );
push(@aerosources, "N:" );
} else {
die "ERROR: can not set sulf rad_climate specification\n";
}
Expand All @@ -1131,9 +1099,6 @@ if ($aer_model eq 'mam' ) {
} elsif ($moz_aero_data =~ /$TRUE/io) {
push(@aero_names, "dust1", "dust2", "dust3", "dust4");
push(@aerosources, "N:", "N:", "N:", "N:" );
} elsif ($cam3_aero_data =~ /$TRUE/io) {
push(@aero_names, "cam3_dust1", "cam3_dust2", "cam3_dust3", "cam3_dust4" );
push(@aerosources, "N:", "N:", "N:", "N:" );
} else {
die "ERROR: can not set dust rad_climate specification\n";
}
Expand All @@ -1144,9 +1109,6 @@ if ($aer_model eq 'mam' ) {
} elsif ($moz_aero_data =~ /$TRUE/io) {
push(@aero_names, "bcar1", "bcar2");
push(@aerosources, "N:", "N:" );
} elsif ($cam3_aero_data =~ /$TRUE/io) {
push(@aero_names, "cam3_bcpho", "cam3_bcphi");
push(@aerosources, "N:", "N:" );
} else {
die "ERROR: can not set black carbon rad_climate specification\n";
}
Expand All @@ -1157,9 +1119,6 @@ if ($aer_model eq 'mam' ) {
} elsif ($moz_aero_data =~ /$TRUE/io) {
push(@aero_names, "ocar1", "ocar2");
push(@aerosources, "N:", "N:" );
} elsif ($cam3_aero_data =~ /$TRUE/io) {
push(@aero_names, "cam3_ocpho", "cam3_ocphi");
push(@aerosources, "N:", "N:" );
} else {
die "ERROR: can not set organic carbon rad_climate specification\n";
}
Expand All @@ -1180,9 +1139,6 @@ if ($aer_model eq 'mam' ) {
push(@aero_names, "SSLTA", "SSLTC");
push(@aerosources, "N:", "N:");
}
} elsif ($cam3_aero_data =~ /$TRUE/io ) {
push(@aero_names, "cam3_ssam", "cam3_sscm");
push(@aerosources, "N:", "N:" );
} else {
die "ERROR: can not set sslt rad_climate specification\n";
}
Expand All @@ -1203,7 +1159,7 @@ if ( $prescribed_aero_model ne 'none' ) {

# Prescribed aerosol deposition fluxes.
# Not needed if in aquaplanet mode.
if ( (($moz_aero_data =~ /$TRUE/io) or ($cam3_aero_data =~ /$TRUE/io)) and !$aqua_mode ) {
if ( $moz_aero_data =~ /$TRUE/io and !$aqua_mode ) {
# If user has not set aerodep_flx_file, then use defaults
unless (defined $nl->get_value('aerodep_flx_file')) {
my @settings = ('aerodep_flx_datapath', 'aerodep_flx_file', 'aerodep_flx_type',
Expand Down Expand Up @@ -3223,17 +3179,18 @@ if (($chem ne 'none') and ($chem ne 'terminator') and !($chem =~ /geoschem/)) {

# Deep convection scheme
add_default($nl, 'deep_scheme');
my $deep_scheme = $nl->get_value('deep_scheme');

# Aerosol convective processes
if (($phys =~ /cam6/ or $phys =~ /cam7/) and $nl->get_value('deep_scheme') =~ /ZM/) {
if (($phys =~ /cam6/ or $phys =~ /cam7/) and $deep_scheme =~ /ZM/) {
add_default($nl, 'convproc_do_aer', 'val'=>'.true.');
add_default($nl, 'convproc_do_evaprain_atonce', 'val'=>'.true.');
add_default($nl, 'convproc_pom_spechygro', 'val'=>'0.2D0');
add_default($nl, 'convproc_wup_max', 'val'=>'4.0D0');
}

# cam7 specific namelists
if ($phys =~ /cam7/ and $nl->get_value('deep_scheme') =~ /ZM/) {
if ($phys =~ /cam7/ and $deep_scheme =~ /ZM/) {
add_default($nl, 'zmconv_parcel_pbl', 'val'=>'.true.');
} else {
add_default($nl, 'zmconv_parcel_pbl', 'val'=>'.false.');
Expand Down Expand Up @@ -3823,12 +3780,13 @@ if (!$simple_phys) {
add_default($nl, 'gw_rdg_do_divstream' , 'val'=>'.true.');
}

my $use_gw_convect_dp = '.false.';
if ($waccm_phys or
(!$simple_phys and $cfg->get('model_top') eq 'mt')) {
# Spectral gravity waves are part of WACCM physics, and also drive the
# QBO in the high vertical resolution configuration.
add_default($nl, 'use_gw_front' , 'val'=>'.true.');
add_default($nl, 'use_gw_convect_dp', 'val'=>'.true.');
$use_gw_convect_dp = '.true.';
my $hdepth_scaling = '0.25D0' ;
my $qbo_forcing = '.false.';
if ($dyn eq 'fv') {
Expand All @@ -3850,12 +3808,16 @@ if ($waccm_phys or
} elsif ($phys =~ /cam7/) {
# cam7 settings for model_top = 'lt'
add_default($nl, 'use_gw_front' , 'val'=>'.true.');
add_default($nl, 'use_gw_convect_dp', 'val'=>'.true.');
$use_gw_convect_dp = '.true.';
add_default($nl, 'gw_qbo_hdepth_scaling', 'val'=>'1.0D0');
} else {
add_default($nl, 'use_gw_front' , 'val'=>'.false.');
add_default($nl, 'use_gw_convect_dp', 'val'=>'.false.');
}
# Check if deep convection scheme used. If not set use_gw_convect_dp=.false.
if ($deep_scheme =~ /off/) {
$use_gw_convect_dp = '.false.';
}
add_default($nl, 'use_gw_convect_dp', 'val'=>$use_gw_convect_dp);

# We need a lot of logic to use these below, so make flags for them.
my $do_gw_oro = ($nl->get_value('use_gw_oro') =~ /$TRUE/io);
Expand All @@ -3869,10 +3831,6 @@ my $do_gw_rdg_gamma = ($nl->get_value('use_gw_rdg_gamma') =~ /$TRUE/io);

my $do_divstream = ($nl->get_value('gw_rdg_do_divstream') =~ /$TRUE/io);

if (!$simple_phys) {
# GW option used only for backwards compatibility with CAM3.
add_default($nl, 'fcrit2', 'val'=>'1.0');
}
# Mid-scale wavelength settings.
if ($do_gw_front or $do_gw_convect_dp or $do_gw_convect_sh) {
add_default($nl, 'pgwv');
Expand Down
6 changes: 3 additions & 3 deletions bld/config_files/definition.xml
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ Option to turn on waccmx thermosphere/ionosphere extension: 0 => no, 1 => yes
<entry id="ionosphere" valid_values="none,wxie" value="none">
Ionosphere model used in WACCMX.
</entry>
<entry id="phys" valid_values="cam3,cam4,cam5,cam6,cam7,held_suarez,adiabatic,kessler,tj2016,grayrad,spcam_sam1mom,spcam_m2005" value="">
Physics package: cam3, cam4, cam5, cam6, cam7, held_suarez, adiabatic, kessler, tj2016, grayrad, spcam_sam1mom, spcam_m2005.
<entry id="phys" valid_values="cam4,cam5,cam6,cam7,held_suarez,adiabatic,kessler,tj2016,grayrad,spcam_sam1mom,spcam_m2005" value="">
Physics package: cam4, cam5, cam6, cam7, held_suarez, adiabatic, kessler, tj2016, grayrad, spcam_sam1mom, spcam_m2005.
</entry>
<entry id="hemco" valid_values="0,1" value="0">
Switch to turn on Harmonized Emissions Component (HEMCO) for chemistry: 0 => no, 1 => yes.
Expand Down Expand Up @@ -93,7 +93,7 @@ PBL package: uw (University of Washington), hb (Holtslag and Boville), hbr
</entry>
<entry id="rad" valid_values="rrtmgp,rrtmg,camrt,none" value="">
Radiative transfer calculation:
camrt (CAM3 and CAM4 RT package), rrtmg (RRTMG package from AER), rrtmgp (updated version).
camrt (CAM4 RT package), rrtmg (RRTMG package from AER), rrtmgp (updated version).
</entry>
<entry id="carma" valid_values="none,bc_strat,cirrus,cirrus_dust,dust,meteor_impact,meteor_smoke,mixed_sulfate,pmc,pmc_sulfate,sea_salt,sulfate,tholin,test_detrain,test_growth,test_passive,test_radiative,test_swelling,test_tracers,test_tracers2" value="none">
CARMA sectional microphysics:
Expand Down
17 changes: 4 additions & 13 deletions bld/configure
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ OPTIONS
-pbl <name> Specify the PBL option [uw | hb | hbr].
-pcols <n> Set maximum number of columns in a chunk to <n>.
-pergro Switch enables building CAM for perturbation growth tests.
-phys <name> Physics option [cam3 | cam4 | cam5 | cam6 | cam7 |
-phys <name> Physics option [cam4 | cam5 | cam6 | cam7 |
held_suarez | adiabatic | kessler | tj2016 | grayrad
spcam_sam1mom | spcam_m2005]. Default: cam6
-prog_species <list>Comma-separate list of prognostic mozart species packages.
Expand Down Expand Up @@ -602,8 +602,8 @@ if (defined $opts{'chem'}) {
" -chem can only be set to 'none' or 'terminator'.\n";
}
}
elsif ($phys_pkg =~ m/^cam3$|^cam4$|^spcam_sam1mom$/) {
# The modal aerosols are not valid with cam3 or cam4 physics
elsif ($phys_pkg =~ m/^cam4$|^spcam_sam1mom$/) {
# The modal aerosols are not valid with cam4 physics
if ($chem_pkg =~ /_mam/) {
die "configure ERROR: -phys=$phys_pkg -chem=$chem_pkg\n".
" -chem cannot be set to a modal aerosol option.\n";
Expand Down Expand Up @@ -1071,7 +1071,7 @@ if ($unicon and $print>=2) { print "Using UNICON scheme.$eol"; }

# Set default
my $rad_pkg = 'none';
if ($phys_pkg =~ m/cam3|cam4|spcam_sam1mom/) {
if ($phys_pkg =~ m/cam4|spcam_sam1mom/) {
$rad_pkg = 'camrt';
}
elsif ($phys_pkg =~ m/cam5|cam6|cam7|spcam_m2005/) {
Expand Down Expand Up @@ -1102,12 +1102,6 @@ if ($rad_pkg eq 'camrt') {
}
elsif ($rad_pkg =~ m/rrtmg/) {

# The rrtmg package doesn't work with the CAM3 prescribed aerosols
if ($phys_pkg eq 'cam3') {
die "configure ERROR: radiation package: $rad_pkg is not compatible\n".
" with physics package $phys_pkg\n";
}

# RRTMGP not currently working with CARMA
if ($rad_pkg eq 'rrtmgp' and $carma_pkg ne 'none') {
die "configure ERROR: The CARMA microphysics package does not currently work with RRTMGP\n";
Expand Down Expand Up @@ -1371,9 +1365,6 @@ elsif ($phys_pkg eq 'cam5' or $phys_pkg eq 'spcam_m2005') {
elsif ($phys_pkg eq 'cam4' or $phys_pkg eq 'spcam_sam1mom') {
$nlev = 26;
}
elsif ($phys_pkg eq 'cam3') {
$nlev = 26;
}
else {
# This will be used for Held-Suarez and other 'simple' physics
# We may change this to 32 once IC files are available.
Expand Down
14 changes: 0 additions & 14 deletions bld/namelist_files/namelist_defaults_cam.xml
Original file line number Diff line number Diff line change
Expand Up @@ -393,19 +393,6 @@

<!-- Bulk aerosol physical properties (includes optics) -->

<!-- CAM3 Bulk aerosols. Optics for CAM-RT -->
<bam_cam3_sul rad="camrt">atm/cam/physprops/sul_cam3_c080918.nc</bam_cam3_sul>
<bam_cam3_dust1 rad="camrt">atm/cam/physprops/dustv1b1_cam3_c080918.nc</bam_cam3_dust1>
<bam_cam3_dust2 rad="camrt">atm/cam/physprops/dustv1b2_cam3_c080918.nc</bam_cam3_dust2>
<bam_cam3_dust3 rad="camrt">atm/cam/physprops/dustv1b3_cam3_c080918.nc</bam_cam3_dust3>
<bam_cam3_dust4 rad="camrt">atm/cam/physprops/dustv1b4_cam3_c080918.nc</bam_cam3_dust4>
<bam_cam3_bcpho rad="camrt">atm/cam/physprops/bcpho_cam3_c080918.nc</bam_cam3_bcpho>
<bam_cam3_bcphi rad="camrt">atm/cam/physprops/bcphi_cam3_c080918.nc</bam_cam3_bcphi>
<bam_cam3_ocpho rad="camrt">atm/cam/physprops/ocpho_cam3_c080918.nc</bam_cam3_ocpho>
<bam_cam3_ocphi rad="camrt">atm/cam/physprops/ocphi_cam3_c080918.nc</bam_cam3_ocphi>
<bam_cam3_ssam rad="camrt">atm/cam/physprops/ssam_cam3_c080918.nc</bam_cam3_ssam>
<bam_cam3_sscm rad="camrt">atm/cam/physprops/sscm_cam3_c080918.nc</bam_cam3_sscm>

<!-- CAM-Chem bulk aerosols (different aerosol names used in prescribed and prognostic modes) -->
<!-- Optics for CAM-RT -->
<bam_sulf rad="camrt">atm/cam/physprops/sulfate_camrt_c080918.nc</bam_sulf>
Expand Down Expand Up @@ -2936,7 +2923,6 @@
<cldsed_ice_stokes_fac hgrid="1.9x2.5" phys="cam4" > 0.5D0 </cldsed_ice_stokes_fac>

<!-- FV dycore -->
<fv_fft_flt phys="cam3" >0</fv_fft_flt>
<fv_fft_flt >1</fv_fft_flt>

<fv_div24del2flag > 2</fv_div24del2flag>
Expand Down
49 changes: 2 additions & 47 deletions bld/namelist_files/namelist_definition.xml
Original file line number Diff line number Diff line change
Expand Up @@ -476,20 +476,6 @@
Default: none
</entry>

<!-- Aerosols: Data (CAM version) -->

<entry id="bndtvaer" type="char*256" input_pathname="abs" category="aero_data_cam"
group="cam3_aero_data_nl" valid_values="" >
Full pathname of time-variant boundary dataset for aerosol masses.
Default: set by build-namelist.
</entry>

<entry id="cam3_aero_data_on" type="logical" category="aero_data_cam"
group="cam3_aero_data_nl" valid_values="" >
Add CAM3 prescribed aerosols to the physics buffer.
Default: FALSE
</entry>

<!-- Physics grid decomp including physics dynamics coupling methods -->

<entry id="phys_alltoall" type="integer" category="perf_dp_coup"
Expand Down Expand Up @@ -685,8 +671,7 @@ Default: 0

<entry id="fv_fft_flt" type="integer" category="dyn_fv"
group="dyn_fv_inparm" valid_values="0,1" >
1 for FFT filter always, 0 for combined algebraic/FFT filter. The value 0
is used for CAM3, otherwise it is using the value 1.
1 for FFT filter always, 0 for combined algebraic/FFT filter.
Default: set by build-namelist
</entry>

Expand Down Expand Up @@ -1495,12 +1480,6 @@ Full pathname of boundary dataset for meso-gamma ridges.
Default: set by build-namelist.
</entry>

<entry id="fcrit2" type="real" category="gw_drag"
group="gw_drag_nl" valid_values="" >
Critical Froude number squared (used only for orographic waves).
Default: set by build-namelist.
</entry>

<entry id="gw_oro_south_fac" type="real" category="gw_drag"
group="gw_drag_nl" valid_values="" >
Factor to multiply tau by, for orographic waves in the southern hemisphere.
Expand Down Expand Up @@ -4913,30 +4892,6 @@ Specifies the name of the sea salt emission parameterization.
Default: Gong
</entry>


=======
<!-- Ozone: Data (original CAM version) -->

<entry id="bndtvo" type="char*256" input_pathname="abs" category="o3_data_cam"
group="cam3_ozone_data_nl" valid_values="" >
Full pathname of time-variant ozone mixing ratio boundary dataset.
Default: set by build-namelist.
</entry>

<entry id="cam3_ozone_data_on" type="logical" category="o3_data_cam"
group="cam3_ozone_data_nl" valid_values="" >
Add CAM3 prescribed ozone to the physics buffer.
Default: FALSE
</entry>

<entry id="ozncyc" type="logical" category="o3_data_cam"
group="cam3_ozone_data_nl" valid_values="" >
Flag for yearly cycling of ozone data. If set to FALSE, a multi-year
dataset is assumed, otherwise a single-year dataset is assumed, and ozone
will be cycled over the 12 monthly averages in the file.
Default: TRUE
</entry>

<!-- Performance Tuning and Profiling -->

<entry id="papi_ctr1_str" type="char*16" category="performance"
Expand Down Expand Up @@ -5070,7 +5025,7 @@ Default: TRUE
<!-- Physics control -->

<entry id="cam_physpkg" type="char*16" category="build"
group="phys_ctl_nl" valid_values="cam3,cam4,cam5,cam6,adiabatic,held_suarez,kessler,frierson" >
group="phys_ctl_nl" valid_values="cam4,cam5,cam6,adiabatic,held_suarez,kessler,frierson" >
Name of the CAM physics package. N.B. this variable may not be set by
the user. It is set by build-namelist via information in the configure
cache file to be consistent with how CAM was built.
Expand Down
Loading

0 comments on commit 9f0cb73

Please sign in to comment.